index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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>{{rmbToLgnsHandle(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>{{rmbToLgnsHandle(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. import { rmbToLgns } from '@/utils';
  85. export default {
  86. data() {
  87. return {
  88. urlDomain: this.$Cache.get("imgHost"),
  89. skeletonShow: true,
  90. isShow: true,
  91. moren: '',
  92. noStarLevel: 0
  93. }
  94. },
  95. components: {
  96. easyLoadimage
  97. },
  98. computed: mapGetters(['uid']),
  99. props: {
  100. merchantList: {
  101. type: Array,
  102. default: () => []
  103. },
  104. //是否是店铺街,true是,false不是
  105. isStreet: {
  106. type: Boolean,
  107. default: () => false
  108. },
  109. //是否是首页展示,true是,false不是
  110. isHome: {
  111. type: Boolean,
  112. default: () => false
  113. },
  114. //首页中展示字段判断
  115. isShowHome: {
  116. type: Object,
  117. default: () => ({
  118. logoShow: true,
  119. typeShow: true,
  120. nameShow: true
  121. })
  122. },
  123. merchantStyle: {
  124. type: Object,
  125. default: () => {}
  126. },
  127. },
  128. created() {
  129. this.moren = this.urlDomain + 'crmebimage/presets/mermoren.png';
  130. },
  131. methods: {
  132. rmbToLgnsHandle(rmb){
  133. return rmbToLgns(rmb)
  134. },
  135. godDetail(item) {
  136. goProductDetail(item.id, 0, '')
  137. },
  138. menusTap(url) {
  139. uni.navigateTo({
  140. url
  141. })
  142. },
  143. goShop(id) {
  144. uni.navigateTo({
  145. url: `/pages/merchant/home/index?merId=${id}`
  146. })
  147. },
  148. }
  149. };
  150. </script>
  151. <style scoped lang="scss">
  152. .noCheck {
  153. color: #ddd;
  154. }
  155. .score {
  156. display: flex;
  157. align-items: center;
  158. font-weight: 500;
  159. font-size: 24rpx;
  160. line-height: 1;
  161. height: 19rpx;
  162. .iconfont {
  163. font-size: 20rpx;
  164. }
  165. }
  166. .star-box {
  167. display: flex;
  168. align-items: center;
  169. .lines {
  170. width: 2rpx;
  171. height: 14rpx;
  172. background: #BFBFBF;
  173. border-radius: 0px 0px 0px 0px;
  174. opacity: 1;
  175. margin-left: 10rpx;
  176. margin-right: 10rpx;
  177. }
  178. .fans {
  179. font-size: 24rpx;
  180. }
  181. .num {
  182. color: $theme-color;
  183. font-size: 24rpx;
  184. margin-left: 10rpx;
  185. }
  186. }
  187. .street {
  188. &-logo {
  189. width: 191rpx !important;
  190. height: 80rpx !important;
  191. background-repeat: no-repeat;
  192. background-size: 100% 100%;
  193. border-radius: 0 !important;
  194. margin-right: 0 !important;
  195. image {
  196. width: 130rpx !important;
  197. height: 44rpx !important;
  198. margin-top: 13rpx;
  199. margin-left: 17rpx;
  200. }
  201. }
  202. &-name {
  203. color: #fff;
  204. }
  205. &-pad20 {
  206. padding: 0 20rpx;
  207. }
  208. &-noPad {
  209. border-top-left-radius: 16rpx;
  210. border-top-right-radius: 16rpx;
  211. width: 100%;
  212. height: 360rpx;
  213. padding: 24rpx !important;
  214. background-size: 100% 100%;
  215. margin-bottom: 120rpx !important;
  216. }
  217. &-pic {
  218. overflow: hidden;
  219. margin-right: 12rpx !important;
  220. }
  221. &-price {
  222. font-size: 28rpx;
  223. color: #FD502F;
  224. margin-top: 14rpx;
  225. }
  226. &-wrapper {
  227. padding: 20rpx 16rpx !important;
  228. margin-top: -2rpx;
  229. margin-bottom: 20rpx;
  230. }
  231. &-active {
  232. background-size: 111rpx 19rpx;
  233. }
  234. }
  235. .backImage {
  236. padding: 24rpx 0 24rpx 20rpx;
  237. border-radius: 16px 16px 0px 0px;
  238. }
  239. .store-item {
  240. margin-bottom: 20rpx;
  241. padding: 24rpx;
  242. background-color: #fff;
  243. border-radius: 24rpx;
  244. .head {
  245. display: flex;
  246. justify-content: space-between;
  247. .left-wrapper {
  248. display: flex;
  249. align-items: center;
  250. .logo {
  251. width: 80rpx;
  252. height: 80rpx;
  253. border-radius: 6rpx;
  254. overflow: hidden;
  255. margin-right: 20rpx;
  256. image {
  257. width: 120rpx;
  258. height: 120rpx;
  259. border-radius: 6rpx;
  260. overflow: hidden;
  261. }
  262. }
  263. .con-box {
  264. .bt-color {
  265. width: max-content;
  266. white-space: nowrap;
  267. font-size: 16rpx;
  268. padding: 2rpx 10rpx;
  269. background-color: #fff;
  270. @include main_color(theme);
  271. border-radius: 13rpx;
  272. }
  273. .name {
  274. font-size: 30rpx;
  275. color: #333;
  276. font-weight: bold;
  277. margin-top: -7rpx;
  278. .mer_name {
  279. max-width: 400rpx;
  280. margin-right: 10rpx;
  281. }
  282. }
  283. }
  284. }
  285. .link {
  286. width: 88rpx;
  287. height: 50rpx;
  288. line-height: 48rpx;
  289. @include main_color(theme);
  290. @include coupons_border_color(theme);
  291. border-radius: 25rpx;
  292. text-align: center;
  293. color: #fff;
  294. font-size: 24rpx;
  295. }
  296. }
  297. .pic-wrapper {
  298. width: 100%;
  299. display: grid;
  300. grid-template-rows: auto;
  301. grid-template-columns: repeat(3, 1fr);
  302. background-color: #FFFFFF;
  303. border-radius: 0px 16rpx 16rpx 16rpx;
  304. padding-top: 20rpx;
  305. grid-gap: 12rpx;
  306. .pic-name {
  307. margin-top: 10rpx;
  308. font-size: 24rpx;
  309. color: #333333;
  310. height: 68rpx;
  311. line-height: 34rpx;
  312. }
  313. .pic-item {
  314. position: relative;
  315. width: 100%;
  316. height: 198rpx;
  317. overflow: hidden;
  318. .easy-loadimage,
  319. image,
  320. uni-image {
  321. overflow: hidden;
  322. border-radius: 16rpx;
  323. width: 100%;
  324. height: 100%;
  325. }
  326. .price {
  327. position: absolute;
  328. right: 0;
  329. bottom: 0;
  330. height: 36rpx;
  331. padding: 0 10rpx;
  332. line-height: 36rpx;
  333. text-align: center;
  334. background: rgba(0, 0, 0, .5);
  335. border-radius: 16rpx 2rpx 16rpx 2rpx;
  336. color: #fff;
  337. font-size: 24rpx;
  338. text {
  339. font-size: 18rpx;
  340. }
  341. }
  342. &:nth-child(3n) {
  343. margin-right: 0;
  344. }
  345. }
  346. }
  347. }
  348. </style>