index.vue 24 KB

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