my-shop.vue 26 KB

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