This commit is contained in:
niannian zheng 2026-03-13 11:15:18 +08:00
commit f6bdc35ef1
47 changed files with 158 additions and 17 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
API 接口设计文档.md Normal file → Executable file
View File

0
App.vue Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
index.html Normal file → Executable file
View File

8
main.js Normal file → Executable file
View File

@ -14,7 +14,7 @@ app.$mount()
// #ifdef VUE3
import { createSSRApp } from 'vue'
import api from './utils/api'
import uView from 'uview-ui'
import uviewPlus from 'uview-plus'
console.log('🚀 应用启动导入api模块')
@ -25,9 +25,9 @@ export function createApp() {
app.config.globalProperties.$api = api
console.log('✅ api已全局注册为 $api')
// 注册uView UI 2.0
app.use(uView)
console.log('✅ uView UI 2.0 已全局注册')
// 注册uview-plus (Vue3兼容版)
app.use(uviewPlus)
console.log('✅ uview-plus 已全局注册')
return {
app

0
manifest.json Normal file → Executable file
View File

14
package-lock.json generated Normal file → Executable file
View File

@ -5,15 +5,17 @@
"packages": {
"": {
"dependencies": {
"uview-ui": "^2.0.36"
"uview-plus": "^3.7.13"
}
},
"node_modules/uview-ui": {
"version": "2.0.36",
"resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz",
"integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==",
"node_modules/uview-plus": {
"version": "3.7.13",
"resolved": "https://registry.npmjs.org/uview-plus/-/uview-plus-3.7.13.tgz",
"integrity": "sha512-vHByf0kxKReYxam6BuU6wn/80giCkMaMUHEblhkf4kAjP852b86V3ctkjfGtV17MEIORFo3Vkve+HFnHNXpwNg==",
"engines": {
"HBuilderX": "^3.1.0"
"HBuilderX": "^3.1.0",
"uni-app": "^4.66",
"uni-app-x": ""
}
}
}

2
package.json Normal file → Executable file
View File

@ -1,5 +1,5 @@
{
"dependencies": {
"uview-ui": "^2.0.36"
"uview-plus": "^3.7.13"
}
}

2
pages.json Normal file → Executable file
View File

@ -72,7 +72,7 @@
"easycom": {
"autoscan": true,
"custom": {
"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
"^u-(.*)": "uview-plus/components/u-$1/u-$1.vue"
}
}
}

0
pages/config/config.vue Normal file → Executable file
View File

0
pages/detail/detail.vue Normal file → Executable file
View File

142
pages/index/index.vue Normal file → Executable file
View File

@ -1,7 +1,24 @@
<template>
<view class="page-container">
<view class="header-section">
<!-- 骨架屏资产卡片区域 -->
<view class="header-section" v-if="loading">
<view class="skeleton-asset-card">
<view class="skeleton-row">
<view class="skeleton-text skeleton-label"></view>
</view>
<view class="skeleton-row">
<view class="skeleton-text skeleton-big"></view>
</view>
<view class="skeleton-row skeleton-bottom">
<view class="skeleton-text skeleton-stat"></view>
<view class="skeleton-text skeleton-stat"></view>
</view>
</view>
</view>
<!-- 真实内容资产卡片 -->
<view class="header-section" v-else>
<view class="asset-card">
@ -49,7 +66,28 @@
<text class="section-title">当前记录组合</text>
</view>
<!-- 骨架屏持仓卡片 -->
<view v-if="loading" class="holding-card" v-for="i in 2" :key="'skeleton-' + i">
<view class="card-top">
<view class="flex-row items-center gap-2">
<view class="skeleton-icon"></view>
<view class="flex-col">
<view class="skeleton-text skeleton-name"></view>
<view class="skeleton-text skeleton-tags"></view>
</view>
</view>
<view class="skeleton-text skeleton-status"></view>
</view>
<view class="card-divider"></view>
<view class="card-bottom">
<view class="skeleton-text skeleton-data"></view>
<view class="skeleton-text skeleton-data"></view>
</view>
</view>
<!-- 真实内容持仓卡片 -->
<view
v-else
v-for="holding in holdings"
:key="holding.id"
class="holding-card"
@ -95,6 +133,9 @@ import { ref } from 'vue';
import { onShow } from '@dcloudio/uni-app';
import { api } from '../../utils/api';
//
const loading = ref(true);
//
const assetData = ref({
totalValue: 0,
@ -171,12 +212,14 @@ const goDetail = (holdingId) => {
onShow(async () => {
console.log('首页显示,刷新数据...');
isFetching = true;
loading.value = true;
await Promise.all([
fetchAssetData(),
fetchHoldingsData()
]);
loading.value = false;
isFetching = false;
});
</script>
@ -243,6 +286,103 @@ onShow(async () => {
/* 跌 */
/* ============================ */
/* 骨架屏样式 */
/* ============================ */
.skeleton-asset-card {
background-color: #064E3B;
border-radius: 40rpx;
padding: 40rpx 48rpx;
min-height: 320rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.skeleton-row {
display: flex;
align-items: center;
}
.skeleton-bottom {
justify-content: space-between;
}
.skeleton-text {
background: linear-gradient(90deg, rgba(255,255,255,0.1) 25%, rgba(255,255,255,0.2) 37%, rgba(255,255,255,0.1) 50%);
background-size: 400% 100%;
animation: skeleton-loading 1.8s ease infinite;
border-radius: 8rpx;
}
.skeleton-label {
width: 200rpx;
height: 28rpx;
}
.skeleton-big {
width: 400rpx;
height: 68rpx;
margin-top: 20rpx;
}
.skeleton-stat {
width: 180rpx;
height: 36rpx;
}
.skeleton-icon {
width: 80rpx;
height: 80rpx;
border-radius: 20rpx;
background: linear-gradient(90deg, #F1F2F4 25%, #e6e6e6 37%, #F1F2F4 50%);
background-size: 400% 100%;
animation: skeleton-loading 1.8s ease infinite;
}
.skeleton-name {
width: 160rpx;
height: 30rpx;
margin-bottom: 8rpx;
background: linear-gradient(90deg, #F1F2F4 25%, #e6e6e6 37%, #F1F2F4 50%);
background-size: 400% 100%;
animation: skeleton-loading 1.8s ease infinite;
}
.skeleton-tags {
width: 100rpx;
height: 22rpx;
background: linear-gradient(90deg, #F1F2F4 25%, #e6e6e6 37%, #F1F2F4 50%);
background-size: 400% 100%;
animation: skeleton-loading 1.8s ease infinite;
}
.skeleton-status {
width: 100rpx;
height: 32rpx;
border-radius: 100rpx;
background: linear-gradient(90deg, #F1F2F4 25%, #e6e6e6 37%, #F1F2F4 50%);
background-size: 400% 100%;
animation: skeleton-loading 1.8s ease infinite;
}
.skeleton-data {
width: 140rpx;
height: 32rpx;
background: linear-gradient(90deg, #F1F2F4 25%, #e6e6e6 37%, #F1F2F4 50%);
background-size: 400% 100%;
animation: skeleton-loading 1.8s ease infinite;
}
@keyframes skeleton-loading {
0% {
background-position: 100% 50%
}
100% {
background-position: 0 50%
}
}
/* ============================ */
/* Part 1: 资产卡片样式 (精修版) */
/* ============================ */

0
pages/me/me.vue Normal file → Executable file
View File

0
pages/strategies/edit/edit.vue Normal file → Executable file
View File

0
pages/strategies/strategies.vue Normal file → Executable file
View File

0
static/home.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

0
static/profile_circled.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

0
static/puzzle.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

0
uni.promisify.adaptor.js Normal file → Executable file
View File

5
uni.scss Normal file → Executable file
View File

@ -75,6 +75,5 @@ $uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;
/* 引入uView样式 */
@import "uview-ui/theme.scss";
@import "uview-ui/index.scss";
/* 引入uview-plus样式 */
@import 'uview-plus/theme.scss';

0
uni_modules/uni-icons/changelog.md Normal file → Executable file
View File

View File

View File

View File

View File

View File

View File

0
uni_modules/uni-icons/package.json Normal file → Executable file
View File

0
uni_modules/uni-icons/readme.md Normal file → Executable file
View File

0
uni_modules/uni-scss/changelog.md Normal file → Executable file
View File

0
uni_modules/uni-scss/index.scss Normal file → Executable file
View File

0
uni_modules/uni-scss/package.json Normal file → Executable file
View File

0
uni_modules/uni-scss/readme.md Normal file → Executable file
View File

0
uni_modules/uni-scss/styles/index.scss Normal file → Executable file
View File

0
uni_modules/uni-scss/styles/setting/_border.scss Normal file → Executable file
View File

0
uni_modules/uni-scss/styles/setting/_color.scss Normal file → Executable file
View File

0
uni_modules/uni-scss/styles/setting/_radius.scss Normal file → Executable file
View File

0
uni_modules/uni-scss/styles/setting/_space.scss Normal file → Executable file
View File

0
uni_modules/uni-scss/styles/setting/_styles.scss Normal file → Executable file
View File

0
uni_modules/uni-scss/styles/setting/_text.scss Normal file → Executable file
View File

0
uni_modules/uni-scss/styles/setting/_variables.scss Normal file → Executable file
View File

0
uni_modules/uni-scss/styles/tools/functions.scss Normal file → Executable file
View File

0
uni_modules/uni-scss/theme.scss Normal file → Executable file
View File

0
uni_modules/uni-scss/variables.scss Normal file → Executable file
View File

0
utils/api.js Normal file → Executable file
View File

2
vite.config.js Normal file → Executable file
View File

@ -4,6 +4,6 @@ import uni from '@dcloudio/vite-plugin-uni'
export default defineConfig({
plugins: [uni()],
optimizeDeps: {
include: ['uview-ui']
include: ['uview-plus']
}
})