refundMoney.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <view class="box">
  3. <view class="content">
  4. <view class="viewBg">
  5. <image src="../../static/img/icon_xinghao.png" mode="" style="width: 14rpx; height: 14rpx;"></image>
  6. <view class="leftTitle">退款原因</view>
  7. <picker :value="firstIndex" class="width70" mode="selector" :range="reasonArray" range-key="contents"
  8. @change="reasonChange">
  9. <view class="blackColor" :class="{grayColor: firstIndex==null}">
  10. {{firstIndex == null ? '请选择' : reasonArray[firstIndex].contents}}
  11. </view>
  12. </picker>
  13. <image src="../../static/img/rightArrow.png" mode="" style="width: 13rpx; height: 23rpx;"></image>
  14. </view>
  15. <view class="moneyBg">
  16. <view class="viewBg2">
  17. <image src="../../static/img/icon_xinghao.png" mode="" style="width: 14rpx; height: 14rpx;"></image>
  18. <view class="leftTitle">退款金额</view>
  19. <input class="blackColor" type="number" v-model="money" :placeholder="'最大可退 ¥'+maxMoney"
  20. placeholder-style="color:#999999" />
  21. </view>
  22. <view class="grayColor">如全额退款,优惠券会退回到您的账户</view>
  23. </view>
  24. <view class="contentBg">
  25. <view class="leftTitle">补充描述</view>
  26. <textarea placeholder-style="color:#999999" placeholder="选填,请输入补充描述" v-model="exeContent"
  27. class="textareaCont" maxlength="-1" auto-height="true" @confirm="feedDone" />
  28. </view>
  29. <view class="bottom">
  30. <view class="shoreDz" @click="submit">提交</view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. sheetId: '',
  40. reasonArray: [],
  41. firstIndex: null,
  42. reasonId: '',
  43. maxMoney: '',
  44. money: '',
  45. exeContent: '',
  46. }
  47. },
  48. onLoad(opt) {
  49. this.sheetId = opt.sheetId;
  50. this.maxMoney = opt.maxMoney;
  51. this.getRefundData();
  52. },
  53. methods: {
  54. submit() {
  55. if (this.reasonId == '') {
  56. uni.showToast({
  57. title: '请选择退款原因',
  58. icon: 'none',
  59. duration: 2000,
  60. });
  61. return ;
  62. }
  63. if (this.money==0) {
  64. uni.showToast({
  65. title: '请输入退款金额',
  66. icon: 'none',
  67. duration: 2000,
  68. });
  69. return ;
  70. }
  71. if (this.money > this.maxMoney) {
  72. uni.showToast({
  73. title: '退款金额不能大于最大可退金额',
  74. icon: 'none',
  75. duration: 2000,
  76. });
  77. return ;
  78. }
  79. uni.showLoading({});
  80. this.$http('worldKeepCar/orderRefund/applyRefund', {
  81. sheetId:this.sheetId,
  82. applyReasonId:this.reasonId,
  83. applyReason:this.reasonArray[this.firstIndex].contents,
  84. money:this.money,
  85. reasonComment: this.exeContent,
  86. }, 'POST').then(res => {
  87. uni.hideLoading();
  88. if(res.code==0){
  89. uni.showToast({
  90. title: '提交成功',
  91. icon: 'none',
  92. duration: 2000,
  93. });
  94. setTimeout(function() {
  95. uni.navigateBack({
  96. })
  97. }, 2000);
  98. }
  99. })
  100. },
  101. getRefundData() {
  102. uni.showLoading({
  103. title: '加载中'
  104. })
  105. let url = 'worldKeepCar/orderRefund/refuseReasonList',
  106. params = {
  107. type: 3,
  108. }
  109. this.$http(url, params, 'GET').then(res => {
  110. uni.hideLoading();
  111. this.reasonArray = res.data
  112. console.log(this.reasonArray);
  113. })
  114. },
  115. feedDone(e) {
  116. this.exeContent = e.target.value
  117. },
  118. reasonChange(e) {
  119. this.firstIndex = e.target.value
  120. this.reasonId = this.reasonArray[this.firstIndex].id
  121. },
  122. }
  123. }
  124. </script>
  125. <style scoped>
  126. .box {
  127. min-height: 100vh;
  128. background: #F4F5F7;
  129. padding-top: 20rpx;
  130. }
  131. .content {
  132. background-color: #FFFFFF;
  133. border-radius: 10rpx;
  134. margin: 20rpx 24rpx;
  135. padding: 0 20rpx;
  136. }
  137. .viewBg {
  138. display: flex;
  139. align-items: center;
  140. padding: 30rpx 0;
  141. border-bottom: 1rpx solid #EEEEEE;
  142. }
  143. .width70 {
  144. width: 70%;
  145. }
  146. .moneyBg {
  147. padding: 30rpx 0;
  148. border-bottom: 1rpx solid #EEEEEE;
  149. }
  150. .viewBg2 {
  151. display: flex;
  152. align-items: center;
  153. margin-bottom: 20rpx;
  154. }
  155. .leftTitle {
  156. color: #333333;
  157. font-size: 28rpx;
  158. width: 130rpx;
  159. margin-right: 50rpx;
  160. }
  161. .blackColor {
  162. color: #333333;
  163. font-size: 28rpx;
  164. }
  165. .grayColor {
  166. color: #999999;
  167. font-size: 28rpx;
  168. }
  169. .textareaCont {
  170. width: 70%;
  171. font-size: 28rpx;
  172. color: #333333;
  173. }
  174. .contentBg {
  175. display: flex;
  176. align-items: center;
  177. padding: 30rpx 0;
  178. }
  179. .bottom {
  180. width: 750rpx;
  181. height: 120rpx;
  182. background: #FFFFFF;
  183. box-shadow: 0px -4px 8px 0px rgba(153, 153, 153, 0.08);
  184. position: fixed;
  185. left: 0;
  186. bottom: 0;
  187. display: flex;
  188. justify-content: space-around;
  189. }
  190. .shoreDz {
  191. width: 702rpx;
  192. height: 74rpx;
  193. background: linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  194. border-radius: 37rpx;
  195. text-align: center;
  196. line-height: 74rpx;
  197. color: #FFFFFF;
  198. font-size: 30rpx;
  199. margin-top: 24rpx;
  200. }
  201. </style>