Commit cbd714e3 authored by pengguangpu's avatar pengguangpu

添加日结相关逻辑;

parent e9be6be4
......@@ -67,6 +67,8 @@ export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING";
//结算页面回到扫商品页面
export const ACTION_BALANCE_BACK_GOODS = "ACTION_BALANCE_BACK_GOODS";
//日结打印
export const ACTION_DAY_CHECK = "ACTION_DAY_CHECK";
const FLOW_IDLE = "idle";
const FLOW_COLLECTIONS = "collections";//收款
......
......@@ -7,7 +7,7 @@ import {
ACTION_DIRECT_PAYMENT, ACTION_CONVERT_COUPON, ACTION_LOGIN_OK,
ACTION_REFUND, ACTION_REFUND_SUCCESS, ACTION_REFUND_FAILED,
ACTION_PRINT_LAST_ORDER, ACTION_GET_CUR_AD, ACTION_SEND_SEL_AD,
ACTION_SYSTEM_SETTING,ACTION_BALANCE_BACK_GOODS,
ACTION_SYSTEM_SETTING,ACTION_BALANCE_BACK_GOODS,ACTION_DAY_CHECK
} from '../../const/actioncmd'
import { FLOW_IDLE, FLOW_COLLECTIONS, FLOW_REFUND, FLOW_DIRECT_PAYMENT } from '../../const/actioncmd'
......@@ -16,18 +16,18 @@ Page({
data: {
//页面控制相关参数
pageShow: {
"home": false,
"home": true,
"landscan": false,
"waitoperate": false,
"payresult": false,
"operateresult": false,
"printlastorder": false,
"poster": true,
"poster": false,
"aboutsystem": false,
"appsetting": false,
},
// 前屏是否完成登录
isFrontScreenLoginOK: true,
isFrontScreenLoginOK: false,
flowType: "", //流程类型:用于区分易混淆的流程,以及共同界面使用时用该标识位作为区分
/**账号信息 */
......@@ -319,6 +319,16 @@ Page({
}else if(res.action == ACTION_BALANCE_BACK_GOODS){
//结算页面回到扫商品页面
context.goPage('landscan');
}else if(res.action ==ACTION_DAY_CHECK){
//收到日结处理回调
var printDayCheckResult = res.data;
if(printDayCheckResult.code==0){
//打印成功
my.showToast({content:"打印成功"});
}else{
//打印失败
my.showToast({content:"打印失败"});
}
}
}
});
......@@ -472,7 +482,22 @@ Page({
/**日结 */
onHomeDayCheckClicked() {
//发送打印日结订单到前屏
my.ix.sendBuddyMessage({
// 填入目标小程序的 AppID
target: getApp().globalData.frontScreenAppId,
data: {
action: ACTION_DAY_CHECK,
data: null
},
success: (res) => {
console.info(`sendBuddyMessage success: ${JSON.stringify(res)}`);
my.showToast({content:"正在打印中"});
},
fail: (res) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
}
});
},
/**关于系统(实际上是关于应用) */
......
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