2
This commit is contained in:
@@ -151,7 +151,6 @@
|
||||
|
||||
<!-- 购物车空态 -->
|
||||
<view class="empty" v-if="!items.length">
|
||||
<image src="/static/icons/icons8-shopping-cart-100.png" mode="widthFix" class="empty-img"></image>
|
||||
<text class="empty-text">购物车里空空如也</text>
|
||||
<text class="empty-sub">扫描或点击 “+” 选择商品吧</text>
|
||||
</view>
|
||||
@@ -217,14 +216,14 @@
|
||||
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'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -281,11 +280,26 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async fetchCategories() {
|
||||
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 get('/api/finance/categories')
|
||||
if (res && Array.isArray(res.incomeCategories)) this._incomeCategories = res.incomeCategories
|
||||
if (res && Array.isArray(res.expenseCategories)) this._expenseCategories = res.expenseCategories
|
||||
if (res && Array.isArray(res.incomeCategories)) this._incomeCategories = this.normalizeCats(res.incomeCategories)
|
||||
if (res && Array.isArray(res.expenseCategories)) this._expenseCategories = this.normalizeCats(res.expenseCategories)
|
||||
this.ensureActiveCategory()
|
||||
} catch (_) { this.ensureActiveCategory() }
|
||||
},
|
||||
@@ -397,47 +411,51 @@
|
||||
.tabs text { color: $uni-text-color-grey; }
|
||||
.tabs text.active { color: $uni-text-color; font-weight: 700; }
|
||||
/* 三段式胶囊切换 */
|
||||
.seg3 { display:flex; gap: 0; 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); }
|
||||
.seg3-item { flex:1; display:flex; align-items:center; justify-content:center; gap: 8rpx; padding: 12rpx 0; color:$uni-text-color; border-radius: 999rpx; }
|
||||
.seg3 { display:flex; gap: 0; margin: 12rpx 16rpx; padding: 6rpx; background:#fff; border-radius: 999rpx; box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.04); }
|
||||
.seg3-item { flex:1; display:flex; align-items:center; justify-content:center; gap: 8rpx; padding: 12rpx 0; color:$uni-text-color; border-radius: 999rpx; transition: box-shadow .2s ease, background .2s ease; }
|
||||
/* 间隔通过内边距处理,避免空选择器 */
|
||||
.seg3-item.active { background:#fff; color:#4C8DFF; box-shadow: 0 4rpx 12rpx rgba(76,141,255,0.20), 0 0 0 2rpx #4C8DFF inset; }
|
||||
.seg3-item.active { background:#fff; color:#4C8DFF; box-shadow: 0 3rpx 10rpx rgba(76,141,255,0.16); }
|
||||
.seg3-icon { width: 28rpx; height: 28rpx; opacity: .9; }
|
||||
.field { display:flex; justify-content: space-between; padding: 22rpx 24rpx; background: $uni-bg-color-grey; border-bottom: 1rpx solid $uni-border-color; }
|
||||
.label { color:$uni-text-color-grey; }
|
||||
.value { color:$uni-text-color; }
|
||||
.field { display:flex; align-items:center; justify-content: flex-start; padding: 22rpx 24rpx; background: #f8faff; gap: 16rpx; }
|
||||
.label { width: 160rpx; color:$uni-text-color-grey; }
|
||||
.value { flex:1; color:$uni-text-color; text-align:right; }
|
||||
/* 汇总卡片:白底卡片+主色按钮 */
|
||||
.summary { display:flex; justify-content: space-between; align-items:center; padding: 16rpx 18rpx; margin: 12rpx 16rpx; background:#fff; border:2rpx solid $uni-border-color; border-radius: 16rpx; color:$uni-text-color; }
|
||||
.summary { display:flex; justify-content: space-between; align-items:center; padding: 18rpx 20rpx; margin: 16rpx 18rpx 10rpx; background: none; border-radius: 18rpx; color:$uni-text-color; }
|
||||
/* 加号改为图标按钮 */
|
||||
.add { margin: 18rpx auto; width: 120rpx; height: 120rpx; border-radius: 24rpx; background: #fff; border:2rpx solid $uni-color-primary; color:$uni-color-primary; font-size: 72rpx; display:flex; align-items:center; justify-content:center; box-shadow: 0 6rpx 16rpx rgba(76,141,255,0.12); }
|
||||
.add { margin: 24rpx auto 18rpx; width: 120rpx; height: 120rpx; border-radius: 28rpx; background: none; border:0; color:$uni-color-primary; font-size: 72rpx; display:flex; align-items:center; justify-content:center; box-shadow: none; }
|
||||
.empty { display:flex; flex-direction: column; align-items:center; padding: 60rpx 0; color:$uni-text-color-grey; }
|
||||
.empty-img { width: 160rpx; margin-bottom: 16rpx; }
|
||||
.empty-text { margin-bottom: 8rpx; }
|
||||
.list { background:#fff; margin: 0 16rpx 12rpx; border:2rpx solid $uni-border-color; border-radius: 16rpx; overflow: hidden; }
|
||||
.row { display:grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 12rpx; padding: 16rpx 12rpx; align-items:center; border-bottom: 1rpx solid $uni-border-color; }
|
||||
.list { background:#fff; 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: 18rpx 16rpx; align-items:center; }
|
||||
.col.name { padding-left: 12rpx; }
|
||||
.col.amount { text-align:right; padding-right: 12rpx; color:$uni-text-color; }
|
||||
.bottom { position: fixed; left:0; right:0; bottom:0; background:$uni-bg-color-grey; padding: 16rpx 24rpx calc(env(safe-area-inset-bottom) + 16rpx); box-shadow: 0 -4rpx 12rpx rgba(0,0,0,0.16); }
|
||||
.primary { width: 100%; background: $uni-color-primary; color:#fff; border-radius: 999rpx; padding: 20rpx 0; font-weight:800; }
|
||||
.bottom { position: fixed; left:0; right:0; bottom:0; background:$uni-bg-color-grey; padding: 6rpx 18rpx calc(env(safe-area-inset-bottom) + 2rpx); box-shadow: 0 -4rpx 12rpx rgba(0,0,0,0.16); }
|
||||
.order .bottom button { margin: 0; }
|
||||
/* 仅限开单页底部按钮样式(缩小高度) */
|
||||
.order .bottom .primary { width: 100%; background: $uni-color-primary; color:#fff; border-radius: 999rpx; padding: 14rpx 0; font-weight:700; font-size: 28rpx; }
|
||||
.order .bottom .ghost { background: transparent; color: $uni-color-primary; border: 0; border-radius: 999rpx; padding: 12rpx 0; font-size: 28rpx; }
|
||||
/* 收款/付款页样式 */
|
||||
.pay-row .pay-input { text-align: right; color:$uni-text-color; }
|
||||
.textarea { position: relative; padding: 16rpx 24rpx; background:$uni-bg-color-grey; border-top: 1rpx solid $uni-border-color; }
|
||||
.amount-badge { position: absolute; right: 24rpx; top: -36rpx; background: $uni-color-primary; color:#fff; padding: 8rpx 16rpx; border-radius: 12rpx; font-size: 24rpx; }
|
||||
.textarea { position: relative; padding: 16rpx 24rpx; background:#f8faff; }
|
||||
.amount-badge { position: absolute; right: 24rpx; top: -32rpx; background: $uni-color-primary; color:#fff; padding: 10rpx 20rpx; border-radius: 14rpx; font-size: 24rpx; }
|
||||
.date-mini { position: absolute; right: 24rpx; bottom: 20rpx; color:$uni-text-color-grey; font-size: 24rpx; }
|
||||
/* 分类chips样式:选中后文字变红 */
|
||||
.chips { display:flex; flex-wrap: wrap; gap: 12rpx; padding: 12rpx 24rpx; }
|
||||
.chip { padding: 10rpx 20rpx; border-radius: 999rpx; background: $uni-bg-color-hover; color:$uni-text-color-grey; }
|
||||
.chip.active { background: $uni-color-primary; color:#fff; }
|
||||
.chips { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12rpx 16rpx; padding: 12rpx 24rpx; }
|
||||
.chip { padding: 12rpx 20rpx; border-radius: 999rpx; background: $uni-bg-color-hover; color:$uni-text-color-grey; text-align:center; }
|
||||
.chip.active { background: rgba(76,141,255,0.15); color:$uni-color-primary; }
|
||||
|
||||
/* 顶部业务 Tabs 显示 */
|
||||
|
||||
/* 快捷操作宫格 */
|
||||
/* 信息卡片式表达(更稳重) */
|
||||
.info-card { display:grid; grid-template-columns: 1fr 1fr auto; gap: 10rpx; margin: 10rpx 12rpx 0; background:transparent; padding: 0; align-items:center; }
|
||||
.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); }
|
||||
.info-field { background:#fff; border:0; border-radius: 14rpx; padding: 12rpx 14rpx; box-shadow: 0 6rpx 16rpx rgba(0,0,0,0.06); }
|
||||
.info-label { color:$uni-text-color-grey; font-size: 24rpx; margin-right: 8rpx; }
|
||||
.info-value { color:$uni-text-color; font-weight: 700; }
|
||||
.info-action { display:flex; align-items:center; gap: 6rpx; background:$uni-color-primary; color:#fff; border-radius: 12rpx; padding: 14rpx 16rpx; box-shadow: 0 8rpx 18rpx rgba(76,141,255,0.26); }
|
||||
.info-icon { width: 32rpx; height: 32rpx; }
|
||||
/* 缩小“加商品”按钮尺寸,仅在本页卡片内 */
|
||||
.order .info-card .info-action { display:flex; align-items:center; gap: 6rpx; background:$uni-color-primary; color:#fff; border-radius: 12rpx; padding: 8rpx 12rpx; box-shadow: 0 5rpx 12rpx rgba(76,141,255,0.18); font-size: 26rpx; }
|
||||
.order .info-card .info-icon { width: 24rpx; height: 24rpx; }
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user