index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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">
  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. tabClick(item, index) {
  48. this.tabCurrentIndex = index;
  49. },
  50. getList(type) {
  51. let that = this
  52. if (type == 'reload') {
  53. // item.list
  54. return
  55. }
  56. if (type == 'tab' && that.loaded) {
  57. return
  58. }
  59. if (that.loadingType == 'loading' || that.loadingType == 'nomore') {
  60. return
  61. }
  62. that.loadingType = 'loading'
  63. getMyServeList({
  64. page: that.page,
  65. limit: that.pageSize,
  66. name: ''
  67. }).then(({
  68. data
  69. }) => {
  70. that.list = that.list.concat(data.list)
  71. that.page++
  72. if (data.length == that.pageSize) {
  73. that.loadingType = 'more'
  74. } else {
  75. that.loadingType = 'nomore'
  76. }
  77. })
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss">
  83. .content {
  84. background-color:#f8f6f6 ;
  85. height: auto;
  86. min-height: 100%;
  87. }
  88. .dyquan-wrap {
  89. padding: 20rpx;
  90. background-color: #fff;
  91. margin-bottom: 15rpx;
  92. .showtime {
  93. height: 50rpx;
  94. }
  95. .item-info {
  96. width: 750rpx;
  97. height: 205rpx;
  98. background: #F7F7F7;
  99. display: flex;
  100. justify-content: flex-start;
  101. align-items: center;
  102. image {
  103. width: 160rpx;
  104. height: 160rpx;
  105. margin-right: 30rpx;
  106. }
  107. .info-info {
  108. height: 160rpx;
  109. padding: 15rpx 0;
  110. padding-right: 50rpx;
  111. font-size: 30rpx;
  112. font-weight: 500;
  113. color: #666666;
  114. display: flex;
  115. flex-direction: column;
  116. justify-content: space-between;
  117. align-items: flex-start;
  118. .info-cs {
  119. font-size: 26rpx;
  120. font-weight: 500;
  121. color: #999999;
  122. }
  123. }
  124. }
  125. .btm {
  126. width: 100%;
  127. height: 95rpx;
  128. background-color: #fff;
  129. display: flex;
  130. justify-content: flex-end;
  131. align-items: center;
  132. .btn {
  133. width: 144rpx;
  134. height: 55rpx;
  135. border-radius: 28rpx;
  136. font-size: 26rpx;
  137. font-weight: 500;
  138. color: #FFFFFF;
  139. line-height: 55rpx;
  140. text-align: center;
  141. }
  142. }
  143. }
  144. </style>