index.vue 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  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" 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="useList&&useList.length>0&&showIcons">
  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="useList && useList.length > 0 && showIcons"
  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. if (list[0].status == false) {
  394. showIcons.value = false;
  395. } else {
  396. showIcons.value = true;
  397. }
  398. tradeList.value = [list[0], list[1]];
  399. useList.value = [
  400. {
  401. ...list[2],
  402. src: `${HTTP_REQUEST_URL_IMG}setting/mailiao.png`,
  403. },
  404. {
  405. ...list[3],
  406. src: `${HTTP_REQUEST_URL_IMG}setting/mailiao2.png`,
  407. },
  408. {
  409. ...list[4],
  410. src: `${HTTP_REQUEST_URL_IMG}setting/cunliao.png`,
  411. iconName: "存料",
  412. },
  413. {
  414. ...list[5],
  415. src: `${HTTP_REQUEST_URL_IMG}setting/tiliao.png`,
  416. },
  417. ];
  418. console.log(tradeList.value);
  419. },
  420. { deep: true, immediate: true }
  421. );
  422. // 编辑资料
  423. const editProfile = () => {
  424. uni.showToast({
  425. title: "编辑资料",
  426. icon: "none",
  427. });
  428. };
  429. // 开通会员
  430. const openVip = () => {
  431. uni.showToast({
  432. title: "开通会员",
  433. icon: "none",
  434. });
  435. };
  436. // 查看会员权益
  437. const goVIP = () => {
  438. uni.navigateTo({ url: "/pages/users/VIP/VIP" });
  439. };
  440. // 查看交易明细
  441. const viewTransactionDetail = () => {
  442. if (!isLogin) {
  443. toLogin();
  444. } else {
  445. uni.navigateTo({ url: "/pages/users/vault/index" });
  446. }
  447. };
  448. // 充值
  449. const recharge = () => {
  450. if (!isLogin) {
  451. toLogin();
  452. } else {
  453. uni.navigateTo({
  454. url: `/pages/webview/index?path=${"/pages/users/vault/rechargeRmb"}`,
  455. });
  456. }
  457. };
  458. // 提现
  459. const withdraw = () => {
  460. if (!isLogin) {
  461. toLogin();
  462. } else {
  463. uni.navigateTo({
  464. url: `/pages/webview/index?path=${"/pages/users/vault/withdraw"}`,
  465. });
  466. }
  467. };
  468. const goDetail = (url) => {
  469. console.log(url);
  470. const webviewPageUrl = `/pages/webview/index?path=${url}`;
  471. uni.navigateTo({
  472. url: webviewPageUrl,
  473. fail: (err) => {
  474. console.error("跳转到webview页面失败:", err);
  475. uni.showToast({
  476. title: "跳转失败,请重试",
  477. icon: "none",
  478. duration: 1500,
  479. });
  480. },
  481. });
  482. };
  483. function handleLogOut() {
  484. uni.showModal({
  485. title: "提示",
  486. content: "确认退出登录吗?",
  487. success: function (res) {
  488. if (res.confirm) {
  489. // 清除全局定时器
  490. if (getApp().globalData?.messageTimer) {
  491. clearInterval(getApp().globalData.messageTimer);
  492. getApp().globalData.messageTimer = null;
  493. }
  494. appStore.LOGOUT();
  495. uni.reLaunch({ url: "/pages/users/login/index" });
  496. }
  497. },
  498. });
  499. }
  500. // 功能点击
  501. const handleFunctionClick = (item) => {
  502. const url = item.pageUrl;
  503. console.log(url);
  504. if (item.name === "平台客服") return (showCallList.value = true);
  505. if (!url) return;
  506. // 买料、卖料、消费需要通过webview跳转
  507. if (
  508. [
  509. "/pages/users/vault/rechargeGold",
  510. "/pages/users/vault/storeMetal/index",
  511. "/pages/users/vault/storeMetal/order",
  512. ].includes(url)
  513. ) {
  514. const webviewPageUrl = `/pages/webview/index?path=${url}`;
  515. uni.navigateTo({
  516. url: webviewPageUrl,
  517. fail: (err) => {
  518. console.error("跳转到webview页面失败:", err);
  519. uni.showToast({
  520. title: "跳转失败,请重试",
  521. icon: "none",
  522. duration: 1500,
  523. });
  524. },
  525. });
  526. return; // 阻止继续执行后续跳转逻辑
  527. } else if (url === "download") {
  528. uni.setClipboardData({
  529. data: "https://a.app.qq.com/o/simple.jsp?pkgname=uni.app.UNI9DE338F",
  530. showToast: false,
  531. success: function () {
  532. uni.showToast({
  533. title: "下载链接复制成功,请打开内置手机浏览器访问下载。",
  534. icon: "none",
  535. });
  536. console.log("success");
  537. },
  538. });
  539. return;
  540. } else if (url === "logout") {
  541. handleLogOut();
  542. } else {
  543. console.log(url)
  544. uni.navigateTo({ url });
  545. }
  546. };
  547. // 获取客服列表
  548. const getServiceList = async (url) => {
  549. const res = await getCustomerServiceList();
  550. callList.value = res.data.list;
  551. };
  552. // 跳转企微客服
  553. const callService = async (item) => {
  554. wx.openCustomerServiceChat({
  555. corpId: item.enterpriseId,
  556. extInfo: {
  557. url: item.serviceLink,
  558. },
  559. });
  560. };
  561. // 查看商家
  562. const viewStore = (store) => {
  563. if (!store.merchantId) {
  564. return;
  565. }
  566. uni.navigateTo({
  567. url: "/pages/merchantCenters/merchant?merchantId=" + store.merchantId,
  568. });
  569. };
  570. // 查看全部订单
  571. const viewAllOrders = () => {
  572. uni.navigateTo({ url: "/pages/order_list/index" });
  573. };
  574. // 查看订单
  575. const viewOrders = (status) => {
  576. uni.navigateTo({ url: "/pages/order_list/index?status=" + status });
  577. };
  578. const navigateTo = (url) => {
  579. if (!url) return;
  580. uni.navigateTo({ url });
  581. };
  582. // 用户面板事件处理
  583. function handleEdit() {
  584. // console.log("编辑资料");
  585. uni.navigateTo({ url: "/pages/users/personal_info/personal_info" });
  586. }
  587. async function fetchMetalBalance() {
  588. // 若appStore.uid为空,则请求失败
  589. if (!appStore?.uid) {
  590. // Toast({ title: "未登录,请前往登录后访问" });
  591. return;
  592. }
  593. const params = { userId: appStore.uid };
  594. const { data } = await getMetalBalance(params);
  595. wallet.value.assets = wallet.value.assets.map((metal) => {
  596. const metalValue = data[metal.type];
  597. return metalValue !== undefined ? { ...metal, balance: metalValue } : metal;
  598. });
  599. }
  600. const getHistoryList = async () => {
  601. const { data } = await footprintList(params.value);
  602. recentStores.value = data.records;
  603. };
  604. </script>
  605. <style scoped lang="scss">
  606. .container {
  607. background-color: #f5f5f5;
  608. min-height: 100vh;
  609. padding-bottom: 30rpx;
  610. }
  611. /* 顶部用户信息 */
  612. .user-header {
  613. height: 600rpx;
  614. background-image: linear-gradient(200deg, #fcd965 0%, #ffffff 90%) !important;
  615. background-size: 100% 100%;
  616. padding: 150rpx 20rpx 20rpx;
  617. color: #fff;
  618. border-radius: 0 0 20rpx 20rpx;
  619. box-sizing: border-box;
  620. }
  621. .user-info {
  622. display: flex;
  623. justify-content: space-between;
  624. align-items: center;
  625. margin-bottom: 30rpx;
  626. }
  627. .user-main {
  628. display: flex;
  629. align-items: center;
  630. }
  631. .avatar {
  632. width: 120rpx;
  633. height: 120rpx;
  634. border-radius: 50%;
  635. background-color: #fff;
  636. margin-right: 30rpx;
  637. }
  638. .name-vip {
  639. display: flex;
  640. align-items: center;
  641. margin-bottom: 16rpx;
  642. }
  643. .name {
  644. font-size: 32rpx;
  645. color: #333;
  646. }
  647. .vip-tag {
  648. width: 100rpx;
  649. margin-left: 16rpx;
  650. }
  651. .vip-expire,
  652. .login-tip {
  653. font-size: 28rpx;
  654. color: #666;
  655. }
  656. .btn-content {
  657. display: flex;
  658. flex-direction: column;
  659. align-items: center;
  660. justify-content: center;
  661. .setting {
  662. width: 40rpx;
  663. height: 40rpx;
  664. }
  665. .btn-text {
  666. font-size: 24rpx;
  667. color: #333;
  668. line-height: 1.5;
  669. }
  670. }
  671. /* 会员开通提示 */
  672. .vip-promote {
  673. height: 108rpx;
  674. width: 100%;
  675. height: 108rpx;
  676. padding: 0 30rpx;
  677. box-sizing: border-box;
  678. .vipBG {
  679. width: 100%;
  680. height: 100%;
  681. border-radius: 48rpx 48rpx 0 0;
  682. }
  683. .vip-text {
  684. margin-top: -108rpx;
  685. display: flex;
  686. width: 100%;
  687. justify-content: space-between;
  688. align-items: center;
  689. padding: 20rpx;
  690. box-sizing: border-box;
  691. .title {
  692. font-size: 28rpx;
  693. color: #bdad8e;
  694. display: flex;
  695. justify-content: flex-start;
  696. align-items: center;
  697. .vipIcon {
  698. width: 70rpx;
  699. height: 60rpx;
  700. margin-right: 10rpx;
  701. }
  702. .bigText {
  703. font-size: 32rpx;
  704. color: #facd8d;
  705. margin: 0 10rpx;
  706. }
  707. }
  708. .open-vip {
  709. width: 144rpx;
  710. height: 60rpx;
  711. line-height: 60rpx;
  712. font-size: 24rpx;
  713. color: #5d3d03;
  714. background: linear-gradient(270deg, #fee2a3 0%, #fdebcc 100%);
  715. border-radius: 16rpx 16rpx 16rpx 16rpx;
  716. .bofang {
  717. width: 24rpx;
  718. height: 24rpx;
  719. margin-left: 10rpx;
  720. }
  721. }
  722. }
  723. }
  724. .desc {
  725. font-size: 22rpx;
  726. opacity: 0.9;
  727. }
  728. /* 钱包余额 */
  729. .wallet-section {
  730. background: #fff;
  731. margin: -190rpx 20rpx 20rpx;
  732. border-radius: 24rpx;
  733. padding: 30rpx;
  734. }
  735. .wallet-header {
  736. display: flex;
  737. justify-content: space-between;
  738. align-items: center;
  739. margin-bottom: 20rpx;
  740. }
  741. .wallet-title {
  742. font-size: 28rpx;
  743. color: #333;
  744. }
  745. .transaction-detail {
  746. color: #666;
  747. font-size: 24rpx;
  748. display: flex;
  749. align-items: center;
  750. }
  751. .balance {
  752. font-size: 48rpx;
  753. font-weight: bold;
  754. text-align: center;
  755. margin: 10rpx 0;
  756. color: #333;
  757. }
  758. .assets {
  759. display: flex;
  760. justify-content: space-between;
  761. align-items: center;
  762. margin-top: 40rpx;
  763. flex-wrap: nowrap; /* 确保不换行 */
  764. }
  765. .asset-container {
  766. display: flex;
  767. align-items: center;
  768. flex: 1;
  769. justify-content: center;
  770. position: relative;
  771. }
  772. .asset-item {
  773. display: flex;
  774. flex-direction: column;
  775. align-items: center;
  776. flex: 1;
  777. padding: 0 20rpx;
  778. }
  779. .asset-name {
  780. font-size: 24rpx;
  781. color: #333;
  782. margin-bottom: 16rpx;
  783. text-align: center;
  784. }
  785. .asset-amount {
  786. font-size: 40rpx;
  787. font-weight: bold;
  788. color: #333;
  789. text-align: center;
  790. }
  791. .wallet-actions {
  792. display: flex;
  793. justify-content: space-between;
  794. margin-top: 50rpx;
  795. }
  796. .wallet-btn {
  797. flex: 1;
  798. text-align: center;
  799. height: 88rpx;
  800. line-height: 88rpx;
  801. margin: 0 10rpx;
  802. border-radius: 16rpx;
  803. font-size: 32rpx;
  804. }
  805. .recharge {
  806. background: #f8c008;
  807. color: #333;
  808. }
  809. .withdraw {
  810. background: rgba(248, 192, 8, 0.1);
  811. color: #333;
  812. }
  813. /* 功能入口 */
  814. .function-grid {
  815. background: #fff;
  816. margin: 30rpx;
  817. border-radius: 24rpx;
  818. padding: 40rpx;
  819. }
  820. .functions {
  821. display: grid;
  822. grid-template-columns: repeat(4, 1fr);
  823. gap: 40rpx;
  824. margin-top: 40rpx;
  825. }
  826. .function-item {
  827. text-align: center;
  828. }
  829. .function-icon {
  830. .img {
  831. width: 60rpx;
  832. height: 60rpx;
  833. }
  834. }
  835. .function-name {
  836. font-size: 24rpx;
  837. color: #333;
  838. }
  839. /* 最近访问 */
  840. .recent-visit,
  841. .order-section,
  842. .common-functions {
  843. background: #fff;
  844. margin: 20rpx;
  845. border-radius: 16rpx;
  846. padding: 30rpx;
  847. }
  848. .section-header {
  849. display: flex;
  850. justify-content: space-between;
  851. align-items: center;
  852. margin-bottom: 30rpx;
  853. }
  854. .section-title {
  855. font-size: 32rpx;
  856. color: #333;
  857. }
  858. .more {
  859. font-size: 24rpx;
  860. color: #666;
  861. }
  862. .store-item {
  863. display: flex;
  864. align-items: center;
  865. justify-content: flex-start;
  866. padding: 20rpx;
  867. border-bottom: 2rpx solid #f0f0f0;
  868. background-color: #f9f7f0;
  869. border-radius: 16rpx;
  870. }
  871. .store-item:last-child {
  872. border-bottom: none;
  873. }
  874. .store-logo {
  875. .img {
  876. width: 100rpx;
  877. height: 100rpx;
  878. border-radius: 16rpx;
  879. margin-right: 30rpx;
  880. }
  881. }
  882. .store-name {
  883. font-size: 32rpx;
  884. color: #333;
  885. margin-bottom: 20rpx;
  886. display: block;
  887. }
  888. .store-desc {
  889. font-size: 24rpx;
  890. color: #666;
  891. display: block;
  892. }
  893. /* 订单状态 */
  894. .order-status {
  895. display: flex;
  896. justify-content: space-between;
  897. }
  898. .status-item {
  899. text-align: center;
  900. flex: 1;
  901. }
  902. .status-icon {
  903. .img {
  904. width: 60rpx;
  905. height: 60rpx;
  906. }
  907. }
  908. .status-name {
  909. font-size: 24rpx;
  910. color: #333;
  911. }
  912. /* 常用功能 */
  913. .common-functions .functions {
  914. grid-template-columns: repeat(4, 1fr);
  915. }
  916. .page-title {
  917. font-size: 36rpx;
  918. color: #333;
  919. }
  920. .callService {
  921. padding: 20px 10px 0px;
  922. // background-color: #ddcca3;
  923. display: flex;
  924. justify-content: center;
  925. flex-direction: column;
  926. font-size: 16px;
  927. margin-bottom: 30rpx;
  928. .list-box {
  929. background: #fff;
  930. border-radius: 20px;
  931. .list-item {
  932. width: 100%;
  933. height: 100rpx;
  934. display: flex;
  935. justify-content: center;
  936. align-items: center;
  937. border-bottom: 1px solid #e1e1e1;
  938. }
  939. }
  940. }
  941. </style>