优化小宝

This commit is contained in:
tangxinyue 2026-01-16 17:23:26 +08:00
parent 56f24cd7ab
commit 79862a3fa0
10 changed files with 699 additions and 678 deletions

View File

@ -21,15 +21,11 @@ import {
} from './store' } from './store'
export function createApp() { export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App)
// 将store挂载到全局
app.config.globalProperties.$store = store
// 从缓存读取系统信息已在App.vue中获取 // 从缓存读取系统信息已在App.vue中获取
const systemInfo = uni.getStorageSync('systemInfo') || {} const systemInfo = uni.getStorageSync('systemInfo') || {}
app.config.globalProperties.$system = systemInfo.platform == 'ios' ? 'iOS' : 'Android' app.config.globalProperties.$system = systemInfo.platform == 'ios' ? 'iOS' : 'Android'
app.config.globalProperties.$systemInfo = systemInfo app.config.globalProperties.$systemInfo = systemInfo
uni.setStorageSync('version', '1.1.0') uni.setStorageSync('version', '1.0.0')
app.use(globalMethods); app.use(globalMethods);
return { return {
app app

View File

@ -1,36 +1,37 @@
{ {
"name" : "alipay-emulator", "name": "alipay-emulator",
"appid" : "__UNI__D535736", "appid": "__UNI__D535736",
"description" : "", "description": "",
"versionName" : "1.0.0", "versionName": "1.0.0",
"versionCode" : "100", "versionCode": "100",
"transformPx" : false, "transformPx": false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus": {
"usingComponents" : true, "darkmode": false,
"nvueStyleCompiler" : "uni-app", "usingComponents": true,
"compilerVersion" : 3, "nvueStyleCompiler": "uni-app",
"splashscreen" : { "compilerVersion": 3,
"alwaysShowBeforeRender" : true, "splashscreen": {
"waiting" : true, "alwaysShowBeforeRender": true,
"autoclose" : true, "waiting": true,
"delay" : 0 "autoclose": true,
"delay": 0
}, },
"optimization" : { "optimization": {
"subPackages" : true "subPackages": true
}, },
"runmode" : "liberate", // "runmode": "liberate", //
/* */ /* */
"modules" : { "modules": {
"Camera" : {}, "Camera": {},
"Payment" : {} "Payment": {}
}, },
/* */ /* */
"distribute" : { "distribute": {
/* android */ /* android */
"android" : { "android": {
"permissions" : [ "permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
@ -49,46 +50,46 @@
] ]
}, },
/* ios */ /* ios */
"ios" : { "ios": {
"dSYMs" : false "dSYMs": false
}, },
/* SDK */ /* SDK */
"sdkConfigs" : { "sdkConfigs": {
"payment" : { "payment": {
"weixin" : { "weixin": {
"__platform__" : [ "ios", "android" ], "__platform__": ["ios", "android"],
"appid" : "123456", "appid": "123456",
"UniversalLinks" : "123456" "UniversalLinks": "123456"
}, },
"alipay" : { "alipay": {
"__platform__" : [ "ios", "android" ] "__platform__": ["ios", "android"]
} }
} }
} }
}, },
"nvueLaunchMode" : "" "nvueLaunchMode": ""
}, },
/* */ /* */
"quickapp" : {}, "quickapp": {},
/* */ /* */
"mp-weixin" : { "mp-weixin": {
"appid" : "", "appid": "",
"setting" : { "setting": {
"urlCheck" : false "urlCheck": false
}, },
"usingComponents" : true "usingComponents": true
}, },
"mp-alipay" : { "mp-alipay": {
"usingComponents" : true "usingComponents": true
}, },
"mp-baidu" : { "mp-baidu": {
"usingComponents" : true "usingComponents": true
}, },
"mp-toutiao" : { "mp-toutiao": {
"usingComponents" : true "usingComponents": true
}, },
"uniStatistics" : { "uniStatistics": {
"enable" : false "enable": false
}, },
"vueVersion" : "3" "vueVersion": "3"
} }

View File

@ -197,20 +197,23 @@ onLoad(async () => {
// //
updateStatusBarHeight() updateStatusBarHeight()
data.windowHeight = await deviceUtil.getWindowHeight() data.windowHeight = await deviceUtil.getWindowHeight()
})
onShow(() => {
// #ifdef APP-PLUS
util.setAndroidSystemBarColor('#F0F3F8')
plus.navigator.setStatusBarStyle("light");
// #endif
//
data.menuList = fastEntranceData()
// //
const cachedBalance = storage.get('balance') const cachedBalance = storage.get('balance')
if (cachedBalance !== null) { if (cachedBalance !== null) {
data.balance = cachedBalance data.balance = cachedBalance
} }
})
onShow(() => {
// #ifdef APP-PLUS
util.setAndroidSystemBarColor('#F0F3F8', "#ffffff")
// #endif
//
data.menuList = fastEntranceData()
getRecentBills() getRecentBills()
}) })
@ -228,6 +231,7 @@ const fastEntranceData = () => {
// //
const getRecentBills = () => { const getRecentBills = () => {
const allBillList = getBillList() const allBillList = getBillList()
// //
const sortedList = [...allBillList].sort((a, b) => { const sortedList = [...allBillList].sort((a, b) => {
const timeA = a.itemInfoList.find(info => info.key == 'createTime')?.value || 0 const timeA = a.itemInfoList.find(info => info.key == 'createTime')?.value || 0
@ -235,9 +239,12 @@ const getRecentBills = () => {
return new Date(timeB) - new Date(timeA) return new Date(timeB) - new Date(timeA)
}) })
console.log('sortedList', sortedList)
// 3 // 3
const recentBills = sortedList.filter(item => item.payMethod == '余额').slice(0, 3) const recentBills = sortedList.filter(item => item.payMethod == '余额').slice(0, 3)
console.log('recentBills', recentBills)
// //
data.changeDetailList = recentBills.map(item => { data.changeDetailList = recentBills.map(item => {
const createTime = item.itemInfoList.find(info => info.key == 'createTime')?.value || new Date() const createTime = item.itemInfoList.find(info => info.key == 'createTime')?.value || new Date()
@ -717,7 +724,7 @@ const onMenuScroll = (e) => {
.title-right>.text { .title-right>.text {
font-size: 14px; font-size: 14px;
color: var(--text-color); color: #979797;
} }
.right-icon { .right-icon {

View File

@ -473,6 +473,9 @@ let { billData, datePickerData, selectItemInfo } = toRefs(data)
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS
util.setAndroidSystemBarColor('#F5F5F5') util.setAndroidSystemBarColor('#F5F5F5')
setTimeout(() => {
plus.navigator.setStatusBarStyle("dark");
}, 500);
// #endif // #endif
}) })
@ -791,6 +794,9 @@ const onRightClick = async () => {
billData.value.payMethod = "余额" billData.value.payMethod = "余额"
} }
addBill(billData.value) addBill(billData.value)
const allBillList = getBillList()
console.log("getBillDataList------", allBillList)
} }
uni.showToast({ uni.showToast({

View File

@ -319,6 +319,9 @@ onShow(() => {
getBillData(data.billId) getBillData(data.billId)
// #ifdef APP-PLUS // #ifdef APP-PLUS
util.setAndroidSystemBarColor('#F5F5F5') util.setAndroidSystemBarColor('#F5F5F5')
setTimeout(() => {
plus.navigator.setStatusBarStyle("dark");
}, 500);
// #endif // #endif
}) })

View File

@ -12,7 +12,7 @@
<template v-slot:center> <template v-slot:center>
<view class="nav-bar-search flex-align-center flex-1"> <view class="nav-bar-search flex-align-center flex-1">
<image class="search-icon" src="/static/image/bill/bill-list/search-black.png" mode=""></image> <image class="search-icon" src="/static/image/bill/bill-list/search-black.png" mode=""></image>
<input type="text" class="search-input flex-1" placeholder="请输入搜索内容" /> <input type="text" class="search-input flex-1" placeholder="请输入交易记录" />
<view class="line h100"></view> <view class="line h100"></view>
<view class="search-button">搜索</view> <view class="search-button">搜索</view>
</view> </view>
@ -249,7 +249,9 @@ onShow(() => {
timingFunc: 'easeIn' timingFunc: 'easeIn'
} }
}) })
setTimeout(() => {
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");
}, 500);
// #endif // #endif
}) })
@ -258,6 +260,8 @@ onShow(() => {
*/ */
const getBillDataList = () => { const getBillDataList = () => {
const allBillList = getBillList() const allBillList = getBillList()
console.log("getBillDataList------", allBillList)
// //
const groupList = [] const groupList = []
allBillList.forEach(item => { allBillList.forEach(item => {

View File

@ -75,7 +75,9 @@ onLoad((options) => {
onShow(() => { onShow(() => {
// #ifdef APP-PLUS // #ifdef APP-PLUS
util.setAndroidSystemBarColor('#ffffff') util.setAndroidSystemBarColor('#ffffff')
setTimeout(() => {
plus.navigator.setStatusBarStyle("dark"); plus.navigator.setStatusBarStyle("dark");
}, 500);
// #endif // #endif
}) })

View File

@ -100,59 +100,59 @@
</view> </view>
</template> </template>
<script setup> <script setup>
import { import {
util, util,
uiUtil uiUtil
} from '@/utils/common.js' } from '@/utils/common.js'
import { import {
storage storage
} from '@/utils/storage.js' } from '@/utils/storage.js'
import { import {
get get
} from '@/utils/requests.js' } from '@/utils/requests.js'
import { import {
ref, ref,
reactive, reactive,
toRefs toRefs
} from 'vue'; } from 'vue';
import { import {
onLoad, onLoad,
onShow onShow
} from '@dcloudio/uni-app'; } from '@dcloudio/uni-app';
import { import {
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
// 菜单列表 // 菜单列表
const menuList = [{ const menuList = [{
icon: "yuemoni", icon: "yuemoni",
name: "余额模拟", name: "余额模拟",
isHot: false, isHot: false,
path: "/pages/balance/index" path: "/pages/balance/index"
}, },
{ {
icon: "zhangdanshencheng", icon: "zhangdanshencheng",
name: "账单生成", name: "账单生成",
isHot: false, isHot: false,
path: "/pages/bill/bill-list/bill-list" path: "/pages/bill/bill-list/bill-list"
}, },
{ {
icon: "licaiheika", icon: "licaiheika",
name: "理财黑卡", name: "理财黑卡",
isHot: true, isHot: true,
path: "" path: ""
}, },
{ {
icon: "huabei", icon: "huabei",
name: "花呗", name: "花呗",
isHot: false, isHot: false,
path: "" path: ""
}, },
] ]
const data = reactive({ const data = reactive({
statusBarHeight: 0, statusBarHeight: 0,
windowWidth: 0, windowWidth: 0,
windowHeight: 0, windowHeight: 0,
@ -161,9 +161,9 @@
noticeInfo: {}, noticeInfo: {},
vision: "", vision: "",
platform: '' // 添加平台信息 platform: '' // 添加平台信息
}) })
const { const {
statusBarHeight, statusBarHeight,
windowWidth, windowWidth,
windowHeight, windowHeight,
@ -172,19 +172,18 @@
noticeInfo, noticeInfo,
vision, vision,
platform platform
} = toRefs(data); } = toRefs(data);
onLoad(async () => {
// 启动时获取数据
fetchUserData()
onLoad(async () => {
// 获取平台信息 // 获取平台信息
const systemInfo = uni.getSystemInfoSync() const systemInfo = uni.getSystemInfoSync()
data.platform = systemInfo.platform data.platform = systemInfo.platform
data.vision = uni.getStorageSync('version') data.vision = uni.getStorageSync('version')
}) })
onShow(() => { onShow(() => {
// 启动时获取数据
fetchUserData()
// 每次显示时刷新数据 // 每次显示时刷新数据
setUserData() setUserData()
// 获取系统信息 // 获取系统信息
@ -194,13 +193,16 @@
data.windowHeight = systemInfo.windowHeight; data.windowHeight = systemInfo.windowHeight;
// #ifdef APP-PLUS // #ifdef APP-PLUS
util.setAndroidSystemBarColor('#F0F4F9') util.setAndroidSystemBarColor('#F0F4F9')
setTimeout(() => {
plus.navigator.setStatusBarStyle("dark");
}, 500)
// #endif // #endif
}) })
/** /**
* 获取用户数据(从服务器) * 获取用户数据(从服务器)
*/ */
const fetchUserData = async () => { const fetchUserData = async () => {
try { try {
// 先设置默认值,避免页面显示异常 // 先设置默认值,避免页面显示异常
setUserData() setUserData()
@ -230,12 +232,12 @@
} catch (error) { } catch (error) {
console.error('获取用户数据异常:', error) console.error('获取用户数据异常:', error)
} }
} }
/** /**
* 获取用户信息 * 获取用户信息
*/ */
const fetchUserInfo = async () => { const fetchUserInfo = async () => {
const data = await get('', 'api/user', {}) const data = await get('', 'api/user', {})
if (data.code === 0) { if (data.code === 0) {
uni.setStorageSync('userInfo', data.data) uni.setStorageSync('userInfo', data.data)
@ -243,12 +245,12 @@
} else { } else {
throw new Error(data.message || '获取用户信息失败') throw new Error(data.message || '获取用户信息失败')
} }
} }
/** /**
* 获取用户配置 * 获取用户配置
*/ */
const fetchUserConfig = async () => { const fetchUserConfig = async () => {
const data = await get('', 'api/user/config', {}) const data = await get('', 'api/user/config', {})
if (data.code === 0) { if (data.code === 0) {
uni.setStorageSync('config', data.data) uni.setStorageSync('config', data.data)
@ -256,13 +258,13 @@
} else { } else {
throw new Error(data.message || '获取用户配置失败') throw new Error(data.message || '获取用户配置失败')
} }
} }
/** /**
* 设置用户数据(从本地存储读取) * 设置用户数据(从本地存储读取)
*/ */
const setUserData = () => { const setUserData = () => {
// 用户信息 - 提供默认值 // 用户信息 - 提供默认值
const userInfoData = storage.get("userInfo") const userInfoData = storage.get("userInfo")
data.userInfo = userInfoData || { data.userInfo = userInfoData || {
@ -293,63 +295,63 @@
} }
data.videoHelpList = [] data.videoHelpList = []
} }
} }
const clickMenu = (item) => { const clickMenu = (item) => {
if (!item.path) { if (!item.path) {
uiUtil.showError('开发中') uiUtil.showError('开发中')
} else { } else {
util.goPage(item.path) util.goPage(item.path)
} }
} }
const openVip = () => { const openVip = () => {
console.log('openVip') console.log('openVip')
util.goPage('/pages/common/recharge/index') util.goPage('/pages/common/recharge/index')
} }
/** /**
* 点击视频教程 * 点击视频教程
* @param item * @param item
*/ */
const clickVideoHelp = (item) => { const clickVideoHelp = (item) => {
const url = item.url const url = item.url
util.goPage(`/pages/common/webview/webview?url=${encodeURIComponent(url)}&title=${item.text}`) util.goPage(`/pages/common/webview/webview?url=${encodeURIComponent(url)}&title=${item.text}`)
} }
/** /**
* 点击公告 * 点击公告
*/ */
const clickNotice = () => { const clickNotice = () => {
if (!noticeInfo.value.url) return if (!noticeInfo.value.url) return
const url = noticeInfo.value.url + `&uni_id=${userInfo.value.user_id}` const url = noticeInfo.value.url + `&uni_id=${userInfo.value.user_id}`
util.goPage(`/pages/common/webview/webview?url=${encodeURIComponent(url)}&title=${noticeInfo.value.title}`) util.goPage(`/pages/common/webview/webview?url=${encodeURIComponent(url)}&title=${noticeInfo.value.title}`)
} }
/** /**
* 退出模拟器 * 退出模拟器
*/ */
const exit = () => { const exit = () => {
plus.runtime.quit() plus.runtime.quit()
} }
const noticeContainer = ref(null); const noticeContainer = ref(null);
const noticeInner = ref(null); const noticeInner = ref(null);
const noticeBox = ref(null); const noticeBox = ref(null);
// #ifndef H5 // #ifndef H5
const animation = uni.requireNativePlugin('animation'); const animation = uni.requireNativePlugin('animation');
const dom = uni.requireNativePlugin('dom'); const dom = uni.requireNativePlugin('dom');
// #endif // #endif
let marqueeTimer = null; let marqueeTimer = null;
const currentMarqueeId = ref(0); const currentMarqueeId = ref(0);
const lastMarqueeText = ref(''); const lastMarqueeText = ref('');
/** /**
* 开始走马灯 * 开始走马灯
*/ */
const startMarquee = () => { const startMarquee = () => {
// 避免不必要的重置:如果文本没有变化且正在运行,则忽略 // 避免不必要的重置:如果文本没有变化且正在运行,则忽略
if (lastMarqueeText.value === noticeInfo.value.text && currentMarqueeId.value > 0) { if (lastMarqueeText.value === noticeInfo.value.text && currentMarqueeId.value > 0) {
return; return;
@ -397,12 +399,12 @@
}); });
}); });
}, 1000); // 增加延时确保渲染 }, 1000); // 增加延时确保渲染
} }
/** /**
* 执行滚动动画循环 * 执行滚动动画循环
*/ */
const runMarqueeAnimation = (containerWidth, textWidth, myId) => { const runMarqueeAnimation = (containerWidth, textWidth, myId) => {
// ID 校验如果当前ID不匹配说明已被新动画取代停止递归 // ID 校验如果当前ID不匹配说明已被新动画取代停止递归
if (myId !== currentMarqueeId.value) return; if (myId !== currentMarqueeId.value) return;
if (!noticeInner.value) return; if (!noticeInner.value) return;
@ -439,30 +441,30 @@
runMarqueeAnimation(containerWidth, textWidth, myId); runMarqueeAnimation(containerWidth, textWidth, myId);
}); });
}); });
} }
</script> </script>
<style> <style>
.container { .container {
background-color: #F0F4F9; background-color: #F0F4F9;
} }
.index-bg-img { .index-bg-img {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
z-index: 1; z-index: 1;
} }
.nav-bar-box { .nav-bar-box {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
z-index: 999; z-index: 999;
background-color: transparent; background-color: transparent;
} }
.content-box { .content-box {
position: fixed; position: fixed;
top: 0rpx; top: 0rpx;
left: 0; left: 0;
@ -472,31 +474,31 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
} }
.status-box { .status-box {
width: 100%; width: 100%;
} }
.nav-box { .nav-box {
height: 44px; height: 44px;
background-color: transparent; background-color: transparent;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.left-box { .left-box {
width: 60px; width: 60px;
height: 44px; height: 44px;
background-color: transparent; background-color: transparent;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.title { .title {
flex: 1; flex: 1;
height: 44px; height: 44px;
font-size: 32rpx; font-size: 32rpx;
@ -507,33 +509,33 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.right-box { .right-box {
width: 60px; width: 60px;
height: 44px; height: 44px;
background-color: transparent; background-color: transparent;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.user-box { .user-box {
position: relative; position: relative;
margin: 24rpx 32rpx 0; margin: 24rpx 32rpx 0;
height: 120rpx; height: 120rpx;
z-index: 10; z-index: 10;
} }
.user-bg { .user-bg {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 120rpx; height: 120rpx;
} }
.user-info-box { .user-info-box {
position: absolute; position: absolute;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -545,49 +547,49 @@
width: 100%; width: 100%;
height: 120rpx; height: 120rpx;
z-index: 1; z-index: 1;
} }
.user-info { .user-info {
flex: 1; flex: 1;
} }
.user-avatar { .user-avatar {
width: 72rpx; width: 72rpx;
height: 72rpx; height: 72rpx;
border-radius: 50%; border-radius: 50%;
margin-right: 20rpx; margin-right: 20rpx;
} }
.name-box { .name-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
} }
.phone-text { .phone-text {
font-size: 28rpx; font-size: 28rpx;
color: #FFFFFF; color: #FFFFFF;
font-weight: bold; font-weight: bold;
margin-right: 12rpx; margin-right: 12rpx;
} }
.vip-logo { .vip-logo {
width: 60rpx; width: 60rpx;
height: 20rpx; height: 20rpx;
} }
.vip-end-time { .vip-end-time {
font-size: 24rpx; font-size: 24rpx;
color: #FFFFFF; color: #FFFFFF;
margin-top: 8rpx; margin-top: 8rpx;
} }
.open-vip-btn { .open-vip-btn {
height: 40rpx; height: 40rpx;
width: 116rpx; width: 116rpx;
} }
.notice-box { .notice-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
@ -597,9 +599,9 @@
padding: 0 16rpx; padding: 0 16rpx;
height: 64rpx; height: 64rpx;
overflow: hidden; overflow: hidden;
} }
.sound-box { .sound-box {
height: 64rpx; height: 64rpx;
width: 50rpx; width: 50rpx;
display: flex; display: flex;
@ -607,35 +609,35 @@
justify-content: center; justify-content: center;
position: relative; position: relative;
z-index: 10; z-index: 10;
} }
.notice-content-wrapper { .notice-content-wrapper {
flex: 1; flex: 1;
flex-direction: row; flex-direction: row;
overflow: hidden; overflow: hidden;
} }
.notice-inner { .notice-inner {
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
} }
.notice-content { .notice-content {
font-size: 24rpx; font-size: 24rpx;
color: #767676; color: #767676;
} }
.group-box { .group-box {
margin: 32rpx; margin: 32rpx;
margin-bottom: 0; margin-bottom: 0;
} }
.title-img { .title-img {
width: 140rpx; width: 140rpx;
height: 44rpx; height: 44rpx;
} }
.video-help-box { .video-help-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
@ -644,43 +646,43 @@
padding: 24rpx 32rpx; padding: 24rpx 32rpx;
border-radius: 24rpx; border-radius: 24rpx;
margin-top: 16rpx; margin-top: 16rpx;
} }
.video-help-item { .video-help-item {
text-align: center; text-align: center;
flex-direction: column; flex-direction: column;
} }
.video-help-img { .video-help-img {
width: 96rpx; width: 96rpx;
height: 96rpx; height: 96rpx;
} }
.video-help-title { .video-help-title {
font-size: 24rpx; font-size: 24rpx;
color: #1A1A1A; color: #1A1A1A;
text-align: center; text-align: center;
} }
.menu-box { .menu-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 16rpx; margin-top: 16rpx;
} }
.item-box { .item-box {
position: relative; position: relative;
height: 156rpx; height: 156rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-end; justify-content: flex-end;
margin-bottom: 32rpx; margin-bottom: 32rpx;
} }
.menu-item { .menu-item {
display: flex; display: flex;
position: relative; position: relative;
flex-direction: row; flex-direction: row;
@ -690,46 +692,46 @@
border-radius: 16rpx; border-radius: 16rpx;
padding: 16rpx 32rpx; padding: 16rpx 32rpx;
height: 140rpx; height: 140rpx;
} }
.menu-item-name { .menu-item-name {
font-weight: bold; font-weight: bold;
font-size: 32rpx; font-size: 32rpx;
color: #000000; color: #000000;
} }
.name-img { .name-img {
height: 28rpx; height: 28rpx;
} }
.hot-icon { .hot-icon {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 68rpx; width: 68rpx;
height: 30rpx; height: 30rpx;
z-index: 99; z-index: 99;
} }
.activity-box { .activity-box {
margin: 0 32rpx; margin: 0 32rpx;
} }
.footer-box { .footer-box {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 40rpx; margin-top: 40rpx;
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.vision-text { .vision-text {
font-size: 24rpx; font-size: 24rpx;
color: #767676; color: #767676;
} }
.ios-padding-bottom { .ios-padding-bottom {
margin-bottom: 50rpx; margin-bottom: 50rpx;
} }
</style> </style>

View File

@ -39,6 +39,9 @@ export const store = reactive({
}); });
// 定义操作方法 // 定义操作方法
export const useStore = () => { export const useStore = () => {
// 用户相关操作 // 用户相关操作
@ -83,10 +86,6 @@ export const useStore = () => {
return store.billList return store.billList
} }
// 手动保存账单列表(替代自动监听)
const saveBillList = debounce(() => {
storage.set('bill_list', store.billList)
}, 500)
// 优化后的监听:使用防抖减少存储频率 // 优化后的监听:使用防抖减少存储频率
const debouncedSaveSettings = debounce((newValue) => { const debouncedSaveSettings = debounce((newValue) => {
@ -105,7 +104,12 @@ export const useStore = () => {
{ deep: true } { deep: true }
); );
// 移除billList的自动监听改为手动调用saveBillList // 监听billList改变自动保存
watch(
() => store.billList,
(newValue) => storage.set('bill_list', newValue),
{ deep: true }
);
// 获取系统信息(从缓存读取) // 获取系统信息(从缓存读取)
const getSystemInfo = () => { const getSystemInfo = () => {
@ -124,7 +128,6 @@ export const useStore = () => {
updateBill, updateBill,
deleteBill, deleteBill,
getBillList, getBillList,
saveBillList,
getSystemInfo getSystemInfo
}; };
}; };

View File

@ -387,7 +387,6 @@ export const util = {
let window = plus.android.invoke(activity, "getWindow"); let window = plus.android.invoke(activity, "getWindow");
plus.android.invoke(window, "setNavigationBarColor", colorInt); plus.android.invoke(window, "setNavigationBarColor", colorInt);
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: frontColor,
animation: { // 动画效果 animation: { // 动画效果
duration: 100, duration: 100,
timingFunc: 'easeIn' timingFunc: 'easeIn'
@ -395,7 +394,6 @@ export const util = {
}) })
setTimeout(function () { setTimeout(function () {
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: frontColor,
animation: { // 动画效果 animation: { // 动画效果
duration: 100, duration: 100,
timingFunc: 'easeIn' timingFunc: 'easeIn'
@ -407,7 +405,6 @@ export const util = {
} catch (err) { } catch (err) {
console.log("状态栏修改失败", err); console.log("状态栏修改失败", err);
uni.setNavigationBarColor({ uni.setNavigationBarColor({
frontColor: frontColor,
animation: { // 动画效果 animation: { // 动画效果
duration: 100, duration: 100,
timingFunc: 'easeIn' timingFunc: 'easeIn'