Commit d2f77b98 authored by pengguangpu's avatar pengguangpu

合并远程代码;

parents 78348b55 e7d8777a
......@@ -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_QUIT = "ACTION_QUIT";
const FLOW_IDLE = "idle";
const FLOW_COLLECTIONS = "collections";//收款
const FLOW_REFUND = "refund";//退款
......
......@@ -137,3 +137,14 @@
font-size: 24rpx;
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 @@
</view>
<view class="result-baseline">
</view>
<text class="err-msg" a:if="{{errMsg != ''}}">{{errMsg}}</text>
</view>
<view class="keybord-right">
<image class="keybord-close" mode="aspectFit" src="/images/close_keybord.png" catchTap="closeKeybord" />
......
......@@ -3,15 +3,15 @@ Component({
data: {
result: "",
scenes: 2,
errMsg: ""
},
props: {
//场景 1.输入商品码 2.会员 3.收款 4.退款
scene: 1,
//错误提示
errMsg: ''
},
didMount() { },
didUpdate() { },
......@@ -22,6 +22,7 @@ Component({
if (nextProps.scene == 0) {
this.setData({
result: '',
errMsg: '',
});
}
......@@ -66,17 +67,23 @@ Component({
this.setData({ result: '' });
}
}, finish(e) {
this.setData({ errMsg: "" })
if (this.data.scenes == 3 || this.data.scenes == 4) {
//判断价格是否参数合法
var priceReg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
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
}
}
this.props.onKeyBordFinished(this.data.result);
},closeKeybord(e){
}, closeKeybord(e) {
this.props.onKeyBordClose();
}
......
......@@ -306,7 +306,8 @@
}
/* 提货成功 */
.pick-goods-success-container{
.pick-goods-success-container {
height: 100%;
width: 45%;
background: white;
......@@ -828,6 +829,7 @@
}
/* 提货 商品已交付*/
.pick-goods-success {
width: 200rpx;
height: 60rpx;
......@@ -1195,27 +1197,17 @@
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
}
.about-system-back-icon {
width: 9rpx;
height: 18rpx;
}
.about-system-back {
width: 95rpx;
height: 60rpx;
justify-content: center;
align-items: center;
display: flex;
flex-direction: row
}
.about-system-back-text {
flex-direction: row;
position: absolute;
text-align: center;
font-size: 19rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(51, 51, 51, 1);
line-height: 22rpx;
margin-left: 5rpx
line-height: 60rpx;
}
.about-system-title {
......@@ -1285,7 +1277,6 @@
.toastLayout {
text-align: center;
width: 100%;
height: 100%;
position: absolute;
......
......@@ -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>
</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 class="homeBodyView" style="height:100%;">
<swiper indicator-dots="{{true}}">
......@@ -202,7 +204,7 @@
<image id="{{item.barcode}}" class="good-del" mode="aspectFit" src="/images/harf_delete.png" catchTap="deleteGood" />
</view>
<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">
<image id="{{item.barcode}}" class="good-decrease" mode="scaleToFill" src="/images/good_decrease.png" catchTap="decreaseGood"/>
<text class="good-num">{{item.quantity}}</text>
......@@ -484,13 +486,13 @@
</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-title">关于系统</view>
<view class="about-system-back" catchTap="goHome">
<image class="about-system-back-icon" mode="aspectFit" src="/images/icon_back.png"/>
<text class="about-system-back-text">返回</text>
<image mode="aspectFit" style="width:9rpx;height:18rpx;margin-right:8rpx;" src="/images/icon_back.png"/>
<text>返回</text>
</view>
<view class="about-system-title">关于系统</view>
</view>
<view class="about-system-body">
<view class="about-system-item" style="margin-top:60rpx;">
......@@ -520,13 +522,13 @@
</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-title">应用设置</view>
<view class="about-system-back" catchTap="goHome">
<image class="about-system-back-icon" mode="aspectFit" src="/images/icon_back.png"/>
<text class="about-system-back-text">返回</text>
<image mode="aspectFit" style="width:9rpx;height:18rpx;margin-right:8rpx;" src="/images/icon_back.png"/>
<text>返回</text>
</view>
<view class="about-system-title">应用设置</view>
</view>
<view class="about-system-body">
<view class="app-setting-item">
......
......@@ -3,12 +3,12 @@ import {
ACTION_USE_COUPON, ACTION_GOODS, ACTION_MEMBER,
ACTION_GO_BALANCE, ACTION_REQUEST_GOOD_INFO, ACTION_PRINT_RESULT,
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_REFUND, ACTION_REFUND_SUCCESS, ACTION_REFUND_FAILED,
ACTION_PRINT_LAST_ORDER, ACTION_GET_CUR_AD, ACTION_SEND_SEL_AD,
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'
import { FLOW_IDLE, FLOW_COLLECTIONS, FLOW_REFUND, FLOW_DIRECT_PAYMENT, FLOW_VERIFY } from '../../const/actioncmd'
......@@ -115,6 +115,9 @@ Page({
{ url: "/images/img_ad1.png", selected: true },
{ url: "/images/img_ad2.png", selected: false },
],
/**键盘 */
keyboardErrMsg: "",
},
/**
......@@ -395,10 +398,12 @@ Page({
operateReDo: "重新扫描",
});
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
,pickGoodsState:res.data.pickGoodsState})
context.setData({
pickGoods: res.data.pickGoods
, pickGoodsState: res.data.pickGoodsState
})
}
}
});
......@@ -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() {
console.log("goHome");
let context = this;
my.ix.sendBuddyMessage({
target: getApp().globalData.frontScreenAppId,
......@@ -792,9 +824,6 @@ Page({
} else if (this.data.scene == 1) {
this.sendGoodsInfoToFront(result)
} else if (this.data.scene == 2) {
if (result.length != 11) {
return;//键盘不给消失
}
this.sendMemberLogin(result);
} else if (this.data.scene == 4) {
this.sendRefund(result);
......@@ -847,7 +876,7 @@ Page({
//清空商品信息
clearGood(e) {
this.setData({ goods: [] })
this.setData({ goods: [], discCouponPrice: 0 })
this.calculation([]);
},
......@@ -915,14 +944,20 @@ Page({
quantitytemp = quantitytemp + item.quantity
pricetemp = pricetemp + item.price * item.quantity
})
pricetemp = this.fen2Yuan(pricetemp)
this.setData({ totalQuantity: quantitytemp, totalPrice: pricetemp })
//数据同步到前屏
this.sendGoodInfoToFront()
},
fen2Yuan(num) {
if (typeof num !== "number" || isNaN(num)) return null;
return (num / 100).toFixed(2);
},
sendMemberLogin(result) {
sendMemberLogin(result) {
this.setData({
memberPhone: result
})
......@@ -1119,6 +1154,12 @@ Page({
},
//使用券
useCoupon(e) {
if (this.data.goods.length == 0) {
this.showToast("请先录入商品")
return
}
this.setData({ discCouponState: 1 })
var request = {};
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