Browse Source

feat(web): 活动管理添加会员价字段(创建编辑表单+列表展示)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
E2E Test Bot 1 month ago
parent
commit
89673f07
2 changed files with 16 additions and 0 deletions
  1. 3 0
      cfc-web/src/views/admin/Activities.vue
  2. 13 0
      cfc-web/src/views/admin/ActivityEdit.vue

+ 3 - 0
cfc-web/src/views/admin/Activities.vue

@@ -76,6 +76,9 @@
         <el-table-column label="费用(元)" width="90">
           <template slot-scope="{ row }">{{ row.price ? (row.price / 100).toFixed(2) : '免费' }}</template>
         </el-table-column>
+        <el-table-column label="会员价(元)" width="90">
+          <template slot-scope="{ row }">{{ row.memberPrice && row.memberPrice > 0 ? (row.memberPrice / 100).toFixed(2) : '-' }}</template>
+        </el-table-column>
         <el-table-column label="人数" width="90">
           <template slot-scope="{ row }">
             <el-button type="text" size="mini" @click="showRegistrations(row)" style="padding:0;">

+ 13 - 0
cfc-web/src/views/admin/ActivityEdit.vue

@@ -90,6 +90,14 @@
           </el-col>
         </el-row>
 
+        <el-row :gutter="16">
+          <el-col :span="12">
+            <el-form-item label="会员价(元)">
+              <el-input-number v-model="form.memberPriceYuan" :min="0" :precision="2" :step="0.01" placeholder="留空等于普通价" style="width:100%" :disabled="readonly" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
         <el-row :gutter="16">
           <el-col :span="12">
             <el-form-item label="开始时间" prop="startTime">
@@ -185,6 +193,7 @@ export default {
         location: '',
         maxParticipants: null,
         priceYuan: null,
+        memberPriceYuan: null,
         startTime: null,
         endTime: null,
         visibility: 'public',
@@ -303,6 +312,7 @@ export default {
             location: d.location || '',
             maxParticipants: d.maxParticipants || null,
             priceYuan: d.price ? d.price / 100 : null,
+            memberPriceYuan: d.memberPrice && d.memberPrice > 0 ? d.memberPrice / 100 : null,
             startTime: d.startTime || null,
             endTime: d.endTime || null,
             visibility: d.visibility || 'public',
@@ -371,6 +381,7 @@ export default {
           location: this.form.location,
           maxParticipants: this.form.maxParticipants,
           price: this.form.priceYuan != null ? Math.round(this.form.priceYuan * 100) : 0,
+          memberPrice: this.form.memberPriceYuan != null && this.form.memberPriceYuan > 0 ? Math.round(this.form.memberPriceYuan * 100) : 0,
           startTime: this.form.startTime,
           endTime: this.form.endTime,
           visibility: this.form.visibility,
@@ -420,6 +431,7 @@ export default {
         location: '',
         maxParticipants: null,
         priceYuan: null,
+        memberPriceYuan: null,
         startTime: null,
         endTime: null,
         visibility: 'public',
@@ -474,6 +486,7 @@ export default {
           location: this.form.location,
           maxParticipants: this.form.maxParticipants,
           price: this.form.priceYuan != null ? Math.round(this.form.priceYuan * 100) : 0,
+          memberPrice: this.form.memberPriceYuan != null && this.form.memberPriceYuan > 0 ? Math.round(this.form.memberPriceYuan * 100) : 0,
           startTime: this.form.startTime,
           endTime: this.form.endTime,
           visibility: this.form.visibility,