index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view style="height: 100vh">
  3. <view class="content">
  4. <view class="dyquan-wrap" v-for="(item,index) in list" :key="index">
  5. <view class="showtime">
  6. <text class="float_left order-no-text">{{ item.card_name|| '' }}</text>
  7. </view>
  8. <view class="item-info" v-for="good in item.card" @click="goGoods(good)">
  9. <image :src="good.product.image" mode=""></image>
  10. <view class="info-info">
  11. <view class="clamp2">
  12. {{good.product.store_name || ''}}
  13. </view>
  14. <view class="info-cs">
  15. 剩余使用次数:{{good.repertory || ''}}
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <view v-if="list.length == 0 && loadingType=='nomore'">
  21. <emptyPage title="暂无订单信息~"></emptyPage>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import { getMyServeList} from "@/api/user.js";
  28. import emptyPage from '@/components/emptyPage.vue';
  29. export default {
  30. components: {
  31. emptyPage
  32. },
  33. data() {
  34. return {
  35. page: 1,
  36. pageSize: 10,
  37. loaded: false,
  38. loadingType: 'more',
  39. list: []
  40. }
  41. },
  42. onLoad(opt) {
  43. },
  44. onShow() {
  45. // this.getList()
  46. },
  47. onReachBottom() {
  48. // this.getList()
  49. },
  50. onReady() {
  51. },
  52. methods: {
  53. goGoods(item) {
  54. console.log(item)
  55. uni.navigateTo({
  56. url:'/pages/goods_details/index?id=' + item.product_id
  57. })
  58. },
  59. tabClick(item, index) {
  60. this.tabCurrentIndex = index;
  61. },
  62. getList(type) {
  63. let that = this
  64. if (type == 'reload') {
  65. // item.list
  66. return
  67. }
  68. if (type == 'tab' && that.loaded) {
  69. return
  70. }
  71. if (that.loadingType == 'loading' || that.loadingType == 'nomore') {
  72. return
  73. }
  74. that.loadingType = 'loading'
  75. getMyServeList({
  76. page: that.page,
  77. limit: that.pageSize,
  78. name: ''
  79. }).then(({
  80. data
  81. }) => {
  82. that.list = that.list.concat(data.list)
  83. that.page++
  84. if (data.length == that.pageSize) {
  85. that.loadingType = 'more'
  86. } else {
  87. that.loadingType = 'nomore'
  88. }
  89. })
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss">
  95. .content {
  96. background-color:#f8f6f6 ;
  97. height: auto;
  98. min-height: 100%;
  99. }
  100. .dyquan-wrap {
  101. padding: 20rpx;
  102. background-color: #fff;
  103. margin-bottom: 15rpx;
  104. .showtime {
  105. height: 50rpx;
  106. }
  107. .item-info {
  108. width: 750rpx;
  109. height: 205rpx;
  110. display: flex;
  111. justify-content: flex-start;
  112. align-items: center;
  113. image {
  114. width: 160rpx;
  115. height: 160rpx;
  116. margin-right: 30rpx;
  117. }
  118. .info-info {
  119. height: 160rpx;
  120. padding: 15rpx 0;
  121. padding-right: 50rpx;
  122. font-size: 30rpx;
  123. font-weight: 500;
  124. color: #666666;
  125. display: flex;
  126. flex-direction: column;
  127. justify-content: space-between;
  128. align-items: flex-start;
  129. .info-cs {
  130. font-size: 26rpx;
  131. font-weight: 500;
  132. color: #999999;
  133. }
  134. }
  135. }
  136. .btm {
  137. width: 100%;
  138. height: 95rpx;
  139. background-color: #fff;
  140. display: flex;
  141. justify-content: flex-end;
  142. align-items: center;
  143. .btn {
  144. width: 144rpx;
  145. height: 55rpx;
  146. border-radius: 28rpx;
  147. font-size: 26rpx;
  148. font-weight: 500;
  149. color: #FFFFFF;
  150. line-height: 55rpx;
  151. text-align: center;
  152. }
  153. }
  154. }
  155. </style>