Commit ec00a0a0 authored by pengguangpu's avatar pengguangpu

添加日结本地写死数据打印;

parent 91e88fcb
...@@ -66,3 +66,6 @@ export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING"; ...@@ -66,3 +66,6 @@ export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING";
//结算页面back到扫商品页面 //结算页面back到扫商品页面
export const ACTION_BALANCE_BACK_GOODS = "ACTION_BALANCE_BACK_GOODS"; export const ACTION_BALANCE_BACK_GOODS = "ACTION_BALANCE_BACK_GOODS";
//打印日结订单
export const ACTION_DAY_CHECK = "ACTION_DAY_CHECK";
\ No newline at end of file
...@@ -9,7 +9,7 @@ import { ...@@ -9,7 +9,7 @@ import {
ACTION_DIRECT_PAYMENT, ACTION_CONVERT_COUPON, ACTION_DIRECT_PAYMENT, ACTION_CONVERT_COUPON,
ACTION_GO_HOME, ACTION_REFUND, ACTION_REFUND_FAILED, ACTION_GO_HOME, ACTION_REFUND, ACTION_REFUND_FAILED,
ACTION_REFUND_SUCCESS, ACTION_PRINT_LAST_ORDER, ACTION_REFUND_SUCCESS, ACTION_PRINT_LAST_ORDER,
ACTION_SYSTEM_SETTING, ACTION_SYSTEM_SETTING,ACTION_DAY_CHECK
} from '../../const/actioncmd' } from '../../const/actioncmd'
...@@ -173,6 +173,9 @@ Page({ ...@@ -173,6 +173,9 @@ Page({
context.setData({ context.setData({
toSetting: true, toSetting: true,
}) })
} else if (res.action == ACTION_DAY_CHECK) {
//本地先写死数据
context.printDayCheck();
} }
} }
}); });
...@@ -199,6 +202,50 @@ Page({ ...@@ -199,6 +202,50 @@ Page({
} }
}, },
/**
* 打印
*/
printDayCheck() {
var printer = require("../../utils/printer.js");
var cmds = [
printer.setAlign(printer.ALIGN_CENTER),
printer.printText('日结订单'),
printer.printText(getApp().globalData.localAccountInfo.storeName),
printer.setAlign(printer.ALIGN_LEFT),
//打印日期
printer.printNowDate(),
//门店号
printer.printText("门店号:"+getApp().globalData.localAccountInfo.storeName),
//收款总额
printer.printText('收款总额:10.00元'),
printer.feedPaper(),
printer.feedPaper(),
printer.feedPaper(),
printer.feedPaper(),
];
printer.print({
isCheckStatus: getApp().globalData.containerVersionCode > 20,
cmds: cmds,
callback: (res) => {
//发送给后屏,告知打印结果
my.ix.sendBuddyMessage({
// 填入目标小程序的 AppID
target: getApp().globalData.backScreenAppId,
data: {
action: ACTION_DAY_CHECK,
data: res
},
success: (res) => {
console.info(`sendBuddyMessage success: ${JSON.stringify(res)}`);
},
fail: (res) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
}
});
}
});
},
/**返回当前选中广告 */ /**返回当前选中广告 */
returnCurShowAd() { returnCurShowAd() {
let context = this; let context = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment