推广小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

185 lines
4.6 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <template>
  2. <view class="cart">
  3. <view class="head-box"></view>
  4. <Navbar title="我的订单" :bgColor="bgColor" leftIconSize="0px" height="100rpx" :titleStyle="{color:fontColor}" />
  5. <view class="content contentPosition_">
  6. <uv-sticky offsetTop="220rpx" :bgColor="bgColor">
  7. <uv-tabs :scrollable="false" @click="tabs" :list="tabList" lineWidth="40"
  8. :lineColor="`url(${lineBg}) 100% 100%`"
  9. :activeStyle="{color: '#FD5C5C', fontWeight: 'bold',transform: 'scale(1.05)'}"
  10. :inactiveStyle="{color: '#999', transform: 'scale(1)'}"
  11. itemStyle="padding-left: 15px; padding-right: 15px; height: 44px;"></uv-tabs>
  12. </uv-sticky>
  13. <cardList :cardListData="cardListData" @btnClick="btnClick" @toOrderDetails="toOrderDetails" />
  14. <uv-load-more :status="status" fontSize="24rpx" dashed line />
  15. </view>
  16. <tabber select="cart" />
  17. </view>
  18. </template>
  19. <script>
  20. import tabber from '@/components/base/tabbar.vue'
  21. import cardList from '@/components/cart/CardList.vue'
  22. import Navbar from '@/pages/components/Navbar.vue'
  23. import {
  24. globalMixin
  25. } from '../mixins/globalMixin';
  26. export default {
  27. mixins: [globalMixin],
  28. components: {
  29. tabber,
  30. cardList,
  31. Navbar
  32. },
  33. data() {
  34. return {
  35. status:"loading",
  36. params: {
  37. state: 0,
  38. pageNo: 1,
  39. pageSize: 10
  40. },
  41. tabList: [{
  42. id: '',
  43. name: '全部'
  44. },
  45. {
  46. id: 0,
  47. name: '未付款'
  48. },
  49. {
  50. id: 1,
  51. name: '待参加'
  52. },
  53. {
  54. id: 2,
  55. name: '已完成'
  56. },
  57. {
  58. id: 3,
  59. name: '已取消'
  60. },
  61. ],
  62. lineBg: require('@/static/image/cart/tabIcon.png'),
  63. // cardListData: [{
  64. // imgUrl: 'https://up.zhuoku.org/22/a4/60/50/fc3bd0b4e656911fccdde4383637c1cd.jpg',
  65. // orderTime: '2024.08.23 12:00',
  66. // state: 'U',
  67. // stateText: '待参加',
  68. // title: '夏日去撒野旅游计划~',
  69. // time: '2024.10.28 10:00',
  70. // address: '成都市东丽湖露营地32号',
  71. // totalPrice: '298.00',
  72. // btnObj: [{
  73. // id: '0',
  74. // btnTitle: '取消活动',
  75. // color: '#AFAFAF',
  76. // bgColor: '#34312E'
  77. // },
  78. // {
  79. // id: '1',
  80. // btnTitle: '活动签到',
  81. // color: '#FF4546',
  82. // bgColor: '#492623'
  83. // }
  84. // ]
  85. // },
  86. // {
  87. // imgUrl: 'https://up.zhuoku.org/22/a4/60/50/fc3bd0b4e656911fccdde4383637c1cd.jpg',
  88. // orderTime: '2024.08.23 12:00',
  89. // state: 'S',
  90. // stateText: '已完成',
  91. // title: '夏日去撒野旅游计划~',
  92. // time: '2024.10.28 10:00',
  93. // address: '成都市东丽湖露营地32号',
  94. // totalPrice: '298.00',
  95. // btnObj: [{
  96. // id: '2',
  97. // btnTitle: '活动评价',
  98. // color: '#FF4546',
  99. // bgColor: '#492623'
  100. // },
  101. // {
  102. // id: '3',
  103. // btnTitle: '开具发票',
  104. // color: '#FFB245',
  105. // bgColor: '#49361D'
  106. // }
  107. // ]
  108. // },
  109. // {
  110. // imgUrl: 'https://up.zhuoku.org/22/a4/60/50/fc3bd0b4e656911fccdde4383637c1cd.jpg',
  111. // orderTime: '2024.08.23 12:00',
  112. // state: 'F',
  113. // stateText: '已完成',
  114. // title: '夏日去撒野旅游计划~',
  115. // time: '2024.10.28 10:00',
  116. // address: '成都市东丽湖露营地32号',
  117. // totalPrice: '298.00',
  118. // btnObj: []
  119. // }
  120. // ]
  121. totalPage: 0,
  122. cardListData: []
  123. }
  124. },
  125. onReachBottom() {
  126. if (this.params.pageNo >= this.totalPage) return
  127. this.params.pageNo++
  128. this.getOrderPageList()
  129. },
  130. onLoad() {
  131. this.getOrderPageList()
  132. },
  133. methods: {
  134. activeList() {
  135. uni.navigateTo({
  136. url: '/pages_my/activeList'
  137. })
  138. },
  139. getOrderPageList() {
  140. this.status = "loading"
  141. this.$api('orderPageList', this.params, res => {
  142. if (res.code == 200) {
  143. this.totalPage = res.result.pages
  144. this.cardListData = [...this.cardListData, ...res.result.records]
  145. if(this.params.pageNo >= this.totalPage) {
  146. this.status = "nomore"
  147. }else {
  148. this.status = "loadmore"
  149. }
  150. }
  151. })
  152. },
  153. tabs(val) {
  154. this.params.state = val.id
  155. this.params.pageNo = 1
  156. this.cardListData = []
  157. this.getOrderPageList()
  158. },
  159. toOrderDetails(val) {
  160. uni.navigateTo({
  161. url: `/pages_order/orderDetails?id=${val.id}`
  162. })
  163. },
  164. btnClick(item,type) {//0取消活动 1活动签到 2评价活动 3开具发票
  165. if (type == 2) {
  166. uni.navigateTo({
  167. url: '/pages_order/orderEvaluation'
  168. })
  169. }
  170. if (type == 3) {
  171. uni.navigateTo({
  172. url: '/pages_order/invoiceIssuance'
  173. })
  174. }
  175. }
  176. }
  177. }
  178. </script>
  179. <style scoped lang="scss">
  180. .content {
  181. padding-bottom: 200rpx;
  182. }
  183. </style>