index_new - 副本 (2).vue 29 KB

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