Przeglądaj źródła

app-直播发红包

三七 3 dni temu
rodzic
commit
079c2be4b8

+ 111 - 1
src/views/live/live/index.vue

@@ -104,7 +104,6 @@
           placeholder="选择结束时间"
           value-format="yyyy-MM-dd HH:mm:ss"
           size="small"
-          :disabled="!queryParams.startTimeS"
         ></el-date-picker>
       </el-form-item>
       <el-form-item label="上下架" prop="isShow">
@@ -293,6 +292,14 @@
             v-hasPermi="['live:live:edit', 'live:live:operation']"
             >修改</el-button
           >
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleSelect(scope.row)"
+            v-hasPermi="['live:live:edit', 'live:live:operation']"
+          >查看标签配置</el-button
+          >
           <el-button
             size="mini"
             type="text"
@@ -623,6 +630,69 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
+    <!-- 查看标签配置 -->
+    <el-dialog :title="selectTitle" :visible.sync="selectOpen" width="900px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="直播标签配置" prop="liveTagList">
+          <el-table
+            :data="form.liveTagList"
+            border
+            style="width: 100%; margin-bottom: 10px"
+          >
+            <el-table-column label="序号" type="index" width="60" />
+            <el-table-column label="公司" prop="tagName">
+              <template slot-scope="scope">
+                <el-select
+                  v-model="scope.row.companyId"
+                  placeholder="请选择公司"
+                  @change="selectCompanyChange(scope.row, scope.$index)"
+                >
+                  <el-option
+                    v-for="item in comapnyDropList"
+                    :key="item.companyId"
+                    :label="item.companyName"
+                    :value="item.companyId"
+                  />
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="所属企微主体" prop="corpId">
+              <template slot-scope="scope">
+                <el-select
+                  v-model="scope.row.corpId"
+                  placeholder="请选择企微主体"
+                >
+                  <el-option
+                    v-for="item in scope.row.corpDropList"
+                    :key="item.dictValue"
+                    :label="item.dictLabel"
+                    :value="item.dictValue"
+                  />
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column label="标记行为类型" prop="markType">
+              <template slot-scope="scope">
+                <el-select
+                  v-model="scope.row.markType"
+                  placeholder="请选择标记行为类型"
+                  clearable
+                  size="small"
+                >
+                  <el-option
+                    v-for="item in markTypeDropList"
+                    :key="item.dictValue"
+                    :label="item.dictLabel"
+                    :value="item.dictValue"
+                  />
+                </el-select>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
     <el-dialog title="提示" :visible.sync="rtmpUrlVisible" width="30%">
       <div>服务器地址:{{ serverName }}</div>
       <div>推流码:{{ livingCode }}</div>
@@ -747,8 +817,10 @@ export default {
       ],
       // 弹出层标题
       title: "",
+      selectTitle: "",
       // 是否显示弹出层
       open: false,
+      selectOpen: false,
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -1178,6 +1250,44 @@ export default {
         this.title = "修改直播间";
       });
     },
+
+    /**
+    * 查询标签设置
+    */
+    handleSelect(row){
+      this.reset();
+      const liveId = row.liveId || this.ids;
+      getLive(liveId).then((response) => {
+        this.form = response.data;
+        this.videoUrl = this.form.videoUrl;
+        if (this.form.duration) {
+          this.form.durationTime = this.secondsToTime(this.form.duration);
+        }
+        //初始化
+        if (
+          this.form.liveTagList == undefined ||
+          this.form.liveTagList == null
+        ) {
+          this.form.liveTagList = [];
+        }else{
+          for(let index =0 ;index<this.form.liveTagList.length;index ++){
+            this.form.liveTagList[index].markType = this.form.liveTagList[index].markType +"";
+            this.selectCompanyChange(this.form.liveTagList[index],index);
+          }
+        }
+        setTimeout(() => {
+          if (this.form.liveDesc == null) {
+            this.$refs.myeditor.setText("");
+          } else {
+            this.$refs.myeditor.setText(this.form.liveDesc);
+          }
+          this.form.videoUrl = row.videoUrl;
+        }, 1);
+        this.selectOpen = true;
+        this.selectTitle = "查看标签配置";
+      });
+    },
+
     /** 提交按钮 */
     submitForm() {
       if (this.form.liveId != null) {

+ 60 - 17
src/views/live/liveConfig/watchReward.vue

@@ -25,8 +25,9 @@
         <!-- 参与条件 -->
         <el-form-item label="参与条件" prop="participateCondition">
           <el-radio-group v-model="watchRewardForm.participateCondition">
-            <el-radio label="1">达到指定观看时长</el-radio>
-            <el-radio label="2">启用完课积分</el-radio>
+            <el-radio label="1">达到指定观看时长发积分</el-radio>
+            <el-radio label="2" v-if="this.projectFrom!=='颐安心'">启用完课积分</el-radio>
+            <el-radio label="3">启动直播完课奖励</el-radio>
           </el-radio-group>
         </el-form-item>
 
@@ -38,11 +39,11 @@
         </el-form-item>
 
         <!-- 完课率要求 -->
-        <el-form-item label="完课率要求" prop="completionRate" v-if="watchRewardForm.participateCondition === '2'">
-          <el-input-number 
-            v-model="watchRewardForm.completionRate" 
-            :min="1" 
-            :max="100" 
+        <el-form-item label="完课率要求" prop="completionRate" v-if="watchRewardForm.participateCondition === '2' || watchRewardForm.participateCondition === '3'">
+          <el-input-number
+            v-model="watchRewardForm.completionRate"
+            :min="1"
+            :max="100"
             :precision="0"
             placeholder="请输入完课率"
             style="width: 200px;"
@@ -50,14 +51,16 @@
           <span style="margin-left: 10px; color: #909399;">%(观看时长占直播总时长的比例)</span>
         </el-form-item>
 
+
+
         <!-- 连续完课积分配置 -->
         <el-form-item label="连续完课积分" prop="pointsConfig" v-if="watchRewardForm.participateCondition === '2'">
           <div style="display: flex; flex-direction: column; gap: 10px;">
             <div v-for="(point, index) in watchRewardForm.pointsConfig" :key="index" style="display: flex; align-items: center;">
               <span style="width: 80px;">第{{ index + 1 }}天:</span>
-              <el-input-number 
-                v-model="watchRewardForm.pointsConfig[index]" 
-                :min="0" 
+              <el-input-number
+                v-model="watchRewardForm.pointsConfig[index]"
+                :min="0"
                 :precision="0"
                 placeholder="请输入积分值"
                 style="width: 200px;"
@@ -84,6 +87,34 @@
 <!--          <el-input v-model="watchRewardForm.receivePrompt" placeholder="请输入领取提示语"></el-input>-->
 <!--        </el-form-item>-->
 
+
+        <div v-if="watchRewardForm.participateCondition === '3'">
+          <div class="section-title">直播红包设置</div>
+          <!-- 红包金额 -->
+          <el-form-item label="红包金额" prop="redPacketAmount" v-if="watchRewardForm.participateCondition === '3'">
+            <el-input-number v-model="watchRewardForm.redPacketAmount" :min="0.1" :max="10" :step="0.1"></el-input-number>
+          </el-form-item>
+          <!--   红包余额是否扣减开关      -->
+          <el-form-item label="红包余额是否扣减开关">
+            <el-radio-group v-model="watchRewardForm.isRedPackageBalanceDeduction">
+              <el-radio label="1">开</el-radio>
+              <el-radio label="2">关</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </div>
+
+        <div v-if="watchRewardForm.participateCondition === '3'">
+          <div class="section-title">录播积分设置</div>
+          <!-- 积分值 -->
+          <el-form-item label="积分值" prop="scoreAmount">
+            <el-input
+              v-model="watchRewardForm.scoreAmount"
+              placeholder="请输入积分值"                style="width: 300px;"
+            ></el-input>
+          </el-form-item>
+        </div>
+
+
         <!-- 红包设置(仅在达到指定观看时长时显示) -->
         <div v-if="watchRewardForm.participateCondition === '1'">
           <div class="section-title">红包设置</div>
@@ -202,6 +233,7 @@ import {addConfig, getConfig, updateConfig} from "@/api/live/liveQuestionLive";
 export default {
   data() {
     return {
+      projectFrom:process.env.VUE_APP_TITLE_INDEX,
       loading: true,
       liveId: null,
       watchRewardForm: {
@@ -221,6 +253,8 @@ export default {
         redPacketType: '1',
         // 红包金额
         redPacketAmount: '',
+        //是否开启红包扣减
+        isRedPackageBalanceDeduction: '2',
         // 红包发放数量
         redPacketCount: '',
         // 红包领取方式
@@ -248,7 +282,7 @@ export default {
           { required: true, message: '请选择参与条件', trigger: 'change'}
         ],
         watchDuration:[
-          { 
+          {
             validator: (rule, value, callback) => {
               if (this.watchRewardForm.participateCondition === '1') {
                 if (!value) {
@@ -259,12 +293,12 @@ export default {
               } else {
                 callback();
               }
-            }, 
+            },
             trigger: 'blur'
           }
         ],
         completionRate:[
-          { 
+          {
             validator: (rule, value, callback) => {
               if (this.watchRewardForm.participateCondition === '2') {
                 if (!value && value !== 0) {
@@ -277,12 +311,12 @@ export default {
               } else {
                 callback();
               }
-            }, 
+            },
             trigger: 'blur'
           }
         ],
         action:[
-          { 
+          {
             validator: (rule, value, callback) => {
               if (this.watchRewardForm.participateCondition === '1') {
                 if (!value) {
@@ -293,7 +327,7 @@ export default {
               } else {
                 callback();
               }
-            }, 
+            },
             trigger: 'change'
           }
         ],
@@ -306,6 +340,9 @@ export default {
         redPacketAmount:[
           { required: true, message: '请输入红包金额', trigger: 'blur'}
         ],
+        scoreAmount:[
+          { required: true, message: '请输入积分数量', trigger: 'blur'}
+        ],
         receiveMethod:[
           { required: true, message: '请选择红包领取方式', trigger: 'blur'}
         ],
@@ -360,7 +397,13 @@ export default {
     getLiveConfig(){
       getConfig(this.liveId).then(response => {
         if(response.code === 200 && response.data != null && response.data.length > 0){
-          this.watchRewardForm = JSON.parse(response.data)
+          const serverData = JSON.parse(response.data)
+          this.watchRewardForm = Object.assign({}, this.watchRewardForm, serverData)
+          if(this.watchRewardForm.isRedPackageBalanceDeduction == null){
+            this.watchRewardForm.isRedPackageBalanceDeduction = '1'
+          } else {
+            this.watchRewardForm.isRedPackageBalanceDeduction = String(this.watchRewardForm.isRedPackageBalanceDeduction)
+          }
         }
         this.loading = false
       })

+ 4 - 1
src/views/system/config/config.vue

@@ -3079,7 +3079,9 @@
           <el-form-item label="回调地址" prop="notifyUrl">
             <el-input v-model="form36.notifyUrl" placeholder="请输入回调地址"></el-input>
           </el-form-item>
-
+          <el-form-item label="直播红包回调地址" prop="LiveNotifyUrl">
+            <el-input v-model="form36.LiveNotifyUrl" placeholder="请输入直播红包回调地址"></el-input>
+          </el-form-item>
           <div class="footer">
             <el-button type="primary" @click="submitForm36">提 交</el-button>
           </div>
@@ -3982,6 +3984,7 @@ export default {
               isNew: '1',
               mchId: '',
               notifyUrl: '',
+              LiveNotifyUrl: '',
               mchKey: '',
               keyPath: '',
               apiV3Key: '',