|
@@ -4,6 +4,10 @@
|
|
|
<view class="box-1 align-items-start">
|
|
<view class="box-1 align-items-start">
|
|
|
<image src="@/static/img/jiankong.png" mode=""></image>
|
|
<image src="@/static/img/jiankong.png" mode=""></image>
|
|
|
<view class="fs-32 fc-3 fw-b">你已进入监控区域</view>
|
|
<view class="fs-32 fc-3 fw-b">你已进入监控区域</view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="box-1-time">
|
|
|
|
|
+ <Countdown></Countdown>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -92,9 +96,10 @@
|
|
|
import keyboardListener from 'uniapp-keyboard-listener';
|
|
import keyboardListener from 'uniapp-keyboard-listener';
|
|
|
import {GoodsInfo,OrderCreate,OrderPay} from '@/api/cashierApi.js'
|
|
import {GoodsInfo,OrderCreate,OrderPay} from '@/api/cashierApi.js'
|
|
|
import tools from '@/common/js/tools';
|
|
import tools from '@/common/js/tools';
|
|
|
|
|
+import Countdown from '../mod/countdown.vue'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
- components: {keyboardListener},
|
|
|
|
|
|
|
+ components: {keyboardListener,Countdown},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
totalNum:0,//总数量
|
|
totalNum:0,//总数量
|
|
@@ -155,7 +160,7 @@ export default {
|
|
|
this.payFLag = true;
|
|
this.payFLag = true;
|
|
|
this.isAJAX = false;
|
|
this.isAJAX = false;
|
|
|
uni.redirectTo({
|
|
uni.redirectTo({
|
|
|
- url:'/pages/index/success'
|
|
|
|
|
|
|
+ url:'/pages/index/success?money=' + this.totalPrice
|
|
|
})
|
|
})
|
|
|
}else{
|
|
}else{
|
|
|
this.isAJAX = false;
|
|
this.isAJAX = false;
|
|
@@ -184,7 +189,7 @@ export default {
|
|
|
if(v.id == obj.id){
|
|
if(v.id == obj.id){
|
|
|
v.num += 1;
|
|
v.num += 1;
|
|
|
this.totalNum += 1;
|
|
this.totalNum += 1;
|
|
|
- this.totalPrice += v.price;
|
|
|
|
|
|
|
+ this.totalPrice = (this.totalPrice*1 + v.price*1).toFixed(2);
|
|
|
flag = false;
|
|
flag = false;
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -192,32 +197,43 @@ export default {
|
|
|
obj.num = 1;
|
|
obj.num = 1;
|
|
|
this.goodsList.push(obj)
|
|
this.goodsList.push(obj)
|
|
|
this.totalNum += 1;
|
|
this.totalNum += 1;
|
|
|
- this.totalPrice += res.data.price;
|
|
|
|
|
|
|
+ this.totalPrice = (this.totalPrice*1 + res.data.price*1).toFixed(2);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ this.headValue = '';
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.headValue = '';
|
|
|
|
|
+ tools.error(res.msg)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
// 删除商品
|
|
// 删除商品
|
|
|
delGoods(i){
|
|
delGoods(i){
|
|
|
-
|
|
|
|
|
|
|
+ this.totalNum = this.totalNum - this.goodsList[i].num;
|
|
|
|
|
+ this.totalPrice = (this.totalPrice*1 - (this.goodsList[i].price*this.goodsList[i].num)).toFixed(2);
|
|
|
|
|
+ this.goodsList.splice(i,1)
|
|
|
},
|
|
},
|
|
|
// 减少
|
|
// 减少
|
|
|
reduce(i){
|
|
reduce(i){
|
|
|
this.goodsList[i].num -= 1
|
|
this.goodsList[i].num -= 1
|
|
|
this.totalNum -= 1;
|
|
this.totalNum -= 1;
|
|
|
- this.totalPrice = this.totalPrice - this.goodsList[i].price;
|
|
|
|
|
|
|
+ this.totalPrice = (this.totalPrice*1 - (this.goodsList[i].price*1)).toFixed(2);
|
|
|
},
|
|
},
|
|
|
// 添加
|
|
// 添加
|
|
|
add(i){
|
|
add(i){
|
|
|
this.goodsList[i].num += 1
|
|
this.goodsList[i].num += 1
|
|
|
this.totalNum += 1;
|
|
this.totalNum += 1;
|
|
|
- this.totalPrice = this.totalPrice + this.goodsList[i].price;
|
|
|
|
|
|
|
+ this.totalPrice = (this.totalPrice*1 + this.goodsList[i].price*1).toFixed(2);
|
|
|
},
|
|
},
|
|
|
// 支付
|
|
// 支付
|
|
|
save(){
|
|
save(){
|
|
|
- this.payFLag = false;
|
|
|
|
|
- this.$refs.popup.open('center')
|
|
|
|
|
|
|
+ if(this.goodsList.length > 0){
|
|
|
|
|
+ this.payFLag = false;
|
|
|
|
|
+ this.$refs.popup.open('center')
|
|
|
|
|
+ }else{
|
|
|
|
|
+ tools.error('请添加商品')
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
// 选择支付类型
|
|
// 选择支付类型
|
|
|
selectTyep(type){
|
|
selectTyep(type){
|
|
@@ -276,6 +292,11 @@ export default {
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
padding: 80rpx 0 0 24rpx;
|
|
padding: 80rpx 0 0 24rpx;
|
|
|
position: relative;
|
|
position: relative;
|
|
|
|
|
+ .box-1-time{
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ bottom: 20rpx;
|
|
|
|
|
+ right: 20rpx;
|
|
|
|
|
+ }
|
|
|
image{
|
|
image{
|
|
|
width: 48rpx;
|
|
width: 48rpx;
|
|
|
height: 48rpx;
|
|
height: 48rpx;
|