BeeBrandPane.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view class="bee-brand-pane-container">
  3. <view class="bee-brand-top" @click="$jump(`/pages_category_page1/store/index?storeId=${brandInfo.shop_id}`)">
  4. <view class="left">
  5. <BeeAvatar :src="common.seamingImgUrl(brandInfo.shop_logo)" radius="10upx"></BeeAvatar>
  6. <!-- <view class="tag"> 惊喜价 </view> -->
  7. </view>
  8. <view class="middle">
  9. <view class="brand-name hidden">{{ brandInfo.shop_name }}</view>
  10. <!-- <view class="rate">
  11. <view style="display: flex;align-items: center;">
  12. <BeeIcon :size="12" :src="require('./images/star.png')"></BeeIcon>
  13. <text class="rate-text">{{ brandInfo.merchantRating || '5.0' }}分</text>
  14. <text class="sub-text">{{ brandInfo.brandLabel | formatTag }}</text>
  15. <text class="rate-text">¥{{ brandInfo.perCapita || '0' }}/人</text>
  16. <text>月售 {{ brandInfo.salesVolume || '0' }}</text>
  17. </view>
  18. <view style="color: #777777;">{{ brandInfo.browse || 0 }}浏览量</view>
  19. </view> -->
  20. <view v-if="brandInfo.brief" class="elva">
  21. <view class="elva-text hidden">{{ brandInfo.brief || '--' }}</view>
  22. </view>
  23. <view class="location-wrapper">
  24. <BeeIcon style="line-height: 100%;" :src="require('./images/location.png')" :size="14"></BeeIcon>
  25. <view class="detail">
  26. <text v-if="isPositioning" class="dis-container">{{ positioningText }}</text>
  27. <view v-else style="display: flex;align-items: center;">
  28. <text class="dis-container"> {{ typeof brandInfo.distance === 'number' ? (brandInfo.distance / 1000).toFixed(2) : 0 }} km </text>
  29. <BeeIcon :src="require('./images/to.png')" :size="14"></BeeIcon>
  30. </view>
  31. </view>
  32. </view>
  33. <view style="display: flex;flex-wrap: wrap;">
  34. <!-- v-if="brandInfo.voucherNum" -->
  35. <view
  36. style="width: fit-content;margin-top: 8upx;margin-right: 8upx;padding: 4upx 8upx;border: 0.25px solid #0d0e0d;border-radius: 12upx;font-size: 28upx;font-weight: bold;color: #0d0e0d;"
  37. >
  38. 补贴代金券{{ brandInfo.voucher_return || 0 }}%
  39. </view>
  40. <view
  41. v-if="brandInfo.is_voucher"
  42. style="width: fit-content;margin-top: 8upx;margin-right: 8upx;padding: 4upx 8upx;border: 0.25px solid #51cc46;border-radius: 12upx;font-size: 28upx;font-weight: bold;color: #51cc46;"
  43. >
  44. 支持代金券
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="bee-brand-bottom">
  50. <slot></slot>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. export default {
  56. filters: {
  57. formatTag(value) {
  58. return {
  59. 0: '美酒',
  60. 1: '美食',
  61. 2: '娱乐',
  62. 3: '好玩'
  63. }[value] || ''
  64. }
  65. },
  66. props: {
  67. brandInfo: {
  68. type: Object,
  69. required: true
  70. },
  71. isPositioning: {
  72. type: Boolean,
  73. default: true
  74. }
  75. },
  76. data() {
  77. return {
  78. positioningText: '定位中',
  79. timer: null
  80. }
  81. },
  82. watch: {
  83. isPositioning: {
  84. handler(val, oldVal) {
  85. this.timer && clearInterval(this.timer)
  86. if (val) {
  87. this.timer = setInterval(() => {
  88. if (this.positioningText.length === 9) {
  89. this.positioningText = '定位中'
  90. } else {
  91. this.positioningText = this.positioningText + '.'
  92. }
  93. }, 500)
  94. } else {
  95. }
  96. },
  97. immediate: true
  98. }
  99. },
  100. beforeDestroy() {
  101. this.timer && clearInterval(this.timer)
  102. }
  103. }
  104. </script>
  105. <style lang="less" scoped>
  106. .hidden {
  107. width: 374upx;
  108. overflow: hidden;
  109. white-space: nowrap;
  110. text-overflow: ellipsis;
  111. }
  112. .bee-brand-pane-container {
  113. // width: 100%;
  114. background-color: #fff;
  115. padding: 24upx 20upx;
  116. border-radius: 20upx;
  117. margin-top: 16upx;
  118. transition: all 350ms;
  119. &:active {
  120. background-color: #e9e9e9;
  121. }
  122. .bee-brand-top {
  123. display: flex;
  124. align-items: flex-start;
  125. width: 100%;
  126. .left {
  127. display: flex;
  128. align-items: center;
  129. flex-direction: column;
  130. .tag {
  131. display: flex;
  132. align-items: center;
  133. justify-content: center;
  134. width: 104upx;
  135. height: 38upx;
  136. background: url('./images/tag1.png');
  137. background-size: cover;
  138. color: #cb511e;
  139. font-size: 24upx;
  140. margin-top: 52upx;
  141. }
  142. }
  143. .middle {
  144. flex: 1;
  145. margin: 0 28upx;
  146. .brand-name {
  147. color: #000;
  148. font-size: 32upx;
  149. font-weight: bold;
  150. }
  151. .rate {
  152. display: flex;
  153. justify-content: space-between;
  154. align-items: center;
  155. margin-top: 8upx;
  156. font-size: 26upx;
  157. text {
  158. font-size: 24upx;
  159. margin-left: 8upx;
  160. &.rate-text {
  161. color: #fa5151;
  162. }
  163. }
  164. }
  165. .location-wrapper {
  166. display: flex;
  167. align-items: center;
  168. margin: 12upx 0 8upx;
  169. // /deep/ .icon-container {
  170. // margin-top: 6upx;
  171. // }
  172. .detail {
  173. background-color: #efefef;
  174. // vertical-align: text-bottom;
  175. padding: 0 4upx;
  176. border-radius: 4upx;
  177. margin-left: 4upx;
  178. }
  179. }
  180. .elva {
  181. margin: 8upx 0;
  182. .elva-text {
  183. // width: 348upx;
  184. margin-left: 10upx;
  185. font-size: 30upx;
  186. }
  187. }
  188. }
  189. }
  190. }
  191. </style>