|
|
@@ -6,13 +6,17 @@
|
|
|
<view class="fs-32 fc-3 fw-b">你已进入监控区域</view>
|
|
|
|
|
|
<view class="box-1-time">
|
|
|
- <Countdown></Countdown>
|
|
|
+ <Countdown ref="countdown"></Countdown>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
|
|
|
<!-- 2 -->
|
|
|
- <scroll-view scroll-y="true" class="scroll-view-css list-box">
|
|
|
+ <view v-if="goodsList.length == 0" class="scroll-view-css">
|
|
|
+ <image class="no-img" src="@/static/img/no-goods.png" mode="scaleToFill"></image>
|
|
|
+ <view class="fs-30 fc-6 text-align-center">请扫码添加商品</view>
|
|
|
+ </view>
|
|
|
+ <scroll-view v-else scroll-y="true" class="scroll-view-css list-box">
|
|
|
<view class="goods-box flex-justify-space" v-for="(item,i) in goodsList" :key="i">
|
|
|
<image :src="item.cover_img" mode="scaleToFill"></image>
|
|
|
|
|
|
@@ -36,6 +40,9 @@
|
|
|
|
|
|
<!-- 3 -->
|
|
|
<view class="box-2">
|
|
|
+ <view class="">
|
|
|
+ {{msgTest}}
|
|
|
+ </view>
|
|
|
<view class="box-2-shou flex-justify-center align-items-center" @click="headInput()">
|
|
|
<image src="@/static/img/txm.png" mode=""></image>
|
|
|
<view class="fs-30 fc-3 fw-400">手输条码</view>
|
|
|
@@ -57,14 +64,18 @@
|
|
|
<keyboard-listener v-if="outscan" @keyup="monitorKeyboard"></keyboard-listener>
|
|
|
|
|
|
<!-- 支付类型 -->
|
|
|
- <uni-popup ref="popup">
|
|
|
- <view class="pop-view">
|
|
|
- <view class="fs-32 fw-600 pop-1 pop-view-1">请选择支付类型</view>
|
|
|
- <view class="pop-2">
|
|
|
- <view class="fs-32 pop-1 pop-view-1 fc-lv" @click="selectTyep(1)">微信</view>
|
|
|
- <view class="fs-32 pop-1 fc-lan" @click="selectTyep(2)">支付宝</view>
|
|
|
- </view>
|
|
|
+ <uni-popup ref="popup" :mask-click="false">
|
|
|
+ <view class="">
|
|
|
+ <view class="pop-view mb-25">
|
|
|
+ <view class="fs-32 fw-600 pop-1 pop-view-1">请选择支付类型</view>
|
|
|
+ <view class="pop-2">
|
|
|
+ <view class="fs-32 pop-1 pop-view-1 fc-lv" @click="selectTyep(1)">微信</view>
|
|
|
+ <view class="fs-32 pop-1 fc-lan" @click="selectTyep(2)">支付宝</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="code-view-1" @click="closePay()">取消支付</view>
|
|
|
</view>
|
|
|
+
|
|
|
</uni-popup>
|
|
|
|
|
|
<!-- 付款码 -->
|
|
|
@@ -79,9 +90,7 @@
|
|
|
<image src="@/static/img/code-1.png" mode="scaleToFill"></image>
|
|
|
<view class="fs-30 fc-6 text-align-center">对准下方扫描口</view>
|
|
|
</view>
|
|
|
- <view class="code-view-1" @click="closePay()">
|
|
|
- 取消叫i有
|
|
|
- </view>
|
|
|
+ <view class="code-view-1" @click="closePay()">取消支付</view>
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
|
|
|
@@ -119,6 +128,8 @@ export default {
|
|
|
|
|
|
headValue:'',//手动输入的值
|
|
|
|
|
|
+ msgTest:'',
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
|
@@ -146,6 +157,10 @@ export default {
|
|
|
newArr = this.keyArr.filter(item => item != 'Shift' && item != 'Enter' && item != 'Unidentified')
|
|
|
if(this.payFLag){
|
|
|
// 添加商品
|
|
|
+ if(this.isAJAX){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isAJAX = true;
|
|
|
this.nvalue = newArr.join("")
|
|
|
this.getGoods();
|
|
|
}else{
|
|
|
@@ -156,6 +171,7 @@ export default {
|
|
|
this.isAJAX = true;
|
|
|
this.auth_code = newArr.join("")
|
|
|
OrderPay({order_id:this.order_id,pay_type:this.payType,auth_code:this.auth_code}).then((res)=>{
|
|
|
+ this.msgTest = res
|
|
|
if(res.code == 1){
|
|
|
this.payFLag = true;
|
|
|
this.isAJAX = false;
|
|
|
@@ -176,6 +192,7 @@ export default {
|
|
|
getGoods(){
|
|
|
GoodsInfo({goods_sn:this.nvalue}).then((res)=>{
|
|
|
if(res.code == 1){
|
|
|
+ this.isAJAX = false;
|
|
|
if(this.goodsList.length == 0){
|
|
|
let obj = res.data;
|
|
|
obj.num = 1;
|
|
|
@@ -202,6 +219,7 @@ export default {
|
|
|
}
|
|
|
this.headValue = '';
|
|
|
}else{
|
|
|
+ this.isAJAX = false;
|
|
|
this.headValue = '';
|
|
|
tools.error(res.msg)
|
|
|
}
|
|
|
@@ -231,6 +249,7 @@ export default {
|
|
|
this.payFLag = false;
|
|
|
this.$refs.popup.open('center')
|
|
|
}else{
|
|
|
+ this.payFLag = true;
|
|
|
tools.error('请添加商品')
|
|
|
}
|
|
|
|
|
|
@@ -238,42 +257,41 @@ export default {
|
|
|
// 选择支付类型
|
|
|
selectTyep(type){
|
|
|
this.payType = type;
|
|
|
- if(this.order_id){
|
|
|
- this.$refs.popup.close();
|
|
|
- // 扫码弹窗
|
|
|
- this.$refs.popupCode.open('center')
|
|
|
- }else{
|
|
|
- if(this.isAJAX){
|
|
|
- return
|
|
|
- }
|
|
|
- this.isAJAX = true;
|
|
|
- OrderCreate({goods:this.goodsList}).then((res)=>{
|
|
|
- if(res.code == 1){
|
|
|
- this.isAJAX = false;
|
|
|
- this.order_id = res.data.order_id;
|
|
|
- this.$refs.popup.close();
|
|
|
- // 扫码弹窗
|
|
|
- this.$refs.popupCode.open('center')
|
|
|
- }else{
|
|
|
- tools.error(res.msg)
|
|
|
- this.isAJAX = false;
|
|
|
- this.payFLag = true;
|
|
|
- this.order_id = '';
|
|
|
- this.payType = '';
|
|
|
- this.$refs.popup.close();
|
|
|
- }
|
|
|
- })
|
|
|
+ if(this.isAJAX){
|
|
|
+ return
|
|
|
}
|
|
|
+ this.isAJAX = true;
|
|
|
+ OrderCreate({goods:this.goodsList}).then((res)=>{
|
|
|
+ if(res.code == 1){
|
|
|
+ this.isAJAX = false;
|
|
|
+ this.order_id = res.data.order_id;
|
|
|
+ this.$refs.popup.close();
|
|
|
+ this.$refs.countdown.timeFun();
|
|
|
+ // 扫码弹窗
|
|
|
+ this.$refs.popupCode.open('center')
|
|
|
+ }else{
|
|
|
+ tools.error(res.msg)
|
|
|
+ this.isAJAX = false;
|
|
|
+ this.payFLag = true;
|
|
|
+ this.order_id = '';
|
|
|
+ this.payType = '';
|
|
|
+ this.$refs.popup.close();
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 取消支付
|
|
|
closePay(){
|
|
|
+ this.payFLag = true;
|
|
|
+ this.order_id = '';
|
|
|
this.payType = '';
|
|
|
+ this.$refs.popup.close();
|
|
|
this.$refs.popupCode.close();
|
|
|
},
|
|
|
// 手动输入
|
|
|
headInput(){
|
|
|
this.$refs.inputDialog.open();
|
|
|
},
|
|
|
+ // 手动输入获取商品
|
|
|
dialogInputConfirm(){
|
|
|
this.nvalue = this.headValue;
|
|
|
this.getGoods();
|
|
|
@@ -286,6 +304,11 @@ export default {
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.index-home{
|
|
|
+ .no-img{
|
|
|
+ width: 200rpx;
|
|
|
+ height: 200rpx;
|
|
|
+ margin: 30% auto 30rpx auto;
|
|
|
+ }
|
|
|
.box-1{
|
|
|
width: 100%;
|
|
|
height: 150rpx;
|
|
|
@@ -413,5 +436,14 @@ export default {
|
|
|
}
|
|
|
.code-view-1{
|
|
|
text-align: center;
|
|
|
+ margin: 0 auto;
|
|
|
+ width: 223rpx;
|
|
|
+ height: 57rpx;
|
|
|
+ line-height: 57rpx;
|
|
|
+ border-radius: 104rpx;
|
|
|
+ border: 2rpx solid #fff;
|
|
|
+ text-align: center;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 32rpx;
|
|
|
}
|
|
|
</style>
|