index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942
  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. console.log(this.domOffsetTop);
  427. },
  428. // 优惠券弹窗
  429. getCoupon() {
  430. const tagDate = uni.getStorageSync("tagDate") || "",
  431. nowDate = new Date().toLocaleDateString();
  432. if (tagDate === nowDate) {
  433. this.getNewCoupon();
  434. } else {
  435. getCouponV2().then((res) => {
  436. const {
  437. data
  438. } = res;
  439. console.log(res)
  440. if (data.list.length) {
  441. this.isCouponShow = true;
  442. this.couponObj = data;
  443. uni.setStorageSync("tagDate", new Date().toLocaleDateString());
  444. } else {
  445. this.getNewCoupon();
  446. }
  447. });
  448. }
  449. },
  450. // 新用户优惠券
  451. getNewCoupon() {
  452. const oldUser = uni.getStorageSync("oldUser") || 0;
  453. if (!oldUser) {
  454. getCouponNewUser().then((res) => {
  455. const {
  456. data
  457. } = res;
  458. if (data.show) {
  459. if (data.list.length) {
  460. this.isCouponShow = true;
  461. this.couponObj = data;
  462. uni.setStorageSync("oldUser", 1);
  463. }
  464. } else {
  465. uni.setStorageSync("oldUser", 1);
  466. }
  467. });
  468. }
  469. },
  470. // 优惠券弹窗关闭
  471. couponClose() {
  472. this.isCouponShow = false;
  473. if (!uni.getStorageSync("oldUser")) {
  474. this.getNewCoupon();
  475. }
  476. },
  477. // #ifdef MP
  478. getTempIds() {
  479. getTempIds().then((res) => {
  480. if (res.data) {
  481. wx.setStorageSync(SUBSCRIBE_MESSAGE, JSON.stringify(res.data));
  482. }
  483. });
  484. },
  485. // #endif
  486. goICP() {
  487. // #ifdef H5
  488. window.open("http://beian.miit.gov.cn/");
  489. // #endif
  490. // #ifdef MP
  491. uni.navigateTo({
  492. url: `/pages/annex/web_view/index?url=https://beian.miit.gov.cn/`,
  493. });
  494. // #endif
  495. },
  496. onLoadFun() {},
  497. diyData() {
  498. let that = this;
  499. getDiy().then((res) => {
  500. let data = res.data;
  501. that.headerSerch = data.headerSerch;
  502. that.swiperBg = data.swiperBg;
  503. that.menus = data.menus;
  504. that.news = data.news;
  505. that.activity = data.activity;
  506. that.alive = data.alive;
  507. that.scrollBox = data.scrollBox;
  508. that.titles = data.titles;
  509. that.goodList = data.goodList;
  510. that.tabNav = data.tabNav;
  511. that.tabBar = data.tabBar;
  512. that.customerService = data.customerService;
  513. that.picTxt = data.picTxt;
  514. that.bargain = data.bargain;
  515. that.combination = data.combination;
  516. that.adsRecommend = data.adsRecommend;
  517. that.seckill = data.seckill;
  518. that.coupon = data.coupon;
  519. this.$Cache.set("TAB_BAR", data.tabBar.default.tabBarList);
  520. setTimeout(() => {
  521. this.showSkeleton = false;
  522. }, 300);
  523. }).catch(error => {
  524. // #ifdef APP-PLUS
  525. if (error.status) {
  526. uni.showToast({
  527. title: this.$t(`连接失败`),
  528. icon: 'none',
  529. duration: 2000
  530. })
  531. setTimeout(e => {
  532. this.diyData();
  533. this.getIndexData();
  534. getShare().then(res => {
  535. this.shareInfo = res.data;
  536. });
  537. }, 2000)
  538. }
  539. // #endif
  540. });
  541. },
  542. getIndexData() {
  543. getIndexData().then((res) => {
  544. this.subscribe = res.data.subscribe;
  545. // #ifdef H5
  546. localStorage.setItem("itemName", res.data.site_name);
  547. // #endif
  548. uni.setNavigationBarTitle({
  549. title: res.data.site_name,
  550. });
  551. });
  552. },
  553. /**
  554. * 获取我的推荐
  555. */
  556. get_host_product: function() {
  557. let that = this;
  558. if (that.hotScroll) return;
  559. getProductHot(that.hotPage, that.hotLimit).then((res) => {
  560. that.hotPage++;
  561. that.hotScroll = res.data.length < that.hotLimit;
  562. that.hostProduct = that.hostProduct.concat(res.data);
  563. // that.$set(that, 'hostProduct', res.data)
  564. });
  565. },
  566. // 获取分类id
  567. bindSortId(data) {
  568. this.isSortType = data == -99 ? 0 : 1;
  569. // this.goodLists = [];
  570. this.getProductList(data);
  571. },
  572. getProductList(data) {
  573. let tempObj = "";
  574. this.curSort = 0;
  575. this.loaded = false;
  576. this.goodPage = 1;
  577. this.getGoodsList(data);
  578. },
  579. getGoodsList(data) {
  580. if (this.loading || this.loaded) return;
  581. this.loading = true;
  582. getProductslist({
  583. keyword: "",
  584. priceOrder: "",
  585. salesOrder: "",
  586. news: 0,
  587. page: this.goodPage,
  588. limit: 10,
  589. cid: data,
  590. }).then((res) => {
  591. this.goodLists = res.data;
  592. this.loading = false;
  593. this.loaded = res.data.length < 10;
  594. this.goodPage++;
  595. });
  596. },
  597. goGoodsDetail(item) {
  598. goPage().then((res) => {
  599. goShopDetail(item, this.uid).then((res) => {
  600. uni.navigateTo({
  601. url: `/pages/goods_details/index?id=${item.id}`,
  602. });
  603. });
  604. });
  605. },
  606. },
  607. onReachBottom: function() {
  608. // if (this.isSortType == 0) {
  609. // // this.getGroomList();
  610. // } else {
  611. // this.getGoodsList();
  612. // }
  613. },
  614. onPageScroll(e) {
  615. // if (this.headerSerch.default.isShow.val) {
  616. // // if (this.domOffsetTop == 50) return
  617. // if (e.scrollTop > this.isTop) {
  618. // this.isFixed = true;
  619. // }
  620. // if (e.scrollTop < this.isTop) {
  621. // this.$nextTick(() => {
  622. // this.isFixed = false;
  623. // });
  624. // }
  625. // } else {
  626. // this.isFixed = false;
  627. // }
  628. },
  629. };
  630. </script>
  631. <style lang="scss" scoped>
  632. page {
  633. // background: linear-gradient(180deg, #fff, #fff 20%, #f5f5f5);
  634. // overflow-x: hidden;
  635. // overflow-y: scroll;
  636. // height: max-content;
  637. }
  638. .bac-col {
  639. width: 100%;
  640. height: 300rpx;
  641. position: absolute;
  642. background-image: linear-gradient(135deg, #f97794 10%, #623aa2 100%);
  643. top: 0;
  644. background: linear-gradient(90deg, #f62c2c 0%, #f96e29 100%);
  645. }
  646. .swiperCon {
  647. margin: 20rpx 0 !important;
  648. /* #ifdef MP */
  649. /deep/.swiperBg {
  650. margin: 20rpx 0 !important;
  651. }
  652. /* #endif */
  653. /deep/.swiper {
  654. swiper,
  655. .swiper-item,
  656. image {
  657. height: 190rpx !important;
  658. }
  659. }
  660. }
  661. .site-config {
  662. margin: 40rpx 0;
  663. font-size: 24rpx;
  664. text-align: center;
  665. color: #666;
  666. &.fixed {
  667. position: fixed;
  668. bottom: 69px;
  669. left: 0;
  670. width: 100%;
  671. }
  672. }
  673. /* #ifdef MP */
  674. .indexTip {
  675. position: fixed;
  676. right: 42rpx;
  677. z-index: 10000;
  678. .tip {
  679. width: 400rpx;
  680. border-radius: 6rpx;
  681. background-color: #fff;
  682. padding: 15rpx 22rpx;
  683. position: relative;
  684. &::before {
  685. content: "";
  686. width: 0;
  687. height: 0;
  688. border-left: 15rpx solid transparent;
  689. border-right: 15rpx solid transparent;
  690. border-bottom: 17rpx solid #fff;
  691. position: absolute;
  692. top: -14rpx;
  693. right: 95rpx;
  694. }
  695. }
  696. .text {
  697. font-size: 22rpx;
  698. color: #333;
  699. width: 320rpx;
  700. image {
  701. width: 30rpx;
  702. height: 16rpx;
  703. display: inline-block;
  704. }
  705. }
  706. .iconfont {
  707. color: #cdcdcd;
  708. font-size: 32rpx;
  709. }
  710. }
  711. /* #endif */
  712. /* #ifdef H5 */
  713. .follow {
  714. position: fixed;
  715. top: 0;
  716. left: 0;
  717. width: 100%;
  718. background-color: rgba(0, 0, 0, 0.36);
  719. height: 80rpx;
  720. font-size: 28rpx;
  721. color: #fff;
  722. padding: 0 30rpx;
  723. z-index: 100000;
  724. .iconfont {
  725. font-size: 30rpx;
  726. margin-left: 29rpx;
  727. }
  728. .bnt {
  729. width: 160rpx;
  730. height: 50rpx;
  731. background-color: #e93323;
  732. border-radius: 25rpx;
  733. font-size: 24rpx;
  734. text-align: center;
  735. line-height: 50rpx;
  736. }
  737. }
  738. .followCode {
  739. .mask {
  740. z-index: 10000;
  741. }
  742. .pictrue {
  743. width: 500rpx;
  744. height: 720rpx;
  745. border-radius: 12px;
  746. left: 50%;
  747. top: 50%;
  748. margin-left: -250rpx;
  749. margin-top: -360rpx;
  750. position: fixed;
  751. z-index: 10001;
  752. img {
  753. width: 100%;
  754. height: 100%;
  755. }
  756. }
  757. }
  758. /* #endif */
  759. .privacy-wrapper {
  760. z-index: 9999;
  761. position: fixed;
  762. left: 0;
  763. top: 0;
  764. width: 100%;
  765. height: 100%;
  766. background: #7f7f7f;
  767. .privacy-box {
  768. position: absolute;
  769. left: 50%;
  770. top: 50%;
  771. transform: translate(-50%, -50%);
  772. width: 560rpx;
  773. padding: 50rpx 45rpx 0;
  774. background: #fff;
  775. border-radius: 20rpx;
  776. .title {
  777. text-align: center;
  778. font-size: 32rpx;
  779. text-align: center;
  780. color: #333;
  781. font-weight: 700;
  782. }
  783. .content {
  784. margin-top: 20rpx;
  785. line-height: 1.5;
  786. font-size: 26rpx;
  787. color: #666;
  788. navigator {
  789. display: inline-block;
  790. color: #e93323;
  791. }
  792. }
  793. .btn-box {
  794. margin-top: 40rpx;
  795. text-align: center;
  796. font-size: 30rpx;
  797. .btn-item {
  798. height: 82rpx;
  799. line-height: 82rpx;
  800. background: linear-gradient(90deg, #f67a38 0%, #f11b09 100%);
  801. color: #fff;
  802. border-radius: 41rpx;
  803. }
  804. .btn {
  805. padding: 30rpx 0;
  806. }
  807. }
  808. }
  809. }
  810. .sort-product {
  811. margin: 20rpx;
  812. }
  813. .emptyBox {
  814. text-align: center;
  815. padding: 150rpx 0;
  816. .tips {
  817. color: #aaa;
  818. font-size: 26rpx;
  819. }
  820. image {
  821. width: 414rpx;
  822. height: 304rpx;
  823. }
  824. }
  825. .nothing {
  826. // min-height: 800rpx;
  827. }
  828. .product-list {
  829. display: flex;
  830. flex-wrap: wrap;
  831. justify-content: space-between;
  832. margin-top: 0rpx;
  833. padding: 0 20rpx;
  834. .product-item {
  835. position: relative;
  836. width: 324rpx;
  837. background: #fff;
  838. border-radius: 10rpx;
  839. margin-bottom: 20rpx;
  840. image {
  841. width: 100%;
  842. // height: 344rpx;
  843. border-radius: 10rpx 10rpx 0 0;
  844. }
  845. .info {
  846. padding: 14rpx 16rpx;
  847. .title {
  848. font-size: 28rpx;
  849. }
  850. .price-box {
  851. font-size: 34rpx;
  852. font-weight: 700;
  853. margin-top: 8px;
  854. color: #fc4141;
  855. text {
  856. font-size: 26rpx;
  857. }
  858. }
  859. }
  860. }
  861. }
  862. .sticky-box {
  863. // /* #ifndef APP-PLUS-NVUE */
  864. // display: flex;
  865. // position: -webkit-sticky;
  866. // /* #endif */
  867. // position: sticky;
  868. // /* #ifdef H5*/
  869. // top: var(--window-top);
  870. // /* #endif */
  871. // z-index: 99;
  872. // flex-direction: row;
  873. // margin: 0px;
  874. // background: #f5f5f5;
  875. // padding: 30rpx 0;
  876. // /* #ifdef MP || APP-PLUS*/
  877. // //top: 110rpx;
  878. // /* #endif
  879. /* #ifndef H5 */
  880. display: flex;
  881. position: -webkit-sticky;
  882. overflow-x: scroll;
  883. /* #endif */
  884. position: sticky;
  885. z-index: 998;
  886. flex-direction: row;
  887. margin: 0px;
  888. background: #f5f5f5;
  889. padding: 24rpx 0 24rpx 0;
  890. /* #ifdef MP || APP-PLUS*/
  891. //top: 110rpx;
  892. /* #endif */
  893. // overflow-x: scroll;
  894. }
  895. </style>