|
13 | 13 | <form @submit="submit">
|
14 | 14 | <view class="coreshop-content-top">
|
15 | 15 | <view class="img-list">
|
16 |
| - <checkbox-group class="cart-checkbox" v-for="(item, key) in items" :key="key" @click="clickCheckBox(item)"> |
| 16 | + <checkbox-group class="cart-checkbox" v-for="(item, key) in items" :key="key" |
| 17 | + @click="clickCheckBox(item)"> |
17 | 18 | <view class="cart-checkbox-item">
|
18 | 19 | <label class="uni-list-cell uni-list-cell-pd">
|
19 | 20 | <view class="cart-checkbox-c">
|
20 |
| - <checkbox :value='item.id' :checked="item.checked" |
21 |
| - color="#FF7159" v-if="item.disabled" :disabled="item.disabled" |
22 |
| - class="checkboxNo" /> |
23 |
| - <checkbox :value='item.id' :checked="item.checked" |
24 |
| - color="#FF7159" v-else /> |
| 21 | + <checkbox :value='item.id' :checked="item.checked" color="#FF7159" |
| 22 | + v-if="item.disabled" :disabled="item.disabled" class="checkboxNo" /> |
| 23 | + <checkbox :value='item.id' :checked="item.checked" color="#FF7159" v-else /> |
25 | 24 | </view>
|
26 | 25 | <view class="img-list-item">
|
27 | 26 | <u-avatar :src="item.imageUrl" mode="square" size="150" class="img-list-item-l">
|
|
321 | 320 |
|
322 | 321 | this.itemIds = this.itemIds.concat({
|
323 | 322 | id: checkbox.id,
|
324 |
| - nums: checkbox.nums |
| 323 | + nums: checkbox.returnNums |
325 | 324 | });
|
326 | 325 | console.log("添加")
|
327 | 326 | }
|
|
359 | 358 | if (this.checkedItems.indexOf(item.id) == -1) {
|
360 | 359 | this.checkedItems.push(item.id)
|
361 | 360 | }
|
362 |
| - this.items[key].checked = true; |
363 |
| - this.getReturnData(); |
| 361 | +
|
364 | 362 | },
|
365 | 363 | //处理退款金额光标事件
|
366 | 364 | refundFocus(e) {
|
|
415 | 413 | nums: nums
|
416 | 414 | });
|
417 | 415 | }
|
418 |
| - if (num1 == 0) { |
419 |
| -
|
420 |
| - this.itemIds = this.itemIds.concat({ |
421 |
| - id: k, |
422 |
| - nums: nums |
423 |
| - }); |
424 |
| -
|
425 |
| - console.log(this.itemIds); |
| 416 | + |
| 417 | + }else { |
| 418 | + this.$u.toast("您填写的数量不对!") |
| 419 | + return; |
426 | 420 | }
|
427 |
| -
|
428 |
| -
|
429 |
| -
|
430 |
| - } else { |
431 |
| - this.$u.toast("您填写的数量不对!") |
432 |
| - return; |
433 |
| - } |
434 | 421 | }
|
| 422 | + } |
435 | 423 | }
|
436 | 424 | }
|
437 |
| - } |
438 |
| - }, |
| 425 | + }, |
439 | 426 |
|
440 |
| - //提交 |
441 |
| - submit(e) { |
| 427 | + //提交 |
| 428 | + submit(e) { |
442 | 429 |
|
443 |
| - let _that = this; |
444 |
| - this.submitStatus = true; |
| 430 | + let _that = this; |
| 431 | + this.submitStatus = true; |
445 | 432 |
|
446 |
| - //判断退款金额 |
447 |
| - let reg = /^[0-9]+(.[0-9]{1,2})?$/; |
448 |
| - if (!reg.test(this.refund)) { |
449 |
| - this.$u.toast('请输入正确金额'); |
450 |
| - this.submitStatus = false; |
451 |
| - return false; |
452 |
| - } else { |
453 |
| - if (this.refund > this.refundShow) { |
454 |
| - this.$u.toast('退款金额过大'); |
455 |
| - this.submitStatus = false; |
456 |
| - return false; |
457 |
| - } |
458 |
| - } |
459 |
| - if (!this.isFlag) { |
460 |
| - this.$u.toast('您填写的数量不对!'); |
461 |
| - this.submitStatus = false; |
462 |
| - return false; |
463 |
| - } |
464 |
| - console.log(this.itemIds) |
465 |
| - if (this.itemIds.length <= 0) { |
466 |
| - this.$u.toast('请选择要售后的商品'); |
467 |
| - this.submitStatus = false; |
468 |
| - return false; |
469 |
| - } |
470 |
| - //组装数据,提交数据 |
471 |
| - let data = { |
472 |
| - orderId: _that.orderId, |
473 |
| - type: _that.aftersaleType, |
474 |
| - items: _that.itemIds, |
475 |
| - images: _that.images, |
476 |
| - refund: _that.refund, |
477 |
| - reason: _that.reason |
478 |
| - }; |
479 |
| - _that.$u.api.addAfterSales(data).then(res => { |
480 |
| - _that.submitStatus = false; |
481 |
| - if (res.status) { |
482 |
| - _that.$refs.uToast.show({ |
483 |
| - title: '提交成功', |
484 |
| - type: 'success', |
485 |
| - callback: function() { |
486 |
| - _that.$u.route("/pages/member/order/detail/detail?orderId=" + _that |
487 |
| - .orderId) |
| 433 | + //判断退款金额 |
| 434 | + let reg = /^[0-9]+(.[0-9]{1,2})?$/; |
| 435 | + if (!reg.test(this.refund)) { |
| 436 | + this.$u.toast('请输入正确金额'); |
| 437 | + this.submitStatus = false; |
| 438 | + return false; |
| 439 | + } else { |
| 440 | + if (this.refund > this.refundShow) { |
| 441 | + this.$u.toast('退款金额过大'); |
| 442 | + this.submitStatus = false; |
| 443 | + return false; |
488 | 444 | }
|
489 |
| - }) |
490 |
| - } else { |
491 |
| - _that.$u.toast(res.msg); |
492 |
| - } |
493 |
| - }); |
494 |
| - }, |
| 445 | + } |
| 446 | + if (!this.isFlag) { |
| 447 | + this.$u.toast('您填写的数量不对!'); |
| 448 | + this.submitStatus = false; |
| 449 | + return false; |
| 450 | + } |
| 451 | + console.log(this.itemIds) |
| 452 | + if (this.itemIds.length <= 0) { |
| 453 | + this.$u.toast('请选择要售后的商品'); |
| 454 | + this.submitStatus = false; |
| 455 | + return false; |
| 456 | + } |
| 457 | + //组装数据,提交数据 |
| 458 | + let data = { |
| 459 | + orderId: _that.orderId, |
| 460 | + type: _that.aftersaleType, |
| 461 | + items: _that.itemIds, |
| 462 | + images: _that.images, |
| 463 | + refund: _that.refund, |
| 464 | + reason: _that.reason |
| 465 | + }; |
| 466 | + _that.$u.api.addAfterSales(data).then(res => { |
| 467 | + _that.submitStatus = false; |
| 468 | + if (res.status) { |
| 469 | + _that.$refs.uToast.show({ |
| 470 | + title: '提交成功', |
| 471 | + type: 'success', |
| 472 | + callback: function() { |
| 473 | + _that.$u.route("/pages/member/order/detail/detail?orderId=" + |
| 474 | + _that |
| 475 | + .orderId) |
| 476 | + } |
| 477 | + }) |
| 478 | + } else { |
| 479 | + _that.$u.toast(res.msg); |
| 480 | + } |
| 481 | + }); |
| 482 | + }, |
495 | 483 |
|
496 |
| - //上传图片 |
497 |
| - upImage() { |
498 |
| - let num = this.imageMax - this.images.length; |
499 |
| - if (num > 0) { |
500 |
| - this.$upload.uploadImage(num, res => { |
501 |
| - if (res.status) { |
502 |
| - this.images.push(res.data.src); |
503 |
| - this.$refs.uToast.show({ |
504 |
| - title: res.msg, |
505 |
| - type: 'success', |
506 |
| - back: false |
| 484 | + //上传图片 |
| 485 | + upImage() { |
| 486 | + let num = this.imageMax - this.images.length; |
| 487 | + if (num > 0) { |
| 488 | + this.$upload.uploadImage(num, res => { |
| 489 | + if (res.status) { |
| 490 | + this.images.push(res.data.src); |
| 491 | + this.$refs.uToast.show({ |
| 492 | + title: res.msg, |
| 493 | + type: 'success', |
| 494 | + back: false |
| 495 | + }); |
| 496 | + } else { |
| 497 | + this.$u.toast(res.msg); |
| 498 | + } |
507 | 499 | });
|
508 |
| - } else { |
509 |
| - this.$u.toast(res.msg); |
510 | 500 | }
|
511 |
| - }); |
512 |
| - } |
513 |
| - }, |
514 |
| - //删除图片 |
515 |
| - delImage(e) { |
516 |
| - let newImages = []; |
517 |
| - for (var i = 0; i < this.images.length; i++) { |
518 |
| - if (this.images[i].image_id != e.image_id) { |
519 |
| - newImages.push(this.images[i]); |
| 501 | + }, |
| 502 | + //删除图片 |
| 503 | + delImage(e) { |
| 504 | + let newImages = []; |
| 505 | + for (var i = 0; i < this.images.length; i++) { |
| 506 | + if (this.images[i].image_id != e.image_id) { |
| 507 | + newImages.push(this.images[i]); |
| 508 | + } |
| 509 | + } |
| 510 | + this.images = newImages; |
| 511 | + }, |
| 512 | + // 图片点击放大 |
| 513 | + clickImg(img) { |
| 514 | + // 预览图片 |
| 515 | + uni.previewImage({ |
| 516 | + urls: img.split() |
| 517 | + }); |
520 | 518 | }
|
521 |
| - } |
522 |
| - this.images = newImages; |
523 | 519 | },
|
524 |
| - // 图片点击放大 |
525 |
| - clickImg(img) { |
526 |
| - // 预览图片 |
527 |
| - uni.previewImage({ |
528 |
| - urls: img.split() |
529 |
| - }); |
| 520 | + onLoad(e) { |
| 521 | + this.orderId = e.orderId; |
| 522 | + this.getOrderInfo(); |
| 523 | + this.getReturnData() |
530 | 524 | }
|
531 |
| - }, |
532 |
| - onLoad(e) { |
533 |
| - this.orderId = e.orderId; |
534 |
| - this.getOrderInfo(); |
535 |
| - this.getReturnData() |
536 | 525 | }
|
537 |
| - } |
538 | 526 | </script>
|
539 | 527 |
|
540 | 528 | <style lang="scss" scoped>
|
|
0 commit comments