index.vue 3.1 KB

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