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

169 lines
3.3 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <!-- 导航栏 -->
  4. <navbar title="订单" leftClick @leftClick="$utils.navigateBack" color="#fff" />
  5. <!-- 订单筛选 -->
  6. <view class="tabs">
  7. <uv-tabs :list="tabs"
  8. :customStyle="{
  9. backgroundColor: '#FFFFFF',
  10. }"
  11. :activeStyle="{
  12. color: '#84A73F',
  13. fontSize: '28rpx',
  14. whiteSpace: 'nowrap',
  15. paddingTop: '29rpx',
  16. paddingBottom: '21rpx',
  17. }"
  18. :inactiveStyle="{
  19. color: '#000000',
  20. fontSize: '28rpx',
  21. whiteSpace: 'nowrap',
  22. paddingTop: '29rpx',
  23. paddingBottom: '21rpx',
  24. }"
  25. lineHeight="8rpx"
  26. lineWidth="92rpx"
  27. lineColor="linear-gradient(to right, #84A73F, #D8FF8F)"
  28. :scrollable="false"
  29. :current="current"
  30. @click="clickTabs"></uv-tabs>
  31. </view>
  32. <!-- 未登录显示 -->
  33. <view v-if="!isLogin" class="no-login">
  34. <image class="no-login-img" src="@/static/image/center/icon-member-center.png" mode="widthFix"></image>
  35. <view class="no-login-text">登录后查看您的订单</view>
  36. <button class="no-login-btn" @click="$utils.toLogin">立即登录</button>
  37. </view>
  38. <view v-if="isLogin" class="list">
  39. <orderCard class="list-item" v-for="item in list" :data="item" :key="item.id" @done="getData"></orderCard>
  40. </view>
  41. <tabber select="order" />
  42. </view>
  43. </template>
  44. <script>
  45. import orderCard from '@/components/order/orderCard.vue'
  46. import mixinsList from '@/mixins/list.js'
  47. import mixinsOrder from '@/mixins/order.js'
  48. import tabber from '@/components/base/tabbar.vue'
  49. export default {
  50. mixins: [mixinsList, mixinsOrder],
  51. components: {
  52. orderCard,
  53. tabber,
  54. },
  55. computed: {
  56. isLogin() {
  57. return this.userInfo && this.userInfo.id
  58. }
  59. },
  60. data() {
  61. return {
  62. tabs: [{
  63. name: '全部订单'
  64. },
  65. {
  66. name: '待付款'
  67. },
  68. {
  69. name: '待核销'
  70. },
  71. {
  72. name: '已完成'
  73. },
  74. {
  75. name: '已取消'
  76. },
  77. ],
  78. current: 0,
  79. mixinsListApi: '',
  80. }
  81. },
  82. onShow() {
  83. if (this.isLogin) {
  84. this.mixinsListApi = 'queryOrderList'
  85. this.getData()
  86. }
  87. },
  88. methods: {
  89. //点击tab栏
  90. clickTabs({ index }) {
  91. if (index == 0) {
  92. delete this.queryParams.status
  93. } else {
  94. this.queryParams.status = index - 1
  95. }
  96. this.getData()
  97. },
  98. //跳转订单详情页面
  99. toOrderDetail(id) {
  100. uni.navigateTo({
  101. url: '/pages_order/order/orderDetail?id=' + id
  102. })
  103. },
  104. }
  105. }
  106. </script>
  107. <style scoped lang="scss">
  108. .page {
  109. background-color: #F5F5F5;
  110. /deep/ .nav-bar__view {
  111. background-image: linear-gradient(#84A73F, #D8FF8F);
  112. }
  113. }
  114. .tabs {
  115. /deep/ .uv-tabs__wrapper__nav__line {
  116. bottom: 0;
  117. }
  118. }
  119. .list {
  120. padding: 16rpx 17rpx;
  121. &-item {
  122. display: block;
  123. & + & {
  124. margin-top: 20rpx;
  125. }
  126. }
  127. }
  128. .no-login {
  129. display: flex;
  130. flex-direction: column;
  131. align-items: center;
  132. justify-content: center;
  133. padding: 100rpx 0;
  134. background-color: #FFFFFF;
  135. &-img {
  136. width: 120rpx;
  137. height: auto;
  138. margin-bottom: 20rpx;
  139. }
  140. &-text {
  141. font-size: 28rpx;
  142. color: #666666;
  143. margin-bottom: 40rpx;
  144. }
  145. &-btn {
  146. padding: 16rpx 60rpx;
  147. background-image: linear-gradient(to right, #84A73F, #D8FF8F);
  148. color: #fff;
  149. font-size: 28rpx;
  150. border-radius: 40rpx;
  151. box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.1);
  152. }
  153. }
  154. </style>