初始化上传医疗项目到 medical-mall

This commit is contained in:
2026-04-10 09:03:21 +08:00
parent ca8794ea3a
commit ce124e7119
421 changed files with 15139 additions and 2363 deletions

View File

@@ -1,4 +1,4 @@
<!-- 商家端 - 商品管理详情页 -->
<!-- 机构端 - 服务/商品详情页 -->
<template>
<view class="product-manage-detail">
<!-- #ifdef MP-WEIXIN -->
@@ -9,10 +9,10 @@
</view>
</view>
<!-- #endif -->
<!-- 商品基本信息 -->
<!-- 服务基本信息 -->
<view class="product-section">
<view class="section-header">
<text class="section-title">商品信息</text>
<text class="section-title">服务项目信息</text>
<text class="edit-btn" @click="editProduct">编辑</text>
</view>
@@ -27,33 +27,33 @@
<view class="product-info">
<view class="info-item">
<text class="info-label">商品名称</text>
<text class="info-label">服务项目名称</text>
<text class="info-value">{{ product.name }}</text>
</view>
<view class="info-item">
<text class="info-label">商品描述</text>
<text class="info-label">服务简介</text>
<text class="info-value">{{ product.description || '暂无描述' }}</text>
</view>
<view class="info-item">
<text class="info-label">商品价格</text>
<text class="info-label">参考价格</text>
<text class="info-value price">¥{{ product.price }}</text>
</view>
<view class="info-item">
<text class="info-label">价</text>
<text class="info-label">门市价</text>
<text class="info-value">¥{{ product.original_price || '未设置' }}</text>
</view>
<view class="info-item">
<text class="info-label">库存数量</text>
<text class="info-value">{{ product.stock }}</text>
<text class="info-label">可预约名额</text>
<text class="info-value">{{ product.stock }}人次</text>
</view>
<view class="info-item">
<text class="info-label">销量</text>
<text class="info-value">{{ product.sales }}</text>
<text class="info-label">服务次数</text>
<text class="info-value">{{ product.sales }}</text>
</view>
<view class="info-item">
<text class="info-label">商品状态</text>
<text class="info-label">服务状态</text>
<text class="info-value" :class="{ 'status-on': product.status === 1, 'status-off': product.status === 2 || product.status === 0 }">
{{ product.status === 1 ? '上架' : (product.status === 2 || product.status === 0 ? '下架' : '其他') }}
{{ product.status === 1 ? '服务中' : (product.status === 2 || product.status === 0 ? '已暂停' : '待上线') }}
</text>
</view>
</view>
@@ -62,7 +62,7 @@
<!-- SKU规格管理 -->
<view class="sku-section">
<view class="section-header">
<text class="section-title">规格管理</text>
<text class="section-title">服务规格/套餐</text>
<text class="add-btn" @click="addSku">添加规格</text>
</view>
@@ -89,25 +89,25 @@
</view>
</view>
<!-- 销售数据 -->
<!-- 服务数据 -->
<view class="sales-section">
<view class="section-header">
<text class="section-title">销售数据</text>
<text class="section-title">服务数据</text>
<text class="view-detail" @click="viewSalesDetail">查看详情</text>
</view>
<view class="sales-stats">
<view class="stat-item">
<text class="stat-value">{{ salesData.today_sales }}</text>
<text class="stat-label">今日销量</text>
<text class="stat-label">今日服务次数</text>
</view>
<view class="stat-item">
<text class="stat-value">{{ salesData.week_sales }}</text>
<text class="stat-label">本周销量</text>
<text class="stat-label">本周服务次数</text>
</view>
<view class="stat-item">
<text class="stat-value">{{ salesData.month_sales }}</text>
<text class="stat-label">本月销量</text>
<text class="stat-label">本月服务次数</text>
</view>
<view class="stat-item">
<text class="stat-value">¥{{ salesData.total_revenue }}</text>
@@ -119,7 +119,7 @@
<!-- 评价管理 -->
<view class="review-section">
<view class="section-header">
<text class="section-title">商品评价</text>
<text class="section-title">服务评价</text>
<text class="view-all" @click="viewAllReviews">查看全部</text>
</view>
@@ -150,10 +150,10 @@
<!-- 操作按钮 -->
<view class="action-buttons">
<button class="action-btn primary" @click="toggleProductStatus">
{{ product.status === 1 ? '下架商品' : '上架商品' }}
{{ product.status === 1 ? '暂停服务' : '开启服务' }}
</button>
<button class="action-btn secondary" @click="editProduct">编辑商品</button>
<button class="action-btn danger" @click="deleteProduct">删除商品</button>
<button class="action-btn secondary" @click="editProduct">编辑服务</button>
<button class="action-btn danger" @click="deleteProduct">删除</button>
</view>
</view>
</template>
@@ -278,16 +278,16 @@ export default {
this.recentReviews = [
{
id: 'review_001',
user_name: '用户***123',
user_name: '家属***123',
rating: 5,
content: '商品质量很好,物流也很快,满意!',
content: '服务人员非常专业,我父亲很满意!',
created_at: '2024-01-14 15:30:00'
},
{
id: 'review_002',
user_name: '用户***456',
user_name: '家属***456',
rating: 4,
content: '整体不错,就是包装有点简单。',
content: '整体服务不错,希望以后能计划性更强一些。',
created_at: '2024-01-13 09:20:00'
}
]
@@ -366,11 +366,11 @@ export default {
toggleProductStatus() {
const newStatus = this.product.status === 1 ? 0 : 1
const actionText = newStatus === 1 ? '上架' : '下架'
const actionText = newStatus === 1 ? '开启服务' : '暂停服务'
uni.showModal({
title: `确认${actionText}`,
content: `确定要${actionText}这个商品吗?`,
content: `确定要${actionText}该服务项目吗?`,
success: (res) => {
if (res.confirm) {
this.product.status = newStatus
@@ -386,7 +386,7 @@ export default {
deleteProduct() {
uni.showModal({
title: '确认删除',
content: '删除后将无法恢复,确定要删除这个商品吗?',
content: '删除后将无法恢复,确定要删除该服务项目吗?',
success: (res) => {
if (res.confirm) {
uni.showToast({
@@ -419,6 +419,7 @@ export default {
.section-header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 30rpx;
@@ -427,14 +428,16 @@ export default {
}
.section-title {
font-size: 32rpx;
font-size: 30rpx;
font-weight: bold;
color: #333;
padding-left: 16rpx;
border-left: 6rpx solid rgb(66, 121, 240);
}
.edit-btn, .add-btn, .view-detail, .view-all {
font-size: 26rpx;
color: #007aff;
color: rgb(66, 121, 240);
}
.product-images {
@@ -443,6 +446,7 @@ export default {
.image-list {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 20rpx;
}
@@ -462,6 +466,7 @@ export default {
.add-image {
background-color: #f5f5f5;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
font-size: 48rpx;
@@ -475,6 +480,7 @@ export default {
.info-item {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 20rpx 0;
@@ -484,7 +490,7 @@ export default {
.info-label {
font-size: 28rpx;
color: #666;
width: 150rpx;
width: 180rpx;
}
.info-value {
@@ -495,7 +501,7 @@ export default {
}
.info-value.price {
color: #ff4444;
color: rgb(225, 37, 27);
font-weight: bold;
}
@@ -504,7 +510,7 @@ export default {
}
.status-off {
color: #ff4444 !important;
color: #999 !important;
}
.empty-sku {
@@ -540,13 +546,14 @@ export default {
.sku-details {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 15rpx;
}
.sku-price {
font-size: 26rpx;
color: #ff4444;
color: rgb(225, 37, 27);
font-weight: bold;
margin-right: 30rpx;
}
@@ -563,6 +570,7 @@ export default {
.sku-actions {
display: flex;
flex-direction: row;
gap: 30rpx;
}
@@ -573,37 +581,38 @@ export default {
}
.action-btn.edit {
background-color: #e3f2fd;
color: #007aff;
background-color: #e8f0fe;
color: rgb(66, 121, 240);
}
.action-btn.delete {
background-color: #ffebee;
color: #ff4444;
color: #f44336;
}
.sales-stats {
display: flex;
gap: 30rpx;
flex-direction: row;
gap: 20rpx;
}
.stat-item {
flex: 1;
text-align: center;
padding: 30rpx 0;
background-color: #f8f9fa;
border-radius: 10rpx;
background: linear-gradient(135deg, #eef2fe, #ece9fa);
border-radius: 12rpx;
}
.stat-value {
font-size: 36rpx;
font-weight: bold;
color: #333;
color: rgb(66, 121, 240);
margin-bottom: 10rpx;
}
.stat-label {
font-size: 24rpx;
font-size: 22rpx;
color: #666;
}
@@ -613,6 +622,7 @@ export default {
.rating-info {
display: flex;
flex-direction: row;
align-items: center;
gap: 20rpx;
}
@@ -625,6 +635,7 @@ export default {
.rating-stars {
display: flex;
flex-direction: row;
}
.star {
@@ -652,6 +663,7 @@ export default {
.review-header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-bottom: 15rpx;
@@ -664,6 +676,7 @@ export default {
.review-rating {
display: flex;
flex-direction: row;
}
.review-content {
@@ -685,8 +698,9 @@ export default {
right: 0;
background-color: #fff;
padding: 30rpx;
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.08);
display: flex;
flex-direction: row;
gap: 20rpx;
}
@@ -699,17 +713,17 @@ export default {
}
.action-buttons .action-btn.primary {
background-color: #4caf50;
background-color: rgb(66, 121, 240);
color: #fff;
}
.action-buttons .action-btn.secondary {
background-color: #ffa726;
color: #fff;
background-color: #E8F0FE;
color: rgb(66, 121, 240);
}
.action-buttons .action-btn.danger {
background-color: #ff4444;
color: #fff;
background-color: #ffebee;
color: #f44336;
}
</style>