|
|
@@ -28,6 +28,13 @@
|
|
|
<span style="color: #aaaaaa" v-if="userinfo.phone">{{ userinfo.phone }}</span>
|
|
|
<span style="color: #aaaaaa" v-else>{{ $t('lang98') }}</span>
|
|
|
</div>
|
|
|
+ <div @click="showPopup(3)" class="li">
|
|
|
+ <div class="li_left">
|
|
|
+ <span>{{ $t('lang229') }}</span>
|
|
|
+ </div>
|
|
|
+ <span style="color: #aaaaaa;text-align: right; max-width: 70%;" v-if="userinfo.take_address?.address">{{ userinfo.take_address?.address }}</span>
|
|
|
+ <span style="color: #aaaaaa" v-else>{{ $t('lang98') }}</span>
|
|
|
+ </div>
|
|
|
<div @click="switchovers('language')" class="li">
|
|
|
<div class="li_left">
|
|
|
<span>{{ $t('lang101') }}</span>
|
|
|
@@ -64,16 +71,31 @@
|
|
|
<div class="title" v-if="editType == 0">{{ $t('lang105') }}</div>
|
|
|
<div class="title" v-if="editType == 1">{{ $t('lang106') }}</div>
|
|
|
<div class="title" v-if="editType == 2">{{ $t('lang107') }}</div>
|
|
|
- <div class="address_field">
|
|
|
+ <div class="title" v-if="editType == 3">{{ $t('lang231') }}</div>
|
|
|
+ <div class="address_field" v-if="editType != 3">
|
|
|
<van-field v-model="inputValue" type="text" rows="1" autosize :placeholder="$t('lang108')" v-if="editType == 0" />
|
|
|
<van-field v-model="inputValue" type="text" rows="1" autosize :placeholder="$t('lang109')" v-if="editType == 1" />
|
|
|
<van-field v-model="inputValue" type="text" rows="1" autosize :placeholder="$t('lang110')" v-if="editType == 2" />
|
|
|
</div>
|
|
|
+ <div class="address_field" v-if="editType == 3">
|
|
|
+ <div class="flex-row bt">
|
|
|
+ <span style="white-space: nowrap; padding-right: 1em;">{{ $t('lang235') }}</span>
|
|
|
+ <span class="grew" v-if="!areaText" @click="areaShow = true">{{ $t('lang236') }}</span>
|
|
|
+ <span class="ngrew" v-if="areaText" @click="areaShow = true">{{ areaText }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="flex-row bt">
|
|
|
+ <span style="white-space: nowrap">{{ $t('lang237') }}</span>
|
|
|
+ <van-field :style="{width: $i18n.locale=='zh-cn'?'70%':'100%'}" v-model="addressDetail" type="text" rows="1" autosize :placeholder="$t('lang232')" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="bind_button" @click="editUserInfo">
|
|
|
<span>{{ $t('lang111') }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</van-popup>
|
|
|
+ <van-popup v-model="areaShow" round :close-on-click-overlay="true" position="bottom" @close="areaShow = false">
|
|
|
+ <van-area :title="$t('lang236')" :area-list="areaList" @cancel="areaShow = false" @confirm="OnConfirm" />
|
|
|
+ </van-popup>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -85,6 +107,7 @@ import { mapState } from 'vuex';
|
|
|
import union from '../../api/union';
|
|
|
import Clipboard from 'clipboard';
|
|
|
import Web3 from 'web3';
|
|
|
+import { areaList } from '@vant/area-data';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -115,6 +138,11 @@ export default {
|
|
|
editShow: false, //
|
|
|
editType: 0, // 0修改昵称 1真实姓名 2手机号码
|
|
|
inputValue: '',
|
|
|
+ areaList: areaList,
|
|
|
+ areaShow: false,
|
|
|
+ areaText: '', // 省市区显示
|
|
|
+ addressDetail: '', //传值(详细地址)
|
|
|
+ area_code: '', //传值
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -124,6 +152,21 @@ export default {
|
|
|
// this.init();
|
|
|
},
|
|
|
methods: {
|
|
|
+ onSave(e) {
|
|
|
+ // this.$toast('save');
|
|
|
+ homeApi.pickupOrder({ order_id: this.item.order_id, name: e.name, phone: e.tel, address: e.province + ' ' + e.city + ' ' + e.county + ' ' + e.areaText }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.addresPopop = false;
|
|
|
+ this.page = 1;
|
|
|
+ this.nft_list = [];
|
|
|
+ this.getNftList();
|
|
|
+ this.getUserInfo();
|
|
|
+ Notify({ type: 'success', message: this.$t('lang152') });
|
|
|
+ } else {
|
|
|
+ this.$toast(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
//返回上一页
|
|
|
back() {
|
|
|
this.$router.back();
|
|
|
@@ -142,6 +185,8 @@ export default {
|
|
|
return this.$toast(this.$t('lang170'));
|
|
|
} else if ((this.editType == 2 && !this.inputValue) || (this.editType == 2 && this.inputValue.length < 11)) {
|
|
|
return this.$toast(this.$t('lang171'));
|
|
|
+ } else if ((this.editType == 3 && !this.addressDetail) || (this.editType == 3 && !this.areaText)) {
|
|
|
+ return this.$toast(this.$t('lang238'));
|
|
|
}
|
|
|
let params = {};
|
|
|
if (this.editType == 0) {
|
|
|
@@ -150,11 +195,18 @@ export default {
|
|
|
params.name = this.inputValue;
|
|
|
} else if (this.editType == 2) {
|
|
|
params.phone = this.inputValue;
|
|
|
+ } else if (this.editType == 3) {
|
|
|
+ params.address = this.areaText.replace(/\//g, ' ') + ' ' + this.addressDetail;
|
|
|
+ params.area_code = this.area_code;
|
|
|
}
|
|
|
+
|
|
|
homeApi.setUserInfo(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.editShow = false;
|
|
|
this.inputValue = '';
|
|
|
+ this.addressDetail = '';
|
|
|
+ this.areaText = '';
|
|
|
+ this.area_code = '';
|
|
|
this.getUserInfo();
|
|
|
Notify({ type: 'success', message: this.$t('lang172') });
|
|
|
}
|
|
|
@@ -182,10 +234,22 @@ export default {
|
|
|
if (res.code == 200) {
|
|
|
this.userinfo = res.data;
|
|
|
this.order_count = res.data.order_count;
|
|
|
+ if (this.userinfo.take_address) {
|
|
|
+ this.addressDetail = this.userinfo.take_address?.address;
|
|
|
+ let sp = this.userinfo.take_address?.address.split(' ') || [];
|
|
|
+ this.areaText = sp[0] + '/' + sp[1] + '/' + sp[2];
|
|
|
+ this.addressDetail = sp[3];
|
|
|
+ this.area_code = this.userinfo.take_address?.area_code;
|
|
|
+ }
|
|
|
this.userinfo.addressEncrypt = this.userinfo.address.substring(0, 5) + '****' + this.userinfo.address.substring(this.userinfo.address.length - 5, this.userinfo.address.length);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ OnConfirm(e) {
|
|
|
+ this.areaText = e[0].name + '/' + e[1].name + '/' + e[2].name;
|
|
|
+ this.area_code = e[0].code + ',' + e[1].code + ',' + e[2].code;
|
|
|
+ this.areaShow = false;
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['account']),
|
|
|
@@ -343,4 +407,19 @@ export default {
|
|
|
border-top: 1px solid #cccccc9d;
|
|
|
}
|
|
|
}
|
|
|
+.grew {
|
|
|
+ color: #c4c4c4;
|
|
|
+ // padding-left: 1em;
|
|
|
+}
|
|
|
+.ngrew {
|
|
|
+ // padding-left: 1em;
|
|
|
+}
|
|
|
+.bt {
|
|
|
+ font-size: 13px;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ line-height: 190%;
|
|
|
+}
|
|
|
+.bt:first-child {
|
|
|
+ padding-bottom: 15px;
|
|
|
+}
|
|
|
</style>
|