修改收货地址不能再添加默认收货地址问题

msb_beta
ch 3 years ago
parent 37899319b8
commit 0d8830d8a3

@ -1,2 +1,2 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>马士兵严选</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)')) <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>马士兵严选</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.b5602bf5.js></script><script src=/static/js/index.e8312dde.js></script></body></html> document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/static/index.a5c69d49.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.b5602bf5.js></script><script src=/static/js/index.180a8da6.js></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -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-22 19:04:06 * @LastEditTime: 2022-04-22 21:32:46
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -25,9 +25,10 @@
</template> </template>
</UiCell> </UiCell>
</view> </view>
{{address.isDefault}}
<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="#FF875B" inactiveColor="#F3F3F3" /> <u-switch v-model="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>
@ -46,11 +47,14 @@ export default {
data (){ data (){
return { return {
address : {}, address : {},
isDefault : false,
city : [] city : []
} }
}, },
onShow(){ onShow(){
this.address.isDefault = this.$Route.query.first === 'true' ? true : false if(this.$Route.query.first === 'true'){
this.isDefault = true;
}
}, },
methods: { methods: {
async save(){ async save(){
@ -79,6 +83,7 @@ export default {
const province = this.city[0].name; const province = this.city[0].name;
const {error} = await ApiPostAddress({ const {error} = await ApiPostAddress({
...this.address, ...this.address,
isDefault : this.isDefault,
province,provinceCode,areaCode,area,city,cityCode province,provinceCode,areaCode,area,city,cityCode
}); });
if(error){ if(error){

@ -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-22 21:08:34 * @LastEditTime: 2022-04-22 21:23:54
* @Description: file content * @Description: file content
--> -->
<template> <template>
@ -99,6 +99,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
page{ page{
background: $color-grey1; background: $color-grey1;
padding-bottom: 200rpx;
} }
.address{ .address{
background: $color-grey0; background: $color-grey0;

Loading…
Cancel
Save