shop.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="integral-shop">
  3. <view class="search-box">
  4. <zs-search></zs-search>
  5. </view>
  6. <image class="top-banner" src="http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/zWqwDFLWR49e9ad6233cd12be362c43beb149fd7afd8.png/1.png" mode=""></image>
  7. <zs-list class="list" mt="0" @load="loadMore" :status="status">
  8. <view class="item" v-for="(item,index) in list" :key="index">
  9. <image :src="item.src" mode="aspectFill" class="icon"></image>
  10. <view class="item-title">
  11. {{item.title}}
  12. </view>
  13. <view class="handle-box">
  14. <view class="price">
  15. {{item.score}}分
  16. </view>
  17. <view class="exchange-btn">
  18. 兑换
  19. </view>
  20. </view>
  21. </view>
  22. </zs-list>
  23. <zs-skeleton :loading="loading" type="integralShop"></zs-skeleton>
  24. </view>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. return {
  30. loading:false,
  31. list:[
  32. {
  33. src:'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/8zBA84UCvIef20b42c8c60ccf255659809bb7487bc39.png/1.png',
  34. title:'宅小鹿芒果干',
  35. score:6000,
  36. },
  37. {
  38. src:'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/9wkfNPdtHQDx215952a03c9499e4bd4cc030e5be26bd.png/1.png',
  39. title:'麻辣王子地道辣条',
  40. score:6000,
  41. },
  42. {
  43. src:'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/FHcYDdynWMlO6bb60c27722f428d3d6552a1a39eae9c.png/1.png',
  44. title:'良品铺子酥脆薄饼',
  45. score:6000,
  46. },
  47. ],
  48. status:'more',//加载状态
  49. }
  50. },
  51. methods: {
  52. loadMore(){
  53. this.status = 'loading'
  54. setTimeout(()=>{
  55. this.status = 'more'
  56. this.list.push({
  57. src:'http://zswl-dev.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/iNEvSic47Nhy84e3b9a86e1e505bfe57c92d01acb255.png/1.png',
  58. title:'薄脆饼干',
  59. score:6000,
  60. num:120
  61. },)
  62. },1000)
  63. }
  64. },
  65. onLoad() {
  66. this.loading = true
  67. setTimeout(()=>{
  68. this.loading = false
  69. },1000)
  70. }
  71. }
  72. </script>
  73. <style lang="scss">
  74. .integral-shop {
  75. background: #f5f5f5;
  76. padding-top: 120rpx;
  77. .search-box{
  78. position: fixed;
  79. top: 0%;
  80. left: 0%;
  81. width: 100%;
  82. padding: 20rpx 0;
  83. background: #fff;
  84. z-index: 9;
  85. }
  86. .top-banner{
  87. margin: 0 30rpx;
  88. width: 690rpx;
  89. height: 346rpx;
  90. }
  91. .zs-list{
  92. margin-left: 30rpx;
  93. margin-right: 30rpx;
  94. display: flex;
  95. flex-wrap: wrap;
  96. justify-content: space-between;
  97. .item{
  98. width: 334rpx;
  99. display: flex;
  100. flex-direction: column;
  101. justify-content: space-between;
  102. background: #fff;
  103. border-radius: 16rpx;
  104. margin-top: 20rpx;
  105. .icon{
  106. width: 100%;
  107. height: 320rpx!important;
  108. border-radius: 12rpx;
  109. object-fit: cover;
  110. }
  111. .item-title{
  112. font-size: 26rpx;
  113. display: -webkit-box;
  114. -webkit-box-orient: vertical;
  115. overflow: hidden;
  116. -webkit-line-clamp: 2;
  117. text-overflow: ellipsis;
  118. padding: 0 20rpx;
  119. margin-top: 20rpx;
  120. }
  121. .handle-box{
  122. display: flex;
  123. justify-content: space-between;
  124. align-items: center;
  125. margin-top: 15rpx;
  126. padding: 10rpx 20rpx;
  127. .price{
  128. font-size: 26rpx;
  129. color: #FE5B47;
  130. }
  131. .exchange-btn{
  132. width: 96rpx;
  133. height: 40rpx;
  134. line-height: 40rpx;
  135. background: $uni-color-primary;
  136. border-radius: 20rpx;
  137. text-align: center;
  138. color: #fff;
  139. font-size: 22rpx;
  140. }
  141. }
  142. }
  143. }
  144. }
  145. </style>