Browse Source

修改提交

yuwenjun 4 years ago
parent
commit
ab242af53b
3 changed files with 16 additions and 19 deletions
  1. 12 13
      pages/user/address/address.vue
  2. 0 2
      pages/user/club/club-list.vue
  3. 4 4
      services/user.service.js

+ 12 - 13
pages/user/address/address.vue

@@ -138,11 +138,6 @@ export default {
 		initAddressList() {
 		initAddressList() {
 			this.$api.getComStorage('clubInfo').then(resolve => {
 			this.$api.getComStorage('clubInfo').then(resolve => {
 				this.userId = resolve.userId
 				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 }
 				let params = { pageNum: this.pageNum, pageSize: this.pageSize, userId: this.userId }
 				this.UserService.QueryAddressList(params)
 				this.UserService.QueryAddressList(params)
 					.then(response => {
 					.then(response => {
@@ -225,18 +220,22 @@ export default {
 		setDefaultAddress(id) {
 		setDefaultAddress(id) {
 			this.UserService.DefaultAddress({ addressId: id, userId: this.userId })
 			this.UserService.DefaultAddress({ addressId: id, userId: this.userId })
 				.then(res => {
 				.then(res => {
-					console.log(res)
-					if(res.code === 0){
+					if (res.code === 0) {
 						this.$util.msg('操作成功', 1000, true, 'success')
 						this.$util.msg('操作成功', 1000, true, 'success')
-						setTimeout(()=>{
-							this.pageNum = 1
-							this.addressList = []
-							this.initAddressList()
-						},1000)
+						this.pageNum = 1
+						this.addressList = []
+						this.initAddressList()
+						// this.addressList = res.data.list
+						// this.pageNum = res.data.pageNum
+						// this.hasNextPage = res.data.hasNextPage
+						// console.log(this.addressList)
 					}
 					}
 				})
 				})
 				.catch(err => {
 				.catch(err => {
-					console.log(err)
+					this.$util.msg('操作失败,请重试', 1000, true, 'error')
+					this.pageNum = 1
+					this.addressList = []
+					this.initAddressList()
 				})
 				})
 		}
 		}
 	}
 	}

+ 0 - 2
pages/user/club/club-list.vue

@@ -133,9 +133,7 @@ export default {
 			this.showSkeleton = true
 			this.showSkeleton = true
 			this.pageNum = 1
 			this.pageNum = 1
 			this.clubList = await this.getClubList()
 			this.clubList = await this.getClubList()
-			console.log(this.clubList)
 			this.showSkeleton = false
 			this.showSkeleton = false
-			console.log(this.showSkeleton)
 		},
 		},
 		// 设置scroll高度
 		// 设置scroll高度
 		setScrollHeight() {
 		setScrollHeight() {

+ 4 - 4
services/user.service.js

@@ -46,7 +46,7 @@ export default class UserService {
 		return this.AjaxService.get({
 		return this.AjaxService.get({
 			url: '/other/findAddress',
 			url: '/other/findAddress',
 			data,
 			data,
-			isLoading: true
+			isLoading: false
 		})
 		})
 	}
 	}
 	/**
 	/**
@@ -56,7 +56,7 @@ export default class UserService {
 		return this.AjaxService.post({
 		return this.AjaxService.post({
 			url: '/other/saveAddress',
 			url: '/other/saveAddress',
 			data,
 			data,
-			isLoading: true
+			isLoading: false
 		})
 		})
 	}
 	}
 	/**
 	/**
@@ -67,7 +67,7 @@ export default class UserService {
 		return this.AjaxService.get({
 		return this.AjaxService.get({
 			url: '/other/deleteAddress',
 			url: '/other/deleteAddress',
 			data,
 			data,
-			isLoading: true
+			isLoading: false
 		})
 		})
 	}
 	}
 	/**
 	/**
@@ -79,7 +79,7 @@ export default class UserService {
 		return this.AjaxService.get({
 		return this.AjaxService.get({
 			url: '/other/defaultAddress',
 			url: '/other/defaultAddress',
 			data,
 			data,
-			isLoading: true
+			isLoading: false
 		})
 		})
 	}
 	}
 }
 }