index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. <template>
  2. <view id="pageIndex" :style="colorStyle">
  3. <!-- <skeleton v-if="!isIframe" :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro"
  4. selector="skeleton" bgcolor="#FFF"></skeleton> -->
  5. <skeletons :show="showSkeleton" loading="chiaroscuro" bgcolor="#FFF"></skeletons>
  6. <!-- #ifdef H5 -->
  7. <view class="followMe" v-if="$wechat.isWeixin()">
  8. <view class="follow acea-row row-between-wrapper" v-if="followHid && followUrl && !subscribe">
  9. <view>点击“立即关注”即可关注公众号</view>
  10. <view class="acea-row row-middle">
  11. <view class="bnt" @click="followTap">立即关注</view>
  12. <span class="iconfont icon-guanbi" @click="closeFollow"></span>
  13. </view>
  14. </view>
  15. <view class="followCode" v-if="followCode">
  16. <view class="pictrue"><img :src="followUrl" /></view>
  17. <view class="mask" @click="closeFollowCode"></view>
  18. </view>
  19. </view>
  20. <!-- #endif -->
  21. <!-- #ifdef MP -->
  22. <view class="indexTip" :style="'top:' + (navH + 50) + 'px'" :hidden="iShidden">
  23. <view class="tip acea-row row-between-wrapper">
  24. <view class="text">点击“<image src="/static/images/spot.png"></image>”添加到我的小程序, 微信首页下拉即可访问商城。</view>
  25. <view class="iconfont icon-guanbi1" @click="closeTip"></view>
  26. </view>
  27. </view>
  28. <!-- #endif -->
  29. <!-- 顶部搜索 -->
  30. <view class="skeleton" id="pageIndexs" :style="{ visibility: showSkeleton ? 'hidden' : 'visible' }">
  31. <headerSerch class="mp-header skeleton" :dataConfig="headerSerch.default"
  32. @click.native="bindEdit('headerSerch', 'default')"></headerSerch>
  33. <!-- 轮播 -->
  34. <swiperBg :dataConfig="swiperBg.default" @click.native="bindEdit('swiperBg', 'default')"></swiperBg>
  35. <!-- 金刚区 -->
  36. <menus :dataConfig="menus.default" @click.native="bindEdit('menus', 'default')"></menus>
  37. <!-- 新闻简报 -->
  38. <news :dataConfig="news.default" @click.native="bindEdit('news', 'default')"></news>
  39. <!-- 活动魔方 -->
  40. <activity :dataConfig="activity.default" @click.native="bindEdit('activity', 'default')"></activity>
  41. <!-- <seckill :dataConfig="seckill.default" @click.native="bindEdit('seckill','default')"></seckill>
  42. <adsRecommend :dataConfig="adsRecommend.default" @click.native="bindEdit('adsRecommend','default')"></adsRecommend>
  43. <combination :dataConfig="combination.default" @click.native="bindEdit('combination','default')"></combination>
  44. <bargain :dataConfig="bargain.default" @click.native="bindEdit('bargain','default')"></bargain>
  45. <picTxt :dataConfig="picTxt.default" @click.native="bindEdit('picTxt','default')"></picTxt> -->
  46. <alive :dataConfig="alive.default" @click.native="bindEdit('alive', 'default')"></alive>
  47. <!-- 优惠券 -->
  48. <coupon :dataConfig="coupon.default" @click.native="bindEdit('coupon', 'default')"></coupon>
  49. <!-- 快速选择 -->
  50. <scrollBox :dataConfig="scrollBox.default" @click.native="bindEdit('scrollBox', 'default')"></scrollBox>
  51. <!-- 促销精品 -->
  52. <recommend :dataConfig="goodList.aa" @click.native="bindEdit('goodList', 'aa')"></recommend>
  53. <!-- 排行榜 -->
  54. <popular :dataConfig="goodList.bb" @click.native="bindEdit('goodList', 'bb')"></popular>
  55. <!-- 商品轮播 -->
  56. <mBanner :dataConfig="swiperBg.aa" @click.native="bindEdit('swiperBg', 'aa')"></mBanner>
  57. <!-- 首发新品 -->
  58. <newGoods :dataConfig="goodList.cc" @click.native="bindEdit('goodList', 'cc')"></newGoods>
  59. <!-- 精品推荐 -->
  60. <!-- <mBanner :dataConfig="swiperBg.cc" @click.native="bindEdit('swiperBg','cc')"></mBanner> -->
  61. <!-- <titles :dataConfig="titles.default" :sty="'off'" @click.native="bindEdit('titles','default')"></titles> -->
  62. <!-- 商品轮播 -->
  63. <!-- <customerService :dataConfig="customerService.default" @click.native="bindEdit('customerService','default')"></customerService> -->
  64. <!-- 促销单品 -->
  65. <promotion :dataConfig="goodList.dd" @click.native="bindEdit('goodList', 'dd')"></promotion>
  66. <!-- 商品分类 -->
  67. <tabNav class="sticky-box" :style="'top:' + isTop + 'px;'" :dataConfig="tabNav.default"
  68. @click.native="bindEdit('tabNav', 'default')" @bindSortId="bindSortId" @bindHeight="bindHeighta">
  69. </tabNav>
  70. <!-- 商品列表 -->
  71. <!-- <goodsWaterfall :class="{ nothing: loading }"
  72. v-if="!isIframe && tabNav.default && tabNav.default.isShow.val" :dataLists="goodLists"
  73. @click.native="bindEdit('List')"></goodsWaterfall> -->
  74. <indexGoods v-if="!isIframe && tabNav.default && tabNav.default.isShow.val" :dataLists="goodLists"
  75. @click.native="bindEdit('List')"></indexGoods>
  76. <!-- <recommend :dataConfig="goodList.aa" @click.native="bindEdit('goodList','aa')"></recommend> -->
  77. <Loading class="loading-sty" :loaded="loaded" :loading="loading"></Loading>
  78. <view class="" v-if="
  79. !isIframe &&
  80. tabNav.default &&
  81. tabNav.default.isShow.val &&
  82. goodLists.length == 0 &&
  83. !loading
  84. ">
  85. <view class="empty-box">
  86. <image src="/static/images/noShopper.png"></image>
  87. </view>
  88. </view>
  89. </view>
  90. <tabBar :dataConfig="tabBar.default" :pagePath="'/pages/index/index'"
  91. @click.native="bindEdit('tabBar', 'default')"></tabBar>
  92. <!-- #ifdef H5 -->
  93. <view v-if="site_config && !isIframe" class="site-config" @click="goICP">{{site_config}}</view>
  94. <!-- #endif -->
  95. <view class="uni-p-b-98"></view>
  96. <couponWindow style="position: relative; z-index: 10000" :window="isCouponShow" @onColse="couponClose"
  97. :couponImage="couponObj.image" :couponList="couponObj.list"></couponWindow>
  98. <!-- #ifdef APP-PLUS -->
  99. <app-update v-if="!privacyStatus" ref="appUpdate" :force="true" :tabbar="false"></app-update>
  100. <view class="privacy-wrapper" v-if="privacyStatus">
  101. <view class="privacy-box">
  102. <view class="title">服务协议与隐私政策</view>
  103. <view class="content">
  104. 请务必审慎阅读、充分理解“服务协议与 隐私政策”各条款,包括但不限于:为了 向你提供即时通讯、内容分享等服务,我 们需要收集你的设备信息、操作日志等个 人信息。你可以在“设置”中查看、变更、
  105. 删除个人信息并管理你的授权。<br>
  106. 你可以阅读<navigator url="/pages/users/privacy/index">《服务协议与隐私政策》</navigator>了解
  107. 详细信息。如你同意,请点击“我同意”开始接受我们的服务。
  108. </view>
  109. <view class="btn-box">
  110. <view class="btn-item" @click="confirmApp">我同意</view>
  111. <view class="btn" @click="closeModel">残忍拒绝</view>
  112. </view>
  113. </view>
  114. </view>
  115. <!-- #endif -->
  116. </view>
  117. </template>
  118. <script>
  119. import couponWindow from "@/components/couponWindow/index";
  120. import indexGoods from "@/components/indexGoods/index";
  121. import headerSerch from "./components/headerSerch";
  122. import swiperBg from "./components/swiperBg";
  123. import menus from "./components/menus";
  124. import news from "./components/news";
  125. import activity from "./components/activity";
  126. import scrollBox from "./components/scrollBox";
  127. import recommend from "./components/recommend";
  128. import popular from "./components/popular";
  129. import mBanner from "./components/mBanner";
  130. import newGoods from "./components/newGoods";
  131. import promotion from "./components/promotion";
  132. import alive from "./components/alive";
  133. import adsRecommend from "./components/adsRecommend";
  134. import coupon from "./components/coupon";
  135. import seckill from "./components/seckill";
  136. import combination from "./components/combination";
  137. import bargain from "./components/bargain";
  138. import goodList from "./components/goodList";
  139. import picTxt from "./components/picTxt";
  140. import titles from "./components/titles";
  141. import customerService from "./components/customerService";
  142. import tabBar from "./components/tabBar";
  143. import tabNav from "./components/tabNav";
  144. import appUpdate from "@/components/update/app-update.vue";
  145. import Loading from "@/components/Loading/index.vue";
  146. import {
  147. getShare,
  148. follow
  149. } from "@/api/public.js";
  150. // #ifdef MP || APP-PLUS
  151. import {
  152. SUBSCRIBE_MESSAGE,
  153. TIPS_KEY
  154. } from "@/config/cache";
  155. // #endif
  156. import {
  157. getTemlIds,
  158. siteConfig
  159. } from "@/api/api.js";
  160. import {
  161. mapGetters
  162. } from "vuex";
  163. import {
  164. getDiy,
  165. getIndexData,
  166. getCouponV2,
  167. getCouponNewUser,
  168. } from "@/api/api.js";
  169. import {
  170. getGroomList,
  171. getCategoryList,
  172. getProductslist,
  173. getProductHot,
  174. } from "@/api/store.js";
  175. import {
  176. goShopDetail,
  177. goPage
  178. } from "@/libs/order.js";
  179. import {
  180. toLogin
  181. } from "@/libs/login.js";
  182. import colors from "@/mixins/color";
  183. import goodsWaterfall from "@/components/goodsWaterfall/goodsWaterfall.vue";
  184. import skeletons from "./components/skeleton.vue";
  185. let app = getApp();
  186. let statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  187. export default {
  188. computed: mapGetters(["isLogin", "uid"]),
  189. components: {
  190. couponWindow,
  191. headerSerch,
  192. swiperBg,
  193. menus,
  194. news,
  195. activity,
  196. scrollBox,
  197. recommend,
  198. popular,
  199. mBanner,
  200. newGoods,
  201. promotion,
  202. alive,
  203. adsRecommend,
  204. coupon,
  205. seckill,
  206. combination,
  207. bargain,
  208. goodList,
  209. picTxt,
  210. titles,
  211. customerService,
  212. tabBar,
  213. tabNav,
  214. Loading,
  215. goodsWaterfall,
  216. skeletons,
  217. indexGoods,
  218. appUpdate, //APP更新
  219. },
  220. mixins: [colors],
  221. data() {
  222. return {
  223. showSkeleton: true, //骨架屏显示隐藏
  224. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  225. isSortType: 0,
  226. sortList: {},
  227. sortAll: [],
  228. goodPage: 1,
  229. goodLists: [],
  230. curSort: 0,
  231. sortMpTop: 0,
  232. loaded: false,
  233. hostProduct: [],
  234. hotScroll: false,
  235. hotPage: 1,
  236. hotLimit: 10,
  237. followHid: true,
  238. followUrl: "",
  239. followCode: false,
  240. navH: statusBarHeight,
  241. subscribe: false,
  242. iShidden: false,
  243. goodType: 3,
  244. loading: false,
  245. loadend: false,
  246. loadTitle: "下拉加载更多", //提示语
  247. page: 1,
  248. limit: this.$config.LIMIT,
  249. numConfig: 0,
  250. couponObj: {},
  251. isCouponShow: false,
  252. shareInfo: {},
  253. site_config: "",
  254. isIframe: app.globalData.isIframe,
  255. headerSerch: {}, //头部搜索
  256. swiperBg: {}, //轮播
  257. menus: {}, //导航
  258. news: {}, //消息公告
  259. activity: {}, //活动魔方
  260. alive: {},
  261. scrollBox: {}, //快速选择分类
  262. titles: {}, //标题
  263. goodList: {}, //商品列表(商品列表、首发新品、热门榜单、促销单品、精品推荐)
  264. tabBar: {}, //导航
  265. customerService: {}, //客服
  266. picTxt: {}, //图文详情
  267. bargain: {}, //砍价
  268. combination: {}, //拼团
  269. adsRecommend: {}, //广告位
  270. seckill: {}, //秒杀
  271. coupon: {}, //优惠券
  272. tabNav: {}, //分类tab
  273. isBorader: "",
  274. domOffsetTop: 50,
  275. isTop: 0,
  276. privacyStatus: false, // 隐私政策是否同意过
  277. isFixed: false,
  278. };
  279. },
  280. created() {
  281. uni.hideTabBar();
  282. // #ifdef APP-PLUS
  283. try {
  284. let val = uni.getStorageSync("privacyStatus") || false;
  285. if (!val) {
  286. this.privacyStatus = true;
  287. }
  288. } catch (e) {}
  289. this.$nextTick(() => {
  290. // this.$refs.appUpdate.update(); //调用子组件 检查更新
  291. });
  292. // #endif
  293. let that = this;
  294. // #ifdef H5
  295. if (app.globalData.isIframe) {
  296. this.showSkeleton = false;
  297. setTimeout(() => {
  298. let active;
  299. document.getElementById("pageIndexs").children.forEach((dom) => {
  300. dom.addEventListener("click", (e) => {
  301. e.stopPropagation();
  302. e.preventDefault();
  303. if (dom === active) return;
  304. dom.classList.add("borderShow");
  305. active && active.classList.remove("borderShow");
  306. active = dom;
  307. });
  308. });
  309. }, 1000);
  310. }
  311. if (app.globalData.isIframe) {
  312. uni.hideTabBar();
  313. }
  314. this.getFollow();
  315. // #endif
  316. this.diyData();
  317. this.getIndexData();
  318. // #ifdef MP
  319. if (this.$Cache.get(TIPS_KEY)) this.iShidden = true;
  320. this.getTemlIds();
  321. // #endif
  322. siteConfig()
  323. .then((res) => {
  324. this.site_config = res.data.record_No;
  325. })
  326. .catch((err) => {
  327. return this.$util.Tips({
  328. title: err.msg,
  329. });
  330. });
  331. // #ifdef APP-PLUS
  332. this.isTop = uni.getSystemInfoSync().statusBarHeight + 85;
  333. // #endif
  334. // #ifdef MP
  335. const query = uni.createSelectorQuery().in(this);
  336. query.select('.mp-header').boundingClientRect(data => {
  337. this.isTop = data.top;
  338. }).exec();
  339. // #endif
  340. // #ifdef H5
  341. this.isTop = 0;
  342. // #endif
  343. if (!app.globalData.isIframe) {
  344. if (this.isLogin) {
  345. this.getCoupon();
  346. }
  347. }
  348. },
  349. methods: {
  350. // #ifdef APP-PLUS
  351. // 同意隐私协议
  352. confirmApp() {
  353. uni.setStorageSync("privacyStatus", true);
  354. this.privacyStatus = false;
  355. },
  356. // 关闭Model
  357. closeModel() {
  358. //退出app
  359. uni.getSystemInfo({
  360. success: function(res) {
  361. // 判断为安卓的手机
  362. if (res.platform == "android") {
  363. // 安卓退出app
  364. plus.runtime.quit();
  365. } else {
  366. // 判断为ios的手机,退出App
  367. plus.ios
  368. .import("UIApplication")
  369. .sharedApplication()
  370. .performSelector("exit");
  371. }
  372. },
  373. });
  374. },
  375. // #endif
  376. bindEdit(name, dataName) {
  377. if (app.globalData.isIframe) {
  378. window.parent.postMessage({
  379. name: name,
  380. dataName: dataName,
  381. params: {},
  382. },
  383. "*"
  384. );
  385. return;
  386. }
  387. },
  388. getFollow() {
  389. follow()
  390. .then((res) => {
  391. this.followUrl = res.data.path;
  392. })
  393. .catch((err) => {
  394. return this.$util.Tips({
  395. title: err.msg,
  396. });
  397. });
  398. },
  399. followTap() {
  400. this.followCode = true;
  401. this.followHid = false;
  402. },
  403. closeFollow() {
  404. this.followHid = false;
  405. },
  406. closeFollowCode() {
  407. this.followCode = false;
  408. this.followHid = true;
  409. },
  410. closeTip: function() {
  411. this.$Cache.set(TIPS_KEY, true);
  412. this.iShidden = true;
  413. },
  414. bindHeighta(data) {
  415. // #ifdef APP-PLUS
  416. this.sortMpTop = data.top + data.height;
  417. // #endif
  418. // #ifdef H5
  419. this.domOffsetTop = data.top;
  420. // #endif
  421. // #ifndef H5
  422. this.domOffsetTop = data.top - 110;
  423. // #endif
  424. console.log(this.domOffsetTop);
  425. },
  426. // 优惠券弹窗
  427. getCoupon() {
  428. const tagDate = uni.getStorageSync("tagDate") || "",
  429. nowDate = new Date().toLocaleDateString();
  430. if (tagDate === nowDate) {
  431. this.getNewCoupon();
  432. } else {
  433. getCouponV2().then((res) => {
  434. const {
  435. data
  436. } = res;
  437. console.log(res)
  438. if (data.list.length) {
  439. this.isCouponShow = true;
  440. this.couponObj = data;
  441. uni.setStorageSync("tagDate", new Date().toLocaleDateString());
  442. } else {
  443. this.getNewCoupon();
  444. }
  445. });
  446. }
  447. },
  448. // 新用户优惠券
  449. getNewCoupon() {
  450. const oldUser = uni.getStorageSync("oldUser") || 0;
  451. if (!oldUser) {
  452. getCouponNewUser().then((res) => {
  453. const {
  454. data
  455. } = res;
  456. if (data.show) {
  457. if (data.list.length) {
  458. this.isCouponShow = true;
  459. this.couponObj = data;
  460. uni.setStorageSync("oldUser", 1);
  461. }
  462. } else {
  463. uni.setStorageSync("oldUser", 1);
  464. }
  465. });
  466. }
  467. },
  468. // 优惠券弹窗关闭
  469. couponClose() {
  470. this.isCouponShow = false;
  471. if (!uni.getStorageSync("oldUser")) {
  472. this.getNewCoupon();
  473. }
  474. },
  475. // 授权关闭
  476. // authColse: function(e) {
  477. // this.isShowAuth = e;
  478. // },
  479. // #ifdef MP
  480. getTemlIds() {
  481. let messageTmplIds = wx.getStorageSync(SUBSCRIBE_MESSAGE);
  482. if (!messageTmplIds) {
  483. getTemlIds().then((res) => {
  484. if (res.data)
  485. wx.setStorageSync(SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
  486. });
  487. }
  488. },
  489. // #endif
  490. goICP() {
  491. // #ifdef H5
  492. window.open("http://beian.miit.gov.cn/");
  493. // #endif
  494. // #ifdef MP
  495. uni.navigateTo({
  496. url: `/pages/annex/web_view/index?url=https://beian.miit.gov.cn/`,
  497. });
  498. // #endif
  499. },
  500. onLoadFun() {},
  501. diyData() {
  502. let that = this;
  503. getDiy().then((res) => {
  504. let data = res.data;
  505. that.headerSerch = data.headerSerch;
  506. that.swiperBg = data.swiperBg;
  507. that.menus = data.menus;
  508. that.news = data.news;
  509. that.activity = data.activity;
  510. that.alive = data.alive;
  511. that.scrollBox = data.scrollBox;
  512. that.titles = data.titles;
  513. that.goodList = data.goodList;
  514. that.tabNav = data.tabNav;
  515. that.tabBar = data.tabBar;
  516. that.customerService = data.customerService;
  517. that.picTxt = data.picTxt;
  518. that.bargain = data.bargain;
  519. that.combination = data.combination;
  520. that.adsRecommend = data.adsRecommend;
  521. that.seckill = data.seckill;
  522. that.coupon = data.coupon;
  523. this.$Cache.set("TAB_BAR", data.tabBar.default.tabBarList);
  524. setTimeout(() => {
  525. this.showSkeleton = false;
  526. }, 1000);
  527. });
  528. },
  529. getIndexData() {
  530. getIndexData().then((res) => {
  531. this.subscribe = res.data.subscribe;
  532. // #ifdef H5
  533. localStorage.setItem("itemName", res.data.site_name);
  534. // #endif
  535. uni.setNavigationBarTitle({
  536. title: res.data.site_name,
  537. });
  538. });
  539. },
  540. /**
  541. * 获取我的推荐
  542. */
  543. get_host_product: function() {
  544. let that = this;
  545. if (that.hotScroll) return;
  546. getProductHot(that.hotPage, that.hotLimit).then((res) => {
  547. that.hotPage++;
  548. that.hotScroll = res.data.length < that.hotLimit;
  549. that.hostProduct = that.hostProduct.concat(res.data);
  550. // that.$set(that, 'hostProduct', res.data)
  551. });
  552. },
  553. // 获取分类id
  554. bindSortId(data) {
  555. this.isSortType = data == -99 ? 0 : 1;
  556. // this.goodLists = [];
  557. this.getProductList(data);
  558. },
  559. getProductList(data) {
  560. let tempObj = "";
  561. this.curSort = 0;
  562. this.loaded = false;
  563. this.goodPage = 1;
  564. this.getGoodsList(data);
  565. },
  566. getGoodsList(data) {
  567. if (this.loading || this.loaded) return;
  568. this.loading = true;
  569. getProductslist({
  570. keyword: "",
  571. priceOrder: "",
  572. salesOrder: "",
  573. news: 0,
  574. page: this.goodPage,
  575. limit: 10,
  576. cid: data,
  577. }).then((res) => {
  578. this.goodLists = res.data;
  579. this.loading = false;
  580. this.loaded = res.data.length < 10;
  581. this.goodPage++;
  582. });
  583. },
  584. goGoodsDetail(item) {
  585. goPage().then((res) => {
  586. goShopDetail(item, this.uid).then((res) => {
  587. uni.navigateTo({
  588. url: `/pages/goods_details/index?id=${item.id}`,
  589. });
  590. });
  591. });
  592. },
  593. },
  594. onReachBottom: function() {
  595. // if (this.isSortType == 0) {
  596. // // this.getGroomList();
  597. // } else {
  598. // this.getGoodsList();
  599. // }
  600. },
  601. onPageScroll(e) {
  602. // if (this.headerSerch.default.isShow.val) {
  603. // // if (this.domOffsetTop == 50) return
  604. // if (e.scrollTop > this.isTop) {
  605. // this.isFixed = true;
  606. // }
  607. // if (e.scrollTop < this.isTop) {
  608. // this.$nextTick(() => {
  609. // this.isFixed = false;
  610. // });
  611. // }
  612. // } else {
  613. // this.isFixed = false;
  614. // }
  615. },
  616. };
  617. </script>
  618. <style lang="scss" scoped>
  619. page {
  620. // background: linear-gradient(180deg, #fff, #fff 20%, #f5f5f5);
  621. // overflow-x: hidden;
  622. // overflow-y: scroll;
  623. // height: max-content;
  624. }
  625. .bac-col {
  626. width: 100%;
  627. height: 300rpx;
  628. position: absolute;
  629. background-image: linear-gradient(135deg, #f97794 10%, #623aa2 100%);
  630. top: 0;
  631. background: linear-gradient(90deg, #f62c2c 0%, #f96e29 100%);
  632. }
  633. .swiperCon {
  634. margin: 20rpx 0 !important;
  635. /* #ifdef MP */
  636. /deep/.swiperBg {
  637. margin: 20rpx 0 !important;
  638. }
  639. /* #endif */
  640. /deep/.swiper {
  641. swiper,
  642. .swiper-item,
  643. image {
  644. height: 190rpx !important;
  645. }
  646. }
  647. }
  648. .site-config {
  649. margin: 40rpx 0;
  650. font-size: 24rpx;
  651. text-align: center;
  652. color: #666;
  653. &.fixed {
  654. position: fixed;
  655. bottom: 69px;
  656. left: 0;
  657. width: 100%;
  658. }
  659. }
  660. /* #ifdef MP */
  661. .indexTip {
  662. position: fixed;
  663. right: 42rpx;
  664. z-index: 10000;
  665. .tip {
  666. width: 400rpx;
  667. border-radius: 6rpx;
  668. background-color: #fff;
  669. padding: 15rpx 22rpx;
  670. position: relative;
  671. &::before {
  672. content: "";
  673. width: 0;
  674. height: 0;
  675. border-left: 15rpx solid transparent;
  676. border-right: 15rpx solid transparent;
  677. border-bottom: 17rpx solid #fff;
  678. position: absolute;
  679. top: -14rpx;
  680. right: 95rpx;
  681. }
  682. }
  683. .text {
  684. font-size: 22rpx;
  685. color: #333;
  686. width: 320rpx;
  687. image {
  688. width: 30rpx;
  689. height: 16rpx;
  690. display: inline-block;
  691. }
  692. }
  693. .iconfont {
  694. color: #cdcdcd;
  695. font-size: 32rpx;
  696. }
  697. }
  698. /* #endif */
  699. /* #ifdef H5 */
  700. .follow {
  701. position: fixed;
  702. top: 0;
  703. left: 0;
  704. width: 100%;
  705. background-color: rgba(0, 0, 0, 0.36);
  706. height: 80rpx;
  707. font-size: 28rpx;
  708. color: #fff;
  709. padding: 0 30rpx;
  710. z-index: 100000;
  711. .iconfont {
  712. font-size: 30rpx;
  713. margin-left: 29rpx;
  714. }
  715. .bnt {
  716. width: 160rpx;
  717. height: 50rpx;
  718. background-color: #e93323;
  719. border-radius: 25rpx;
  720. font-size: 24rpx;
  721. text-align: center;
  722. line-height: 50rpx;
  723. }
  724. }
  725. .followCode {
  726. .mask {
  727. z-index: 10000;
  728. }
  729. .pictrue {
  730. width: 500rpx;
  731. height: 720rpx;
  732. border-radius: 12px;
  733. left: 50%;
  734. top: 50%;
  735. margin-left: -250rpx;
  736. margin-top: -360rpx;
  737. position: fixed;
  738. z-index: 10001;
  739. img {
  740. width: 100%;
  741. height: 100%;
  742. }
  743. }
  744. }
  745. /* #endif */
  746. .privacy-wrapper {
  747. z-index: 9999;
  748. position: fixed;
  749. left: 0;
  750. top: 0;
  751. width: 100%;
  752. height: 100%;
  753. background: #7f7f7f;
  754. .privacy-box {
  755. position: absolute;
  756. left: 50%;
  757. top: 50%;
  758. transform: translate(-50%, -50%);
  759. width: 560rpx;
  760. padding: 50rpx 45rpx 0;
  761. background: #fff;
  762. border-radius: 20rpx;
  763. .title {
  764. text-align: center;
  765. font-size: 32rpx;
  766. text-align: center;
  767. color: #333;
  768. font-weight: 700;
  769. }
  770. .content {
  771. margin-top: 20rpx;
  772. line-height: 1.5;
  773. font-size: 26rpx;
  774. color: #666;
  775. navigator {
  776. display: inline-block;
  777. color: #e93323;
  778. }
  779. }
  780. .btn-box {
  781. margin-top: 40rpx;
  782. text-align: center;
  783. font-size: 30rpx;
  784. .btn-item {
  785. height: 82rpx;
  786. line-height: 82rpx;
  787. background: linear-gradient(90deg, #f67a38 0%, #f11b09 100%);
  788. color: #fff;
  789. border-radius: 41rpx;
  790. }
  791. .btn {
  792. padding: 30rpx 0;
  793. }
  794. }
  795. }
  796. }
  797. .sort-product {
  798. margin: 20rpx;
  799. }
  800. .empty-box {
  801. text-align: center;
  802. padding: 150rpx 0;
  803. image {
  804. width: 410rpx;
  805. height: 336rpx;
  806. }
  807. }
  808. .nothing {
  809. // min-height: 800rpx;
  810. }
  811. .product-list {
  812. display: flex;
  813. flex-wrap: wrap;
  814. justify-content: space-between;
  815. margin-top: 0rpx;
  816. padding: 0 20rpx;
  817. .product-item {
  818. position: relative;
  819. width: 324rpx;
  820. background: #fff;
  821. border-radius: 10rpx;
  822. margin-bottom: 20rpx;
  823. image {
  824. width: 100%;
  825. // height: 344rpx;
  826. border-radius: 10rpx 10rpx 0 0;
  827. }
  828. .info {
  829. padding: 14rpx 16rpx;
  830. .title {
  831. font-size: 28rpx;
  832. }
  833. .price-box {
  834. font-size: 34rpx;
  835. font-weight: 700;
  836. margin-top: 8px;
  837. color: #fc4141;
  838. text {
  839. font-size: 26rpx;
  840. }
  841. }
  842. }
  843. }
  844. }
  845. .sticky-box {
  846. // /* #ifndef APP-PLUS-NVUE */
  847. // display: flex;
  848. // position: -webkit-sticky;
  849. // /* #endif */
  850. // position: sticky;
  851. // /* #ifdef H5*/
  852. // top: var(--window-top);
  853. // /* #endif */
  854. // z-index: 99;
  855. // flex-direction: row;
  856. // margin: 0px;
  857. // background: #f5f5f5;
  858. // padding: 30rpx 0;
  859. // /* #ifdef MP || APP-PLUS*/
  860. // //top: 110rpx;
  861. // /* #endif
  862. /* #ifndef H5 */
  863. display: flex;
  864. position: -webkit-sticky;
  865. overflow-x: scroll;
  866. /* #endif */
  867. position: sticky;
  868. z-index: 998;
  869. flex-direction: row;
  870. margin: 0px;
  871. background: #f5f5f5;
  872. padding: 24rpx 0 24rpx 0;
  873. /* #ifdef MP || APP-PLUS*/
  874. //top: 110rpx;
  875. /* #endif */
  876. // overflow-x: scroll;
  877. }
  878. </style>