wdhd-tc.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <view class="ayuu">
  3. <view class="hdtgyyqb">
  4. <view class="flztoa hdtcuur" @click="chooseType">
  5. <view class="fzctob">
  6. <view class="hdtcuutxt"><text>申请退出</text></view>
  7. <view class=""><text>{{type==1?'我要退出退款':'我要请假'}}</text></view>
  8. </view>
  9. <image src="/static/user/hdr1.png" style="width: 48rpx;min-width: 48rpx;height: 48rpx;" mode=""></image>
  10. </view>
  11. <view class="flztoa hdtcuur" @click="chooseliyou">
  12. <view class="fzctob">
  13. <view class="hdtcuutxt"><text>申请原因</text></view>
  14. <view class="hdtcuutxta"><text>{{liyou[curliyou]}}</text></view>
  15. </view>
  16. <image src="/static/user/hdr1.png" style="width: 48rpx;min-width: 48rpx;height: 48rpx;" mode=""></image>
  17. </view>
  18. </view>
  19. <view class="flztoa hdtcjr">
  20. <view class="fsxto">
  21. <view class="hdtcjra"><text>申请金额</text></view>
  22. <view class="hdtcjrb"><text>¥{{price}}</text></view>
  23. </view>
  24. <!-- <view class="hdtcjrc"><text>修改金额</text></view> -->
  25. </view>
  26. <view class="hdtcjr">
  27. <view class="hdtcjra"><text>申请说明</text></view>
  28. <view class="hdtcwenh">
  29. <textarea v-model="content" placeholder-style="color:#999999;font-size: 28rpx;" placeholder="请详细填写申请说明"/>
  30. </view>
  31. </view>
  32. <view class="fzctob hdtcjr">
  33. <view class="hdtcjra" style="width: 160rpx;"><text>联系电话</text></view>
  34. <view class="hdtcjra">
  35. <input type="number" v-model="phone" maxlength="11" placeholder="请输入联系电话">
  36. </view>
  37. </view>
  38. <view class="fzddrew fknbee" >
  39. <view class="fzddrew fkdibr" @click="Refund">
  40. <text>提交申请</text>
  41. </view>
  42. </view>
  43. <!-- 弹窗 -->
  44. <u-popup v-model="show" mode="bottom" :mask-close-able="false" safe-area-inset-bottom border-radius="20" >
  45. <view v-if="picIndex==0">
  46. <view class="t-title">请选择申请类型</view>
  47. <view :class="type==1?'apply-item-act':'apply-item'" @click="type=1">
  48. 我要退出退款
  49. </view>
  50. <view :class="type==2?'apply-item-act':'apply-item'" @click="type=2">
  51. 我要请假
  52. </view>
  53. </view>
  54. <view v-if="picIndex==1">
  55. <view class="t-title">请选择申请原因</view>
  56. <view v-for="(item,index) in liyou" :key="index" @click="curliyou = index" :class="index==curliyou?'apply-item-act':'apply-item'">
  57. {{item}}
  58. </view>
  59. </view>
  60. <view class="fzddrew fkdibr" @click="show=false" style="margin: auto; margin-top: 300rpx;">
  61. <text>确定</text>
  62. </view>
  63. </u-popup>
  64. </view>
  65. </template>
  66. <style>
  67. page {
  68. background: #FAFAFA;
  69. }
  70. </style>
  71. <script>
  72. export default {
  73. data() {
  74. return {
  75. show:false,
  76. type:1, // 退款类型:1=退出退款 2=我要请假
  77. liyou:[],
  78. picIndex:0,
  79. curliyou:0,
  80. order_id:0, // 活动订单id
  81. price:0, // 订单价格
  82. content:'',
  83. phone:''
  84. }
  85. },
  86. onLoad(e) {
  87. this.order_id = e.order_id
  88. this.price = e.price
  89. this.getliyou()
  90. },
  91. methods:{
  92. // 退款类型
  93. chooseType(){
  94. this.picIndex = 0
  95. this.show = true
  96. },
  97. // 退款理由
  98. chooseliyou(){
  99. this.picIndex = 1
  100. this.show = true
  101. },
  102. // 获取理由
  103. getliyou(){
  104. this.$post({
  105. data:{
  106. do:'RefundInfo'
  107. }
  108. }).then(res=>{
  109. console.log(res)
  110. this.liyou = res.data
  111. })
  112. },
  113. // 请假 退出
  114. Refund(){
  115. if(!this.content){
  116. return uni.showToast({
  117. title:'请输入退款说明',
  118. icon:'none'
  119. })
  120. }
  121. if(!this.phone){
  122. return uni.showToast({
  123. title:'请输入联系电话',
  124. icon:'none'
  125. })
  126. }
  127. this.$post({
  128. data:{
  129. do:'Refund',
  130. data:{
  131. order_id:this.order_id,
  132. type:this.type,
  133. reason:this.liyou[this.curliyou],
  134. user_id:uni.getStorageSync('id'),
  135. content:this.content,
  136. phone:this.phone,
  137. price:this.price
  138. }
  139. }
  140. }).then(res=>{
  141. uni.showToast({
  142. title:res.message || '申请成功',
  143. icon:'none'
  144. })
  145. setTimeout(()=>{
  146. uni.navigateBack()
  147. },1500)
  148. })
  149. }
  150. }
  151. }
  152. </script>
  153. <style scoped>
  154. .t-title{
  155. padding: 30rpx 0;
  156. font-size: 28rpx;
  157. color: #373737;
  158. text-align: center;
  159. }
  160. .apply-item{
  161. padding: 20rpx 22rpx;
  162. border-top: 2rpx solid #F4F4F4;
  163. font-size: 28rpx;
  164. color: #333333;
  165. }
  166. .apply-item-act{
  167. padding: 20rpx 22rpx;
  168. border-top: 2rpx solid #F4F4F4;
  169. font-size: 28rpx;
  170. color: #EE3437;
  171. }
  172. .apply-item:last-of-type{
  173. border-bottom: 2rpx solid #F4F4F4;
  174. }
  175. .apply-item-act:last-of-type{
  176. border-bottom: 2rpx solid #F4F4F4;
  177. }
  178. </style>
  179. <style lang="scss" scoped>
  180. </style>