|
|
@@ -453,11 +453,11 @@
|
|
|
|
|
|
<view class="flex justify-between align-center" style="margin-left: auto">
|
|
|
<view class="flex align-center justify-between">
|
|
|
- <view @click.stop="noAdd(item, ind)">
|
|
|
+ <view @click.stop="noAdd_throttle(item, ind)">
|
|
|
<image src="../../../static/images/index/jian.png" style="width: 54rpx; height: 54rpx"></image>
|
|
|
</view>
|
|
|
<view class="text-center margin-lr-xs">{{ item.goodsNum }}</view>
|
|
|
- <view @click.stop="add(item, ind)">
|
|
|
+ <view @click.stop="add_throttle(item, ind)">
|
|
|
<image src="../../../static/images/index/add.png" style="width: 50rpx; height: 50rpx"></image>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -731,28 +731,29 @@ export default {
|
|
|
shop_zhizhao: [],
|
|
|
shopTypeId: '',
|
|
|
showShopTypeId: false,
|
|
|
- supermarketGoodsList: []
|
|
|
+ supermarketGoodsList: [],
|
|
|
+ isClick: true
|
|
|
}
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- console.log(option, 'option',option.shopId)
|
|
|
+ console.log(option, 'option', option.shopId)
|
|
|
this.shopId = option.shopId
|
|
|
- if(option.lat==''||option.lat==undefined){
|
|
|
+ if (option.lat == '' || option.lat == undefined) {
|
|
|
uni.getLocation({
|
|
|
type: 'gcj02', //返回可以用于uni.openLocation的经纬度
|
|
|
- success: (res) => {
|
|
|
+ success: (res) => {
|
|
|
console.log(res, '经纬度')
|
|
|
this.lat = res.latitude
|
|
|
this.lng = res.longitude
|
|
|
this.getData()
|
|
|
}
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.lat = option.lat
|
|
|
this.lng = option.lng
|
|
|
this.getData()
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
this.shopTypeId = option.shopTypeId.split(',')
|
|
|
this.showShopTypeId = this.shopTypeId.includes('10')
|
|
|
|
|
|
@@ -770,7 +771,7 @@ export default {
|
|
|
title: '店铺详情'
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
uni.showLoading({
|
|
|
title: '加载中',
|
|
|
mask: true // 是否显示透明蒙层,防止触摸穿透
|
|
|
@@ -968,7 +969,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.$Request.get(urlreq, data).then((res) => {
|
|
|
- console.log(res, '999',data)
|
|
|
+ console.log(res, '999', data)
|
|
|
if (res.code == 0 && res.data) {
|
|
|
this.dataList = res.data.list
|
|
|
this.shopDet = res.data.goodsShop
|
|
|
@@ -1002,7 +1003,7 @@ export default {
|
|
|
|
|
|
if (urlreq == '/app/goods/selectGoodsClassifyList') {
|
|
|
this.getSupermarketGoodsList(this.dataList[0].classifyId)
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.getSupermarketGoodsList(this.dataList[0].classifyId)
|
|
|
}
|
|
|
}
|
|
|
@@ -1015,7 +1016,7 @@ export default {
|
|
|
page: this.page,
|
|
|
limit: this.limit
|
|
|
}
|
|
|
- console.log(dataRight,'ll')
|
|
|
+ console.log(dataRight, 'll')
|
|
|
|
|
|
this.$Request.get('/app/goods/selectSupermarketGoodsList', dataRight).then((res) => {
|
|
|
// console.log(res, '9996329')
|
|
|
@@ -1288,6 +1289,9 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ add_throttle: throttle(function (item, index) {
|
|
|
+ this.add(item, index)
|
|
|
+ }, 180),
|
|
|
// 添加数量
|
|
|
add(item, index) {
|
|
|
// this.count++;
|
|
|
@@ -1301,6 +1305,7 @@ export default {
|
|
|
}
|
|
|
this.$Request.get('/app/order/updateGoodsNum', data).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
+ this.isClick = false
|
|
|
this.getOrderList()
|
|
|
} else {
|
|
|
this.$queue.showToast(res.msg)
|
|
|
@@ -1308,6 +1313,9 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ noAdd_throttle: throttle(function (item, index) {
|
|
|
+ this.noAdd(item, index)
|
|
|
+ }, 180),
|
|
|
// 减少数量
|
|
|
noAdd(item, index) {
|
|
|
this.goodsList.orderGoodsList[0][index].goodsNum--
|
|
|
@@ -1320,6 +1328,7 @@ export default {
|
|
|
}
|
|
|
this.$Request.get('/app/order/updateGoodsNum', data).then((res) => {
|
|
|
if (res.code == 0) {
|
|
|
+ this.isClick = false
|
|
|
this.getOrderList()
|
|
|
}
|
|
|
})
|
|
|
@@ -1381,6 +1390,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ this.isClick = true
|
|
|
// 加载提示关闭
|
|
|
uni.hideLoading()
|
|
|
})
|
|
|
@@ -1397,6 +1407,9 @@ export default {
|
|
|
}, 1000),
|
|
|
// 去结算
|
|
|
goConfirm() {
|
|
|
+ if (!this.isClick) {
|
|
|
+ return
|
|
|
+ }
|
|
|
if (!this.userId) {
|
|
|
uni.navigateTo({
|
|
|
url: '/pages/public/login'
|