yuwenjun преди 4 години
родител
ревизия
bbdff24bb6
променени са 2 файла, в които са добавени 35 реда и са изтрити 30 реда
  1. 32 27
      pages/user/address/address.vue
  2. 3 3
      pages/user/address/addressManage.vue

+ 32 - 27
pages/user/address/address.vue

@@ -102,9 +102,10 @@ export default {
 		}
 	},
 	onLoad(option) {
-		// if (option.type == 'select') {
-		// 	this.isSelect = true
-		// }
+		if (option.type == 'select') {
+			this.isSelect = true
+		}
+		console.log(option && option)
 		this.setScrollHeight()
 		// console.log(this.addressList)
 		this.initAddressList()
@@ -131,32 +132,36 @@ export default {
 		},
 		// 初始化地址列表
 		initAddressList() {
-			// this.$api.getComStorage('orderUserInfo').then(resolve => {})
-			// this.userId = resolve.userId
-			// 设置默认地址 测试使用
-			this.userId = '13914'
-			let params = { pageNum: this.pageNum, pageSize: this.pageSize, userId: this.userId }
-			this.UserService.QueryAddressList(params)
-				.then(response => {
-					console.log(response)
-					if (response.data.list == '') {
-						this.isEmpty = true
-					} else {
-						this.isEmpty = false
-						let results = []
-						results = response.data.list
-						this.addressList = this.addressList.concat(results)
-						this.pageNum = response.data.pageNum + 1
-						if (response.data.hasNextPage) {
-							this.isLoadMore = false
+			this.$api.getComStorage('clubInfo').then(resolve => {
+				this.userId = resolve.userId
+				// 设置默认地址 测试使用
+				// const clubInfo = uni.getStorageSync('clubInfo')
+				// this.userId = clubInfo.userId
+				// this.userId = '13914'
+				console.log(this.userId)
+				let params = { pageNum: this.pageNum, pageSize: this.pageSize, userId: this.userId }
+				this.UserService.QueryAddressList(params)
+					.then(response => {
+						console.log(response)
+						if (response.data.list == '') {
+							this.isEmpty = true
 						} else {
-							this.isLoadMore = true
+							this.isEmpty = false
+							let results = []
+							results = response.data.list
+							this.addressList = this.addressList.concat(results)
+							this.pageNum = response.data.pageNum + 1
+							if (response.data.hasNextPage) {
+								this.isLoadMore = false
+							} else {
+								this.isLoadMore = true
+							}
 						}
-					}
-				})
-				.catch(error => {
-					this.$util.msg(error.msg, 2000)
-				})
+					})
+					.catch(error => {
+						this.$util.msg(error.msg, 2000)
+					})
+			})
 		},
 		//选择地址
 		checkAddress(item) {

+ 3 - 3
pages/user/address/addressManage.vue

@@ -134,8 +134,8 @@
 				if(this.addType ==1){
 					this.params ={
 							// 测试id
-							userId:'13914',
-							// userId:this.addressData.userId,			//用户id ,只在新增收货地址时传
+							// userId:'13914',
+							userId:this.addressData.userId,			//用户id ,只在新增收货地址时传
 							shouHuoRen:this.addressData.shouHuoRen ,//收货人
 							townId:this.addressData.townId,			//区ID
 							address:this.addressData.address,		//地址
@@ -196,7 +196,7 @@
 			}
 		},
 		onShow() {
-			this.$api.getComStorage('orderUserInfo').then((resolve) =>{
+			this.$api.getComStorage('clubInfo').then((resolve) =>{
 				this.addressData.userId = resolve.userId
 			})
 		}