Commit 40cb53c39412bfa78f2065561252ad0c2f7d6774
1 parent
46ccd7d1
送礼订单操作
Showing
1 changed file
with
32 additions
and
19 deletions
src/pages/myGiftBox/myGiftBox.vue
| @@ -45,8 +45,12 @@ | @@ -45,8 +45,12 @@ | ||
| 45 | </div> | 45 | </div> |
| 46 | </div> | 46 | </div> |
| 47 | <!-- 弹出框 --> | 47 | <!-- 弹出框 --> |
| 48 | - <van-popup :style="{ height: '160px' }" position="bottom" v-model="actionSheetShow"> | ||
| 49 | - <van-picker :columns="orderOperation.causes" @change="onSelect" /> | 48 | + <van-popup |
| 49 | + :style="{ height: '160px' }" | ||
| 50 | + position="bottom" | ||
| 51 | + v-model="actionSheetShow" | ||
| 52 | + > | ||
| 53 | + <van-picker show-toolbar :columns="orderOperation.causes" :default-index="2" @cancel="onCancel" @confirm="confirm"/> | ||
| 50 | </van-popup> | 54 | </van-popup> |
| 51 | </div> | 55 | </div> |
| 52 | </template> | 56 | </template> |
| @@ -77,10 +81,11 @@ export default { | @@ -77,10 +81,11 @@ export default { | ||
| 77 | }, | 81 | }, |
| 78 | tipText: null, // 是否已加载完 | 82 | tipText: null, // 是否已加载完 |
| 79 | actionSheetShow: false, | 83 | actionSheetShow: false, |
| 80 | - orderOperation: {// 存取取消订单的信息 | ||
| 81 | - causes:[],// 取消原因 | ||
| 82 | - id:''//订单id | ||
| 83 | - } | 84 | + orderOperation: { |
| 85 | + // 存取取消订单的信息 | ||
| 86 | + causes: [], // 取消原因 | ||
| 87 | + item: null //订单id | ||
| 88 | + } | ||
| 84 | }; | 89 | }; |
| 85 | }, | 90 | }, |
| 86 | components: { | 91 | components: { |
| @@ -94,7 +99,7 @@ export default { | @@ -94,7 +99,7 @@ export default { | ||
| 94 | this.getorderGiveGiftList(); | 99 | this.getorderGiveGiftList(); |
| 95 | // 赠礼规则 | 100 | // 赠礼规则 |
| 96 | this.orderGiftContent(); | 101 | this.orderGiftContent(); |
| 97 | - // 取消订单元原因获取 | 102 | + // 取消订单原因获取 |
| 98 | this.cancelPayment(); | 103 | this.cancelPayment(); |
| 99 | }, | 104 | }, |
| 100 | methods: { | 105 | methods: { |
| @@ -418,24 +423,27 @@ export default { | @@ -418,24 +423,27 @@ export default { | ||
| 418 | // 获取到的数组存到this.causes中去 | 423 | // 获取到的数组存到this.causes中去 |
| 419 | if (datas.group && datas.group.length > 0) { | 424 | if (datas.group && datas.group.length > 0) { |
| 420 | this.orderOperation.causes = datas.group; | 425 | this.orderOperation.causes = datas.group; |
| 421 | - console.log(this.orderOperation) | ||
| 422 | } | 426 | } |
| 423 | } | 427 | } |
| 424 | }, | 428 | }, |
| 425 | // 取消支付子组件事件传递 | 429 | // 取消支付子组件事件传递 |
| 426 | - onCancelPayment(item){ | 430 | + onCancelPayment(item) { |
| 427 | this.actionSheetShow = true; // 显示底部取消订单原因弹框 | 431 | this.actionSheetShow = true; // 显示底部取消订单原因弹框 |
| 428 | - this.orderOperation.id = item.id // 获取当前操作订单ID | 432 | + this.orderOperation.item = item; // 获取当前操作订单ID |
| 429 | }, | 433 | }, |
| 430 | - // 取消订单选择框 | ||
| 431 | - onSelect(picker, value, index) { | 434 | + // 确认,取消订单 |
| 435 | + confirm(picker, value, index) { | ||
| 432 | this.actionSheetShow = false; | 436 | this.actionSheetShow = false; |
| 433 | // Toast(`当前值:${value}, 当前索引:${index}`); | 437 | // Toast(`当前值:${value}, 当前索引:${index}`); |
| 434 | // 调用取消订单原因填写 | 438 | // 调用取消订单原因填写 |
| 435 | - this.cancelorder(this.orderOperation.id,value) | 439 | + this.cancelorder(this.orderOperation.item, value); |
| 440 | + }, | ||
| 441 | + // 取消,取消订单 | ||
| 442 | + onCancel(){ | ||
| 443 | + this.actionSheetShow = false; | ||
| 436 | }, | 444 | }, |
| 437 | - // 取消支付填写原因 | ||
| 438 | - cancelorder(orderId,content) { | 445 | + // 取消支付填写原因 |
| 446 | + cancelorder(item, content) { | ||
| 439 | // 加载中提示 | 447 | // 加载中提示 |
| 440 | Indicator.open("加载中..."); | 448 | Indicator.open("加载中..."); |
| 441 | 449 | ||
| @@ -443,12 +451,13 @@ export default { | @@ -443,12 +451,13 @@ export default { | ||
| 443 | this.http( | 451 | this.http( |
| 444 | "/Api/" + this.getApiVersion().index + "/cancel_order", | 452 | "/Api/" + this.getApiVersion().index + "/cancel_order", |
| 445 | { | 453 | { |
| 446 | - id:orderId, // 订单ID | ||
| 447 | - content:content // 取消订单ID | 454 | + id: item.id, // 订单ID |
| 455 | + content: content // 取消订单ID | ||
| 448 | }, | 456 | }, |
| 449 | this.cancelorderCallback, | 457 | this.cancelorderCallback, |
| 450 | { | 458 | { |
| 451 | - method: "post" | 459 | + method: "post", |
| 460 | + item | ||
| 452 | } | 461 | } |
| 453 | ); | 462 | ); |
| 454 | }, | 463 | }, |
| @@ -460,7 +469,11 @@ export default { | @@ -460,7 +469,11 @@ export default { | ||
| 460 | cancelorderCallback(res, ext) { | 469 | cancelorderCallback(res, ext) { |
| 461 | // 加载完成 | 470 | // 加载完成 |
| 462 | Indicator.close(); | 471 | Indicator.close(); |
| 463 | - | 472 | + // 设置已关注 |
| 473 | + if (ext.item.status == "0") { | ||
| 474 | + // 关注达人 | ||
| 475 | + this.$set(ext.item, "status", "3"); | ||
| 476 | + } | ||
| 464 | // 返回处理 | 477 | // 返回处理 |
| 465 | if (res.code == 200) { | 478 | if (res.code == 200) { |
| 466 | this.actionSheetShow = true; | 479 | this.actionSheetShow = true; |