完善页面8

This commit is contained in:
2026-02-24 10:35:34 +08:00
parent f814db2f12
commit 92d6e8144d
90 changed files with 1183 additions and 1887 deletions

View File

@@ -24,9 +24,8 @@ const loading = ref<boolean>(false)
<style scoped lang="scss">
.page-container {
padding: 20px;
/* 使用 Layout 的背景和内边距 */
min-height: 100vh;
background: #f5f5f5;
}
.page-header {

View File

@@ -242,7 +242,7 @@ const toggleStatus = (index: number) => {
/* 表格区域 */
.table-card { background-color: #fff; display: flex; flex-direction: column; }
.card-header { padding: 20px; }
.card-header { padding: 24px; }
.btn-primary-blue {
background-color: #2d8cf0;
@@ -253,7 +253,7 @@ const toggleStatus = (index: number) => {
}
.btn-txt { color: #fff; font-size: 14px; }
.table-container { padding: 0 20px 20px; }
.table-container { padding: 0 24px 24px; }
.table-header-row { display: flex; flex-direction: row; background-color: #f8f8f9; border-bottom: 1px solid #e8eaec; }
.th { padding: 12px 10px; font-size: 14px; color: #515a6e; font-weight: bold; }
.table-row { display: flex; flex-direction: row; border-bottom: 1px solid #e8eaec; border-left: 1px solid transparent; }
@@ -299,7 +299,7 @@ const toggleStatus = (index: number) => {
/* 分页 */
.pagination-footer {
padding: 20px;
padding: 24px;
display: flex;
flex-direction: row;
align-items: center;

View File

@@ -187,8 +187,8 @@ const handleQuery = () => { console.log('Querying redemption records...') }
.query-txt { color: #fff; font-size: 14px; }
/* 表格区域 */
.table-card { padding-top: 20px; }
.table-container { padding: 0 20px 20px; }
.table-card { padding-top: 24px; }
.table-container { padding: 0 24px 24px; }
.table-header-row { display: flex; flex-direction: row; background-color: #f8f8f9; border-bottom: 1px solid #e8eaec; }
.th { padding: 12px 10px; font-size: 14px; color: #515a6e; font-weight: bold; }
.table-row { display: flex; flex-direction: row; border-bottom: 1px solid #e8eaec; }
@@ -206,7 +206,7 @@ const handleQuery = () => { console.log('Querying redemption records...') }
/* 分页 */
.pagination-footer {
padding: 20px;
padding: 24px;
display: flex;
flex-direction: row;
align-items: center;

View File

@@ -96,34 +96,30 @@
</view>
</template>
<script uts>
export default {
data() {
return {
activeTab: 0,
form: {
integral_name: '积分',
integral_unit: 10,
integral_ratio: 0.1,
integral_max: 50,
freeze_time: 7,
valid_type: 0,
valid_year: 1
}
}
},
methods: {
validTypeChange(e: any) {
this.form.valid_type = parseInt(e.detail.value as string)
},
handleSubmit() {
uni.showLoading({ title: '保存中...' })
setTimeout(() => {
uni.hideLoading()
uni.showToast({ title: '保存成功', icon: 'success' })
}, 1000)
}
}
<script setup lang="uts">
import { ref, reactive } from 'vue'
const activeTab = ref(0)
const form = reactive({
integral_name: '积分',
integral_unit: 10,
integral_ratio: 0.1,
integral_max: 50,
freeze_time: 7,
valid_type: 0,
valid_year: 1
})
const validTypeChange = (e: any) => {
form.valid_type = parseInt(e.detail.value as string)
}
const handleSubmit = () => {
uni.showLoading({ title: '保存中...' })
setTimeout(() => {
uni.hideLoading()
uni.showToast({ title: '保存成功', icon: 'success' })
}, 1000)
}
</script>

View File

@@ -66,46 +66,46 @@
</view>
</template>
<script uts>
export default {
data() {
return {
form: {
integralLotteryId: 87,
payLotteryId: 82,
replyLotteryId: 86
},
lotteryOptions: [
{ id: 0, name: '请选择' },
{ id: 87, name: '积分抽奖' },
{ id: 86, name: '评价抽奖' },
{ id: 82, name: '订单抽奖' },
{ id: 75, name: '积分' }
] as any[]
}
},
methods: {
getLotteryName(id: number): string {
const found = this.lotteryOptions.find((item: any): boolean => item.id == id)
return found != null ? (found['name'] as string) : '请选择'
},
onIntegralLotteryChange(e: any) {
this.form.integralLotteryId = this.lotteryOptions[e.detail.value].id
},
onPayLotteryChange(e: any) {
this.form.payLotteryId = this.lotteryOptions[e.detail.value].id
},
onReplyLotteryChange(e: any) {
this.form.replyLotteryId = this.lotteryOptions[e.detail.value].id
},
handleSave() {
uni.showLoading({ title: '正在保存...' })
setTimeout(() => {
uni.hideLoading()
uni.showToast({ title: '保存成功', icon: 'success' })
}, 800)
}
}
<script setup lang="uts">
import { reactive } from 'vue'
const form = reactive({
integralLotteryId: 87,
payLotteryId: 82,
replyLotteryId: 86
})
const lotteryOptions = reactive([
{ id: 0, name: '请选择' },
{ id: 87, name: '积分抽奖' },
{ id: 86, name: '评价抽奖' },
{ id: 82, name: '订单抽奖' },
{ id: 75, name: '积分' }
] as any[])
const getLotteryName = (id: number): string => {
const found = lotteryOptions.find((item: any): boolean => item.id == id)
return found != null ? (found['name'] as string) : '请选择'
}
const onIntegralLotteryChange = (e: any) => {
form.integralLotteryId = lotteryOptions[e.detail.value].id
}
const onPayLotteryChange = (e: any) => {
form.payLotteryId = lotteryOptions[e.detail.value].id
}
const onReplyLotteryChange = (e: any) => {
form.replyLotteryId = lotteryOptions[e.detail.value].id
}
const handleSave = () => {
uni.showLoading({ title: '正在保存...' })
setTimeout(() => {
uni.hideLoading()
uni.showToast({ title: '保存成功', icon: 'success' })
}, 800)
}
</script>

View File

@@ -125,13 +125,19 @@ const formData = reactive({
const showCouponModal = ref(false)
const isEditing = ref(false)
const editingIndex = ref(-1)
const editingCoupon = reactive<Coupon>({ id: 0, name: '', desc: '' })
const couponOptions = reactive<Coupon[]>([
// 使用 reactive 并显式指定初始对象,后续通过类型断言或接口约束保证类型安全
const editingCoupon = reactive({
id: 0,
name: '',
desc: ''
}) as Coupon
const couponOptions = reactive([
{ id: 1, name: '满100减10元券', desc: '全场通用' },
{ id: 2, name: '新人5元无门槛', desc: '仅限新人使用' },
{ id: 3, name: '满200减50元券', desc: '限特定商品' }
])
] as Coupon[])
function isSelected(item: Coupon): boolean {
return formData.coupons.some(c => c.id === item.id)