index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <view>
  3. <form @submit="subRefund" report-submit='true'>
  4. <view class='apply-return'>
  5. <view class='goodsStyle acea-row row-between' v-for="(item,index) in orderInfo.cartInfo" :key="index">
  6. <view class='pictrue'><image :src='item.productInfo.image'></image></view>
  7. <view class='text acea-row row-between'>
  8. <view class='name line2'>{{item.productInfo.store_name}}</view>
  9. <view class='money' v-if="item.productInfo.attrInfo">
  10. <view>{{item.productInfo.attrInfo.price}}</view>
  11. <view class='num'>x{{item.cart_num}}</view>
  12. </view>
  13. <view class='money' v-else>
  14. <view>{{item.productInfo.price}}</view>
  15. <view class='num'>x{{item.cart_num}}</view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class='list'>
  20. <view class='item acea-row row-between-wrapper'>
  21. <view>退货件数</view>
  22. <view class='num'>{{orderInfo.total_num}}</view>
  23. </view>
  24. <view class='item acea-row row-between-wrapper'>
  25. <view>退款金额</view>
  26. <view class='num'>{{orderInfo.pay_price}}</view>
  27. </view>
  28. <view class='item acea-row row-between-wrapper' @tap="toggleTab('region')">
  29. <view>退款原因</view>
  30. <picker class='num' @change="bindPickerChange" :value="index" :range="RefundArray">
  31. <view class="picker acea-row row-between-wrapper">
  32. <view class='reason'>{{RefundArray[index]}}</view>
  33. <text class='iconfont icon-jiantou'></text>
  34. </view>
  35. </picker>
  36. </view>
  37. <view class='item textarea acea-row row-between'>
  38. <view>备注说明</view>
  39. <textarea placeholder='填写备注信息,100字以内' class='num' name="refund_reason_wap_explain" placeholder-class='填写备注信息,100字以内'></textarea>
  40. </view>
  41. <view class='item acea-row row-between'>
  42. <view class='title acea-row row-between-wrapper'>
  43. <view>上传凭证</view>
  44. <view class='tip'>( 最多可上传3张 )</view>
  45. </view>
  46. <view class='upload acea-row row-middle'>
  47. <view class='pictrue' v-for="(item,index) in refund_reason_wap_img" :key="index">
  48. <image :src='item'></image>
  49. <view class='iconfont icon-guanbi1 font-color' @tap='DelPic(index)'></view>
  50. </view>
  51. <view class='pictrue acea-row row-center-wrapper row-column' @tap='uploadpic' v-if="refund_reason_wap_img.length < 3">
  52. <text class='iconfont icon-icon25201'></text>
  53. <view>上传凭证</view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <button class='returnBnt bg-color' form-type="submit">申请退款</button>
  59. </view>
  60. </form>
  61. </view>
  62. </template>
  63. <script>
  64. // +----------------------------------------------------------------------
  65. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  66. // +----------------------------------------------------------------------
  67. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  68. // +----------------------------------------------------------------------
  69. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  70. // +----------------------------------------------------------------------
  71. // | Author: CRMEB Team <admin@crmeb.com>
  72. // +----------------------------------------------------------------------
  73. import { ordeRefundReason, orderRefundVerify, getOrderDetail} from '@/api/order.js';
  74. import { mapGetters } from "vuex";
  75. import { toLogin } from '@/libs/login.js';
  76. export default {
  77. components: {},
  78. data() {
  79. return {
  80. refund_reason_wap_img:[],
  81. orderInfo:{},
  82. RefundArray: [],
  83. index: 0,
  84. orderId:0,
  85. };
  86. },
  87. computed: mapGetters(['isLogin']),
  88. onLoad: function (options) {
  89. if (!options.orderId) return this.$util.Tips({title:'缺少订单id,无法退款'},{tab:3,url:1});
  90. this.orderId = options.orderId;
  91. if (this.isLogin) {
  92. this.getOrderInfo();
  93. this.getRefundReason();
  94. } else {
  95. toLogin()
  96. }
  97. },
  98. methods: {
  99. /**
  100. * 获取订单详情
  101. *
  102. */
  103. getOrderInfo:function(){
  104. let that=this;
  105. getOrderDetail(that.orderId).then(res=>{
  106. that.$set(that,'orderInfo',res.data);
  107. });
  108. },
  109. /**
  110. * 获取退款理由
  111. */
  112. getRefundReason:function(){
  113. let that=this;
  114. ordeRefundReason().then(res=>{
  115. that.$set(that,'RefundArray',res.data);
  116. })
  117. },
  118. /**
  119. * 删除图片
  120. *
  121. */
  122. DelPic:function(e){
  123. let index = e, that = this, pic = this.refund_reason_wap_img[index];
  124. that.refund_reason_wap_img.splice(index, 1);
  125. that.$set(that,'refund_reason_wap_img',that.refund_reason_wap_img);
  126. },
  127. /**
  128. * 上传文件
  129. *
  130. */
  131. uploadpic:function(){
  132. let that=this;
  133. this.$util.uploadImageOne('upload/image',function(res){
  134. that.refund_reason_wap_img.push(res.data.url);
  135. that.$set(that,'refund_reason_wap_img',that.refund_reason_wap_img);
  136. });
  137. },
  138. /**
  139. * 申请退货
  140. */
  141. subRefund:function(e){
  142. let that = this, value = e.detail.value;
  143. //收集form表单
  144. // if (!value.refund_reason_wap_explain) return app.Tips({title:'请输入退款原因'});
  145. orderRefundVerify({
  146. text: that.RefundArray[that.index] || '',
  147. refund_reason_wap_explain: value.refund_reason_wap_explain,
  148. refund_reason_wap_img: that.refund_reason_wap_img.join(','),
  149. uni: that.orderId
  150. }).then(res=>{
  151. return this.$util.Tips({ title: '申请成功', icon: 'success' }, { tab: 5, url: '/pages/users/user_return_list/index?isT=1' });
  152. }).catch(err=>{
  153. return this.$util.Tips({ title: err });
  154. })
  155. },
  156. bindPickerChange: function (e) {
  157. this.$set(this,'index',e.detail.value);
  158. }
  159. }
  160. }
  161. </script>
  162. <style scoped lang="scss">
  163. .apply-return .list{background-color:#fff;margin-top:18rpx;}
  164. .apply-return .list .item{margin-left:30rpx;padding-right:30rpx;min-height:90rpx;border-bottom:1rpx solid #eee;font-size:30rpx;color:#333;}
  165. .apply-return .list .item .num{color:#282828;width:427rpx;text-align:right;}
  166. .apply-return .list .item .num .picker .reason{width:385rpx;}
  167. .apply-return .list .item .num .picker .iconfont{color:#666;font-size:30rpx;margin-top:2rpx;}
  168. .apply-return .list .item.textarea{padding:30rpx 30rpx 30rpx 0;}
  169. .apply-return .list .item textarea{height:100rpx;font-size:30rpx;}
  170. .apply-return .list .item .placeholder{color:#bbb;}
  171. .apply-return .list .item .title{height:95rpx;width:100%;}
  172. .apply-return .list .item .title .tip{font-size:30rpx;color:#bbb;}
  173. .apply-return .list .item .upload{padding-bottom:36rpx;}
  174. .apply-return .list .item .upload .pictrue{margin:22rpx 23rpx 0 0;width:156rpx;height:156rpx;position:relative;font-size:24rpx;color:#bbb;}
  175. .apply-return .list .item .upload .pictrue:nth-of-type(4n){margin-right:0;}
  176. .apply-return .list .item .upload .pictrue image{width:100%;height:100%;border-radius:3rpx;}
  177. .apply-return .list .item .upload .pictrue .icon-guanbi1{position:absolute;font-size:45rpx;top:-10rpx;right:-10rpx;}
  178. .apply-return .list .item .upload .pictrue .icon-icon25201{color:#bfbfbf;font-size:50rpx;}
  179. .apply-return .list .item .upload .pictrue:nth-last-child(1){border:1rpx solid #ddd;box-sizing:border-box;}
  180. .apply-return .returnBnt{font-size:32rpx;color:#fff;width:690rpx;height:86rpx;border-radius:50rpx;text-align:center;line-height:86rpx;margin:43rpx auto;}
  181. </style>