refundMoney.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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="digit" 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. 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) {
  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. title: '处理中'
  101. })
  102. this.$http('worldKeepCar/orderRefund/applyRefund', {
  103. sheetId:this.sheetId,
  104. applyReasonId:this.reasonId,
  105. applyReason:this.reason,
  106. money:this.money,
  107. reasonComment: this.exeContent,
  108. }, 'POST').then(res => {
  109. uni.hideLoading();
  110. if(res.code==0){
  111. uni.showModal({
  112. title: '退款申请成功,请等待平台处理',
  113. content: '您可以在【我的-退款申请记录】里查看申请的处理进度哦',
  114. showCancel:false,
  115. confirmText:'知道了',
  116. success: function (res) {
  117. if (res.confirm) {
  118. uni.navigateBack({
  119. })
  120. }
  121. }
  122. });
  123. }
  124. })
  125. },
  126. editUrl(){
  127. uni.showLoading({
  128. title: '处理中'
  129. })
  130. this.$http('worldKeepCar/orderRefund/editApply', {
  131. applyReasonId:this.reasonId,
  132. applyReason:this.reason,
  133. money:this.money,
  134. reasonComment: this.exeContent,
  135. id:this.editId,
  136. }, 'POST').then(res => {
  137. uni.hideLoading();
  138. if(res.code==0){
  139. uni.showModal({
  140. title: '退款申请成功,请等待平台处理',
  141. content: '您可以在【我的-退款申请记录】里查看申请的处理进度哦',
  142. showCancel:false,
  143. confirmText:'知道了',
  144. success: function (res) {
  145. if (res.confirm) {
  146. uni.navigateBack({
  147. })
  148. }
  149. }
  150. });
  151. }
  152. })
  153. },
  154. getRefundData() {
  155. uni.showLoading({
  156. title: '加载中'
  157. })
  158. let url = 'worldKeepCar/orderRefund/refuseReasonList',
  159. params = {
  160. type: 3,
  161. }
  162. this.$http(url, params, 'GET').then(res => {
  163. uni.hideLoading();
  164. this.reasonArray = res.data
  165. this.reasonArray.forEach((item, index) => {
  166. this.reasonNameArray.push(item.contents)
  167. });
  168. })
  169. },
  170. feedDone(e) {
  171. this.exeContent = e.target.value
  172. },
  173. reasonChange(e) {
  174. this.reasonId = this.reasonArray[e.target.value].id
  175. this.reason = this.reasonArray[e.target.value].contents
  176. },
  177. }
  178. }
  179. </script>
  180. <style scoped>
  181. .box {
  182. min-height: 100vh;
  183. background: #F4F5F7;
  184. padding-top: 20rpx;
  185. }
  186. .content {
  187. background-color: #FFFFFF;
  188. border-radius: 10rpx;
  189. margin: 20rpx 24rpx;
  190. padding: 0 20rpx;
  191. }
  192. .viewBg {
  193. display: flex;
  194. align-items: center;
  195. padding: 30rpx 0;
  196. border-bottom: 1rpx solid #EEEEEE;
  197. }
  198. .width70 {
  199. width: 70%;
  200. }
  201. .moneyBg {
  202. padding: 30rpx 0;
  203. border-bottom: 1rpx solid #EEEEEE;
  204. }
  205. .viewBg2 {
  206. display: flex;
  207. align-items: center;
  208. margin-bottom: 20rpx;
  209. }
  210. .leftTitle {
  211. color: #333333;
  212. font-size: 28rpx;
  213. width: 130rpx;
  214. margin-right: 50rpx;
  215. }
  216. .blackColor {
  217. color: #333333;
  218. font-size: 28rpx;
  219. }
  220. .grayColor {
  221. color: #999999;
  222. font-size: 28rpx;
  223. }
  224. .textareaCont {
  225. width: 70%;
  226. font-size: 28rpx;
  227. color: #333333;
  228. }
  229. .contentBg {
  230. display: flex;
  231. align-items: center;
  232. padding: 30rpx 0;
  233. }
  234. .bottom {
  235. width: 750rpx;
  236. height: 120rpx;
  237. background: #FFFFFF;
  238. box-shadow: 0px -4px 8px 0px rgba(153, 153, 153, 0.08);
  239. position: fixed;
  240. left: 0;
  241. bottom: 0;
  242. display: flex;
  243. justify-content: space-around;
  244. }
  245. .shoreDz {
  246. width: 702rpx;
  247. height: 74rpx;
  248. background: linear-gradient(135deg, #FD5300 0%, #FF270A 100%);
  249. border-radius: 37rpx;
  250. text-align: center;
  251. line-height: 74rpx;
  252. color: #FFFFFF;
  253. font-size: 30rpx;
  254. margin-top: 24rpx;
  255. }
  256. </style>