This commit is contained in:
2025-09-17 14:40:16 +08:00
parent 46c5682960
commit a3bbc0098a
94 changed files with 3549 additions and 105 deletions

View File

@@ -0,0 +1,45 @@
<template>
<view class="page">
<view class="item">
<text>隐藏零库存商品</text>
<switch :checked="settings.hideZeroStock" @change="(e)=>update('hideZeroStock', e.detail.value)" />
</view>
<view class="item">
<text>隐藏进货价</text>
<switch :checked="settings.hidePurchasePrice" @change="(e)=>update('hidePurchasePrice', e.detail.value)" />
</view>
</view>
</template>
<script>
import { get, put } from '../../common/http.js'
export default {
data() {
return { settings: { hideZeroStock: false, hidePurchasePrice: false } }
},
onLoad() { this.load() },
methods: {
async load() {
try {
const res = await get('/api/product-settings')
this.settings = { hideZeroStock: !!res?.hideZeroStock, hidePurchasePrice: !!res?.hidePurchasePrice }
} catch (_) {}
},
async update(key, val) {
const next = { ...this.settings, [key]: val }
this.settings = next
try { await put('/api/product-settings', next) } catch (_) {}
}
}
}
</script>
<style>
.page { background:#fff; }
.item { display:flex; justify-content: space-between; align-items:center; padding: 20rpx; border-bottom: 1rpx solid #f1f1f1; }
</style>