index.vue 24 KB

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