refund.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="pages">
  3. <view class="" :style="{height: navHeight+'px' }"></view>
  4. <view class="navbar-box">
  5. <u-navbar title="开具发票" :safeAreaInsetTop="true" @leftClick="leftClick" :titleStyle="{color:'#fff'}" leftIconColor="#fff" bgColor="#EF1818"></u-navbar>
  6. </view>
  7. <view class="page-wrap">
  8. <view class="box base-info">
  9. <view class="title u-flex u-row-between">
  10. <text>申请退款金额</text>
  11. <text>¥ {{realPrice}}</text>
  12. </view>
  13. <view class="con">
  14. (预计3个工作日内退回)
  15. </view>
  16. </view>
  17. <view class="box reason">
  18. <view class="title">退款原因(必填)</view>
  19. <view class="select-reason u-flex u-row-between" @click="reasonshow=true">
  20. <text>{{refundReason||'请选择原因'}}</text>
  21. <u-icon name="arrow-down" color="#E5E5E5" size="36rpx"></u-icon>
  22. </view>
  23. <u-picker :show="reasonshow" :columns="reasonList" @confirm="confirmReason" @cancel="reasonshow=false"></u-picker>
  24. </view>
  25. </view>
  26. <view class="btn-wrap">
  27. <view class="inner">
  28. <view class="btn" @click="submit">确认退款</view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import { systemInfo } from "@/mixin.js";
  35. export default {
  36. mixins: [systemInfo], // 使用mixin
  37. data() {
  38. return {
  39. staticUrl:this.$commonConfig.staticUrl,
  40. orderId:'',
  41. realPrice:'',
  42. refundReason:'',
  43. reasonshow:false,
  44. reasonList:[
  45. [
  46. '选错场次',
  47. '不想看了',
  48. ]
  49. ],
  50. params:{
  51. }
  52. }
  53. },
  54. onShow() {
  55. },
  56. onLoad(page) {
  57. console.log('page',page);
  58. this.orderId = page.id;
  59. this.realPrice = page.realPrice;
  60. this.getSystemInfo();
  61. },
  62. methods: {
  63. leftClick(e){
  64. let pages = getCurrentPages();
  65. if(pages.length==1){
  66. uni.$u.route('/pages/index/index')
  67. }else{
  68. uni.navigateBack()
  69. };
  70. },
  71. confirmReason(e){
  72. console.log('confirmReason',e.value[0]);
  73. this.refundReason = e.value[0];
  74. this.reasonshow = false;
  75. },
  76. submit(){
  77. if(!this.refundReason){
  78. uni.$u.toast('请选择原因')
  79. return
  80. }
  81. let params = {
  82. orderId:this.orderId,
  83. refundReason:this.refundReason
  84. }
  85. this.$u.api.refundSubmit(params).then(res=>{
  86. uni.$u.toast(res.msg)
  87. uni.navigateBack()
  88. console.log('res',res.data);
  89. }).catch(err=>{
  90. console.log('refundSubmit',err);
  91. })
  92. }
  93. }
  94. }
  95. </script>
  96. <style>
  97. page{background-color: #F7F7F9;}
  98. </style>
  99. <style lang="scss" scoped>
  100. .page-wrap{
  101. padding: 32rpx 16rpx;
  102. }
  103. .box{
  104. margin-bottom: 24rpx;
  105. background: #FFFFFF;
  106. box-shadow: 0rpx 0rpx 20rpx 2rpx rgba(221,221,221,0.5);
  107. border-radius: 20rpx;
  108. padding: 36rpx 24rpx;
  109. .title{
  110. font-size: 28rpx;
  111. font-weight: 500;
  112. color: #2D2D2D;
  113. margin-bottom: 38rpx;
  114. }
  115. }
  116. .base-info{
  117. .con{
  118. font-size: 24rpx;
  119. font-weight: 400;
  120. color: #7F7F7F;
  121. text-align: right;
  122. }
  123. }
  124. .reason{
  125. .select-reason{
  126. height: 64rpx;
  127. line-height: 64rpx;
  128. border-radius: 8rpx;
  129. border: 2rpx solid #E5E5E5;
  130. padding: 0 24rpx;
  131. font-size: 24rpx;
  132. font-weight: 400;
  133. color: #363636;
  134. }
  135. }
  136. .btn-wrap{
  137. height: 92rpx;
  138. .inner{
  139. position: fixed;
  140. left: 0;
  141. right: 0;
  142. bottom: 66rpx;
  143. }
  144. .btn{
  145. height: 92rpx;
  146. line-height: 92rpx;
  147. width:80%;
  148. margin: 0 auto;
  149. background: linear-gradient(90deg, #FF7878 0%, #ED0000 100%);
  150. border-radius: 46rpx;
  151. font-size: 28rpx;
  152. font-weight: 400;
  153. color: #FFFFFF;
  154. text-align: center;
  155. }
  156. }
  157. </style>