index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945
  1. <template>
  2. <view class="core">
  3. <!-- nav -->
  4. <u-navbar leftIconSize="0" :placeholder="true" bgColor="#ffffff">
  5. <view class="u-nav-slot" slot="left">
  6. <view class="u-nav-slot__input flex">
  7. <u-input v-model="goodsTitle" @confirm="toGoodsList()" confirmType="search" placeholder="搜索商品"
  8. border="none" prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" />
  9. <!-- <view class="u-nav-slot__input__btn" @click="toGoodsList()">搜索</view> -->
  10. </view>
  11. </view>
  12. </u-navbar>
  13. <!-- 固定顶部搜索、分类 -->
  14. <view class="fixed-top">
  15. <view class="fixed-top-classify">
  16. <u-tabs @change="changeClassify" :scrollable="true" :list="classifyList" lineWidth="20" lineHeight="2"
  17. lineColor="#FF8D0B" :activeStyle="{
  18. color: '#333',
  19. transform: 'scale(1.1)'
  20. }" :inactiveStyle="{
  21. color: '#999',
  22. transform: 'scale(1.1)'
  23. }" itemStyle="padding-left: 15px; padding-right: 15px; height: 44px; text-align: center;">
  24. </u-tabs>
  25. </view>
  26. <!-- 盲豆筛选 -->
  27. <view class="fixed-top-screen" v-if="scrollTop > 50">
  28. <view class="fixed-top-screen-content flex">
  29. <view class="fixed-top-screen-content__item flex">
  30. <view class="title">我的盲豆:</view>
  31. <view class="num">{{ initData.coinNum ? `${ initData.coinNum }` : '--' }}</view>
  32. </view>
  33. <view class="fixed-top-screen-content__item flex" @click="changeScreen(1)">
  34. <view class="title">盲豆价格</view>
  35. <view class="select flex" v-if="screenIndex == 1">
  36. <image src="../../static/core/core_up.png" mode="scaleToFill" v-if="priceShow" />
  37. <image src="../../static/core/core_down.png" mode="scaleToFill" v-else />
  38. </view>
  39. <view class="select flex" v-else>
  40. <image src="../../static/core/core_null.png" mode="scaleToFill" />
  41. </view>
  42. </view>
  43. <view class="fixed-top-screen-content__item flex" @click="changeScreen(2)">
  44. <view class="title" v-if="!coinActionInfo.min && !coinActionInfo.max">盲豆区间</view>
  45. <view class="title flex" v-else>
  46. <view v-if="coinActionInfo.min">{{ coinActionInfo.min }}</view>
  47. <view v-if="coinActionInfo.max">-{{ coinActionInfo.max }}</view>
  48. <view>{{ coinActionInfo.desc }}</view>
  49. </view>
  50. <u-icon name="arrow-up" size="13" color="#fff" v-if="screenShow"></u-icon>
  51. <u-icon name="arrow-down" size="13" color="#fff" v-else></u-icon>
  52. </view>
  53. <view class="fixed-top-screen-content__coin" v-if="screenShow">
  54. <view class="fixed-top-screen-content__coin__list">
  55. <view class="item flex" :class="{ 'action': coinActionIndex == index }"
  56. v-for="(item, index) in coinList" :key="index" @click="selectCoin(item, index)">
  57. <text v-if="item.min">{{ item.min }}</text>
  58. <text v-if="item.max">-{{ item.max }}</text>
  59. <text>{{ item.desc }}</text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="core-none"></view>
  67. <!-- 轮播 -->
  68. <view class="core-swiper" v-if="swiperList.length">
  69. <swiper class="core-swiper-centent" circular :indicator-dots="true" :autoplay="true" :interval="3000"
  70. indicator-active-color="#fff">
  71. <swiper-item class="swiper-item" v-for="(item, index) in swiperList" :key="index">
  72. <image :src="item.picUrl" mode="scaleToFill" @click="toPage(item)"></image>
  73. </swiper-item>
  74. </swiper>
  75. </view>
  76. <!-- 二级分类 -->
  77. <view class="core-category">
  78. <swiper class="core-category-swiper" :autoplay="false">
  79. <swiper-item class="swiper-item"
  80. v-for="(item, index) in classifyIndex == 0 ? classifyListFilter : classifyList[classifyIndex].list"
  81. :key="index">
  82. <view class="swiper-item-wrap">
  83. <view class="swiper-item-wrap__content" v-for="(items, indexs) in item" :key="indexs">
  84. <image :src="items.picUrl" mode="aspectFit" @click="toCategoryGoods(index, indexs)"></image>
  85. <view class="name">{{ items.name }}</view>
  86. </view>
  87. </view>
  88. </swiper-item>
  89. </swiper>
  90. </view>
  91. <!-- 标签商品 -->
  92. <view class="tag-goods" v-for="(item, index) in exclusiveSingle" :key="index">
  93. <image class="tag-goods-imgBg" src="../../static/core/core_bg.png" mode="scaleToFill"></image>
  94. <view class="tag-goods-content">
  95. <view class="tag-goods-content-nav flex">
  96. <view class="tag-goods-content-nav__left flex">
  97. <image src="../../static/core/core_tag.png" mode="scaleToFill"></image>
  98. <view class="title">{{ item.name }}</view>
  99. <image src="../../static/core/core_tag.png" mode="scaleToFill"></image>
  100. </view>
  101. <view class="tag-goods-content-nav__right flex" @click="toTagGoods(item)">
  102. <view class="title">更多</view>
  103. <image src="../../static/core/core_right.png" mode="scaleToFill"></image>
  104. </view>
  105. </view>
  106. <view class="tag-goods-content-list">
  107. <view class="tag-goods-content-list-item flex" v-for="(items, indexs) in item.data" :key="indexs"
  108. @click="toGoodsDetail(items)">
  109. <view class="image flex">
  110. <image :src="items.picUrl" mode="aspectFit"></image>
  111. </view>
  112. <view class="title">{{ items.exchangePrice }}盲豆</view>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <!-- 商品列表 -->
  118. <view class="core-goods">
  119. <view class="core-goods-list flex">
  120. <view class="core-goods-list-item flex" v-for="(item, index) in list" :key="index"
  121. @click="toGoodsDetail(item)">
  122. <view class="image-wrap flex">
  123. <image :src="item.picUrl" mode="aspectFit"></image>
  124. </view>
  125. <view class="content">
  126. <!-- #ifdef MP-ALIPAY -->
  127. <view class="content-titletwo">{{ item.title }}</view>
  128. <!-- #endif -->
  129. <!-- #ifndef MP-ALIPAY -->
  130. <view class="content-title ells-one">{{ item.title }}</view>
  131. <!-- #endif -->
  132. <view class="content-coin flex">
  133. <view class="content-coin__left flex">
  134. <image src="../../static/public/goods_coin.png" mode="scaleToFill"></image>
  135. <view class="num"><text>×</text>{{ item.exchangePrice }}</view>
  136. </view>
  137. <view class="content-coin__right" v-if="item.originPrice">{{ item.originPrice }}</view>
  138. </view>
  139. <view class="content-price">¥{{ $numberFormat(item.value) }}</view>
  140. </view>
  141. </view>
  142. <!-- <view class="core-goods-list-item"></view> -->
  143. <view class=""></view>
  144. </view>
  145. <view class="flex empty" v-if="!list.length">
  146. <view class="center">
  147. <image class="center-img"
  148. src="https://mp-public-1310078123.cos.ap-shanghai.myqcloud.com/v2/nodata_3.png"
  149. mode="scaleToFill"></image>
  150. <view class="center-font">还没有商品</view>
  151. </view>
  152. </view>
  153. <u-loadmore :line="true" v-if="list.length" :status="status" :loading-text="'努力加载中'"
  154. :nomore-text="'已经到底了'" />
  155. </view>
  156. <custom-tab-bar :activeValue="'core'" />
  157. </view>
  158. </template>
  159. <script>
  160. import env from '../../config/env.js'
  161. import $http from '@/utils/request.js'
  162. import appId from '@/config/appId.js'
  163. import CustomTabBar from '../../components/custom-tab-bar/custom-tab-bar.vue'
  164. export default {
  165. components: {
  166. CustomTabBar,
  167. },
  168. data() {
  169. return {
  170. status: 'nomore', //上拉刷新状态
  171. pageNum: 1,
  172. total: 0,
  173. list: [],
  174. exclusiveSingle: [],
  175. categoryId: '',
  176. classifyList: [], // 分类列表
  177. classifyIndex: 0, // 分类选中下标
  178. classifyListFilter: [],
  179. swiperList: [], // 轮播图
  180. goodsTitle: '',
  181. scrollTop: 0,
  182. screenIndex: 0,
  183. priceShow: false,
  184. priceSort: null,
  185. priceStep: 0,
  186. screenShow: false,
  187. initData: {},
  188. coinNum: {
  189. startPrice: null,
  190. endPrice: null
  191. },
  192. coinActionIndex: 0,
  193. coinActionInfo: {},
  194. coinList: [{
  195. min: null,
  196. max: null,
  197. desc: '全部'
  198. },
  199. {
  200. min: 1,
  201. max: 100,
  202. desc: ''
  203. },
  204. {
  205. min: 101,
  206. max: 200,
  207. desc: ''
  208. },
  209. {
  210. min: 201,
  211. max: 500,
  212. desc: ''
  213. },
  214. {
  215. min: 501,
  216. max: 1000,
  217. desc: ''
  218. },
  219. {
  220. min: 1001,
  221. max: 5000,
  222. desc: ''
  223. },
  224. {
  225. min: 5000,
  226. max: null,
  227. desc: '以上'
  228. },
  229. ],
  230. userInfo: '',
  231. loginState: '',
  232. };
  233. },
  234. onLoad(opthios) {
  235. if (opthios.userId) {
  236. uni.setStorageSync('shareUid', opthios.userId != 'undefined' ? opthios.userId : null)
  237. if (opthios.userId === undefined || opthios.userId === 'undefined') {
  238. uni.getSystemInfo({
  239. success(res) {
  240. log.error(
  241. `基础库:${ res.SDKVersion },设备:${ res.model }-${ res.system },页面:/pages/core/index.vue.`
  242. )
  243. }
  244. })
  245. }
  246. }
  247. if (opthios.type) {
  248. uni.setStorageSync('shareType', opthios.type)
  249. }
  250. this.pageList()
  251. this.getExclusive()
  252. this.getClassify()
  253. this.getSwiper()
  254. },
  255. onShow() {
  256. this.loginState = uni.getStorageSync('token') ? true : false
  257. if (this.loginState) {
  258. this.getBean()
  259. this.getBaseInfo()
  260. }
  261. },
  262. onPageScroll: function(e) {
  263. this.scrollTop = e.scrollTop
  264. },
  265. methods: {
  266. pageList() {
  267. this.pageNum = 1
  268. this.total = 0
  269. this.list = []
  270. this.getList()
  271. },
  272. // 获取分类
  273. getClassify() {
  274. $http.post('/api/v1/mp/user/exchange/category/listTree', {}).then(res => {
  275. if (res.code == 0) {
  276. let interval = 10
  277. this.classifyList = res && res.rows
  278. this.classifyList.forEach(item => {
  279. item.picUrl = env.filePublic + item.picUrl.split(',')[0] +
  280. '?imageView2/2/w/340'
  281. item.goodsCategoryList.forEach(ele => {
  282. ele.picUrl = env.filePublic + ele.picUrl.split(',')[0] +
  283. '?imageView2/2/w/340'
  284. })
  285. item.list = []
  286. if (item.goodsCategoryList.length > interval) {
  287. let num = Math.ceil(item.goodsCategoryList.length / interval)
  288. let arr = []
  289. let a = 0
  290. let stop = interval
  291. for (let i = 1; i <= num; i++) {
  292. arr = item.goodsCategoryList.slice(a, stop)
  293. a = i * interval
  294. stop = stop + interval
  295. }
  296. } else {
  297. item.list.push(item.goodsCategoryList)
  298. }
  299. })
  300. if (this.classifyList.length > interval) {
  301. let num = Math.ceil(this.classifyList.length / interval)
  302. let arr = []
  303. let a = 0
  304. let stop = interval
  305. for (let i = 1; i <= num; i++) {
  306. arr = this.classifyList.slice(a, stop)
  307. a = i * interval
  308. stop = stop + interval
  309. this.classifyListFilter.push(arr)
  310. }
  311. } else {
  312. this.classifyListFilter = [
  313. [...this.classifyList]
  314. ]
  315. }
  316. this.classifyList.unshift({ name: '全部', categoryId: '' })
  317. }
  318. })
  319. },
  320. //轮播图
  321. getSwiper() {
  322. $http.post(`/api/v1/mp/user/exchange/banner/list`, {
  323. noToken: true,
  324. location: "top"
  325. }).then(res => {
  326. res.data.forEach(item => item.picUrl = env.filePublic + item.picUrl.split(',')[0])
  327. this.swiperList = res.data
  328. })
  329. },
  330. // 标签商品
  331. async getExclusive() {
  332. let resData = await $http.post(`/api/v1/mp/user/exchange/activity/list`, {
  333. noToken: true
  334. })
  335. let goodsList = []
  336. for (let item of resData.data) {
  337. let resDatas = await $http.post(`/api/v1/mp/user/exchange/goods/list?pageNum=1&pageSize=10`, {
  338. noToken: true,
  339. tagIds: item.tagId
  340. })
  341. goodsList.push({
  342. data: resDatas.rows,
  343. name: item.name,
  344. tagId: item.tagId
  345. })
  346. }
  347. goodsList.forEach(item => {
  348. item.data.forEach(items => {
  349. items.picUrl = env.filePublic + items.picUrl.split(',')[0] +
  350. '?imageView2/2/w/340'
  351. })
  352. })
  353. this.exclusiveSingle = goodsList
  354. },
  355. // 商品列表
  356. getList() {
  357. uni.showLoading({
  358. title: '加载中'
  359. });
  360. let data = {
  361. categoryId: this.categoryId,
  362. priceSort: this.priceSort,
  363. ...this.coinNum,
  364. noToken: true
  365. }
  366. $http.post(`/api/v1/mp/user/exchange/goods/list?pageNum=${this.pageNum}&pageSize=20`, data).then(
  367. res => {
  368. uni.hideLoading();
  369. if (res.code == 0) {
  370. res.rows.forEach(item => {
  371. let picUrlArr = item.picUrl.split(',')
  372. item.picUrl = env.filePublic + picUrlArr[0] + '?imageView2/2/w/340'
  373. })
  374. this.total = res.total
  375. this.list = this.list.concat(res.rows)
  376. }
  377. }).catch(() => {
  378. uni.hideLoading();
  379. })
  380. },
  381. getBean() {
  382. uni.showLoading({
  383. title: '加载中'
  384. });
  385. $http.post('/api/v1/mp/user/mine/init', {}).then(res => {
  386. uni.hideLoading();
  387. if (res.code == 0) {
  388. this.initData = res.data
  389. }
  390. }).catch(() => {
  391. uni.hideLoading();
  392. })
  393. },
  394. // 切换分类
  395. changeClassify(e) {
  396. this.categoryId = e.categoryId
  397. this.classifyIndex = e.index
  398. this.screenIndex = 0
  399. this.priceStep = 0
  400. this.priceShow = false
  401. this.priceSort = null
  402. this.coinActionIndex = 0
  403. this.screenShow = false
  404. this.coinNum.endPrice = null
  405. this.coinNum.startPrice = null
  406. this.coinActionInfo = {}
  407. this.pageList()
  408. },
  409. // 盲豆筛选切换
  410. changeScreen(num) {
  411. this.screenIndex = num
  412. if (num == 1) {
  413. if (this.priceStep == 0) {
  414. this.priceStep++
  415. this.priceShow = true
  416. this.priceSort = 1
  417. } else if (this.priceStep == 1) {
  418. this.priceStep++
  419. this.priceShow = false
  420. this.priceSort = 2
  421. } else if (this.priceStep == 2) {
  422. this.priceStep = 0
  423. this.priceShow = false
  424. this.priceSort = null
  425. this.screenIndex = 0
  426. }
  427. this.pageList()
  428. } else if (num == 2) {
  429. this.priceStep = 0
  430. this.screenShow = !this.screenShow
  431. this.priceShow = false
  432. this.priceSort = null
  433. }
  434. },
  435. selectCoin(item, index) {
  436. this.coinActionIndex = index
  437. this.coinActionInfo = item
  438. this.screenShow = !this.screenShow
  439. this.coinNum.endPrice = item.max
  440. this.coinNum.startPrice = item.min
  441. this.pageList()
  442. },
  443. // 跳转点击事件
  444. toPage(item) {
  445. if (item.type == "link") {
  446. uni.navigateTo({
  447. url: `/packageOperate/webview/index?linkUrl=${ item.linkUrl }`,
  448. })
  449. } else if (item.type == "tag") {
  450. uni.navigateTo({
  451. url: `/packageGoods/goods/list?name=${ item.name }&tagIds=${ item.goodsTags ? item.goodsTags : '' }`
  452. })
  453. }
  454. },
  455. // 商品详情
  456. toGoodsDetail(item) {
  457. uni.navigateTo({
  458. url: `/packageGoods/goods/detail?id=${ item.goodsId }`
  459. })
  460. },
  461. // 商品列表
  462. toGoodsList() {
  463. uni.navigateTo({
  464. url: `/packageGoods/goods/list?title=${ this.goodsTitle }`
  465. })
  466. },
  467. // 商品标签
  468. toTagGoods(item) {
  469. uni.navigateTo({
  470. url: `/packageGoods/goods/list?name=${ item.name }&tagIds=${ item.tagId ? item.tagId : '' }`
  471. })
  472. },
  473. // 商品分类
  474. toCategoryGoods(index, indexs) {
  475. let list = this.classifyIndex == 0 ? this.classifyListFilter : this.classifyList[this.classifyIndex].list
  476. let item = list[index][indexs]
  477. uni.navigateTo({
  478. url: `/packageGoods/goods/list?name=${ item.name }&categoryId=${ item.categoryId ? item.categoryId : '' }`
  479. })
  480. },
  481. getBaseInfo() {
  482. $http.post('/api/v1/mp/user/getLoginUserinfo', { appSource: appId }).then(res => {
  483. uni.hideLoading();
  484. if (res.code == 0) {
  485. this.userInfo = res.data
  486. }
  487. })
  488. },
  489. },
  490. onReachBottom() {
  491. // 判断是否有数据
  492. if (this.total < this.pageNum * 20) return;
  493. this.status = 'loading';
  494. ++this.pageNum
  495. if (this.total < this.pageNum * 20) this.status = 'nomore';
  496. else this.status = 'loading';
  497. this.getList()
  498. },
  499. //分享好友
  500. onShareAppMessage(res) {
  501. return {
  502. title: '盲票,玩的就是有趣',
  503. path: '/pages/index/index',
  504. }
  505. },
  506. //分享朋友圈
  507. onShareTimeline() {
  508. return {
  509. title: '盲票,玩的就是有趣',
  510. query: `userId=${ this.userInfo.userId?this.userInfo.userId:null }&type=1`
  511. }
  512. }
  513. }
  514. </script>
  515. <style lang="scss" scoped>
  516. .core {
  517. background-color: #fff;
  518. &-none {
  519. height: 120rpx;
  520. }
  521. }
  522. // 搜索
  523. .u-nav-slot {
  524. text {
  525. font-size: 32rpx;
  526. }
  527. &__input {
  528. position: relative;
  529. height: 70rpx;
  530. width: 518rpx;
  531. padding-left: 30rpx;
  532. background: #F4F5F6;
  533. border-radius: 35rpx;
  534. padding-right: 30rpx;
  535. &__btn {
  536. z-index: 200;
  537. width: 140rpx;
  538. height: 70rpx;
  539. line-height: 70rpx;
  540. font-size: 30rpx;
  541. text-align: center;
  542. font-weight: bold;
  543. color: #fff;
  544. background-color: #FF8D0B;
  545. border-radius: 35rpx;
  546. }
  547. }
  548. }
  549. // 固定搜索、分类
  550. .fixed-top {
  551. position: fixed;
  552. z-index: 100;
  553. width: 100%;
  554. background-color: #fff;
  555. // 搜索
  556. &-search {
  557. justify-content: space-between;
  558. padding: 14rpx 30rpx 34rpx;
  559. &__input {
  560. position: relative;
  561. flex: 1;
  562. height: 84rpx;
  563. padding-left: 46rpx;
  564. background: #F4F5F6;
  565. border-radius: 20rpx;
  566. &__btn {
  567. position: absolute;
  568. right: 0;
  569. width: 110rpx;
  570. height: 76rpx;
  571. line-height: 76rpx;
  572. font-size: 34rpx;
  573. text-align: center;
  574. font-weight: bold;
  575. color: #FFC062;
  576. background-color: #333333;
  577. border-radius: 18rpx;
  578. }
  579. }
  580. image {
  581. width: 52rpx;
  582. height: 52rpx;
  583. margin-left: 50rpx;
  584. }
  585. }
  586. // 分类
  587. &-classify {
  588. padding-bottom: 20rpx;
  589. }
  590. // 盲豆筛选
  591. &-screen {
  592. height: 64rpx;
  593. &-content {
  594. position: relative;
  595. justify-content: space-between;
  596. padding: 0 34rpx;
  597. color: #fff;
  598. height: 100%;
  599. background: #F9822C;
  600. &__item {
  601. .title {
  602. margin-right: 14rpx;
  603. }
  604. .select {
  605. flex-direction: column;
  606. image {
  607. width: 18rpx;
  608. height: 26rpx;
  609. }
  610. }
  611. }
  612. &__coin {
  613. position: absolute;
  614. right: 0;
  615. bottom: -390rpx;
  616. width: 200rpx;
  617. height: 390rpx;
  618. background: #FFFFFF;
  619. box-shadow: 0px 0px 2px 0px rgba(100, 100, 100, 0.1);
  620. &__list {
  621. padding-top: 20rpx;
  622. color: #666;
  623. .item {
  624. margin-bottom: 30rpx;
  625. font-size: 26rpx;
  626. line-height: 26rpx;
  627. }
  628. .action {
  629. color: #F9822C;
  630. }
  631. }
  632. }
  633. }
  634. }
  635. }
  636. // 轮播
  637. .core-swiper {
  638. margin: 0 34rpx 20rpx;
  639. border-radius: 16rpx;
  640. &-centent {
  641. height: 300rpx;
  642. .swiper-item {
  643. width: 100%;
  644. height: 100%;
  645. image {
  646. width: 100%;
  647. height: 100%;
  648. border-radius: 16rpx;
  649. }
  650. }
  651. }
  652. }
  653. // 二级分类
  654. .core-category {
  655. width: 100%;
  656. height: 360rpx;
  657. margin-bottom: 34rpx;
  658. padding: 0 34rpx;
  659. &-swiper {
  660. width: 100%;
  661. height: 360rpx;
  662. .swiper-item {
  663. width: 100%;
  664. height: 360rpx;
  665. &-wrap {
  666. width: 100%;
  667. height: 100%;
  668. display: flex;
  669. flex-wrap: wrap;
  670. &__content {
  671. display: flex;
  672. align-items: center;
  673. flex-direction: column;
  674. justify-content: space-between;
  675. width: 20%;
  676. height: 50%;
  677. image {
  678. width: 90%;
  679. height: 70%;
  680. }
  681. }
  682. }
  683. }
  684. }
  685. }
  686. // 标签商品
  687. .tag-goods {
  688. display: flex;
  689. align-items: center;
  690. position: relative;
  691. margin: 0 34rpx 34rpx;
  692. height: 350rpx;
  693. &-imgBg {
  694. position: absolute;
  695. top: 0;
  696. width: 100%;
  697. height: 350rpx;
  698. }
  699. &-content {
  700. width: 100%;
  701. position: absolute;
  702. top: 0;
  703. z-index: 5;
  704. padding: 26rpx 22rpx;
  705. &-nav {
  706. justify-content: space-between;
  707. height: 40rpx;
  708. margin-bottom: 10rpx;
  709. &__left {
  710. image {
  711. width: 40rpx;
  712. height: 30rpx;
  713. }
  714. .title {
  715. font-family: YouSheBiaoTiHei;
  716. font-weight: 400;
  717. font-size: 40rpx;
  718. color: #FFFFFF;
  719. padding: 0 36rpx;
  720. }
  721. }
  722. &__right {
  723. .title {
  724. font-family: YouSheBiaoTiHei;
  725. font-weight: 400;
  726. color: #FFFFFF;
  727. margin-right: 12rpx;
  728. }
  729. image {
  730. width: 22rpx;
  731. height: 20rpx;
  732. }
  733. }
  734. }
  735. &-list {
  736. display: flex;
  737. height: 260rpx;
  738. overflow-x: auto;
  739. &-item {
  740. flex-direction: column;
  741. margin-right: 14rpx;
  742. .image {
  743. width: 180rpx;
  744. height: 180rpx;
  745. background: #FFFFFF;
  746. box-shadow: 0px 0px 4px 0px rgba(100, 100, 100, 0.13);
  747. border-radius: 4rpx;
  748. margin-bottom: 24rpx;
  749. image {
  750. width: 100%;
  751. height: 100%;
  752. }
  753. }
  754. .title {
  755. text-align: center;
  756. line-height: 28rpx;
  757. color: #FFFFFF;
  758. }
  759. }
  760. }
  761. }
  762. }
  763. // 商品列表
  764. .core-goods {
  765. padding: 0 34rpx;
  766. &-list {
  767. width: 100%;
  768. justify-content: space-between;
  769. flex-wrap: wrap;
  770. &-item {
  771. flex-direction: column;
  772. justify-content: flex-start;
  773. width: 48%;
  774. padding-bottom: 32rpx;
  775. background: #FFFFFF;
  776. box-shadow: 0px 0px 3px 0px rgba(100, 100, 100, 0.1);
  777. border-radius: 16rpx;
  778. margin-bottom: 30rpx;
  779. .image-wrap {
  780. width: 100%;
  781. height: 320rpx;
  782. margin-bottom: 16rpx;
  783. image {
  784. width: 100%;
  785. height: 100%;
  786. border-radius: 16rpx 16rpx 0 0;
  787. }
  788. }
  789. .content {
  790. width: 100%;
  791. padding: 0 22rpx;
  792. &-title {
  793. height: 28rpx;
  794. font-size: 28rpx;
  795. line-height: 28rpx;
  796. font-weight: bold;
  797. overflow: hidden;
  798. }
  799. &-titletwo {
  800. height: 34rpx;
  801. font-size: 28rpx;
  802. line-height: 34rpx;
  803. font-weight: bold;
  804. white-space: nowrap;
  805. overflow: hidden;
  806. text-overflow: ellipsis;
  807. }
  808. &-coin {
  809. height: 34rpx;
  810. font-size: 24rpx;
  811. justify-content: space-between;
  812. margin-top: 30rpx;
  813. margin-bottom: 24rpx;
  814. &__left {
  815. margin-right: 24rpx;
  816. font-size: 28rpx;
  817. font-weight: bold;
  818. text {
  819. font-weight: normal;
  820. }
  821. image {
  822. width: 34rpx;
  823. height: 34rpx;
  824. }
  825. }
  826. &__right {
  827. color: #666666;
  828. text-decoration: line-through;
  829. }
  830. }
  831. &-price {
  832. font-size: 24rpx;
  833. line-height: 24rpx;
  834. color: #666666;
  835. }
  836. }
  837. }
  838. }
  839. .empty {
  840. .center {
  841. text-align: center;
  842. &-img {
  843. width: 228rpx;
  844. height: 320rpx;
  845. }
  846. &-font {
  847. font-size: 30rpx;
  848. font-weight: 400;
  849. color: #999999;
  850. margin-bottom: 200rpx;
  851. }
  852. }
  853. }
  854. }
  855. </style>