shop.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <view class="integral-shop">
  3. <!-- 筛选器 -->
  4. <cc-dropDownMenu :titleArr="titleArr" :dropArr="dropArr" @finishDropClick="finishClick"></cc-dropDownMenu>
  5. <zs-list class="list" mt="100rpx" @load="loadMore" :status="status">
  6. <view class="item" v-for="(item,index) in list" :key="index">
  7. <image :src="item.src" mode="aspectFill" class="icon"></image>
  8. <view class="info">
  9. <view class="title">
  10. {{item.title}}
  11. </view>
  12. <view class="desc">
  13. {{item.desc || '非常好吃且美味的小吃'}}
  14. </view>
  15. <view class="sale-box">
  16. <view class="price">
  17. {{item.score}}分
  18. </view>
  19. <view class="exchange-btn">
  20. 兑换
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </zs-list>
  26. <zs-skeleton :loading="loading" type="integralShop"></zs-skeleton>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. data() {
  32. return {
  33. loading:false,
  34. titleArr: ['积分', '品牌', '分类'],
  35. dropArr: [
  36. // 距离
  37. [{
  38. text: '积分',
  39. value: ""
  40. },
  41. {
  42. text: '金币',
  43. value: "440103"
  44. }
  45. ],
  46. // 类型
  47. [{
  48. text: '宅小鹿',
  49. value: "10000"
  50. },
  51. {
  52. text: '麻辣王子',
  53. value: "11000"
  54. }
  55. ],
  56. // 类型
  57. [{
  58. text: '零食',
  59. value: "0-40"
  60. },
  61. {
  62. text: '肉类',
  63. value: "40-60"
  64. }
  65. ],
  66. ],
  67. filterResultData: [],
  68. list:[
  69. {
  70. src:'http://t14.baidu.com/it/u=1060435979,471196002&fm=224&app=112&f=JPEG?w=500&h=500',
  71. title:'宅小鹿芒果干',
  72. score:6000,
  73. num:120
  74. },
  75. {
  76. src:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.alicdn.com%2Fbao%2Fuploaded%2Fi2%2F2207895997260%2FO1CN01Ogi5ab23V8BwbWSzn_%21%210-item_pic.jpg&refer=http%3A%2F%2Fimg.alicdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695440007&t=24ed88d94f8a1820a4411241c3bd5940',
  77. title:'麻辣王子地道辣条',
  78. score:6000,
  79. num:120
  80. },
  81. {
  82. src:'https://img2.baidu.com/it/u=248724739,3924050991&fm=253&fmt=auto&app=138&f=JPEG?w=616&h=500',
  83. title:'良品铺子酥脆薄饼',
  84. score:6000,
  85. num:120
  86. },
  87. {
  88. src:'https://alipic.lanhuapp.com/XDSlicePNGMAX5d129d495d8809b39d3bf35bf8bfabb798998037de72617952986550d6581788.png',
  89. title:'良品铺子猪肉脯',
  90. score:6000,
  91. num:120
  92. },
  93. {
  94. src:'https://alipic.lanhuapp.com/XDSlicePNGMAX5d129d495d8809b39d3bf35bf8bfabb798998037de72617952986550d6581788.png',
  95. title:'良品铺子猪肉脯',
  96. score:6000,
  97. num:120
  98. }
  99. ],
  100. status:'more',//加载状态
  101. }
  102. },
  103. methods: {
  104. finishClick(resultData) {
  105. this.filterResultData = resultData;
  106. // uni.showModal({
  107. // title: '温馨提示',
  108. // content: '筛选数据 = ' + JSON.stringify(resultData)
  109. // })
  110. },
  111. loadMore(){
  112. this.status = 'loading'
  113. setTimeout(()=>{
  114. this.status = 'more'
  115. this.list.push({
  116. src:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.alicdn.com%2Fbao%2Fuploaded%2Fi2%2F2207895997260%2FO1CN01Ogi5ab23V8BwbWSzn_%21%210-item_pic.jpg&refer=http%3A%2F%2Fimg.alicdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1695440007&t=24ed88d94f8a1820a4411241c3bd5940',
  117. title:'麻辣王子地道辣条',
  118. score:6000,
  119. num:120
  120. },)
  121. },1000)
  122. }
  123. },
  124. onLoad() {
  125. this.loading = true
  126. setTimeout(()=>{
  127. this.loading = false
  128. },1000)
  129. }
  130. }
  131. </script>
  132. <style lang="scss">
  133. .integral-shop cc-drop-down-menu{
  134. position: fixed;
  135. left: 0%;
  136. top: 0;
  137. width: 100%;
  138. background: #fff;
  139. z-index: 99999999;
  140. }
  141. .integral-shop {
  142. .bar-item-text {
  143. max-width: 250rpx !important;
  144. }
  145. .screen-bar::after {
  146. display: none;
  147. }
  148. .zs-list{
  149. .item{
  150. display: flex;
  151. margin: 0 20rpx 20rpx;
  152. // box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 3px 0px;
  153. box-shadow: 0rpx 0rpx 24rpx 2rpx rgba(0, 0, 0, 0.08);
  154. .icon{
  155. width: 250rpx;
  156. height: 250rpx;
  157. border-radius: 16rpx 0 0 16rpx;
  158. }
  159. .info{
  160. flex: 1;
  161. padding: 20rpx;
  162. border-radius: 0 16rpx 16rpx 0;
  163. position: relative;
  164. display: flex;
  165. flex-direction: column;
  166. justify-content: space-between;
  167. .title{
  168. font-size: 26rpx;
  169. display: -webkit-box;
  170. -webkit-box-orient: vertical;
  171. overflow: hidden;
  172. -webkit-line-clamp: 2;
  173. text-overflow: ellipsis;
  174. }
  175. .desc{
  176. color: #cacaca;
  177. font-size: 24rpx;
  178. }
  179. .sale-box{
  180. display: flex;
  181. justify-content: space-between;
  182. align-items: center;
  183. .price{
  184. color: #ecb751;
  185. font-size: 38rpx;
  186. }
  187. .exchange-btn{
  188. width: 120rpx;
  189. height: 50rpx;
  190. line-height: 50rpx;
  191. background: $uni-color-primary;
  192. border-radius: 25rpx;
  193. text-align: center;
  194. color: #fff;
  195. font-size: 24rpx;
  196. }
  197. }
  198. }
  199. }
  200. }
  201. }
  202. </style>