...
|
...
|
@@ -11,7 +11,12 @@ |
|
|
></CInput>
|
|
|
</FormItem>
|
|
|
<FormItem>
|
|
|
<CInput label="手机号" place-holder="请填写手机号" v-model="model.mobile" :textValue="model.mobile"></CInput>
|
|
|
<CInput
|
|
|
label="手机号"
|
|
|
place-holder="请填写手机号"
|
|
|
v-model="model.mobile"
|
|
|
:textValue="model.mobile"
|
|
|
></CInput>
|
|
|
</FormItem>
|
|
|
|
|
|
<template>
|
...
|
...
|
@@ -20,7 +25,7 @@ |
|
|
<label class="input-label">所在区域</label>
|
|
|
<div class="wrapper-arrow" @click="chooseArea">
|
|
|
<template v-if="model.area">
|
|
|
<label class="text-label">{{model.area}}</label>
|
|
|
<label class="text-label">{{ model.area }}</label>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<label class="choose-area">请选择</label>
|
...
|
...
|
@@ -39,30 +44,32 @@ |
|
|
:textValue="model.address"
|
|
|
></CInput>
|
|
|
</FormItem>
|
|
|
|
|
|
<div class="wrapper-tag">
|
|
|
<!-- 订单修改地址隐藏 -->
|
|
|
<div v-if="!$route.params.code" class="wrapper-tag">
|
|
|
<p class="tag-text">设置标签:</p>
|
|
|
<RadioGroup class="wrapper-radio">
|
|
|
<div v-for="(tag, index) in addressTags" :key="index">
|
|
|
<Radio
|
|
|
class="tag-radio"
|
|
|
:label="{text: `${tag.name}`, value: `${tag.code}`}"
|
|
|
:label="{ text: `${tag.name}`, value: `${tag.code}` }"
|
|
|
v-model="model.tag_code"
|
|
|
checked="tag.code === model.tag_code"
|
|
|
></Radio>
|
|
|
</div>
|
|
|
</RadioGroup>
|
|
|
</div>
|
|
|
|
|
|
<div class="wrapper-del">
|
|
|
<!-- 订单修改地址隐藏 -->
|
|
|
<div v-if="!$route.params.code" class="wrapper-del">
|
|
|
<Radio
|
|
|
class="radio"
|
|
|
:label="{text: '设为默认地址', value: true}"
|
|
|
:label="{ text: '设为默认地址', value: true }"
|
|
|
style="flex: 0 1 100%;"
|
|
|
checked="model.is_default"
|
|
|
v-model="model.is_default"
|
|
|
></Radio>
|
|
|
<div v-if="isUpdate" class="del-address" @click="delAddress">删除地址</div>
|
|
|
<div v-if="isUpdate" class="del-address" @click="delAddress">
|
|
|
删除地址
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div :class="submitClass" @touchend="onSubmit">确 认</div>
|
...
|
...
|
@@ -279,26 +286,24 @@ export default { |
|
|
},
|
|
|
|
|
|
activated() {
|
|
|
this.fetchAddressTags();
|
|
|
|
|
|
this.isUpdate = this.$route.params.update;
|
|
|
this.title = this.$route.params.title
|
|
|
? this.$route.params.title
|
|
|
: "添加地址";
|
|
|
let { update, title, item, code } = this.$route.params;
|
|
|
// 订单编辑 不查标签
|
|
|
if (!code) {
|
|
|
this.fetchAddressTags();
|
|
|
}
|
|
|
|
|
|
if (this.$route.params.update) {
|
|
|
let item = JSON.parse(this.$route.params.item);
|
|
|
if (item) {
|
|
|
let that = this;
|
|
|
that.model.consignee = item.consignee;
|
|
|
that.model.address_id = item.address_id;
|
|
|
that.model.mobile = item.mobile;
|
|
|
that.model.area_code = item.area_code;
|
|
|
that.model.area = item.area;
|
|
|
that.model.address = item.address;
|
|
|
that.model.tag_code = item.tag_code;
|
|
|
that.model.is_default = item.is_default === "Y" ? true : false;
|
|
|
}
|
|
|
this.isUpdate = update;
|
|
|
this.title = update ? "编辑地址" : "添加地址";
|
|
|
if (update) {
|
|
|
item = JSON.parse(item || "{}");
|
|
|
this.model.consignee = item.consignee;
|
|
|
this.model.address_id = item.address_id;
|
|
|
this.model.mobile = item.mobile;
|
|
|
this.model.area_code = item.area_code;
|
|
|
this.model.area = item.area;
|
|
|
this.model.address = item.address;
|
|
|
this.model.tag_code = item.tag_code;
|
|
|
this.model.is_default = item.is_default === "Y" ? true : false;
|
|
|
} else {
|
|
|
this.model = {};
|
|
|
}
|
...
|
...
|
|