Merge branch 'dev1.0.0' into develop

msb_beta
ch 3 years ago
commit 57ae302b4e

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-17 17:42:32 * @Date: 2022-03-17 17:42:32
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-04-20 14:23:33 * @LastEditTime: 2022-04-20 15:34:09
* @Description: 项目接口请求统一处理器返回一个需要token和不需要token的请求封装方法 * @Description: 项目接口请求统一处理器返回一个需要token和不需要token的请求封装方法
*/ */

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-22 14:12:18 * @Date: 2022-03-22 14:12:18
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-04-09 15:03:36 * @LastEditTime: 2022-04-20 14:45:43
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -27,7 +27,7 @@
</view> </view>
<UiCell class="form--item form--item__last" title="设为默认地址" > <UiCell class="form--item form--item__last" title="设为默认地址" >
<template slot="right-icon"> <template slot="right-icon">
<u-switch space="2" v-model="address.isDefault" activeColor="$color-yellow3" inactiveColor="#F3F3F3" /> <u-switch space="2" v-model="address.isDefault" activeColor="#FF875B" inactiveColor="#F3F3F3" />
</template> </template>
</UiCell> </UiCell>
<UiButton class="saveBtn" type="solid" size="max" @click="save"></UiButton> <UiButton class="saveBtn" type="solid" size="max" @click="save"></UiButton>

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-22 14:12:18 * @Date: 2022-03-22 14:12:18
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-04-09 15:03:37 * @LastEditTime: 2022-04-20 14:45:36
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -27,7 +27,7 @@
</view> </view>
<UiCell class="form--item form--item__last" title="设为默认地址" > <UiCell class="form--item form--item__last" title="设为默认地址" >
<template slot="right-icon"> <template slot="right-icon">
<u-switch space="2" v-model="address.isDefault" activeColor="$color-yellow3" inactiveColor="#F3F3F3" /> <u-switch space="2" v-model="address.isDefault" activeColor="#FF875B" inactiveColor="#F3F3F3" />
</template> </template>
</UiCell> </UiCell>
<UiCell class="form--item form--item__last del-address" @click="delAddress" title="删除收货地址" :rightIcon="false"></UiCell> <UiCell class="form--item form--item__last del-address" @click="delAddress" title="删除收货地址" :rightIcon="false"></UiCell>

@ -2,7 +2,7 @@
* @Author: ch * @Author: ch
* @Date: 2022-03-22 13:54:15 * @Date: 2022-03-22 13:54:15
* @LastEditors: ch * @LastEditors: ch
* @LastEditTime: 2022-04-18 18:36:28 * @LastEditTime: 2022-04-20 15:32:04
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -26,7 +26,8 @@
</view> </view>
</view> </view>
<UiButton class="addAddress" type="solid" size="max" @click="$Router.push(`/addressCreate?first=${!addresList.length}`)"></UiButton> <UiButton class="addAddress" type="solid" size="max"
@click="$Router.push(`/addressCreate?first=${!addresList.length}`)">新增地址</UiButton>
</view> </view>
</template> </template>
@ -44,7 +45,8 @@ export default {
type : query.type, type : query.type,
id : query.id, id : query.id,
// submitOrder // submitOrder
source : query.source source : query.source,
status : query.status
}, },
addresList : [], addresList : [],
isLoading : true isLoading : true
@ -53,13 +55,10 @@ export default {
computed:{ computed:{
selectedId (){ selectedId (){
const defaultAddress = this.addresList.find(i => i.isDefault); const defaultAddress = this.addresList.find(i => i.isDefault);
return this.query.id || defaultAddress.id; return Number(this.query.id) || defaultAddress.id;
} }
}, },
/** onShow(options) {
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getAddressList(); this.getAddressList();
}, },
methods: { methods: {
@ -73,6 +72,16 @@ export default {
} }
this.addresList = result; this.addresList = result;
this.$store.commit('SET_ADDRESS', result); this.$store.commit('SET_ADDRESS', result);
//
if(this.query.source=== 'submitOrder' && this.query.status === 'created'){
if(result.length){
uni.$emit('changeAddress',result.find(i => i.isDefault) || result[0], this.query.source);
}else{
uni.$emit('changeAddress',{}, this.query.source);
}
}
}, },
/** /**
* 选择地址 * 选择地址

@ -2,12 +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-04-20 14:35:32 * @LastEditTime: 2022-04-20 15:29:10
* @Description: file content * @Description: file content
--> -->
<template> <template>
<view> <view>
<u-cell class="address" :border="false" isLink @click="$Router.push('/addressList?source=submitOrder')"> <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 : '请选择收货地址'}}
</view> </view>
@ -126,6 +127,11 @@ export default {
this.orderInfo = res.result; this.orderInfo = res.result;
},
selectAddress(){
const selectedId = this.address.id;
const selectedPar = selectedId ? `&id=${selectedId}` : '&status=created';
this.$Router.push(`/addressList?source=submitOrder${selectedPar}`);
}, },
/** /**
* 提交订单 * 提交订单

Loading…
Cancel
Save