This commit is contained in:
2025-09-27 22:57:59 +08:00
parent 8a458ff0a4
commit ed26244cdb
12585 changed files with 1914308 additions and 3474 deletions

View File

@@ -37,14 +37,14 @@ const _sfc_main = {
showMore: false,
SEG_ICONS: {
sale: {
out: "/static/icons/sale.png",
return: "/static/icons/other-pay.png",
collect: "/static/icons/report.png"
out: "/static/icons/icons8-shopping-cart-100.png",
return: "/static/icons/icons8-return-purchase-50.png",
collect: "/static/icons/icons8-profit-50.png"
},
purchase: {
in: "/static/icons/purchase.png",
return: "/static/icons/other-pay.png",
pay: "/static/icons/account.png"
in: "/static/icons/icons8-purchase-order-100.png",
return: "/static/icons/icons8-return-purchase-50.png",
pay: "/static/icons/icons8-dollar-ethereum-exchange-50.png"
}
}
};
@@ -120,13 +120,33 @@ const _sfc_main = {
}
},
methods: {
fixMojibake(s) {
try {
if (!s)
return s;
const bad = /[ÂÃæåé¼½¢]/.test(s);
if (!bad)
return s;
return decodeURIComponent(escape(s));
} catch (_) {
return s;
}
},
normalizeCats(list) {
if (!Array.isArray(list))
return [];
return list.map((it) => ({
key: it && it.key || "",
label: this.fixMojibake(it && it.label || "")
})).filter((it) => it.key && it.label);
},
async fetchCategories() {
try {
const res = await common_http.get("/api/finance/categories");
if (res && Array.isArray(res.incomeCategories))
this._incomeCategories = res.incomeCategories;
this._incomeCategories = this.normalizeCats(res.incomeCategories);
if (res && Array.isArray(res.expenseCategories))
this._expenseCategories = res.expenseCategories;
this._expenseCategories = this.normalizeCats(res.expenseCategories);
this.ensureActiveCategory();
} catch (_) {
this.ensureActiveCategory();
@@ -392,10 +412,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
}, {
ag: $data.biz === "sale" || $data.biz === "purchase",
aG: !$data.items.length
}, !$data.items.length ? {
aH: common_assets._imports_0
} : {
aI: common_vendor.f($data.items, (it, idx, i0) => {
}, !$data.items.length ? {} : {
aH: common_vendor.f($data.items, (it, idx, i0) => {
return {
a: common_vendor.t(it.productName),
b: common_vendor.o([common_vendor.m(($event) => it.quantity = $event.detail.value, {
@@ -411,8 +429,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
};
})
}, {
aJ: common_vendor.o((...args) => $options.saveAndReset && $options.saveAndReset(...args)),
aK: common_vendor.o((...args) => $options.submit && $options.submit(...args))
aI: common_vendor.o((...args) => $options.saveAndReset && $options.saveAndReset(...args)),
aJ: common_vendor.o((...args) => $options.submit && $options.submit(...args))
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

File diff suppressed because one or more lines are too long

View File

@@ -47,9 +47,8 @@
margin: 12rpx 16rpx;
padding: 6rpx;
background: #fff;
border: 2rpx solid #e6ebf2;
border-radius: 999rpx;
box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.04);
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.04);
}
.seg3-item {
flex: 1;
@@ -60,13 +59,14 @@
padding: 12rpx 0;
color: #111;
border-radius: 999rpx;
transition: box-shadow 0.2s ease, background 0.2s ease;
}
/* 间隔通过内边距处理,避免空选择器 */
.seg3-item.active {
background: #fff;
color: #4C8DFF;
box-shadow: 0 4rpx 12rpx rgba(76, 141, 255, 0.2), 0 0 0 2rpx #4C8DFF inset;
box-shadow: 0 3rpx 10rpx rgba(76, 141, 255, 0.16);
}
.seg3-icon {
width: 28rpx;
@@ -75,16 +75,20 @@
}
.field {
display: flex;
justify-content: space-between;
align-items: center;
justify-content: flex-start;
padding: 22rpx 24rpx;
background: #ffffff;
border-bottom: 1rpx solid #e5e7eb;
background: #f8faff;
gap: 16rpx;
}
.label {
width: 160rpx;
color: #444;
}
.value {
flex: 1;
color: #111;
text-align: right;
}
/* 汇总卡片:白底卡片+主色按钮 */
@@ -92,28 +96,27 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: 16rpx 18rpx;
margin: 12rpx 16rpx;
background: #fff;
border: 2rpx solid #e5e7eb;
border-radius: 16rpx;
padding: 18rpx 20rpx;
margin: 16rpx 18rpx 10rpx;
background: none;
border-radius: 18rpx;
color: #111;
}
/* 加号改为图标按钮 */
.add {
margin: 18rpx auto;
margin: 24rpx auto 18rpx;
width: 120rpx;
height: 120rpx;
border-radius: 24rpx;
background: #fff;
border: 2rpx solid #4C8DFF;
border-radius: 28rpx;
background: none;
border: 0;
color: #4C8DFF;
font-size: 72rpx;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 6rpx 16rpx rgba(76, 141, 255, 0.12);
box-shadow: none;
}
.empty {
display: flex;
@@ -131,18 +134,17 @@
}
.list {
background: #fff;
margin: 0 16rpx 12rpx;
border: 2rpx solid #e5e7eb;
border-radius: 16rpx;
margin: 0 18rpx 20rpx;
border-radius: 18rpx;
overflow: hidden;
box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.06);
}
.row {
display: grid;
grid-template-columns: 1.5fr 1fr 1fr 1fr;
gap: 12rpx;
padding: 16rpx 12rpx;
padding: 18rpx 16rpx;
align-items: center;
border-bottom: 1rpx solid #e5e7eb;
}
.col.name {
padding-left: 12rpx;
@@ -158,16 +160,30 @@
right: 0;
bottom: 0;
background: #ffffff;
padding: 16rpx 24rpx calc(env(safe-area-inset-bottom) + 16rpx);
padding: 6rpx 18rpx calc(env(safe-area-inset-bottom) + 2rpx);
box-shadow: 0 -4rpx 12rpx rgba(0, 0, 0, 0.16);
}
.primary {
.order .bottom button {
margin: 0;
}
/* 仅限开单页底部按钮样式(缩小高度) */
.order .bottom .primary {
width: 100%;
background: #4C8DFF;
color: #fff;
border-radius: 999rpx;
padding: 20rpx 0;
font-weight: 800;
padding: 14rpx 0;
font-weight: 700;
font-size: 28rpx;
}
.order .bottom .ghost {
background: transparent;
color: #4C8DFF;
border: 0;
border-radius: 999rpx;
padding: 12rpx 0;
font-size: 28rpx;
}
/* 收款/付款页样式 */
@@ -178,17 +194,16 @@
.textarea {
position: relative;
padding: 16rpx 24rpx;
background: #ffffff;
border-top: 1rpx solid #e5e7eb;
background: #f8faff;
}
.amount-badge {
position: absolute;
right: 24rpx;
top: -36rpx;
top: -32rpx;
background: #4C8DFF;
color: #fff;
padding: 8rpx 16rpx;
border-radius: 12rpx;
padding: 10rpx 20rpx;
border-radius: 14rpx;
font-size: 24rpx;
}
.date-mini {
@@ -201,20 +216,21 @@
/* 分类chips样式选中后文字变红 */
.chips {
display: flex;
flex-wrap: wrap;
gap: 12rpx;
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12rpx 16rpx;
padding: 12rpx 24rpx;
}
.chip {
padding: 10rpx 20rpx;
padding: 12rpx 20rpx;
border-radius: 999rpx;
background: #f1f1f1;
color: #444;
text-align: center;
}
.chip.active {
background: #4C8DFF;
color: #fff;
background: rgba(76, 141, 255, 0.15);
color: #4C8DFF;
}
/* 顶部业务 Tabs 显示 */
@@ -231,10 +247,10 @@
}
.info-field {
background: #fff;
border: 2rpx solid #e6ebf2;
border-radius: 12rpx;
padding: 10rpx 12rpx;
box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.04);
border: 0;
border-radius: 14rpx;
padding: 12rpx 14rpx;
box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.06);
}
.info-label {
color: #444;
@@ -245,17 +261,20 @@
color: #111;
font-weight: 700;
}
.info-action {
/* 缩小“加商品”按钮尺寸,仅在本页卡片内 */
.order .info-card .info-action {
display: flex;
align-items: center;
gap: 6rpx;
background: #4C8DFF;
color: #fff;
border-radius: 12rpx;
padding: 14rpx 16rpx;
box-shadow: 0 8rpx 18rpx rgba(76, 141, 255, 0.26);
padding: 8rpx 12rpx;
box-shadow: 0 5rpx 12rpx rgba(76, 141, 255, 0.18);
font-size: 26rpx;
}
.info-icon {
width: 32rpx;
height: 32rpx;
.order .info-card .info-icon {
width: 24rpx;
height: 24rpx;
}