lineDetails.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="column hb bgf">
  3. <view class="column align-center pt50 mlr50 pb40" style="border-bottom: 2rpx solid #f5f5f5;">
  4. <view class="base-success fs52 bold">
  5. <text>+</text>
  6. <text>{{countDeatil.payMoney?countDeatil.payMoney.toFixed(2):'0.00'}}</text>
  7. </view>
  8. <view class="mt8 base-color-3" v-if="countDeatil.remark">备注:{{countDeatil.remark}}</view>
  9. </view>
  10. <view class="m40 fs24">
  11. <view class="justify-start align-center ptb4">
  12. <text style="width: 20%;" class="base-color-6">付款时间</text>
  13. <text>{{countDeatil.payTime}}</text>
  14. </view>
  15. <view class="justify-start align-center ptb4">
  16. <text style="width: 20%;" class="base-color-6">付款单号</text>
  17. <text>{{countDeatil.payCode}}</text>
  18. </view>
  19. <view class="justify-start align-center ptb4">
  20. <text style="width: 20%;" class="base-color-6">商户单号</text>
  21. <text>{{countDeatil.tradeNo}}</text>
  22. </view>
  23. </view>
  24. <view class="ptb40 fs24 mlr40" style="border-top: 2rpx solid #f5f5f5;border-bottom: 2rpx solid #f5f5f5;"
  25. v-if="countDeatil.refundAuditStatus!==null">
  26. <view class="justify-start align-center ptb4">
  27. <text style="width: 20%;" class="base-color-6">退款记录</text>
  28. <view>
  29. <view class="base-color-red mb8" v-if="countDeatil.refundAuditStatus==2">
  30. 已退款¥{{countDeatil.refundMoney?countDeatil.refundMoney.toFixed(2):'0.00'}}</view>
  31. <view class="orangecol" v-if="countDeatil.refundAuditStatus==1">
  32. 退款中¥{{countDeatil.refundMoney?countDeatil.refundMoney.toFixed(2):'0.00'}}</view>
  33. <view class="orangecol" v-if="countDeatil.refundAuditStatus==0">
  34. 待退款¥{{countDeatil.refundMoney?countDeatil.refundMoney.toFixed(2):'0.00'}}</view>
  35. <text>{{countDeatil.refundTime}}</text>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="justify-start align-center p20 box mt20">
  40. <view class="fs28 mr20" v-if="countDeatil.refundAuditStatus">当前状态</view>
  41. <view class="refund" @click="showRefund=true" v-if="countDeatil.refundAuditStatus==null">退款</view>
  42. <view class="review" @click="showReview=true" v-if="countDeatil.refundAuditStatus==0">退款审核</view>
  43. <view class="refunding" v-if="countDeatil.refundAuditStatus==1">退款中</view>
  44. <view class="refuned" v-if="countDeatil.refundAuditStatus==2">已退款</view>
  45. </view>
  46. <view>
  47. <u-modal :show="showRefund" :title="title" :content='content'
  48. :showCancelButton="true" @cancel='showRefund=false' @confirm='toRefund'></u-modal>
  49. </view>
  50. <view>
  51. <u-modal :show="showReview" :title="titleReview" :content='contentReview'
  52. :showCancelButton='true' @cancel='showReview=false' @confirm='toReview'></u-modal>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import {getPaymentDetail,toReviewRefund,refundStorePayment} from '@/api/payment'
  58. export default {
  59. data() {
  60. return {
  61. paymentId:null,
  62. showRefund:false,
  63. showReview:false,
  64. title:'退款',
  65. content:'确认退款金额并退款!',
  66. titleReview:'审核',
  67. contentReview:'确认退款金额并同意当前订单退款!',
  68. countDeatil:[]
  69. }
  70. },
  71. onLoad(option) {
  72. this.paymentId=option.paymentId
  73. this.getPaymentDetails()
  74. console.log(this.paymentId)
  75. },
  76. methods: {
  77. toReview(){
  78. const data={
  79. paymentId:this.paymentId
  80. }
  81. toReviewRefund(data).then(res=>{
  82. if(res.code==200){
  83. uni.showToast({
  84. icon:'none',
  85. title: '操作成功!',
  86. });
  87. this.showReview=false
  88. this.getPaymentDetails()
  89. }else{
  90. uni.showToast({
  91. icon:'none',
  92. title: res.msg,
  93. });
  94. }
  95. })
  96. },
  97. toRefund(){
  98. const data={
  99. paymentId:this.paymentId,
  100. refundMoney:this.countDeatil.payMoney
  101. }
  102. refundStorePayment(data).then(res=>{
  103. if(res.code==200){
  104. uni.showToast({
  105. icon:'none',
  106. title: '操作成功!',
  107. });
  108. this.showRefund=false
  109. this.getPaymentDetails()
  110. }else{
  111. uni.showToast({
  112. icon:'none',
  113. title: res.msg,
  114. });
  115. }
  116. })
  117. },
  118. getPaymentDetails(){
  119. getPaymentDetail({paymentId:this.paymentId}).then(res=>{
  120. console.log(res)
  121. if(res.code==200){
  122. console.log(res)
  123. this.countDeatil=res.data
  124. }else{
  125. uni.showToast({
  126. icon:'none',
  127. title: res.msg,
  128. });
  129. }
  130. })
  131. }
  132. }
  133. }
  134. </script>
  135. <style scoped lang="scss">
  136. .box{
  137. view{
  138. padding: 10rpx 28rpx;
  139. border-radius: 40rpx;
  140. font-size: 28rpx;
  141. }
  142. }
  143. .review{
  144. background-color: #ff8b06;
  145. color: #fff;
  146. }
  147. .refund{
  148. background-color: #ff1201;
  149. color: #fff;
  150. }
  151. .refunding{
  152. color: #ff8b06;
  153. }
  154. .refuned{
  155. color: #ff1201;
  156. }
  157. .orangecol{
  158. color: #ffa006;
  159. }
  160. </style>