index.vue 8.8 KB

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