index.vue 21 KB

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