my-shop.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959
  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: 0,
  390. actasFlag:2,
  391. listQuery: {
  392. keyword: '',
  393. pageSize: 10,
  394. pageNum: 1,
  395. id: 0
  396. },
  397. isHomeProduct: false,
  398. total: 0
  399. }
  400. },
  401. computed: {
  402. ...mapState(['hasLogin', 'userInfo', 'isActivity', 'identity', 'isWxAuthorize'])
  403. },
  404. onLoad(option) {
  405. if (option.type == 'share') {
  406. wxLogin.wxLoginAuthorize()
  407. }
  408. this.listQuery.id = this.supplierId = option.shopId
  409. this.initGetStotage()
  410. },
  411. filters: {
  412. NumFormat: function(text) {
  413. //处理金额
  414. return Number(text).toFixed(2)
  415. }
  416. },
  417. methods: {
  418. ...mapMutations(['login', 'logout']),
  419. async initGetStotage(option) {
  420. const userInfo = await this.$api.getStorage()
  421. this.shopId = userInfo.shopId ? userInfo.shopId : 0
  422. this.userId = userInfo.userId ? userInfo.userId : 0
  423. this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
  424. this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
  425. if(this.userIdentity == 1){
  426. this.actasFlag = this.userIdentity
  427. }else{
  428. this.actasFlag = 2
  429. }
  430. //初始化请求数据
  431. this.GetSupplierHomeBanner()
  432. this.GetSupplierHomeDeatils()
  433. this.GetSupplierHomeProduct()
  434. this.GetSupplierHomeProductList()
  435. this.skeletonShow = false
  436. },
  437. GetSupplierHomeBanner() {
  438. //轮播图
  439. this.ShopService.GetSupplierHomeBanner({ shopId: this.supplierId })
  440. .then(response => {
  441. this.bannerImageList = response.data
  442. })
  443. .catch(error => {
  444. this.$util.msg(error.msg, 2000)
  445. })
  446. },
  447. GetSupplierHomeDeatils() {
  448. //商铺详情
  449. this.ShopService.GetSupplierHomeDeatils({ shopId: this.supplierId })
  450. .then(response => {
  451. let data = response.data
  452. this.normalNum = data.normalNum
  453. this.shopName = data.name
  454. this.shopLogo = data.logo
  455. })
  456. .catch(error => {
  457. this.$util.msg(error.msg, 2000)
  458. })
  459. },
  460. GetSupplierHomeProduct() {
  461. //主推商品
  462. this.ShopService.GetSupplierHomeProduct({ shopId: this.supplierId, identity: this.identity })
  463. .then(response => {
  464. let data = response.data
  465. console.log('主推商品', data)
  466. if (data.length > 0) {
  467. this.isHomeProduct = false
  468. this.QueryProductPrice(data)
  469. } else {
  470. this.isHomeProduct = true
  471. }
  472. })
  473. .catch(error => {
  474. this.$util.msg(error.msg, 2000)
  475. })
  476. },
  477. GetSupplierHomeProductList() {
  478. //全部商品
  479. this.ShopService.GetSupplierHomeProductList(this.listQuery)
  480. .then(response => {
  481. let data = JSON.parse(response.data)
  482. console.log('全部商品', data)
  483. let dataList = data.items
  484. this.total = data.total
  485. if (this.total > 0) {
  486. this.isEmpty = false
  487. this.productList = dataList
  488. this.QueryProductPrice1(this.productList)
  489. } else {
  490. this.isEmpty = true
  491. }
  492. })
  493. .catch(error => {
  494. this.$util.msg(error.msg, 2000)
  495. })
  496. },
  497. GetMoreSupplierHomeProductList() {
  498. //加载分页
  499. this.listQuery.pageNum += 1
  500. this.ShopService.GetSupplierHomeProductList(this.listQuery)
  501. .then(response => {
  502. let data = JSON.parse(response.data)
  503. this.total = data.total
  504. this.productList = this.productList.concat(data.items)
  505. this.QueryProductPrice1(this.productList)
  506. })
  507. .catch(error => {
  508. this.$util.msg(error.msg, 2000)
  509. })
  510. },
  511. QueryProductPrice(data) {
  512. //处理主推商品商品或者活动价格
  513. let productIdArr = []
  514. let productIds = ''
  515. data.map(item => {
  516. // 0公开价格 1不公开价格 2仅对资质机构公开
  517. productIdArr.push(item.productId)
  518. })
  519. productIds = productIdArr.join(',')
  520. this.ProductService.querySearchProductPrice({
  521. flag:this.actasFlag, //查询促销标记 1协销 2机构 3供应商
  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. isShowVipFlag(pros) {
  620. // 超级会员价格显示控制
  621. if (this.hasLogin && pros.priceFlag != 1) {
  622. if (this.userIdentity == 1 || (this.userIdentity == 4 && this.vipFlag == 1)) {
  623. return true
  624. } else if (this.userIdentity == 2) {
  625. return true
  626. }
  627. }
  628. }
  629. },
  630. onPageScroll(e) {
  631. //实时获取到滚动的值
  632. if (e.scrollTop > 400) {
  633. this.isScrollTop = true
  634. } else {
  635. this.isScrollTop = false
  636. }
  637. },
  638. onPullDownRefresh() {
  639. //下拉刷新
  640. this.listQuery.pageNum = 1
  641. this.productList = []
  642. this.InitShopDataInfo()
  643. uni.stopPullDownRefresh()
  644. },
  645. onReachBottom() {
  646. //上滑加载分页
  647. if (this.total > this.productList.length) {
  648. this.loadding = true
  649. this.pullUpOn = true
  650. this.GetMoreSupplierHomeProductList()
  651. }
  652. },
  653. onShareAppMessage(res) {
  654. //分享转发
  655. if (res.from === 'button') {
  656. // 来自页面内转发按钮
  657. }
  658. return {
  659. title: '进入店铺,发现惊喜',
  660. path: `pages/supplier/user/my-shop?type=share&shopId=${this.listQuery.id}`
  661. }
  662. },
  663. onShow() {}
  664. }
  665. </script>
  666. <style lang="scss">
  667. page {
  668. background-color: #f7f7f7;
  669. }
  670. .shop {
  671. width: 100%;
  672. height: auto;
  673. }
  674. .shop-search-main {
  675. width: 100%;
  676. height: 86rpx;
  677. background-color: #ffffff;
  678. box-sizing: border-box;
  679. padding: 10rpx 24rpx;
  680. position: fixed;
  681. top: 0;
  682. left: 0;
  683. z-index: 999;
  684. .shop-search {
  685. width: 100%;
  686. height: 66rpx;
  687. border-radius: 33rpx;
  688. background-color: #f7f7f7;
  689. box-sizing: border-box;
  690. position: relative;
  691. .icon-sousuo {
  692. width: 80rpx;
  693. height: 66rpx;
  694. display: block;
  695. float: left;
  696. color: #707070;
  697. line-height: 66rpx;
  698. text-align: center;
  699. font-size: 36rpx;
  700. }
  701. .icon-shanchu1 {
  702. width: 80rpx;
  703. height: 66rpx;
  704. display: block;
  705. color: #8a8a8a;
  706. line-height: 66rpx;
  707. text-align: center;
  708. font-size: 36rpx;
  709. position: absolute;
  710. right: 0;
  711. top: 0;
  712. z-index: 100;
  713. }
  714. .input {
  715. width: 580rpx;
  716. height: 66rpx;
  717. box-sizing: border-box;
  718. color: #666666;
  719. overflow: hidden;
  720. font-size: $font-size-24;
  721. }
  722. }
  723. }
  724. .container-shop {
  725. width: 100%;
  726. height: auto;
  727. padding: 24rpx;
  728. box-sizing: border-box;
  729. background-color: #ffffff;
  730. margin-top: 96rpx;
  731. }
  732. .product-supplier {
  733. width: 100%;
  734. height: 140rpx;
  735. padding: 30rpx 0 10rpx 0;
  736. box-sizing: border-box;
  737. background-color: #ffffff;
  738. position: relative;
  739. box-sizing: border-box;
  740. .logo {
  741. width: 128rpx;
  742. height: 92rpx;
  743. float: left;
  744. border: 1px solid #efefef;
  745. border-radius: 6rpx;
  746. image {
  747. width: 100%;
  748. height: 100%;
  749. display: block;
  750. border-radius: 6rpx;
  751. }
  752. }
  753. .main {
  754. width: 470rpx;
  755. height: 92rpx;
  756. float: left;
  757. margin-left: 20rpx;
  758. .name {
  759. width: 100%;
  760. line-height: 46rpx;
  761. float: left;
  762. font-size: $font-size-28;
  763. color: $text-color;
  764. float: right;
  765. overflow: hidden;
  766. text-overflow: ellipsis;
  767. white-space: nowrap;
  768. text-align: left;
  769. }
  770. .massgs {
  771. width: 100%;
  772. line-height: 46rpx;
  773. float: left;
  774. font-size: $font-size-24;
  775. color: #999999;
  776. .label {
  777. float: left;
  778. }
  779. .p-stars {
  780. float: left;
  781. margin-left: 20rpx;
  782. }
  783. .acount {
  784. float: right;
  785. text {
  786. color: $color-system;
  787. }
  788. }
  789. }
  790. }
  791. .icon-xiayibu {
  792. line-height: 154rpx;
  793. display: inline-block;
  794. position: absolute;
  795. width: 48rpx;
  796. top: 0;
  797. right: 0;
  798. color: #b2b2b2;
  799. }
  800. }
  801. .container-section {
  802. width: 100%;
  803. height: auto;
  804. background-color: #f7f7f7;
  805. box-sizing: border-box;
  806. padding: 0 24rpx;
  807. .tab-title {
  808. width: 100%;
  809. height: 88rpx;
  810. line-height: 88rpx;
  811. font-size: $font-size-30;
  812. font-weight: bold;
  813. }
  814. .section-product {
  815. width: 100%;
  816. height: auto;
  817. .floor-item-none {
  818. min-height: 300rpx;
  819. display: flex;
  820. flex-direction: column;
  821. align-items: center;
  822. .none-image {
  823. width: 260rpx;
  824. height: 260rpx;
  825. }
  826. .none-text {
  827. text-align: center;
  828. font-size: $font-size-28;
  829. color: #999999;
  830. line-height: 40rpx;
  831. }
  832. }
  833. .floor-item {
  834. width: 341rpx;
  835. height: auto;
  836. margin-right: 20rpx;
  837. font-size: $font-size-24;
  838. color: $text-color;
  839. background: #ffffff;
  840. line-height: 36rpx;
  841. border-radius: 20rpx;
  842. margin-bottom: 20rpx;
  843. float: left;
  844. box-sizing: border-box;
  845. padding-bottom: 10rpx;
  846. &:nth-child(2n) {
  847. margin-right: 0;
  848. }
  849. .item-img {
  850. width: 341rpx;
  851. height: 341rpx;
  852. border-radius: 20rpx 20rpx 0 0;
  853. display: block;
  854. margin-bottom: 20rpx;
  855. }
  856. .floor-item-content {
  857. width: 311rpx;
  858. padding: 0 15rpx;
  859. }
  860. .floor-item-act {
  861. display: block;
  862. width: 100%;
  863. height: 68rpx;
  864. text-align: center;
  865. box-sizing: border-box;
  866. padding: 16rpx 0;
  867. margin-top: 8rpx;
  868. }
  869. .title-none {
  870. font-size: $font-size-26;
  871. color: #ff2a2a;
  872. line-height: 54rpx;
  873. .btn {
  874. display: inline-block;
  875. float: right;
  876. width: 112rpx;
  877. height: 44rpx;
  878. background: $btn-confirm;
  879. line-height: 44rpx;
  880. font-size: $font-size-24;
  881. color: #ffffff;
  882. text-align: center;
  883. border-radius: 22rpx;
  884. margin-top: 17rpx;
  885. }
  886. }
  887. .title {
  888. width: 100%;
  889. height: 72rpx;
  890. display: flex;
  891. flex-direction: column;
  892. margin-bottom: 15rpx;
  893. padding: 0;
  894. position: relative;
  895. .mclap {
  896. width: 100%;
  897. line-height: 40rpx;
  898. text-overflow: ellipsis;
  899. display: -webkit-box;
  900. word-break: break-all;
  901. -webkit-box-orient: vertical;
  902. -webkit-line-clamp: 2;
  903. overflow: hidden;
  904. font-size: 26rpx;
  905. &.indent {
  906. text-indent: 95rpx;
  907. }
  908. }
  909. .mclap-tag {
  910. display: block;
  911. width: 84rpx;
  912. height: 32rpx;
  913. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  914. border-radius: 4rpx 48rpx 4px 4px;
  915. line-height: 32rpx;
  916. font-size: $font-size-22;
  917. color: #ffffff;
  918. text-align: center;
  919. position: absolute;
  920. left: 0;
  921. top: 0;
  922. }
  923. }
  924. .no-price {
  925. height: 54rpx;
  926. line-height: 54rpx;
  927. display: flex;
  928. box-sizing: border-box;
  929. .p-no {
  930. font-size: $font-size-30;
  931. color: $text-color;
  932. display: block;
  933. float: left;
  934. }
  935. .p-stars {
  936. float: left;
  937. }
  938. }
  939. .price {
  940. color: #ff2a2a;
  941. line-height: 54rpx;
  942. &.none {
  943. text-decoration: line-through;
  944. color: #999999;
  945. }
  946. .sm {
  947. font-size: $font-size-24;
  948. }
  949. .big {
  950. font-size: $font-size-28;
  951. }
  952. }
  953. }
  954. }
  955. }
  956. </style>