card1.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="filter">
  3. <view class="flex justify-around">
  4. <view :class="{active:activeIndex==index}" class="con" :key="index"
  5. v-for="(item,index) in tagsList" @click="activeIndex=index">
  6. <text class="title">{{item.title}}</text>
  7. <view class="tag">
  8. <text>{{item.desc}}</text>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="item">
  13. <view class="card" @click="goDetail(item.id)" v-for="(item,index) in list" :key="index">
  14. <view class="left">
  15. <image :src="item.cover" mode=""></image>
  16. </view>
  17. <view class="right">
  18. <view class="title text-cut-1">
  19. <text class="">{{item.name}}</text>
  20. </view>
  21. <view class="data">
  22. <view class="">
  23. <block>
  24. <u-icon name="star-fill" color="#ff7001" size="30"></u-icon>
  25. <text
  26. style="margin-left: 4rpx;margin-right: 20rpx;color: #ff7001;font-size: 26rpx;">4.9</text>
  27. </block>
  28. <block>
  29. <text>月售</text>
  30. <text>{{item.sales}}</text>
  31. </block>
  32. </view>
  33. <view>
  34. <text>珠江新城</text>
  35. <text class="margin-left-10">3.5km</text>
  36. </view>
  37. </view>
  38. <view class="text-cut-2" style="width: 100%;height: 32rpx;margin-top: 14rpx;">
  39. <view v-for="(item1,index1) in item.labelNames.split(',')" :key="index1" class="cu-tag sm "
  40. style="background-color: #fff0d9;color: #ffa353;">
  41. {{item1}}
  42. </view>
  43. </view>
  44. <view v-if="false" class="flex justify-start text-cut-2"
  45. style="margin-top: 12rpx;width: 100%;height: 34rpx;">
  46. <view class="line-red sm cu-tag" v-for="(item,index) in 5" :key="index">
  47. 首次光临减2元
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. export default{
  57. props:{
  58. list:Array
  59. },
  60. data(){
  61. return {
  62. activeIndex: 0,
  63. tagsList: [{
  64. title: '智能筛选',
  65. desc: '大数据优选'
  66. }, {
  67. title: '距离最近',
  68. desc: '由近到远'
  69. }, {
  70. title: '评论最高',
  71. desc: '好评如潮'
  72. }, {
  73. title: '全部筛选',
  74. desc: '全部分类'
  75. }]
  76. }
  77. },
  78. methods:{
  79. goDetail(id){
  80. uni.navigateTo({
  81. url:"/pages/consume/detail/shop-detail?id="+id,
  82. fail(err) {
  83. console.log(err);
  84. }
  85. })
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. .filter {
  92. padding: 10rpx;
  93. display: flex;
  94. flex-direction: column;
  95. .con {
  96. display: flex;
  97. flex-direction: column;
  98. justify-content: center;
  99. align-items: center;
  100. .title {
  101. font-size: 28rpx;
  102. font-weight: 800;
  103. }
  104. .tag {
  105. color: #888888;
  106. padding: 4rpx;
  107. margin-top: 10rpx;
  108. font-size: 22rpx;
  109. }
  110. }
  111. .active {
  112. color: #fd5d4a;
  113. .title {
  114. color: fd5d4a;
  115. }
  116. .tag {
  117. border-radius: 20rpx 0 20rpx 0;
  118. background-color: #ffddd5;
  119. color: #fd5d4a;
  120. }
  121. }
  122. }
  123. .item {
  124. display: flex;
  125. flex-direction: column;
  126. margin-top: 50rpx;
  127. .card {
  128. margin-bottom: 20rpx;
  129. display: flex;
  130. border-bottom: 1rpx solid #ececec;
  131. padding-bottom: 20rpx;
  132. .left {
  133. width: 30%;
  134. image {
  135. width: 100%;
  136. border-radius: 12rpx;
  137. height: 180rpx;
  138. }
  139. }
  140. .right {
  141. margin-left: 20rpx;
  142. display: flex;
  143. width: 70%;
  144. flex-direction: column;
  145. .title {
  146. font-size: 30rpx;
  147. font-weight: 800;
  148. }
  149. .data {
  150. margin-top: 20rpx;
  151. display: flex;
  152. justify-content: space-between;
  153. font-size: 24rpx;
  154. color: #666666;
  155. }
  156. .label {
  157. margin-top: 10rpx;
  158. }
  159. }
  160. }
  161. .card:last-child {
  162. border: none;
  163. margin-bottom: 0;
  164. padding-bottom: 0;
  165. }
  166. }
  167. </style>