index.vue 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031
  1. <template>
  2. <view class="container">
  3. <view class="top_header" :style="{ background: header_color }">
  4. <!-- 顶部导航栏 -->
  5. <view class="top-address" :style="{ backgroundColor: 'rgba(255,255,255,' + navP + ')' }">
  6. <view class="header flex">
  7. <!-- 定位城市 -->
  8. <view class="addr" @click="Toaddress" :style="{ color: addr_color }">
  9. <view class="icon location" :style="{ color: addr_color }"></view>
  10. <view class="clamp">{{ (addressData.detail || '请选择地址') | filterAddress }}</view>
  11. </view>
  12. <!-- 右侧图标按钮 -->
  13. <view class="time-box" :style="{ color: addr_color }" >
  14. <view class="timeText">营业时间:{{ workstarTime }} - {{ workendTime }},商城满19包邮到家(拼团自提)</view>
  15. </view>
  16. <!-- <uni-notice-bar scrollable="true" single="true" text=""></uni-notice-bar> -->
  17. </view>
  18. <view class="input-box" @tap="clickSearch()">
  19. <input placeholder="默认关键字" placeholder-style="color:#c0c0c0;" />
  20. <view class="icon search"></view>
  21. </view>
  22. </view>
  23. <view class="zhanwei"></view>
  24. <view class="text-box flex" @click="Toreturned">
  25. <view v-for="ls in Textlist" class="text-center flex_item" :style="{ backgroundColor: Textlist_color }">
  26. <view class="img"><image :src="ls.img"></image></view>
  27. <view class="text">{{ ls.text }}</view>
  28. </view>
  29. </view>
  30. <view class="swiper">
  31. <view class="swiper-box">
  32. <swiper circular="true" autoplay="true" @change="swiperChange">
  33. <swiper-item v-for="swiper in carouselList" @click="bannerNavToUrl(swiper)"><image :src="swiper.pic"></image></swiper-item>
  34. </swiper>
  35. <view class="indicator"><view class="dots" v-for="(swiper, index) in carouselList" :class="[swiperCurrent >= index ? 'on' : '']"></view></view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="Make-group" @click="ToGroup()">
  40. <view class="group-title flex">
  41. <view class="title">邻里拼团</view>
  42. <view class="tip">|</view>
  43. <view class="tpl">10:00 ~ 22:00 准时开抢</view>
  44. <view>
  45. <view class="detail">
  46. <text>立即抢购</text>
  47. <text style="font-size: 32rpx;" class="iconfont iconenter"></text>
  48. </view>
  49. </view>
  50. </view>
  51. <view class="floor-list">
  52. <gbro-marquee :groupBookingList='groupBookingList' ref='pinkGoodsBox' broadcastType="mould" :viewHeight="190" direction="left" :broadcastStyle="broadcastStyle" style="width: 100%">
  53. </gbro-marquee>
  54. </view>
  55. </view>
  56. <!-- 产品接龙 -->
  57. <view class="solitaire flex" @click="ToKlon">
  58. <view class="flex_item">
  59. <view class="Member-box"><image src="/static/img/img20.png"></image></view>
  60. <view class="Member-text">预售产品,发起接龙抢先购买</view>
  61. </view>
  62. <view class="Member-code">
  63. 点击进入
  64. <text class="iconfont iconenter"></text>
  65. </view>
  66. </view>
  67. <view class="content"><image :src="image" @click="navTo('/pages/notice/poster?id=3')"></image></view>
  68. <!-- 商品分类 -->
  69. <view class="category-section">
  70. <view class="category-item" @click="ToCategory(18)">
  71. <view class="image-wrapper"><image src="http://shicai.liuniu946.com/static/img/img25.png"></image></view>
  72. <text class="title clamp">每日蔬菜</text>
  73. </view>
  74. <view class="category-item" @click="ToCategory(6)">
  75. <view class="image-wrapper"><image src="http://shicai.liuniu946.com/static/img/img26.png"></image></view>
  76. <text class="title clamp">肉类禽类</text>
  77. </view>
  78. <view class="category-item" @click="ToCategory(1)">
  79. <view class="image-wrapper"><image src="http://shicai.liuniu946.com/static/img/img27.png"></image></view>
  80. <text class="title clamp">海鲜水产</text>
  81. </view>
  82. <view class="category-item" @click="ToCategory(44)">
  83. <view class="image-wrapper"><image src="http://shicai.liuniu946.com/static/img/img28.png" mode="scaleToFill"></image></view>
  84. <text class="title clamp">面点豆腐</text>
  85. </view>
  86. <view class="category-item" @click="ToCategory(34)">
  87. <view class="image-wrapper"><image src="http://shicai.liuniu946.com/static/img/img29.png" mode="scaleToFill"></image></view>
  88. <text class="title clamp">家庭常用</text>
  89. </view>
  90. <view class="category-item" @click="ToCategory(33)">
  91. <view class="image-wrapper"><image src="http://shicai.liuniu946.com/static/img/img30.png" mode="scaleToFill"></image></view>
  92. <text class="title clamp">快捷早餐</text>
  93. </view>
  94. <view class="category-item" @click="ToCategory(25)">
  95. <view class="image-wrapper"><image src="http://shicai.liuniu946.com/static/img/img31.png" mode="scaleToFill"></image></view>
  96. <text class="title clamp">方便速食</text>
  97. </view>
  98. <view class="category-item" @click="ToCategory(47)">
  99. <view class="image-wrapper"><image src="http://shicai.liuniu946.com/static/img/img32.png" mode="scaleToFill"></image></view>
  100. <text class="title clamp">有机蔬菜</text>
  101. </view>
  102. <view class="category-item" @click="ToCategory(48)">
  103. <view class="image-wrapper"><image src="http://shicai.liuniu946.com/static/img/img33.png" mode="scaleToFill"></image></view>
  104. <text class="title clamp">分享有礼</text>
  105. </view>
  106. <view class="category-item" @click="ToCategory(49)">
  107. <view class="image-wrapper"><image src="http://shicai.liuniu946.com/static/img/img34.png" mode="scaleToFill"></image></view>
  108. <text class="title clamp">联系客服</text>
  109. </view>
  110. </view>
  111. <!-- 开通美卡 -->
  112. <!-- <view class="Member flex" @click="Tomember">
  113. <view class="flex_item">
  114. <view class="Member-box"><image src="/static/img/img20.png"></image></view>
  115. <view class="Member-text">开通美卡,平均可省1588元/年</view>
  116. </view>
  117. <view class="Member-code">
  118. 5折开卡
  119. <text class="iconfont iconenter"></text>
  120. </view>
  121. </view> -->
  122. <!-- 秒杀楼层 -->
  123. <!-- <view class="seckill-section m-t">
  124. <view class="s-header">
  125. <view class="f-left-icon"></view>
  126. <view class="tit-box"><text class="tit">限时秒杀</text></view>
  127. <view class="tip-box">
  128. <text class="tip" v-if="status == 1">{{ showTime }}点场结束</text>
  129. <text class="tip" v-if="status == 2">距离下场开始</text>
  130. <text class="tip" v-if="status == 0">当天活动已结束</text>
  131. <uni-countdown v-if="status == 1 || status == 2" :show-day="false" :hour="stopTimeH" color="#F9F9F8" background-color="#666666" :minute="stopTimeM" :second="stopTimeS"></uni-countdown>
  132. </view>
  133. <view class="textNav iconfont iconenter" @click="navTo('/pages/seckill/seckill')">更多</view>
  134. </view>
  135. <scroll-view class="floor-list" scroll-x>
  136. <view class="scoll-wrapper position-relative" @click="navTo('/pages/seckill/seckill')">
  137. <view v-for="(item, index) in list" :key="index" class="floor-item">
  138. <image class="list-image" :src="item.image" mode="aspectFill"></image>
  139. <text class="title clamp">{{ item.title }}</text>
  140. <text class="price">¥{{ item.price }}</text>
  141. </view>
  142. <view v-if="list.length == 0" class="floor-item ">
  143. <image class="list-image" mode="aspectFill"></image>
  144. <text class="title clamp"></text>
  145. <text class="price"></text>
  146. </view>
  147. <view v-if="list.length == 0" class="noGoodsBg"><view>敬请期待</view></view>
  148. </view>
  149. </scroll-view>
  150. </view> -->
  151. <!-- 今日爆款 -->
  152. <view class="seckill-section m-t">
  153. <view class="s-header">
  154. <view class="f-left-icon"></view>
  155. <view class="tit-box"><text class="tit">今日秒杀</text></view>
  156. <view class="tip-box">
  157. <view class="time flex_item">
  158. <view class="flex_item time-box" v-show="starting">
  159. <uni-countdown
  160. color="#FFFFFF"
  161. background-color="#334432"
  162. :show-day="false"
  163. :hour="starthour"
  164. :minute="startminute"
  165. :second="startsecond"
  166. ></uni-countdown>
  167. </view>
  168. <view class="flex_item time-box" v-show="Timeing">
  169. <uni-countdown
  170. color="#FFFFFF"
  171. background-color="#334432"
  172. :show-day="false"
  173. :hour="Timeinghour"
  174. :minute="Timeingminute"
  175. :second="Timeingsecond"
  176. ></uni-countdown>
  177. </view>
  178. <view class="flex_item " v-show="end">
  179. <uni-countdown color="#FFFFFF" background-color="#334432" :show-day="false" :hour="endhour" :minute="endminute" :second="endsecond"></uni-countdown>
  180. </view>
  181. </view>
  182. </view>
  183. <view class="textNav" @click="ToSeckill">更多</view>
  184. </view>
  185. <scroll-view class="floor-list" scroll-x>
  186. <view class="scoll-wrapper position-relative" @click="ToSeckill">
  187. <view v-for="(item, index) in Productslist" :key="index" class="floor-item">
  188. <image class="list-image" :src="item.image"></image>
  189. <view class="tpl">
  190. <view class="title clamp">{{ item.store_name }}</view>
  191. <view class="flex">
  192. <view class="">
  193. <view class="price">¥{{ item.price }}</view>
  194. <view class="otPrice">¥{{ item.ot_price }}</view>
  195. </view>
  196. <view class="img position-relative" @click.stop="Addcar(item, 2)">
  197. <image src="/static/img/img21.png"></image>
  198. <view class="corner" v-if="item.cart_num > 0">
  199. <text>{{ item.cart_num }}</text>
  200. </view>
  201. </view>
  202. </view>
  203. </view>
  204. </view>
  205. </view>
  206. </scroll-view>
  207. </view>
  208. <!-- <view class="transition"></view> -->
  209. <!-- 特色专区 --><!-- @click="openSp()" -->
  210. <!-- <view class="characteristic">
  211. <view class="f-header m-t">
  212. <view class="f-left-icon"></view>
  213. <view class="tit-box"><text class="tit">特色专区</text></view>
  214. </view>
  215. <view class="characteristic-box" @click="Category()">
  216. <view class="box flex">
  217. <view class="characteristic-list">
  218. <view class="list-tpl red">本地小菜</view>
  219. <view class="list-tip">绿色本地小菜 随心选~</view>
  220. <view class="list-img flex">
  221. <view class="img"><image src="http://shicai.liuniu946.com/static/img/img03.png"></image></view>
  222. <view class="img"><image src="http://shicai.liuniu946.com/static/img/img04.png"></image></view>
  223. </view>
  224. </view>
  225. <view class="characteristic-list">
  226. <view class="list-tpl pink">光鸡光鸭</view>
  227. <view class="list-tip">优质禽肉 肉嫩鲜香</view>
  228. <view class="list-img flex">
  229. <view class="img"><image src="http://shicai.liuniu946.com/static/img/img05.png"></image></view>
  230. <view class="img"><image src="http://shicai.liuniu946.com/static/img/img06.png"></image></view>
  231. </view>
  232. </view>
  233. </view>
  234. <view class="box flex">
  235. <view class="characteristic-list">
  236. <view class="list-tpl blue">活鱼活虾</view>
  237. <view class="list-tip">种类丰富 鲜活到家</view>
  238. <view class="list-img flex">
  239. <view class="img"><image src="http://shicai.liuniu946.com/static/img/img07.png"></image></view>
  240. <view class="img"><image src="http://shicai.liuniu946.com/static/img/img10.png"></image></view>
  241. </view>
  242. </view>
  243. <view class="characteristic-list">
  244. <view class="list-tpl green">有机农场</view>
  245. <view class="list-tip">基地直采 生态健康</view>
  246. <view class="list-img flex">
  247. <view class="img"><image src="http://shicai.liuniu946.com/static/img/img09.png"></image></view>
  248. <view class="img"><image src="http://shicai.liuniu946.com/static/img/img08.png"></image></view>
  249. </view>
  250. </view>
  251. </view>
  252. </view>
  253. </view> -->
  254. <view class="transition"></view>
  255. <!-- 商品分类切换卡片 -->
  256. <view class="recommend flex">
  257. <view class="recommend_list" @click="change(ls.id)" v-for="(ls,index) in recommend" :key='index'>
  258. <view class="re_title" v-bind:class="{ active_color: ls.id == checkid }">{{ ls.re_title }}</view>
  259. <view class="re_name">
  260. <text v-bind:class="{ active_name: ls.id == checkid }">{{ ls.re_name }}</text>
  261. </view>
  262. </view>
  263. </view>
  264. <view id="list-box" class="list-box" @change="listChange" :style="{ height: swiperHeight + 'px' }" :current="checkid">
  265. <view class="guess-section">
  266. <view v-for="(item, index) in detail" class="guess-item" @click="navToDetailPage(item)">
  267. <view class="imagewrapper"><image :src="item.image"></image></view>
  268. <view class="guess-list">
  269. <text class="title clamp">{{ item.store_name }}</text>
  270. <view class="info clamp">{{ item.store_info }}</view>
  271. <view class="tipBox">
  272. <view class="tipsl" v-if="item.keyword != ''">
  273. <text v-for="lss in item.keyword">{{ lss }}</text>
  274. </view>
  275. </view>
  276. </view>
  277. <view class="price margin-c-20 flex">
  278. <view class="price_list">
  279. <view class="price-red">
  280. ¥{{ item.price }}
  281. <text>/份</text>
  282. </view>
  283. <view class="price-green" v-if="item.ot_price">
  284. ¥{{ item.ot_price }}
  285. <text>市场价</text>
  286. </view>
  287. </view>
  288. <view class="img position-relative" @click.stop="Addcar(item)">
  289. <image src="/static/img/img21.png"></image>
  290. <view class="corner" v-if="item.cart_num > 0">
  291. <text>{{ item.cart_num }}</text>
  292. </view>
  293. </view>
  294. </view>
  295. </view>
  296. </view>
  297. </view>
  298. <view class="TipsBox" v-show="ShowAddress" @click="ToAddress">
  299. 当前地址不在配送范围内,建议您
  300. <text>修改地址</text>
  301. </view>
  302. <!-- <view class="Mask" v-show="MaskShow"><image @click="Mask" src="http://shicai.liuniu946.com/static/img/shareimg3.png"></image></view> -->
  303. <view class="Mask" v-show="shareShow">
  304. <image @click="share" src="http://shicai.liuniu946.com/static/img/shareimg4.png"></image>
  305. <view class="Toshare" @click="Toshare"></view>
  306. <view class="Tocancel" @click="Tocancel"></view>
  307. </view>
  308. </view>
  309. </template>
  310. <script>
  311. import seckill from './seckill';
  312. import { mapState, mapMutations } from 'vuex';
  313. import { check_address } from '@/api/address.js';
  314. import { category_layer } from '@/api/category.js';
  315. import { getProducts } from '@/api/product.js';
  316. import { loadIndexs } from '@/api/index.js';
  317. import { article, details } from '@/api/notice.js';
  318. import { setCoupons } from '@/api/coupon.js';
  319. import { cartAdd } from '@/api/product.js';
  320. import { getUserInfo } from '@/api/login.js';
  321. import { saveUrl } from '@/utils/loginUtils';
  322. import uniCountdown from '@/components/uni-countdown/uni-countdown.vue';
  323. import gbroMarquee from '@/components/gbro-marquee/marquee.vue';
  324. import { getList, getClass } from '@/api/seckill.js';
  325. import { share } from '@/api/wx.js';
  326. import { timeComputed } from '@/utils/rocessor.js';
  327. import { GetRequest } from '@/utils/rocessor.js';
  328. // 拼团列表
  329. // import { getCombinationList } from '@/api/groupBooking.js';
  330. export default {
  331. components: {
  332. uniCountdown,
  333. gbroMarquee,
  334. },
  335. filters: {
  336. filterAddress: function(value) {
  337. let b = value.split(',');
  338. // console.log(b);
  339. return b[0];
  340. },
  341. returnNub(value) {
  342. return +value;
  343. }
  344. },
  345. onPageScroll(e) {
  346. this.navP = e.scrollTop / 200;
  347. if (e.scrollTop > 10) {
  348. this.addr_color = '#333333';
  349. } else {
  350. this.addr_color = '#ffffff';
  351. }
  352. },
  353. watch: {
  354. //自适应swiper高度
  355. checkid(newValue, oldValue) {
  356. let obj = this;
  357. if (newValue == 0) {
  358. let bHeight = Math.ceil(obj.bastList.length / 2);
  359. obj.swiperHeight = Math.ceil(obj.pageProportion * 550 * bHeight);
  360. }
  361. if (newValue == 1) {
  362. let bHeight = Math.ceil(obj.benefitList.length / 2);
  363. }
  364. if (newValue == 2) {
  365. let bHeight = Math.ceil(obj.firstList.length / 2);
  366. obj.swiperHeight = Math.ceil(obj.pageProportion * 500 * bHeight);
  367. }
  368. if (newValue == 3) {
  369. let bHeight = Math.ceil(obj.hotList.length / 2);
  370. obj.swiperHeight = Math.ceil(obj.pageProportion * 500 * bHeight);
  371. }
  372. },
  373. // 初次加载页面高度时修改页面高度
  374. detail(newValue, oldValue) {
  375. let obj = this;
  376. let bHeight = Math.ceil(newValue.length / 2);
  377. obj.$nextTick(function() {
  378. uni.createSelectorQuery()
  379. .select('#list-box')
  380. .fields(
  381. {
  382. size: true
  383. },
  384. function(data) {
  385. obj.pageProportion = data.width / 750;
  386. obj.swiperHeight = Math.ceil(obj.pageProportion * 550 * bHeight);
  387. }
  388. )
  389. .exec();
  390. });
  391. }
  392. },
  393. data() {
  394. return {
  395. shareShow: false, //分享海报
  396. ShowAddress: false, //当地址超出配送范围,显示提示
  397. MaskShow: false, //第一次进入小程序出现弹窗
  398. navP: 0, // 导航栏透明度
  399. addr_color: '#FFFFFF', //导航栏字体颜色
  400. header_color: '', //轮播图背景色渐变
  401. Textlist_color: '', //送货上门背景色
  402. pageProportion: 0, //保存页面基于750宽度的比例
  403. swiperHeight: 0,
  404. checkid: 0, //商品种类切换
  405. swiperCurrent: 0, //轮播图
  406. broadcastStyle: {
  407. speed: 100 //每秒100px
  408. },
  409. Textlist: [
  410. {
  411. img: '/static/img/img05.png',
  412. text: '送货上门'
  413. },
  414. {
  415. img: '/static/img/img06.png',
  416. text: '放心交易'
  417. },
  418. {
  419. img: '/static/img/img07.png',
  420. text: '品质保障'
  421. },
  422. {
  423. img: '/static/img/img08.png',
  424. text: '售后无忧'
  425. }
  426. ],
  427. CategoryList: [], //商品一级分类
  428. Productslist: '', //今日秒杀商品
  429. groupBookingList: [], //拼团商品
  430. recommend: [
  431. {
  432. id: 0,
  433. re_title: '随便看看',
  434. re_name: '猜你喜欢'
  435. },
  436. {
  437. id: 1,
  438. re_title: '海鲜大咖',
  439. re_name: '本地特色'
  440. },
  441. {
  442. id: 2,
  443. re_title: '新货新得',
  444. re_name: '新品发布'
  445. },
  446. {
  447. id: 3,
  448. re_title: '方便快捷',
  449. re_name: '早餐夜宵'
  450. }
  451. ],
  452. detail: [], //点击选中的的商品列表
  453. carouselList: [], //轮播列表
  454. bastList: [], //随便看看
  455. benefitList: [], //海鲜大咖
  456. firstList: [], //新货新得
  457. hotList: [], //方便快捷
  458. userServant: [
  459. {
  460. image: ''
  461. }
  462. ], //用户推广服务
  463. couponArray: [], //可领取优惠券
  464. // 头部高度
  465. barHeight: 0,
  466. cid: 3, //文章分类
  467. image: '', //海报图片
  468. userInfo: '',
  469. workstarTime: '', //营业开始时间
  470. workendTime: '', //营业结束时间
  471. page: 1,
  472. limit: 10,
  473. starting: false, //判断活动未开始
  474. end: false, //判断活动结束
  475. Timeing: false, //判断活动进行中
  476. starthour: 0, //距离今天开始时间
  477. startminute: 0,
  478. startsecond: 0,
  479. Timeinghour: '',
  480. Timeingminute: '',
  481. Timeingsecond: '',
  482. endhour: 0, //距离今天结束时间
  483. endminute: 0,
  484. endsecond: 0,
  485. startime: '9:00:00' //距离开始时间
  486. };
  487. },
  488. computed: {
  489. ...mapState(['addressData', 'addressPageShow', 'GetInfo']),
  490. ...mapState('user', ['orderInfo', 'hasLogin'])
  491. },
  492. onLoad: function(option) {
  493. // #ifdef MP
  494. // 获取地图权限
  495. uni.authorize({
  496. scope: 'scope.userLocation',
  497. success: res => {}
  498. });
  499. // #endif
  500. if (option.spread) {
  501. uni.setStorageSync('spread', option.spread);
  502. }
  503. if (uni.getStorageSync('FirstEntry') == '' || uni.getStorageSync('FirstEntry') == null) {
  504. if (uni.getStorageSync('FirstEntry') == false) {
  505. this.MaskShow = true;
  506. } else {
  507. this.MaskShow = false;
  508. }
  509. } else {
  510. uni.setStorage({
  511. key: 'FirstEntry',
  512. data: false,
  513. success: function() {
  514. console.log(uni.getStorageSync('FirstEntry'), 'app');
  515. }
  516. });
  517. }
  518. // 保存传值
  519. uni.setStorageSync('option', option);
  520. if (option.scene) {
  521. if (typeof option.scene == 'string' && isNaN(option.scene)) {
  522. let da = GetRequest(decodeURIComponent(option.scene));
  523. uni.setStorageSync('spread', da.spread);
  524. }
  525. if (!isNaN(option.scene)) {
  526. uni.setStorageSync('spread_code', option.scene);
  527. }
  528. }
  529. saveUrl();
  530. // 判断是否有地址信息
  531. let address = uni.getStorageSync('addressData') || '';
  532. // 判断是否有缓存
  533. if (address.id) {
  534. this.setAddressData(address);
  535. }
  536. },
  537. onShow: function() {
  538. this.userInfo = uni.getStorageSync('userInfo');
  539. // 保存传值
  540. // this.swiperCurrent = 0;
  541. this.loadData();
  542. this.GetList();
  543. this.GetProducts();
  544. this.ArticleDate();
  545. this.checkAddress();
  546. this.GetShare();
  547. //加载拼团价商品
  548. // this.getCombinationList();
  549. // this.getClass();
  550. },
  551. onReady() {
  552. // 初始化获取页面宽度
  553. uni.createSelectorQuery()
  554. .select('.top-address')
  555. .fields(
  556. {
  557. size: true
  558. },
  559. data => {
  560. // 获取头部高度
  561. this.barHeight = data.height;
  562. }
  563. )
  564. .exec();
  565. },
  566. //下拉刷新
  567. onPullDownRefresh() {
  568. let obj = this;
  569. //监听下拉刷新动作的执行方法,每次手动下拉刷新都会执行一次
  570. setTimeout(function() {
  571. obj.loadData();
  572. uni.stopPullDownRefresh(); //停止下拉刷新动画
  573. }, 1000);
  574. },
  575. methods: {
  576. ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
  577. ...mapMutations(['setAddressData', 'upAddressPageShow', 'setGetInfo']),
  578. // 获取拼团列表
  579. // getCombinationList() {
  580. // // 请求订单
  581. // getCombinationList({
  582. // page: 1,
  583. // limit: 20
  584. // })
  585. // .then(e => {
  586. // this.groupBookingList = e.data;
  587. // })
  588. // .catch(e => {});
  589. // },
  590. //收藏小程序蒙层
  591. Mask() {
  592. this.MaskShow = false;
  593. this.shareShow = true;
  594. uni.setStorage({
  595. key: 'FirstEntry',
  596. data: true,
  597. success: function() {
  598. console.log(uni.getStorageSync('FirstEntry'), 'Mask');
  599. }
  600. });
  601. },
  602. // 扫码查看值
  603. openSp() {
  604. let obj = this;
  605. uni.scanCode({
  606. complete(e) {
  607. uni.showModal({
  608. title: '',
  609. content: JSON.stringify(e),
  610. showCancel: false,
  611. complete() {
  612. if(obj.erros){
  613. uni.showModal({
  614. title: '错误',
  615. content:JSON.stringify(obj.erros),
  616. showCancel: false
  617. });
  618. }
  619. }
  620. });
  621. }
  622. });
  623. },
  624. //检查地址是否在配送区域
  625. checkAddress() {
  626. let obj = this;
  627. check_address({
  628. address_id: obj.addressData.id
  629. })
  630. .then(({ data }) => {
  631. if (data.shop == -1) {
  632. obj.ShowAddress = true;
  633. }
  634. // if(data.shop == 0){
  635. // obj.$api.msg('请选择配送地址');
  636. // }
  637. })
  638. .catch(e => {
  639. console.log(e);
  640. });
  641. },
  642. //分享信息
  643. GetShare() {
  644. let obj = this;
  645. share({})
  646. .then(({ data }) => {
  647. obj.setGetInfo(data.data);
  648. })
  649. .catch(err => {
  650. console.log(err);
  651. });
  652. },
  653. //当地址不在配送范围内,跳转到选择地址页面
  654. ToAddress() {
  655. if (!this.addressPageShow) {
  656. this.upAddressPageShow();
  657. }
  658. uni.navigateTo({
  659. url: '/pages/index/address'
  660. });
  661. },
  662. //菜佬优惠日
  663. async ArticleDate() {
  664. let obj = this;
  665. article({}, obj.cid).then(function({ data }) {
  666. obj.image = data[0].image_input[0];
  667. });
  668. },
  669. // 获取商品分类
  670. async GetList() {
  671. let obj = this;
  672. category_layer({})
  673. .then(({ data }) => {
  674. this.CategoryList = data.list;
  675. })
  676. .catch(err => {
  677. console.log(err);
  678. });
  679. },
  680. // 请求今日秒杀商品
  681. GetProducts() {
  682. let obj = this;
  683. getProducts({
  684. type: 1,
  685. sid: 100 //分类id
  686. })
  687. .then(({ data }) => {
  688. obj.Productslist = data;
  689. })
  690. .catch(err => {
  691. console.log(err);
  692. });
  693. },
  694. //分享
  695. // #ifdef MP
  696. onShareAppMessage: function(res) {
  697. console.log(this.GetInfo);
  698. // 来自页面内分享按钮
  699. let pages = getCurrentPages();
  700. // 获取当前页面
  701. let page = pages[pages.length - 1];
  702. let path = '/pages/index/index?';
  703. // 保存邀请人
  704. path += 'spread=' + this.userInfo.uid;
  705. let data = {
  706. path: path,
  707. imageUrl: this.GetInfo.img,
  708. title: this.GetInfo.title
  709. };
  710. console.log(data);
  711. return data;
  712. },
  713. // #endif
  714. //加入购物车
  715. Addcar(item, type) {
  716. let obj = this;
  717. cartAdd({
  718. cartNum: '1', //商品数量
  719. uniqueId: '', //商品标签
  720. new: 0, //商品是否新增加到购物车1为不加入0为加入
  721. mer_id: '',
  722. productId: item.id //商品编号
  723. })
  724. .then(function(e) {
  725. uni.showToast({
  726. title: '成功加入购物车',
  727. type: 'top',
  728. duration: 500,
  729. icon: 'none'
  730. });
  731. if (type == 2) {
  732. obj.GetProducts();
  733. } else {
  734. obj.loadData();
  735. }
  736. })
  737. .catch(e => {
  738. console.log(e);
  739. });
  740. },
  741. // 请求商品列表
  742. async loadData() {
  743. let obj = this;
  744. loadIndexs({})
  745. .then(({ data }) => {
  746. try {
  747. let goods = data.info;
  748. obj.carouselList = data.banner;
  749. let color = obj.carouselList[obj.swiperCurrent].color;
  750. obj.header_color = 'linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, ' + color + '100%) ';
  751. obj.Textlist_color = color;
  752. obj.bastList = goods.bastList;
  753. obj.benefitList = goods.benefitList;
  754. obj.firstList = goods.firstList;
  755. obj.hotList = goods.hotList;
  756. obj.detail = obj.bastList;
  757. let arr = data.sell_time.split(',');
  758. obj.workstarTime = arr[0];
  759. obj.workendTime = arr[1];
  760. // 保存拼团商品信息
  761. obj.groupBookingList = data.latestPink;
  762. obj.$nextTick(function(){
  763. obj.getPinkTimeBoxWidth()
  764. })
  765. console.log(obj.groupBookingList);
  766. obj.StartDate();
  767. obj.GetDate();
  768. } catch (e) {
  769. console.log(e);
  770. }
  771. uni.stopPullDownRefresh();
  772. })
  773. .catch(e => {
  774. uni.stopPullDownRefresh();
  775. });
  776. },
  777. getPinkTimeBoxWidth(){
  778. this.$refs.pinkGoodsBox.getBoxWidth()
  779. },
  780. // 跳转接龙页面
  781. ToKlon() {
  782. if( this.userInfo.is_promoter == 0 ) {
  783. uni.showToast({
  784. title: '请先成为团长!',
  785. type: 'top',
  786. duration: 500,
  787. icon: 'none',
  788. success() {
  789. uni.navigateTo({
  790. url: '/pages/notice/poster?id=5'
  791. })
  792. }
  793. });
  794. } else {
  795. uni.navigateTo({
  796. url: '/pages/groupBooking/klondike'
  797. })
  798. }
  799. },
  800. //跳转开通美卡页面
  801. Tomember() {
  802. uni.showToast({
  803. title: '敬请期待!',
  804. type: 'top',
  805. duration: 500,
  806. icon: 'none'
  807. });
  808. // if(this.userInfo == ''){
  809. // getUserInfo({})
  810. // .then(({ data }) => {
  811. // this.setUserInfo(data);
  812. // this.userInfo = data;
  813. // })
  814. // .catch(e => {});
  815. // }else{
  816. // if (this.userInfo.level_info.grade > 99) {
  817. // uni.navigateTo({
  818. // url: '/pages/user/renew'
  819. // });
  820. // }
  821. // if (this.userInfo.level_info.grade < 100) {
  822. // uni.navigateTo({
  823. // url: '/pages/user/card'
  824. // });
  825. // }
  826. // }
  827. },
  828. //跳转今日秒杀页面
  829. ToSeckill() {
  830. uni.navigateTo({
  831. url: '/pages/seckill/seckill'
  832. });
  833. },
  834. //跳转退换货协议页面
  835. Toreturned() {
  836. // 只允许通过相机扫码
  837. // uni.scanCode({
  838. // onlyFromCamera: true,
  839. // success: function (res) {
  840. // }
  841. // });
  842. uni.navigateTo({
  843. url: '/pages/index/returned'
  844. });
  845. },
  846. //跳转商品分类页面
  847. ToCategory(ls) {
  848. console.log(ls);
  849. let item = ls;
  850. // 保存当前选中的分类
  851. uni.setStorageSync('categoryId', item);
  852. if (item == '48') {
  853. uni.navigateTo({
  854. url: '/pages/shareQrCode/index'
  855. });
  856. } else if (item == '49') {
  857. uni.navigateTo({
  858. url: '/pages/service/service'
  859. });
  860. } else {
  861. uni.switchTab({
  862. url: '/pages/category/category'
  863. });
  864. }
  865. },
  866. //商品分类
  867. Category() {
  868. uni.switchTab({
  869. url: '/pages/category/category'
  870. });
  871. },
  872. // 监听切换事件
  873. listChange(e) {
  874. this.checkid = e.detail.current;
  875. },
  876. // 點擊搜索框
  877. clickSearch() {
  878. uni.navigateTo({
  879. url: '/pages/product/search'
  880. });
  881. },
  882. //点击切换商品种类
  883. change(item) {
  884. let id = item;
  885. this.checkid = id;
  886. console.log(this.checkid);
  887. if (this.checkid == 0) {
  888. this.detail = this.bastList;
  889. }
  890. if (this.checkid == 1) {
  891. this.detail = this.benefitList;
  892. }
  893. if (this.checkid == 2) {
  894. this.detail = this.firstList;
  895. }
  896. if (this.checkid == 3) {
  897. this.detail = this.hotList;
  898. }
  899. },
  900. // 监听图片加载完成
  901. onImageError(key, index) {
  902. this[key][index].image = '/static/error/errorImage.jpg';
  903. },
  904. //轮播图切换修改背景色
  905. swiperChange(e) {
  906. const index = e.detail.current;
  907. let color = this.carouselList[index].color;
  908. this.swiperCurrent = index;
  909. this.header_color = 'linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, ' + color + '100%) ';
  910. this.Textlist_color = color;
  911. },
  912. //跳转商品详情页
  913. navToDetailPage(item) {
  914. let id = item.id;
  915. uni.navigateTo({
  916. url: '/pages/product/product?id=' + id
  917. });
  918. },
  919. //跳转拼团商品详情页
  920. ToGroup() {
  921. uni.navigateTo({
  922. url: '/pages/groupBooking/index'
  923. });
  924. },
  925. //选择地址
  926. Toaddress() {
  927. if (!this.addressPageShow) {
  928. this.upAddressPageShow();
  929. }
  930. uni.navigateTo({
  931. url: '/pages/index/address'
  932. });
  933. },
  934. Toshare() {
  935. if (this.userInfo == '') {
  936. getUserInfo({})
  937. .then(({ data }) => {
  938. this.setUserInfo(data);
  939. this.userInfo = data;
  940. })
  941. .catch(e => {});
  942. } else {
  943. this.shareShow = false;
  944. uni.navigateTo({
  945. url: '/pages/shareQrCode/index?spread=' + this.userInfo.uid
  946. });
  947. }
  948. },
  949. Tocancel() {
  950. this.shareShow = false;
  951. },
  952. StartDate() {
  953. let obj = this;
  954. console.log(obj.workstarTime);
  955. console.log(this.workendTime);
  956. // 获取当前时间
  957. let now = new Date();
  958. let year = now.getFullYear(); //得到年份
  959. let month = now.getMonth(); //得到月份
  960. let date = now.getDate(); //得到日期
  961. let hour = now.getHours(); //得到小时
  962. let minu = now.getMinutes(); //得到分钟
  963. let sec = now.getSeconds(); //得到秒
  964. //获取早上开始营业的时间戳
  965. let aa = this.workstarTime.split(':');
  966. let bb = aa[0];
  967. let cc = aa[1];
  968. let dd = String(cc).split('');
  969. let ff = dd[0];
  970. let gg = dd[1];
  971. console.log(bb, ff, gg);
  972. let time1 = new Date(year, month, date, bb, ff, gg);
  973. let morning = time1.getTime();
  974. //获取现在时间的时间戳
  975. let time2 = new Date(year, month, date, hour, minu, sec);
  976. let present = time2.getTime();
  977. //获取晚上结束营业的时间戳
  978. let a = this.workendTime.split(':');
  979. let b = a[0];
  980. let c = a[1];
  981. let d = String(c).split('');
  982. let f = d[0];
  983. let g = d[1];
  984. console.log(b, f, g);
  985. let time3 = new Date(year, month, date, b, f, g);
  986. console.log(time1, 'time1');
  987. console.log(time3, 'time3');
  988. let night = time3.getTime();
  989. //现在时间大于结束时间,活动结束
  990. // if(present > time3){
  991. // console.log('现在时间大于结束时间,活动结束')
  992. // obj.end = true;
  993. // }
  994. //现在时间大于开始时间小于结束时间,活动进行中
  995. if (present < time3 && present > time1) {
  996. console.log('现在时间大于开始时间小于结束时间,活动进行中');
  997. obj.Timeing = true;
  998. let starTime = time3 - present;
  999. console.log(time3,present,'present')
  1000. console.log(starTime,'starTime')
  1001. let hours = Math.floor((starTime / 1000 / 60 / 60) % 24); //获取剩余小时数
  1002. let minutes = Math.floor((starTime / 1000 / 60) % 60); //获取分钟
  1003. let seconds = Math.floor((starTime / 1000) % 60); //获取秒数
  1004. obj.Timeinghour = hours;
  1005. obj.Timeingminute = minutes;
  1006. obj.Timeingsecond = seconds;
  1007. console.log('时间差是: ' + obj.Timeinghour + '小时, ' + obj.Timeingminute + '分钟, ' + obj.Timeingsecond + '秒', '距离晚上22:00点结束');
  1008. }
  1009. //现在时间小于开始时间,活动还未开始
  1010. if (present < time1) {
  1011. console.log('现在时间小于开始时间,活动还未开始');
  1012. obj.starting = true;
  1013. let starTime = time1 - present;
  1014. let hours = Math.floor((starTime / 1000 / 60 / 60) % 24); //获取剩余小时数
  1015. let minutes = Math.floor((starTime / 1000 / 60) % 60); //获取分钟
  1016. let seconds = Math.floor((starTime / 1000) % 60); //获取秒数
  1017. obj.starthour = hours;
  1018. obj.startminute = minutes;
  1019. obj.startsecond = seconds;
  1020. console.log('时间差是: ' + obj.starthour + '小时, ' + obj.startminute + '分钟, ' + obj.startsecond + '秒', '距离早上7:00点开始');
  1021. }
  1022. //现在时间距离第二天开始时间
  1023. // day3.setTime(day3.getTime()+24*60*60*1000);
  1024. // var s3 = day3.getFullYear()+"-" + (day3.getMonth()+1) + "-" + day3.getDate();
  1025. },
  1026. GetDate() {
  1027. let obj = this;
  1028. let now = new Date();
  1029. //现在时间转换成时间戳
  1030. let nowTime = now.getTime();
  1031. now.setTime(now.getTime() + 24 * 60 * 60 * 1000);
  1032. let time = obj.workstarTime;
  1033. let data = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate() + ' ' + time;
  1034. data = data.replace(/-/g, '/');
  1035. let time4 = new Date(data);
  1036. let tomorrow = time4.getTime();
  1037. let starTime = tomorrow - nowTime;
  1038. let hours = Math.floor((starTime / 1000 / 60 / 60) % 24); //获取剩余小时数
  1039. let minutes = Math.floor((starTime / 1000 / 60) % 60); //获取分钟
  1040. let seconds = Math.floor((starTime / 1000) % 60); //获取秒数
  1041. obj.hour = hours;
  1042. obj.minute = minutes;
  1043. obj.second = seconds;
  1044. console.log('时间差是: ' + hours + '小时, ' + minutes + '分钟, ' + seconds + '秒', '距离第二天6:40开始');
  1045. },
  1046. // 计算倒计时时间
  1047. timeComputed(da) {
  1048. let obj = this;
  1049. let stopTime = timeComputed(da);
  1050. obj.stopTimeH = stopTime.hours;
  1051. obj.stopTimeM = stopTime.minutes;
  1052. obj.stopTimeS = stopTime.seconds;
  1053. },
  1054. // 轮播图跳转
  1055. bannerNavToUrl(item) {
  1056. // #ifdef H5
  1057. uni.navigateTo({
  1058. url: item.url
  1059. });
  1060. // #endif
  1061. // #ifdef MP-WEIXIN
  1062. uni.navigateTo({
  1063. url: item.wap_url
  1064. });
  1065. // #endif
  1066. // // #ifdef H5
  1067. // if (item.wap_url.indexOf('http') > 0) {
  1068. // window.location.href = item.wap_url;
  1069. // }
  1070. // // #endif
  1071. // //测试数据没有写id,用title代替
  1072. // uni.navigateTo({
  1073. // url: item.wap_url
  1074. // });
  1075. },
  1076. //跳转接口
  1077. navTo(url) {
  1078. uni.navigateTo({
  1079. url
  1080. });
  1081. }
  1082. }
  1083. };
  1084. </script>
  1085. <style lang="scss">
  1086. page {
  1087. background: #ffffff;
  1088. }
  1089. .Mask {
  1090. width: 100%;
  1091. height: 100vh;
  1092. position: fixed;
  1093. z-index: 99999;
  1094. background-color: rgba(0, 0, 0, 0.7);
  1095. top: 0;
  1096. image {
  1097. width: 100%;
  1098. height: 100vh;
  1099. }
  1100. }
  1101. .Toshare {
  1102. position: absolute;
  1103. width: 100%;
  1104. height: 700rpx;
  1105. top: 200rpx;
  1106. }
  1107. .Tocancel {
  1108. position: absolute;
  1109. width: 100%;
  1110. height: 100rpx;
  1111. bottom: 50rpx;
  1112. }
  1113. /*公用边框样式*/
  1114. %icon {
  1115. margin-right: 10rpx;
  1116. display: inline-block;
  1117. padding: 2rpx 10rpx;
  1118. border: 1rpx solid $color-yellow;
  1119. color: $color-yellow;
  1120. line-height: 1;
  1121. font-size: $font-base;
  1122. border-radius: 10rpx;
  1123. }
  1124. .top_header {
  1125. .top-address {
  1126. position: fixed;
  1127. top: 0;
  1128. width: 100% !important;
  1129. z-index: 999;
  1130. padding-bottom: 25rpx;
  1131. //地址
  1132. .header {
  1133. width: 100%;
  1134. padding: 0 4%;
  1135. height: 100rpx;
  1136. display: flex;
  1137. align-items: center;
  1138. .time-box {
  1139. font-size: 26rpx;
  1140. color: #ffffff;
  1141. overflow: hidden; //(超出隐藏)
  1142. width: 45%;
  1143. .timeText {
  1144. isplay: inline-block;
  1145. white-space: nowrap;
  1146. animation: 10s wordsLoop linear infinite normal;
  1147. }
  1148. }
  1149. @keyframes wordsLoop {
  1150. 0% {
  1151. transform: translateX(300px);
  1152. -webkit-transform: translateX(300px);
  1153. }
  1154. 100% {
  1155. transform: translateX(-200%);
  1156. -webkit-transform: translateX(-200%);
  1157. }
  1158. }
  1159. @-webkit-keyframes wordsLoop {
  1160. 0% {
  1161. transform: translateX(300px);
  1162. -webkit-transform: translateX(300px);
  1163. }
  1164. 100% {
  1165. transform: translateX(-200%);
  1166. -webkit-transform: translateX(-200%);
  1167. }
  1168. }
  1169. .addr {
  1170. height: 60rpx;
  1171. flex-shrink: 0;
  1172. display: flex;
  1173. align-items: center;
  1174. font-size: 32rpx;
  1175. width: 50%;
  1176. color: #ffffff;
  1177. .icon {
  1178. height: 60rpx;
  1179. margin-right: 15rpx;
  1180. display: flex;
  1181. align-items: center;
  1182. font-size: 42rpx;
  1183. color: #ffffff;
  1184. }
  1185. }
  1186. .config {
  1187. width: 120rpx;
  1188. height: 60rpx;
  1189. flex-shrink: 0;
  1190. display: flex;
  1191. .message {
  1192. width: 65rpx;
  1193. height: 65rpx;
  1194. display: flex;
  1195. justify-content: flex-end;
  1196. align-items: center;
  1197. font-size: 42rpx;
  1198. color: #ffffff;
  1199. }
  1200. }
  1201. }
  1202. //搜索框
  1203. .input-box {
  1204. width: 92%;
  1205. margin: 0rpx auto;
  1206. height: 70rpx;
  1207. background-color: #f5f5f5;
  1208. border-radius: 50rpx;
  1209. position: relative;
  1210. display: flex;
  1211. align-items: center;
  1212. .icon {
  1213. display: flex;
  1214. align-items: center;
  1215. position: absolute;
  1216. top: 0;
  1217. right: 0;
  1218. width: 60rpx;
  1219. height: 80rpx;
  1220. font-size: 34rpx;
  1221. color: #c0c0c0;
  1222. }
  1223. input {
  1224. padding-left: 28rpx;
  1225. height: 28rpx;
  1226. font-size: 28rpx;
  1227. }
  1228. }
  1229. }
  1230. .zhanwei {
  1231. width: 100% !important;
  1232. height: 160rpx;
  1233. }
  1234. .text-box {
  1235. padding: 30rpx 25rpx;
  1236. font-size: 22rpx;
  1237. color: #ffffff;
  1238. .text-center {
  1239. background: #ef747b;
  1240. border-radius: 50rpx;
  1241. padding: 7rpx 20rpx;
  1242. .img {
  1243. width: 25rpx;
  1244. height: 25rpx;
  1245. margin-right: 8rpx;
  1246. image {
  1247. width: 100%;
  1248. height: 100%;
  1249. }
  1250. }
  1251. .text {
  1252. font-size: 22rpx;
  1253. margin-top: -3rpx;
  1254. }
  1255. }
  1256. }
  1257. //轮播图
  1258. .swiper {
  1259. width: 100%;
  1260. display: flex;
  1261. justify-content: center;
  1262. .swiper-box {
  1263. width: 92%;
  1264. height: 346rpx;
  1265. overflow: hidden;
  1266. border-radius: 15upx;
  1267. // box-shadow: 0upx 8upx 25upx rgba(0, 0, 0, 0.2);
  1268. //兼容ios,微信小程序
  1269. position: relative;
  1270. z-index: 1;
  1271. swiper {
  1272. width: 100%;
  1273. height: 346rpx;
  1274. swiper-item {
  1275. image {
  1276. width: 100%;
  1277. height: 346rpx;
  1278. }
  1279. }
  1280. }
  1281. .indicator {
  1282. position: absolute;
  1283. bottom: 20upx;
  1284. left: 20upx;
  1285. background-color: rgba(255, 255, 255, 0.4);
  1286. width: 150upx;
  1287. height: 5upx;
  1288. border-radius: 3upx;
  1289. overflow: hidden;
  1290. display: flex;
  1291. .dots {
  1292. width: 0upx;
  1293. background-color: rgba(255, 255, 255, 1);
  1294. transition: all 0.3s ease-out;
  1295. &.on {
  1296. width: (100%/3);
  1297. }
  1298. }
  1299. }
  1300. }
  1301. }
  1302. }
  1303. .floor-item {
  1304. margin: 0rpx 25rpx;
  1305. .list-image {
  1306. width: 140rpx;
  1307. height: 140rpx;
  1308. border-radius: 15rpx;
  1309. }
  1310. .price-list {
  1311. font-size: 20rpx;
  1312. position: absolute;
  1313. top: 0;
  1314. left: 0;
  1315. width: 100%;
  1316. padding: 5rpx 10rpx;
  1317. line-height: 1;
  1318. height: 33rpx;
  1319. align-items: flex-end;
  1320. .out-price {
  1321. color: #b25e15;
  1322. text-decoration: line-through;
  1323. font-size: 17rpx;
  1324. }
  1325. .xianprice {
  1326. color: #ffffff;
  1327. font-size: 24rpx !important;
  1328. // padding-bottom: 5rpx;
  1329. }
  1330. .moneyIcon {
  1331. font-size: 17rpx;
  1332. }
  1333. }
  1334. }
  1335. //拼团列表
  1336. .Make-group {
  1337. margin-top: 25rpx !important;
  1338. // color: #157142;
  1339. color: #b33ec5;
  1340. font-size: 26rpx;
  1341. margin: 0rpx 20rpx;
  1342. padding: 10rpx 6rpx;
  1343. // background: linear-gradient(0deg, rgba(124, 224, 128, 1), rgba(220, 250, 196, 1));
  1344. background: linear-gradient(0deg, rgba(141,88,254, 1), rgba(237,224,252, 1));
  1345. border-radius: 21rpx;
  1346. .floor-list {
  1347. .scoll-wrapper {
  1348. }
  1349. }
  1350. .group-title {
  1351. padding-bottom: 20rpx;
  1352. margin: 0 25rpx;
  1353. margin-top: 15rpx;
  1354. .title {
  1355. // color: #157142;
  1356. color: #b33ec5;
  1357. font-size: 36rpx;
  1358. font-weight: bolder;
  1359. }
  1360. .tip {
  1361. }
  1362. .tpl {
  1363. width: 44%;
  1364. font-weight: normal !important;
  1365. font-size: 26rpx !important;
  1366. }
  1367. .detail {
  1368. font-size: 28rpx !important;
  1369. background: linear-gradient(90deg, rgba(255, 116, 0, 1), rgba(254, 5, 0, 1), rgba(254, 10, 0, 1));
  1370. padding: 5rpx 20rpx;
  1371. border-radius: 25rpx;
  1372. color: #ffffff;
  1373. }
  1374. }
  1375. }
  1376. .content {
  1377. width: 100%;
  1378. height: 220rpx;
  1379. margin: 20rpx 0rpx 45rpx 0rpx;
  1380. image {
  1381. width: 100%;
  1382. height: 100%;
  1383. }
  1384. }
  1385. /* 秒杀专区 */
  1386. .seckill-section {
  1387. padding: 4rpx 30rpx 24rpx;
  1388. .s-header {
  1389. display: flex;
  1390. align-items: center;
  1391. height: 92rpx;
  1392. line-height: 1;
  1393. .tit-box {
  1394. flex-shrink: 0;
  1395. }
  1396. .tit {
  1397. @extend %font-title;
  1398. }
  1399. .f-left-icon {
  1400. @extend %f-left-icon;
  1401. }
  1402. .textNav {
  1403. line-height: 1;
  1404. padding: 15rpx 0;
  1405. flex-shrink: 0;
  1406. flex-grow: 1;
  1407. min-width: 100rpx;
  1408. text-align: right;
  1409. }
  1410. .tip-box {
  1411. flex-grow: 1;
  1412. display: flex;
  1413. justify-content: flex-start;
  1414. align-items: center;
  1415. }
  1416. .tip {
  1417. font-size: $font-sm;
  1418. color: $font-color-light;
  1419. padding-left: 10rpx;
  1420. padding-right: 10rpx;
  1421. }
  1422. .timer {
  1423. display: inline-block;
  1424. width: 40rpx;
  1425. height: 36rpx;
  1426. text-align: center;
  1427. line-height: 36rpx;
  1428. margin-right: 14rpx;
  1429. font-size: $font-sm + 2rpx;
  1430. color: #fff;
  1431. border-radius: 2px;
  1432. background: rgba(0, 0, 0, 0.8);
  1433. }
  1434. .iconenter {
  1435. font-size: $font-sm;
  1436. color: $font-color-light;
  1437. flex: 1;
  1438. text-align: right;
  1439. }
  1440. }
  1441. }
  1442. .floor-list {
  1443. white-space: nowrap;
  1444. background-color: white;
  1445. padding: 20rpx;
  1446. border-radius: 5rpx;
  1447. }
  1448. .tpl-box {
  1449. position: relative;
  1450. image {
  1451. width: 149rpx;
  1452. height: 33rpx;
  1453. }
  1454. }
  1455. .scoll-wrapper {
  1456. display: flex;
  1457. align-items: flex-start;
  1458. .noGoodsBg {
  1459. display: flex;
  1460. align-items: center;
  1461. justify-content: center;
  1462. height: 100%;
  1463. position: absolute;
  1464. top: 0;
  1465. left: 0;
  1466. width: 100%;
  1467. color: $font-color-light;
  1468. }
  1469. .floor-item {
  1470. width: 200rpx;
  1471. margin-right: 20rpx;
  1472. font-size: $font-sm + 2rpx;
  1473. color: $font-color-dark;
  1474. line-height: 1.8;
  1475. .list-image {
  1476. width: 200rpx;
  1477. height: 200rpx;
  1478. border-radius: 6rpx;
  1479. image {
  1480. width: 100%;
  1481. height: 100%;
  1482. }
  1483. }
  1484. .price {
  1485. color: $color-red;
  1486. }
  1487. }
  1488. }
  1489. //商品分类
  1490. .category-section {
  1491. display: flex;
  1492. flex-wrap: wrap;
  1493. padding-left: 40rpx;
  1494. font-size: 24rpx;
  1495. color: #656565;
  1496. .category-item {
  1497. text-align: center;
  1498. overflow: hidden;
  1499. display: flex;
  1500. flex-direction: column;
  1501. width: 112rpx;
  1502. background-color: white;
  1503. &:nth-child(n + 1) {
  1504. margin-right: 4%;
  1505. }
  1506. }
  1507. .image-wrapper {
  1508. width: 100%;
  1509. height: 112rpx;
  1510. border-radius: 100%;
  1511. overflow: hidden;
  1512. image {
  1513. width: 100%;
  1514. height: 100%;
  1515. opacity: 1;
  1516. border-radius: 100%;
  1517. }
  1518. }
  1519. .title {
  1520. padding-bottom: 15rpx;
  1521. }
  1522. }
  1523. // 接龙
  1524. .solitaire {
  1525. // background: linear-gradient(270deg, rgba(181,116,242, 1) 0%, rgba(139,86,254, 1) 100%);
  1526. background: linear-gradient(90deg, rgba(45,190,89, 1) 0%, rgba(37,215,79, 1) 100%);
  1527. border-radius: 10rpx;
  1528. margin: 20rpx 25rpx;
  1529. font-size: 24rpx;
  1530. padding: 0rpx 20rpx;
  1531. height: 84rpx;
  1532. color: #ffffff;
  1533. .Member-code {
  1534. font-size: 26rpx;
  1535. display: flex;
  1536. align-items: center;
  1537. }
  1538. .Member-box {
  1539. image {
  1540. width: 45rpx;
  1541. height: 38rpx;
  1542. }
  1543. }
  1544. .Member-text {
  1545. margin-left: 15rpx;
  1546. color: rgba(255, 255, 255, 1);
  1547. }
  1548. }
  1549. //开通美卡
  1550. .Member {
  1551. background: linear-gradient(270deg, rgba(37, 214, 79, 1) 0%, rgba(45, 189, 89, 1) 100%);
  1552. border-radius: 10rpx;
  1553. margin: 15rpx 25rpx;
  1554. font-size: 24rpx;
  1555. padding: 0rpx 20rpx;
  1556. height: 84rpx;
  1557. color: #ffffff;
  1558. .Member-code {
  1559. font-size: 26rpx;
  1560. display: flex;
  1561. align-items: center;
  1562. }
  1563. .Member-box {
  1564. image {
  1565. width: 45rpx;
  1566. height: 38rpx;
  1567. }
  1568. }
  1569. .Member-text {
  1570. margin-left: 15rpx;
  1571. color: rgba(255, 255, 255, 1);
  1572. }
  1573. }
  1574. .time-box {
  1575. position: relative;
  1576. }
  1577. .seckill-section {
  1578. padding: 4rpx 30rpx 24rpx;
  1579. .s-header {
  1580. display: flex;
  1581. align-items: center;
  1582. height: 92rpx;
  1583. line-height: 1;
  1584. .tit-box {
  1585. flex-shrink: 0;
  1586. }
  1587. .tit {
  1588. @extend %font-title;
  1589. margin-right: 15;
  1590. }
  1591. .f-left-icon {
  1592. @extend %f-left-icon;
  1593. background-image: linear-gradient(#71d094, #5dbc7c);
  1594. }
  1595. .textNav {
  1596. font-size: 28rpx;
  1597. color: #2dbd59;
  1598. }
  1599. .tip-box {
  1600. flex-grow: 1;
  1601. display: flex;
  1602. justify-content: flex-start;
  1603. align-items: center;
  1604. }
  1605. .tip {
  1606. font-size: $font-sm;
  1607. color: $font-color-light;
  1608. padding-left: 10rpx;
  1609. padding-right: 10rpx;
  1610. }
  1611. .timer {
  1612. display: inline-block;
  1613. width: 40rpx;
  1614. height: 36rpx;
  1615. text-align: center;
  1616. line-height: 36rpx;
  1617. margin-right: 14rpx;
  1618. font-size: $font-sm + 2rpx;
  1619. color: #fff;
  1620. border-radius: 2px;
  1621. background: rgba(0, 0, 0, 0.8);
  1622. }
  1623. .iconenter {
  1624. font-size: $font-sm;
  1625. color: $font-color-light;
  1626. flex: 1;
  1627. text-align: right;
  1628. }
  1629. }
  1630. .floor-list {
  1631. white-space: nowrap;
  1632. background-color: white;
  1633. padding: 20rpx;
  1634. border-radius: 5rpx;
  1635. }
  1636. .scoll-wrapper {
  1637. display: flex;
  1638. align-items: flex-start;
  1639. .noGoodsBg {
  1640. display: flex;
  1641. align-items: center;
  1642. justify-content: center;
  1643. height: 100%;
  1644. position: absolute;
  1645. top: 0;
  1646. left: 0;
  1647. width: 100%;
  1648. color: $font-color-light;
  1649. }
  1650. .floor-item {
  1651. width: 200rpx;
  1652. font-size: $font-sm + 2rpx;
  1653. margin-right: 25rpx;
  1654. .list-image {
  1655. width: 200rpx;
  1656. height: 200rpx;
  1657. }
  1658. .tpl {
  1659. padding-left: 15rpx;
  1660. .title {
  1661. font-size: 26rpx !important;
  1662. }
  1663. .img {
  1664. width: 50rpx;
  1665. height: 50rpx;
  1666. image {
  1667. width: 100%;
  1668. height: 100%;
  1669. }
  1670. }
  1671. .price {
  1672. padding-top: 15rpx;
  1673. font-size: 24rpx;
  1674. font-weight: bold;
  1675. color: rgba(255, 26, 39, 1);
  1676. }
  1677. .otPrice {
  1678. font-size: 20rpx;
  1679. font-weight: 400;
  1680. text-decoration: line-through;
  1681. color: rgba(153, 153, 153, 1);
  1682. }
  1683. .price-green {
  1684. color: #2dbd59;
  1685. font-size: 28rpx !important;
  1686. text {
  1687. background: #2dbd59;
  1688. color: #ffffff;
  1689. padding: 0rpx 10rpx;
  1690. border-radius: 7rpx;
  1691. font-size: 22rpx !important;
  1692. margin-left: 15rpx;
  1693. }
  1694. }
  1695. }
  1696. }
  1697. }
  1698. }
  1699. //过渡分割线
  1700. .transition {
  1701. background: #f0f0f0;
  1702. width: 100%;
  1703. height: 20rpx;
  1704. margin-bottom: 25rpx;
  1705. }
  1706. // 特色专区
  1707. .characteristic {
  1708. margin-bottom: 25rpx;
  1709. .characteristic-box {
  1710. font-size: 26rpx;
  1711. width: 93%;
  1712. margin: 0rpx auto;
  1713. border-radius: 15rpx;
  1714. border: 1rpx solid #f8f6f6;
  1715. .box {
  1716. border-bottom: 1rpx solid #f8f6f6;
  1717. .characteristic-list {
  1718. padding: 25rpx 25rpx;
  1719. width: 50%;
  1720. border-right: 1rpx solid #f8f6f6;
  1721. .list-tpl {
  1722. font-size: 30rpx;
  1723. font-weight: bold;
  1724. color: rgba(51, 51, 51, 1);
  1725. }
  1726. .red {
  1727. background: linear-gradient(140deg, rgba(254, 74, 50, 1) 0%, rgba(254, 148, 84, 1) 100%);
  1728. -webkit-background-clip: text;
  1729. -webkit-text-fill-color: transparent;
  1730. }
  1731. .pink {
  1732. background: linear-gradient(140deg, rgba(243, 42, 60, 1) 0%, rgba(255, 74, 144, 1) 100%);
  1733. -webkit-background-clip: text;
  1734. -webkit-text-fill-color: transparent;
  1735. }
  1736. .blue {
  1737. background: linear-gradient(140deg, rgba(1, 115, 213, 1) 0%, rgba(12, 127, 225, 1) 0%, rgba(58, 161, 251, 1) 100%);
  1738. -webkit-background-clip: text;
  1739. -webkit-text-fill-color: transparent;
  1740. }
  1741. .green {
  1742. background: linear-gradient(140deg, rgba(18, 159, 55, 1) 0%, rgba(110, 206, 70, 1) 100%);
  1743. -webkit-background-clip: text;
  1744. -webkit-text-fill-color: transparent;
  1745. }
  1746. .list-tip {
  1747. font-size: 24rpx;
  1748. padding: 10rpx 0rpx;
  1749. margin-bottom: 10rpx;
  1750. font-weight: 500;
  1751. color: rgba(153, 153, 153, 1);
  1752. }
  1753. .list-img {
  1754. .img {
  1755. width: 140rpx;
  1756. height: 140rpx;
  1757. image {
  1758. width: 100%;
  1759. height: 100%;
  1760. }
  1761. }
  1762. }
  1763. }
  1764. }
  1765. }
  1766. }
  1767. //商品种类卡片切换
  1768. .recommend {
  1769. width: 95%;
  1770. height: 155rpx;
  1771. margin: 0rpx auto;
  1772. padding-top: 30rpx;
  1773. font-size: 24rpx;
  1774. text-align: center;
  1775. color: #333333;
  1776. align-items: flex-start;
  1777. .recommend_list {
  1778. width: 33%;
  1779. }
  1780. .re_title {
  1781. font-size: 30rpx;
  1782. font-weight: bold;
  1783. }
  1784. .re_name {
  1785. color: #999999;
  1786. padding-top: 10rpx;
  1787. }
  1788. .selected_icon {
  1789. width: 25rpx;
  1790. height: 10rpx;
  1791. margin: 0px auto;
  1792. display: none;
  1793. image {
  1794. width: 100%;
  1795. height: 100%;
  1796. }
  1797. }
  1798. .active {
  1799. display: block;
  1800. }
  1801. .active_color {
  1802. background: linear-gradient(to right, rgba(106, 242, 46, 1) 0%, #1bcc26);
  1803. -webkit-background-clip: text;
  1804. color: transparent;
  1805. }
  1806. .active_name {
  1807. background: linear-gradient(-21deg, rgba(27, 204, 38, 1), rgba(106, 242, 46, 1));
  1808. border-radius: 16px;
  1809. color: #ffffff;
  1810. padding: 5rpx 15rpx;
  1811. }
  1812. }
  1813. .f-header {
  1814. display: flex;
  1815. align-items: center;
  1816. height: 92rpx;
  1817. padding: 6rpx 30rpx 8rpx;
  1818. image {
  1819. flex-shrink: 0;
  1820. width: 80rpx;
  1821. height: 80rpx;
  1822. margin-right: 20rpx;
  1823. }
  1824. .tit-box {
  1825. @extend %font-title-box;
  1826. }
  1827. .tit {
  1828. @extend %font-title;
  1829. }
  1830. .iconenter {
  1831. font-size: $font-lg + 2rpx;
  1832. color: $font-color-light;
  1833. }
  1834. .f-left-icon {
  1835. @extend %f-left-icon;
  1836. }
  1837. .iconfont {
  1838. font-size: $font-sm - 2rpx;
  1839. }
  1840. }
  1841. // 美卡升级礼包
  1842. .uservip {
  1843. border-radius: $border-radius-sm;
  1844. background-color: white;
  1845. box-shadow: $box-shadow;
  1846. height: 300rpx;
  1847. margin: 0 30rpx;
  1848. image {
  1849. height: 100%;
  1850. width: 300rpx;
  1851. }
  1852. .detail {
  1853. position: relative;
  1854. padding: 20rpx;
  1855. height: 100%;
  1856. .icon {
  1857. @extend %icon;
  1858. }
  1859. .price-box {
  1860. position: absolute;
  1861. bottom: 20rpx;
  1862. width: calc(100% - 40rpx);
  1863. .price {
  1864. font-size: $font-lg + 2rpx;
  1865. font-weight: bold;
  1866. color: $font-color-base;
  1867. }
  1868. .text {
  1869. color: $color-gray;
  1870. font-size: $font-sm;
  1871. }
  1872. }
  1873. .title {
  1874. font-size: $font-lg;
  1875. font-weight: bold;
  1876. }
  1877. }
  1878. }
  1879. /* 猜你喜欢 */
  1880. .guess-section {
  1881. display: flex;
  1882. flex-wrap: wrap;
  1883. padding: 0 20rpx;
  1884. /* #ifdef H5 */
  1885. padding-bottom: 100rpx;
  1886. /* #endif */
  1887. .guess-item {
  1888. // height: 558rpx;
  1889. position: relative;
  1890. overflow: hidden;
  1891. display: flex;
  1892. flex-direction: column;
  1893. border: 2rpx solid #eeeeee;
  1894. width: 343rpx;
  1895. margin-bottom: 4%;
  1896. border-radius: $border-radius-sm;
  1897. background-color: white;
  1898. padding-bottom: 30rpx;
  1899. &:nth-child(2n + 1) {
  1900. margin-right: 24rpx;
  1901. }
  1902. }
  1903. .imagewrapper {
  1904. width: 100%;
  1905. height: 330rpx;
  1906. border-radius: 3px;
  1907. margin-bottom: 15rpx;
  1908. image {
  1909. width: 100%;
  1910. height: 100%;
  1911. // opacity: 1;
  1912. }
  1913. }
  1914. .guess-list {
  1915. height: 130rpx;
  1916. padding: 0rpx 25rpx;
  1917. .title {
  1918. font-size: 28rpx;
  1919. color: $font-color-dark;
  1920. }
  1921. .info {
  1922. color: #999999;
  1923. font-size: 24rpx;
  1924. }
  1925. .tipBox {
  1926. // padding-bottom: 8rpx;
  1927. .tipsl {
  1928. text {
  1929. border: 2rpx solid #ff1a27;
  1930. color: #ff1a27;
  1931. border-radius: 5rpx;
  1932. font-size: 18rpx;
  1933. padding: 2rpx 5rpx;
  1934. margin-right: 15rpx;
  1935. }
  1936. }
  1937. }
  1938. }
  1939. .price {
  1940. font-size: 28rpx;
  1941. width: 303rpx;
  1942. // padding-top: 25rpx;
  1943. position: relative;
  1944. .price_list {
  1945. .price-red {
  1946. font-weight: bold;
  1947. font-size: 32rpx !important;
  1948. color: #ff1a27;
  1949. text {
  1950. color: #9699a0;
  1951. font-size: 24rpx !important;
  1952. font-weight: normal;
  1953. padding: 0rpx 10rpx;
  1954. }
  1955. }
  1956. .price-green {
  1957. color: #2dbd59;
  1958. font-size: 24rpx !important;
  1959. text {
  1960. background: #2dbd59;
  1961. color: #ffffff;
  1962. padding: 0rpx 8 rpx;
  1963. border-radius: 7rpx;
  1964. font-size: 20rpx !important;
  1965. margin-left: 8rpx;
  1966. }
  1967. }
  1968. }
  1969. .img {
  1970. position: absolute;
  1971. bottom: 0;
  1972. right: 0;
  1973. width: 50rpx;
  1974. height: 50rpx;
  1975. image {
  1976. width: 100%;
  1977. height: 100%;
  1978. }
  1979. }
  1980. }
  1981. .icon {
  1982. @extend %icon;
  1983. }
  1984. .detail {
  1985. line-height: 1;
  1986. }
  1987. .tip {
  1988. color: white;
  1989. background-color: $color-yellow;
  1990. line-height: 1.5;
  1991. font-size: $font-sm;
  1992. padding-left: 20rpx;
  1993. }
  1994. }
  1995. .TipsBox {
  1996. position: fixed;
  1997. bottom: 118rpx;
  1998. width: 100%;
  1999. padding: 50rpx 50rpx;
  2000. font-size: 30rpx;
  2001. background-color: #fdfbcb;
  2002. color: #444025;
  2003. text {
  2004. background-color: #ffbd1e;
  2005. padding: 10rpx 25rpx;
  2006. border-radius: 100rpx;
  2007. color: #ffffff;
  2008. margin-left: 10rpx;
  2009. }
  2010. }
  2011. </style>