推广小程序前端代码
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.

153 lines
4.1 KiB

5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 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. <uv-modal ref="modal" align="center" content='是否取消订单?' @confirm="confirm"></uv-modal>
  17. <tabber select="cart" />
  18. </view>
  19. </template>
  20. <script>
  21. import tabber from '@/components/base/tabbar.vue'
  22. import cardList from '@/components/cart/CardList.vue'
  23. import Navbar from '@/pages/components/Navbar.vue'
  24. import {
  25. globalMixin
  26. } from '../mixins/globalMixin';
  27. export default {
  28. mixins: [globalMixin],
  29. components: {
  30. tabber,
  31. cardList,
  32. Navbar
  33. },
  34. data() {
  35. this.orderId = '';
  36. return {
  37. status:"loading",
  38. params: {
  39. state: 0,
  40. pageNo: 1,
  41. pageSize: 10
  42. },
  43. tabList: [{
  44. id: '',
  45. name: '全部'
  46. },
  47. {
  48. id: 0,
  49. name: '未付款'
  50. },
  51. {
  52. id: 1,
  53. name: '待参加'
  54. },
  55. {
  56. id: 2,
  57. name: '已完成'
  58. },
  59. {
  60. id: 3,
  61. name: '已取消'
  62. },
  63. ],
  64. lineBg: require('@/static/image/cart/tabIcon.png'),
  65. totalPage: 0,
  66. cardListData: []
  67. }
  68. },
  69. onReachBottom() {
  70. if (this.params.pageNo >= this.totalPage) return
  71. this.params.pageNo++
  72. this.getOrderPageList()
  73. },
  74. onLoad() {
  75. this.getOrderPageList()
  76. },
  77. methods: {
  78. activeList() {
  79. uni.navigateTo({
  80. url: '/pages_my/activeList'
  81. })
  82. },
  83. getOrderPageList() {
  84. this.status = "loading"
  85. this.$api('orderPageList', this.params, res => {
  86. if (res.code == 200) {
  87. this.totalPage = res.result.pages
  88. this.cardListData = [...this.cardListData, ...res.result.records]
  89. if(this.params.pageNo >= this.totalPage) {
  90. this.status = "nomore"
  91. }else {
  92. this.status = "loadmore"
  93. }
  94. }
  95. })
  96. },
  97. tabs(val) {
  98. this.params.state = val.id
  99. this.params.pageNo = 1
  100. this.cardListData = []
  101. this.getOrderPageList()
  102. },
  103. toOrderDetails(val) {
  104. uni.navigateTo({
  105. url: `/pages_order/orderDetails?id=${val.id}`
  106. })
  107. },
  108. btnClick(item,type) {//0取消活动 1活动签到 2评价活动 3开具发票
  109. this.orderId = item.id;
  110. if (type == 0) {
  111. this.$refs.modal.open();
  112. }
  113. if (type == 1) {
  114. this.$api('signIn', {orderId: item.id}, res=> {
  115. if (res.code == 200) {
  116. this.cardListData = []
  117. this.getOrderPageList()
  118. this.$refs.toast.show({
  119. type: 'success',
  120. message: res.result
  121. })
  122. }
  123. })
  124. }
  125. if (type == 2) {
  126. uni.navigateTo({
  127. url: `/pages_order/orderEvaluation?activityId=${this.orderId}`
  128. })
  129. }
  130. if (type == 3) {
  131. uni.navigateTo({
  132. url: `/pages_order/invoiceIssuance?orderId=${this.orderId}`
  133. })
  134. }
  135. },
  136. confirm() {
  137. this.$api('cancelOrder', {orderId: this.orderId}, res => {
  138. if (res.code == 200) {
  139. this.cardListData = [];
  140. this.getOrderPageList();
  141. }
  142. })
  143. }
  144. }
  145. }
  146. </script>
  147. <style scoped lang="scss">
  148. .content {
  149. padding-bottom: 200rpx;
  150. }
  151. </style>