index.vue 2.9 KB

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