refundMoney.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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 class="width70" mode="selector" :range="reasonNameArray" @change="reasonChange">
  8. <view class="blackColor" :class="{grayColor: reason==''}">
  9. {{reason == '' ? '请选择' : reason}}
  10. </view>
  11. </picker>
  12. <image src="../../static/img/rightArrow.png" mode="" style="width: 13rpx; height: 23rpx;"></image>
  13. </view>
  14. <view class="moneyBg">
  15. <view class="viewBg2">
  16. <image src="../../static/img/icon_xinghao.png" mode="" style="width: 14rpx; height: 14rpx;"></image>
  17. <view class="leftTitle">退款金额</view>
  18. <input class="blackColor" type="number" v-model="money" :placeholder="'最大可退 ¥'+maxMoney"
  19. placeholder-style="color:#999999" />
  20. </view>
  21. <view class="grayColor">如全额退款,优惠券会退回到您的账户</view>
  22. </view>
  23. <view class="contentBg">
  24. <view class="leftTitle">补充描述</view>
  25. <textarea placeholder-style="color:#999999" placeholder="选填,请输入补充描述" v-model="exeContent"
  26. class="textareaCont" maxlength="-1" auto-height="true" @confirm="feedDone" />
  27. </view>
  28. <view class="bottom">
  29. <view class="shoreDz" @click="submit">提交</view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. sheetId: '',
  39. reasonArray: [],
  40. reasonNameArray: [],
  41. reasonId: '',
  42. reason:'',
  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.reason,
  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. this.reasonArray.forEach((item, index) => {
  113. this.reasonNameArray.push(item.contents)
  114. });
  115. })
  116. },
  117. feedDone(e) {
  118. this.exeContent = e.target.value
  119. },
  120. reasonChange(e) {
  121. this.reasonId = this.reasonArray[e.target.value].id
  122. this.reason = this.reasonArray[e.target.value].contents
  123. },
  124. }
  125. }
  126. </script>
  127. <style scoped>
  128. .box {
  129. min-height: 100vh;
  130. background: #F4F5F7;
  131. padding-top: 20rpx;
  132. }
  133. .content {
  134. background-color: #FFFFFF;
  135. border-radius: 10rpx;
  136. margin: 20rpx 24rpx;
  137. padding: 0 20rpx;
  138. }
  139. .viewBg {
  140. display: flex;
  141. align-items: center;
  142. padding: 30rpx 0;
  143. border-bottom: 1rpx solid #EEEEEE;
  144. }
  145. .width70 {
  146. width: 70%;
  147. }
  148. .moneyBg {
  149. padding: 30rpx 0;
  150. border-bottom: 1rpx solid #EEEEEE;
  151. }
  152. .viewBg2 {
  153. display: flex;
  154. align-items: center;
  155. margin-bottom: 20rpx;
  156. }
  157. .leftTitle {
  158. color: #333333;
  159. font-size: 28rpx;
  160. width: 130rpx;
  161. margin-right: 50rpx;
  162. }
  163. .blackColor {
  164. color: #333333;
  165. font-size: 28rpx;
  166. }
  167. .grayColor {
  168. color: #999999;
  169. font-size: 28rpx;
  170. }
  171. .textareaCont {
  172. width: 70%;
  173. font-size: 28rpx;
  174. color: #333333;
  175. }
  176. .contentBg {
  177. display: flex;
  178. align-items: center;
  179. padding: 30rpx 0;
  180. }
  181. .bottom {
  182. width: 750rpx;
  183. height: 120rpx;
  184. background: #FFFFFF;
  185. box-shadow: 0px -4px 8px 0px rgba(153, 153, 153, 0.08);
  186. position: fixed;
  187. left: 0;
  188. bottom: 0;
  189. display: flex;
  190. justify-content: space-around;
  191. }
  192. .shoreDz {
  193. width: 702rpx;
  194. height: 74rpx;
  195. background: linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  196. border-radius: 37rpx;
  197. text-align: center;
  198. line-height: 74rpx;
  199. color: #FFFFFF;
  200. font-size: 30rpx;
  201. margin-top: 24rpx;
  202. }
  203. </style>