appoint.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <view>
  3. <scroll-list ref="list" :option="option" @load="load" @refresh="refresh" @loadSuccess="loadSuccess"
  4. @scrolltolower="scrolltolower">
  5. <view style="text-align: center;border: 1rpx solid #cecece;color: #9c9c9c;">
  6. <uni-row>
  7. <uni-col :span="20">
  8. <uni-row>
  9. <uni-col :span="16">活动名</uni-col>
  10. <uni-col :span="8">活动类型</uni-col>
  11. </uni-row>
  12. </uni-col>
  13. <uni-col :span="4">
  14. 操作
  15. </uni-col>
  16. </uni-row>
  17. </view>
  18. <view v-for="(item, index) in list" :key="index">
  19. <view
  20. style="text-align: center;border: 1rpx solid #cecece;color: #747474;padding: 20rpx 0;font-size: 50rpx;">
  21. <uni-row>
  22. <uni-col :span="20">
  23. <view @click="handleTest(item)">
  24. <uni-row>
  25. <uni-col :span="16">{{item.eventName}}</uni-col>
  26. <uni-col :span="8">{{item.eventType}}</uni-col>
  27. </uni-row>
  28. <view
  29. style="font-size: 20rpx;color: #a2a2a2;text-align: left;padding: 15rpx 0 0 25rpx;">
  30. 预约时间:{{item.createTime}}
  31. </view>
  32. </view>
  33. </uni-col>
  34. <uni-col :span="4">
  35. <view class="yyButton" style="margin:20rpx 5rpx 0;border: 1rpx solid rgb(10, 185, 156);
  36. color: rgb(10, 185, 156);font-size: 22rpx; padding: 5rpx;
  37. border-radius: 10rpx;" @click="back(item)">
  38. 取消预约
  39. </view>
  40. </uni-col>
  41. </uni-row>
  42. </view>
  43. </view>
  44. </scroll-list>
  45. </view>
  46. </template>
  47. <style lang="scss" scoped>
  48. .page-wrap {}
  49. .yyButton:active {
  50. background-color: #dedede;
  51. }
  52. .infoBody {
  53. background-color: #ffffff;
  54. padding: 20rpx 0;
  55. font-size: 30px;
  56. margin: 2rpx;
  57. box-shadow: 0px 2px 5px #e5e5e5;
  58. }
  59. </style>
  60. <script>
  61. export default {
  62. data() {
  63. return {
  64. option: {
  65. page: 1,
  66. size: 5,
  67. auto: true
  68. },
  69. page: 1,
  70. list: [],
  71. scrollList: [],
  72. total: 0
  73. }
  74. },
  75. onLoad() {
  76. },
  77. onShow() {
  78. this.$refs.list.refresh()
  79. },
  80. methods: {
  81. async back(item) {
  82. const {
  83. data: res
  84. } = await this.$httpRequest({
  85. url: '/app/backEventOrder?id=' + item.id,
  86. method: 'get',
  87. urlType: this.$getUrlType()
  88. });
  89. if (res.code === 200) {
  90. this.taskList({
  91. page: 1,
  92. size: 5
  93. })
  94. this.$showModal("取消成功")
  95. } else {
  96. this.$showModal(res.msg)
  97. }
  98. },
  99. handleTest(item) {
  100. setTimeout(() => {
  101. this.list = []
  102. }, 1000)
  103. uni.setStorageSync("eventId", item.eventId)
  104. uni.setStorageSync("isUpload", 1)
  105. uni.navigateTo({
  106. url: "more"
  107. })
  108. },
  109. async taskList(paging) {
  110. // 发送请求
  111. const {
  112. data: res
  113. } = await this.$httpRequest({
  114. url: '/app/eventOrders?pageNum=' + paging.page + '&pageSize=' + paging.size,
  115. method: 'get',
  116. urlType: this.$getUrlType()
  117. });
  118. if (res.code === 200) {
  119. if (paging.page === 1) {
  120. this.scrollList = res.rows
  121. this.total = res.total
  122. this.$refs.list.loadSuccess({
  123. list: res.rows,
  124. total: this.total
  125. });
  126. } else if (paging.page > 1) {
  127. for (var i = 0; i < res.rows.length; i++) {
  128. this.scrollList.push(res.rows[i])
  129. }
  130. this.$refs.list.loadSuccess({
  131. list: this.scrollList,
  132. total: this.total
  133. });
  134. }
  135. }
  136. },
  137. // 刷新刷剧
  138. refresh(paging) {
  139. this.taskList(paging)
  140. },
  141. scrolltolower(e) {
  142. console.log(e)
  143. },
  144. load(paging) {
  145. this.taskList(paging)
  146. },
  147. loadSuccess(list) {
  148. this.list = list
  149. }
  150. }
  151. }
  152. </script>