refundDetails.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. <template>
  2. <view>
  3. <!--mine/refundGoods/refundGoods.wxml-->
  4. <!-- 退货成功 退货失败 -->
  5. <!-- <view class="cg" v-if="refundState>=42||refundState==32&&isShow==true">
  6. <image :src="refundState==42||refundState==32?'/static/pages/images/thsb.png':'/static/pages/images/audit.png'" :class="refundState==42||refundState==32?'shibai':'chengong'"></image>
  7. <text>{{refundState==42||refundState==32?'退货失败了哦~':'您已经成功退货啦~'}}</text>
  8. <button class="btn bgline" @tap="goblack">返回</button>
  9. </view> -->
  10. <block>
  11. <!-- 退款进度条 待寄回,退货中r11 -->
  12. <view :class="'status mdaddr1 bgfff ' + (true ? 'r10' : 'r11')">
  13. <view :class="'li ' + (refundState >= 39 || refundState >= 30 ? 'ing' : '')">
  14. <text></text>
  15. 待审核
  16. </view>
  17. <view :class="'li ' + (refundState >= 32 ? 'ing' : '')" v-if="refundState == 32">
  18. <text></text>
  19. 审核失败
  20. </view>
  21. <block v-else>
  22. <block v-if="isRefund == 2 && refundMethod == 1">
  23. <view :class="'li ' + (refundState >= 35 ? 'ing' : '')">
  24. <text></text>
  25. 待寄回
  26. </view>
  27. <view :class="'li ' + (refundState >= 36 ? 'ing' : '')">
  28. <text></text>
  29. 退货中
  30. </view>
  31. </block>
  32. <block v-if="isRefund == 2 && (refundMethod == 2 || refundMethod == 3)">
  33. <view :class="'li ' + (refundState >= 36 ? 'ing' : '')">
  34. <text></text>
  35. 退货中
  36. </view>
  37. </block>
  38. <view :class="'li ' + ((refundState >= 39 && isRefund == 2) || (refundState == 40 && (isRefund == 1 || isRefund == 3)) || refundState >= 41 ? 'ing' : '')">
  39. <text></text>
  40. 退款中
  41. </view>
  42. <view :class="'li ' + (refundState >= 42 ? 'ing' : '')">
  43. <text></text>
  44. {{ refundState == 42 ? '退款失败' : '已退款' }}
  45. </view>
  46. </block>
  47. </view>
  48. <!-- 待寄回,退货中显示 -->
  49. <!-- <view class="list1"> -->
  50. <!-- 待寄回显示 -->
  51. <view class="th-addr" v-if="refundState >= 35 && address">
  52. <view class="th-tit dflex">
  53. <image src="../../static/mine/images/fbico2.png"></image>
  54. 退货地址
  55. </view>
  56. <block v-if="address.address">
  57. <view class="th-area">{{ address.address }}</view>
  58. <view class="th-ren ddflex">
  59. <view class="fflex">收件人:{{ address.contactName }} {{ address.contactPhone }}</view>
  60. <view class="fuzhi" @click="copy()">复制</view>
  61. </view>
  62. </block>
  63. <view class="th-lx ddflex" v-else>
  64. 商家未设置,请
  65. <button open-type="contact" hover-class="none">联系客服</button>
  66. </view>
  67. </view>
  68. <!-- <view class="li red" wx:if="{{false}}">填写物流信息</view> -->
  69. <!-- 退货中 显示 -->
  70. <!-- <view class="li">查看物流</view> -->
  71. <!-- </view> -->
  72. <!-- 进度处理 -->
  73. <view class="list">
  74. <view class="li">
  75. <image src="/mine/static/mine/images/cljd.png"></image>
  76. 处理进度
  77. </view>
  78. <!-- 退货流程 -->
  79. <view :class="'li2 ' + (refundState >= 43 ? '' : 'glay')" v-if="refundState >= 42">
  80. <image src="/mine/static/mine/images/gou_hong.png"></image>
  81. <view>
  82. {{ refundState == 43 ? '退款成功' : '退款失败' }}
  83. <view class="time" v-if="refundOverTime || refundFalseRes">{{ refundState == 43 ? (refundOverTime ? refundOverTime : '') : refundFalseRes }}</view>
  84. </view>
  85. </view>
  86. <block v-if="isRefund == 2">
  87. <view :class="'li2 ' + (refundState == 39 || refundState == 40 || refundState == 41 ? '' : 'glay')" v-if="refundState >= 39">
  88. <image
  89. :src="refundState == 39 || refundState == 40 || refundState == 41 ? '/mine/static/mine/images/gou_hong.png' : '/mine/static/mine/images/list_no.png'"
  90. ></image>
  91. <view>
  92. 您寄回的商品卖家已接收,等待卖家退款中
  93. <view class="time">{{ receiveTime }}</view>
  94. </view>
  95. </view>
  96. <view
  97. :class="'li2 ' + (refundState == 36 && (refundMethod == 1 || refundMethod == 3) ? '' : 'glay')"
  98. v-if="refundState >= 36 && (refundMethod == 1 || refundMethod == 3)"
  99. >
  100. <image
  101. :src="refundState == 36 && (refundMethod == 1 || refundMethod == 3) ? '/mine/static/mine/images/gou_hong.png' : '/mine/static/mine/images/list_no.png'"
  102. ></image>
  103. <view>
  104. 商品已寄回,等待卖家确认收货
  105. <view class="time">{{ refundMethod == 1 ? expressTime : refundGoodReviewTime }}</view>
  106. </view>
  107. </view>
  108. </block>
  109. <view
  110. :class="'li2 ' + ((refundState == 35 && isRefund == 2 && refundMethod == null) || (refundState == 41 && (isRefund == 1 || isRefund == 3)) ? '' : 'glay')"
  111. v-if="refundState >= 35 && isRefund == 2 && refundMethod == null"
  112. >
  113. <image
  114. :src="refundState == 35 && isRefund == 2 && refundMethod == null ? '/mine/static/mine/images/gou_hong.png' : '/mine/static/mine/images/list_no.png'"
  115. ></image>
  116. <view>
  117. 您提交的退款申请审核完成,请选择退货方式
  118. <view class="time">{{ refundGoodReviewTime }}</view>
  119. </view>
  120. </view>
  121. <view
  122. :class="
  123. 'li2 ' +
  124. ((refundState == 35 && isRefund == 2 && refundMethod == 1) ||
  125. (refundState == 40 && (isRefund == 1 || isRefund == 3)) ||
  126. (refundState == 41 && (isRefund == 1 || isRefund == 3))
  127. ? ''
  128. : 'glay')
  129. "
  130. v-if="
  131. ((refundState >= 35 && isRefund == 2 && refundMethod == 1) ||
  132. (refundState == 40 && (isRefund == 1 || isRefund == 3)) ||
  133. (refundState >= 41 && (isRefund == 1 || isRefund == 3))) &&
  134. refundMethod != 2
  135. "
  136. >
  137. <image
  138. :src="
  139. (refundState == 35 && isRefund == 2 && refundMethod == 1) ||
  140. (refundState == 40 && (isRefund == 1 || isRefund == 3)) ||
  141. (refundState == 41 && (isRefund == 1 || isRefund == 3))
  142. ? '/mine/static/mine/images/gou_hong.png'
  143. : '/mine/static/mine/images/list_no.png'
  144. "
  145. ></image>
  146. <view>
  147. 您提交的退款申请审核完成{{ refundState >= 40 && (isRefund == 1 || isRefund == 3) ? ',等待卖家退款中' : ',请填写物流信息' }}
  148. <view class="time">{{ refundGoodReviewTime ? refundGoodReviewTime : refundReviewTime }}</view>
  149. </view>
  150. </view>
  151. <view :class="'li2 ' + (refundState == 36 && isRefund == 2 && refundMethod == 2 ? '' : 'glay')" v-if="refundState == 36 && isRefund == 2 && refundMethod == 2">
  152. <image
  153. :src="refundState == 36 && isRefund == 2 && refundMethod == 2 ? '/mine/static/mine/images/gou_hong.png' : '/mine/static/mine/images/list_no.png'"
  154. ></image>
  155. <view>
  156. 您提交的退款申请审核完成,请您把商品送回门店
  157. <view class="time">{{ refundGoodReviewTime }}</view>
  158. </view>
  159. </view>
  160. <view :class="'li2 ' + (refundState == 32 ? '' : 'glay')" v-if="refundState == 32">
  161. <image :src="refundState == 32 ? '/mine/static/mine/images/gou_hong.png' : '/mine/static/mine/images/list_no.png'"></image>
  162. <view>
  163. 您提交的退款申请,审核失败
  164. <view class="time">{{ refundOverTime }}</view>
  165. </view>
  166. </view>
  167. <!-- ||refundState==40&&refundType==1 -->
  168. <view :class="'li2 ' + (refundState == 30 ? '' : 'glay')" v-if="refundState >= 30 || refundState >= 40">
  169. <!-- ||refundState==40&&refundType==1 -->
  170. <image :src="refundState == 30 ? '/mine/static/mine/images/gou_hong.png' : '/mine/static/mine/images/list_no.png'"></image>
  171. <view>
  172. 您已提交退款申请,等待审核中
  173. <view class="time">{{ createDate }}</view>
  174. </view>
  175. </view>
  176. </view>
  177. <view class="list3" v-if="listRefundProduct && listRefundProduct.length > 0">
  178. <view class="shouhou txt99">退款产品</view>
  179. <block v-for="(item, idx) in listRefundProduct" :key="idx">
  180. <view class="li">
  181. <view class="info dflex flex">
  182. <view class="cimgs" :data-id="item.productId">
  183. <image :src="item.pic + '?x-oss-process=style/w160'" class="cimg"></image>
  184. <image src="/static/pages/images/jishida.png" class="type" v-if="item.isJs"></image>
  185. <!-- <view class="gys" wx:if="{{item.store<=0||item.isInvalid}}">{{item.store<=0?'已售罄':item.isInvalid?'已下架':''}}</view> -->
  186. </view>
  187. <view class="zhinfo">
  188. <view :class="'zhtit ' + (item.store <= 0 || item.isInvalid ? 'color999' : '')" :data-id="item.productId">{{ item.productName }}</view>
  189. <view v-if="item.specs && item.specs != 'DEFAULT_SKU'" class="guigecontent">
  190. 规格:
  191. <text v-for="(itemGuige, index2) in JSON.parse(item.specs)" :key="index2" class="guige" decode="true">{{ itemGuige.value }}&nbsp;</text>
  192. </view>
  193. <view class="jiage">
  194. <view class="zhjia" :data-id="item.productId" v-if="!integralshop">
  195. <text>¥</text>
  196. {{ item.payMoney }}
  197. </view>
  198. <view class="integral" v-if="integralshop">
  199. <text class="intnum">{{ item.integral }}积分</text>
  200. <text class="money">+¥{{ item.payMoney }}</text>
  201. </view>
  202. <view class="">x{{ item.refundStock }}</view>
  203. </view>
  204. <!-- <view class="tabe dflex"><text>购买数量:{{item.quantity}}</text>
  205. <text v-if="item.refundStock">已退数量:{{item.refundStock}}</text>
  206. </view> -->
  207. </view>
  208. </view>
  209. </view>
  210. </block>
  211. </view>
  212. <!-- 退款信息 -->
  213. <view class="list">
  214. <view class="li">
  215. <image src="/mine/static/mine/images/list.png"></image>
  216. 退款信息
  217. </view>
  218. <view class="li1">
  219. <text class="txt99">申请时间</text>
  220. <text>{{ createDate }}</text>
  221. </view>
  222. <view class="li1" v-if="listRefundProduct.length < 1">
  223. <text class="txt99">退款产品</text>
  224. <view class="t">
  225. <text class="yc">{{ proInfo[0] }}</text>
  226. <view class="dflex txt99">
  227. x
  228. <text class="red">{{ number ? number : '0' }}</text>
  229. </view>
  230. </view>
  231. </view>
  232. <view class="li1 li-spe">
  233. <text class="txt99">退款金额</text>
  234. <view class="view-spe">
  235. <view>
  236. <text class="money" v-if="isRefund == 3">退差</text>
  237. <text class="money">¥</text>
  238. <text class="size">{{ refundMoney ? refundMoney : '0' }}</text>
  239. </view>
  240. <view class="baohan" v-if="refundExpressFee">
  241. 订单金额¥{{ refundPayMoney ? refundPayMoney : 0 }}元 + 邮费¥{{ refundExpressFee ? refundExpressFee : 0 }}元
  242. </view>
  243. </view>
  244. </view>
  245. <view class="li1" v-if="integral > 0">
  246. <text class="txt99">退回积分</text>
  247. <text>
  248. <text class="money"></text>
  249. <text class="size">{{ integral ? integral : '0' }}</text>
  250. </text>
  251. </view>
  252. <view class="li1">
  253. <text class="txt99">退货原因</text>
  254. <text>{{ refundReason ? refundReason : '' }}</text>
  255. </view>
  256. <view class="li1" v-if="refundState == 32">
  257. <text class="txt99">失败原因</text>
  258. <text>{{ refundFalseRes }}</text>
  259. </view>
  260. <!-- 上传凭证 -->
  261. <block v-if="avatar && avatar.length > 0">
  262. <view class="li1"><view class="txt99">凭证</view></view>
  263. <view class="dflex">
  264. <view v-for="(item, index) in avatar" :key="index" class="pz">
  265. <image :src="avatar[index]" class="scpz" @tap="previewImg" :data-index="index" :data-list="avatar"></image>
  266. </view>
  267. </view>
  268. </block>
  269. </view>
  270. <!-- 寄回信息 -->
  271. <view class="list" v-if="expressNo">
  272. <view class="li" @click="jumpUrl()">
  273. <image src="/mine/static/mine/images/list.png"></image>
  274. <view class="flex">寄回信息</view>
  275. <text class="ck">查看快递</text>
  276. <image src="../../../static/pages/images/more.png" class="rico"></image>
  277. </view>
  278. <view class="li1">
  279. <text class="txt99">寄回时间</text>
  280. <view class="t">{{ expressTime }}</view>
  281. </view>
  282. <view class="li1">
  283. <text class="txt99">快递公司</text>
  284. <view class="t">{{ express }}</view>
  285. </view>
  286. <view class="li1">
  287. <text class="txt99">快递单号</text>
  288. <view class="t">{{ expressNo }}</view>
  289. </view>
  290. </view>
  291. <view class="rebtns dflex">
  292. <view class="pdlr40 flex" v-if="isRefund == 2 && refundState == 35 && refundMethod == 1"><view class=" bgline btn1" @tap="goExpress">填写物流信息</view></view>
  293. <view class="pdlr40 flex" v-if="isRefund == 2 && refundState == 35 && refundMethod == null">
  294. <view class=" bgline btn1" @tap="gorefundmode">选择退货方式</view>
  295. </view>
  296. <view class="pdlr40 flex" v-if="refundState != 32 && refundState < 42"><view class="btn" @click="cancelOrderRefund">取消售后申请</view></view>
  297. </view>
  298. </block>
  299. </view>
  300. </template>
  301. <script>
  302. // mine/refundGoods/refundGoods.js
  303. const app = getApp();
  304. const req = require('../../../utils/request.js');
  305. export default {
  306. data() {
  307. return {
  308. isShow: false,
  309. reason: [],
  310. avatar: [],
  311. id: '',
  312. isRefund: '',
  313. refundReason: '',
  314. address: ''
  315. };
  316. },
  317. components: {},
  318. props: {},
  319. /**
  320. * 生命周期函数--监听页面加载
  321. */
  322. onLoad: function(options) {
  323. this.setData({
  324. id: options.id,
  325. isRefund: options.isrefund
  326. });
  327. console.log(options);
  328. },
  329. /**
  330. * 生命周期函数--监听页面显示
  331. */
  332. onShow: function() {
  333. this.getrefundDet();
  334. },
  335. methods: {
  336. previewImg: function(e) {
  337. //预览评论买家秀
  338. var index = e.currentTarget.dataset.index;
  339. let list = e.currentTarget.dataset.list;
  340. uni.previewImage({
  341. current: index,
  342. // 当前显示图片的http链接
  343. urls: list
  344. });
  345. },
  346. //取消售后
  347. cancelOrderRefund() {
  348. var tha = this;
  349. uni.showModal({
  350. title: '提示',
  351. content: '您确定要取消售后申请吗?',
  352. confirmText: '确定',
  353. success(res) {
  354. if (res.confirm) {
  355. req.getRequest(
  356. '/api/orderRefund/cancel',
  357. {
  358. refundId: tha.id
  359. },
  360. data => {
  361. req.msg('售后申请取消成功');
  362. setTimeout(function() {
  363. uni.navigateBack();
  364. }, 2000);
  365. }
  366. );
  367. }
  368. }
  369. });
  370. },
  371. getrefundDet() {
  372. // console.log(this.id);
  373. req.getRequest(
  374. '/api/orderRefund/detail',
  375. {
  376. id: this.id
  377. },
  378. data => {
  379. let res = data;
  380. if (data.imgUrl) {
  381. this.avatar = data.imgUrl.split(',');
  382. }
  383. req.getRequest('/api/orderRefund/refundReason', '', data => {
  384. // console.log(res.refundType); // data.forEach(res=>{console.log(res)})
  385. // if(res.refundType==1){
  386. let arr = data.refund.concat(data.reason);
  387. arr.forEach(it => {
  388. // console.log(it.value, res.refundReason);
  389. if (it.value == res.refundReason) {
  390. // res.refundReason=it.label
  391. this.setData({
  392. refundReason: it.label
  393. });
  394. }
  395. }); // }
  396. // if(res.refundType==2){
  397. // data.reason.forEach(it=>{
  398. // console.log(res.refundReason)
  399. // if(it.value==res.refundReason){
  400. // this.setData({refundReason:it.label})
  401. // }
  402. // })
  403. // }
  404. }); // if(data.refundReason==1){
  405. // data.refundReason='发货不及时'
  406. // }
  407. // if(data.refundReason==2){
  408. // data.refundReason='收到商品破损'
  409. // }
  410. // if(data.refundReason==3){
  411. // data.refundReason='商品错发、漏发'
  412. // }
  413. // if(data.refundReason==4){
  414. // data.refundReason='收到商品与描述不符'
  415. // }
  416. // if(data.refundReason==5){
  417. // data.refundReason='商品质量问题'
  418. // }
  419. // if(data.refundReason==6){
  420. // data.refundReason='未按约定时间发货'
  421. // }
  422. data.proInfo = data.proInfo.replace('件', '').split(',');
  423. if (data.refundState >= 42 || data.refundState == 32) {
  424. this.setData({
  425. isShow: true
  426. });
  427. }
  428. if (res.refundState >= 35 && this.isRefund == 2) {
  429. this.getAddress(res.id);
  430. }
  431. this.setData(res);
  432. }
  433. );
  434. },
  435. getAddress(id) {
  436. req.getRequest('/api/supplierDeliver/supplierReturnAddress', { returnId: id }, res => {
  437. if (res && res.length > 0) {
  438. this.address = res[0];
  439. }
  440. });
  441. },
  442. // 跳转物流
  443. goExpress() {
  444. uni.navigateTo({
  445. url: '/mine/refund/express/express?id=' + this.id + '&isrefund=' + this.isRefund
  446. });
  447. },
  448. // 选择退货方式
  449. gorefundmode() {
  450. uni.navigateTo({
  451. url: '/mine/refund/applyRefund/applyRefund?id=' + this.id + '&isrefund=' + this.isRefund + '&refundMethod=' + 5
  452. });
  453. },
  454. copy() {
  455. let content = this.address.address + ' ' + this.address.contactName + ' ' + this.address.contactPhone;
  456. uni.setClipboardData({
  457. data: content,
  458. success() {
  459. req.msg('复制退货信息成功');
  460. }
  461. });
  462. },
  463. //返回上一页
  464. goblack() {
  465. uni.navigateBack();
  466. },
  467. jumpUrl() {
  468. uni.navigateTo({
  469. url: '/mine/logistics/logistics?id=' + this.deliverId + '&orderId=' + this.orderId + '&type=' + 1
  470. });
  471. }
  472. }
  473. };
  474. </script>
  475. <style>
  476. @import './refundDetails.css';
  477. </style>