index.vue 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039
  1. <template>
  2. <view class="container">
  3. <up-navbar
  4. class="inde-nav-bar"
  5. :bgColor="navBgColor"
  6. >
  7. <template #left>
  8. <view></view>
  9. </template>
  10. <template #center>
  11. <view class="page-title">我的</view>
  12. </template>
  13. </up-navbar>
  14. <!-- 顶部用户信息 -->
  15. <view class="user-header">
  16. <view class="user-info">
  17. <view class="user-main">
  18. <view>
  19. <image
  20. class="avatar"
  21. :src="isHttpsImage(appStore.$userInfo?.avatar)"
  22. ></image>
  23. </view>
  24. <view class="user-detail">
  25. <view class="name-vip" v-if="appStore.isLogin">
  26. <text class="name">{{ appStore.$userInfo?.nickname }}</text>
  27. <image class="vip-tag" v-if="appStore.$userInfo?.svip && !(appStore?.$wxConfig?.auditModeEnabled)" mode="widthFix" :src="HTTP_REQUEST_URL_IMG+'sviplogo.png'"></image>
  28. </view>
  29. <view
  30. class="name-vip"
  31. v-else
  32. @click="navigateTo('/pages/users/login/index')"
  33. >
  34. <text class="name">未登录</text>
  35. </view>
  36. <text class="vip-expire" v-if="appStore.$userInfo?.svip"
  37. >到期时间:{{ appStore.$userInfo?.svipExpireTime }}</text
  38. >
  39. </view>
  40. </view>
  41. <view class="btn-content" @click="handleEdit()">
  42. <image
  43. class="setting"
  44. :src="HTTP_REQUEST_URL_IMG + 'setting.png'"
  45. mode="widthFix"
  46. ></image>
  47. <text class="btn-text">编辑资料</text>
  48. </view>
  49. </view>
  50. <!-- 会员开通提示 v-if="!userInfo.isVip"-->
  51. <view class="vip-promote" v-if="!(appStore?.$wxConfig?.auditModeEnabled)">
  52. <image class="vipBG" :src="HTTP_REQUEST_URL_IMG+'vipBG.png'" mode="scaleToFill"></image>
  53. <view class="vip-text">
  54. <view class="title">
  55. <image class="vipIcon" :src="HTTP_REQUEST_URL_IMG+'setting/vipIcon.png'" mode="widthFix"></image>
  56. <text v-if="!appStore.$userInfo?.svip">开通<text class="bigText">会员</text>享受更多<text class="bigText">权益</text></text>
  57. <text v-else>前往查看<text class="bigText">权益</text></text>
  58. </view>
  59. <button class="open-vip" @click="goVIP">{{appStore.$userInfo?.svip ? '去查看':'去开通'}}<image class="bofang" :src="HTTP_REQUEST_URL_IMG+'setting/bofang.png'" mode="widthFix"></image></button>
  60. </view>
  61. </view>
  62. </view>
  63. <!-- 钱包余额 -->
  64. <view class="wallet-section">
  65. <view class="wallet-header">
  66. <view>
  67. <view class="wallet-title">钱包余额(元)</view>
  68. <view class="balance">{{ wallet.balance }}</view>
  69. </view>
  70. <view
  71. class="transaction-detail"
  72. @click="viewTransactionDetail"
  73. v-if="!(appStore?.$wxConfig?.auditModeEnabled)"
  74. >
  75. <text style="margin-right: 10rpx">交易明细</text>
  76. <uni-icons type="right" size="16" color="#666666"></uni-icons>
  77. </view>
  78. </view>
  79. <up-line color="#F1F3F8"></up-line>
  80. <view class="assets">
  81. <view
  82. v-for="(asset, index) in wallet.assets"
  83. :key="asset.name"
  84. class="asset-container"
  85. >
  86. <view class="asset-item">
  87. <text class="asset-name">{{ asset.name }}</text>
  88. <text class="asset-amount"
  89. >{{ asset.balance }}{{ asset.unit }}</text
  90. >
  91. </view>
  92. <!-- 在每个资产项后面添加垂直分隔线,除了最后一个 -->
  93. <up-line
  94. v-if="index < wallet.assets.length - 1"
  95. color="#F1F3F8"
  96. direction="col"
  97. length="80rpx"
  98. style="margin: 0 20rpx"
  99. ></up-line>
  100. </view>
  101. </view>
  102. <view
  103. class="wallet-actions"
  104. v-if="tradeList && tradeList.length > 0 && showIcons"
  105. >
  106. <view
  107. class="wallet-btn withdraw"
  108. @click="goDetail(tradeList[0].jumpUrl)"
  109. >{{ tradeList[0].iconName }}</view
  110. >
  111. <view
  112. class="wallet-btn recharge"
  113. @click="goDetail(tradeList[1].jumpUrl)"
  114. >{{ tradeList[1].iconName }}</view
  115. >
  116. </view>
  117. <view class="functions" v-if="useList&&useList.length>0&&showIcons">
  118. <view class="function-item" v-for="item in useList" :key="item.iconName" @click="goDetail(item.jumpUrl)">
  119. <view class="function-icon">
  120. <image class="img" :src="item.src" mode="widthFix"></image>
  121. </view>
  122. <text class="function-name">{{ item.iconName }}</text>
  123. </view>
  124. </view>
  125. </view>
  126. <!-- 最近访问 -->
  127. <view class="recent-visit" v-if="recentStores.length > 0">
  128. <view class="section-header">
  129. <text class="section-title">最近访问</text>
  130. <view class="more" @click="handleFunctionClick({pageUrl:'/pages/users/browsing_history/index'})">查看更多<uni-icons style="margin-left: 10rpx;" type="right" size="16" color="#666666"></uni-icons></view>
  131. </view>
  132. <view class="store-list">
  133. <template v-for="(store,storeIndex) in recentStores" :key="store.id">
  134. <view class="store-item" v-if="storeIndex == 0" @click="viewStore(store)">
  135. <view class="store-logo">
  136. <image class="img" :src="store.merchantLogo"></image>
  137. </view>
  138. <view class="store-info">
  139. <text class="store-name">{{ store.merchantName }}</text>
  140. <text class="store-desc">{{ store.merchantDescribe }}</text>
  141. </view>
  142. <uni-icons style="margin-left: auto;" type="right" size="16" color="#666666"></uni-icons>
  143. </view>
  144. </template>
  145. </view>
  146. </view>
  147. <!-- 订单状态 -->
  148. <view class="order-section">
  149. <view class="section-header">
  150. <text class="section-title">我的订单</text>
  151. <view class="more" @click="viewAllOrders"
  152. >全部订单<uni-icons
  153. style="margin-left: 10rpx"
  154. type="right"
  155. size="16"
  156. color="#666666"
  157. ></uni-icons
  158. ></view>
  159. </view>
  160. <view class="order-status">
  161. <view
  162. class="status-item"
  163. v-for="order in orderStatus"
  164. :key="order.name"
  165. @click="viewOrders(order.id)"
  166. >
  167. <view class="status-icon">
  168. <image class="img" :src="order.src" mode="widthFix"></image>
  169. </view>
  170. <text class="status-name">{{ order.name }}</text>
  171. </view>
  172. </view>
  173. </view>
  174. <!-- 常用功能 -->
  175. <view class="common-functions">
  176. <view class="section-header">
  177. <text class="section-title">常用功能</text>
  178. </view>
  179. <view class="functions">
  180. <template v-for="func in commonFunctions" :key="func.name">
  181. <view class="function-item" @click="handleFunctionClick(func)" v-if="func.show">
  182. <view class="function-icon">
  183. <image class="img" :src="func.src" mode="widthFix"></image>
  184. </view>
  185. <text class="function-name">{{ func.name }}</text>
  186. </view>
  187. </template>
  188. </view>
  189. </view>
  190. <!-- 企微客服弹窗 -->
  191. <up-popup
  192. :show="showCallList"
  193. closeOnClickOverlay
  194. mode="bottom"
  195. @close="showCallList = false"
  196. >
  197. <view class="callService">
  198. <view class="list-box">
  199. <view
  200. v-for="(item, index) in callList"
  201. :key="index"
  202. class="list-item"
  203. @click="callService(item)"
  204. >
  205. <view class="item-left">
  206. <view class="item-name">{{ item.serviceName }}</view>
  207. </view>
  208. </view>
  209. </view>
  210. </view>
  211. </up-popup>
  212. <!-- 自定义 tabBar -->
  213. <customTabBar :current="3" :showBackTop="false" />
  214. </view>
  215. </template>
  216. <script setup>
  217. import { ref, reactive, watch, computed } from "vue";
  218. import { onLoad, onShow, onPageScroll } from "@dcloudio/uni-app";
  219. import UniIcons from "../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
  220. import { HTTP_REQUEST_URL_IMG } from "@/config/app";
  221. import { isHttpsImage } from "@/utils/util";
  222. import { useAppStore } from "@/stores/app";
  223. import { useToast } from "@/hooks/useToast";
  224. import { getMetalBalance } from "@/api/vault";
  225. import { footprintList } from "@/api/merchant.js";
  226. import { getCustomerServiceList } from "@/api/user";
  227. import { toLogin } from "@/libs/login.js";
  228. import customTabBar from "@/components/customTabBar/index.vue";
  229. const showIcons = ref(false);
  230. const appStore = useAppStore();
  231. const { Toast } = useToast();
  232. const isLogin = appStore.isLogin;
  233. const callList = ref([]);
  234. const showCallList = ref(false);
  235. const navBgColor = ref("rgba(255,255,255,0)");
  236. // 钱包信息
  237. const wallet = ref({
  238. balance: appStore.userInfo?.nowMoney || "0.00",
  239. assets: [
  240. { name: "黄金资产", balance: "0.00", unit: "g", type: 1 },
  241. { name: "铂金资产", balance: "0.00", unit: "g", type: 2 },
  242. { name: "白银资产", balance: "0.00", unit: "g", type: 3 },
  243. ],
  244. });
  245. // 主要功能列表
  246. const mainFunctions = ref([
  247. {
  248. src: `${HTTP_REQUEST_URL_IMG}setting/mailiao.png`,
  249. name: "买料",
  250. pageUrl: "/pages/users/vault/rechargeGold",
  251. },
  252. {
  253. src: `${HTTP_REQUEST_URL_IMG}setting/mailiao2.png`,
  254. name: "卖料",
  255. pageUrl: "/pages/users/vault/storeMetal/index",
  256. },
  257. {
  258. src: `${HTTP_REQUEST_URL_IMG}setting/cunliao.png`,
  259. name: "存料",
  260. pageUrl: "/pages/users/vault/storeMetal/goldBullionStock",
  261. },
  262. {
  263. src: `${HTTP_REQUEST_URL_IMG}setting/tiliao.png`,
  264. name: "提料",
  265. pageUrl: "/pages/users/vault/storeMetal/metalExchange",
  266. },
  267. ]);
  268. // 最近访问的商家
  269. const recentStores = ref([]);
  270. // 订单状态
  271. const orderStatus = ref([
  272. {
  273. src: `${HTTP_REQUEST_URL_IMG}setting/daifukuan.png`,
  274. name: "待付款",
  275. id: 0,
  276. },
  277. { src: `${HTTP_REQUEST_URL_IMG}setting/daifahuo.png`, name: "待发货", id: 1 },
  278. {
  279. src: `${HTTP_REQUEST_URL_IMG}setting/daishouhuo.png`,
  280. name: "待收货",
  281. id: 2,
  282. },
  283. {
  284. src: `${HTTP_REQUEST_URL_IMG}setting/tuikuan.png`,
  285. name: "退款/换货",
  286. id: 5,
  287. },
  288. {
  289. src: `${HTTP_REQUEST_URL_IMG}setting/yiwancheng.png`,
  290. name: "已完成",
  291. id: 4,
  292. },
  293. ]);
  294. const merchantZYShow = ref(false);
  295. const lxsjShow = ref(false);
  296. const logoutShow = ref(false);
  297. // 常用功能
  298. const commonFunctions = computed(() => {
  299. const baseFunctions = [
  300. {
  301. src: `${HTTP_REQUEST_URL_IMG}setting/zuji.png`,
  302. name: "浏览足迹",
  303. pageUrl: "/pages/users/browsing_history/index",
  304. show: true,
  305. },
  306. {
  307. src: `${HTTP_REQUEST_URL_IMG}setting/shoucang.png`,
  308. name: "我的收藏",
  309. pageUrl: "/pages/users/user_goods_collection/index",
  310. show: true,
  311. },
  312. {
  313. src: `${HTTP_REQUEST_URL_IMG}setting/dingwei.png`,
  314. name: "收货地址",
  315. pageUrl: "/pages/users/user_address_list/index",
  316. show: true,
  317. },
  318. {
  319. src: `${HTTP_REQUEST_URL_IMG}setting/dianpu.png`,
  320. name: "联系商家",
  321. pageUrl: "/pages/users/my_merchant/index",
  322. show: lxsjShow.value,
  323. },
  324. {
  325. src: `${HTTP_REQUEST_URL_IMG}setting/dianpu.png`,
  326. name: "门店主页",
  327. pageUrl: "/pages/merchantCenter/index",
  328. show: merchantZYShow.value,
  329. },
  330. // { src: `${HTTP_REQUEST_URL_IMG}setting/xiazaiapp.png`, name: '下载APP', pageUrl: 'download', show: true },
  331. {
  332. src: `${HTTP_REQUEST_URL_IMG}setting/lianxikefu.png`,
  333. name: "平台客服",
  334. show: true,
  335. },
  336. {
  337. src: `${HTTP_REQUEST_URL_IMG}setting/logout.png`,
  338. name: "退出登录",
  339. pageUrl: "logout",
  340. show: logoutShow.value,
  341. },
  342. ];
  343. // 根据 show 值过滤
  344. return baseFunctions.filter((func) => func.show);
  345. });
  346. const params = ref({
  347. page: 1,
  348. limit: 10,
  349. });
  350. // 页面加载
  351. onShow(async () => {
  352. // 隐藏原生 tabBar
  353. uni.hideTabBar();
  354. if (appStore.isLogin) {
  355. await appStore.USERINFO();
  356. logoutShow.value = true;
  357. wallet.value.balance = appStore.userInfo?.nowMoney || "0.00";
  358. if (appStore.userInfo?.merchant?.id) {
  359. merchantZYShow.value = true;
  360. } else {
  361. merchantZYShow.value = false;
  362. }
  363. if (appStore.merchantId || appStore.userInfo?.merchant?.id) {
  364. lxsjShow.value = true;
  365. } else {
  366. lxsjShow.value = false;
  367. }
  368. } else {
  369. logoutShow.value = false;
  370. }
  371. fetchMetalBalance();
  372. getHistoryList();
  373. });
  374. onLoad(async () => {
  375. await getServiceList();
  376. });
  377. onPageScroll((e) => {
  378. if (e.scrollTop > 0) {
  379. navBgColor.value = "#ffe079";
  380. } else {
  381. navBgColor.value = "rgba(252,255,255,0)";
  382. }
  383. });
  384. const wxConfig = ref({});
  385. const tradeList = ref([]);
  386. const useList = ref([]);
  387. watch(
  388. () => appStore.wxConfig,
  389. (newVal) => {
  390. const configDate = newVal || appStore.$wxConfig;
  391. wxConfig.value = configDate;
  392. const list = JSON.parse(configDate.essentialFunctions);
  393. console.log('list',list)
  394. if (list[0].status == false) {
  395. showIcons.value = false;
  396. } else {
  397. showIcons.value = true;
  398. }
  399. tradeList.value = [list[0], list[1]];
  400. useList.value = [
  401. {
  402. ...list[2],
  403. src: `${HTTP_REQUEST_URL_IMG}setting/mailiao.png`,
  404. },
  405. {
  406. ...list[3],
  407. src: `${HTTP_REQUEST_URL_IMG}setting/mailiao2.png`,
  408. },
  409. {
  410. ...list[4],
  411. src: `${HTTP_REQUEST_URL_IMG}setting/cunliao.png`,
  412. iconName: "存料",
  413. },
  414. {
  415. ...list[5],
  416. src: `${HTTP_REQUEST_URL_IMG}setting/tiliao.png`,
  417. },
  418. ];
  419. console.log(tradeList.value);
  420. },
  421. { deep: true, immediate: true }
  422. );
  423. // 编辑资料
  424. const editProfile = () => {
  425. uni.showToast({
  426. title: "编辑资料",
  427. icon: "none",
  428. });
  429. };
  430. // 开通会员
  431. const openVip = () => {
  432. uni.showToast({
  433. title: "开通会员",
  434. icon: "none",
  435. });
  436. };
  437. // 查看会员权益
  438. const goVIP = () => {
  439. // uni.navigateTo({ url: "/pages/users/VIP/VIP" });
  440. goDetail("/pages/users/VIP/VIP")
  441. };
  442. // 查看交易明细
  443. const viewTransactionDetail = () => {
  444. console.log(isLogin)
  445. if (!appStore.isLogin) {
  446. toLogin();
  447. } else {
  448. // uni.navigateTo({ url: "/pages/users/vault/index" });
  449. goDetail("/pages/users/vault/indexWX")
  450. }
  451. };
  452. // 充值
  453. const recharge = () => {
  454. if (!appStore.isLogin) {
  455. toLogin();
  456. } else {
  457. uni.navigateTo({
  458. url: `/pages/webview/index?path=${"/pages/users/vault/rechargeRmb"}`,
  459. });
  460. }
  461. };
  462. // 提现
  463. const withdraw = () => {
  464. if (!appStore.isLogin) {
  465. toLogin();
  466. } else {
  467. uni.navigateTo({
  468. url: `/pages/webview/index?path=${"/pages/users/vault/withdraw"}`,
  469. });
  470. }
  471. };
  472. const goDetail = (url) => {
  473. console.log(url);
  474. const webviewPageUrl = `/pages/webview/index?path=${url}`;
  475. uni.navigateTo({
  476. url: webviewPageUrl,
  477. fail: (err) => {
  478. console.error("跳转到webview页面失败:", err);
  479. uni.showToast({
  480. title: "跳转失败,请重试",
  481. icon: "none",
  482. duration: 1500,
  483. });
  484. },
  485. });
  486. };
  487. function handleLogOut() {
  488. uni.showModal({
  489. title: "提示",
  490. content: "确认退出登录吗?",
  491. success: function (res) {
  492. if (res.confirm) {
  493. // 清除全局定时器
  494. if (getApp().globalData?.messageTimer) {
  495. clearInterval(getApp().globalData.messageTimer);
  496. getApp().globalData.messageTimer = null;
  497. }
  498. appStore.LOGOUT();
  499. uni.reLaunch({ url: "/pages/users/login/index" });
  500. }
  501. },
  502. });
  503. }
  504. // 功能点击
  505. const handleFunctionClick = (item) => {
  506. const url = item.pageUrl;
  507. console.log(url);
  508. if (item.name === "平台客服") return (showCallList.value = true);
  509. if (!url) return;
  510. // 买料、卖料、消费需要通过webview跳转
  511. if (
  512. [
  513. "/pages/users/vault/rechargeGold",
  514. "/pages/users/vault/storeMetal/index",
  515. "/pages/users/vault/storeMetal/order",
  516. ].includes(url)
  517. ) {
  518. const webviewPageUrl = `/pages/webview/index?path=${url}`;
  519. uni.navigateTo({
  520. url: webviewPageUrl,
  521. fail: (err) => {
  522. console.error("跳转到webview页面失败:", err);
  523. uni.showToast({
  524. title: "跳转失败,请重试",
  525. icon: "none",
  526. duration: 1500,
  527. });
  528. },
  529. });
  530. return; // 阻止继续执行后续跳转逻辑
  531. } else if (url === "download") {
  532. uni.setClipboardData({
  533. data: "https://a.app.qq.com/o/simple.jsp?pkgname=uni.app.UNI9DE338F",
  534. showToast: false,
  535. success: function () {
  536. uni.showToast({
  537. title: "下载链接复制成功,请打开内置手机浏览器访问下载。",
  538. icon: "none",
  539. });
  540. console.log("success");
  541. },
  542. });
  543. return;
  544. } else if (url === "logout") {
  545. handleLogOut();
  546. } else {
  547. console.log(url)
  548. uni.navigateTo({ url });
  549. }
  550. };
  551. // 获取客服列表
  552. const getServiceList = async (url) => {
  553. const res = await getCustomerServiceList();
  554. callList.value = res.data.list;
  555. };
  556. // 跳转企微客服
  557. const callService = async (item) => {
  558. wx.openCustomerServiceChat({
  559. corpId: item.enterpriseId,
  560. extInfo: {
  561. url: item.serviceLink,
  562. },
  563. });
  564. };
  565. // 查看商家
  566. const viewStore = (store) => {
  567. if (!store.merchantId) {
  568. return;
  569. }
  570. uni.navigateTo({
  571. url: "/pages/merchantCenters/merchant?merchantId=" + store.merchantId,
  572. });
  573. };
  574. // 查看全部订单
  575. const viewAllOrders = () => {
  576. uni.navigateTo({ url: "/pages/order_list/index" });
  577. };
  578. // 查看订单
  579. const viewOrders = (status) => {
  580. uni.navigateTo({ url: "/pages/order_list/index?status=" + status });
  581. };
  582. const navigateTo = (url) => {
  583. if (!url) return;
  584. uni.navigateTo({ url });
  585. };
  586. // 用户面板事件处理
  587. function handleEdit() {
  588. // console.log("编辑资料");
  589. uni.navigateTo({ url: "/pages/users/personal_info/personal_info" });
  590. }
  591. async function fetchMetalBalance() {
  592. // 若appStore.uid为空,则请求失败
  593. if (!appStore?.uid) {
  594. // Toast({ title: "未登录,请前往登录后访问" });
  595. return;
  596. }
  597. const params = { userId: appStore.uid };
  598. const { data } = await getMetalBalance(params);
  599. wallet.value.assets = wallet.value.assets.map((metal) => {
  600. const metalValue = data[metal.type];
  601. return metalValue !== undefined ? { ...metal, balance: metalValue } : metal;
  602. });
  603. }
  604. const getHistoryList = async () => {
  605. const { data } = await footprintList(params.value);
  606. recentStores.value = data.records;
  607. };
  608. </script>
  609. <style scoped lang="scss">
  610. .container {
  611. background-color: #f5f5f5;
  612. min-height: 100vh;
  613. padding-bottom: 180rpx;
  614. }
  615. /* 顶部用户信息 */
  616. .user-header {
  617. height: 600rpx;
  618. background-image: linear-gradient(200deg, #fcd965 0%, #ffffff 90%) !important;
  619. background-size: 100% 100%;
  620. padding: 150rpx 20rpx 20rpx;
  621. color: #fff;
  622. border-radius: 0 0 20rpx 20rpx;
  623. box-sizing: border-box;
  624. }
  625. .user-info {
  626. display: flex;
  627. justify-content: space-between;
  628. align-items: center;
  629. margin-bottom: 30rpx;
  630. }
  631. .user-main {
  632. display: flex;
  633. align-items: center;
  634. }
  635. .avatar {
  636. width: 120rpx;
  637. height: 120rpx;
  638. border-radius: 50%;
  639. background-color: #fff;
  640. margin-right: 30rpx;
  641. }
  642. .name-vip {
  643. display: flex;
  644. align-items: center;
  645. margin-bottom: 16rpx;
  646. }
  647. .name {
  648. font-size: 32rpx;
  649. color: #333;
  650. }
  651. .vip-tag {
  652. width: 100rpx;
  653. margin-left: 16rpx;
  654. }
  655. .vip-expire,
  656. .login-tip {
  657. font-size: 28rpx;
  658. color: #666;
  659. }
  660. .btn-content {
  661. display: flex;
  662. flex-direction: column;
  663. align-items: center;
  664. justify-content: center;
  665. .setting {
  666. width: 40rpx;
  667. height: 40rpx;
  668. }
  669. .btn-text {
  670. font-size: 24rpx;
  671. color: #333;
  672. line-height: 1.5;
  673. }
  674. }
  675. /* 会员开通提示 */
  676. .vip-promote {
  677. height: 108rpx;
  678. width: 100%;
  679. height: 108rpx;
  680. padding: 0 30rpx;
  681. box-sizing: border-box;
  682. .vipBG {
  683. width: 100%;
  684. height: 100%;
  685. border-radius: 48rpx 48rpx 0 0;
  686. }
  687. .vip-text {
  688. margin-top: -108rpx;
  689. display: flex;
  690. width: 100%;
  691. justify-content: space-between;
  692. align-items: center;
  693. padding: 20rpx;
  694. box-sizing: border-box;
  695. .title {
  696. font-size: 28rpx;
  697. color: #bdad8e;
  698. display: flex;
  699. justify-content: flex-start;
  700. align-items: center;
  701. .vipIcon {
  702. width: 70rpx;
  703. height: 60rpx;
  704. margin-right: 10rpx;
  705. }
  706. .bigText {
  707. font-size: 32rpx;
  708. color: #facd8d;
  709. margin: 0 10rpx;
  710. }
  711. }
  712. .open-vip {
  713. width: 144rpx;
  714. height: 60rpx;
  715. font-size: 24rpx;
  716. color: #5d3d03;
  717. background: linear-gradient(270deg, #fee2a3 0%, #fdebcc 100%);
  718. border-radius: 16rpx 16rpx 16rpx 16rpx;
  719. display: flex;
  720. justify-content: center;
  721. align-items: center;
  722. .bofang {
  723. width: 24rpx;
  724. height: 24rpx;
  725. margin-left: 10rpx;
  726. }
  727. }
  728. }
  729. }
  730. .desc {
  731. font-size: 22rpx;
  732. opacity: 0.9;
  733. }
  734. /* 钱包余额 */
  735. .wallet-section {
  736. background: #fff;
  737. margin: -190rpx 20rpx 20rpx;
  738. border-radius: 24rpx;
  739. padding: 30rpx;
  740. }
  741. .wallet-header {
  742. display: flex;
  743. justify-content: space-between;
  744. align-items: center;
  745. margin-bottom: 20rpx;
  746. }
  747. .wallet-title {
  748. font-size: 28rpx;
  749. color: #333;
  750. }
  751. .transaction-detail {
  752. color: #666;
  753. font-size: 24rpx;
  754. display: flex;
  755. align-items: center;
  756. }
  757. .balance {
  758. font-size: 48rpx;
  759. font-weight: bold;
  760. text-align: center;
  761. margin: 10rpx 0;
  762. color: #333;
  763. }
  764. .assets {
  765. display: flex;
  766. justify-content: space-between;
  767. align-items: center;
  768. margin-top: 40rpx;
  769. flex-wrap: nowrap; /* 确保不换行 */
  770. }
  771. .asset-container {
  772. display: flex;
  773. align-items: center;
  774. flex: 1;
  775. justify-content: center;
  776. position: relative;
  777. }
  778. .asset-item {
  779. display: flex;
  780. flex-direction: column;
  781. align-items: center;
  782. flex: 1;
  783. padding: 0 20rpx;
  784. }
  785. .asset-name {
  786. font-size: 24rpx;
  787. color: #333;
  788. margin-bottom: 16rpx;
  789. text-align: center;
  790. }
  791. .asset-amount {
  792. font-size: 40rpx;
  793. font-weight: bold;
  794. color: #333;
  795. text-align: center;
  796. }
  797. .wallet-actions {
  798. display: flex;
  799. justify-content: space-between;
  800. margin-top: 50rpx;
  801. }
  802. .wallet-btn {
  803. flex: 1;
  804. text-align: center;
  805. height: 88rpx;
  806. line-height: 88rpx;
  807. margin: 0 10rpx;
  808. border-radius: 16rpx;
  809. font-size: 32rpx;
  810. }
  811. .recharge {
  812. background: #f8c008;
  813. color: #333;
  814. }
  815. .withdraw {
  816. background: rgba(248, 192, 8, 0.1);
  817. color: #333;
  818. }
  819. /* 功能入口 */
  820. .function-grid {
  821. background: #fff;
  822. margin: 30rpx;
  823. border-radius: 24rpx;
  824. padding: 40rpx;
  825. }
  826. .functions {
  827. display: grid;
  828. grid-template-columns: repeat(4, 1fr);
  829. gap: 40rpx;
  830. margin-top: 40rpx;
  831. }
  832. .function-item {
  833. text-align: center;
  834. }
  835. .function-icon {
  836. .img {
  837. width: 60rpx;
  838. height: 60rpx;
  839. }
  840. }
  841. .function-name {
  842. font-size: 24rpx;
  843. color: #333;
  844. }
  845. /* 最近访问 */
  846. .recent-visit,
  847. .order-section,
  848. .common-functions {
  849. background: #fff;
  850. margin: 20rpx;
  851. border-radius: 16rpx;
  852. padding: 30rpx;
  853. }
  854. .section-header {
  855. display: flex;
  856. justify-content: space-between;
  857. align-items: center;
  858. margin-bottom: 30rpx;
  859. }
  860. .section-title {
  861. font-size: 32rpx;
  862. color: #333;
  863. }
  864. .more {
  865. font-size: 24rpx;
  866. color: #666;
  867. }
  868. .store-item {
  869. display: flex;
  870. align-items: center;
  871. justify-content: flex-start;
  872. padding: 20rpx;
  873. border-bottom: 2rpx solid #f0f0f0;
  874. background-color: #f9f7f0;
  875. border-radius: 16rpx;
  876. }
  877. .store-item:last-child {
  878. border-bottom: none;
  879. }
  880. .store-logo {
  881. .img {
  882. width: 100rpx;
  883. height: 100rpx;
  884. border-radius: 16rpx;
  885. margin-right: 30rpx;
  886. }
  887. }
  888. .store-name {
  889. font-size: 32rpx;
  890. color: #333;
  891. margin-bottom: 20rpx;
  892. display: block;
  893. }
  894. .store-desc {
  895. font-size: 24rpx;
  896. color: #666;
  897. display: block;
  898. }
  899. /* 订单状态 */
  900. .order-status {
  901. display: flex;
  902. justify-content: space-between;
  903. }
  904. .status-item {
  905. text-align: center;
  906. flex: 1;
  907. }
  908. .status-icon {
  909. .img {
  910. width: 60rpx;
  911. height: 60rpx;
  912. }
  913. }
  914. .status-name {
  915. font-size: 24rpx;
  916. color: #333;
  917. }
  918. /* 常用功能 */
  919. .common-functions .functions {
  920. grid-template-columns: repeat(4, 1fr);
  921. }
  922. .page-title {
  923. font-size: 36rpx;
  924. color: #333;
  925. }
  926. .callService {
  927. padding: 20px 10px 0px;
  928. // background-color: #ddcca3;
  929. display: flex;
  930. justify-content: center;
  931. flex-direction: column;
  932. font-size: 16px;
  933. margin-bottom: 30rpx;
  934. .list-box {
  935. background: #fff;
  936. border-radius: 20px;
  937. .list-item {
  938. width: 100%;
  939. height: 100rpx;
  940. display: flex;
  941. justify-content: center;
  942. align-items: center;
  943. border-bottom: 1px solid #e1e1e1;
  944. }
  945. }
  946. }
  947. </style>