my-shop.vue 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057
  1. <template>
  2. <view class="container shop clearfix" :style="{ paddingTop: CustomBar + 'px' }">
  3. <custom
  4. :systeminfo="systeminfo"
  5. :navbar-data="nvabarData"
  6. :headerBtnPosi="headerBtnPosi"
  7. :headerColor="headerColor"
  8. :page="backPage"
  9. >
  10. </custom>
  11. <!-- 主页内容 -->
  12. <tui-skeleton
  13. v-if="skeletonShow"
  14. backgroundColor="#fafafa"
  15. borderRadius="10rpx"
  16. :isLoading="true"
  17. :loadingType="5"
  18. ></tui-skeleton>
  19. <template v-else>
  20. <view class="shop-search-main">
  21. <view class="shop-search">
  22. <text class="iconfont icon-sousuo"></text>
  23. <input
  24. class="input"
  25. maxlength="20"
  26. type="text"
  27. value=""
  28. @focus="onFocus"
  29. @input="onShowClose"
  30. v-model.trim="listQuery.keyword"
  31. confirm-type="search"
  32. @confirm="SubMitSearch()"
  33. placeholder="搜索本店铺商品"
  34. />
  35. <text class="iconfont icon-shanchu1" v-if="isShowClose" @click.stop="delInputText()"></text>
  36. </view>
  37. </view>
  38. <view class="container-shop tui-skeleton">
  39. <!-- 轮播 -->
  40. <view class="product-supplier" @click="goSupplier">
  41. <view class="logo"
  42. ><img
  43. :src="shopLogo ? shopLogo : 'https://static.caimei365.com/app/img/icon/icon-shoplogo.png'"
  44. alt=""
  45. /></view>
  46. <view class="main">
  47. <view class="name">{{ shopName }}</view>
  48. <view class="massgs">
  49. <view class="label">满意度:</view>
  50. <view class="p-stars">
  51. <uni-stars
  52. :stars="6"
  53. :iconClass="iconClass"
  54. :iconColor="iconColor"
  55. :fontSize="36"
  56. :widthInfo="176"
  57. ></uni-stars>
  58. </view>
  59. <!-- <view class="acount">
  60. <text> {{ normalNum }} </text>件商品
  61. </view> -->
  62. </view>
  63. </view>
  64. <view class="right"><text class="iconfont icon-xiayibu"></text></view>
  65. </view>
  66. <banner :list="bannerImageList"></banner>
  67. </view>
  68. <view class="container-section tui-skeleton" v-if="recommendList.length>0">
  69. <view class="tab-title">主推商品</view>
  70. <view class="section-product clearfix">
  71. <view class="floor-item-none" v-if="isHomeProduct">
  72. <image class="none-image" :src="iconNoneData" mode=""></image>
  73. <view class="none-text">暂无主推商品~</view>
  74. </view>
  75. <view
  76. v-else
  77. class="floor-item"
  78. v-for="(prop, index) in recommendList"
  79. :key="index"
  80. @click.stop="navToDetailPage(prop.productId)"
  81. >
  82. <image class="item-img tui-skeleton-fillet" :src="prop.image" mode="aspectFill"></image>
  83. <view class="floor-item-type" v-if="prop.productType == 2">医疗器械</view>
  84. <view class="floor-item-content">
  85. <view class="title tui-skeleton-rect">
  86. <text class="mclap-tag" v-if="prop.beautyActFlag == 1">美博会</text>
  87. <text class="mclap" :class="prop.beautyActFlag == 1 ? 'indent' : ''">{{
  88. prop.name
  89. }}</text>
  90. </view>
  91. <view class="floor-item-act">
  92. <template v-if="userIdentity === 3">
  93. <view class="coupon-tags" v-if="prop.couponsLogo">优惠券</view>
  94. <template v-if="prop.actStatus === 1">
  95. <view class="floor-tags" v-if="PromotionsFormat(prop.promotions)">
  96. {{ prop.promotions.name }}
  97. <text v-if="hasLogin && prop.priceFlag != 1 && prop.shopId == shopId"
  98. >:¥{{ prop.price | NumFormat }}</text
  99. >
  100. </view>
  101. <view class="floor-tags" v-else>{{ prop.promotions.name }}</view>
  102. </template>
  103. <template v-if="prop.svipProductFlag == 1">
  104. <template v-if="prop.priceFlag != 1">
  105. <view class="svip-tags">
  106. <view class="tags">SVIP</view>
  107. <view class="price" v-if="prop.shopId == shopId">{{
  108. prop.svipPriceTag
  109. }}</view>
  110. </view>
  111. </template>
  112. <template v-else>
  113. <view class="svip-tags"> <view class="tags none">SVIP</view> </view>
  114. </template>
  115. </template>
  116. </template>
  117. <template v-else>
  118. <view class="coupon-tags" v-if="prop.couponsLogo">优惠券</view>
  119. <template v-if="prop.actStatus === 1">
  120. <view class="floor-tags" v-if="PromotionsFormat(prop.promotions)">
  121. {{ prop.promotions.name }}
  122. <text v-if="hasLogin && prop.priceFlag != 1"
  123. >:¥{{ prop.price | NumFormat }}</text
  124. >
  125. </view>
  126. <view class="floor-tags" v-else>{{ prop.promotions.name }}</view>
  127. </template>
  128. <template v-if="prop.svipProductFlag == 1">
  129. <view class="svip-tags">
  130. <view class="tags" :class="{ none: !isShowVipFlag(prop) }">SVIP</view>
  131. <view class="price" v-if="isShowVipFlag(prop)">{{
  132. prop.svipPriceTag
  133. }}</view>
  134. </view>
  135. </template>
  136. </template>
  137. </view>
  138. <view class="" v-if="hasLogin">
  139. <template v-if="userIdentity == 3">
  140. <template v-if="prop.shopId == shopId">
  141. <view class="title-none" v-if="prop.priceFlag === 1">
  142. <text class="p big">¥未公开价格</text>
  143. </view>
  144. <view
  145. class="price tui-skeleton-rect"
  146. v-else
  147. :class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
  148. >
  149. <text class="p sm">¥</text>
  150. <text class="p big">{{
  151. (PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
  152. | NumFormat
  153. }}</text>
  154. </view>
  155. </template>
  156. <template v-else>
  157. <view class="no-price">
  158. <view class="p-stars">
  159. <text class="p-no">¥</text>
  160. <uni-grader :grade="Number(prop.priceGrade)" :margin="14"></uni-grader>
  161. </view>
  162. </view>
  163. </template>
  164. </template>
  165. <template v-else-if="userIdentity === 4 && vipFlag !=1">
  166. <view class="title-none" v-if="prop.priceFlag === 1">
  167. <text class="p big">¥未公开价格</text>
  168. </view>
  169. <view class="title-none" v-else-if="prop.priceFlag === 2">
  170. <text class="p big">¥价格仅会员可见</text>
  171. </view>
  172. <view class="title-none" v-else-if="prop.priceFlag === 3">
  173. <text class="p big">¥仅医美机构可见</text>
  174. </view>
  175. <view
  176. class="price tui-skeleton-rect"
  177. v-if="prop.priceFlag === 0"
  178. :class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
  179. >
  180. <text class="p sm">¥</text>
  181. <text class="p big">{{
  182. (PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
  183. | NumFormat
  184. }}</text>
  185. </view>
  186. </template>
  187. <template v-else-if="userIdentity === 2 || (userIdentity == 4 && vipFlag == 1)">
  188. <view class="title-none" v-if="prop.priceFlag === 1">
  189. <text class="p big">¥未公开价格</text>
  190. </view>
  191. <view class="title-none" v-else-if="prop.priceFlag === 3 && (firstClubType!=1)">
  192. <text class="p big">¥仅医美机构可见</text>
  193. </view>
  194. <view
  195. class="price tui-skeleton-rect"
  196. v-else
  197. :class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
  198. >
  199. <text class="p sm">¥</text>
  200. <text class="p big">{{
  201. (PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
  202. | NumFormat
  203. }}</text>
  204. </view>
  205. </template>
  206. <template v-else>
  207. <view class="title-none" v-if="prop.priceFlag === 1">
  208. <text class="p big">¥未公开价格</text>
  209. </view>
  210. <view
  211. class="price tui-skeleton-rect"
  212. v-else
  213. :class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
  214. >
  215. <text class="p sm">¥</text>
  216. <text class="p big">{{
  217. (PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
  218. | NumFormat
  219. }}</text>
  220. </view>
  221. </template>
  222. </view>
  223. <view v-else class="no-price">
  224. <view class="p-stars">
  225. <text class="p-no">¥</text>
  226. <uni-grader :grade="Number(prop.priceGrade)"></uni-grader>
  227. <template v-if="prop.actStatus == 1">
  228. <view class="floor-tags" v-if="PromotionsFormat(prop.promotions)">
  229. {{ prop.promotions.name
  230. }}<text v-if="hasLogin && prop.priceFlag != 1"
  231. >:¥{{ prop.price | NumFormat }}</text
  232. >
  233. </view>
  234. <view class="floor-tags" v-else>{{ prop.promotions.name }}</view>
  235. </template>
  236. </view>
  237. </view>
  238. </view>
  239. </view>
  240. </view>
  241. </view>
  242. <view class="container-section tui-skeleton">
  243. <view class="tab-title" v-if="!isEmpty">全部商品</view>
  244. <view class="section-product clearfix">
  245. <view class="floor-item-none" v-if="isEmpty">
  246. <image class="none-image" :src="iconNoneData1" mode=""></image>
  247. <view class="none-text">暂未发布任何商品~</view>
  248. </view>
  249. <view
  250. v-else
  251. class="floor-item"
  252. v-for="(prop, index) in productList"
  253. :key="index"
  254. @click.stop="navToDetailPage(prop.productId)"
  255. >
  256. <image class="item-img tui-skeleton-fillet" :src="prop.image" mode="aspectFill"></image>
  257. <view class="floor-item-type" v-if="prop.productType == 2">医疗器械</view>
  258. <view class="floor-item-content">
  259. <view class="title tui-skeleton-rect">
  260. <text class="mclap-tag" v-if="prop.beautyActFlag == 1">美博会</text>
  261. <text class="mclap" :class="prop.beautyActFlag == 1 ? 'indent' : ''">{{
  262. isInterceptHtmlFn(prop.name)
  263. }}</text>
  264. </view>
  265. <view class="floor-item-act">
  266. <template v-if="userIdentity === 3">
  267. <view class="coupon-tags" v-if="prop.couponsLogo">优惠券</view>
  268. <template v-if="prop.actStatus === 1">
  269. <view class="floor-tags" v-if="PromotionsFormat(prop.promotions)">
  270. {{ prop.promotions.name }}
  271. <text v-if="hasLogin && prop.priceFlag != 1 && prop.shopId == shopId"
  272. >:¥{{ prop.price | NumFormat }}</text
  273. >
  274. </view>
  275. <view class="floor-tags" v-else>{{ prop.promotions.name }}</view>
  276. </template>
  277. <template v-if="prop.svipProductFlag == 1">
  278. <template v-if="prop.priceFlag != 1">
  279. <view class="svip-tags">
  280. <view class="tags">SVIP</view>
  281. <view class="price" v-if="prop.shopId == shopId">{{
  282. prop.svipPriceTag
  283. }}</view>
  284. </view>
  285. </template>
  286. <template v-else>
  287. <view class="svip-tags"> <view class="tags none">SVIP</view> </view>
  288. </template>
  289. </template>
  290. </template>
  291. <template v-else>
  292. <view class="coupon-tags" v-if="prop.couponsLogo">优惠券</view>
  293. <template v-if="prop.actStatus === 1">
  294. <view class="floor-tags" v-if="PromotionsFormat(prop.promotions)">
  295. {{ prop.promotions.name }}
  296. <text v-if="hasLogin && prop.priceFlag != 1"
  297. >:¥{{ prop.price | NumFormat }}</text
  298. >
  299. </view>
  300. <view class="floor-tags" v-else>{{ prop.promotions.name }}</view>
  301. </template>
  302. <template v-if="prop.svipProductFlag == 1">
  303. <view class="svip-tags">
  304. <view class="tags" :class="{ none: !isShowVipFlag(prop) }">SVIP</view>
  305. <view class="price" v-if="isShowVipFlag(prop)">{{
  306. prop.svipPriceTag
  307. }}</view>
  308. </view>
  309. </template>
  310. </template>
  311. </view>
  312. <view class="" v-if="hasLogin">
  313. <template v-if="userIdentity == 3">
  314. <template v-if="prop.shopId == shopId">
  315. <view class="title-none" v-if="prop.priceFlag === 1">
  316. <text class="p big">¥未公开价格</text>
  317. </view>
  318. <view
  319. class="price tui-skeleton-rect"
  320. v-else
  321. :class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
  322. >
  323. <text class="p sm">¥</text>
  324. <text class="p big">{{
  325. (PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
  326. | NumFormat
  327. }}</text>
  328. </view>
  329. </template>
  330. <template v-else>
  331. <view class="no-price">
  332. <view class="p-stars">
  333. <text class="p-no">¥</text>
  334. <uni-grader :grade="Number(prop.priceGrade)" :margin="14"></uni-grader>
  335. </view>
  336. </view>
  337. </template>
  338. </template>
  339. <template v-else-if="userIdentity === 4 && vipFlag != 1">
  340. <view class="title-none" v-if="prop.priceFlag === 1">
  341. <text class="p big">¥未公开价格</text>
  342. </view>
  343. <view class="title-none" v-else-if="prop.priceFlag === 2">
  344. <text class="p big">¥价格仅会员可见</text>
  345. </view>
  346. <view class="title-none" v-else-if="prop.priceFlag === 3">
  347. <text class="p big">¥仅医美机构可见</text>
  348. </view>
  349. <view
  350. class="price tui-skeleton-rect"
  351. v-if="prop.priceFlag === 0"
  352. :class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
  353. >
  354. <text class="p sm">¥</text>
  355. <text class="p big">{{
  356. (PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
  357. | NumFormat
  358. }}</text>
  359. </view>
  360. </template>
  361. <template v-else-if="userIdentity === 2 || (userIdentity == 4 && vipFlag == 1)">
  362. <view class="title-none" v-if="prop.priceFlag === 1">
  363. <text class="p big">¥未公开价格</text>
  364. </view>
  365. <view class="title-none" v-else-if="prop.priceFlag === 3 && (firstClubType!=1)">
  366. <text class="p big">¥仅医美机构可见</text>
  367. </view>
  368. <view
  369. class="price tui-skeleton-rect"
  370. v-else
  371. :class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
  372. >
  373. <text class="p sm">¥</text>
  374. <text class="p big">{{
  375. (PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
  376. | NumFormat
  377. }}</text>
  378. </view>
  379. </template>
  380. <template v-else>
  381. <view class="title-none" v-if="prop.priceFlag === 1">
  382. <text class="p big">¥未公开价格</text>
  383. </view>
  384. <view
  385. class="price tui-skeleton-rect"
  386. v-else
  387. :class="PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? 'none' : ''"
  388. >
  389. <text class="p sm">¥</text>
  390. <text class="p big">{{
  391. (PromotionsFormat(prop.promotions) || prop.svipProductFlag == 1 ? prop.originalPrice : prop.price)
  392. | NumFormat
  393. }}</text>
  394. </view>
  395. </template>
  396. </view>
  397. <view v-else class="no-price">
  398. <view class="p-stars">
  399. <text class="p-no">¥</text>
  400. <uni-grader :grade="Number(prop.priceGrade)"></uni-grader>
  401. </view>
  402. </view>
  403. </view>
  404. </view>
  405. </view>
  406. </view>
  407. </template>
  408. <!-- ross弹窗 -->
  409. <cmRossPopup v-if="showRossHtml" :popupShow="showRossHtml"></cmRossPopup>
  410. <!-- 侧边 -->
  411. <scroll-top :isScrollTop="isScrollTop" :bottom="200"></scroll-top>
  412. </view>
  413. </template>
  414. <script>
  415. import { mapState, mapMutations } from 'vuex'
  416. import custom from './components/custom.vue' //自定义导航
  417. import banner from '../components/banner.vue'
  418. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  419. import cmRossPopup from '@/components/cm-module/cm-ross/cm-ross-popup'
  420. import authorize from '@/common/config/authorize.js'
  421. import wxLogin from '@/common/config/wxLogin.js'
  422. import cmSrsMixins from '@/mixins/cmSrsMixins.js'
  423. export default {
  424. components: {
  425. custom,
  426. banner,
  427. uniGrader,
  428. cmRossPopup
  429. },
  430. mixins: [cmSrsMixins],
  431. data() {
  432. return {
  433. CustomBar:this.CustomBar,
  434. headerBtnPosi: this.setHeaderBtnPosi(), // 获取设备顶部胶囊高度
  435. systeminfo: this.setSysteminfo(), // 获取设备信息
  436. headerColor: false,
  437. backPage: 1,
  438. userId: 0,
  439. supplierId: 0,
  440. shopId: 0,
  441. iconClass: 'icon-aixin',
  442. iconColor: '#ff9100',
  443. iconNoneData: 'https://static.caimei365.com/app/img/icon/icon-prnone.png',
  444. iconNoneData1: 'https://static.caimei365.com/app/img/icon/icon-pbnone.png',
  445. isScrollTop: false,
  446. shopName: '',
  447. shopLogo: '',
  448. normalNum: 0,
  449. isFocus: false,
  450. isEmpty: false,
  451. isShowClose: false, //是否显示清空输入框图标
  452. skeletonShow: true,
  453. bannerImageList: [],
  454. recommendList: [],
  455. productList: [],
  456. userIdentity: 0,
  457. firstClubType:0,
  458. listQuery: {
  459. keyword: '',
  460. pageSize: 10,
  461. pageNum: 1,
  462. id: 0,
  463. identity:0
  464. },
  465. isHomeProduct: false,
  466. total: 0
  467. }
  468. },
  469. computed: {
  470. ...mapState(['hasLogin', 'userInfo', 'isActivity', 'identity', 'clubType'])
  471. },
  472. onLoad(option) {
  473. if (option.type == 'share') {
  474. wxLogin.wxLoginAuthorize()
  475. }
  476. this.listQuery.id = this.supplierId = this.handleShopId = option.shopId
  477. uni.setStorageSync('pageLabel','供应商主页')
  478. this.initGetStotage()
  479. },
  480. filters: {
  481. NumFormat: function(text) {
  482. //处理金额
  483. return Number(text).toFixed(2)
  484. }
  485. },
  486. methods: {
  487. ...mapMutations(['login', 'logout']),
  488. setHeaderBtnPosi() {
  489. // 获得胶囊按钮位置信息
  490. let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
  491. return headerBtnPosi
  492. },
  493. setSysteminfo() {
  494. let systeminfo
  495. uni.getSystemInfo({
  496. // 获取设备信息
  497. success: res => {
  498. systeminfo = res
  499. }
  500. })
  501. return systeminfo
  502. },
  503. async initGetStotage(option) {
  504. const userInfo = await this.$api.getStorage()
  505. this.shopId = userInfo.shopId ? userInfo.shopId : 0
  506. this.userId = userInfo.userId ? userInfo.userId : 0
  507. this.listQuery.identity = this.identity
  508. this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
  509. this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
  510. this.firstClubType = this.clubType
  511. //初始化请求数据
  512. this.GetSupplierHomeBanner()
  513. this.GetSupplierHomeDeatils()
  514. this.GetSupplierHomeProduct()
  515. this.GetSupplierHomeProductList()
  516. this.checkedIsRossSet()
  517. this.skeletonShow = false
  518. },
  519. GetSupplierHomeBanner() {
  520. //轮播图
  521. this.ShopService.GetSupplierHomeBanner({ shopId: this.supplierId })
  522. .then(response => {
  523. this.bannerImageList = response.data
  524. })
  525. .catch(error => {
  526. this.$util.msg(error.msg, 2000)
  527. })
  528. },
  529. GetSupplierHomeDeatils() {
  530. //商铺详情
  531. this.ShopService.GetSupplierHomeDeatils({ shopId: this.supplierId })
  532. .then(response => {
  533. let data = response.data
  534. this.normalNum = data.normalNum
  535. this.shopName = data.name
  536. this.shopLogo = data.logo
  537. })
  538. .catch(error => {
  539. this.$util.msg(error.msg, 2000)
  540. })
  541. },
  542. GetSupplierHomeProduct() {
  543. //主推商品
  544. this.ShopService.GetSupplierHomeProduct({ shopId: this.supplierId, identity: this.identity })
  545. .then(response => {
  546. let data = response.data
  547. if (data.length > 0) {
  548. this.isHomeProduct = false
  549. this.QueryProductPrice(data)
  550. } else {
  551. this.isHomeProduct = true
  552. }
  553. })
  554. .catch(error => {
  555. this.$util.msg(error.msg, 2000)
  556. })
  557. },
  558. GetSupplierHomeProductList() {
  559. //全部商品
  560. this.ShopService.GetSupplierHomeProductList(this.listQuery)
  561. .then(response => {
  562. let data = JSON.parse(response.data)
  563. console.log('全部商品', data)
  564. let dataList = data.items
  565. this.total = data.total
  566. if (this.total > 0) {
  567. this.isEmpty = false
  568. this.productList = dataList
  569. this.QueryProductPrice1(this.productList)
  570. } else {
  571. this.isEmpty = true
  572. }
  573. })
  574. .catch(error => {
  575. this.$util.msg(error.msg, 2000)
  576. })
  577. },
  578. GetMoreSupplierHomeProductList() {
  579. //加载分页
  580. this.listQuery.pageNum += 1
  581. this.ShopService.GetSupplierHomeProductList(this.listQuery)
  582. .then(response => {
  583. let data = JSON.parse(response.data)
  584. this.total = data.total
  585. this.productList = this.productList.concat(data.items)
  586. this.QueryProductPrice1(this.productList)
  587. })
  588. .catch(error => {
  589. this.$util.msg(error.msg, 2000)
  590. })
  591. },
  592. QueryProductPrice(data) {
  593. //处理主推商品商品或者活动价格
  594. let productIdArr = []
  595. let productIds = ''
  596. data.map(item => {
  597. // 0公开价格 1不公开价格 2仅对资质机构公开
  598. productIdArr.push(item.productId)
  599. })
  600. productIds = productIdArr.join(',')
  601. this.ProductService.querySearchProductPrice({
  602. userId: this.userId,
  603. productIds: productIds,
  604. source: 2
  605. })
  606. .then(response => {
  607. this.recommendList = this.ReturnNewProducts(data, response.data)
  608. })
  609. .catch(error => {
  610. this.$util.msg(error.msg, 2000)
  611. })
  612. },
  613. QueryProductPrice1(data) {
  614. //获取商品或者活动价格
  615. let productIdArr = []
  616. let productIds = ''
  617. data.map(item => {
  618. // 0公开价格 1不公开价格 2仅对资质机构公开
  619. productIdArr.push(item.productId)
  620. })
  621. productIds = productIdArr.join(',')
  622. this.ProductService.querySearchProductPrice({
  623. userId: this.userId,
  624. productIds: productIds,
  625. source: 2
  626. })
  627. .then(response => {
  628. this.productList = this.ReturnNewProducts(data, response.data)
  629. })
  630. .catch(error => {
  631. this.$util.msg(error.msg, 2000)
  632. })
  633. },
  634. ReturnNewProducts(listA, listB) {
  635. let NewArray = []
  636. listA.map(item => {
  637. for (let i = 0; i < listB.length; i++) {
  638. if (item.productId == listB[i].productId) {
  639. NewArray.push(Object.assign(item, listB[i]))
  640. }
  641. }
  642. })
  643. return NewArray
  644. },
  645. SubMitSearch() {
  646. //搜索
  647. this.listQuery.pageNum = 1
  648. this.GetSupplierHomeProductList()
  649. },
  650. PromotionsFormat(promo) {
  651. //促销活动类型数据处理
  652. if (promo != null) {
  653. if (promo.type == 1 && promo.mode == 1) {
  654. return true
  655. } else {
  656. return false
  657. }
  658. }
  659. return false
  660. },
  661. onShowClose() {
  662. //输入框输入时触发
  663. this.inputEmpty(this.listQuery.keyword)
  664. },
  665. onFocus() {
  666. //输入框获取焦点时触发
  667. this.inputEmpty(this.listQuery.keyword)
  668. },
  669. delInputText() {
  670. //清除输入框内容
  671. this.listQuery.keyword = ''
  672. this.isShowClose = false
  673. this.isShowWrapper = false
  674. this.inputEmpty(this.listQuery.keyword)
  675. this.initGetSerachRecord()
  676. },
  677. inputEmpty(val) {
  678. if (val != '') {
  679. this.isShowClose = true
  680. this.isFocus = true
  681. } else {
  682. this.isShowClose = false
  683. this.isFocus = true
  684. }
  685. },
  686. isInterceptHtmlFn(text) {
  687. let name = this.$reg.interceptHtmlFn(text)
  688. return name
  689. },
  690. goSupplier() {
  691. //跳供应商资料页
  692. this.$api.navigateTo('/pages/supplier/user/supplier?shopId=' + this.supplierId)
  693. },
  694. navToDetailPage(id) {
  695. //跳转商品详情页
  696. this.$api.navigateTo(`/pages/goods/product?id=${id}`)
  697. },
  698. isShowVipFlag(pros) {
  699. /**
  700. *显示SVIP和超级会员价格:
  701. * 个人机构(不是超级会员,但价格所有机构可见),
  702. * 资质机构(不是超级会员,但价格所有机构可见或仅会员可见),
  703. * 超级会员(价格所有机构可见或仅会员可见),超级会员(是医美机构,价格仅医美可见)
  704. *商品价格是否可见:priceFlag 0:所有机构可见 1:未公开价格 2:仅会员可见 3:仅医美机构可见
  705. * 普通机构
  706. * 超级会员 && priceFlag === 0
  707. * 资质机构
  708. * priceFlag !== 1 ||
  709. * 超级会员
  710. * 商品priceFlag === 3 && 是否是医美机构
  711. */
  712. // 未登录 || 非会员
  713. if(!this.hasLogin || !this.vipFlag === 1) return false
  714. // 商品所有机构可见
  715. if(pros.priceFlag === 0 ) return true
  716. // 商品价格仅资质机构可见
  717. if((pros.priceFlag === 2 && this.userIdentity === 2) || this.userIdentity === 1) return true
  718. // 商品价格仅医美机构可见
  719. if((pros.priceFlag === 3 && this.userIdentity === 2 && this.firstClubType == 1) || this.userIdentity === 1) return true
  720. // 其它
  721. return false
  722. },
  723. },
  724. onPageScroll(e) {
  725. //实时获取到滚动的值
  726. if (e.scrollTop > 400) {
  727. this.isScrollTop = true
  728. } else {
  729. this.isScrollTop = false
  730. }
  731. },
  732. onReachBottom() {
  733. //上滑加载分页
  734. if (this.total > this.productList.length) {
  735. this.loadding = true
  736. this.pullUpOn = true
  737. this.GetMoreSupplierHomeProductList()
  738. }
  739. },
  740. onShareAppMessage(res) {
  741. //分享转发
  742. if (res.from === 'button') {
  743. // 来自页面内转发按钮
  744. }
  745. return {
  746. title: '进入店铺,发现惊喜',
  747. path: `pages/supplier/user/my-shop?type=share&shopId=${this.listQuery.id}`
  748. }
  749. },
  750. onShow() {}
  751. }
  752. </script>
  753. <style lang="scss">
  754. page {
  755. background-color: #f7f7f7;
  756. }
  757. .shop {
  758. width: 100%;
  759. height: auto;
  760. }
  761. .shop-search-main {
  762. width: 100%;
  763. height: 86rpx;
  764. background-color: #ffffff;
  765. box-sizing: border-box;
  766. padding: 10rpx 24rpx;
  767. .shop-search {
  768. width: 100%;
  769. height: 66rpx;
  770. border-radius: 33rpx;
  771. background-color: #f7f7f7;
  772. box-sizing: border-box;
  773. position: relative;
  774. .icon-sousuo {
  775. width: 80rpx;
  776. height: 66rpx;
  777. display: block;
  778. float: left;
  779. color: #707070;
  780. line-height: 66rpx;
  781. text-align: center;
  782. font-size: 36rpx;
  783. }
  784. .icon-shanchu1 {
  785. width: 80rpx;
  786. height: 66rpx;
  787. display: block;
  788. color: #8a8a8a;
  789. line-height: 66rpx;
  790. text-align: center;
  791. font-size: 36rpx;
  792. position: absolute;
  793. right: 0;
  794. top: 0;
  795. z-index: 100;
  796. }
  797. .input {
  798. width: 580rpx;
  799. height: 66rpx;
  800. box-sizing: border-box;
  801. color: #666666;
  802. overflow: hidden;
  803. font-size: $font-size-24;
  804. }
  805. }
  806. }
  807. .container-shop {
  808. width: 100%;
  809. height: auto;
  810. padding: 24rpx;
  811. box-sizing: border-box;
  812. background-color: #ffffff;
  813. margin-top: 10rpx;
  814. }
  815. .product-supplier {
  816. width: 100%;
  817. height: 140rpx;
  818. padding: 30rpx 0 10rpx 0;
  819. box-sizing: border-box;
  820. background-color: #ffffff;
  821. position: relative;
  822. box-sizing: border-box;
  823. .logo {
  824. width: 128rpx;
  825. height: 92rpx;
  826. float: left;
  827. border: 1px solid #efefef;
  828. border-radius: 6rpx;
  829. image {
  830. width: 100%;
  831. height: 100%;
  832. display: block;
  833. border-radius: 6rpx;
  834. }
  835. }
  836. .main {
  837. width: 470rpx;
  838. height: 92rpx;
  839. float: left;
  840. margin-left: 20rpx;
  841. .name {
  842. width: 100%;
  843. line-height: 46rpx;
  844. float: left;
  845. font-size: $font-size-28;
  846. color: $text-color;
  847. float: right;
  848. overflow: hidden;
  849. text-overflow: ellipsis;
  850. white-space: nowrap;
  851. text-align: left;
  852. }
  853. .massgs {
  854. width: 100%;
  855. line-height: 46rpx;
  856. float: left;
  857. font-size: $font-size-24;
  858. color: #999999;
  859. .label {
  860. float: left;
  861. }
  862. .p-stars {
  863. float: left;
  864. margin-left: 20rpx;
  865. }
  866. .acount {
  867. float: right;
  868. text {
  869. color: $color-system;
  870. }
  871. }
  872. }
  873. }
  874. .icon-xiayibu {
  875. line-height: 154rpx;
  876. display: inline-block;
  877. position: absolute;
  878. width: 48rpx;
  879. top: 0;
  880. right: 0;
  881. color: #b2b2b2;
  882. }
  883. }
  884. .container-section {
  885. width: 100%;
  886. height: auto;
  887. background-color: #f7f7f7;
  888. box-sizing: border-box;
  889. padding: 0 24rpx;
  890. .tab-title {
  891. width: 100%;
  892. height: 88rpx;
  893. line-height: 88rpx;
  894. font-size: $font-size-30;
  895. font-weight: bold;
  896. }
  897. .section-product {
  898. width: 100%;
  899. height: auto;
  900. .floor-item-none {
  901. min-height: 300rpx;
  902. display: flex;
  903. flex-direction: column;
  904. align-items: center;
  905. .none-image {
  906. width: 260rpx;
  907. height: 260rpx;
  908. }
  909. .none-text {
  910. text-align: center;
  911. font-size: $font-size-28;
  912. color: #999999;
  913. line-height: 40rpx;
  914. }
  915. }
  916. .floor-item {
  917. width: 341rpx;
  918. height: auto;
  919. margin-right: 20rpx;
  920. font-size: $font-size-24;
  921. color: $text-color;
  922. background: #ffffff;
  923. line-height: 36rpx;
  924. border-radius: 20rpx;
  925. margin-bottom: 20rpx;
  926. float: left;
  927. box-sizing: border-box;
  928. padding-bottom: 10rpx;
  929. position: relative;
  930. &:nth-child(2n) {
  931. margin-right: 0;
  932. }
  933. .floor-item-type{
  934. width: 64rpx;
  935. height: 64rpx;
  936. text-align: justify;
  937. box-sizing: border-box;
  938. padding: 10rpx;
  939. border-radius: 0 0 8rpx 8rpx;
  940. background-color: #33CCBF;
  941. font-size: $font-size-22;
  942. color: #FFFFFF;
  943. line-height: 25rpx;
  944. position: absolute;
  945. top: 0;
  946. right: 16rpx;
  947. }
  948. .item-img {
  949. width: 341rpx;
  950. height: 341rpx;
  951. border-radius: 20rpx 20rpx 0 0;
  952. display: block;
  953. margin-bottom: 20rpx;
  954. }
  955. .floor-item-content {
  956. width: 311rpx;
  957. padding: 0 15rpx;
  958. }
  959. .floor-item-act {
  960. display: block;
  961. width: 100%;
  962. height: 68rpx;
  963. text-align: center;
  964. box-sizing: border-box;
  965. padding: 16rpx 0;
  966. margin-top: 8rpx;
  967. }
  968. .title-none {
  969. font-size: $font-size-26;
  970. color: #ff2a2a;
  971. line-height: 54rpx;
  972. .btn {
  973. display: inline-block;
  974. float: right;
  975. width: 112rpx;
  976. height: 44rpx;
  977. background: $btn-confirm;
  978. line-height: 44rpx;
  979. font-size: $font-size-24;
  980. color: #ffffff;
  981. text-align: center;
  982. border-radius: 22rpx;
  983. margin-top: 17rpx;
  984. }
  985. }
  986. .title {
  987. width: 100%;
  988. height: 72rpx;
  989. display: flex;
  990. flex-direction: column;
  991. margin-bottom: 15rpx;
  992. padding: 0;
  993. position: relative;
  994. .mclap {
  995. width: 100%;
  996. line-height: 40rpx;
  997. text-overflow: ellipsis;
  998. display: -webkit-box;
  999. word-break: break-all;
  1000. -webkit-box-orient: vertical;
  1001. -webkit-line-clamp: 2;
  1002. overflow: hidden;
  1003. font-size: 26rpx;
  1004. &.indent {
  1005. text-indent: 95rpx;
  1006. }
  1007. }
  1008. .mclap-tag {
  1009. display: block;
  1010. width: 84rpx;
  1011. height: 32rpx;
  1012. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  1013. border-radius: 4rpx 48rpx 4px 4px;
  1014. line-height: 32rpx;
  1015. font-size: $font-size-22;
  1016. color: #ffffff;
  1017. text-align: center;
  1018. position: absolute;
  1019. left: 0;
  1020. top: 0;
  1021. }
  1022. }
  1023. .no-price {
  1024. height: 54rpx;
  1025. line-height: 54rpx;
  1026. display: flex;
  1027. box-sizing: border-box;
  1028. .p-no {
  1029. font-size: $font-size-30;
  1030. color: $text-color;
  1031. display: block;
  1032. float: left;
  1033. }
  1034. .p-stars {
  1035. float: left;
  1036. }
  1037. }
  1038. .price {
  1039. color: #ff2a2a;
  1040. line-height: 54rpx;
  1041. &.none {
  1042. text-decoration: line-through;
  1043. color: #999999;
  1044. }
  1045. .sm {
  1046. font-size: $font-size-24;
  1047. }
  1048. .big {
  1049. font-size: $font-size-28;
  1050. }
  1051. }
  1052. }
  1053. }
  1054. }
  1055. </style>