Commit 7f51e390 authored by pengguangpu's avatar pengguangpu

合并远程代码;

parents 7cc39e5a 3148b44c
{ {
"pages": [ "pages": [
"pages/login/login", "pages/login/login",
"pages/home/home",
"pages/paysuccess/paysuccess", "pages/paysuccess/paysuccess",
"pages/balance/balance", "pages/balance/balance",
"pages/scan/scan", "pages/scan/scan"
"pages/home/home"
], ],
"window": { "window": {
"defaultTitle": "" "defaultTitle": ""
......
...@@ -67,6 +67,8 @@ export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING"; ...@@ -67,6 +67,8 @@ export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING";
//结算页面back到扫商品页面 //结算页面back到扫商品页面
export const ACTION_BALANCE_BACK_GOODS = "ACTION_BALANCE_BACK_GOODS"; export const ACTION_BALANCE_BACK_GOODS = "ACTION_BALANCE_BACK_GOODS";
//提货
export const ACTION_PICK_UP_GOODS = "ACTION_PICK_UP_GOODS";
//打印日结订单 //打印日结订单
export const ACTION_DAY_CHECK = "ACTION_DAY_CHECK"; export const ACTION_DAY_CHECK = "ACTION_DAY_CHECK";
//核验 //核验
......
...@@ -98,13 +98,6 @@ Page({ ...@@ -98,13 +98,6 @@ Page({
}, },
onReady() {
if (my.canIUse('hideBackHome')) {
my.hideBackHome();
}
},
onShow() { onShow() {
my.ix.onBuddyMessage({ my.ix.onBuddyMessage({
success: (res) => { success: (res) => {
...@@ -138,7 +131,7 @@ Page({ ...@@ -138,7 +131,7 @@ Page({
//获取order //获取order
var payAmount = payUtils.yuan2Fen(this.data.payPrice); var payAmount = payUtils.yuan2Fen(this.data.payPrice);
payUtils.getOrder(/*payAmount*/1, this.data.list, function (res) { payUtils.getOrder(payAmount, this.data.list, function (res) {
if (res != null) { if (res != null) {
console.log("callback调用,res=" + JSON.stringify(res)); console.log("callback调用,res=" + JSON.stringify(res));
...@@ -227,7 +220,7 @@ Page({ ...@@ -227,7 +220,7 @@ Page({
this.setData({ isPaying: true }); this.setData({ isPaying: true });
//使用barCode来当面付 //使用barCode来当面付
var payAmount = payUtils.yuan2Fen(this.data.payPrice); var payAmount = payUtils.yuan2Fen(this.data.payPrice);
payUtils.startPay(orderNo, payCode, /*payAmount*/1, this.data.list, function (res) { payUtils.startPay(orderNo, payCode, payAmount, this.data.list, function (res) {
my.hideLoading(); my.hideLoading();
console.log("支付回调 ===>" + JSON.stringify(res)); console.log("支付回调 ===>" + JSON.stringify(res));
this.setData({ isPaying: false }); this.setData({ isPaying: false });
...@@ -251,7 +244,7 @@ Page({ ...@@ -251,7 +244,7 @@ Page({
my.ix.offCashierEventReceive(); my.ix.offCashierEventReceive();
this.saveData(this.data.list, res.data); this.saveData(this.data.list, res.data);
my.redirectTo({ my.redirectTo({
url: '/pages/paysuccess/paysuccess', url: '/pages/paysuccess/paysuccess?totalGoodsNum=' + this.data.goodsNum,
}); });
//发送支付成功到后屏 //发送支付成功到后屏
......
page{ .page {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
...@@ -6,23 +6,113 @@ page{ ...@@ -6,23 +6,113 @@ page{
align-items: center; align-items: center;
} }
.bg{ .bg {
position:fixed; position: fixed;
width:100%; width: 100%;
height:100%; height: 100%;
left:0rpx; left: 0rpx;
top:0rpx; top: 0rpx;
bottom:0rpx; bottom: 0rpx;
/* background:url(/images/bg_home.png) no-repeat fixed top; */ /* background:url(/images/bg_home.png) no-repeat fixed top; */
background-size:100% 100%; background-size: 100% 100%;
/* border: 2px solid red; */ /* border: 2px solid red; */
box-sizing: border-box; box-sizing: border-box;
} }
.container{ .container {
position: relative; position: relative;
width: 750rpx; width: 750rpx;
height: 430rpx; height: 430rpx;
margin: 0 auto; margin: 0 auto;
margin-top: 38rpx; margin-top: 38rpx;
} }
/* 商品价格 */
.good-list-item-price-font {
color: #F96146;
font-size: 44rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
margin-left: 24rpx;
}
/* 商品数量 */
.good-list-item-quantity-font {
color: #8C8C8C;
font-size: 32rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
margin-right: 24rpx
}
/* 商品名称 */
.good-list-item-name-font {
color: #333333;
font-size: 32rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
margin-left: 24rpx;
margin-top: 25rpx;
}
/* 商品列表项价格和数量 */
.scan-good-list-item {
display: flex;
flex-direction: row;
width: 100%;
height: 80rpx;
justify-content: space-between;
align-items: center;
}
/* 商品列表项背景 */
.scan-list-bg {
height: 158rpx;
border-radius: 16px;
background-color: white;
margin-bottom: 24rpx;
box-shadow: 0px 2px 10px 0px rgba(77, 81, 102, 0.1);
display: flex;
flex-direction: column;
}
/* 提货商品布局 */
.page-pick-goods {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
height: 100%;
position: absolute;
background: url(/images/scan_header_bg.png) no-repeat fixed top;
background-size: 100% 200rpx;
}
/* 提货商品布局top部分 */
.pick-goods-header {
width: 100%;
height: 200rpx;
display: flex;
flex-direction: column;
font-size: 42px;
align-items: center;
justify-content: center;
font-size: 40rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
}
/* 提货商品body部分 */
.pick-goods-body {
width: 700rpx;
height: 100%;
background: transparent;
margin-top: 45rpx
}
\ No newline at end of file
<view class="page" > <view class="page">
<view class="bg" onTap="homeTap"> <view class="bg" onTap="homeTap" a:if="{{pickGoodsState != 3}}">
<image mode="scaleToFill" style="width:100%;height:100%;" src="{{adUrl}}"/> <image mode="scaleToFill" style="width:100%;height:100%;" src="{{adUrl}}"/>
</view> </view>
<!-- 提货布局 -->
<!-- 弹窗 --> <view class="page-pick-goods" a:if="{{pickGoodsState == 3}}">
<scandialog displayDialog="{{scanDialogDisplay}}" <view class="pick-goods-header">
remindText="{{dialogRemindText}}" 提货商品如下
loadingText="{{dialogLoadingText}}" </view>
resultSuccessRemind="{{dialogResultSuccessRemind}}" <scroll-view class="pick-goods-body" scroll-y a:if="{{pickGoods.length > 0}}">
resultSuccessText="{{dialogResultSuccessText}}" <block a:for="{{pickGoods}}">
resultFailureRemind="{{dialogResultFailureRemind}}" <view class="scan-list-bg">
resultFailureText="{{dialogResultFailureText}}" <view class="good-list-item-name-font">
/> {{item.name}}
</view>
<view class="scan-good-list-item">
<view class="good-list-item-price-font">¥{{item.price}}</view>
<view class="good-list-item-quantity-font">
{{item.quantity}}件
</view>
</view>
</view>
</block>
</scroll-view>
</view>
<!-- 弹窗 -->
<scandialog displayDialog="{{scanDialogDisplay}}" remindText="{{dialogRemindText}}" loadingText="{{dialogLoadingText}}" resultSuccessRemind="{{dialogResultSuccessRemind}}" resultSuccessText="{{dialogResultSuccessText}}" resultFailureRemind="{{dialogResultFailureRemind}}" resultFailureText="{{dialogResultFailureText}}" />
</view> </view>
\ No newline at end of file
...@@ -10,7 +10,7 @@ import { ...@@ -10,7 +10,7 @@ import {
ACTION_GO_HOME, ACTION_REFUND, ACTION_REFUND_FAILED, ACTION_GO_HOME, ACTION_REFUND, ACTION_REFUND_FAILED,
ACTION_REFUND_SUCCESS, ACTION_PRINT_LAST_ORDER, ACTION_REFUND_SUCCESS, ACTION_PRINT_LAST_ORDER,
ACTION_SYSTEM_SETTING, ACTION_VERIFY, ACTION_VERIFY_SUCCESS, ACTION_SYSTEM_SETTING, ACTION_VERIFY, ACTION_VERIFY_SUCCESS,
ACTION_VERIFY_FAILED,ACTION_DAY_CHECK, ACTION_VERIFY_FAILED,ACTION_DAY_CHECK,ACTION_PICK_UP_GOODS
} from '../../const/actioncmd' } from '../../const/actioncmd'
...@@ -18,7 +18,7 @@ Page({ ...@@ -18,7 +18,7 @@ Page({
data: { data: {
//显示弹窗,>1为显示,2loading 3 result success 4 result failed //显示弹窗,>1为显示,2loading 3 result success 4 result failed
scanDialogDisplay: 0, scanDialogDisplay: 0,
dialogShowType: "",//弹窗类型:如refund coupon verify dialogShowType: "",//弹窗类型:如refund coupon verify pickgoods
dialogRemindText: "请扫描兑换码", dialogRemindText: "请扫描兑换码",
dialogLoadingText: "识别中", dialogLoadingText: "识别中",
dialogResultSuccessRemind: "兑换码已识别", dialogResultSuccessRemind: "兑换码已识别",
...@@ -27,10 +27,24 @@ Page({ ...@@ -27,10 +27,24 @@ Page({
dialogResultFailureText: "兑换失败,请稍后重试!", dialogResultFailureText: "兑换失败,请稍后重试!",
adUrl: "/images/img_ad1.png", adUrl: "/images/img_ad1.png",
toSetting: false, toSetting: false,
//提货
pickGoodsState: 0,
pickGoodsMsg: "录入失败!无效的提货码",
pickGoods: [],
}, },
onLoad() { onLoad() {
let pickgoodsTemp = []
for(var i = 0;i < 3;i++){
var good = {};
good.name = "SK-II R.N.A.超肌能紧致弹力精华"
good.price = "1098"
good.quantity = 1
pickgoodsTemp.push(good)
}
this.setData({pickGoods:pickgoodsTemp})
}, },
onShow() { onShow() {
...@@ -174,6 +188,35 @@ Page({ ...@@ -174,6 +188,35 @@ Page({
context.setData({ context.setData({
toSetting: true, toSetting: true,
}) })
}else if(res.action == ACTION_PICK_UP_GOODS){
//提货
context.setData({
scanDialogDisplay: res.data,
dialogShowType: "pickgoods",//弹窗类型:如refund coupon pickgoods
dialogRemindText: "请扫描提货码",
dialogLoadingText: "识别中",
dialogResultSuccessRemind: "提货码已识别",
dialogResultSuccessText: "恭喜您!提货成功",
dialogResultFailureRemind: "提货失败",
dialogResultFailureText: "提货失败!无效的提货码!",
});
if (res.data != 0) {
var speechContent = "请扫描提货码";
my.ix.speech({
text: speechContent,
speak: true,
success: (r) => {
}
});
}
//隐藏提货页面
if(res.data == 0){
context.setData({
pickGoodsState:0,
pickGoods:[]
})
}
} else if (res.action == ACTION_DAY_CHECK) { } else if (res.action == ACTION_DAY_CHECK) {
//本地先写死数据 //本地先写死数据
context.printDayCheck(); context.printDayCheck();
...@@ -376,6 +419,9 @@ Page({ ...@@ -376,6 +419,9 @@ Page({
} else if (this.data.dialogShowType == "coupon") { } else if (this.data.dialogShowType == "coupon") {
// 兑换券 // 兑换券
this.verifyCoupon(r); this.verifyCoupon(r);
}else if (this.data.dialogShowType == "pickgoods") {
// 提货
this.pickGoods(r);
} else if (this.data.dialogShowType == "verify") { } else if (this.data.dialogShowType == "verify") {
this.verify(r); this.verify(r);
} }
...@@ -574,7 +620,39 @@ Page({ ...@@ -574,7 +620,39 @@ Page({
}, },
//提货商品
pickGoods(code) {
let context = this;
this.setData({ scanDialogDisplay: 2 })
setTimeout(() => {
//模拟提货数据
let pickgoodsTemp = []
for(var i = 0;i < 3;i++){
var good = {};
good.name = "SK-II R.N.A.超肌能紧致弹力精华"
good.price = "1098"
good.quantity = 1
pickgoodsTemp.push(good)
}
let pickGoodsReq = {}
pickGoodsReq.pickGoodsState=3;
pickGoodsReq.pickGoods = pickgoodsTemp;
my.ix.sendBuddyMessage({
target: getApp().globalData.backScreenAppId,
data: {
action: ACTION_PICK_UP_GOODS,
data: pickGoodsReq
},
success: (sres) => {
context.setData({pickGoods:pickgoodsTemp,pickGoodsState:3,scanDialogDisplay:0})
},
fail: (fres) => {
console.info(`sendBuddyMessage failed: ${JSON.stringify(res)}`);
}
});
}, 700);
},
}); });
...@@ -146,8 +146,6 @@ Page({ ...@@ -146,8 +146,6 @@ Page({
context.sendGoodInfoToBack(); context.sendGoodInfoToBack();
} }
}) })
}, 700); }, 700);
}, },
......
...@@ -9,11 +9,11 @@ export default class scan { ...@@ -9,11 +9,11 @@ export default class scan {
if (!page._keyEventListener) { if (!page._keyEventListener) {
//摄像头 //摄像头
my.ix.onCodeScan((r) => { my.ix.onCodeScan((r) => {
if (r.success){ if (r.success) {
let cur = getCurrentPages().slice(-1)[0]; let cur = getCurrentPages().slice(-1)[0];
cur.onKeyPress.call(cur, code); cur.onKeyPress.call(cur, code);
} }
console.log('code: ' + r.code); console.log('code: ' + r.code);
}); });
//物理扫码枪 //物理扫码枪
...@@ -27,7 +27,7 @@ export default class scan { ...@@ -27,7 +27,7 @@ export default class scan {
//兼容扫描枪 //兼容扫描枪
cur.onKeyPress.call(cur, code); cur.onKeyPress.call(cur, code);
isScaning = false isScaning = false
}, 700); }, 1000);
} else { } else {
//特殊处理 keycode需要减7 //特殊处理 keycode需要减7
if (r.keyCode >= 7 && r.keyCode <= 16) { if (r.keyCode >= 7 && r.keyCode <= 16) {
......
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