CommonShop.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <template>
  2. <view
  3. v-if="shopInfo" class="common-shop-container" :style="{ margin, borderRadius: radius }"
  4. @click="go(`/another-tf/another-user/shop/shop-detail?shopId=${shopInfo.shopId}`)"
  5. >
  6. <view class="shop-top" :style="{ padding }">
  7. <image
  8. class="shop-logo" :style="{ width: picWidth, height: picHeight }"
  9. :src="common.seamingImgUrl(shopInfo.shopLogo) || require('../../../static/images/new-user/fee.icon.png')"
  10. >
  11. </image>
  12. <view class="shop-info">
  13. <view class="shop-name">
  14. <view style="flex: 1;width: 0;display: flex;align-items: center;">
  15. <image
  16. v-if="showLogo" style="width: 32upx;height: 32upx;margin-right: 6upx;"
  17. src="../../../static/images/new-community/home/tag.png"
  18. ></image>
  19. <view
  20. style="flex: 1;margin-left: 5upx;font-size: 32upx;font-weight: bold;color: #222229;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"
  21. >
  22. {{ shopInfo.shopName || shopInfo.chargePersonName || '附近商家' }}
  23. </view>
  24. </view>
  25. <image
  26. v-if="showSign && shopInfo.contractState" src="../../../static/images/new-community/home/gold-star.png"
  27. style="width: 48upx;height: 48upx;"
  28. ></image>
  29. </view>
  30. <view class="shop-middle" :style="{ marginTop: bottomType !== 'brief' ? '10upx' : '0' }">
  31. <view class="rate">
  32. <tui-rate active="#EF530E" :current="shopInfo.score" :size="14" disabled></tui-rate>
  33. <text class="rate-text">{{ shopInfo.score }}</text>
  34. </view>
  35. <!-- && shopInfo.monthlySales -->
  36. <view v-if="(bottomType === 'detail')" style="color: #888889;font-size: 24upx;margin-left: 15upx;">
  37. 月售{{ shopInfo.monthlySales || 1 }}
  38. </view>
  39. </view>
  40. <view v-if="bottomType === 'detail'">
  41. <view style="display: flex;align-items: center;justify-content: space-between;padding-top: 6upx;">
  42. <view
  43. style="flex: 1;width: 0;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;font-size: 26upx;color: #888889;"
  44. >
  45. <!-- <template v-if="shopInfo.mainBusiness">
  46. <text
  47. v-for="(item, index) in shopInfo.mainBusiness.split(',')" :key="index"
  48. style="padding-right: 10upx;margin-left: 10upx;border-right: 1upx solid #D8D8D8;"
  49. >
  50. {{ item }}
  51. </text>
  52. </template> -->
  53. <text>{{ shopInfo.shopBrief || '--' }}</text>
  54. </view>
  55. <view v-if="shopInfo.distance" style="margin-left: 6upx;">
  56. <tui-icon name="gps" :size="14" color="#888889"></tui-icon>
  57. <text style="margin-left: 4upx;color: #888889;font-size: 26upx;">{{ shopInfo.distance || 0 }}Km</text>
  58. </view>
  59. </view>
  60. <view style="display: flex;align-items: center;justify-content: flex-end;padding-top: 6upx;">
  61. <!-- <view
  62. v-if="shopInfo.shopTypeName"
  63. style="flex: 1;width: 0;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"
  64. >
  65. <text
  66. v-for="(item, index) in shopInfo.shopTypeName.split(',')" :key="index"
  67. style="padding: 4upx 18upx;margin-right: 10upx;font-size: 24upx;color: #c8530a;background-color: #fff1d7;"
  68. >
  69. {{ item }}
  70. </text>
  71. </view> -->
  72. <view
  73. v-if="shopInfo.authenType || shopInfo.checkState || shopInfo.authenticationState || shopInfo.startTime"
  74. style="flex: 1;width: 0;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;font-size: 24upx;color: #c8530a;"
  75. >
  76. <text v-if="shopInfo.authenType" style="padding: 4upx 18upx;margin-right: 10upx;background-color: #fff1d7;">
  77. <template v-if="shopInfo.authenType === 1">个人</template>
  78. <template v-else-if="shopInfo.authenType === 2">个体工商户</template>
  79. <template v-else-if="shopInfo.authenType === 3">企业</template>
  80. <template v-else-if="shopInfo.authenType === 4">其它组织</template>
  81. <template v-else>特殊角色</template>
  82. </text>
  83. <text v-if="shopInfo.checkState" style="padding: 4upx 18upx;margin-right: 10upx;background-color: #fff1d7;">
  84. 已入驻
  85. </text>
  86. <text
  87. v-if="shopInfo.authenticationState"
  88. style="padding: 4upx 18upx;margin-right: 10upx;background-color: #fff1d7;"
  89. >
  90. 已签约
  91. </text>
  92. <text v-if="shopInfo.startTime" style="padding: 4upx 18upx;margin-right: 10upx;background-color: #fff1d7;">
  93. {{ shopInfo.startTime }}营业
  94. </text>
  95. </view>
  96. <!-- <view v-if="shopInfo.accessNum" style="margin-left: 6upx;">
  97. <text style="color: #888889;font-size: 26upx;">{{ shopInfo.accessNum || 0 }}浏览量</text>
  98. </view> -->
  99. <view style="margin-left: 6upx;">
  100. <text style="color: #888889;font-size: 26upx;">{{ shopInfo.fansNumber || '0 ' }}粉丝</text>
  101. </view>
  102. </view>
  103. </view>
  104. <view v-if="bottomType === 'brief'" class="bottom-brief">
  105. <view class="brief-left">
  106. <!-- <view v-if="shopInfo.mainBusiness" class="serve-list">
  107. <text v-for="(item, index) in shopInfo.mainBusiness.split(',')" :key="index" class="item">
  108. {{ item }}
  109. </text>
  110. </view> -->
  111. <view v-if="shopInfo.shopBrief" class="serve-list">
  112. <text>{{ shopInfo.shopBrief || '--' }}</text>
  113. </view>
  114. <!-- <view v-if="shopInfo.shopTypeName" class="type-list">
  115. <text v-for="(item, index) in shopInfo.shopTypeName.split(',')" :key="index" class="item">
  116. {{ item }}
  117. </text>
  118. </view> -->
  119. <view v-if="shopInfo.authenType || shopInfo.checkState || shopInfo.authenticationState || shopInfo.startTime" class="type-list">
  120. <text v-if="shopInfo.authenType" style="padding: 4upx 18upx;margin-right: 10upx;background-color: #f7f7f7;border-radius: 24upx;">
  121. <template v-if="shopInfo.authenType === 1">个人</template>
  122. <template v-else-if="shopInfo.authenType === 2">个体工商户</template>
  123. <template v-else-if="shopInfo.authenType === 3">企业</template>
  124. <template v-else-if="shopInfo.authenType === 4">其它组织</template>
  125. <template v-else>特殊角色</template>
  126. </text>
  127. <text v-if="shopInfo.checkState" style="padding: 4upx 18upx;margin-right: 10upx;background-color: #f7f7f7;border-radius: 24upx;">
  128. 已入驻
  129. </text>
  130. <text
  131. v-if="shopInfo.authenticationState"
  132. style="padding: 4upx 18upx;margin-right: 10upx;background-color: #f7f7f7;"
  133. >
  134. 已签约
  135. </text>
  136. <text v-if="shopInfo.startTime" style="padding: 4upx 18upx;margin-right: 10upx;background-color: #f7f7f7;border-radius: 24upx;">
  137. {{ shopInfo.startTime }}营业
  138. </text>
  139. </view>
  140. </view>
  141. <view v-if="shopInfo.distance" class="brief-right">
  142. <image class="icon" src="../../../static/images/new-community/home/location.png"></image>
  143. <text>{{ shopInfo.distance || 0 }}Km</text>
  144. </view>
  145. </view>
  146. <view v-if="bottomType === 'display'">
  147. <!-- <view class="detail-msg">{{ shopInfo.elegantDemeanour || '--' }}</view> -->
  148. <view class="detail-msg">{{ shopInfo.shopBrief || '--' }}</view>
  149. </view>
  150. <view style="display: flex;flex-wrap: wrap;padding: 4upx 0;">
  151. <view
  152. v-if="shopInfo.voucherReturn"
  153. style="width: fit-content;margin-top: 8upx;margin-right: 8upx;padding: 2upx 6upx;border: 1upx solid rgba(226, 71, 71, 0.5);border-radius: 12upx;font-size: 24upx;color: #E24747;"
  154. >
  155. 补贴代金券{{ shopInfo.voucherReturn || 0 }}%
  156. </view>
  157. <view
  158. v-if="shopInfo.isVoucher"
  159. style="width: fit-content;margin-top: 8upx;padding: 2upx 6upx;border: 1upx solid rgba(226, 71, 71, 0.5);border-radius: 12upx;font-size: 24upx;color: #E24747;"
  160. >
  161. 支持代金券
  162. </view>
  163. </view>
  164. <view v-if="bottomType === 'display'" class="bottom-detail">
  165. <view class="op-info">
  166. <view class="item">
  167. <image class="icon" src="../../../static/images/new-community/home/follow.png"></image>
  168. <text class="num">{{ shopInfo.score || 0 }}</text>
  169. </view>
  170. <view class="item">
  171. <image class="icon" src="../../../static/images/new-community/home/views.png"></image>
  172. <text class="num">{{ shopInfo.fansNumber || 0 }}</text>
  173. </view>
  174. <view v-if="shopInfo.distance" class="item">
  175. <image class="icon" src="../../../static/images/new-community/home/location.png"></image>
  176. <text class="num">{{ shopInfo.distance || 0 }}Km</text>
  177. </view>
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. <view class="shop-bottom">
  183. <slot></slot>
  184. </view>
  185. </view>
  186. </template>
  187. <script>
  188. export default {
  189. name: 'CommonShop',
  190. props: {
  191. shopInfo: {
  192. type: Object,
  193. require: true
  194. },
  195. padding: {
  196. type: String,
  197. default: '22upx 26upx'
  198. },
  199. margin: {
  200. type: String,
  201. default: '0' // 22upx 0
  202. },
  203. radius: {
  204. type: String,
  205. default: '0' // 20upx
  206. },
  207. picWidth: {
  208. type: String,
  209. default: '168upx'
  210. },
  211. picHeight: {
  212. type: String,
  213. default: '168upx'
  214. },
  215. showLogo: {
  216. type: Boolean,
  217. default: false
  218. },
  219. showSign: {
  220. type: Boolean,
  221. default: false
  222. },
  223. bottomType: {
  224. type: String,
  225. default: 'detail'
  226. }
  227. }
  228. }
  229. </script>
  230. <style lang="less" scoped>
  231. .common-shop-container {
  232. box-sizing: border-box;
  233. background-color: #ffffff;
  234. .shop-top {
  235. display: flex;
  236. .shop-logo {
  237. flex-shrink: 0;
  238. border-radius: 14upx;
  239. margin-right: 26upx;
  240. }
  241. .shop-info {
  242. flex: 1;
  243. width: 0;
  244. .shop-name {
  245. display: flex;
  246. justify-content: space-between;
  247. align-items: center;
  248. }
  249. }
  250. .shop-middle {
  251. display: flex;
  252. align-items: center;
  253. .rate {
  254. flex: 1;
  255. width: 0;
  256. line-height: 1;
  257. .rate-text {
  258. font-size: 24upx;
  259. color: #ef530e;
  260. margin-left: 4upx;
  261. }
  262. }
  263. }
  264. .detail-msg {
  265. font-size: 26upx;
  266. color: #9E9E9E;
  267. overflow: hidden;
  268. white-space: nowrap;
  269. text-overflow: ellipsis;
  270. }
  271. .bottom-detail {
  272. .op-info {
  273. display: flex;
  274. align-items: center;
  275. .item {
  276. display: flex;
  277. align-items: center;
  278. width: 33%;
  279. .icon {
  280. width: 44upx;
  281. height: 44upx;
  282. }
  283. .num {
  284. color: #888889;
  285. font-size: 24upx;
  286. }
  287. &:nth-child(3) {
  288. .num {
  289. color: #ef530e;
  290. }
  291. }
  292. }
  293. }
  294. }
  295. .bottom-brief {
  296. display: flex;
  297. justify-content: space-between;
  298. .brief-left {
  299. flex: 1;
  300. width: 0;
  301. .serve-list {
  302. overflow: hidden;
  303. white-space: nowrap;
  304. text-overflow: ellipsis;
  305. margin-bottom: 6upx;
  306. font-size: 26upx;
  307. color: #9E9E9E;
  308. .item {
  309. color: #9E9E9E;
  310. margin-left: 10upx;
  311. padding-right: 10upx;
  312. font-size: 26upx;
  313. border-right: 1upx solid #D8D8D8;
  314. }
  315. .item:last-child {
  316. border: none !important;
  317. }
  318. }
  319. .type-list {
  320. overflow: hidden;
  321. white-space: nowrap;
  322. text-overflow: ellipsis;
  323. font-size: 24upx;
  324. color: #979797;
  325. .item {
  326. color: #9E9E9E;
  327. margin-right: 10upx;
  328. padding: 4upx 18upx;
  329. font-size: 24upx;
  330. background-color: #f7f7f7;
  331. }
  332. }
  333. }
  334. .brief-right {
  335. display: flex;
  336. align-items: center;
  337. margin-left: 20upx;
  338. color: #ef530e;
  339. font-size: 24upx;
  340. .icon {
  341. width: 44upx;
  342. height: 44upx;
  343. }
  344. }
  345. }
  346. }
  347. }
  348. </style>