Commit 2edbcfee authored by jiangjiantao's avatar jiangjiantao

Merge branch 'dev-1.0' of…

Merge branch 'dev-1.0' of https://gitlab.infra.miyatech.com/pengguangpu/doublescreen-back into dev-1.0
parents 8d138f6b 0e4b3902
{ {
"pages": [ "pages": [
"pages/index/index", "pages/index/index",
"pages/payresult/payresult",
"pages/printlastorder/printlastorder", "pages/printlastorder/printlastorder",
"pages/poster/poster", "pages/poster/poster",
"pages/home/home", "pages/home/home",
"pages/poster/poster", "pages/poster/poster",
"pages/waitoperate/waitoperate", "pages/waitoperate/waitoperate",
"pages/landscan/landscan", "pages/landscan/landscan"
"pages/payresult/payresult"
], ],
"window": { "window": {
"defaultTitle": "", "defaultTitle": "",
......
...@@ -106,16 +106,25 @@ ...@@ -106,16 +106,25 @@
*/ */
.topView { .payResultPage {
position: relative; display: flex;
width: 768rpx; flex-direction: column;
width: 100%;
height: 100%;
position: absolute;
}
.payResultTopView {
position: absolute;
top: 0rpx;
width: 100%;
height: 60rpx; height: 60rpx;
background: #ffffff; background: #ffffff;
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16); box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
/* border: 2px solid red; */ /* border: 2px solid red; */
} }
.backButton { .payResultBackButton {
color: #333333; color: #333333;
font-size: 19rpx; font-size: 19rpx;
line-height: 60rpx; line-height: 60rpx;
...@@ -126,14 +135,16 @@ ...@@ -126,14 +135,16 @@
position: relative; position: relative;
} }
.bottomView { .payResultBottomView {
position: relative; position: relative;
width: 100%; width: 100%;
height: 372rpx; height: 100%;
margin-top: 60rpx;
/* border: 2px solid red; */ /* border: 2px solid red; */
box-sizing: border-box;
} }
.leftView { .payResultLeftView {
display: flex; display: flex;
position: absolute; position: absolute;
left: 0rpx; left: 0rpx;
...@@ -141,11 +152,11 @@ ...@@ -141,11 +152,11 @@
width: 406rpx; width: 406rpx;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
height: 372rpx; height: 100%;
/* border: 2px solid red; */ /* border: 2px solid red; */
} }
.rightView { .payResultRightView {
display: flex; display: flex;
right: 0rpx; right: 0rpx;
top: 0rpx; top: 0rpx;
...@@ -154,7 +165,7 @@ ...@@ -154,7 +165,7 @@
align-items: center; align-items: center;
width: 362rpx; width: 362rpx;
background: #ffffff; background: #ffffff;
height: 372rpx; height: 100%;
/* border: 2px solid red; */ /* border: 2px solid red; */
} }
......
...@@ -223,18 +223,11 @@ ...@@ -223,18 +223,11 @@
</view> </view>
<!--支付结果页--> <!--支付结果页-->
<view hidden="{{!pageShow['payresult']}}"> <view hidden="{{!pageShow['payresult']}}">
<!--top view--> <view class="payResultPage">
<view class="topView">
<!--back button-->
<view class="backButton" hidden="true">
<image mode="aspectFit" style="position:absolute;width:11rpx;height:17rpx;left: 18rpx;top:22rpx;" src="/images/icon_back.png"/>
<text>返回</text>
</view>
</view>
<!--bottom view--> <!--bottom view-->
<view class="bottomView"> <view class="payResultBottomView">
<!--left view--> <!--left view-->
<view class="leftView"> <view class="payResultLeftView">
<block a:if="{{isPaySuccess}}"> <block a:if="{{isPaySuccess}}">
<!--支付成功--> <!--支付成功-->
<image mode="aspectFit" style="width:101rpx;height:101rpx;margin-top:43rpx;" src="/images/icon_success.png"/> <image mode="aspectFit" style="width:101rpx;height:101rpx;margin-top:43rpx;" src="/images/icon_success.png"/>
...@@ -249,7 +242,7 @@ ...@@ -249,7 +242,7 @@
</block> </block>
</view> </view>
<!--right view--> <!--right view-->
<view class="rightView"> <view class="payResultRightView">
<block a:if="{{isPaySuccess}}"> <block a:if="{{isPaySuccess}}">
<!--支付成功--> <!--支付成功-->
<text style="font-size:26rpx;color:#333333;font-weight:bold;margin-top:35rpx;">{{printResult}}</text> <text style="font-size:26rpx;color:#333333;font-weight:bold;margin-top:35rpx;">{{printResult}}</text>
...@@ -261,13 +254,13 @@ ...@@ -261,13 +254,13 @@
</block> </block>
<block a:else> <block a:else>
<view hidden="{{isPrinting}}"> <view hidden="{{isPrinting}}">
<button type="ghost" style="margin:0 auto;font-size:28rpx;height:40rpx;border-radius:20rpx;border-color:#FF7F19;color:#FF7F19;width:166rpx;" onTap="onReprint">重新打印</button> <button type="ghost" style="margin:0 auto;font-size:28rpx;height:40rpx;border-radius:20rpx;border-color:#FF7F19;color:#FF7F19;width:166rpx;line-height:40rpx;text-align:center;font-size:24rpx;" onTap="onReprint">重新打印</button>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
<view hidden="{{isPrinting}}"> <view hidden="{{isPrinting}}">
<button type="primary" style="height:60rpx;margin-top:8rpx;border-radius:5rpx;background-color:#007AFF;border-color:#007AFF;opacity: 0.7;width:252rpx;" hover-class="loginButtonHover" onTap="onNextPayFromPayResult">继续付款</button> <button type="primary" style="height:60rpx;margin-top:8rpx;border-radius:5rpx;background-color:#007AFF;border-color:#007AFF;opacity: 0.7;width:252rpx;line-height:60rpx;text-align:center;font-size:24rpx;" size="mini" hover-class="loginButtonHover" onTap="onNextPayFromPayResult">继续付款</button>
</view> </view>
</block> </block>
<block a:else> <block a:else>
...@@ -277,6 +270,15 @@ ...@@ -277,6 +270,15 @@
</block> </block>
</view> </view>
</view> </view>
<!--top view-->
<view class="payResultTopView">
<!--back button-->
<view class="payResultBackButton" hidden="true">
<image mode="aspectFit" style="position:absolute;width:11rpx;height:17rpx;left: 18rpx;top:22rpx;" src="/images/icon_back.png"/>
<text>返回</text>
</view>
</view>
</view>
</view> </view>
<!--打印上一单--> <!--打印上一单-->
<view hidden="{{!pageShow['printlastorder']}}"> <view hidden="{{!pageShow['printlastorder']}}">
......
...@@ -16,8 +16,10 @@ import { ACTION_LOGIN_OK } from '../../const/actioncmd' ...@@ -16,8 +16,10 @@ import { ACTION_LOGIN_OK } from '../../const/actioncmd'
import { ACTION_REFUND } from '../../const/actioncmd' import { ACTION_REFUND } from '../../const/actioncmd'
import { ACTION_REFUND_SUCCESS } from '../../const/actioncmd' import { ACTION_REFUND_SUCCESS } from '../../const/actioncmd'
import { ACTION_REFUND_FAILED } from '../../const/actioncmd' import { ACTION_REFUND_FAILED } from '../../const/actioncmd'
import { ACTION_PRINT_LAST_ORDER } from '../../const/actioncmd'
import { FLOW_IDLE, FLOW_COLLECTIONS, FLOW_REFUND } from '../../const/actioncmd' import { FLOW_IDLE, FLOW_COLLECTIONS, FLOW_REFUND } from '../../const/actioncmd'
Page({ Page({
data: { data: {
//页面控制相关参数 //页面控制相关参数
...@@ -38,7 +40,7 @@ Page({ ...@@ -38,7 +40,7 @@ Page({
isPaySuccess: true, isPaySuccess: true,
payPriceYuan: "--.--", payPriceYuan: "--.--",
printResult: "正在打印小票...", printResult: "正在打印小票...",
isPrinting: false, isPrinting: true,
isPrintSuccess: false, isPrintSuccess: false,
payPriceFen: 0, payPriceFen: 0,
/**商品扫码页相关参数 */ /**商品扫码页相关参数 */
...@@ -72,7 +74,7 @@ Page({ ...@@ -72,7 +74,7 @@ Page({
printLastOrderPrintStatusHint: "正在打印上一单...", printLastOrderPrintStatusHint: "正在打印上一单...",
//是否打印成功 //是否打印成功
printLastOrderIsPrintSuccess: false, printLastOrderIsPrintSuccess: false,
printLastOrderIsPrinting:true printLastOrderIsPrinting: true
}, },
/**跳转页面方法 */ /**跳转页面方法 */
...@@ -83,7 +85,7 @@ Page({ ...@@ -83,7 +85,7 @@ Page({
"waitoperate": false, "waitoperate": false,
"payresult": false, "payresult": false,
"operateResult": false, "operateResult": false,
"printlastorder":false "printlastorder": false
}; };
//遍历pageShow //遍历pageShow
for (var key in pageShowTemp) { for (var key in pageShowTemp) {
...@@ -210,6 +212,26 @@ Page({ ...@@ -210,6 +212,26 @@ Page({
isPaySuccess: false, isPaySuccess: false,
}); });
context.goPage('operateResult'); context.goPage('operateResult');
} else if (res.action == ACTION_PRINT_LAST_ORDER && context.data.pageShow['printlastorder'] == true) {
//打印上一单结果返回
//获取到打印结果
var printLastOrderResult = res.data;
this.setData({
printLastOrderIsPrinting: false
});
if (printLastOrderResult.code == 0) {
//打印成功
this.setData({
printLastOrderIsPrintSuccess: true,
printLastOrderPrintStatusHint:"打印完成"
});
} else {
//打印失败
this.setData({
printLastOrderIsPrintSuccess: false,
printLastOrderPrintStatusHint:"打印失败"
});
}
} }
} }
...@@ -315,6 +337,22 @@ Page({ ...@@ -315,6 +337,22 @@ Page({
* 打印上一单 * 打印上一单
*/ */
onHomePrintLastOrderClicked() { onHomePrintLastOrderClicked() {
//发送指令至前屏
//通知前屏重新打印
my.ix.sendBuddyMessage({
// 填入目标小程序的 AppID
target: getApp().globalData.frontScreenAppId,
data: {
action: ACTION_PRINT_LAST_ORDER,
data: null
},
success: (res) => {
console.info(`sendBuddyMessage success: ${JSON.stringify(res)}`);
},
fail: (res) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
}
});
//跳转至打印上一单页面 //跳转至打印上一单页面
this.goPage('printlastorder'); this.goPage('printlastorder');
}, },
...@@ -738,12 +776,39 @@ Page({ ...@@ -738,12 +776,39 @@ Page({
/** /**
* 打印上一单页面 * 打印上一单页面
*/ */
onPrintLastOrderCancelClicked() { }, onPrintLastOrderCancelClicked() {
//回首页
this.setData({
printLastOrderIsPrintSuccess: false,
printLastOrderIsPrinting: true,
printLastOrderPrintStatusHint: "正在打印上一单"
});
this.goPage('home');
},
onPrintLastOrderConfirmClicked() { }, onPrintLastOrderConfirmClicked() {
//回首页
this.setData({
printLastOrderIsPrintSuccess: false,
printLastOrderIsPrinting: true,
printLastOrderPrintStatusHint: "正在打印上一单"
});
this.goPage('home');
},
onPrintLastOrderRePrintClicked() { }, onPrintLastOrderRePrintClicked() {
//发送重新打印指令
onPrintLastOrderBackClicked(){} },
onPrintLastOrderBackClicked() {
//回首页
this.setData({
printLastOrderIsPrintSuccess: false,
printLastOrderIsPrinting: true,
printLastOrderPrintStatusHint: "正在打印上一单"
});
this.goPage('home');
}
}); });
page { .payResultPage {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
height: 100%; height: 100%;
align-items: center; position: absolute;
background: #F3F7F9;
} }
.topView { .payResultTopView {
position: relative; position: absolute;
width: 768rpx; top: 0rpx;
width: 100%;
height: 60rpx; height: 60rpx;
background: #ffffff; background: #ffffff;
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
/* border: 2px solid red; */ /* border: 2px solid red; */
} }
.backButton { .payResultBackButton {
color: #333333; color: #333333;
font-size: 19rpx; font-size: 19rpx;
line-height: 60rpx; line-height: 60rpx;
...@@ -26,14 +27,16 @@ page { ...@@ -26,14 +27,16 @@ page {
position: relative; position: relative;
} }
.bottomView { .payResultBottomView {
position: relative; position: relative;
width: 100%; width: 100%;
height: 372rpx; height: 100%;
margin-top: 60rpx;
/* border: 2px solid red; */ /* border: 2px solid red; */
box-sizing: border-box;
} }
.leftView { .payResultLeftView {
display: flex; display: flex;
position: absolute; position: absolute;
left: 0rpx; left: 0rpx;
...@@ -41,11 +44,11 @@ page { ...@@ -41,11 +44,11 @@ page {
width: 406rpx; width: 406rpx;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
height: 372rpx; height: 100%;
/* border: 2px solid red; */ /* border: 2px solid red; */
} }
.rightView { .payResultRightView {
display: flex; display: flex;
right: 0rpx; right: 0rpx;
top: 0rpx; top: 0rpx;
...@@ -54,6 +57,6 @@ page { ...@@ -54,6 +57,6 @@ page {
align-items: center; align-items: center;
width: 362rpx; width: 362rpx;
background: #ffffff; background: #ffffff;
height: 372rpx; height: 100%;
/* border: 2px solid red; */ /* border: 2px solid red; */
} }
\ No newline at end of file
<view class="page"> <view class="payResultPage">
<!--top view-->
<view class="topView">
<!--back button-->
<view class="backButton">
<image mode="aspectFit" style="position:absolute;width:11rpx;height:17rpx;left: 18rpx;top:22rpx;" src="/images/icon_back.png"/>
<text>返回</text>
</view>
</view>
<!--bottom view--> <!--bottom view-->
<view class="bottomView"> <view class="payResultBottomView">
<!--left view--> <!--left view-->
<view class="leftView"> <view class="payResultLeftView">
<block a:if="{{isPaySuccess}}"> <block a:if="{{isPaySuccess}}">
<!--支付成功--> <!--支付成功-->
<image mode="aspectFit" style="width:101rpx;height:101rpx;margin-top:43rpx;" src="/images/icon_success.png"/> <image mode="aspectFit" style="width:101rpx;height:101rpx;margin-top:43rpx;" src="/images/icon_success.png"/>
...@@ -25,7 +17,7 @@ ...@@ -25,7 +17,7 @@
</block> </block>
</view> </view>
<!--right view--> <!--right view-->
<view class="rightView"> <view class="payResultRightView">
<block a:if="{{isPaySuccess}}"> <block a:if="{{isPaySuccess}}">
<!--支付成功--> <!--支付成功-->
<text style="font-size:26rpx;color:#333333;font-weight:bold;margin-top:35rpx;">{{printResult}}</text> <text style="font-size:26rpx;color:#333333;font-weight:bold;margin-top:35rpx;">{{printResult}}</text>
...@@ -37,13 +29,13 @@ ...@@ -37,13 +29,13 @@
</block> </block>
<block a:else> <block a:else>
<view hidden="{{isPrinting}}"> <view hidden="{{isPrinting}}">
<button type="ghost" style="height:40rpx;margin:0 auto;border-radius:20rpx;border-color:#FF7F19;color:#FF7F19;width:166rpx;" hover-class="loginButtonHover" onTap="onReprint">重新打印</button> <button type="ghost" style="margin:0 auto;font-size:28rpx;height:40rpx;border-radius:20rpx;border-color:#FF7F19;color:#FF7F19;width:166rpx;line-height:40rpx;text-align:center;font-size:24rpx;" onTap="onReprint">重新打印</button>
</view> </view>
</block> </block>
</view> </view>
</view> </view>
<view hidden="{{isPrinting}}"> <view hidden="{{isPrinting}}">
<button type="primary" style="height:60rpx;margin-top:8rpx;border-radius:5rpx;background-color:#007AFF;border-color:#007AFF;opacity: 0.7;width:252rpx;" hover-class="loginButtonHover" onTap="">继续付款</button> <button type="primary" style="height:60rpx;margin-top:8rpx;border-radius:5rpx;background-color:#007AFF;border-color:#007AFF;opacity: 0.7;width:252rpx;line-height:60rpx;text-align:center;font-size:24rpx;" size="mini" hover-class="loginButtonHover" onTap="onNextPayFromPayResult">继续付款</button>
</view> </view>
</block> </block>
<block a:else> <block a:else>
...@@ -53,4 +45,12 @@ ...@@ -53,4 +45,12 @@
</block> </block>
</view> </view>
</view> </view>
<!--top view-->
<view class="payResultTopView">
<!--back button-->
<view class="payResultBackButton" hidden="true">
<image mode="aspectFit" style="position:absolute;width:11rpx;height:17rpx;left: 18rpx;top:22rpx;" src="/images/icon_back.png"/>
<text>返回</text>
</view>
</view>
</view> </view>
\ No newline at end of file
...@@ -8,7 +8,7 @@ Page({ ...@@ -8,7 +8,7 @@ Page({
payPriceYuan: "--.--", payPriceYuan: "--.--",
printResult: "正在打印小票...", printResult: "正在打印小票...",
isPrinting: false, isPrinting: false,
isPrintSuccess: true, isPrintSuccess: false,
}, },
onLoad() { }, onLoad() { },
......
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