index.vue 24 KB

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