Commit d801a642 authored by gaodapeng's avatar gaodapeng

调整了UI,增加了获取店铺号的逻辑,增加了结算页面返回的逻辑

parent 3022cb49
......@@ -27,3 +27,6 @@ export const ACTION_ON_PAY_FAILED = "ACTION_ON_PAY_FAILED";
//跳转首页
export const ACTION_GO_HOME = "ACTION_GO_HOME";
//获取账户信息
export const ACTION_GET_ACCOUNT = "ACTION_GET_ACCOUNT";
<view class="page">
<view class="topView">
<!--back button-->
<!-- <view class="store">
<view class="store">
<image mode="aspectFit" style="position:absolute;width:24rpx;height:21rpx;left: 19rpx;top:19rpx;" src="/images/icon_store.png"/>
<text style="position:absolute;font-size:19rpx;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:rgba(0,0,0,0.85);line-height:22rpx;left:55rpx;top:19rpx;">{{storeName}}</text>
</view> -->
</view>
<view style="position:absolute;font-size:22rpx;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:rgba(51,51,51,1);line-height:22rpx;top:19rpx;width:100%;text-align:center;">首页</view>
<view style="display:flex;flex-direction:row-reverse;position:absolute;right:19rpx;top:19rpx;">
<view style="font-size:19rpx;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:rgba(51,51,51,1);line-height:22rpx;">退出</view>
......@@ -21,5 +21,4 @@
</view>
</view>
\ No newline at end of file
{
"transparentTitle": "always",
"usingComponents":{
"grid": "mini-antui/es/grid/index"
}
"transparentTitle": "always"
}
\ No newline at end of file
/* 公共样式 */
.topView {
position: relative;
width: 768rpx;
height: 60rpx;
background: #ffffff;
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
/* border: 2px solid red; */
}
/* home样式 */
......@@ -22,7 +12,7 @@
.homeTopView {
position: relative;
width: 746rpx;
width: 750rpx;
height: 60rpx;
background: #ffffff;
/* border: 2px solid red; */
......@@ -41,10 +31,6 @@
width: 100%;
height: 100%;
background: #ffffff;
/* padding-top: 15rpx;
padding-left: 36rpx;
padding-right: 36rpx;
padding-bottom: 28rpx; */
/* border: 2px solid red; */
}
......@@ -55,8 +41,8 @@
align-items: center;
margin-top: 15rpx;
margin-bottom: 15rpx;
margin-left: 39rpx;
margin-right: 39rpx;
margin-left: 38rpx;
margin-right: 38rpx;
}
.homeItemImage {
......@@ -79,6 +65,16 @@
*/
.topView {
position: relative;
width: 768rpx;
height: 60rpx;
background: #ffffff;
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
/* border: 2px solid red; */
}
.backButton {
color: #333333;
font-size: 19rpx;
......@@ -511,7 +507,7 @@
/* 结算页 */
.topView {
.balanceTopView {
position: relative;
width: 768rpx;
height: 60rpx;
......
......@@ -7,19 +7,22 @@
</view>
<view style="position:absolute;font-size:22rpx;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:rgba(51,51,51,1);line-height:22rpx;left:0rpx;top:19rpx;width:100%;text-align:center;">首页</view>
<view style="display:flex;flex-direction:row-reverse;position:absolute;right:19rpx;top:19rpx;width:auto;background:#ffffff;">
<view style="font-size:19rpx;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:rgba(51,51,51,1);line-height:22rpx;margin-right:19rpx;">退出</view>
<view style="font-size:19rpx;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:rgba(51,51,51,1);line-height:22rpx;">退出</view>
<image mode="aspectFit" src="/images/icon_exit.png" style="position:relative;width:19rpx;height:19rpx;margin-right:8rpx;margin-top:1rpx;"/>
</view>
</view>
<view class="homeBodyView">
<!-- 还需要加一层swiper -->
<view style="display:flex;flex-direction:row;position:relative;margin-top: 14rpx;margin-left: 32rpx;margin-right: 32rpx;">
<view class="homeGridItem" catchTap="sendGoToCollections">
<image mode="aspectFit" src="/images/collections.png" class="homeItemImage"/>
<view class="homeItemText">收银</view>
</view>
</view>
</view>
</view>
<!--扫码页-->
......@@ -99,9 +102,9 @@
<!-- 结算页 -->
<view class="balance" hidden="{{!pageShow['waitoperate']}}">
<view class="topView">
<view class="balanceTopView">
<!--back button-->
<view class="backButton">
<view catchTap="waitOperateBack" class="backButton">
<image mode="aspectFit" style="position:absolute;width:11rpx;height:17rpx;left: 18rpx;top:22rpx;" src="/images/icon_back.png"/>
<text>返回</text>
</view>
......@@ -129,8 +132,8 @@
<view class="rightBody">
<view class="remindText">等待顾客付款…</view>
<image mode="aspectFit" style="width:166rpx;height:143rpx;margin-top:39rpx;" src="/images/icon_wait_operate.png"/>
<view 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 onTap="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 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="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>
</view>
</view>
......
......@@ -9,7 +9,7 @@ import { ACTION_GO_SCAN } from '../../const/actioncmd'
import { ACTION_ON_PAY_SUCCESS } from '../../const/actioncmd'
import { ACTION_ON_PAY_FAILED } from '../../const/actioncmd'
import { ACTION_GO_HOME } from '../../const/actioncmd'
import { ACTION_GET_ACCOUNT } from '../../const/actioncmd'
Page({
data: {
......@@ -80,9 +80,7 @@ Page({
my.ix.onBuddyMessage({
success: (res) => {
console.info(`onBuddyMessage success: ${JSON.stringify(res)}`);
my.showToast({
content: JSON.stringify(res)
});
if (res.action == ACTION_PRINT_RESULT && context.data.pageShow['payresult'] == true) {
//获取到打印结果
var printResultData = res.data;
......@@ -147,11 +145,14 @@ Page({
});
context.goPage('payresult');
} else {
//未知指令
} else if(res.action == ACTION_GET_ACCOUNT){
context.setData({
storeName:res.data.storeName
});
}
}
});
},
onHide() {
// 页面隐藏
......@@ -171,6 +172,7 @@ Page({
// 页面被拉到底部
},
onShareAppMessage() {
// 返回自定义分享信息
return {
......@@ -180,6 +182,24 @@ Page({
};
},
getAccountInfo(){
my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId,
data: {
action: ACTION_GET_ACCOUNT,
data: null
},
success: (res) => {
console.log("发送收银事件到前屏小程序 成功 ===》" + JSON.stringify(res));
},
fail: (res) => {
console.log("发送收银事件到前屏小程序 失败 ===》 " + JSON.stringify(res));
},
});
},
/**payresult页面逻辑方法 */
onReprint() {
//通知前屏重新打印
......@@ -224,25 +244,16 @@ Page({
action: ACTION_GO_SCAN,
data: null
};
my.showToast({
content: "首页发送数据"
});
my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId,
data: commonRequest,
success: (res) => {
my.showToast({
content: "首页发送数据成功"
});
console.log("发送收银事件到前屏小程序 成功 ===》" + JSON.stringify(res));
},
fail: (res) => {
console.log("发送收银事件到前屏小程序 失败 ===》 " + JSON.stringify(res));
//发送失败重试
// context.sendGoToCollections();
my.showToast({
content: "首页发送数据失败"
});
console.log("发送收银事件到前屏小程序 ===》" + JSON.stringify(res));
},
});
......@@ -409,7 +420,33 @@ Page({
},
});
}
})
},
waitOperateBack(){
//直接返回到扫码页面,并且通知前屏返回
this.goPage('landscan');
my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId,
data: {
action:ACTION_GO_SCAN,
data:null
},
success: (res) => {
console.log("通知前屏跳转到结算页面 成功 ===》" + JSON.stringify(res));
},
fail: (res) => {
console.log("通知前屏跳转到结算页面 失败 ===》 " + JSON.stringify(res));
my.showToast({
type: 'fail',
content: '结算失败',
duration: 3000,
success: () => {
},
});
}
})
},
//用券返回
......
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