refundMoney.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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="digit" :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. edit: '', //修改申请
  47. editId: '',
  48. }
  49. },
  50. onLoad(opt) {
  51. this.sheetId = opt.sheetId;
  52. this.maxMoney = opt.maxMoney;
  53. this.getRefundData();
  54. //修改申请
  55. this.edit = opt.edit;
  56. this.editId = opt.editId;
  57. this.money = opt.money;
  58. this.reasonId = opt.reasonId;
  59. this.reason = opt.reason;
  60. this.exeContent = opt.exeContent;
  61. if (opt.exeContent == null || opt.exeContent == 'null') {
  62. this.exeContent = ''
  63. }
  64. },
  65. methods: {
  66. submit() {
  67. if (this.reasonId == '') {
  68. uni.showToast({
  69. title: '请选择退款原因',
  70. icon: 'none',
  71. duration: 2000,
  72. });
  73. return ;
  74. }
  75. if (this.money==0) {
  76. uni.showToast({
  77. title: '请输入退款金额',
  78. icon: 'none',
  79. duration: 2000,
  80. });
  81. return ;
  82. }
  83. if (this.money > this.maxMoney) {
  84. uni.showToast({
  85. title: '退款金额不能大于最大可退金额',
  86. icon: 'none',
  87. duration: 2000,
  88. });
  89. return ;
  90. }
  91. if (this.edit == 'true') {
  92. console.log('修改申请');
  93. this.editUrl();
  94. } else {
  95. this.addUrl();
  96. }
  97. },
  98. addUrl(){
  99. uni.showLoading({});
  100. this.$http('worldKeepCar/orderRefund/applyRefund', {
  101. sheetId:this.sheetId,
  102. applyReasonId:this.reasonId,
  103. applyReason:this.reason,
  104. money:this.money,
  105. reasonComment: this.exeContent,
  106. }, 'POST').then(res => {
  107. uni.hideLoading();
  108. if(res.code==0){
  109. uni.showModal({
  110. title: '退款申请成功,请等待平台处理',
  111. content: '您可以在【我的-退款申请记录】列表里具体查看申请的处理进度哦~',
  112. showCancel:false,
  113. confirmText:'知道了',
  114. success: function (res) {
  115. if (res.confirm) {
  116. uni.navigateBack({
  117. })
  118. }
  119. }
  120. });
  121. }
  122. })
  123. },
  124. editUrl(){
  125. uni.showLoading({});
  126. this.$http('worldKeepCar/orderRefund/editApply', {
  127. applyReasonId:this.reasonId,
  128. applyReason:this.reason,
  129. money:this.money,
  130. reasonComment: this.exeContent,
  131. id:this.editId,
  132. }, 'POST').then(res => {
  133. uni.hideLoading();
  134. if(res.code==0){
  135. uni.showModal({
  136. title: '退款申请成功,请等待平台处理',
  137. content: '您可以在【我的-退款申请记录】列表里具体查看申请的处理进度哦~',
  138. showCancel:false,
  139. confirmText:'知道了',
  140. success: function (res) {
  141. if (res.confirm) {
  142. uni.navigateBack({
  143. })
  144. }
  145. }
  146. });
  147. }
  148. })
  149. },
  150. getRefundData() {
  151. uni.showLoading({
  152. title: '加载中'
  153. })
  154. let url = 'worldKeepCar/orderRefund/refuseReasonList',
  155. params = {
  156. type: 3,
  157. }
  158. this.$http(url, params, 'GET').then(res => {
  159. uni.hideLoading();
  160. this.reasonArray = res.data
  161. this.reasonArray.forEach((item, index) => {
  162. this.reasonNameArray.push(item.contents)
  163. });
  164. })
  165. },
  166. feedDone(e) {
  167. this.exeContent = e.target.value
  168. },
  169. reasonChange(e) {
  170. this.reasonId = this.reasonArray[e.target.value].id
  171. this.reason = this.reasonArray[e.target.value].contents
  172. },
  173. }
  174. }
  175. </script>
  176. <style scoped>
  177. .box {
  178. min-height: 100vh;
  179. background: #F4F5F7;
  180. padding-top: 20rpx;
  181. }
  182. .content {
  183. background-color: #FFFFFF;
  184. border-radius: 10rpx;
  185. margin: 20rpx 24rpx;
  186. padding: 0 20rpx;
  187. }
  188. .viewBg {
  189. display: flex;
  190. align-items: center;
  191. padding: 30rpx 0;
  192. border-bottom: 1rpx solid #EEEEEE;
  193. }
  194. .width70 {
  195. width: 70%;
  196. }
  197. .moneyBg {
  198. padding: 30rpx 0;
  199. border-bottom: 1rpx solid #EEEEEE;
  200. }
  201. .viewBg2 {
  202. display: flex;
  203. align-items: center;
  204. margin-bottom: 20rpx;
  205. }
  206. .leftTitle {
  207. color: #333333;
  208. font-size: 28rpx;
  209. width: 130rpx;
  210. margin-right: 50rpx;
  211. }
  212. .blackColor {
  213. color: #333333;
  214. font-size: 28rpx;
  215. }
  216. .grayColor {
  217. color: #999999;
  218. font-size: 28rpx;
  219. }
  220. .textareaCont {
  221. width: 70%;
  222. font-size: 28rpx;
  223. color: #333333;
  224. }
  225. .contentBg {
  226. display: flex;
  227. align-items: center;
  228. padding: 30rpx 0;
  229. }
  230. .bottom {
  231. width: 750rpx;
  232. height: 120rpx;
  233. background: #FFFFFF;
  234. box-shadow: 0px -4px 8px 0px rgba(153, 153, 153, 0.08);
  235. position: fixed;
  236. left: 0;
  237. bottom: 0;
  238. display: flex;
  239. justify-content: space-around;
  240. }
  241. .shoreDz {
  242. width: 702rpx;
  243. height: 74rpx;
  244. background: linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  245. border-radius: 37rpx;
  246. text-align: center;
  247. line-height: 74rpx;
  248. color: #FFFFFF;
  249. font-size: 30rpx;
  250. margin-top: 24rpx;
  251. }
  252. </style>