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