my-shop.vue 28 KB

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