Commit eceb2b04 authored by jiangjiantao's avatar jiangjiantao

bugfixed

parents bf1a847f cab5fb70
......@@ -67,14 +67,28 @@ 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";
//核验
export const ACTION_VERIFY = "ACTION_VERIFY";
//核验成功
export const ACTION_VERIFY_SUCCESS = "ACTION_VERIFY_SUCCESS";
//核验失败
export const ACTION_VERIFY_FAILED = "ACTION_VERIFY_FAILED";
//提货
export const ACTION_PICK_UP_GOODS = "ACTION_PICK_UP_GOODS";
const FLOW_IDLE = "idle";
const FLOW_COLLECTIONS = "collections";//收款
const FLOW_REFUND = "refund";//退款
const FLOW_DIRECT_PAYMENT = "direct_payment"
const FLOW_DIRECT_PAYMENT = "direct_payment"//直接收款
const FLOW_VERIFY = "verify";//核验
export {
FLOW_IDLE,FLOW_COLLECTIONS,FLOW_REFUND,FLOW_DIRECT_PAYMENT
FLOW_IDLE, FLOW_COLLECTIONS, FLOW_REFUND, FLOW_DIRECT_PAYMENT, FLOW_VERIFY
}
......@@ -698,6 +698,8 @@
position: relative;
width: 47.2%;
height: 100%;
margin-left: auto;
margin-right: auto;
align-items: center;
background: #ffffff;
}
......
......@@ -273,7 +273,7 @@
</view>
<!-- 界面主体 -->
<view class="bodyContainer">
<view class="leftBody">
<view class="leftBody" hidden="{{waitOperateHideLeft}}">
<view class="contentLine" style="margin-top:29rpx;" hidden="{{flowType!='collections'}}">
<view class="descText">合计金额:</view>
<view class="totalPrice">¥{{totalPrice}}</view>
......@@ -461,8 +461,8 @@
<view class="operateResultText">{{operateSuccessRemind}}</view>
<view class="operateResultDesc">{{operateSuccessDesc}}</view>
<view class="operateResultBtnContainer">
<view class="operateResultConfirmBtn">
<view class="operateResultConfirmBtnText" onTap="operateResultClose">确定</view>
<view class="operateResultConfirmBtn" onTap="operateResultClose">
<view class="operateResultConfirmBtnText">确定</view>
</view>
</view>
</block>
......@@ -471,11 +471,11 @@
<view class="operateResultText">{{operateFailedRemind}}</view>
<view class="operateResultDesc">{{operateFailedDesc}}</view>
<view class="operateResultBtnContainer">
<view class="operateResultCloseBtn">
<view class="operateResultCloseBtnText" onTap="operateResultClose">关闭</view>
<view class="operateResultCloseBtn" onTap="operateResultClose">
<view class="operateResultCloseBtnText">关闭</view>
</view>
<view class="operateResultConfirmBtn">
<view class="operateResultConfirmBtnText" onTap="operateResultReOperate">{{operateReDo}}</view>
<view class="operateResultConfirmBtn" onTap="operateResultReOperate">
<view class="operateResultConfirmBtnText">{{operateReDo}}</view>
</view>
</view>
</block>
......
......@@ -3,31 +3,32 @@ import {
ACTION_USE_COUPON, ACTION_GOODS, ACTION_MEMBER,
ACTION_GO_BALANCE, ACTION_REQUEST_GOOD_INFO, ACTION_PRINT_RESULT,
ACTION_REPRINT, ACTION_GO_SCAN, ACTION_ON_PAY_SUCCESS,
ACTION_ON_PAY_FAILED, ACTION_GO_HOME, ACTION_GET_ACCOUNT,
ACTION_ON_PAY_FAILED, ACTION_GO_HOME,
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_PICK_UP_GOODS
ACTION_SYSTEM_SETTING, ACTION_BALANCE_BACK_GOODS, ACTION_DAY_CHECK,
ACTION_VERIFY, ACTION_VERIFY_SUCCESS, ACTION_VERIFY_FAILED,ACTION_PICK_UP_GOODS
} from '../../const/actioncmd'
import { FLOW_IDLE, FLOW_COLLECTIONS, FLOW_REFUND, FLOW_DIRECT_PAYMENT } from '../../const/actioncmd'
import { FLOW_IDLE, FLOW_COLLECTIONS, FLOW_REFUND, FLOW_DIRECT_PAYMENT, FLOW_VERIFY } from '../../const/actioncmd'
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: "", //流程类型:用于区分易混淆的流程,以及共同界面使用时用该标识位作为区分
/**账号信息 */
......@@ -84,12 +85,11 @@ Page({
/** 等待操作页面的参数 */
//左上角的显示隐藏,左下角的文字提示
waitOperateRemindText: "等待顾客付款…",
waitOperateCancelText: "取消收款",
waitOperateCancelRecheckShow: false,
waitOperateMoneyRemind: "应收款:",
waitOperateAmount: 0.00,
waitOperateHideLeft: false,
/** 操作结果页参数 */
//在操作中携带的内容,可自定义内容,每次操作的开始和结束应当把该值给重置
......@@ -268,14 +268,15 @@ Page({
operateSuccessRemind: "退款成功",
operateSuccessDesc: "退款完成!会在1~2个工作日返还到付款账户",
});
context.goPage('operateResult');
context.goPage('operateresult');
} else if (res.action == ACTION_REFUND_FAILED) {
context.setData({
operateSuccess: false,
operateFailedRemind: "退款失败",
operateFailedDesc: res.data,
operateReDo: "重新退款",
});
context.goPage('operateResult');
context.goPage('operateresult');
} else if (res.action == ACTION_PRINT_LAST_ORDER && context.data.pageShow['printlastorder'] == true) {
//打印上一单结果返回
//获取到打印结果
......@@ -321,9 +322,37 @@ Page({
discCouponMsg: coupon.discCouponMsg,
discCouponPrice: coupon.discCouponPrice
})
}else if(res.action == ACTION_BALANCE_BACK_GOODS){
} else if (res.action == ACTION_BALANCE_BACK_GOODS) {
//结算页面回到扫商品页面
context.goPage('landscan');
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: "打印失败" });
}
context.goPage('landscan');
} else if (res.action == ACTION_VERIFY_SUCCESS) {
//核验成功
//跳转到成功页面
context.setData({
operateSuccess: true,
operateSuccessRemind: "核验成功",
operateSuccessDesc: "核销完成!请提示顾客可以离场",
});
context.goPage('operateresult');
} else if (res.action == ACTION_VERIFY_FAILED) {
context.setData({
operateSuccess: true,
operateSuccessRemind: "核销失败",
operateSuccessDesc: res.data,
operateReDo: "重新扫描",
});
context.goPage('operateresult');
}
}
});
......@@ -376,6 +405,7 @@ Page({
operateContext: {},//重新初始化
memberPhone: '',
memberPhoneShown: '',
waitOperateHideLeft: false,
})
},
......@@ -465,7 +495,30 @@ Page({
* 核验
*/
onHomeVerifyClicked() {
this.setData({
flowType: FLOW_VERIFY,
})
//跳转等待页
this.goPage('waitoperate');
this.setData({
waitOperateRemindText: "请提示顾客核验订单…",
waitOperateCancelText: "关闭",
waitOperateHideLeft: true,
})
my.ix.sendBuddyMessage({
// 填入目标小程序的 AppID
target: getApp().globalData.frontScreenAppId,
data: {
action: ACTION_VERIFY,
data: null
},
success: (res) => {
console.info(`sendBuddyMessage success: ${JSON.stringify(res)}`);
},
fail: (res) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
}
});
},
/**
......@@ -491,7 +544,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)}`);
}
});
},
/**关于系统(实际上是关于应用) */
......@@ -922,8 +990,10 @@ Page({
recheckRemind: "确定要取消此支付订单吗?",
recheckShow: true,
});
} else if (this.data.flowType == FLOW_VERIFY) {
//直接退出到home
this.goHome();
}
},
//提货关闭
......@@ -1123,6 +1193,8 @@ Page({
if (this.data.flowType == FLOW_REFUND) {
//重新进行退款操作,后屏重新进入
this.sendRefund(null);
} else if (this.data.flowType == FLOW_VERIFY) {
this.onHomeVerifyClicked();
}
},
......
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