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