index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937
  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. ">
  82. <view class='emptyBox'>
  83. <image :src="imgHost + '/statics/images/no-thing.png'"></image>
  84. <view class="tips">{{$t(`暂无商品,去看点别的吧`)}}</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(`你可以阅读`)}}
  104. <navigator url="/pages/users/privacy/index?type=3">{{$t(`《服务协议与隐私政策》`)}}</navigator>
  105. {{$t(`了解详细信息。如你同意,请点击“我同意”开始接受我们的服务。`)}}
  106. </view>
  107. <view class="btn-box">
  108. <view class="btn-item" @click="confirmApp">{{$t(`我同意`)}}</view>
  109. <view class="btn" @click="closeModel">{{$t(`残忍拒绝`)}}</view>
  110. </view>
  111. </view>
  112. </view>
  113. <!-- #endif -->
  114. </view>
  115. </template>
  116. <script>
  117. import couponWindow from "@/components/couponWindow/index";
  118. import indexGoods from "@/components/indexGoods/index";
  119. import headerSerch from "./components/headerSerch";
  120. import swiperBg from "./components/swiperBg";
  121. import menus from "./components/menus";
  122. import news from "./components/news";
  123. import activity from "./components/activity";
  124. import scrollBox from "./components/scrollBox";
  125. import recommend from "./components/recommend";
  126. import popular from "./components/popular";
  127. import mBanner from "./components/mBanner";
  128. import newGoods from "./components/newGoods";
  129. import promotion from "./components/promotion";
  130. import alive from "./components/alive";
  131. import adsRecommend from "./components/adsRecommend";
  132. import coupon from "./components/coupon";
  133. import seckill from "./components/seckill";
  134. import combination from "./components/combination";
  135. import bargain from "./components/bargain";
  136. import goodList from "./components/goodList";
  137. import picTxt from "./components/picTxt";
  138. import titles from "./components/titles";
  139. import customerService from "./components/customerService";
  140. import tabBar from "./components/tabBar";
  141. import tabNav from "./components/tabNav";
  142. import appUpdate from "@/components/update/app-update.vue";
  143. import Loading from "@/components/Loading/index.vue";
  144. import {
  145. getShare,
  146. follow
  147. } from "@/api/public.js";
  148. // #ifdef MP || APP-PLUS
  149. import {
  150. SUBSCRIBE_MESSAGE,
  151. TIPS_KEY
  152. } from "@/config/cache";
  153. // #endif
  154. import {
  155. getTempIds,
  156. siteConfig
  157. } from "@/api/api.js";
  158. import {
  159. mapGetters
  160. } from "vuex";
  161. import {
  162. getDiy,
  163. getIndexData,
  164. getCouponV2,
  165. getCouponNewUser,
  166. } from "@/api/api.js";
  167. import {
  168. getGroomList,
  169. getCategoryList,
  170. getProductslist,
  171. getProductHot,
  172. } from "@/api/store.js";
  173. import {
  174. goShopDetail,
  175. goPage
  176. } from "@/libs/order.js";
  177. import {
  178. toLogin
  179. } from "@/libs/login.js";
  180. import {
  181. HTTP_REQUEST_URL
  182. } from '@/config/app';
  183. import colors from "@/mixins/color";
  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. skeletons,
  216. indexGoods,
  217. appUpdate, //APP更新
  218. },
  219. mixins: [colors],
  220. data() {
  221. return {
  222. imgHost: HTTP_REQUEST_URL,
  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: this.$t(`下拉加载更多`), //提示语
  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. uni.setStorageSync("privacyStatus", true);
  284. // try {
  285. // let val = uni.getStorageSync("privacyStatus") || false;
  286. // if (!val) {
  287. // this.privacyStatus = true;
  288. // }
  289. // } catch (e) {}
  290. // this.$nextTick(() => {
  291. // // this.$refs.appUpdate.update(); //调用子组件 检查更新
  292. // });
  293. // #endif
  294. let that = this;
  295. // #ifdef H5
  296. if (app.globalData.isIframe) {
  297. this.showSkeleton = false;
  298. setTimeout(() => {
  299. let active;
  300. document.getElementById("pageIndexs").children.forEach((dom) => {
  301. dom.addEventListener("click", (e) => {
  302. e.stopPropagation();
  303. e.preventDefault();
  304. if (dom === active) return;
  305. dom.classList.add("borderShow");
  306. active && active.classList.remove("borderShow");
  307. active = dom;
  308. });
  309. });
  310. }, 1000);
  311. }
  312. if (app.globalData.isIframe) {
  313. uni.hideTabBar();
  314. }
  315. this.getFollow();
  316. // #endif
  317. this.diyData();
  318. this.getIndexData();
  319. // #ifdef MP
  320. if (this.$Cache.get(TIPS_KEY)) this.iShidden = true;
  321. this.getTempIds();
  322. // #endif
  323. siteConfig()
  324. .then((res) => {
  325. this.site_config = res.data.record_No;
  326. })
  327. .catch((err) => {
  328. return this.$util.Tips({
  329. title: err.msg,
  330. });
  331. });
  332. // #ifdef APP-PLUS
  333. this.isTop = uni.getSystemInfoSync().statusBarHeight + 85;
  334. // #endif
  335. // #ifdef MP
  336. const query = uni.createSelectorQuery().in(this);
  337. query.select('.mp-header').boundingClientRect(data => {
  338. this.isTop = data.top;
  339. }).exec();
  340. // #endif
  341. // #ifdef H5
  342. this.isTop = 0;
  343. // #endif
  344. if (!app.globalData.isIframe) {
  345. if (this.isLogin) {
  346. this.getCoupon();
  347. }
  348. }
  349. },
  350. methods: {
  351. // #ifdef APP-PLUS
  352. // 同意隐私协议
  353. confirmApp() {
  354. uni.setStorageSync("privacyStatus", true);
  355. this.privacyStatus = false;
  356. },
  357. // 关闭Model
  358. closeModel() {
  359. //退出app
  360. uni.getSystemInfo({
  361. success: function(res) {
  362. // 判断为安卓的手机
  363. if (res.platform == "android") {
  364. // 安卓退出app
  365. plus.runtime.quit();
  366. } else {
  367. // 判断为ios的手机,退出App
  368. plus.ios
  369. .import("UIApplication")
  370. .sharedApplication()
  371. .performSelector("exit");
  372. }
  373. },
  374. });
  375. },
  376. // #endif
  377. bindEdit(name, dataName) {
  378. if (app.globalData.isIframe) {
  379. window.parent.postMessage({
  380. name: name,
  381. dataName: dataName,
  382. params: {},
  383. },
  384. "*"
  385. );
  386. return;
  387. }
  388. },
  389. getFollow() {
  390. follow()
  391. .then((res) => {
  392. this.followUrl = res.data.path;
  393. })
  394. .catch((err) => {
  395. return this.$util.Tips({
  396. title: err.msg,
  397. });
  398. });
  399. },
  400. followTap() {
  401. this.followCode = true;
  402. this.followHid = false;
  403. },
  404. closeFollow() {
  405. this.followHid = false;
  406. },
  407. closeFollowCode() {
  408. this.followCode = false;
  409. this.followHid = true;
  410. },
  411. closeTip: function() {
  412. this.$Cache.set(TIPS_KEY, true);
  413. this.iShidden = true;
  414. },
  415. bindHeighta(data) {
  416. // #ifdef APP-PLUS
  417. this.sortMpTop = data.top + data.height;
  418. // #endif
  419. // #ifdef H5
  420. this.domOffsetTop = data.top;
  421. // #endif
  422. // #ifndef H5
  423. this.domOffsetTop = data.top - 110;
  424. // #endif
  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. if (data.list.length) {
  438. this.isCouponShow = true;
  439. this.couponObj = data;
  440. uni.setStorageSync("tagDate", new Date().toLocaleDateString());
  441. } else {
  442. this.getNewCoupon();
  443. }
  444. });
  445. }
  446. },
  447. // 新用户优惠券
  448. getNewCoupon() {
  449. const oldUser = uni.getStorageSync("oldUser") || 0;
  450. if (!oldUser) {
  451. getCouponNewUser().then((res) => {
  452. const {
  453. data
  454. } = res;
  455. if (data.show) {
  456. if (data.list.length) {
  457. this.isCouponShow = true;
  458. this.couponObj = data;
  459. uni.setStorageSync("oldUser", 1);
  460. }
  461. } else {
  462. uni.setStorageSync("oldUser", 1);
  463. }
  464. });
  465. }
  466. },
  467. // 优惠券弹窗关闭
  468. couponClose() {
  469. this.isCouponShow = false;
  470. if (!uni.getStorageSync("oldUser")) {
  471. this.getNewCoupon();
  472. }
  473. },
  474. // #ifdef MP
  475. getTempIds() {
  476. getTempIds().then((res) => {
  477. if (res.data) {
  478. wx.setStorageSync(SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
  479. }
  480. });
  481. },
  482. // #endif
  483. goICP() {
  484. // #ifdef H5
  485. window.open("http://beian.miit.gov.cn/");
  486. // #endif
  487. // #ifdef MP
  488. uni.navigateTo({
  489. url: `/pages/annex/web_view/index?url=https://beian.miit.gov.cn/`,
  490. });
  491. // #endif
  492. },
  493. onLoadFun() {},
  494. reconnect() {
  495. this.diyData();
  496. this.getIndexData();
  497. },
  498. diyData() {
  499. let that = this;
  500. getDiy().then((res) => {
  501. console.log('222', res)
  502. let data = res.data;
  503. that.headerSerch = data.headerSerch;
  504. that.swiperBg = data.swiperBg;
  505. that.menus = data.menus;
  506. that.news = data.news;
  507. that.activity = data.activity;
  508. that.alive = data.alive;
  509. that.scrollBox = data.scrollBox;
  510. that.titles = data.titles;
  511. that.goodList = data.goodList;
  512. that.tabNav = data.tabNav;
  513. that.tabBar = data.tabBar;
  514. that.customerService = data.customerService;
  515. that.picTxt = data.picTxt;
  516. that.bargain = data.bargain;
  517. that.combination = data.combination;
  518. that.adsRecommend = data.adsRecommend;
  519. that.seckill = data.seckill;
  520. that.coupon = data.coupon;
  521. this.$Cache.set("TAB_BAR", data.tabBar.default.tabBarList);
  522. setTimeout(() => {
  523. this.showSkeleton = false;
  524. }, 300);
  525. uni.setStorageSync('VIS_DATA', res.data)
  526. }).catch(error => {
  527. // #ifdef APP-PLUS
  528. if (error.status) {
  529. uni.showToast({
  530. title: this.$t(`连接失败`),
  531. icon: 'none',
  532. duration: 2000
  533. })
  534. }
  535. // #endif
  536. });
  537. },
  538. getIndexData() {
  539. getIndexData().then((res) => {
  540. this.subscribe = res.data.subscribe;
  541. // #ifdef H5
  542. localStorage.setItem("itemName", res.data.site_name);
  543. // #endif
  544. uni.setNavigationBarTitle({
  545. title: res.data.site_name,
  546. });
  547. });
  548. },
  549. /**
  550. * 获取我的推荐
  551. */
  552. get_host_product: function() {
  553. let that = this;
  554. if (that.hotScroll) return;
  555. getProductHot(that.hotPage, that.hotLimit).then((res) => {
  556. that.hotPage++;
  557. that.hotScroll = res.data.length < that.hotLimit;
  558. that.hostProduct = that.hostProduct.concat(res.data);
  559. // that.$set(that, 'hostProduct', res.data)
  560. });
  561. },
  562. // 获取分类id
  563. bindSortId(data) {
  564. this.isSortType = data == -99 ? 0 : 1;
  565. // this.goodLists = [];
  566. this.getProductList(data);
  567. },
  568. getProductList(data) {
  569. let tempObj = "";
  570. this.curSort = 0;
  571. this.loaded = false;
  572. this.goodPage = 1;
  573. this.getGoodsList(data);
  574. },
  575. getGoodsList(data) {
  576. if (this.loading || this.loaded) return;
  577. this.loading = true;
  578. getProductslist({
  579. keyword: "",
  580. priceOrder: "",
  581. salesOrder: "",
  582. news: 0,
  583. page: this.goodPage,
  584. limit: 10,
  585. cid: data,
  586. }).then((res) => {
  587. this.goodLists = res.data;
  588. this.loading = false;
  589. this.loaded = res.data.length < 10;
  590. this.goodPage++;
  591. });
  592. },
  593. goGoodsDetail(item) {
  594. goPage().then((res) => {
  595. goShopDetail(item, this.uid).then((res) => {
  596. uni.navigateTo({
  597. url: `/pages/goods_details/index?id=${item.id}`,
  598. });
  599. });
  600. });
  601. },
  602. },
  603. onReachBottom: function() {
  604. // if (this.isSortType == 0) {
  605. // // this.getGroomList();
  606. // } else {
  607. // this.getGoodsList();
  608. // }
  609. },
  610. onPageScroll(e) {
  611. // if (this.headerSerch.default.isShow.val) {
  612. // // if (this.domOffsetTop == 50) return
  613. // if (e.scrollTop > this.isTop) {
  614. // this.isFixed = true;
  615. // }
  616. // if (e.scrollTop < this.isTop) {
  617. // this.$nextTick(() => {
  618. // this.isFixed = false;
  619. // });
  620. // }
  621. // } else {
  622. // this.isFixed = false;
  623. // }
  624. },
  625. };
  626. </script>
  627. <style lang="scss" scoped>
  628. page {
  629. // background: linear-gradient(180deg, #fff, #fff 20%, #f5f5f5);
  630. // overflow-x: hidden;
  631. // overflow-y: scroll;
  632. // height: max-content;
  633. }
  634. .bac-col {
  635. width: 100%;
  636. height: 300rpx;
  637. position: absolute;
  638. background-image: linear-gradient(135deg, #f97794 10%, #623aa2 100%);
  639. top: 0;
  640. background: linear-gradient(90deg, #f62c2c 0%, #f96e29 100%);
  641. }
  642. .swiperCon {
  643. margin: 20rpx 0 !important;
  644. /* #ifdef MP */
  645. /deep/.swiperBg {
  646. margin: 20rpx 0 !important;
  647. }
  648. /* #endif */
  649. /deep/.swiper {
  650. swiper,
  651. .swiper-item,
  652. image {
  653. height: 190rpx !important;
  654. }
  655. }
  656. }
  657. .site-config {
  658. margin: 40rpx 0;
  659. font-size: 24rpx;
  660. text-align: center;
  661. color: #666;
  662. &.fixed {
  663. position: fixed;
  664. bottom: 69px;
  665. left: 0;
  666. width: 100%;
  667. }
  668. }
  669. /* #ifdef MP */
  670. .indexTip {
  671. position: fixed;
  672. right: 42rpx;
  673. z-index: 10000;
  674. .tip {
  675. width: 400rpx;
  676. border-radius: 6rpx;
  677. background-color: #fff;
  678. padding: 15rpx 22rpx;
  679. position: relative;
  680. &::before {
  681. content: "";
  682. width: 0;
  683. height: 0;
  684. border-left: 15rpx solid transparent;
  685. border-right: 15rpx solid transparent;
  686. border-bottom: 17rpx solid #fff;
  687. position: absolute;
  688. top: -14rpx;
  689. right: 95rpx;
  690. }
  691. }
  692. .text {
  693. font-size: 22rpx;
  694. color: #333;
  695. width: 320rpx;
  696. image {
  697. width: 30rpx;
  698. height: 16rpx;
  699. display: inline-block;
  700. }
  701. }
  702. .iconfont {
  703. color: #cdcdcd;
  704. font-size: 32rpx;
  705. }
  706. }
  707. /* #endif */
  708. /* #ifdef H5 */
  709. .follow {
  710. position: fixed;
  711. top: 0;
  712. left: 0;
  713. width: 100%;
  714. background-color: rgba(0, 0, 0, 0.36);
  715. height: 80rpx;
  716. font-size: 28rpx;
  717. color: #fff;
  718. padding: 0 30rpx;
  719. z-index: 100000;
  720. .iconfont {
  721. font-size: 30rpx;
  722. margin-left: 29rpx;
  723. }
  724. .bnt {
  725. width: 160rpx;
  726. height: 50rpx;
  727. background-color: #e93323;
  728. border-radius: 25rpx;
  729. font-size: 24rpx;
  730. text-align: center;
  731. line-height: 50rpx;
  732. }
  733. }
  734. .followCode {
  735. .mask {
  736. z-index: 10000;
  737. }
  738. .pictrue {
  739. width: 500rpx;
  740. height: 720rpx;
  741. border-radius: 12px;
  742. left: 50%;
  743. top: 50%;
  744. margin-left: -250rpx;
  745. margin-top: -360rpx;
  746. position: fixed;
  747. z-index: 10001;
  748. img {
  749. width: 100%;
  750. height: 100%;
  751. }
  752. }
  753. }
  754. /* #endif */
  755. .privacy-wrapper {
  756. z-index: 9999;
  757. position: fixed;
  758. left: 0;
  759. top: 0;
  760. width: 100%;
  761. height: 100%;
  762. background: #7f7f7f;
  763. .privacy-box {
  764. position: absolute;
  765. left: 50%;
  766. top: 50%;
  767. transform: translate(-50%, -50%);
  768. width: 560rpx;
  769. padding: 50rpx 45rpx 0;
  770. background: #fff;
  771. border-radius: 20rpx;
  772. .title {
  773. text-align: center;
  774. font-size: 32rpx;
  775. text-align: center;
  776. color: #333;
  777. font-weight: 700;
  778. }
  779. .content {
  780. margin-top: 20rpx;
  781. line-height: 1.5;
  782. font-size: 26rpx;
  783. color: #666;
  784. navigator {
  785. display: inline-block;
  786. color: #e93323;
  787. }
  788. }
  789. .btn-box {
  790. margin-top: 40rpx;
  791. text-align: center;
  792. font-size: 30rpx;
  793. .btn-item {
  794. height: 82rpx;
  795. line-height: 82rpx;
  796. background: linear-gradient(90deg, #f67a38 0%, #f11b09 100%);
  797. color: #fff;
  798. border-radius: 41rpx;
  799. }
  800. .btn {
  801. padding: 30rpx 0;
  802. }
  803. }
  804. }
  805. }
  806. .sort-product {
  807. margin: 20rpx;
  808. }
  809. .emptyBox {
  810. text-align: center;
  811. padding: 150rpx 0;
  812. .tips {
  813. color: #aaa;
  814. font-size: 26rpx;
  815. }
  816. image {
  817. width: 414rpx;
  818. height: 304rpx;
  819. }
  820. }
  821. .nothing {
  822. // min-height: 800rpx;
  823. }
  824. .product-list {
  825. display: flex;
  826. flex-wrap: wrap;
  827. justify-content: space-between;
  828. margin-top: 0rpx;
  829. padding: 0 20rpx;
  830. .product-item {
  831. position: relative;
  832. width: 324rpx;
  833. background: #fff;
  834. border-radius: 10rpx;
  835. margin-bottom: 20rpx;
  836. image {
  837. width: 100%;
  838. // height: 344rpx;
  839. border-radius: 10rpx 10rpx 0 0;
  840. }
  841. .info {
  842. padding: 14rpx 16rpx;
  843. .title {
  844. font-size: 28rpx;
  845. }
  846. .price-box {
  847. font-size: 34rpx;
  848. font-weight: 700;
  849. margin-top: 8px;
  850. color: #fc4141;
  851. text {
  852. font-size: 26rpx;
  853. }
  854. }
  855. }
  856. }
  857. }
  858. .sticky-box {
  859. // /* #ifndef APP-PLUS-NVUE */
  860. // display: flex;
  861. // position: -webkit-sticky;
  862. // /* #endif */
  863. // position: sticky;
  864. // /* #ifdef H5*/
  865. // top: var(--window-top);
  866. // /* #endif */
  867. // z-index: 99;
  868. // flex-direction: row;
  869. // margin: 0px;
  870. // background: #f5f5f5;
  871. // padding: 30rpx 0;
  872. // /* #ifdef MP || APP-PLUS*/
  873. // //top: 110rpx;
  874. // /* #endif
  875. /* #ifndef H5 */
  876. display: flex;
  877. position: -webkit-sticky;
  878. overflow-x: scroll;
  879. /* #endif */
  880. position: sticky;
  881. z-index: 998;
  882. flex-direction: row;
  883. margin: 0px;
  884. background: #f5f5f5;
  885. padding: 24rpx 0 24rpx 0;
  886. /* #ifdef MP || APP-PLUS*/
  887. //top: 110rpx;
  888. /* #endif */
  889. // overflow-x: scroll;
  890. }
  891. </style>