From 11c8a711e3296ee385b2f09ca55af4a13811f827 Mon Sep 17 00:00:00 2001 From: fanfan Date: Fri, 23 Feb 2024 20:53:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9D=80=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8F=92=E4=BB=B6=20=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E7=9C=9F=E5=AE=9E=E7=9C=81=E5=B8=82=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/news/park/addressEdit.vue | 57 +++++++++++++++------------------ 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/pages/news/park/addressEdit.vue b/pages/news/park/addressEdit.vue index 8f41c60..586ed38 100644 --- a/pages/news/park/addressEdit.vue +++ b/pages/news/park/addressEdit.vue @@ -117,43 +117,39 @@ }, // 获取多列的索引 multiChange: function(e) { - // console.log(e); - var _this = this; - var multiIndex = e.detail.value; - console.log(multiIndex); - this.multiIndex = multiIndex; - + this.multiIndex = e.detail.value; + let a_name = this.multiArray[0][e.detail.value[0]].name; + let a_id = this.multiArray[0][e.detail.value[0]].id; + let b_name = this.multiArray[1][e.detail.value[1]].name; + let b_id = this.multiArray[1][e.detail.value[1]].id; + let c_name = this.multiArray[2][e.detail.value[2]].name; + let c_id = this.multiArray[2][e.detail.value[2]].id; + this.cityInfo.province = a_name; + this.cityInfo.city =b_name; + this.cityInfo.area = c_name; + this.form.region = [{ + value: a_id, + label: a_name + }, { + value: b_id, + label: b_name + }, { + value: c_id, + label: c_name + }]; }, // 选择列 columnChange: function(e) { - // console.log(e); var _this = this; - var multiData = _this.multiData; - var multiIndex = _this.multiIndex; var columnIndex = e.detail.column; var columnValue = e.detail.value; - multiIndex[columnIndex] = columnValue; - this.multiArray = [ - multiData, - multiData[multiIndex[0]].children, - multiData[multiIndex[0]].children[multiIndex[1]].children,] - }, - bindCityChange(e) { - this.cityInfo.province = e.detail.value[0]; - this.cityInfo.city = e.detail.value[1]; - this.cityInfo.area = e.detail.value[2]; - this.form.region = e.detail.id; - this.form.region = [{ - value: e.detail.id[0], - label: e.detail.value[0] - }, { - value: e.detail.id[1], - label: e.detail.value[1] - }, { - value: e.detail.id[2], - label: e.detail.value[2] - }]; + _this.multiIndex[columnIndex] = columnValue; + this.multiArray = [ + _this.multiData, + _this.multiData[_this.multiIndex[0]].children, + _this.multiData[_this.multiIndex[0]].children[_this.multiIndex[1]].children + ] }, saveAddress() { // 保存收货地址 @@ -196,7 +192,6 @@ } AddressApi.edit(that.addressId, that.form) .then(result => { - return that.$toast(result.message) setTimeout(() => { uni.navigateBack()