多租户商城-商户小程序端
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.

1172 lines
28 KiB

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