refund.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <template>
  2. <view class="record">
  3. <u-navbar title="协商记录" :autoBack="true" :placeholder="true" :border-bottom="true"></u-navbar>
  4. <view class="product">
  5. <view class="img">
  6. <image :src="list.productImage" mode=""></image>
  7. </view>
  8. <view class="name">
  9. {{list.productName}}
  10. <view class="price">
  11. 退款金额:{{list.orderPrice}}
  12. </view>
  13. </view>
  14. </view>
  15. <view class="history">
  16. <view class="client" v-for="(item, index) in list.afterSaleReasonVo" :key="index">
  17. <view class="title">
  18. <view class="img" v-if="item.refundType == 0">
  19. <image :src="item.userAvatar" alt="" />
  20. </view>
  21. <view class="img" v-else>
  22. <image :src="item.logo" alt="" />
  23. </view>
  24. <view class="message" v-if="item.refundType == 0">
  25. {{item.nickName}}<br />
  26. <span>{{item.createTime}}</span>
  27. </view>
  28. <view class="message" v-else>
  29. {{item.corporateName}}<br />
  30. <span>{{item.rejectionTime}}</span>
  31. </view>
  32. </view>
  33. <!-- 用户提交 -->
  34. <view class="" v-if="item.refundType == 0">
  35. <view class="information">
  36. 退货金额:¥ {{item.refundPrice}}
  37. </view>
  38. <view class="information">
  39. 联系方式:{{item.phone}}
  40. </view>
  41. <view class="information">
  42. 申请原因:{{item.reason}}
  43. </view>
  44. <view class="information">
  45. 补充说明:{{item.reasonReasonExplain}}
  46. </view>
  47. </view>
  48. <!-- 商家拒绝 -->
  49. <view class="" v-if="item.refundType == 1">
  50. <view class="information" >
  51. 拒绝原因:{{item.refuseReason}}
  52. </view>
  53. <view class="information">
  54. 补充说明:{{item.refuseReasonExplain}}
  55. </view>
  56. </view>
  57. <!-- 商家同意 -->
  58. <!-- <view class="information" v-if="item.refundType == 0">
  59. 您已同意退货退款,平台会将退款原路退回。
  60. </view> -->
  61. <view class="request" v-if="item.auditType == 0">
  62. <view class="btn" @click="reject(item)">拒绝</view>
  63. <view class="btn" @click="agree(item)">同意</view>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 拒绝原因弹窗 -->
  68. <view class="popup" v-if="isRefuse">
  69. <view class="content">
  70. <view class="title">
  71. <span>拒绝原因 </span>
  72. <image src="/static/index/cut.png" alt="" @click="cutPopup" />
  73. </view>
  74. <view class="popup_title">
  75. 拒绝原因
  76. </view>
  77. <view class="item" v-for="(item,index) in reasonList" :key="index" @click="selectReason(item,index)">
  78. {{item.text}}
  79. <image v-if="item.check" src="/static/product/select.png" mode=""></image>
  80. <image v-else src="/static/product/round.png" mode=""></image>
  81. </view>
  82. <view class="popup_title">
  83. 补充说明(选填)
  84. <view class="input">
  85. <textarea v-model="rejectData.refuseReasonExplain" type="textarea" :maxlength="500" rows="3" />
  86. <span>{{ rejectData.refuseReasonExplain.length }}/500</span>
  87. </view>
  88. </view>
  89. <view class="submit">
  90. <view class="cancel_btn" @click="cutPopup">
  91. 取消
  92. </view>
  93. <view class="submit_btn" @click="refusalRefund">
  94. 确定
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. </template>
  101. <script>
  102. export default {
  103. data() {
  104. return {
  105. list: {
  106. productImage: '/static/banner/banner1.png',
  107. productName: 'productName',
  108. orderPrice: 'orderPrice',
  109. afterSaleReasonVo: [
  110. {refundType: 0, auditType: 0, nickName: 'nickName', createTime: 'createTime', corporateName: 'corporateName', rejectionTime: 'rejectionTime'},
  111. {refundType: 0, nickName: 'nickName', createTime: 'createTime', corporateName: 'corporateName', rejectionTime: 'rejectionTime'},
  112. {refundType: 1, nickName: 'nickName', createTime: 'createTime', corporateName: 'corporateName', rejectionTime: 'rejectionTime'},
  113. ]
  114. },
  115. orderNo: '',
  116. reasonList: [{
  117. name: '商品已使用',
  118. check: false,
  119. },
  120. {
  121. name: '服务已核销',
  122. check: false,
  123. }
  124. ],
  125. isRefuse: false,
  126. rejectData: {
  127. id: '',
  128. reOrderId: '',
  129. refuseReason: '',
  130. refuseReasonExplain: ''
  131. }
  132. }
  133. },
  134. mounted() {
  135. // this.getRecord()
  136. // this.getCodeList()
  137. },
  138. onLoad(query) {
  139. this.orderNo = query.orderId;
  140. },
  141. methods: {
  142. //返回
  143. back() {
  144. uni.navigateBack({
  145. delta: 1
  146. });
  147. },
  148. getRecord() {
  149. let data = {
  150. orderNo: this.orderNo
  151. }
  152. this.$http.get("/app/order/locaOrder/afterSaleDetails?orderNo=" + this.orderNo).then(res => {
  153. if (res.data.code == 200) {
  154. this.list = res.data.result
  155. }
  156. })
  157. },
  158. selectReason(item, index) {
  159. console.log(item)
  160. this.reasonList.forEach(reason => {
  161. reason.check = false;
  162. });
  163. this.reasonList[index].check = true
  164. this.rejectData.refuseReason = item.value
  165. },
  166. cutPopup() {
  167. this.isRefuse = false
  168. },
  169. reject(item) {
  170. console.log(item)
  171. this.isRefuse = true
  172. this.rejectData.id = item.id
  173. this.rejectData.reOrderId = item.reOrderId
  174. },
  175. //提交拒绝
  176. refusalRefund() {
  177. if(this.rejectData.refuseReason==''){
  178. uni.showToast({
  179. icon: 'none',
  180. title: '选择拒绝原因'
  181. })
  182. return
  183. }else{
  184. this.$http.post("/app/order/locaOrder/refusalRefund", this.rejectData).then(res => {
  185. if (res.data.code == 200) {
  186. console.log(res)
  187. uni.showToast({
  188. icon: 'none',
  189. title: '拒绝成功'
  190. })
  191. this.isRefuse = false
  192. this.getRecord()
  193. // this.list = res.data.result
  194. }
  195. })
  196. }
  197. },
  198. getCodeList() {
  199. this.$http.get("/sys/api/getManyDictItems?dictCodeList=" + 'reason_refusal').then(res => {
  200. if (res.statusCode == 200) {
  201. //
  202. res.data.reason_refusal.forEach(item => {
  203. item.check = false
  204. })
  205. this.reasonList = res.data.reason_refusal
  206. }
  207. })
  208. },
  209. // 同意退款
  210. agree(item){
  211. let data = {
  212. reOrderId:this.orderNo
  213. }
  214. this.$http.post("/app/order/locaOrder/agreeRefund",data).then(res => {
  215. if (res.statusCode == 200) {
  216. uni.showToast({
  217. icon: 'none',
  218. title: '商家已同意退款'
  219. })
  220. this.getRecord()
  221. }
  222. })
  223. }
  224. }
  225. }
  226. </script>
  227. <style lang="scss" scoped>
  228. .record {
  229. width: 100vw;
  230. height: 100vh;
  231. background: #F7F8FC;
  232. display: flex;
  233. flex-direction: column;
  234. .product {
  235. display: flex;
  236. border-radius: 16rpx;
  237. padding: 20rpx 24rpx;
  238. background-color: #FFFFFF;
  239. border-top: 1px solid #eeeeee;
  240. .img {
  241. width: 132rpx;
  242. height: 132rpx;
  243. border-radius: 12rpx;
  244. overflow: hidden;
  245. margin-right: 16rpx;
  246. image {
  247. width: 132rpx;
  248. height: 132rpx;
  249. }
  250. }
  251. .name {
  252. flex: 1;
  253. display: flex;
  254. flex-direction: column;
  255. justify-content: space-between;
  256. font-size: 28rpx;
  257. color: #000000;
  258. line-height: 35rpx;
  259. .price {
  260. font-size: 26rpx;
  261. color: #666666;
  262. display: flex;
  263. align-items: center;
  264. justify-content: space-between;
  265. span {
  266. color: #666666;
  267. }
  268. }
  269. }
  270. }
  271. .history {
  272. flex: 1;
  273. overflow-y: auto;
  274. padding: 0px 24rpx;
  275. margin-top: 18rpx;
  276. .client {
  277. background-color: #FFFFFF;
  278. padding: 20rpx 16rpx;
  279. box-shadow: 0px 2rpx 8rpx 0px rgba(214, 225, 237, 0.1);
  280. border-radius: 16rpx;
  281. margin-bottom: 20rpx;
  282. .title {
  283. display: flex;
  284. border-bottom: 1px solid #EEEEEE;
  285. padding-bottom: 16rpx;
  286. margin-bottom: 16rpx;
  287. .img {
  288. width: 80rpx;
  289. height: 80rpx;
  290. margin-right: 12rpx;
  291. border-radius: 8rpx;
  292. overflow: hidden;
  293. image {
  294. width: 80rpx;
  295. height: 80rpx;
  296. }
  297. }
  298. .message {
  299. display: flex;
  300. flex-direction: column;
  301. justify-content: space-between;
  302. font-size: 28rpx;
  303. color: #000000;
  304. span {
  305. font-size: 24rpx;
  306. color: #999999;
  307. }
  308. }
  309. }
  310. .information {
  311. font-size: 26rpx;
  312. color: #333333;
  313. margin-bottom: 10rpx;
  314. word-wrap: break-word;
  315. }
  316. .request {
  317. display: flex;
  318. align-items: center;
  319. justify-content: end;
  320. margin-top: 16rpx;
  321. .btn {
  322. display: flex;
  323. align-items: center;
  324. justify-content: center;
  325. width: 112rpx;
  326. height: 47rpx;
  327. border-radius: 47rpx;
  328. border: 1px solid #449AFF;
  329. font-size: 24rpx;
  330. color: #449AFF;
  331. margin-left: 24rpx;
  332. }
  333. }
  334. }
  335. }
  336. .popup {
  337. width: 100vw;
  338. height: 100vh;
  339. position: fixed;
  340. top: 0;
  341. left: 0;
  342. background: rgba(0, 0, 0, 0.4);
  343. .content {
  344. width: 100%;
  345. background: #FFFFFF;
  346. border-radius: 20rpx 20rpx 0rpx 0px;
  347. padding: 20rpx 24rpx;
  348. padding-bottom: 16rpx;
  349. position: absolute;
  350. bottom: 0;
  351. left: 0;
  352. .title {
  353. display: flex;
  354. align-items: center;
  355. justify-content: center;
  356. position: relative;
  357. border-bottom: 1px solid #EEEEEE;
  358. padding-bottom: 20rpx;
  359. font-weight: 600;
  360. image {
  361. width: 37rpx;
  362. height: 37rpx;
  363. position: absolute;
  364. right: 0;
  365. }
  366. }
  367. .popup_title {
  368. font-size: 30rpx;
  369. color: #333333;
  370. margin-top: 20rpx;
  371. font-weight: 600;
  372. .input {
  373. width: 100%;
  374. // min-height: 196rpx;
  375. margin-top: 15rpx;
  376. padding: 16rpx 16rpx;
  377. background: #F1F1F2;
  378. border-radius: 4rpx;
  379. overflow-y: auto;
  380. font-weight: normal;
  381. textarea {
  382. width: 100%;
  383. height: 196rpx;
  384. }
  385. span {
  386. display: block;
  387. text-align: right;
  388. }
  389. }
  390. }
  391. .item {
  392. height: 70rpx;
  393. display: flex;
  394. align-items: center;
  395. justify-content: space-between;
  396. border-bottom: 1px solid #EEEEEE;
  397. image {
  398. width: 28rpx;
  399. height: 28rpx;
  400. }
  401. }
  402. .submit {
  403. height: 112rpx;
  404. display: flex;
  405. align-items: center;
  406. justify-content: space-around;
  407. border-top: 1px solid #eeeeee;
  408. margin-top: 20rpx;
  409. .cancel_btn {
  410. width: 324rpx;
  411. height: 76rpx;
  412. border-radius: 54rpx;
  413. border: 1px solid #CCCCCC;
  414. font-size: 28rpx;
  415. color: #999999;
  416. display: flex;
  417. align-items: center;
  418. justify-content: center;
  419. }
  420. .submit_btn {
  421. width: 324rpx;
  422. height: 76rpx;
  423. border-radius: 54rpx;
  424. background: linear-gradient(90deg, #77B6FF 0%, #449AFF 100%);
  425. border: 1px solid #CCCCCC;
  426. font-size: 28rpx;
  427. color: #FFFFFF;
  428. display: flex;
  429. align-items: center;
  430. justify-content: center;
  431. }
  432. }
  433. }
  434. }
  435. }
  436. </style>