Forráskód Böngészése

直播控制台代码合并

chenguo 2 napja
szülő
commit
69cdad55ab

+ 2 - 0
package.json

@@ -58,12 +58,14 @@
     "chart.js": "^2.9.4",
     "clipboard": "2.0.6",
     "core-js": "3.8.1",
+    "crypto-js": "^4.2.0",
     "cos-js-sdk-v5": "^1.8.3",
     "dayjs": "^1.11.13",
     "echarts": "^4.9.0",
     "element-ui": "2.15.5",
     "esdk-obs-browserjs": "^3.24.3",
     "file-saver": "2.0.4",
+    "flv.js": "^1.6.2",
     "fuse.js": "6.4.3",
     "highlight.js": "9.18.5",
     "image-conversion": "^2.1.1",

+ 10 - 1
src/api/live/gift.js

@@ -50,4 +50,13 @@ export function exportGift(query) {
     method: 'get',
     params: query
   })
-}
+}
+
+
+// 查询直播间礼物配置详细
+export function getDictData(dictType) {
+  return request({
+    url: '/system/dict/data/type/' + dictType,
+    method: 'get'
+  })
+}

+ 23 - 1
src/api/live/live.js

@@ -50,4 +50,26 @@ export function exportLive(query) {
     method: 'get',
     params: query
   })
-}
+}
+
+export function selectLiveToStudent(query) {
+  return request({
+    url: '/live/live/selectLiveToStudent',
+    method: 'post',
+    data: query
+  })
+}
+
+export function selectCompanyTalent(query) {
+  return request({
+    url: '/company/user/selectCompanyTalent/' + query,
+    method: 'get'
+  })
+}
+
+export function getLivingUrl(liveId) {
+  return request({
+    url: '/live/live/living/' + liveId,
+    method: 'get'
+  })
+}

+ 10 - 1
src/api/live/liveGoods.js

@@ -50,4 +50,13 @@ export function exportLiveGoods(query) {
     method: 'get',
     params: query
   })
-}
+}
+
+// 导出直播商品
+export function listStoreProduct(data) {
+  return request({
+    url: '/store/storeProduct/list',
+    method: 'get',
+    params: data
+  })
+}

+ 89 - 0
src/api/live/liveQuestionLive.js

@@ -0,0 +1,89 @@
+import request from '@/utils/request'
+
+// 查询直播间题库列表
+export function listLiveQuestionLive(query) {
+    return request({
+        url: '/live/liveQuestionLive/list',
+        method: 'get',
+        params: query
+    })
+}
+
+// 查询直播间可选题库列表
+export function listLiveQuestionOptionList(query) {
+    return request({
+        url: '/live/liveQuestionLive/optionList',
+        method: 'get',
+        params: query
+    })
+}
+
+// 新增直播间题库
+export function addLiveQuestionLive(data) {
+    return request({
+        url: '/live/liveQuestionLive',
+        method: 'post',
+        params: data
+    })
+}
+
+// 删除直播间题库
+export function deleteLiveQuestionLive(data) {
+    return request({
+        url: '/live/liveQuestionLive/' + data.liveId,
+        method: 'delete',
+        params: {ids: data.ids}
+    })
+}
+
+// 查询直播观看奖励设置列表
+export function listConfig(query) {
+  return request({
+    url: '/live/config/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询直播观看奖励设置详细
+export function getConfig(id) {
+  return request({
+    url: '/live/config/' + id,
+    method: 'get'
+  })
+}
+
+// 新增直播观看奖励设置
+export function addConfig(data) {
+  return request({
+    url: '/live/config',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改直播观看奖励设置
+export function updateConfig(data) {
+  return request({
+    url: '/live/config',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除直播观看奖励设置
+export function delConfig(id) {
+  return request({
+    url: '/live/config/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出直播观看奖励设置
+export function exportConfig(query) {
+  return request({
+    url: '/live/config/export',
+    method: 'get',
+    params: query
+  })
+}

+ 1 - 1
src/api/live/words.js

@@ -50,4 +50,4 @@ export function exportWords(query) {
     method: 'get',
     params: query
   })
-}
+}

+ 111 - 0
src/utils/liveWS.js

@@ -0,0 +1,111 @@
+import CryptoJS from 'crypto-js'
+
+export class LiveWS {
+  /**
+   * @param {string} url - WebSocket 服务器地址
+   * @param {number} liveId - 直播间ID
+   * @param {number} userId - 用户ID
+   * @param {number} checkInterval - 检查连接状态的时间间隔,单位毫秒
+   * @param {number} reconnectDelay - 连接断开后重连的延迟,单位毫秒
+   */
+  constructor(url, liveId, userId, checkInterval = 5000, reconnectDelay = 3000) {
+    let timestamp = new Date().getTime()
+    let userType = 1
+    let signature = CryptoJS.HmacSHA256(
+      CryptoJS.enc.Utf8.parse(liveId + userId + userType + timestamp), 
+      CryptoJS.enc.Utf8.parse(timestamp)).toString(CryptoJS.enc.Hex)
+    this.url = url + `?liveId=${liveId}&userId=${userId}&userType=${userType}&timestamp=${timestamp}&signature=${signature}`;
+    this.liveId = liveId;
+    this.userId = userId;
+    this.checkInterval = checkInterval;
+    this.reconnectDelay = reconnectDelay;
+    this.ws = null;
+    this.reconnectTimer = null;
+    this.heartbeatTimer = null;
+    this.isManualClose = false;
+    this.connect();
+    this.startHeartbeat();
+  }
+
+  connect() {
+    // 如果已经有一个连接处于 OPEN 或 CONNECTING 状态,则不再创建新连接
+    if (this.ws && (this.ws.readyState === WebSocket.OPEN || this.ws.readyState === WebSocket.CONNECTING)) {
+      return;
+    }
+
+    this.ws = new WebSocket(this.url);
+
+    // 绑定事件
+    this.ws.onopen = (event) => {
+      // 连接成功后,清除重连计时器
+      if (this.reconnectTimer) {
+        clearTimeout(this.reconnectTimer);
+        this.reconnectTimer = null;
+      }
+    };
+
+    this.ws.onmessage = (event) => {
+      this.onmessage(event);
+    };
+
+    this.ws.onerror = (error) => {
+    };
+
+    this.ws.onclose = (event) => {
+      // 如果不是主动关闭,则重连
+      if (!this.isManualClose) {
+        setTimeout(() => this.reconnect(), this.reconnectDelay);
+      }
+    };
+  }
+
+  onmessage(event) {}
+
+  reconnect() {
+    this.connect();
+  }
+
+  // 调度重连
+  scheduleReconnect() {
+    // 避免多次重连定时器同时存在
+    if (this.reconnectTimer) return;
+    this.reconnectTimer = setTimeout(() => {
+      this.connect();
+    }, this.reconnectDelay);
+  }
+
+  // 定时检查连接状态
+  startHeartbeat() {
+    this.heartbeatTimer = setInterval(() => {
+      if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
+        this.scheduleReconnect();
+      } else {
+        // 发送信息
+        this.ws.send(JSON.stringify({'cmd':'heartbeat','msg':'ping', 'liveId': this.liveId, 'userId': this.userId}));
+      }
+    }, this.checkInterval);
+  }
+
+  // 主动关闭 WebSocket 连接,并清除定时任务
+  close() {
+    this.isManualClose = true;
+    if (this.heartbeatTimer) {
+      clearInterval(this.heartbeatTimer);
+    }
+    if (this.reconnectTimer) {
+      clearTimeout(this.reconnectTimer);
+    }
+    if (this.ws) {
+      this.ws.close();
+    }
+  }
+
+  // 发送消息方法
+  send(message) {
+    if (this.ws && this.ws.readyState === WebSocket.OPEN) {
+      this.ws.send(message);
+    } else {
+      console.error("WebSocket is not open. Message not sent.");
+    }
+  }
+}

+ 29 - 27
src/views/live/gift/index.vue

@@ -10,27 +10,14 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="礼物图标链接地址" prop="iconUrl">
-        <el-input
-          v-model="queryParams.iconUrl"
-          placeholder="请输入礼物图标链接地址"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="礼物价格" prop="price">
-        <el-input
-          v-model="queryParams.price"
-          placeholder="请输入礼物价格"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="礼物当前状态" prop="status">
+      <el-form-item label="礼物当前状态" prop="status" label-width="120px">
         <el-select v-model="queryParams.status" placeholder="请选择礼物当前状态" clearable size="small">
-          <el-option label="请选择字典生成" value="" />
+          <el-option
+            v-for="dict in statusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          ></el-option>
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -93,7 +80,7 @@
       <el-table-column label="礼物描述" align="center" prop="description" />
       <el-table-column label="礼物图标链接地址" align="center" prop="iconUrl" />
       <el-table-column label="礼物价格" align="center" prop="price" />
-      <el-table-column label="礼物当前状态" align="center" prop="status" />
+      <el-table-column label="礼物当前状态" align="center" prop="status" :formatter="formatStatus" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -124,14 +111,14 @@
 
     <!-- 添加或修改直播间礼物配置对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
         <el-form-item label="礼物名称" prop="giftName">
           <el-input v-model="form.giftName" placeholder="请输入礼物名称" />
         </el-form-item>
         <el-form-item label="礼物描述" prop="description">
           <el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-        <el-form-item label="礼物图标链接地址" prop="iconUrl">
+        <el-form-item label="图标链接地址" prop="iconUrl">
           <el-input v-model="form.iconUrl" placeholder="请输入礼物图标链接地址" />
         </el-form-item>
         <el-form-item label="礼物价格" prop="price">
@@ -139,7 +126,13 @@
         </el-form-item>
         <el-form-item label="礼物当前状态">
           <el-radio-group v-model="form.status">
-            <el-radio label="1">请选择字典生成</el-radio>
+            <el-radio
+              v-for="dict in statusOptions"
+              :key="dict.dictValue"
+              :label="dict.dictValue"
+            >
+              {{ dict.dictLabel }}
+            </el-radio>
           </el-radio-group>
         </el-form-item>
       </el-form>
@@ -152,7 +145,7 @@
 </template>
 
 <script>
-import { listGift, getGift, delGift, addGift, updateGift, exportGift } from "@/api/live/gift";
+import { listGift, getGift, delGift, addGift, updateGift, exportGift,getDictData } from "@/api/live/gift";
 
 export default {
   name: "Gift",
@@ -184,10 +177,9 @@ export default {
         pageSize: 10,
         giftName: null,
         description: null,
-        iconUrl: null,
-        price: null,
         status: null
       },
+      statusOptions:[],
       // 表单参数
       form: {},
       // 表单校验
@@ -203,8 +195,18 @@ export default {
   },
   created() {
     this.getList();
+    this.getDict();
   },
   methods: {
+    formatStatus(row, column, cellValue) {
+      const found = this.statusOptions.find(d => d.dictValue === cellValue);
+      return found ? found.dictLabel : '未知';
+    },
+    getDict() {
+      getDictData("sys_normal_disable").then(response => {
+        this.statusOptions = response.data;
+      });
+    },
     /** 查询直播间礼物配置列表 */
     getList() {
       this.loading = true;

+ 66 - 33
src/views/live/live/index.vue

@@ -87,7 +87,7 @@
           <el-tag v-if="scope.row.isShow == 2">下架</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -103,12 +103,19 @@
             @click="handleDelete(scope.row)"
             v-hasPermi="['live:live:remove']"
           >删除</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-monitor"
+            @click="handleConfig(scope.row)"
+            v-hasPermi="['live:config:list']"
+          >配置</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-monitor"
             @click="handleManage(scope.row)"
-            v-hasPermi="['live:live:remove']"
+            v-hasPermi="['live:console:list']"
           >管理</el-button>
         </template>
       </el-table-column>
@@ -140,9 +147,19 @@
             <el-radio :label="2">录播</el-radio>
           </el-radio-group>
         </el-form-item>
+        <el-form-item label="直播达人" prop="talentId">
+          <el-select v-model="form.talentId" placeholder="请选择达人">
+            <el-option
+              v-for="item in talentList"
+              :key="item.talentId"
+              :label="item.nickName"
+              :value="item.talentId">
+            </el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item label="直播描述" prop="liveDesc">
           <Editor ref="myeditor" :height="300" @on-text-change="updateText"/>
-<!--          <Editor v-model="form.liveDesc" :height="300" placeholder="直播描述" />-->
+          <!--          <Editor v-model="form.liveDesc" :height="300" placeholder="直播描述" />-->
         </el-form-item>
         <el-form-item label="录播视屏" prop="videoUrl">
           <file-upload v-model="form.videoUrl" :limit="1" :file-size="3" :file-type="['mp4']" />
@@ -151,20 +168,20 @@
         </el-form-item>
         <el-form-item label="开始时间" prop="startTime">
           <el-date-picker size="small"
-            v-model="form.startTime"
-            @change="timeChange"
-            type="datetime"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            placeholder="选择开始时间">
+                          v-model="form.startTime"
+                          @change="timeChange"
+                          type="datetime"
+                          value-format="yyyy-MM-dd HH:mm:ss"
+                          placeholder="选择开始时间">
           </el-date-picker>
         </el-form-item>
         <el-form-item label="结束时间" prop="finishTime" v-loading="timeLoading">
           <el-date-picker size="small"
-            v-model="form.finishTime"
-            type="datetime"
-            disabled
-            value-format="yyyy-MM-dd HH:mm:ss"
-            placeholder="视屏播放结束">
+                          v-model="form.finishTime"
+                          type="datetime"
+                          disabled
+                          value-format="yyyy-MM-dd HH:mm:ss"
+                          placeholder="视屏播放结束">
           </el-date-picker>
         </el-form-item>
         <el-form-item label="直播封面" prop="liveImgUrl">
@@ -186,8 +203,9 @@
 </template>
 
 <script>
-import { listLive, getLive, delLive, addLive, updateLive, exportLive } from "@/api/live/live";
+import { listLive, getLive, delLive, addLive, updateLive, exportLive,selectCompanyTalent } from "@/api/live/live";
 import Editor from '@/components/Editor/wang';
+import user from '@/store/modules/user';
 
 export default {
   name: "Live",
@@ -212,6 +230,8 @@ export default {
       total: 0,
       // 直播表格数据
       liveList: [],
+      // 达人列表
+      talentList: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -260,6 +280,9 @@ export default {
         isShow: [
           { required: true, message: "不能为空", trigger: "change" }
         ],
+        talentId: [
+          { required: true, message: "不能为空", trigger: "change" }
+        ]
       }
     };
   },
@@ -364,6 +387,9 @@ export default {
     handleAdd() {
       this.reset();
       this.open = true;
+      selectCompanyTalent(user.state.user.companyId).then(res=>{
+        this.talentList = res.rows;
+      });
       setTimeout(() => {
         this.$refs.myeditor.setText("");
       }, 100);
@@ -375,6 +401,9 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
+      selectCompanyTalent(user.state.user.companyId).then(res=>{
+        this.talentList = res.rows;
+      });
       const liveId = row.liveId || this.ids
       getLive(liveId).then(response => {
         this.form = response.data;
@@ -416,15 +445,19 @@ export default {
     handleDelete(row) {
       const liveIds = row.liveId || this.ids;
       this.$confirm('是否确认删除直播编号为"' + liveIds + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delLive(liveIds);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(() => {});
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return delLive(liveIds);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    handleConfig(row) {
+      console.info(row)
+      this.$router.push('/live/liveConfig/' + row.liveId)
     },
     handleManage(row) {
       this.$router.push('/live/liveConsole/' + row.liveId)
@@ -433,16 +466,16 @@ export default {
     handleExport() {
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有直播数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportLive(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportLive(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
     }
   }
 };

+ 1016 - 0
src/views/live/liveConfig/index.vue

@@ -0,0 +1,1016 @@
+<template>
+  <div class="live-config-container">
+    <!-- 根tabs -->
+    <el-tabs v-model="rootActiveName" @tab-click="handleClick" class="white-bg-tabs">
+      <el-tab-pane v-for="item in rootTabs" :key="item.name" :label="item.label" :name="item.name">
+        <!-- 营销内容 start -->
+        <el-tabs v-if="item.name == 'market'" v-model="marketActiveName" type="card" @tab-click="handleTabClick">
+          <el-tab-pane v-for="marketItem in marketTabs" :key="marketItem.name" :label="marketItem.label" :name="marketItem.name" class="market-tab-pane">
+            <!-- 观看奖励 start -->
+            <template>
+              <div v-if="marketItem.name == 'watchReward'">
+                <!-- 提示信息 -->
+                <div class="tip-message">
+                  设置观看奖励,用户达到直播观看时长后可领取奖励
+                </div>
+
+                <!-- 开启观看奖励开关 -->
+                <div class="reward-switch">
+                  <span class="switch-label">开启观看奖励</span>
+                  <el-switch v-model="watchRewardForm.enabled"></el-switch>
+                </div>
+
+                <!-- 观看奖励设置 -->
+                <div v-if="watchRewardForm.enabled" class="section-block">
+                  <div class="section-title">观看奖励设置</div>
+
+                  <!-- 表单内容 -->
+                  <el-form
+                    :model="watchRewardForm"
+                    :rules="rules"
+                    ref="watchRewardForm"
+                    label-width="130px"
+                  >
+                    <!-- 参与条件 -->
+                    <el-form-item label="参与条件" prop="participateCondition">
+                      <el-radio v-model="watchRewardForm.participateCondition" label="1">
+                        达到指定观看时长
+                      </el-radio>
+                    </el-form-item>
+
+                    <!-- 观看时长 -->
+                    <el-form-item label="观看时长" prop="watchDuration">
+                      <el-input v-model="watchRewardForm.watchDuration" placeholder="请输入观看时长" class="duration-input">
+                        <template #append>分钟</template>
+                      </el-input>
+                    </el-form-item>
+
+                    <!-- 实施动作 -->
+                    <el-form-item label="实施动作" prop="action">
+                      <el-select v-model="watchRewardForm.action" placeholder="请选择实施动作" style="width: 300px;">
+                        <el-option
+                          v-for="item in actionOptions"
+                          :key="item.value"
+                          :label="item.label"
+                          :value="item.value"
+                        ></el-option>
+                      </el-select>
+                    </el-form-item>
+
+                    <!-- 领取提示语 -->
+                    <el-form-item label="领取提示语" prop="receivePrompt">
+                      <el-input v-model="watchRewardForm.receivePrompt" placeholder="请输入领取提示语"></el-input>
+                    </el-form-item>
+
+                    <!-- 红包设置 -->
+                    <div>
+                      <div class="section-title">红包设置</div>
+
+                      <!-- 根据实施动作类型显示不同的表单内容 -->
+                      <template v-if="watchRewardForm.action === '1'">
+                        <!-- 现金红包设置 -->
+                        <!-- 红包发放方式   1固定金额 2随机金额 -->
+                        <el-form-item label="红包发放方式" prop="redPacketType">
+                          <el-radio-group v-model="watchRewardForm.redPacketType">
+                            <el-radio label="1">固定金额</el-radio>
+                            <el-radio label="2">随机金额</el-radio>
+                          </el-radio-group>
+                        </el-form-item>
+
+                        <!-- 红包金额 -->
+                        <el-form-item label="红包金额" prop="redPacketAmount">
+                          <el-input v-model="watchRewardForm.redPacketAmount" placeholder="请输入红包金额"></el-input>
+                        </el-form-item>
+
+                        <!-- 红包发放数量 -->
+                        <el-form-item label="红包发放数量" prop="redPacketCount">
+                          <el-input v-model="watchRewardForm.redPacketCount" placeholder="红包数量+28888人数"></el-input>
+                        </el-form-item>
+
+                        <!-- 红包领取方式  1二维码核销 2微信提现 -->
+                        <el-form-item label="红包领取方式" prop="receiveMethod">
+                          <el-radio-group v-model="watchRewardForm.receiveMethod">
+                            <el-radio label="1">二维码领取</el-radio>
+                            <el-radio label="2">微信发放</el-radio>
+                          </el-radio-group>
+                        </el-form-item>
+                      </template>
+
+                      <template v-else>
+                        <!-- 积分红包设置 -->
+                        <!-- 积分值 -->
+                        <el-form-item label="积分值" prop="scoreAmount">
+                          <el-input
+                            v-model="watchRewardForm.scoreAmount"
+                            placeholder="请输入积分值"                style="width: 300px;"
+                          ></el-input>
+                        </el-form-item>
+
+                        <!-- 最大领取人数 -->
+                        <el-form-item label="最大领取人数" prop="maxReceivers">
+                          <el-input
+                            v-model="watchRewardForm.maxReceivers"
+                            placeholder="请输入最大领取人数"                style="width: 300px;"
+                          ></el-input>
+                        </el-form-item>
+                      </template>
+                    </div>
+
+                    <!-- 其他设置 -->
+                    <div >
+                      <div class="section-title">其他设置</div>
+
+                      <template v-if="watchRewardForm.action === '1'">
+                        <!-- 客服引导  1跟进企业微信 2不设置 -->
+                        <el-form-item label="客服引导" prop="showGuide">
+                          <el-radio-group v-model="watchRewardForm.showGuide">
+                            <el-radio label="1">跟进企业微信</el-radio>
+                            <el-radio label="2">不设置</el-radio>
+                          </el-radio-group>
+                        </el-form-item>
+
+                        <!-- 客服引导语 -->
+                        <el-form-item label="客服引导语" prop="guideText">
+                          <el-input
+                            v-model="watchRewardForm.guideText"
+                            placeholder="请输入客服引导语"                style="width: 300px;"
+                          ></el-input>
+                        </el-form-item>
+                      </template>
+
+                      <template v-else>
+                        <!-- 积分使用引导语 -->
+                        <el-form-item label="积分使用引导语" prop="scoreGuideText">
+                          <el-input
+                            v-model="watchRewardForm.scoreGuideText"
+                            placeholder="请输入积分使用引导语"                style="width: 300px;"
+                          ></el-input>
+                        </el-form-item>
+
+                        <!-- 积分使用引导链接 -->
+                        <el-form-item label="积分使用引导链接" prop="scoreGuideLink">
+                          <el-input
+                            v-model="watchRewardForm.scoreGuideLink"
+                            placeholder="请输入积分使用引导链接"                style="width: 300px;"
+                          ></el-input>
+                        </el-form-item>
+
+                        <!-- 引导语 -->
+                        <el-form-item label="引导语" prop="guideText">
+                          <el-input
+                            v-model="watchRewardForm.guideText"
+                            placeholder="请输入引导语"                style="width: 300px;"
+                          ></el-input>
+                        </el-form-item>
+                      </template>
+                    </div>
+
+                    <!-- 保存按钮 -->
+                    <div class="form-actions">
+                      <el-button type="primary" @click="saveWatchReward">保存</el-button>
+                    </div>
+                  </el-form>
+                </div>
+              </div>
+            </template>
+
+            <!-- 答题 start -->
+            <div v-if="marketItem.name == 'answer'">
+              <div class="tip-box">
+                选择用于本节直播课程的题库试题,试题可用于直播间内发送
+                <el-link
+                  type="primary"
+                  style="margin-left: 5px;"
+                  @click="handleToQuestionBank"
+                >配置题库试题 >></el-link>
+              </div>
+
+              <el-button type="primary" icon="el-icon-plus" style="margin: 20px 0;" @click="handleAddQuestion">添加试题</el-button>
+              <!-- 试题列表表格 -->
+              <el-table
+                :data="questionLiveList"
+                style="width: 100%"
+                v-loading="loading"
+              >
+                <!-- 题干列:显示试题的主要内容 -->
+                <el-table-column
+                  prop="title"
+                  label="题干"
+                  show-overflow-tooltip
+                ></el-table-column>
+
+                <!-- 题型列:显示是单选还是多选 -->
+                <el-table-column
+                  prop="type"
+                  label="题型"
+                >
+                  <template slot-scope="scope">
+                    {{ scope.row.type === 1 ? '单选题' : '多选题' }}
+                  </template>
+                </el-table-column>
+
+                <!-- 创建时间列:显示试题创建的时间 -->
+                <el-table-column
+                  prop="createTime"
+                  label="创建时间"
+                ></el-table-column>
+
+                <!-- 操作列:包含编辑和删除按钮 -->
+                <el-table-column
+                  label="操作"
+                  width="180"
+                  fixed="right"
+                >
+                  <template slot-scope="scope">
+                    <!-- 删除按钮:用于移除试题 -->
+                    <el-button
+                      type="text"
+                      size="small"
+                      style="color: #F56C6C;"
+                      @click="handleDelete(scope.row)"
+                    >删除</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+
+              <!-- 分页组件:用于分页展示试题列表 -->
+              <pagination
+                v-show="questionTotal > 0"
+                :total="questionTotal"
+                :page.sync="questionParams.pageNum"
+                :limit.sync="questionParams.pageSize"
+                @pagination="getLiveQuestionLiveList"
+                style="margin-top: 20px;"
+              />
+
+              <!-- 添加试题弹窗 -->
+              <el-dialog
+                title="添加试题"
+                :visible.sync="questionDialogVisible"
+                width="800px"
+                :close-on-click-modal="false"
+                :close-on-press-escape="false"
+              >
+                <div class="dialog-content">
+                  <div style="text-align: right; margin-bottom: 20px;">
+                    <el-input
+                      v-model="searchTitle"
+                      placeholder="请输入搜索内容"
+                      style="width: 300px;"
+                      @input="handleQuestionSearch"
+                    ></el-input>
+                  </div>
+
+                  <el-table
+                    ref="questionTable"
+                    :data="questionList"
+                    style="width: 100%"
+                    v-loading="questionLoading"
+                    @selection-change="handleSelectionChange"
+                    @row-click="handleRowClick"
+                    row-key="id"
+                  >
+                    <!-- 复选框列:用于多选试题 -->
+                    <el-table-column
+                      type="selection"
+                      width="55"
+                    >
+                    </el-table-column>
+                    <!-- 题干列:显示试题的主要内容 -->
+                    <el-table-column
+                      prop="title"
+                      label="题干"
+                      class-name="clickable-column"
+                    ></el-table-column>
+                    <!-- 题型列:显示单选或多选 -->
+                    <el-table-column
+                      prop="type"
+                      label="题型"
+                      class-name="clickable-column"
+                    >
+                      <template slot-scope="scope">
+                        {{ scope.row.type === 1 ? '单选题' : '多选题' }}
+                      </template>
+                    </el-table-column>
+                    <!-- 创建人列 -->
+                    <el-table-column
+                      prop="createBy"
+                      label="创建人"
+                      class-name="clickable-column"
+                    ></el-table-column>
+                    <!-- 创建时间列 -->
+                    <el-table-column
+                      prop="createTime"
+                      label="创建时间"
+                      width="150"
+                      class-name="clickable-column"
+                    ></el-table-column>
+                  </el-table>
+
+                  <pagination
+                    v-show="total > 0"
+                    :total="total"
+                    :page.sync="queryParams.pageNum"
+                    :limit.sync="queryParams.pageSize"
+                    @pagination="getQuestionList"
+                    style="margin-top: 20px;"
+                  />
+                </div>
+                <div slot="footer" class="dialog-footer">
+                  <div style="display: flex; justify-content: space-between; align-items: center;">
+                    <span class="selected-count">当前已选择 <span style="color: #00BFFF; font-style: italic;">{{ selectedQuestions.length }}</span> 题</span>
+                    <div>
+                      <el-button @click="questionDialogVisible = false">取 消</el-button>
+                      <el-button type="primary" @click="confirmAddQuestion">确 定</el-button>
+                    </div>
+                  </div>
+                </div>
+              </el-dialog>
+            </div>
+            <!-- 答题 end -->
+
+            <!-- 直播商品start -->
+            <div v-if="marketItem.name == 'goods'">
+
+              <el-button type="primary" icon="el-icon-plus" style="margin: 20px 0;" @click="handleAddLiveGoods">添加商品</el-button>
+              <el-table
+                :data="goodsLiveList"
+                style="width: 100%"
+                v-loading="loading"
+              >
+                <!-- 题干列:显示试题的主要内容 -->
+                <el-table-column
+                  prop="goodsId"
+                  label="商品id"
+                  show-overflow-tooltip
+                ></el-table-column>
+
+                <el-table-column
+                  label="商品图片"
+                >
+                  <template slot-scope="scope">
+                    <img
+                      :src="scope.row.imgUrl"
+                      style="display: block; max-width: 100%; width: 100px; height: 100px"
+                    />
+                  </template>
+
+                </el-table-column>
+
+                <el-table-column
+                  prop="productName"
+                  label="商品名称"
+                ></el-table-column>
+
+                <el-table-column
+                  prop="price"
+                  label="价格"
+                ></el-table-column>
+
+                <el-table-column
+                  prop="stock"
+                  label="库存"
+                ></el-table-column>
+
+                <el-table-column
+                  prop="sales"
+                  label="销量"
+                ></el-table-column>
+
+                <!-- 操作列:包含编辑和删除按钮 -->
+                <el-table-column
+                  label="操作"
+                  width="180"
+                  fixed="right"
+                >
+                  <template slot-scope="scope">
+                    <el-button
+                      type="text"
+                      size="small"
+                      style="color: #F56C6C;"
+                      @click="handleGoodDelete(scope.row)"
+                    >删除</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+
+              <!-- 分页组件:用于分页展示试题列表 -->
+              <pagination
+                v-show="goodsTotal > 0"
+                :total="goodsTotal"
+                :page.sync="goodsParams.pageNum"
+                :limit.sync="goodsParams.pageSize"
+                @pagination="getLiveGoodsList"
+                style="margin-top: 20px;"
+              />
+
+              <!-- 添加商品弹窗 -->
+              <el-dialog
+                title="添加商品"
+                :visible.sync="goodsDialogVisible"
+                width="800px"
+                :close-on-click-modal="false"
+                :close-on-press-escape="false"
+              >
+                <div class="dialog-content">
+                  <div style="text-align: right; margin-bottom: 20px;">
+                    <el-input
+                      v-model="searchTitle"
+                      placeholder="请输入搜索内容"
+                      style="width: 300px;"
+                      @input="handleGoodsSearch"
+                    ></el-input>
+                  </div>
+
+                  <el-table
+                    ref="goodsTable"
+                    :data="goodsList"
+                    style="width: 100%"
+                    v-loading="goodsLoading"
+                    @selection-change="handleGoodsChange"
+                    @row-click="handleGoodsRowClick"
+                    row-key="id"
+                  >
+                    <el-table-column
+                      type="selection"
+                      width="55"
+                    >
+                    </el-table-column>
+                    <el-table-column
+                      prop="storeName"
+                      label="商铺名称"
+                      class-name="clickable-column"
+                    ></el-table-column>
+                    <el-table-column
+                      prop="productName"
+                      label="产品"
+                      class-name="clickable-column"
+                    ></el-table-column>
+                    <el-table-column
+                      prop="price"
+                      label="价格"
+                      class-name="clickable-column"
+                    ></el-table-column>
+                    <el-table-column
+                      prop="stock"
+                      label="库存"
+                      class-name="clickable-column"
+                    ></el-table-column>
+                  </el-table>
+
+                  <pagination
+                    v-show="total > 0"
+                    :total="total"
+                    :page.sync="queryParams.pageNum"
+                    :limit.sync="queryParams.pageSize"
+                    @pagination="getStoreProductLists"
+                    style="margin-top: 20px;"
+                  />
+                </div>
+                <div slot="footer" class="dialog-footer">
+                  <div style="display: flex; justify-content: space-between; align-items: center;">
+                    <span class="selected-count">当前已选择 <span style="color: #00BFFF; font-style: italic;">{{ selectedGoods.length }}</span> 商品</span>
+                    <div>
+                      <el-button @click="goodsDialogVisible = false">取 消</el-button>
+                      <el-button type="primary" @click="confirmAddGoods">确 定</el-button>
+                    </div>
+                  </div>
+                </div>
+              </el-dialog>
+            </div>
+            <!-- 直播商品end -->
+
+          </el-tab-pane>
+        </el-tabs>
+        <!-- 营销内容 end -->
+      </el-tab-pane>
+    </el-tabs>
+    <!-- 根tabs end -->
+  </div>
+</template>
+
+<script>
+import {
+  listLiveQuestionLive,
+  listLiveQuestionOptionList,
+  addLiveQuestionLive,
+  deleteLiveQuestionLive,
+  getConfig,
+  addConfig,
+  updateConfig
+} from '@/api/live/liveQuestionLive'
+import {listLiveGoods, delLiveGoods, listStoreProduct,addLiveGoods} from '@/api/live/liveGoods'
+export default {
+  name: 'LiveConfig',
+  data() {
+    return {
+      liveId: null,
+      loading: true,
+      rootActiveName: 'market',
+      rootTabs: [
+        {
+          label: '营销内容',
+          name: 'market'
+        }
+      ],
+      marketActiveName: 'watchReward',
+      marketTabs: [
+        {
+          label: '观看奖励',
+          name: 'watchReward'
+        },
+        {
+          label: '答题红包',
+          name: 'answerRedPacket'
+        },
+        {
+          label: '答题',
+          name: 'answer'
+        },
+        {
+          label: '直播商品',
+          name: 'goods'
+        },
+        {
+          label: '观看积分 ',
+          name: 'watchScore'
+        }
+      ],
+      questionDialogVisible: false,
+      goodsDialogVisible: false,
+      questionLoading: false,
+      goodsLoading: false,
+      searchTitle: '',
+      questionList: [],
+      selectedQuestions: [],
+      selectedGoods: [],
+      total: 0,
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        title: null,
+        liveId: null
+      },
+      questionTotal: 0,
+      questionParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null
+      },
+      goodsList: [],
+      goodsTotal: 0,
+      questionLiveList: [],
+      goodsLiveList: [],
+      goodsLiveTotal: 0,
+      goodsParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null
+      },
+      queryGoodParams: {
+        pageNum: 1,
+        pageSize: 10,
+        title: null,
+        liveId: null
+      },
+      rules:{
+        participateCondition:[
+          { required: true, message: '请选择参与条件', trigger: 'blur'}
+        ],
+        watchDuration:[
+          { required: true, message: '请输入观看时长', trigger: 'blur'}
+        ],
+        action:[
+          { required: true, message: '请选择实施动作', trigger: 'blur'}
+        ],
+        receivePrompt:[
+          { required: true, message: '请输入领取提示语', trigger: 'blur'}
+        ],
+        redPacketType:[
+          { required: true, message: '请选择红包发放方式', trigger: 'blur'}
+        ],
+        redPacketAmount:[
+          { required: true, message: '请输入红包金额', trigger: 'blur'}
+        ],
+        receiveMethod:[
+          { required: true, message: '请选择红包领取方式', trigger: 'blur'}
+        ],
+        guideText:[
+          { required: true, message: '请输入客服引导语', trigger: 'blur'}
+        ],
+        showGuide:[
+          { required: true, message: '请选择是否显示客服引导', trigger: 'blur'}
+        ]
+      },
+      watchRewardForm: {
+        id: null,
+        liveId: null,
+        // 是否启用观看奖励
+        enabled: false,
+        // 参与条件
+        participateCondition: '1',
+        // 观看时长
+        watchDuration: '',
+        // 实施动作
+        action: '1',
+        // 领取提示语
+        receivePrompt: '',
+        // 红包发放方式(固定金额/随机金额)
+        redPacketType: '1',
+        // 红包金额
+        redPacketAmount: '',
+        // 红包发放数量
+        redPacketCount: '',
+        // 红包领取方式
+        receiveMethod: '1',
+        // 是否显示客服引导
+        showGuide: '1',
+        // 客服引导语
+        guideText: '',
+        // 积分值
+        scoreAmount: '',
+        // 最大领取人数
+        maxReceivers: '',
+        // 积分使用引导语
+        scoreGuideText: '',
+        // 积分使用引导链接
+        scoreGuideLink: ''
+      },
+      // 添加实施动作选项
+      actionOptions: [
+        {
+          label: '现金红包',
+          value: '1'
+        },
+        {
+          label: '积分红包',
+          value: '2'
+        }
+      ]
+    }
+  },
+  created() {
+    this.liveId = this.$route.params.liveId
+    this.queryParams.liveId = this.liveId
+    this.goodsParams.liveId = this.liveId
+    this.questionParams.liveId = this.liveId
+    this.watchRewardForm.liveId = this.liveId
+    // this.getLiveQuestionLiveList()
+    this.getLiveConfig();
+  },
+  methods: {
+    getLiveConfig(){
+      getConfig(this.liveId).then(response => {
+        if(response.code === 200){
+          this.watchRewardForm = JSON.parse(response.data)
+        }
+      })
+    },
+    handleClick(tab, event) {
+      console.info(tab, event)
+    },
+    handleToQuestionBank() {
+      this.$router.push('/live/liveQuestionBank')
+    },
+    handleTabClick(tab) {
+      if(tab.name === 'answer') {
+        // this.getLiveQuestionLiveList()
+      }
+      if(tab.name === 'goods'){
+        this.getLiveGoodsList();
+      }
+    },
+    getLiveGoodsList() {
+      this.loading = true
+      listLiveGoods({liveId: this.liveId}).then(response => {
+        this.goodsLiveList = response.rows
+        this.goodsLiveTotal = response.total
+        this.loading = false
+      })
+    },
+    getLiveQuestionLiveList() {
+      this.loading = true
+      listLiveQuestionLive(this.questionParams).then(response => {
+        this.questionLiveList = response.rows
+        this.questionTotal = response.total
+        this.loading = false
+      })
+    },
+    handleAddQuestion() {
+      this.questionDialogVisible = true
+      this.getQuestionList()
+    },
+    handleAddLiveGoods(){
+      this.goodsDialogVisible = true;
+      this.getStoreProductLists()
+    },
+    getQuestionList() {
+      this.questionLoading = true
+      listLiveQuestionOptionList(this.queryParams).then(response => {
+        this.questionList = response.rows
+        this.total = response.total
+        this.questionLoading = false
+      })
+    },
+    handleQuestionSearch() {
+      this.queryParams.pageNum = 1
+      this.queryParams.title = this.searchTitle
+      this.getQuestionList()
+    },
+    handleGoodsSearch(){
+      this.queryParams.pageNum = 1
+      this.queryParams.title = this.searchTitle
+      this.getQuestionList()
+    },
+    handleSelectionChange(selection) {
+      this.selectedQuestions = selection
+    },
+    handleGoodsChange(goods) {
+      this.selectedGoods = goods
+    },
+    handleCurrentChange() {
+      this.getQuestionList()
+    },
+    confirmAddQuestion() {
+      if (this.selectedQuestions.length === 0) {
+        this.$message({
+          message: '请选择要添加的试题',
+          type: 'warning'
+        })
+        return
+      }
+      // 调用添加直播间试题接口
+      addLiveQuestionLive({
+        liveId: this.liveId,
+        questionIds: this.selectedQuestions.map(item => item.id).join(',')
+      }).then(response => {
+        this.questionDialogVisible = false
+        this.getLiveQuestionLiveList()
+      })
+    },
+    confirmAddGoods(){
+      if (this.selectedGoods.length === 0) {
+        this.$message({
+          message: '请选择要添加的商品',
+          type: 'warning'
+        })
+        return
+      }
+      addLiveGoods({
+        liveId: this.liveId,
+        productsId: this.selectedGoods.map(item => item.productId).join(',')
+      }).then(response => {
+        this.goodsDialogVisible = false
+        this.getLiveGoodsList()
+      })
+    },
+    handleDelete(row) {
+      // 调用删除直播间试题接口
+      deleteLiveQuestionLive({
+        liveId: this.liveId,
+        ids: row.id
+      }).then(response => {
+        this.getLiveQuestionLiveList()
+      })
+    },
+    handleGoodDelete(row){
+      delLiveGoods(row.goodsId).then(response => {
+        this.getLiveGoodsList()
+      })
+    },
+    /** 处理行点击事件 */
+    handleRowClick(row, column) {
+      // 如果点击的是复选框列,不进行处理
+      if (column.type === 'selection') {
+        return
+      }
+
+      // 获取表格实例
+      const table = this.$refs.questionTable[0]
+      if (!table) {
+        return
+      }
+
+      // 判断当前行是否已经被选中
+      const isSelected = this.selectedQuestions.some(item => item.id === row.id)
+
+      // 切换选中状态
+      table.toggleRowSelection(row, !isSelected)
+    },
+    /** 处理行点击事件 */
+    handleGoodsRowClick(row, column) {
+      // 如果点击的是复选框列,不进行处理
+      if (column.type === 'selection') {
+        return
+      }
+
+      // 获取表格实例
+      const table = this.$refs.goodsTable[0]
+      if (!table) {
+        return
+      }
+
+      // 判断当前行是否已经被选中
+      const isSelected = this.selectedGoods.some(item => item.id === row.id)
+
+      // 切换选中状态
+      table.toggleRowSelection(row, !isSelected)
+    },
+    saveWatchReward() {
+      this.$refs["watchRewardForm"][0].validate(valid => {
+        if (valid) {
+          if (this.watchRewardForm.id == null) {
+            // 调用保存观看奖励接口
+            // 实现保存逻辑
+            addConfig(this.watchRewardForm).then(res => {
+              if (res.code == 200) {
+                this.msgSuccess("修改成功");
+              }
+            })
+          } else {
+            updateConfig(this.watchRewardForm).then(response => {
+              this.msgSuccess("修改成功");
+            });
+          }
+        }
+      })
+
+    },
+    getStoreProductLists() {
+      listStoreProduct({liveId:this.liveId}).then(response => {
+        this.goodsList = response.rows
+        this.goodsTotal = response.total
+        this.loading = false
+      })
+    }
+  }
+}
+</script>
+
+<style scoped>
+.live-config-container {
+  padding: 10px 20px;
+  height: calc(100vh - 84px); /* 减去头部导航的高度 */
+}
+.white-bg-tabs {
+  background-color: #fff;
+  padding: 10px 20px;
+  border-radius: 4px;
+  height: 100%;
+}
+
+.market-tab-pane {
+  height: 74vh;
+  overflow-y: auto;
+}
+.tip-box {
+  padding: 12px 16px;
+  background-color: #FFF6F2;
+  border-radius: 4px;
+  color: #666;
+  font-size: 14px;
+}
+
+/* 修改弹窗相关样式 */
+::v-deep .el-dialog {
+  height: 90%;
+  margin: 0 !important;
+  width: 900px !important;
+}
+
+::v-deep .el-dialog__body {
+  padding: 20px;
+  height: calc(100% - 110px);  /* 减去header和footer的高度 */
+  overflow: hidden;
+}
+
+.dialog-content {
+  height: 100%;
+  overflow-y: auto;
+}
+
+::v-deep .el-dialog__footer {
+  position: absolute;
+  bottom: 0;
+  width: 100%;
+  background: #fff;
+  z-index: 1;
+  border-top: 1px solid #e4e7ed;
+  padding: 15px 20px;
+}
+
+::v-deep .el-dialog__header {
+  padding: 15px 20px;
+  border-bottom: 1px solid #e4e7ed;
+}
+
+.selected-count {
+  color: #999;
+  font-size: 14px;
+}
+
+/* 可点击列的样式 */
+::v-deep .clickable-column {
+  cursor: pointer;
+}
+
+/* 提示信息样式 */
+.tip-message {
+  padding: 12px 16px;
+  background-color: #FFF6F2;
+  border-radius: 4px;
+  color: #666;
+  font-size: 14px;
+  margin-bottom: 20px;
+}
+
+/* 开关容器样式 */
+.reward-switch {
+  margin-left: 200px;
+  margin-bottom: 20px;
+  padding: 20px;
+  background-color: #fff;
+  border-radius: 4px;
+  display: flex;
+  align-items: center;
+}
+
+/* 开关标签样式 */
+.reward-switch .switch-label {
+  margin-right: 10px;
+  font-size: 14px;
+  color: #333;
+  margin-left: 50px;
+}
+
+/* 表单区块样式 */
+.section-block {
+  width: 50%;
+  background-color: #fff;
+  padding: 20px;
+  border-radius: 4px;
+  margin-left: 50px;
+  margin-bottom: 20px;
+}
+
+/* 标题样式 */
+.section-block .section-title {
+  font-size: 14px;
+  color: #333;
+  margin-bottom: 20px;
+  border-left: 4px solid #409EFF;
+  padding-left: 10px;
+  line-height: 1;
+}
+
+/* 表单样式 */
+.reward-form {
+  margin-top: 20px;
+}
+
+/* 表单项样式 */
+.reward-form .el-form-item {
+  margin-bottom: 22px;
+  padding-left: 50px;
+}
+
+.reward-form .el-form-item:last-child {
+  margin-bottom: 0;
+}
+
+/* 表单标签样式 */
+.reward-form .el-form-item .el-form-item__label {
+  color: #606266;
+}
+
+/* 输入框统一宽度 */
+.reward-form .el-form-item .el-input {
+  width: 300px;
+}
+
+/* 必填项星号样式 */
+.reward-form .el-form-item.is-required .el-form-item__label:before {
+  color: #F56C6C;
+}
+
+/* 观看时长输入框样式 */
+.reward-form .el-form-item .duration-input {
+  width: 300px;
+}
+
+.reward-form .el-form-item .duration-input .el-input__inner {
+  text-align: left;
+}
+
+/* 保存按钮样式 */
+.form-actions {
+  width: 600px;
+  text-align: center;
+  margin-top: 30px;
+}
+
+.form-actions .el-button {
+  padding: 8px 20px;
+  font-size: 13px;
+}
+</style>

+ 274 - 96
src/views/live/liveConsole/index.vue

@@ -4,54 +4,66 @@
 
     <!-- 用户列表 start -->
     <el-col class="live-console-col" :span="5">
-      <el-tabs class="live-console-tab-left" v-model="tabLeft.activeName" @tab-click="handleClick">
+      <el-tabs class="live-console-tab-left" v-model="tabLeft.activeName" @tab-click="handleClick" :stretch="true">
         <el-tab-pane :label="onlineLabel" name="online">
-          <el-scrollbar ref="manageLeftRef" style="height: 800px; width: 100%;">
+          <el-scrollbar ref="manageLeftRef_online" style="height: 800px; width: 100%;">
             <el-row style="margin-top: 10px" type="flex" align="middle" v-for="u in onlineUserList">
-              <el-col :span="5"><el-avatar :src="u.avatar"></el-avatar></el-col>
-              <el-col :span="12" :offset="2">{{ u.nickName }}</el-col>
-              <el-col :span="3" >
-                <el-switch
-                  v-model="u.msgStatus"
-                  :active-value="0"
-                  :inactive-value="1"
-                  active-color="#13ce66"
-                  inactive-color="#ff4949">
-                </el-switch>
+              <el-col :span="20">
+                <el-row type="flex" align="middle">
+                  <el-col :span="4" style="padding-left: 10px;"><el-avatar :src="u.avatar"></el-avatar></el-col>
+                  <el-col :span="19" :offset="1">{{ u.nickName }}</el-col>
+                  <el-col :span="19" :offset="1">{{ u.userId }}</el-col>
+                </el-row>
+              </el-col>
+              <el-col :span="4" >
+                <el-popover
+                  width="100"
+                  trigger="click">
+                  <a style="cursor: pointer;color: #ff0000;" @click="changeUserState(u)">{{ u.msgStatus === 1 ? '解禁' : '禁言' }}</a>
+                  <i class="el-icon-more" slot="reference"></i>
+                </el-popover>
               </el-col>
             </el-row>
           </el-scrollbar>
         </el-tab-pane>
         <el-tab-pane :label="offlineLabel" name="offline">
-          <el-scrollbar ref="manageLeftRef" style="height: 100%; width: 100%;">
+          <el-scrollbar ref="manageLeftRef_offline" style="height: 800px; width: 100%;">
             <el-row style="margin-top: 10px" type="flex" align="middle" v-for="u in offlineUserList">
-              <el-col :span="5"><el-avatar :src="u.avatar"></el-avatar></el-col>
-              <el-col :span="12" :offset="2">{{ u.nickName }}</el-col>
-              <el-col :span="3" >
-                <el-switch
-                  v-model="u.msgStatus"
-                  :active-value="0"
-                  :inactive-value="1"
-                  active-color="#13ce66"
-                  inactive-color="#ff4949">
-                </el-switch>
+              <el-col :span="20">
+                <el-row type="flex" align="middle">
+                  <el-col :span="4" style="padding-left: 10px;"><el-avatar :src="u.avatar"></el-avatar></el-col>
+                  <el-col :span="19" :offset="1">{{ u.nickName }}</el-col>
+                  <el-col :span="19" :offset="1">{{ u.userId }}</el-col>
+                </el-row>
+              </el-col>
+              <el-col :span="4" >
+                <el-popover
+                  width="100"
+                  trigger="click">
+                  <a style="cursor: pointer;color: #ff0000;" @click="changeUserState(u)">{{ u.msgStatus === 1 ? '解禁' : '禁言' }}</a>
+                  <i class="el-icon-more" slot="reference"></i>
+                </el-popover>
               </el-col>
             </el-row>
           </el-scrollbar>
         </el-tab-pane>
         <el-tab-pane :label="silencedUserLabel" name="silenced">
-          <el-scrollbar ref="manageLeftRef" style="height: 100%; width: 100%;">
+          <el-scrollbar ref="manageLeftRef_silenced" style="height: 800px; width: 100%;">
             <el-row style="margin-top: 10px" type="flex" align="middle" v-for="u in silencedUserList">
-              <el-col :span="5"><el-avatar :src="u.avatar"></el-avatar></el-col>
-              <el-col :span="12" :offset="2">{{ u.nickName }}</el-col>
-              <el-col :span="3" >
-                <el-switch
-                  v-model="u.msgStatus"
-                  :active-value="0"
-                  :inactive-value="1"
-                  active-color="#13ce66"
-                  inactive-color="#ff4949">
-                </el-switch>
+              <el-col :span="20">
+                <el-row type="flex" align="middle">
+                  <el-col :span="4" style="padding-left: 10px;"><el-avatar :src="u.avatar"></el-avatar></el-col>
+                  <el-col :span="19" :offset="1">{{ u.nickName }}</el-col>
+                  <el-col :span="19" :offset="1">{{ u.userId }}</el-col>
+                </el-row>
+              </el-col>
+              <el-col :span="4" >
+                <el-popover
+                  width="100"
+                  trigger="click">
+                  <a style="cursor: pointer;color: #ff0000;" @click="changeUserState(u)">{{ u.msgStatus === 1 ? '解禁' : '禁言' }}</a>
+                  <i class="el-icon-more" slot="reference"></i>
+                </el-popover>
               </el-col>
             </el-row>
           </el-scrollbar>
@@ -61,8 +73,45 @@
     <!-- 用户列表 end -->
 
     <!-- 直播/视频 start -->
-    <el-col class="live-console-col" :span="10">
-      <video controls autoplay :src="this.liveVideo.videoUrl" width="100%"></video>
+    <el-col class="live-console-col" :span="11">
+      <div style="background: #000; border-radius: 5px; overflow: hidden; margin: 10px 5px;">
+        <div style="border-radius: 5px; overflow: hidden;">
+          <video
+            controls
+            ref="videoPlayer"
+            autoplay
+            width="100%"
+            style="display: block; background: #000;"
+          ></video>
+        </div>
+      </div>
+      <!-- 底部导航栏 -->
+<!--      <div style="display: flex; justify-content: space-around; padding: 15px 0; background: #fff; border-top: 1px solid #f0f0f0;">-->
+<!--          <div style="display: flex; flex-direction: column; align-items: center; cursor: pointer;">-->
+<!--            <i class="el-icon-microphone" style="font-size: 20px;"></i>-->
+<!--            <span style="font-size: 12px; margin-top: 4px;">语音</span>-->
+<!--          </div>-->
+<!--          <div style="display: flex; flex-direction: column; align-items: center; cursor: pointer;">-->
+<!--            <i class="el-icon-video-camera" style="font-size: 20px;"></i>-->
+<!--            <span style="font-size: 12px; margin-top: 4px;">视频</span>-->
+<!--          </div>-->
+<!--          <div style="display: flex; flex-direction: column; align-items: center; cursor: pointer;">-->
+<!--            <i class="el-icon-share" style="font-size: 20px;"></i>-->
+<!--            <span style="font-size: 12px; margin-top: 4px;">分享</span>-->
+<!--          </div>-->
+<!--          <div style="display: flex; flex-direction: column; align-items: center; cursor: pointer;">-->
+<!--            <i class="el-icon-message" style="font-size: 20px;"></i>-->
+<!--            <span style="font-size: 12px; margin-top: 4px;">评论</span>-->
+<!--          </div>-->
+<!--          <div style="display: flex; flex-direction: column; align-items: center; cursor: pointer;">-->
+<!--            <i class="el-icon-goods" style="font-size: 20px;"></i>-->
+<!--            <span style="font-size: 12px; margin-top: 4px;">商品</span>-->
+<!--          </div>-->
+<!--          <div style="display: flex; flex-direction: column; align-items: center; cursor: pointer;">-->
+<!--            <i class="el-icon-menu" style="font-size: 20px;"></i>-->
+<!--            <span style="font-size: 12px; margin-top: 4px;">工具箱</span>-->
+<!--          </div>-->
+<!--        </div>-->
     </el-col>
     <!-- 直播/视频 end -->
 
@@ -70,29 +119,54 @@
     <el-col class="live-console-col" :span="5">
       <el-tabs class="live-console-tab-right" v-model="tabRight.activeName" @tab-click="handleClick">
         <el-tab-pane label="聊天" name="talk">
-          <el-scrollbar style="height: 500px; width: 300px;" ref="manageRightRef">
-            <el-row v-for="m in msgList">
-              <el-row style="margin-top: 10px" type="flex" align="top">
-                <el-col :span="3" :offset="1"><el-avatar :src="m.avatar"/></el-col>
+          <el-scrollbar style="height: 500px; width: 100%;" ref="manageRightRef">
+            <el-row v-for="m in msgList" >
+              <el-row v-if="m.userId !== userId" style="margin-top: 5px" type="flex" align="top" >
+                <el-col :span="3" style="margin-left: 10px"><el-avatar :src="m.avatar"/></el-col>
                 <el-col :span="15">
-                  <el-row>
-                    <el-col>{{ m.nickName }}</el-col>
-                    <el-col>{{ m.msg }}</el-col>
+                  <el-row style="margin-left: 10px">
+                    <el-col><div style="font-size: 12px; color: #999; margin-bottom: 3px;">{{ m.nickName }}</div></el-col>
+                    <el-col :span="24" style="max-width: 200px;">
+                      <div style="white-space: normal; word-wrap: break-word;background-color: #f0f2f5; padding: 8px; border-radius: 5px;font-size: 14px;width: 100%;">
+                        {{ m.msg }}
+                      </div>
+                    </el-col>
+                    <el-col>
+                      <a style="cursor: pointer;color: #ff0000;padding: 8px 8px 0 0;font-size: 12px;" @click="changeUserState(m)">{{ m.msgStatus === 1 ? '解禁' : '禁言' }}</a>
+                    </el-col>
                   </el-row>
                 </el-col>
               </el-row>
+              <el-row v-if="m.userId === userId" style="padding: 8px 0" type="flex" align="top" justify="end">
+                <div style="display: flex;justify-content: flex-end">
+                  <div style="display: flex;justify-content: flex-end;flex-direction: column;max-width: 200px;align-items: flex-end">
+                    <div style="font-size: 12px; color: #999; margin-bottom: 3px;">{{ m.nickName }}</div>
+                    <div style="white-space: normal; word-wrap: break-word;width: 100%; background-color: #e6f7ff; padding: 8px; border-radius: 5px;font-size: 14px;">{{ m.msg }}</div>
+                  </div>
+                  <el-avatar :src="m.avatar" style="margin-left: 10px; margin-right: 10px;"/>
+                </div>
+              </el-row>
             </el-row>
+            <!-- 底部留白 -->
+            <div style="height: 20px;"></div>
           </el-scrollbar>
 
           <!-- 消息输入区域 -->
-          <div class="chat-input">
+          <div style="padding: 10px; border-top: 1px solid #ebeef5; background-color: #fff; min-height: 120px;">
             <el-input
+              type="textarea"
               v-model="newMsg"
               placeholder="请输入消息..."
+              :rows="8"
               @keyup.enter.native="sendMessage"
               clearable
-            ></el-input>
-            <el-button type="primary" @click="sendMessage">发送</el-button>
+              resize="none"
+              style="flex: 1; margin-right: 10px;"
+            >
+            </el-input>
+            <div style="display: flex; justify-content: flex-end; margin-top: 10px;">
+              <el-button plain @click="sendMessage">发送</el-button>
+            </div>
           </div>
         </el-tab-pane>
       </el-tabs>
@@ -105,8 +179,10 @@
 <script>
 import { changeUserStatus, watchUserList } from '@/api/live/liveWatchUser'
 import { getLiveVideoByLiveId } from '@/api/live/liveVideo'
+import { getLivingUrl } from '@/api/live/live'
 import { listLiveMsg } from '@/api/live/liveMsg'
-import { LiveWS } from '@/utils/webSocket'
+import { LiveWS } from '@/utils/liveWS'
+import flvjs from 'flv.js';
 
 export default {
   name: "LiveConsole",
@@ -118,8 +194,10 @@ export default {
       tabRight: {
         activeName: "talk",
       },
+      livingUrl:"",
       liveVideo: {},
       socket: null,
+      liveWsUrl: process.env.VUE_APP_LIVE_WS_URL + '/app/webSocket',
       userParams:{
         pageNum: 1,
         pageSize: 10,
@@ -136,9 +214,10 @@ export default {
     }
   },
   created() {
-    this.getLiveVideo()
+    // this.getLiveVideo()
     this.getList()
     this.connectWebSocket()
+    this.getLiveUrl()
   },
   computed: {
     liveId() {
@@ -147,6 +226,9 @@ export default {
     userId() {
       return this.$store.state.user.user.userId
     },
+    companyId() {
+      return this.$store.state.user.user.companyId
+    },
     onlineUserList() {
       return this.userList.filter(u => u.online === 0)
     },
@@ -176,6 +258,33 @@ export default {
     }
   },
   methods: {
+    getLiveUrl(){
+      getLivingUrl(this.liveId).then(res=>{
+        if(res.code === 200){
+          this.livingUrl = res.livingUrl
+          this.initPlayer()
+        }
+      })
+    },
+    initPlayer(){
+      var isUrl = this.livingUrl === null || this.livingUrl.trim() === ''
+      if (flvjs.isSupported() && !isUrl) {
+        const videoElement = this.$refs.videoPlayer
+        var flvPlayer = flvjs.createPlayer({
+          type: 'flv',
+          // qfedu 是推流的时候的路径名称
+          // dixon 是stream 自定义的名称
+          url: this.livingUrl,
+          enableWorker: true,
+          enableStashBuffer: false, // 禁用内部缓冲区
+          stashInitialSize: 128,   // 减小初始缓冲大小
+          autoCleanupSourceBuffer: true
+        });
+        flvPlayer.attachMediaElement(videoElement);
+        flvPlayer.load();
+        flvPlayer.play();
+      }
+    },
     handleClick(tab) {
       console.log("click",tab.name)
       console.log("liveId", this.liveId)
@@ -211,17 +320,20 @@ export default {
         pageNum: this.userParams.pageNum,
         pageSize: this.userParams.pageSize
       }).then(response => {
-        let {rows,total} = response;
-        this.userParams.pageNum = (this.userParams.pageNum - 1) * this.userParams.pageSize;
-        rows.forEach(row => {
-          if (!this.userList.some(u => u.userId === row.userId)) {
-            this.userList.push(row)
-          }
-        })
+        let {code,rows,total} = response
+        if (code === 200) {
+          let totalPage = (total % this.userParams.pageSize == 0) ? Math.floor(total / this.userParams.pageSize) : Math.floor(total / this.userParams.pageSize + 1);
+          rows.forEach(row => {
+            if (!this.userList.some(u => u.userId === row.userId)) {
+              this.userList.push(row)
+            }
+          })
 
-        // 没加载完继续加载
-        if (this.userList.length < total) {
-          this.loadUserList()
+          // 没加载完继续加载
+          if (this.userParams.pageNum < totalPage) {
+            this.userParams.pageNum = parseInt(this.userParams.pageNum) + 1;
+            this.loadUserList()
+          }
         }
       })
     },
@@ -232,25 +344,40 @@ export default {
         pageNum: this.msgParams.pageNum,
         pageSize: this.msgParams.pageSize
       }).then(response => {
-          let {rows,total} = response;
-          console.log(rows);
-          this.msgParams.pageNum = (this.msgParams.pageNum - 1) * this.msgParams.pageSize;
-          rows.forEach(row => {
-            if (!this.msgList.some(m => m.msgId === row.msgId)) {
-              this.msgList.push(row)
+          let {code, rows,total} = response;
+          if (code === 200) {
+            let totalPage = (total % this.msgParams.pageSize == 0) ? Math.floor(total / this.msgParams.pageSize) : Math.floor(total / this.msgParams.pageSize + 1);
+            rows.forEach(row => {
+              if (!this.msgList.some(m => m.msgId === row.msgId)) {
 
-              // 移动到底部
-              this.$nextTick(() => {
-                setTimeout(() => {
-                  this.$refs.manageRightRef.wrap.scrollTop = this.$refs.manageRightRef.wrap.scrollHeight - this.$refs.manageRightRef.wrap.clientHeight
-                }, 200)
-              })
+                let user = this.userList.find(u => u.userId === row.userId)
+                if (user) {
+                  row.msgStatus = user.msgStatus
+                } else {
+                  row.msgStatus = 0
+                }
+
+                this.msgList.push(row)
+
+                // 移动到底部
+                this.$nextTick(() => {
+                  setTimeout(() => {
+                    this.$refs.manageRightRef.wrap.scrollTop = this.$refs.manageRightRef.wrap.scrollHeight - this.$refs.manageRightRef.wrap.clientHeight
+                  }, 200)
+                })
+              }
+            })
+
+            // 没加载完继续加载
+            if (this.msgParams.pageNum < totalPage) {
+              this.msgParams.pageNum = parseInt(this.msgParams.pageNum) + 1;
+              this.loadMsgList()
             }
-          })
 
-          // 没加载完继续加载
-          if (this.msgList.length < total) {
-            this.loadMsgList()
+            // 同步更新消息列表中相同用户的状态
+            this.userList.forEach(u => {
+              this.msgList.filter(m => m.userId === u.userId).forEach(m => m.msgStatus = u.msgStatus)
+            })
           }
         })
 
@@ -266,13 +393,24 @@ export default {
       console.log("manageRight", current)
     },
     changeUserState(u) {
-      // 还原状态
-      u.msgStatus = u.msgStatus === 0 ? 1 : 0
       // 修改状态
       changeUserStatus({liveId: u.liveId, userId: u.userId}).then(response => {
         let { code } = response;
         if (200 === code) {
           u.msgStatus = u.msgStatus === 0 ? 1 : 0
+          // 同步更新消息列表中相同用户的状态
+          this.msgList.forEach(msg => {
+            if (msg.userId === u.userId) {
+              msg.msgStatus = u.msgStatus;
+            }
+          });
+
+          this.userList.forEach(user => {
+            if (user.userId === u.userId) {
+              user.msgStatus = u.msgStatus;
+            }
+          });
+
           let msg = u.msgStatus === 0 ? "已解禁" : "已禁言"
           this.msgSuccess(msg);
           return
@@ -281,39 +419,62 @@ export default {
       })
     },
     connectWebSocket() {
-      let socket = new LiveWS('ws://localhost:7114/app/webSocket', this.liveId, this.userId);
-      socket.ws.onmessage = (e) => {
-        this.handleWsMessage(e)
-      }
+      let socket = new LiveWS(this.liveWsUrl, this.liveId, this.userId);
+      socket.onmessage = (event) => this.handleWsMessage(event)
       this.socket = socket
     },
     handleWsMessage(event) {
-      console.log(event.data);
+      let { code, data } = JSON.parse(event.data)
+      if (code === 200) {
+        let { cmd } = data
+        if (cmd === 'sendMsg') {
+          let message = JSON.parse(data.data)
+
+          let user = this.userList.find(u => u.userId === message.userId)
+          if (user) {
+            message.msgStatus = user.msgStatus
+          } else {
+            message.msgStatus = 0
+          }
+          delete message.params
+          this.msgList.push(message)
+
+          // 移动到底部
+          this.$nextTick(() => {
+            setTimeout(() => {
+              this.$refs.manageRightRef.wrap.scrollTop = this.$refs.manageRightRef.wrap.scrollHeight - this.$refs.manageRightRef.wrap.clientHeight
+            }, 200)
+          })
+        }
+        else if (cmd === 'entry' || cmd === 'out') {
+
+          let user = data
+          if(this.userList.length > 0){
+            this.userList = this.userList.filter(u => u.userId !== user.userId)
+          }
+          this.userList.push(user)
+        }
+      }
     },
     sendMessage() {
-      console.log(this.newMsg);
       // 发送前简单校验
       if (this.newMsg.trim() === '') {
         return;
       }
 
-      this.msgList.push({
+      let msg = {
         msg: this.newMsg,
         liveId: this.liveId,
         userId: this.userId,
-        avatar: 'https://thirdwx.qlogo.cn/mmopen/vi_32/Q3auHgzwzM4Rv7nYYRvbQcJD9OogfiaMWDj8LTiceZ5J3Bm6Ph9pIiac9MVcwdfwPUI9XQ50ibo4TFp0ZHjgzLH6dw/132',
-        nickName: '测试123123'
-      })
+        userType: 1,
+        cmd: 'sendMsg',
+        avatar: this.$store.state.user.user.avatar,
+        nickName: this.$store.state.user.user.nickName
+      }
+
+      this.socket.send(JSON.stringify(msg))
 
       this.newMsg = '';
-      this.$nextTick(() => {
-        // 新消息加入后自动滚动到底部
-        if (this.$refs.manageRightRef) {
-          this.$refs.manageRightRef.update();
-          const scrollDom = this.$refs.manageRightRef.$el.querySelector('.el-scrollbar__wrap');
-          scrollDom.scrollTop = scrollDom.scrollHeight;
-        }
-      });
     }
   },
   destroyed() {
@@ -323,6 +484,9 @@ export default {
 </script>
 
 <style scoped>
+.talk-list{
+  display: flex;
+}
   .live-console {
     width: 90vw;
     padding: 10px 0;
@@ -344,12 +508,26 @@ export default {
     padding: 10px;
     border-top: 1px solid #ebeef5;
     background-color: #fff;
-    min-height: 60px;
+    min-height: 120px;
   }
 
   .chat-input .el-input {
     flex: 1;
     margin-right: 10px;
-    min-height: 40px;
   }
+
+  .chat-input .el-textarea__inner {
+    resize: none;
+    min-height: 100px;
+  }
+  ::v-deep .el-textarea__inner {
+    border: none !important;
+    box-shadow: none !important;
+    resize: none !important;
+  }
+  ::v-deep .el-textarea__inner:focus {
+    border: none !important;
+    box-shadow: none !important;
+  }
+
 </style>

+ 15 - 15
src/views/live/liveEventConf/index.vue

@@ -15,13 +15,14 @@
           <el-option label="请选择字典生成" value="" />
         </el-select>
       </el-form-item>
-      <el-form-item label="创建日期" prop="createTime">
-        <el-date-picker clearable size="small"
-          v-model="queryParams.createTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择创建日期">
-        </el-date-picker>
+      <el-form-item label="触发阈值" prop="triggerCount">
+        <el-input
+          v-model="queryParams.triggerCount"
+          placeholder="请输入触发阈值"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -78,7 +79,7 @@
 
     <el-table border v-loading="loading" :data="liveEventConfList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="创建日期" align="center" prop="eventId" />
+      <el-table-column label="触发阈值" align="center" prop="eventId" />
       <el-table-column label="直播间ID" align="center" prop="liveId" />
       <el-table-column label="事件类型 (0:用户进入直播间, 1:用户发言, 2:用户点赞, 3:用户关注)" align="center" prop="eventType" />
       <el-table-column label="触发阈值" align="center" prop="triggerCount" />
@@ -88,6 +89,11 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
+      <el-table-column label="修改日期" align="center" prop="udpateTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.udpateTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -130,9 +136,6 @@
         <el-form-item label="触发阈值" prop="triggerCount">
           <el-input v-model="form.triggerCount" placeholder="请输入触发阈值" />
         </el-form-item>
-        <el-form-item label="关联红包ID" prop="redId">
-          <el-input v-model="form.redId" placeholder="请输入关联红包ID" />
-        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -175,7 +178,7 @@ export default {
         pageSize: 10,
         liveId: null,
         eventType: null,
-        createTime: null,
+        triggerCount: null,
       },
       // 表单参数
       form: {},
@@ -190,9 +193,6 @@ export default {
         triggerCount: [
           { required: true, message: "触发阈值不能为空", trigger: "blur" }
         ],
-        redId: [
-          { required: true, message: "关联红包ID不能为空", trigger: "blur" }
-        ],
       }
     };
   },

+ 14 - 25
src/views/live/liveLotteryConf/index.vue

@@ -37,6 +37,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="描述" prop="desc">
+        <el-input
+          v-model="queryParams.desc"
+          placeholder="请输入描述"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item label="创建日期" prop="createTime">
         <el-date-picker clearable size="small"
           v-model="queryParams.createTime"
@@ -110,27 +119,12 @@
       <el-table-column label="参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与" align="center" prop="require" />
       <el-table-column label="参与抽奖方式 2/3对应的配置,2:送礼数量,以最低档位礼物为单位 3:指定商品Id及数量,|竖线分割" align="center" prop="requireConf" />
       <el-table-column label="持续时间 单位:分" align="center" prop="duration" />
-      <el-table-column label="描述/标题" align="center" prop="desc" />
+      <el-table-column label="描述" align="center" prop="desc" />
       <el-table-column label="创建日期" align="center" prop="createTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="修改日期" align="center" prop="udpateTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.udpateTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="创建日期" align="center" prop="createBy" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createBy, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改日期" align="center" prop="updateBy" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updateBy, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -177,9 +171,6 @@
         <el-form-item label="可中奖份量" prop="totalLots">
           <el-input v-model="form.totalLots" placeholder="请输入可中奖份量" />
         </el-form-item>
-        <el-form-item label="实际发放奖励份量" prop="totalSend">
-          <el-input v-model="form.totalSend" placeholder="请输入实际发放奖励份量" />
-        </el-form-item>
         <el-form-item label="参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与" prop="require">
           <el-input v-model="form.require" placeholder="请输入参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与" />
         </el-form-item>
@@ -189,8 +180,8 @@
         <el-form-item label="持续时间 单位:分" prop="duration">
           <el-input v-model="form.duration" placeholder="请输入持续时间 单位:分" />
         </el-form-item>
-        <el-form-item label="描述/标题" prop="desc">
-          <el-input v-model="form.desc" placeholder="请输入描述/标题" />
+        <el-form-item label="描述" prop="desc">
+          <el-input v-model="form.desc" placeholder="请输入描述" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -236,6 +227,7 @@ export default {
         productId: null,
         prizeLevel: null,
         require: null,
+        desc: null,
         createTime: null,
       },
       // 表单参数
@@ -257,9 +249,6 @@ export default {
         totalLots: [
           { required: true, message: "可中奖份量不能为空", trigger: "blur" }
         ],
-        totalSend: [
-          { required: true, message: "实际发放奖励份量不能为空", trigger: "blur" }
-        ],
         require: [
           { required: true, message: "参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与不能为空", trigger: "blur" }
         ],
@@ -267,7 +256,7 @@ export default {
           { required: true, message: "持续时间 单位:分不能为空", trigger: "blur" }
         ],
         desc: [
-          { required: true, message: "描述/标题不能为空", trigger: "blur" }
+          { required: true, message: "描述不能为空", trigger: "blur" }
         ],
       }
     };

+ 29 - 5
src/views/live/liveLotteryRecord/index.vue

@@ -1,6 +1,32 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="直播间ID" prop="liveId">
+        <el-input
+          v-model="queryParams.liveId"
+          placeholder="请输入直播间ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="抽奖状态 0:未开始 1:进行中 2:已结束" prop="lotteryStauts">
+        <el-input
+          v-model="queryParams.lotteryStauts"
+          placeholder="请输入抽奖状态 0:未开始 1:进行中 2:已结束"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="修改日期" prop="udpateTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.udpateTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择修改日期">
+        </el-date-picker>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -64,11 +90,6 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="创建日期" align="center" prop="createBy" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createBy, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -140,6 +161,9 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        liveId: null,
+        lotteryStauts: null,
+        udpateTime: null,
       },
       // 表单参数
       form: {},

+ 0 - 103
src/views/live/liveLotteryRegistration/index.vue

@@ -1,74 +1,6 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="直播间ID" prop="liveId">
-        <el-input
-          v-model="queryParams.liveId"
-          placeholder="请输入直播间ID"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="用户ID" prop="userId">
-        <el-input
-          v-model="queryParams.userId"
-          placeholder="请输入用户ID"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="是否中奖 0否1是" prop="isWin">
-        <el-input
-          v-model="queryParams.isWin"
-          placeholder="请输入是否中奖 0否1是"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="奖品等级" prop="rizeLevel">
-        <el-input
-          v-model="queryParams.rizeLevel"
-          placeholder="请输入奖品等级"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="创建日期" prop="createTime">
-        <el-date-picker clearable size="small"
-          v-model="queryParams.createTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择创建日期">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改日期" prop="udpateTime">
-        <el-date-picker clearable size="small"
-          v-model="queryParams.udpateTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择修改日期">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="创建日期" prop="createBy">
-        <el-date-picker clearable size="small"
-          v-model="queryParams.createBy"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择创建日期">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="修改日期" prop="updateBy">
-        <el-date-picker clearable size="small"
-          v-model="queryParams.updateBy"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择修改日期">
-        </el-date-picker>
-      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -134,21 +66,6 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="修改日期" align="center" prop="udpateTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.udpateTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="创建日期" align="center" prop="createBy" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createBy, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改日期" align="center" prop="updateBy" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updateBy, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -180,18 +97,6 @@
     <!-- 添加或修改直播抽奖登记对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="直播间ID" prop="liveId">
-          <el-input v-model="form.liveId" placeholder="请输入直播间ID" />
-        </el-form-item>
-        <el-form-item label="用户ID" prop="userId">
-          <el-input v-model="form.userId" placeholder="请输入用户ID" />
-        </el-form-item>
-        <el-form-item label="是否中奖 0否1是" prop="isWin">
-          <el-input v-model="form.isWin" placeholder="请输入是否中奖 0否1是" />
-        </el-form-item>
-        <el-form-item label="奖品等级" prop="rizeLevel">
-          <el-input v-model="form.rizeLevel" placeholder="请输入奖品等级" />
-        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -232,14 +137,6 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        liveId: null,
-        userId: null,
-        isWin: null,
-        rizeLevel: null,
-        createTime: null,
-        udpateTime: null,
-        createBy: null,
-        updateBy: null
       },
       // 表单参数
       form: {},

+ 88 - 131
src/views/live/liveOrderitems/index.vue

@@ -1,73 +1,55 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="订单号" prop="orderCode">
-        <el-input
-          v-model="queryParams.orderCode"
-          placeholder="请输入订单号"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item label="商品ID" prop="goodsId">
         <el-input
           v-model="queryParams.goodsId"
-          placeholder="请输入直播商品ID"
+          placeholder="请输入商品ID"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="商品规格" prop="productAttrValueId">
+      <el-form-item label="订单ID" prop="orderId">
         <el-input
-          v-model="queryParams.productAttrValueId"
-          placeholder="请输入商品规格ID"
+          v-model="queryParams.orderId"
+          placeholder="请输入订单ID"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="数量" prop="num">
+      <el-form-item label="商品名" prop="goodsName">
         <el-input
-          v-model="queryParams.num"
-          placeholder="请输入数量"
+          v-model="queryParams.goodsName"
+          placeholder="请输入商品名"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="是否售后" prop="isAfterSales">
-        <el-select filterable  v-model="queryParams.isAfterSales" placeholder="请选择是否申请售后"  clearable size="small">
-          <el-option v-for="(item,index) in liveIsAfterSalesOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="是否处方" prop="isPrescribe">
+      <el-form-item label="单价" prop="price">
         <el-input
-          v-model="queryParams.isPrescribe"
-          placeholder="请输入是否为处方药"
+          v-model="queryParams.price"
+          placeholder="请输入单价"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="店铺ID" prop="storeId">
+      <el-form-item label="数量" prop="num">
         <el-input
-          v-model="queryParams.storeId"
-          placeholder="请输入店铺ID"
+          v-model="queryParams.num"
+          placeholder="请输入数量"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="是否赠品" prop="isGift">
-        <el-input
-          v-model="queryParams.isGift"
-          placeholder="请输入是否赠品"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="状态 1正常 2已退款" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态 1正常 2已退款" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -83,7 +65,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['live:liveOrderItem:add']"
+          v-hasPermi="['live:liveOrderitems:add']"
         >新增</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -94,7 +76,7 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['live:liveOrderItem:edit']"
+          v-hasPermi="['live:liveOrderitems:edit']"
         >修改</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -105,7 +87,7 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['live:liveOrderItem:remove']"
+          v-hasPermi="['live:liveOrderitems:remove']"
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -116,26 +98,23 @@
           size="mini"
           :loading="exportLoading"
           @click="handleExport"
-          v-hasPermi="['live:liveOrderItem:export']"
+          v-hasPermi="['live:liveOrderitems:export']"
         >导出</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table border v-loading="loading" :data="liveOrderItemList" @selection-change="handleSelectionChange">
+    <el-table border v-loading="loading" :data="liveOrderitemsList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="是否赠品" align="center" prop="itemId" />
-      <el-table-column label="订单id" align="center" prop="orderId" />
-      <el-table-column label="订单号" align="center" prop="orderCode" />
-      <el-table-column label="购物车ID" align="center" prop="cartId" />
-      <el-table-column label="直播商品ID" align="center" prop="goodsId" />
-      <el-table-column label="商品ID" align="center" prop="productId" />
-      <el-table-column label="商品规格ID" align="center" prop="productAttrValueId" />
+      <el-table-column label="ID" align="center" prop="id" />
+      <el-table-column label="商品ID" align="center" prop="goodsId" />
+      <el-table-column label="订单ID" align="center" prop="orderId" />
+      <el-table-column label="商品JSON" align="center" prop="goodsJson" />
+      <el-table-column label="商品名" align="center" prop="goodsName" />
+      <el-table-column label="单价" align="center" prop="price" />
       <el-table-column label="数量" align="center" prop="num" />
-      <el-table-column label="是否申请售后" align="center" prop="isAfterSales" :formatter="liveIsAfterSalesFormatter"/>
-      <el-table-column label="是否为处方药" align="center" prop="isPrescribe" />
-      <el-table-column label="店铺ID" align="center" prop="storeId" />
-      <el-table-column label="是否赠品" align="center" prop="isGift" />
+      <el-table-column label="状态 1正常 2已退款" align="center" prop="status" />
+      <el-table-column label="备注" align="center" prop="remark" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -143,14 +122,14 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['live:liveOrderItem:edit']"
+            v-hasPermi="['live:liveOrderitems:edit']"
           >修改</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['live:liveOrderItem:remove']"
+            v-hasPermi="['live:liveOrderitems:remove']"
           >删除</el-button>
         </template>
       </el-table-column>
@@ -164,34 +143,34 @@
       @pagination="getList"
     />
 
-    <!-- 添加或修改订单详情对话框 -->
+    <!-- 添加或修改订单商品对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
-        <el-form-item label="订单号" prop="orderCode">
-          <el-input v-model="form.orderCode" placeholder="请输入订单号" />
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="商品ID" prop="goodsId">
+          <el-input v-model="form.goodsId" placeholder="请输入商品ID" />
         </el-form-item>
-        <el-form-item label="直播商品ID" prop="goodsId">
-          <el-input v-model="form.goodsId" placeholder="请输入直播商品ID" />
+        <el-form-item label="订单ID" prop="orderId">
+          <el-input v-model="form.orderId" placeholder="请输入订单ID" />
         </el-form-item>
-        <el-form-item label="商品规格ID" prop="productAttrValueId">
-          <el-input v-model="form.productAttrValueId" placeholder="请输入商品规格ID" />
+        <el-form-item label="商品JSON" prop="goodsJson">
+          <el-input v-model="form.goodsJson" type="textarea" placeholder="请输入内容" />
         </el-form-item>
-        <el-form-item label="数量" prop="num">
-          <el-input v-model="form.num" placeholder="请输入数量" />
+        <el-form-item label="商品名" prop="goodsName">
+          <el-input v-model="form.goodsName" placeholder="请输入商品名" />
         </el-form-item>
-        <el-form-item label="是否售后" prop="isAfterSales">
-          <el-select filterable  v-model="queryParams.isAfterSales" placeholder="请选择是否申请售后"  clearable size="small">
-            <el-option v-for="(item,index) in liveIsAfterSalesOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue"/>
-          </el-select>
+        <el-form-item label="单价" prop="price">
+          <el-input v-model="form.price" placeholder="请输入单价" />
         </el-form-item>
-        <el-form-item label="是否为处方药" prop="isPrescribe">
-          <el-input v-model="form.isPrescribe" placeholder="请输入是否为处方药" />
+        <el-form-item label="数量" prop="num">
+          <el-input v-model="form.num" placeholder="请输入数量" />
         </el-form-item>
-        <el-form-item label="店铺ID" prop="storeId">
-          <el-input v-model="form.storeId" placeholder="请输入店铺ID" />
+        <el-form-item label="状态 1正常 2已退款">
+          <el-radio-group v-model="form.status">
+            <el-radio label="1">请选择字典生成</el-radio>
+          </el-radio-group>
         </el-form-item>
-        <el-form-item label="是否赠品" prop="isGift">
-          <el-input v-model="form.isGift" placeholder="请输入是否赠品" />
+        <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" placeholder="请输入备注" />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -203,14 +182,12 @@
 </template>
 
 <script>
-import { listLiveOrderItem, getLiveOrderItem, delLiveOrderItem, addLiveOrderItem, updateLiveOrderItem, exportLiveOrderItem } from "@/api/live/liveOrderitems";
+import { listLiveOrderitems, getLiveOrderitems, delLiveOrderitems, addLiveOrderitems, updateLiveOrderitems, exportLiveOrderitems } from "@/api/live/liveOrderitems";
 
 export default {
-  name: "LiveOrderItem",
+  name: "LiveOrderitems",
   data() {
     return {
-      //字典
-      liveIsAfterSalesOptions: [],
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -225,8 +202,8 @@ export default {
       showSearch: true,
       // 总条数
       total: 0,
-      // 订单详情表格数据
-      liveOrderItemList: [],
+      // 订单商品表格数据
+      liveOrderitemsList: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -235,54 +212,34 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        orderId: null,
-        orderCode: null,
-        cartId: null,
         goodsId: null,
-        productId: null,
-        productAttrValueId: null,
-        jsonInfo: null,
+        orderId: null,
+        goodsJson: null,
+        goodsName: null,
+        price: null,
         num: null,
-        isAfterSales: null,
-        isPrescribe: null,
-        storeId: null,
-        isGift: null
+        status: null,
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
-        orderId: [
-          { required: true, message: "订单id不能为空", trigger: "blur" }
-        ],
-        cartId: [
-          { required: true, message: "购物车ID不能为空", trigger: "blur" }
-        ],
-        productId: [
-          { required: true, message: "商品ID不能为空", trigger: "blur" }
-        ],
       }
     };
   },
   created() {
     this.getList();
-    this.getDicts("sys_live_is_after_sales").then(response => {
-      this.liveIsAfterSalesOptions = response.data;
-    });
   },
   methods: {
-    /** 查询订单详情列表 */
+    /** 查询订单商品列表 */
     getList() {
       this.loading = true;
-      listLiveOrderItem(this.queryParams).then(response => {
-        this.liveOrderItemList = response.rows;
+      listLiveOrderitems(this.queryParams).then(response => {
+        this.liveOrderitemsList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
     },
-    liveIsAfterSalesFormatter(row, column) {
-      return this.selectDictLabel(this.liveIsAfterSalesOptions, row.status);
-    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -291,19 +248,19 @@ export default {
     // 表单重置
     reset() {
       this.form = {
-        itemId: null,
-        orderId: null,
-        orderCode: null,
-        cartId: null,
+        id: null,
         goodsId: null,
-        productId: null,
-        productAttrValueId: null,
-        jsonInfo: null,
+        orderId: null,
+        goodsJson: null,
+        goodsName: null,
+        price: null,
         num: null,
-        isAfterSales: null,
-        isPrescribe: null,
-        storeId: null,
-        isGift: null
+        status: 0,
+        createTime: null,
+        createBy: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
       };
       this.resetForm("form");
     },
@@ -319,7 +276,7 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.itemId)
+      this.ids = selection.map(item => item.id)
       this.single = selection.length!==1
       this.multiple = !selection.length
     },
@@ -327,30 +284,30 @@ export default {
     handleAdd() {
       this.reset();
       this.open = true;
-      this.title = "添加订单详情";
+      this.title = "添加订单商品";
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const itemId = row.itemId || this.ids
-      getLiveOrderItem(itemId).then(response => {
+      const id = row.id || this.ids
+      getLiveOrderitems(id).then(response => {
         this.form = response.data;
         this.open = true;
-        this.title = "修改订单详情";
+        this.title = "修改订单商品";
       });
     },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          if (this.form.itemId != null) {
-            updateLiveOrderItem(this.form).then(response => {
+          if (this.form.id != null) {
+            updateLiveOrderitems(this.form).then(response => {
               this.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addLiveOrderItem(this.form).then(response => {
+            addLiveOrderitems(this.form).then(response => {
               this.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -361,13 +318,13 @@ export default {
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const itemIds = row.itemId || this.ids;
-      this.$confirm('是否确认删除订单详情编号为"' + itemIds + '"的数据项?', "警告", {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除订单商品编号为"' + ids + '"的数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
         }).then(function() {
-          return delLiveOrderItem(itemIds);
+          return delLiveOrderitems(ids);
         }).then(() => {
           this.getList();
           this.msgSuccess("删除成功");
@@ -376,13 +333,13 @@ export default {
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有订单详情数据项?', "警告", {
+      this.$confirm('是否确认导出所有订单商品数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           type: "warning"
         }).then(() => {
           this.exportLoading = true;
-          return exportLiveOrderItem(queryParams);
+          return exportLiveOrderitems(queryParams);
         }).then(response => {
           this.download(response.msg);
           this.exportLoading = false;

+ 30 - 45
src/views/live/liveRedConf/index.vue

@@ -10,15 +10,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="有效时间 单位:分" prop="duration">
-        <el-input
-          v-model="queryParams.duration"
-          placeholder="请输入有效时间 单位:分"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item label="红包类型 1:主播发起 2:事件红包" prop="redType">
         <el-select v-model="queryParams.redType" placeholder="请选择红包类型 1:主播发起 2:事件红包" clearable size="small">
           <el-option label="请选择字典生成" value="" />
@@ -33,33 +24,6 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="红包数量" prop="redNum">
-        <el-input
-          v-model="queryParams.redNum"
-          placeholder="请输入红包数量"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="可中奖份量" prop="totalLots">
-        <el-input
-          v-model="queryParams.totalLots"
-          placeholder="请输入可中奖份量"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="实际发放奖励份量" prop="totalSend">
-        <el-input
-          v-model="queryParams.totalSend"
-          placeholder="请输入实际发放奖励份量"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
       <el-form-item label="描述" prop="desc">
         <el-input
           v-model="queryParams.desc"
@@ -69,6 +33,22 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="创建日期" prop="createTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.createTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择创建日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="修改日期" prop="udpateTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.udpateTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择修改日期">
+        </el-date-picker>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -138,11 +118,13 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="修改日期" align="center" prop="updateBy" width="180">
+      <el-table-column label="修改日期" align="center" prop="udpateTime" width="180">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updateBy, '{y}-{m}-{d}') }}</span>
+          <span>{{ parseTime(scope.row.udpateTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
+      <el-table-column label="创建人" align="center" prop="createBy" />
+      <el-table-column label="修改人" align="center" prop="updateBy" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -177,6 +159,14 @@
         <el-form-item label="有效时间 单位:分" prop="duration">
           <el-input v-model="form.duration" placeholder="请输入有效时间 单位:分" />
         </el-form-item>
+        <el-form-item label="红包类型 1:主播发起 2:事件红包" prop="redType">
+          <el-select v-model="form.redType" placeholder="请选择红包类型 1:主播发起 2:事件红包">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="直播间ID" prop="liveId">
+          <el-input v-model="form.liveId" placeholder="请输入直播间ID" />
+        </el-form-item>
         <el-form-item label="红包数量" prop="redNum">
           <el-input v-model="form.redNum" placeholder="请输入红包数量" />
         </el-form-item>
@@ -227,13 +217,11 @@ export default {
         pageNum: 1,
         pageSize: 10,
         redStauts: null,
-        duration: null,
         redType: null,
         liveId: null,
-        redNum: null,
-        totalLots: null,
-        totalSend: null,
         desc: null,
+        createTime: null,
+        udpateTime: null,
       },
       // 表单参数
       form: {},
@@ -254,9 +242,6 @@ export default {
         totalLots: [
           { required: true, message: "可中奖份量不能为空", trigger: "blur" }
         ],
-        totalSend: [
-          { required: true, message: "实际发放奖励份量不能为空", trigger: "blur" }
-        ],
         desc: [
           { required: true, message: "描述不能为空", trigger: "blur" }
         ],

+ 41 - 16
src/views/live/liveUserLotteryRecord/index.vue

@@ -1,6 +1,41 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="直播间ID" prop="liveId">
+        <el-input
+          v-model="queryParams.liveId"
+          placeholder="请输入直播间ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="中奖用户ID" prop="userId">
+        <el-input
+          v-model="queryParams.userId"
+          placeholder="请输入中奖用户ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="商品ID" prop="productId">
+        <el-input
+          v-model="queryParams.productId"
+          placeholder="请输入商品ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="创建日期" prop="createTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.createTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择创建日期">
+        </el-date-picker>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -56,7 +91,7 @@
 
     <el-table border v-loading="loading" :data="liveUserLotteryRecordList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="修改日期" align="center" prop="id" />
+      <el-table-column label="创建日期" align="center" prop="id" />
       <el-table-column label="抽奖ID" align="center" prop="lotteryId" />
       <el-table-column label="直播间ID" align="center" prop="liveId" />
       <el-table-column label="中奖用户ID" align="center" prop="userId" />
@@ -66,21 +101,7 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="修改日期" align="center" prop="udpateTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.udpateTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="创建日期" align="center" prop="createBy" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createBy, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改日期" align="center" prop="updateBy" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updateBy, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
+      <el-table-column label="创建人" align="center" prop="createBy" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -152,6 +173,10 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        liveId: null,
+        userId: null,
+        productId: null,
+        createTime: null,
       },
       // 表单参数
       form: {},

+ 31 - 16
src/views/live/liveUserRedRecord/index.vue

@@ -1,6 +1,32 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="直播间ID" prop="liveId">
+        <el-input
+          v-model="queryParams.liveId"
+          placeholder="请输入直播间ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="中奖用户ID" prop="userId">
+        <el-input
+          v-model="queryParams.userId"
+          placeholder="请输入中奖用户ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="创建日期" prop="createTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.createTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择创建日期">
+        </el-date-picker>
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -56,7 +82,7 @@
 
     <el-table border v-loading="loading" :data="liveUserRedRecordList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="修改日期" align="center" prop="id" />
+      <el-table-column label="创建日期" align="center" prop="id" />
       <el-table-column label="抽奖ID" align="center" prop="redId" />
       <el-table-column label="直播间ID" align="center" prop="liveId" />
       <el-table-column label="中奖用户ID" align="center" prop="userId" />
@@ -66,21 +92,7 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="修改日期" align="center" prop="udpateTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.udpateTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="创建日期" align="center" prop="createBy" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createBy, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="修改日期" align="center" prop="updateBy" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.updateBy, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
+      <el-table-column label="创建人" align="center" prop="createBy" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
@@ -152,6 +164,9 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
+        liveId: null,
+        userId: null,
+        createTime: null,
       },
       // 表单参数
       form: {},

+ 6 - 14
src/views/live/words/index.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="需要过滤的敏感词" prop="word">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
+      <el-form-item label="敏感词" prop="word">
         <el-input
           v-model="queryParams.word"
           placeholder="请输入需要过滤的敏感词"
@@ -10,7 +10,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="敏感词添加时间" prop="createdAt">
+      <el-form-item label="敏感词添加时间" prop="createdAt" label-width="120px">
         <el-date-picker clearable size="small"
           v-model="queryParams.createdAt"
           type="date"
@@ -110,18 +110,10 @@
 
     <!-- 添加或修改直播间敏感词过滤对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="需要过滤的敏感词" prop="word">
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="敏感词" prop="word">
           <el-input v-model="form.word" placeholder="请输入需要过滤的敏感词" />
         </el-form-item>
-        <el-form-item label="敏感词添加时间" prop="createdAt">
-          <el-date-picker clearable size="small"
-            v-model="form.createdAt"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="选择敏感词添加时间">
-          </el-date-picker>
-        </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -132,7 +124,7 @@
 </template>
 
 <script>
-import { listWords, getWords, delWords, addWords, updateWords, exportWords } from "@/api/live/words";
+import {listWords, getWords, delWords, addWords, updateWords, exportWords} from "@/api/live/words";
 
 export default {
   name: "Words",