item.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="content">
  3. <view class="gq-list">
  4. <view class="gq-item" v-for="item in list" @click="goPage('/pagesT/unit/itemdetail?id=' + item.id)">
  5. <view class="gq-logo">
  6. <image :src="item.image" mode="" class=""></image>
  7. </view>
  8. <view class="info">
  9. <view class="info-tit">
  10. 名称:
  11. </view>
  12. <view class="info-val clamp">
  13. {{item.name}}
  14. </view>
  15. </view>
  16. <view class="info">
  17. <view class="info-tit">
  18. 价格:
  19. </view>
  20. <view class="info-val clamp">
  21. {{item.price}}
  22. </view>
  23. </view>
  24. <view class="info">
  25. <view class="info-tit">
  26. 服务时间:
  27. </view>
  28. <view class="info-val clamp">
  29. {{item.service_time}}分钟
  30. </view>
  31. </view>
  32. <view class="info">
  33. <view class="info-tit">
  34. 可预约:
  35. </view>
  36. <view class="info-val clamp">
  37. </view>
  38. </view>
  39. <view class="info">
  40. <view class="info-tit">
  41. 可下单:
  42. </view>
  43. <view class="info-val clamp">
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <u-loadmore :status="loadingType" />
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. list: [],
  56. type: '',
  57. page: 1,
  58. limit: 12,
  59. loadingType: 'loadmore'
  60. }
  61. },
  62. onLoad(opt) {
  63. this.getList()
  64. },
  65. onShow() {
  66. },
  67. onReachBottom() {
  68. this.getList()
  69. },
  70. onReady() {
  71. },
  72. methods: {
  73. navto(url) {
  74. uni.navigateTo({
  75. url
  76. })
  77. },
  78. getList() {
  79. let that = this
  80. if (that.loadingType == 'nomore' || that.loadingType == 'loading') {
  81. return
  82. }
  83. that.loadingType = 'loading'
  84. this.$u.api.getItemList({
  85. page: that.page,
  86. pageSize: that.limit
  87. }).then(res => {
  88. console.log(res)
  89. that.list = that.list.concat(res.data)
  90. console.log(that.list)
  91. that.page++
  92. if(res.data.length == that.limit) {
  93. that.loadingType = 'loadmore'
  94. }else {
  95. that.loadingType = 'nomore'
  96. }
  97. })
  98. }
  99. }
  100. }
  101. </script>
  102. <style lang="scss">
  103. .gq-list {
  104. display: flex;
  105. flex-wrap: wrap;
  106. justify-content: flex-start;
  107. // justify-content: space-between;
  108. padding: 20rpx 0 20rpx 20rpx;
  109. }
  110. .gq-item {
  111. margin: 0 0 20rpx 14rpx;
  112. width: 227rpx;
  113. // height: 425rpx;
  114. background: #FFFFFF;
  115. box-shadow: 0px 5rpx 5rpx 0px rgba(35, 24, 21, 0.06);
  116. border-radius: 10rpx;
  117. display: flex;
  118. flex-direction: column;
  119. align-items: center;
  120. justify-content: space-between;
  121. padding: 15rpx 14rpx;
  122. .gq-logo {
  123. width: 182rpx;
  124. height: 192rpx;
  125. display: flex;
  126. justify-content: center;
  127. align-items: center;
  128. margin-bottom: 20rpx;
  129. image {
  130. width: 182rpx;
  131. height: 192rpx;
  132. background-color: #eee;
  133. }
  134. }
  135. .store-name {
  136. padding-top: 10rpx;
  137. text-align: center;
  138. width: 100%;
  139. font-size: 26rpx;
  140. font-weight: 500;
  141. color: #262261;
  142. overflow: hidden;
  143. }
  144. .info {
  145. width: 100%;
  146. display: flex;
  147. padding: 5rpx 0;
  148. .info-tit {
  149. font-size: 18rpx;
  150. flex-shrink: 0;
  151. }
  152. .info-val {
  153. flex-grow: 1;
  154. text-align: center;
  155. font-size: 20rpx;
  156. width: 140rpx;
  157. border-bottom: 1px #C7C7C7 solid;
  158. }
  159. }
  160. }
  161. </style>