修复提示bug和网络异常打印bug

main
chenjf 2 years ago
parent afbdbbfd6d
commit b554371822

@ -16,7 +16,7 @@
"type" : "uniCloud"
},
{
"playground" : "custom",
"playground" : "standard",
"type" : "uni-app:app-android"
}
]

@ -29,7 +29,7 @@
import scanCode from "@/components/scan-code/scan-code.vue";
import { getCLodop } from '@/common/print/CLodopfuncs.js';
const printPdf = uni.requireNativePlugin('YanYu-PrintPDF');
const LODOP = getCLodop();
export default {
data() {
return {
@ -83,12 +83,14 @@
// //LODOP.ADD_PRINT_HTM(10, 20, "100mm", "150mm", "<img src="+this.imageData+" style=\"width: 100mm; height: 100mm;\"/>");
// LODOP.ADD_PRINT_PDF(0, 0, "100mm", "150mm", this.imgePdfData);
// LODOP.PRINT();
uni.request({
url: this.httpRoot + this.ilsApi + '/jeecg-boot/front/getOrderPayStateAndPdfBase64?OrderId=' + orderCoder,
method: 'GET',
success: (res) => {
console.log( res.data.result);
if(res.data.code==200){
let LODOP = getCLodop();
LODOP.PRINT_INIT(null, this.printIp);
LODOP.SET_PRINTER_INDEX(-1);
LODOP.PRINT_INITA(2, 0, "100mm", "150mm", "100X150");
@ -99,18 +101,18 @@
LODOP.PRINT();
uni.showToast({
title: '面单下发成功.正在打印,请稍候...',
icon: 'success',
icon: 'none',
duration: 3000
});
}else{
uni.showToast({
title: '面单获取异常,打印失败',
title: res.data.message,
icon: 'none',
duration: 3000
})
}
},
fail: () => {
fail: (error) => {
uni.showToast({
title: '接口访问异常,打印失败',
icon: 'none',
@ -137,6 +139,7 @@
success: (res) => {
console.log( res.data.result);
if(res.data.code==200){
let LODOP = getCLodop();
LODOP.PRINT_INIT(null, _this.printIp);
LODOP.SET_PRINTER_INDEX(-1);
LODOP.PRINT_INITA(2, 0, "100mm", "150mm", "100X150");
@ -147,18 +150,19 @@
LODOP.PRINT();
uni.showToast({
title: '下发成功.正在打印,请稍候...',
icon: 'success',
icon: 'none',
duration: 3000
});
}else{
uni.showToast({
title: '面单获取异常,打印失败',
title: res.data.message,
icon: 'none',
duration: 3000
})
}
},
fail: () => {
fail: (error) => {
console.log("error: ", error);
uni.showToast({
title: '接口访问异常,打印失败',
icon: 'none',

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save