index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view class="favorite">
  3. <zs-list mt="0" @load="loadMore" :status="status">
  4. <view class="favorite-item" v-for="(item,index) in list" :key="index">
  5. <!-- <image :src="item.src" mode="" class="icon" @click="goDetail(item)"></image> -->
  6. <zs-img radius="full" :src="item.src" width="200rpx" height="180rpx"></zs-img>
  7. <view class="info">
  8. <view class="title">
  9. {{item.title}}
  10. </view>
  11. <view class="address" @click="handleAdress(item)">
  12. <u-icon name="tags" size="38"></u-icon>
  13. {{item.address}}·距你{{item.distance}}km
  14. </view>
  15. <view class="tags">
  16. <view class="tag-item">
  17. <view class="label">
  18. </view>
  19. <view class="value">
  20. 满200享8折
  21. </view>
  22. </view>
  23. </view>
  24. <view class="like" @click="handleLike(item)">
  25. <u-icon :name="item.isLike?'heart-fill':'heart'" color="red" size="48"></u-icon>
  26. </view>
  27. </view>
  28. </view>
  29. </zs-list>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. status:'more',
  37. loading:false,
  38. list: [{
  39. src: 'https://mstatic.gzstv.com/media/images/2021/06/09/w1nrZC8_x-PQ.jpg',
  40. title: '万安加油站(中石化)',
  41. isLike:true,
  42. time: '2023-07-30 10:00:00',
  43. distance: 13.62,
  44. address:'贵州省贵阳市观山湖区金清路',
  45. },
  46. {
  47. src: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fss2.meipian.me%2Fusers%2F159660028%2Fb327e4a2a3e1473a82e2a53b5a5d2db2.jpeg%3Fmeipian-raw%2Fbucket%2Fivwen%2Fkey%2FdXNlcnMvMTU5NjYwMDI4L2IzMjdlNGEyYTNlMTQ3M2E4MmUyYTUzYjVhNWQyZGIyLmpwZWc%3D%2Fsign%2Fcec9ce1dfb5e0c3e627e30fb099899da.jpg&refer=http%3A%2F%2Fss2.meipian.me&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1693560973&t=7b7dfb1cbf6a6759e70f868c894888c9',
  48. title: '万安加油站(中石化)',
  49. time: '2023-07-30 10:00:00',
  50. isLike:true,
  51. address:'贵州省贵阳市观山湖区金清路',
  52. distance: 13.62
  53. },
  54. {
  55. id: 2,
  56. src:'https://img-md.veimg.cn/meadinindex/img5/2021/11/69F51D249ADA446EB5507352AA4ABD6E.jpg',
  57. title: '泊斯曼酒店',
  58. isLike:true,
  59. time: '2023-07-30 10:00:00',
  60. address:'贵州省贵阳市观山湖区金清路',
  61. distance: 5.23,
  62. },
  63. {
  64. id: 3,
  65. src:'https://file.gzl.cn/group1/M00/32/54/wKkBH1_7uBKAaWm1AAMJ4gwToRo237.jpg',
  66. title: '贵阳万丽酒店',
  67. isLike:true,
  68. time: '2023-07-30 10:00:00',
  69. address:'贵州省贵阳市观山湖区金清路',
  70. distance: 5.23,
  71. },
  72. ]
  73. }
  74. },
  75. methods: {
  76. handleLike(item) {
  77. item.isLike = !item.isLike
  78. },
  79. goDetail(){
  80. uni.navigateTo({
  81. url:'../../detail/shopDetail/shopDetail'
  82. })
  83. },
  84. loadMore(){
  85. this.status = 'loading'
  86. setTimeout(()=>{
  87. this.status = 'more'
  88. this.list.push({
  89. id: 3,
  90. src:'https://img2.baidu.com/it/u=242243300,1128843585&fm=253&fmt=auto&app=138&f=JPEG?w=696&h=500',
  91. title: '贵阳万丽酒店',
  92. isLike:true,
  93. time: '2023-07-30 10:00:00',
  94. address:'贵州省贵阳市观山湖区金清路',
  95. distance: 5.23,
  96. })
  97. },1000)
  98. },
  99. jump(){
  100. }
  101. },
  102. }
  103. </script>
  104. <style lang="scss" scoped>
  105. .favorite{
  106. background: #efefef;
  107. padding: 30rpx;
  108. min-height: 100vh;
  109. .favorite-item {
  110. display: flex;
  111. padding: 20rpx 30rpx;
  112. background: #FFFFFF;
  113. border-radius: 16rpx;
  114. margin-bottom: 20rpx;
  115. .icon{
  116. width: 200rpx;
  117. height: 180rpx;
  118. border-radius: 8px;
  119. }
  120. .info{
  121. flex: 1;
  122. padding-left: 20rpx;
  123. display: flex;
  124. flex-direction: column;
  125. justify-content: space-between;
  126. position: relative;
  127. .title{
  128. font-size: 28rpx;
  129. font-weight: bold;
  130. }
  131. .address{
  132. color: #bebebe;
  133. display: flex;
  134. align-items: center;
  135. font-size: 24rpx;
  136. padding: 15rpx 0;
  137. .u-icon{
  138. align-self: flex-start;
  139. }
  140. }
  141. .tags{
  142. display: flex;
  143. align-items: center;
  144. .tag-item{
  145. line-height: 50rpx;
  146. border-radius: 8rpx;
  147. padding: 6rpx 0;
  148. font-size: 24rpx;
  149. margin-left: 10rpx;
  150. display: flex;
  151. .label{
  152. background: #FE5B47;
  153. color: #fff;
  154. padding: 0 10rpx;
  155. border-radius: 8rpx 0 0 8rpx;
  156. }
  157. .value{
  158. color: #FE5B47;
  159. background: rgba(254,91,71,0.1);
  160. padding: 0 14rpx;
  161. border-radius: 0 8rpx 8rpx 0;
  162. }
  163. }
  164. }
  165. .like{
  166. position: absolute;
  167. top: 0%;
  168. right: 10rpx;
  169. }
  170. }
  171. }
  172. }
  173. </style>