|
|
@@ -323,7 +323,23 @@ export default {
|
|
|
shopDet: '',
|
|
|
isThrottle: true, //防抖,待支付结果返回后继续
|
|
|
storeCommodityId: 0,
|
|
|
- openLists: [],
|
|
|
+ openLists: [
|
|
|
+ {
|
|
|
+ image: '../../../static/images/my/weixin.png',
|
|
|
+ text: '微信',
|
|
|
+ id: 2
|
|
|
+ }
|
|
|
+ // {
|
|
|
+ // image: '../../../static/images/my/zhifubao.png',
|
|
|
+ // text: '支付宝',
|
|
|
+ // id: 3
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // image: '../../../static/images/my/jinbi.png',
|
|
|
+ // text: '零钱',
|
|
|
+ // id: 1
|
|
|
+ // }
|
|
|
+ ],
|
|
|
openWay: 2,
|
|
|
orderId: '',
|
|
|
page: 1,
|
|
|
@@ -399,60 +415,9 @@ export default {
|
|
|
if (option.showReach) {
|
|
|
this.showReach = option.showReach
|
|
|
}
|
|
|
- // #ifdef APP
|
|
|
- this.openLists = [
|
|
|
- {
|
|
|
- image: '../../../static/images/my/weixin.png',
|
|
|
- text: '微信',
|
|
|
- id: 2
|
|
|
- }
|
|
|
- // {
|
|
|
- // image: '../../../static/images/my/zhifubao.png',
|
|
|
- // text: '支付宝',
|
|
|
- // id: 3
|
|
|
- // },
|
|
|
- // {
|
|
|
- // image: '../../../static/images/my/jinbi.png',
|
|
|
- // text: '零钱',
|
|
|
- // id: 1
|
|
|
- // }
|
|
|
- ]
|
|
|
- // #endif
|
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
this.XCXIsSelect = this.$queue.getData('XCXIsSelect') ? this.$queue.getData('XCXIsSelect') : '是'
|
|
|
- this.openLists = [
|
|
|
- {
|
|
|
- image: '../../../static/images/my/weixin.png',
|
|
|
- text: '微信',
|
|
|
- id: 2
|
|
|
- }
|
|
|
- // {
|
|
|
- // image: '../../../static/images/my/jinbi.png',
|
|
|
- // text: '零钱',
|
|
|
- // id: 1
|
|
|
- // }
|
|
|
- ]
|
|
|
- // #endif
|
|
|
-
|
|
|
- // #ifdef H5
|
|
|
- this.openLists = [
|
|
|
- {
|
|
|
- image: '../../../static/images/my/weixin.png',
|
|
|
- text: '微信',
|
|
|
- id: 2
|
|
|
- }
|
|
|
- // {
|
|
|
- // image: '../../../static/images/my/zhifubao.png',
|
|
|
- // text: '支付宝',
|
|
|
- // id: 3
|
|
|
- // },
|
|
|
- // {
|
|
|
- // image: '../../../static/images/my/jinbi.png',
|
|
|
- // text: '零钱',
|
|
|
- // id: 1
|
|
|
- // }
|
|
|
- ]
|
|
|
// #endif
|
|
|
|
|
|
this.shopId = option.shopId
|
|
|
@@ -469,33 +434,18 @@ export default {
|
|
|
this.status = option.status
|
|
|
}
|
|
|
|
|
|
- // #ifndef H5
|
|
|
- uni.getLocation({
|
|
|
- type: 'gcj02', //返回可以用于uni.openLocation的经纬度
|
|
|
- success: function (res) {
|
|
|
- this.lat = res.latitude
|
|
|
- this.lng = res.longitude
|
|
|
- }
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中...',
|
|
|
+ mask: true // 是否显示透明蒙层,防止触摸穿透
|
|
|
})
|
|
|
- this.getShopDet(this.shopId)
|
|
|
- // #endif
|
|
|
- // #ifdef H5
|
|
|
+
|
|
|
uni.getLocation({
|
|
|
type: 'gcj02', //返回可以用于uni.openLocation的经纬度
|
|
|
- success: function (res) {
|
|
|
+ success: (res) => {
|
|
|
this.lat = res.latitude
|
|
|
this.lng = res.longitude
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
- this.getShopDet(this.shopId)
|
|
|
- // #endif
|
|
|
-
|
|
|
- uni.showLoading({
|
|
|
- title: '加载中...',
|
|
|
- mask: true // 是否显示透明蒙层,防止触摸穿透
|
|
|
- })
|
|
|
- // this.getOrderList();
|
|
|
this.getAddressList()
|
|
|
},
|
|
|
onUnload() {
|
|
|
@@ -506,13 +456,16 @@ export default {
|
|
|
},
|
|
|
onShow() {
|
|
|
this.getMsgData()
|
|
|
- console.log(uni.getStorageSync('addressId'), '地址id')
|
|
|
this.addressId = this.addressId ? this.addressId : uni.getStorageSync('addressId')
|
|
|
if (this.addressId) {
|
|
|
console.log(this.addressId, '地址id')
|
|
|
this.address = {}
|
|
|
this.getAddressDet(this.addressId)
|
|
|
}
|
|
|
+
|
|
|
+ // console.log(this.shopId, 'this.shopId')
|
|
|
+ this.getShopDet(this.shopId)
|
|
|
+
|
|
|
// 设置定时器
|
|
|
this.timer = setInterval(() => {
|
|
|
// 定时器执行的操作
|
|
|
@@ -612,7 +565,7 @@ export default {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: '当前时间段无骑手配送,现在下单,最早将于明日' + teshu + ':00' + '送达',
|
|
|
- success: function (res) {
|
|
|
+ success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
} else if (res.cancel) {
|
|
|
}
|
|
|
@@ -637,7 +590,7 @@ export default {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: '当前时间段无骑手配送,现在下单,最早将于今日' + teshu + ':00' + '送达',
|
|
|
- success: function (res) {
|
|
|
+ success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
} else if (res.cancel) {
|
|
|
}
|
|
|
@@ -959,7 +912,7 @@ export default {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: '当前选择的优惠券已过期,请重新选择',
|
|
|
- success: function (res) {
|
|
|
+ success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
this.coupon = ''
|
|
|
} else if (res.cancel) {
|
|
|
@@ -1004,7 +957,7 @@ export default {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: '当前选择的优惠活动已过期,请重新选择',
|
|
|
- success: function (res) {
|
|
|
+ success: (res) => {
|
|
|
if (res.confirm) {
|
|
|
this.huodong = ''
|
|
|
} else if (res.cancel) {
|
|
|
@@ -1038,12 +991,11 @@ export default {
|
|
|
//拼单支付成功取消订单
|
|
|
|
|
|
cancelPinDan() {
|
|
|
- let that = this
|
|
|
- // if (that.orderId) {
|
|
|
+ // if (this.orderId) {
|
|
|
// let data = {
|
|
|
- // orderId: that.orderId
|
|
|
+ // orderId: this.orderId
|
|
|
// };
|
|
|
- // that.$Request.post('/app/order/deleteOrder', data).then(res => {
|
|
|
+ // this.$Request.post('/app/order/deleteOrder', data).then(res => {
|
|
|
// if (res.code == 0) {
|
|
|
// uni.removeStorageSync('orderId');
|
|
|
// }
|
|
|
@@ -1081,6 +1033,7 @@ export default {
|
|
|
this.dataList = res.data.pageUtils.list[0]
|
|
|
|
|
|
if (this.dataList && this.dataList.orderGoodsList && this.dataList.orderGoodsList[0]) {
|
|
|
+ this.dabaoMoney = 0
|
|
|
this.dataList.orderGoodsList[0].forEach((res) => {
|
|
|
res.goodsPicture = res.goodsPicture.split(',')
|
|
|
this.dabaoMoney += res.goodsPack * res.goodsNum
|
|
|
@@ -1104,6 +1057,12 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.totalPrice = res.data.money
|
|
|
+
|
|
|
+ console.log(this.totalPrice)
|
|
|
+ console.log(this.paotuiMoney)
|
|
|
+ console.log(this.dabaoMoney)
|
|
|
+ console.log(this.address.insideDeliveryFee)
|
|
|
+
|
|
|
if (this.orderType == 2) {
|
|
|
this.totalPrice1 = parseFloat(
|
|
|
parseFloat(this.totalPrice) + parseFloat(this.paotuiMoney) + parseFloat(this.dabaoMoney) + parseFloat(this.address.insideDeliveryFee)
|
|
|
@@ -1204,7 +1163,6 @@ export default {
|
|
|
if (this.isThrottle == false) {
|
|
|
return
|
|
|
}
|
|
|
- let that = this
|
|
|
|
|
|
if (this.isTrue && this.orderType == 2) {
|
|
|
uni.showToast({
|
|
|
@@ -1246,17 +1204,17 @@ export default {
|
|
|
console.log(res, '结果')
|
|
|
if (res.code == 0) {
|
|
|
uni.hideLoading()
|
|
|
- that.$queue.showToast('支付成功')
|
|
|
- that.cancelPinDan()
|
|
|
- setTimeout(function () {
|
|
|
- that.isThrottle = true
|
|
|
+ this.$queue.showToast('支付成功')
|
|
|
+ this.cancelPinDan()
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isThrottle = true
|
|
|
uni.switchTab({
|
|
|
url: '/pages/order/index'
|
|
|
})
|
|
|
}, 1000)
|
|
|
} else {
|
|
|
- that.$queue.showToast(res.msg)
|
|
|
- that.isThrottle = true
|
|
|
+ this.$queue.showToast(res.msg)
|
|
|
+ this.isThrottle = true
|
|
|
}
|
|
|
})
|
|
|
} else if (this.openWay == 2) {
|
|
|
@@ -1335,7 +1293,7 @@ export default {
|
|
|
if (res.code == 0) {
|
|
|
this.isCheckPay(res.code, 'wxpay', JSON.stringify(res.data))
|
|
|
} else {
|
|
|
- that.isThrottle = true
|
|
|
+ this.isThrottle = true
|
|
|
}
|
|
|
})
|
|
|
// #endif
|
|
|
@@ -1529,30 +1487,28 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
setPayment(name, order) {
|
|
|
- let that = this
|
|
|
-
|
|
|
console.log(777777777, name, order)
|
|
|
uni.requestPayment({
|
|
|
provider: name,
|
|
|
orderInfo: order, //微信、支付宝订单数据
|
|
|
- success: function (res) {
|
|
|
+ success: (res) => {
|
|
|
uni.hideLoading()
|
|
|
- that.cancelPinDan()
|
|
|
+ this.cancelPinDan()
|
|
|
uni.showLoading({
|
|
|
title: '支付成功',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
- setTimeout(function () {
|
|
|
- that.isThrottle = true
|
|
|
+ setTimeout(() => {
|
|
|
+ this.isThrottle = true
|
|
|
uni.navigateBack()
|
|
|
}, 1000)
|
|
|
},
|
|
|
- fail: function (err) {
|
|
|
+ fail: (err) => {
|
|
|
uni.hideLoading()
|
|
|
- that.isThrottle = true
|
|
|
+ this.isThrottle = true
|
|
|
},
|
|
|
- complete() {
|
|
|
- that.isThrottle = true
|
|
|
+ complete: () => {
|
|
|
+ this.isThrottle = true
|
|
|
uni.hideLoading()
|
|
|
}
|
|
|
})
|
|
|
@@ -1581,22 +1537,21 @@ export default {
|
|
|
},
|
|
|
// 获取地址列表
|
|
|
getAddressList() {
|
|
|
- let that = this
|
|
|
let data = {
|
|
|
page: 1,
|
|
|
limit: 100
|
|
|
}
|
|
|
- that.$Request.get('/app/address/selectAddressList', data).then((res) => {
|
|
|
+ this.$Request.get('/app/address/selectAddressList', data).then((res) => {
|
|
|
console.log(res, 741852)
|
|
|
- if (res.code == 0) {
|
|
|
- that.address = res.data.list[0] ? res.data.list[0] : {}
|
|
|
+ if (res.code == 0 && res.data.list.length) {
|
|
|
+ this.address = res.data.list[0]
|
|
|
res.data.list.forEach((ret) => {
|
|
|
if (ret.addressDefault == 1) {
|
|
|
- that.address = ret
|
|
|
+ this.address = ret
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- console.log(that.address, '我的地址列表460777')
|
|
|
+ console.log(this.address, '我的地址列表460777')
|
|
|
|
|
|
if (this.address.insideAddressId) {
|
|
|
this.getInsideDeliveryFee(this.address.insideAddressId)
|
|
|
@@ -1638,20 +1593,19 @@ export default {
|
|
|
// url: 'plugin://routePlan/index?key=' + key + '&referer=' + referer + '&endPoint=' + endPoint
|
|
|
// });
|
|
|
|
|
|
- let that = this
|
|
|
- let lati = parseFloat(that.dataList.shopLat)
|
|
|
- let longi = parseFloat(that.dataList.shopLng)
|
|
|
+ let lati = parseFloat(this.dataList.shopLat)
|
|
|
+ let longi = parseFloat(this.dataList.shopLng)
|
|
|
uni.authorize({
|
|
|
scope: 'scope.userLocation',
|
|
|
- success(res) {
|
|
|
+ success: (res) => {
|
|
|
uni.openLocation({
|
|
|
- name: that.dataList.shopName,
|
|
|
+ name: this.dataList.shopName,
|
|
|
latitude: lati,
|
|
|
longitude: longi,
|
|
|
- success: function () {}
|
|
|
+ success: () => {}
|
|
|
})
|
|
|
},
|
|
|
- fail(err) {}
|
|
|
+ fail: (err) => {}
|
|
|
})
|
|
|
},
|
|
|
// 打电话
|