diff --git a/pages/pages_zhentou/form/form.vue b/pages/pages_zhentou/form/form.vue index 7d17bef..890a833 100644 --- a/pages/pages_zhentou/form/form.vue +++ b/pages/pages_zhentou/form/form.vue @@ -25,17 +25,17 @@ - + - + - - - + @@ -47,28 +47,28 @@ - + -->

单位:厘米cm

- +

单位:公斤kg

- +

单位:厘米cm

- +
- +

单位:厘米cm

- +
@@ -77,37 +77,37 @@ - + - + - - - + - + - + - +
@@ -203,12 +203,12 @@ } }] }, - address: { - rules: [{ - required: true, - errorMessage: '地址不能为空' - }] - }, + // address: { + // rules: [{ + // required: true, + // errorMessage: '地址不能为空' + // }] + // }, height: { rules: [{ required: true, @@ -332,7 +332,8 @@ sleepPosData1: [{ text: '侧睡', value: 2 - }, ] + }, ], + isDisabled:false, } }, onShow(){ @@ -366,18 +367,18 @@ // console.log(this.a) this.getData() console.log(options) - if(options.phone){ + if(options.pageFrom == 'order'){ this.phoneNumber = options.phone this.getInfo() } - + // this.getCurrentArea('北京市') }, methods: { // 获取表单信息 getInfo(){ uni.request({ // this.phoneNumber - url:getApp().globalData.baseUrl + '/blade-desk/custom-made-info/get-newest?phone=13214521014' , + url:getApp().globalData.baseUrl + '/blade-desk/custom-made-info/get-newest?phone=15932584136' , method:'GET', header:{ 'Blade-Auth': 'bearer ' + uni.getStorageSync('token') @@ -406,24 +407,36 @@ this.city = res.data.data.city == '-1' ? '' :res.data.data.city; this.district = res.data.data.district == '-1' ? '' :res.data.data.district; // this.getCurrentArea(this.province) + console.log(this.valiFormData) + if(this.valiFormData.username !== '' && + this.valiFormData.phone !== '' && this.valiFormData.height !== '' && + this.valiFormData.weight !== '' && this.valiFormData.pillowHardness !== '' && + this.valiFormData.pillowMaterial !== '' && this.valiFormData.sleepingPosture !== ''){ + this.isDisabled = true + }else{ + this.isDisabled = false + } } } }) }, - // getCurrentArea(value){ - // this.allCityData.map((item,index) =>{ - // if(item.province == value){ - // this.multiIndex[0] = index - // item.citys.map((item1,index1) =>{ - // this.locationArr[1].push(item.city); - // if(item1.city == this.city){ + getCurrentArea(value){ + this.allCityData.map((item,index) =>{ + if(item.province == value){ + this.multiIndex[0] = index + item.citys.map((item1,index1) =>{ + if(item1.city == this.province){ + console.log('111') + this.locationArr[1].push(item.city); + } + if(item1.city == this.city){ - // } - // }) + } + }) - // } - // }) - // }, + } + }) + }, toggle(type) { this.$refs.popup.open(type) }, diff --git a/pages/pages_zhentou/myPage/address.vue b/pages/pages_zhentou/myPage/address.vue index 4163cdf..41183da 100644 --- a/pages/pages_zhentou/myPage/address.vue +++ b/pages/pages_zhentou/myPage/address.vue @@ -9,7 +9,7 @@ {{item.phone}} - {{item.province}} {{item.city}} {{item.area}}{{item.address}} + {{item.province}}{{item.city}}{{item.area}}{{item.address}} @@ -19,12 +19,17 @@ - - -

+ + +

设为默认

-

设为默认

-

默认地址

+ + +

+
+

默认地址

+
+
{{title}} - + @@ -66,21 +71,22 @@ 位置: - + + + - - - {{province}} / {{city}} {{district ? '/' : ''}} {{district}} - - - 请选择地区 - - + + + {{province}} / {{city}} {{district ? '/' : ''}} {{district}} + + + 请选择地区 + + + @@ -89,9 +95,9 @@ - + @@ -175,7 +181,7 @@ phone:this.buyPhone, province:this.province, city:this.city, - district:this.district ? this.district : '', + area:this.district ? this.district : '', address:this.address, isDefault:0 } @@ -193,6 +199,7 @@ title: '新增成功', icon: 'none' }) + this.addressData = [] this.$refs.popup.close(); this.hasMore = true; this.current = 0; @@ -215,7 +222,7 @@ phone:this.buyPhone, province:this.province, city:this.city, - district:this.district ? this.district : '', + area:this.district ? this.district : '', address:this.address, } uni.request({ @@ -262,8 +269,47 @@ this.province = item.province; this.city = item.city; this.district = item.area; + this.getCurrentArea(this.province) this.$refs.popup.open('bottom') }, + // 编辑页面时获取省市区数据 + getCurrentArea(value){ + this.locationArr[1] = [] + this.locationArr[2] = [] + this.allCityData.map((item,index) =>{ + if(item.province == this.province){ + this.multiIndex[0] = index; + item.citys.map((item1,index1) =>{ + if(item1.city == this.province){ + console.log(item1) + item1.areas.map((item2,index2) =>{ + if(item2.area == this.city){ + this.multiIndex[1] = index2; + } + this.locationArr[1].push(item2.area); + }) + }else{ + if(item1.city == this.city){ + this.multiIndex[1] = index1; + item1.areas.map((item3,index3) =>{ + this.locationArr[2].push(item3.area) + if(item3.area == this.district){ + console.log('item3 ==>',item3) + console.log('index3 ==>',index3) + this.multiIndex[2] = index3; + } + }) + } + this.locationArr[1].push(item1.city); + + } + }) + + } + }) + console.log('multiIndex',this.multiIndex) + console.log('locationArr',this.locationArr) + }, // 删除地址 handleDelete(){ uni.showModal({ @@ -348,7 +394,7 @@ } }) }, - + // 跳转到提交订单页面 turnToOrder(item){ if(this.pageFrom == 1){ var pages = getCurrentPages(); // 获取页面栈 @@ -357,13 +403,8 @@ console.log(pages) console.log(prevPage) if(prevPage.__route__ == 'pages/pages_zhentou/order/confirmOrder'){ - prevPage.__data__.changeAddress( - { - name:item.consignee, - phone:item.phone, - address:item.province + item.city + (item.area ? item.area : '') + item.address, - } - ) + prevPage.__data__.changeAddress(item); + uni.navigateBack() } } }, @@ -373,7 +414,7 @@ }, // 获取地区数据 getData() { - console.log(this.allCityData) + this.locationArr = [[],[],[]] this.allCityData.map(item => { this.locationArr[0].push(item.province); }) @@ -383,15 +424,15 @@ console.log(this.locationArr) }, + // 省市区确定地址 cityChange(e) { - console.log('111') this.multiIndex = e.detail.value; - console.log(this.locationArr) this.province = this.locationArr[0][this.multiIndex[0]] this.city = this.locationArr[1][this.multiIndex[1]] this.district = this.locationArr[2][this.multiIndex[2]]; this.address = '' }, + // 列切换 columnchange(e) { let value = e.detail.value; console.log(e.detail) @@ -442,6 +483,8 @@ this.province = ''; this.city = ''; this.district = ''; + this.getData(); + this.multiIndex = [0,0,0] this.$refs.popup.open('bottom') }, // 定位 @@ -501,7 +544,7 @@ this.current = this.current + 1; this.staus = 'loading'; uni.request({ - url: getApp().globalData.baseUrl + '/address/list?userId=' + this.userInfo.id + '¤t=' + this + url: getApp().globalData.baseUrl + '/address/list?id=' + this.userInfo.id + '¤t=' + this .current + '&size=' + this.size, method: 'GET', header:{ @@ -556,34 +599,45 @@ height: 25%; display: flex; align-items: center; - .no_checked{ - width: 28rpx; - height: 28rpx; - background: #FFFFFF; - border: 1rpx solid #666666; - border-radius: 50%; - margin: 0 30rpx; + .no_checked_box{ + width: 100%; + display: flex; + .no_checked{ + width: 28rpx; + height: 28rpx; + background: #FFFFFF; + border: 1rpx solid #666666; + border-radius: 50%; + margin: 0 30rpx; + } } - .checked{ - width: 28rpx; - height: 28rpx; - background: #FFFFFF; - border: 1rpx solid #D73232; - border-radius: 50%; - margin: 0 30rpx; + + .check_box{ + width: 100%; display: flex; - align-items: center; - justify-content: center; - - .item{ - width: 16rpx; - height: 16rpx; - background: #D73232; + .checked{ + width: 28rpx; + height: 28rpx; + background: #FFFFFF; + border: 1rpx solid #D73232; border-radius: 50%; + margin: 0 30rpx; + display: flex; + align-items: center; + justify-content: center; + + .item{ + width: 16rpx; + height: 16rpx; + background: #D73232; + border-radius: 50%; + } } } + + .default_txt{ font-size: 22rpx; color: #D73232; @@ -726,6 +780,7 @@ margin-left: 30rpx; font-size: 26rpx; color: #333; + } .right_item{ @@ -736,6 +791,19 @@ margin-left: 30rpx; font-size: 26rpx; color: #333; + + .picker_box{ + padding-left: 20rpx; + } + + /deep/.uni-easyinput__content{ + // padding-left: 30rpx; + + .uni-easyinput__content-textarea{ + min-height: 40rpx !important; + padding-left: 20rpx; + } + } } .right_icon{ diff --git a/pages/pages_zhentou/order/checkOrder.vue b/pages/pages_zhentou/order/checkOrder.vue index eb1867e..27563a9 100644 --- a/pages/pages_zhentou/order/checkOrder.vue +++ b/pages/pages_zhentou/order/checkOrder.vue @@ -76,7 +76,7 @@

取消订单

立即支付

-

完善定制信息

+

完善定制信息

删除订单

再次定制

@@ -247,7 +247,7 @@ // 完善定制信息,跳转表单页面 handleInfo(){ uni.navigateTo({ - url:"/pages/pages_zhentou/form/form?phone=" + this.orderData.buyerPhone + url:"/pages/pages_zhentou/form/form?phone=" + this.orderData.buyerPhone + '&pageFrom=order' }) }, // 跳转售后服务