my-shop.vue 25 KB

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