Commit d2f77b98 authored by pengguangpu's avatar pengguangpu

合并远程代码;

parents 78348b55 e7d8777a
...@@ -83,6 +83,9 @@ export const ACTION_VERIFY_FAILED = "ACTION_VERIFY_FAILED"; ...@@ -83,6 +83,9 @@ export const ACTION_VERIFY_FAILED = "ACTION_VERIFY_FAILED";
//提货 //提货
export const ACTION_PICK_UP_GOODS = "ACTION_PICK_UP_GOODS"; export const ACTION_PICK_UP_GOODS = "ACTION_PICK_UP_GOODS";
//退出
export const ACTION_QUIT = "ACTION_QUIT";
const FLOW_IDLE = "idle"; const FLOW_IDLE = "idle";
const FLOW_COLLECTIONS = "collections";//收款 const FLOW_COLLECTIONS = "collections";//收款
const FLOW_REFUND = "refund";//退款 const FLOW_REFUND = "refund";//退款
......
...@@ -136,4 +136,15 @@ ...@@ -136,4 +136,15 @@
.input-finished-text { .input-finished-text {
font-size: 24rpx; font-size: 24rpx;
color: white color: white
}
/* 错误提示 */
.err-msg {
font-size: 22rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(249, 97, 70, 1);
line-height: 30rpx;
margin-top: 20rpx;
} }
\ No newline at end of file
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
</view> </view>
<view class="result-baseline"> <view class="result-baseline">
</view> </view>
<text class="err-msg" a:if="{{errMsg != ''}}">{{errMsg}}</text>
</view> </view>
<view class="keybord-right"> <view class="keybord-right">
<image class="keybord-close" mode="aspectFit" src="/images/close_keybord.png" catchTap="closeKeybord" /> <image class="keybord-close" mode="aspectFit" src="/images/close_keybord.png" catchTap="closeKeybord" />
......
...@@ -3,15 +3,15 @@ Component({ ...@@ -3,15 +3,15 @@ Component({
data: { data: {
result: "", result: "",
scenes: 2, scenes: 2,
errMsg: ""
}, },
props: { props: {
//场景 1.输入商品码 2.会员 3.收款 4.退款 //场景 1.输入商品码 2.会员 3.收款 4.退款
scene: 1, scene: 1,
//错误提示
errMsg: ''
}, },
didMount() { }, didMount() { },
didUpdate() { }, didUpdate() { },
...@@ -22,6 +22,7 @@ Component({ ...@@ -22,6 +22,7 @@ Component({
if (nextProps.scene == 0) { if (nextProps.scene == 0) {
this.setData({ this.setData({
result: '', result: '',
errMsg: '',
}); });
} }
...@@ -66,18 +67,24 @@ Component({ ...@@ -66,18 +67,24 @@ Component({
this.setData({ result: '' }); this.setData({ result: '' });
} }
}, finish(e) { }, finish(e) {
this.setData({ errMsg: "" })
if (this.data.scenes == 3 || this.data.scenes == 4) { if (this.data.scenes == 3 || this.data.scenes == 4) {
//判断价格是否参数合法 //判断价格是否参数合法
var priceReg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/; var priceReg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
if (!priceReg.test(this.data.result)) { if (!priceReg.test(this.data.result)) {
//错误提示 //错误提示
this.setData({ errMsg: "金额格式有误" })
return
}
} else if (this.data.scenes == 2) {
if (this.data.result == null || this.data.result.length != 11) {
this.setData({ errMsg: "会员号格式有误" })
return return
} }
} }
this.props.onKeyBordFinished(this.data.result); this.props.onKeyBordFinished(this.data.result);
},closeKeybord(e){ }, closeKeybord(e) {
this.props.onKeyBordClose(); this.props.onKeyBordClose();
} }
......
...@@ -306,8 +306,9 @@ ...@@ -306,8 +306,9 @@
} }
/* 提货成功 */ /* 提货成功 */
.pick-goods-success-container{
height: 100%; .pick-goods-success-container {
height: 100%;
width: 45%; width: 45%;
background: white; background: white;
display: flex; display: flex;
...@@ -828,6 +829,7 @@ ...@@ -828,6 +829,7 @@
} }
/* 提货 商品已交付*/ /* 提货 商品已交付*/
.pick-goods-success { .pick-goods-success {
width: 200rpx; width: 200rpx;
height: 60rpx; height: 60rpx;
...@@ -1195,27 +1197,17 @@ ...@@ -1195,27 +1197,17 @@
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16); box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
} }
.about-system-back-icon {
width: 9rpx;
height: 18rpx;
}
.about-system-back { .about-system-back {
width: 95rpx; width: 95rpx;
height: 60rpx; height: 60rpx;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
display: flex; display: flex;
flex-direction: row flex-direction: row;
} position: absolute;
text-align: center;
.about-system-back-text {
font-size: 19rpx; font-size: 19rpx;
font-family: PingFangSC-Regular, PingFang SC; line-height: 60rpx;
font-weight: 400;
color: rgba(51, 51, 51, 1);
line-height: 22rpx;
margin-left: 5rpx
} }
.about-system-title { .about-system-title {
...@@ -1285,7 +1277,6 @@ ...@@ -1285,7 +1277,6 @@
.toastLayout { .toastLayout {
text-align: center; text-align: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute; position: absolute;
......
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
<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;left:0rpx;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;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><image mode="aspectFit" src="/images/icon_exit.png" style="position:relative;width:19rpx;height:19rpx;margin-right:8rpx;margin-top:1rpx;"/></view> --> <view style="display:flex;flex-direction:row-reverse;position:absolute;right:19rpx;top:19rpx;width:auto;background:#ffffff;" onTap="onQuit">
<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>
<view class="homeBodyView" style="height:100%;"> <view class="homeBodyView" style="height:100%;">
<swiper indicator-dots="{{true}}"> <swiper indicator-dots="{{true}}">
...@@ -202,7 +204,7 @@ ...@@ -202,7 +204,7 @@
<image id="{{item.barcode}}" class="good-del" mode="aspectFit" src="/images/harf_delete.png" catchTap="deleteGood" /> <image id="{{item.barcode}}" class="good-del" mode="aspectFit" src="/images/harf_delete.png" catchTap="deleteGood" />
</view> </view>
<view class="good-bottom"> <view class="good-bottom">
<view class="good-price">¥{{item.price}}</view> <view class="good-price">¥{{(item.price/100).toFixed(2)}}</view>
<view class="good-operat"> <view class="good-operat">
<image id="{{item.barcode}}" class="good-decrease" mode="scaleToFill" src="/images/good_decrease.png" catchTap="decreaseGood"/> <image id="{{item.barcode}}" class="good-decrease" mode="scaleToFill" src="/images/good_decrease.png" catchTap="decreaseGood"/>
<text class="good-num">{{item.quantity}}</text> <text class="good-num">{{item.quantity}}</text>
...@@ -484,13 +486,13 @@ ...@@ -484,13 +486,13 @@
</view> </view>
</view> </view>
<!-- 关于系统 --> <!-- 关于系统 -->
<view hidden="{{!pageShow['aboutsystem']}}" style="background:#ffffff"> <view hidden="{{!pageShow['aboutsystem']}}" style="background:#FFFFFF;">
<view class="about-system-top"> <view class="about-system-top">
<view class="about-system-title">关于系统</view>
<view class="about-system-back" catchTap="goHome"> <view class="about-system-back" catchTap="goHome">
<image class="about-system-back-icon" mode="aspectFit" src="/images/icon_back.png"/> <image mode="aspectFit" style="width:9rpx;height:18rpx;margin-right:8rpx;" src="/images/icon_back.png"/>
<text class="about-system-back-text">返回</text> <text>返回</text>
</view> </view>
<view class="about-system-title">关于系统</view>
</view> </view>
<view class="about-system-body"> <view class="about-system-body">
<view class="about-system-item" style="margin-top:60rpx;"> <view class="about-system-item" style="margin-top:60rpx;">
...@@ -520,13 +522,13 @@ ...@@ -520,13 +522,13 @@
</view> </view>
</view> </view>
<!-- 应用设置 --> <!-- 应用设置 -->
<view hidden="{{!pageShow['appsetting']}}" style="background:#ffffff"> <view hidden="{{!pageShow['appsetting']}}" style="background:#FFFFFF;">
<view class="about-system-top"> <view class="about-system-top">
<view class="about-system-title">应用设置</view>
<view class="about-system-back" catchTap="goHome"> <view class="about-system-back" catchTap="goHome">
<image class="about-system-back-icon" mode="aspectFit" src="/images/icon_back.png"/> <image mode="aspectFit" style="width:9rpx;height:18rpx;margin-right:8rpx;" src="/images/icon_back.png"/>
<text class="about-system-back-text">返回</text> <text>返回</text>
</view> </view>
<view class="about-system-title">应用设置</view>
</view> </view>
<view class="about-system-body"> <view class="about-system-body">
<view class="app-setting-item"> <view class="app-setting-item">
......
...@@ -3,12 +3,12 @@ import { ...@@ -3,12 +3,12 @@ import {
ACTION_USE_COUPON, ACTION_GOODS, ACTION_MEMBER, ACTION_USE_COUPON, ACTION_GOODS, ACTION_MEMBER,
ACTION_GO_BALANCE, ACTION_REQUEST_GOOD_INFO, ACTION_PRINT_RESULT, ACTION_GO_BALANCE, ACTION_REQUEST_GOOD_INFO, ACTION_PRINT_RESULT,
ACTION_REPRINT, ACTION_GO_SCAN, ACTION_ON_PAY_SUCCESS, ACTION_REPRINT, ACTION_GO_SCAN, ACTION_ON_PAY_SUCCESS,
ACTION_ON_PAY_FAILED, ACTION_GO_HOME, ACTION_ON_PAY_FAILED, ACTION_GO_HOME, ACTION_QUIT,
ACTION_DIRECT_PAYMENT, ACTION_CONVERT_COUPON, ACTION_LOGIN_OK, ACTION_DIRECT_PAYMENT, ACTION_CONVERT_COUPON, ACTION_LOGIN_OK,
ACTION_REFUND, ACTION_REFUND_SUCCESS, ACTION_REFUND_FAILED, ACTION_REFUND, ACTION_REFUND_SUCCESS, ACTION_REFUND_FAILED,
ACTION_PRINT_LAST_ORDER, ACTION_GET_CUR_AD, ACTION_SEND_SEL_AD, ACTION_PRINT_LAST_ORDER, ACTION_GET_CUR_AD, ACTION_SEND_SEL_AD,
ACTION_SYSTEM_SETTING, ACTION_BALANCE_BACK_GOODS, ACTION_DAY_CHECK, ACTION_SYSTEM_SETTING, ACTION_BALANCE_BACK_GOODS, ACTION_DAY_CHECK,
ACTION_VERIFY, ACTION_VERIFY_SUCCESS, ACTION_VERIFY_FAILED,ACTION_PICK_UP_GOODS ACTION_VERIFY, ACTION_VERIFY_SUCCESS, ACTION_VERIFY_FAILED, ACTION_PICK_UP_GOODS
} from '../../const/actioncmd' } from '../../const/actioncmd'
import { FLOW_IDLE, FLOW_COLLECTIONS, FLOW_REFUND, FLOW_DIRECT_PAYMENT, FLOW_VERIFY } from '../../const/actioncmd' import { FLOW_IDLE, FLOW_COLLECTIONS, FLOW_REFUND, FLOW_DIRECT_PAYMENT, FLOW_VERIFY } from '../../const/actioncmd'
...@@ -57,7 +57,7 @@ Page({ ...@@ -57,7 +57,7 @@ Page({
//提货 0关闭 提货弹窗 1等待扫描提货码 2.提货码录入中 3.提货码录入成功 4.提货码录入失败 //提货 0关闭 提货弹窗 1等待扫描提货码 2.提货码录入中 3.提货码录入成功 4.提货码录入失败
pickGoodsState: 0, pickGoodsState: 0,
pickGoodsMsg: "录入失败!无效的提货码", pickGoodsMsg: "录入失败!无效的提货码",
pickGoods: [], pickGoods: [],
//优惠券 0关闭 录入券弹窗 1等待录入 2.录入中 3.录入成功 4.录入失败 //优惠券 0关闭 录入券弹窗 1等待录入 2.录入中 3.录入成功 4.录入失败
discCouponState: 0, discCouponState: 0,
...@@ -115,6 +115,9 @@ Page({ ...@@ -115,6 +115,9 @@ Page({
{ url: "/images/img_ad1.png", selected: true }, { url: "/images/img_ad1.png", selected: true },
{ url: "/images/img_ad2.png", selected: false }, { url: "/images/img_ad2.png", selected: false },
], ],
/**键盘 */
keyboardErrMsg: "",
}, },
/** /**
...@@ -161,7 +164,7 @@ Page({ ...@@ -161,7 +164,7 @@ Page({
onLoad(query) { onLoad(query) {
// 页面加载 // 页面加载
console.info(`Page onLoad with query: ${JSON.stringify(query)}`); console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
}, },
onReady() { onReady() {
// 页面加载完成 // 页面加载完成
...@@ -395,10 +398,12 @@ Page({ ...@@ -395,10 +398,12 @@ Page({
operateReDo: "重新扫描", operateReDo: "重新扫描",
}); });
context.goPage('operateresult'); context.goPage('operateresult');
}else if(res.action == ACTION_PICK_UP_GOODS){ } else if (res.action == ACTION_PICK_UP_GOODS) {
//提货 //提货
context.setData({pickGoods:res.data.pickGoods context.setData({
,pickGoodsState:res.data.pickGoodsState}) pickGoods: res.data.pickGoods
, pickGoodsState: res.data.pickGoodsState
})
} }
} }
}); });
...@@ -422,9 +427,36 @@ Page({ ...@@ -422,9 +427,36 @@ Page({
// 页面被拉到底部 // 页面被拉到底部
}, },
onQuit() {
console.log("onQuit");
this.setData({
isFrontScreenLoginOK: false,
storeName: "--",
storeId: "--",
userName: "--",
})
this.goPage('home')
my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId,
data: {
action: ACTION_QUIT,
data: null
},
success: (res) => {
console.log("通知前屏退出 成功 ===》" + JSON.stringify(res));
},
fail: (res) => {
console.log("通知前屏退出 失败 ===》" + JSON.stringify(res));
}
})
},
//回到首页 //回到首页
goHome() { goHome() {
console.log("goHome");
let context = this; let context = this;
my.ix.sendBuddyMessage({ my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId, target: getApp().globalData.frontScreenAppId,
...@@ -586,7 +618,7 @@ Page({ ...@@ -586,7 +618,7 @@ Page({
console.log("提货通知前屏 失败 ===》 " + JSON.stringify(fres)); console.log("提货通知前屏 失败 ===》 " + JSON.stringify(fres));
} }
}) })
}, },
/**日结 */ /**日结 */
onHomeDayCheckClicked() { onHomeDayCheckClicked() {
...@@ -705,7 +737,7 @@ Page({ ...@@ -705,7 +737,7 @@ Page({
discCouponState: 0, discCouponState: 0,
discCouponMsg: "", discCouponMsg: "",
discCouponPrice: 0, discCouponPrice: 0,
}) })
var commonRequest = { var commonRequest = {
...@@ -792,9 +824,6 @@ Page({ ...@@ -792,9 +824,6 @@ Page({
} else if (this.data.scene == 1) { } else if (this.data.scene == 1) {
this.sendGoodsInfoToFront(result) this.sendGoodsInfoToFront(result)
} else if (this.data.scene == 2) { } else if (this.data.scene == 2) {
if (result.length != 11) {
return;//键盘不给消失
}
this.sendMemberLogin(result); this.sendMemberLogin(result);
} else if (this.data.scene == 4) { } else if (this.data.scene == 4) {
this.sendRefund(result); this.sendRefund(result);
...@@ -847,7 +876,7 @@ Page({ ...@@ -847,7 +876,7 @@ Page({
//清空商品信息 //清空商品信息
clearGood(e) { clearGood(e) {
this.setData({ goods: [] }) this.setData({ goods: [], discCouponPrice: 0 })
this.calculation([]); this.calculation([]);
}, },
...@@ -915,14 +944,20 @@ Page({ ...@@ -915,14 +944,20 @@ Page({
quantitytemp = quantitytemp + item.quantity quantitytemp = quantitytemp + item.quantity
pricetemp = pricetemp + item.price * item.quantity pricetemp = pricetemp + item.price * item.quantity
}) })
pricetemp = this.fen2Yuan(pricetemp)
this.setData({ totalQuantity: quantitytemp, totalPrice: pricetemp }) this.setData({ totalQuantity: quantitytemp, totalPrice: pricetemp })
//数据同步到前屏 //数据同步到前屏
this.sendGoodInfoToFront() this.sendGoodInfoToFront()
}, },
fen2Yuan(num) {
if (typeof num !== "number" || isNaN(num)) return null;
return (num / 100).toFixed(2);
},
sendMemberLogin(result) {
sendMemberLogin(result) {
this.setData({ this.setData({
memberPhone: result memberPhone: result
}) })
...@@ -1119,6 +1154,12 @@ Page({ ...@@ -1119,6 +1154,12 @@ Page({
}, },
//使用券 //使用券
useCoupon(e) { useCoupon(e) {
if (this.data.goods.length == 0) {
this.showToast("请先录入商品")
return
}
this.setData({ discCouponState: 1 }) this.setData({ discCouponState: 1 })
var request = {}; var request = {};
request.discCouponState = 1; request.discCouponState = 1;
......
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