index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419
  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. padding-bottom: 200rpx;
  924. box-sizing: border-box;
  925. .top-box {
  926. padding-top: 168rpx;
  927. //background: linear-gradient(180deg, #ffe079 0%, #ffffff 100%);
  928. //background-image: url("https://sb-admin.oss-cn-shenzhen.aliyuncs.com/shuibei-mini/new-mini/jianbianBG.png");
  929. background-size: 100% 100%;
  930. }
  931. }
  932. .header {
  933. //position: sticky;
  934. //top: 0;
  935. //z-index: 200000;
  936. width: 100%;
  937. padding: 28rpx 20rpx 10rpx;
  938. .serch-wrapper {
  939. //margin-top: var(--status-bar-height);
  940. margin-bottom: 30rpx;
  941. display: flex;
  942. justify-content: center;
  943. align-items: center;
  944. /* #ifdef MP-WEIXIN */
  945. width: 100%;
  946. /* #endif */
  947. .logo {
  948. width: 154rpx;
  949. height: 47rpx;
  950. margin-right: 24rpx;
  951. }
  952. image {
  953. width: 118rpx;
  954. height: 42rpx;
  955. }
  956. .input {
  957. display: flex;
  958. align-items: center;
  959. width: 100%;
  960. height: 80rpx;
  961. background-color: #ffffff;
  962. border-radius: 20rpx;
  963. font-size: 28rpx;
  964. color: #868686;
  965. .iconfont {
  966. margin: 0 10rpx;
  967. font-size: 26rpx;
  968. color: #666666;
  969. }
  970. .searchImg{
  971. width: 32rpx;
  972. height: 32rpx;
  973. margin: 0 20rpx;
  974. }
  975. }
  976. }
  977. .tabNav {
  978. padding-top: 24rpx;
  979. }
  980. }
  981. .page_content {
  982. padding: 0 30rpx;
  983. }
  984. .index-product-wrapper {
  985. padding: 0 30rpx;
  986. margin-bottom: 110rpx;
  987. min-height: 700rpx;
  988. //background: #fff;
  989. &.on {
  990. min-height: 1500rpx;
  991. }
  992. .list-box {
  993. display: flex;
  994. flex-wrap: wrap;
  995. justify-content: space-between;
  996. .item {
  997. width: 48.99%;
  998. //height: 490rpx;
  999. background-color: #ffffff;
  1000. box-shadow: 0rpx 3rpx 13rpx 0rpx rgba(0, 0, 0, 0.13);
  1001. border-radius: 20rpx;
  1002. margin-bottom: 20rpx;
  1003. overflow: hidden;
  1004. display: flex;
  1005. flex-direction: column;
  1006. justify-content: space-between;
  1007. .pictrue {
  1008. position: relative;
  1009. image {
  1010. width: 100%;
  1011. height: 330rpx;
  1012. }
  1013. }
  1014. .text-info {
  1015. padding: 10rpx 20rpx 15rpx;
  1016. .title {
  1017. color: #222222;
  1018. display: flex;
  1019. align-items: center;
  1020. justify-items: space-between;
  1021. .tip {
  1022. width: 61rpx;
  1023. height: auto;
  1024. font-size: 22rpx;
  1025. display: flex;
  1026. justify-content: center;
  1027. align-items: center;
  1028. color: #ffffff;
  1029. position: relative;
  1030. margin-right: 5rpx;
  1031. background-color: #ef4800;
  1032. border-radius: 5rpx;
  1033. }
  1034. .text{
  1035. width: 80%;
  1036. }
  1037. .weight{
  1038. background-color: rgba(197, 128, 3, 0.10);
  1039. color: #C58003;
  1040. font-size: 24rpx;
  1041. padding: 8rpx 16rpx;
  1042. border-radius: 8rpx;
  1043. float: right;
  1044. }
  1045. }
  1046. .bottom-row {
  1047. color: $theme-color;
  1048. display: flex;
  1049. justify-content: space-between;
  1050. align-items: center;
  1051. font-size: 28rpx;
  1052. margin: 10rpx 0 0;
  1053. .price {
  1054. padding-bottom: 4rpx;
  1055. font-weight: 800;
  1056. white-space: nowrap;
  1057. font-size: 28rpx;
  1058. color: #f16327;
  1059. }
  1060. .sales {
  1061. font-size: 22rpx;
  1062. white-space: nowrap;
  1063. color: #999999;
  1064. }
  1065. }
  1066. .merchantInfo{
  1067. display: flex;
  1068. align-items: center;
  1069. height: 60rpx;
  1070. }
  1071. .merchantLogo{
  1072. width: 40rpx;
  1073. height: 40rpx;
  1074. border-radius: 50%;
  1075. margin-right: 20rpx;
  1076. }
  1077. .merchantName{
  1078. font-size: 24rpx;
  1079. color: #333;
  1080. }
  1081. }
  1082. }
  1083. &.on {
  1084. display: flex;
  1085. }
  1086. }
  1087. }
  1088. .top-bg-box2 {
  1089. overflow: hidden;
  1090. padding: 20rpx;
  1091. box-sizing: border-box;
  1092. .title{
  1093. font-size: 32rpx;
  1094. color: #333333;
  1095. font-weight: bold;
  1096. line-height: 60rpx;
  1097. }
  1098. }
  1099. .top-bg-box {
  1100. overflow: hidden;
  1101. padding: 20rpx;
  1102. box-sizing: border-box;
  1103. // background-image: linear-gradient(
  1104. // to bottom,
  1105. // $header-color 0%,
  1106. // $header-color 10%,
  1107. // #ffe9a1 50%,
  1108. // transparent 100%
  1109. // );
  1110. .card{
  1111. background-color: #fff;
  1112. padding: 4rpx;
  1113. box-sizing: border-box;
  1114. border-radius: 20rpx;
  1115. .cardbgLinear{
  1116. padding: 20rpx 16rpx;
  1117. box-sizing: border-box;
  1118. border-radius: 20rpx;
  1119. background: linear-gradient(to bottom,
  1120. rgba(255, 240, 200, 0.7) 0%,
  1121. rgba(255, 240, 200, 0.4) 8%,
  1122. rgba(255, 255, 255, 1) 20%,
  1123. rgba(255, 255, 255, 1) 100%);
  1124. }
  1125. }
  1126. }
  1127. .top-bg-box {
  1128. .title {
  1129. display: flex;
  1130. justify-content: space-between; // 左右两端对齐
  1131. align-items: center; // 垂直居中
  1132. .title-left {
  1133. display: flex;
  1134. align-items: center;
  1135. .ssjj {
  1136. width: 150rpx;
  1137. height: 36rpx;
  1138. vertical-align: middle;
  1139. }
  1140. .updateTime {
  1141. font-size: 24rpx;
  1142. color: #666666;
  1143. padding: 0 20rpx;
  1144. box-sizing: border-box;
  1145. }
  1146. }
  1147. .more {
  1148. display: flex;
  1149. align-items: center;
  1150. .txt {
  1151. font-size: 28rpx;
  1152. color: #666666;
  1153. }
  1154. .right {
  1155. width: 40rpx;
  1156. vertical-align: middle;
  1157. margin-left: 10rpx; // 添加一些间距
  1158. }
  1159. }
  1160. }
  1161. }
  1162. .nav-list {
  1163. width: 100%;
  1164. display: flex;
  1165. justify-content: space-between;
  1166. align-items: center;
  1167. padding: 0 40rpx 0;
  1168. margin-top: 30rpx;
  1169. .item {
  1170. text-align: center;
  1171. .price{
  1172. font-size: 44rpx;
  1173. color: #FD5B37;
  1174. font-weight: bold;
  1175. .unit{
  1176. font-size: 28rpx;
  1177. }
  1178. }
  1179. .txt{
  1180. font-size: 28rpx;
  1181. color: #666666;
  1182. line-height: 60rpx;
  1183. }
  1184. }
  1185. }
  1186. .no-data {
  1187. margin: 150rpx auto 0;
  1188. text-align: center;
  1189. img {
  1190. width: 65%;
  1191. height: auto;
  1192. }
  1193. }
  1194. .inde-nav-bar{
  1195. .page-title{
  1196. color: #fff;
  1197. }
  1198. }
  1199. // 分类卡片区域样式
  1200. .classify-section {
  1201. background: #fff;
  1202. margin: 0 20rpx;
  1203. border-radius: 16rpx;
  1204. padding: 30rpx 0 10rpx;
  1205. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.06);
  1206. }
  1207. .classify-scroll {
  1208. width: 100%;
  1209. white-space: nowrap;
  1210. }
  1211. .classify-container {
  1212. width: 100%;
  1213. display: inline-flex;
  1214. flex-wrap: nowrap;
  1215. min-width: 100%;
  1216. }
  1217. .classify-item {
  1218. display: inline-flex;
  1219. flex-direction: column;
  1220. align-items: center;
  1221. justify-content: center;
  1222. width: 175rpx;
  1223. flex-shrink: 0;
  1224. box-sizing: border-box;
  1225. .classify-img {
  1226. width: 100rpx;
  1227. height: 100rpx;
  1228. }
  1229. .classify-txt {
  1230. font-size: 24rpx;
  1231. color: #666;
  1232. margin-top: 8rpx;
  1233. text-align: center;
  1234. white-space: nowrap;
  1235. overflow: hidden;
  1236. text-overflow: ellipsis;
  1237. max-width: 120rpx;
  1238. }
  1239. }
  1240. .nav-slot{
  1241. //width: 60%;
  1242. display: flex;
  1243. justify-content: space-between;
  1244. align-items: center;
  1245. .dianpu{
  1246. width: 32rpx;
  1247. }
  1248. .zhankai{
  1249. width: 20rpx;
  1250. }
  1251. .storeName{
  1252. width: 60%;
  1253. font-size: 28rpx;
  1254. color: #333;
  1255. }
  1256. }
  1257. .no-data {
  1258. margin: 150rpx auto 0;
  1259. text-align: center;
  1260. img {
  1261. width: 65%;
  1262. height: auto;
  1263. }
  1264. }
  1265. .mores-txt {
  1266. width: 100%;
  1267. align-items: center;
  1268. justify-content: center;
  1269. height: 70rpx;
  1270. color: #999;
  1271. font-size: 24rpx;
  1272. .iconfont {
  1273. margin-top: 2rpx;
  1274. font-size: 20rpx;
  1275. }
  1276. }
  1277. :deep(.page-title){
  1278. font-size: 36rpx;
  1279. }
  1280. </style>