Commit 3e1c9855 authored by gaodapeng's avatar gaodapeng

fix bugs

parent e33bedc8
...@@ -53,8 +53,8 @@ export const ACTION_REFUND_FAILED = "ACTION_REFUND_FAILED"; ...@@ -53,8 +53,8 @@ export const ACTION_REFUND_FAILED = "ACTION_REFUND_FAILED";
export const ACTION_PRINT_LAST_ORDER = "ACTION_PRINT_LAST_ORDER"; export const ACTION_PRINT_LAST_ORDER = "ACTION_PRINT_LAST_ORDER";
const FLOW_IDLE = "idle"; const FLOW_IDLE = "idle";
const FLOW_COLLECTIONS = "collections"; const FLOW_COLLECTIONS = "collections";//收款
const FLOW_REFUND = "refund"; const FLOW_REFUND = "refund";//退款
export { export {
FLOW_IDLE,FLOW_COLLECTIONS,FLOW_REFUND FLOW_IDLE,FLOW_COLLECTIONS,FLOW_REFUND
......
...@@ -20,17 +20,15 @@ Component({ ...@@ -20,17 +20,15 @@ Component({
//弹窗消失的时候 result清空 //弹窗消失的时候 result清空
if (nextProps.scene == 0) { if (nextProps.scene == 0) {
this.setData({ this.setData({
result: '', result: '',
}); });
} }
this.setData({ this.setData({
scenes: nextProps.scene, scenes: nextProps.scene,
}); });
console.log("scenes:"+this.data.scenes);
}, },
methods: { methods: {
......
.login-waiting-page{ .login-waiting-page {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
position: absolute position: absolute
} }
.login-waiting-left{ .login-waiting-left {
width: 50%; width: 50%;
height: 100%; height: 100%;
} }
.login-waiting-right{ .login-waiting-right {
width: 50%; width: 50%;
height: 100%; height: 100%;
background-color: white; background-color: white;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
align-items: center align-items: center
} }
.login-waiting-right-image{ .login-waiting-right-image {
width: 287rpx; width: 287rpx;
height: 204rpx; height: 204rpx;
} }
/* home样式 */ /* home样式 */
...@@ -573,6 +573,7 @@ ...@@ -573,6 +573,7 @@
width: 252rpx; width: 252rpx;
height: 60rpx; height: 60rpx;
} }
/* 确定 兑换成功 */ /* 确定 兑换成功 */
.sure-use-coupon { .sure-use-coupon {
...@@ -598,11 +599,32 @@ ...@@ -598,11 +599,32 @@
border: 2px solid red; border: 2px solid red;
} }
/* 结算页 */ /* 等待操作页 */
.waitOperate {
display: flex;
flex-direction: column;
position: absolute;
width: 100%;
height: 100%;
left: 0rpx;
top: 0rpx;
}
.waitOperateBackButton {
color: #333333;
font-size: 19rpx;
line-height: 60rpx;
height: 60rpx;
width: 110rpx;
text-align: center;
/* border: 2px solid red; */
position: relative;
}
.balanceTopView { .balanceTopView {
position: relative; position: relative;
width: 768rpx; width: 750rpx;
height: 60rpx; height: 60rpx;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
/* border: 2px solid red; */ /* border: 2px solid red; */
...@@ -613,11 +635,11 @@ ...@@ -613,11 +635,11 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
position: relative; position: relative;
width: 768rpx; width: 750rpx;
height: 372rpx; height: 362rpx;
box-sizing: border-box; box-sizing: border-box;
align-items: center; align-items: center;
background: #F3F7F9; background: #FFFFFF;
} }
.leftBody { .leftBody {
...@@ -626,6 +648,7 @@ ...@@ -626,6 +648,7 @@
position: relative; position: relative;
width: 52.8%; width: 52.8%;
height: 100%; height: 100%;
background: rgba(243, 247, 249, 1);
box-sizing: border-box; box-sizing: border-box;
} }
...@@ -714,6 +737,7 @@ ...@@ -714,6 +737,7 @@
} }
/* 兑换券成功文本 */ /* 兑换券成功文本 */
.scan-coupon-text-success { .scan-coupon-text-success {
font-size: 26rpx; font-size: 26rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
...@@ -724,17 +748,18 @@ ...@@ -724,17 +748,18 @@
} }
/* 兑换券失败文本 */ /* 兑换券失败文本 */
.scan-coupon-text-fail { .scan-coupon-text-fail {
font-size: 26rpx; font-size: 26rpx;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color:rgba(255,0,0,1); color: rgba(255, 0, 0, 1);
line-height: 26rpx; line-height: 26rpx;
margin-top: 24rpx; margin-top: 24rpx;
} }
/* 兑换券失败容器*/ /* 兑换券失败容器*/
.failure-operation { .failure-operation {
width: 100%; width: 100%;
height: 62rpx; height: 62rpx;
...@@ -745,129 +770,133 @@ ...@@ -745,129 +770,133 @@
} }
/* 兑换券 关闭 */ /* 兑换券 关闭 */
.close-use-coupon{
width:252rpx; .close-use-coupon {
height:60rpx; width: 252rpx;
margin-right: 18rpx; height: 60rpx;
margin-right: 18rpx;
} }
/* 兑换券 再次兑换 */ /* 兑换券 再次兑换 */
.again-use-coupon{
width:252rpx; .again-use-coupon {
height:60rpx; width: 252rpx;
margin-left: 18rpx; height: 60rpx;
margin-left: 18rpx;
} }
/* 兑换券失败描述 */ /* 兑换券失败描述 */
.scan-coupon-text-fail-desr{
font-size:22rpx; .scan-coupon-text-fail-desr {
font-family:PingFangSC-Regular,PingFang SC; font-size: 22rpx;
font-weight:400; font-family: PingFangSC-Regular, PingFang SC;
color:rgba(91,105,129,1); font-weight: 400;
line-height:22rpx; color: rgba(91, 105, 129, 1);
margin-top: 15rpx line-height: 22rpx;
margin-top: 15rpx
} }
/* 操作结果页面 */ /* 操作结果页面 */
.operateTopView{ .operateTopView {
position: relative; position: relative;
width: 750rpx; width: 750rpx;
height: 60rpx; height: 60rpx;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
/* border: 2px solid red; */ /* border: 2px solid red; */
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16); box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
}
.operateBodyView{
position: relative;
display: flex;
flex-direction: column;
align-items: center;
width: 750rpx;
height: 364rpx;
background: #ffffff;
}
.operateResultIcon{
position: relative;
width: 84rpx;
height: 84rpx;
margin-top: 35rpx;
}
.operateResultText{
font-size:26rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(0,122,255,1);
line-height:26rpx;
margin-top: 23rpx;
}
.operateResultDesc{
font-size:21rpx;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(91,105,129,1);
line-height:21rpx;
margin-top: 19rpx;
}
.operateResultBtnContainer{
width: auto;
height: auto;
display: flex;
flex-direction: row;
margin-top: 54rpx;
}
.operateResultConfirmBtn{
width:246rpx;
height:59rpx;
background:rgba(0,122,255,1);
border-radius:5rpx;
border:1rpx solid rgba(151,151,151,1);
flex-direction: row;
display: flex;
align-items: center;
}
.operateResultConfirmBtnText{
font-size:23rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(255,255,255,1);
line-height:33rpx;
text-align: center;
width: 100%;
height: auto;
}
.operateResultCloseBtn{
width:246rpx;
height:59rpx;
background:rgba(255,255,255,1);
border-radius:5rpx;
border:1rpx solid rgba(0,122,255,1);
flex-direction: row;
display: flex;
margin-right:35rpx;
align-items: center;
}
.operateResultCloseBtnText{
font-size:23rpx;
font-family:PingFangSC-Medium,PingFang SC;
font-weight:500;
color:rgba(0,122,255,1);
line-height:33rpx;
text-align: center;
width: 100%;
height: auto;
} }
.operateBodyView {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
width: 750rpx;
height: 364rpx;
background: #ffffff;
}
.operateResultIcon {
position: relative;
width: 84rpx;
height: 84rpx;
margin-top: 35rpx;
}
.operateResultText {
font-size: 26rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(0, 122, 255, 1);
line-height: 26rpx;
margin-top: 23rpx;
}
.operateResultDesc {
font-size: 21rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(91, 105, 129, 1);
line-height: 21rpx;
margin-top: 19rpx;
}
.operateResultBtnContainer {
width: auto;
height: auto;
display: flex;
flex-direction: row;
margin-top: 54rpx;
}
.operateResultConfirmBtn {
width: 246rpx;
height: 59rpx;
background: rgba(0, 122, 255, 1);
border-radius: 5rpx;
border: 1rpx solid rgba(151, 151, 151, 1);
flex-direction: row;
display: flex;
align-items: center;
}
.operateResultConfirmBtnText {
font-size: 23rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
line-height: 33rpx;
text-align: center;
width: 100%;
height: auto;
}
.operateResultCloseBtn {
width: 246rpx;
height: 59rpx;
background: rgba(255, 255, 255, 1);
border-radius: 5rpx;
border: 1rpx solid rgba(0, 122, 255, 1);
flex-direction: row;
display: flex;
margin-right: 35rpx;
align-items: center;
}
.operateResultCloseBtnText {
font-size: 23rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(0, 122, 255, 1);
line-height: 33rpx;
text-align: center;
width: 100%;
height: auto;
}
/**打印上一单*/ /**打印上一单*/
.printLastOrderPage { .printLastOrderPage {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -932,4 +961,70 @@ ...@@ -932,4 +961,70 @@
font-weight: bold; font-weight: bold;
position: absolute; position: absolute;
top: 89rpx; top: 89rpx;
}
/* 取消等待操作页的操作。名称为recheck*/
.recheckPage {
width: 100%;
height: 100%;
position: absolute;
background: rgba(0, 0, 0, 0.65);
display: flex;
flex-direction: column;
align-items: center;
z-index: 1;
}
.recheckDialog {
width: 516rpx;
height: 292rpx;
background: rgba(255, 255, 255, 1);
border-radius: 5px;
margin-top: 65rpx;
display: flex;
position: relative;
flex-direction: column;
align-items: center;
}
.recheckRemind {
font-size: 21rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 26rpx;
margin-top: 60rpx;
}
.recheckButtonConfirm {
width: 246rpx;
height: 60rpx;
background: rgba(0, 122, 255, 1);
border-radius: 5rpx;
position: relative;
box-sizing: border-box;
margin-top: 32rpx;
}
.recheckButtonCancel {
width: 252rpx;
height: 60rpx;
background: rgba(255, 255, 255, 1);
border-radius: 5rpx;
border: 2rpx solid rgba(0, 122, 255, 1);
position: relative;
box-sizing: border-box;
margin-top: 19rpx;
}
.recheckButtonText {
width: 100%;
height: 60rpx;
margin: 0 auto;
text-align: center;
font-size: 24rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
line-height: 60rpx;
} }
\ No newline at end of file
...@@ -185,11 +185,11 @@ ...@@ -185,11 +185,11 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 结算页 --> <!-- 等待操作页 -->
<view class="balance" hidden="{{!pageShow['waitoperate']}}"> <view class="waitOperate" hidden="{{!pageShow['waitoperate']}}">
<view class="balanceTopView"> <view class="balanceTopView">
<!--back button--> <!--back button-->
<view catchTap="waitOperateBack" class="backButton"> <view catchTap="waitOperateBack" class="waitOperateBackButton">
<image mode="aspectFit" style="position:absolute;width:11rpx;height:17rpx;left: 18rpx;top:22rpx;" src="/images/icon_back.png"/> <image mode="aspectFit" style="position:absolute;width:11rpx;height:17rpx;left: 18rpx;top:22rpx;" src="/images/icon_back.png"/>
<text>返回</text> <text>返回</text>
</view> </view>
...@@ -197,26 +197,26 @@ ...@@ -197,26 +197,26 @@
<!-- 界面主体 --> <!-- 界面主体 -->
<view class="bodyContainer"> <view class="bodyContainer">
<view class="leftBody"> <view class="leftBody">
<view class="contentLine" style="margin-top:29rpx;"> <view class="contentLine" style="margin-top:29rpx;" hidden="{{flowType!='collections'}}">
<view class="descText">合计金额:</view> <view class="descText">合计金额:</view>
<view class="totalPrice">¥{{totalPrice}}</view> <view class="totalPrice">¥{{totalPrice}}</view>
</view> </view>
<view class="contentLine" style="margin-top: 14.5rpx;"> <view class="contentLine" style="margin-top: 14.5rpx;" hidden="{{flowType!='collections'}}">
<view class="descText">商家优惠:</view> <view class="descText">商家优惠:</view>
<view class="totalCoupon">¥{{totalDisc}}</view> <view class="totalCoupon">¥{{totalDisc}}</view>
</view> </view>
<view style="position: absolute;display: flex;flex-direction: row;align-items: baseline;bottom:22rpx;left:0rpx;padding-left: 29rpx;"> <view style="position: absolute;display: flex;flex-direction: row;align-items: baseline;bottom:22rpx;left:0rpx;padding-left: 29rpx;">
<view class="descText">应收款:</view> <view class="descText">{{waitOperateMoneyRemind}}</view>
<view class="moneySign">¥</view> <view class="moneySign">¥</view>
<view class="payPrice">{{totalPrice}}</view> <view class="payPrice">{{waitOperateAmount}}</view>
<view class="descText">(共{{totalQuantity}}件)</view> <view class="descText" hidden="{{flowType!='collections'}}">(共{{totalQuantity}}件)</view>
</view> </view>
</view> </view>
<view class="rightBody"> <view class="rightBody">
<view class="remindText">等待顾客付款…</view> <view class="remindText">{{waitOperateRemindText}}</view>
<image mode="aspectFit" style="width:166rpx;height:143rpx;margin-top:39rpx;" src="/images/icon_wait_operate.png"/> <image mode="aspectFit" style="width:166rpx;height:143rpx;margin-top:39rpx;" src="/images/icon_wait_operate.png"/>
<view catchTap="waitOperateBack" style="width:252rpx;height:60rpx;background:rgba(255,255,255,1);border-radius:5rpx;border:2rpx solid rgba(0,122,255,1);position:relative;box-sizing: border-box;margin-top:32rpx;"> <view catchTap="waitOperateCancel" style="width:252rpx;height:60rpx;background:rgba(255,255,255,1);border-radius:5rpx;border:2rpx solid rgba(0,122,255,1);position:relative;box-sizing: border-box;margin-top:32rpx;">
<view catchTap="cancelCollect" style="width:100%;height:60rpx;margin:0 auto;text-align:center;font-size:24rpx;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:rgba(0,122,255,1);line-height:60rpx;">取消收款</view> <view style="width:100%;height:60rpx;margin:0 auto;text-align:center;font-size:24rpx;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:rgba(0,122,255,1);line-height:60rpx;">{{waitOperateCancelText}}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -330,39 +330,45 @@ ...@@ -330,39 +330,45 @@
<!-- 键盘 --> <!-- 键盘 -->
<land-keybord scene="{{scene}}" onKeyBordFinished="onKeyBordFinished" onKeyBordClose="onKeyBordClose"> <land-keybord scene="{{scene}}" onKeyBordFinished="onKeyBordFinished" onKeyBordClose="onKeyBordClose">
</land-keybord> </land-keybord>
<!-- 等待前屏登录 --> <!-- 操作结果页 -->
<view class="login-waiting-page" a:if="{{!isFrontScreenLoginOK}}"> <view hidden="{{!pageShow['operateResult']}}">
<image class="login-waiting-left" mode="aspectFill" src="/images/login_wait_left.png"/> <view class="operateTopView"></view>
<view class="login-waiting-right"> <view class="operateBodyView">
<image class="login-waiting-right-image" mode="aspectFit" src="/images/login_waiting_right.png"/> <block a:if="{{operateSuccess}}">
</view> <image class="operateResultIcon" mode="aspectFit" src="/images/icon_success.png"/>
<!-- 操作结果页 --> <view class="operateResultText">{{operateSuccessRemind}}</view>
<view hidden="{{!pageShow['operateResult']}}"> <view class="operateResultDesc">{{operateSuccessDesc}}</view>
<view class="operateTopView"></view> <view class="operateResultBtnContainer">
<view class="operateBodyView"> <view class="operateResultConfirmBtn">
<block a:if="{{operateSuccess}}"> <view class="operateResultConfirmBtnText" onTap="operateResultClose">确定</view>
<image class="operateResultIcon" mode="aspectFit" src="/images/icon_success.png"/>
<view class="operateResultText">{{operateSuccessRemind}}</view>
<view class="operateResultDesc">{{operateSuccessDesc}}</view>
<view class="operateResultBtnContainer">
<view class="operateResultConfirmBtn">
<view class="operateResultConfirmBtnText">确定</view>
</view>
</view> </view>
</block> </view>
<block a:else> </block>
<image class="operateResultIcon" mode="aspectFit" src="/images/icon_failed.png"/> <block a:else>
<view class="operateResultText">{{operateFailedRemind}}</view> <image class="operateResultIcon" mode="aspectFit" src="/images/icon_failed.png"/>
<view class="operateResultDesc">{{operateFailedDesc}}</view> <view class="operateResultText">{{operateFailedRemind}}</view>
<view class="operateResultBtnContainer"> <view class="operateResultDesc">{{operateFailedDesc}}</view>
<view class="operateResultCloseBtn"> <view class="operateResultBtnContainer">
<view class="operateResultCloseBtnText">关闭</view> <view class="operateResultCloseBtn">
</view> <view class="operateResultCloseBtnText" onTap="operateResultClose">关闭</view>
<view class="operateResultConfirmBtn"> </view>
<view class="operateResultConfirmBtnText">重新退款</view> <view class="operateResultConfirmBtn">
</view> <view class="operateResultConfirmBtnText" onTap="operateResultReOperate">{{operateReDo}}</view>
</view> </view>
</block> </view>
</block>
</view>
</view>
<!-- 重新检查弹窗 -->
<view class="recheckPage" hidden="{{!recheckShow}}">
<view class="recheckDialog">
<view class="recheckRemind">{{recheckRemind}}</view>
<view class="recheckButtonConfirm" onTap="recheckConfirm">
<view class="recheckButtonText" style="color:#ffffff;">确定</view>
</view>
<view class="recheckButtonCancel" onTap="recheckCancel">
<view class="recheckButtonText" style="color:rgba(0,122,255,1);">取消</view>
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file </view>
\ No newline at end of file
...@@ -52,8 +52,6 @@ Page({ ...@@ -52,8 +52,6 @@ Page({
convertCouponState: 0, convertCouponState: 0,
convertCouponMsg: "兑换失败!无效的兑换码", convertCouponMsg: "兑换失败!无效的兑换码",
//是否正在用券
couponUseing: false,
//0代表弹窗关闭 1代表手动输入条码弹窗 2代表会员 3.收款 4.退款 //0代表弹窗关闭 1代表手动输入条码弹窗 2代表会员 3.收款 4.退款
scene: 0, scene: 0,
//总数量 //总数量
...@@ -64,17 +62,35 @@ Page({ ...@@ -64,17 +62,35 @@ Page({
totalDisc: 0.00, totalDisc: 0.00,
goods: [ goods: [
], ],
//打印上一单页面
printLastOrderPrintStatusHint: "正在打印上一单...",
//是否打印成功
printLastOrderIsPrintSuccess: false,
printLastOrderIsPrinting: true,
/** 等待操作页面的参数 */
//左上角的显示隐藏,左下角的文字提示
waitOperateRemindText: "等待顾客付款…",
waitOperateCancelText: "取消收款",
waitOperateCancelRecheckShow: false,
waitOperateMoneyRemind: "应收款:",
waitOperateAmount: 0.00,
/** 操作结果页参数 */
//在操作中携带的内容,可自定义内容,每次操作的开始和结束应当把该值给重置
operateContext: {},
operateSuccess: false, operateSuccess: false,
operateSuccessRemind: "退款成功", operateSuccessRemind: "退款成功",
operateSuccessDesc: "退款完成!会在1~2个工作日返还到付款账户", operateSuccessDesc: "退款完成!会在1~2个工作日返还到付款账户",
operateFailedRemind: "退款失败", operateFailedRemind: "退款失败",
operateFailedDesc: "核销失败!无效的订单码", operateFailedDesc: "核销失败!无效的订单码",
operateReDo: "重新退款",
//打印上一单页面 /** 重新检查的窗口 */
printLastOrderPrintStatusHint: "正在打印上一单...", recheckBlock: false,//屏蔽取消操作,防止在实际已经进行了接口请求时还能取消,使得流程混乱
//是否打印成功 recheckShow: false,
printLastOrderIsPrintSuccess: false, recheckRemind: "确定要取消此收款订单吗?",
printLastOrderIsPrinting: true
}, },
/**跳转页面方法 */ /**跳转页面方法 */
...@@ -141,12 +157,13 @@ Page({ ...@@ -141,12 +157,13 @@ Page({
isPrinting: true, isPrinting: true,
printResult: "正在打印...", printResult: "正在打印...",
payPriceYuan: "--.--", payPriceYuan: "--.--",
payPriceFen: 0 payPriceFen: 0,
}); });
//跳首页 //跳首页
context.goPage('home'); context.goPage('home');
setData({ context.setData({
flowType: FLOW_IDLE, flowType: FLOW_IDLE,
operateContext: {},//重新初始化
}) })
} else if (res.action == ACTION_GOODS) { } else if (res.action == ACTION_GOODS) {
//商品信息同步 //商品信息同步
...@@ -163,9 +180,6 @@ Page({ ...@@ -163,9 +180,6 @@ Page({
} else if (res.action == ACTION_GO_SCAN) { } else if (res.action == ACTION_GO_SCAN) {
//跳转到 //跳转到
context.goPage('landscan'); context.goPage('landscan');
} else if (res.action == ACTION_GO_BALANCE) {
//跳转
context.goPage('waitoperate');
} else if (res.action == ACTION_ON_PAY_SUCCESS) { } else if (res.action == ACTION_ON_PAY_SUCCESS) {
//分转元 //分转元
...@@ -191,7 +205,7 @@ Page({ ...@@ -191,7 +205,7 @@ Page({
} else if (res.action == ACTION_DIRECT_PAYMENT) { } else if (res.action == ACTION_DIRECT_PAYMENT) {
//直接收款 //直接收款
if (res.data != null) { if (res.data != null) {
context.setData({ totalPrice: res.data }) context.setData({ waitOperateAmount: res.data })
} }
context.goPage('waitoperate'); context.goPage('waitoperate');
} else if (res.action == ACTION_CONVERT_COUPON) { } else if (res.action == ACTION_CONVERT_COUPON) {
...@@ -202,14 +216,20 @@ Page({ ...@@ -202,14 +216,20 @@ Page({
} }
} else if (res.action == ACTION_LOGIN_OK) { } else if (res.action == ACTION_LOGIN_OK) {
//前屏登录完成 //前屏登录完成
context.setData({ isFrontScreenLoginOK: true,storeName:res.data }) context.setData({ isFrontScreenLoginOK: true, storeName: res.data })
} else if (res.action == ACTION_REFUND_SUCCESS) { } else if (res.action == ACTION_REFUND_SUCCESS) {
//跳转到成功页面 //跳转到成功页面
context.setData({
operateSuccess: true,
operateSuccessRemind: "退款成功",
operateSuccessDesc: "退款完成!会在1~2个工作日返还到付款账户",
});
context.goPage('operateResult'); context.goPage('operateResult');
} else if (res.action == ACTION_REFUND_FAILED) { } else if (res.action == ACTION_REFUND_FAILED) {
context.setData({ context.setData({
isPaySuccess: false, operateSuccess: false,
operateFailedRemind: "退款失败",
operateFailedDesc: res.data,
}); });
context.goPage('operateResult'); context.goPage('operateResult');
} else if (res.action == ACTION_PRINT_LAST_ORDER && context.data.pageShow['printlastorder'] == true) { } else if (res.action == ACTION_PRINT_LAST_ORDER && context.data.pageShow['printlastorder'] == true) {
...@@ -223,13 +243,13 @@ Page({ ...@@ -223,13 +243,13 @@ Page({
//打印成功 //打印成功
this.setData({ this.setData({
printLastOrderIsPrintSuccess: true, printLastOrderIsPrintSuccess: true,
printLastOrderPrintStatusHint:"打印完成" printLastOrderPrintStatusHint: "打印完成"
}); });
} else { } else {
//打印失败 //打印失败
this.setData({ this.setData({
printLastOrderIsPrintSuccess: false, printLastOrderIsPrintSuccess: false,
printLastOrderPrintStatusHint:"打印失败" printLastOrderPrintStatusHint: "打印失败"
}); });
} }
} }
...@@ -258,7 +278,7 @@ Page({ ...@@ -258,7 +278,7 @@ Page({
//回到首页 //回到首页
goHome(){ goHome() {
let context = this; let context = this;
my.ix.sendBuddyMessage({ my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId, target: getApp().globalData.frontScreenAppId,
...@@ -452,15 +472,21 @@ Page({ ...@@ -452,15 +472,21 @@ Page({
action: ACTION_GO_SCAN, action: ACTION_GO_SCAN,
data: null data: null
}; };
var context = this;
my.ix.sendBuddyMessage({ my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId, target: getApp().globalData.frontScreenAppId,
data: commonRequest, data: commonRequest,
success: (res) => { success: (res) => {
flowType = FLOW_COLLECTIONS; context.setData({
flowType: FLOW_COLLECTIONS
})
console.log("发送收银事件到前屏小程序 成功 ===》" + JSON.stringify(res)); console.log("发送收银事件到前屏小程序 成功 ===》" + JSON.stringify(res));
}, },
fail: (res) => { fail: (res) => {
flowType = FLOW_IDLE; context.setData({
flowType: FLOW_IDLE
})
console.log("发送收银事件到前屏小程序 失败 ===》 " + JSON.stringify(res)); console.log("发送收银事件到前屏小程序 失败 ===》 " + JSON.stringify(res));
//发送失败重试 //发送失败重试
// context.sendGoToCollections(); // context.sendGoToCollections();
...@@ -527,7 +553,6 @@ Page({ ...@@ -527,7 +553,6 @@ Page({
this.sendGoodsInfoToFront(result) this.sendGoodsInfoToFront(result)
} else if (this.data.scene == 4) { } else if (this.data.scene == 4) {
this.sendRefund(result); this.sendRefund(result);
return;
} }
this.onKeyBordClose(); this.onKeyBordClose();
}, },
...@@ -649,17 +674,18 @@ Page({ ...@@ -649,17 +674,18 @@ Page({
//跳转到结算等待页 //跳转到结算等待页
goPay(e) { goPay(e) {
//购物车不能为空 //购物车不能为空
if(this.data.goods.length == 0){ if (this.data.goods.length == 0) {
my.showToast({ my.showToast({
type: 'fail', type: 'fail',
content: '等待收银员录入商品', content: '等待收银员录入商品',
duration: 3000, duration: 3000,
success: () => { success: () => {
}, },
}); });
return return
} }
//发送指令,前屏跳转
var commonRequest = { var commonRequest = {
action: ACTION_GO_BALANCE, action: ACTION_GO_BALANCE,
data: "" data: ""
...@@ -680,36 +706,63 @@ Page({ ...@@ -680,36 +706,63 @@ Page({
}, },
}); });
} }
}) });
//后屏跳转
this.goPage('waitoperate');
var amount = this.data.totalPrice;
this.setData({
waitOperateAmount: amount,
});
}, },
waitOperateBack() { waitOperateBack() {
//直接返回到扫码页面,并且通知前屏返回 //直接返回到扫码页面,并且通知前屏返回
this.goPage('landscan'); if (this.data.flowType == FLOW_REFUND) {
this.operateResultClose();
my.ix.sendBuddyMessage({ } else {
target: getApp().globalData.frontScreenAppId, this.goPage('landscan');
data: { my.ix.sendBuddyMessage({
action: ACTION_GO_SCAN, target: getApp().globalData.frontScreenAppId,
data: null data: {
}, action: ACTION_GO_SCAN,
success: (res) => { data: null
console.log("通知前屏跳转到结算页面 成功 ===》" + JSON.stringify(res)); },
}, success: (res) => {
fail: (res) => { console.log("通知前屏跳转到结算页面 成功 ===》" + JSON.stringify(res));
console.log("通知前屏跳转到结算页面 失败 ===》 " + JSON.stringify(res)); },
my.showToast({ fail: (res) => {
type: 'fail', console.log("通知前屏跳转到结算页面 失败 ===》 " + JSON.stringify(res));
content: '结算失败', my.showToast({
duration: 3000, type: 'fail',
success: () => { content: '结算失败',
}, duration: 3000,
}); success: () => {
} },
}) });
}
})
}
}, },
//等待操作页,取消付款/收款等按钮
waitOperateCancel() {
//todo 是否需要加上当接口在请求时,则屏蔽取消按钮的操作?
console.log("取消操作等待页");
if (this.data.flowType == FLOW_COLLECTIONS) {
this.setData({
recheckRemind: "确定要取消此收款订单吗?",
recheckShow: true,
});
} else if (this.data.flowType == FLOW_REFUND) {
this.setData({
recheckRemind: "确定要取消此退款订单吗?",
recheckShow: true,
});
}
},
//兑换券界面关闭 //兑换券界面关闭
convertCouponClose(e) { convertCouponClose(e) {
...@@ -748,6 +801,28 @@ Page({ ...@@ -748,6 +801,28 @@ Page({
//发送退款金额.以分为单位 //发送退款金额.以分为单位
sendRefund(amount) { sendRefund(amount) {
var object = this.data.operateContext;
if (amount == null) {
if (object != null && object.refundAmount != null) {
amount = object.refundAmount;
} else {
console.log("refund failed");
return;
}
} else {
object.refundAmount = amount;
}
this.goPage('waitoperate');
this.setData({
waitOperateMoneyRemind: "应退款:",
waitOperateRemindText: "等待顾客扫描订单条码…",
waitOperateCancelText: "取消退款",
waitOperateAmount: amount,
})
//todo 修改等待操作界面的内容
var miyapay = require("/utils/miyapay4.js"); var miyapay = require("/utils/miyapay4.js");
var refundAmount = miyapay.yuan2Fen(amount); var refundAmount = miyapay.yuan2Fen(amount);
console.log("amount" + refundAmount); console.log("amount" + refundAmount);
...@@ -810,6 +885,58 @@ Page({ ...@@ -810,6 +885,58 @@ Page({
printLastOrderPrintStatusHint: "正在打印上一单" printLastOrderPrintStatusHint: "正在打印上一单"
}); });
this.goPage('home'); this.goPage('home');
} },
//结果页面关闭
operateResultClose() {
this.goPage('home');
this.setData({
flowType: FLOW_IDLE,
})
my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId,
data: {
action: ACTION_GO_HOME,
data: null
},
success: (res) => {
//成功发送则
console.log("发送退款金额到前屏小程序成功 ===》" + JSON.stringify(res));
},
fail: (res) => {
my.showToast({
type: 'fail',
content: '发送关闭前屏操作结果页失败',
duration: 3000,
success: () => {
},
});
}
})
},
//操作没成功,重新操作
operateResultReOperate() {
if (this.data.flowType == FLOW_REFUND) {
//重新进行退款操作,后屏重新进入
this.sendRefund(null);
}
},
//重检查提示点击确定
recheckConfirm() {
this.setData({
recheckShow: false,
});
this.goHome();
},
recheckCancel() {
this.setData({
recheckShow: false,
});
},
}); });
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