index.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187
  1. <template>
  2. <view>
  3. <view class="page-index" :class="{'bgf':navIndex >0}">
  4. <!-- #ifdef H5 -->
  5. <view class="header">
  6. <view class="serch-wrapper flex">
  7. <view class="logo">
  8. <image :src="logoUrl" mode="" />
  9. </view>
  10. <navigator url="/pages/goods_search/index" class="input" hover-class="none">
  11. <text class="iconfont icon-xiazai5" /> 搜索商品
  12. </navigator>
  13. </view>
  14. </view>
  15. <!-- #endif -->
  16. <!-- #ifdef MP -->
  17. <view class="mp-header">
  18. <view class="sys-head" :style="{ height: statusBarHeight }"></view>
  19. <view class="serch-box" style="height: 40px;">
  20. <view class="serch-wrapper flex">
  21. <view class="logo">
  22. <image :src="logoUrl" mode=""></image>
  23. </view>
  24. <navigator url="/pages/goods_search/index" class="input" hover-class="none"><text
  25. class="iconfont icon-xiazai5"></text>
  26. 搜索商品</navigator>
  27. </view>
  28. </view>
  29. </view>
  30. <!-- #endif -->
  31. <!-- 首页展示 -->
  32. <view class="page_content" :style="'margin-top:'+(marTop)+'px;'" v-if="navIndex === 0">
  33. <view class="mp-bg"></view>
  34. <!-- banner 轮播图 -->
  35. <view class="swiper" v-if="slideShows.length">
  36. <swiper indicator-dots="true" :autoplay="true" :circular="circular" :interval="interval"
  37. :duration="duration" indicator-color="rgba(255,255,255,0.6)" indicator-active-color="#fff">
  38. <block v-for="(item,index) in slideShows" :key="index">
  39. <swiper-item>
  40. <navigator :url='item.url' class='slide-navigator acea-row row-between-wrapper'
  41. hover-class='none'>
  42. <image :src="item.picUrl" class="slide-image" lazy-load></image>
  43. </navigator>
  44. </swiper-item>
  45. </block>
  46. </swiper>
  47. </view>
  48. <!-- 新闻简报 -->
  49. <view class='notice acea-row row-middle row-between' v-if="scrollingNews.length">
  50. <view class="pic">
  51. <image src="/static/images/xinjian.png" />
  52. </view>
  53. <text class='line'>|</text>
  54. <view class='swipers'>
  55. <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500"
  56. vertical="true" circular="true">
  57. <block v-for="(item,index) in scrollingNews" :key='index'>
  58. <swiper-item>
  59. <navigator class='item' :url='item.url' hover-class='none'>
  60. <view class='line1'>{{ item.name }}</view>
  61. </navigator>
  62. </swiper-item>
  63. </block>
  64. </swiper>
  65. </view>
  66. <view class="iconfont icon-xiangyou" />
  67. </view>
  68. <!-- menu 菜单 -->
  69. <view class='nav acea-row' v-if="menus.length">
  70. <block v-for="(item,index) in menus" :key="index">
  71. <navigator class='item' v-if="item.show === '1'" :url='item.url' open-type='switchTab'
  72. hover-class='none'>
  73. <view class='pictrue'>
  74. <image :src='item.picUrl'></image>
  75. </view>
  76. <view class="menu-txt">{{item.name}}</view>
  77. </navigator>
  78. <navigator class='item' v-else :url='item.url' hover-class='none'>
  79. <view class='pictrue'>
  80. <image :src='item.picUrl'></image>
  81. </view>
  82. <view class="menu-txt">{{item.name}}</view>
  83. </navigator>
  84. </block>
  85. </view>
  86. <!-- 优惠券 -->
  87. <view class="couponIndex" v-if="couponList.length>0">
  88. <view class="acea-row" style="height: 100%;">
  89. <view class="titBox">
  90. <view class="tit1">领取优惠券</view>
  91. <view class="tit2">福利大礼包,省了又省</view>
  92. <navigator class='item' url='/pages/users/user_get_coupon/index' hover-class='none'>
  93. <view class="tit3">查看全部 <text class="iconfont icon-xiangyou"></text></view>
  94. </navigator>
  95. </view>
  96. <view class="listBox acea-row">
  97. <view class="list" :class='item.canTake ? "listActive" : "listHui"'
  98. v-for="(item, index) in couponList" :key="index">
  99. <view class="tit line1" :class='item.canTake ? "titActive" : "pricehui"'>{{ item.name }}</view>
  100. <view class="price" :class='item.canTake ? "icon-color" : "pricehui"'>
  101. <text v-if="item.discountType === 1">{{ fen2yuan(item.discountPrice) }} 元</text>
  102. <text v-else>{{ (item.discountPercent / 10.0).toFixed(1) }} 折</text>
  103. </view>
  104. <view class="ling icon-color" v-if="item.canTake"
  105. @click="getCoupon(item.id,index)">领取</view>
  106. <view class="ling pricehui fonthui" v-else>已领取</view>
  107. <view class="priceM">满{{ fen2yuan(item.usePrice) }}元可用</view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. <!-- 营销活动 -->
  113. <a_seckill />
  114. <b_combination />
  115. <c_bargain />
  116. <!-- 首页推荐 -->
  117. <view class="sticky-box" :style="'top:'+(marTop)+'px;'">
  118. <scroll-view class="scroll-view_H" style="width: 100%;" scroll-x="true" scroll-with-animation
  119. :scroll-left="tabsScrollLeft" @scroll="scroll">
  120. <view class="tab nav-bd" id="tab_list">
  121. <view id="tab_item" :class="{ 'active': listActive === index}" class="item"
  122. v-for="(item, index) in productRecommends" :key="index" @click="ProductNavTab(item,index)">
  123. <view class="txt">{{item.name}}</view>
  124. <view class="label">{{item.tag}}</view>
  125. </view>
  126. </view>
  127. </scroll-view>
  128. </view>
  129. <!-- 首发新品 -->
  130. <view class="index-product-wrapper" :class="iSshowH?'on':''">
  131. <view class="list-box animated" :class='tempArr.length > 0?"fadeIn on":""'>
  132. <view class="item" v-for="(item,index) in tempArr" :key="index" @click="goDetail(item)">
  133. <view class="pictrue">
  134. <span class="pictrue_log pictrue_log_class"
  135. v-if="item.activityList && item.activityList[0] && item.activityList[0].type === 1">秒杀</span>
  136. <span class="pictrue_log pictrue_log_class"
  137. v-if="item.activityList && item.activityList[0] && item.activityList[0].type === 2">砍价</span>
  138. <span class="pictrue_log pictrue_log_class"
  139. v-if="item.activityList && item.activityList[0] && item.activityList[0].type === 3">拼团</span>
  140. <image :src="item.picUrl" mode="" />
  141. </view>
  142. <view class="text-info">
  143. <view class="title line1">{{ item.name }}</view>
  144. <view class="old-price"><text>¥{{ fen2yuan(item.marketPrice) }}</text></view>
  145. <view class="price">
  146. <text>¥</text>{{ fen2yuan(item.price) }}
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. <view class='loadingicon acea-row row-center-wrapper' v-if="goodScroll">
  152. <text class='loading iconfont icon-jiazai' :hidden='!loading' />
  153. </view>
  154. <view class="mores-txt flex" v-if="!goodScroll">
  155. <text>我是有底线的</text>
  156. </view>
  157. </view>
  158. </view>
  159. </view>
  160. </view>
  161. </template>
  162. <script>
  163. import Cache from '../../utils/cache';
  164. const statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
  165. let app = getApp();
  166. import a_seckill from './components/a_seckill';
  167. import b_combination from './components/b_combination';
  168. import c_bargain from './components/c_bargain';
  169. import goodList from '@/components/goodList';
  170. import { goShopDetail } from '@/libs/order.js'
  171. import { mapGetters } from "vuex";
  172. import countDown from '@/components/countDown';
  173. import recommend from '@/components/recommend';
  174. import { silenceBindingSpread } from '@/utils';
  175. import Loading from '@/components/Loading/index.vue';
  176. import * as ProductSpuApi from '@/api/product/spu.js';
  177. import * as PromotionActivityApi from '@/api/promotion/activity.js';
  178. import * as CouponApi from '@/api/promotion/coupon.js';
  179. import * as DecorateApi from '@/api/promotion/decorate.js';
  180. import * as ProductUtil from '@/utils/product.js';
  181. import * as Util from '@/utils/util.js';
  182. export default {
  183. computed: mapGetters(['isLogin', 'uid']),
  184. components: {
  185. goodList,
  186. countDown,
  187. a_seckill,
  188. b_combination,
  189. c_bargain,
  190. recommend,
  191. Loading
  192. },
  193. data() {
  194. return {
  195. statusBarHeight: statusBarHeight,
  196. navIndex: 0,
  197. navTop: [],
  198. marTop: 0,
  199. configApi: {}, // 分享类容配置
  200. tabsScrollLeft: 0, // tabs 当前偏移量
  201. scrollLeft: 0,
  202. slideShows: [], // 轮播图
  203. circular: true,
  204. interval: 3000,
  205. duration: 500,
  206. menus: [], // 菜单
  207. scrollingNews: [], // 新闻简报
  208. indicatorDots: false,
  209. autoplay: true,
  210. couponList: [], // 优惠劵列表
  211. productRecommends: [], // 商品推荐
  212. site_name: '首页', // 首页 title
  213. logoUrl: "",
  214. // ========== 精品推荐 ===========
  215. goodScroll: true, // 精品推荐开关
  216. listActive: 0, // 当前选中项
  217. goodType: 1, //精品推荐 Type
  218. params: { //精品推荐分页
  219. page: 1,
  220. limit: 10,
  221. },
  222. loading: false,
  223. tempArr: [], // 精品推荐临时数组
  224. iSshowH: false,
  225. }
  226. },
  227. watch: {
  228. listActive(newVal) { // 监听当前选中项
  229. this.setTabList()
  230. }
  231. },
  232. mounted() {
  233. this.setTabList()
  234. },
  235. onLoad() {
  236. // wx.login({
  237. // success (res) {
  238. // if (res.code) {
  239. // console.log(res.code, '======== code 编号 =======')
  240. // }
  241. // }
  242. // })
  243. var that = this;
  244. // 获取系统信息
  245. uni.getSystemInfo({
  246. success(res) {
  247. that.$store.commit("SYSTEM_PLATFORM", res.platform);
  248. }
  249. });
  250. uni.getLocation({
  251. type: 'gcj02',
  252. altitude: true,
  253. geocode: true,
  254. success: function(res) {
  255. try {
  256. uni.setStorageSync('user_latitude', res.latitude);
  257. uni.setStorageSync('user_longitude', res.longitude);
  258. } catch {}
  259. }
  260. });
  261. this.isLogin && silenceBindingSpread();
  262. this.getIndexConfig();
  263. },
  264. onShow() {
  265. uni.setNavigationBarTitle({
  266. title: this.site_name
  267. })
  268. },
  269. methods: {
  270. // scroll-view滑动事件
  271. scroll(e) {
  272. this.scrollLeft = e.detail.scrollLeft;
  273. },
  274. setTabList() {
  275. this.$nextTick(() => {
  276. this.scrollIntoView()
  277. })
  278. },
  279. // 计算tabs位置
  280. scrollIntoView() { // item滚动
  281. let lineLeft = 0;
  282. this.getElementData('#tab_list', (data) => {
  283. let list = data[0]
  284. this.getElementData(`#tab_item`, (data) => {
  285. let el = data[this.listActive]
  286. if (el) {
  287. lineLeft = el.width / 2 + (-list.left) + el.left - list.width / 2 - this.scrollLeft
  288. this.tabsScrollLeft = this.scrollLeft + lineLeft
  289. }
  290. })
  291. })
  292. },
  293. getElementData(el, callback) {
  294. uni.createSelectorQuery().in(this).selectAll(el).boundingClientRect().exec((data) => {
  295. callback(data[0]);
  296. });
  297. },
  298. // 首页数据
  299. getIndexConfig: function() {
  300. let that = this;
  301. DecorateApi.getDecorateComponentListByPage(1).then(res => {
  302. // TODO 芋艿:暂时写死
  303. uni.setNavigationBarTitle({
  304. title: '首页'
  305. })
  306. this.$set(this, "logoUrl", 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png');
  307. this.$set(this, "site_name", '首页');
  308. // #ifdef H5
  309. this.$store.commit("SET_CHATURL", 'https://cschat.antcloud.com.cn/index.htm?tntInstId=jm7_c46J&scene=SCE01197657');
  310. Cache.set('chatUrl', 'https://cschat.antcloud.com.cn/index.htm?tntInstId=jm7_c46J&scene=SCE01197657');
  311. // #endif
  312. // 轮播图
  313. const slideShow = res.data.find(item => item.code === 'slide-show');
  314. if (slideShow) {
  315. this.$set(this, "slideShows", JSON.parse(slideShow.value));
  316. }
  317. // 菜单
  318. const menu = res.data.find(item => item.code === 'menu');
  319. if (menu) {
  320. this.$set(this, "menus", JSON.parse(menu.value));
  321. }
  322. // 滚动新闻
  323. const scrollingNews = res.data.find(item => item.code === 'scrolling-news');
  324. if (scrollingNews) {
  325. this.$set(this, "scrollingNews", JSON.parse(scrollingNews.value));
  326. }
  327. // 商品推荐
  328. const productRecommend = res.data.find(item => item.code === 'product-recommend');
  329. if (productRecommend) {
  330. this.$set(this, "productRecommends", JSON.parse(productRecommend.value));
  331. if (this.productRecommends.length > 0) {
  332. this.goodType = this.productRecommends[0].type
  333. this.getGroomList();
  334. }
  335. }
  336. })
  337. // 获得分享配置
  338. this.shareApi();
  339. // 获得优惠劵列表
  340. this.getcouponList();
  341. },
  342. shareApi: function() {
  343. // TODO 芋艿:写死
  344. const configApi = {
  345. "title": "芋道商城",
  346. "synopsis": "芋道商城,好用!",
  347. "img": "https://static.iocoder.cn/ruoyi-vue-pro-logo.png"
  348. }
  349. this.$set(this, 'configApi', configApi);
  350. // #ifdef H5
  351. this.setOpenShare(configApi);
  352. // #endif
  353. },
  354. // 微信分享;
  355. setOpenShare: function(data) {
  356. let that = this;
  357. if (that.$wechat.isWeixin()) {
  358. let configAppMessage = {
  359. desc: data.synopsis,
  360. title: data.title,
  361. link: location.href,
  362. imgUrl: data.img
  363. };
  364. that.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage);
  365. }
  366. },
  367. // ========== 优惠劵 ===========
  368. /**
  369. * 获得优惠劵列表
  370. */
  371. getcouponList() {
  372. CouponApi.getCouponTemplateList({ count: 2 }).then(res => {
  373. this.$set(this, 'couponList', res.data);
  374. }).catch(err => {
  375. return this.$util.Tips({
  376. title: err
  377. });
  378. });
  379. },
  380. /**
  381. * 领取优惠劵
  382. */
  383. getCoupon: function(id, index) {
  384. CouponApi.takeCoupon(id).then(res => {
  385. // 设置已领取,即不能再领取
  386. this.$set(this.couponList[index], 'canTake', res.data !== true);
  387. this.$util.Tips({
  388. title: '领取成功'
  389. });
  390. }).catch(err => {
  391. return this.$util.Tips({
  392. title: err
  393. });
  394. })
  395. },
  396. // ========== 精品推荐 ===========
  397. /**
  398. * 首发新品切换
  399. */
  400. ProductNavTab(item, index) {
  401. this.listActive = index
  402. this.goodType = item.type
  403. this.listActive = index
  404. this.tempArr = []
  405. this.params.page = 1
  406. this.goodScroll = true
  407. this.getGroomList(true)
  408. },
  409. /**
  410. * 商品精品推荐
  411. */
  412. getGroomList(onloadH) {
  413. if (!this.goodScroll) {
  414. return
  415. }
  416. if (onloadH) {
  417. this.iSshowH = true
  418. }
  419. this.loading = true
  420. ProductSpuApi.getSpuPage({
  421. recommendType: this.goodType,
  422. pageNo: this.params.page,
  423. pageSize: this.params.limit
  424. }).then(res => {
  425. const good_list = res.data.list;
  426. this.iSshowH = false
  427. this.loading = false
  428. this.goodScroll = good_list.length >= this.params.limit
  429. this.params.page++
  430. // 设置营销活动
  431. const spuIds = good_list.map(item => item.id);
  432. if (spuIds.length > 0) {
  433. PromotionActivityApi.getActivityListBySpuIds(spuIds).then(res => {
  434. ProductUtil.setActivityList(good_list, res.data);
  435. this.tempArr = this.tempArr.concat(good_list); // 放在此处,避免 Vue 监控不到数组里的元素变化
  436. });
  437. }
  438. })
  439. },
  440. /**
  441. * 前往商品详情
  442. */
  443. goDetail(item) {
  444. goShopDetail(item, this.uid).then(res => {
  445. uni.navigateTo({
  446. url: `/pages/goods_details/index?id=${item.id}`
  447. })
  448. })
  449. },
  450. fen2yuan(price) {
  451. return Util.fen2yuan(price)
  452. }
  453. },
  454. /**
  455. * 用户点击右上角分享
  456. */
  457. // #ifdef MP
  458. onShareAppMessage: function() {
  459. return {
  460. title: this.configApi.title,
  461. imageUrl: this.configApi.img,
  462. desc: this.configApi.synopsis,
  463. path: '/pages/index/index'
  464. };
  465. },
  466. // #endif
  467. onReachBottom() {
  468. if (this.navIndex === 0) {
  469. // 首页加载更多
  470. if (this.params.page !== 1) {
  471. this.getGroomList();
  472. }
  473. }
  474. }
  475. }
  476. </script>
  477. <style>
  478. page {
  479. display: flex;
  480. flex-direction: column;
  481. height: 100%;
  482. /* #ifdef H5 */
  483. background-color: #fff;
  484. /* #endif */
  485. }
  486. </style>
  487. <style lang="scss">
  488. .notice{
  489. width: 100%;
  490. height: 70rpx;
  491. border-radius: 10rpx;
  492. background-color: #fff;
  493. margin-bottom: 25rpx;
  494. line-height: 70rpx;
  495. padding: 0 14rpx;
  496. .line {
  497. color: #CCCCCC;
  498. }
  499. .pic{
  500. width: 130rpx;
  501. height: 36rpx;
  502. image{
  503. width: 100%;
  504. height: 100%;
  505. display: block !important;
  506. }
  507. }
  508. .swipers {
  509. height: 100%;
  510. width: 444rpx;
  511. overflow: hidden;
  512. swiper {
  513. height: 100%;
  514. width: 100%;
  515. overflow: hidden;
  516. font-size: 22rpx;
  517. color: #333333;
  518. }
  519. }
  520. .iconfont {
  521. color: #999999;
  522. font-size: 20rpx;
  523. }
  524. }
  525. .couponIndex {
  526. width: auto;
  527. height: 238rpx;
  528. background-image: url('~@/static/images/yhjsy.png');
  529. background-size: 100% 100%;
  530. padding-left: 42rpx;
  531. margin-bottom: 30rpx;
  532. .titBox {
  533. padding: 47rpx 0;
  534. text-align: center;
  535. height: 100%;
  536. .tit1 {
  537. color: #FFEBD2;
  538. font-size: 34rpx;
  539. font-weight: 600;
  540. }
  541. .tit2 {
  542. color: #FFEBD2;
  543. font-size: 22rpx;
  544. margin:10rpx 0 26rpx 0;
  545. }
  546. .tit3 {
  547. color: #FFDAAF;
  548. font-size: 24rpx;
  549. .iconfont {
  550. font-size: 20rpx;
  551. }
  552. }
  553. }
  554. .listBox {
  555. padding: 14rpx 0;
  556. .listActive {
  557. background-image: url('~@/static/images/lingyhj.png');
  558. background-size: 100% 100%;
  559. }
  560. .listHui {
  561. background-image: url('~@/static/images/weiling.png');
  562. background-size: 100% 100%;
  563. }
  564. .list {
  565. width: 170rpx;
  566. height: 210rpx;
  567. padding: 16rpx 0;
  568. text-align: center;
  569. margin-left: 24rpx;
  570. .tit {
  571. font-size: 18rpx;
  572. padding: 0 26rpx;
  573. }
  574. .titActive {
  575. color: #C99959;
  576. }
  577. .price {
  578. font-size: 46rpx;
  579. font-weight: 900;
  580. margin-top: 4rpx;
  581. }
  582. .pricehui {
  583. color: #B2B2B2;
  584. }
  585. .fonthui{
  586. background-color: #F5F5F5 !important;
  587. }
  588. .yuan {
  589. font-size: 24rpx;
  590. }
  591. .ling {
  592. font-size: 24rpx;
  593. margin-top: 9.5rpx;
  594. width: 102rpx;
  595. height: 36rpx;
  596. line-height: 36rpx;
  597. background-color: #FFE5C7;
  598. border-radius: 28rpx;
  599. margin: auto;
  600. }
  601. .priceM {
  602. color: #FFDAAF;
  603. font-size: 22rpx;
  604. margin-top: 14rpx;
  605. }
  606. }
  607. }
  608. }
  609. .sticky-box {
  610. /* #ifndef APP-PLUS-NVUE */
  611. display: flex;
  612. position: -webkit-sticky;
  613. /* #endif */
  614. position: sticky;
  615. /* #ifdef H5*/
  616. top: var(--window-top);
  617. /* #endif */
  618. z-index: 99;
  619. flex-direction: row;
  620. margin: 0px;
  621. background: #f5f5f5;
  622. padding: 30rpx 0;
  623. }
  624. .listAll {
  625. width: 20%;
  626. text-indent: 62rpx;
  627. font-size: 30rpx;
  628. border-left: 1px #eee solid;
  629. margin: 1% 0;
  630. padding: 5rpx;
  631. position: relative;
  632. image {
  633. position: absolute;
  634. left: 20rpx;
  635. top: 8rpx;
  636. }
  637. }
  638. .tab {
  639. position: relative;
  640. display: flex;
  641. font-size: 28rpx;
  642. white-space: nowrap;
  643. &__item {
  644. flex: 1;
  645. padding: 0 20rpx;
  646. text-align: center;
  647. height: 60rpx;
  648. line-height: 60rpx;
  649. color: #666;
  650. &.active {
  651. color: #09C2C9;
  652. }
  653. }
  654. }
  655. .tab__line {
  656. display: block;
  657. height: 6rpx;
  658. position: absolute;
  659. bottom: 0;
  660. left: 0;
  661. z-index: 1;
  662. border-radius: 3rpx;
  663. position: relative;
  664. background: #2FC6CD;
  665. }
  666. .scroll-view_H {
  667. /* 文本不会换行,文本会在在同一行上继续,直到遇到 <br> 标签为止。 */
  668. white-space: nowrap;
  669. width: 100%;
  670. }
  671. .privacy-wrapper {
  672. z-index: 999;
  673. position: fixed;
  674. left: 0;
  675. top: 0;
  676. width: 100%;
  677. height: 100%;
  678. background: #7F7F7F;
  679. .privacy-box {
  680. position: absolute;
  681. left: 50%;
  682. top: 50%;
  683. transform: translate(-50%, -50%);
  684. width: 560rpx;
  685. padding: 50rpx 45rpx 0;
  686. background: #fff;
  687. border-radius: 20rpx;
  688. .title {
  689. text-align: center;
  690. font-size: 32rpx;
  691. text-align: center;
  692. color: #333;
  693. font-weight: 700;
  694. }
  695. .content {
  696. margin-top: 20rpx;
  697. line-height: 1.5;
  698. font-size: 26rpx;
  699. color: #666;
  700. text-indent: 54rpx;
  701. i {
  702. font-style: normal;
  703. color: $theme-color;
  704. }
  705. }
  706. .btn-box {
  707. margin-top: 40rpx;
  708. text-align: center;
  709. font-size: 30rpx;
  710. .btn-item {
  711. height: 82rpx;
  712. line-height: 82rpx;
  713. background: linear-gradient(90deg, #F67A38 0%, #F11B09 100%);
  714. color: #fff;
  715. border-radius: 41rpx;
  716. }
  717. .btn {
  718. padding: 30rpx 0;
  719. }
  720. }
  721. }
  722. }
  723. .page-index {
  724. display: flex;
  725. flex-direction: column;
  726. min-height: 100%;
  727. background: linear-gradient(180deg, #fff 0%, #f5f5f5 100%);
  728. .header {
  729. width: 100%;
  730. background-color: $theme-color;
  731. padding: 28rpx 30rpx;
  732. .serch-wrapper {
  733. align-items: center;
  734. .logo {
  735. width: 118rpx;
  736. height: 42rpx;
  737. margin-right: 24rpx;
  738. }
  739. image {
  740. width: 118rpx;
  741. height: 42rpx;
  742. }
  743. .input {
  744. display: flex;
  745. align-items: center;
  746. width: 546rpx;
  747. height: 58rpx;
  748. padding: 0 0 0 30rpx;
  749. background: rgba(247, 247, 247, 1);
  750. border: 1px solid rgba(241, 241, 241, 1);
  751. border-radius: 29rpx;
  752. color: #BBBBBB;
  753. font-size: 26rpx;
  754. .iconfont {
  755. margin-right: 20rpx;
  756. font-size: 26rpx;
  757. color: #666666;
  758. }
  759. }
  760. }
  761. .tabNav {
  762. padding-top: 24rpx;
  763. }
  764. }
  765. /* #ifdef MP */
  766. .mp-header {
  767. z-index: 999;
  768. position: fixed;
  769. left: 0;
  770. top: 0;
  771. width: 100%;
  772. /* #ifdef H5 */
  773. padding-bottom: 20rpx;
  774. /* #endif */
  775. background-color: $theme-color;
  776. .serch-wrapper {
  777. height: 100%;
  778. align-items: center;
  779. padding: 0 50rpx 0 53rpx;
  780. image {
  781. width: 118rpx;
  782. height: 42rpx;
  783. margin-right: 30rpx;
  784. }
  785. .input {
  786. display: flex;
  787. align-items: center;
  788. /* #ifdef MP */
  789. width: 305rpx;
  790. /* #endif */
  791. height: 50rpx;
  792. padding: 0 0 0 30rpx;
  793. background: rgba(247, 247, 247, 1);
  794. border: 1px solid rgba(241, 241, 241, 1);
  795. border-radius: 29rpx;
  796. color: #BBBBBB;
  797. font-size: 28rpx;
  798. .iconfont {
  799. margin-right: 20rpx;
  800. }
  801. }
  802. }
  803. }
  804. /* #endif */
  805. .page_content {
  806. background-color: #f5f5f5;
  807. /* #ifdef H5 */
  808. // margin-top: 20rpx !important;
  809. /* #endif */
  810. padding: 0 30rpx;
  811. .swiper {
  812. position: relative;
  813. width: 100%;
  814. height: 280rpx;
  815. margin: 0 auto;
  816. border-radius: 10rpx;
  817. overflow: hidden;
  818. margin-bottom: 25rpx;
  819. /* #ifdef MP */
  820. z-index: 10;
  821. margin-top: 20rpx;
  822. /* #endif */
  823. swiper,
  824. .swiper-item,
  825. image {
  826. width: 100%;
  827. height: 280rpx;
  828. border-radius: 10rpx;
  829. }
  830. }
  831. .nav {
  832. padding-bottom: 26rpx;
  833. background: #fff;
  834. opacity: 1;
  835. border-radius: 14rpx;
  836. width: 100%;
  837. margin-bottom: 30rpx;
  838. .item {
  839. display: flex;
  840. flex-direction: column;
  841. align-items: center;
  842. justify-content: center;
  843. width: 20%;
  844. margin-top: 30rpx;
  845. image {
  846. width: 82rpx;
  847. height: 82rpx;
  848. }
  849. }
  850. }
  851. .nav-bd {
  852. display: flex;
  853. align-items: center;
  854. justify-content: space-between;
  855. .item {
  856. display: flex;
  857. flex-direction: column;
  858. align-items: center;
  859. justify-content: center;
  860. .txt {
  861. font-size: 32rpx;
  862. color: #282828;
  863. }
  864. .label {
  865. display: flex;
  866. align-items: center;
  867. justify-content: center;
  868. width: 124rpx;
  869. height: 32rpx;
  870. margin-top: 5rpx;
  871. font-size: 24rpx;
  872. color: #999;
  873. }
  874. &.active {
  875. color: $theme-color;
  876. .txt {
  877. color: $theme-color;
  878. }
  879. .label {
  880. background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
  881. border-radius: 16rpx;
  882. color: #fff;
  883. }
  884. }
  885. }
  886. }
  887. .index-product-wrapper {
  888. margin-bottom: 110rpx;
  889. &.on {
  890. min-height: 1500rpx;
  891. }
  892. .list-box {
  893. display: flex;
  894. flex-wrap: wrap;
  895. justify-content: space-between;
  896. .item {
  897. width: 335rpx;
  898. margin-bottom: 20rpx;
  899. background-color: #fff;
  900. border-radius: 10rpx;
  901. overflow: hidden;
  902. image {
  903. width: 100%;
  904. height: 330rpx;
  905. }
  906. .text-info {
  907. padding: 10rpx 20rpx 15rpx;
  908. .title {
  909. color: #222222;
  910. }
  911. .old-price {
  912. margin-top: 8rpx;
  913. font-size: 26rpx;
  914. color: #AAAAAA;
  915. text-decoration: line-through;
  916. text {
  917. margin-right: 2px;
  918. font-size: 20rpx;
  919. }
  920. }
  921. .price {
  922. display: flex;
  923. align-items: flex-end;
  924. color: $theme-color;
  925. font-size: 34rpx;
  926. font-weight: 800;
  927. text {
  928. padding-bottom: 4rpx;
  929. font-size: 24rpx;
  930. font-weight: 800;
  931. }
  932. .txt {
  933. display: flex;
  934. align-items: center;
  935. justify-content: center;
  936. width: 28rpx;
  937. height: 28rpx;
  938. margin-left: 15rpx;
  939. margin-bottom: 10rpx;
  940. border: 1px solid $theme-color;
  941. border-radius: 4rpx;
  942. font-size: 22rpx;
  943. font-weight: normal;
  944. }
  945. }
  946. }
  947. }
  948. &.on {
  949. display: flex;
  950. }
  951. }
  952. }
  953. }
  954. }
  955. .productList {
  956. /* #ifdef H5 */
  957. padding-bottom: 140rpx;
  958. /* #endif */
  959. }
  960. .productList .list {
  961. padding: 0 20rpx;
  962. }
  963. .productList .list.on {
  964. background-color: #fff;
  965. border-top: 1px solid #f6f6f6;
  966. }
  967. .productList .list .item {
  968. width: 345rpx;
  969. margin-top: 20rpx;
  970. background-color: #fff;
  971. border-radius: 10rpx;
  972. }
  973. .productList .list .item.on {
  974. width: 100%;
  975. display: flex;
  976. border-bottom: 1rpx solid #f6f6f6;
  977. padding: 30rpx 0;
  978. margin: 0;
  979. }
  980. .productList .list .item .pictrue {
  981. position: relative;
  982. width: 100%;
  983. height: 345rpx;
  984. }
  985. .productList .list .item .pictrue.on {
  986. width: 180rpx;
  987. height: 180rpx;
  988. }
  989. .productList .list .item .pictrue image {
  990. width: 100%;
  991. height: 100%;
  992. border-radius: 20rpx 20rpx 0 0;
  993. }
  994. .productList .list .item .pictrue image.on {
  995. border-radius: 6rpx;
  996. }
  997. .productList .list .item .text {
  998. padding: 20rpx 17rpx 26rpx 17rpx;
  999. font-size: 30rpx;
  1000. color: #222;
  1001. }
  1002. .productList .list .item .text.on {
  1003. width: 508rpx;
  1004. padding: 0 0 0 22rpx;
  1005. }
  1006. .productList .list .item .text .money {
  1007. font-size: 26rpx;
  1008. font-weight: bold;
  1009. margin-top: 8rpx;
  1010. }
  1011. .productList .list .item .text .money.on {
  1012. margin-top: 50rpx;
  1013. }
  1014. .productList .list .item .text .money .num {
  1015. font-size: 34rpx;
  1016. }
  1017. .productList .list .item .text .vip {
  1018. font-size: 22rpx;
  1019. color: #aaa;
  1020. margin-top: 7rpx;
  1021. }
  1022. .productList .list .item .text .vip.on {
  1023. margin-top: 12rpx;
  1024. }
  1025. .productList .list .item .text .vip .vip-money {
  1026. font-size: 24rpx;
  1027. color: #282828;
  1028. font-weight: bold;
  1029. }
  1030. .productList .list .item .text .vip .vip-money image {
  1031. width: 46rpx;
  1032. height: 21rpx;
  1033. margin-left: 4rpx;
  1034. }
  1035. .pictrue {
  1036. position: relative;
  1037. }
  1038. .fixed {
  1039. z-index: 100;
  1040. position: fixed;
  1041. left: 0;
  1042. top: 0;
  1043. background: linear-gradient(90deg, red 50%, #ff5400 100%);
  1044. }
  1045. .mores-txt {
  1046. width: 100%;
  1047. align-items: center;
  1048. justify-content: center;
  1049. height: 70rpx;
  1050. color: #999;
  1051. font-size: 24rpx;
  1052. .iconfont {
  1053. margin-top: 2rpx;
  1054. font-size: 20rpx;
  1055. }
  1056. }
  1057. .menu-txt {
  1058. font-size: 24rpx;
  1059. color: #454545;
  1060. }
  1061. .mp-bg {
  1062. position: absolute;
  1063. left: 0;
  1064. /* #ifdef H5 */
  1065. top: 98rpx;
  1066. /* #endif */
  1067. width: 100%;
  1068. height: 304rpx;
  1069. background: linear-gradient(180deg, #E93323 0%, #F5F5F5 100%, #751A12 100%);
  1070. // border-radius: 0 0 30rpx 30rpx;
  1071. }
  1072. </style>