activity.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <!-- 我的-活动订单列表 -->
  2. <template>
  3. <view>
  4. <view class="head">
  5. <view @click="change_type" :data-type="0" :class="type=='0'?'focus':''">已报名</view>
  6. <view @click="change_type" :data-type="1" :class="type=='1'?'focus':''">已使用</view>
  7. </view>
  8. <view style="background-color: #F4F4F4;height: 20upx;"></view>
  9. <view class="loading_text" v-if="loading">加载中...</view>
  10. <view v-else>
  11. <view @click="to_detail(item)" v-for="(item, index) in data" class="con box">
  12. <view style="margin-left: 4%;display: flex;align-items: center;">
  13. <view style="">
  14. <view>
  15. {{item.title}}
  16. </view>
  17. <view
  18. style="color: #8D8D8D;font-size: 28upx;margin-top: 20upx;display: flex;align-items: center;">
  19. <image style="width: 27upx;height: 27upx;margin-right: 10upx;"
  20. src="../../static/clock_grey.png"></image>
  21. {{item.begin_datetime.slice(5,10)}}~{{item.finish_datetime.slice(5,10)}}
  22. </view>
  23. </view>
  24. </view>
  25. <view style="margin-right: 4%;text-align: right;">
  26. <view style="color: #FF663D;">{{type==0?'已报名':'已使用'}}</view>
  27. <view style="margin-top: 10upx;color: #666666;">{{item.price}}元</view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="loading_text" v-if="data.length==0&&!loading">暂无数据</view>
  32. </view>
  33. </template>
  34. <script>
  35. import commonData from '../../commonData.js'
  36. import commonFun from '../../commonFun.js'
  37. export default {
  38. data() {
  39. return {
  40. type: 0,
  41. data: [],
  42. loading: true,
  43. }
  44. },
  45. methods: {
  46. to_detail(item) {
  47. uni.navigateTo({
  48. url: '../activity/detail?id=' + item.market_activityid + '&type=1',
  49. })
  50. },
  51. change_type(e) { //切换tab
  52. this.type = e.currentTarget.dataset.type
  53. this.get_data()
  54. },
  55. get_data() {
  56. if (this.isTrader2 == 1 || this.FOREND_TOKEN == '') {
  57. uni.stopPullDownRefresh()
  58. return
  59. }
  60. this.loading = true
  61. uni.showLoading({
  62. title: '加载中...',
  63. mask: true
  64. })
  65. let params = {
  66. bizCatalog: 'MActivityEntity',
  67. handleMode: 'fetchallSelf',
  68. pageIndex: 1,
  69. pageSize: 1000,
  70. orderby: 0,
  71. query: {
  72. status: this.type + 2,
  73. }
  74. }
  75. console.log('我的活动订单列表请求参数')
  76. console.log(params)
  77. commonFun.requestUrl('&WsAjaxBiz=Worker&WsAjaxAction=fetchPageData', params, res => {
  78. if (res.status) {
  79. this.data = res.data.Result.pageData
  80. console.log('我的活动获取数据')
  81. console.log(this.data)
  82. }
  83. this.loading = false
  84. uni.hideLoading()
  85. uni.stopPullDownRefresh()
  86. })
  87. },
  88. },
  89. components: {},
  90. onLoad() {
  91. this.get_data()
  92. },
  93. onPullDownRefresh() {
  94. this.get_data();
  95. },
  96. };
  97. </script>
  98. <style>
  99. .box {
  100. border-bottom: 2upx solid #ececec;
  101. display: flex;
  102. justify-content: space-between;
  103. align-items: center;
  104. }
  105. .head view.focus {
  106. border-bottom: 6upx solid #00AB92;
  107. color: #00AB92;
  108. }
  109. .head view {
  110. height: 70upx;
  111. margin-top: 40upx;
  112. width: 150upx;
  113. text-align: center;
  114. }
  115. .head {
  116. display: flex;
  117. justify-content: space-around;
  118. overflow: hidden;
  119. }
  120. .con {
  121. width: 100%;
  122. height: 180upx;
  123. background: #FFFFFF;
  124. }
  125. .wal {
  126. width: 100%;
  127. height: 254upx;
  128. background: linear-gradient(90deg, #0ABACC 0%, #00DC7C 100%);
  129. border-radius: 26upx;
  130. color: #ffffff;
  131. margin-top: 20upx;
  132. overflow: hidden;
  133. }
  134. </style>