consumerm模块完成度90%,完善消费者和商家端数据库表,商品、聊天、订单数据对接好了supabase,和商家端对接了聊天功能,安卓端编译通过了css样式,剩余几个页面在处理函数规范问题

This commit is contained in:
cyh666666
2026-02-24 17:17:49 +08:00
parent e2f1dfb097
commit e606c597ca
174 changed files with 37917 additions and 4444 deletions

View File

@@ -241,7 +241,7 @@ const resetTransactions = () => {
// 加载钱包数据
const loadWalletData = async () => {
const userId = getCurrentUserId()
if (userId == null) {
if (userId == '') {
// uni.navigateTo({
// url: '/pages/user/login'
// })
@@ -282,7 +282,7 @@ const loadTransactions = async (loadMore: boolean = false) => {
try {
const userId = getCurrentUserId()
if (!userId) {
if (userId == '') {
isLoading.value = false
return
}
@@ -305,19 +305,19 @@ const loadTransactions = async (loadMore: boolean = false) => {
let createdAt = ''
if (item instanceof UTSJSONObject) {
id = item.getString('id') || ''
amount = item.getNumber('amount') || 0
balance = item.getNumber('balance_after') || 0
type = item.getString('type') || 'consume'
remark = item.getString('description') || ''
createdAt = item.getString('created_at') || ''
id = item.getString('id') ?? ''
amount = item.getNumber('amount') ?? 0
balance = item.getNumber('balance_after') ?? 0
type = item.getString('type') ?? 'consume'
remark = item.getString('description') ?? ''
createdAt = item.getString('created_at') ?? ''
} else {
id = (item['id'] as string) || ''
amount = (item['amount'] as number) || 0
balance = (item['balance_after'] as number) || 0
type = (item['type'] as string) || 'consume'
remark = (item['description'] as string) || ''
createdAt = (item['created_at'] as string) || ''
id = (item['id'] as string) ?? ''
amount = (item['amount'] as number) ?? 0
balance = (item['balance_after'] as number) ?? 0
type = (item['type'] as string) ?? 'consume'
remark = (item['description'] as string) ?? ''
createdAt = (item['created_at'] as string) ?? ''
}
mappedData.push({
@@ -355,7 +355,7 @@ const loadTransactions = async (loadMore: boolean = false) => {
// 获取当前用户ID
const getCurrentUserId = (): string => {
const userStore = uni.getStorageSync('userInfo')
return userStore?.id || ''
return userStore?.getString('id') ?? ''
}
// 获取交易图标
@@ -369,7 +369,8 @@ const getTransactionIcon = (type: string): string => {
income: '💰',
expense: '📤'
}
return icons[type] || '💰'
const icon = icons[type]
return icon != null ? icon : '💰'
}
// 获取交易标题
@@ -383,7 +384,8 @@ const getTransactionTitle = (type: string): string => {
income: '收入',
expense: '支出'
}
return titles[type] || '交易'
const title = titles[type]
return title != null ? title : '交易'
}
// 格式化时间
@@ -531,7 +533,7 @@ const goBack = () => {
.wallet-page {
display: flex;
flex-direction: column;
height: 100vh;
flex: 1; /* Fixed 100vh */
background-color: #f5f5f5;
}
@@ -595,13 +597,14 @@ const goBack = () => {
.dashboard-container {
flex-direction: row; /* 横向排列 */
align-items: flex-start;
gap: 20px;
max-width: 100%;
/* gap: 20px; REMOVED */
/* max-width: 100%; REMOVED */
}
.dashboard-main {
width: 400px; /* 左侧固定宽度 */
flex-shrink: 0;
margin-right: 20px; /* REPLACED gap */
}
.dashboard-side {
@@ -632,7 +635,7 @@ const goBack = () => {
}
.balance-label {
display: block;
/* display: block; REMOVED */
font-size: 14px;
opacity: 0.9;
margin-bottom: 10px;
@@ -640,7 +643,7 @@ const goBack = () => {
}
.balance-value {
display: block;
/* display: block; REMOVED */
font-size: 36px;
font-weight: bold;
margin-bottom: 20px;
@@ -650,7 +653,7 @@ const goBack = () => {
.balance-actions {
display: flex;
flex-direction: row;
gap: 20px;
/* gap: 20px; REMOVED */
}
.action-btn {
@@ -665,6 +668,7 @@ const goBack = () => {
.action-btn.recharge {
background-color: #ffffff;
color: #667eea;
margin-right: 20px; /* REPLACED gap */
}
.action-btn.withdraw {
@@ -688,14 +692,14 @@ const goBack = () => {
}
.stat-label {
display: block;
/* display: block; REMOVED */
font-size: 12px;
color: #666666;
margin-bottom: 8px;
}
.stat-value {
display: block;
/* display: block; REMOVED */
font-size: 16px;
font-weight: bold;
color: #333333;
@@ -752,9 +756,7 @@ const goBack = () => {
}
.filter-tabs {
display: flex;
flex-direction: row;
gap: 15px;
/* gap: 15px; REMOVED */
}
.filter-tab {
@@ -762,22 +764,17 @@ const goBack = () => {
color: #666666;
padding: 5px 0;
position: relative;
margin-right: 15px; /* REPLACED gap */
border-bottom: 2px solid transparent; /* Prepare for active state */
}
.filter-tab.active {
color: #007aff;
font-weight: bold;
border-bottom: 2px solid #007aff; /* REPLACED ::after */
}
.filter-tab.active::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 2px;
background-color: #007aff;
}
/* ::after removed */
.empty-transactions {
display: flex;
@@ -899,7 +896,10 @@ const goBack = () => {
}
.tip-title {
display: block;
/* display: block; REMOVED */
font-size: 16px;
font-weight: bold;
/* display: block; REMOVED */
font-size: 16px;
font-weight: bold;
color: #333333;
@@ -907,11 +907,11 @@ const goBack = () => {
}
.tip-item {
display: block;
/* display: block; REMOVED */
margin-bottom: 8px;
font-size: 12px;
color: #666666;
line-height: 1.6;
margin-bottom: 8px;
line-height: 1.6;
}
.tip-item:last-child {
@@ -974,7 +974,7 @@ const goBack = () => {
}
.amount-label {
display: block;
/* display: block; REMOVED */
font-size: 14px;
color: #333333;
margin-bottom: 10px;
@@ -1007,7 +1007,7 @@ const goBack = () => {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 10px;
/* gap: 10px; REMOVED */
margin-bottom: 15px;
}
@@ -1017,6 +1017,8 @@ const goBack = () => {
border-radius: 15px;
font-size: 14px;
color: #333333;
margin-right: 10px; /* REPLACED gap */
margin-bottom: 10px; /* REPLACED gap */
}
.quick-amount.active {
@@ -1026,7 +1028,7 @@ const goBack = () => {
}
.recharge-tip {
display: block;
/* display: block; REMOVED */
font-size: 12px;
color: #999999;
}
@@ -1034,7 +1036,7 @@ const goBack = () => {
.popup-footer {
display: flex;
flex-direction: row;
gap: 15px;
/* gap: 15px; REMOVED */
}
.cancel-btn,
@@ -1050,6 +1052,7 @@ const goBack = () => {
.cancel-btn {
background-color: #f5f5f5;
color: #666666;
margin-right: 15px; /* REPLACED gap */
}
.confirm-btn {