refundDetail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. <template>
  2. <view class="refundDetail">
  3. <view class="content progress">
  4. <view class="progress-title">
  5. {{info.goodsList[0].goodsState == 'REFUNDED'?'退款成功':'退款中'}}
  6. </view>
  7. <view class="progress-desc">
  8. {{info.goodsList[0].refundLog.refundAmount?'如您未查询到退款,请拨打10086咨询客服':' 请耐心等待,正在为您处理退款'}}
  9. </view>
  10. <u-steps dot current="0" activeColor="#FF4D3A" direction="column">
  11. <u-steps-item v-for="(item,index) in stepList" :key="index" :title="item.desc" :desc="$u.timeFormat(info.goodsList[0].refundLog[item.time], 'yyyy-mm-dd hh:MM:ss')">
  12. </u-steps-item>
  13. </u-steps>
  14. </view>
  15. <!-- <view class="content shop-box">
  16. <view class="shop-name">
  17. {{info.shopInfo.shopName}}
  18. </view>
  19. <view class="address">
  20. {{info.shopInfo.address}}
  21. </view>
  22. </view> -->
  23. <view class="content info">
  24. <view class="order-info">
  25. <image class="icon" :src="info.goodsList[0].goodsInfo.activityCover" mode=""></image>
  26. <view class="shop-info">
  27. <view class="title">
  28. {{info.goodsList[0].goodsInfo.activityName}}
  29. </view>
  30. <view class="goods-desc">
  31. 活动时间:{{info.goodsList[0].goodsInfo.activityStartTime.replace('T','')}} 至 {{info.goodsList[0].goodsInfo.activityEndTime.replace('T','')}}
  32. </view>
  33. <view class="num-box">
  34. <view class="label">
  35. 报名人数
  36. </view>
  37. <view class="label">
  38. {{info.goodsList.length}}
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="content">
  45. <view class="title">
  46. 商品总价
  47. </view>
  48. <view class="item">
  49. <view class="label">
  50. 商品金额
  51. </view>
  52. <view class="value black">
  53. ¥{{info.goodsList[0].goodsInfo.price}}
  54. </view>
  55. </view>
  56. <view class="item" >
  57. <view class="label">
  58. 优惠券
  59. </view>
  60. <view class="value red">
  61. -¥{{info.discountAmount}}
  62. </view>
  63. </view>
  64. <view class="item">
  65. <view class="label">
  66. 合计
  67. </view>
  68. <view class="value">
  69. <text class="red fs28">¥{{info.payAmount}}</text>
  70. </view>
  71. </view>
  72. <view class="item">
  73. <view class="label">
  74. 退款金额
  75. </view>
  76. <view class="value">
  77. <text class="red fs28">¥{{info.goodsList[0].refundLog.refundAmount||info.payAmount}}</text>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="content refund-box">
  82. <view class="title">
  83. 退款原因
  84. </view>
  85. <view class="refund-msg">
  86. {{info.goodsList[0].refundLog.remark}}
  87. </view>
  88. </view>
  89. <!-- <button type="default" :loading="btnLoading" v-if="!info.payment.transferAll" class="pay-btn" @click="cancelReply" >取消退款</button> -->
  90. <button type="default" :loading="btnLoading" class="pay-btn" v-if="info.orderType == 'WAIT_PAYMENT'" @click="pay" >立即支付</button>
  91. <view class="content apply-box" v-else-if="info.orderType == 'WAIT_USE'||info.orderType == 'USED'||info.orderType == 'CLOSE'" @click="apply">
  92. <view class="label">
  93. 退款申请
  94. </view>
  95. <view class="value">
  96. 如引发商品争议,可申请平台介入处理
  97. </view>
  98. <image class="jiantou" src="../../static/jiantou-icon.png" mode=""></image>
  99. </view>
  100. </view>
  101. </template>
  102. <script>
  103. import {qrCode} from '@/api/order.js'
  104. import {payDetails,queryPayOrder,unRefund} from '@/api/payment.js'
  105. export default {
  106. data() {
  107. return {
  108. codeData:'123',
  109. loading:false,
  110. btnLoading:false,
  111. oldBright:0,
  112. info:{
  113. goodsList:[]
  114. },
  115. stepList:[
  116. {
  117. desc:'平台受理中',
  118. time:'createTime'
  119. },
  120. {
  121. desc:'提交申请',
  122. time:'createTime'
  123. },
  124. ]
  125. }
  126. },
  127. filters: {
  128. filterType: function(val) {
  129. if(val == 'APPLY_REFUND'){
  130. return '退款审核中'
  131. }else if(val == 'CLOSE'){
  132. return '关闭订单'
  133. }else if(val == 'REFUNDED'){
  134. return '已退款'
  135. }else if(val == 'REFUSAL_REFUND'){
  136. return '拒绝退款'
  137. }else if(val == 'USED'){
  138. return '订单已完成'
  139. }else if(val == 'WAIT_PAYMENT'){
  140. return '待付款'
  141. }else if(val == 'WAIT_USE'){
  142. return '待使用'
  143. }
  144. },
  145. filterPay(val){
  146. if(val == 'wx.unifiedOrder'){
  147. return '微信支付'
  148. }else if(val == 'trade.create'){
  149. return '支付宝支付'
  150. }else if(val == 'uac.miniOrder'){
  151. return '云闪付支付'
  152. }else{
  153. return '-'
  154. }
  155. }
  156. },
  157. methods: {
  158. apply(){
  159. let that = this
  160. uni.navigateTo({
  161. url:'./refund',
  162. success: function(res) {
  163. // 通过eventChannel向被打开页面传送数据
  164. res.eventChannel.emit('orderInfo', that.info)
  165. }
  166. })
  167. },
  168. // 获取订单详情
  169. payDetails(orderNo){
  170. payDetails(orderNo).then(res=>{
  171. this.info = res.content
  172. console.log(this.info);
  173. if(this.info.goodsList[0].goodsState == 'REFUNDED'&&this.info.goodsList[0].refundLog.conclusionTime){
  174. this.stepList.unshift({
  175. desc:'审核通过,到账时间以实际到账为准',
  176. time:'conclusionTime'
  177. })
  178. }
  179. })
  180. },
  181. // 支付
  182. pay(){
  183. if (this.btnLoading) return
  184. this.btnLoading = true
  185. uni.showLoading({
  186. title: '支付中'
  187. })
  188. let that = this
  189. let miniPayRequest = JSON.parse(this.info.miniPayRequest)
  190. uni.requestPayment({
  191. "provider": "wxpay",
  192. "orderInfo": miniPayRequest,
  193. "appid": miniPayRequest.appId, // 微信开放平台 - 应用 - AppId,注意和微信小程序、公众号 AppId 可能不一致
  194. "paySign": miniPayRequest.paySign,
  195. "nonceStr": miniPayRequest.nonceStr, // 随机字符串
  196. "package": miniPayRequest.package, // 固定值
  197. // "prepayid": miniPayRequest.package, // 统一下单订单号
  198. "timeStamp": miniPayRequest.timeStamp, // 时间戳(单位:秒)
  199. "signType": miniPayRequest.signType, //签名算法
  200. success(msg) {
  201. console.log('msg', msg);
  202. queryPayOrder(that.info.orderNo).then(res1 => {
  203. if (res1.state == 'Success') {
  204. uni.hideLoading()
  205. uni.showToast({
  206. title: '支付成功',
  207. icon: 'success'
  208. })
  209. that.btnLoading = false
  210. that.payDetails(that.info.orderNo)
  211. }
  212. })
  213. },
  214. fail(e) {
  215. that.btnLoading = false
  216. uni.hideLoading()
  217. uni.showToast({
  218. title: '取消支付',
  219. icon: 'fail'
  220. })
  221. // 取消支付后,获取支付信息以备再次支付
  222. that.payDetails(that.info.orderNo)
  223. console.log('err', e,this);
  224. }
  225. })
  226. },
  227. // 取消退款申请
  228. cancelReply(){
  229. if (this.btnLoading) return
  230. this.btnLoading = true
  231. uni.showLoading({
  232. title: '取消中'
  233. })
  234. unRefund({id:this.info.goodsList[0].id}).then(res=>{
  235. this.btnLoading = false
  236. uni.hideLoading()
  237. if (res.state == 'Success') {
  238. this.payDetails(this.info.orderNo)
  239. uni.showToast({
  240. title:'取消成功',
  241. icon:'success'
  242. })
  243. }
  244. })
  245. }
  246. },
  247. onReady() {
  248. },
  249. onLoad(options) {
  250. this.info.orderNo = options.id
  251. },
  252. onShow() {
  253. this.payDetails(this.info.orderNo)
  254. },
  255. created() {
  256. // this.info = JSON.parse(uni.getStorageSync('order'))
  257. }
  258. }
  259. </script>
  260. <style lang="scss">
  261. .refundDetail{
  262. background: #F9F9F9;
  263. min-height: 100vh;
  264. padding-bottom: 100rpx;
  265. .u-steps{
  266. margin-top: 20rpx;
  267. .u-text__value--main,.u-text__value--content,.u-text__value--tips{
  268. font-size: 22rpx!important;
  269. }
  270. }
  271. .progress{
  272. .progress-title{
  273. font-weight: 600;
  274. font-size: 32rpx;
  275. color: #181818;
  276. }
  277. .progress-desc{
  278. font-weight: 300;
  279. font-size: 24rpx;
  280. color: #AAAAAA;
  281. margin-top: 15rpx;
  282. }
  283. }
  284. .shop-box{
  285. width: 690rpx;
  286. // margin: 0 30rpx;
  287. // padding: 24rpx 24rpx 30rpx;
  288. background: #fff;
  289. border-radius: 16rpx;
  290. margin-top: -30rpx;
  291. box-sizing: border-box;
  292. .shop-name{
  293. font-weight: 600;
  294. font-size: 32rpx;
  295. color: #181818;
  296. width: 100%;
  297. white-space: nowrap;
  298. overflow: hidden;
  299. text-overflow: ellipsis;
  300. }
  301. .address{
  302. font-weight: 300;
  303. font-size: 24rpx;
  304. color: #AAAAAA;
  305. margin-top: 20rpx;
  306. width: 100%;
  307. white-space: nowrap;
  308. overflow: hidden;
  309. text-overflow: ellipsis;
  310. }
  311. }
  312. .black{
  313. color: #222222!important;
  314. }
  315. .red{
  316. color: red!important;
  317. }
  318. .fs28{
  319. font-size: 28rpx!important;
  320. font-weight: bold;
  321. }
  322. .input-box{
  323. margin: 20rpx 30rpx;
  324. padding: 28rpx 24rpx;
  325. background: #FFFFFF;
  326. border-radius: 16rpx 16rpx 16rpx 16rpx;
  327. display: flex;
  328. align-items: center;
  329. justify-content: space-between;
  330. .label {
  331. color: #222;
  332. font-size: 28rpx;
  333. }
  334. .value {
  335. font-size: 28rpx;
  336. color: #AAAAAA;
  337. }
  338. }
  339. .content{
  340. margin: 20rpx 30rpx;
  341. padding: 28rpx 24rpx;
  342. border-radius: 16rpx;
  343. background: #fff;
  344. .title{
  345. font-weight: 600;
  346. font-size: 28rpx;
  347. color: #222222;
  348. }
  349. .item{
  350. display: flex;
  351. align-items: center;
  352. justify-content: space-between;
  353. margin-top: 28rpx;
  354. .label{
  355. color: #222222;
  356. font-size: 28rpx;
  357. }
  358. .value{
  359. color: #999999;
  360. font-size: 28rpx;
  361. }
  362. }
  363. }
  364. .pay-btn{
  365. background: $uni-color-primary;
  366. width: 688rpx;
  367. height: 80rpx;
  368. line-height: 80rpx;
  369. border-radius: 46rpx;
  370. color: #fff;
  371. margin-top: 50rpx;
  372. }
  373. .refund-box{
  374. .refund-msg{
  375. font-weight: 300;
  376. font-size: 24rpx;
  377. color: #222222;
  378. margin-top: 15rpx;
  379. line-height: 40rpx;
  380. }
  381. }
  382. .apply-box{
  383. position: relative;
  384. .label{
  385. font-weight: 600;
  386. font-size: 28rpx;
  387. color: #222222;
  388. }
  389. .value{
  390. color: #999999;
  391. font-size: 24rpx;
  392. margin-top: 15rpx;
  393. }
  394. .jiantou{
  395. position: absolute;
  396. top: 50%;
  397. right: 24rpx;
  398. transform: translateY(-50%);
  399. width: 24rpx;
  400. height: 24rpx;
  401. }
  402. }
  403. .info{
  404. .order-info{
  405. display: flex;
  406. .icon{
  407. width: 164rpx;
  408. height: 164rpx;
  409. border-radius: 16rpx;
  410. flex-shrink: 0;
  411. }
  412. .shop-info{
  413. display: flex;
  414. flex-direction: column;
  415. justify-content: space-between;
  416. padding-left: 24rpx;
  417. flex: 1;
  418. box-sizing: border-box;
  419. .title{
  420. color: #181818;
  421. font-size: 28rpx;
  422. width: 450rpx;
  423. white-space: nowrap;
  424. overflow: hidden;
  425. text-overflow: ellipsis;
  426. }
  427. .price-box{
  428. display: flex;
  429. align-items: center;
  430. justify-content: space-between;
  431. .price{
  432. color: #181818;
  433. font-size: 32rpx;
  434. font-weight: bold;
  435. }
  436. }
  437. .goods-desc{
  438. font-size: 24rpx;
  439. color: #AAAAAA;
  440. width: 450rpx;
  441. white-space: nowrap;
  442. overflow: hidden;
  443. text-overflow: ellipsis;
  444. margin-top: 10rpx;
  445. }
  446. .num-box{
  447. display: flex;
  448. align-items: center;
  449. justify-content: space-between;
  450. .label{
  451. font-weight: 300;
  452. font-size: 24rpx;
  453. color: #181818;
  454. }
  455. .num{
  456. font-weight: 400;
  457. font-size: 24rpx;
  458. color: #222222;
  459. }
  460. }
  461. }
  462. }
  463. }
  464. .wrap{
  465. display: flex;
  466. justify-content: center;
  467. align-items: center;
  468. height: 100vh;
  469. overflow: hidden;
  470. }
  471. }
  472. </style>