index.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <view>
  3. <view v-if="merchantList.length" class="store-wrapper">
  4. <view v-for="(item,index) in merchantList" :key="item.id">
  5. <view v-if="(item.proList&&item.proList.length && isStreet) || (!isStreet)" class="store-item"
  6. :class="isStreet?'street-noPad':''"
  7. :style="[isStreet ? { 'background-image': item.streetBackImage?'url('+ item.streetBackImage +')': 'url('+ moren +')' } : '',isHome?merchantStyle.contentStyle:'']">
  8. <view @click="goShop(item.id)" class="head" :class="isStreet?'street-backImage':''">
  9. <view class="left-wrapper">
  10. <view class="logo" :class="isStreet?'street-logo':''"
  11. :style="{'background-image': isStreet?`url(${urlDomain}crmebimage/presets/shang.png)`:''}">
  12. <image v-show="(isShowHome.logoShow&&isHome) ||!isHome"
  13. :src="isStreet?item.rectangleLogo:item.avatar" mode=""></image>
  14. </view>
  15. <view class="con-box">
  16. <view class="name line1 acea-row row-middle" :class="isStreet?'street-name':''"
  17. :style="[isHome?merchantStyle.nameColor:'']">
  18. <text v-show="(isShowHome.nameShow&&isHome) ||!isHome"
  19. class="mer_name line1">{{item.name}}</text>
  20. <text v-if="item.isSelf && ((isShowHome.typeShow&&isHome) ||!isHome)"
  21. class="font-bg-red mr10 merType" :class="isHome?'':'bg-color'"
  22. :style="[isHome?merchantStyle.labelColor:'']">自营</text>
  23. </view>
  24. <view class="star-box">
  25. <view v-if="!isStreet" class="score">
  26. <view class='starsList'>
  27. <block v-for="(itemn, indexn) in item.starLevel" :key="indexn">
  28. <text class='iconfont icon-ic_star1 font-color'></text>
  29. </block>
  30. <block v-show="Number(item.starLevel)<5">
  31. <text v-for="(itemn, indexn) in 5-parseInt(item.starLevel)"
  32. :key="indexn" class='iconfont icon-ic_star1 noCheck'></text>
  33. </block>
  34. </view>
  35. </view>
  36. <view v-show="!isStreet" class="lines tui-skeleton-rect"></view>
  37. <view class="fans" :style="isStreet?'color:#fff':'color:#999'">
  38. {{ item.followerNum < 10000 ? item.followerNum : (item.followerNum / 10000).toFixed(2) + '万' }}人关注
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view v-if="!isStreet" class="link" @click="goShop(item.id)">进店</view>
  44. </view>
  45. <view v-if="item.proList.length" class="pic-wrapper" :class="isStreet?'street-wrapper':''">
  46. <view v-for="(goods,indexn) in item.proList" :key="indexn" class="proList"
  47. @click="godDetail(goods)">
  48. <view class="pic-item" :class="isStreet?'street-pic':''">
  49. <view v-show="goods.stock===0" class="sellOut">已售罄</view>
  50. <image :src="goods.image" mode="aspectFill"></image>
  51. <!-- <easy-loadimage :image-src="goods.image"></easy-loadimage> -->
  52. <view v-if="!isStreet" class="price" :style="[isHome?merchantStyle.priceColor:'']">
  53. <text>{{$store.getters.priceUnit}}</text>{{goods.price}}
  54. </view>
  55. </view>
  56. <view class="pic-name line2" v-if="isStreet">{{goods.name}}</view>
  57. <view v-if="isStreet" class="street-price semiBold line-heightOne" :style="[isHome?merchantStyle.priceColor:'']">
  58. <text>{{$store.getters.priceUnit}}</text>{{goods.price}}
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. // +----------------------------------------------------------------------
  69. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  70. // +----------------------------------------------------------------------
  71. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  72. // +----------------------------------------------------------------------
  73. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  74. // +----------------------------------------------------------------------
  75. // | Author: CRMEB Team <admin@crmeb.com>
  76. // +----------------------------------------------------------------------
  77. import {
  78. goProductDetail
  79. } from '@/libs/order.js'
  80. import {
  81. mapGetters
  82. } from "vuex";
  83. import easyLoadimage from '@/components/base/easy-loadimage.vue';
  84. export default {
  85. data() {
  86. return {
  87. urlDomain: this.$Cache.get("imgHost"),
  88. skeletonShow: true,
  89. isShow: true,
  90. moren: '',
  91. noStarLevel: 0
  92. }
  93. },
  94. components: {
  95. easyLoadimage
  96. },
  97. computed: mapGetters(['uid']),
  98. props: {
  99. merchantList: {
  100. type: Array,
  101. default: () => []
  102. },
  103. //是否是店铺街,true是,false不是
  104. isStreet: {
  105. type: Boolean,
  106. default: () => false
  107. },
  108. //是否是首页展示,true是,false不是
  109. isHome: {
  110. type: Boolean,
  111. default: () => false
  112. },
  113. //首页中展示字段判断
  114. isShowHome: {
  115. type: Object,
  116. default: () => ({
  117. logoShow: true,
  118. typeShow: true,
  119. nameShow: true
  120. })
  121. },
  122. merchantStyle: {
  123. type: Object,
  124. default: () => {}
  125. },
  126. },
  127. created() {
  128. this.moren = this.urlDomain + 'crmebimage/presets/mermoren.png';
  129. },
  130. methods: {
  131. godDetail(item) {
  132. goProductDetail(item.id, 0, '')
  133. },
  134. menusTap(url) {
  135. uni.navigateTo({
  136. url
  137. })
  138. },
  139. goShop(id) {
  140. uni.navigateTo({
  141. url: `/pages/merchant/home/index?merId=${id}`
  142. })
  143. },
  144. }
  145. };
  146. </script>
  147. <style scoped lang="scss">
  148. .noCheck {
  149. color: #ddd;
  150. }
  151. .score {
  152. display: flex;
  153. align-items: center;
  154. font-weight: 500;
  155. font-size: 24rpx;
  156. line-height: 1;
  157. height: 19rpx;
  158. .iconfont {
  159. font-size: 20rpx;
  160. }
  161. }
  162. .star-box {
  163. display: flex;
  164. align-items: center;
  165. .lines {
  166. width: 2rpx;
  167. height: 14rpx;
  168. background: #BFBFBF;
  169. border-radius: 0px 0px 0px 0px;
  170. opacity: 1;
  171. margin-left: 10rpx;
  172. margin-right: 10rpx;
  173. }
  174. .fans {
  175. font-size: 24rpx;
  176. }
  177. .num {
  178. color: $theme-color;
  179. font-size: 24rpx;
  180. margin-left: 10rpx;
  181. }
  182. }
  183. .street {
  184. &-logo {
  185. width: 191rpx !important;
  186. height: 80rpx !important;
  187. background-repeat: no-repeat;
  188. background-size: 100% 100%;
  189. border-radius: 0 !important;
  190. margin-right: 0 !important;
  191. image {
  192. width: 130rpx !important;
  193. height: 44rpx !important;
  194. margin-top: 13rpx;
  195. margin-left: 17rpx;
  196. }
  197. }
  198. &-name {
  199. color: #fff;
  200. }
  201. &-pad20 {
  202. padding: 0 20rpx;
  203. }
  204. &-noPad {
  205. border-top-left-radius: 16rpx;
  206. border-top-right-radius: 16rpx;
  207. width: 100%;
  208. height: 360rpx;
  209. padding: 24rpx !important;
  210. background-size: 100% 100%;
  211. margin-bottom: 120rpx !important;
  212. }
  213. &-pic {
  214. overflow: hidden;
  215. margin-right: 12rpx !important;
  216. }
  217. &-price {
  218. font-size: 28rpx;
  219. color: #FD502F;
  220. margin-top: 14rpx;
  221. }
  222. &-wrapper {
  223. padding: 20rpx 16rpx !important;
  224. margin-top: -2rpx;
  225. margin-bottom: 20rpx;
  226. }
  227. &-active {
  228. background-size: 111rpx 19rpx;
  229. }
  230. }
  231. .backImage {
  232. padding: 24rpx 0 24rpx 20rpx;
  233. border-radius: 16px 16px 0px 0px;
  234. }
  235. .store-item {
  236. margin-bottom: 20rpx;
  237. padding: 24rpx;
  238. background-color: #fff;
  239. border-radius: 24rpx;
  240. .head {
  241. display: flex;
  242. justify-content: space-between;
  243. .left-wrapper {
  244. display: flex;
  245. align-items: center;
  246. .logo {
  247. width: 80rpx;
  248. height: 80rpx;
  249. border-radius: 6rpx;
  250. overflow: hidden;
  251. margin-right: 20rpx;
  252. image {
  253. width: 120rpx;
  254. height: 120rpx;
  255. border-radius: 6rpx;
  256. overflow: hidden;
  257. }
  258. }
  259. .con-box {
  260. .bt-color {
  261. width: max-content;
  262. white-space: nowrap;
  263. font-size: 16rpx;
  264. padding: 2rpx 10rpx;
  265. background-color: #fff;
  266. @include main_color(theme);
  267. border-radius: 13rpx;
  268. }
  269. .name {
  270. font-size: 30rpx;
  271. color: #333;
  272. font-weight: bold;
  273. margin-top: -7rpx;
  274. .mer_name {
  275. max-width: 400rpx;
  276. margin-right: 10rpx;
  277. }
  278. }
  279. }
  280. }
  281. .link {
  282. width: 88rpx;
  283. height: 50rpx;
  284. line-height: 48rpx;
  285. @include main_color(theme);
  286. @include coupons_border_color(theme);
  287. border-radius: 25rpx;
  288. text-align: center;
  289. color: #fff;
  290. font-size: 24rpx;
  291. }
  292. }
  293. .pic-wrapper {
  294. width: 100%;
  295. display: grid;
  296. grid-template-rows: auto;
  297. grid-template-columns: repeat(3, 1fr);
  298. background-color: #FFFFFF;
  299. border-radius: 0px 16rpx 16rpx 16rpx;
  300. padding-top: 20rpx;
  301. grid-gap: 12rpx;
  302. .pic-name {
  303. margin-top: 10rpx;
  304. font-size: 24rpx;
  305. color: #333333;
  306. height: 68rpx;
  307. line-height: 34rpx;
  308. }
  309. .pic-item {
  310. position: relative;
  311. width: 100%;
  312. height: 198rpx;
  313. overflow: hidden;
  314. .easy-loadimage,
  315. image,
  316. uni-image {
  317. overflow: hidden;
  318. border-radius: 16rpx;
  319. width: 100%;
  320. height: 100%;
  321. }
  322. .price {
  323. position: absolute;
  324. right: 0;
  325. bottom: 0;
  326. height: 36rpx;
  327. padding: 0 10rpx;
  328. line-height: 36rpx;
  329. text-align: center;
  330. background: rgba(0, 0, 0, .5);
  331. border-radius: 16rpx 2rpx 16rpx 2rpx;
  332. color: #fff;
  333. font-size: 24rpx;
  334. text {
  335. font-size: 18rpx;
  336. }
  337. }
  338. &:nth-child(3n) {
  339. margin-right: 0;
  340. }
  341. }
  342. }
  343. }
  344. </style>