zs %!s(int64=2) %!d(string=hai) anos
pai
achega
db57bfd6b7
Modificáronse 1 ficheiros con 5 adicións e 6 borrados
  1. 5 6
      pagesMy/address/index.vue

+ 5 - 6
pagesMy/address/index.vue

@@ -6,7 +6,7 @@
 					<view class="list-scroll-view">
 					<view class="list-scroll-view">
 						<radio-group @change="addressChange" v-if="type=='shopping'">
 						<radio-group @change="addressChange" v-if="type=='shopping'">
 							<label class="radio" v-for="(item, index) in list" :key="index">
 							<label class="radio" v-for="(item, index) in list" :key="index">
-								<radio :value="item._id" :checked="index === address" />
+								<radio :value="item._id" :checked="item._id === address" />
 								<view class="radio_1">
 								<view class="radio_1">
 									<view class="name">
 									<view class="name">
 										<text>{{item.name}}</text>
 										<text>{{item.name}}</text>
@@ -86,9 +86,8 @@
 		data() {
 		data() {
 			return {
 			return {
 				// 购物选地址
 				// 购物选地址
-				id: '',
 				type: '',
 				type: '',
-				address: -1,
+				address: '',
 				// 系统设置
 				// 系统设置
 				config: {},
 				config: {},
 				user: {},
 				user: {},
@@ -105,7 +104,7 @@
 		onLoad: async function(e) {
 		onLoad: async function(e) {
 			const that = this;
 			const that = this;
 			that.$set(that, `type`, e && e.type || '');
 			that.$set(that, `type`, e && e.type || '');
-			that.$set(that, `id`, e && e.id || '');
+			that.$set(that, `address`, e && e.id || '');
 			that.searchConfig();
 			that.searchConfig();
 			that.watchLogin();
 			that.watchLogin();
 		},
 		},
@@ -162,7 +161,7 @@
 					if (that.id) {
 					if (that.id) {
 						for (let i = 0; i < list.length; i++) {
 						for (let i = 0; i < list.length; i++) {
 							if (list[i]._id === that.id) {
 							if (list[i]._id === that.id) {
-								that.address = i;
+								that.address = that.id;
 								break;
 								break;
 							}
 							}
 						}
 						}
@@ -199,7 +198,7 @@
 				const that = this;
 				const that = this;
 				for (let i = 0; i < that.list.length; i++) {
 				for (let i = 0; i < that.list.length; i++) {
 					if (that.list[i]._id === e.detail.value) {
 					if (that.list[i]._id === e.detail.value) {
-						that.address = i;
+						that.address = e.detail.value;
 						break;
 						break;
 					}
 					}
 				}
 				}