ShopItem.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <view class="item" @click.stop="goDetails(v)">
  3. <view class="shop-img">
  4. <image class="u-skeleton-fillet" :src="v.image" mode="aspectFill"></image>
  5. </view>
  6. <view class="right">
  7. <view class="title u-skeleton-fillet">{{
  8. v.businessName || "加载中"
  9. }}</view>
  10. <view class="score-box u-skeleton-fillet">
  11. <view class="score">
  12. <rate :value="Math.round(v.average || 0)"></rate>
  13. </view>
  14. <text class="score-text"
  15. >{{ v.average ? Number(v.average).toFixed(2) : "" }}分</text
  16. >
  17. <text class="ju"
  18. >距离:{{ Math.round((v.distance / 1000) * 100) / 100 }}KM</text
  19. >
  20. </view>
  21. <view class="address-box u-skeleton-fillet">
  22. <view class="left">
  23. <uv-icon name="map" color="#999999" size="34rpx"></uv-icon>
  24. <view class="district">{{ v.address || "商户暂无地理位置" }}</view>
  25. </view>
  26. <view class="goShopping">
  27. <text class="iconfont">&#xe642;</text>
  28. <text class="text">去逛逛</text>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script setup>
  35. import { ref } from "vue";
  36. const props = defineProps({
  37. v: {
  38. type: Object,
  39. default: () => {},
  40. },
  41. });
  42. // const emit = defineEmits(["click"]);
  43. const goDetails = (v) => {
  44. uni.navigateTo({
  45. url: "/pages/shop/index?businessId=" + v.businessId,
  46. });
  47. // emit("click", v);
  48. };
  49. </script>
  50. <style scoped lang="scss">
  51. .item {
  52. display: flex;
  53. align-items: center;
  54. padding: 25rpx 0;
  55. // border-bottom: 1rpx solid #e6e6e6;
  56. .shop-img {
  57. width: 162rpx;
  58. height: 158rpx;
  59. margin-right: 40rpx;
  60. border-radius: 10rpx;
  61. overflow: hidden;
  62. flex-shrink: 0;
  63. image {
  64. width: 100%;
  65. height: 100%;
  66. }
  67. }
  68. .right {
  69. flex: 1;
  70. width: 0;
  71. .score-box,
  72. .address-box,
  73. .location2-box {
  74. display: flex;
  75. align-items: center;
  76. font-size: 24rpx;
  77. font-family: PingFang SC, PingFang SC-Regular;
  78. font-weight: 400;
  79. }
  80. .location1,
  81. .location2 {
  82. width: 20rpx;
  83. height: 27rpx;
  84. flex-shrink: 0;
  85. margin-right: 9rpx;
  86. }
  87. .light-start,
  88. .startt {
  89. width: 30rpx;
  90. height: 30rpx;
  91. margin-right: 12rpx;
  92. }
  93. .title {
  94. margin-bottom: 18rpx;
  95. font-size: 28rpx;
  96. font-family: PingFang SC, PingFang SC-Regular;
  97. color: #1a1a1a;
  98. }
  99. .score-box {
  100. display: flex;
  101. align-items: normal;
  102. margin-bottom: 10rpx;
  103. font-family: PingFang SC, PingFang SC-Semibold;
  104. color: #333333;
  105. .score {
  106. flex-shrink: 0;
  107. }
  108. .score-text {
  109. font-size: 24rpx;
  110. font-family: PingFang SC, PingFang SC-Medium;
  111. font-weight: 500;
  112. text-align: left;
  113. color: #333333;
  114. flex-shrink: 0;
  115. }
  116. .ju {
  117. margin-left: 23rpx;
  118. font-size: 24rpx;
  119. color: #808080;
  120. text-align: left;
  121. overflow: hidden;
  122. text-overflow: ellipsis;
  123. white-space: nowrap;
  124. }
  125. }
  126. .address-box {
  127. // margin-bottom: 10rpx;
  128. font-family: PingFang SC;
  129. color: #666666;
  130. justify-content: space-between;
  131. .left {
  132. flex: 1;
  133. width: 0;
  134. display: flex;
  135. align-items: center;
  136. font-size: 24rpx;
  137. font-family: PingFang SC, PingFang SC-Regular;
  138. font-weight: 400;
  139. text-align: left;
  140. color: #333333;
  141. }
  142. .goShopping {
  143. display: flex;
  144. align-items: center;
  145. font-size: 40rpx;
  146. color: #fa6138;
  147. flex-shrink: 0;
  148. .text {
  149. font-size: 24rpx;
  150. font-family: PingFang SC, PingFang SC-Medium;
  151. font-weight: 500;
  152. text-align: left;
  153. color: #666666;
  154. }
  155. }
  156. .district {
  157. color: #1a1a1a;
  158. margin-right: 40rpx;
  159. overflow: hidden;
  160. text-overflow: ellipsis;
  161. white-space: nowrap;
  162. }
  163. }
  164. .location2-box {
  165. color: #333333;
  166. view {
  167. overflow: hidden;
  168. text-overflow: ellipsis;
  169. white-space: nowrap;
  170. }
  171. }
  172. }
  173. }
  174. </style>