index.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417
  1. <template>
  2. <view class="page-container">
  3. <up-navbar
  4. class="inde-nav-bar"
  5. :bgColor="navBgColor"
  6. >
  7. <template #left>
  8. <view class="nav-slot" v-if="!merchantNameShow()" @click="toBrowsingHistory()">
  9. <image class="dianpu" src="@/static/images/dianpu.png" mode="widthFix"></image>
  10. <view class="storeName line1">{{ merchantInfo.merchantName }}</view>
  11. <image class="zhankai" src="@/static/images/zhankai.png" mode="widthFix"></image>
  12. </view>
  13. </template>
  14. <template #center>
  15. <view class="page-title">首页</view>
  16. </template>
  17. <template #right></template>
  18. </up-navbar>
  19. <!-- <view class="page-index" :class="{ bgf: navIndex > 0 }"> -->
  20. <view class="page-index">
  21. <view class="top-box jianbianBG">
  22. <view class="header">
  23. <view class="serch-wrapper">
  24. <!-- <view class="logo" @click="goBack">-->
  25. <!-- <image src="@/static/logo1.png" mode=""></image>-->
  26. <!-- </view>-->
  27. <navigator
  28. url="/pages/goods/goods_search/index"
  29. class="input"
  30. hover-class="none"
  31. ><image class="searchImg" src="@/static/images/search.png"></image> 搜索商品</navigator
  32. >
  33. </view>
  34. <!-- 轮播图 -->
  35. <up-swiper
  36. class="swiper-box"
  37. :list="list1"
  38. :height="160"
  39. image-fit="cover"
  40. indicator
  41. :radius="10"
  42. indicatorMode="line"
  43. :circular="true"
  44. keyName="url"
  45. @click="clickSwiper"
  46. ></up-swiper>
  47. </view>
  48. </view>
  49. <!-- 实时金价 -->
  50. <view class="top-bg-box">
  51. <view class="card">
  52. <view class="cardbgLinear">
  53. <view class="title" @click="btnClick">
  54. <view class="title-left">
  55. <image class="ssjj" :src="HTTP_REQUEST_URL_IMG+'shishijinjia.png'" mode="widthFix"></image>
  56. <text class="updateTime">{{ timeFormat(timestamp, "yyyy-mm-dd hh:MM:ss") }}更新</text>
  57. </view>
  58. <view class="more">
  59. <text class="txt">更多金价</text>
  60. <image class="right" src="@/static/images/right.png" mode="widthFix"></image>
  61. </view>
  62. </view>
  63. <view class="nav-list">
  64. <view class="item">
  65. <view class="price">{{ viprealGoldprice }}<text class="unit">/克</text></view>
  66. <view class="txt">黄金</view>
  67. </view>
  68. <view class="item">
  69. <view class="price">{{ viprealPtprice }}<text class="unit">/克</text></view>
  70. <view class="txt">铂金</view>
  71. </view>
  72. <view class="item">
  73. <view class="price">{{ viprealAgprice }}<text class="unit">/克</text></view>
  74. <view class="txt">白银</view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. <!-- 分类卡片 -->
  81. <view class="classify-section">
  82. <up-scroll-list class="classify-scroll" :indicator="classifyList.length > 4" :scrollX="true" indicatorActiveColor="#F8C008">
  83. <view class="classify-container">
  84. <view
  85. class="classify-item"
  86. v-for="(item, index) in classifyList"
  87. :key="'item-' + index"
  88. @click="toGoodsCate(item)"
  89. >
  90. <image class="classify-img" :src="item.extra" mode="widthFix"></image>
  91. <view class="classify-txt">{{ item.name }}</view>
  92. </view>
  93. </view>
  94. </up-scroll-list>
  95. </view>
  96. <view class="top-bg-box2">
  97. <view class="title">
  98. 精选商品
  99. </view>
  100. </view>
  101. <!-- 首发新品 -->
  102. <view class="index-product-wrapper">
  103. <view
  104. class="list-box animated"
  105. :class="goodsList.length > 0 ? 'fadeIn on' : ''"
  106. >
  107. <view
  108. class="item"
  109. v-for="(item, index) in calculatedProducts"
  110. :key="index"
  111. @click="goDetail(item)"
  112. >
  113. <view class="pictrue">
  114. <image :src="item.image" mode=""></image>
  115. </view>
  116. <view class="text-info">
  117. <view class="title" >
  118. <view class="text line1">{{ item.storeName }}</view>
  119. <view class="weight">{{ item.weight }}g</view>
  120. </view>
  121. <view class="bottom-row">
  122. <!-- <text class="price">工费: {{ item.price }}/克</text> -->
  123. <text class="price">¥ {{ item.totalPrice }}</text>
  124. <text class="sales">
  125. 销量:{{ Number(item.sales || 0) + Number(item.ficti || 0) }}件
  126. </text>
  127. <!-- <view class="txt">券</view> -->
  128. </view>
  129. <view class="bottom-row">
  130. <!-- <text class="price">工费: {{ item.price }}/克</text> -->
  131. <text class="sales">工费: {{ item.totalLaborCost }}</text>
  132. <text class="sales">
  133. 附加费: {{ item.additionalAmount }}
  134. </text>
  135. <!-- <view class="txt">券</view> -->
  136. </view>
  137. <template v-if="item?.merchant?.id && merchantNameShow()">
  138. <view class="merchantInfo" @click.stop="toMerchant(item.merchant.id)">
  139. <image class="merchantLogo" :src="item.merchant.merchantLogo" mode="scaleToFill"></image>
  140. <text class="merchantName">{{item.merchant.merchantName}}</text>
  141. <uni-icons style="margin-left: 10rpx;" type="right" size="16" color="#999999"></uni-icons>
  142. </view>
  143. </template>
  144. </view>
  145. </view>
  146. </view>
  147. <view class="loadingicon acea-row row-center-wrapper" v-if="goodScroll">
  148. <text
  149. class="loading iconfont icon-jiazai"
  150. :hidden="loading == false"
  151. ></text>
  152. </view>
  153. <view class="no-data" v-if="isNoDataState">
  154. <image
  155. src="https://my-go-easy-im.oss-cn-shenzhen.aliyuncs.com/goeasy-im-%E6%B0%B4%E8%B4%9D%E5%95%86%E5%9F%8E/zhanwu_20250827104005_1720_6.png"
  156. />
  157. </view>
  158. <view class="mores-txt flex" v-if="!goodScroll && !isNoDataState">
  159. <text>我是有底线的</text>
  160. </view>
  161. </view>
  162. </view>
  163. <!-- 上半部分 -->
  164. </view>
  165. </template>
  166. <script setup>
  167. // 获取实时金价
  168. import useRealGoldPrice from "@/hooks/useRealGoldPrice";
  169. import { onLoad, onShow, onReachBottom,onPageScroll } from "@dcloudio/uni-app";
  170. import {ref, onMounted, reactive, computed, getCurrentInstance, watch, nextTick} from "vue";
  171. import { getIndexData, getCoupons, setCouponReceive, getMerchantBannerList } from "@/api/api.js";
  172. import {
  173. getSbmerchantInfo
  174. } from "@/api/merchant.js";
  175. import { getProductListAPI } from "@/api/factory.js";
  176. import { useStoreRights } from "@/stores/rights";
  177. import { useRealtimeTimestamp } from "@/utils/useRealtimeTimestamp.js";
  178. import { getUserLevelInfo } from "@/api/user";
  179. import { useAppStore } from "@/stores/app";
  180. import { goShopDetail } from "@/libs/order.js";
  181. import { HTTP_REQUEST_URL_IMG } from "@/config/app";
  182. // 全局状态和时间
  183. const appStore = useAppStore();
  184. const rightsStore = useStoreRights();
  185. import {
  186. getGroomList as getGroomListApi,
  187. getProductByCategoryId,
  188. getCategoryList
  189. } from "@/api/store.js";
  190. import { timeFormat } from "@/uni_modules/uview-plus";
  191. import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
  192. import { getSceneInfo } from '@/utils/util.js';
  193. import { toLogin } from "@/libs/login.js";
  194. // 获取实时金价
  195. // 实时价格处理
  196. const {
  197. realGoldprice, // 黄金实时销售价(基础)
  198. realPtprice, // 铂金实时销售价(基础)
  199. realAgprice, // 白银实时销售价(基础)
  200. } = useRealGoldPrice({});
  201. const { timestamp } = useRealtimeTimestamp();
  202. const uid = appStore.uidComputed;
  203. console.log(uid)
  204. // 轮播图数据
  205. const list1 = ref([]);
  206. const site_name = ref("");
  207. const loading = ref(false);
  208. const goodScroll = ref(true);
  209. const classifyList = ref([])
  210. // 用户权益数据
  211. const userBenefits = ref({});
  212. const adjustPtPrice = ref({});
  213. const adjustAgPrice = ref({});
  214. const adjustGoldpriceNew = ref({});
  215. const adjustKgoldPrice = ref({});
  216. const merchantInfo = ref({});
  217. const merchantId = ref('');
  218. const goodsList = ref([]);
  219. const goodType = ref(1);
  220. // Pagination
  221. const params = ref({
  222. page: 1,
  223. limit: 10,
  224. });
  225. const isFirstLoad = ref(true);
  226. const navBgColor = ref('rgba(255,255,255,0)');
  227. const calculatedProducts = computed(() => {
  228. // 计算逻辑与原代码一致,但基于响应式数据 products
  229. return goodsList.value.map((product) => {
  230. // 1. 将price字符串转为数字
  231. const price = Number(product.price);
  232. // 2. 计算乘积
  233. const total = (price + product.sales) * realGoldprice.value;
  234. // 3. 向上取整到两位小数(先放大100倍取整,再缩小100倍)
  235. const roundedTotal = Math.ceil(total * 100) / 100;
  236. // 4. 格式化保留两位小数
  237. const formattedTotal = roundedTotal.toFixed(2);
  238. const totalLaborCost = Number(product.totalLaborCost);
  239. const additionalAmount = Number(product.additionalAmount);
  240. const totalPrice = (totalLaborCost+additionalAmount).toFixed(2);
  241. return {
  242. ...product,
  243. calculatedTotal: formattedTotal, // 新增计算结果字段
  244. totalPrice
  245. };
  246. });
  247. });
  248. onLoad(async (options) => {
  249. const params = await getSceneInfo(options,'index');
  250. // 2. 设置商户ID
  251. const isLogin = appStore.isLogin;
  252. if (appStore.merchantId && appStore.merchantId !== '') {
  253. merchantId.value = appStore.merchantId;
  254. if (!isLogin) {
  255. toLogin();
  256. return; // 登录后页面会刷新,避免继续执行
  257. }
  258. } else if (appStore?.userInfo?.merchant?.id) {
  259. merchantId.value = appStore.userInfo.merchant.id;
  260. } else {
  261. merchantId.value = '';
  262. }
  263. if(isFirstLoad.value){
  264. await initPageData();
  265. isFirstLoad.value = false;
  266. }
  267. });
  268. onShow(async () => {
  269. const isLogin = appStore.isLogin;
  270. if(isLogin){
  271. rightsStore.getUserBenefits(appStore.userInfo?.userId);
  272. getUserBenefits();
  273. }
  274. if (appStore.merchantId && appStore.merchantId !== '') {
  275. merchantId.value = appStore.merchantId;
  276. if (!isLogin) {
  277. toLogin();
  278. return; // 登录后页面会刷新,避免继续执行
  279. }
  280. } else if (appStore?.userInfo?.merchant?.id) {
  281. merchantId.value = appStore.userInfo.merchant.id;
  282. } else {
  283. merchantId.value = '';
  284. }
  285. if(!isFirstLoad.value){
  286. await initPageData();
  287. }
  288. uni.setNavigationBarTitle({ title: site_name.value });
  289. });
  290. const initPageData = async () => {
  291. try {
  292. loading.value = true;
  293. goodScroll.value = true;
  294. goodsList.value = [];
  295. goodType.value = 1;
  296. params.value = {
  297. page: 1,
  298. limit: 10,
  299. };
  300. // 并行执行不依赖的数据获取
  301. const promises = [];
  302. if (merchantId.value && merchantId.value !== '') {
  303. promises.push(getSbmerchantInfoFn());
  304. promises.push(getMerchantBannerListFn());
  305. } else {
  306. promises.push(getIndexConfig());
  307. }
  308. promises.push(getGroomList());
  309. promises.push(getAllCategory());
  310. // 等待所有数据获取完成
  311. await Promise.all(promises);
  312. } catch (error) {
  313. console.error('初始化页面数据失败:', error);
  314. uni.showToast({
  315. title: '数据加载失败',
  316. icon: 'none'
  317. });
  318. } finally {
  319. loading.value = false;
  320. }
  321. };
  322. const getMerchantBannerListFn = async () => {
  323. try {
  324. let obj = {
  325. merchantId:merchantId.value
  326. }
  327. const res = await getMerchantBannerList(obj);
  328. uni.setNavigationBarTitle({ title: "首页" });
  329. site_name.value = "首页";
  330. list1.value = res.data.map((v) => {
  331. return {
  332. url: v.bannerUrl,
  333. title: "",
  334. type: "image",
  335. navUrl: v.bannerValue,
  336. };
  337. });
  338. } catch (err) {
  339. console.error(err);
  340. }
  341. }
  342. const getSbmerchantInfoFn = async () => {
  343. try {
  344. let obj = {
  345. merchantId:merchantId.value
  346. }
  347. const res = await getSbmerchantInfo(obj);
  348. merchantInfo.value = res.data;
  349. } catch (err) {
  350. console.error(err);
  351. }
  352. }
  353. const goBack = () => {
  354. uni.switchTab({ url: "/pages/index/index" });
  355. };
  356. async function clickSwiper(index) {
  357. const imgItem = list1.value[index];
  358. try {
  359. if (imgItem.navUrl !== "#") {
  360. await uni.navigateTo({ url: imgItem.navUrl });
  361. } else {
  362. uni.previewImage({
  363. current: index,
  364. urls: list1.value.map((item) => item.url) || [],
  365. });
  366. }
  367. } catch (err) {
  368. uni.previewImage({
  369. current: index,
  370. urls: list1.value.map((item) => item.url) || [],
  371. });
  372. return;
  373. }
  374. }
  375. const getIndexConfig = async () => {
  376. try {
  377. loading.value = true;
  378. const res = await getIndexData();
  379. uni.setNavigationBarTitle({ title: "首页" });
  380. site_name.value = "首页";
  381. list1.value = res.data.banner.map((v) => {
  382. return {
  383. url: v.pic,
  384. title: "",
  385. type: "image",
  386. navUrl: v.url,
  387. };
  388. });
  389. } catch (err) {
  390. console.error(err);
  391. } finally {
  392. loading.value = false;
  393. }
  394. };
  395. const getUserBenefits = async () => {
  396. try {
  397. const res = await getUserLevelInfo(appStore?.userInfo?.userId || 0);
  398. userBenefits.value = res.data || { sold: 0, buy: 0 }; // 默认权益为0,避免NaN
  399. if (
  400. userBenefits?.value?.nobleMeta &&
  401. userBenefits.value.nobleMeta.length > 0
  402. ) {
  403. const nobleMeta = userBenefits.value.nobleMeta;
  404. nobleMeta.forEach((item) => {
  405. switch (item.name) {
  406. case "黄金":
  407. adjustGoldpriceNew.value = item;
  408. break;
  409. case "K金":
  410. adjustKgoldPrice.value = item;
  411. break;
  412. case "铂金":
  413. adjustPtPrice.value = item;
  414. break;
  415. case "白银":
  416. adjustAgPrice.value = item;
  417. break;
  418. default:
  419. break;
  420. }
  421. });
  422. }
  423. } catch (error) {
  424. console.error("获取用户权益失败:", error);
  425. userBenefits.value = { sold: 0, buy: 0 }; // 出错时默认权益为0
  426. }
  427. };
  428. // 黄金调整价
  429. const viprealGoldprice = computed(() => {
  430. const res =
  431. Number(realGoldprice.value) -
  432. Number(userBenefits.value.buy) +
  433. Number(adjustGoldpriceNew.value.sellPriceAdjust) || 0;
  434. return Number(res).toFixed(2);
  435. });
  436. const viprealPtprice = computed(() =>{
  437. const res =
  438. Number(realPtprice.value) -
  439. Number(userBenefits.value.buy) +
  440. Number(adjustPtPrice.value.sellPriceAdjust) || 0;
  441. return Number(res).toFixed(2);
  442. });
  443. const viprealAgprice = computed(() =>{
  444. const res =
  445. Number(realAgprice.value) -
  446. Number(userBenefits.value.buy) +
  447. Number(adjustAgPrice.value.sellPriceAdjust) || 0;
  448. return Number(res).toFixed(2);
  449. });
  450. const btnClick = () => {
  451. uni.navigateTo({
  452. url: "/pages/mall/dapan",
  453. });
  454. };
  455. const isNoDataState = computed(() => {
  456. return goodsList.value.length === 0 && !loading.value;
  457. });
  458. // Product Lists
  459. const getGroomList = async () => {
  460. if (!goodScroll.value) return;
  461. try {
  462. loading.value = true;
  463. merchantId.value!='' ? params.value.merchantId = merchantId.value:'';
  464. const { data } = await getGroomListApi(goodType.value, params.value);
  465. goodsList.value = [...goodsList.value, ...data.productList.list] || [];
  466. goodScroll.value = data.productList.list.length >= params.value.limit;
  467. params.value.page++;
  468. } catch (err) {
  469. console.error(err);
  470. } finally {
  471. loading.value = false;
  472. }
  473. };
  474. onPageScroll((e) => {
  475. if(e.scrollTop > 0){
  476. navBgColor.value ='#ffe079';
  477. }else{
  478. navBgColor.value ='rgba(252,255,255,0)';
  479. }
  480. })
  481. onReachBottom(() => {
  482. getGroomList();
  483. });
  484. // Product Details
  485. const goDetail = async (item) => {
  486. // await goShopDetail(item, uid);
  487. uni.navigateTo({ url: `/pages/goods/goods_details/index?id=${item.id}` });
  488. };
  489. function getAllCategory () {
  490. getCategoryList().then(res => {
  491. classifyList.value = res.data.sort((a, b) => a.sort - b.sort);
  492. })
  493. }
  494. const toBrowsingHistory = () => {
  495. uni.navigateTo({ url: `/pages/users/browsing_history/index?merchantId=${merchantId.value}` });
  496. }
  497. const toMerchant = (merchantId) => {
  498. uni.navigateTo({ url:"/pages/merchantCenters/merchant?merchantId="+merchantId });
  499. }
  500. const toGoodsCate = (item) => {
  501. uni.setStorageSync('goods_cate', { id: item.id }); // 存储参数
  502. uni.switchTab({url:`/pages/goods_cate/goods_cate`})
  503. }
  504. const merchantNameShow = () => {
  505. if(!appStore.userInfo ||((appStore.userInfo && !appStore.userInfo.merchant && !appStore.merchantId))){
  506. return true;
  507. }else{
  508. return false;
  509. }
  510. }
  511. </script>
  512. <style>
  513. page {
  514. display: flex;
  515. flex-direction: column;
  516. height: 100%;
  517. }
  518. </style>
  519. <style lang="scss" scoped>
  520. .Hoverball {
  521. display: flex;
  522. justify-content: center;
  523. align-items: center;
  524. flex-direction: column;
  525. background: linear-gradient(180deg, #fefcf9 0%, #fff2df 100%);
  526. box-shadow: 0rpx 3rpx 12rpx 0rpx rgba(0, 0, 0, 0.16);
  527. width: 105upx;
  528. height: 105upx;
  529. border-radius: 50%; // 圆形按钮
  530. position: fixed; // 固定定位(不随页面滚动)
  531. z-index: 999999; // 最高层级,避免被其他元素遮挡
  532. top: 0%;
  533. right: 0%;
  534. .title {
  535. font-size: 19rpx;
  536. color: #000000;
  537. margin-bottom: 4rpx; // 文本与价格间距
  538. }
  539. .price {
  540. font-size: 26rpx;
  541. color: #cc0000;
  542. font-weight: bold;
  543. }
  544. // 贴边/停止拖拽时的过渡动画
  545. &.transition {
  546. transition: left 0.3s ease, top 0.3s ease;
  547. }
  548. }
  549. .couponIndex {
  550. width: auto;
  551. height: 238rpx;
  552. //background-image: url("~@/static/images/yhjsy.png");
  553. background-size: 100% 100%;
  554. padding-left: 42rpx;
  555. margin-bottom: 30rpx;
  556. .titBox {
  557. padding: 47rpx 0;
  558. text-align: center;
  559. height: 100%;
  560. .tit1 {
  561. color: #ffebd2;
  562. font-size: 34rpx;
  563. font-weight: 600;
  564. }
  565. .tit2 {
  566. color: #ffebd2;
  567. font-size: 22rpx;
  568. margin: 10rpx 0 26rpx 0;
  569. }
  570. .tit3 {
  571. color: #ffdaaf;
  572. font-size: 24rpx;
  573. .iconfont {
  574. font-size: 20rpx;
  575. }
  576. }
  577. }
  578. }
  579. .sticky-box {
  580. // display: flex;
  581. // position: -webkit-sticky;
  582. // position: sticky;
  583. z-index: 99;
  584. flex-direction: row;
  585. // margin: 0px;
  586. // background: #fff;
  587. padding-bottom: 30rpx;
  588. background: #fff;
  589. margin-top: 30rpx;
  590. .active {
  591. color: #000;
  592. }
  593. .nav-bd {
  594. display: flex;
  595. align-items: center;
  596. justify-content: space-between;
  597. padding: 0 20rpx;
  598. .item {
  599. display: flex;
  600. flex-direction: column;
  601. align-items: center;
  602. justify-content: center;
  603. border-bottom: 3rpx solid #e6e6e6;
  604. box-sizing: border-box;
  605. .txt {
  606. font-size: 28rpx;
  607. color: #282828;
  608. }
  609. .label {
  610. display: flex;
  611. align-items: center;
  612. justify-content: center;
  613. width: 124rpx;
  614. height: 32rpx;
  615. margin-top: 5rpx;
  616. font-size: 24rpx;
  617. color: #999;
  618. }
  619. &.active {
  620. color: $theme-color;
  621. border-bottom: 2rpx solid #000;
  622. .txt {
  623. color: $theme-color;
  624. }
  625. .label {
  626. background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
  627. border-radius: 16rpx;
  628. color: #fff;
  629. }
  630. }
  631. }
  632. }
  633. .second-nav {
  634. width: 100%;
  635. display: flex;
  636. flex-wrap: nowrap;
  637. overflow-x: auto;
  638. &::-webkit-scrollbar {
  639. display: none;
  640. }
  641. -webkit-overflow-scrolling: touch;
  642. padding: 0 50rpx;
  643. box-sizing: border-box;
  644. .second-nav-item {
  645. font-size: 26rpx;
  646. padding: 15rpx 0;
  647. margin: 0 10rpx 0 0;
  648. color: #000;
  649. white-space: nowrap;
  650. // flex: 1;
  651. width: 33%;
  652. display: flex;
  653. justify-content: center;
  654. align-items: center;
  655. &.active {
  656. color: #ef4800;
  657. }
  658. }
  659. }
  660. }
  661. .swiper-box {
  662. &::v-deep uni-image {
  663. width: 100%;
  664. }
  665. }
  666. // 活动专区
  667. .active-contanier {
  668. width: 100%;
  669. box-sizing: border-box;
  670. padding: 0 30rpx;
  671. .active-scroll {
  672. width: 100%;
  673. white-space: nowrap;
  674. .active-scroll-content {
  675. margin: 30rpx 0;
  676. display: flex;
  677. flex-direction: row;
  678. white-space: nowrap;
  679. }
  680. }
  681. .active-item {
  682. // width: 335rpx;
  683. width: 48.99%;
  684. background: #ffffff;
  685. height: 180rpx;
  686. box-shadow: 0rpx 3rpx 13rpx 0rpx rgba(0, 0, 0, 0.13);
  687. border-radius: 20rpx;
  688. padding: 13rpx 20rpx;
  689. box-sizing: border-box;
  690. display: flex;
  691. flex-direction: column;
  692. margin-right: 20rpx;
  693. flex-shrink: 0;
  694. .title-box {
  695. height: 33rpx;
  696. display: flex;
  697. font-size: 22rpx;
  698. align-items: center;
  699. .title {
  700. // width: 50%;
  701. font-weight: bold;
  702. text-align: center;
  703. }
  704. }
  705. .active-box {
  706. flex: 1;
  707. display: flex;
  708. .active-item-left {
  709. flex: 1;
  710. display: flex;
  711. flex-direction: column;
  712. .image-box {
  713. flex: 1;
  714. // width: 115rpx;
  715. display: flex;
  716. align-items: center;
  717. image {
  718. border-radius: 5rpx;
  719. width: 115rpx;
  720. height: 110rpx;
  721. }
  722. .da-jin-tiao {
  723. width: 51rpx;
  724. }
  725. }
  726. }
  727. .active-item-right {
  728. display: flex;
  729. flex-direction: column;
  730. justify-content: space-between;
  731. flex: 1;
  732. min-width: 0;
  733. width: 0;
  734. .ms {
  735. font-size: 16rpx;
  736. color: #000000;
  737. width: 100%;
  738. overflow: hidden;
  739. text-overflow: ellipsis;
  740. white-space: nowrap;
  741. display: block;
  742. max-width: 100%;
  743. box-sizing: border-box;
  744. }
  745. .tag {
  746. display: flex;
  747. .tag-text {
  748. color: #acacac;
  749. background-color: #ebebeb;
  750. border-radius: 5rpx;
  751. font-size: 16rpx;
  752. text-align: center;
  753. padding: 0rpx 5rpx;
  754. }
  755. }
  756. .price-box {
  757. display: flex;
  758. justify-content: space-between;
  759. .price {
  760. font-size: 18rpx;
  761. font-weight: bold;
  762. color: #000000;
  763. margin-right: 10rpx;
  764. }
  765. .btn {
  766. width: 77rpx;
  767. height: 26rpx;
  768. background-image: linear-gradient(270deg, #fc962c 0%, #f0470d 100%);
  769. border-radius: 100rpx;
  770. display: flex;
  771. justify-content: center;
  772. align-items: center;
  773. font-size: 14rpx;
  774. color: #ffffff;
  775. }
  776. }
  777. }
  778. }
  779. }
  780. }
  781. .listAll {
  782. width: 20%;
  783. text-indent: 62rpx;
  784. font-size: 30rpx;
  785. border-left: 1px #eee solid;
  786. margin: 1% 0;
  787. padding: 5rpx;
  788. position: relative;
  789. image {
  790. position: absolute;
  791. left: 20rpx;
  792. top: 8rpx;
  793. }
  794. }
  795. .tab {
  796. position: relative;
  797. display: flex;
  798. font-size: 28rpx;
  799. white-space: nowrap;
  800. &__item {
  801. flex: 1;
  802. padding: 0 20rpx;
  803. text-align: center;
  804. height: 60rpx;
  805. line-height: 60rpx;
  806. color: #666;
  807. &.active {
  808. color: #09c2c9;
  809. }
  810. }
  811. }
  812. .tab__line {
  813. display: block;
  814. height: 6rpx;
  815. position: absolute;
  816. bottom: 0;
  817. left: 0;
  818. z-index: 1;
  819. border-radius: 3rpx;
  820. position: relative;
  821. background: #2fc6cd;
  822. }
  823. .scroll-view_H {
  824. width: 100%;
  825. display: flex;
  826. overflow-x: auto;
  827. padding: 12rpx 0;
  828. background-color: #fff;
  829. box-sizing: border-box;
  830. &::-webkit-scrollbar {
  831. display: none;
  832. }
  833. -webkit-overflow-scrolling: touch;
  834. .tab.nav-bd {
  835. display: flex;
  836. align-items: center;
  837. width: 100%;
  838. }
  839. #tab_item.item {
  840. display: flex;
  841. flex-direction: column;
  842. align-items: center;
  843. // margin: 0 24rpx;
  844. padding: 8rpx 0;
  845. cursor: pointer;
  846. flex: 1;
  847. transition: all 0.3s ease;
  848. .uni-icons {
  849. font-size: 44rpx;
  850. margin-bottom: 6rpx;
  851. }
  852. .txt {
  853. font-size: 26rpx;
  854. color: #333;
  855. }
  856. }
  857. #tab_list:first-of-type .item.active {
  858. .uni-icons {
  859. color: #000;
  860. }
  861. .txt {
  862. color: #000;
  863. font-weight: bold;
  864. }
  865. }
  866. .privacy-wrapper {
  867. z-index: 999;
  868. position: fixed;
  869. left: 0;
  870. top: 0;
  871. width: 100%;
  872. height: 100%;
  873. background: #7f7f7f;
  874. .privacy-box {
  875. position: absolute;
  876. left: 50%;
  877. top: 50%;
  878. transform: translate(-50%, -50%);
  879. width: 560rpx;
  880. padding: 50rpx 45rpx 0;
  881. background: #fff;
  882. border-radius: 20rpx;
  883. .title {
  884. text-align: center;
  885. font-size: 32rpx;
  886. text-align: center;
  887. color: #333;
  888. font-weight: 700;
  889. }
  890. .content {
  891. margin-top: 20rpx;
  892. line-height: 1.5;
  893. font-size: 26rpx;
  894. color: #666;
  895. text-indent: 54rpx;
  896. i {
  897. font-style: normal;
  898. color: $theme-color;
  899. }
  900. }
  901. .btn-box {
  902. margin-top: 40rpx;
  903. text-align: center;
  904. font-size: 30rpx;
  905. .btn-item {
  906. height: 82rpx;
  907. line-height: 82rpx;
  908. background: linear-gradient(90deg, #f67a38 0%, #f11b09 100%);
  909. color: #fff;
  910. border-radius: 41rpx;
  911. }
  912. .btn {
  913. padding: 30rpx 0;
  914. }
  915. }
  916. }
  917. }
  918. }
  919. .page-index {
  920. position: relative;
  921. z-index: 1;
  922. height: 100%;
  923. .top-box {
  924. padding-top: 168rpx;
  925. //background: linear-gradient(180deg, #ffe079 0%, #ffffff 100%);
  926. //background-image: url("https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/jianbianBG.png");
  927. background-size: 100% 100%;
  928. }
  929. }
  930. .header {
  931. //position: sticky;
  932. //top: 0;
  933. //z-index: 200000;
  934. width: 100%;
  935. padding: 28rpx 20rpx 10rpx;
  936. .serch-wrapper {
  937. //margin-top: var(--status-bar-height);
  938. margin-bottom: 30rpx;
  939. display: flex;
  940. justify-content: center;
  941. align-items: center;
  942. /* #ifdef MP-WEIXIN */
  943. width: 100%;
  944. /* #endif */
  945. .logo {
  946. width: 154rpx;
  947. height: 47rpx;
  948. margin-right: 24rpx;
  949. }
  950. image {
  951. width: 118rpx;
  952. height: 42rpx;
  953. }
  954. .input {
  955. display: flex;
  956. align-items: center;
  957. width: 100%;
  958. height: 80rpx;
  959. background-color: #ffffff;
  960. border-radius: 20rpx;
  961. font-size: 28rpx;
  962. color: #868686;
  963. .iconfont {
  964. margin: 0 10rpx;
  965. font-size: 26rpx;
  966. color: #666666;
  967. }
  968. .searchImg{
  969. width: 32rpx;
  970. height: 32rpx;
  971. margin: 0 20rpx;
  972. }
  973. }
  974. }
  975. .tabNav {
  976. padding-top: 24rpx;
  977. }
  978. }
  979. .page_content {
  980. padding: 0 30rpx;
  981. }
  982. .index-product-wrapper {
  983. padding: 0 30rpx;
  984. margin-bottom: 110rpx;
  985. min-height: 700rpx;
  986. //background: #fff;
  987. &.on {
  988. min-height: 1500rpx;
  989. }
  990. .list-box {
  991. display: flex;
  992. flex-wrap: wrap;
  993. justify-content: space-between;
  994. .item {
  995. width: 48.99%;
  996. //height: 490rpx;
  997. background-color: #ffffff;
  998. box-shadow: 0rpx 3rpx 13rpx 0rpx rgba(0, 0, 0, 0.13);
  999. border-radius: 20rpx;
  1000. margin-bottom: 20rpx;
  1001. overflow: hidden;
  1002. display: flex;
  1003. flex-direction: column;
  1004. justify-content: space-between;
  1005. .pictrue {
  1006. position: relative;
  1007. image {
  1008. width: 100%;
  1009. height: 330rpx;
  1010. }
  1011. }
  1012. .text-info {
  1013. padding: 10rpx 20rpx 15rpx;
  1014. .title {
  1015. color: #222222;
  1016. display: flex;
  1017. align-items: center;
  1018. justify-items: space-between;
  1019. .tip {
  1020. width: 61rpx;
  1021. height: auto;
  1022. font-size: 22rpx;
  1023. display: flex;
  1024. justify-content: center;
  1025. align-items: center;
  1026. color: #ffffff;
  1027. position: relative;
  1028. margin-right: 5rpx;
  1029. background-color: #ef4800;
  1030. border-radius: 5rpx;
  1031. }
  1032. .text{
  1033. width: 80%;
  1034. }
  1035. .weight{
  1036. background-color: rgba(197, 128, 3, 0.10);
  1037. color: #C58003;
  1038. font-size: 24rpx;
  1039. padding: 8rpx 16rpx;
  1040. border-radius: 8rpx;
  1041. float: right;
  1042. }
  1043. }
  1044. .bottom-row {
  1045. color: $theme-color;
  1046. display: flex;
  1047. justify-content: space-between;
  1048. align-items: center;
  1049. font-size: 28rpx;
  1050. margin: 10rpx 0 0;
  1051. .price {
  1052. padding-bottom: 4rpx;
  1053. font-weight: 800;
  1054. white-space: nowrap;
  1055. font-size: 28rpx;
  1056. color: #f16327;
  1057. }
  1058. .sales {
  1059. font-size: 22rpx;
  1060. white-space: nowrap;
  1061. color: #999999;
  1062. }
  1063. }
  1064. .merchantInfo{
  1065. display: flex;
  1066. align-items: center;
  1067. height: 60rpx;
  1068. }
  1069. .merchantLogo{
  1070. width: 40rpx;
  1071. height: 40rpx;
  1072. border-radius: 50%;
  1073. margin-right: 20rpx;
  1074. }
  1075. .merchantName{
  1076. font-size: 24rpx;
  1077. color: #333;
  1078. }
  1079. }
  1080. }
  1081. &.on {
  1082. display: flex;
  1083. }
  1084. }
  1085. }
  1086. .top-bg-box2 {
  1087. overflow: hidden;
  1088. padding: 20rpx;
  1089. box-sizing: border-box;
  1090. .title{
  1091. font-size: 32rpx;
  1092. color: #333333;
  1093. font-weight: bold;
  1094. line-height: 60rpx;
  1095. }
  1096. }
  1097. .top-bg-box {
  1098. overflow: hidden;
  1099. padding: 20rpx;
  1100. box-sizing: border-box;
  1101. // background-image: linear-gradient(
  1102. // to bottom,
  1103. // $header-color 0%,
  1104. // $header-color 10%,
  1105. // #ffe9a1 50%,
  1106. // transparent 100%
  1107. // );
  1108. .card{
  1109. background-color: #fff;
  1110. padding: 4rpx;
  1111. box-sizing: border-box;
  1112. border-radius: 20rpx;
  1113. .cardbgLinear{
  1114. padding: 20rpx 16rpx;
  1115. box-sizing: border-box;
  1116. border-radius: 20rpx;
  1117. background: linear-gradient(to bottom,
  1118. rgba(255, 240, 200, 0.7) 0%,
  1119. rgba(255, 240, 200, 0.4) 8%,
  1120. rgba(255, 255, 255, 1) 20%,
  1121. rgba(255, 255, 255, 1) 100%);
  1122. }
  1123. }
  1124. }
  1125. .top-bg-box {
  1126. .title {
  1127. display: flex;
  1128. justify-content: space-between; // 左右两端对齐
  1129. align-items: center; // 垂直居中
  1130. .title-left {
  1131. display: flex;
  1132. align-items: center;
  1133. .ssjj {
  1134. width: 150rpx;
  1135. height: 36rpx;
  1136. vertical-align: middle;
  1137. }
  1138. .updateTime {
  1139. font-size: 24rpx;
  1140. color: #666666;
  1141. padding: 0 20rpx;
  1142. box-sizing: border-box;
  1143. }
  1144. }
  1145. .more {
  1146. display: flex;
  1147. align-items: center;
  1148. .txt {
  1149. font-size: 28rpx;
  1150. color: #666666;
  1151. }
  1152. .right {
  1153. width: 40rpx;
  1154. vertical-align: middle;
  1155. margin-left: 10rpx; // 添加一些间距
  1156. }
  1157. }
  1158. }
  1159. }
  1160. .nav-list {
  1161. width: 100%;
  1162. display: flex;
  1163. justify-content: space-between;
  1164. align-items: center;
  1165. padding: 0 40rpx 0;
  1166. margin-top: 30rpx;
  1167. .item {
  1168. text-align: center;
  1169. .price{
  1170. font-size: 44rpx;
  1171. color: #FD5B37;
  1172. font-weight: bold;
  1173. .unit{
  1174. font-size: 28rpx;
  1175. }
  1176. }
  1177. .txt{
  1178. font-size: 28rpx;
  1179. color: #666666;
  1180. line-height: 60rpx;
  1181. }
  1182. }
  1183. }
  1184. .no-data {
  1185. margin: 150rpx auto 0;
  1186. text-align: center;
  1187. img {
  1188. width: 65%;
  1189. height: auto;
  1190. }
  1191. }
  1192. .inde-nav-bar{
  1193. .page-title{
  1194. color: #fff;
  1195. }
  1196. }
  1197. // 分类卡片区域样式
  1198. .classify-section {
  1199. background: #fff;
  1200. margin: 0 20rpx;
  1201. border-radius: 16rpx;
  1202. padding: 30rpx 0 10rpx;
  1203. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
  1204. }
  1205. .classify-scroll {
  1206. width: 100%;
  1207. white-space: nowrap;
  1208. }
  1209. .classify-container {
  1210. width: 100%;
  1211. display: inline-flex;
  1212. flex-wrap: nowrap;
  1213. min-width: 100%;
  1214. }
  1215. .classify-item {
  1216. display: inline-flex;
  1217. flex-direction: column;
  1218. align-items: center;
  1219. justify-content: center;
  1220. width: 175rpx;
  1221. flex-shrink: 0;
  1222. box-sizing: border-box;
  1223. .classify-img {
  1224. width: 100rpx;
  1225. height: 100rpx;
  1226. }
  1227. .classify-txt {
  1228. font-size: 24rpx;
  1229. color: #666;
  1230. margin-top: 8rpx;
  1231. text-align: center;
  1232. white-space: nowrap;
  1233. overflow: hidden;
  1234. text-overflow: ellipsis;
  1235. max-width: 120rpx;
  1236. }
  1237. }
  1238. .nav-slot{
  1239. //width: 60%;
  1240. display: flex;
  1241. justify-content: space-between;
  1242. align-items: center;
  1243. .dianpu{
  1244. width: 32rpx;
  1245. }
  1246. .zhankai{
  1247. width: 20rpx;
  1248. }
  1249. .storeName{
  1250. width: 60%;
  1251. font-size: 28rpx;
  1252. color: #333;
  1253. }
  1254. }
  1255. .no-data {
  1256. margin: 150rpx auto 0;
  1257. text-align: center;
  1258. img {
  1259. width: 65%;
  1260. height: auto;
  1261. }
  1262. }
  1263. .mores-txt {
  1264. width: 100%;
  1265. align-items: center;
  1266. justify-content: center;
  1267. height: 70rpx;
  1268. color: #999;
  1269. font-size: 24rpx;
  1270. .iconfont {
  1271. margin-top: 2rpx;
  1272. font-size: 20rpx;
  1273. }
  1274. }
  1275. :deep(.page-title){
  1276. font-size: 36rpx;
  1277. }
  1278. </style>