Commit 3022cb49 authored by pengguangpu's avatar pengguangpu

修改首页样式;添加指令交互;

parents f5e4d947 2b6dc7b2
...@@ -24,3 +24,6 @@ export const ACTION_ON_PAY_SUCCESS = "ACTION_ON_PAY_SUCCESS"; ...@@ -24,3 +24,6 @@ export const ACTION_ON_PAY_SUCCESS = "ACTION_ON_PAY_SUCCESS";
//支付失败 //支付失败
export const ACTION_ON_PAY_FAILED = "ACTION_ON_PAY_FAILED"; export const ACTION_ON_PAY_FAILED = "ACTION_ON_PAY_FAILED";
//跳转首页
export const ACTION_GO_HOME = "ACTION_GO_HOME";
/* 公共样式 */ /* 公共样式 */
.topView { .topView {
position: relative; position: relative;
width: 768rpx; width: 768rpx;
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; */
} }
...@@ -15,54 +16,61 @@ ...@@ -15,54 +16,61 @@
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
height: 100%; height: 100%;
align-items: center;
background: #F3F7F9; background: #F3F7F9;
/* border: 2px solid red; */
} }
.store{ .homeTopView {
display: flex; position: relative;
flex-direction: row; width: 746rpx;
height: 60rpx; height: 60rpx;
width: auto; background: #ffffff;
/* border: 2px solid red; */
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
}
.store {
display: flex;
flex-direction: row;
height: 60rpx;
width: auto;
} }
.homeBodyView { .homeBodyView {
position: relative; position: relative;
width: 768rpx; width: 100%;
height: 372rpx; height: 100%;
background: #ffffff; background: #ffffff;
padding-top: 15rpx; /* padding-top: 15rpx;
padding-left: 36rpx; padding-left: 36rpx;
padding-right: 36rpx; padding-right: 36rpx;
padding-bottom: 28rpx; padding-bottom: 28rpx; */
/* border: 2px solid red; */
} }
.homeGridItem{ .homeGridItem {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 96rpx; width: 96rpx;
align-items: center; align-items: center;
margin-top: 15rpx; margin-top: 15rpx;
margin-bottom: 15rpx; margin-bottom: 15rpx;
margin-left: 39rpx; margin-left: 39rpx;
margin-right: 39rpx; margin-right: 39rpx;
} }
.homeItemImage{ .homeItemImage {
width: 96rpx; width: 96rpx;
height: 96rpx; height: 96rpx;
} }
.homeItemText{ .homeItemText {
font-size:19rpx; font-size: 19rpx;
font-family:PingFangSC-Medium,PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight:500; font-weight: 500;
color:rgba(0,0,0,1); color: rgba(0, 0, 0, 1);
line-height:27rpx; line-height: 27rpx;
margin-top: 12rpx; margin-top: 12rpx;
} }
/** /**
...@@ -114,12 +122,12 @@ ...@@ -114,12 +122,12 @@
/* border: 2px solid red; */ /* border: 2px solid red; */
} }
/** /**
商品扫码页样式css 商品扫码页样式css
*/ */
/* 整个页面 */ /* 整个页面 */
.pageland { .pageland {
...@@ -449,9 +457,10 @@ ...@@ -449,9 +457,10 @@
} }
/* 返回icon */ /* 返回icon */
.coupon-back-icon{
width: 9rpx; .coupon-back-icon {
height: 18rpx; width: 9rpx;
height: 18rpx;
} }
/* 返回text */ /* 返回text */
...@@ -494,107 +503,107 @@ ...@@ -494,107 +503,107 @@
} }
/* 扫券引导图 */ /* 扫券引导图 */
.scan-coupon-guide{
.scan-coupon-guide {
width: 180rpx; width: 180rpx;
height: 155rpx; height: 155rpx;
} }
/* 结算页 */ /* 结算页 */
.topView{ .topView {
position: relative; position: relative;
width: 768rpx; width: 768rpx;
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);
} }
.bodyContainer { .bodyContainer {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
position:relative; position: relative;
width: 768rpx; width: 768rpx;
height: 372rpx; height: 372rpx;
box-sizing: border-box; box-sizing: border-box;
align-items: center; align-items: center;
background: #F3F7F9; background: #F3F7F9;
} }
.leftBody { .leftBody {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
width: 52.8%; width: 52.8%;
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
.contentLine{ .contentLine {
position: relative; position: relative;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: baseline; align-items: baseline;
width: 100%; width: 100%;
height:auto; height: auto;
padding-left: 29rpx; padding-left: 29rpx;
} }
.rightBody{ .rightBody {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
position: relative; position: relative;
width: 47.2%; width: 47.2%;
height: 100%; height: 100%;
align-items: center; align-items: center;
background: #ffffff; background: #ffffff;
} }
.remindText{ .remindText {
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(51,51,51,0.85); color: rgba(51, 51, 51, 0.85);
line-height:26rpx; line-height: 26rpx;
margin-top:35rpx; margin-top: 35rpx;
} }
.totalPrice{ .totalPrice {
font-size:22rpx; font-size: 22rpx;
font-family:Helvetica; font-family: Helvetica;
color:rgba(51,51,51,0.85); color: rgba(51, 51, 51, 0.85);
line-height:22rpx; line-height: 22rpx;
} }
.totalCoupon{ .totalCoupon {
font-size:22rpx; font-size: 22rpx;
font-family:PingFangSC-Semibold,PingFang SC; font-family: PingFangSC-Semibold, PingFang SC;
font-weight:600; font-weight: 600;
color:rgba(255,0,0,1); color: rgba(255, 0, 0, 1);
line-height:22rpx; line-height: 22rpx;
} }
.moneySign{ .moneySign {
font-size:38rpx; font-size: 38rpx;
font-family:AlibabaPuHuiTiB; font-family: AlibabaPuHuiTiB;
color:rgba(0,122,255,1); color: rgba(0, 122, 255, 1);
line-height:53rpx; line-height: 53rpx;
} }
.payPrice{ .payPrice {
font-size:36rpx; font-size: 36rpx;
font-family:DINAlternate-Bold,DINAlternate; font-family: DINAlternate-Bold, DINAlternate;
font-weight:bold; font-weight: bold;
color:rgba(0,122,255,1); color: rgba(0, 122, 255, 1);
line-height:26rpx; line-height: 26rpx;
letter-spacing:1rpx; letter-spacing: 1rpx;
} }
.descText{ .descText {
font-size:19rpx; font-size: 19rpx;
font-family:PingFangSC-Regular,PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
font-weight:400; font-weight: 400;
color:rgba(0,0,0,0.65); color: rgba(0, 0, 0, 0.65);
line-height:27rpx; line-height: 27rpx;
} }
\ No newline at end of file
<view> <view>
<view class="homePage" hidden="{{!pageShow['home']}}"> <view class="homePage" hidden="{{!pageShow['home']}}">
<view class="topView"> <view class="homeTopView">
<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"/> <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> <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="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;"> <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;">退出</view> <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>
<image mode="aspectFit" src="/images/icon_exit.png" style="position:relative;width:19rpx;height:19rpx;margin-right:8rpx;margin-top:1rpx;"/> <image mode="aspectFit" src="/images/icon_exit.png" style="position:relative;width:19rpx;height:19rpx;margin-right:8rpx;margin-top:1rpx;"/>
</view> </view>
</view> </view>
<view class="homeBodyView"> <view class="homeBodyView">
<!-- 还需要加一层swiper --> <!-- 还需要加一层swiper -->
<view class="homeGridItem" onTap="sendGoToCollections"> <view class="homeGridItem" catchTap="sendGoToCollections">
<image mode="aspectFit" src="/images/collections.png" class="homeItemImage"/> <image mode="aspectFit" src="/images/collections.png" class="homeItemImage"/>
<view class="homeItemText">收银</view> <view class="homeItemText">收银</view>
</view> </view>
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
<!--top view--> <!--top view-->
<view class="topView"> <view class="topView">
<!--back button--> <!--back button-->
<view class="backButton"> <view class="backButton" hidden="true">
<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>
......
...@@ -8,6 +8,8 @@ import { ACTION_REPRINT } from '../../const/actioncmd' ...@@ -8,6 +8,8 @@ import { ACTION_REPRINT } from '../../const/actioncmd'
import { ACTION_GO_SCAN } from '../../const/actioncmd' import { ACTION_GO_SCAN } from '../../const/actioncmd'
import { ACTION_ON_PAY_SUCCESS } from '../../const/actioncmd' import { ACTION_ON_PAY_SUCCESS } from '../../const/actioncmd'
import { ACTION_ON_PAY_FAILED } from '../../const/actioncmd' import { ACTION_ON_PAY_FAILED } from '../../const/actioncmd'
import { ACTION_GO_HOME } from '../../const/actioncmd'
Page({ Page({
data: { data: {
...@@ -26,6 +28,7 @@ Page({ ...@@ -26,6 +28,7 @@ Page({
printResult: "正在打印小票...", printResult: "正在打印小票...",
isPrinting: false, isPrinting: false,
isPrintSuccess: false, isPrintSuccess: false,
payPriceFen: 0,
/**商品扫码页相关参数 */ /**商品扫码页相关参数 */
//是否正在用券 //是否正在用券
couponUseing: false, couponUseing: false,
...@@ -53,9 +56,6 @@ Page({ ...@@ -53,9 +56,6 @@ Page({
for (var key in pageShowTemp) { for (var key in pageShowTemp) {
if (key == pageName) { if (key == pageName) {
pageShowTemp[key] = true; pageShowTemp[key] = true;
my.showToast({
content: "跳页"
});
} else { } else {
pageShowTemp[key] = false; pageShowTemp[key] = false;
} }
...@@ -101,6 +101,16 @@ Page({ ...@@ -101,6 +101,16 @@ Page({
printResult: "打印失败" printResult: "打印失败"
}); });
} }
} else if (res.action == ACTION_GO_HOME) {
//重制打印状态
this.setData({
isPrinting: true,
printResult: "正在打印...",
payPriceYuan: "--.--",
payPriceFen: 0
});
//跳首页
context.goPage('home');
} else if (res.action == ACTION_GOODS) { } else if (res.action == ACTION_GOODS) {
//商品信息同步 //商品信息同步
my.hideLoading(); my.hideLoading();
...@@ -118,17 +128,25 @@ Page({ ...@@ -118,17 +128,25 @@ Page({
context.goPage('landscan'); context.goPage('landscan');
} else if (res.action == ACTION_GO_BALANCE) { } else if (res.action == ACTION_GO_BALANCE) {
//跳转 //跳转
context.goPage('waitoperate') context.goPage('waitoperate');
} else if (res.action == ACTION_ON_PAY_SUCCESS) { } else if (res.action == ACTION_ON_PAY_SUCCESS) {
//分转元
var miyapay = require("/utils/miyapay4.js");
context.setData({ context.setData({
isPaySuccess: true isPaySuccess: true,
payPriceFen: res.data.tradeAmount,
payPriceYuan: miyapay.fen2Yuan(res.data.tradeAmount) + "",
}); });
context.goPage('payresult'); context.goPage('payresult');
} else if (res.action == ACTION_ON_PAY_FAILED) { } else if (res.action == ACTION_ON_PAY_FAILED) {
context.setData({ context.setData({
isPaySuccess: false isPaySuccess: false,
}); });
context.goPage("payresult");
context.goPage('payresult');
} else { } else {
//未知指令 //未知指令
} }
...@@ -182,13 +200,22 @@ Page({ ...@@ -182,13 +200,22 @@ Page({
}, },
onNextPayFromPayResult() { onNextPayFromPayResult() {
//重制打印状态 //通知前屏跳首页
this.setData({ my.ix.sendBuddyMessage({
isPrinting: true, target: getApp().globalData.frontScreenAppId,
printResult: "正在打印..." data: {
action: ACTION_GO_HOME,
data: null
},
success: (res) => {
console.log("发送收银事件到前屏小程序 成功 ===》" + JSON.stringify(res));
},
fail: (res) => {
console.log("发送收银事件到前屏小程序 失败 ===》 " + JSON.stringify(res));
},
}); });
//跳转首页
this.goPage('home');
}, },
//跳转到收银页面 //跳转到收银页面
...@@ -216,7 +243,8 @@ Page({ ...@@ -216,7 +243,8 @@ Page({
my.showToast({ my.showToast({
content: "首页发送数据失败" content: "首页发送数据失败"
}); });
} console.log("发送收银事件到前屏小程序 ===》" + JSON.stringify(res));
},
}); });
}, },
...@@ -381,9 +409,7 @@ Page({ ...@@ -381,9 +409,7 @@ Page({
}, },
}); });
} }
}) });
//跳转结算页
this.goPage('waitoperate');
}, },
//用券返回 //用券返回
......
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