index.vue 3.0 KB

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