record.vue 11 KB

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