第一次上传

This commit is contained in:
xxk
2026-06-11 09:53:11 +08:00
commit e257f2009e
89 changed files with 4336 additions and 0 deletions
@@ -0,0 +1 @@
"use strict";const e=require("../common/vendor.js"),t={__name:"AppTabBar",props:{current:{type:String,default:"home"}},setup(t){const a=t,o=[{id:"home",label:"首页",path:"/pages/home/index",color:"#1f6f5f"},{id:"bills",label:"账单",path:"/pages/bills/index",color:"#d36c43"},{id:"budget",label:"预算",path:"/pages/budget/index",color:"#5f8df5"},{id:"stats",label:"报表",path:"/pages/stats/index",color:"#7f56d9"},{id:"mine",label:"我的",path:"/pages/mine/index",color:"#44546a"}];return(r,d)=>({a:e.f(o,((o,r,d)=>({a:t.current===o.id?o.color:"var(--line-soft)",b:e.t(o.label),c:o.id,d:t.current===o.id?1:"",e:e.o((t=>function(t){t.id!==a.current&&e.index.redirectTo({url:t.path})}(o)),o.id)})))})}},a=e._export_sfc(t,[["__scopeId","data-v-c3788da6"]]);wx.createComponent(a);
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
@@ -0,0 +1 @@
<view class="surface-card tabbar data-v-c3788da6"><view wx:for="{{a}}" wx:for-item="item" wx:key="c" class="{{['tab-item', 'data-v-c3788da6', item.d && 'active']}}" bindtap="{{item.e}}"><view class="tab-dot data-v-c3788da6" style="{{'background:' + item.a}}"></view><text class="tab-label data-v-c3788da6">{{item.b}}</text></view></view>
@@ -0,0 +1 @@
.tabbar.data-v-c3788da6{position:fixed;left:24rpx;right:24rpx;bottom:24rpx;display:flex;align-items:center;justify-content:space-between;padding:18rpx 12rpx env(safe-area-inset-bottom);z-index:20}.tab-item.data-v-c3788da6{flex:1;display:flex;flex-direction:column;align-items:center;gap:10rpx;padding:14rpx 0;border-radius:22rpx}.tab-item.active.data-v-c3788da6{background:var(--brand-soft)}.tab-dot.data-v-c3788da6{width:18rpx;height:18rpx;border-radius:50%}.tab-label.data-v-c3788da6{font-size:22rpx;color:var(--text-secondary)}.tab-item.active .tab-label.data-v-c3788da6{color:var(--text-primary);font-weight:600}
@@ -0,0 +1 @@
"use strict";const e=require("../common/vendor.js"),t=require("../utils/date.js"),a={__name:"BillEditorPopup",props:{visible:{type:Boolean,default:!1},entry:{type:Object,default:null},categories:{type:Object,required:!0},accounts:{type:Array,required:!0},defaultType:{type:String,default:"expense"},initialCategoryId:{type:String,default:""}},emits:["close","save"],setup(a,{emit:o}){const d=a,i=o,c=[{label:"支出",value:"expense"},{label:"收入",value:"income"}],n=e.reactive({id:"",type:"expense",amount:"",categoryId:"",accountId:"",date:t.toDateKey(),note:"",createdAt:0}),l=e.computed((()=>d.categories[n.type]||[]));function u(e){n.date=e.detail.value}function r(){Number(n.amount)?n.categoryId&&n.accountId?(i("save",{id:n.id,type:n.type,amount:Number(n.amount),categoryId:n.categoryId,accountId:n.accountId,date:n.date,note:n.note.trim(),createdAt:n.createdAt}),i("close")):e.index.showToast({title:"请选择分类和账户",icon:"none"}):e.index.showToast({title:"请输入有效金额",icon:"none"})}return e.watch((()=>d.visible),(e=>{e&&function(){var e,a,o;const i=d.entry||{},c=i.type||d.defaultType||"expense",l=d.initialCategoryId&&(d.categories[c]||[]).some((e=>e.id===d.initialCategoryId))?d.initialCategoryId:(null==(a=null==(e=d.categories[c])?void 0:e[0])?void 0:a.id)||"";n.id=i.id||"",n.type=c,n.amount=i.amount?String(i.amount):"",n.categoryId=i.categoryId||l,n.accountId=i.accountId||(null==(o=d.accounts[0])?void 0:o.id)||"",n.date=i.date||t.toDateKey(),n.note=i.note||"",n.createdAt=i.createdAt||0}()}),{immediate:!0}),e.watch((()=>n.type),(e=>{const t=(d.categories[e]||[]).map((e=>e.id));t.includes(n.categoryId)||(n.categoryId=t[0]||"")})),(t,o)=>e.e({a:a.visible},a.visible?{b:e.o((e=>i("close"))),c:e.t(n.id?"编辑账单":"新增账单"),d:e.o((e=>i("close"))),e:e.f(c,((t,a,o)=>({a:e.t(t.label),b:t.value,c:n.type===t.value?1:"",d:e.o((e=>n.type=t.value),t.value)}))),f:n.amount,g:e.o((e=>n.amount=e.detail.value)),h:e.f(l.value,((t,a,o)=>({a:t.color,b:e.t(t.name),c:t.id,d:n.categoryId===t.id?1:"",e:e.o((e=>n.categoryId=t.id),t.id)}))),i:e.f(a.accounts,((t,a,o)=>({a:t.color,b:e.t(t.name),c:t.id,d:n.accountId===t.id?1:"",e:e.o((e=>n.accountId=t.id),t.id)}))),j:e.t(n.date),k:n.date,l:e.o(u),m:n.note,n:e.o((e=>n.note=e.detail.value)),o:e.o((e=>i("close"))),p:e.o(r),q:e.o((()=>{}))}:{})}},o=e._export_sfc(a,[["__scopeId","data-v-eeef8b0e"]]);wx.createComponent(o);
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
@@ -0,0 +1 @@
<view wx:if="{{a}}" class="popup-shell data-v-eeef8b0e" catchtouchmove="{{q}}"><view class="popup-mask data-v-eeef8b0e" bindtap="{{b}}"></view><view class="surface-card popup-panel data-v-eeef8b0e"><view class="popup-head data-v-eeef8b0e"><view class="data-v-eeef8b0e"><text class="section-title data-v-eeef8b0e">{{c}}</text><text class="section-subtitle data-v-eeef8b0e">3 步完成记录,所有数据仅保存在本机</text></view><text class="close-text data-v-eeef8b0e" bindtap="{{d}}">关闭</text></view><scroll-view scroll-y class="popup-body data-v-eeef8b0e"><view class="field-block data-v-eeef8b0e"><text class="field-label data-v-eeef8b0e">收支类型</text><view class="pill-row data-v-eeef8b0e"><view wx:for="{{e}}" wx:for-item="item" wx:key="b" class="{{['pill-button', 'data-v-eeef8b0e', item.c && 'active']}}" bindtap="{{item.d}}">{{item.a}}</view></view></view><view class="field-block data-v-eeef8b0e"><text class="field-label data-v-eeef8b0e">金额</text><view class="input-shell amount-shell data-v-eeef8b0e"><text class="prefix-text data-v-eeef8b0e">¥</text><input class="data-v-eeef8b0e" type="digit" placeholder="输入金额" value="{{f}}" bindinput="{{g}}"/></view></view><view class="field-block data-v-eeef8b0e"><text class="field-label data-v-eeef8b0e">分类</text><view class="chip-grid data-v-eeef8b0e"><view wx:for="{{h}}" wx:for-item="item" wx:key="c" class="{{['chip-item', 'data-v-eeef8b0e', item.d && 'active']}}" bindtap="{{item.e}}"><view class="chip-dot data-v-eeef8b0e" style="{{'background:' + item.a}}"></view><text class="data-v-eeef8b0e">{{item.b}}</text></view></view></view><view class="field-block data-v-eeef8b0e"><text class="field-label data-v-eeef8b0e">账户</text><view class="chip-grid data-v-eeef8b0e"><view wx:for="{{i}}" wx:for-item="item" wx:key="c" class="{{['chip-item', 'data-v-eeef8b0e', item.d && 'active']}}" bindtap="{{item.e}}"><view class="chip-dot data-v-eeef8b0e" style="{{'background:' + item.a}}"></view><text class="data-v-eeef8b0e">{{item.b}}</text></view></view></view><view class="field-block data-v-eeef8b0e"><text class="field-label data-v-eeef8b0e">日期</text><picker class="data-v-eeef8b0e" mode="date" value="{{k}}" bindchange="{{l}}"><view class="input-shell picker-shell data-v-eeef8b0e"><text class="data-v-eeef8b0e">{{j}}</text><text class="tiny-text data-v-eeef8b0e">选择</text></view></picker></view><view class="field-block data-v-eeef8b0e"><text class="field-label data-v-eeef8b0e">备注</text><view class="input-shell textarea-shell data-v-eeef8b0e"><block wx:if="{{r0}}"><textarea class="data-v-eeef8b0e" maxlength="40" placeholder="补充说明,便于后续搜索" value="{{m}}" bindinput="{{n}}"></textarea></block></view></view></scroll-view><view class="popup-foot data-v-eeef8b0e"><view class="ghost-button data-v-eeef8b0e" bindtap="{{o}}">取消</view><view class="primary-button save-button data-v-eeef8b0e" bindtap="{{p}}">保存账单</view></view></view></view>
@@ -0,0 +1 @@
.popup-shell.data-v-eeef8b0e{position:fixed;top:0;right:0;bottom:0;left:0;z-index:50}.popup-mask.data-v-eeef8b0e{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(3,12,21,.42)}.popup-panel.data-v-eeef8b0e{position:absolute;left:16rpx;right:16rpx;bottom:16rpx;max-height:84vh;padding:28rpx 28rpx 32rpx;display:flex;flex-direction:column;gap:24rpx}.popup-head.data-v-eeef8b0e{display:flex;align-items:flex-start;justify-content:space-between;gap:16rpx}.close-text.data-v-eeef8b0e{padding:10rpx 0;font-size:24rpx;color:var(--text-secondary)}.popup-body.data-v-eeef8b0e{max-height:58vh}.field-block.data-v-eeef8b0e{display:flex;flex-direction:column;gap:18rpx;margin-bottom:24rpx}.field-label.data-v-eeef8b0e{font-size:26rpx;font-weight:600;color:var(--text-primary)}.pill-row.data-v-eeef8b0e,.chip-grid.data-v-eeef8b0e{display:flex;flex-wrap:wrap;gap:16rpx}.chip-item.data-v-eeef8b0e{display:flex;align-items:center;gap:10rpx;padding:16rpx 20rpx;border-radius:22rpx;background:var(--surface-muted);color:var(--text-secondary);font-size:24rpx}.chip-item.active.data-v-eeef8b0e{background:var(--brand-soft);color:var(--text-primary)}.chip-dot.data-v-eeef8b0e{width:14rpx;height:14rpx;border-radius:50%}.amount-shell.data-v-eeef8b0e{gap:12rpx}.prefix-text.data-v-eeef8b0e{font-size:36rpx;font-weight:600;color:var(--text-primary)}.picker-shell.data-v-eeef8b0e{justify-content:space-between}.textarea-shell.data-v-eeef8b0e{padding:20rpx 24rpx;min-height:160rpx;align-items:flex-start}.textarea-shell textarea.data-v-eeef8b0e{min-height:120rpx}.popup-foot.data-v-eeef8b0e{display:flex;align-items:center;gap:16rpx}.popup-foot .ghost-button.data-v-eeef8b0e{flex:0 0 180rpx}.save-button.data-v-eeef8b0e{flex:1}
@@ -0,0 +1 @@
"use strict";const t=require("../common/vendor.js"),e={__name:"SectionCard",props:{title:{type:String,default:""},subtitle:{type:String,default:""}},setup:e=>(i,s)=>t.e({a:e.title||e.subtitle||i.$slots.action},e.title||e.subtitle||i.$slots.action?t.e({b:e.title},e.title?{c:t.t(e.title)}:{},{d:e.subtitle},e.subtitle?{e:t.t(e.subtitle)}:{}):{})},i=t._export_sfc(e,[["__scopeId","data-v-55faa340"]]);wx.createComponent(i);
@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}
@@ -0,0 +1 @@
<view class="surface-card card data-v-55faa340"><view wx:if="{{a}}" class="head data-v-55faa340"><view class="title-group data-v-55faa340"><text wx:if="{{b}}" class="section-title data-v-55faa340">{{c}}</text><text wx:if="{{d}}" class="section-subtitle data-v-55faa340">{{e}}</text></view><slot name="action"></slot></view><slot></slot></view>
@@ -0,0 +1 @@
.card.data-v-55faa340{padding:28rpx}.head.data-v-55faa340{display:flex;align-items:flex-start;justify-content:space-between;gap:16rpx;margin-bottom:24rpx}.title-group.data-v-55faa340{display:flex;flex-direction:column;gap:10rpx}