Sfoglia il codice sorgente

feat(memberprice): 恢复商品会员价 - 管理端设置 + 小程序详情页展示

- ProductEdit.vue: 售价行新增会员价输入框,留空等于普通价
- product-detail.vue: 详情页按会员身份展示 - 非会员显示普通价+加入会员享会员价链接,会员显示会员价+原价划线;去掉底部栏价格
- 修复远端合并引入的编译错误: HealthReportController缺import、HealthReportService的reportMapper笔误、HealthReportDraft实体补remark字段
E2E Test Bot 1 mese fa
parent
commit
b5a93ae549

+ 1 - 0
cfc-backend/src/main/java/com/etotem/cfc/controller/HealthReportController.java

@@ -47,6 +47,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import java.io.File;
 import java.io.File;
 import java.io.IOException;
 import java.io.IOException;
 import java.nio.file.Files;
 import java.nio.file.Files;

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/entity/HealthReportDraft.java

@@ -56,7 +56,7 @@ public class HealthReportDraft implements Serializable {
     /** 确认后对应的真实报告ID */
     /** 确认后对应的真实报告ID */
     private Long confirmedReportId;
     private Long confirmedReportId;
 
 
-    /** 代上传备注(由管理员或服务端填写) */
+/** 代上传备注(由管理员或服务端填写) */
     private String remark;
     private String remark;
 
 
     private Date createdAt;
     private Date createdAt;

+ 3 - 6
cfc-frontend/pages/discover-detail/product-detail/product-detail.vue

@@ -16,13 +16,13 @@
         <view class="price-row">
         <view class="price-row">
           <view class="price-main">
           <view class="price-main">
             <text class="price">{{ formatPriceWithSymbol(displayPrice) }}</text>
             <text class="price">{{ formatPriceWithSymbol(displayPrice) }}</text>
-            <text v-if="hasMemberPrice" class="member-tag">会员价</text>
+            <text v-if="hasMemberPrice && isMember" class="member-tag">会员价</text>
           </view>
           </view>
-          <view v-if="hasMemberPrice" class="price-original">
+          <view v-if="hasMemberPrice && isMember" class="price-original">
             <text class="original-label">原价</text>
             <text class="original-label">原价</text>
             <text class="original-text">{{ formatPriceWithSymbol(originalPriceVal) }}</text>
             <text class="original-text">{{ formatPriceWithSymbol(originalPriceVal) }}</text>
           </view>
           </view>
-          <view v-if="!isMember" class="member-hint" @click="goUpgrade">开通会员享会员价 ›</view>
+          <view v-if="hasMemberPrice && !isMember" class="member-hint" @click="goUpgrade">加入会员享会员价 {{ formatPriceWithSymbol(memberPriceVal) }} ›</view>
         </view>
         </view>
         <view v-if="product.giftLevelName" class="gift-tag">购买即送 {{ product.giftLevelName }} 会员</view>
         <view v-if="product.giftLevelName" class="gift-tag">购买即送 {{ product.giftLevelName }} 会员</view>
         <view class="meta-row">
         <view class="meta-row">
@@ -103,9 +103,6 @@
 
 
     <!-- 底部操作栏:必须与 scroll-view 平级,否则 iOS 上 position: fixed 在 scroll-view 内不生效(按钮不显示) -->
     <!-- 底部操作栏:必须与 scroll-view 平级,否则 iOS 上 position: fixed 在 scroll-view 内不生效(按钮不显示) -->
     <view class="bottom-bar" v-if="!loading && product.id">
     <view class="bottom-bar" v-if="!loading && product.id">
-      <view class="price-info">
-        <text class="bottom-price">{{ formatPriceWithSymbol(displayPrice) }}</text>
-      </view>
       <view class="action-btns">
       <view class="action-btns">
         <view class="action-extra">
         <view class="action-extra">
           <button class="btn-share" @click="onShareProduct">🖼</button>
           <button class="btn-share" @click="onShareProduct">🖼</button>

+ 8 - 0
cfc-web/src/views/admin/ProductEdit.vue

@@ -122,6 +122,11 @@
               <el-input-number v-model="form.price" :min="0" :precision="2" placeholder="0.00" style="width: 100%;" controls />
               <el-input-number v-model="form.price" :min="0" :precision="2" placeholder="0.00" style="width: 100%;" controls />
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="会员价(元)">
+              <el-input-number v-model="form.memberPrice" :min="0" :precision="2" :step="0.01" placeholder="留空等于普通价" style="width: 100%;" controls />
+            </el-form-item>
+          </el-col>
           <el-col :span="6">
           <el-col :span="6">
             <el-form-item label="库存" prop="stock">
             <el-form-item label="库存" prop="stock">
               <el-input-number v-model="form.stock" :min="0" :precision="0" placeholder="0" style="width: 100%;" controls />
               <el-input-number v-model="form.stock" :min="0" :precision="0" placeholder="0" style="width: 100%;" controls />
@@ -307,6 +312,7 @@ export default {
         images: '',
         images: '',
         productType: 'physical',
         productType: 'physical',
         price: null,
         price: null,
+        memberPrice: null,
         stock: null,
         stock: null,
         minQuantity: 1,
         minQuantity: 1,
         vendorName: '',
         vendorName: '',
@@ -453,6 +459,7 @@ export default {
             images: p.images || '',
             images: p.images || '',
             productType: p.productType || 'physical',
             productType: p.productType || 'physical',
             price: (p.price != null) ? p.price / 100 : null,
             price: (p.price != null) ? p.price / 100 : null,
+            memberPrice: (p.memberPrice != null && p.memberPrice > 0) ? p.memberPrice / 100 : null,
             stock: (p.stock != null) ? p.stock : null,
             stock: (p.stock != null) ? p.stock : null,
             minQuantity: p.minQuantity || null,
             minQuantity: p.minQuantity || null,
             vendorName: p.vendorName || '',
             vendorName: p.vendorName || '',
@@ -712,6 +719,7 @@ async loadGiftRule(productId) {
           const productData = {
           const productData = {
             ...this.form,
             ...this.form,
             price: (this.form.price != null) ? Math.round(this.form.price * 100) : 0,
             price: (this.form.price != null) ? Math.round(this.form.price * 100) : 0,
+            memberPrice: (this.form.memberPrice != null && this.form.memberPrice > 0) ? Math.round(this.form.memberPrice * 100) : 0,
             images: JSON.stringify(this.imageList)
             images: JSON.stringify(this.imageList)
           }
           }
           // Extract dimensionWeights before sending to product API
           // Extract dimensionWeights before sending to product API