Ver Fonte

地址修改

1004749546@qq.com há 4 anos atrás
pai
commit
9adf510c87
2 ficheiros alterados com 32 adições e 26 exclusões
  1. 31 25
      pages/toOrder/editAddress.vue
  2. 1 1
      pages/userCenter/userInfo/userInfo.vue

+ 31 - 25
pages/toOrder/editAddress.vue

@@ -38,31 +38,6 @@
 				receiveAreas: '', //地址编码
 				areaName: '', //地址
 				rules: {
-					receiverName: [
-						{ 
-							required: true, 
-							message: '请输入姓名', 
-							// 可以单个或者同时写两个触发验证方式 
-							trigger: ['change','blur'],
-						}
-					],
-					receiverPhone: [
-						{ 
-							required: true, 
-							message: '请输入电话', 
-							// 可以单个或者同时写两个触发验证方式 
-							trigger: ['change','blur'],
-						}
-					],
-					receiveAreasName: [
-						{
-							required: true, 
-							message: '请选择省市区', 
-							trigger: ['change','blur']
-						}
-					],
-					receiveAddress: [
-					]
 				}
 			};
 		},
@@ -81,11 +56,42 @@
 				})
 			}
 		},
+		onUnload() {
+			this.$u.vuex("vuex_OrderAddress",{})
+		},
 		methods: {
 			submit() {
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
 						console.log('验证通过');
+						if (this.form.receiverName ==='') {
+							uni.showToast({
+								title: '请输入姓名',
+								icon: 'none'
+							})
+							return false
+						}
+						if (this.form.receiverPhone ==='') {
+							uni.showToast({
+								title: '请输入电话',
+								icon: 'none'
+							})
+							return false
+						}
+						if (this.form.receiveAreasName ==='') {
+							uni.showToast({
+								title: '请选择省市区',
+								icon: 'none'
+							})
+							return false
+						}
+						if (this.form.receiveAddress ==='') {
+							uni.showToast({
+								title: '请输入详细地址',
+								icon: 'none'
+							})
+							return false
+						}
 						let params = {
 							receiverName: this.form.receiverName,
 							receiverPhone: this.form.receiverPhone,

+ 1 - 1
pages/userCenter/userInfo/userInfo.vue

@@ -44,7 +44,7 @@
 				 findAddressBycustomerNo({}).then(res => {
 					 console.log(res)
 					 if (res.status == 200&&res.data.length) {
-						 this.address = res.data[0].receiveAddress
+						 this.address = res.data[0].receiveAreasName
 						 this.userInfo = res.data[0]
 					 } else {
 						 this.address = ''