index_new.vue 29 KB

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