shop-item.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="wrap">
  3. <view class="item" v-for="item,index in msg" :key="index">
  4. <view class="nav_list clear" :data-id = "item.id" @tap="toShopDetail(item.id)">
  5. <view class="nav_list_img"><image :src="url + item.imgLog" mode="aspectFill"></image></view>
  6. <view class="middle">
  7. <view class="clear">
  8. <view class="middle_title">{{item.name}}</view>
  9. <view class="middle_title_pai" v-if="item.status == 1">
  10. <image src="https://wx.fujinyangche.com/nvrnetwork/images/vip.png"></image>
  11. </view>
  12. </view>
  13. <view style="margin-top:10rpx;overflow:hidden;">
  14. <view v-for="item,index in item.mainBusiness" :key="index" class="middle_qian">{{item}}</view>
  15. </view>
  16. <view class="nav_address">{{item.street}}</view>
  17. <view class="recommend" v-if="item.isHot == 1">荐</view>
  18. <view class="distance">{{item.distance}}</view>
  19. </view>
  20. </view>
  21. <view class="back1"></view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. let app = getApp();
  27. export default {
  28. data() {
  29. return {
  30. url:app.globalData.url
  31. }
  32. },
  33. props:['msg'],
  34. methods: {
  35. //跳转店铺详情
  36. toShopDetail(id){
  37. uni.navigateTo({
  38. url:"/pages/packageOne/service/classify/shop_detail/shop_detail?id=" + id
  39. })
  40. }
  41. }
  42. }
  43. </script>
  44. <style>
  45. .clear:after{
  46. content: "";
  47. display: block;
  48. clear:both;
  49. }
  50. .nav_list{
  51. width:100%;
  52. height:208rpx;
  53. box-sizing: border-box;
  54. position: relative;
  55. padding:24rpx 0 24rpx 30rpx;
  56. }
  57. .nav_list_img{
  58. width:160rpx;
  59. height:160rpx;
  60. float:left;
  61. overflow: hidden;
  62. position: relative;
  63. }
  64. .nav_list_img image{
  65. display: block;
  66. width:100%;
  67. height:100%;
  68. position: absolute;
  69. top:50%;
  70. left:50%;
  71. transform: translate(-50%,-50%);
  72. border-radius: 6rpx;
  73. }
  74. .middle{
  75. width:480rpx;
  76. margin-left: 20rpx;
  77. float:left;
  78. }
  79. .middle_title{
  80. width:400rpx;
  81. overflow: hidden;
  82. text-overflow: ellipsis;
  83. white-space: nowrap;
  84. font-size: 30rpx;
  85. color:#2A2A2A;
  86. font-weight: bold;
  87. float:left;
  88. }
  89. .middle_title_pai{
  90. width:120rpx;
  91. height:37rpx;
  92. position: absolute;
  93. top:28rpx;
  94. right:30rpx;
  95. }
  96. .middle_title_pai image{
  97. display: block;
  98. width: 100%;
  99. height:100%;
  100. }
  101. .middle_qian{
  102. width: 150rpx;
  103. box-sizing: border-box;
  104. overflow: hidden;
  105. white-space: nowrap;
  106. text-overflow: ellipsis;
  107. padding:0 16rpx;
  108. height:34rpx;
  109. background:rgba(231,120,23,0.06);
  110. border-radius:4rpx;
  111. text-align: center;
  112. line-height: 34rpx;
  113. font-size: 22rpx;
  114. color:#E77817;
  115. display: inline-block;
  116. margin-right:10rpx;
  117. }
  118. .nav_address{
  119. width:310rpx;
  120. font-size: 26rpx;
  121. color:#999999;
  122. margin-top:20rpx;
  123. overflow: hidden;
  124. text-overflow: ellipsis;
  125. white-space: nowrap;
  126. }
  127. .recommend{
  128. width:28rpx;
  129. height:28rpx;
  130. color:#ffffff;
  131. font-size: 22rpx;
  132. text-align: center;
  133. line-height: 28rpx;
  134. background:linear-gradient(270deg,rgba(254,107,21,1) 0%,rgba(254,163,48,1) 100%);
  135. position: absolute;
  136. top:12rpx;
  137. right:0rpx;
  138. }
  139. .distance{
  140. font-size: 24rpx;
  141. color:#999999;
  142. position: absolute;
  143. right:30rpx;
  144. bottom:36rpx;
  145. }
  146. .back1{
  147. width:100%;
  148. height: 10rpx;
  149. background-color: rgba(249,249,249,1);
  150. }
  151. </style>