wdhd.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <template>
  2. <view class="">
  3. <view class="zxkjyr" style="padding: 0 42rpx;padding-top: 12rpx;">
  4. <view :class="['zxkjyra',Inv==0?'zxkjyrff':'']" @click="Inv=0">
  5. <text>进行中</text>
  6. <view class="zxkjxh"></view>
  7. </view>
  8. <view :class="['zxkjyra',Inv==1?'zxkjyrff':'']" @click="Inv=1">
  9. <text>未开始</text>
  10. <view class="zxkjxh"></view>
  11. </view>
  12. <view :class="['zxkjyra',Inv==2?'zxkjyrff':'']" @click="Inv=2">
  13. <text>已结束</text>
  14. <view class="zxkjxh"></view>
  15. </view>
  16. </view>
  17. <view style="margin-top: 30rpx;">
  18. <view class="fsxto sclixmy" v-for="(item,index) in list" :key="index">
  19. <view class="fzctob">
  20. <view class="sckjert" style="overflow: hidden;">
  21. <image style="width: 100%; height: 100%;" :src="item.good_data.img" mode="aspectFill"></image>
  22. </view>
  23. <view class="fsxto" style="width: 100%;margin-left: 24rpx;">
  24. <view class="cphrry"><text>{{item.good_data.title}}</text></view>
  25. <view class="cptxtyra"><text>课程讲师</text></view>
  26. <view class="flztoa">
  27. <text class="cpkkry">数量: {{item.people.length}}</text>
  28. <text class="cpkkrya">总价¥{{item.reality_price}}</text>
  29. </view>
  30. </view>
  31. </view>
  32. <view style="border-top: 2rpx dashed #e8e8e8;width: 107%;margin-left: -24rpx;margin-top: 22rpx;"></view>
  33. <view class="flztoa" style="margin-top: 26rpx;">
  34. <view class="hdtyyr">
  35. <text>下单时间:{{item.time1}}</text>
  36. </view>
  37. <view class="hdtyyra" v-show="Inv==0">
  38. <text>进行中</text>
  39. </view>
  40. <view class="fyctoc" v-show="Inv==1" @click="toRefund(item.id,item.reality_price)">
  41. <view class="hdtyyra">
  42. <text>去请假</text>
  43. </view>
  44. <view class="hdtyyra">
  45. <text>去退出</text>
  46. </view>
  47. </view>
  48. <view class="hdtyyra" v-show="Inv==2">
  49. <text>已结束</text>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <style>
  57. page {
  58. background: #FAFAFA;
  59. }
  60. </style>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. Inv: 0,
  66. page:1,
  67. num:20,
  68. type:2,
  69. total:0,
  70. list:[]
  71. }
  72. },
  73. onLoad() {
  74. this.getList()
  75. },
  76. watch:{
  77. Inv(val){
  78. switch(val/1){
  79. case 0:
  80. this.type = 3
  81. break;
  82. case 1:
  83. this.type = 2
  84. break;
  85. case 2:
  86. this.type = 4
  87. break;
  88. }
  89. this.page = 1
  90. this.getList()
  91. }
  92. },
  93. onReachBottom() {
  94. if(this.list.length<this.total){
  95. this.page++
  96. this.getList()
  97. }
  98. },
  99. methods: {
  100. // 获取参加列表
  101. getList(){
  102. this.$post({
  103. data:{
  104. do:'MyGoodOrder',
  105. data:{
  106. page:this.page,
  107. num:this.num,
  108. type:this.type, // 类型:2=未开始3=进行中4=结束
  109. // type:1, // 类型:2=未开始3=进行中4=结束
  110. user_id:uni.getStorageSync('id'),
  111. pw:375,
  112. }
  113. }
  114. }).then(res=>{
  115. this.total = res.data.total
  116. if(res.data.list.length){
  117. this.list = this.page==1?res.data.list:[...this.list,...res.data.list]
  118. }else{
  119. this.list = []
  120. }
  121. }).catch(()=>{
  122. this.list = []
  123. })
  124. },
  125. // 退出 退款
  126. toRefund(order_id,price){
  127. // 订单id 僵尸id 金额
  128. uni.navigateTo({
  129. url:'/pages/user/wdhd-tc?order_id=' + order_id +'&price=' + price
  130. })
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. </style>