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

@@ -674,7 +674,7 @@ const addToCart = async (product: any) => {
uni.showLoading({ title: '添加中...' })
try {
// 尝试调用 Supabase 服务添加
const success = await supabaseService.addToCart(product.id, 1)
const success = await supabaseService.addToCart(product.id, 1, '')
if (success) {
uni.showToast({
title: '已添加到购物车',
@@ -990,7 +990,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.card-name {
font-size: 15px;
font-weight: 600;
font-weight: 700;
color: #333;
margin-bottom: 4px;
text-align: center;
@@ -1046,7 +1046,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.news-image {
width: 100%;
height: 100%;
display: block;
/* display: block; REMOVED for uniapp-x support */
}
.news-overlay {
@@ -1071,8 +1071,8 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.news-caption {
font-size: 16px;
font-weight: 600;
display: block;
font-weight: 700;
/* display: block; REMOVED for uniapp-x support */
line-height: 1.4;
}
@@ -1086,9 +1086,11 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
}
.services-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 20px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
/* grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); REMOVED */
/* gap: 20px; REMOVED */
}
.service-card {
@@ -1098,7 +1100,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
padding: 20px;
background: #f8f9fa;
border-radius: 12px;
cursor: pointer;
/* cursor: pointer; REMOVED for uniapp-x support */
transition: all 0.3s ease;
}
@@ -1124,7 +1126,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.service-name {
font-size: 15px;
font-weight: 600;
font-weight: 700;
color: #333;
margin-bottom: 4px;
}
@@ -1154,13 +1156,14 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.title-section {
display: flex;
align-items: center;
gap: 8px;
/* gap: 8px; REMOVED */
width: 100%;
}
.section-icon {
font-size: 20px;
color: #4CAF50;
margin-right: 8px;
}
.sort-tabs {
@@ -1180,9 +1183,9 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
padding: 8px 12px; /* 增加左右内边距 */
border-radius: 20px;
border: 1px solid #e0e0e0;
cursor: pointer;
/* cursor: pointer; REMOVED */
transition: all 0.2s ease;
white-space: nowrap;
/* white-space: nowrap; REMOVED for uniapp-x support on view */
flex: 1; /* 均分宽度 */
min-width: 70px; /* 设置最小宽度防止过窄 */
text-align: center;
@@ -1207,13 +1210,18 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
/* 产品网格 */
.products-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
/* grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); REMOVED */
/* gap: 20px; REMOVED */
margin-top: 20px;
margin: 20px -1.5% 0 -1.5%;
}
.product-card {
width: 47%;
margin: 0 1.5% 20px 1.5%;
background: #f8f9fa;
border-radius: 12px;
overflow: hidden;
@@ -1237,7 +1245,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
font-size: 11px;
padding: 4px 12px;
border-radius: 12px;
font-weight: 600;
font-weight: 700;
z-index: 2;
}
@@ -1254,10 +1262,10 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.product-name {
font-size: 15px;
font-weight: 600;
font-weight: 700;
color: #333;
margin-bottom: 4px;
display: block;
/* display: block; REMOVED */
line-height: 1.4;
}
@@ -1265,7 +1273,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
font-size: 13px;
color: #666;
margin-bottom: 12px;
display: block;
/* display: block; REMOVED */
}
.price-section {
@@ -1361,9 +1369,11 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
}
.family-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 16px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
/* grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); REMOVED */
/* gap: 16px; REMOVED */
margin-top: 20px;
}
@@ -1400,7 +1410,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.family-name {
font-size: 14px;
font-weight: 600;
font-weight: 700;
color: #333;
margin-bottom: 4px;
}
@@ -1436,9 +1446,9 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
padding: 8px 12px; /* 增加左右内边距 */
border-radius: 20px;
border: 1px solid #e0e0e0;
cursor: pointer;
/* cursor: pointer; REMOVED */
transition: all 0.2s ease;
white-space: nowrap;
/* white-space: nowrap; REMOVED */
flex: 1; /* 均分宽度 */
min-width: 80px; /* 设置最小宽度防止过窄 */
text-align: center;
@@ -1462,13 +1472,18 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
}
.recommend-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
/* grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); REMOVED */
/* gap: 20px; REMOVED */
margin-top: 20px;
margin: 20px -1.5% 0 -1.5%;
}
.recommend-product {
width: 97%; /* Single col by default or adjust */
margin: 0 1.5% 20px 1.5%;
background: #f8f9fa;
border-radius: 12px;
overflow: hidden;
@@ -1506,7 +1521,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
padding: 4px 10px;
border-radius: 10px;
font-size: 11px;
font-weight: 600;
font-weight: 700;
color: white;
}
@@ -1524,7 +1539,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.product-title {
font-size: 16px;
font-weight: 600;
font-weight: 700;
color: #333;
margin-bottom: 4px;
display: block;
@@ -1558,7 +1573,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
}
.rating-value {
font-weight: 600;
font-weight: 700;
color: #333;
}
@@ -1622,7 +1637,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.reminder-title {
font-size: 15px;
font-weight: 600;
font-weight: 700;
}
.reminder-desc {
@@ -1661,15 +1676,17 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
height: 32px;
border: 3px solid #f0f0f0;
border-top-color: #4CAF50;
border-radius: 50%;
animation: spin 1s linear infinite;
border-radius: 16px;
/* animation: spin 1s linear infinite; REMOVED for uniapp-x support */
margin-bottom: 12px;
}
/*
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
}
*/
.loading-text {
font-size: 14px;
@@ -1705,7 +1722,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.search-box {
padding: 8px 16px; /* 与分类页保持一致 */
max-width: 100%;
/* max-width: 100%; REMOVED for uniapp-x support */
margin: 0;
}
@@ -1783,9 +1800,16 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.products-grid,
.recommend-grid {
grid-template-columns: repeat(2, 1fr); /* 手机端调整为双列显示 */
gap: 8px; /* 减小间距 */
/* grid-template-columns: repeat(2, 1fr); REMOVED */
/* gap: 8px; REMOVED */
margin: 20px -1% 0 -1%;
}
.products-grid .product-card,
.recommend-grid .recommend-product {
width: 48%;
margin: 0 1% 8px 1%;
}
.product-info,
.product-details {
@@ -1858,7 +1882,7 @@ const navigateToReminders = () => uni.navigateTo({ url: '/pages/user/reminders'
.hot-products .price-value,
.smart-recommend .price-value {
font-size: 14px; /* 字体变小 */
font-weight: 600;
font-weight: 700;
}
.family-grid {