|
|
@ -2,13 +2,13 @@
|
|
|
|
* @Author: ch
|
|
|
|
* @Author: ch
|
|
|
|
* @Date: 2022-03-20 14:14:53
|
|
|
|
* @Date: 2022-03-20 14:14:53
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditors: ch
|
|
|
|
* @LastEditTime: 2022-05-24 09:57:17
|
|
|
|
* @LastEditTime: 2022-05-25 16:04:45
|
|
|
|
* @Description: file content
|
|
|
|
* @Description: file content
|
|
|
|
-->
|
|
|
|
-->
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<view>
|
|
|
|
<view>
|
|
|
|
|
|
|
|
|
|
|
|
<UiWhiteBox>
|
|
|
|
<UiWhiteBox v-if="productType == 1">
|
|
|
|
<u-cell class="address" :border="false" isLink @click="selectAddress">
|
|
|
|
<u-cell class="address" :border="false" isLink @click="selectAddress">
|
|
|
|
<view slot="title" class="address--title">
|
|
|
|
<view slot="title" class="address--title">
|
|
|
|
{{address.province ? address.province + address.city + address.area : '请选择收货地址'}}
|
|
|
|
{{address.province ? address.province + address.city + address.area : '请选择收货地址'}}
|
|
|
@ -82,7 +82,8 @@ export default {
|
|
|
|
address : {},
|
|
|
|
address : {},
|
|
|
|
userMessage : '',
|
|
|
|
userMessage : '',
|
|
|
|
orderInfo : {},
|
|
|
|
orderInfo : {},
|
|
|
|
payType : 'wxpay'
|
|
|
|
payType : 'wxpay',
|
|
|
|
|
|
|
|
productType : this.$Route.query.productType,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onLoad(){
|
|
|
|
onLoad(){
|
|
|
@ -93,10 +94,12 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onShow(){
|
|
|
|
onShow(){
|
|
|
|
// 默认选择设为默认的地址
|
|
|
|
// 默认选择设为默认的地址
|
|
|
|
if(!this.address.id){
|
|
|
|
if(!this.address.id && this.productType == 1){
|
|
|
|
this.getAddressList()
|
|
|
|
this.getAddressList()
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.getBeforeOrder();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.getBeforeOrder();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods:{
|
|
|
|
methods:{
|
|
|
@ -107,8 +110,8 @@ export default {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.address = result.find(i => i.isDefault) || {};
|
|
|
|
this.address = result.find(i => i.isDefault) || {};
|
|
|
|
console.log(this.address);
|
|
|
|
|
|
|
|
this.$store.commit('SET_ADDRESS', result);
|
|
|
|
this.$store.commit('SET_ADDRESS', result);
|
|
|
|
|
|
|
|
this.getBeforeOrder();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取预订单信息,将要提交的订单信息
|
|
|
|
* 获取预订单信息,将要提交的订单信息
|
|
|
@ -153,7 +156,7 @@ export default {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
async submit(){
|
|
|
|
async submit(){
|
|
|
|
const {query} = this.$Route;
|
|
|
|
const {query} = this.$Route;
|
|
|
|
if(!this.address.id){
|
|
|
|
if(!this.address.id && this.productType === 1){
|
|
|
|
uni.$u.toast('请选择收货地址');
|
|
|
|
uni.$u.toast('请选择收货地址');
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|