初始化上传医疗项目到 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

@@ -9,16 +9,16 @@
</view>
<!-- #endif -->
<view class="header">
<text class="title">由于您的需求,为 {{ userName }} 配置专属商品折扣</text>
<text class="subtitle">专属打折商品的折扣不受全场默认 VIP 折扣影响。</text>
<text class="title">为 {{ userName }} 配置定向关怀补贴</text>
<text class="subtitle">定向关怀补贴项目,优先于全场默认优惠,帮助长者获得更多專属关怀。</text>
</view>
<view class="action-bar">
<button class="add-btn" @click="openProductSelect"> 添加更多覆盖商品</button>
<button class="add-btn" @click="openProductSelect"> 添加更多定向优惠项目</button>
</view>
<scroll-view scroll-y class="list-container">
<view v-if="discounts.length === 0" class="empty-tip">该户暂无专属折扣商品</view>
<view v-if="discounts.length === 0" class="empty-tip">该户暂无定向关怀补贴项目</view>
<view v-for="item in discounts" :key="item.id" class="discount-item">
<view class="product-info">
@@ -27,7 +27,7 @@
<text class="product-name">{{ item.product_name }}</text>
<view class="price-row">
<text class="original-price">原价 ¥{{ item.base_price }}</text>
<text class="current-discount">当前设置: {{ parseFloat(item.discount_rate) * 10 }} 折</text>
<text class="current-discount">当前设置: {{ parseFloat(item.discount_rate) * 10 }} 折优惠</text>
</view>
</view>
</view>
@@ -41,7 +41,7 @@
<!-- 修改折扣弹窗 -->
<view class="modal" v-if="showEditModal">
<view class="modal-content">
<view class="modal-header">设置该商品的折扣倍数</view>
<view class="modal-header">设置该项目的优惠比例</view>
<view class="modal-body">
<input type="digit" class="input" v-model="editForm.rate" placeholder="示例:填写 0.85 代表 85折" />
</view>
@@ -55,7 +55,7 @@
<!-- 选择商品弹窗 -->
<view class="modal" v-if="showProductSelect">
<view class="modal-content product-modal-content">
<view class="modal-header">选择要设置折扣的商品</view>
<view class="modal-header">选择要设置优惠的服务项目</view>
<scroll-view scroll-y class="product-scroll">
<view class="product-p-item" v-for="p in allProducts" :key="p.id" @click="selectProductForDiscount(p)">
<image :src="p.main_image_url || '/static/images/default-product.png'" class="p-img" mode="aspectFill" />
@@ -64,7 +64,7 @@
<text class="p-price">¥{{p.base_price}}</text>
</view>
</view>
<view v-if="allProducts.length === 0" class="empty-tip">暂无可选商品</view>
<view v-if="allProducts.length === 0" class="empty-tip">暂无可选服务项目</view>
</scroll-view>
<view class="modal-footer">
<button class="btn cancel" @click="showProductSelect = false">关闭</button>
@@ -127,7 +127,7 @@
async openProductSelect() {
this.showProductSelect = true
if (this.allProducts.length === 0) {
uni.showLoading({ title: '获取商品中' })
uni.showLoading({ title: '获取服务项目中' })
try {
let merchantId = ''
const session = supa.getSession()
@@ -233,7 +233,7 @@
user_id: item['user_id'] != null ? String(item['user_id']) : '',
product_id: pid,
discount_rate: item['discount_rate'] != null ? String(item['discount_rate']) : '1.0',
product_name: prod != null && prod['name'] != null ? String(prod['name']) : '未知商品',
product_name: prod != null && prod['name'] != null ? String(prod['name']) : '未知服务',
main_image_url: prod != null && prod['main_image_url'] != null ? String(prod['main_image_url']) : '',
base_price: prod != null && prod['base_price'] != null ? String(prod['base_price']) : '0'
} as DiscountDoc)
@@ -312,7 +312,7 @@
const that = this
uni.showModal({
title: '提醒',
content: '确定移除此商品的打折?移除后将恢复通常价格',
content: '确定移除此服务项目的优惠折扣?移除后将恢复原始价格',
success: async (res) => {
if (res.confirm) {
uni.showLoading({ title: '移除中' })
@@ -390,11 +390,13 @@
padding: 20rpx;
margin-bottom: 20rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.product-info {
display: flex;
flex-direction: row;
flex: 1;
}
.product-image {
@@ -414,6 +416,7 @@
.price-row {
margin-top: 10rpx;
display: flex;
flex-direction: row;
align-items: center;
gap: 16rpx;
}
@@ -482,6 +485,7 @@
}
.modal-footer {
display: flex;
flex-direction: row;
border-top: 1rpx solid #eee;
}
.modal-footer .btn {
@@ -514,6 +518,7 @@
}
.product-p-item {
display: flex;
flex-direction: row;
align-items: center;
padding: 20rpx;
border-bottom: 1rpx solid #eee;