home-page-c.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781
  1. <template>
  2. <view class="home-container">
  3. <block v-show="isLoaded">
  4. <custom :bgColor="'bg-them'" :backColor="'#FFFFFF'" :isBack="false" v-show="scrollTop > 100">
  5. <text slot="content" style="color: #FFFFFF; font-size: 36rpx;">{{configInfo.minAppName}}</text>
  6. </custom>
  7. <view class="top-container">
  8. <image src="@/static/home/top_bg_2.png" mode="widthFix" class="bg"></image>
  9. <view class="content">
  10. <view class="title" :style="cuStyle">{{configInfo.minAppName}}</view>
  11. <view class="search">
  12. <image src="/static/icon/search.png" class=""></image>
  13. <input type="text" confirm-type="search" placeholder="搜索商品名称或型号" v-model="keyword" @confirm="searchSubmit">
  14. </view>
  15. </view>
  16. </view>
  17. <view class="swiper-container" v-if="isShow_banner && bannerList.length > 0">
  18. <swiper @change="changeBanner" :autoplay="true">
  19. <block v-for="(item, index) in bannerList" :key='index'>
  20. <swiper-item>
  21. <image :src="item.imgSrc" mode="aspectFill" @tap="toMiniProgram(item.appId, item.linkUrl)" v-if="item.type === 2"></image>
  22. <image :src="item.imgSrc" mode="aspectFill" @tap="toActivityList(item.goodsId)" v-if="item.type === 3"></image>
  23. <image :src="item.imgSrc" mode="aspectFill" @tap="toGoodsDetail(item.goodsId)" v-else></image>
  24. </swiper-item>
  25. </block>
  26. </swiper>
  27. <view class="dots-conatiner">
  28. <view class="con" :style="'width:'+(bannerList.length * 20)+'rpx;'" >
  29. <view class="dot" :style=" 'transform:translateX('+ (bannerCurrent * 100) +'%)' " ></view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="bigActivity-container" v-if="isShow_activity1 && bigActivityImgUrl">
  34. <image :src="bigActivityImgUrl" mode="widthFix" @tap="toActivityList(3)"></image>
  35. </view>
  36. <view class="classify-container" v-if="isShow_classify"
  37. :class="(!isShow_banner || (isShow_banner && bannerList.length < 1))
  38. && (!isShow_activity1 || (isShow_activity1 && !bigActivityImgUrl)) ? 'whiteBg':''">
  39. <view class="content">
  40. <block v-for="(item, index) in classifyList" :key='index'>
  41. <view class="item" @tap="toClassifyLst(item.categoryId)">
  42. <image :src="item.imgUrl" mode="aspectFill"></image>
  43. <text class="ellipsis">{{item.name}}</text>
  44. </view>
  45. </block>
  46. <view class="item" @tap="toClassifyLst(0)">
  47. <image src="@/static/home/class_more2.png" mode="aspectFill"></image>
  48. <text>更多分类</text>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="smallActivity-container" v-if="isShow_activity2 && leftActivityImgUrl && rightActivityImgUrl">
  53. <view class="content">
  54. <view class="list">
  55. <view class="item">
  56. <image :src="leftActivityImgUrl" mode="aspectFill" @tap="toActivityList(4)"></image>
  57. </view>
  58. <view class="item">
  59. <image :src="rightActivityImgUrl" mode="aspectFill" @tap="toActivityList(5)"></image>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="smallActivity-container" v-if="isShow_special">
  65. <view class="content">
  66. <view class="list">
  67. <view class="item">
  68. <image :src="smallActivity1ImgUrl" mode="aspectFill" @tap="toActivityList(6)"></image>
  69. </view>
  70. <view class="item">
  71. <image :src="smallActivity2ImgUrl" mode="aspectFill" @tap="toActivityList(7)"></image>
  72. </view>
  73. <view class="item">
  74. <image :src="smallActivity3ImgUrl" mode="aspectFill" @tap="toActivityList(8)"></image>
  75. </view>
  76. <view class="item">
  77. <image :src="smallActivity4ImgUrl" mode="aspectFill" @tap="toActivityList(9)"></image>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="coupon-container" v-if="isShow_coupon && couponList.length > 0">
  83. <image src="@/static/home/cp_bg1.png" mode="widthFix" class="bg" v-if="couponList.length == 1"></image>
  84. <image src="@/static/home/cp_bg2.png" mode="widthFix" class="bg" v-if="couponList.length > 1"></image>
  85. <view class="list list1" v-if="couponList.length == 1">
  86. <block v-for="(item, index) in couponList" :key='index'>
  87. <view class="item" @tap="handleCoupon(item)">
  88. <image class="cp" src="@/static/home/coupon_bg1.png"></image>
  89. <view class="content">
  90. <view class="left">
  91. <view class="price">¥{{item.couponValue}}</view>
  92. <view class="text" v-if="item.couponType == 'SATISFY'">满{{item.orderAmount}}可用</view>
  93. </view>
  94. <view class="right">
  95. <view class="main">
  96. <view class="row1 ellipsis-2">{{item.couponName}}</view>
  97. <view class="row2">
  98. <view class="date" v-if="item.obtainType == 0 || item.obtainType == 1">
  99. <view>领取时间:</view>
  100. <view>{{item.obtainStartTime | dateToYYmmdd2}}-{{item.obtainEndTime | dateToYYmmdd2}}</view>
  101. </view>
  102. <view class="date" v-if="item.obtainType == 2">
  103. <view>使用时间:</view>
  104. <view>{{item.activeStartTime | dateToYYmmdd2}}-{{item.activeEndTime | dateToYYmmdd2}}</view>
  105. </view>
  106. <view class="button gary" v-if="item.obtainType == 0">待开始</view>
  107. <view class="button red" v-if="item.obtainType == 1">立即领取</view>
  108. <view class="button white" v-if="item.obtainType == 2">去使用</view>
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. </block>
  115. </view>
  116. <view class="list list2" v-if="couponList.length == 2">
  117. <block v-for="(item, index) in couponList" :key='index'>
  118. <view class="item" @tap="handleCoupon(item)">
  119. <image class="cp" src="@/static/home/coupon_bg2.png"></image>
  120. <view class="content">
  121. <view class="top">
  122. <view class="price">¥{{item.couponValue}}</view>
  123. <view class="text">满{{item.orderAmount}}可用</view>
  124. </view>
  125. <view class="bottom">
  126. <view class="name ellipsis">{{item.couponName}}</view>
  127. <view class="date ellipsis" v-if="item.obtainType == 0 || item.obtainType == 1">领取时间:{{item.obtainStartTime | dateToYYmmdd2}}-{{item.obtainEndTime | dateToYYmmdd2}}</view>
  128. <view class="date ellipsis" v-if="item.obtainType == 2">使用时间:{{item.activeStartTime | dateToYYmmdd2}}-{{item.activeEndTime | dateToYYmmdd2}}</view>
  129. <view class="button gary" v-if="item.obtainType == 0">待开始</view>
  130. <view class="button red" v-if="item.obtainType == 1">立即领取</view>
  131. <view class="button white" v-if="item.obtainType == 2">去使用</view>
  132. </view>
  133. </view>
  134. </view>
  135. </block>
  136. </view>
  137. <view class="list list3" v-if="couponList.length > 2">
  138. <view class="left">
  139. <block v-for="(item, index) in couponList" :key='index'>
  140. <view class="item" @tap="handleCoupon(item)">
  141. <image class="cp" src="@/static/home/coupon_bg3.png"></image>
  142. <view class="content">
  143. <view class="top">
  144. <view class="price">¥{{item.couponValue}}</view>
  145. <view class="text">满{{item.orderAmount}}可用</view>
  146. </view>
  147. <view class="bottom">
  148. <view class="name ellipsis">{{item.couponName}}</view>
  149. <view class="date ellipsis" v-if="item.obtainType == 0 || item.obtainType == 1">领取时间:{{item.obtainStartTime | dateToYYmmdd2}}-{{item.obtainEndTime | dateToYYmmdd2}}</view>
  150. <view class="date ellipsis" v-if="item.obtainType == 2">使用时间:{{item.activeStartTime | dateToYYmmdd2}}-{{item.activeEndTime | dateToYYmmdd2}}</view>
  151. <view class="button gary" v-if="item.obtainType == 0">待开始</view>
  152. <view class="button red" v-if="item.obtainType == 1">立即领取</view>
  153. <view class="button white" v-if="item.obtainType == 2">去使用</view>
  154. </view>
  155. </view>
  156. </view>
  157. </block>
  158. </view>
  159. <view class="right">
  160. <view class="text" @tap="toReceiveCoupon">
  161. <text>查</text>
  162. <text>看</text>
  163. <text>更</text>
  164. <text>多</text>
  165. <image src="@/static/home/cp_more.png"></image>
  166. </view>
  167. </view>
  168. </view>
  169. </view>
  170. <view class="myManager-container" v-if="isShow_manager && myManagerDetail && !userInfo.promotionGroupLeader && !userInfo.type === 'SERVICE'">
  171. <view class="content">
  172. <view class="left">
  173. <image :src="myManagerDetail.avatar" mode="aspectFill" v-if="myManagerDetail.avatar.indexOf('http') >= 0"></image>
  174. <image :src="imageUrl + myManagerDetail.avatar" mode="aspectFill" v-else></image>
  175. <view class="main">
  176. <view>客户经理:{{myManagerDetail.workName}}</view>
  177. <view>{{myManagerDetail.workPhone}}</view>
  178. </view>
  179. </view>
  180. <view class="right" @tap="callPhone(myManagerDetail.workPhone)">拨打电话</view>
  181. </view>
  182. </view>
  183. <view class="notice-container" v-if="isShow_notice && noticeList.length > 0 && userInfo.type === 'SERVICE'">
  184. <view class="content">
  185. <view class="left">
  186. <image src="@/static/home/notice.png" ></image>
  187. </view>
  188. <swiper class="swiper" :autoplay="true" :vertical="true" :circular="true" :disable-touch="true">
  189. <block v-for="(item,index) in noticeList" :key='index' >
  190. <swiper-item @touchmove.stop='stopTouchMove'>
  191. <view class="ellipsis">{{item.workUserName}}成功分享商城,获得收益{{item.amount}}元</view>
  192. </swiper-item>
  193. </block>
  194. </swiper>
  195. </view>
  196. </view>
  197. <view class="seckill2-container" v-if="isShow_seckill && seckillTimeList.length > 0">
  198. <view class="content">
  199. <view class="top">
  200. <view class="left">
  201. <view class="title">秒杀专区</view>
  202. <view class="timeout">
  203. <view class="text">{{countdownText}}</view>
  204. <view class="time">{{countdownTime}}</view>
  205. </view>
  206. </view>
  207. <view class="right" @tap="toSeckillGoodsList()">更多<image src="@/static/icon/right.png"></image></view>
  208. </view>
  209. <view class="list">
  210. <block v-for="(item, index) in seckillGoodsList" :key='index'>
  211. <view class="item" @tap="toSeckillGoodsDetail(item.goodsId)">
  212. <image :src="item.imgUrl" mode="aspectFill"></image>
  213. <view class="title ellipsis-2">{{item.goodsName}}</view>
  214. <view class="price">¥{{item.price | numToFixed}}</view>
  215. </view>
  216. </block>
  217. </view>
  218. </view>
  219. </view>
  220. <view class="selected-container" v-if="isShow_selected">
  221. <view class="content">
  222. <view class="title">专题精选</view>
  223. <view class="list">
  224. <view class="item">
  225. <image :src="selected1ImgUrl" mode="aspectFill" @tap="toActivityList(10)"></image>
  226. <view class="text1 ellipsis">{{selected1Title1}}</view>
  227. <view class="text2 ellipsis">{{selected1Title2}}</view>
  228. </view>
  229. <view class="item">
  230. <image :src="selected2ImgUrl" mode="aspectFill" @tap="toActivityList(11)"></image>
  231. <view class="text1 ellipsis">{{selected2Title1}}</view>
  232. <view class="text2 ellipsis">{{selected2Title2}}</view>
  233. </view>
  234. <view class="item">
  235. <image :src="selected3ImgUrl" mode="aspectFill" @tap="toActivityList(12)"></image>
  236. <view class="text1 ellipsis">{{selected3Title1}}</view>
  237. <view class="text2 ellipsis">{{selected3Title2}}</view>
  238. </view>
  239. </view>
  240. </view>
  241. </view>
  242. <view class="recom-container" v-if="isShow_newclassify">
  243. <view class="top">
  244. <scroll-view
  245. :scroll-x="true"
  246. :scroll-left="scrollLeft"
  247. scroll-with-animation
  248. :show-scrollbar="false"
  249. class="tabs-view"
  250. ref="tabs-view">
  251. <view class="tab">
  252. <block v-for="(item, index) in tabList" :key='index'>
  253. <view class="item" :ref="`tabs-item-${index}`" :class="[`tabs-item-${index}`, item.goodsNewsCategoryId == tabCurrent ? 'current':'']" @tap="changeTab(item.goodsNewsCategoryId)">
  254. <view class="name">{{item.mainTitle}}</view>
  255. <view class="text">{{item.subTitle}}</view>
  256. </view>
  257. </block>
  258. </view>
  259. </scroll-view>
  260. </view>
  261. <view class="goods-row-list" v-if="recomList.length > 0">
  262. <block v-for="(item, index) in recomList" :key='index'>
  263. <view class="item" @tap="toGoodsDetail(item.goodsId)">
  264. <view class="image">
  265. <image :src="item.imgUrl" mode="aspectFill" class="img"></image>
  266. <image :src="item.logo" mode="heightFix" class="water" v-if="item.isShowWater"></image>
  267. </view>
  268. <view class="right">
  269. <view>
  270. <view class="title ellipsis-2">{{item.goodsName}}</view>
  271. <view class="tags" v-if="item.tags1 && item.tags1.length > 0">
  272. <view class="it" v-for="(it, idx) in item.tags1" :key="idx">{{it}}</view>
  273. </view>
  274. </view>
  275. <view>
  276. <view class="bottom">
  277. <view class="price">
  278. <view class="price-1">¥{{item.goodsPrice | numToFixed}}</view>
  279. <view class="price-2">¥{{item.orgGoodsPrice | numToFixed}}</view>
  280. </view>
  281. <view class="text">销量:{{item.soldNum}}</view>
  282. </view>
  283. </view>
  284. </view>
  285. </view>
  286. </block>
  287. </view>
  288. <no-data v-if="!recomList.length" :showText="'暂无商品'"></no-data>
  289. <loading-text v-if="recomList.length" :loading="loading" :noMore="noMore" ></loading-text>
  290. </view>
  291. <view class="dialog-container" v-if="isShow_dialog && dialogImgUrl && isShowDialog">
  292. <uni-transition ref="dialog" mode-class="zoom-in" :duration="500" :show="isShow_dialog && dialogImgUrl && isShowDialog">
  293. <image class="image" :src="dialogImgUrl" mode="widthFix" @tap="toActivityList(2)"></image>
  294. </uni-transition>
  295. <uni-transition ref="dialogBtn" mode-class="fade" :duration="500" :show="isShow_dialog && dialogImgUrl && isShowDialog">
  296. <image class="close" src="@/static/icon/close4.png" @tap="closeDialog()"></image>
  297. </uni-transition>
  298. </view>
  299. <view class="bottom-container" v-if="isShow_bottom && bottomImgUrl && isShowBottom">
  300. <uni-transition ref="bottomBtn" mode-class="fade" :duration="500" :show="isShow_bottom && bottomImgUrl && isShowBottom">
  301. <image class="close" src="@/static/icon/close5.png" @tap="closeBottom()"></image>
  302. </uni-transition>
  303. <uni-transition ref="bottom" mode-class="zoom-in" :duration="500" :show="isShow_bottom && bottomImgUrl && isShowBottom">
  304. <image class="image" :src="bottomImgUrl" mode="aspectFill" @tap="toActivityList(13)"></image>
  305. </uni-transition>
  306. </view>
  307. </block>
  308. </view>
  309. </template>
  310. <script>
  311. import {mapState} from 'vuex';
  312. export default {
  313. props:{
  314. homePage: {
  315. type: Number,
  316. default: 0
  317. },
  318. templateInfo: {
  319. type: Object,
  320. default: {}
  321. }
  322. },
  323. data() {
  324. return {
  325. thisHomePage: 3, // 当前首页页面模版
  326. imageUrl: this.$imageUrl,
  327. configInfo: uni.getStorageSync('configInfo'),
  328. isShow_dialog: false,
  329. isShow_banner: false,
  330. isShow_activity1: false,
  331. isShow_classify: false,
  332. isShow_activity2: false,
  333. isShow_special: false,
  334. isShow_seckill: false,
  335. isShow_coupon: false,
  336. isShow_manager: false,
  337. isShow_notice: false,
  338. isShow_newclassify: false,
  339. isShow_selected: false,
  340. isShow_bottom: false,
  341. scrollTop: 0, // 滚动高度(用于控制自定义导航)
  342. keyword: '', // 搜索关键词
  343. classifyList: [], // 分类列表
  344. bannerList: [], // 轮播图列表
  345. bannerCurrent: 0, // 轮播图当前值
  346. dialogImgUrl: '',
  347. bigActivityImgUrl: '',
  348. leftActivityImgUrl: '',
  349. rightActivityImgUrl: '',
  350. smallActivity1ImgUrl: '',
  351. smallActivity2ImgUrl: '',
  352. smallActivity3ImgUrl: '',
  353. smallActivity4ImgUrl: '',
  354. selected1ImgUrl: '',
  355. selected2ImgUrl: '',
  356. selected3ImgUrl: '',
  357. selected1Title1: '',
  358. selected2Title1: '',
  359. selected3Title1: '',
  360. selected1Title2: '',
  361. selected2Title2: '',
  362. selected3Title2: '',
  363. bottomImgUrl: '',
  364. noticeList: [],
  365. couponList: [], // 可领取优惠券列表
  366. myManagerDetail: null, // 我的客户经理信息
  367. seckillTimeList: [], // 秒杀时间段列表
  368. seckillGoodsList: [], // 秒杀商品列表
  369. seckillGoodsPage: 1, // 秒杀商品分页
  370. seckillGoodsNoMore: false, //
  371. countdownText: '', // 倒计时文字
  372. countdownTime: '', // 倒计时时间
  373. endDatetime: '', // 倒计时结束时间
  374. nowDate: null, // 当前时间
  375. dateInterval: null, // 时间定时器
  376. tabList: [], // 好物推荐分类列表
  377. tabCurrent: 1, // 好物推荐分类当前值
  378. pageNum: 1,
  379. pageSize: 8,
  380. recomList: [], // 好物推荐列表
  381. noMore: false,
  382. loading: false,
  383. isLoaded_banner: false,
  384. isLoaded_coupon: false,
  385. isLoaded_seckill: false,
  386. isLoaded_classify: false,
  387. isLoaded_manager: false,
  388. isLoaded_classfly: false,
  389. isLoaded_newclassify: false,
  390. scrollLeft: 50,
  391. scrollViewWidth: 0,
  392. tabsRect: {
  393. left: 0
  394. },
  395. isShowDialog: true,
  396. isShowBottom: true,
  397. }
  398. },
  399. computed:{
  400. cuStyle(){
  401. return `height:${this.CustomBar-this.StatusBar}px; padding-top:${this.StatusBar}px;`
  402. },
  403. ...mapState(['userInfo', 'isLogin', 'userId']),
  404. isLoaded() {
  405. uni.hideLoading();
  406. return (!this.isShow_banner || (this.isShow_banner && this.isLoaded_banner))
  407. && (!this.isShow_coupon || (this.isShow_coupon && this.isLoaded_coupon))
  408. && (!this.isShow_seckill || (this.isShow_seckill && this.isLoaded_seckill))
  409. && (!this.isShow_classify || (this.isShow_classify && this.isLoaded_classify))
  410. && (!this.isShow_manager || (this.isShow_manager && this.isLoaded_manager))
  411. && (!this.isShow_newclassify || (this.isShow_newclassify && this.isLoaded_newclassify))
  412. }
  413. },
  414. watch: {
  415. nowDate() {
  416. let hh = this.nowDate.getHours(),
  417. mm = this.nowDate.getMinutes(),
  418. ss = this.nowDate.getSeconds();
  419. let hs = [10, 12, 15, 18, 20];
  420. if(mm == 0 && ss == 0 && hs.indexOf(hh) >= 0) {
  421. setTimeout(() => {
  422. this.getSeckillTimeList();
  423. }, 1000)
  424. }
  425. },
  426. tabList() {
  427. this.$nextTick(() => {
  428. this.resize()
  429. })
  430. },
  431. templateInfo: {
  432. handler(newValue, oldValue) {
  433. const templateInfo = this.templateInfo;
  434. this.isShow_dialog = templateInfo.popupStatus;
  435. this.isShow_banner = templateInfo.carouseStatus;
  436. this.isShow_activity1 = templateInfo.active1Status;
  437. this.isShow_classify = templateInfo.categoryStatus;
  438. this.isShow_activity2 = templateInfo.active2Status;
  439. this.isShow_special = templateInfo.onlyStatus;
  440. this.isShow_seckill = templateInfo.killStatus;
  441. this.isShow_coupon = templateInfo.couponStatus;
  442. this.isShow_manager = templateInfo.customerStatus;
  443. this.isShow_notice = templateInfo.notiveStatus;
  444. this.isShow_newclassify = templateInfo.newsStatus;
  445. this.isShow_selected = templateInfo.topicsStatus;
  446. this.isShow_bottom = templateInfo.bottomBannerStatus;
  447. this.dialogImgUrl = templateInfo.popupImage;
  448. this.bigActivityImgUrl = templateInfo.active1Image;
  449. this.leftActivityImgUrl = templateInfo.active2LeftImage;
  450. this.rightActivityImgUrl = templateInfo.active2RightImage;
  451. this.smallActivity1ImgUrl = templateInfo.only1Image;
  452. this.smallActivity2ImgUrl = templateInfo.only2Image;
  453. this.smallActivity3ImgUrl = templateInfo.only3Image;
  454. this.smallActivity4ImgUrl = templateInfo.only4Image;
  455. this.selected1ImgUrl = templateInfo.topics1Image;
  456. this.selected2ImgUrl = templateInfo.topics2Image;
  457. this.selected3ImgUrl = templateInfo.topics3Image;
  458. this.selected1Title1 = templateInfo.topics1Title;
  459. this.selected1Title2 = templateInfo.topics1Title2;
  460. this.selected2Title1 = templateInfo.topics2Title;
  461. this.selected2Title2 = templateInfo.topics2Title2;
  462. this.selected3Title1 = templateInfo.topics3Title;
  463. this.selected3Title2 = templateInfo.topics3Title2;
  464. this.bottomImgUrl = templateInfo.bottomBannerImage;
  465. },
  466. immediate: true,
  467. deep: true
  468. }
  469. },
  470. mounted() {
  471. uni.$on('onPageScroll', (data) => {
  472. this.scrollTop = data;
  473. });
  474. uni.$on('onPullDownRefresh', (data) => {
  475. this.keyword = '';
  476. this.getTabList();
  477. this.getBannerList();
  478. this.getCouponList();
  479. this.getMyManager();
  480. this.getNoticeList();
  481. this.getSeckillTimeList();
  482. this.getClassflyList();
  483. });
  484. uni.$on('onReachBottom', (data) => {
  485. this.getRecomList(1);
  486. });
  487. uni.$on('onShow', (data) => {
  488. console.log('onShow page ' + this.thisHomePage);
  489. this.keyword = '';
  490. this.getTabList();
  491. this.getBannerList();
  492. this.getCouponList();
  493. this.getMyManager();
  494. this.getNoticeList();
  495. this.getSeckillTimeList();
  496. if(this.tabList.length < 1) {
  497. this.getClassflyList();
  498. }
  499. this.dateInterval = setInterval(() => {
  500. this.nowDate = new Date();
  501. }, 1000)
  502. });
  503. uni.$on('onHide', (data) => {
  504. if(this.homePage !== this.thisHomePage) return false;
  505. clearInterval(this.dateInterval);
  506. })
  507. },
  508. methods: {
  509. // 搜索商品
  510. searchSubmit() {
  511. uni.navigateTo({
  512. url: '/packageGoods/pages/search?keyword=' + this.keyword
  513. })
  514. },
  515. // 获取一级菜单
  516. getTabList() {
  517. this.$axios({
  518. url: '/goods/category/list',
  519. method: 'get',
  520. params: {}
  521. }).then(res => {
  522. this.classifyList = res.data.slice(0, 9);
  523. uni.stopPullDownRefresh();
  524. }).finally(res => {
  525. this.isLoaded_classify = true;
  526. })
  527. },
  528. // 去分类列表
  529. toClassifyLst(categoryId) {
  530. uni.setStorageSync('categoryId', categoryId);
  531. uni.switchTab({
  532. url: '/pages/goods/classify'
  533. })
  534. },
  535. // 获取轮播图列表
  536. getBannerList() {
  537. this.$axios({
  538. url: '/common/list/page',
  539. method: 'get',
  540. params: {
  541. pageNum: 1,
  542. pageSize: 10,
  543. state: true
  544. }
  545. }).then(res => {
  546. this.bannerList = res.data.records;
  547. }).finally(res => {
  548. this.isLoaded_banner = true;
  549. uni.stopPullDownRefresh();
  550. })
  551. },
  552. // 切换广告图
  553. changeBanner(e) {
  554. this.bannerCurrent = e.detail.current;
  555. },
  556. stopTouchMove() {
  557. return true;
  558. },
  559. // 获取可领优惠券列表
  560. getCouponList() {
  561. this.$axios({
  562. url: '/coupon/list/all',
  563. method: 'get',
  564. params: {
  565. userId: this.userId
  566. }
  567. }).then(res => {
  568. this.couponList = res.data;
  569. }).finally(res => {
  570. this.isLoaded_coupon = true;
  571. })
  572. },
  573. // 处理优惠券
  574. handleCoupon(item) {
  575. if(item.obtainType == 0) {
  576. return this.$toast('该优惠券不可领取');
  577. }else if(item.obtainType == 1) {
  578. this.$axios({
  579. url: '/coupon/obtain',
  580. method: 'get',
  581. params: {
  582. userId: this.userId,
  583. couponId: item.couponId
  584. }
  585. }).then(res => {
  586. this.$successToast('领取成功');
  587. this.getCouponList();
  588. })
  589. }else if(item.obtainType == 2) {
  590. uni.switchTab({
  591. url: '/pages/goods/classify'
  592. });
  593. }
  594. },
  595. // 去可领取优惠券
  596. toReceiveCoupon() {
  597. uni.navigateTo({
  598. url:'/pages/index/coupon'
  599. })
  600. },
  601. // 获取我的客户经理
  602. getMyManager() {
  603. this.$axios({
  604. url: '/user/parent',
  605. method: 'get',
  606. params: {
  607. userId: this.userId
  608. }
  609. }).then(res => {
  610. if(res.data) {
  611. this.myManagerDetail = res.data;
  612. }
  613. }).finally(res => {
  614. this.isLoaded_manager = true;
  615. })
  616. },
  617. // 获取公告列表
  618. getNoticeList() {
  619. this.$axios({
  620. url: '/renovation/settle/list',
  621. method: 'get',
  622. params: {
  623. }
  624. }).then(res => {
  625. if(res.data) {
  626. res.data.forEach(item => {
  627. item.workUserName = item.workUserName.slice(0, 1) + '师傅';
  628. })
  629. this.noticeList = res.data;
  630. }
  631. })
  632. },
  633. // 拨打电话
  634. callPhone(val) {
  635. uni.makePhoneCall({
  636. phoneNumber: val
  637. });
  638. },
  639. findElem(array, attr, val) {
  640. for (var i = 0; i < array.length; i++) {
  641. if (array[i][attr] == val) {
  642. return i; //返回当前索引值
  643. }
  644. }
  645. return -1;
  646. },
  647. // 计算倒计时
  648. countTime() {
  649. let endDatetime = this.endDatetime.replace(/\-/g, '/');
  650. // console.log(endDatetime)
  651. var nowtime = new Date(), //获取当前时间
  652. endtime = new Date(endDatetime); //定义结束时间
  653. var lefttime = endtime.getTime() - nowtime.getTime(), //距离结束时间的毫秒数
  654. dd = Math.floor(lefttime/(1000*60*60)/24), //计算天数
  655. hh = Math.floor(lefttime/(1000*60*60)), //计算小时数
  656. mm = Math.floor(lefttime/(1000*60)%60), //计算分钟数
  657. ss = Math.floor(lefttime/1000%60); //计算秒数
  658. // console.log(new Date(endDatetime))
  659. function checkTime(i){
  660. if (i<10) {
  661. i = "0"+i;
  662. }
  663. return i;
  664. }
  665. setTimeout(() => {
  666. this.countTime();
  667. }, 1000);
  668. this.countdownTime = (dd > 0 ? dd + '天 ' : '') + checkTime(hh) + ":" + checkTime(mm) + ":" + checkTime(ss);
  669. // console.log(this.countdownTime)
  670. },
  671. // 获取秒杀时间列表
  672. getSeckillTimeList() {
  673. this.$axios({
  674. url: '/goods/sec/time',
  675. method: 'get',
  676. params: {}
  677. }).then(res => {
  678. if(res.data.length < 1) {return false;}
  679. this.seckillTimeList = res.data;
  680. this.endDatetime = this.seckillTimeList[0].endDatetime;
  681. this.countdownText = this.seckillTimeList[0].type == 'jxz' ? '距离结束':'即将开始';
  682. this.countTime();
  683. this.getSeckillGoodsList();
  684. }).finally(res => {
  685. this.isLoaded_seckill = true;
  686. })
  687. },
  688. // 获取秒杀商品列表
  689. getSeckillGoodsList(loadMore) {
  690. if(this.seckillGoodsNoMore && loadMore)return;
  691. if(!loadMore) {
  692. this.seckillGoodsNoMore = false;
  693. this.seckillGoodsPage = 1;
  694. }
  695. let secKillId = this.seckillTimeList[0].secKillId;
  696. this.$axios({
  697. url: '/goods/sec/goods/list',
  698. method: 'get',
  699. params: {
  700. pageNum: this.seckillGoodsPage,
  701. pageSize: 3,
  702. secKillId: secKillId,
  703. }
  704. }).then(res => {
  705. let _list = res.data.records;
  706. let pageTotal = res.data.pages;
  707. if(this.seckillGoodsPage >= pageTotal){
  708. this.seckillGoodsNoMore = true;
  709. }
  710. if (_list.length) {
  711. this.seckillGoodsPage += 1;
  712. }
  713. if (loadMore) {
  714. this.seckillGoodsList = this.seckillGoodsList.concat(_list);
  715. } else {
  716. this.seckillGoodsList = _list;
  717. }
  718. })
  719. },
  720. // 加载更多秒杀商品
  721. loadMoreSeckillGoods() {
  722. this.getSeckillGoodsList(true);
  723. },
  724. // 进入秒杀商品详情
  725. toSeckillGoodsDetail(id) {
  726. if(!id) {
  727. return false;
  728. }
  729. if(this.seckillTimeList[0].type == 'wks') {
  730. return this.$toast('活动未开始');
  731. }
  732. uni.navigateTo({
  733. url: '/packageGoods/pages/detail?id=' + id
  734. })
  735. },
  736. // 进入秒杀商品列表
  737. toSeckillGoodsList() {
  738. uni.navigateTo({
  739. url: '/packageGoods/pages/seckill'
  740. })
  741. },
  742. // 获取推荐分类
  743. getClassflyList() {
  744. this.$axios({
  745. url: '/renovation/category/list',
  746. method: 'get',
  747. params: {
  748. pageNo: 1,
  749. pageSize: 10
  750. }
  751. }).then(res => {
  752. this.tabList = res.data.records;
  753. this.tabCurrent = res.data.records.length > 0 ? res.data.records[0].goodsNewsCategoryId : 0;
  754. this.getRecomList();
  755. uni.stopPullDownRefresh();
  756. }).finally(res => {
  757. this.isLoaded_newclassify = true;
  758. })
  759. },
  760. // 切换一级菜单
  761. changeTab(current) {
  762. this.tabCurrent = current;
  763. this.getRecomList();
  764. this.resize();
  765. },
  766. // 获取好物推荐商品列表
  767. getRecomList(loadMore) {
  768. if(this.noMore && loadMore)return;
  769. this.noMore = false
  770. if(!loadMore){
  771. this.pageNum = 1;
  772. }else{
  773. this.loading = true;
  774. }
  775. this.$axios({
  776. url: '/renovation/goods/list',
  777. method: 'get',
  778. params: {
  779. pageNo: this.pageNum,
  780. pageSize: this.pageSize,
  781. type: 1,
  782. objId: this.tabCurrent,
  783. sort: 1
  784. },
  785. }).then(res => {
  786. res.data.records.forEach(item => {
  787. if(item.logo && item.logoStartTime) {
  788. item.isShowWater = this.$compareTime(item.logoStartTime, item.logoEndTime);
  789. }else {
  790. item.isShowWater = false;
  791. }
  792. })
  793. let _list = res.data.records;
  794. let pageTotal = res.data.pages;
  795. if(this.pageNum >= pageTotal){
  796. this.noMore = true;
  797. }
  798. if (_list.length) {
  799. this.pageNum += 1
  800. }
  801. if (loadMore) {
  802. this.recomList = this.recomList.concat(_list);
  803. this.loading = false;
  804. } else {
  805. this.recomList = _list;
  806. }
  807. uni.stopPullDownRefresh();
  808. })
  809. },
  810. // 进入商品详情
  811. toGoodsDetail(id) {
  812. if(!id) {
  813. return false;
  814. }
  815. uni.navigateTo({
  816. url: '/packageGoods/pages/detail?id=' + id
  817. })
  818. },
  819. // 跳转小程序
  820. toMiniProgram(appId, path) {
  821. wx.navigateToMiniProgram({
  822. appId,
  823. path,
  824. extraData: {},
  825. envVersion: 'release',
  826. success(res) {}
  827. });
  828. },
  829. setScrollLeft() {
  830. // 当前活动tab的布局信息,有tab菜单的width和left(为元素左边界到父元素左边界的距离)等信息
  831. const index = this.findElem(this.tabList, 'goodsNewsCategoryId', this.tabCurrent);
  832. const tabRect = this.tabList[index]
  833. // 累加得到当前item到左边的距离
  834. const offsetLeft = this.tabList
  835. .slice(0, index)
  836. .reduce((total, curr) => {
  837. return total + curr.rect.width
  838. }, 0)
  839. // 此处为屏幕宽度
  840. const res = uni.getSystemInfoSync();
  841. const windowWidth = res.windowWidth;
  842. // 将活动的tabs-item移动到屏幕正中间,实际上是对scroll-view的移动
  843. let scrollLeft = offsetLeft - (this.tabsRect.width - tabRect.rect.width) / 2 - (windowWidth - this.tabsRect.right) / 2 + this.tabsRect.left / 2
  844. // 这里做一个限制,限制scrollLeft的最大值为整个scroll-view宽度减去tabs组件的宽度
  845. scrollLeft = Math.min(scrollLeft, this.scrollViewWidth - this.tabsRect.width)
  846. this.scrollLeft = Math.max(0, scrollLeft)
  847. },
  848. // 获取所有标签的尺寸
  849. resize() {
  850. // 如果不存在list,则不处理
  851. if(this.tabList.length === 0) {
  852. return
  853. }
  854. Promise.all([this.getTabsRect(), this.getAllItemRect()]).then(([tabsRect, itemRect = []]) => {
  855. this.tabsRect = tabsRect
  856. this.scrollViewWidth = 0
  857. itemRect.map((item, index) => {
  858. // 计算scroll-view的宽度,这里
  859. this.scrollViewWidth += item.width
  860. // 另外计算每一个item的中心点X轴坐标
  861. this.tabList[index].rect = item
  862. })
  863. // 获取了tabs的尺寸之后,设置滑块的位置
  864. this.setScrollLeft()
  865. })
  866. },
  867. // 获取导航菜单的尺寸
  868. getTabsRect() {
  869. return new Promise(resolve => {
  870. this.queryRect('tabs-view').then(size => resolve(size))
  871. })
  872. },
  873. // 获取所有标签的尺寸
  874. getAllItemRect() {
  875. return new Promise(resolve => {
  876. const promiseAllArr = this.tabList.map((item, index) => this.queryRect(
  877. `tabs-item-${index}`, true))
  878. Promise.all(promiseAllArr).then(sizes => resolve(sizes))
  879. })
  880. },
  881. // 获取各个标签的尺寸
  882. queryRect(el, item) {
  883. const query = uni.createSelectorQuery().in(this);
  884. return new Promise(resolve => {
  885. query.select(`.${el}`).boundingClientRect(data => {
  886. resolve(data)
  887. }).exec();
  888. })
  889. },
  890. // 关闭弹窗
  891. closeDialog() {
  892. this.$refs.dialog.step({
  893. scale: 0
  894. }, {
  895. duration: 400
  896. })
  897. this.$refs.dialog.run(()=>{
  898. this.isShowDialog = false;
  899. })
  900. this.$refs.dialogBtn.step({
  901. scale: 0
  902. }, {
  903. duration: 400
  904. })
  905. this.$refs.dialogBtn.run(()=>{
  906. this.isShowDialog = false;
  907. })
  908. },
  909. // 关闭弹窗
  910. closeBottom() {
  911. this.$refs.bottom.step({
  912. scale: 0
  913. }, {
  914. duration: 400
  915. })
  916. this.$refs.bottom.run(()=>{
  917. this.isShowBottom = false;
  918. })
  919. this.$refs.bottomBtn.step({
  920. scale: 0
  921. }, {
  922. duration: 400
  923. })
  924. this.$refs.bottomBtn.run(()=>{
  925. this.isShowBottom = false;
  926. })
  927. },
  928. // 进入活动列表
  929. toActivityList(type) {
  930. if(type == 2) {
  931. this.closeDialog();
  932. }
  933. // if(type == 13) {
  934. // this.closeBottom();
  935. // }
  936. uni.navigateTo({
  937. url: '/packageGoods/pages/activity?type=' + type
  938. })
  939. }
  940. }
  941. }
  942. </script>
  943. <style lang="scss" scoped>
  944. .top-container {
  945. position: relative;
  946. margin-bottom: 20rpx;
  947. .bg {
  948. display: block;
  949. width: 750rpx;
  950. position: absolute;
  951. top: 0;
  952. z-index: 0;
  953. }
  954. .content {
  955. width: 710rpx;
  956. padding: 0 20rpx;
  957. position: relative;
  958. z-index: 1;
  959. }
  960. .title {
  961. display: flex;
  962. align-items: center;
  963. justify-content: center;
  964. color: #FFFFFF;
  965. font-size: 36rpx;
  966. }
  967. .search {
  968. background: #FFFFFF;
  969. height: 64rpx;
  970. display: flex;
  971. align-items: center;
  972. border-radius: 64rpx;
  973. padding: 0 20rpx;
  974. margin-top: 20rpx;
  975. image {
  976. width: 28rpx;
  977. height: 28rpx;
  978. }
  979. input {
  980. width: 100%;
  981. padding-left: 15rpx;
  982. }
  983. }
  984. }
  985. .classify-container {
  986. margin-top: 20rpx;
  987. position: relative;
  988. z-index: 1;
  989. padding: 0 20rpx;
  990. &.whiteBg {
  991. .content {
  992. background: #ffffff;
  993. text {
  994. color: #666666;
  995. }
  996. }
  997. }
  998. .content {
  999. border-radius: 20rpx;
  1000. padding-top: 30rpx;
  1001. display: flex;
  1002. flex-wrap: wrap;
  1003. .item {
  1004. display: flex;
  1005. flex-direction: column;
  1006. align-items: center;
  1007. width: 142rpx;
  1008. margin-bottom: 30rpx;
  1009. image {
  1010. width: 78rpx;
  1011. height: 78rpx;
  1012. display: block;
  1013. border-radius: 30rpx;
  1014. overflow: hidden;
  1015. }
  1016. text {
  1017. font-size: 24rpx;
  1018. color: #333333;
  1019. margin-top: 10rpx;
  1020. width: 150rpx;
  1021. text-align: center;
  1022. }
  1023. }
  1024. }
  1025. }
  1026. .swiper-container {
  1027. position: relative;
  1028. margin-top: 20rpx;
  1029. swiper {
  1030. height: 270rpx;
  1031. }
  1032. image {
  1033. height: 270rpx;
  1034. width: 710rpx;
  1035. display: block;
  1036. margin: 0 auto 0;
  1037. border-radius: 15rpx;
  1038. overflow: hidden;
  1039. }
  1040. .dots-conatiner {
  1041. position: absolute;
  1042. width: 100%;
  1043. bottom: 40rpx;
  1044. display: flex;
  1045. align-items: center;
  1046. justify-content: center;
  1047. .con {
  1048. border-radius: 4rpx;
  1049. overflow: hidden;
  1050. height: 4rpx;
  1051. background-color: rgba($color: #FFFFFF, $alpha: 0.3);
  1052. }
  1053. .dot {
  1054. width: 20rpx;
  1055. height: 4rpx;
  1056. background-color: #FFFFFF;
  1057. transition: all .3s;
  1058. }
  1059. }
  1060. }
  1061. .bigActivity-container {
  1062. position: relative;
  1063. z-index: 9;
  1064. margin-top: 20rpx;
  1065. padding: 0 20rpx;
  1066. image {
  1067. width: 710rpx;
  1068. display: block;
  1069. }
  1070. }
  1071. .other-container {
  1072. display: flex;
  1073. padding: 0 20rpx;
  1074. margin-top: 20rpx;
  1075. justify-content: space-between;
  1076. image {
  1077. display: block;
  1078. width: 350rpx;
  1079. height: 240rpx;
  1080. border-radius: 20rpx;
  1081. }
  1082. }
  1083. .smallActivity-container {
  1084. margin-top: 20rpx;
  1085. padding: 0 20rpx;
  1086. .content {
  1087. background: #FFFFFF;
  1088. border-radius: 20rpx;
  1089. .title {
  1090. font-size: 32rpx;
  1091. color: #333333;
  1092. line-height: 74rpx;
  1093. padding-left: 20rpx;
  1094. font-weight: 600;
  1095. }
  1096. .list {
  1097. display: flex;
  1098. flex-wrap: wrap;
  1099. padding: 20rpx 20rpx 0;
  1100. .item {
  1101. width: 320rpx;
  1102. margin-right: 30rpx;
  1103. margin-bottom: 20rpx;
  1104. &:nth-child(2n) {
  1105. margin-right: 0;
  1106. }
  1107. image {
  1108. width: 320rpx;
  1109. height: 200rpx;
  1110. display: block;
  1111. border-radius: 20rpx;
  1112. }
  1113. }
  1114. }
  1115. }
  1116. }
  1117. .notice-container {
  1118. padding: 0 20rpx;
  1119. margin-top: 20rpx;
  1120. .content {
  1121. display: flex;
  1122. align-items: center;
  1123. height: 100rpx;
  1124. background: #FFFFFF;
  1125. border-radius: 20rpx;
  1126. }
  1127. .left{
  1128. display: flex;
  1129. align-items: center;
  1130. justify-content: center;
  1131. width: 96rpx;
  1132. height: 48rpx;
  1133. margin-right: 20rpx;
  1134. border-right: 2rpx solid #E5E5E5;
  1135. image {
  1136. width: 60rpx;
  1137. height: 30rpx;
  1138. display: block;
  1139. }
  1140. }
  1141. .swiper{
  1142. height: 100rpx;
  1143. flex: 1;
  1144. padding-right: 20rpx;
  1145. ::v-deep swiper-item {
  1146. display: block;
  1147. height: 100rpx;
  1148. width: 100%;
  1149. line-height: 100rpx;
  1150. }
  1151. }
  1152. }
  1153. .coupon-container {
  1154. position: relative;
  1155. margin-top: 20rpx;
  1156. padding: 0 20rpx;
  1157. .bg {
  1158. display: block;
  1159. width: 100%;
  1160. }
  1161. .list {
  1162. position: absolute;
  1163. top: 80rpx;
  1164. z-index: 1;
  1165. }
  1166. .list1 {
  1167. .item {
  1168. position: relative;
  1169. margin-bottom: 20rpx;
  1170. margin-left: 16rpx;
  1171. .cp {
  1172. width: 688rpx;
  1173. height: 178rpx;
  1174. display: block;
  1175. }
  1176. .content {
  1177. position: absolute;
  1178. left: 0;
  1179. top: 0;
  1180. width: 710rpx;
  1181. height: 160rpx;
  1182. display: flex;
  1183. align-items: center;
  1184. .left {
  1185. width: 210rpx;
  1186. display: flex;
  1187. align-items: center;
  1188. justify-content: center;
  1189. flex-direction: column;
  1190. .price {
  1191. font-size: 48rpx;
  1192. color: #FFFFFF;
  1193. }
  1194. .text {
  1195. color: #FFFFFF;
  1196. font-size: 28rpx;
  1197. }
  1198. }
  1199. .right {
  1200. display: flex;
  1201. align-items: center;
  1202. justify-content: space-between;
  1203. padding: 0 20rpx;
  1204. width: 470rpx;
  1205. height: 150rpx;
  1206. box-sizing: border-box;
  1207. .main {
  1208. width: 430rpx;
  1209. height: 150rpx;
  1210. padding: 16rpx 0 8rpx;
  1211. box-sizing: border-box;
  1212. display: flex;
  1213. flex-direction: column;
  1214. justify-content: space-between;
  1215. .row1 {
  1216. font-size: 28rpx;
  1217. line-height: 32rpx;
  1218. height: 64rpx;
  1219. }
  1220. .row2 {
  1221. font-size: 24rpx;
  1222. line-height: 28rpx;
  1223. color: #999999;
  1224. display: flex;
  1225. justify-content: space-between;
  1226. align-items: center;
  1227. }
  1228. }
  1229. }
  1230. }
  1231. }
  1232. }
  1233. .list2 {
  1234. display: flex;
  1235. .item {
  1236. position: relative;
  1237. margin-bottom: 20rpx;
  1238. &:first-child {
  1239. margin-left: 16rpx;
  1240. }
  1241. .cp {
  1242. width: 342rpx;
  1243. height: 308rpx;
  1244. display: block;
  1245. }
  1246. .content {
  1247. position: absolute;
  1248. left: 0;
  1249. top: 0;
  1250. width: 342rpx;
  1251. height: 328rpx;
  1252. display: flex;
  1253. flex-direction: column;
  1254. align-items: center;
  1255. .top {
  1256. width: 324rpx;
  1257. height: 130rpx;
  1258. display: flex;
  1259. align-items: center;
  1260. justify-content: center;
  1261. flex-direction: column;
  1262. .price {
  1263. font-size: 48rpx;
  1264. color: #FFFFFF;
  1265. line-height: 48rpx;
  1266. margin-top: 16rpx;
  1267. }
  1268. .text {
  1269. color: #FFFFFF;
  1270. font-size: 28rpx;
  1271. line-height: 28rpx;
  1272. margin-top: 10rpx;
  1273. }
  1274. }
  1275. .bottom {
  1276. width: 324rpx;
  1277. height: 160rpx;
  1278. padding: 16rpx;
  1279. box-sizing: border-box;
  1280. display: flex;
  1281. flex-direction: column;
  1282. justify-content: space-between;
  1283. align-items: center;
  1284. .name {
  1285. font-size: 28rpx;
  1286. text-align: left;
  1287. line-height: 32rpx;
  1288. width: 100%;
  1289. }
  1290. .date {
  1291. font-size: 24rpx;
  1292. color: #999999;
  1293. text-align: left;
  1294. width: 100%;
  1295. line-height: 28rpx;
  1296. }
  1297. }
  1298. }
  1299. }
  1300. }
  1301. .list3 {
  1302. display: flex;
  1303. align-items: center;
  1304. .left {
  1305. display: flex;
  1306. width: 630rpx;
  1307. overflow-x: scroll;
  1308. }
  1309. .right {
  1310. width: 80rpx;
  1311. display: flex;
  1312. justify-content: center;
  1313. .text {
  1314. width: 48rpx;
  1315. height: 200rpx;
  1316. border-radius: 48rpx;
  1317. background: #FFFFFF;
  1318. display: flex;
  1319. flex-direction: column;
  1320. align-items: center;
  1321. justify-content: center;
  1322. text {
  1323. font-size: 28rpx;
  1324. color: #FF3F42;
  1325. line-height: 32rpx;
  1326. }
  1327. image {
  1328. width: 32rpx;
  1329. height: 32rpx;
  1330. display: block;
  1331. flex-shrink: 0;
  1332. margin-top: 10rpx;
  1333. }
  1334. }
  1335. }
  1336. .item {
  1337. position: relative;
  1338. margin-bottom: 20rpx;
  1339. &:first-child {
  1340. margin-left: 16rpx;
  1341. }
  1342. .cp {
  1343. width: 278rpx;
  1344. height: 308rpx;
  1345. display: block;
  1346. }
  1347. .content {
  1348. position: absolute;
  1349. left: 0;
  1350. top: 0;
  1351. width: 278rpx;
  1352. height: 328rpx;
  1353. display: flex;
  1354. flex-direction: column;
  1355. align-items: center;
  1356. .top {
  1357. width: 260rpx;
  1358. height: 130rpx;
  1359. display: flex;
  1360. align-items: center;
  1361. justify-content: center;
  1362. flex-direction: column;
  1363. .price {
  1364. font-size: 48rpx;
  1365. color: #FFFFFF;
  1366. line-height: 48rpx;
  1367. margin-top: 16rpx;
  1368. }
  1369. .text {
  1370. color: #FFFFFF;
  1371. font-size: 28rpx;
  1372. line-height: 28rpx;
  1373. margin-top: 10rpx;
  1374. }
  1375. }
  1376. .bottom {
  1377. width: 260rpx;
  1378. height: 160rpx;
  1379. padding: 16rpx;
  1380. box-sizing: border-box;
  1381. display: flex;
  1382. flex-direction: column;
  1383. justify-content: space-between;
  1384. align-items: center;
  1385. .name {
  1386. font-size: 28rpx;
  1387. text-align: left;
  1388. line-height: 32rpx;
  1389. width: 100%;
  1390. }
  1391. .date {
  1392. font-size: 24rpx;
  1393. color: #999999;
  1394. text-align: left;
  1395. width: 100%;
  1396. line-height: 28rpx;
  1397. }
  1398. }
  1399. }
  1400. }
  1401. }
  1402. .button {
  1403. width: 120rpx;
  1404. height: 40rpx;
  1405. border-radius: 40rpx;
  1406. font-size: 24rpx;
  1407. flex-shrink: 0;
  1408. box-sizing: border-box;
  1409. display: flex;
  1410. justify-content: center;
  1411. align-items: center;
  1412. &.gary {
  1413. background: #AAAAAA;
  1414. color: #FFFFFF;
  1415. border: 1px solid #AAAAAA;
  1416. }
  1417. &.red {
  1418. background: #C434FF;
  1419. color: #FFFFFF;
  1420. border: 1px solid #C434FF;
  1421. }
  1422. &.white {
  1423. color: #FF3F42;
  1424. border: 1px solid #FF3F42;
  1425. }
  1426. }
  1427. }
  1428. .myManager-container {
  1429. padding: 0 20rpx;
  1430. .content {
  1431. display: flex;
  1432. justify-content: space-between;
  1433. align-items: center;
  1434. background: #FFFFFF;
  1435. border-radius: 20rpx;
  1436. padding: 20rpx;
  1437. .left {
  1438. display: flex;
  1439. align-items: center;
  1440. image {
  1441. width: 100rpx;
  1442. height: 100rpx;
  1443. border-radius: 50%;
  1444. }
  1445. .main {
  1446. font-size: 28rpx;
  1447. line-height: 48rpx;
  1448. margin-left: 20rpx;
  1449. }
  1450. }
  1451. .right {
  1452. width: 160rpx;
  1453. height: 60rpx;
  1454. line-height: 60rpx;
  1455. border-radius: 60rpx;
  1456. text-align: center;
  1457. font-size: 28rpx;
  1458. color: #E43B38;
  1459. border: 1px solid #E43B38;
  1460. }
  1461. }
  1462. }
  1463. .seckill2-container {
  1464. padding: 0 20rpx;
  1465. margin-top: 20rpx;
  1466. .content {
  1467. background: #FFFFFF;
  1468. border-radius: 20rpx;
  1469. padding: 0 20rpx;
  1470. .top {
  1471. display: flex;
  1472. justify-content: space-between;
  1473. align-items: center;
  1474. height: 86rpx;
  1475. .left {
  1476. display: flex;
  1477. align-items: center;
  1478. .title {
  1479. font-size: 32rpx;
  1480. color: #333333;
  1481. line-height: 74rpx;
  1482. font-weight: 600;
  1483. }
  1484. .timeout {
  1485. display: flex;
  1486. align-items: center;
  1487. margin-left: 20rpx;
  1488. border-radius: 40rpx;
  1489. height: 40rpx;
  1490. overflow: hidden;
  1491. .text {
  1492. font-size: 24rpx;
  1493. color: #FFFFFF;
  1494. width: 120rpx;
  1495. text-align: center;
  1496. background: #FF3F42;
  1497. border-radius: 40rpx;
  1498. position: relative;
  1499. z-index: 1;
  1500. }
  1501. .time {
  1502. padding: 0 20rpx 0 32rpx;
  1503. background: #FFD3B5;
  1504. font-size: 24rpx;
  1505. color: #FF3F42;
  1506. margin-left: -20rpx;
  1507. position: relative;
  1508. z-index: 0;
  1509. }
  1510. }
  1511. }
  1512. .right {
  1513. display: flex;
  1514. align-items: center;
  1515. font-size: 28rpx;
  1516. color: #999999;
  1517. image {
  1518. width: 12rpx;
  1519. height: 26rpx;
  1520. display: block;
  1521. margin-left: 8rpx;
  1522. }
  1523. }
  1524. }
  1525. .list {
  1526. display: flex;
  1527. .item {
  1528. width: 210rpx;
  1529. margin-right: 20rpx;
  1530. padding-bottom: 20rpx;
  1531. &:last-child {
  1532. margin-right: 0;
  1533. }
  1534. image {
  1535. width: 210rpx;
  1536. height: 210rpx;
  1537. display: block;
  1538. }
  1539. .title {
  1540. font-size: 28rpx;
  1541. color: #333333;
  1542. line-height: 36rpx;
  1543. font-weight: 600;
  1544. margin-top: 6rpx;
  1545. }
  1546. .price {
  1547. font-size: 32rpx;
  1548. color: #FF3F42;
  1549. line-height: 36rpx;
  1550. margin-top: 6rpx;
  1551. }
  1552. }
  1553. }
  1554. }
  1555. }
  1556. .selected-container {
  1557. padding: 0 20rpx;
  1558. margin-top: 20rpx;
  1559. .content {
  1560. background: #FFFFFF;
  1561. border-radius: 20rpx;
  1562. padding: 0 20rpx;
  1563. .title {
  1564. font-size: 32rpx;
  1565. color: #333333;
  1566. line-height: 74rpx;
  1567. font-weight: 600;
  1568. }
  1569. .list {
  1570. display: flex;
  1571. .item {
  1572. width: 210rpx;
  1573. margin-right: 20rpx;
  1574. padding-bottom: 20rpx;
  1575. &:last-child {
  1576. margin-right: 0;
  1577. }
  1578. image {
  1579. width: 210rpx;
  1580. height: 210rpx;
  1581. display: block;
  1582. }
  1583. .text1 {
  1584. font-size: 30rpx;
  1585. color: #333333;
  1586. line-height: 36rpx;
  1587. font-weight: 600;
  1588. margin-top: 12rpx;
  1589. text-align: center;
  1590. }
  1591. .text2 {
  1592. font-size: 24rpx;
  1593. color: #666666;
  1594. line-height: 30rpx;
  1595. margin-top: 10rpx;
  1596. text-align: center;
  1597. }
  1598. }
  1599. }
  1600. }
  1601. }
  1602. .recom-container {
  1603. margin-top: 20rpx;
  1604. .top {
  1605. .tab {
  1606. display: flex;
  1607. .item {
  1608. display: flex;
  1609. flex-direction: column;
  1610. align-items: center;
  1611. justify-content: center;
  1612. flex-shrink: 0;
  1613. width: 187.5rpx;
  1614. font-size: 28rpx;
  1615. color: #666666;
  1616. position: relative;
  1617. height: 130rpx;
  1618. .name {
  1619. font-size: 36rpx;
  1620. color: #333333;
  1621. }
  1622. .text {
  1623. font-size: 24rpx;
  1624. color: #666666;
  1625. margin-top: 8rpx;
  1626. }
  1627. &.current {
  1628. .name {
  1629. color: #FF3F42;
  1630. font-weight: 600;
  1631. }
  1632. .text {
  1633. color: #FF3F42;
  1634. }
  1635. &::after {
  1636. content: '';
  1637. display: block;
  1638. width: 48rpx;
  1639. height: 6rpx;
  1640. background: #FF3F42;
  1641. position: absolute;
  1642. bottom: 0;
  1643. left: 50%;
  1644. margin-left: -24rpx;
  1645. }
  1646. }
  1647. }
  1648. }
  1649. }
  1650. }
  1651. .dialog-container {
  1652. position: fixed;
  1653. z-index: 1000000;
  1654. top: 0;
  1655. left: 0;
  1656. width: 100%;
  1657. height: 100vh;
  1658. display: flex;
  1659. align-items: center;
  1660. justify-content: center;
  1661. flex-direction: column;
  1662. background: rgba($color: #000000, $alpha: .6);
  1663. .image {
  1664. width: 600rpx;
  1665. display: block;
  1666. border-radius: 20rpx;
  1667. margin-top: 40rpx;
  1668. }
  1669. .close {
  1670. width: 68rpx;
  1671. height: 68rpx;
  1672. display: block;
  1673. margin-top: 40rpx;
  1674. }
  1675. }
  1676. .bottom-container {
  1677. position: fixed;
  1678. z-index: 999999;
  1679. bottom: 20rpx;
  1680. left: 20rpx;
  1681. width: 710rpx;
  1682. display: flex;
  1683. align-items: flex-end;
  1684. justify-content: center;
  1685. flex-direction: column;
  1686. .image {
  1687. width: 710rpx;
  1688. height: 70rpx;
  1689. display: block;
  1690. border-radius: 70rpx;
  1691. margin-top: 8rpx;
  1692. }
  1693. .close {
  1694. width: 30rpx;
  1695. height: 30rpx;
  1696. display: block;
  1697. }
  1698. }
  1699. </style>
  1700. <style>
  1701. ::-webkit-scrollbar {
  1702. display: none;
  1703. width: 0 !important;
  1704. height: 0 !important;
  1705. -webkit-appearance: none;
  1706. background: transparent;
  1707. color: transparent;
  1708. }
  1709. </style>