多租户商城-商户小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1114 lines
26 KiB

2 years ago
2 years ago
  1. <template>
  2. <view class="container">
  3. <global-loading />
  4. <!-- 店铺首页 -->
  5. <view class="content" v-if="id">
  6. <view class="shop-top" :style="{'padding-top': topHeight + 'px'}">
  7. <image src="https://ceres.zkthink.com/static/images/back_img04.png" class="back" @click="back"></image>
  8. <view class="search-btn" @click="searchPro">
  9. <image class="search-icon" src="https://ceres.zkthink.com/static/img/searchImg.png" mode="widthFix">
  10. </image>
  11. <text class="fs24 font-color-999 mar-left-10">请输入您想要的宝贝</text>
  12. </view>
  13. </view>
  14. <view class="stopInfo">
  15. <view class="shop-top-content">
  16. <view class="contentLeft">
  17. <image :src="storeInfo.shopLogo" class="photo-img"></image>
  18. <view class="shop-info-top">
  19. <view class="shop-name">
  20. <text class="shop-name">{{storeInfo.shopName}}</text>
  21. <text class="shop-num">粉丝数{{fansNumber}}</text>
  22. </view>
  23. <!-- #ifdef MP-WEIXIN -->
  24. <view v-if="hasService" class="btns flex-column-plus mar-left-10" @click="flyToService">
  25. <image class="store-icon"
  26. src="https://ceres.zkthink.com/static/images/service-product-detail.png"></image>
  27. <text>客服</text>
  28. </view>
  29. <!-- #endif -->
  30. </view>
  31. </view>
  32. <view class="contentRight">
  33. <view class="favorites-box cur-poi" @click="collectToggle">
  34. <image v-if="ifCollect === 0" class="store-icon"
  35. src="https://ceres.zkthink.com/static/images/iconShoucang.png">
  36. </image>
  37. <image v-else class="store-icon"
  38. src="https://ceres.zkthink.com/static/images/shoucangActive.png"></image>
  39. <text class="text">{{ifCollect === 0? '收藏' : '取消'}}</text>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="distributorBox flex-items flex-sp-between" @click="applyForRecruit">
  44. <view class="distributor">
  45. <view class="flex-display flex-items">
  46. <image class="item-btn-icon" src="https://ceres.zkthink.com/static/img/user/fenxiao2.png"
  47. mode="widthFix"></image>
  48. <view>成为分销员</view>
  49. </view>
  50. </view>
  51. <view class="rightArrow">
  52. <image src="https://ceres.zkthink.com/static/images/arrowRight.png"></image>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="shopContent">
  57. <view class="tabs-nav-warp">
  58. <scroll-view class="tabs-nav" scroll-x="true">
  59. <view class="ul">
  60. <view class="li" :class="{'on':activeTab==='index'}" @click="tabChange('index')">首页</view>
  61. <view class="li" :class="{'on':activeTab==='all'}" @click="tabChange('all')">全部</view>
  62. <view class="li" v-for="(item,index) in classList" :key="index"
  63. :class="{'on':activeTab===item.classifyId}" @click="tabChange(item.classifyId)">
  64. {{item.classifyName}}
  65. </view>
  66. </view>
  67. </scroll-view>
  68. </view>
  69. <view v-if="activeTab=== 'index'">
  70. <canvas-page :componentsData="componentsData" :terminal="terminal" :typeId="3" :shopId="id">
  71. </canvas-page>
  72. </view>
  73. <view v-else>
  74. <view class="shop-banner-box" v-if="bannerInfo && bannerInfo.length > 0">
  75. <swiper indicator-dots="true">
  76. <swiper-item v-for="(item, index) in bannerInfo" :key="index" @click="applyForRecruit()">
  77. <image :src="item.bannerImage" class="shop-banner-img"></image>
  78. </swiper-item>
  79. </swiper>
  80. </view>
  81. <view class="shop-list-content">
  82. <!-- <view class="shop-list-nav">-->
  83. <!-- <view class="nav-item padd-l" :class="{'active' : navIndex == 0}" @click="navIndexTap(0)">-->
  84. <!-- <text class="nav-title">全部商品</text>-->
  85. <!-- <text class="line"></text>-->
  86. <!-- </view>-->
  87. <!-- <view class="nav-item padd-r" :class="{'active' : navIndex == 1}" @click="navIndexTap(1)">-->
  88. <!-- <text class="nav-title">分类查看</text>-->
  89. <!-- <text class="line"></text>-->
  90. <!-- </view>-->
  91. <!-- </view>-->
  92. <block v-if='isShowGoods'>
  93. <view class="navBox">
  94. <view class="shop-list-nav">
  95. <view class="nav-item-sort" @click="sortTap(1)">
  96. <text class="nav-title" :class="{'active' : sortIndex == 1}">新品</text>
  97. </view>
  98. <view class="nav-item-sort" @click="sortTap(2)">
  99. <text class="nav-title" :class="{'active' : sortIndex == 2}">价格</text>
  100. <view class="r">
  101. <image src="https://ceres.zkthink.com/static/images/arrowSortUp.png"
  102. v-if="type == 1" class="arrow-img padd-t"></image>
  103. <image src="https://ceres.zkthink.com/static/images/arrowSortDown.png"
  104. v-if="type == 2" class="arrow-img padd-b"></image>
  105. </view>
  106. </view>
  107. <view class="nav-item-sort" @click="sortTap(3)">
  108. <text class="nav-title" :class="{'active' : sortIndex == 3}">销量</text>
  109. <view class="r">
  110. <image src="https://ceres.zkthink.com/static/images/arrowSortUp.png"
  111. v-if="volume == 1" class="arrow-img padd-t"></image>
  112. <image src="https://ceres.zkthink.com/static/images/arrowSortDown.png"
  113. v-if="volume == 2" class="arrow-img padd-b"></image>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. <view class="shop-list-box" v-if="total > 0">
  119. <view class="item" v-for="(cItem, index) in storeInfolist" :key="index"
  120. @click="goodsItemTap(cItem.productId,cItem.skuId)">
  121. <image :src="cItem.image" class="product-img default-img"
  122. onerror="this.src='url(https://ceres.zkthink.com/static/root/default.png) no-repeat center';this.οnerrοr=null"></image>
  123. <view class="product-bottom-box">
  124. <view class="product-name">{{cItem.productName}}</view>
  125. <view class="product-num font-color-C5AA7B mar-top-10">已售{{cItem.number}}
  126. </view>
  127. <view class="product-price-box">
  128. <image v-if="cItem.activityType===1" class="iconImg"
  129. src="https://ceres.zkthink.com/static/images/groupBuyIcon.png"
  130. alt="拼团icon"></image>
  131. <image v-if="cItem.activityType === 2" class="iconImg"
  132. src="https://ceres.zkthink.com/static/images/spikeIcon.png" alt="秒杀活动">
  133. </image>
  134. <image v-if="cItem.activityType === 3" class="iconImg discountIcon"
  135. src="https://zk-cereshop.oss-cn-shenzhen.aliyuncs.com/zkthink/2022-03-14/38184785db4b4fbca767ada611097ae9_discount.png"
  136. alt="限时折扣活动"></image>
  137. <image v-if="cItem.activityType === 4" class="iconImg"
  138. src="https://ceres.zkthink.com/static/images/spikeIcon.png" alt="平台秒杀">
  139. </image>
  140. <image v-if="cItem.activityType===5" class="iconImg"
  141. src="https://ceres.zkthink.com/static/images/discountListIcon.png"
  142. alt="平台折扣"></image>
  143. <image v-if="cItem.activityType===9" class="iconImg"
  144. src="https://ceres.zkthink.com/static/images/memberCenterIcon.png"
  145. alt="会员价"></image>
  146. <image v-if="cItem.activityType === 8" class="iconImg"
  147. src="https://zk-cereshop.oss-cn-shenzhen.aliyuncs.com/zkthink/2022-02-15/d0d8d96f28904167b271de4ae924d1a8_sceneMarketing.png"
  148. alt="场景营销"></image>
  149. <text
  150. class="price-box fs40 font-color-C83732 mar-right-20">{{cItem.price}}</text>
  151. <text class="price-through">{{cItem.originalPrice}}</text>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <view class='empty-container' v-else>
  157. <image src="/images/kong4.png"></image>
  158. <text>暂无商品</text>
  159. </view>
  160. </block>
  161. </view>
  162. </view>
  163. </view>
  164. </view>
  165. </view>
  166. </template>
  167. <script>
  168. const NET = require('../../utils/request')
  169. const API = require('../../config/api')
  170. import api from '@/components/canvasShow/config/api'
  171. import canvasPage from '@/components/canvasShow/canvasShowPage.vue'
  172. export default {
  173. data() {
  174. return {
  175. componentsData: [],
  176. navIndex: 0,
  177. id: '',
  178. price: 0,
  179. storeInfo: {},
  180. classList: [],
  181. dataList: [],
  182. isShowGoods: true,
  183. sortIndex: 0,
  184. list: [],
  185. bannerInfo: [],
  186. total: 0,
  187. ifNew: 0, //是否新品
  188. type: 1, //价格排序条件
  189. volume: 1, //销量排序条件
  190. page: 1, //当前页
  191. pageSize: 20, //每页记录数
  192. classifyId: '',
  193. loadingType: 0,
  194. storeInfolist: [],
  195. isIphone: false,
  196. activeTab: 'index',
  197. terminal: API.terminal,
  198. collectId: 0,
  199. ifCollect: 0,
  200. salesId: 0, //分销员id
  201. fansNumber: '', // 粉丝数
  202. topHeight: 10,
  203. hasService: false,
  204. isLoading: false,
  205. }
  206. },
  207. components: {
  208. canvasPage
  209. },
  210. onLoad(options) {
  211. // #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
  212. let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  213. this.topHeight = menuButtonInfo.top
  214. // #endif
  215. // #ifdef APP
  216. this.topHeight = 50
  217. // #endif
  218. this.isIphone = getApp().globalData.isIphone;
  219. if (getApp().globalData.shopShareItem) {
  220. const item = getApp().globalData.shopShareItem
  221. this.id = parseInt(item.storeId)
  222. this.salesId = parseInt(item.salesId)
  223. getApp().globalData.shopShareItem = undefined
  224. } else {
  225. this.id = parseInt(options.storeId)
  226. this.salesId = parseInt(options.salesId)
  227. }
  228. this.bindSalesCustomer(this.salesId, this.id)
  229. this.canvasGet()
  230. this.getTemplate()
  231. this.getFindProductGroupList()
  232. this.getShopBanner()
  233. this.getShopInfo()
  234. this.addBusinessBuyerUser();
  235. // #ifdef MP-WEIXIN
  236. this.getServiceUrl(this.id)
  237. // #endif
  238. },
  239. onReachBottom() {
  240. if (this.loadingType == 1) {
  241. uni.stopPullDownRefresh()
  242. } else {
  243. this.page = this.page + 1
  244. this.getTemplate()
  245. }
  246. },
  247. methods: {
  248. // 读取画布
  249. canvasGet() {
  250. var _this = this
  251. var apiUrl = api.getCanvas + '?terminal=' + this.terminal + '&type=' + 3
  252. if (this.id) {
  253. apiUrl += '&shopId=' + this.id
  254. }
  255. let params = {
  256. url: apiUrl,
  257. method: 'GET'
  258. }
  259. // uni.showLoading({
  260. // mask: true,
  261. // title: '加载中...',
  262. // })
  263. NET.request(apiUrl, {}, 'GET').then(res => {
  264. if (JSON.stringify(res.data) !== '{}') {
  265. var componentsData = JSON.parse(res.data.json)
  266. this.componentsData = componentsData
  267. }
  268. uni.hideLoading()
  269. }).catch(res => {
  270. uni.hideLoading()
  271. })
  272. },
  273. getShopBanner() {
  274. NET.request(API.GetShopBanner, {
  275. shopId: this.id
  276. }, 'GET').then(res => {
  277. this.bannerInfo = res.data
  278. }).catch(res => {
  279. })
  280. },
  281. getTemplate() {
  282. let data = {
  283. shopId: this.id,
  284. ifNew: this.ifNew,
  285. type: this.type,
  286. volume: this.volume,
  287. page: this.page,
  288. pageSize: this.pageSize,
  289. groupId: this.classifyId
  290. }
  291. // uni.showLoading({
  292. // title: '加载中...',
  293. // mask: true
  294. // });
  295. NET.request(API.GetStore, data, 'GET').then(res => {
  296. uni.hideLoading()
  297. if (res.data.page.list.length == 0) {
  298. this.loadingType = 1
  299. this.page = this.page
  300. }
  301. this.storeInfo = res.data;
  302. this.total = res.data.page.total
  303. this.storeInfolist = this.storeInfolist.concat(res.data.page.list)
  304. }).catch(res => {
  305. uni.hideLoading()
  306. uni.showToast({
  307. title: res.data.message,
  308. duration: 2000,
  309. icon: 'none'
  310. });
  311. })
  312. },
  313. // 查询店铺分组数据
  314. getFindProductGroupList() {
  315. NET.request(API.GetStoreShopClassify, {
  316. shopId: this.id
  317. }, 'GET').then(res => {
  318. this.classList = res.data.filter(item => JSON.stringify(item) !== "{}")
  319. }).catch(res => {})
  320. },
  321. goodsItemTap(productId, skuId) {
  322. uni.navigateTo({
  323. url: '../goodsModule/goodsDetails?shopId=' + this.id + '&productId=' + productId + '&skuId=' +
  324. skuId
  325. })
  326. },
  327. navIndexTap(index) {
  328. this.storeInfolist = []
  329. this.navIndex = index,
  330. this.isShowGoods = index == 0
  331. if (index == 0) {
  332. this.page = 1
  333. this.classifyId = ''
  334. this.getTemplate()
  335. } else {
  336. this.isShowGoods = false
  337. }
  338. },
  339. back() {
  340. uni.navigateBack()
  341. },
  342. sortTap(index) {
  343. this.page = 1
  344. this.storeInfolist = []
  345. if (index == 1) {
  346. this.ifNew = this.ifNew != 0 ? 0 : 1,
  347. this.type = 1,
  348. this.volume = 1,
  349. this.sortIndex = index
  350. } else if (index == 2) {
  351. this.ifNew = 0,
  352. this.type = this.type != 1 ? 1 : 2,
  353. this.volume = 1,
  354. this.sortIndex = index
  355. } else if (index == 3) {
  356. this.ifNew = 0,
  357. this.type = 1,
  358. this.volume = this.volume != 1 ? 1 : 2,
  359. this.sortIndex = index
  360. }
  361. this.getTemplate()
  362. },
  363. classItemTap(classifyId) {
  364. this.page = 1
  365. this.classifyId = classifyId
  366. this.isShowGoods = true
  367. this.storeInfolist = []
  368. this.getTemplate()
  369. },
  370. // 栏目切换
  371. tabChange(key) {
  372. this.activeTab = key
  373. if (key !== 'index') {
  374. this.page = 1
  375. this.classifyId = key === 'all' ? '' : key
  376. this.storeInfolist = []
  377. this.getTemplate()
  378. }
  379. },
  380. //判断是否已申请成为该店铺的分销员
  381. applyForRecruit() {
  382. const res = uni.getStorageSync('storage_key');
  383. const token = res.token
  384. if (token) {
  385. let item = {}
  386. if (uni.getStorageSync('storage_key')) {
  387. item = uni.getStorageSync('storage_key');
  388. }
  389. if (JSON.stringify(item) == '{}') {
  390. } else {
  391. NET.request(API.HasApply, {
  392. shopId: this.id
  393. }, 'GET').then(res => {
  394. if (res.data.distributorId == undefined) {
  395. uni.navigateTo({
  396. url: '../distributionModule/recruit?shopId=' + this.id
  397. })
  398. } else if (res.data.state === 1) {
  399. uni.showToast({
  400. title: "您已申请成为该店铺的分销员",
  401. icon: "none"
  402. })
  403. } else {
  404. uni.showToast({
  405. title: "您的申请正在审核中,请稍后查看",
  406. icon: "none"
  407. })
  408. }
  409. }).catch(res => {})
  410. }
  411. } else {
  412. uni.showToast({
  413. title: '请先登录',
  414. icon: "none"
  415. })
  416. uni.navigateTo({
  417. url: '/pages_category_page2/userModule/login'
  418. })
  419. }
  420. },
  421. bindSalesCustomer(salesId, storeId) {
  422. if (salesId && storeId) {
  423. //如果已登录,静默绑定客户关系,否则跳转到登录页面
  424. if (uni.getStorageSync('storage_key')) {
  425. NET.request(API.BindSalesCustomer, {
  426. shopId: storeId,
  427. distributorId: salesId
  428. }, 'POST').then(res => {
  429. uni.showToast({
  430. title: "绑定成功",
  431. icon: "none"
  432. })
  433. }).catch(res => {
  434. uni.showToast({
  435. title: res.data.msg,
  436. icon: "none"
  437. })
  438. })
  439. } else {
  440. uni.setStorageSync('salesId', salesId)
  441. uni.setStorageSync("shopId", storeId)
  442. uni.navigateTo({
  443. url: '../../pages_category_page2/userModule/login'
  444. })
  445. }
  446. }
  447. },
  448. // 获取店铺信息
  449. getShopInfo() {
  450. var _this = this;
  451. NET.request(API.getShopIndex + `?shopId=${this.id}`, null,
  452. 'GET').then(function(res) {
  453. _this.ifCollect = res.data.ifCollect;
  454. _this.collectId = res.data.collectId;
  455. _this.fansNumber = res.data.fansNumber;
  456. }).catch(function(res) {
  457. uni.showToast({
  458. title: '失败',
  459. icon: "none"
  460. });
  461. });
  462. },
  463. //收藏店辅
  464. collectToggle() {
  465. const res = uni.getStorageSync('storage_key');
  466. const token = res.token
  467. if (token) {
  468. if (this.ifCollect == 0) {
  469. this.collectShop();
  470. } else {
  471. this.cancelCollectShop();
  472. }
  473. } else {
  474. uni.showToast({
  475. title: '请先登录',
  476. icon: "none"
  477. })
  478. uni.navigateTo({
  479. url: '/pages_category_page2/userModule/login'
  480. })
  481. }
  482. },
  483. //收藏
  484. collectShop() {
  485. var _this = this;
  486. NET.request(API.collect, {
  487. shopId: parseInt(this.id)
  488. },
  489. 'POST').then(function(res) {
  490. _this.ifCollect = 1;
  491. uni.showToast({
  492. title: '收藏成功',
  493. icon: "success"
  494. });
  495. }).catch(function(res) {
  496. uni.showToast({
  497. title: '失败',
  498. icon: "none"
  499. });
  500. });
  501. },
  502. //取消收藏
  503. cancelCollectShop() {
  504. var _this2 = this;
  505. NET.request(API.cancelCollect, {
  506. ids: [this.collectId]
  507. },
  508. 'POST').then(function(res) {
  509. _this2.ifCollect = 0;
  510. uni.showToast({
  511. title: '取消收藏成功',
  512. icon: "success"
  513. });
  514. }).catch(function(res) {
  515. uni.showToast({
  516. title: '失败',
  517. icon: "none"
  518. });
  519. });
  520. },
  521. addBusinessBuyerUser() {
  522. NET.request(API.AddBusinessBuyerUser, {
  523. shopId: this.id
  524. }, "POST")
  525. },
  526. // 查询产品
  527. searchPro(key, type) {
  528. uni.navigateTo({
  529. url: `/pages_category_page1/search/index/index`
  530. })
  531. },
  532. // 获取客服url
  533. getServiceUrl(id) {
  534. if (this.isLoading || !id || id === 'null') {
  535. return
  536. }
  537. const shopids = uni.getStorageSync('service_shopids') || []
  538. const corpIds = uni.getStorageSync('service_corpIds') || []
  539. const urls = uni.getStorageSync('service_urls') || []
  540. const index = shopids.indexOf(id)
  541. if (index === -1) {
  542. this.isLoading = true
  543. NET.request(API.CustomerService, {
  544. id
  545. }, 'get').then(res => {
  546. if (res.code === '' && res.data.corpId && res.data.url) {
  547. shopids.push(this.shopId)
  548. corpIds.push(res.data.corpId)
  549. urls.push(res.data.url)
  550. uni.setStorageSync('service_shopids', shopids);
  551. uni.setStorageSync('service_corpIds', corpIds);
  552. uni.setStorageSync('service_urls', urls);
  553. this.corpId = res.data.corpId
  554. this.serviceURL = res.data.url
  555. if (this.serviceURL) {
  556. this.hasService = true
  557. }
  558. }
  559. this.isLoading = false
  560. }).catch(err => {
  561. this.isLoading = false
  562. })
  563. } else {
  564. this.corpId = corpIds[index]
  565. this.serviceURL = urls[index]
  566. if (this.serviceURL) {
  567. this.hasService = true
  568. }
  569. }
  570. },
  571. // 跳转客服
  572. flyToService() {
  573. if (!this.serviceURL || !this.corpId) {
  574. this.hasService = false
  575. return
  576. }
  577. const extInfo = { // 客服信息
  578. url: this.serviceURL // 客服链接
  579. }
  580. // #ifdef MP-WEIXIN
  581. wx.openCustomerServiceChat({
  582. extInfo,
  583. corpId: this.corpId // 企业ID
  584. })
  585. // #endif
  586. },
  587. }
  588. }
  589. </script>
  590. <style lang="scss" scoped>
  591. page {
  592. background: #F8F8F8;
  593. }
  594. </style>
  595. <style lang='scss' scoped>
  596. page {
  597. background: #F8F8F8;
  598. }
  599. .shop-top {
  600. background: #333333;
  601. display: flex;
  602. align-items: center;
  603. width: 100%;
  604. position: fixed;
  605. z-index: 99;
  606. padding-bottom: 20rpx;
  607. }
  608. // #ifdef APP-PLUS
  609. .shop-top {
  610. padding-top: 80rpx;
  611. }
  612. // #endif
  613. .stopInfo {
  614. padding: 200rpx 20rpx 20rpx 20rpx;
  615. background: #F8F8F8;
  616. }
  617. // 店铺头部
  618. .shop-top-content {
  619. padding: 10rpx 30rpx;
  620. background: #FFFFFF;
  621. display: flex;
  622. align-items: center;
  623. .contentLeft {
  624. flex: 9;
  625. display: flex;
  626. .photo-img {
  627. width: 102rpx;
  628. height: 102rpx;
  629. border-radius: 10rpx;
  630. margin-right: 10rpx;
  631. }
  632. .shop-info-top {
  633. border-radius: 20rpx 20rpx 0 0;
  634. position: relative;
  635. display: flex;
  636. align-items: center;
  637. .shop-name {
  638. display: flex;
  639. flex-direction: column;
  640. justify-content: space-between;
  641. font-size: 32rpx;
  642. color: #333333;
  643. .shop-num {
  644. font-size: 26rpx;
  645. color: #333333;
  646. opacity: 0.7;
  647. margin-top: 15rpx;
  648. }
  649. }
  650. .btns {
  651. width: 100rpx;
  652. height: 95%;
  653. font-size: 24rpx;
  654. text-align: center;
  655. image {
  656. max-width: 56rpx;
  657. max-height: 56rpx;
  658. margin: auto;
  659. }
  660. }
  661. }
  662. }
  663. .contentRight {
  664. flex: 3;
  665. .favorites-box {
  666. display: flex;
  667. width: 160rpx;
  668. height: 60rpx;
  669. background: #C83732;
  670. opacity: 1;
  671. border-radius: 46rpx;
  672. align-items: center;
  673. justify-content: center;
  674. .store-icon {
  675. width: 32rpx;
  676. height: 32rpx;
  677. margin-right: 8rpx;
  678. }
  679. .text {
  680. font-size: 26rpx;
  681. color: #fff;
  682. }
  683. }
  684. }
  685. }
  686. .rightArrow {
  687. image {
  688. width: 18rpx;
  689. height: 24rpx;
  690. }
  691. }
  692. .distributorBox {
  693. background: #FFFFFF;
  694. margin-top: 20rpx;
  695. height: 80rpx;
  696. padding: 0 20rpx;
  697. display: flex;
  698. justify-items: center;
  699. color: #333333;
  700. font-size: 28rpx;
  701. }
  702. // 首页内容
  703. .shopContent {
  704. width: 100%;
  705. /* background: #fff; */
  706. border-radius: 20rpx 20rpx 0 0;
  707. .tabs-nav-warp {
  708. padding: 0 20px;
  709. .tabs-nav {
  710. margin-top: 20upx;
  711. .ul {
  712. white-space: nowrap;
  713. .li {
  714. display: inline-block;
  715. margin-left: 60upx;
  716. font-size: 28upx;
  717. color: #999999;
  718. position: relative;
  719. padding-bottom: 18upx;
  720. &:first-child {
  721. margin-left: 0;
  722. }
  723. &.on {
  724. &:after {
  725. content: '';
  726. width: 100%;
  727. height: 4upx;
  728. background: #C5AA7B;
  729. position: absolute;
  730. left: 0;
  731. bottom: 0;
  732. }
  733. font-weight:bold;
  734. color: #333333;
  735. }
  736. }
  737. }
  738. }
  739. }
  740. .shop-banner-box {
  741. background: #f7f7f7;
  742. padding: 20rpx 30rpx;
  743. box-sizing: border-box;
  744. }
  745. .shop-list-content {
  746. width: 100%;
  747. /* background: #fff; */
  748. .navBox {
  749. padding: 0 20rpx;
  750. .shop-list-nav {
  751. display: flex;
  752. flex-direction: row;
  753. align-items: center;
  754. height: 80rpx;
  755. line-height: 76rpx;
  756. background: #fff;
  757. }
  758. }
  759. .shop-list-box {
  760. width: 100%;
  761. background: #f7f7f7;
  762. padding: 16rpx 20rpx 0;
  763. box-sizing: border-box;
  764. display: flex;
  765. flex-wrap: wrap;
  766. .item {
  767. width: 49%;
  768. margin: 12rpx 0;
  769. background: #d6d6d6;
  770. border-radius: 10rpx;
  771. display: flex;
  772. flex-direction: column;
  773. }
  774. .item:nth-of-type(2n) {
  775. margin-left: 2%;
  776. margin-right: 0;
  777. }
  778. }
  779. }
  780. }
  781. .shop-banner-img {
  782. width: 100%;
  783. height: 280rpx;
  784. border-radius: 20rpx;
  785. }
  786. .nav-item {
  787. flex: 1;
  788. font-size: 30rpx;
  789. color: #666;
  790. display: flex;
  791. flex-direction: column;
  792. align-items: center;
  793. height: 80rpx;
  794. line-height: 76rpx;
  795. }
  796. .nav-item.active {
  797. color: #ff7911;
  798. }
  799. .nav-item .line {
  800. display: inline-block;
  801. width: 80rpx;
  802. height: 4rpx;
  803. background: #fff;
  804. border-radius: 2rpx;
  805. }
  806. .nav-item.active .line {
  807. background: linear-gradient(0deg, rgba(255, 162, 0, 1), rgba(255, 121, 17, 1));
  808. }
  809. .nav-item.padd-l {
  810. padding-left: 20%;
  811. box-sizing: border-box;
  812. }
  813. .nav-item.padd-r {
  814. padding-right: 20%;
  815. box-sizing: border-box;
  816. }
  817. .nav-item-sort {
  818. flex: 1;
  819. font-size: 24rpx;
  820. color: #222;
  821. display: flex;
  822. flex-direction: row;
  823. align-items: center;
  824. justify-content: center;
  825. height: 80rpx;
  826. line-height: 80rpx;
  827. .r {
  828. display: flex;
  829. flex-direction: column;
  830. align-items: center;
  831. justify-content: center;
  832. margin-left: 5rpx;
  833. }
  834. .r .arrow-img {
  835. width: 32rpx;
  836. height: 32rpx;
  837. padding: 7rpx;
  838. box-sizing: border-box;
  839. }
  840. }
  841. .product-img {
  842. width: 347rpx;
  843. height: 347rpx;
  844. }
  845. .product-bottom-box {
  846. padding: 20rpx;
  847. box-sizing: border-box;
  848. background: #fff;
  849. }
  850. .product-name {
  851. display: block;
  852. font-size: 28rpx;
  853. color: #333;
  854. overflow: hidden;
  855. text-overflow: ellipsis;
  856. white-space: nowrap;
  857. }
  858. .product-num {
  859. font-size: 24rpx;
  860. margin-top: 15rpx;
  861. border: 2rpx solid #E4E5E6;
  862. padding: 10rpx;
  863. display: inline-block;
  864. }
  865. .product-price-box {
  866. width: 100%;
  867. display: flex;
  868. flex-direction: row;
  869. align-items: center;
  870. margin-top: 30rpx;
  871. .iconImg {
  872. width: 58rpx;
  873. height: 36rpx;
  874. margin-right: 10rpx;
  875. }
  876. .discountIcon {
  877. width: 100rpx;
  878. }
  879. }
  880. .product-price-box .price-through {
  881. text-decoration: line-through;
  882. font-size: 24rpx;
  883. color: #CCC;
  884. }
  885. .shop-sort-list {
  886. margin-top: 20rpx;
  887. width: 100%;
  888. display: flex;
  889. flex-direction: column;
  890. }
  891. .shop-sort-list .item {
  892. display: flex;
  893. flex-direction: column;
  894. background: #fff;
  895. padding: 0 30rpx 20rpx;
  896. box-sizing: border-box;
  897. margin-bottom: 20rpx;
  898. }
  899. .shop-sort-list .item .sort-title {
  900. font-size: 30rpx;
  901. color: #333;
  902. padding: 30rpx 0;
  903. }
  904. .sort-single-box {
  905. display: flex;
  906. flex-direction: row;
  907. flex-wrap: wrap;
  908. width: 100%;
  909. }
  910. .sort-single-box .single {
  911. width: 340rpx;
  912. height: 78rpx;
  913. margin: 0 5rpx 10rpx 0;
  914. background: #fff;
  915. border: 1px solid #E5E5E5;
  916. border-radius: 4rpx;
  917. display: flex;
  918. flex-direction: column;
  919. align-items: center;
  920. justify-content: center;
  921. font-size: 26rpx;
  922. color: #333;
  923. box-sizing: border-box;
  924. }
  925. .sort-single-box .single:nth-of-type(2n) {
  926. margin-left: 5rpx;
  927. margin-right: 0;
  928. }
  929. .back {
  930. width: 50rpx;
  931. height: 50rpx;
  932. padding: 0 20rpx;
  933. }
  934. .empty-container {
  935. width: 100%;
  936. display: flex;
  937. flex-direction: column;
  938. align-items: center;
  939. justify-content: center;
  940. }
  941. .empty-container image {
  942. width: 200rpx;
  943. height: 200rpx;
  944. margin-top: 150rpx;
  945. }
  946. .empty-container text {
  947. font-size: 28rpx;
  948. color: #999;
  949. margin-top: 30rpx;
  950. display: block;
  951. width: 300rpx;
  952. text-align: center;
  953. }
  954. .active {
  955. color: #ff7911;
  956. }
  957. .distributor {
  958. font-size: 26upx;
  959. border-radius: 25upx;
  960. display: flex;
  961. align-items: center;
  962. .item-btn-icon {
  963. width: 40upx;
  964. height: 40upx;
  965. margin-right: 10upx;
  966. }
  967. }
  968. .search-btn {
  969. height: 64rpx;
  970. border-radius: 4rpx;
  971. display: flex;
  972. flex-direction: row;
  973. align-items: center;
  974. margin-right: 30rpx;
  975. width: 428rpx;
  976. background: rgba(255, 255, 255, 0.1);
  977. .search-icon {
  978. width: 44rpx;
  979. height: 44rpx;
  980. margin-left: 10rpx;
  981. margin-top: 8rpx;
  982. }
  983. .search-word {
  984. font-size: 26rpx;
  985. font-weight: 400;
  986. color: rgba(153, 153, 153, 1);
  987. margin-left: 10rpx;
  988. }
  989. }
  990. // #ifdef H5 || APP-PLUS
  991. .search-btn {
  992. width: 100%;
  993. }
  994. // #endif
  995. // #ifdef MP-ALIPAY
  996. .back {
  997. width: 25rpx;
  998. height: 25rpx;
  999. margin-top: 15rpx;
  1000. padding: 10rpx;
  1001. display: none;
  1002. }
  1003. .shop-top {
  1004. margin-top: 0 !important;
  1005. }
  1006. .shop-top-content {
  1007. padding-top: 80rpx;
  1008. }
  1009. .nav-item-sort .r .arrow-img {
  1010. width: 16rpx;
  1011. height: 16rpx;
  1012. padding: 4rpx;
  1013. }
  1014. .tabs-nav {
  1015. margin-top: 20upx;
  1016. .ul {
  1017. .li {
  1018. &:first-child {
  1019. margin-left: 36upx;
  1020. }
  1021. }
  1022. }
  1023. }
  1024. // #endif
  1025. </style>