瀏覽代碼

地址修改添加

yuwenjun 4 年之前
父節點
當前提交
655337ce97

+ 25 - 25
common/config/addressdata.js

@@ -2,60 +2,60 @@
  *请求获取省市区
  *已提供给地区选择picker组件使用
  */ 
-import { queryAddressInformation } from '@/services/public.js';
-const provinceData=[];
-const cityData=[];
-const areaData=[];
+import { queryAddressInformation } from '@/services/public.js'
+const provinceData=[]
+const cityData=[]
+const areaData=[]
 
-// queryAddressInformation().then(res =>{
-// 	let list = res.data;
-// 	list.forEach(item => {
-// 		let xxx = handleCitys(item);
-// 		provinceData.push(item);
-// 		cityData.push(xxx.e);
-// 		areaData.push(xxx.f);
-// 	})
-// })
+queryAddressInformation().then(res =>{
+	let list = res.data
+	list.forEach(item => {
+		let xxx = handleCitys(item)
+		provinceData.push(item)
+		cityData.push(xxx.e)
+		areaData.push(xxx.f)
+	})
+})
 //获取市后继续处理
 function handleCitys(data) {
-    const x = [];
-    const s = [];
+    const x = []
+    const s = []
     if (data.cityList.length) {
         data.cityList.forEach(item => {
-			let xxx = handleTowns(item);
-			s.push(xxx);
+			let xxx = handleTowns(item)
+			s.push(xxx)
 			x.push(item)
         })
     }else{
-		s.push([{name:''}]);
-		x.push([{name:''}]);
+		s.push([{name:''}])
+		x.push([{name:''}])
 	}
     return {
         e: x,
         f: s,
-    };
+    }
 }
 //获取区后继续处理
 function handleTowns(data) {
-    const x = [];
+    const x = []
     data.townList.forEach(item => {
         x.push(item)
     })
-    return x;
+    return x
 }
 
 function handleData3(data) {
-    const xxx = [];
+    const xxx = []
     data.forEach(item => {
         const ooo = []
         item.forEach(opt => {
            opt.forEach(z => {
-               ooo.push(z);
+               ooo.push(z)
            })
         })
         xxx.push(ooo)
     })
-    return xxx;
+    return xxx
 }
 module.exports = {
 	provinceData,

+ 7 - 7
components/mpvue-citypicker/mpvueCityPicker.vue

@@ -37,9 +37,9 @@
 			};
 		},
 		created() {
-			// console.log('provinceData',provinceData)
-			// console.log('cityData',cityData)
-			// console.log('areaData',areaData)
+			console.log('provinceData',provinceData)
+			console.log('cityData',cityData)
+			console.log('areaData',areaData)
 			// this.init()
 		},
 		props: {
@@ -55,7 +55,7 @@
 		},
 		watch: {
 			pickerValueDefault() {
-				// this.init();
+				this.init();
 			}
 		},
 		methods: {
@@ -149,13 +149,13 @@
 				return pcikerLabel;
 			},
 			_getTownCode() {
-				return this.areaDataList[this.pickerValue[2]].townID;
+				return this.areaDataList[this.pickerValue[2]].townId;
 			},
 			_getCityCode() {
-				return this.cityDataList[this.pickerValue[1]].cityID;
+				return this.cityDataList[this.pickerValue[1]].cityId;
 			},
 			_getProvinceCode() {
-				return this.provinceDataList[this.pickerValue[0]].provinceID;
+				return this.provinceDataList[this.pickerValue[0]].provinceId;
 			}
 		}
 	};

+ 13 - 21
pages/goods/product.vue

@@ -216,40 +216,31 @@
 							<scroll-view class="tui-popup-scroll" scroll-y="true">
 								<view class="content-tr">
 									<view class="content-td">起订量</view>
-									<view class="content-th">{{ product.minBuyNumber }}</view>
+									<view class="content-th">{{product.minBuyNumber}}</view>
 								</view>
 								<view class="content-tr">
 									<view class="content-td">品牌</view>
-									<view class="content-th">{{
-										product.brandName == null ? '其他' : product.brandName
-									}}</view>
+									<view class="content-th">{{product.brandName == null? '其他' : product.brandName}}</view>
 								</view>
 								<view class="content-tr">
 									<view class="content-td">分类</view>
-									<view class="content-th">{{
-										product.typeName == null ? '暂无' : product.typeName
-									}}</view>
+									<view class="content-th">{{product.typeName == null? '暂无' : product.typeName}}</view>
 								</view>
 								<view class="content-tr">
-									<view class="content-td">包装规格</view>
-									<view class="content-th">{{ product.unit }}</view>
+									<view class="content-td">包装规格</view> 
+									<view class="content-th">{{product.unit}}</view>
 								</view>
 								<view class="content-tr">
 									<view class="content-td">商品编码</view>
-									<view class="content-th">{{ product.productCode }}</view>
+									<view class="content-th">{{product.productCode}}</view>
 								</view>
 								<view class="content-tr">
 									<view class="content-td">库存</view>
-									<view class="content-th">{{ product.stock }}</view>
+									<view class="content-th">{{product.stock}}</view>
 								</view>
-								<view
-									class="content-tr"
-									v-if="product.parametersList.length > 0"
-									v-for="(item, index) in product.parametersList"
-									:key="index"
-								>
-									<view class="content-td">{{ item.paramsName }}</view>
-									<view class="content-th">{{ item.paramsContent }}</view>
+								<view class="content-tr" v-if="product.parametersList.length>0" v-for="(item, index) in product.parametersList" :key="index">
+									<view class="content-td">{{item.paramsName}}</view>
+									<view class="content-th">{{item.paramsContent}}</view>
 								</view>
 							</scroll-view>
 						</div>
@@ -630,13 +621,14 @@ export default {
 			//丢弃
 		},
 		onShare(res) {
+			console.log(this.product)
 			//分享转发
 			if (res.from === 'button') {
 				// 来自页面内转发按钮
 			}
 			return {
-				title: `${this.product.name}`,
-				path: `pages/goods/product?type=share&id=${this.productID}`,
+				title: `${this.product.productName}`,
+				path: `pages/goods/product?type=share&id=${this.productId}`,
 				imageUrl: `${this.productImage[0]}`
 			}
 		},

+ 304 - 271
pages/user/address/address.vue

@@ -1,40 +1,57 @@
 <template>
 	<view class="container clearfix">
 		<view v-if="isEmpty" class="empty-container">
-			<image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AFmO1AAGxLZjSeDg040.png" mode="aspectFit"></image>
+			<image
+				class="empty-container-image"
+				src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AFmO1AAGxLZjSeDg040.png"
+				mode="aspectFit"
+			></image>
 			<view class="txt">您还没有收货地址</view>
 			<view class="txt">点击底部按钮添加收货地址吧~~</view>
 			<view class="login-btn" @click="addAddress('add')">添加新地址</view>
 		</view>
-		<view v-else class="address-list" :style="{'height': scrollHeight + 'px'}">
-			<scroll-view scroll-y="true" :style="{'height': scrollHeight + 'px'}">
-				<view class="list" v-for="(item, index) in addressList" :key="index" @click="checkAddress(item)">
+		<view v-else class="address-list" :style="{ height: scrollHeight + 'px' }">
+			<scroll-view scroll-y="true" :style="{ height: scrollHeight + 'px' }">
+				<view
+					class="list"
+					v-for="(item, index) in addressList"
+					:key="index"
+					@click="checkAddress(item)"
+				>
 					<view class="wrapper">
 						<view class="u-box">
-							<text class="name">{{item.shouHuoRen}}</text>
-							<text class="mobile">{{item.mobile}}</text>
+							<text class="name">{{ item.shouHuoRen }}</text>
+							<text class="mobile">{{ item.mobile }}</text>
 							<text v-if="item.defaultFlag == 1" class="default-tags">默认</text>
 						</view>
 						<view class="u-box b-b">
-							<text class="address"><text class="label">收货地址:</text>{{item.province}}{{item.city}}{{item.town}}{{item.address}}</text>
+							<text class="address"
+								><text class="label">收货地址:</text>{{ item.provinceName
+								}}{{ item.cityName }}{{ item.townName }}{{ item.address }}</text
+							>
 						</view>
 						<view class="u-box b-t">
 							<view v-if="item.defaultFlag == 1" class="tag-left">
-								<view class="tag"><text class="iconfont icon-xuanze"></text><text>已设为默认地址</text></view>
+								<view class="tag"
+									><text class="iconfont icon-xuanze"></text
+									><text>已设为默认地址</text></view
+								>
 							</view>
 							<view v-else class="tag-left">
-								<view class="tag"><text class="iconfont icon-weixuanze"></text><text>设为默认地址</text></view>
+								<view class="tag"
+									><text class="iconfont icon-weixuanze"></text
+									><text>设为默认地址</text></view
+								>
 							</view>
 							<view class="tag-right">
-								<view class="t-b"  @click.stop="deleteAddress(item.addressID)">
+								<view class="t-b" @click.stop="deleteAddress(item.addressId)">
 									<text class="iconfont icon-shanchu"></text>
 									<text class="txt">删除</text>
 								</view>
-								<view class="t-b"  @click.stop="addAddress('edit',item)">
+								<view class="t-b" @click.stop="addAddress('edit', item)">
 									<text class="iconfont icon-bianji"></text>
 									<text class="txt">编辑</text>
 								</view>
-								
 							</view>
 						</view>
 					</view>
@@ -42,293 +59,309 @@
 			</scroll-view>
 			<view class="add-btn" @click="addAddress('add')">添加新地址</view>
 		</view>
-		<tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :content="contentModalText" color="#333" :size="32" shape="circle" :maskClosable="false"></tui-modal>
+		<tui-modal
+			:show="modal"
+			@click="handleClick"
+			@cancel="hideMobel"
+			:content="contentModalText"
+			color="#333"
+			:size="32"
+			shape="circle"
+			:maskClosable="false"
+		></tui-modal>
 	</view>
 </template>
 
 <script>
-	import authorize from '@/common/config/authorize.js'	
-	import modelAlert from '@/components/cm-module/modelAlert/modelAlert.vue'
-	import { addressList } from '@/common/json/data.json.js' //本地数据
-	
-	export default {
-		components:{
-			modelAlert
-		},
-		data() {
-			return {
-				isSelect:false,
-				isEmpty:false,
-				isLoadMore:false,
-				userID:'',
-				pageNum:1,
-				pageSize:10,
-				addressList: addressList,
-				hasNextPage:false,
-				allowDataStatus:true,
-				wrapperHeight:'100%',
-				scrollHeight:'',
-				currPage:'',//当前页面
-				prevPage:'',//上一个页面
-				modal:false,
-				contentModalText:'',
-				deleteAddressId:0
-			}
+import authorize from '@/common/config/authorize.js'
+import modelAlert from '@/components/cm-module/modelAlert/modelAlert.vue'
+// import { addressList } from '@/common/json/data.json.js' //本地数据
+
+export default {
+	components: {
+		modelAlert
+	},
+	data() {
+		return {
+			isSelect: false,
+			isEmpty: false,
+			isLoadMore: false,
+			userId: '',
+			pageNum: 1,
+			pageSize: 10,
+			addressList: [],
+			hasNextPage: false,
+			allowDataStatus: true,
+			wrapperHeight: '100%',
+			scrollHeight: '',
+			currPage: '', //当前页面
+			prevPage: '', //上一个页面
+			modal: false,
+			contentModalText: '',
+			deleteaddressId: 0
+		}
+	},
+	onLoad(option) {
+		// if (option.type == 'select') {
+		// 	this.isSelect = true
+		// }
+		this.setScrollHeight()
+		// console.log(this.addressList)
+		this.initAddressList()
+	},
+	onReachBottom() {
+		if (this.isLoadMore) {
+			this.initAddressList()
+		}
+	},
+	methods: {
+		setScrollHeight() {
+			// 窗口高度 - 底部距离
+			setTimeout(() => {
+				const query = wx.createSelectorQuery().in(this)
+				query.selectAll('.add-btn').boundingClientRect()
+				query.exec(res => {
+					if (res[0][0]) {
+						let winHeight = this.$api.getWindowHeight(),
+							eleTop = res[0][0].top - 1
+						this.scrollHeight = eleTop
+					}
+				})
+			}, 500)
 		},
-		onLoad(option){	
-			if(option.type=='select'){this.isSelect = true;}
-			this.setScrollHeight();
-			console.log(this.addressList)	
+		// 初始化地址列表
+		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
+						} else {
+							this.isLoadMore = true
+						}
+					}
+				})
+				.catch(error => {
+					this.$util.msg(error.msg, 2000)
+				})
 		},
-		onReachBottom() {
-			if(this.isLoadMore) {
-				this.initAddressList();
+		//选择地址
+		checkAddress(item) {
+			//是否需要返回地址(从订单确认页跳过来选收货地址)
+			if (!this.isSelect) {
+				return
 			}
+			uni.setStorageSync('selectAddress', item)
+			var pages = getCurrentPages()
+			var prevPage = pages[pages.length - 2] //上一个页面
+			prevPage.setData({ select: 'select' })
+			uni.navigateBack()
 		},
-		methods: {
-			setScrollHeight() {	// 窗口高度 - 底部距离
-				setTimeout(()=> {
-					const query = wx.createSelectorQuery().in(this);
-					query.selectAll('.add-btn').boundingClientRect();
-					query.exec(res => {
-						if(res[0][0]){
-							let winHeight = this.$api.getWindowHeight(),
-								eleTop = res[0][0].top - 1;
-								this.scrollHeight =  eleTop;
-						}
-					})
-				}, 500)
-			},
-			initAddressList(){	
-				this.$api.getComStorage('orderUserInfo').then((resolve) =>{
-					this.userID = resolve.userID
-					let params = {pageNum:this.pageNum,pageSize:this.pageSize,userID:this.userID}
-					this.UserService.QueryAddressList(params).then(response =>{
-						if(response.data.results == ''){
-							this.isEmpty = true
-						}else{
-							this.isEmpty = false
-							let results =[];
-							results = response.data.results;
-							this.addressList = this.addressList.concat(results);
-							this.pageNum = response.index +1;
-							if(this.pageNum === response.totalPage + 1 ){
-								this.isLoadMore = false;
-							} else {
-								this.isLoadMore = true;
-							}
-						}
-					}).catch(error =>{
-						this.$util.msg(error.msg,2000)
-					})
-				})
-				
-			},
-			//选择地址
-			checkAddress(item){
-				//是否需要返回地址(从订单确认页跳过来选收货地址)
-				if(!this.isSelect){return ;}
-				uni.setStorageSync('selectAddress',item)
-				var pages = getCurrentPages();
-				var prevPage = pages[pages.length - 2];  //上一个页面	
-					prevPage.setData({select:'select'})
-				uni.navigateBack();
-			},
-			addAddress(type,item){
-				uni.navigateTo({
-					url: `/pages/user/address/addressManage?type=${type}&data=${JSON.stringify(item)}`
+		// 跳转添加地址页面 type:添加或修改
+		addAddress(type, item) {
+			uni.navigateTo({
+				url: `/pages/user/address/addressManage?type=${type}&data=${JSON.stringify(item)}`
+			})
+		},
+		handleClick(e) {
+			//用户操作订单
+			let index = e.index
+			if (index == 1) {
+				this.UserService.DeleteNewAddress({
+					addressId: this.deleteaddressId,
+					userId: this.userId
 				})
-			},
-			handleClick(e) {//用户操作订单
-				let index = e.index;
-				if(index == 1){
-					this.UserService.DeleteNewAddress({addressID:this.deleteAddressId,userID:this.userID}).then(response =>{
-						this.$util.msg('删除成功',2000,true,'success')
-						setTimeout(() =>{
-							this.pageNum = 1;
-							this.addressList = [];
-							this.initAddressList();
-						},2000)
-					}).catch(error =>{
-						this.$util.msg(error.msg,2000);
-						setTimeout(function(){
+					.then(response => {
+						this.$util.msg('删除成功', 2000, true, 'success')
+						setTimeout(() => {
+							this.pageNum = 1
+							this.addressList = []
+							this.initAddressList()
+						}, 2000)
+					})
+					.catch(error => {
+						this.$util.msg(error.msg, 2000)
+						setTimeout(function() {
 							uni.switchTab({
-								url:'/seller/pages/home/home'
+								url: '/seller/pages/home/home'
 							})
-						},1000)
+						}, 1000)
 					})
-				}
-				this.modal = false;
-			},
-			hideMobel(){
-				this.modal = false;
-			},
-			//删除收货地址
-			deleteAddress(id){
-				this.modal = true;
-				this.contentModalText = '确认删除该地址吗?';
-				this.deleteAddressId =id;
 			}
+			this.modal = false
+		},
+		hideMobel() {
+			this.modal = false
 		},
-		onShow() {
-			// this.$api.getStorage().then((resolve) =>{
-			// 	this.userID = resolve.userID
-			// 	this.pageNum = 1;
-			// 	this.addressList = [];
-			// 	// this.initAddressList();
-			// 	var pages = getCurrentPages();
-			// 	var prevPage = pages[pages.length - 2];  //上一个页面	
-			// 		// prevPage.setData({select:''})
-			// })
+		//删除收货地址
+		deleteAddress(id) {
+			this.modal = true
+			this.contentModalText = '确认删除该地址吗?'
+			this.deleteaddressId = id
 		}
-	}
+	},
+	onShow() {}
+}
 </script>
 
-<style lang='scss'>
-	page {
-		height: auto;
-	}
-	page,.container{
-		/* padding-bottom: 120upx; */
-		background: #F7F7F7;
-		border-top: 1px solid #EBEBEB;
+<style lang="scss">
+page {
+	height: auto;
+}
+page,
+.container {
+	/* padding-bottom: 120upx; */
+	background: #f7f7f7;
+	border-top: 1px solid #ebebeb;
+}
+.container {
+	position: relative;
+}
+.list {
+	display: flex;
+	align-items: center;
+	width: 702rpx;
+	height: auto;
+	padding: 24rpx;
+	background: #ffffff;
+	position: relative;
+	margin-bottom: 20rpx;
+}
+.wrapper {
+	display: flex;
+	flex-direction: column;
+	flex: 1;
+}
+.u-box .label {
+	color: #999999;
+}
+.u-box.b-b {
+	margin-bottom: 24rpx;
+}
+.u-box.b-t {
+	margin-bottom: 0;
+}
+.u-box {
+	display: flex;
+	align-items: center;
+	font-size: $font-size-26;
+	color: $text-color;
+	line-height: 40rpx;
+	margin-bottom: 12rpx;
+	.name {
+		margin-right: 40rpx;
+		font-weight: bold;
 	}
-	.container{
-		position: relative;
+	.mobile {
+		font-weight: bold;
 	}
-	.list{
-		display: flex;
-		align-items: center;
-		width: 702rpx;
-		height: auto;
-		padding: 24rpx;
-		background: #FFFFFF;
-		position: relative;
-		margin-bottom: 20rpx;
-	}
-	.wrapper{
-		display: flex;
-		flex-direction: column;
-		flex: 1;
-	}
-	.u-box .label{
-		color: #999999;
-	}
-	.u-box.b-b{
-		margin-bottom:24rpx;
-	}
-	.u-box.b-t{
-		margin-bottom:0;
+	.default-tags {
+		margin-left: 15rpx;
+		display: block;
+		width: 72rpx;
+		height: 32rpx;
+		border-radius: 16rpx;
+		background-color: #fff3e2;
+		color: #c4761f;
+		line-height: 32rpx;
+		text-align: center;
+		font-size: 22rpx;
 	}
-	.u-box{
-		display: flex;
-		align-items: center;
-		font-size: $font-size-26;
-		color: $text-color;
-		line-height: 40rpx;
-		margin-bottom: 12rpx;
-		.name{
-			margin-right: 40rpx;
-			font-weight: bold;
-		}
-		.mobile{
-			font-weight: bold;
-		}
-		.default-tags{
-			margin-left: 15rpx;
-			display: block;
-			width: 72rpx;
-			height: 32rpx;
-			border-radius: 16rpx;
-			background-color: #fff3e2;
-			color: #c4761f;
-			line-height: 32rpx;
-			text-align: center;
-			font-size: 22rpx;
-		}
-		.tag-left{
-			flex: 6;
-			.tag{
-				width: 280rpx;
-				height: 40rpx;
-				font-size: $font-size-26;
+	.tag-left {
+		flex: 6;
+		.tag {
+			width: 280rpx;
+			height: 40rpx;
+			font-size: $font-size-26;
+			color: #999999;
+			line-height: 40rpx;
+			.icon-xuanze {
+				color: #333333;
+				font-size: 38rpx;
+				margin-right: 10rpx;
+			}
+			.icon-weixuanze {
 				color: #999999;
-				line-height: 40rpx;
-				.icon-xuanze{
-					color: #333333;
-					font-size: 38rpx;
-					margin-right: 10rpx;
-				}
-				.icon-weixuanze{
-					color: #999999;
-					font-size: 38rpx;
-					margin-right: 10rpx;
-				}
+				font-size: 38rpx;
+				margin-right: 10rpx;
 			}
 		}
-		.tag-right{
-			flex: 4;
-			display: flex;
-			text-align: right;
-			.t-b{
-				flex: 1;
+	}
+	.tag-right {
+		flex: 4;
+		display: flex;
+		text-align: right;
+		.t-b {
+			flex: 1;
+			line-height: 40rpx;
+			.txt {
+				font-size: $font-size-24;
+				color: $text-color;
 				line-height: 40rpx;
-				.txt{
-					font-size: $font-size-24;
-					color: $text-color;
-					line-height: 40rpx;
-				}
-			}
-			.icon-shanchu{
-				color:#333333 ;
-				margin-right: 8rpx;
-			}
-			.icon-bianji{
-				color: #333333;
-				margin-right: 8rpx;
 			}
 		}
-		.address{
-			font-size: $font-size-28;
-			color: $text-color;
-			line-height: 40rpx;
-			-o-text-overflow: ellipsis;
-			text-overflow: ellipsis;
-			display: -webkit-box;
-			word-break: break-all;
-			-webkit-box-orient: vertical;
-			-webkit-line-clamp: 2;
-			overflow: hidden;
+		.icon-shanchu {
+			color: #333333;
+			margin-right: 8rpx;
+		}
+		.icon-bianji {
+			color: #333333;
+			margin-right: 8rpx;
 		}
 	}
-	.add-btn{
-		position: fixed;
-		left: 24rpx;
-		right: 24rpx;
-		bottom: 34rpx;
-		z-index: 95;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		width: 702rpx;
-		height: 88rpx;
+	.address {
 		font-size: $font-size-28;
-		line-height: 88rpx;
-		color: #FFFFFF;
-		text-align: center;
-		background: $btn-confirm;
-		border-radius: 45rpx;
-	}
-	.adds-btn{
-		width: 702rpx;
-		height: 88rpx;
-		font-size: 28rpx;
-		line-height: 88rpx;
-		color: #FFFFFF;
-		margin: 0 auto;
-		text-align: center;
-		background: #000000;
-		border-radius: 14rpx;
+		color: $text-color;
+		line-height: 40rpx;
+		-o-text-overflow: ellipsis;
+		text-overflow: ellipsis;
+		display: -webkit-box;
+		word-break: break-all;
+		-webkit-box-orient: vertical;
+		-webkit-line-clamp: 2;
+		overflow: hidden;
 	}
+}
+.add-btn {
+	position: fixed;
+	left: 24rpx;
+	right: 24rpx;
+	bottom: 34rpx;
+	z-index: 95;
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 702rpx;
+	height: 88rpx;
+	font-size: $font-size-28;
+	line-height: 88rpx;
+	color: #ffffff;
+	text-align: center;
+	background: $btn-confirm;
+	border-radius: 45rpx;
+}
+.adds-btn {
+	width: 702rpx;
+	height: 88rpx;
+	font-size: 28rpx;
+	line-height: 88rpx;
+	color: #ffffff;
+	margin: 0 auto;
+	text-align: center;
+	background: #000000;
+	border-radius: 14rpx;
+}
 </style>
-

+ 20 - 14
pages/user/address/addressManage.vue

@@ -60,13 +60,13 @@
 				isShowInput:false,
 				switchDefault:false,
 				addressData:{
-					addressID:'',
+					addressId:'',
 					allAddress:'请选择所在地区',
-					userID: '',			//用户id ,只在新增收货地址时传
+					userId: '',			//用户id ,只在新增收货地址时传
 					shouHuoRen: '',		//收货人
 					mobile:'',			//收货人手机
-					townID:'',			//区ID
-					address: '',	//地址
+					townId:'',			//区ID
+					address: '',		//地址
 					defaultFlag:0,		//是否默认收货地址(0 不是默认,1 默认)
 				},
 				params:{}				//参数
@@ -79,15 +79,17 @@
 				this.isConfirm = false;
 				this.addType = 2;	
 				let optionData = JSON.parse(option.data)
-				this.addressData.allAddress = `${optionData.province}-${optionData.city}-${optionData.town}`
+				console.log(optionData);
+				// 设置默认值
+				this.addressData.allAddress = `${optionData.provinceName}-${optionData.cityName}-${optionData.townName}`
 				this.addressData.address = optionData.address
 				this.addressData.defaultFlag = optionData.defaultFlag;
-				this.addressData.userID = optionData.userID;
+				this.addressData.userId = optionData.userId;
 				this.addressData.mobile = optionData.mobile;
-				this.addressData.townID = optionData.townID;
-				this.addressData.addressID = optionData.addressID;
+				this.addressData.townId = optionData.townId;
+				this.addressData.addressId = optionData.addressId;
 				this.addressData.shouHuoRen = optionData.shouHuoRen;
-				this.addressData.addressID = optionData.addressID;
+				this.addressData.addressId = optionData.addressId;
 				if(optionData.defaultFlag == 1){
 					this.switchDefault = true
 				}else{
@@ -113,7 +115,8 @@
 			},
 			onConfirm(e) {
 				this.addressData.allAddress = e.name;
-				this.addressData.townID = e.townCode;
+				this.addressData.townId = e.townCode;
+				console.log(e);
 				this.initInput();
 			},			
 			//提交
@@ -130,9 +133,11 @@
 				}
 				if(this.addType ==1){
 					this.params ={
-							userID:this.addressData.userID,			//用户id ,只在新增收货地址时传
+							// 测试id
+							userId:'13914',
+							// userId:this.addressData.userId,			//用户id ,只在新增收货地址时传
 							shouHuoRen:this.addressData.shouHuoRen ,//收货人
-							townID:this.addressData.townID,			//区ID
+							townId:this.addressData.townId,			//区ID
 							address:this.addressData.address,		//地址
 							mobile:this.addressData.mobile,			//手机
 							defaultFlag:this.addressData.defaultFlag//是否默认收货地址(0 不是默认,1 默认)
@@ -145,6 +150,7 @@
 			},
 			postAddressData(res){
 				this.btnText(true)
+				// 保存地址
 				this.UserService.AddNewAddress(res).then( response=>{
 					this.$util.msg('保存成功',2000,true,'success')
 					this.btnText(false)
@@ -182,7 +188,7 @@
 			   this.initInput();
 			},
 			initInput(){
-				if(this.addressData.shouHuoRen !== "" && this.addressData.mobile !=="" && this.addressData.address !=="" && this.addressData.townID!==""){
+				if(this.addressData.shouHuoRen !== "" && this.addressData.mobile !=="" && this.addressData.address !=="" && this.addressData.townId!==""){
 					this.isConfirm =false;
 				}else{
 					this.isConfirm =true;
@@ -191,7 +197,7 @@
 		},
 		onShow() {
 			this.$api.getComStorage('orderUserInfo').then((resolve) =>{
-				this.addressData.userID = resolve.userID
+				this.addressData.userId = resolve.userId
 			})
 		}
 	}

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

@@ -129,6 +129,7 @@ export default {
 		async init() {
 			this.pageNum = 1
 			this.clubList = await this.getClubList()
+			console.log(this.clubList)
 		},
 		// 设置scroll高度
 		setScrollHeight() {

+ 65 - 65
services/public.js

@@ -13,15 +13,15 @@ import $reg from '@/common/config/common.js'
  *获取省市区列表
  */
 export function queryAddressInformation() {
-	return new Promise(function(resolve,reject) {
-		request.get("/club/address",{}, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
+	return new Promise(function(resolve, reject) {
+		request.get('/other/list', {}, res => {
+			if (res.code == 0) {
+				resolve(res)
+			} else {
 				reject(res)
 			}
 		})
-	});
+	})
 }
 /**
  * @新分类下的商品列表
@@ -29,146 +29,146 @@ export function queryAddressInformation() {
  * @param:pageNum	页码
  * @param:pageSize	每页显示条数
  */
-export function searchQueryTinyType(url,params) {
-	return new Promise(function(resolve,reject) {
-		request.lodingGet(url,params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
+export function searchQueryTinyType(url, params) {
+	return new Promise(function(resolve, reject) {
+		request.lodingGet(url, params, res => {
+			if (res.code == 0) {
+				resolve(res)
+			} else {
 				reject(res)
 			}
 		})
-	});
+	})
 }
 /**
  *获取协议
  */
 export function queryProtocol() {
-	return new Promise(function(resolve,reject) {
-		request.get("/club/protocol",{}, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
+	return new Promise(function(resolve, reject) {
+		request.get('/club/protocol', {}, res => {
+			if (res.code == 0) {
+				resolve(res)
+			} else {
 				reject(res)
 			}
 		})
-	});
+	})
 }
 /**
  *获取邮箱验证码
  */
 export function getEmailCode(params) {
-	return new Promise(function(resolve,reject) {		
-		request.get("/user/mailbox",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
+	return new Promise(function(resolve, reject) {
+		request.get('/user/mailbox', params, res => {
+			if (res.code == 0) {
+				resolve(res)
+			} else {
 				reject(res)
 			}
 		})
-	});
+	})
 }
 /**
  *注册专用获取验证码
  */
 export function getRegisterMobileCode(params) {
-	return new Promise(function(resolve,reject) {
-		request.get("/club/captcha",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
+	return new Promise(function(resolve, reject) {
+		request.get('/club/captcha', params, res => {
+			if (res.code == 0) {
+				resolve(res)
+			} else {
 				reject(res)
 			}
 		})
-	});
+	})
 }
 /**
  *会所资料修改手机号
  *旧手机号获取验证码
  */
 export function getClubMobileCode(params) {
-	return new Promise(function(resolve,reject) {
-		request.get("/club/modifyPhoneNumber",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
+	return new Promise(function(resolve, reject) {
+		request.get('/club/modifyPhoneNumber', params, res => {
+			if (res.code == 0) {
+				resolve(res)
+			} else {
 				reject(res)
 			}
 		})
-	});
+	})
 }
 /**
  *会所资料修改手机号
  *新手机号获取验证码
  */
 export function getClubNewMobileCode(params) {
-	return new Promise(function(resolve,reject) {
-		request.get("/club/modifyPhoneNumber",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
+	return new Promise(function(resolve, reject) {
+		request.get('/club/modifyPhoneNumber', params, res => {
+			if (res.code == 0) {
+				resolve(res)
+			} else {
 				reject(res)
 			}
 		})
-	});
+	})
 }
 /**
  *小程序机构账号绑定微信,PC微信绑定机构账号
  */
 export function getbindWechatCode(params) {
-	return new Promise(function(resolve,reject) {
-		request.get("/user/note",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
+	return new Promise(function(resolve, reject) {
+		request.get('/user/note', params, res => {
+			if (res.code == 0) {
+				resolve(res)
+			} else {
 				reject(res)
 			}
 		})
-	});
+	})
 }
 /**
  *通过邀请链接绑定运营人员获取手机短信
  */
 export function getbindOperatorCode(params) {
-	return new Promise(function(resolve,reject) {
-		request.get("/seller/note",params, res => {
-			if(res.code == 0){
-				resolve(res);
-			}else{
+	return new Promise(function(resolve, reject) {
+		request.get('/seller/note', params, res => {
+			if (res.code == 0) {
+				resolve(res)
+			} else {
 				reject(res)
 			}
 		})
-	});
+	})
 }
 /**
  *上传图片
  */
 export function uploadFileImage() {
-	return new Promise(function(resolve,reject) {
+	return new Promise(function(resolve, reject) {
 		uni.chooseImage({
 			count: 1, //默认1
-			sizeType: ['original','compressed'], //可以指定是原图还是压缩图,默认二者都有
+			sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
 			sourceType: ['album'], //从相册选择
 			success: (res) => {
-				const tempFilePaths = res.tempFilePaths;
+				const tempFilePaths = res.tempFilePaths
 				const uploadTask = uni.uploadFile({
-					url : requestUrl+'/formData/MultiPictareaddData',
+					url: requestUrl + '/formData/MultiPictareaddData',
 					filePath: tempFilePaths[0],
 					name: 'file',
 					header: {
-					    "Content-Type": "multipart/form-data",
+						'Content-Type': 'multipart/form-data',
 					},
 					formData: {
 						'user': 'test'
 					},
-					success: function (res) {
-						resolve(res);
+					success: function(res) {
+						resolve(res)
 					},
-					error : function(e){
+					error: function(e) {
 						reject(res)
 					}
 				})
 			}
-		});
-	});
+		})
+	})
 }

+ 3 - 3
services/user.service.js

@@ -44,7 +44,7 @@ export default class UserService {
 	 */
 	QueryAddressList(data = {}) {
 		return this.AjaxService.get({
-			url: '/personalCenter/findAddress',
+			url: '/other/findAddress',
 			data,
 			isLoading: true
 		})
@@ -56,7 +56,7 @@ export default class UserService {
 	 */
 	AddNewAddress(data = {}) {
 		return this.AjaxService.post({
-			url: '/personalCenter/saveAddress',
+			url: '/other/saveAddress',
 			data,
 			isLoading: true
 		})
@@ -68,7 +68,7 @@ export default class UserService {
 	 */
 	DeleteNewAddress(data = {}) {
 		return this.AjaxService.get({
-			url: '/personalCenter/deleteAddress',
+			url: '/other/deleteAddress',
 			data,
 			isLoading: true
 		})