Commit a6478ad1a0975a62552ea0d4a42806929b5b6f9b
1 parent
9b5736bc
地址删除弹框提示
Showing
1 changed file
with
36 additions
and
52 deletions
src/pages/addressList/addressList.vue
| ... | ... | @@ -34,7 +34,6 @@ import addressList from "@/components/addressList/addressList.vue"; |
| 34 | 34 | import addressCreateBar from "@/components/addressCreateBar/addressCreateBar.vue"; |
| 35 | 35 | import Vue from "vue"; |
| 36 | 36 | import { Toast, Indicator } from "mint-ui"; |
| 37 | -import { Dialog } from 'vant'; | |
| 38 | 37 | export default { |
| 39 | 38 | name: 'addressListPage', |
| 40 | 39 | data () { |
| ... | ... | @@ -147,7 +146,6 @@ export default { |
| 147 | 146 | delete: {}, |
| 148 | 147 | defaultContact: {} |
| 149 | 148 | }; |
| 150 | - console.log(this.addresss); | |
| 151 | 149 | /** |
| 152 | 150 | * 列表功能模式配置 |
| 153 | 151 | * mode: |
| ... | ... | @@ -288,36 +286,46 @@ export default { |
| 288 | 286 | * @param {Object} item [地址信息对象] |
| 289 | 287 | */ |
| 290 | 288 | doDelete (item) { |
| 291 | - Dialog.confirm({ | |
| 292 | - title: '标题', | |
| 293 | - message: '确定删除收件人?', | |
| 294 | - }).then((res) => { | |
| 295 | - // 用户点击确定 | |
| 296 | - if (res) { | |
| 297 | - | |
| 298 | - // 执行删除操作,校验必选参数 | |
| 299 | - if (item.uid && item.id) { | |
| 300 | - | |
| 301 | - // 显示loading | |
| 302 | - Indicator.open('加载中...'); | |
| 303 | - // 请求接口 | |
| 304 | - this.http("/Api/" + (this.getApiVersion().index) + "/delAddress", { | |
| 289 | + // 提示用积分值兑换兑换 | |
| 290 | + let options = { | |
| 291 | + title: "", | |
| 292 | + message: "确定删除收件人地址吗?", | |
| 293 | + confirmButtonText: "确定", | |
| 294 | + confirmButtonCallback: this.doDeleteConfirm, | |
| 295 | + showCancelButton: true, | |
| 296 | + cancelButtonText: "取消", | |
| 297 | + params: item | |
| 298 | + }; | |
| 299 | + // 调用showModal层参数 | |
| 300 | + this.$set(this.$parent, "showOptions", options); | |
| 301 | + // 显示通用浮层 | |
| 302 | + this.$parent.$refs.showModal.showLayer(); | |
| 303 | + }, | |
| 304 | + doDeleteConfirm (item) { | |
| 305 | + // 用户点击确定 | |
| 306 | + if (item) { | |
| 307 | + | |
| 308 | + // 执行删除操作,校验必选参数 | |
| 309 | + if (item.uid && item.id) { | |
| 310 | + | |
| 311 | + // 显示loading | |
| 312 | + Indicator.open('加载中...'); | |
| 313 | + // 请求接口 | |
| 314 | + this.http("/Api/" + (this.getApiVersion().index) + "/delAddress", { | |
| 315 | + uid: item.uid, | |
| 316 | + id: item.id | |
| 317 | + }, this.doDeleteCallback, { | |
| 318 | + method: "POST", | |
| 305 | 319 | uid: item.uid, |
| 306 | 320 | id: item.id |
| 307 | - }, this.doDeleteCallback, { | |
| 308 | - method: "POST", | |
| 309 | - uid: item.uid, | |
| 310 | - id: item.id | |
| 311 | - }) | |
| 312 | - } else { | |
| 313 | - | |
| 314 | - // 参数错误 | |
| 315 | - Toast("删除收件人参数错误"); | |
| 316 | - } | |
| 321 | + }) | |
| 322 | + } else { | |
| 323 | + | |
| 324 | + // 参数错误 | |
| 325 | + Toast("删除收件人参数错误"); | |
| 317 | 326 | } |
| 318 | - }); | |
| 327 | + } | |
| 319 | 328 | }, |
| 320 | - | |
| 321 | 329 | /** |
| 322 | 330 | * 删除地址操作回调 |
| 323 | 331 | * @param {Object} res [服务器返回数据] |
| ... | ... | @@ -476,28 +484,4 @@ export default { |
| 476 | 484 | |
| 477 | 485 | <style rel="stylesheet/less" lang="less"> |
| 478 | 486 | @import './addressList'; |
| 479 | -.van-dialog { | |
| 480 | - width: 640px; | |
| 481 | - font-size: 32px; | |
| 482 | -} | |
| 483 | -.van-dialog__header { | |
| 484 | - padding-top: 52px; | |
| 485 | - font-weight: 500; | |
| 486 | - line-height: 48px; | |
| 487 | - text-align: center; | |
| 488 | -} | |
| 489 | -.van-dialog__message { | |
| 490 | - max-height: 72px; | |
| 491 | - padding: 26px 24px; | |
| 492 | - overflow-y: auto; | |
| 493 | - font-size: 28px; | |
| 494 | - line-height: 40px; | |
| 495 | -} | |
| 496 | -.van-dialog { | |
| 497 | - font-size: 32px; | |
| 498 | -} | |
| 499 | -.van-button { | |
| 500 | - font-size: 32px; | |
| 501 | - padding: 40px 0; | |
| 502 | -} | |
| 503 | 487 | </style> |
| 504 | 488 | \ No newline at end of file | ... | ... |