index.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770
  1. <template>
  2. <view :class="bgTabVal==2?'fullsize noRepeat':bgTabVal==1?'repeat ysize':'noRepeat ysize'"
  3. :style="'background-color:'+bgColor+';background-image: url('+bgPic+');min-height:'+windowHeight+'px;'">
  4. <skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
  5. bgcolor="#FFF"></skeleton>
  6. <view v-if="!errorNetwork" :style="{visibility: showSkeleton ? 'hidden' : 'visible'}">
  7. <view class="page-index skeleton" :class="{ bgf: navIndex > 0 }">
  8. <block>
  9. <!-- #ifdef H5 -->
  10. <view v-for="(item, index) in styleConfig" :key="index">
  11. <block v-if="item.name != 'headerSerch' && item.name != 'tabNav'">
  12. <component :is="item.name" :index="index" :isFixed="isFixed" :dataConfig="item"
  13. @changeBarg="changeBarg" :tempArr="tempArr" :userInfo="userInfo" :tabTitle="navTop"
  14. :navIndex="navIndex" @changeTab="changeTab" @detail="goDetail" v-show="navIndex == 0">
  15. </component>
  16. </block>
  17. <block v-if="item.name == 'headerSerch'">
  18. <component :is="'headerSerch'" :isFixed="isFixed" :dataConfig="item"
  19. @changeBarg="changeBarg" :tempArr="tempArr" :userInfo="userInfo" :tabTitle="navTop"
  20. @changeTab="changeTab" @detail="goDetail"></component>
  21. </block>
  22. <block v-if="item.name == 'tabNav'">
  23. <component :is="'tabNav'" :isFixed="isFixed" :dataConfig="item" @changeBarg="changeBarg"
  24. :tempArr="tempArr" :userInfo="userInfo" :tabTitle="navTop" @changeTab="changeTab"
  25. @detail="goDetail"></component>
  26. </block>
  27. </view>
  28. <!-- #endif -->
  29. <!-- #ifdef MP || APP-PLUS -->
  30. <block v-for="(item, index) in styleConfig" :key="index">
  31. <view v-show="navIndex == 0">
  32. <activeParty v-if="item.name == 'activeParty'" :dataConfig="item"></activeParty>
  33. <bargain v-if="item.name == 'bargain'" :dataConfig="item" @changeBarg="changeBarg">
  34. </bargain>
  35. <blankPage v-if="item.name == 'blankPage'" :dataConfig="item"></blankPage>
  36. <combination v-if="item.name == 'combination'" :dataConfig="item"></combination>
  37. <topic v-if="item.name == 'topic'" :dataConfig="item"></topic>
  38. <coupon v-if="item.name == 'coupon'" :dataConfig="item"></coupon>
  39. <customerService v-if="item.name == 'customerService'" :dataConfig="item"></customerService>
  40. <goodList v-if="item.name == 'goodList'" :dataConfig="item" @detail="goDetail"></goodList>
  41. <guide v-if="item.name == 'guide'" :dataConfig="item"></guide>
  42. <liveBroadcast v-if="item.name == 'liveBroadcast'" :dataConfig="item"></liveBroadcast>
  43. <menus v-if="item.name == 'menus'" :dataConfig="item"></menus>
  44. <news v-if="item.name == 'news'" :dataConfig="item"></news>
  45. <presellList v-if="item.name == 'presellList'" :dataConfig="item"></presellList>
  46. <plantList v-if="item.name == 'plantList'" :dataConfig="item"></plantList>
  47. <promotionList v-if="item.name == 'promotionList'" :dataConfig="item" @changeTab="changeTab"
  48. :tempArr="tempArr" @detail="goDetail"></promotionList>
  49. <richText v-if="item.name == 'richText'" :dataConfig="item"></richText>
  50. <seckill v-if="item.name == 'seckill'" :dataConfig="item"></seckill>
  51. <swiperBg v-if="item.name == 'swiperBg'" :dataConfig="item"></swiperBg>
  52. <pictureCube v-if="item.name == 'pictureCube'" :dataConfig="item"></pictureCube>
  53. <titles v-if="item.name == 'titles'" :dataConfig="item"></titles>
  54. <shopList v-if="item.name == 'shopList' && hide_mer_status != 1" :dataConfig="item">
  55. </shopList>
  56. </view>
  57. <headerSerch v-if="item.name == 'headerSerch'" :dataConfig="item" :userInfo="userInfo">
  58. </headerSerch>
  59. <tabNav v-if="item.name == 'tabNav'" :dataConfig="item" class="tabNav" :tabTitle="navTop"
  60. @bindHeight="bindHeighta" @changeTab="changeTab" :isFixed="isFixed"></tabNav>
  61. </block>
  62. <!-- #endif -->
  63. <view class="main" v-show="navIndex == 0">
  64. <!-- 首页推荐 -->
  65. <view class="index-product-wrapper">
  66. <!-- 首发新品 -->
  67. <recommend :hostProduct="hostProduct" :indexP="true" :isLogin="isLogin"></recommend>
  68. <view class="loadingicon acea-row row-center-wrapper" v-if="hostProduct.length > 0">
  69. <text class="loading iconfont icon-jiazai" :hidden="hotLoading == false"></text>
  70. {{ hotTitle }}
  71. </view>
  72. </view>
  73. </view>
  74. <view v-show="navIndex == 0" class="loadingicon acea-row row-center-wrapper"
  75. v-if="tempArr.length && styleConfig[styleConfig.length - 1].name == 'promotionList'">
  76. <text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
  77. {{ loadTitle }}
  78. </view>
  79. </block>
  80. <!-- 分类页 -->
  81. <view class="productList" v-if="navIndex > 0" :style="'margin-top:' + prodeuctTop + 'px;'">
  82. <view class="sort acea-row" v-if="sortList.length>0" :style="{ marginTop: sortMarTop + 'px' }">
  83. <navigator hover-class="none" v-if="index < 9"
  84. :url="'/pages/columnGoods/goods_list/index?id=' + item.store_category_id + '&title=' + item.cate_name"
  85. class="item" v-for="(item, index) in sortList" :key="item.store_category_id">
  86. <view class="pictrue">
  87. <easy-loadimage :image-src="item.pic"></easy-loadimage>
  88. </view>
  89. <view class="text">{{ item.cate_name }}</view>
  90. </navigator>
  91. <view class="item" @click="bindMore" v-if="sortList.length >= 9">
  92. <view class="pictrues acea-row row-center-wrapper"><text
  93. class="iconfont icon-gengduo1"></text></view>
  94. <view class="text" style="margin-top: 22rpx;">更多</view>
  95. </view>
  96. </view>
  97. <block v-if="sortProduct.length > 0">
  98. <view class="list acea-row row-between-wrapper">
  99. <navigator @tap="goDetails(item)" class="item" v-for="(item, index) in sortProduct"
  100. :key="item.product_id">
  101. <view class="pictrue">
  102. <easy-loadimage :image-src="item.image"></easy-loadimage>
  103. </view>
  104. <view class="text">
  105. <view class="name line1">
  106. <text class="name_text line2">{{ item.store_name }}</text>
  107. </view>
  108. <view class="acea-row row-middle">
  109. <view class="money font-color-red">
  110. <text class="num">{{ item.price }}</text>
  111. </view>
  112. </view>
  113. <view class="item_tags acea-row">
  114. <text v-if="item.merchant.type_name && item.product_type == 0"
  115. class="font-bg-red">{{ item.merchant.type_name }}</text>
  116. <text v-else-if="item.merchant.is_trader && item.product_type == 0"
  117. class="font-bg-red">自营</text>
  118. <text v-if="item.product_type != 0"
  119. :class="'font_bg-red type' + item.product_type">
  120. {{ item.product_type == 1 ? '秒杀' : item.product_type == 2 ? '预售' : item.product_type == 3 ? '助力' : item.product_type == 4 ? '拼团' : '' }}
  121. </text>
  122. <text class="tags_item ticket" v-if="item.issetCoupon">领券</text>
  123. <text class="tags_item delivery" v-if="item.delivery_free == 1">包邮</text>
  124. </view>
  125. </view>
  126. </navigator>
  127. <view class="loadingicon acea-row row-center-wrapper"
  128. v-if="sortProduct.length > 0 || sortProductLoading">
  129. <text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
  130. {{ loadTitle }}
  131. </view>
  132. </view>
  133. </block>
  134. <block v-if="sortProduct.length == 0">
  135. <view class="noCommodity">
  136. <view class="pictrue" style="margin: 0 auto;">
  137. <image src="http://ygs.hqgjsmc.com/baseimg/noCart.png"></image>
  138. <view>暂无商品,去看点什么吧</view>
  139. </view>
  140. <recommend :hostProduct="hostProduct"></recommend>
  141. </view>
  142. </block>
  143. </view>
  144. <!-- #ifdef H5 -->
  145. <a v-if="beian_sn" href="https://beian.miit.gov.cn/#/Integrated/index"
  146. class="copyRight">{{beian_sn}}</a>
  147. <!-- #endif -->
  148. </view>
  149. </view>
  150. <view v-else>
  151. <view class="error-network">
  152. <image src="/static/images/error-network.png"></image>
  153. <view class="title">网络连接断开</view>
  154. <view class="con">
  155. <view class="label">请检查情况:</view>
  156. <view class="item">· 在设置中是否已开启网络权限</view>
  157. <view class="item">· 当前是否处于弱网环境</view>
  158. <view class="item">· 版本是否过低,升级试试吧</view>
  159. </view>
  160. <view class="btn" @click="reconnect">重新连接</view>
  161. </view>
  162. </view>
  163. <!-- #ifdef APP-PLUS -->
  164. <view class="privacy-wrapper" v-if="privacyStatus">
  165. <view class="privacy-box">
  166. <view class="title">服务协议与隐私政策</view>
  167. <view class="content">
  168. 请务必审慎阅读、充分理解“服务协议与 隐私政策”各条款,包括但不限于:为了 向你提供即时通讯、内容分享等服务,我 们需要收集你的设备信息、操作日志等个
  169. 人信息。你可以在“设置”中查看、变更、 删除个人信息并管理你的授权。
  170. <br />
  171. 你可以阅读
  172. <navigator url="/pages/users/privacy/index">《服务协议与隐私政策》</navigator>
  173. 了解 详细信息。如你同意,请点击“我同意”开始接受我们的服务。
  174. </view>
  175. <view class="btn-box">
  176. <view class="btn-item" @click="confirmApp">我同意</view>
  177. <view class="btn" @click="closeModel">随便逛逛</view>
  178. </view>
  179. </view>
  180. </view>
  181. <!-- #endif -->
  182. <!-- 发送给朋友图片 -->
  183. <view class="share-box" v-if="isIntegral">
  184. <!-- #ifndef H5 -->
  185. <image src="http://ygs.hqgjsmc.com/baseimg/share-info.png" @click="closeShare"></image>
  186. <!-- #endif -->
  187. <!-- #ifdef H5 -->
  188. <image src="/static/images/share-info-wechat.png" @click="closeShare"></image>
  189. <!-- #endif -->
  190. </view>
  191. <!-- 优惠券弹窗 -->
  192. <view class="coupon_popups" v-if="showCoupon">
  193. <view class="bg"></view>
  194. <view class="con" :style="{ 'background-image': `url(${domain}/static/diy/couponWindow${keyColor}.png)` }">
  195. <scroll-view scroll-y="true">
  196. <view v-for="(item, index) in couponArray" class="item">
  197. <view class="left">
  198. <view class="price">¥ <text>{{item.coupon_price}}</text></view>
  199. <view class="max_price" v-if="item.use_min_price > 0">满{{item.use_min_price}}可用</view>
  200. <view class="max_price" v-else>无门槛</view>
  201. </view>
  202. <view class="right">
  203. <view class="time line1" v-if="item.coupon_type">有效期{{item.use_start_time}} -
  204. {{item.use_end_time}}</view>
  205. <text class="coupon_type">{{couponTypeMsg[item.type] || '店铺券'}}</text>
  206. <navigator :url="'/pages/columnGoods/goods_coupon_list/index?coupon_id='+item.coupon_id"
  207. class='bnt1 b-color' hover-class="none"><text
  208. class="title titleSize">{{item.title}}</text>
  209. <view class="title titleColor">
  210. 全场商品均可使用
  211. </view>
  212. </navigator>
  213. <!-- <view>{{item.start_time}}-{{item.end_time}}</view> -->
  214. </view>
  215. </view>
  216. </scroll-view>
  217. <view class="text">优惠券已放入您的账户中,点击“优惠券”去使用</view>
  218. <view class='iconfont icon-guanbi3' @click="showCoupon = false"></view>
  219. </view>
  220. </view>
  221. <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"
  222. :isGoIndex="false"></authorize>
  223. <!-- #ifndef H5 -->
  224. <passwordPopup></passwordPopup>
  225. <!-- #endif -->
  226. <view class="page-btm" style="padding-top: 20rpx;">
  227. ©2022 浙江易博网络科技有限公司 版权所有
  228. </view>
  229. <view class="page-btm" @click="gocx" style="padding-bottom: 10rpx;">
  230. 浙ICP备2021013190号
  231. </view>
  232. </view>
  233. </template>
  234. <script>
  235. // +----------------------------------------------------------------------
  236. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  237. // +----------------------------------------------------------------------
  238. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  239. // +----------------------------------------------------------------------
  240. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  241. // +----------------------------------------------------------------------
  242. // | Author: CRMEB Team <admin@crmeb.com>
  243. // +----------------------------------------------------------------------
  244. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  245. let app = getApp();
  246. import {
  247. getUserInfo
  248. } from '@/api/user.js';
  249. import {
  250. getDiy,
  251. getIndexData,
  252. getAppVersion,
  253. getUserCoupons
  254. } from '@/api/api.js';
  255. // #ifdef MP-WEIXIN
  256. import {
  257. getTemlIds
  258. } from '@/api/api.js';
  259. import {
  260. SUBSCRIBE_MESSAGE,
  261. TIPS_KEY
  262. } from '@/config/cache';
  263. // #endif
  264. import {
  265. getShare,
  266. getconfig
  267. } from '@/api/public.js';
  268. import {
  269. goShopDetail
  270. } from '@/libs/order.js';
  271. import {
  272. mapGetters
  273. } from 'vuex';
  274. import {
  275. getProductslist,
  276. getProductHot,
  277. storeCategory
  278. } from '@/api/store.js';
  279. import {
  280. initiateAssistApi
  281. } from '@/api/activity.js';
  282. import {
  283. openBargainSubscribe
  284. } from '@/utils/SubscribeMessage.js';
  285. import {
  286. setVisit,
  287. spread
  288. } from '@/api/user.js';
  289. import recommend from '@/components/recommend';
  290. // #ifndef H5
  291. import passwordPopup from '@/components/passwordPopup';
  292. // #endif
  293. // #ifdef H5
  294. import mConfig from './component/index.js';
  295. // #endif
  296. import authorize from '@/components/Authorize';
  297. // #ifdef MP || APP-PLUS
  298. import activeParty from './component/activeParty';
  299. import headerSerch from './component/headerSerch';
  300. import coupon from './component/coupon';
  301. import bargain from './component/bargain';
  302. import blankPage from './component/blankPage';
  303. import combination from './component/combination';
  304. import customerService from './component/customerService';
  305. import goodList from './component/goodList';
  306. import guide from './component/guide';
  307. import liveBroadcast from './component/liveBroadcast';
  308. import menus from './component/menus';
  309. import news from './component/news';
  310. import topic from './component/topic';
  311. import presellList from './component/presellList';
  312. import plantList from './component/plantList';
  313. import pictureCube from './component/pictureCube'
  314. import shopList from './component/shopList';
  315. import richText from './component/richText';
  316. import seckill from './component/seckill';
  317. import swiperBg from './component/swiperBg';
  318. import tabNav from './component/tabNav';
  319. import titles from './component/titles';
  320. // #endif
  321. import {
  322. silenceBindingSpread,
  323. configMap,
  324. isWeixin
  325. } from '@/utils/index';
  326. import history from '@/mixins/history';
  327. import shareScence from '@/libs/spread';
  328. import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue';
  329. import {
  330. getNewPeopleCouponLst
  331. } from '@/api/activity.js'
  332. import {
  333. HTTP_REQUEST_URL
  334. } from '@/config/app';
  335. export default {
  336. computed: configMap({
  337. hide_mer_status: 0,
  338. beian_sn: '',
  339. share_title: '',
  340. site_name: ''
  341. },
  342. mapGetters(['isLogin', 'uid', 'keyColor'])),
  343. mixins: [history],
  344. components: {
  345. easyLoadimage,
  346. recommend,
  347. authorize,
  348. // #ifndef H5
  349. passwordPopup,
  350. // #endif
  351. // #ifdef H5
  352. ...mConfig,
  353. // #endif
  354. // #ifdef MP || APP-PLUS
  355. activeParty,
  356. headerSerch,
  357. bargain,
  358. coupon,
  359. blankPage,
  360. combination,
  361. customerService,
  362. goodList,
  363. guide,
  364. liveBroadcast,
  365. menus,
  366. news,
  367. topic,
  368. presellList,
  369. plantList,
  370. pictureCube,
  371. shopList,
  372. richText,
  373. seckill,
  374. swiperBg,
  375. tabNav,
  376. titles
  377. // #endif
  378. },
  379. data() {
  380. return {
  381. domain: HTTP_REQUEST_URL,
  382. couponTypeMsg: {
  383. 10: '通用券',
  384. 11: '品类券',
  385. 12: '跨店券'
  386. },
  387. styleConfig: [],
  388. showSkeleton: true, //骨架屏显示隐藏
  389. isNodes: 0, //控制什么时候开始抓取元素节点,只要数值改变就重新抓取
  390. privacyStatus: false,
  391. errorNetwork: false,
  392. ad: {
  393. home_ad_pic: ''
  394. },
  395. userInfo: {},
  396. loading: false,
  397. isAuto: false, //没有授权的不会自动授权
  398. isShowAuth: false, //是否隐藏授权
  399. statusBarHeight: statusBarHeight,
  400. navIndex: 0,
  401. navTop: [],
  402. subscribe: false,
  403. followUrl: '',
  404. followHid: true,
  405. followCode: false,
  406. imgUrls: [{
  407. url: '',
  408. pic: '',
  409. id: '',
  410. name: ''
  411. }],
  412. hot: [],
  413. sortList: [],
  414. menus: [{
  415. url: '',
  416. pic: '',
  417. id: '',
  418. name: ''
  419. }, {
  420. url: '',
  421. pic: '',
  422. id: '',
  423. name: ''
  424. }, {
  425. url: '',
  426. pic: '',
  427. id: '',
  428. name: ''
  429. }, {
  430. url: '',
  431. pic: '',
  432. id: '',
  433. name: ''
  434. }, {
  435. url: '',
  436. pic: '',
  437. id: '',
  438. name: ''
  439. }, {
  440. url: '',
  441. pic: '',
  442. id: '',
  443. name: ''
  444. }, {
  445. url: '',
  446. pic: '',
  447. id: '',
  448. name: ''
  449. }, {
  450. url: '',
  451. pic: '',
  452. id: '',
  453. name: ''
  454. }, {
  455. url: '',
  456. pic: '',
  457. id: '',
  458. name: ''
  459. }, {
  460. url: '',
  461. pic: '',
  462. id: '',
  463. name: ''
  464. }],
  465. window: false,
  466. navH: '',
  467. couponList: [],
  468. marTop: 0,
  469. loadend: false,
  470. loading: false,
  471. loadTitle: '加载更多',
  472. sortProduct: [],
  473. where: {
  474. pid: 0,
  475. page: 1,
  476. limit: 6
  477. },
  478. is_switch: true,
  479. hostProduct: [],
  480. hotPage: 1,
  481. hotLimit: 30,
  482. hotScroll: true,
  483. hotLoading: false,
  484. hotTitle: '加载更多',
  485. explosiveMoney: [],
  486. prodeuctTop: 0,
  487. pinkInfo: '',
  488. searchH: 0,
  489. domOffsetTop: 50,
  490. // #ifdef APP-PLUS || MP
  491. isFixed: true,
  492. // #endif
  493. // #ifdef H5
  494. isFixed: false,
  495. // #endif
  496. goodScroll: true, //精品推荐开关
  497. params: {
  498. //精品推荐分页
  499. page: 1,
  500. limit: 10
  501. },
  502. tempArr: [], //精品推荐临时数组
  503. numConfig: 0,
  504. pageInfo: '', // 精品推荐全数据
  505. swiperCur: 0,
  506. d: '',
  507. h: '',
  508. m: '',
  509. s: '',
  510. sum_h: '',
  511. sortMarTop: 0,
  512. globalDatas: {},
  513. // #ifdef MP || APP-PLUS
  514. mpHeight: 108,
  515. // #endif
  516. // #ifndef MP || APP-PLUS
  517. mpHeight: 0,
  518. // #endif
  519. currSpid: '',
  520. _options: {},
  521. isIntegral: false,
  522. appUpdate: {},
  523. sortMpTop: 0,
  524. bgColor: '',
  525. bgPic: '',
  526. bgTabVal: '',
  527. windowHeight: 0,
  528. isHeaderSerch: false,
  529. showCoupon: false,
  530. couponArray: []
  531. };
  532. },
  533. /**
  534. * 用户点击右上角分享
  535. */
  536. // #ifdef MP
  537. onShareAppMessage: function() {
  538. let that = this;
  539. wx.showShareMenu({
  540. withShareTicket: true,
  541. menus: ['shareAppMessage', 'shareTimeline']
  542. });
  543. return {
  544. title: that.share_title,
  545. path: '/pages/index/index?spid=' + that.uid
  546. };
  547. },
  548. onShareTimeline: function() {
  549. let that = this;
  550. return {
  551. title: that.share_title,
  552. query: {
  553. spid: that.uid
  554. },
  555. imageUrl: ''
  556. };
  557. },
  558. // #endif
  559. onLoad(options) {
  560. let that = this
  561. this._options = options;
  562. // #ifdef APP-PLUS
  563. const pages = getCurrentPages();
  564. const page = pages[pages.length - 1];
  565. const currentWebview = page.$getAppWebview();
  566. currentWebview.setStyle({
  567. pullToRefresh: {
  568. support: !that.isSupport,
  569. style: plus.os.name === 'Android' ? 'circle' : 'default'
  570. }
  571. });
  572. that.isSupport = !that.isSupport;
  573. that.appVersionConfig(); //APP版本检测
  574. // #endif
  575. that.$nextTick(function() {
  576. uni.getSystemInfo({
  577. success: function(res) {
  578. that.windowHeight = res.windowHeight;
  579. }
  580. });
  581. })
  582. that.pageLoad(options);
  583. setTimeout(() => {
  584. that.isNodes++;
  585. }, 100);
  586. },
  587. onShow() {
  588. this.getConfig();
  589. this.isIntegral = uni.getStorageSync('isIntegral')
  590. // #ifdef APP-PLUS
  591. if (this.appUpdate.openUpgrade == '1') {
  592. this.alertAppUpdate();
  593. }
  594. // #endif
  595. this.loadCoupon()
  596. },
  597. onHide() {
  598. uni.setStorageSync('isIntegral', false)
  599. },
  600. onReady() {
  601. },
  602. watch: {
  603. globalDatas(nVal, oVal) {
  604. // #ifdef H5
  605. this.ShareInfo(nVal);
  606. // #endif
  607. },
  608. privacyStatus(n) {
  609. if (n) {
  610. uni.hideTabBar();
  611. } else {
  612. uni.showTabBar();
  613. }
  614. },
  615. },
  616. onPullDownRefresh() {
  617. this.styleConfig = []
  618. this.diyData()
  619. setTimeout(() => {
  620. uni.stopPullDownRefresh();
  621. }, 100);
  622. this.reconnect();
  623. },
  624. methods: {
  625. gocx() {
  626. let url = 'https://www.miit.gov.cn/'
  627. // #ifdef H5
  628. window.location.href = 'https://www.miit.gov.cn/'
  629. // #endif
  630. // #ifdef APP-PLUS
  631. plus.runtime.openURL(
  632. url,
  633. function(err) {
  634. console.log(err);
  635. }
  636. );
  637. // #endif
  638. },
  639. changeBarg() {},
  640. loadCoupon() {
  641. if (!this.showCoupon && !uni.getStorageSync('show_coupon') && uni.getStorageSync('is_new_user')) {
  642. getNewPeopleCouponLst().then(res => {
  643. this.couponArray = res.data;
  644. setTimeout(() => {
  645. this.showCoupon = this.couponArray.length > 0;
  646. uni.setStorageSync('show_coupon', '1')
  647. }, 1500);
  648. })
  649. }
  650. },
  651. pageLoad(options) {
  652. let that = this;
  653. if (options.spid) {
  654. that.currSpid = options.spid;
  655. app.globalData.spid = options.spid;
  656. }
  657. // #ifdef APP-PLUS
  658. try {
  659. let val = uni.getStorageSync('privacyStatus') || false;
  660. if (!val) {
  661. this.privacyStatus = true;
  662. }
  663. } catch (e) {}
  664. this.snycNetWork();
  665. // #endif
  666. // #ifdef MP
  667. if (options.scene) {
  668. let value = that.$util.getUrlParams(decodeURIComponent(options.scene));
  669. if (value.id) options.id = value.id;
  670. //记录推广人uid
  671. if (value.spid) {
  672. that.currSpid = value.spid;
  673. app.globalData.spid = value.spid;
  674. }
  675. }
  676. // #endif
  677. shareScence(that.currSpid, that.isLogin);
  678. this.isLogin && silenceBindingSpread();
  679. this.getIndexConfig()
  680. Promise.all([
  681. this.diyData(),
  682. this.get_host_product(),
  683. ]);
  684. if (this.isLogin) {
  685. this.getUserInfo();
  686. // #ifdef MP
  687. this.getHistory();
  688. // #endif
  689. }
  690. },
  691. closeShare() {
  692. uni.setStorageSync('isIntegral', false);
  693. this.isIntegral = uni.getStorageSync('isIntegral');
  694. },
  695. bindHeighta(data) {
  696. // #ifdef APP-PLUS
  697. this.sortMpTop = data.top + data.height;
  698. // #endif
  699. },
  700. // 重新链接
  701. reconnect() {
  702. uni.getNetworkType({
  703. success: res => {
  704. this.errorNetwork = res.networkType === 'none';
  705. if (!this.errorNetwork) {
  706. this.pageLoad(this._options);
  707. }
  708. }
  709. });
  710. },
  711. // #ifdef APP-PLUS
  712. snycNetWork() {
  713. uni.getNetworkType({
  714. success: res => {
  715. this.errorNetwork = res.networkType === 'none';
  716. }
  717. });
  718. },
  719. // 同意隐私协议
  720. confirmApp() {
  721. uni.setStorageSync('privacyStatus', true);
  722. this.privacyStatus = false;
  723. },
  724. // 关闭 Model
  725. closeModel() {
  726. this.privacyStatus = false;
  727. },
  728. // #endif
  729. // 对象转数组
  730. objToArr(data) {
  731. let obj = Object.keys(data).sort();
  732. let m = obj.map(key => data[key]);
  733. return m;
  734. },
  735. diyData() {
  736. let that = this;
  737. getDiy().then(res => {
  738. setTimeout(() => {
  739. that.isNodes++;
  740. }, 0);
  741. that.errorNetwork = false
  742. uni.setNavigationBarTitle({
  743. title: res.data.title
  744. });
  745. let data = res.data;
  746. if (data.is_bg_color) {
  747. that.bgColor = data.color_picker
  748. }
  749. if (data.is_bg_pic) {
  750. that.bgPic = data.bg_pic
  751. that.bgTabVal = data.bg_tab_val
  752. }
  753. that.styleConfig = that.objToArr(res.data.value);
  754. that.styleConfig.forEach((item, index, arr) => {
  755. if (item.name == 'headerSerch') {
  756. that.isHeaderSerch = true
  757. }
  758. });
  759. });
  760. },
  761. // 微信登录回调
  762. onLoadFun: function(e) {
  763. this.isShowAuth = false;
  764. },
  765. // #ifdef APP-PLUS
  766. appVersionConfig() {
  767. var that = this;
  768. //app升级
  769. // 获取本地应用资源版本号
  770. getAppVersion().then(res => {
  771. that.$set(that.appUpdate, 'androidAddress', res.data.androidAddress);
  772. that.$set(that.appUpdate, 'appVersion', res.data.appVersion);
  773. that.$set(that.appUpdate, 'iosAddress', res.data.iosAddress);
  774. that.$set(that.appUpdate, 'openUpgrade', res.data.openUpgrade);
  775. plus.runtime.getProperty(plus.runtime.appid, function(inf) {
  776. let nowVersion = (inf.version).split('.').join('');
  777. let appVersion = (res.data.appVersion).split('.').join('');
  778. that.$set(that.appUpdate, 'alert', appVersion > nowVersion);
  779. that.alertAppUpdate();
  780. });
  781. })
  782. },
  783. alertAppUpdate() {
  784. if (this.appUpdate.alert) {
  785. uni.getSystemInfo({
  786. success: (res) => {
  787. uni.showModal({
  788. title: '更新提示',
  789. content: '发现新版本,是否前去下载?',
  790. showCancel: this.appUpdate.openUpgrade !=
  791. '1',
  792. cancelColor: '#eeeeee',
  793. confirmColor: '#FF0000',
  794. success: (response) => {
  795. if (response.confirm) {
  796. switch (res.platform) {
  797. case "android":
  798. plus.runtime.openURL(this
  799. .appUpdate
  800. .androidAddress);
  801. break;
  802. case "ios":
  803. plus.runtime.openURL(encodeURI(
  804. this.appUpdate
  805. .iosAddress));
  806. break;
  807. }
  808. }
  809. }
  810. });
  811. }
  812. })
  813. }
  814. },
  815. // #endif
  816. getConfig() {
  817. // 获取配置
  818. getconfig()
  819. .then(res => {
  820. let self = this;
  821. this.globalDatas = res.data;
  822. uni.$emit('configData', res.data);
  823. })
  824. .catch(err => {});
  825. },
  826. // 分类页更多
  827. bindMore() {
  828. console.log(this.navTop[this.navIndex]);
  829. try {
  830. uni.setStorageSync('storeIndex', this.navTop[this.navIndex].pid);
  831. uni.switchTab({
  832. url: '/pages/goods_cate/goods_cate'
  833. });
  834. } catch (e) {}
  835. },
  836. goDetails(item) {
  837. goShopDetail(item, this.uid).then(res => {
  838. if (this.isLogin) {
  839. initiateAssistApi(item.activity_id)
  840. .then(res => {
  841. let id = res.data.product_assist_set_id;
  842. uni.hideLoading();
  843. // #ifndef MP
  844. uni.navigateTo({
  845. url: '/pages/activity/assist_detail/index?id=' + id
  846. });
  847. // #endif
  848. // #ifdef MP
  849. openBargainSubscribe()
  850. .then(res => {
  851. uni.hideLoading();
  852. uni.navigateTo({
  853. url: '/pages/activity/assist_detail/index?id=' + id
  854. });
  855. })
  856. .catch(err => {
  857. uni.hideLoading();
  858. });
  859. // #endif
  860. })
  861. .catch(err => {
  862. uni.showToast({
  863. title: err,
  864. icon: 'none'
  865. });
  866. });
  867. } else {
  868. this.isAuto = true;
  869. this.isShowAuth = true
  870. }
  871. });
  872. },
  873. /**
  874. * 获取个人用户信息
  875. */
  876. getUserInfo: function() {
  877. let that = this;
  878. getUserInfo().then(res => {
  879. that.userInfo = res.data;
  880. });
  881. },
  882. // 记录会员访问
  883. setVisit() {
  884. setVisit({
  885. url: '/pages/index/index'
  886. }).then(res => {
  887. console.log(res);
  888. });
  889. },
  890. // 导航分类切换
  891. changeTab(e) {
  892. let self = this;
  893. if (this.navIndex == e.index) return;
  894. this.navIndex = e.index;
  895. if (e.index > 0) {
  896. storeCategory({
  897. pid: e.pid
  898. }).then(res => {
  899. this.sortList = res.data.length > 9 ? res.data.splice(0, 9) : res.data;
  900. if (this.sortList.length > 0) {
  901. this.where.pid = e.pid;
  902. this.where.page = 1;
  903. this.loadend = false;
  904. this.loading = false;
  905. this.sortProduct = [];
  906. this.get_product_list();
  907. }
  908. });
  909. self.sortMarTop = 10;
  910. }
  911. },
  912. //分类产品
  913. get_product_list: function() {
  914. let that = this;
  915. if (that.loading) return;
  916. that.loading = true;
  917. that.loadTitle = '';
  918. getProductslist(that.where)
  919. .then(res => {
  920. let list = res.data.list;
  921. let productList = that.$util.SplitArray(list, that.sortProduct);
  922. let loadend = list.length < that.where.limit;
  923. that.loadend = loadend;
  924. that.loading = false;
  925. that.loadTitle = loadend ? '已全部加载' : '加载更多';
  926. that.$set(that, 'sortProduct', productList);
  927. that.$set(that.where, 'page', that.where.page + 1);
  928. })
  929. .catch(err => {
  930. that.loading = false;
  931. that.loadTitle = '加载更多';
  932. });
  933. },
  934. /**
  935. * 获取我的推荐
  936. */
  937. get_host_product: function() {
  938. let that = this;
  939. let num = that.hotLimit;
  940. if (!that.hotScroll) return;
  941. if (that.hotLoading) return;
  942. that.hotLoading = true;
  943. that.hotTitle = '';
  944. getProductHot(that.hotPage, that.hotLimit).then(res => {
  945. let list = res.data.list;
  946. let productList = that.$util.SplitArray(list, that.hostProduct);
  947. let hotScroll = list.length <= num && list.length != 0;
  948. that.hotScroll = hotScroll;
  949. that.hotLoading = false;
  950. that.hotTitle = !hotScroll ? '已全部加载' : '加载更多';
  951. that.$set(that, 'hostProduct', productList);
  952. that.$set(that, 'hotPage', that.hotPage + 1);
  953. });
  954. },
  955. // 首页数据
  956. getIndexConfig: function() {
  957. let that = this;
  958. getIndexData().then(res => {
  959. that.$set(that, 'imgUrls', res.data.banner);
  960. that.$set(that, 'menus', res.data.menu);
  961. that.$set(that, 'hot', res.data.hot);
  962. that.$set(that, 'ad', res.data.ad);
  963. res.data.category.unshift({
  964. cate_name: '首页'
  965. });
  966. that.$set(that, 'navTop', res.data.category);
  967. // #ifdef H5
  968. that.subscribe = res.data.subscribe;
  969. // #endif
  970. // 小程序判断用户是否授权;
  971. // #ifdef MP
  972. uni.getSetting({
  973. success(res) {
  974. if (!res.authSetting['scope.userInfo']) {
  975. that.window = that.couponList.length ? true : false;
  976. } else {
  977. that.window = false;
  978. }
  979. }
  980. });
  981. // #endif
  982. // #ifndef MP
  983. if (that.isLogin) {
  984. that.window = false;
  985. } else {
  986. that.window = that.couponList.length ? true : false;
  987. }
  988. // #endif
  989. that.reloadData();
  990. });
  991. },
  992. reloadData() {
  993. setTimeout(() => {
  994. this.showSkeleton = false
  995. }, 500)
  996. },
  997. // 授权关闭
  998. authColse: function(e) {
  999. this.isShowAuth = e;
  1000. },
  1001. // 首发新品详情
  1002. goDetail(item) {
  1003. if (item.activity && item.activity.type === '2' && !this.isLogin) {
  1004. // #ifdef H5
  1005. uni.showModal({
  1006. title: '提示',
  1007. content: '您未登录,请登录!',
  1008. success: function(res) {
  1009. if (res.confirm) {
  1010. uni.navigateTo({
  1011. url: '/pages/users/login/index'
  1012. });
  1013. } else if (res.cancel) {}
  1014. }
  1015. });
  1016. // #endif
  1017. // #ifdef MP
  1018. this.$set(this, 'isAuto', true);
  1019. this.$set(this, 'isShowAuth', true);
  1020. // #endif
  1021. return;
  1022. } else {
  1023. goShopDetail(item, this.uid).then(res => {
  1024. uni.navigateTo({
  1025. url: `/pages/goods_details/index?id=${item.id}`
  1026. });
  1027. });
  1028. }
  1029. },
  1030. // 分类详情
  1031. godDetail(item) {
  1032. uni.navigateTo({
  1033. url: `/pages/goods_details/index?id=${item.id}`
  1034. });
  1035. },
  1036. //拼团详情
  1037. goCombinDetail(item) {
  1038. uni.navigateTo({
  1039. url: `/pages/activity/combination_details/index?id=${item.product_group_id}`
  1040. });
  1041. },
  1042. countTime: function() {
  1043. // 获取当前时间
  1044. var date = new Date();
  1045. var now = date.getTime();
  1046. //设置截止时间
  1047. var endDate = new Date('2020-10-22 23:23:23');
  1048. var end = endDate.getTime();
  1049. //时间差
  1050. var leftTime = end - now;
  1051. //定义变量 d,h,m,s保存倒计时的时间
  1052. if (leftTime >= 0) {
  1053. this.d = Math.floor(leftTime / 1000 / 60 / 60 / 24);
  1054. this.h = Math.floor((leftTime / 1000 / 60 / 60) % 24);
  1055. this.m = Math.floor((leftTime / 1000 / 60) % 60);
  1056. this.s = Math.floor((leftTime / 1000) % 60);
  1057. this.sum_h = this.d * 24 + this.h;
  1058. }
  1059. //递归每秒调用countTime方法,显示动态时间效果
  1060. setTimeout(this.countTime, 1000);
  1061. },
  1062. //#ifdef H5
  1063. ShareInfo(datas) {
  1064. let data = this.storeInfo;
  1065. let href = location.href;
  1066. if (this.$wechat.isWeixin()) {
  1067. if (this.isLogin) {
  1068. href = href.indexOf('?') === -1 ? href + '?spid=' + this.uid : href + '&spid=' + this.uid;
  1069. } else {
  1070. href = href;
  1071. }
  1072. let configAppMessage = {
  1073. desc: datas.share_info,
  1074. title: datas.share_title,
  1075. link: href,
  1076. imgUrl: datas.share_pic
  1077. };
  1078. this.$wechat
  1079. .wechatEvevt(['updateAppMessageShareData', 'updateTimelineShareData', 'onMenuShareAppMessage',
  1080. 'onMenuShareTimeline'
  1081. ], configAppMessage)
  1082. .then(res => {
  1083. console.log(res, '=============================>>WXAPI');
  1084. })
  1085. .catch(err => {
  1086. console.log(err);
  1087. });
  1088. }
  1089. },
  1090. //#endif
  1091. },
  1092. mounted() {
  1093. },
  1094. // 滚动到底部
  1095. onReachBottom() {
  1096. if (this.navIndex == 0) {
  1097. // 首页加载更多
  1098. this.get_host_product();
  1099. } else {
  1100. // 分类栏目加载更多
  1101. if (this.sortProduct.length > 0) {
  1102. this.get_product_list();
  1103. } else {
  1104. this.get_host_product();
  1105. }
  1106. }
  1107. },
  1108. // 滚动监听
  1109. onPageScroll(e) {
  1110. // #ifdef H5
  1111. if (this.isHeaderSerch) {
  1112. if (e.scrollTop > this.domOffsetTop) {
  1113. this.isFixed = true;
  1114. }
  1115. if (e.scrollTop < this.domOffsetTop) {
  1116. this.$nextTick(() => {
  1117. this.isFixed = false;
  1118. });
  1119. }
  1120. } else {
  1121. this.isFixed = false
  1122. }
  1123. // #endif
  1124. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  1125. uni.$emit('scroll');
  1126. }
  1127. };
  1128. </script>
  1129. <style>
  1130. </style>
  1131. <style lang="scss">
  1132. .bnt1 {
  1133. color: red;
  1134. }
  1135. page {
  1136. display: flex;
  1137. flex-direction: column;
  1138. height: 100%;
  1139. }
  1140. .main {
  1141. padding: 0 20rpx;
  1142. }
  1143. .colum0 {
  1144. white-space: nowrap;
  1145. display: flex;
  1146. }
  1147. .ysize {
  1148. background-size: 100%;
  1149. }
  1150. .fullsize {
  1151. background-size: 100% 100%;
  1152. }
  1153. .repeat {
  1154. background-repeat: repeat;
  1155. }
  1156. .noRepeat {
  1157. background-repeat: no-repeat;
  1158. }
  1159. .privacy-wrapper {
  1160. z-index: 999;
  1161. position: fixed;
  1162. left: 0;
  1163. top: 0;
  1164. bottom: 0;
  1165. right: 0;
  1166. width: 100%;
  1167. height: 100%;
  1168. background: #7f7f7f;
  1169. .privacy-box {
  1170. position: absolute;
  1171. left: 50%;
  1172. top: 50%;
  1173. transform: translate(-50%, -50%);
  1174. width: 560rpx;
  1175. padding: 50rpx 45rpx 0;
  1176. background: #fff;
  1177. border-radius: 20rpx;
  1178. .title {
  1179. text-align: center;
  1180. font-size: 32rpx;
  1181. text-align: center;
  1182. color: #333;
  1183. font-weight: 700;
  1184. }
  1185. .content {
  1186. margin-top: 20rpx;
  1187. line-height: 1.5;
  1188. font-size: 26rpx;
  1189. color: #666;
  1190. navigator {
  1191. display: inline-block;
  1192. color: #e93323;
  1193. }
  1194. }
  1195. .btn-box {
  1196. margin-top: 40rpx;
  1197. text-align: center;
  1198. font-size: 30rpx;
  1199. .btn-item {
  1200. height: 82rpx;
  1201. line-height: 82rpx;
  1202. background: linear-gradient(90deg, #f67a38 0%, #f11b09 100%);
  1203. color: #fff;
  1204. border-radius: 41rpx;
  1205. }
  1206. .btn {
  1207. padding: 30rpx 0;
  1208. }
  1209. }
  1210. }
  1211. }
  1212. .coupon_popups {
  1213. z-index: 999;
  1214. position: fixed;
  1215. left: 0;
  1216. top: 0;
  1217. width: 100%;
  1218. height: 100%;
  1219. text-align: center;
  1220. .bg {
  1221. position: absolute;
  1222. left: 0;
  1223. top: 0;
  1224. width: 100%;
  1225. height: 100%;
  1226. background-color: rgba(0, 0, 0, .5);
  1227. }
  1228. .con {
  1229. position: absolute;
  1230. left: 50%;
  1231. top: 50%;
  1232. transform: translate(-50%, -50%);
  1233. width: 680rpx;
  1234. height: 900rpx;
  1235. background-size: 100% 700rpx;
  1236. background-repeat: no-repeat;
  1237. scroll-view {
  1238. width: 540rpx;
  1239. height: 306rpx;
  1240. padding-top: 20rpx;
  1241. margin: 300rpx auto 0;
  1242. }
  1243. .item {
  1244. display: flex;
  1245. align-items: center;
  1246. width: 100%;
  1247. height: 164rpx;
  1248. background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABDgAAAFICAMAAACC1L7bAAAAilBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////2N2iNAAAALXRSTlMA9xnrZyf0790ev4d1Egr7cl9TI+XNbVpAtKSUjX0NB6ucgnpDMdjRxUw7LdTK5bIiAAAF40lEQVR42uzcWW7CMBSF4UNImAIBEcpUKJQixt79b68qD1VLgNi8VHL+bxHH9tH1VUE+SeedVs1QkMmNAYGotTrzdNJWiSRtGe7J5aRnQFh2m1z3ndeGB05ycjYgOPNct2WLvuGRoZxMDAhPbbnSDQmPlDKpnCwMCNE+UsGxYSixl5MXA4JUP+lKbCgXyUHbgED1J/pjbHAwloONAcGKqfP8jVYqlTUNCNdQPxKDmw+V6hoQsEZOm+et0VOJHiUzwnbgjPQ3Uwlm6BC6WBcRZ6SHpa7QMqNimj19ezd42OqBLcO3CF/K2IG/5lR3Tbm8oQIuVd/S4CfmnYJqiyXtDJ5eM92QdAyohI6UG7zVB7qWpQZUxRufVJ4z6kb65dytG1AZR80NzzkMTkkkKY/XpAaqJWVqFICvmfiSBcDTp1hnDsDTiFX+AHzVCA4A3ggOAAQHgAKCA8D/Izi+2KmDAQAAAAZC/tYDGMB9CiJAHMARB9ATByAO4IgD6IkDEAdwxAH0xAGIAzjiAHriAMQBHHEAPXEA4gCOOICeOABxAEccQE8cgDiAIw6gJw5AHMARB9ATByAOxk4dDAAAADAQ8rcewADuUxDBEQfQEwcgDuCIA+iJAxAHcMQB9MQBiAM44gB64gDEARxxAD1xAOIAjjiAnjgAcQBHHEBPHIA4gCMOoCcOQBzAEQfQEwcgDuCIA+iJAxAHcMQB9MQBiAM44gB64gDEARxxAD1xAOIAjjiAnjgAcQBHHEBPHIA4gCMOoCcOQBzAEQfQEwcgDuCIA+iJAxAHcMQB9MQBjJ06GAAAAGAg5G89gAHcpyASB3DEAfTEAYgDOOIAeuIAxAEccQA9cQDiAI44gJ44AHEARxxATxyAOIAjDqAnDkAcwBEH0BMHIA7giAPoiQMQB3DEAfTEAYgDOOIAeuIAxAEccQA9cQDiAI44gJ44AHEARxxATxyAOIAjDqAnDkAcwBEH0BMHIA7giAPoiQMQB3DEAfTEAYgDOOIAeuIAxAEccQA9cTB26mAAAACAgZC/9QAOYJ+CCMQBhDiAP3EA4gBCHMCfOABxACEO4E8cgDiAEAfwJw5AHECIA/gTByAOIMQB/IkDEAcQ4gD+xAGIAwhxAH/iAMQBhDiAP3EA4gBCHMCfOABxACEO4E8cgDiAEAfwJw5AHECIA/gTByAOIMQB/IkDEAcQ4gD+xAGIAwhxAH/iAMQBhDiAP3EA4gBCHMCfOABxACEOYOzUwQAAAAADIX/rAQzgPgVRTxyAOIAjDqAnDkAcwBEH0BMHIA7giAPoiQMQB3DEAfTEAYgDOOIAeuIAxAEccQA9cQDiAI44gJ44AHEARxxATxyAOIAjDqAnDkAcwBEH0BMHIA7giAPoiQMQB3DEAfTEAYgDOOIAeuIAxAEccQA9cQDiAI44gJ44AHEARxxATxyAOIAjDqAnDkAcwBEH0BMHIA7giIOxU4cEAIBAEMBAIUny/esR4BTqzBZi0CcOQBxAEAfQJw5AHEAQB9AnDkAcQBAH0CcOQBxAEAfQJw5AHEAQB9AnDkAcQBAH0CcOQBxAEAfQt+4AfNnrDK+dO8tNGIaiMHwSoBAKlERAQ4FQhnSQeve/vaoPRVWayTza/7cI2/ecKwNwMtDEAMDJRFMDACdb7Qz3WZ3SRJqX2fJ1YEBI9no23GGyGemP8sLZgYBkig3uLqpaLDk6EIy5tDY42iaqsTgZEISppJnBSZSqwdKAEAwlZhVHg1KNcrZiEICHQhK9ipOoVIucRVz476wfcWToLVOroQGeG8wlkXI42akF7zeE4BbyvRv6WS3UoaCVhd+m+jUy9JPqhmoFQRrHukkNfUzU7bgywF+fXJPONmpFZATvDSttAD1it6hQMwY/+O8pVcWV3aVOW/XBFyfw1TjXP8mXod1MvewN8NE6Vo3jmU2wdrlaEDXDb9HhqHqjF0OLWL1cDfDOKVGz5PBmaCKJdBQhWl9idUiy/QczSy31UxjgjYfpYxar6hufchGebA48QgAAAABJRU5ErkJggg==');
  1249. background-repeat: no-repeat;
  1250. background-size: 100% 100%;
  1251. margin-bottom: 20rpx;
  1252. border-radius: 20rpx;
  1253. position: relative;
  1254. .left {
  1255. width: 160rpx;
  1256. text-align: center;
  1257. &::after {
  1258. content: "";
  1259. display: block;
  1260. height: 110rpx;
  1261. border-right: 1rpx dashed #E6E6E6;
  1262. position: absolute;
  1263. left: 162rpx;
  1264. top: 25rpx;
  1265. }
  1266. .price {
  1267. color: #E93323;
  1268. font-size: 26rpx;
  1269. font-weight: bold;
  1270. text {
  1271. font-size: 46rpx;
  1272. }
  1273. }
  1274. .max_price {
  1275. color: #999999;
  1276. font-size: 18rpx;
  1277. margin-top: 8rpx;
  1278. }
  1279. }
  1280. .right {
  1281. width: 380rpx;
  1282. padding: 0 20rpx;
  1283. .title {
  1284. color: #333333;
  1285. font-size: 26rpx;
  1286. }
  1287. .time {
  1288. color: #999999;
  1289. font-size: 22rpx;
  1290. margin-top: 20rpx;
  1291. }
  1292. .bnt1 {
  1293. .titleSize {
  1294. font-weight: 700;
  1295. font-size: 33rpx;
  1296. }
  1297. .titleColor {
  1298. color: #999999;
  1299. }
  1300. }
  1301. .coupon_type {
  1302. position: absolute;
  1303. color: #fff;
  1304. font-size: 15rpx;
  1305. width: 30rpx;
  1306. text-align: center;
  1307. height: auto;
  1308. background: #E93323;
  1309. top: 0;
  1310. right: 20rpx;
  1311. line-height: 26rpx;
  1312. padding: 5rpx 0 15rpx;
  1313. &::after {
  1314. content: "";
  1315. width: 0;
  1316. height: 0;
  1317. border-left: 14rpx solid transparent;
  1318. border-right: 14rpx solid transparent;
  1319. border-bottom: 14rpx solid #fff;
  1320. position: absolute;
  1321. bottom: -4rpx;
  1322. left: 2rpx;
  1323. }
  1324. }
  1325. }
  1326. }
  1327. .text {
  1328. width: 600rpx;
  1329. margin: 30rpx auto 0;
  1330. font-size: 20rpx;
  1331. color: #ffffff;
  1332. }
  1333. .icon-guanbi3 {
  1334. color: #ffffff;
  1335. font-size: 70rpx;
  1336. position: absolute;
  1337. bottom: -80rpx;
  1338. left: 320rpx;
  1339. }
  1340. }
  1341. }
  1342. .copyRight {
  1343. margin: 60rpx auto 20rpx;
  1344. max-width: 690rpx;
  1345. font-size: 20rpx;
  1346. color: #707070;
  1347. text-decoration: none;
  1348. }
  1349. .share-box {
  1350. z-index: 1000;
  1351. position: fixed;
  1352. left: 0;
  1353. top: 0;
  1354. width: 100%;
  1355. height: 100%;
  1356. image {
  1357. width: 100%;
  1358. height: 100%;
  1359. }
  1360. }
  1361. .error-network {
  1362. position: fixed;
  1363. left: 0;
  1364. top: 0;
  1365. display: flex;
  1366. flex-direction: column;
  1367. align-items: center;
  1368. width: 100%;
  1369. height: 100%;
  1370. padding-top: 40rpx;
  1371. background: #fff;
  1372. padding-top: 30%;
  1373. image {
  1374. width: 414rpx;
  1375. height: 336rpx;
  1376. }
  1377. .title {
  1378. position: relative;
  1379. top: -40rpx;
  1380. font-size: 32rpx;
  1381. color: #666;
  1382. }
  1383. .con {
  1384. font-size: 24rpx;
  1385. color: #999;
  1386. .label {
  1387. margin-bottom: 20rpx;
  1388. }
  1389. .item {
  1390. margin-bottom: 20rpx;
  1391. }
  1392. }
  1393. .btn {
  1394. display: flex;
  1395. align-items: center;
  1396. justify-content: center;
  1397. width: 508rpx;
  1398. height: 86rpx;
  1399. margin-top: 100rpx;
  1400. border: 1px solid #d74432;
  1401. color: #e93323;
  1402. font-size: 30rpx;
  1403. border-radius: 120rpx;
  1404. }
  1405. }
  1406. .area-row {
  1407. overflow: hidden;
  1408. text-overflow: ellipsis;
  1409. white-space: nowrap;
  1410. display: block;
  1411. width: 100%;
  1412. text-align: center;
  1413. }
  1414. .page-index {
  1415. display: flex;
  1416. flex-direction: column;
  1417. min-height: 100%;
  1418. .page_content {
  1419. /* #ifdef MP || APP-PLUS */
  1420. padding-top: 270rpx;
  1421. /* #endif */
  1422. .page_bg {
  1423. background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
  1424. }
  1425. .nav {
  1426. padding: 0 0rpx 30rpx;
  1427. flex-wrap: wrap;
  1428. /* #ifdef MP */
  1429. margin-top: 0;
  1430. /* #endif */
  1431. /* #ifdef H5 */
  1432. margin-top: 0;
  1433. /* #endif */
  1434. .item {
  1435. display: flex;
  1436. flex-direction: column;
  1437. align-items: center;
  1438. justify-content: center;
  1439. width: 20%;
  1440. margin-top: 30rpx;
  1441. image {
  1442. width: 82rpx;
  1443. height: 82rpx;
  1444. }
  1445. }
  1446. }
  1447. .index-product-wrapper {
  1448. .nav-bd {
  1449. display: flex;
  1450. align-items: center;
  1451. .item {
  1452. display: flex;
  1453. flex-direction: column;
  1454. align-items: center;
  1455. justify-content: center;
  1456. width: 25%;
  1457. .txt {
  1458. font-size: 32rpx;
  1459. color: #282828;
  1460. }
  1461. .label {
  1462. display: flex;
  1463. align-items: center;
  1464. justify-content: center;
  1465. width: 124rpx;
  1466. height: 32rpx;
  1467. margin-top: 5rpx;
  1468. font-size: 24rpx;
  1469. color: #999;
  1470. }
  1471. &.active {
  1472. color: $theme-color;
  1473. .label {
  1474. background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
  1475. border-radius: 16rpx;
  1476. color: #fff;
  1477. }
  1478. }
  1479. }
  1480. }
  1481. .list-box {
  1482. display: flex;
  1483. flex-wrap: wrap;
  1484. justify-content: space-between;
  1485. .item {
  1486. width: 345rpx;
  1487. margin-bottom: 20rpx;
  1488. background-color: #fff;
  1489. border-radius: 10px;
  1490. overflow: hidden;
  1491. image {
  1492. width: 100%;
  1493. height: 345rpx;
  1494. }
  1495. .text-info {
  1496. padding: 10rpx 20rpx 15rpx;
  1497. .title {
  1498. color: #222222;
  1499. }
  1500. .old-price {
  1501. margin-top: 8rpx;
  1502. font-size: 26rpx;
  1503. color: #aaaaaa;
  1504. text-decoration: line-through;
  1505. text {
  1506. margin-right: 2px;
  1507. font-size: 20rpx;
  1508. }
  1509. }
  1510. .price {
  1511. display: flex;
  1512. align-items: flex-end;
  1513. color: $theme-color;
  1514. font-size: 34rpx;
  1515. font-weight: 800;
  1516. text {
  1517. padding-bottom: 4rpx;
  1518. font-size: 24rpx;
  1519. font-weight: normal;
  1520. }
  1521. .txt {
  1522. display: flex;
  1523. align-items: center;
  1524. justify-content: center;
  1525. width: 28rpx;
  1526. height: 28rpx;
  1527. margin-left: 15rpx;
  1528. margin-bottom: 10rpx;
  1529. border: 1px solid $theme-color;
  1530. border-radius: 4rpx;
  1531. font-size: 22rpx;
  1532. font-weight: normal;
  1533. }
  1534. }
  1535. }
  1536. }
  1537. &.on {
  1538. display: flex;
  1539. }
  1540. }
  1541. }
  1542. }
  1543. }
  1544. .productList {
  1545. background-color: #f1f1f1;
  1546. min-height: 70vh;
  1547. .sort {
  1548. width: 710rpx;
  1549. max-height: 380rpx;
  1550. background: rgba(255, 255, 255, 1);
  1551. border-radius: 16rpx;
  1552. padding: 8rpx 0rpx 30rpx;
  1553. flex-wrap: wrap;
  1554. margin: 25rpx auto 0 auto;
  1555. .item {
  1556. width: 20%;
  1557. margin-top: 30rpx;
  1558. text-align: center;
  1559. .pictrues {
  1560. width: 90rpx;
  1561. height: 90rpx;
  1562. background: rgba(248, 248, 248, 1);
  1563. border-radius: 50%;
  1564. margin: 0 auto;
  1565. }
  1566. .easy-loadimage {
  1567. width: 90rpx;
  1568. height: 90rpx;
  1569. display: inline-block;
  1570. }
  1571. .text {
  1572. color: #272727;
  1573. font-size: 24rpx;
  1574. margin-top: 10rpx;
  1575. overflow: hidden;
  1576. white-space: nowrap;
  1577. text-overflow: ellipsis;
  1578. }
  1579. }
  1580. }
  1581. }
  1582. .productList .list {
  1583. padding: 0 20rpx;
  1584. }
  1585. .productList .list.on {
  1586. background-color: #fff;
  1587. border-top: 1px solid #f6f6f6;
  1588. }
  1589. .productList .list .item {
  1590. width: 345rpx;
  1591. margin-top: 20rpx;
  1592. background-color: #fff;
  1593. border-radius: 10rpx;
  1594. .name {
  1595. display: flex;
  1596. align-items: center;
  1597. }
  1598. }
  1599. .productList .list .item.on {
  1600. width: 100%;
  1601. display: flex;
  1602. border-bottom: 1rpx solid #f6f6f6;
  1603. padding: 30rpx 0;
  1604. margin: 0;
  1605. }
  1606. .productList .list .item .pictrue {
  1607. position: relative;
  1608. width: 100%;
  1609. height: 345rpx;
  1610. }
  1611. .productList .list .item .pictrue.on {
  1612. width: 180rpx;
  1613. height: 180rpx;
  1614. }
  1615. .productList .list .item .pictrue image,
  1616. .productList .list .item .pictrue uni-image,
  1617. .productList .list .item .pictrue .easy-loadimage {
  1618. width: 100%;
  1619. height: 100%;
  1620. border-radius: 10rpx 10rpx 0 0;
  1621. }
  1622. /deep/.productList .list .item .pictrue uni-image.origin-img {
  1623. border-radius: 10rpx 10rpx 0 0;
  1624. }
  1625. .productList .list .item .pictrue image.on {
  1626. border-radius: 6rpx;
  1627. }
  1628. .productList .list .item .text {
  1629. padding: 14rpx 17rpx 26rpx 17rpx;
  1630. font-size: 28rpx;
  1631. color: #212121;
  1632. }
  1633. .productList .list .item .text.on {
  1634. width: 508rpx;
  1635. padding: 0 0 0 22rpx;
  1636. }
  1637. .productList .list .item .text .money {
  1638. font-size: 26rpx;
  1639. font-weight: bold;
  1640. margin-top: 8rpx;
  1641. }
  1642. .productList .list .item .text .coupon {
  1643. background: rgba(255, 248, 247, 1);
  1644. border: 1px solid rgba(233, 51, 35, 1);
  1645. border-radius: 4rpx;
  1646. font-size: 20rpx;
  1647. margin-left: 18rpx;
  1648. padding: 1rpx 4rpx;
  1649. }
  1650. .productList .list .item .text .money.on {
  1651. margin-top: 50rpx;
  1652. }
  1653. .productList .list .item .text .money .num {
  1654. font-size: 34rpx;
  1655. }
  1656. .pictrue {
  1657. position: relative;
  1658. }
  1659. .fixed {
  1660. z-index: 100;
  1661. position: fixed;
  1662. left: 0;
  1663. top: 0;
  1664. background-color: #fff;
  1665. box-shadow: 0 10rpx 20rpx -5rpx rgba(0, 0, 0, 0.06);
  1666. }
  1667. .page-btm {
  1668. background-color: #f5f5f5;
  1669. font-size: 32rpx;
  1670. text-align: center;
  1671. color: #d6d6d8;
  1672. }
  1673. </style>