Skip to content

Commit 5cc99d6

Browse files
committed
修复地址列表重复加载的bug
1 parent 7c057e7 commit 5cc99d6

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

src/page/confirmOrder/children/chooseAddress.vue

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<section id="scroll_section" class="scroll_container">
99
<section class="list_cotainer">
1010
<ul class="deliverable_address">
11-
<li v-for="(item,index) in deliverable" @click="chooseAddress(item, index)">
11+
<li v-for="(item,index) in deliverable" @click.prevent.stop="chooseAddress(item, index)">
1212
<svg class="choosed_address" :class="{default_address: defaultIndex == index}">
1313
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#select"></use>
1414
</svg>
@@ -39,7 +39,7 @@
3939
<span>{{item.phone}}</span>
4040
</header>
4141
<div class="address_detail ellipsis">
42-
<span v-if="item.tag" :style="{backgroundColor: '#ccc'}">{{item.tag}}</span>
42+
<span v-if="item.tag" :style="{backgroundColor: '#ccc', color: '#fff'}">{{item.tag}}</span>
4343
<p>{{item.address_detail}}</p>
4444
</div>
4545
</div>
@@ -77,7 +77,6 @@
7777
created(){
7878
this.id = this.$route.query.id;
7979
this.sig = this.$route.query.sig;
80-
this.initData();
8180
},
8281
components: {
8382
headTop,
@@ -106,6 +105,7 @@
106105
this.addressList = [];
107106
this.deliverable = [];
108107
this.deliverdisable = [];
108+
109109
if (this.userInfo && this.userInfo.user_id) {
110110
this.addressList = await getAddress(this.id, this.sig);
111111
//将当前所有地址访问有效无效两种
@@ -116,14 +116,13 @@
116116
this.deliverdisable.push(item);
117117
}
118118
})
119-
this.$nextTick(() => {
120-
new BScroll('#scroll_section', {
121-
deceleration: 0.001,
122-
bounce: true,
123-
swipeTime: 1800,
124-
click: true,
125-
});
126-
})
119+
// this.$nextTick(() => {
120+
// new BScroll('#scroll_section', {
121+
// deceleration: 0.003,
122+
// bounce: true,
123+
// swipeTime: 1800,
124+
// });
125+
// })
127126
}
128127
},
129128
iconColor(name){
@@ -135,7 +134,7 @@
135134
//选择地址
136135
chooseAddress(address, index){
137136
this.CHOOSE_ADDRESS({address, index});
138-
137+
this.$router.go(-1);
139138
},
140139
},
141140
watch: {

src/page/profile/children/children/address.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
//删除地址
8787
async deleteSite(index, item){
8888
if (this.userInfo && this.userInfo.user_id) {
89-
let res = await deleteAddress(this.userInfo.user_id, item.id);
89+
await deleteAddress(this.userInfo.user_id, item.id);
9090
this.removeAddress.splice(index, 1);
9191
}
9292
}

src/service/getData.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ if (process.env.NODE_ENV == 'development') {
479479
* 删除地址
480480
*/
481481

482-
var deleteAddress=(userid, addressid) => fetch('DELETE','/v1/users/' + userid + '/addresses/' + addressid,{})
482+
var deleteAddress=(userid, addressid) => fetch('OPTIONS','/v1/users/' + userid + '/addresses/' + addressid,{})
483483

484484
}else{
485485
var cityGuess = () => setpromise(home.guesscity);

0 commit comments

Comments
 (0)