newIndex.vue 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703
  1. <template>
  2. <view>
  3. <view class="page-index" :class="{ bgf: navIndex > 0 }">
  4. <!-- 上半部分 -->
  5. <view class="top-box">
  6. <view class="header">
  7. <view class="serch-wrapper">
  8. <view class="logo" @click="goBack">
  9. <image src="@/static/logo1.png" mode=""></image>
  10. </view>
  11. <navigator
  12. url="/pages/goods_search/index"
  13. class="input"
  14. hover-class="none"
  15. ><text class="iconfont icon-sousuo"></text> 搜索商品</navigator
  16. >
  17. </view>
  18. </view>
  19. <!-- 快捷入口 -->
  20. <view class="top-bg-box">
  21. <view class="nav-list">
  22. <navigator
  23. class="item"
  24. :url="item.url"
  25. v-for="item in navMenus"
  26. :key="item.type"
  27. >
  28. <uni-icons
  29. :size="item.size"
  30. customPrefix="iconfont"
  31. :type="item.icon"
  32. ></uni-icons>
  33. <view class="txt">{{ item.name }}</view>
  34. </navigator>
  35. </view>
  36. </view>
  37. <!-- 轮播图 -->
  38. <up-swiper
  39. class="swiper-box"
  40. :list="list1"
  41. image-fit="cover"
  42. indicator
  43. indicatorMode="line"
  44. :circular="true"
  45. keyName="url"
  46. @click="clickSwiper"
  47. ></up-swiper>
  48. <!-- 活动专区 -->
  49. <view class="active-contanier">
  50. <scroll-view
  51. class="active-scroll"
  52. scroll-x="true"
  53. show-scrollbar="false"
  54. :enable-flex="true"
  55. >
  56. <view class="active-scroll-content">
  57. <view class="active-item" @click="goFlashSale">
  58. <view class="title-box">
  59. <view class="title">福利整点秒杀 </view>
  60. <up-count-down
  61. :time="
  62. (skillPro.storeSeckillProduct?.seckillEndTimeStamp || 0) -
  63. Date.now() >
  64. 0
  65. ? (skillPro.storeSeckillProduct?.seckillEndTimeStamp ||
  66. 0) - Date.now()
  67. : 0
  68. "
  69. format="HH:mm:ss"
  70. autoStart
  71. millisecond
  72. @change="onChange"
  73. >
  74. <view class="time">
  75. <view class="time__custom">
  76. <text class="time__custom__item">{{
  77. timeData.hours > 10
  78. ? timeData.hours
  79. : "0" + timeData.hours
  80. }}</text>
  81. </view>
  82. <text class="time__doc">:</text>
  83. <view class="time__custom">
  84. <text class="time__custom__item">{{
  85. timeData.minutes
  86. }}</text>
  87. </view>
  88. <text class="time__doc">:</text>
  89. <view class="time__custom">
  90. <text class="time__custom__item">{{
  91. timeData.seconds
  92. }}</text>
  93. </view>
  94. </view>
  95. </up-count-down>
  96. </view>
  97. <view class="active-box">
  98. <view class="active-item-left">
  99. <view class="image-box">
  100. <image :src="skillPro.storeSeckillProduct?.image"></image>
  101. </view>
  102. </view>
  103. <view class="active-item-right">
  104. <view class="ms">{{
  105. skillPro.storeSeckillProduct?.storeName || ""
  106. }}</view>
  107. <view
  108. class="tag"
  109. v-for="tag in switchTagName(
  110. skillPro.storeSeckillProduct?.attrValue?.[0]?.attrValue
  111. )"
  112. :key="tag.key"
  113. >
  114. <text class="tag-text">
  115. {{ tag.key }}: {{ tag.value }}</text
  116. >
  117. </view>
  118. <view class="price-box">
  119. <view class="price"
  120. >¥{{
  121. skillPro.storeSeckillProduct?.attrValue?.[0]
  122. ? totalPrice(
  123. skillPro.storeSeckillProduct.attrValue[0]
  124. )
  125. : "0.00"
  126. }}</view
  127. >
  128. <view class="btn">立即前往</view>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. <!-- <view class="active-item" @click="goGroupBuying">
  134. <view class="title-box">
  135. <view class="title">团购拼团 </view>
  136. <view class="live">Live</view>
  137. </view>
  138. <view class="active-box">
  139. <view class="active-item-left">
  140. <view class="image-box">
  141. <image src="@/static/images/shoulian.png"></image>
  142. </view>
  143. </view>
  144. <view class="active-item-right">
  145. <view class="ms">足金房车钱编织手绳秒杀即将开始</view>
  146. <view class="tag">
  147. <text class="tag-text"> 抽号商品 </text>
  148. </view>
  149. <view class="price-box">
  150. <view class="price">¥{{ 111 }}</view>
  151. <view class="btn">立即前往</view>
  152. </view>
  153. </view>
  154. </view>
  155. </view> -->
  156. <view class="active-item" @click="goFactory">
  157. <view class="title-box">
  158. <view class="title">工厂定制 </view>
  159. <view class="live">GO</view>
  160. </view>
  161. <view class="active-box">
  162. <view class="active-item-left">
  163. <view class="image-box">
  164. <image
  165. :src="
  166. factoryPro.image || '@/static/images/xianglian.png'
  167. "
  168. />
  169. </view>
  170. </view>
  171. <view class="active-item-right">
  172. <view class="ms">
  173. {{ factoryPro.name || "足金999宝宝锁项链秒杀即将开始" }}
  174. </view>
  175. <view class="tag">
  176. <text class="tag-text">
  177. {{ factoryPro.categoryName || "抽号商品" }}
  178. </text>
  179. </view>
  180. <view class="tag">
  181. <text class="tag-text">
  182. {{ factoryPro.processList[0].name || "抽号商品" }}:
  183. {{
  184. factoryPro.processList[0].feePerGram || "抽号商品"
  185. }}¥/g
  186. </text>
  187. </view>
  188. <view class="price-box">
  189. <!-- <view class="price">¥{{ 111 }}</view> -->
  190. <view class="btn">立即前往</view>
  191. </view>
  192. </view>
  193. </view>
  194. </view>
  195. <!-- <view class="active-item">
  196. <view class="title-box">
  197. <view class="title">微瑕品 </view>
  198. <view class="live weixia">正</view>
  199. </view>
  200. <view class="active-box">
  201. <view class="active-item-left">
  202. <view class="image-box">
  203. <image src="@/static/images/dajintiao.png"></image>
  204. </view>
  205. </view>
  206. <view class="active-item-right">
  207. <view class="ms">足金古法无事牌吊坠秒杀即将开始</view>
  208. <view class="tag">
  209. <text class="tag-text"> 抽号商品 </text>
  210. </view>
  211. <view class="price-box">
  212. <view class="price">¥{{ 111 }}</view>
  213. <view class="btn">立即前往</view>
  214. </view>
  215. </view>
  216. </view>
  217. </view> -->
  218. </view>
  219. </scroll-view>
  220. </view>
  221. </view>
  222. <!-- <up-sticky :offsetTop="stickyTop" customNavHeight="62px"> -->
  223. <view class="sticky-box">
  224. <view class="scroll-view_H">
  225. <view class="tab nav-bd" id="tab_list">
  226. <view
  227. id="tab_item"
  228. :class="{ active: listActive == index }"
  229. class="item"
  230. v-for="(item, index) in goodsNavs"
  231. :key="index"
  232. @click="ProductNavTab(item, index)"
  233. >
  234. <uni-icons
  235. customPrefix="iconfont"
  236. :color="listActive == index ? '#000' : '#000'"
  237. :type="item.icon"
  238. :size="item.size"
  239. ></uni-icons>
  240. <!-- <i class="item-icon iconfont" :class="item.icon"></i> -->
  241. <view class="txt">{{ item.name }}</view>
  242. <!-- <view class="label">{{ item.info }}</view> -->
  243. </view>
  244. </view>
  245. </view>
  246. <view class="second-nav" v-if="goodsTwoList.length > 0">
  247. <view
  248. :class="{ active: currentSecondCategoryId === item.id }"
  249. class="second-nav-item"
  250. v-for="(item, index) in goodsTwoList"
  251. :key="index"
  252. @click="handleSecondCategoryClick(item.id)"
  253. >
  254. <!-- <uni-icons
  255. customPrefix="iconfont"
  256. :type="item.icon || 'icon-erjifenlei'"
  257. :size="25"
  258. ></uni-icons> -->
  259. <view class="txt">{{ item.name }}</view>
  260. </view>
  261. </view>
  262. </view>
  263. <!-- </up-sticky> -->
  264. <!-- 首发新品 -->
  265. <view class="index-product-wrapper" :class="iSshowH ? 'on' : ''">
  266. <view
  267. class="list-box animated"
  268. :class="goodsList.length > 0 ? 'fadeIn on' : ''"
  269. >
  270. <view
  271. class="item"
  272. v-for="(item, index) in calculatedProducts"
  273. :key="index"
  274. @click="goDetail(item)"
  275. >
  276. <view class="pictrue">
  277. <image :src="item.image" mode=""></image>
  278. </view>
  279. <view class="text-info">
  280. <view class="title line2"
  281. ><text class="tip">现货</text>{{ item.storeName }}</view
  282. >
  283. <view class="bottom-row">
  284. <!-- <text class="price">工费: {{ item.price }}/克</text> -->
  285. <text class="price">¥ {{ item.totalLaborCost }}</text>
  286. <text class="sales">
  287. 已售{{ Number(item.sales || 0) + Number(item.ficti || 0) }}件
  288. </text>
  289. <!-- <view class="txt">券</view> -->
  290. </view>
  291. </view>
  292. </view>
  293. </view>
  294. <view class="loadingicon acea-row row-center-wrapper" v-if="goodScroll">
  295. <text
  296. class="loading iconfont icon-jiazai"
  297. :hidden="loading == false"
  298. ></text>
  299. </view>
  300. <view class="no-data" v-if="isNoDataState">
  301. <image
  302. 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"
  303. />
  304. </view>
  305. <view class="mores-txt flex" v-if="!goodScroll && !isNoDataState">
  306. <text>我是有底线的</text>
  307. </view>
  308. </view>
  309. <!-- </view> -->
  310. </view>
  311. <drag-button
  312. :isDock="true"
  313. :price="viprealGoldprice"
  314. :existTabBar="true"
  315. @btnClick="btnClick"
  316. />
  317. <!-- 悬浮球固定 -->
  318. <!-- <view class="Hoverball">
  319. <text class="title">实时金价</text>
  320. <text class="price">{{ realGoldprice }}</text>
  321. </view> -->
  322. </view>
  323. </template>
  324. <script setup>
  325. // 获取实时金价
  326. import useRealGoldPrice from "@/hooks/useRealGoldPrice";
  327. // 测试拖拽
  328. import dragButton from "@/components/drag-button/drag-button.vue";
  329. import { onLoad, onShow, onReachBottom } from "@dcloudio/uni-app";
  330. import { ref, onMounted, reactive, computed, getCurrentInstance } from "vue";
  331. import Auth from "@/libs/wechat";
  332. import Cache from "@/utils/cache";
  333. import { getIndexData, getCoupons, setCouponReceive } from "@/api/api.js";
  334. import { getProductListAPI } from "@/api/factory.js";
  335. import { getShare, kefuConfig } from "@/api/public.js";
  336. import {
  337. getGroomList as getGroomListApi,
  338. getProductByCategoryId,
  339. } from "@/api/store.js";
  340. import { goShopDetail } from "@/libs/order.js";
  341. import { silenceBindingSpread } from "@/utils";
  342. import { getUserLevelInfo } from "@/api/user";
  343. import { useStoreRights } from "@/stores/rights";
  344. const userBenefits = ref({});
  345. // 获取用户权益
  346. const rightsStore = useStoreRights();
  347. // 获取实时金价
  348. const { realGoldprice, fetchGoldPrice } = useRealGoldPrice("RTJ_Au");
  349. const getUserBenefits = async () => {
  350. try {
  351. const res = await getUserLevelInfo(appStore.userInfo.userId);
  352. userBenefits.value = res.data || { sold: 0, buy: 0 }; // 默认权益为0,避免NaN
  353. } catch (error) {
  354. console.error("获取用户权益失败:", error);
  355. userBenefits.value = { sold: 0, buy: 0 }; // 出错时默认权益为0
  356. }
  357. };
  358. // 黄金调整价
  359. const adjustGoldprice = computed(() => {
  360. const res = rightsStore.userBenefits.nobleMeta?.find(
  361. (gold) => gold.name == "黄金"
  362. );
  363. return res;
  364. });
  365. const viprealGoldprice = computed(() => {
  366. const res =
  367. Number(realGoldprice.value) -
  368. Number(rightsStore.userBenefits.buy) +
  369. Number(adjustGoldprice.value?.sellPriceAdjust) || 0;
  370. return Number(res).toFixed(2);
  371. });
  372. const btnClick = () => {
  373. uni.navigateTo({
  374. url: "/pages/mall/dapan",
  375. });
  376. };
  377. // };
  378. import { useAppStore } from "@/stores/app";
  379. const appStore = useAppStore();
  380. const app = getApp();
  381. const instance = getCurrentInstance();
  382. const navH = ref("");
  383. const marTop = ref(0);
  384. const searchH = ref(0);
  385. const loading = ref(false);
  386. // Authorization
  387. const isShowAuth = ref(false);
  388. const iShidden = ref(false);
  389. const window = ref(false);
  390. // Navigation and Tabs
  391. const navIndex = ref(0);
  392. const ProductNavindex = ref(0);
  393. const listActive = ref(0);
  394. const tabsScrollLeft = ref(0);
  395. const scrollLeft = ref(0);
  396. const lineStyle = ref({});
  397. const duration = ref(0.2);
  398. // Home Page Data
  399. const logoUrl = ref("");
  400. const site_name = ref("");
  401. const imgUrls = ref([]);
  402. const menus = ref([]);
  403. const roll = ref([]);
  404. const explosiveMoney = ref([]);
  405. const goodType = ref(1);
  406. const goodScroll = ref(true);
  407. const iSshowH = ref(false);
  408. const stickyTop = ref(0);
  409. const navMenus = ref([
  410. {
  411. name: "商城订单",
  412. icon: "icon-wodedingdan1",
  413. type: 1,
  414. url: "/pages/order_list/index",
  415. size: 25,
  416. },
  417. {
  418. name: "购物车",
  419. icon: "icon-gouwuche",
  420. type: 2,
  421. url: "/pages/order_addcart/order_addcart",
  422. size: 26,
  423. },
  424. {
  425. name: "卡卷包",
  426. icon: "icon-kabao",
  427. type: 3,
  428. url: "/pages/users/user_coupon/index",
  429. size: 28,
  430. },
  431. {
  432. name: "客服消息",
  433. icon: "icon-xiaoxi",
  434. type: 4,
  435. url: "/pages/message_create/message_create",
  436. size: 26,
  437. },
  438. ]);
  439. // 轮播图数据
  440. const list1 = ref([]);
  441. // Product Lists
  442. const sortProduct = ref([]);
  443. const goodsList = ref([]);
  444. const goodsTwoList = ref([]);
  445. const currentSecondCategoryId = ref(null);
  446. const goodsNavs = ref([
  447. { name: "新品推荐", type: 1, icon: "icon-xinpintuijian", size: 25 },
  448. { name: "黄金金条", type: 2, icon: "icon-touzijintiao1", size: 25 },
  449. { name: "黄金首饰", type: 3, icon: "icon-huangjinshoushi", size: 25 },
  450. { name: "其他", type: 4, icon: "icon-a-ziyuan97", size: 25 },
  451. ]);
  452. const skillPro = ref({});
  453. const factoryPro = ref({});
  454. // 前往福利秒杀
  455. const goFlashSale = () => {
  456. uni.navigateTo({
  457. url: "/pages/users/utils/flashSale/newIndex",
  458. });
  459. };
  460. // 前往团购
  461. const goGroupBuying = () => {
  462. uni.navigateTo({
  463. url: "/pages/group_buying/index",
  464. });
  465. };
  466. // Pagination
  467. const params = ref({
  468. page: 1,
  469. limit: 10,
  470. });
  471. const hotScroll = ref(false);
  472. const headerHeight = ref(0);
  473. // Other
  474. const couponList = ref([]);
  475. const configApi = ref({});
  476. // pinia
  477. const isLogin = appStore.isLogin;
  478. const uid = appStore.uidComputed;
  479. const arrTemp = [
  480. "beforePay",
  481. "afterPay",
  482. "refundApply",
  483. "beforeRecharge",
  484. "createBargain",
  485. "pink",
  486. ];
  487. // 前往定制工厂
  488. const goFactory = () => {
  489. uni.navigateTo({
  490. url: "/pages/users/utils/factory/index",
  491. });
  492. };
  493. // Coupon Functions
  494. const getCoupon = async (id, index) => {
  495. try {
  496. await setCouponReceive(id);
  497. couponList.value[index].isUse = true;
  498. uni.showToast({ title: "领取成功" });
  499. } catch (err) {
  500. uni.showToast({ title: err.message, icon: "none" });
  501. }
  502. };
  503. // Tab Navigation Functions
  504. const clickSort = (index) => {
  505. listActive.value = index;
  506. };
  507. const scroll = (e) => {
  508. scrollLeft.value = e.detail.scrollLeft;
  509. };
  510. // Home Page Data Functions
  511. const getIndexConfig = async () => {
  512. try {
  513. loading.value = true;
  514. const res = await getIndexData();
  515. uni.setNavigationBarTitle({ title: "首页" });
  516. skillPro.value = res.data.storeSeckillProductDetailResponse;
  517. const factoryProRes = await getProductListAPI(0);
  518. factoryPro.value = factoryProRes.data[0];
  519. logoUrl.value = res.data.logoUrl;
  520. site_name.value = "首页";
  521. list1.value = res.data.banner.map((v) => {
  522. return {
  523. url: v.pic,
  524. title: "",
  525. type: "image",
  526. navUrl: v.url,
  527. };
  528. });
  529. // console.log("list1==========>", list1.value);
  530. menus.value = res.data.menus;
  531. roll.value = res.data.roll || [];
  532. // #ifdef H5
  533. appStore.SET_CHATURL(res.data.yzfUrl);
  534. Cache.set("chatUrl", res.data.yzfUrl);
  535. // #endif
  536. const iconTypes = [
  537. "icon-shouye",
  538. "icon-shouye",
  539. "icon-shouye",
  540. "icon-shouye",
  541. ];
  542. explosiveMoney.value = res.data.explosiveMoney.map((v, i) => ({
  543. ...v,
  544. icon: iconTypes[i] || "icon-shouye",
  545. }));
  546. await getGroomList();
  547. await shareApi();
  548. await getcouponList();
  549. } catch (err) {
  550. console.error(err);
  551. } finally {
  552. loading.value = false;
  553. }
  554. };
  555. const getcouponList = async () => {
  556. try {
  557. const res = await getCoupons({ page: 1, limit: 6 });
  558. couponList.value = res.data;
  559. // #ifdef MP
  560. uni.getSetting({
  561. success(res) {
  562. window.value =
  563. !res.authSetting["scope.userInfo"] && couponList.value.length
  564. ? true
  565. : false;
  566. iShidden.value = res.authSetting["scope.userInfo"];
  567. },
  568. });
  569. // #endif
  570. // #ifndef MP
  571. window.value = isLogin ? false : res.data.length ? true : false;
  572. // #endif
  573. } catch (err) {
  574. uni.showToast({ title: err.message, icon: "none" });
  575. }
  576. };
  577. const shareApi = async () => {
  578. try {
  579. const res = await getShare();
  580. configApi.value = res.data;
  581. // #ifdef H5
  582. setOpenShare(res.data);
  583. // #endif
  584. } catch (err) {
  585. console.error(err);
  586. }
  587. };
  588. const getChatUrL = async () => {
  589. try {
  590. const res = await kefuConfig();
  591. appStore.SET_CHATURL(res.data.yzfUrl);
  592. Cache.set("chatUrl", res.data.yzfUrl);
  593. } catch (err) {
  594. console.error(err);
  595. }
  596. };
  597. const setOpenShare = (data) => {
  598. if (Auth.isWeixin()) {
  599. const configAppMessage = {
  600. desc: data.synopsis,
  601. title: data.title,
  602. link: location.href,
  603. imgUrl: data.img,
  604. };
  605. Auth.wechatEvevt(
  606. ["updateAppMessageShareData", "updateTimelineShareData"],
  607. configAppMessage
  608. );
  609. }
  610. };
  611. // Authorization
  612. const authColse = (e) => {
  613. isShowAuth.value = e;
  614. };
  615. // Product Navigation
  616. const ProductNavTab = (item, index) => {
  617. goodsList.value = [];
  618. goodsTwoList.value = [];
  619. listActive.value = index;
  620. goodType.value = item.type;
  621. ProductNavindex.value = index;
  622. params.value.page = 1;
  623. goodScroll.value = true;
  624. currentSecondCategoryId.value = null;
  625. getGroomList(true);
  626. };
  627. // Product Details
  628. const goDetail = async (item) => {
  629. if (item.activityH5 && item.activityH5.type === "2" && !isLogin) {
  630. toLogin();
  631. } else {
  632. await goShopDetail(item, uid);
  633. uni.navigateTo({ url: `/pages/goods_details/index?id=${item.id}` });
  634. }
  635. };
  636. const godDetail = async (item) => {
  637. await goShopDetail(item, uid);
  638. uni.navigateTo({ url: `/pages/goods_details/index?id=${item.id}` });
  639. };
  640. const isNoDataState = computed(() => {
  641. return goodsList.value.length === 0 && !loading.value;
  642. });
  643. // Product Lists
  644. const getGroomList = async (onloadH = false) => {
  645. if (!goodScroll.value) return;
  646. if (onloadH) iSshowH.value = true;
  647. try {
  648. loading.value = true;
  649. const { data } = await getGroomListApi(goodType.value, params.value);
  650. iSshowH.value = false;
  651. goodsList.value = [...goodsList.value, ...data.productList.list] || [];
  652. goodsTwoList.value = data.secondLevelCategories || [];
  653. goodScroll.value = data.productList.list.length >= params.value.limit;
  654. params.value.page++;
  655. currentSecondCategoryId.value = null;
  656. } catch (err) {
  657. console.error(err);
  658. } finally {
  659. loading.value = false;
  660. }
  661. };
  662. async function clickSwiper(index) {
  663. const imgItem = list1.value[index];
  664. try {
  665. if (imgItem.navUrl !== "#") {
  666. await uni.navigateTo({ url: imgItem.navUrl });
  667. } else {
  668. uni.previewImage({
  669. current: index,
  670. urls: list1.value.map((item) => item.url) || [],
  671. });
  672. }
  673. } catch (err) {
  674. uni.previewImage({
  675. current: index,
  676. urls: list1.value.map((item) => item.url) || [],
  677. });
  678. return;
  679. }
  680. }
  681. const handleSecondCategoryClick = async (categoryId) => {
  682. currentSecondCategoryId.value = categoryId;
  683. params.value.page = 1;
  684. goodsList.value = [];
  685. goodScroll.value = false;
  686. try {
  687. loading.value = true;
  688. const { data } = await getProductByCategoryId(categoryId, params.value);
  689. goodsList.value = data.list;
  690. goodScroll.value = data.list.length >= params.value.limit;
  691. params.value.page++;
  692. } catch (err) {
  693. console.error(err);
  694. } finally {
  695. loading.value = false;
  696. }
  697. };
  698. const get_host_product = async () => {
  699. if (hotScroll.value) return;
  700. try {
  701. loading.onMounted(() => {});
  702. } catch (err) {
  703. console.error(err);
  704. } finally {
  705. loading.value = false;
  706. }
  707. };
  708. onLoad((option) => {
  709. getUserBenefits();
  710. uni.getSystemInfo({
  711. success(res) {
  712. appStore.SYSTEM_PLATFORM(res.platform);
  713. },
  714. });
  715. // uni.getLocation({
  716. // type: "gcj02",
  717. // altitude: true,
  718. // geocode: true,
  719. // success: (res) => {
  720. // try {
  721. // uni.setStorageSync("user_latitude", res.latitude);
  722. // uni.setStorageSync("user_longitude", res.longitude);
  723. // } catch {}
  724. // },
  725. // });
  726. navH.value = app.globalData.navHeight;
  727. // #ifndef MP
  728. navH.value = 0;
  729. // #endif
  730. isLogin && silenceBindingSpread();
  731. });
  732. onShow(() => {
  733. getIndexConfig();
  734. uni.setNavigationBarTitle({ title: site_name.value });
  735. });
  736. onMounted(() => {
  737. // #ifdef H5
  738. const appSearchH = uni.createSelectorQuery().select(".serch-wrapper");
  739. appSearchH
  740. .boundingClientRect((data) => {
  741. searchH.value = data.height;
  742. })
  743. .exec();
  744. // #endif
  745. const query = uni.createSelectorQuery().in(instance.proxy);
  746. query.select(".header").boundingClientRect((data) => {
  747. headerHeight.value = Math.ceil(data.height);
  748. });
  749. query
  750. .select(".sticky-box")
  751. .boundingClientRect((data) => {
  752. // marTop.value = Util.pxToRpx(data.height);
  753. // stickyTop.value = data.height;
  754. console.log({ data });
  755. marTop.value = data.height + 5;
  756. })
  757. .exec();
  758. });
  759. // #ifdef MP
  760. const onShareAppMessage = () => {
  761. return {
  762. title: configApi.value.title,
  763. imageUrl: configApi.value.img,
  764. desc: configApi.value.synopsis,
  765. path: "/pages/index/index",
  766. };
  767. };
  768. // #endif
  769. onReachBottom(() => {
  770. if (navIndex.value === 0) {
  771. if (currentSecondCategoryId.value) {
  772. if (goodScroll.value) {
  773. getProductByCategoryId(currentSecondCategoryId.value, params.value)
  774. .then(({ data }) => {
  775. // console.log("11111=>", data);
  776. goodsList.value =
  777. [...goodsList.value, ...data.productList.list] || [];
  778. goodScroll.value =
  779. data.productList.list.length >= params.value.limit;
  780. params.value.page++;
  781. })
  782. .catch(console.error);
  783. }
  784. } else {
  785. if (params.value.page !== 1) {
  786. getGroomList();
  787. }
  788. }
  789. } else {
  790. }
  791. });
  792. // 定义 onChange 方法
  793. const onChange = (e) => {
  794. timeData.value = e;
  795. };
  796. const timeData = ref({});
  797. const calculatedProducts = computed(() => {
  798. // 计算逻辑与原代码一致,但基于响应式数据 products
  799. return goodsList.value.map((product) => {
  800. // 1. 将price字符串转为数字
  801. const price = Number(product.price);
  802. // 2. 计算乘积
  803. const total = (price + product.sales) * realGoldprice.value;
  804. // 3. 向上取整到两位小数(先放大100倍取整,再缩小100倍)
  805. const roundedTotal = Math.ceil(total * 100) / 100;
  806. // 4. 格式化保留两位小数
  807. const formattedTotal = roundedTotal.toFixed(2);
  808. return {
  809. ...product,
  810. calculatedTotal: formattedTotal, // 新增计算结果字段
  811. };
  812. });
  813. });
  814. const goBack = () => {
  815. uni.switchTab({ url: "/pages/index/index" });
  816. };
  817. // 解析商品规格信息
  818. const switchTagName = (jsonStr) => {
  819. // console.log("jsonStr", jsonStr);
  820. if (!jsonStr || typeof jsonStr !== "string") {
  821. return [];
  822. }
  823. try {
  824. const attrObj = JSON.parse(jsonStr);
  825. if (typeof attrObj !== "object" || attrObj === null) {
  826. return [];
  827. }
  828. return Object.entries(attrObj).map(([key, value]) => ({
  829. key: String(key),
  830. value: String(value),
  831. }));
  832. } catch (err) {
  833. console.error("解析商品规格失败:", err);
  834. return [];
  835. }
  836. };
  837. // 价格
  838. const totalPrice = (pro) => {
  839. return (
  840. Number(pro.weight) * Number(pro.price) +
  841. Number(pro.additionalAmount)
  842. ).toFixed(2);
  843. };
  844. </script>
  845. <style>
  846. page {
  847. display: flex;
  848. flex-direction: column;
  849. height: 100%;
  850. /* #ifdef H5 */
  851. background-color: #fff;
  852. /* #endif */
  853. }
  854. </style>
  855. <style lang="scss" scoped>
  856. .Hoverball {
  857. display: flex;
  858. justify-content: center;
  859. align-items: center;
  860. flex-direction: column;
  861. background: linear-gradient(180deg, #fefcf9 0%, #fff2df 100%);
  862. box-shadow: 0rpx 3rpx 12rpx 0rpx rgba(0, 0, 0, 0.16);
  863. width: 105upx;
  864. height: 105upx;
  865. border-radius: 50%; // 圆形按钮
  866. position: fixed; // 固定定位(不随页面滚动)
  867. z-index: 999999; // 最高层级,避免被其他元素遮挡
  868. top: 0%;
  869. right: 0%;
  870. .title {
  871. font-size: 19rpx;
  872. color: #000000;
  873. margin-bottom: 4rpx; // 文本与价格间距
  874. }
  875. .price {
  876. font-size: 26rpx;
  877. color: #cc0000;
  878. font-weight: bold;
  879. }
  880. // 贴边/停止拖拽时的过渡动画
  881. &.transition {
  882. transition: left 0.3s ease, top 0.3s ease;
  883. }
  884. }
  885. .couponIndex {
  886. width: auto;
  887. height: 238rpx;
  888. background-image: url("~@/static/images/yhjsy.png");
  889. background-size: 100% 100%;
  890. padding-left: 42rpx;
  891. margin-bottom: 30rpx;
  892. .titBox {
  893. padding: 47rpx 0;
  894. text-align: center;
  895. height: 100%;
  896. .tit1 {
  897. color: #ffebd2;
  898. font-size: 34rpx;
  899. font-weight: 600;
  900. }
  901. .tit2 {
  902. color: #ffebd2;
  903. font-size: 22rpx;
  904. margin: 10rpx 0 26rpx 0;
  905. }
  906. .tit3 {
  907. color: #ffdaaf;
  908. font-size: 24rpx;
  909. .iconfont {
  910. font-size: 20rpx;
  911. }
  912. }
  913. }
  914. .listBox {
  915. padding: 14rpx 0;
  916. .listActive {
  917. background-image: url("~@/static/images/lingyhj.png");
  918. background-size: 100% 100%;
  919. }
  920. .listHui {
  921. background-image: url("~@/static/images/weiling.png");
  922. background-size: 100% 100%;
  923. }
  924. .list {
  925. width: 170rpx;
  926. height: 210rpx;
  927. padding: 16rpx 0;
  928. text-align: center;
  929. margin-left: 24rpx;
  930. .tit {
  931. font-size: 18rpx;
  932. padding: 0 26rpx;
  933. }
  934. .titActive {
  935. color: #c99959;
  936. }
  937. .price {
  938. font-size: 46rpx;
  939. font-weight: 900;
  940. margin-top: 4rpx;
  941. }
  942. .pricehui {
  943. color: #b2b2b2;
  944. }
  945. .fonthui {
  946. background-color: #f5f5f5 !important;
  947. }
  948. .yuan {
  949. font-size: 24rpx;
  950. }
  951. .ling {
  952. font-size: 24rpx;
  953. margin-top: 9.5rpx;
  954. width: 102rpx;
  955. height: 36rpx;
  956. line-height: 36rpx;
  957. background-color: #ffe5c7;
  958. border-radius: 28rpx;
  959. margin: auto;
  960. }
  961. .priceM {
  962. color: #ffdaaf;
  963. font-size: 22rpx;
  964. margin-top: 14rpx;
  965. }
  966. }
  967. }
  968. }
  969. .sticky-box {
  970. // display: flex;
  971. // position: -webkit-sticky;
  972. // position: sticky;
  973. z-index: 99;
  974. flex-direction: row;
  975. // margin: 0px;
  976. // background: #fff;
  977. padding-bottom: 30rpx;
  978. background: #fff;
  979. margin-top: 30rpx;
  980. .active {
  981. color: #000;
  982. }
  983. .nav-bd {
  984. display: flex;
  985. align-items: center;
  986. justify-content: space-between;
  987. padding: 0 20rpx;
  988. .item {
  989. display: flex;
  990. flex-direction: column;
  991. align-items: center;
  992. justify-content: center;
  993. border-bottom: 3rpx solid #e6e6e6;
  994. box-sizing: border-box;
  995. .txt {
  996. font-size: 28rpx;
  997. color: #282828;
  998. }
  999. .label {
  1000. display: flex;
  1001. align-items: center;
  1002. justify-content: center;
  1003. width: 124rpx;
  1004. height: 32rpx;
  1005. margin-top: 5rpx;
  1006. font-size: 24rpx;
  1007. color: #999;
  1008. }
  1009. &.active {
  1010. color: $theme-color;
  1011. border-bottom: 2rpx solid #000;
  1012. .txt {
  1013. color: $theme-color;
  1014. }
  1015. .label {
  1016. background: linear-gradient(90deg, $bg-star 0%, $bg-end 100%);
  1017. border-radius: 16rpx;
  1018. color: #fff;
  1019. }
  1020. }
  1021. }
  1022. }
  1023. .second-nav {
  1024. width: 100%;
  1025. display: flex;
  1026. flex-wrap: nowrap;
  1027. overflow-x: auto;
  1028. &::-webkit-scrollbar {
  1029. display: none;
  1030. }
  1031. -webkit-overflow-scrolling: touch;
  1032. padding: 0 50rpx;
  1033. box-sizing: border-box;
  1034. .second-nav-item {
  1035. font-size: 26rpx;
  1036. padding: 15rpx 0;
  1037. margin: 0 10rpx 0 0;
  1038. color: #000;
  1039. white-space: nowrap;
  1040. // flex: 1;
  1041. width: 33%;
  1042. display: flex;
  1043. justify-content: center;
  1044. align-items: center;
  1045. &.active {
  1046. color: #ef4800;
  1047. }
  1048. }
  1049. }
  1050. }
  1051. .swiper-box {
  1052. margin: 0 30rpx;
  1053. &::v-deep uni-image {
  1054. width: 100%;
  1055. }
  1056. }
  1057. // 活动专区
  1058. .active-contanier {
  1059. width: 100%;
  1060. box-sizing: border-box;
  1061. padding: 0 30rpx;
  1062. .active-scroll {
  1063. width: 100%;
  1064. white-space: nowrap;
  1065. .active-scroll-content {
  1066. margin: 30rpx 0;
  1067. display: flex;
  1068. flex-direction: row;
  1069. white-space: nowrap;
  1070. }
  1071. }
  1072. .active-item {
  1073. // width: 335rpx;
  1074. width: 48.99%;
  1075. background: #ffffff;
  1076. height: 180rpx;
  1077. box-shadow: 0rpx 3rpx 13rpx 0rpx rgba(0, 0, 0, 0.13);
  1078. border-radius: 20rpx;
  1079. padding: 13rpx 20rpx;
  1080. box-sizing: border-box;
  1081. display: flex;
  1082. flex-direction: column;
  1083. margin-right: 20rpx;
  1084. flex-shrink: 0;
  1085. .title-box {
  1086. height: 33rpx;
  1087. display: flex;
  1088. font-size: 22rpx;
  1089. align-items: center;
  1090. .title {
  1091. // width: 50%;
  1092. font-weight: bold;
  1093. text-align: center;
  1094. }
  1095. }
  1096. .active-box {
  1097. flex: 1;
  1098. display: flex;
  1099. .active-item-left {
  1100. flex: 1;
  1101. display: flex;
  1102. flex-direction: column;
  1103. .image-box {
  1104. flex: 1;
  1105. // width: 115rpx;
  1106. display: flex;
  1107. align-items: center;
  1108. image {
  1109. border-radius: 5rpx;
  1110. width: 115rpx;
  1111. height: 110rpx;
  1112. }
  1113. .da-jin-tiao {
  1114. width: 51rpx;
  1115. }
  1116. }
  1117. }
  1118. .active-item-right {
  1119. display: flex;
  1120. flex-direction: column;
  1121. justify-content: space-between;
  1122. flex: 1;
  1123. min-width: 0;
  1124. width: 0;
  1125. .ms {
  1126. font-size: 16rpx;
  1127. color: #000000;
  1128. width: 100%;
  1129. overflow: hidden;
  1130. text-overflow: ellipsis;
  1131. white-space: nowrap;
  1132. display: block;
  1133. max-width: 100%;
  1134. box-sizing: border-box;
  1135. }
  1136. .tag {
  1137. display: flex;
  1138. .tag-text {
  1139. color: #acacac;
  1140. background-color: #ebebeb;
  1141. border-radius: 5rpx;
  1142. font-size: 16rpx;
  1143. text-align: center;
  1144. padding: 0rpx 5rpx;
  1145. }
  1146. }
  1147. .price-box {
  1148. display: flex;
  1149. justify-content: space-between;
  1150. .price {
  1151. font-size: 18rpx;
  1152. font-weight: bold;
  1153. color: #000000;
  1154. margin-right: 10rpx;
  1155. }
  1156. .btn {
  1157. width: 77rpx;
  1158. height: 26rpx;
  1159. background-image: linear-gradient(270deg, #fc962c 0%, #f0470d 100%);
  1160. border-radius: 100rpx;
  1161. display: flex;
  1162. justify-content: center;
  1163. align-items: center;
  1164. font-size: 14rpx;
  1165. color: #ffffff;
  1166. }
  1167. }
  1168. }
  1169. }
  1170. }
  1171. }
  1172. .listAll {
  1173. width: 20%;
  1174. text-indent: 62rpx;
  1175. font-size: 30rpx;
  1176. border-left: 1px #eee solid;
  1177. margin: 1% 0;
  1178. padding: 5rpx;
  1179. position: relative;
  1180. image {
  1181. position: absolute;
  1182. left: 20rpx;
  1183. top: 8rpx;
  1184. }
  1185. }
  1186. .tab {
  1187. position: relative;
  1188. display: flex;
  1189. font-size: 28rpx;
  1190. white-space: nowrap;
  1191. &__item {
  1192. flex: 1;
  1193. padding: 0 20rpx;
  1194. text-align: center;
  1195. height: 60rpx;
  1196. line-height: 60rpx;
  1197. color: #666;
  1198. &.active {
  1199. color: #09c2c9;
  1200. }
  1201. }
  1202. }
  1203. .tab__line {
  1204. display: block;
  1205. height: 6rpx;
  1206. position: absolute;
  1207. bottom: 0;
  1208. left: 0;
  1209. z-index: 1;
  1210. border-radius: 3rpx;
  1211. position: relative;
  1212. background: #2fc6cd;
  1213. }
  1214. .scroll-view_H {
  1215. width: 100%;
  1216. display: flex;
  1217. overflow-x: auto;
  1218. padding: 12rpx 0;
  1219. background-color: #fff;
  1220. box-sizing: border-box;
  1221. &::-webkit-scrollbar {
  1222. display: none;
  1223. }
  1224. -webkit-overflow-scrolling: touch;
  1225. .tab.nav-bd {
  1226. display: flex;
  1227. align-items: center;
  1228. width: 100%;
  1229. }
  1230. #tab_item.item {
  1231. display: flex;
  1232. flex-direction: column;
  1233. align-items: center;
  1234. // margin: 0 24rpx;
  1235. padding: 8rpx 0;
  1236. cursor: pointer;
  1237. flex: 1;
  1238. transition: all 0.3s ease;
  1239. .uni-icons {
  1240. font-size: 44rpx;
  1241. margin-bottom: 6rpx;
  1242. }
  1243. .txt {
  1244. font-size: 26rpx;
  1245. color: #333;
  1246. }
  1247. }
  1248. #tab_list:first-of-type .item.active {
  1249. .uni-icons {
  1250. color: #000;
  1251. }
  1252. .txt {
  1253. color: #000;
  1254. font-weight: bold;
  1255. }
  1256. }
  1257. .privacy-wrapper {
  1258. z-index: 999;
  1259. position: fixed;
  1260. left: 0;
  1261. top: 0;
  1262. width: 100%;
  1263. height: 100%;
  1264. background: #7f7f7f;
  1265. .privacy-box {
  1266. position: absolute;
  1267. left: 50%;
  1268. top: 50%;
  1269. transform: translate(-50%, -50%);
  1270. width: 560rpx;
  1271. padding: 50rpx 45rpx 0;
  1272. background: #fff;
  1273. border-radius: 20rpx;
  1274. .title {
  1275. text-align: center;
  1276. font-size: 32rpx;
  1277. text-align: center;
  1278. color: #333;
  1279. font-weight: 700;
  1280. }
  1281. .content {
  1282. margin-top: 20rpx;
  1283. line-height: 1.5;
  1284. font-size: 26rpx;
  1285. color: #666;
  1286. text-indent: 54rpx;
  1287. i {
  1288. font-style: normal;
  1289. color: $theme-color;
  1290. }
  1291. }
  1292. .btn-box {
  1293. margin-top: 40rpx;
  1294. text-align: center;
  1295. font-size: 30rpx;
  1296. .btn-item {
  1297. height: 82rpx;
  1298. line-height: 82rpx;
  1299. background: linear-gradient(90deg, #f67a38 0%, #f11b09 100%);
  1300. color: #fff;
  1301. border-radius: 41rpx;
  1302. }
  1303. .btn {
  1304. padding: 30rpx 0;
  1305. }
  1306. }
  1307. }
  1308. }
  1309. }
  1310. .page-index {
  1311. position: relative;
  1312. z-index: 1;
  1313. height: 100%;
  1314. .top-box {
  1315. background: linear-gradient(180deg, #ffe079 0%, #ffffff 100%);
  1316. }
  1317. }
  1318. .header {
  1319. position: sticky;
  1320. top: 0;
  1321. z-index: 200000;
  1322. width: 100%;
  1323. padding: 28rpx 30rpx;
  1324. .serch-wrapper {
  1325. margin-top: var(--status-bar-height);
  1326. display: flex;
  1327. justify-content: center;
  1328. align-items: center;
  1329. /* #ifdef MP-WEIXIN */
  1330. width: 75%;
  1331. /* #endif */
  1332. .logo {
  1333. width: 154rpx;
  1334. height: 47rpx;
  1335. margin-right: 24rpx;
  1336. }
  1337. image {
  1338. width: 118rpx;
  1339. height: 42rpx;
  1340. }
  1341. .input {
  1342. display: flex;
  1343. align-items: center;
  1344. width: 447rpx;
  1345. height: 58rpx;
  1346. background-color: #ffffff;
  1347. border-radius: 10rpx;
  1348. font-size: 22rpx;
  1349. color: #868686;
  1350. .iconfont {
  1351. margin: 0 10rpx;
  1352. font-size: 26rpx;
  1353. color: #666666;
  1354. }
  1355. }
  1356. }
  1357. .tabNav {
  1358. padding-top: 24rpx;
  1359. }
  1360. }
  1361. .page_content {
  1362. padding: 0 30rpx;
  1363. }
  1364. .index-product-wrapper {
  1365. padding: 0 30rpx;
  1366. margin-bottom: 110rpx;
  1367. min-height: 700rpx;
  1368. background: #fff;
  1369. &.on {
  1370. min-height: 1500rpx;
  1371. }
  1372. .list-box {
  1373. display: flex;
  1374. flex-wrap: wrap;
  1375. justify-content: space-between;
  1376. .item {
  1377. width: 48.99%;
  1378. height: 463rpx;
  1379. background-color: #ffffff;
  1380. box-shadow: 0rpx 3rpx 13rpx 0rpx rgba(0, 0, 0, 0.13);
  1381. border-radius: 20rpx;
  1382. margin-bottom: 20rpx;
  1383. overflow: hidden;
  1384. display: flex;
  1385. flex-direction: column;
  1386. justify-content: space-between;
  1387. .pictrue {
  1388. position: relative;
  1389. image {
  1390. width: 100%;
  1391. height: 330rpx;
  1392. }
  1393. }
  1394. .text-info {
  1395. padding: 10rpx 20rpx 15rpx;
  1396. .title {
  1397. color: #222222;
  1398. display: flex;
  1399. align-items: center;
  1400. .tip {
  1401. width: 61rpx;
  1402. height: auto;
  1403. font-size: 22rpx;
  1404. display: flex;
  1405. justify-content: center;
  1406. align-items: center;
  1407. color: #ffffff;
  1408. position: relative;
  1409. margin-right: 5rpx;
  1410. background-color: #ef4800;
  1411. border-radius: 5rpx;
  1412. }
  1413. }
  1414. .bottom-row {
  1415. color: $theme-color;
  1416. display: flex;
  1417. justify-content: space-between;
  1418. align-items: center;
  1419. font-size: 28rpx;
  1420. margin: 10rpx 0 0;
  1421. .price {
  1422. padding-bottom: 4rpx;
  1423. font-weight: 800;
  1424. white-space: nowrap;
  1425. font-size: 28rpx;
  1426. color: #f16327;
  1427. }
  1428. .sales {
  1429. color: #b4b4b4;
  1430. font-size: 22rpx;
  1431. white-space: nowrap;
  1432. color: #6e6e6e;
  1433. }
  1434. }
  1435. }
  1436. }
  1437. &.on {
  1438. display: flex;
  1439. }
  1440. }
  1441. }
  1442. .top-bg-box {
  1443. overflow: hidden;
  1444. // background-image: linear-gradient(
  1445. // to bottom,
  1446. // $header-color 0%,
  1447. // $header-color 10%,
  1448. // #ffe9a1 50%,
  1449. // transparent 100%
  1450. // );
  1451. }
  1452. .nav-list {
  1453. width: 100%;
  1454. display: flex;
  1455. justify-content: space-between;
  1456. align-items: center;
  1457. padding: 0 40rpx 0;
  1458. margin: 25rpx 0;
  1459. .item {
  1460. text-align: center;
  1461. }
  1462. }
  1463. .no-data {
  1464. margin: 150rpx auto 0;
  1465. text-align: center;
  1466. img {
  1467. width: 65%;
  1468. height: auto;
  1469. }
  1470. }
  1471. .mores-txt {
  1472. width: 100%;
  1473. align-items: center;
  1474. justify-content: center;
  1475. height: 70rpx;
  1476. color: #999;
  1477. font-size: 24rpx;
  1478. .iconfont {
  1479. margin-top: 2rpx;
  1480. font-size: 20rpx;
  1481. }
  1482. }
  1483. .menu-txt {
  1484. font-size: 24rpx;
  1485. color: #454545;
  1486. }
  1487. .stats {
  1488. position: absolute;
  1489. left: 0px;
  1490. top: 0px;
  1491. z-index: 2000000;
  1492. width: 750rpx;
  1493. height: var(--status-bar-height);
  1494. background: #ffffff;
  1495. }
  1496. // 倒计时样式
  1497. .time {
  1498. @include flex;
  1499. align-items: center;
  1500. &__custom {
  1501. // margin-top: 4px;
  1502. width: 24rpx;
  1503. height: 24rpx;
  1504. background-color: #ef4800;
  1505. border-radius: 4px;
  1506. /* #ifndef APP-NVUE */
  1507. display: flex;
  1508. /* #endif */
  1509. justify-content: center;
  1510. align-items: center;
  1511. font-size: 12rpx;
  1512. border-radius: 50%;
  1513. margin-left: 10rpx;
  1514. &__item {
  1515. color: #fff;
  1516. font-size: 12rpx;
  1517. text-align: center;
  1518. }
  1519. }
  1520. &__doc {
  1521. color: #ef4800;
  1522. padding: 0px 4rpx;
  1523. margin-bottom: 4rpx;
  1524. }
  1525. &__item {
  1526. color: #606266;
  1527. font-size: 15px;
  1528. margin-right: 4px;
  1529. }
  1530. }
  1531. .live {
  1532. width: 59rpx;
  1533. height: 20rpx;
  1534. background-color: #ef4800;
  1535. border-radius: 5rpx;
  1536. font-size: 12rpx;
  1537. display: flex;
  1538. justify-content: center;
  1539. align-items: center;
  1540. margin-left: 10rpx;
  1541. color: #ffffff;
  1542. }
  1543. .weixia {
  1544. width: 24rpx;
  1545. height: 24rpx;
  1546. background-color: #ef4800;
  1547. border-radius: 50%;
  1548. }
  1549. </style>