my-shop.vue 29 KB

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