index.vue 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866
  1. <template>
  2. <view class="page-index" :class="{'bgf':navIndex >0}">
  3. <!-- #ifdef H5 -->
  4. <view class="header">
  5. <view class="serch-wrapper flex">
  6. <view class="logo">
  7. <!-- <image v-if="!logoUrl" class="logo" src="/static/images/crmeb.png"></image> -->
  8. <image :src="logoUrl" mode=""></image>
  9. </view>
  10. <navigator url="/pages/goods_search/index" class="input" hover-class="none"><text class="iconfont icon-xiazai5"></text>
  11. 搜索商品</navigator>
  12. </view>
  13. <tabNav class="tabNav" :class="{'fixed':isFixed}" :tabTitle="navTop" @changeTab='changeTab' @emChildTab='emChildTab'
  14. @childTab='childTab'></tabNav>
  15. </view>
  16. <!-- #endif -->
  17. <!-- #ifdef MP -->
  18. <view class="mp-header">
  19. <view class="sys-head" view :style="{ height: statusBarHeight }"></view>
  20. <view class="serch-box" view style="height: 43px;">
  21. <view class="serch-wrapper flex">
  22. <view class="logo">
  23. <!-- <image class="logo" src="/static/images/crmeb.png"></image> -->
  24. <image :src="logoUrl" mode=""></image>
  25. </view>
  26. <navigator url="/pages/goods_search/index" class="input" hover-class="none"><text class="iconfont icon-xiazai5"></text>
  27. 搜索商品</navigator>
  28. </view>
  29. </view>
  30. <tabNav class="tabNav" :tabTitle="navTop" @changeTab='changeTab'></tabNav>
  31. </view>
  32. <!-- #endif -->
  33. <!-- 首页展示 -->
  34. <view class="page_content" :style="'margin-top:'+(marTop+30)+'px;'" v-if="navIndex == 0">
  35. <!-- #ifdef MP -->
  36. <view class="mp-bg"></view>
  37. <!-- #endif -->
  38. <!-- banner -->
  39. <view class="swiper">
  40. <swiper indicator-dots="true" :autoplay="false" :circular="circular" :interval="interval" :duration="duration"
  41. indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
  42. <block v-for="(item,index) in imgUrls" :key="index">
  43. <swiper-item>
  44. <navigator :url='item.url' class='slide-navigator acea-row row-between-wrapper' hover-class='none'>
  45. <image :src="item.pic" class="slide-image"></image>
  46. </navigator>
  47. </swiper-item>
  48. </block>
  49. </swiper>
  50. </view>
  51. <!-- menu -->
  52. <view class='nav acea-row' v-if="menus.length">
  53. <block v-for="(item,index) in menus" :key="index">
  54. <navigator class='item' v-if="item.show == '1'" :url='item.url' open-type='switchTab' hover-class='none'>
  55. <view class='pictrue'>
  56. <image :src='item.pic'></image>
  57. </view>
  58. <view class="menu-txt">{{item.name}}</view>
  59. </navigator>
  60. <navigator class='item' v-else :url='item.url' hover-class='none'>
  61. <view class='pictrue'>
  62. <image :src='item.pic'></image>
  63. </view>
  64. <view class="menu-txt">{{item.name}}</view>
  65. </navigator>
  66. </block>
  67. </view>
  68. <!-- 直播 -->
  69. <!-- #ifdef MP -->
  70. <block v-if="liveList.length>0">
  71. <navigator :url="'plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id='+liveList[0].roomid" class="live-wrapper"
  72. v-if="liveList.length==1" hover-class="none">
  73. <view class="live-top" :class="liveList[0].live_status == 101?'pictrue_log_xl':liveList[0].live_status == 103?'pictrue_log_xl_gray':'pictrue_log_xl_blue'">
  74. <block v-if="liveList[0].live_status == 101">
  75. <image src="/static/images/live-01.png" mode=""></image>
  76. <text>直播中</text>
  77. </block>
  78. <block v-if="liveList[0].live_status == 103">
  79. <image src="/static/images/live-02.png" mode=""></image>
  80. <text>已结束</text>
  81. </block>
  82. <block v-if="liveList[0].live_status == 102">
  83. <image src="/static/images/live-03.png" mode=""></image>
  84. <text>未开始</text>
  85. </block>
  86. </view>
  87. <image :src="liveList[0].anchor_img"></image>
  88. <view class="live-title line1">{{liveList[0].name}}</view>
  89. </navigator>
  90. <view class="live-wrapper mores" v-else>
  91. <scroll-view scroll-x="true" style="white-space: nowrap; display: flex">
  92. <navigator hover-class="none" class="item" v-for="(item,index) in liveList" :key="index" :url="'plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id='+item.roomid">
  93. <view class="live-top" :class="item.type == 1?'pictrue_log_xl':item.type == 2?'pictrue_log_xl_gray':'pictrue_log_xl_blue'">
  94. <block v-if="item.live_status == 101">
  95. <image src="/static/images/live-01.png" mode=""></image>
  96. <text>直播中</text>
  97. </block>
  98. <block v-if="item.live_status == 103">
  99. <image src="/static/images/live-02.png" mode=""></image>
  100. <text>已结束</text>
  101. </block>
  102. <block v-if="item.live_status == 102">
  103. <image src="/static/images/live-03.png" mode=""></image>
  104. <text>未开始</text>
  105. </block>
  106. </view>
  107. <image :src="item.anchor_img"></image>
  108. <view class="live-title">{{item.name}}</view>
  109. </navigator>
  110. </scroll-view>
  111. </view>
  112. </block>
  113. <!-- #endif -->
  114. <!-- 拼团热点图 -->
  115. <view class="hot-img" :style="{'marginTop':liveList.length>0?'40rpx':'0'}">
  116. <swiper :autoplay="autoplay" :circular="circular" :interval="interval">
  117. <block v-for="(item,index) in activityList" :key="index">
  118. <swiper-item>
  119. <navigator :url='item.link' class='slide-navigator acea-row row-between-wrapper' hover-class='none'>
  120. <image :src="item.pic" class="slide-image"></image>
  121. </navigator>
  122. </swiper-item>
  123. </block>
  124. </swiper>
  125. </view>
  126. <!-- 超值爆款 -->
  127. <view class="explosion">
  128. <view class="hd">
  129. <image src="/static/images/explosion-title.png" mode=""></image>
  130. <view class="txt">美好生活由此开始</view>
  131. </view>
  132. <view class="bd">
  133. <navigator class="item" v-for="(item,index) in explosiveMoney" :key="index" :url="'/pages/columnGoods/HotNewGoods/index?type='+item.type"
  134. hover-class='none'>
  135. <view class="con-box">
  136. <view class="title line1">{{item.title}}</view>
  137. <view class="con line2">{{item.info}}</view>
  138. <view class="go">GO!<image src="/static/images/right-icon.png" mode=""></image>
  139. </view>
  140. </view>
  141. <image :src="item.image"></image>
  142. </navigator>
  143. </view>
  144. </view>
  145. <!-- 限时秒杀 -->
  146. <view class="spike-box" v-if="spikeList.length>0">
  147. <view class="hd">
  148. <view class="left">
  149. <image src="/static/images/spike-icon-002.gif" class="icon"></image>
  150. <image src="/static/images/spike-icon-001.png" class="title"></image>
  151. <countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '" :minute-text="' : '" :second-text="' '"
  152. :datatime="datatime"></countDown>
  153. </view>
  154. <navigator class="more" url="/pages/activity/goods_seckill/index">更多 <text class="iconfont icon-jiantou"
  155. hover-class='none'></text></navigator>
  156. </view>
  157. <view class="spike-wrapper">
  158. <scroll-view scroll-x="true" style="white-space: nowrap; display: flex" show-scrollbar="false">
  159. <navigator class="spike-item" v-for="(item,index) in spikeList" :key="index" :url="'/pages/activity/goods_seckill_details/index?id='+item.id+'&time='+datatime+'&status=1'"
  160. hover-class='none'>
  161. <view class="img-box">
  162. <image :src="item.image" mode=""></image>
  163. <view class="msg flex-aj-center">{{item.discountNum}}折起</view>
  164. </view>
  165. <view class="info">
  166. <view class="name line1">{{item.title}}</view>
  167. <view class="price-box">
  168. <text class="tips">抢</text>
  169. <text class="price"><text>¥</text>{{item.price}}</text>
  170. </view>
  171. </view>
  172. </navigator>
  173. </scroll-view>
  174. </view>
  175. </view>
  176. <!-- 砍价专区 -->
  177. <view class="barg" v-if="bargList.length>0">
  178. <view class="title">
  179. <image src="/static/images/barg001.png" mode=""></image>
  180. </view>
  181. <view class="barg-swiper">
  182. <scroll-view scroll-x="true" style="white-space: nowrap; display: flex" show-scrollbar="true">
  183. <view class="wrapper">
  184. <block v-for="(item,index) in bargList" :key="index">
  185. <view class='list-box' @click="bargDetail(item)">
  186. <image :src="item.image" class="slide-image"></image>
  187. <view class="info-txt">
  188. <view class="price">¥{{item.price}}</view>
  189. <view class="txt">立即砍价</view>
  190. </view>
  191. </view>
  192. </block>
  193. <navigator url="/pages/activity/goods_bargain/index" class="more-box" hover-class="none">
  194. <view class="txt">查看更多</view>
  195. <image src="/static/images/mores.png"></image>
  196. </navigator>
  197. </view>
  198. </scroll-view>
  199. </view>
  200. </view>
  201. <!-- 拼团活动 -->
  202. <view class="group-wrapper" v-if="combinationList.length>0">
  203. <view class="hd">
  204. <view class="left">
  205. <image src="/static/images/group02.gif" class="icon"></image>
  206. <image src="/static/images/group01.png" class="title"></image>
  207. <view class="person">
  208. <view class="avatar-box">
  209. <block v-for="item in pinkInfo.avatars">
  210. <image :src="item" mode=""></image>
  211. </block>
  212. </view>
  213. <view class="num" v-if="pinkInfo.pink_count>0">{{pinkInfo.pink_count}}人拼团成功</view>
  214. </view>
  215. </view>
  216. <navigator class="more" url="/pages/activity/goods_combination/index" hover-class="none">更多 <text class="iconfont icon-jiantou"></text></navigator>
  217. </view>
  218. <view class="group-scroll">
  219. <scroll-view scroll-x="true" style="white-space: nowrap; display: flex" show-scrollbar="false">
  220. <navigator class="group-item" v-for="(item,index) in combinationList" :key="index" :url="'/pages/activity/goods_combination_details/index?id='+item.id"
  221. hover-class="none">
  222. <image :src="item.image" mode=""></image>
  223. <view class="info">
  224. <view class="name line1">{{item.title}}</view>
  225. <view class="price-box">
  226. <text class="tips">拼团价</text>
  227. <text class="price"><text>¥</text>{{item.price}}</text>
  228. </view>
  229. </view>
  230. <view class="bom-btn">参与拼团</view>
  231. </navigator>
  232. </scroll-view>
  233. </view>
  234. </view>
  235. <!-- 精品推荐 -->
  236. <view class='boutique'>
  237. <swiper autoplay="true" indicator-dots="true" :circular="circular" :interval="interval" :duration="duration"
  238. indicator-color="rgba(0,0,0,.4)" indicator-active-color="#fff">
  239. <block v-for="(item,index) in bastBanner" :key="index">
  240. <swiper-item>
  241. <navigator :url='item.link' style='width:100%;height:100%;' hover-class='none'>
  242. <image :src="item.img" class="slide-image" />
  243. </navigator>
  244. </swiper-item>
  245. </block>
  246. </swiper>
  247. </view>
  248. <!-- 首页推荐 -->
  249. <view class="index-product-wrapper">
  250. <view class="nav-bd">
  251. <view class="item" v-for="(item,index) in explosiveMoney" :index="item.id" :class="{active:index == ProductNavindex}"
  252. @click="ProductNavTab(item,index)">
  253. <view class="txt">{{item.title}}</view>
  254. <view class="label">{{item.info2}}</view>
  255. </view>
  256. </view>
  257. <!-- 首发新品 -->
  258. <view class="list-box animated" :class='tempArr.length > 0?"fadeIn on":""'>
  259. <view class="item" v-for="(item,index) in tempArr" :key="index" @click="goDetail(item)">
  260. <view class="pictrue">
  261. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '1'">秒杀</span>
  262. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '2'">砍价</span>
  263. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '3'">拼团</span>
  264. <image :src="item.image" mode=""></image>
  265. </view>
  266. <view class="text-info">
  267. <view class="title line1">{{item.store_name}}</view>
  268. <view class="old-price"><text>¥</text>{{item.ot_price}}</view>
  269. <view class="price">
  270. <text>¥</text>{{item.price}}
  271. <view class="txt" v-if="item.checkCoupon">券</view>
  272. </view>
  273. </view>
  274. </view>
  275. </view>
  276. <view class='loadingicon acea-row row-center-wrapper' v-if="goodScroll">
  277. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
  278. </view>
  279. <view class="mores-txt flex" v-if="!goodScroll">
  280. <text>我是有底线的</text>
  281. </view>
  282. </view>
  283. </view>
  284. <!-- 分类页 -->
  285. <view class="productList" v-if="navIndex>0" :style="'margin-top:'+prodeuctTop+'px'">
  286. <block v-if="sortProduct.length>0">
  287. <view class='list acea-row row-between-wrapper' :class='is_switch==true?"":"on"'>
  288. <view class='item' :class='is_switch==true?"":"on"' hover-class='none' v-for="(item,index) in sortProduct" :key="index"
  289. @click="godDetail(item)">
  290. <view class='pictrue' :class='is_switch==true?"":"on"'>
  291. <image :src='item.image' :class='is_switch==true?"":"on"'></image>
  292. <span class="pictrue_log_class" :class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'" v-if="item.activity && item.activity.type === '1'">秒杀</span>
  293. <span class="pictrue_log_class" :class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'" v-if="item.activity && item.activity.type === '2'">砍价</span>
  294. <span class="pictrue_log_class" :class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'" v-if="item.activity && item.activity.type === '3'">拼团</span>
  295. </view>
  296. <view class='text' :class='is_switch==true?"":"on"'>
  297. <view class='name line1'>{{item.store_name}}</view>
  298. <view class='money font-color' :class='is_switch==true?"":"on"'>¥<text class='num'>{{item.price}}</text></view>
  299. <view class='vip acea-row row-between-wrapper' :class='is_switch==true?"":"on"'>
  300. <view class='vip-money' v-if="item.vip_price && item.vip_price > 0">¥{{item.vip_price}}
  301. <image src='../../static/images/vip.png'></image>
  302. </view>
  303. <view>已售{{item.sales}}件</view>
  304. </view>
  305. </view>
  306. </view>
  307. <view class='loadingicon acea-row row-center-wrapper' v-if='sortProduct.length > 0'>
  308. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
  309. </view>
  310. </view>
  311. </block>
  312. <block v-if="sortProduct.length == 0">
  313. <view class="noCommodity">
  314. <view class='pictrue'>
  315. <image src='/static/images/noShopper.png'></image>
  316. </view>
  317. <recommend :hostProduct="hostProduct"></recommend>
  318. </view>
  319. </block>
  320. </view>
  321. <!-- #ifdef MP -->
  322. <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse" :isGoIndex="false"></authorize>
  323. <!-- #endif -->
  324. </view>
  325. </template>
  326. <script>
  327. var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  328. let app = getApp();
  329. import {
  330. getIndexData,
  331. getCoupons,
  332. pink
  333. } from '@/api/api.js';
  334. // #ifdef MP-WEIXIN
  335. import {
  336. getTemlIds,
  337. getLiveList
  338. } from '@/api/api.js';
  339. import {
  340. SUBSCRIBE_MESSAGE,
  341. TIPS_KEY
  342. } from '@/config/cache';
  343. // #endif
  344. // #ifdef H5
  345. import {
  346. getShare,
  347. follow
  348. } from '@/api/public.js';
  349. // #endif
  350. import goodList from '@/components/goodList';
  351. import promotionGood from '@/components/promotionGood';
  352. import couponWindow from '@/components/couponWindow';
  353. import {
  354. goShopDetail
  355. } from '@/libs/order.js'
  356. import {
  357. mapGetters
  358. } from "vuex";
  359. import tabNav from '@/components/tabNav.vue'
  360. import {
  361. getSeckillIndexTime,
  362. getSeckillList,
  363. getBargainList,
  364. getCombinationList
  365. } from '@/api/activity.js';
  366. import countDown from '@/components/countDown';
  367. import {
  368. getCategoryList,
  369. getProductslist,
  370. getProductHot,
  371. getGroomList
  372. } from '@/api/store.js';
  373. import {
  374. setVisit
  375. } from '@/api/user.js'
  376. import recommend from '@/components/recommend';
  377. // #ifdef MP
  378. import authorize from '@/components/Authorize';
  379. // #endif
  380. import {
  381. silenceBindingSpread
  382. } from '@/utils';
  383. export default {
  384. computed: mapGetters(['isLogin', 'uid']),
  385. components: {
  386. tabNav,
  387. goodList,
  388. promotionGood,
  389. couponWindow,
  390. countDown,
  391. recommend,
  392. // #ifdef MP
  393. authorize
  394. // #endif
  395. },
  396. data() {
  397. return {
  398. loading: false,
  399. isAuto: false, //没有授权的不会自动授权
  400. isShowAuth: false, //是否隐藏授权
  401. statusBarHeight: statusBarHeight,
  402. navIndex: 0,
  403. navTop: [],
  404. subscribe: false,
  405. followUrl: "",
  406. followHid: true,
  407. followCode: false,
  408. logoUrl: "",
  409. imgUrls: [],
  410. itemNew: [],
  411. activityList: [],
  412. menus: [],
  413. bastBanner: [],
  414. bastInfo: '',
  415. bastList: [],
  416. fastInfo: '',
  417. fastList: [],
  418. firstInfo: '',
  419. firstList: [],
  420. salesInfo: '',
  421. likeInfo: [],
  422. benefit: [],
  423. indicatorDots: false,
  424. circular: true,
  425. autoplay: true,
  426. interval: 3000,
  427. duration: 500,
  428. window: false,
  429. iShidden: false,
  430. navH: "",
  431. newGoodsBananr: '',
  432. couponList: [],
  433. lovely: [],
  434. liveList: [],
  435. spikeList: [],
  436. combinationList: [],
  437. hotList: [{
  438. pic: '/static/images/hot_001.png'
  439. }, {
  440. pic: '/static/images/hot_002.png'
  441. }, {
  442. pic: '/static/images/hot_003.png'
  443. }],
  444. bargList: [],
  445. ProductNavindex: 0,
  446. marTop: 0,
  447. datatime: 0,
  448. childID: 0,
  449. loadend: false,
  450. loading: false,
  451. loadTitle: '加载更多',
  452. sortProduct: [],
  453. where: {
  454. sid: 0,
  455. page: 1,
  456. limit: 20,
  457. },
  458. is_switch: true,
  459. hostProduct: [],
  460. hotPage: 1,
  461. hotLimit: 10,
  462. hotScroll: false,
  463. explosiveMoney: [],
  464. prodeuctTop: 0,
  465. pinkInfo: '',
  466. searchH: 0,
  467. isFixed: false,
  468. goodType: 0, //精品推荐Type
  469. goodScroll: true, //精品推荐开关
  470. params: { //精品推荐分页
  471. page: 1,
  472. limit: 10,
  473. },
  474. tempArr: [], //精品推荐临时数组
  475. pageInfo: '', // 精品推荐全数据
  476. site_name: '' //首页title
  477. }
  478. },
  479. onLoad() {
  480. uni.getLocation({
  481. type: 'wgs84',
  482. success: function(res) {
  483. try {
  484. uni.setStorageSync('user_latitude', res.latitude);
  485. uni.setStorageSync('user_longitude', res.longitude);
  486. } catch {}
  487. }
  488. });
  489. let self = this
  490. // #ifdef MP
  491. // 获取小程序头部高度
  492. this.navH = app.globalData.navHeight;
  493. let info = uni.createSelectorQuery().select(".mp-header");
  494. info.boundingClientRect(function(data) {
  495. self.marTop = data.height
  496. }).exec()
  497. // #endif
  498. // #ifndef MP
  499. this.navH = 0;
  500. // #endif
  501. this.isLogin && silenceBindingSpread();
  502. Promise.all([this.getAllCategory(), this.getIndexConfig(), this.getSeckillIndexTime(), this.getBargainList(), this.getCombinationList(),
  503. this.pink(), this.setVisit()
  504. ]);
  505. // #ifdef MP
  506. this.getLiveList()
  507. // #endif
  508. },
  509. onShow() {
  510. let self = this
  511. uni.setNavigationBarTitle({
  512. title: self.site_name
  513. })
  514. },
  515. methods: {
  516. // 记录会员访问
  517. setVisit() {
  518. setVisit({
  519. url: '/pages/index/index'
  520. }).then(res => {
  521. console.log(res)
  522. })
  523. },
  524. // 获取导航
  525. getAllCategory: function() {
  526. let that = this;
  527. getCategoryList().then(res => {
  528. res.data.unshift({
  529. 'cate_name': '首页'
  530. })
  531. that.navTop = res.data;
  532. })
  533. },
  534. // 导航分类切换
  535. changeTab(e) {
  536. let self = this
  537. if (e.type == 'big') {
  538. if (e.index == 0) {
  539. this.navIndex = e.index
  540. } else {
  541. // #ifdef MP
  542. setTimeout(res => {
  543. this.navH = app.globalData.navHeight;
  544. let info = uni.createSelectorQuery().select(".mp-header");
  545. info.boundingClientRect(function(data) {
  546. self.prodeuctTop = data.height
  547. }).exec()
  548. }, 300)
  549. // #endif
  550. // #ifdef H5
  551. self.prodeuctTop = 18
  552. // #endif
  553. this.navIndex = e.index
  554. if (this.navTop[e.index].children.length > 0) {
  555. this.where.sid = this.navTop[e.index].children[0].id
  556. } else {
  557. this.where.sid = this.navTop[e.index].id
  558. }
  559. this.loadend = false
  560. this.loading = false
  561. this.where.page = 1
  562. this.sortProduct = []
  563. this.get_product_list()
  564. }
  565. } else {
  566. this.navIndex = e.parentIndex
  567. this.where.sid = this.navTop[e.parentIndex].children[e.childIndex].id
  568. this.loadend = false
  569. this.loading = false
  570. this.where.page = 1
  571. this.sortProduct = []
  572. this.get_product_list()
  573. }
  574. },
  575. //分类产品
  576. get_product_list: function(isPage) {
  577. let that = this;
  578. if (that.loadend) return;
  579. if (that.loading) return;
  580. // if (isPage === true) that.$set(that, 'productList', []);
  581. that.loading = true;
  582. that.loadTitle = '';
  583. getProductslist(that.where).then(res => {
  584. if (that.where.page == 1 && res.data.length == 0) {
  585. that.hotScroll = false
  586. that.hotPage = 1
  587. that.hostProduct = []
  588. this.get_host_product()
  589. }
  590. let list = res.data;
  591. let productList = that.$util.SplitArray(list, that.sortProduct);
  592. let loadend = list.length < that.where.limit;
  593. that.loadend = loadend;
  594. that.loading = false;
  595. that.loadTitle = loadend ? '已全部加载' : '加载更多';
  596. that.$set(that, 'sortProduct', productList);
  597. that.$set(that.where, 'page', that.where.page + 1);
  598. }).catch(err => {
  599. that.loading = false;
  600. that.loadTitle = '加载更多';
  601. });
  602. },
  603. /**
  604. * 获取我的推荐
  605. */
  606. get_host_product: function() {
  607. let that = this;
  608. that.loading = true;
  609. if (that.hotScroll) return
  610. getProductHot(
  611. that.hotPage,
  612. that.hotLimit,
  613. ).then(res => {
  614. that.hotPage++
  615. that.hotScroll = res.data.length < that.hotLimit
  616. that.hostProduct = that.hostProduct.concat(res.data)
  617. // that.$set(that, 'hostProduct', res.data)
  618. });
  619. },
  620. // 首页数据
  621. getIndexConfig: function() {
  622. let that = this;
  623. getIndexData().then(res => {
  624. uni.setNavigationBarTitle({
  625. title: res.data.site_name
  626. })
  627. that.$set(that, "logoUrl", res.data.logoUrl);
  628. that.$set(that, "site_name", res.data.site_name);
  629. that.$set(that, "imgUrls", res.data.banner);
  630. that.$set(that, "menus", res.data.menus);
  631. that.$set(that, "activityList", res.data.activity);
  632. that.lovely = res.data.lovely
  633. that.$set(that, "pageInfo", res.data)
  634. that.$set(that, "firstList", res.data.info.firstList);
  635. that.$set(that, "bastList", res.data.info.bastList);
  636. that.$set(that, "likeInfo", res.data.likeInfo);
  637. that.$set(that, "benefit", res.data.benefit);
  638. that.$set(that, "bastBanner", res.data.info.bastBanner);
  639. that.explosiveMoney = res.data.explosive_money
  640. that.goodType = res.data.explosive_money[0].type
  641. // #ifdef H5
  642. that.subscribe = res.data.subscribe;
  643. that.setOpenShare();
  644. // #endif
  645. // 小程序判断用户是否授权;
  646. // #ifdef MP
  647. uni.getSetting({
  648. success(res) {
  649. if (!res.authSetting['scope.userInfo']) {
  650. that.window = that.couponList.length ? true : false;
  651. } else {
  652. that.window = false;
  653. that.iShidden = true;
  654. }
  655. }
  656. });
  657. // #endif
  658. // #ifndef MP
  659. if (that.isLogin) {
  660. that.window = false;
  661. } else {
  662. that.window = that.couponList.length ? true : false;
  663. }
  664. // #endif
  665. this.getGroomList();
  666. })
  667. },
  668. // 微信分享;
  669. setOpenShare: function() {
  670. let that = this;
  671. if (that.$wechat.isWeixin()) {
  672. getShare().then(res => {
  673. let data = res.data.data;
  674. let configAppMessage = {
  675. desc: data.synopsis,
  676. title: data.title,
  677. link: location.href,
  678. imgUrl: data.img
  679. };
  680. that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
  681. })
  682. }
  683. },
  684. // 秒杀
  685. getSeckillIndexTime() {
  686. let params = {
  687. page: 1,
  688. limit: 6,
  689. type: 'index'
  690. }
  691. getSeckillIndexTime().then(res => {
  692. this.datatime = res.data.seckillTime[res.data.seckillTimeIndex].stop
  693. let id = res.data.seckillTime[res.data.seckillTimeIndex].id
  694. getSeckillList(id, params).then(({
  695. data
  696. }) => {
  697. data.forEach((item) => {
  698. let num = ((parseFloat(item.price) / parseFloat(item.ot_price)).toFixed(2))
  699. item.discountNum = this.$util.$h.Mul(num, 10)
  700. })
  701. this.spikeList = data
  702. })
  703. })
  704. },
  705. // 砍价列表
  706. getBargainList() {
  707. getBargainList({
  708. page: 1,
  709. limit: 20
  710. }).then(res => {
  711. this.bargList = res.data
  712. })
  713. },
  714. // 拼团列表
  715. getCombinationList: function() {
  716. var that = this;
  717. var data = {
  718. page: 1,
  719. limit: 6
  720. };
  721. getCombinationList(data).then(function(res) {
  722. var combinationList = that.combinationList;
  723. that.combinationList = combinationList.concat(res.data);
  724. }).catch(() => {
  725. that.loading = false
  726. })
  727. },
  728. // 拼团数据
  729. pink: function() {
  730. pink().then(res => {
  731. this.pinkInfo = res.data
  732. })
  733. },
  734. // 砍价详情
  735. bargDetail(item) {
  736. if (!this.isLogin) {
  737. // #ifdef H5
  738. uni.showModal({
  739. title: '提示',
  740. content: '您未登陆,请登陆!',
  741. success: function(res) {
  742. if (res.confirm) {
  743. uni.navigateTo({
  744. url: '/pages/users/login/index'
  745. })
  746. } else if (res.cancel) {}
  747. }
  748. })
  749. // #endif
  750. // #ifdef MP
  751. this.$set(this, 'isAuto', true);
  752. this.$set(this, 'isShowAuth', true);
  753. // #endif
  754. } else {
  755. uni.navigateTo({
  756. url: `/pages/activity/goods_bargain_details/index?id=${item.id}&bargain=${this.uid}`
  757. })
  758. }
  759. },
  760. // 授权关闭
  761. authColse: function(e) {
  762. this.isShowAuth = e
  763. },
  764. // 授权回调
  765. onLoadFun() {
  766. },
  767. // 首发新品切换
  768. ProductNavTab(item, index) {
  769. this.goodType = item.type
  770. this.ProductNavindex = index
  771. this.tempArr = []
  772. this.params.page = 1
  773. this.goodScroll = true
  774. this.getGroomList()
  775. },
  776. // 首发新品详情
  777. goDetail(item) {
  778. if (item.activity && item.activity.type === "2" && !this.isLogin) {
  779. // #ifdef H5
  780. uni.showModal({
  781. title: '提示',
  782. content: '您未登陆,请登陆!',
  783. success: function(res) {
  784. if (res.confirm) {
  785. uni.navigateTo({
  786. url: '/pages/users/login/index'
  787. })
  788. } else if (res.cancel) {}
  789. }
  790. })
  791. // #endif
  792. // #ifdef MP
  793. this.$set(this, 'isAuto', true);
  794. this.$set(this, 'isShowAuth', true);
  795. // #endif
  796. return
  797. } else {
  798. goShopDetail(item, this.uid).then(res => {
  799. uni.navigateTo({
  800. url: `/pages/goods_details/index?id=${item.id}`
  801. })
  802. })
  803. }
  804. },
  805. // 分类详情
  806. godDetail(item) {
  807. goShopDetail(item, this.uid).then(res => {
  808. uni.navigateTo({
  809. url: `/pages/goods_details/index?id=${item.id}`
  810. })
  811. })
  812. },
  813. // 直播
  814. getLiveList: function() {
  815. getLiveList(1, 20).then(res => {
  816. this.liveList = res.data
  817. }).catch(res => {
  818. })
  819. },
  820. // 精品推荐
  821. getGroomList() {
  822. this.loading = true
  823. let type = this.goodType;
  824. if (!this.goodScroll) return
  825. getGroomList(type, this.params).then(({
  826. data
  827. }) => {
  828. this.loading = false
  829. this.goodScroll = data.list.length >= this.params.limit
  830. this.params.page++
  831. this.tempArr = this.tempArr.concat(data.list)
  832. })
  833. }
  834. },
  835. mounted() {
  836. let self = this
  837. // #ifdef H5
  838. // 获取H5 搜索框高度
  839. let appSearchH = uni.createSelectorQuery().select(".serch-wrapper");
  840. appSearchH.boundingClientRect(function(data) {
  841. self.searchH = data.height
  842. }).exec()
  843. // #endif
  844. },
  845. // 滚动到底部
  846. onReachBottom() {
  847. if (this.navIndex == 0) {
  848. // 首页加载更多
  849. if (this.params.page != 1) {
  850. this.getGroomList();
  851. }
  852. } else {
  853. // 分类栏目加载更多
  854. if (this.sortProduct.length > 0) {
  855. this.get_product_list();
  856. } else {
  857. this.get_host_product();
  858. }
  859. }
  860. },
  861. // 滚动监听
  862. onPageScroll(e) {
  863. let self = this
  864. if (e.scrollTop >= self.searchH) {
  865. self.isFixed = true
  866. } else {
  867. self.isFixed = false
  868. }
  869. }
  870. }
  871. </script>
  872. <style>
  873. page {
  874. display: flex;
  875. flex-direction: column;
  876. height: 100%;
  877. /* #ifdef H5 */
  878. background-color: #fff;
  879. /* #endif */
  880. }
  881. </style>
  882. <style lang="scss">
  883. /deep/.spike-box .styleAll {
  884. display: inline-block;
  885. width: 44rpx;
  886. height: 40rpx;
  887. line-height: 40rpx;
  888. padding: 0;
  889. text-align: center;
  890. border-radius: 8rpx;
  891. }
  892. .page-index {
  893. display: flex;
  894. flex-direction: column;
  895. min-height: 100%;
  896. background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
  897. // &.bgf{
  898. // background: #fff;
  899. // }
  900. .header {
  901. width: 100%;
  902. height: 320rpx;
  903. background: linear-gradient(90deg, $bg-star 50%, $bg-end 100%);
  904. .serch-wrapper {
  905. align-items: center;
  906. padding: 20rpx 50rpx 0 53rpx;
  907. .logo {
  908. width: 118rpx;
  909. height: 42rpx;
  910. margin-right: 30rpx;
  911. }
  912. image {
  913. width: 118rpx;
  914. height: 42rpx;
  915. }
  916. .input {
  917. display: flex;
  918. align-items: center;
  919. width: 500rpx;
  920. height: 58rpx;
  921. padding: 0 0 0 30rpx;
  922. background: rgba(247, 247, 247, 1);
  923. border: 1px solid rgba(241, 241, 241, 1);
  924. border-radius: 29rpx;
  925. color: #BBBBBB;
  926. font-size: 28rpx;
  927. .iconfont {
  928. margin-right: 20rpx;
  929. }
  930. }
  931. }
  932. .tabNav {
  933. padding-top: 24rpx;
  934. }
  935. }
  936. /* #ifdef MP */
  937. .mp-header {
  938. z-index: 999;
  939. position: fixed;
  940. left: 0;
  941. top: 0;
  942. width: 100%;
  943. /* #ifdef H5 */
  944. padding-bottom: 20rpx;
  945. /* #endif */
  946. background: linear-gradient(90deg, $bg-star 50%, $bg-end 100%);
  947. .serch-wrapper {
  948. height: 100%;
  949. align-items: center;
  950. padding: 0 50rpx 0 53rpx;
  951. image {
  952. width: 118rpx;
  953. height: 42rpx;
  954. margin-right: 30rpx;
  955. }
  956. .input {
  957. display: flex;
  958. align-items: center;
  959. width: 305rpx;
  960. height: 58rpx;
  961. padding: 0 0 0 30rpx;
  962. background: rgba(247, 247, 247, 1);
  963. border: 1px solid rgba(241, 241, 241, 1);
  964. border-radius: 29rpx;
  965. color: #BBBBBB;
  966. font-size: 28rpx;
  967. .iconfont {
  968. margin-right: 20rpx;
  969. }
  970. }
  971. }
  972. }
  973. /* #endif */
  974. .page_content {
  975. /* #ifdef H5 */
  976. margin-top: -140rpx !important;
  977. /* #endif */
  978. padding: 0 20rpx;
  979. .swiper {
  980. position: relative;
  981. width: 710rpx;
  982. height: 280rpx;
  983. margin: 0 auto;
  984. border-radius: 10rpx;
  985. overflow: hidden;
  986. /* #ifdef MP */
  987. z-index: 10;
  988. /* #endif */
  989. swiper,
  990. .swiper-item,
  991. image {
  992. width: 100%;
  993. height: 280rpx;
  994. border-radius: 10rpx;
  995. }
  996. }
  997. .nav {
  998. padding: 0 0rpx 30rpx;
  999. flex-wrap: wrap;
  1000. .item {
  1001. display: flex;
  1002. flex-direction: column;
  1003. align-items: center;
  1004. justify-content: center;
  1005. width: 20%;
  1006. margin-top: 30rpx;
  1007. image {
  1008. width: 82rpx;
  1009. height: 82rpx;
  1010. }
  1011. }
  1012. }
  1013. .live-wrapper {
  1014. position: relative;
  1015. width: 100%;
  1016. overflow: hidden;
  1017. border-radius: 16rpx;
  1018. image {
  1019. width: 100%;
  1020. height: 400rpx;
  1021. }
  1022. .live-top {
  1023. z-index: 20;
  1024. position: absolute;
  1025. left: 0;
  1026. top: 0;
  1027. display: flex;
  1028. align-items: center;
  1029. justify-content: center;
  1030. color: #fff;
  1031. width: 180rpx;
  1032. height: 54rpx;
  1033. border-radius: 0rpx 0px 18rpx 0px;
  1034. image {
  1035. width: 30rpx;
  1036. height: 30rpx;
  1037. margin-right: 10rpx;
  1038. /* #ifdef H5 */
  1039. display: block;
  1040. /* #endif */
  1041. }
  1042. }
  1043. .live-title {
  1044. position: absolute;
  1045. left: 0;
  1046. bottom: 6rpx;
  1047. width: 100%;
  1048. height: 70rpx;
  1049. line-height: 70rpx;
  1050. text-align: center;
  1051. font-size: 30rpx;
  1052. color: #fff;
  1053. background: rgba(0, 0, 0, .35);
  1054. }
  1055. &.mores {
  1056. width: 100%;
  1057. .item {
  1058. position: relative;
  1059. width: 320rpx;
  1060. display: inline-block;
  1061. border-radius: 16rpx;
  1062. overflow: hidden;
  1063. margin-right: 20rpx;
  1064. image {
  1065. width: 320rpx;
  1066. height: 180rpx;
  1067. border-radius: 16rpx;
  1068. }
  1069. .live-title {
  1070. height: 40rpx;
  1071. line-height: 40rpx;
  1072. text-align: center;
  1073. font-size: 22rpx;
  1074. }
  1075. .live-top {
  1076. width: 120rpx;
  1077. height: 36rpx;
  1078. font-size: 22rpx;
  1079. image {
  1080. width: 20rpx;
  1081. height: 20rpx;
  1082. }
  1083. }
  1084. }
  1085. }
  1086. }
  1087. .hot-img {
  1088. /* #ifndef H5 */
  1089. margin-top: 40rpx;
  1090. /* #endif */
  1091. swiper,
  1092. swiper-item image {
  1093. width: 100%;
  1094. height: 225rpx;
  1095. }
  1096. }
  1097. .explosion {
  1098. width: 100%;
  1099. height: 500rpx;
  1100. margin-top: 20rpx;
  1101. padding: 30rpx 20rpx;
  1102. background-image: url('~@/static/images/explosion.png');
  1103. background-size: 100% 100%;
  1104. border-radius: 13px;
  1105. .hd {
  1106. display: flex;
  1107. align-items: center;
  1108. image {
  1109. width: 147rpx;
  1110. height: 35rpx;
  1111. margin-right: 20rpx;
  1112. }
  1113. .txt {
  1114. width: 220rpx;
  1115. height: 36rpx;
  1116. background: linear-gradient(90deg, rgba(255, 168, 0, 1) 0%, rgba(255, 34, 15, 1) 100%);
  1117. border-radius: 26rpx 0px 26rpx 0px;
  1118. color: #fff;
  1119. text-align: center;
  1120. font-size: 22rpx;
  1121. box-shadow: 3px 1px 1px 1px rgba(255, 203, 199, .8);
  1122. }
  1123. }
  1124. .bd {
  1125. display: flex;
  1126. flex-wrap: wrap;
  1127. margin-top: 28rpx;
  1128. .item {
  1129. display: flex;
  1130. align-items: center;
  1131. justify-content: space-between;
  1132. position: relative;
  1133. width: 325rpx;
  1134. height: 180rpx;
  1135. margin-bottom: 20rpx;
  1136. margin-right: 20rpx;
  1137. background-color: #fff;
  1138. border-radius: 16rpx;
  1139. padding: 0 20rpx;
  1140. box-sizing: border-box;
  1141. image {
  1142. width: 160rpx;
  1143. height: 160rpx;
  1144. }
  1145. .con-box {
  1146. display: flex;
  1147. flex-direction: column;
  1148. justify-content: center;
  1149. width: 120rpx;
  1150. height: 100%;
  1151. .title {
  1152. color: #282828;
  1153. font-size: 30rpx;
  1154. }
  1155. .con {
  1156. color: #999999;
  1157. font-size: 20rpx;
  1158. }
  1159. .go {
  1160. display: flex;
  1161. align-items: center;
  1162. justify-content: center;
  1163. margin-top: 10rpx;
  1164. width: 112rpx;
  1165. height: 36rpx;
  1166. border-radius: 18rpx;
  1167. color: #fff;
  1168. font-size: 26rpx;
  1169. font-weight: bold;
  1170. font-style: italic;
  1171. image {
  1172. width: 26rpx;
  1173. height: 26rpx;
  1174. }
  1175. }
  1176. }
  1177. &:first-child .go {
  1178. background: linear-gradient(90deg, rgba(75, 196, 255, 1) 0%, rgba(32, 126, 255, 1) 100%);
  1179. }
  1180. &:nth-child(2) .go {
  1181. background: linear-gradient(90deg, rgba(255, 144, 67, 1) 0%, rgba(255, 83, 29, 1) 100%);
  1182. }
  1183. &:nth-child(3) .go {
  1184. background: linear-gradient(90deg, rgba(150, 225, 135, 1) 0%, rgba(72, 206, 44, 1) 100%);
  1185. }
  1186. &:nth-child(4) .go {
  1187. background: linear-gradient(90deg, rgba(255, 197, 96, 1) 0%, rgba(255, 156, 0, 1) 100%);
  1188. }
  1189. &:nth-child(2n) {
  1190. margin-right: 0;
  1191. }
  1192. }
  1193. }
  1194. }
  1195. .spike-box {
  1196. margin-top: 20rpx;
  1197. padding: 23rpx 20rpx;
  1198. border-radius: 24rpx;
  1199. background-color: #fff;
  1200. overflow: hidden;
  1201. box-shadow: 0px 0px 16px 3px rgba(0, 0, 0, 0.04);
  1202. .hd {
  1203. display: flex;
  1204. align-items: center;
  1205. justify-content: space-between;
  1206. .left {
  1207. display: flex;
  1208. align-items: center;
  1209. width: 500rpx;
  1210. .icon {
  1211. width: 38rpx;
  1212. height: 38rpx;
  1213. margin-right: 8rpx;
  1214. }
  1215. .title {
  1216. width: 134rpx;
  1217. height: 33rpx;
  1218. }
  1219. }
  1220. .more {
  1221. font-size: 26rpx;
  1222. color: #999;
  1223. .iconfont {
  1224. margin-left: 6rpx;
  1225. font-size: 25rpx;
  1226. }
  1227. }
  1228. }
  1229. .spike-wrapper {
  1230. width: 100%;
  1231. margin-top: 27rpx;
  1232. .spike-item {
  1233. display: inline-block;
  1234. width: 222rpx;
  1235. margin-right: 20rpx;
  1236. .img-box {
  1237. position: relative;
  1238. height: 222rpx;
  1239. image {
  1240. width: 100%;
  1241. height: 222rpx;
  1242. border-radius: 16rpx;
  1243. }
  1244. .msg {
  1245. position: absolute;
  1246. left: 10rpx;
  1247. bottom: 16rpx;
  1248. width: 86rpx;
  1249. height: 30rpx;
  1250. background: rgba(255, 255, 255, 1);
  1251. border: 1px solid rgba(255, 109, 96, 1);
  1252. border-radius: 6rpx;
  1253. font-size: 20rpx;
  1254. color: $theme-color;
  1255. }
  1256. }
  1257. .info {
  1258. margin-top: 8rpx;
  1259. padding: 0 10rpx;
  1260. .name {
  1261. font-size: 28rpx;
  1262. }
  1263. .price-box {
  1264. display: flex;
  1265. align-items: center;
  1266. justify-content: center;
  1267. .tips {
  1268. display: flex;
  1269. align-items: center;
  1270. justify-content: center;
  1271. width: 28rpx;
  1272. height: 28rpx;
  1273. background-color: $theme-color;
  1274. color: #fff;
  1275. font-size: 20rpx;
  1276. border-radius: 2px;
  1277. }
  1278. .price {
  1279. display: flex;
  1280. margin-left: 10rpx;
  1281. color: $theme-color;
  1282. font-size: 28rpx;
  1283. font-weight: bold;
  1284. text {
  1285. font-size: 18rpx;
  1286. }
  1287. }
  1288. }
  1289. }
  1290. }
  1291. }
  1292. }
  1293. .barg {
  1294. width: 100%;
  1295. height: 478rpx;
  1296. margin-top: 20rpx;
  1297. padding-left: 20rpx;
  1298. background-image: url('~@/static/images/barg002.png');
  1299. background-size: 100% 100%;
  1300. .title {
  1301. display: flex;
  1302. align-items: center;
  1303. justify-content: center;
  1304. padding-top: 42rpx;
  1305. image {
  1306. width: 463rpx;
  1307. height: 39rpx;
  1308. }
  1309. }
  1310. .barg-swiper {
  1311. margin-top: 43rpx;
  1312. padding-right: 20rpx;
  1313. .wrapper {
  1314. display: flex;
  1315. }
  1316. .list-box {
  1317. flex-shrink: 0;
  1318. width: 210rpx;
  1319. background-color: #fff;
  1320. border-radius: 16rpx;
  1321. overflow: hidden;
  1322. padding-bottom: 18rpx;
  1323. margin-right: 20rpx;
  1324. image {
  1325. width: 100%;
  1326. height: 210rpx;
  1327. }
  1328. .info-txt {
  1329. width: 100%;
  1330. display: flex;
  1331. flex-direction: column;
  1332. align-items: center;
  1333. justify-content: center;
  1334. padding-top: 15rpx;
  1335. .price {
  1336. font-weight: 700;
  1337. color: $theme-color;
  1338. }
  1339. .txt {
  1340. display: flex;
  1341. align-items: center;
  1342. justify-content: center;
  1343. width: 136rpx;
  1344. height: 33rpx;
  1345. margin-top: 10rpx;
  1346. background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
  1347. border-radius: 17px;
  1348. font-size: 22rpx;
  1349. color: #fff;
  1350. }
  1351. }
  1352. }
  1353. .more-box {
  1354. flex-shrink: 0;
  1355. display: flex;
  1356. flex-direction: column;
  1357. align-items: center;
  1358. justify-content: center;
  1359. width: 80rpx;
  1360. background-color: #fff;
  1361. border-radius: 16rpx;
  1362. image {
  1363. width: 24rpx;
  1364. height: 24rpx;
  1365. margin-top: 10rpx;
  1366. }
  1367. .txt {
  1368. display: block;
  1369. writing-mode: vertical-lr;
  1370. font-size: 26rpx;
  1371. line-height: 1.2;
  1372. }
  1373. }
  1374. }
  1375. }
  1376. .group-wrapper {
  1377. padding: 26rpx 20rpx;
  1378. margin-top: 20rpx;
  1379. background: #fff;
  1380. border-radius: 24rpx;
  1381. .hd {
  1382. display: flex;
  1383. align-items: center;
  1384. justify-content: space-between;
  1385. .left {
  1386. display: flex;
  1387. align-items: center;
  1388. .icon {
  1389. width: 38rpx;
  1390. height: 38rpx;
  1391. margin-right: 8rpx;
  1392. }
  1393. .title {
  1394. width: 134rpx;
  1395. height: 33rpx;
  1396. }
  1397. .person {
  1398. display: flex;
  1399. align-items: center;
  1400. margin-left: 40rpx;
  1401. .avatar-box {
  1402. display: flex;
  1403. align-items: center;
  1404. image {
  1405. width: 30rpx;
  1406. height: 30rpx;
  1407. border-radius: 50%;
  1408. margin-right: -10rpx;
  1409. }
  1410. }
  1411. .num {
  1412. margin-left: 18rpx;
  1413. font-size: 26rpx;
  1414. color: #999999;
  1415. }
  1416. }
  1417. }
  1418. .more {
  1419. font-size: 26rpx;
  1420. color: #999;
  1421. .iconfont {
  1422. margin-left: 6rpx;
  1423. font-size: 25rpx;
  1424. }
  1425. }
  1426. }
  1427. .group-scroll {
  1428. width: 100%;
  1429. margin-top: 25rpx;
  1430. .group-item {
  1431. display: inline-block;
  1432. width: 222rpx;
  1433. margin-right: 20rpx;
  1434. box-shadow: 0px 2px 6px 2px rgba(0, 0, 0, 0.03);
  1435. border-radius: 16rpx;
  1436. image {
  1437. width: 100%;
  1438. height: 222rpx;
  1439. border-radius: 16rpx 16rpx 0 0;
  1440. }
  1441. .info {
  1442. padding: 8rpx 13rpx;
  1443. .name {
  1444. font-size: 24rpx;
  1445. }
  1446. .price-box {
  1447. display: flex;
  1448. align-items: center;
  1449. margin-top: 10rpx;
  1450. .tips {
  1451. display: flex;
  1452. align-items: center;
  1453. justify-content: center;
  1454. width: 76rpx;
  1455. height: 30rpx;
  1456. margin-right: 6rpx;
  1457. background: linear-gradient(90deg, rgba(255, 0, 0, .1) 0%, rgba(255, 84, 0, .1) 100%);
  1458. border-radius: 2px;
  1459. font-size: 20rpx;
  1460. color: $theme-color;
  1461. }
  1462. .price {
  1463. font-size: 26rpx;
  1464. color: $theme-color;
  1465. font-weight: 700;
  1466. text {
  1467. font-size: 20rpx;
  1468. }
  1469. }
  1470. }
  1471. }
  1472. .bom-btn {
  1473. display: flex;
  1474. align-items: center;
  1475. justify-content: center;
  1476. width: 100%;
  1477. height: 48rpx;
  1478. background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
  1479. border-radius: 0px 0px 16rpx 16rpx;
  1480. color: #fff;
  1481. }
  1482. }
  1483. }
  1484. }
  1485. .boutique {
  1486. margin-top: 20rpx;
  1487. swiper,
  1488. swiper-item,
  1489. .slide-image {
  1490. width: 100%;
  1491. height: 240rpx;
  1492. border-radius: 12rpx;
  1493. }
  1494. }
  1495. .index-product-wrapper {
  1496. margin-top: 40rpx;
  1497. .nav-bd {
  1498. display: flex;
  1499. align-items: center;
  1500. .item {
  1501. display: flex;
  1502. flex-direction: column;
  1503. align-items: center;
  1504. justify-content: center;
  1505. width: 25%;
  1506. .txt {
  1507. font-size: 32rpx;
  1508. color: #282828;
  1509. }
  1510. .label {
  1511. display: flex;
  1512. align-items: center;
  1513. justify-content: center;
  1514. width: 124rpx;
  1515. height: 32rpx;
  1516. margin-top: 5rpx;
  1517. font-size: 24rpx;
  1518. color: #999;
  1519. }
  1520. &.active {
  1521. color: $theme-color;
  1522. .label {
  1523. background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
  1524. border-radius: 16rpx;
  1525. color: #fff;
  1526. }
  1527. }
  1528. }
  1529. }
  1530. .list-box {
  1531. display: flex;
  1532. flex-wrap: wrap;
  1533. justify-content: space-between;
  1534. margin-top: 30rpx;
  1535. .item {
  1536. width: 345rpx;
  1537. margin-bottom: 20rpx;
  1538. background-color: #fff;
  1539. border-radius: 10px;
  1540. overflow: hidden;
  1541. image {
  1542. width: 100%;
  1543. height: 345rpx;
  1544. }
  1545. .text-info {
  1546. padding: 10rpx 20rpx 15rpx;
  1547. .title {
  1548. color: #222222;
  1549. }
  1550. .old-price {
  1551. margin-top: 8rpx;
  1552. font-size: 26rpx;
  1553. color: #AAAAAA;
  1554. text-decoration: line-through;
  1555. text {
  1556. margin-right: 2px;
  1557. font-size: 20rpx;
  1558. }
  1559. }
  1560. .price {
  1561. display: flex;
  1562. align-items: flex-end;
  1563. color: $theme-color;
  1564. font-size: 34rpx;
  1565. font-weight: 800;
  1566. text {
  1567. padding-bottom: 4rpx;
  1568. font-size: 24rpx;
  1569. font-weight: normal;
  1570. }
  1571. .txt {
  1572. display: flex;
  1573. align-items: center;
  1574. justify-content: center;
  1575. width: 28rpx;
  1576. height: 28rpx;
  1577. margin-left: 15rpx;
  1578. margin-bottom: 10rpx;
  1579. border: 1px solid $theme-color;
  1580. border-radius: 4rpx;
  1581. font-size: 22rpx;
  1582. font-weight: normal;
  1583. }
  1584. }
  1585. }
  1586. }
  1587. &.on {
  1588. display: flex;
  1589. }
  1590. }
  1591. }
  1592. }
  1593. }
  1594. .productList {
  1595. background-color: #fff;
  1596. }
  1597. .productList .list {
  1598. padding: 0 20rpx;
  1599. }
  1600. .productList .list.on {
  1601. background-color: #fff;
  1602. border-top: 1px solid #f6f6f6;
  1603. }
  1604. .productList .list .item {
  1605. width: 345rpx;
  1606. margin-top: 20rpx;
  1607. background-color: #fff;
  1608. border-radius: 10rpx;
  1609. }
  1610. .productList .list .item.on {
  1611. width: 100%;
  1612. display: flex;
  1613. border-bottom: 1rpx solid #f6f6f6;
  1614. padding: 30rpx 0;
  1615. margin: 0;
  1616. }
  1617. .productList .list .item .pictrue {
  1618. position: relative;
  1619. width: 100%;
  1620. height: 345rpx;
  1621. }
  1622. .productList .list .item .pictrue.on {
  1623. width: 180rpx;
  1624. height: 180rpx;
  1625. }
  1626. .productList .list .item .pictrue image {
  1627. width: 100%;
  1628. height: 100%;
  1629. border-radius: 20rpx 20rpx 0 0;
  1630. }
  1631. .productList .list .item .pictrue image.on {
  1632. border-radius: 6rpx;
  1633. }
  1634. .productList .list .item .text {
  1635. padding: 20rpx 17rpx 26rpx 17rpx;
  1636. font-size: 30rpx;
  1637. color: #222;
  1638. }
  1639. .productList .list .item .text.on {
  1640. width: 508rpx;
  1641. padding: 0 0 0 22rpx;
  1642. }
  1643. .productList .list .item .text .money {
  1644. font-size: 26rpx;
  1645. font-weight: bold;
  1646. margin-top: 8rpx;
  1647. }
  1648. .productList .list .item .text .money.on {
  1649. margin-top: 50rpx;
  1650. }
  1651. .productList .list .item .text .money .num {
  1652. font-size: 34rpx;
  1653. }
  1654. .productList .list .item .text .vip {
  1655. font-size: 22rpx;
  1656. color: #aaa;
  1657. margin-top: 7rpx;
  1658. }
  1659. .productList .list .item .text .vip.on {
  1660. margin-top: 12rpx;
  1661. }
  1662. .productList .list .item .text .vip .vip-money {
  1663. font-size: 24rpx;
  1664. color: #282828;
  1665. font-weight: bold;
  1666. }
  1667. .productList .list .item .text .vip .vip-money image {
  1668. width: 46rpx;
  1669. height: 21rpx;
  1670. margin-left: 4rpx;
  1671. }
  1672. .pictrue {
  1673. position: relative;
  1674. }
  1675. .fixed {
  1676. z-index: 100;
  1677. position: fixed;
  1678. left: 0;
  1679. top: 0;
  1680. background: linear-gradient(90deg, red 50%, #ff5400 100%);
  1681. }
  1682. .mores-txt {
  1683. width: 100%;
  1684. align-items: center;
  1685. justify-content: center;
  1686. height: 70rpx;
  1687. color: #999;
  1688. font-size: 24rpx;
  1689. .iconfont {
  1690. margin-top: 2rpx;
  1691. font-size: 20rpx;
  1692. }
  1693. }
  1694. .menu-txt {
  1695. font-size: 24rpx;
  1696. color: #454545;
  1697. }
  1698. .mp-bg {
  1699. position: absolute;
  1700. left: 0;
  1701. top: 0;
  1702. width: 100%;
  1703. height: 330rpx;
  1704. background: linear-gradient(90deg, $bg-star 50%, $bg-end 100%);
  1705. // border-radius: 0 0 30rpx 30rpx;
  1706. }
  1707. </style>