|
@@ -20,8 +20,11 @@
|
|
|
<x-input title="详细地址" v-model='userAddress' @on-blur="addressBlur" placeholder="填写详细地址如15号楼1单元201室"></x-input>
|
|
|
</group>
|
|
|
</scroller>
|
|
|
- <!--确认地址-->
|
|
|
- <div @click="right" class="btnAddress">更新地址</div>
|
|
|
+ <!--点击区域-->
|
|
|
+ <div class="btn-address">
|
|
|
+ <div @click="right" class="btnAddress">更新地址</div>
|
|
|
+ <div @click="deleteAddress" class="btnAddress">删除地址</div>
|
|
|
+ </div>
|
|
|
<!--展示报错信息-->
|
|
|
<alert v-model="showAlert" :title="(alertTitle)"> {{ (alertContent) }}</alert>
|
|
|
</div>
|
|
@@ -50,7 +53,8 @@
|
|
|
TransferDom
|
|
|
},
|
|
|
components: {XInput, Group, Cell, Alert},
|
|
|
- beforeCreate () {},
|
|
|
+ beforeCreate () {
|
|
|
+ },
|
|
|
computed: {},
|
|
|
watch: {
|
|
|
results: function (val, oldVal) {
|
|
@@ -77,6 +81,19 @@
|
|
|
addressBlur (evl) {
|
|
|
config.addressAdd.userAddress = evl
|
|
|
},
|
|
|
+ // 删除地址
|
|
|
+ deleteAddress () {
|
|
|
+ axios.get('api/shop/delAddress&address_id=' + config.editAddress.address_id + '&user_id=' + config.userId).then(res => {
|
|
|
+ if (res.data.success) {
|
|
|
+ this.$router.push({path: '/addressList'})
|
|
|
+ } else {
|
|
|
+ this.alertContent = '地址删除失败'
|
|
|
+ this.showAlert = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 编辑地址
|
|
|
right () {
|
|
|
// 姓名不为空
|
|
|
if (!this.userName) {
|
|
@@ -151,24 +168,30 @@
|
|
|
margin-top: 15px;
|
|
|
}
|
|
|
|
|
|
- .btnAddress {
|
|
|
- webkit-touch-callout: none;
|
|
|
- -webkit-user-select: none;
|
|
|
- -khtml-user-select: none;
|
|
|
- -moz-user-select: none;
|
|
|
- -ms-user-select: none;
|
|
|
- user-select: none;
|
|
|
- width: 100%;
|
|
|
- padding: 3% 0;
|
|
|
- color: #fff;
|
|
|
- font-size: 20px;
|
|
|
- margin: 0 auto;
|
|
|
+ .btn-address {
|
|
|
+ display: flex;
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
- background-color: #997e03;
|
|
|
- &:active {
|
|
|
- background-color: #bd9f03;
|
|
|
- color: #bababa;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ .btnAddress {
|
|
|
+ margin: 5px;
|
|
|
+ webkit-touch-callout: none;
|
|
|
+ -webkit-user-select: none;
|
|
|
+ -khtml-user-select: none;
|
|
|
+ -moz-user-select: none;
|
|
|
+ -ms-user-select: none;
|
|
|
+ user-select: none;
|
|
|
+ width: 50%;
|
|
|
+ padding: 3% 0;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 20px;
|
|
|
+ background-color: #997e03;
|
|
|
+ &:active {
|
|
|
+ background-color: #bd9f03;
|
|
|
+ color: #bababa;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
</style>
|