| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -31,21 +31,22 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									</view> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									<view class="lf-row-between"> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										<view @tap="setInfo(item)"> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											<text class="lf-iconfont icon--1"></text> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											<text class="lf-iconfont icon-bianji"></text> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											<text class="lf-m-l-10">编辑</text> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										</view> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										<view class="lf-m-l-50" @click="deleteAddress(item)"> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											<text class="lf-iconfont icon--1"></text> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										<view class="lf-m-l-50 lf-color-red" @click="deleteAddress(item, index)"> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											<text class="lf-iconfont icon-shanchu"></text> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											<text class="lf-m-l-10">删除</text> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										</view> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									</view> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								</view> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        </view> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							<lf-nocontent src="/static/images/empty.png" text="您还未添加地址" v-if="list.length <= 0 && !is_load"></lf-nocontent> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    </view> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						<view style="height: 230rpx;"></view> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						<view class="add-address" @tap="add"> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						    <view class="small-btn"> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						    	<text class="lf-iconfont icon--2"></text> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						    	<text class="lf-iconfont icon-jia"></text> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						    	<text class="lf-m-l-10">新增收货地址</text> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						    </view> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						</view> | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -61,7 +62,8 @@ export default { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      list: [], | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      order_no: '', | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      url: '', | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  id:'' | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  id:'', | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  is_load: true | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    }; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  }, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -89,29 +91,62 @@ export default { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  props: {}, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  methods: { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  // 删除收货地址 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  deleteAddress(item){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  deleteAddress(item, index){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  console.log("item", item) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							   var token = this.$cookieStorage.get('user_token'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  this.$http.ajax({ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								  api: '/api/address/'+ item.id, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								  method: 'DELETE', | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								  header: { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								    Authorization: token | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  }).then(res => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								  console.log("删除地址", res); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							   | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  uni.showModal({ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  	title: '温馨提示', | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								content: '您确定删除该收货地址吗?', | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								success: result => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									if(result.confirm){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										var token = this.$cookieStorage.get('user_token'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										this.$http.ajax({ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										  api: '/api/address/'+ item.id, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										  method: 'DELETE', | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										  header: { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
											Authorization: token | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										}).then(res => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										  console.log("删除地址", res); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										  this.$msg('删除成功', {icon: 'success'}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										  this.list.splice(index, 1); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										}).catch(err => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										  this.$msg('删除失败', {icon: 'error'}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
										}) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  }) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  }, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  // 切换默认地址 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  radioChange(e){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  let current = e.target.value; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  let id = null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  this.list.forEach((item, index) => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								  if(current == index){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									  item.is_default = 1; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									  id = item.id; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								  }else{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									  item.is_default = 0; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  }) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  this.switchDefaultAddress(id); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  }, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  switchDefaultAddress(id){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  var token = this.$cookieStorage.get('user_token'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  this.$http.ajax({ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							    api: 'api/address/'+ id, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							    method: 'PUT', | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							    header: { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							      Authorization: token | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							    }, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							    data: { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									is_default: 1 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  }).then(res => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								  this.$msg('操作成功', {icon: 'success'}); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  }).catch(err => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								  this.$msg('切换默认地址失败'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  }) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  }, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    setInfo(e) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      // var from = e.currentTarget.dataset.info; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -150,6 +185,7 @@ export default { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    // 查询收货地址列表 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    queryAddressList() { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							this.is_load = true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      var token = this.$cookieStorage.get('user_token'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      this.$http.get({ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        api: 'api/address', | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -159,7 +195,7 @@ export default { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      }).then(res => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (res.statusCode == 200) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          res = res.data; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          if (res.status) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            this.setData({ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					              list: res.data | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -176,7 +212,10 @@ export default { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            image: '../../../static/error.png' | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							this.is_load = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      }).catch(err => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							  this.is_load = false; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						  }) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    }, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    setData: function (obj) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -213,7 +252,9 @@ export default { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					</style> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					<style rel="stylesheet/less" lang="less"> | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @import "list"; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						.lf-color-red{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							color: red; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						.user-item, .menu-item{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							height: 50rpx; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							width: 100%; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |