Commit 570d559a authored by 肖健's avatar 肖健

免费挪车牌下单的提示添加

parent dab0ec64
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="get__content"> <div class="get__content">
<div class="address" v-if="addressShow"> <div class="address" v-if="addressShow">
<div class="address__left"> <div class="address__left">
<div class="right__title" @click="geMap"> <div class="right__title">
{{addressInfo.address}}&emsp;{{addressInfo.detailInfo}} {{addressInfo.address}}&emsp;{{addressInfo.detailInfo}}
</div> </div>
<div class="right__phone"> <div class="right__phone">
...@@ -162,67 +162,77 @@ export default { ...@@ -162,67 +162,77 @@ export default {
} }
}, },
methods: { methods: {
getMap() {
uni.getLocation({
type: 'wgs84',
success: function (res) {
//console.log('当前位置的经度:' + res.longitude);
//console.log('当前位置的纬度:' + res.latitude);
}
});
},
pay() { pay() {
let list = [{ if(!this.addressId) {
uni.showToast({
title:'请添加一个收货地址',
icon:'none',
})
} else {
let list = [{
id: this.freeCode.id, id: this.freeCode.id,
nums: 1, nums: 1,
}] }]
let idMap = this.mallSelectMap let idMap = this.mallSelectMap
for(let id in idMap){ for(let id in idMap){
if(idMap[id] > 0){ if(idMap[id] > 0){
let commodity = { id: id, nums: idMap[id] } let commodity = { id: id, nums: idMap[id] }
list.push(commodity) list.push(commodity)
} }
}
this.createOrder = {
addressId: this.addressId,
commodityList: list,
}
let that = this
let opts = { url: '/app/mall/create/order', method: 'post' };
this.http.httpTokenRequest(opts, this.createOrder).then(res => {
if (res.data.code == 200) {
let orderIds = res.data.data
if(orderIds && orderIds.length > 0) {
that.orderSubmit = {
appId: 6,
ids: orderIds,
channelCode: 'wx_lite',
}
let opts = { url: '/app/pay/order/submit/more', method: 'post' }
this.http.httpTokenRequest(opts, that.orderSubmit).then(res => {
if (res.data.code == 200) {
let paymentData = res.data.data.invokeResponse;
uni.requestPayment({
provider: 'wxpay', // 服务提提供商
timeStamp: paymentData.timeStamp,
nonceStr: paymentData.nonceStr,
package: paymentData.packageValue,
signType: paymentData.signType,
paySign: paymentData.paySign,
success: function (res) {
uni.navigateTo({
url: '/pagesC/pages/shop/payOk'
})
},
fail: function (err) {
//console.log('支付失败',err);
},
});
} else {
}
})
} else {
uni.navigateTo({
url: '/pagesC/pages/shop/payOk'
})
}
} else {
uni.showToast({
title: res.data.msg,
icon:'none',
})
}
})
} }
this.createOrder = {
addressId: this.addressId,
commodityList: list,
}
let that = this
let opts = { url: '/app/mall/create/order', method: 'post' };
this.http.httpTokenRequest(opts, this.createOrder).then(res => {
if (res.data.code == 200) {
let orderIds = res.data.data
that.orderSubmit = {
appId: 6,
ids: orderIds,
channelCode: 'wx_lite',
}
let opts = { url: '/app/pay/order/submit/more', method: 'post' }
this.http.httpTokenRequest(opts, that.orderSubmit).then(res => {
if (res.data.code == 200) {
let paymentData = res.data.data.invokeResponse;
uni.requestPayment({
provider: 'wxpay', // 服务提提供商
timeStamp: paymentData.timeStamp,
nonceStr: paymentData.nonceStr,
package: paymentData.packageValue,
signType: paymentData.signType,
paySign: paymentData.paySign,
success: function (res) {
uni.navigateTo({
url: '/pagesC/pages/shop/payOk'
})
},
fail: function (err) {
//console.log('支付失败',err);
},
});
} else {
}
})
}
})
}, },
add(){ add(){
this.nums++ this.nums++
......
...@@ -156,7 +156,6 @@ export default { ...@@ -156,7 +156,6 @@ export default {
that.$nextTick(() => { that.$nextTick(() => {
that.model1.carInfo = res.data.data; that.model1.carInfo = res.data.data;
that.model1.carInfo.carNo = res.data.data.carNo; that.model1.carInfo.carNo = res.data.data.carNo;
console.log(that.model1.carInfo)
that.$set(that.model1.carInfo, 'carNo', res.data.data.carNo); that.$set(that.model1.carInfo, 'carNo', res.data.data.carNo);
}) })
} }
......
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