consumer模块完成度95%,能编译在安卓端运行,在解决数据获取和页面布局问题

This commit is contained in:
cyh666666
2026-02-27 08:20:43 +08:00
parent e606c597ca
commit b9acce6c35
1554 changed files with 23471 additions and 8551 deletions

View File

@@ -55,19 +55,6 @@ const totalPoints = ref<number>(0)
const records = ref<PointRecord[]>([])
const loading = ref<boolean>(true)
onMounted(() => {
loadData()
})
const loadData = async () => {
loading.value = true
await Promise.all([
loadPoints(),
loadRecords()
])
loading.value = false
}
const loadPoints = async () => {
// 调用 service 获取积分 (需要supabaseService支持)
// 暂时如果service没更新先用mock
@@ -84,12 +71,30 @@ const loadPoints = async () => {
const loadRecords = async () => {
try {
const list = await supabaseService.getPointRecords()
records.value = list
const typedList: PointRecord[] = []
for (let i = 0; i < list.length; i++) {
const item = list[i] as PointRecord
typedList.push(item)
}
records.value = typedList
} catch (e) {
console.error('获取积分记录失败', e)
}
}
const loadData = async () => {
loading.value = true
await Promise.all<void>([
loadPoints(),
loadRecords()
])
loading.value = false
}
onMounted(() => {
loadData()
})
const handleExchange = () => {
uni.showToast({
title: '积分商城开发中',
@@ -98,14 +103,12 @@ const handleExchange = () => {
}
const getTypeText = (type: string): string => {
const map: Record<string, string> = {
'signin': '每日签到',
'shopping': '购物奖励',
'redeem': '积分兑换',
'admin': '系统调整',
'register': '注册赠送'
}
return map[type] ?? '积分变动'
if (type === 'signin') return '每日签到'
if (type === 'shopping') return '购物奖励'
if (type === 'redeem') return '积分兑换'
if (type === 'admin') return '系统调整'
if (type === 'register') return '注册赠送'
return '积分变动'
}
const formatTime = (timeStr: string): string => {