Commit a9a4fcdd authored by gaodapeng's avatar gaodapeng

增加核验功能,fixbugs

parent e9be6be4
......@@ -67,12 +67,22 @@ export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING";
//结算页面回到扫商品页面
export const ACTION_BALANCE_BACK_GOODS = "ACTION_BALANCE_BACK_GOODS";
//核验
export const ACTION_VERIFY = "ACTION_VERIFY";
//核验成功
export const ACTION_VERIFY_SUCCESS = "ACTION_VERIFY_SUCCESS";
//核验失败
export const ACTION_VERIFY_FAILED = "ACTION_VERIFY_FAILED";
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;
}
......
......@@ -213,7 +213,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>
......@@ -225,7 +225,6 @@
<view style="position: absolute;display: flex;flex-direction: row;align-items: baseline;bottom:22rpx;left:0rpx;padding-left: 29rpx;">
<view class="descText">{{waitOperateMoneyRemind}}</view>
<view class="moneySign">¥</view>
<view class="payPrice">{{waitOperateAmount}}</view>
<view class="descText" hidden="{{flowType!='collections'}}">(共{{totalQuantity}}件)</view>
</view>
......@@ -386,7 +385,6 @@
</view>
</view>
</view>
<!-- 等待前屏登录 -->
<view class="login-waiting-page" a:if="{{!isFrontScreenLoginOK}}">
<image class="login-waiting-left" mode="aspectFill" src="/images/login_wait_left.png"/>
......@@ -394,7 +392,6 @@
<image class="login-waiting-right-image" mode="aspectFit" src="/images/login_waiting_right.png"/>
</view>
</view>
<!-- 操作结果页 -->
<view hidden="{{!pageShow['operateresult']}}">
<view class="operateTopView"></view>
......@@ -404,8 +401,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>
......@@ -414,11 +411,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_SYSTEM_SETTING, ACTION_VERIFY, ACTION_VERIFY_SUCCESS,
ACTION_VERIFY_FAILED, ACTION_BALANCE_BACK_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: "", //流程类型:用于区分易混淆的流程,以及共同界面使用时用该标识位作为区分
/**账号信息 */
......@@ -79,12 +80,11 @@ Page({
/** 等待操作页面的参数 */
//左上角的显示隐藏,左下角的文字提示
waitOperateRemindText: "等待顾客付款…",
waitOperateCancelText: "取消收款",
waitOperateCancelRecheckShow: false,
waitOperateMoneyRemind: "应收款:",
waitOperateAmount: 0.00,
waitOperateHideLeft: false,
/** 操作结果页参数 */
//在操作中携带的内容,可自定义内容,每次操作的开始和结束应当把该值给重置
......@@ -263,14 +263,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) {
//打印上一单结果返回
//获取到打印结果
......@@ -316,9 +317,26 @@ 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');
} 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');
}
}
});
......@@ -371,6 +389,7 @@ Page({
operateContext: {},//重新初始化
memberPhone: '',
memberPhoneShown: '',
waitOperateHideLeft: false,
})
},
......@@ -460,7 +479,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)}`);
}
});
},
/**
......@@ -902,8 +944,10 @@ Page({
recheckRemind: "确定要取消此支付订单吗?",
recheckShow: true,
});
} else if (this.data.flowType == FLOW_VERIFY) {
//直接退出到home
this.goHome();
}
},
//兑换券界面关闭
......@@ -1085,6 +1129,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