index.vue 23 KB

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