| | |
| | | </view> |
| | | <view class="v-line"></view> |
| | | <view class="flex"> |
| | | <!-- @click="changeDefaultAddress(item,index)"--> |
| | | <!-- --> |
| | | <view class="flex"> |
| | | <view class="radio m-t-2 m-r-10" :class="[item.defaulted?'select':'']"> |
| | | <view class="radio m-t-2 m-r-10" :class="[item.isDefault?'select':'']" |
| | | @click="changeDefaultAddress(item,index)"> |
| | | |
| | | </view> |
| | | <span class="desc">{{ item.defaulted ? '默认地址:' : '当前地址:' }}{{ item.address || '' }}</span> |
| | | <span class="desc">{{ item.isDefault ? '默认地址:' : '当前地址:' }}{{ item.address || '' }}</span> |
| | | <!-- 当前地址/默认地址勾选 --> |
| | | </view> |
| | | <view class="desc del t-red" @click="deleteAddress(item)"> |
| | |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="form-item-label require"> |
| | | 请选择收获地址 |
| | | 收获地址 |
| | | </view> |
| | | <view class="m-l-a m-r-0 flex " :class="[!dto['province']?'desc-gray':'']"> |
| | | <uni-data-picker :area="true" @change="(e)=>{PickArea(dto,e)}" placeholder="" |
| | | <uni-data-picker :area="true" @change="(e)=>{PickArea(submitForm,e)}" placeholder="" |
| | | :localdata="regionDataPlus"> |
| | | {{ dto['province'] || '请选择' }}{{ dto['city'] && ('/' + dto['city']) || '' }}{{ |
| | | dto['region'] && ('/' + dto['region']) || '' |
| | | {{ submitForm['province'] || '请选择' }}{{ submitForm['city'] && ('/' + submitForm['city']) || '' }}{{ |
| | | submitForm['region'] && ('/' + submitForm['region']) || '' |
| | | }} |
| | | </uni-data-picker> |
| | | <u-icon class="m-l-a" name="arrow-right"></u-icon> |
| | |
| | | |
| | | }, |
| | | regionDataPlus: [], |
| | | list:[], |
| | | }; |
| | | }, |
| | | methods: { |
| | | PickArea(item, e) { |
| | | console.log('PickArea', item, e) |
| | | if (e.detail.value) { |
| | | this.dto.province = '' |
| | | this.dto.city = '' |
| | | this.dto.region = '' |
| | | this.submitForm.province = '' |
| | | this.submitForm.city = '' |
| | | this.submitForm.region = '' |
| | | if (e.detail.value.length <= 3) { |
| | | if (!!e.detail.value[0]) |
| | | this.dto.province = e.detail.value[0].value |
| | | this.submitForm.province = e.detail.value[0].value |
| | | if (!!e.detail.value[1]) |
| | | this.dto.city = e.detail.value[1].value |
| | | this.submitForm.city = e.detail.value[1].value |
| | | if (!!e.detail.value[2]) |
| | | this.dto.region = e.detail.value[2].value |
| | | this.submitForm.region = e.detail.value[2].value |
| | | } else { |
| | | //说明有重复的 |
| | | var plusnum = e.detail.value.length - 3 |
| | | if (!!e.detail.value[plusnum + 0]) |
| | | this.dto.province = e.detail.value[plusnum + 0].value |
| | | this.submitForm.province = e.detail.value[plusnum + 0].value |
| | | if (!!e.detail.value[plusnum + 1]) |
| | | this.dto.city = e.detail.value[plusnum + 1].value |
| | | this.submitForm.city = e.detail.value[plusnum + 1].value |
| | | if (!!e.detail.value[plusnum + 2]) |
| | | this.dto.region = e.detail.value[plusnum + 2].value |
| | | this.submitForm.region = e.detail.value[plusnum + 2].value |
| | | } |
| | | |
| | | this.$forceUpdate() |
| | | |
| | | console.log('submit forn',this.submitForm) |
| | | } |
| | | }, |
| | | async init_area() { |
| | |
| | | this.$message.showLoading() |
| | | var { |
| | | code |
| | | } = await this.$http.request('post', '/api/address/customer/default/' + |
| | | } = await this.$http.request('post', '/api/address/set/default/' + |
| | | item.id, {}) |
| | | this.$message.hideLoading() |
| | | if (code === 0) { |
| | |
| | | this.$message.showLoading() |
| | | var { |
| | | code |
| | | } = await this.$http.request('get', '/api/address/customer/delete/' + item.id, {}) |
| | | } = await this.$http.request('get', '/api/address/delete?id=' + item.id, {}) |
| | | this.$message.hideLoading() |
| | | if (code === 0) { |
| | | this.$message.showToast('删除成功') |
| | |
| | | this.$message.showLoading() |
| | | var { |
| | | data |
| | | } = await this.$http.request('get', '/api/address/list/detail/' + this.submitForm.id, {}) |
| | | } = await this.$http.request('get', '/api/address/list/detail?id=' + this.submitForm.id, {}) |
| | | |
| | | |
| | | if (data) { |
| | |
| | | const { |
| | | code |
| | | } = await this.$http.request('post', '/api/address/' + (this.submitForm.id ? 'update' : |
| | | 'edit'), { |
| | | 'add'), { |
| | | data: this.submitForm |
| | | }) |
| | | this.$message.hideLoading() |