index.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452
  1. <template>
  2. <view class="container">
  3. <!-- <view class="dnFile" @click="downFile">
  4. 台企联入会申请
  5. </view> -->
  6. <scroll-view scroll-x="true" class="class-box flex b-t" :scroll-left="scrollLeft" :scroll-with-animation="true">
  7. <view @click="tabClick(idx)" class="item" :style="{ width: topNavWidth }" v-for="(item, idx) in navList" :key="idx">
  8. <view class="status" :class="{ action: idx == tabCurrentIndex }">{{ item.title }}</view>
  9. </view>
  10. </scroll-view>
  11. <swiper :interval="3000" :duration="500" class="nav-swiper" :current="tabCurrentIndex"
  12. :style="{'height':height}" @change="changeTab" :circular="true" disable-touch>
  13. <swiper-item v-for="navItem in navList">
  14. <scroll-view scroll-y="true" :style="{'height':height}" @scrolltolower="getArtList()">
  15. <!-- 轮播图and搜索 start-->
  16. <view class="top-swiper" v-if="tabCurrentIndex == 0">
  17. <swiper :autoplay="true" :interval="3000" :duration="1000" class="banner-swiper">
  18. <swiper-item v-for="itemb in carouselList" @click="navTo(itemb.wap_url)">
  19. <image :src="itemb.pic" mode="" class="swiper-img"></image>
  20. </swiper-item>
  21. </swiper>
  22. <view class="input-box flex" @click="navTo('/pages/index/searchArt')">
  23. <view class=" input-content flex">
  24. <view class="iconfont iconsearch"></view>
  25. <view class="input"><input type="text" disabled placeholder="有什么新鲜事" /></view>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- 轮播图and搜索 end-->
  30. <!-- 置顶新闻 start-->
  31. <view class="zd-wrap flex" v-if="zdArt && tabCurrentIndex == 0" @click="goToDetail(zdArt.id)">
  32. <view class="zd-tit clamp2">
  33. <text class="zd-tip">|置顶|</text>{{zdArt.title}}
  34. </view>
  35. <view class="art-time">
  36. <image src="../../static/icon/hot.png" mode="" class="hot" v-if="zdArt.is_hot == 1"></image>{{zdArt.add_time | showTime}}
  37. </view>
  38. </view>
  39. <!-- 置顶新闻 end-->
  40. <!-- 文章列表 start-->
  41. <view class="art-list">
  42. <template v-for="item in navItem.list">
  43. <!-- 文章图片为一 -->
  44. <view class="art-item-one flex art-item" v-if="item.image_input.length == 1" @click="goToDetail(item.id)">
  45. <view class="art-left flex">
  46. <view class="art-tit clamp2">
  47. {{item.title}}
  48. </view>
  49. <view class="art-time">
  50. <image src="../../static/icon/hot.png" mode="" class="hot" v-if="item.is_hot == 1"></image><text
  51. class="store-name">{{item.mername | storeName}}</text>
  52. <text
  53. class="creat-time">{{item.add_time | showTime}}</text>
  54. </view>
  55. </view>
  56. <view class="art-right">
  57. <image :src="item.image_input" mode=""></image>
  58. </view>
  59. </view>
  60. <!-- 文章图片为零 -->
  61. <view class="art-item-zero flex art-item" v-if="item.image_input.length == 0" @click="goToDetail(item.id)">
  62. <view class="art-tit clamp2">
  63. {{item.title}}
  64. </view>
  65. <view class="art-time">
  66. <image src="../../static/icon/hot.png" mode="" class="hot"></image><text
  67. class="store-name">{{item.mername | storeName}}</text>
  68. <!-- <text class="pl">{{item.comment}}评论</text> -->
  69. <text
  70. class="creat-time">{{item.add_time | showTime}}</text>
  71. </view>
  72. </view>
  73. <!-- 文章图片大于一 -->
  74. <view class="art-item-three art-item flex" v-if="item.image_input.length > 1" @click="goToDetail(item.id)">
  75. <view class="art-tit clamp2">
  76. {{item.title}}
  77. </view>
  78. <view class="art-img-list">
  79. <image :src="imgitem" mode="" v-for="imgitem in item.image_input"></image>
  80. </view>
  81. <view class="art-time">
  82. <image src="../../static/icon/hot.png" mode="" class="hot"></image><text
  83. class="store-name">{{item.mername | storeName}}</text>
  84. <!-- <text class="pl">{{item.comment}}评论</text> -->
  85. <text
  86. class="creat-time">{{item.add_time | showTime}}</text>
  87. </view>
  88. </view>
  89. </template>
  90. </view>
  91. <uni-load-more :status="navItem.loadingType"></uni-load-more>
  92. <!-- 文章列表 start-->
  93. </scroll-view>
  94. </swiper-item>
  95. </swiper>
  96. </view>
  97. </template>
  98. <script>
  99. import {
  100. weixindata,
  101. shareLoad
  102. } from '@/utils/wxAuthorized.js';
  103. import {
  104. loadIndexs,
  105. downFile
  106. } from '@/api/index.js';
  107. import {
  108. getUserInfo
  109. } from '@/api/user.js';
  110. import {
  111. interceptor
  112. } from '@/utils/loginUtils';
  113. import {
  114. mapState
  115. } from 'vuex';
  116. import {
  117. getArtTypeList,
  118. getArtList
  119. } from '@/api/art.js'
  120. import { timeComputed } from '@/utils/rocessor.js';
  121. export default {
  122. data() {
  123. return {
  124. topNavWidth: '25%', //设置导航默认宽度
  125. height: '',
  126. tabCurrentIndex: 0,
  127. navList: [{
  128. id: 0,
  129. title: '推荐',
  130. loadingType: 'more',
  131. list: [],
  132. limit: 10,
  133. page: 1,
  134. loaded: false
  135. }],
  136. checkid: 0,
  137. titleNViewBackground: '',
  138. swiperCurrent: 0,
  139. swiperLength: 0,
  140. carouselList: [], //轮播列表
  141. goodsList: [], //最新商品列表
  142. bastList: [], //精品推荐列表
  143. bastBanner: [], //促销商品列表
  144. menusList: [], //头部菜单
  145. page: 1,
  146. limit: 5,
  147. userServant: [{
  148. image: ''
  149. }], //用户推广服务
  150. actTime: new Date(),
  151. zdArt: {},
  152. };
  153. },
  154. computed: {
  155. ...mapState(['loginInterceptor']),
  156. ...mapState('user', ['hasLogin', 'userInfo']),
  157. scrollLeft() {
  158. if (this.tabCurrentIndex > 1) {
  159. return this.itemWidht * (this.tabCurrentIndex - 1.5);
  160. } else {
  161. return 0;
  162. }
  163. }
  164. },
  165. filters: {
  166. showTime(dateTime) {
  167. //dateTimeStamp是一个时间毫秒,注意时间戳是秒的形式,在这个毫秒的基础上除以1000,就是十位数的时间戳。13位数的都是时间毫秒。
  168. dateTime = dateTime*1000
  169. var minute = 1000 * 60 //把分,时,天,周,半个月,一个月用毫秒表示
  170. var hour = minute * 60
  171. var day = hour * 24
  172. var week = day * 7
  173. var halfamonth = day * 15
  174. var month = day * 30
  175. var now = new Date().getTime() //获取当前时间毫秒
  176. var dateTimeStamp = new Date(dateTime)
  177. var diffValue = now - dateTimeStamp //时间差
  178. if (diffValue < 0) {
  179. return
  180. }
  181. var minC = diffValue / minute //计算时间差的分,时,天,周,月
  182. var hourC = diffValue / hour
  183. var dayC = diffValue / day
  184. var weekC = diffValue / week
  185. var monthC = diffValue / month
  186. var result = ''
  187. if (monthC >= 1 && monthC <= 3) {
  188. result = ' ' + parseInt(monthC) + '月前'
  189. } else if (weekC >= 1 && weekC <= 4) {
  190. result = ' ' + parseInt(weekC) + '周前'
  191. } else if (dayC >= 1 && dayC <= 7) {
  192. result = ' ' + parseInt(dayC) + '天前'
  193. } else if (hourC >= 1 && hourC <= 24) {
  194. result = ' ' + parseInt(hourC) + '小时前'
  195. } else if (minC >= 1 && minC <= 60) {
  196. result = ' ' + parseInt(minC) + '分钟前'
  197. } else if (diffValue >= 0 && diffValue <= minute) {
  198. result = '刚刚'
  199. } else {
  200. var datetime = new Date()
  201. datetime.setTime(dateTimeStamp)
  202. var Nyear = datetime.getFullYear()
  203. var Nmonth =
  204. datetime.getMonth() + 1 < 10 ?
  205. '0' + (datetime.getMonth() + 1) :
  206. datetime.getMonth() + 1
  207. var Ndate =
  208. datetime.getDate() < 10 ?
  209. '0' + datetime.getDate() :
  210. datetime.getDate()
  211. var Nhour =
  212. datetime.getHours() < 10 ?
  213. '0' + datetime.getHours() :
  214. datetime.getHours()
  215. var Nminute =
  216. datetime.getMinutes() < 10 ?
  217. '0' + datetime.getMinutes() :
  218. datetime.getMinutes()
  219. var Nsecond =
  220. datetime.getSeconds() < 10 ?
  221. '0' + datetime.getSeconds() :
  222. datetime.getSeconds()
  223. result = Nyear + '-' + Nmonth + '-' + Ndate
  224. }
  225. return result
  226. },
  227. storeName(val) {
  228. let str = ''
  229. if(val) {
  230. if(val.length <= 6) {
  231. str = val
  232. }else {
  233. str = val.slice(0,6) + '...'
  234. }
  235. }
  236. return str
  237. }
  238. },
  239. onLoad: function(option) {
  240. // #ifndef MP
  241. if (option.spread) {
  242. // 存储其他邀请人
  243. uni.setStorageSync('spread', option.spread);
  244. }
  245. // #endif
  246. // #ifdef MP
  247. if (option.scene) {
  248. // 存储小程序邀请人
  249. uni.setStorage({
  250. key: 'spread_code',
  251. data: option.scene
  252. });
  253. }
  254. // #endif
  255. // 获取文章分类
  256. this.getArtTypeList()
  257. // 获取置顶
  258. this.getArtList('zhiding')
  259. // 获取推荐文章列表
  260. this.getArtList()
  261. this.loadIndexs()
  262. this.IndexShare()
  263. },
  264. onShow: function() {
  265. // 判断是否强制登录
  266. if (this.loginInterceptor && !this.hasLogin) {
  267. // 登录拦截
  268. interceptor();
  269. }
  270. },
  271. // 计算页面剩余高度
  272. onReady(res) {
  273. var obj = this;
  274. uni.getSystemInfo({
  275. success: resu => {
  276. const query = uni.createSelectorQuery();
  277. query.select('.nav-swiper').boundingClientRect();
  278. query.exec(function(res) {
  279. obj.height = resu.windowHeight - res[0].top + 'px';
  280. });
  281. },
  282. fail: res => {}
  283. });
  284. },
  285. // 用户下拉刷新
  286. async onPullDownRefresh() {
  287. // 获取置顶
  288. this.getArtList('zhiding')
  289. // 当前分类列表状态重置
  290. let data = this.navList[this.tabCurrentIndex]
  291. data.loaded = false
  292. data.page = 1
  293. data.list = []
  294. data.loadingType = 'more'
  295. // 获取推荐文章列表
  296. await this.getArtList()
  297. // 停止当前页面的下拉刷新
  298. uni.stopPullDownRefresh()
  299. },
  300. methods: {
  301. downFile(){
  302. downFile().then(res=>{
  303. if(res.status==200){
  304. window.location.href=res.data[0].url
  305. }
  306. })
  307. },
  308. // 分享
  309. IndexShare() {
  310. let obj = this;
  311. // let money = obj.money;
  312. let item = {
  313. link: obj.$store.state.baseURL + '/index/#/pages/index/index', // 分享链接
  314. imgUrl:'http://media.fgtpt.cn/uploads/attach/2022/04/20220406/bfccab8ef0875d338e74d0b977c451a9.jpg',
  315. desc: '企联汇首页',
  316. title: '企联汇首页',
  317. success: console.log('分享加载成功')
  318. };
  319. shareLoad(item);
  320. },
  321. // 获取项目宽度
  322. numClassWidht() {
  323. uni.createSelectorQuery()
  324. .select('.container')
  325. .fields(
  326. {
  327. size: true
  328. },
  329. data => {
  330. // 设置项目宽度
  331. this.itemWidht = Math.floor((data.width / 750) * 187.5);
  332. }
  333. )
  334. .exec();
  335. },
  336. // 获取轮播图
  337. loadIndexs() {
  338. let obj = this
  339. loadIndexs().then(res => {
  340. console.log(res)
  341. obj.carouselList = res.data.banner
  342. })
  343. },
  344. //swiper 切换
  345. changeTab(e) {
  346. console.log(e,'eeeeeeeeeeeeeeeeee')
  347. if(e.target.current > this.navList.length -1) {
  348. this.tabCurrentIndex = 0
  349. } else {
  350. this.tabCurrentIndex = e.target.current;
  351. }
  352. this.getArtList('tab')
  353. },
  354. // 头部点击切换
  355. tabClick(index) {
  356. this.tabCurrentIndex = index
  357. },
  358. openSubscribe: function(e) {
  359. let page = e;
  360. // #ifndef MP
  361. uni.navigateTo({
  362. url: page
  363. });
  364. // #endif
  365. // #ifdef MP
  366. uni.showLoading({
  367. title: '正在加载'
  368. });
  369. openBargainSubscribe()
  370. .then(res => {
  371. uni.hideLoading();
  372. uni.navigateTo({
  373. url: page
  374. });
  375. })
  376. .catch(err => {
  377. uni.hideLoading();
  378. });
  379. // #endif
  380. },
  381. // 监听切换事件
  382. listChange(e) {
  383. this.checkid = e.detail.current;
  384. },
  385. // 點擊搜索框
  386. clickSearch() {
  387. uni.navigateTo({
  388. url: '/pages/product/search'
  389. });
  390. },
  391. // 监听图片加载完成
  392. onImageError(key, index) {
  393. this[key][index].image = '/static/error/errorImage.jpg';
  394. },
  395. // 轮播图跳转
  396. bannerNavToUrl(item) {
  397. // #ifdef H5
  398. if (item.wap_url.indexOf('http') > 0) {
  399. window.location.href = item.wap_url;
  400. }
  401. // #endif
  402. //测试数据没有写id,用title代替
  403. uni.navigateTo({
  404. url: item.wap_url
  405. });
  406. },
  407. // 获取文章分类
  408. getArtTypeList() {
  409. let obj = this
  410. getArtTypeList().then(res => {
  411. console.log(res)
  412. // 获取头部nav
  413. let arr = res.data.map(e => {
  414. e.loadingType = 'more'
  415. e.page = 1
  416. e.limit = 10
  417. e.loaded = false
  418. e.list = []
  419. return e
  420. })
  421. obj.navList = obj.navList.concat(arr)
  422. obj.$nextTick(() => {
  423. obj.numClassWidht();
  424. });
  425. console.log(obj.navList)
  426. })
  427. },
  428. // 获取文章列表
  429. getArtList(type) {
  430. let obj = this
  431. let index = obj.tabCurrentIndex
  432. let navitem = this.navList[index]
  433. if (type == 'zhiding') {
  434. getArtList({
  435. page: 1,
  436. rows: 1,
  437. type: 0
  438. }).then(res => {
  439. console.log(res, '置顶')
  440. obj.zdArt = res.data.list[0]
  441. })
  442. } else {
  443. // nav 点击切换拦截
  444. if(type == 'tab') {
  445. if(navitem.loaded) {
  446. return
  447. }
  448. }
  449. if (navitem.id == 0) {
  450. if(navitem.loadingType == 'loading' || navitem.loadingType == 'noMore') {
  451. return
  452. }
  453. navitem.loadingType = 'loading'
  454. getArtList({
  455. page:navitem.page,
  456. rows: navitem.limit,
  457. }).then(res => {
  458. console.log(res, '推荐')
  459. navitem.list = navitem.list.concat(res.data.list)
  460. console.log(navitem.list, 'navitem.list')
  461. navitem.page++
  462. if(res.data.list.length == navitem.limit) {
  463. navitem.loadingType = 'more'
  464. }else {
  465. navitem.loadingType = 'noMore'
  466. }
  467. navitem.loaded = true
  468. })
  469. }else {
  470. if(navitem.loadingType == 'loading' || navitem.loadingType == 'noMore') {
  471. return
  472. }
  473. navitem.loadingType = 'loading'
  474. getArtList({
  475. page:navitem.page,
  476. rows: navitem.limit,
  477. type: navitem.id
  478. }).then(res => {
  479. console.log(res, '其他')
  480. navitem.list = navitem.list.concat(res.data.list)
  481. console.log(navitem.list, 'navitem.list')
  482. navitem.page++
  483. if(res.data.list.length == navitem.limit) {
  484. navitem.loadingType = 'more'
  485. }else {
  486. navitem.loadingType = 'noMore'
  487. }
  488. navitem.loaded = true
  489. })
  490. }
  491. }
  492. },
  493. goToDetail(id) {
  494. uni.navigateTo({
  495. url: '/pages/user/article?id=' + id
  496. })
  497. },
  498. navTo(url) {
  499. uni.navigateTo({
  500. url,
  501. fail() {
  502. uni.switchTab({
  503. url
  504. })
  505. }
  506. })
  507. }
  508. }
  509. };
  510. </script>
  511. <style lang="scss">
  512. .dnFile{
  513. width: 100%;
  514. height: 80rpx;
  515. font-size: 28rpx;
  516. text-align: center;
  517. line-height: 80rpx;
  518. }
  519. .Mask {
  520. width: 100%;
  521. height: 100vh;
  522. position: fixed;
  523. z-index: 99999;
  524. background-color: rgba(0, 0, 0, 0.7);
  525. top: 0;
  526. image {
  527. width: 100%;
  528. height: 100vh;
  529. }
  530. }
  531. // 热销商品
  532. .hot-goods {
  533. margin: 0 25rpx;
  534. padding: 5rpx 25rpx 30rpx 25rpx;
  535. background-color: #fff;
  536. border-radius: 10rpx;
  537. .hot-headers {
  538. margin: 25rpx 0;
  539. width: 100%;
  540. display: flex;
  541. .img {
  542. width: 32rpx;
  543. height: 32rpx;
  544. margin-right: 10rpx;
  545. }
  546. .hot-title {
  547. font-size: 30rpx;
  548. margin-right: 15rpx;
  549. }
  550. .more {
  551. line-height: 1;
  552. padding: 5rpx 10rpx 5rpx 15rpx;
  553. text-align: center;
  554. font-size: 20rpx;
  555. border-radius: 15rpx;
  556. color: #ffffff;
  557. background: linear-gradient(90deg, rgba(250, 52, 38, 1) 0%, rgba(249, 30, 83, 1) 100%);
  558. image {
  559. width: 20rpx;
  560. height: 20rpx;
  561. }
  562. }
  563. }
  564. .hot-lists {
  565. line-height: 1;
  566. display: flex;
  567. .hot-produce {
  568. width: 100%;
  569. height: 260rpx;
  570. border-top: 1px solid #f0f0f0;
  571. display: flex;
  572. padding-top: 28rpx;
  573. .produce-image {
  574. width: 200rpx;
  575. height: 200rpx;
  576. image {
  577. width: 200rpx;
  578. height: 200rpx;
  579. border: 1px solid #f0f0f0;
  580. }
  581. }
  582. .produce-content {
  583. // flex-direction: column;
  584. margin-left: 30rpx;
  585. height: 200rpx;
  586. position: relative;
  587. width: calc(100% - 200rpx - 30rpx);
  588. .produce-name {
  589. font-size: 28rpx;
  590. font-weight: bold;
  591. line-height: 35rpx;
  592. color: #343434;
  593. }
  594. .produce-info {
  595. font-size: 20rpx;
  596. margin-top: 25rpx;
  597. }
  598. .produce-price {
  599. display: flex;
  600. align-items: flex-end;
  601. color: #ff383e;
  602. font-size: 24rpx;
  603. margin-top: 70rpx;
  604. font-weight: bold;
  605. text {
  606. font-size: 36rpx;
  607. }
  608. .produce-price-1 {
  609. font-size: 22rpx;
  610. font-weight: 500;
  611. text-decoration: line-through;
  612. color: rgba(170, 170, 170, 1);
  613. margin-left: 20rpx;
  614. }
  615. }
  616. .produce-price1 {
  617. height: 100%;
  618. letter-spacing: 3rpx;
  619. color: #ff383e;
  620. font-size: 24rpx;
  621. font-weight: bold;
  622. .produce-center {
  623. width: 100%;
  624. position: absolute;
  625. bottom: 0;
  626. display: flex;
  627. justify-content: space-between;
  628. align-items: center;
  629. .kanjia_word {
  630. .word-1 {
  631. font-size: 22rpx;
  632. color: #666666;
  633. }
  634. .word-2 {
  635. font-size: 28rpx;
  636. color: #ff383e;
  637. margin-top: 10rpx;
  638. }
  639. }
  640. .kanjia_button {
  641. height: 50rpx;
  642. width: 150rpx;
  643. border-radius: 25rpx;
  644. font-size: 26rpx;
  645. font-weight: 500;
  646. color: #ff383e;
  647. border: 1px solid rgba(255, 56, 62, 1);
  648. }
  649. }
  650. }
  651. }
  652. }
  653. }
  654. }
  655. // .mp-height {
  656. // height: 44px;
  657. // }
  658. // page {
  659. // .cate-section {
  660. // position: relative;
  661. // z-index: 5;
  662. // border-radius: 16rpx 16rpx 0 0;
  663. // margin-top: -20rpx;
  664. // }
  665. // .carousel-section {
  666. // padding: 0;
  667. // .titleNview-placing {
  668. // padding-top: 0;
  669. // height: 0;
  670. // }
  671. // .carousel {
  672. // .carousel-item {
  673. // padding: 0;
  674. // }
  675. // }
  676. // .swiper-dots {
  677. // left: 45rpx;
  678. // bottom: 40rpx;
  679. // }
  680. // }
  681. // }
  682. page {
  683. background: #f7f8f7;
  684. }
  685. .m-t {
  686. margin-top: 16rpx;
  687. }
  688. /* 头部 轮播图 */
  689. .carousel-section {
  690. position: relative;
  691. padding-top: 10px;
  692. overflow: hidden;
  693. .titleNview-placing {
  694. height: var(--status-bar-height);
  695. padding-top: 44px;
  696. box-sizing: content-box;
  697. }
  698. .titleNview-background {
  699. position: absolute;
  700. top: 0;
  701. left: 0;
  702. width: 100%;
  703. height: 426rpx;
  704. transition: 0.4s;
  705. }
  706. .carousel {
  707. width: 100%;
  708. height: 240rpx;
  709. .carousel-item {
  710. width: 100%;
  711. height: 100%;
  712. padding: 0 28rpx;
  713. overflow: hidden;
  714. }
  715. image {
  716. width: 100%;
  717. height: 100%;
  718. border-radius: $border-radius-sm;
  719. }
  720. }
  721. }
  722. .swiper-dots {
  723. display: flex;
  724. position: absolute;
  725. left: 60rpx;
  726. bottom: 15rpx;
  727. width: 72rpx;
  728. height: 36rpx;
  729. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABkCAYAAADDhn8LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTMyIDc5LjE1OTI4NCwgMjAxNi8wNC8xOS0xMzoxMzo0MCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTk4MzlBNjE0NjU1MTFFOUExNjRFQ0I3RTQ0NEExQjMiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTk4MzlBNjA0NjU1MTFFOUExNjRFQ0I3RTQ0NEExQjMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6Q0E3RUNERkE0NjExMTFFOTg5NzI4MTM2Rjg0OUQwOEUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6Q0E3RUNERkI0NjExMTFFOTg5NzI4MTM2Rjg0OUQwOEUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4Gh5BPAAACTUlEQVR42uzcQW7jQAwFUdN306l1uWwNww5kqdsmm6/2MwtVCp8CosQtP9vg/2+/gY+DRAMBgqnjIp2PaCxCLLldpPARRIiFj1yBbMV+cHZh9PURRLQNhY8kgWyL/WDtwujjI8hoE8rKLqb5CDJaRMJHokC6yKgSCR9JAukmokIknCQJpLOIrJFwMsBJELFcKHwM9BFkLBMKFxNcBCHlQ+FhoocgpVwwnv0Xn30QBJGMC0QcaBVJiAMiec/dcwKuL4j1QMsVCXFAJE4s4NQA3K/8Y6DzO4g40P7UcmIBJxbEesCKWBDg8wWxHrAiFgT4fEGsB/CwIhYE+AeBAAdPLOcV8HRmWRDAiQVcO7GcV8CLM8uCAE4sQCDAlHcQ7x+ABQEEAggEEAggEEAggEAAgQACASAQQCCAQACBAAIBBAIIBBAIIBBAIABe4e9iAe/xd7EAJxYgEGDeO4j3EODp/cOCAE4sYMyJ5cwCHs4rCwI4sYBxJ5YzC84rCwKcXxArAuthQYDzC2JF0H49LAhwYUGsCFqvx5EF2T07dMaJBetx4cRyaqFtHJ8EIhK0i8OJBQxcECuCVutxJhCRoE0cZwMRyRcFefa/ffZBVPogePihhyCnbBhcfMFFEFM+DD4m+ghSlgmDkwlOgpAl4+BkkJMgZdk4+EgaSCcpVX7bmY9kgXQQU+1TgE0c+QJZUUz1b2T4SBbIKmJW+3iMj2SBVBWz+leVfCQLpIqYbp8b85EskIxyfIOfK5Sf+wiCRJEsllQ+oqEkQfBxmD8BBgA5hVjXyrBNUQAAAABJRU5ErkJggg==);
  730. background-size: 100% 100%;
  731. .num {
  732. width: 36rpx;
  733. height: 36rpx;
  734. border-radius: 50px;
  735. font-size: 24rpx;
  736. color: #fff;
  737. text-align: center;
  738. line-height: 36rpx;
  739. }
  740. .sign {
  741. position: absolute;
  742. top: 0;
  743. left: 50%;
  744. line-height: 36rpx;
  745. font-size: 12rpx;
  746. color: #fff;
  747. transform: translateX(-50%);
  748. }
  749. }
  750. /* 分类 */
  751. .cate-section {
  752. display: flex;
  753. justify-content: space-around;
  754. align-items: center;
  755. flex-wrap: wrap;
  756. padding: 30rpx 22rpx;
  757. .cate-item {
  758. display: flex;
  759. flex-direction: column;
  760. align-items: center;
  761. font-size: $font-sm + 2rpx;
  762. color: $font-color-dark;
  763. }
  764. /* 原图标颜色太深,不想改图了,所以加了透明度 */
  765. image {
  766. width: 88rpx;
  767. height: 88rpx;
  768. margin-bottom: 14rpx;
  769. border-radius: 50%;
  770. opacity: 0.7;
  771. }
  772. }
  773. // 中间广告图片
  774. .ad-1 {
  775. width: 100%;
  776. height: 210rpx;
  777. padding: 10rpx 0;
  778. background: #fff;
  779. image {
  780. width: 100%;
  781. height: 100%;
  782. }
  783. }
  784. /*公用边框样式*/
  785. %icon {
  786. margin-right: 10rpx;
  787. display: inline-block;
  788. padding: 2rpx 10rpx;
  789. border: 1rpx solid $color-yellow;
  790. color: $color-yellow;
  791. line-height: 1;
  792. font-size: $font-base;
  793. border-radius: 10rpx;
  794. }
  795. .f-header {
  796. display: flex;
  797. align-items: center;
  798. height: 92rpx;
  799. padding: 6rpx 30rpx 8rpx;
  800. image {
  801. flex-shrink: 0;
  802. width: 80rpx;
  803. height: 80rpx;
  804. margin-right: 20rpx;
  805. }
  806. .tit-box {
  807. @extend %font-title-box;
  808. }
  809. .tit {
  810. @extend %font-title;
  811. }
  812. .iconenter {
  813. font-size: $font-lg + 2rpx;
  814. color: $font-color-light;
  815. }
  816. .f-left-icon {
  817. @extend %f-left-icon;
  818. }
  819. .iconfont {
  820. font-size: $font-sm - 2rpx;
  821. }
  822. }
  823. // 会员升级礼包
  824. .uservip {
  825. border-radius: $border-radius-sm;
  826. background-color: white;
  827. box-shadow: $box-shadow;
  828. height: 300rpx;
  829. margin: 0 30rpx;
  830. image {
  831. height: 100%;
  832. width: 300rpx;
  833. }
  834. .detail {
  835. position: relative;
  836. padding: 20rpx;
  837. height: 100%;
  838. .icon {
  839. @extend %icon;
  840. }
  841. .price-box {
  842. position: absolute;
  843. bottom: 20rpx;
  844. width: calc(100% - 40rpx);
  845. .price {
  846. font-size: $font-lg + 2rpx;
  847. font-weight: bold;
  848. color: $font-color-base;
  849. }
  850. .text {
  851. color: $color-gray;
  852. font-size: $font-sm;
  853. }
  854. }
  855. .title {
  856. font-size: $font-lg;
  857. font-weight: bold;
  858. }
  859. }
  860. }
  861. /* 猜你喜欢 */
  862. .guess-section {
  863. display: flex;
  864. flex-wrap: wrap;
  865. padding: 0 30rpx;
  866. .guess-item {
  867. overflow: hidden;
  868. display: flex;
  869. flex-direction: column;
  870. width: 48%;
  871. margin-bottom: 4%;
  872. border-radius: $border-radius-sm;
  873. background-color: white;
  874. box-shadow: $box-shadow;
  875. &:nth-child(2n + 1) {
  876. margin-right: 4%;
  877. }
  878. }
  879. .image-wrapper {
  880. width: 100%;
  881. height: 330rpx;
  882. border-radius: 3px;
  883. overflow: hidden;
  884. image {
  885. width: 100%;
  886. height: 100%;
  887. opacity: 1;
  888. }
  889. }
  890. .title {
  891. font-size: $font-base;
  892. color: $font-color-dark;
  893. font-weight: bold;
  894. line-height: 80rpx;
  895. }
  896. .price {
  897. font-size: $font-lg;
  898. color: $font-color-base;
  899. font-weight: bold;
  900. line-height: 1;
  901. line-height: 80rpx;
  902. }
  903. .icon {
  904. @extend %icon;
  905. }
  906. .detail {
  907. line-height: 1;
  908. }
  909. .tip {
  910. color: white;
  911. background-color: $color-yellow;
  912. line-height: 1.5;
  913. font-size: $font-sm;
  914. padding-left: 20rpx;
  915. }
  916. }
  917. // 推荐
  918. .recommend {
  919. width: 95%;
  920. height: 155rpx;
  921. margin: 0rpx auto;
  922. padding-top: 30rpx;
  923. font-size: 26rpx;
  924. text-align: center;
  925. color: #333333;
  926. align-items: flex-start;
  927. .recommend_list {
  928. width: 33%;
  929. }
  930. .re_title {
  931. font-size: 32rpx;
  932. font-weight: bold;
  933. }
  934. .re_name {
  935. color: #999999;
  936. padding-top: 10rpx;
  937. }
  938. .selected_icon {
  939. width: 25rpx;
  940. height: 10rpx;
  941. margin: 0px auto;
  942. display: none;
  943. image {
  944. width: 100%;
  945. height: 100%;
  946. }
  947. }
  948. .active {
  949. display: block;
  950. }
  951. .active_color {
  952. color: #dc4d46 !important;
  953. }
  954. }
  955. // 列表
  956. .list-box-h {
  957. height: 1550rpx;
  958. }
  959. // 优惠券
  960. .coupon-list {
  961. display: inline-block;
  962. }
  963. .row {
  964. border-radius: 15rpx;
  965. margin: 25rpx;
  966. height: 155rpx;
  967. // width: 552rpx;
  968. overflow: hidden;
  969. background-color: #ffffff;
  970. padding-right: 25rpx;
  971. .list-interval {
  972. border: 1px dashed $border-color-light;
  973. height: 100%;
  974. .top,
  975. .bottom {
  976. border-radius: 100rpx;
  977. width: 30rpx;
  978. height: 30rpx;
  979. position: absolute;
  980. background-color: $page-color-base;
  981. right: -15rpx;
  982. }
  983. .top {
  984. top: -18rpx;
  985. }
  986. .bottom {
  987. bottom: -18rpx;
  988. }
  989. }
  990. .list-money {
  991. height: 100%;
  992. min-width: 155rpx;
  993. text-align: center;
  994. image {
  995. height: 100%;
  996. width: 20rpx;
  997. }
  998. .list-money-text {
  999. flex-grow: 1;
  1000. padding: 0 25rpx;
  1001. .tit {
  1002. text-align: center;
  1003. padding: 15rpx 0rpx;
  1004. font-size: 55rpx;
  1005. color: $color-red;
  1006. font-weight: bold;
  1007. &.noAction {
  1008. color: $font-color-light;
  1009. }
  1010. }
  1011. .price {
  1012. padding-bottom: 25rpx;
  1013. color: $font-color-light;
  1014. }
  1015. }
  1016. }
  1017. .row_list_right {
  1018. // flex-grow: 1;
  1019. min-width: 200rpx;
  1020. padding-left: 25rpx;
  1021. line-height: 1;
  1022. .right_time {
  1023. padding: 10rpx 0rpx;
  1024. color: $font-color-light;
  1025. font-size: $font-sm;
  1026. }
  1027. .right_top {
  1028. margin: 15rpx 0;
  1029. .right_name {
  1030. font-size: $font-base;
  1031. color: #bc253a;
  1032. font-weight: bold;
  1033. }
  1034. .right_title {
  1035. font-size: $font-base;
  1036. color: $font-base;
  1037. font-weight: bold;
  1038. &.noAction {
  1039. color: $font-color-light;
  1040. }
  1041. }
  1042. }
  1043. }
  1044. .right_use {
  1045. margin: 15rpx 0;
  1046. padding: 10rpx;
  1047. width: 160rpx;
  1048. text-align: center;
  1049. color: #fff;
  1050. background-color: #bc253a;
  1051. border-radius: 50rpx;
  1052. font-size: $font-sm;
  1053. &.noAction {
  1054. background-color: $font-color-light;
  1055. }
  1056. }
  1057. .iconlocation {
  1058. font-size: 36rpx;
  1059. color: $font-color-light;
  1060. }
  1061. }
  1062. .navbar {
  1063. display: flex;
  1064. height: 40px;
  1065. padding: 0 5px;
  1066. background: #fff;
  1067. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  1068. position: relative;
  1069. z-index: 10;
  1070. .nav-item {
  1071. flex: 1;
  1072. display: flex;
  1073. justify-content: center;
  1074. align-items: center;
  1075. height: 100%;
  1076. font-size: 15px;
  1077. color: $font-color-dark;
  1078. position: relative;
  1079. &.current {
  1080. color: #000;
  1081. font-weight: bold;
  1082. &:after {
  1083. content: '';
  1084. position: absolute;
  1085. left: 50%;
  1086. bottom: 0;
  1087. transform: translateX(-50%);
  1088. width: 44px;
  1089. height: 0;
  1090. border-bottom: 2px solid #E60012;
  1091. }
  1092. }
  1093. }
  1094. }
  1095. .nav-swiper {
  1096. // background-color: #bfa;
  1097. }
  1098. .top-swiper {
  1099. position: relative;
  1100. .banner-swiper {
  1101. width: 750rpx;
  1102. height: 390rpx;
  1103. .swiper-img {
  1104. display: block;
  1105. width: 750rpx;
  1106. height: 390rpx;
  1107. }
  1108. swiper-item {
  1109. width: 750rpx;
  1110. height: 390rpx;
  1111. }
  1112. }
  1113. .input-box {
  1114. // position: fixed;
  1115. // top: 0;
  1116. // left: 0;
  1117. position: absolute;
  1118. top: 0;
  1119. left: 0;
  1120. width: 100%;
  1121. padding: 25rpx;
  1122. // background-color: #ffffff;
  1123. z-index: 999;
  1124. height: 44px;
  1125. .iconsearch {
  1126. font-size: 50rpx;
  1127. }
  1128. .input-content {
  1129. border-radius: 99rpx;
  1130. flex-grow: 1;
  1131. padding: 10rpx 30rpx;
  1132. background-color: rgba(255, 255, 255, 0.7);
  1133. .input {
  1134. flex-grow: 1;
  1135. input {
  1136. font-size: $font-lg;
  1137. }
  1138. }
  1139. }
  1140. .input-button {
  1141. padding-left: 20rpx;
  1142. font-size: $font-lg;
  1143. height: 100%;
  1144. }
  1145. }
  1146. }
  1147. .zd-wrap {
  1148. width: 750rpx;
  1149. height: 203rpx;
  1150. background: #FFFFFF;
  1151. margin: 20rpx auto;
  1152. padding: 30rpx 28rpx;
  1153. flex-direction: column;
  1154. justify-content: space-between;
  1155. align-items: flex-start;
  1156. .zd-tit {
  1157. font-size: 33rpx;
  1158. }
  1159. .zd-tip {
  1160. color: #FF0018;
  1161. }
  1162. }
  1163. .hot {
  1164. width: 22rpx;
  1165. height: 22rpx;
  1166. margin-right: 10rpx;
  1167. }
  1168. .art-time {
  1169. display: inline-block;
  1170. font-size: 24rpx;
  1171. font-weight: 500;
  1172. color: #7F8699;
  1173. text {
  1174. margin-right: 10rpx;
  1175. }
  1176. }
  1177. .art-tit {
  1178. // font-size: 26rpx;
  1179. font-size: 30rpx;
  1180. }
  1181. .art-list {
  1182. background-color: #fff;
  1183. width: 750rpx;
  1184. font-size: 31rpx;
  1185. font-weight: 500;
  1186. color: #323232;
  1187. // font-weight: bold;
  1188. }
  1189. .art-item {
  1190. width: 691rpx;
  1191. border-bottom: #E1E1E1 1px solid;
  1192. margin: auto;
  1193. }
  1194. .art-item-zero {
  1195. height: 153rpx;
  1196. flex-direction: column;
  1197. justify-content: space-between;
  1198. align-items: flex-start;
  1199. padding: 20rpx 0;
  1200. border-bottom: #E1E1E1 1px solid;
  1201. }
  1202. .art-item-one {
  1203. height: 195rpx;
  1204. margin: auto;
  1205. padding: 30rpx 0 20rpx;
  1206. .art-left {
  1207. height: 100%;
  1208. flex-direction: column;
  1209. justify-content: space-between;
  1210. align-items: flex-start;
  1211. padding-right: 40rpx;
  1212. }
  1213. .art-right {
  1214. width: 227rpx;
  1215. height: 145rpx;
  1216. border-radius: 10rpx;
  1217. flex-shrink: 0;
  1218. image {
  1219. width: 100%;
  1220. height: 100%;
  1221. border-radius: 10rpx;
  1222. }
  1223. }
  1224. }
  1225. .art-item-three {
  1226. height: 345rpx;
  1227. flex-direction: column;
  1228. justify-content: space-between;
  1229. align-items: flex-start;
  1230. padding: 30rpx 0;
  1231. .art-img-list {
  1232. width: 100%;
  1233. height: 145rpx;
  1234. // background-color: #bfa;
  1235. // border-radius: 10px;
  1236. image {
  1237. width: 220rpx;
  1238. height: 145rpx;
  1239. border-radius: 10rpx;
  1240. margin-right: 15rpx;
  1241. &:last-child {
  1242. margin-right: 0;
  1243. }
  1244. }
  1245. }
  1246. }
  1247. // 头部时间段样式
  1248. .class-box {
  1249. white-space: nowrap;
  1250. height: 40px;
  1251. position: relative;
  1252. background-color: #fff;
  1253. .item {
  1254. text-align: center;
  1255. display: inline-block;
  1256. color: $font-color-base;
  1257. height: 100%;
  1258. background-color: #ffffff;
  1259. line-height: 1;
  1260. .status {
  1261. font-size:30rpx;
  1262. margin: 0 auto;
  1263. width: 60px;
  1264. height: 100%;
  1265. line-height: 40px;
  1266. &.action {
  1267. color: #000;
  1268. font-weight: bold;
  1269. position: relative;
  1270. &:after {
  1271. content: '';
  1272. position: absolute;
  1273. left: 50%;
  1274. bottom:5px;
  1275. transform: translateX(-50%);
  1276. width: 33px;
  1277. height: 0;
  1278. border-bottom: 2px solid #E60012;
  1279. }
  1280. }
  1281. }
  1282. }
  1283. }
  1284. .nav {
  1285. height: 78rpx;
  1286. .nav-item {
  1287. height: 100%;
  1288. width: 60rpx;
  1289. .status {
  1290. font-size:30rpx;
  1291. margin: 0 auto;
  1292. width: 60px;
  1293. height: 100%;
  1294. line-height: 78rpx;
  1295. &.action {
  1296. color: #000;
  1297. font-weight: bold;
  1298. position: relative;
  1299. &:after {
  1300. content: '';
  1301. position: absolute;
  1302. left: 50%;
  1303. bottom:5px;
  1304. transform: translateX(-50%);
  1305. width: 33px;
  1306. height: 0;
  1307. border-bottom: 2px solid #E60012;
  1308. }
  1309. }
  1310. }
  1311. }
  1312. }
  1313. </style>