yuhongqi 3 месяцев назад
Родитель
Сommit
9049ff6dcf

+ 28 - 2
src/api/live/live.js

@@ -60,9 +60,9 @@ export function selectLiveToStudent(query) {
   })
 }
 
-export function selectCompanyTalent(query) {
+export function selectCompanyTalent() {
   return request({
-    url: '/company/user/selectCompanyTalent/' + query,
+    url: '/live/live/selectCompanyTalent',
     method: 'get'
   })
 }
@@ -81,3 +81,29 @@ export function updateLiveIsAudit(data) {
     data: data
   })
 }
+
+//上下架视频
+export function handleShelfOrUn(data) {
+  return request({
+    url: '/live/live/handleShelfOrUn',
+    method: 'post',
+    data: data
+  })
+}
+
+
+export function handleDeleteSelected(data) {
+  return request({
+    url: '/live/live/handleDeleteSelected',
+    method: 'post',
+    data: data
+  })
+}
+
+export function verifyIdInfo(data) {
+  return request({
+    url: '/live/live/verifyIdInfo',
+    method: 'post',
+    data: data
+  })
+}

+ 34 - 0
src/api/live/liveGoods.js

@@ -34,6 +34,14 @@ export function updateLiveGoods(data) {
     data: data
   })
 }
+// 修改直播商品
+export function updateGoodsStock(data) {
+  return request({
+    url: '/live/liveGoods',
+    method: 'put',
+    data: data
+  })
+}
 
 // 删除直播商品
 export function delLiveGoods(goodsId) {
@@ -60,3 +68,29 @@ export function listStoreProduct(data) {
     params: data
   })
 }
+
+//上下架商品
+export function handleShelfOrUn(data) {
+  return request({
+    url: '/live/liveGoods/handleShelfOrUn',
+    method: 'post',
+    data: data
+  })
+}
+
+
+export function handleDeleteSelected(data) {
+  return request({
+    url: '/live/liveGoods/handleDeleteSelected',
+    method: 'post',
+    data: data
+  })
+}
+
+export function handleIsShowChange(data) {
+  return request({
+    url: '/live/liveGoods/handleIsShowChange',
+    method: 'post',
+    data: data
+  })
+}

+ 44 - 2
src/api/live/liveOrder.js

@@ -12,7 +12,7 @@ export function listLiveOrder(query) {
 // 查询订单详细
 export function getLiveOrder(orderId) {
   return request({
-    url: '/live/liveOrder/' + orderId,
+    url: '/live/liveOrder/info/' + orderId,
     method: 'get'
   })
 }
@@ -29,7 +29,7 @@ export function addLiveOrder(data) {
 // 修改订单
 export function updateLiveOrder(data) {
   return request({
-    url: '/live/liveOrder',
+    url: '/live/liveOrder/update',
     method: 'put',
     data: data
   })
@@ -59,3 +59,45 @@ export function getExpress(orderId) {
   })
 }
 
+// 获取表格 时间粒度
+export function getLiveOrderTimeGranularity(query) {
+  return request({
+    url: '/live/liveOrder/getLiveOrderTimeGranularity',
+    method: 'get',
+    params: query
+  })
+}
+
+
+// 同步快递信息
+export function syncExpress(orderId) {
+  return request({
+    url: '/live/liveOrder/syncExpress/' + orderId,
+    method: 'get'
+  })
+}
+
+
+export function updateErp(data) {
+  return request({
+    url: '/live/liveOrder/updateErpOrder',
+    method: 'post',
+    data: data
+  })
+}
+
+export function listOrderitem(orderId) {
+  return request({
+    url: '/live/liveOrder/ltemlist/' + orderId,
+    method: 'get'
+  })
+}
+
+export function tuiOrder(data) {
+  return request({
+    url: '/live/liveOrder/tuiOrder',
+    method: 'put',
+    data: data
+  })
+}
+

+ 8 - 0
src/api/live/liveWatchUser.js

@@ -17,3 +17,11 @@ export function changeUserStatus(query) {
     params: query
   })
 }
+
+// 直播间用户禁言
+export function blockUser(query) {
+  return request({
+    url: '/live/liveWatchUser/blockUser/' + query,
+    method: 'get',
+  })
+}

+ 53 - 0
src/api/live/task.js

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询直播间自动化任务配置列表
+export function listTask(query) {
+  return request({
+    url: '/live/task/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询直播间自动化任务配置详细
+export function getTask(id) {
+  return request({
+    url: '/live/task/' + id,
+    method: 'get'
+  })
+}
+
+// 新增直播间自动化任务配置
+export function addTask(data) {
+  return request({
+    url: '/live/task',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改直播间自动化任务配置
+export function updateTask(data) {
+  return request({
+    url: '/live/task',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除直播间自动化任务配置
+export function delTask(id) {
+  return request({
+    url: '/live/task/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出直播间自动化任务配置
+export function exportTask(query) {
+  return request({
+    url: '/live/task/export',
+    method: 'get',
+    params: query
+  })
+}

BIN
src/assets/images/videoIsAudit.png


BIN
src/assets/images/videoNotStart.png


+ 276 - 0
src/components/LiveVideoUpload/index.vue

@@ -0,0 +1,276 @@
+<template>
+  <div>
+    <el-form-item label="视频上传">
+      <div class="upload_video" id="upload_video">
+        <el-upload
+          ref="upload"
+          action="#"
+          :http-request="uploadVideoToTxPcdn"
+          accept=".mp4"
+          :limit="1"
+          :on-remove="handleRemove"
+          :on-change="handleChange"
+          :auto-upload="false"
+          :key="uploadKey"
+        >
+          <el-button slot="trigger" size="small" type="primary">选取视频</el-button>
+          <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">点击上传</el-button>
+          <!-- 线路一 -->
+          <div class="progress-container" style="width:100% !important;">
+            <span class="progress-label">线路一</span>
+            <el-progress
+              style="margin-top: 5px;"
+              class="progress"
+              :text-inside="true"
+              :stroke-width="18"
+              :percentage="txProgress"
+              status="success">
+            </el-progress>
+          </div>
+
+          <!-- 线路二 -->
+          <!--          <div class="progress-container">-->
+          <!--            <span class="progress-label">线路er</span>-->
+          <!--            <el-progress-->
+          <!--              style="margin-top: 5px;"-->
+          <!--              class="progress"-->
+          <!--              :text-inside="true"-->
+          <!--              :stroke-width="18"-->
+          <!--              :percentage="hwProgress"-->
+          <!--              status="success">-->
+          <!--            </el-progress>-->
+          <!--          </div>-->
+          <div slot="tip" class="el-upload__tip">只能上传mp4文件,且不超过500M</div>
+        </el-upload>
+      </div>
+    </el-form-item>
+    <el-form-item label="视频播放">
+      <video v-if="videoUrl" ref="myvideo" :src="videoUrl" id="video" width="100%" height="300px" controls></video>
+      <div v-if="fileName">视频文件名: {{ fileName }}</div>
+      <div v-if="fileKey">文件Key: {{ fileKey }}</div>
+      <div v-if="fileSize">文件大小(MB): {{ (fileSize / (1024 * 1024)).toFixed(2) }} MB</div>
+    </el-form-item>
+    <!-- 仅当showControl为true时显示播放线路选择器 -->
+    <el-form-item v-if="showControl" label="播放线路">
+      <el-radio-group v-model="localUploadType">
+        <el-radio :label="1" >线路一</el-radio>
+        <!--        <el-radio :label="2" >线路二</el-radio>-->
+        <!--        <el-radio :label="3" >线路三</el-radio>-->
+      </el-radio-group>
+    </el-form-item>
+
+  </div>
+</template>
+
+<script>
+import {getSignature, uploadHuaWeiObs, uploadHuaWeiVod} from "@/api/common";
+import {getThumbnail} from "@/api/course/userVideo";
+import TcVod from "vod-js-sdk-v6";
+import { uploadObject } from "@/utils/cos.js";
+import { uploadToOBS } from "@/utils/obs.js";
+import Pagination from "@/components/Pagination";
+import { listVideoResource } from '@/api/course/videoResource';
+
+export default {
+  components: {
+    Pagination
+  },
+  props: {
+    videoUrl: {
+      type: String,
+      default: "",
+    },
+    fileKey: {
+      type: String,
+      default: "",
+    },
+    fileSize: {
+      type: Number,
+      default: null,
+    },
+    fileName: {
+      type: String,
+      default: "",
+    },
+    line_1: {
+      type: String,
+      default: "",
+    },
+    line_2: {
+      type: String,
+      default: "",
+    },
+    line_3: {
+      type: String,
+      default: "",
+    },
+    thumbnail: {
+      type: String,
+      default: "",
+    },
+    uploadType: {
+      type: Number,
+      default: null,
+    },
+    type: {
+      type: Number,
+      default: null,
+    },
+    isPrivate: {
+      type: Number,
+      default: 0,
+    },
+
+    // 使用一个变量控制显示,默认为true显示所有控制项
+    showControl: {
+      type: Boolean,
+      default: false,
+    }
+  },
+  data() {
+    return {
+      videoName:'',
+      isHidden : false,
+      localUploadType: this.uploadType,
+      duration: 0,
+      fileId: "",
+      uploadTypeOptions: [
+        { dictLabel: "线路一", dictValue: 1 }, // 腾讯pcdn
+        // { dictLabel: "线路二", dictValue: 2 }, // 华为云obs
+        // { dictLabel: "华为云VOD", dictValue: 4 },
+        // { dictLabel: "腾讯云VOD", dictValue: 5 },
+      ],
+      fileList: [],
+      txProgress: 0,
+      hwProgress: 0,
+      uploadLoading: false,
+      uploadKey: 0,
+    };
+  },
+  watch: {
+    localUploadType(newType) {
+      this.$emit("update:uploadType", newType);
+      this.$emit("change");
+    },
+    uploadType(newType) {
+      this.localUploadType = newType;
+    },
+  },
+  methods: {
+
+    handleChange(file, fileList) {
+      this.fileList = fileList;
+      this.getVideoDuration(file.raw);
+    },
+    getVideoDuration(file) {
+      const video = document.createElement("video");
+      video.preload = "metadata";
+      video.onloadedmetadata = () => {
+        window.URL.revokeObjectURL(video.src);
+        this.duration = parseInt(video.duration.toFixed(2));
+        console.log("视频时长=========>", this.duration);
+        this.$emit("video-duration", this.duration);
+        console.log("文件大小=====>", file.size);
+        this.$emit("update:fileSize", file.size);
+      };
+      video.src = URL.createObjectURL(file);
+    },
+    async submitUpload() {
+      if (this.fileList.length < 1) {
+        return this.$message.error("请先选取视频,再进行上传");
+      }
+      //同时上传个线路
+      await this.uploadVideoToTxPcdn();
+      // await this.uploadVideoToHwObs();
+      this.$emit("update:fileName", this.fileList[0].name);
+    },
+    //获取第一帧封面
+    async getFirstThumbnail() {
+      const file = this.fileList[0].raw;
+      getThumbnail(file).then(response => {
+        console.log("获取到第一帧为封面======>", response.url)
+        this.$emit("update:thumbnail", response.url);
+      })
+    },
+    //更新华为线路进度条
+    updateHwProgress(progress) {
+      this.hwProgress = progress;
+    },
+    //更新腾讯线路进度条
+    updateTxProgress(progressData) {
+      this.txProgress = Math.round(progressData.percent * 100);
+    },
+    //上传腾讯云Pcdn
+    async uploadVideoToTxPcdn() {
+      try {
+        const file = this.fileList[0].raw;
+        const data = await uploadObject(file, this.updateTxProgress, this.type);
+        console.log("腾讯COS返回========>", data);
+        console.log("isPrivate=======>", this.isPrivate)
+        let line_1 = '';
+        if (this.isPrivate === 0) {
+          line_1 = `${process.env.VUE_APP_VIDEO_LINE_1}${data.urlPath}`;
+        } else {
+          line_1 = `${process.env.VUE_APP_VIDEO_LINE_1}${data.urlPath}`;
+        }
+
+        let urlPathWithoutFirstSlash = data.urlPath.substring(1);
+        this.$emit("update:fileKey", urlPathWithoutFirstSlash);
+
+        console.log("文件key", urlPathWithoutFirstSlash);
+        console.log("组装URL========>", line_1);
+        this.$emit("update:videoUrl", line_1);
+        this.$emit("update:line_1", line_1);
+        // this.$emit("update:line_2", line_2);
+        this.$message.success("线路一上传成功");
+      } catch (error) {
+        this.$message.error("线路一上传失败");
+      }
+    },
+    //上传华为云Obs
+    async uploadVideoToHwObs() {
+      try {
+        const file = this.fileList[0].raw;
+        const data = await uploadToOBS(file, this.updateHwProgress, this.type);
+        console.log("华为OBS返回========>", data);
+        let line_2 = '';
+        if (this.isPrivate === 0) {
+          line_2 = `${process.env.VUE_APP_VIDEO_LINE_2}/${data.urlPath}`;
+        } else {
+          line_2 = `${process.env.VUE_APP_VIDEO_LINE_2}/${data.urlPath}`;
+        }
+        this.$emit("update:videoUrl", line_2);
+        this.$emit("update:line_2", line_2);
+        this.$message.success("线路二上传成功");
+      } catch (error) {
+        this.$message.error("线路二上传失败");
+      }
+    },
+    handleRemove(file, fileList) {
+      console.log(file, fileList.length);
+    },
+  }
+};
+</script>
+
+<style>
+.progress-container {
+  margin-bottom: 5px; /* 进度条之间的间距 */
+}
+
+.progress-label {
+  display: block;
+  font-weight: bold;
+  font-size: 13px;
+  color: #303331; /* 标签颜色,可以根据需要调整 */
+}
+
+/* 视频库选择对话框样式 */
+.library-search {
+  margin-bottom: 15px;
+}
+
+.el-table .el-table__row:hover {
+  cursor: pointer;
+}
+</style>

+ 30 - 6
src/store/index.js

@@ -20,17 +20,41 @@ const store = new Vuex.Store({
   },
   getters,
   state: {
-    liveWs: null
+    liveWs: {}
   },
   mutations: {
-    setLiveWs(state, ws) {
-      state.liveWs = ws
+    // 更新为支持多个 WebSocket 连接
+    setLiveWs(state, { ws, liveId }) {
+      // 使用 liveId 作为键来存储不同的 WebSocket 连接
+      Vue.set(state.liveWs, liveId, ws);
     },
+    // 添加移除 WebSocket 连接的 mutation
+    removeLiveWs(state, liveId) {
+      Vue.delete(state.liveWs, liveId);
+    }
   },
   actions: {
-    initLiveWs({ commit }, { liveWsUrl, liveId, userId }) {
-      const ws = new LiveWS(liveWsUrl, liveId, userId)
-      commit('setLiveWs', ws)
+    // 修改 action 以正确传递参数
+    initLiveWs({ commit, state }, { liveWsUrl, liveId, userId }) {
+      // 如果已经存在对应 liveId 的连接,先关闭它
+      if (state.liveWs[liveId]) {
+        state.liveWs[liveId].close();
+      }
+
+      // 创建新的 WebSocket 连接
+      const ws = new LiveWS(liveWsUrl, liveId, userId);
+
+      // 提交到 mutation
+      commit('setLiveWs', { ws, liveId });
+
+      return ws;
+    },
+    // 添加关闭特定 WebSocket 连接的 action
+    closeLiveWs({ commit, state }, liveId) {
+      if (state.liveWs[liveId]) {
+        state.liveWs[liveId].close();
+        commit('removeLiveWs', liveId);
+      }
     }
   }
 })

+ 305 - 72
src/views/live/live/index.vue

@@ -1,5 +1,40 @@
 <template>
   <div class="app-container">
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:live:add']"
+        >新增</el-button>
+      </el-col>
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--          type="success"-->
+      <!--          plain-->
+      <!--          icon="el-icon-edit"-->
+      <!--          size="mini"-->
+      <!--          :disabled="single"-->
+      <!--          @click="handleUpdate"-->
+      <!--          v-hasPermi="['live:live:edit']"-->
+      <!--        >修改</el-button>-->
+      <!--      </el-col>-->
+      <!--      <el-col :span="1.5">-->
+      <!--        <el-button-->
+      <!--          type="warning"-->
+      <!--          plain-->
+      <!--          icon="el-icon-download"-->
+      <!--          size="mini"-->
+      <!--          :loading="exportLoading"-->
+      <!--          @click="handleExport"-->
+      <!--          v-hasPermi="['live:live:export']"-->
+      <!--        >导出</el-button>-->
+      <!--      </el-col>-->
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="直播名称" prop="liveName">
         <el-input
@@ -12,50 +47,32 @@
       </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>
+        <!--        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
+        <el-button icon="el-icon-download" size="mini" v-hasPermi="['live:live:export']" @click="handleExport">导出</el-button>
       </el-form-item>
     </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['live:live:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['live:live:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          :loading="exportLoading"
-          @click="handleExport"
-          v-hasPermi="['live:live:export']"
-        >导出</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-table border v-loading="loading" :data="liveList">
+    <div class="selection-toolbar">
+      <el-checkbox :indeterminate="isIndeterminate" v-model="allChecked" @change="toggleSelectAll">
+        {{ multipleSelection.length > 0 ? `已选 ${multipleSelection.length} 条` : '选中本页' }}
+      </el-checkbox>
+      <el-button  plain size="mini" @click="handleShelf">上架</el-button>
+      <el-button  plain size="mini" @click="handleUnshelf">下架</el-button>
+      <el-button  plain size="mini" @click="handleDeleteSelected">删除</el-button>
+      <!--      <el-dropdown>-->
+      <!--        <el-button plain size="mini">-->
+      <!--          更多操作<i class="el-icon-arrow-down el-icon&#45;&#45;right"></i>-->
+      <!--        </el-button>-->
+      <!--        <el-dropdown-menu slot="dropdown">-->
+      <!--          <el-dropdown-item>操作一</el-dropdown-item>-->
+      <!--          <el-dropdown-item>操作二</el-dropdown-item>-->
+      <!--        </el-dropdown-menu>-->
+      <!--      </el-dropdown>-->
+    </div>
+    <el-table ref="liveTable" v-loading="loading" :data="liveList"  @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55"></el-table-column>
       <el-table-column label="直播封面" align="center" prop="liveImgUrl" width="180">
         <template slot-scope="scope">
-          <el-image style="width: 180px;" :src="scope.row.liveImgUrl" mode="aspectFill" :preview-src-list="[scope.row.liveImgUrl]" />
+          <el-image style="width: 90px;height: 90px;" :src="scope.row.liveImgUrl" mode="aspectFill" :preview-src-list="[scope.row.liveImgUrl]" />
         </template>
       </el-table-column>
       <el-table-column label="直播名称" align="center" prop="liveName" />
@@ -72,7 +89,7 @@
           <el-tag v-if="scope.row.status == 3">已结束</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="主播ID" align="center" prop="anchorId" />
+      <el-table-column label="主播ID" align="center" prop="talentId" />
       <el-table-column label="直播类型" align="center" prop="liveType">
         <template slot-scope="scope">
           <el-tag v-if="scope.row.liveType == 1">直播</el-tag>
@@ -84,7 +101,13 @@
       <el-table-column label="上下架" align="center" prop="isShow">
         <template slot-scope="scope">
           <el-tag v-if="scope.row.isShow == 1">上架</el-tag>
-          <el-tag v-if="scope.row.isShow == 2">下架</el-tag>
+          <el-tag type="danger" v-if="scope.row.isShow == 2">下架</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="审核状态" align="center" prop="isAudit">
+        <template slot-scope="scope">
+          <el-tag type="danger" v-if="scope.row.isAudit == 0">审核未通过</el-tag>
+          <el-tag v-if="scope.row.isAudit == 1">审核通过</el-tag>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
@@ -99,31 +122,41 @@
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['live:live:remove']"
-          >删除</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-monitor"
+            icon="el-icon-setting"
             @click="handleConfig(scope.row)"
             v-hasPermi="['live:config:list']"
           >配置</el-button>
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-monitor"
+            icon="el-icon-service"
             @click="handleManage(scope.row)"
             v-hasPermi="['live:console:list']"
-          >管理</el-button>
+          >进入直播间</el-button>
           <el-button
             size="mini"
             type="text"
-            icon="el-icon-monitor"
+            icon="el-icon-setting"
             @click="handleAudit(scope.row)"
-            v-hasPermi="['live:console:edit']"
+            v-hasPermi="['live:config:list']"
           >审核</el-button>
+          <el-button
+            v-if="scope.row.status == 2 && scope.row.liveType == 1"
+            size="mini"
+            type="text"
+            icon="el-icon-set-up"
+            @click="showLivingUrl(scope.row)"
+            v-hasPermi="['live:live:remove']"
+          >推流码</el-button>
+<!--          <el-button-->
+<!--            v-if="scope.row.status == 2"-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-switch-button"-->
+<!--            @click="handleEnded(scope.row)"-->
+<!--            v-hasPermi="['live:config:edit']"-->
+<!--          >结束</el-button>-->
+
         </template>
       </el-table-column>
     </el-table>
@@ -149,13 +182,13 @@
           </el-radio-group>
         </el-form-item>
         <el-form-item label="直播类型" prop="liveType">
-          <el-radio-group disabled v-model="form.liveType">
+          <el-radio-group v-model="form.liveType">
             <el-radio :label="1">直播</el-radio>
             <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-select filterable v-model="form.talentId" placeholder="请选择达人">
             <el-option
               v-for="item in talentList"
               :key="item.talentId"
@@ -168,17 +201,42 @@
           <Editor ref="myeditor" :height="300" @on-text-change="updateText"/>
           <!--          <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']" />
-          <el-button @click="getVideoDuration" v-loading="timeLoading">读取视屏时长</el-button>
-          <p style="margin: 0;padding: 0;" v-loading="timeLoading">视屏时长:<span style="color: #ff4949;">{{form.durationTime}}</span></p>
-        </el-form-item>
+<!--        <el-form-item label="录播视屏" prop="videoUrl" v-if="form.liveType == 2">-->
+<!--          <file-upload v-model="form.videoUrl" :limit="1" :file-size="3" :file-type="['mp4']" />-->
+<!--          <el-button @click="getVideoDuration" v-loading="timeLoading">读取视屏时长</el-button>-->
+<!--          <p style="margin: 0;padding: 0;" v-loading="timeLoading">视屏时长:<span style="color: #ff4949;">{{form.durationTime}}</span></p>-->
+<!--        </el-form-item>-->
+        <video-upload
+          v-if="form.liveType == 2"
+          :type = "1"
+          :isPrivate = "isPrivate"
+          :fileKey.sync = "form.fileKey"
+          :fileSize.sync = "form.fileSize"
+          :videoUrl.sync="videoUrl"
+          :fileName.sync="form.fileName"
+          :line_2.sync="form.lineTwo"
+          :thumbnail.sync="form.thumbnail"
+          :uploadType.sync="form.uploadType"
+          :isTranscode.sync="form.isTranscode"
+          :transcodeFileKey.sync="form.transcodeFileKey"
+          @video-duration="handleVideoDuration"
+          @change="handleVideoChange"
+          ref="videoUpload"
+          append-to-body
+        />
         <el-form-item label="开始时间" prop="startTime">
           <el-date-picker size="small"
                           v-model="form.startTime"
                           @change="timeChange"
                           type="datetime"
+                          format="yyyy-MM-dd HH:mm"
                           value-format="yyyy-MM-dd HH:mm:ss"
+                          :picker-options="{
+                            timePickerOptions: {
+                              selectableRange: '00:00 - 23:59',
+                              format: 'HH:mm'
+                            }
+                          }"
                           placeholder="选择开始时间">
           </el-date-picker>
         </el-form-item>
@@ -186,8 +244,14 @@
           <el-date-picker size="small"
                           v-model="form.finishTime"
                           type="datetime"
-                          disabled
+                          format="yyyy-MM-dd HH:mm"
                           value-format="yyyy-MM-dd HH:mm:ss"
+                          :picker-options="{
+                            timePickerOptions: {
+                              selectableRange: '00:00 - 23:59',
+                              format: 'HH:mm'
+                            }
+                          }"
                           placeholder="视屏播放结束">
           </el-date-picker>
         </el-form-item>
@@ -206,13 +270,25 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+    <el-dialog
+      title="提示"
+      :visible.sync="rtmpUrlVisible"
+      width="30%"
+    >
+      <div>服务器地址:{{serverName}}</div>
+      <div>推流码:{{livingCode}}</div>
+      <span slot="footer" class="dialog-footer">
+    <el-button type="primary" @click="rtmpUrlVisible = false">确 定</el-button>
+  </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { listLive, getLive, delLive, addLive, updateLive, exportLive,selectCompanyTalent,updateLiveIsAudit } from "@/api/live/live";
+import { listLive, getLive, delLive, addLive, updateLive, exportLive,selectCompanyTalent,updateLiveIsAudit,  handleShelfOrUn, handleDeleteSelected, } from "@/api/live/live";
 import Editor from '@/components/Editor/wang';
 import user from '@/store/modules/user';
+import VideoUpload from "@/components/LiveVideoUpload/index.vue";
 
 export default {
   name: "Live",
@@ -220,6 +296,8 @@ export default {
   data() {
     return {
       baseUrl: process.env.VUE_APP_BASE_API,
+      uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
+      isPrivate:null,
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -263,7 +341,11 @@ export default {
         rtmpUrl: null,
       },
       // 表单参数
-      form: {},
+      form: {
+        uploadType: 2,
+        isTranscode:0,
+        transcodeFileKey:null
+      },
       // 表单校验
       rules: {
         liveName: [
@@ -290,13 +372,142 @@ export default {
         talentId: [
           { required: true, message: "不能为空", trigger: "change" }
         ]
-      }
+      },
+      multipleSelection: [],
+      allChecked: false,
+      isIndeterminate: false,
+      rtmpUrlVisible:false,
+      serverName: '',
+      livingCode:'',
+      videoUrl: "",
     };
   },
   created() {
     this.getList();
   },
   methods: {
+    beforeAvatarUpload(file) {
+      const isLt1M = file.size / 1024 / 1024 < 1;
+      if (!isLt1M) {
+        this.$message.error('上传图片大小不能超过 1MB!');
+      }
+      return   isLt1M;
+    },
+    handleAvatarSuccess(res, file) {
+      if(res.code==200){
+        this.form.thumbnail=res.url;
+        this.$forceUpdate()
+      }
+      else{
+        this.msgError(res.msg);
+      }
+    },
+    handleVideoDuration(duration) {
+      this.form.duration = duration;
+    },
+    handleVideoChange(){
+      console.log(this.videoUrl)
+      if(this.form.uploadType==1){
+        this.videoUrl = this.form.lineOne;
+      }else if(this.form.uploadType==2){
+        this.videoUrl = this.form.lineTwo;
+        this.form.videoUrl = this.form.lineTwo;
+      }else if(this.form.uploadType==3){
+        this.videoUrl = this.form.lineThree;
+      }
+      console.log(this.videoUrl)
+    },
+    showLivingUrl(row){
+      this.serverName=''
+      this.livingCode=''
+      this.rtmpUrlVisible = true
+      this.serverName = row.rtmpUrl.slice(0,row.rtmpUrl.lastIndexOf('/') + 1)
+      this.livingCode = row.rtmpUrl.slice(row.rtmpUrl.lastIndexOf('/') + 1)
+    },
+    handleShelf(){
+      if (this.multipleSelection.length > 0) {
+        var liveList = []
+        this.multipleSelection.forEach(item => {
+          liveList.push(item.liveId);
+        })
+        handleShelfOrUn({"liveIds":liveList,"isShow":1}).then(res=>{
+          if (res.code == 200) {
+            this.getList();
+            this.$refs.liveTable.clearSelection();
+          } else {
+            this.$message.error(res.msg);
+          }
+        })
+      } else {
+        this.$message.info("请选择上架直播!")
+      }
+
+    },
+    handleUnshelf(){
+      if (this.multipleSelection.length > 0) {
+        var liveList = []
+        this.multipleSelection.forEach(item => {
+          console.log(typeof(item.liveId))
+          console.log(item.liveId)
+          liveList.push(item.liveId);
+        })
+        handleShelfOrUn({"liveIds":liveList,"isShow":2}).then(res=>{
+          if (res.code == 200) {
+            this.getList();
+            this.$refs.liveTable.clearSelection();
+          } else {
+            this.$message.error(res.msg);
+          }
+        })
+      } else {
+        this.$message.info("请选择下架直播!")
+      }
+    },
+    handleDeleteSelected(){
+      if (this.multipleSelection.length > 0) {
+        var liveList = []
+        this.multipleSelection.forEach(item => {
+          liveList.push(item.liveId);
+        })
+        handleDeleteSelected({"liveIds":liveList}).then(res=>{
+          if (res.code == 200) {
+            this.getList();
+            this.$refs.liveTable.clearSelection();
+          } else {
+            this.$message.error(res.msg);
+          }
+        })
+      } else {
+        this.$message.info("请选择被删除的直播!")
+      }
+    },
+    // 全选或取消全选
+    toggleSelectAll(val) {
+      this.checked = val; // 更新 checkbox 的状态
+      if (val) {
+        // 如果 checkbox 被选中,则全选
+        this.toggleSelection(this.liveList);
+      } else {
+        // 如果 checkbox 被取消选中,则取消全选
+        this.toggleSelection();
+      }
+    },
+    toggleSelection(rows) {
+      if (rows && !this.isIndeterminate) {
+        rows.forEach(row => {
+          this.$refs.liveTable.toggleRowSelection(row);
+        });
+      } else {
+        this.$refs.liveTable.clearSelection();
+      }
+    },
+    // 多选框选中数据
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+      // 根据选择项的数量更新 checkbox 的状态
+      this.allChecked = val.length === this.liveList.length;
+      this.isIndeterminate = val.length > 0 && val.length < this.liveList.length;
+    },
     /** 查询直播列表 */
     getList() {
       this.loading = true;
@@ -371,7 +582,10 @@ export default {
         showType: 1,
         liveType: 2,
         isShow: 1,
+        isTranscode:0,
+        transcodeFileKey:null
       };
+      this.videoUrl = "";
       this.resetForm("form");
     },
     /** 搜索按钮操作 */
@@ -384,17 +598,11 @@ export default {
       this.resetForm("queryForm");
       this.handleQuery();
     },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.liveId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
       this.open = true;
-      selectCompanyTalent(user.state.user.companyId).then(res=>{
+      selectCompanyTalent().then(res=>{
         this.talentList = res.rows;
       });
       setTimeout(() => {
@@ -414,6 +622,7 @@ export default {
       const liveId = row.liveId || this.ids
       getLive(liveId).then(response => {
         this.form = response.data;
+        this.videoUrl = this.form.videoUrl;
         if(this.form.duration){
           this.form.durationTime = this.secondsToTime(this.form.duration)
         }
@@ -430,8 +639,11 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
+      if(this.form.liveId != null) { this.videoUrl = this.form.videoUrl; }
+      if(this.form.liveType==2 && this.videoUrl.length == 0) {return this.$message.error("请上传视频");}
       this.$refs["form"].validate(valid => {
         if (valid) {
+          this.form.videoUrl = this.videoUrl;
           if (this.form.liveId != null) {
             updateLive(this.form).then(response => {
               this.msgSuccess("修改成功");
@@ -482,7 +694,10 @@ export default {
           if(action === 'confirm') isAudit = 1;
           if("confirm" === action || "cancel" === action){
             updateLiveIsAudit( {"liveId" : row.liveId, "isAudit" : isAudit}).then(res => {
+              console.log(res)
+              console.log(res>0)
               if (res > 0) {
+                this.getList()
                 this.$message.success("审核成功")
               }else {
                 this.$message.error(res.msg)
@@ -510,3 +725,21 @@ export default {
   }
 };
 </script>
+
+<style scoped>
+.selection-toolbar {
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+  padding-left: 10px;
+}
+
+.selection-toolbar .el-checkbox {
+  margin-right: 10px;
+}
+
+/* 调整 checkbox 内部输入框的对齐 */
+.selection-toolbar .el-checkbox .el-checkbox__inner {
+  top: 8px; /* 根据实际需求调整 */
+}
+</style>

+ 260 - 0
src/views/live/liveConfig/answer.vue

@@ -0,0 +1,260 @@
+<template>
+  <div class="container-md">
+    <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>
+</template>
+
+<script>
+
+import {addLiveQuestionLive, listLiveQuestionLive, listLiveQuestionOptionList} from "@/api/live/liveQuestionLive";
+
+export default {
+  data() {
+    return {
+      questionDialogVisible: false,
+      questionLoading: false,
+      questionTotal: 0,
+      selectedQuestions: [],
+      questionLiveList: [],
+      questionList: [],
+      loading: true,
+      searchTitle: '',
+      total: 0,
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        title: null,
+        liveId: null
+      },
+      questionParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null
+      },
+    };
+  },
+  created() {
+    this.liveId = this.$route.params.liveId
+    this.queryParams.liveId = this.liveId
+    this.questionParams.liveId = this.liveId
+    this.getLiveQuestionLiveList()
+  },
+  methods: {
+    handleQuestionSearch() {
+      this.queryParams.pageNum = 1
+      this.queryParams.title = this.searchTitle
+      this.getQuestionList()
+    },
+    getLiveQuestionLiveList() {
+      this.loading = true
+      listLiveQuestionLive(this.questionParams).then(response => {
+        this.questionLiveList = response.rows
+        this.questionTotal = response.total
+        this.loading = false
+      })
+    },
+    handleToQuestionBank() {
+      this.$router.push('/live/liveQuestionBank')
+    },
+    handleAddQuestion() {
+      this.questionDialogVisible = true
+      this.getQuestionList()
+    },
+    getQuestionList() {
+      this.questionLoading = true
+      listLiveQuestionOptionList(this.queryParams).then(response => {
+        this.questionList = response.rows
+        this.total = response.total
+        this.questionLoading = false
+      })
+    },
+    handleSelectionChange(selection) {
+      this.selectedQuestions = selection
+    },
+    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()
+      })
+    },
+    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)
+    },
+  }
+};
+</script>

+ 506 - 0
src/views/live/liveConfig/goods.vue

@@ -0,0 +1,506 @@
+<template>
+  <div class="el-container-md">
+
+    <div class="selection-toolbar">
+      <el-checkbox :indeterminate="isIndeterminate" v-model="allChecked" @change="toggleSelectAll">
+        {{ multipleSelection.length > 0 ? `已选 ${multipleSelection.length} 条` : '选中本页' }}
+      </el-checkbox>
+      <el-button  plain size="mini" @click="handleShelf">上架</el-button>
+      <el-button  plain size="mini" @click="handleUnshelf">下架</el-button>
+      <el-button  plain size="mini" @click="handleDeleteSelected">删除</el-button>
+      <el-button  plain type="mini" icon="el-icon-plus" @click="handleAddLiveGoods">添加商品</el-button>
+    </div>
+    <el-table
+      ref="goodTable"
+      :data="goodsLiveList"
+      style="width: 100%; "
+      v-loading="loading"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55"></el-table-column>
+      <!-- 题干列:显示试题的主要内容 -->
+      <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
+        prop="isShow"
+        label="显示状态"
+      >
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.isShow"
+            @click.native.capture.prevent="handleSwitchClick(scope.row)"
+            active-color="#13ce66"
+            inactive-color="#ff4949">
+          </el-switch>
+        </template>
+      </el-table-column>
+
+      <el-table-column
+        prop="status"
+        label="上下架"
+      >
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.status == 1">上架</el-tag>
+          <el-tag v-if="scope.row.status == 0">下架</el-tag>
+        </template>
+      </el-table-column>
+
+      <!-- 操作列:包含编辑和删除按钮 -->
+      <el-table-column
+        label="操作"
+        width="180"
+        fixed="right"
+      >
+        <template slot-scope="scope">
+          <el-button
+            type="text"
+            size="small"
+            style="color: #0066FF;"
+            @click="handleGoodStock(scope.row)"
+          >调整库存</el-button>
+          <el-button
+            type="text"
+            size="small"
+            style="color: #F56C6C;"
+            @click="handleGoodDelete(scope.row)"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 分页组件:用于分页展示试题列表 -->
+    <pagination
+      v-show="goodsLiveTotal > 0"
+      :total="goodsLiveTotal"
+      :page.sync="goodsParams.pageNum"
+      :limit.sync="goodsParams.pageSize"
+      @pagination="getLiveGoodsList"
+      style="margin-top: 20px;background-color: inherit;"
+    />
+
+    <!-- 添加商品弹窗 -->
+    <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
+          :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="goodsTotal > 0"
+          :total="goodsTotal"
+          :page.sync="queryGoodParams.pageNum"
+          :limit.sync="queryGoodParams.pageSize"
+          @pagination="getStoreProductLists"
+          style="margin-top: 20px;"
+        />
+      </div>
+      <div slot="footer" class="dialog-footer" style="background-color: inherit;">
+        <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>
+    <el-dialog
+      title="调整库存"
+      :visible.sync="stockDialogVisible"
+      width="400px"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+    >
+      <el-form :model="stockForm" ref="stockForm" :rules="stockRules">
+        <el-form-item label="调整后库存" prop="newStock">
+          <el-input-number
+            v-model="stockForm.stock"
+            :min="0"
+            :max="999999"
+            controls-position="right"
+            style="width: 100%;"
+          ></el-input-number>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="stockDialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="confirmStockChange">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {addLiveGoods, delLiveGoods, listLiveGoods, listStoreProduct, handleShelfOrUn, handleDeleteSelected,handleIsShowChange,updateGoodsStock} from "@/api/live/liveGoods";
+
+export default {
+  data() {
+    return {
+      liveId: '',
+      loading: true,
+      searchTitle: '',
+      queryGoodParams: {
+        pageNum: 1,
+        pageSize: 10,
+        productName: null,
+        liveId: null,
+        storeId: null
+      },
+      goodsLiveList: [],
+      goodsLiveTotal: 0,
+      goodsParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null
+      },
+      goodsList: [],
+      goodsTotal: 0,
+      selectedGoods: [],
+      goodsLoading: false,
+      goodsDialogVisible: false,
+      multipleSelection: [],
+      allChecked: false,
+      isIndeterminate: false,
+      socket: null,
+      stockDialogVisible: false,
+      stockForm: {
+        goodsId: '',
+        stock: 0
+      },
+      stockRules: {
+        stock: [
+          { required: true, message: '请输入库存数量', trigger: 'blur' },
+          { type: 'number', min: 0, message: '库存数量不能小于0', trigger: 'blur' }
+        ]
+      }
+    };
+  },
+  created() {
+    if (this.$route.params.liveId) {
+      this.liveId = this.$route.params.liveId;
+    }else {
+      this.liveId = this.$route.query.liveId;
+    }
+    this.goodsParams.liveId = this.liveId
+    this.getLiveGoodsList();
+    this.socket = this.$store.state.liveWs[this.liveId]
+  },
+  methods: {
+    handleSwitchClick(row) {
+      // 1. 获取「即将切换到的目标状态」(当前状态取反)
+      const targetStatus = !row.isShow
+      const goodsList = [row.goodsId];
+      handleIsShowChange({"goodsIds":goodsList,"isShow":targetStatus,"liveId":this.liveId}).then(res=>{
+        if(res.code == 200){
+          row.isShow = res.isShow
+          if (res.msg == "目前仅支持单一物品展示") {
+            this.$message.error(res.msg)
+          } else if(res.isShow){
+            if (this.socket == null) {
+              this.$message.error("请从直播间开启展示状态!");
+            } else {
+              const msg = {
+                cmd: 'goods',
+                data: {"liveId":this.liveId,"goodsId":goodsList[0]}
+              }
+              this.$store.state.liveWs[this.liveId].send(JSON.stringify(msg));
+            }
+          }
+        }
+      })
+    },
+    handleShelf(){
+      this.handleShelfOrUn(1)
+    },
+    handleUnshelf(){
+      this.handleShelfOrUn(0)
+    },
+    handleShelfOrUn(type){
+      if (this.multipleSelection.length > 0) {
+        const goodsList = this.getSelectedList();
+        handleShelfOrUn({"goodsIds":goodsList,"status":type,"liveId":this.liveId}).then(res=>{
+          this.dealResult(res)
+        })
+      } else {
+        this.$message.info("请选择下架商品!")
+      }
+    },
+    handleDeleteSelected(){
+      if (this.multipleSelection.length > 0) {
+        const goodsList = this.getSelectedList();
+        handleDeleteSelected({"goodsIds":goodsList,"liveId":this.liveId}).then(res=>{
+          this.dealResult(res)
+        })
+      } else {
+        this.$message.info("请选择被删除的商品!")
+      }
+    },
+    dealResult(res){
+      if (res.code == 200) {
+        this.getLiveGoodsList();
+        this.$refs.goodTable.clearSelection();
+      } else {
+        this.$message.error(res.msg);
+      }
+    },
+    getSelectedList(){
+      var goodsList = []
+      this.multipleSelection.forEach(item => {
+        goodsList.push(item.goodsId);
+      })
+      return goodsList;
+    },
+    // 全选或取消全选
+    toggleSelectAll(val) {
+      this.checked = val; // 更新 checkbox 的状态
+      if (val) {
+        // 如果 checkbox 被选中,则全选
+        this.toggleSelection(this.goodsLiveList);
+      } else {
+        // 如果 checkbox 被取消选中,则取消全选
+        this.toggleSelection();
+      }
+    },
+    toggleSelection(rows) {
+      if (rows && !this.isIndeterminate) {
+        rows.forEach(row => {
+          this.$refs.goodTable.toggleRowSelection(row);
+        });
+      } else {
+        this.$refs.goodTable.clearSelection();
+      }
+    },
+    // 多选框选中数据
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+      // 根据选择项的数量更新 checkbox 的状态
+      this.allChecked = val.length === this.goodsLiveList.length;
+      this.isIndeterminate = val.length > 0 && val.length < this.goodsLiveList.length;
+    },
+
+    getLiveGoodsList() {
+      this.loading = true
+      listLiveGoods(this.goodsParams).then(response => {
+        this.goodsLiveList = response.rows
+        this.goodsLiveTotal = response.total
+        this.loading = false
+      })
+    },
+    handleAddLiveGoods(){
+      this.goodsDialogVisible = true;
+      this.getStoreProductLists()
+    },
+    handleGoodsSearch(){
+      this.queryGoodParams.pageNum = 1
+      this.queryGoodParams.productName = this.searchTitle
+      this.getStoreProductLists()
+    },
+    handleGoodsChange(goods) {
+      this.selectedGoods = goods
+    },
+    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 => {
+        if (response.code !== 200) {
+          this.$message({
+            message: response.msg,
+            type: 'warning'
+          });
+          return;
+        }
+        this.goodsDialogVisible = false;
+        this.getLiveGoodsList()
+      })
+    },
+    handleGoodDelete(row){
+      delLiveGoods(row.goodsId).then(response => {
+        this.getLiveGoodsList()
+      })
+    },
+    /** 处理行点击事件 */
+    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)
+    },
+    getStoreProductLists() {
+      this.queryGoodParams.liveId = this.liveId
+      listStoreProduct(this.queryGoodParams).then(response => {
+        this.goodsList = response.rows
+        this.goodsTotal = response.total
+        this.loading = false
+      })
+    },
+    handleGoodStock(row){
+      this.stockForm.goodsId = row.goodsId;
+      this.stockForm.stock = row.stock;
+      this.stockDialogVisible = true;
+    },
+    // 添加确认修改库存方法
+    confirmStockChange() {
+      this.$refs.stockForm.validate((valid) => {
+        if (valid) {
+          updateGoodsStock({
+            goodsId: this.stockForm.goodsId,
+            stock: this.stockForm.stock
+          }).then(response => {
+            if (response.code === 200) {
+              this.$message.success('库存修改成功');
+              this.stockDialogVisible = false;
+              this.getLiveGoodsList(); // 重新获取列表数据
+            } else {
+              this.$message.error(response.msg || '库存修改失败');
+            }
+          });
+        }
+      });
+    },
+
+  }
+};
+</script >
+
+<style lang="scss" scoped>
+
+.selection-toolbar {
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+  padding-left: 10px;
+  background-color: #f0f2f5;
+}
+
+.selection-toolbar .el-checkbox {
+  margin-right: 10px;
+  background-color: #f0f2f5;
+}
+
+/* 调整 checkbox 内部输入框的对齐 */
+.selection-toolbar .el-checkbox .el-checkbox__inner {
+  top: 8px; /* 根据实际需求调整 */
+  background-color: #f0f2f5;
+}
+/* 1. 让组件根容器继承 app-main 背景 */
+.goods-table-container {
+  background-color: inherit; /* 继承父容器(app-main)的背景色 */
+  padding: 20px; /* 可选:保留内边距,避免内容贴边 */
+}
+
+/* 2. 让 Element UI 容器/表格匹配背景(若其有默认白色背景) */
+.el-container-md {
+  background-color: inherit; /* 取消 el-container 的默认背景 */
+}
+
+.el-table {
+  background-color: inherit; /* 取消 el-table 的默认白色背景(可选,若需要表格透明) */
+  /* 若希望表格有背景,但与 app-main 协调:可改为 app-main 背景色的相近色 */
+  /* background-color: #f8f9fa; */
+}
+::v-deep .app-main .goods-table-container {
+  background-color: #f5f7fa; /* 与 app-main 全局背景统一 */
+}
+</style>

+ 49 - 0
src/views/live/liveConfig/idCard.vue

@@ -0,0 +1,49 @@
+<template>
+  <el-form ref="form"  label-width="80px">
+    <el-form-item>
+      <el-form-item label="上传图片" prop="materialUrl">
+        <img :src="idCardUrl" alt="身份证" style="height: 150px; width: 150px" v-if="idCardUrl.length > 0">
+        <ImageUpload @input="handleUrl" type="image" :num="10" :width="150" :height="150" />
+      </el-form-item>
+      <el-button type="primary" size="mini" @click="submit">保存</el-button>
+    </el-form-item>
+  </el-form>
+</template>
+
+<script>
+import ImageUpload from '@/components/ImageUpload/index';
+import {verifyIdInfo, getLive} from '@/api/live/live'
+
+export default {
+  components: { ImageUpload },
+  data() {
+    return {
+      test: "1test",
+      idCardUrl: "",
+      liveId: null,
+    };
+  },
+  created() {
+    this.liveId = this.$route.params.liveId
+    getLive(this.liveId).then(res => {
+      this.idCardUrl = res.data.idCardUrl;
+    })
+  },
+  methods: {
+    submit(){
+      verifyIdInfo({ liveId: this.liveId, idCardUrl: this.idCardUrl}).then(response => {
+        if (response.code == 200) {
+          this.$message.success("保存成功");
+        } else {
+          this.$message.success(response.msg);
+        }
+      })
+    },
+    handleUrl(data){
+      if (data.length > 0) {
+        this.idCardUrl = data;
+      }
+    }
+  }
+};
+</script>

+ 209 - 956
src/views/live/liveConfig/index.vue

@@ -1,1031 +1,284 @@
 <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 == 'redPacket'">
-              <live-red-conf :liveId="liveId"></live-red-conf>
+    <el-card class="box-card live-config-header">
+      <div class="detail-header">
+        <div class="header-left-area">
+          <img :src="liveInfo.liveImgUrl" alt="直播封面">
+          <!-- 加载遮罩 -->
+          <div class="ss-loading-mask" style="display: none;">
+            <div class="ss-loading-spinner is-module-loading">
+              <div class="ss-loading-dot-flashing"></div>
             </div>
-            <div v-if="marketItem.name == 'lottery'">
-              <live-lottery-conf :liveId="liveId"></live-lottery-conf>
-            </div>
-
-            <!-- 直播商品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>
+        </div>
+
+        <div class="header-middle-area">
+          <div class="live-info-title">
+            <div class="title-text">{{ liveInfo.liveName }}</div>
+          </div>
+
+          <div class="live-info-desc">
+            <div class="live-type">{{ liveInfo.liveType == 1 ? '视频直播' : '录播' }}</div>
+            <div class="line"></div>
+            <div class="live-mode">{{ liveInfo.showType == 1 ? '横屏' : '竖屏' }}</div>
+            <div class="big-screen-info">
+              <div class="dataLarge">
+                <a class="dataLarge__screen ss-popover__reference" aria-describedby="ss-popover-7614" tabindex="0" data-auth-id="818">
+                  <span class="dataLarge__screen__icon"></span>
+                  <span class="dataLarge__screen__txt">实时大屏</span>
+                </a>
+              </div>
             </div>
-            <!-- 直播商品end -->
+          </div>
+
+          <div class="live-info-state">
+            <div class="info-state-text live-time">直播时间:{{ liveInfo.startTime }} 至 {{ liveInfo.finishTime }}</div>
+            <div class="line"></div>
+            <div class="info-state-text live-state">{{ liveInfo.status == 3 ? '已结束' : liveInfo.status == 2 ? '直播中' : '未开始'}}</div>
+            <div class="line"></div>
+            <div class="info-state-text live-active-state">{{ liveInfo.isShow == 1 ? '上架' : '下架' }}</div>
+            <div class="line"></div>
+          </div>
+        </div>
+
+
+<!--        <div class="header-right-area">-->
+<!--          <div class="operation-wrapper">-->
+<!--            <div class="operation-item">-->
+<!--              <div class="operation-item-icon sales-icon"></div>-->
+<!--              <div class="operation-item-text">中控台</div>-->
+<!--            </div>-->
+<!--            <div class="line"></div>-->
+<!--            <div class="operation-item">-->
+<!--              <span class="operation-item-icon xe-iconfont"></span>-->
+<!--              <div class="operation-item-text">分享</div>-->
+<!--            </div>-->
+<!--            <div class="line"></div>-->
+<!--            <div class="operation-item" data-auth-id="975">-->
+<!--              <span class="operation-item-icon xe-iconfont"></span>-->
+<!--              <div class="operation-item-text">恢复直播</div>-->
+<!--            </div>-->
+<!--            <div class="line"></div>-->
+<!--            <div class="operation-item ss-popover__reference" aria-describedby="ss-popover-6482" tabindex="0">-->
+<!--              <span class="operation-item-icon xe-iconfont"></span>-->
+<!--              <div class="operation-item-text">更多</div>-->
+<!--            </div>-->
+<!--          </div>-->
+<!--        </div>-->
+      </div>
+    </el-card>
+    <el-card class="box-card live-config-left">
+      <div class="container">
+      <!-- 左边菜单 -->
+        <div class="left-menu">
+          <el-menu default-active="1" class="el-menu-vertical-demo" @select="handleSelect">
+            <el-menu-item :index="item.index" v-for="item in menuList" >
+              <span>{{item.name}}</span>
+            </el-menu-item>
+          </el-menu>
+        </div>
+        <!-- 右边信息 -->
+        <div class="right-info">
+          <!-- 动态组件 -->
+          <component :is="currentComponent" ></component>
+        </div>
+      </div>
+<!--      <el-tabs tab-position="left" style="height: 200px;">-->
+<!--        <el-tab-pane label="营销内容">营销内容</el-tab-pane>-->
+<!--        <el-tab-pane label="观看奖励">观看奖励</el-tab-pane>-->
+<!--        <el-tab-pane label="答题红包">答题红包</el-tab-pane>-->
+<!--        <el-tab-pane label="答题">答题</el-tab-pane>-->
+<!--        <el-tab-pane label="直播商品">直播商品</el-tab-pane>-->
+<!--        <el-tab-pane label="观看积分">观看积分</el-tab-pane>-->
+<!--        <el-tab-pane label="身份认证">-->
+<!--            <idCard :liveId="liveId" />-->
+<!--        </el-tab-pane>-->
+<!--      </el-tabs>-->
+    </el-card>
 
-          </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'
-import LiveRedConf from '@/views/live/liveRedConf/index.vue'
-import LiveLotteryConf from '@/views/live/liveLotteryConf/index.vue'
+import WatchReward from './watchReward.vue';
+import Answer from './answer.vue';
+import Goods from './goods.vue';
+import WatchScore from './watchScore.vue';
+import IdCard from './idCard.vue';
+import LiveRedConf from './liveRedConf.vue'
+import LiveLotteryConf from './liveLotteryConf.vue'
+import { listLive, getLive, delLive, addLive, updateLive, exportLive,selectCompanyTalent,handleShelfOrUn,handleDeleteSelected } from "@/api/live/live";
+
+
 export default {
   name: 'LiveConfig',
-  components: { LiveLotteryConf, LiveRedConf },
+  components: {
+    WatchReward,
+    LiveRedConf,
+    LiveLotteryConf,
+    Answer,
+    Goods,
+    WatchScore,
+    IdCard
+  },
   data() {
     return {
+      activeTab: 'basicInfo',
       liveId: null,
-      loading: true,
-      rootActiveName: 'market',
-      rootTabs: [
-        {
-          label: '营销内容',
-          name: 'market'
-        }
-      ],
-      marketActiveName: 'watchReward',
-      marketTabs: [
-        {
-          label: '观看奖励',
-          name: 'watchReward'
-        },
-        {
-          label: '红包配置',
-          name: 'redPacket'
-        },
-        {
-          label: '抽奖配置',
-          name: 'lottery'
-        },
-        {
-          label: '答题',
-          name: 'answer'
-        },
-        {
-          label: '直播商品',
-          name: 'goods'
-        },
-        {
-          label: '观看积分 ',
-          name: 'watchScore'
-        }
+      liveInfo: {},
+      currentComponent: WatchReward,
+      menuList:[
+        { name: '观看奖励', label: '观看奖励', index: 'watchReward'},
+        { name: '红包配置', label: '红包配置', index: 'liveRedConf'},
+        { name: '抽奖配置', label: '抽奖配置', index: 'liveLotteryConf'},
+        // { name: '答题', label: '答题', index: 'answer'},
+        { name: '直播商品', label: '直播商品', index: 'goods'},
+        // { name: '观看积分', label: '观看积分', index: 'watchScore'},
+        { name: '身份认证', label: '身份认证', index: 'idCard'},
       ],
-      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();
+    this.getLiving()
   },
   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')
+    handleSelect(index){
+      this.currentComponent = index; // 切换当前显示的组件
     },
-    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
+    getLiving() {
+      getLive(this.liveId).then(res => {
+        this.liveInfo = res.data
       })
     },
-    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;
+<style scoped>
+.el-tabs__header .is-top {
+  display: none !important;
 }
-.tip-box {
-  padding: 12px 16px;
-  background-color: #FFF6F2;
-  border-radius: 4px;
-  color: #666;
-  font-size: 14px;
+.live-config-header{
+  padding: 5px;
+  border: 1px solid #ebeef5;
 }
-
-/* 修改弹窗相关样式 */
-::v-deep .el-dialog {
-  height: 90%;
-  margin: 0 !important;
-  width: 900px !important;
+.detail-header {
+  display: flex;
+  padding: 20px;
+  border-bottom: 1px solid #ebeef5;
 }
 
-::v-deep .el-dialog__body {
-  padding: 20px;
-  height: calc(100% - 110px);  /* 减去header和footer的高度 */
-  overflow: hidden;
+.header-left-area {
+  flex: 0 0 120px;
+  position: relative;
 }
 
-.dialog-content {
-  height: 100%;
-  overflow-y: auto;
+.header-left-area img {
+  width: 100px;
+  height: 100px;
+  border-radius: 4px;
 }
 
-::v-deep .el-dialog__footer {
-  position: absolute;
-  bottom: 0;
-  width: 100%;
-  background: #fff;
-  z-index: 1;
-  border-top: 1px solid #e4e7ed;
-  padding: 15px 20px;
+.header-middle-area {
+  flex: 1;
+  padding: 0 20px;
 }
 
-::v-deep .el-dialog__header {
-  padding: 15px 20px;
-  border-bottom: 1px solid #e4e7ed;
+.header-right-area {
+  flex: 0 0 200px;
 }
 
-.selected-count {
-  color: #999;
-  font-size: 14px;
+.live-info-title .title-text {
+  font-size: 20px;
+  font-weight: 500;
+  color: #303133;
 }
 
-/* 可点击列的样式 */
-::v-deep .clickable-column {
-  cursor: pointer;
+.live-info-desc {
+  display: flex;
+  align-items: center;
+  margin-top: 10px;
 }
 
-/* 提示信息样式 */
-.tip-message {
-  padding: 12px 16px;
-  background-color: #FFF6F2;
-  border-radius: 4px;
-  color: #666;
-  font-size: 14px;
-  margin-bottom: 20px;
+.live-info-desc .line {
+  width: 1px;
+  height: 12px;
+  background: #c0c4cc;
+  margin: 0 10px;
 }
 
-/* 开关容器样式 */
-.reward-switch {
-  margin-left: 200px;
-  margin-bottom: 20px;
-  padding: 20px;
-  background-color: #fff;
-  border-radius: 4px;
+.live-info-state {
   display: flex;
   align-items: center;
+  margin-top: 10px;
 }
 
-/* 开关标签样式 */
-.reward-switch .switch-label {
-  margin-right: 10px;
-  font-size: 14px;
-  color: #333;
-  margin-left: 50px;
+.live-info-state .line {
+  width: 1px;
+  height: 12px;
+  background: #c0c4cc;
+  margin: 0 10px;
 }
 
-/* 表单区块样式 */
-.section-block {
-  width: 50%;
-  background-color: #fff;
-  padding: 20px;
-  border-radius: 4px;
-  margin-left: 50px;
-  margin-bottom: 20px;
+.live-state-dot {
+  width: 8px;
+  height: 8px;
+  border-radius: 50%;
 }
 
-/* 标题样式 */
-.section-block .section-title {
-  font-size: 14px;
-  color: #333;
-  margin-bottom: 20px;
-  border-left: 4px solid #409EFF;
-  padding-left: 10px;
-  line-height: 1;
+.live-state-dot-liveEnd {
+  background: #909399;
 }
 
-/* 表单样式 */
-.reward-form {
-  margin-top: 20px;
+.info-state-text {
+  font-size: 14px;
+  color: #606266;
 }
 
-/* 表单项样式 */
-.reward-form .el-form-item {
-  margin-bottom: 22px;
-  padding-left: 50px;
+.operation-wrapper {
+  display: flex;
+  align-items: center;
 }
 
-.reward-form .el-form-item:last-child {
-  margin-bottom: 0;
+.operation-item {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  cursor: pointer;
 }
 
-/* 表单标签样式 */
-.reward-form .el-form-item .el-form-item__label {
+.operation-item-text {
+  font-size: 12px;
   color: #606266;
+  margin-top: 4px;
 }
 
-/* 输入框统一宽度 */
-.reward-form .el-form-item .el-input {
-  width: 300px;
+.operation-wrapper .line {
+  width: 1px;
+  height: 20px;
+  background: #c0c4cc;
+  margin: 0 10px;
 }
 
-/* 必填项星号样式 */
-.reward-form .el-form-item.is-required .el-form-item__label:before {
-  color: #F56C6C;
+.container {
+  display: flex;
+  height: 100%;
 }
-
-/* 观看时长输入框样式 */
-.reward-form .el-form-item .duration-input {
-  width: 300px;
+.left-menu {
+  width: 200px;
+  border-right: 1px solid #e4e7ed;
+  flex-shrink: 0; /* 不收缩 */
 }
 
-.reward-form .el-form-item .duration-input .el-input__inner {
-  text-align: left;
+.right-info {
+  flex: 1;
+  padding: 20px;
 }
 
-/* 保存按钮样式 */
-.form-actions {
-  width: 600px;
-  text-align: center;
-  margin-top: 30px;
+.right-tabs {
+  height: 100%;
 }
 
-.form-actions .el-button {
-  padding: 8px 20px;
-  font-size: 13px;
-}
 </style>

+ 826 - 0
src/views/live/liveConfig/liveLotteryConf.vue

@@ -0,0 +1,826 @@
+<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"
+          :disabled="canLiveId"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="参与方式" prop="require">
+        <el-select v-model="queryParams.require" placeholder="请输入参与抽奖方式">
+          <el-option v-for="(item,index) in requireOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="抽奖状态" prop="require">
+        <el-select v-model="queryParams.lotteryStatus" placeholder="请输入参与抽奖方式">
+          <el-option v-for="(item,index) in lotteryStatusOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
+        </el-select>
+      </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"
+          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>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:liveLotteryConf:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['live:liveLotteryConf:edit']"
+        >修改</el-button>
+      </el-col>
+<!--      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['live:liveLotteryConf:remove']"
+        >删除</el-button>
+      </el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['live:liveLotteryConf:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveLotteryConfList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="抽奖ID" align="center" prop="lotteryId" />
+      <el-table-column label="操作商品" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button v-if="scope.row.lotteryStatus+'' === '0'" @click="handleUpdateProduct(scope.row)">编辑商品</el-button>
+          <el-button v-else @click="handleDetailProduct(scope.row)">查看商品</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column label="直播间ID" align="center" prop="liveId" />
+      <el-table-column label="参与方式" align="center" prop="require" :formatter="requireFormatter"/>
+      <el-table-column label="抽奖状态" align="center" prop="lotteryStatus" :formatter="lotteryStatusFormatter"/>
+      <el-table-column label="配置" 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="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" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveLotteryConf:edit']"
+            style="margin-left: 10px"
+          >修改</el-button>
+          <!-- 开始 -->
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleStatusChange(scope.row,'1')"
+            v-hasPermi="['live:liveLotteryConf:edit']"
+          >开始</el-button>
+          <!-- 暂停 -->
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleStatusChange(scope.row,'3')"
+            v-hasPermi="['live:liveLotteryConf:edit']"
+          >暂停</el-button>
+          <!-- 结算 -->
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleStatusChange(scope.row,'2')"
+            v-hasPermi="['live:liveLotteryConf:edit']"
+          >结算</el-button>
+
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveLotteryConf:edit']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改直播抽奖配置对话框 -->
+    <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"
+                    :disabled="canLiveId"/>
+        </el-form-item>
+        <el-form-item label="参与方式" prop="require">
+          <el-select v-model="form.require" placeholder="请输入参与抽奖方式">
+            <el-option v-for="(item,index) in requireOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="方式配置" prop="requireConf">
+          <el-input v-model="form.requireConf" placeholder="请输入参与抽奖方式" />
+          <span style="margin-bottom:10px;font-size: 10px; font-family: Arial,serif">当参与方式选择为“送礼参与”或“下单参与”时,此处填写商品ID及数量</span>
+        </el-form-item>
+        <el-form-item label="持续时间" prop="duration" style="margin-top: 50px;">
+          <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>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="titleProduct" :visible.sync="openProduct" width="800px" append-to-body>
+      <el-form ref="form1" :model="form1" :rules="rules1" label-width="100px" :disabled="isDetail">
+        <!-- 基础信息 -->
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="抽奖ID" prop="lotteryId">
+              <el-input v-model="form1.lotteryId" placeholder="请输入抽奖ID" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+<!--            <el-form-item label="直播间ID" prop="liveId">
+              <el-input v-model="form1.liveId" placeholder="请输入直播间ID" />
+            </el-form-item>-->
+          </el-col>
+        </el-row>
+
+        <!-- 动态奖品配置 -->
+        <el-divider content-position="left">奖品配置</el-divider>
+
+        <el-card v-for="(prize, index) in form1.prizes" :key="index" class="prize-card" shadow="hover">
+          <div slot="header" class="prize-header">
+            <span><b>奖品等级 :{{ prize.prizeLevel }}</b></span>
+            <el-button
+              v-if="form1.prizes.length > 1"
+              @click="removePrize(index)"
+              type="danger"
+              icon="el-icon-delete"
+              size="mini"
+              circle
+            ></el-button>
+          </div>
+
+          <el-row :gutter="20">
+            <el-col :span="12">
+              <el-form-item
+                label="商品名称"
+                :prop="'prizes.' + index + '.productId'"
+                :rules="[{ required: true, message: '请输入商品', trigger: 'blur' }]">
+<!--                <el-input v-model="prize.productId" placeholder="请输入商品ID" />-->
+                <el-select
+                  v-model="prize.productId"
+                  filterable
+                  clearable
+                  remote
+                reserve-keyword
+                placeholder="请输入关键字搜索"
+                :remote-method="fetchProducts"
+                :loading="loadingProducts"
+                size="small"
+                style="width: 180px"
+                >
+                <el-option
+                  v-for="product in productOptions"
+                  :key="product.goodsId"
+                  :label="product.productName"
+                  :value="product.goodsId"
+                />
+                <span style="float: left">{{ product.goodsId }}</span>
+                <span style="margin-left: 30px ;">{{product.productName}}</span>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item
+                label="奖品等级"
+                :prop="'prizes.' + index + '.prizeLevel'"
+                :rules="[{ required: true, message: '请输入奖品等级', trigger: 'blur' }]">
+                <el-input v-model="prize.prizeLevel" placeholder="请输入奖品等级" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          <el-row :gutter="20">
+            <el-col :span="12">
+              <el-form-item
+                label="单奖数量"
+                :prop="'prizes.' + index + '.perLotteryNum'"
+                :rules="[
+                { required: true, message: '请输入单次中奖数量', trigger: 'blur' },
+                { type: 'number', message: '必须为数字值' }
+              ]">
+                <el-input-number
+                  v-model="prize.perLotteryNum"
+                  :min="1"
+                  :max="100"
+                  controls-position="right"
+                  placeholder="单次中奖数量" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item
+                label="奖励总份数"
+                :prop="'prizes.' + index + '.totalLots'"
+                :rules="[
+                { required: true, message: '请输入奖励总份数', trigger: 'blur' },
+                { type: 'number', message: '必须为数字值' }
+              ]">
+                <el-input-number
+                  v-model="prize.totalLots"
+                  :min="1"
+                  controls-position="right"
+                  placeholder="奖励总份数" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="12">
+              <el-form-item
+                label="实发份数"
+                :prop="'prizes.' + index + '.totalSend'"
+                >
+                <el-input-number
+                  v-model="prize.totalSend"
+                  :min="0"
+                  :max="prize.totalLots"
+                  controls-position="right"
+                  placeholder="实际发放份数"
+                  :disabled="true"/>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-card>
+
+        <div class="add-prize-btn">
+          <el-button
+            @click="addPrize"
+            type="primary"
+            icon="el-icon-plus"
+            plain
+            size="small">
+            添加奖品配置
+          </el-button>
+        </div>
+      </el-form>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancel1">取 消</el-button>
+        <el-button type="primary" @click="submitForm1">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveLotteryConf, getLiveLotteryConf, delLiveLotteryConf, addLiveLotteryConf, updateLiveLotteryConf, exportLiveLotteryConf } from "@/api/live/liveLotteryConf";
+import LiveLotteryProductConf from '@/views/live/liveLotteryProductConf/index.vue'
+import {
+  listStoreProduct,
+  updateLiveLotteryProductConf
+} from '@/api/live/liveLotteryProductConf'
+import { listLiveGoods } from '@/api/live/liveGoods'
+
+export default {
+  name: "LiveLotteryConf",
+  components: { LiveLotteryProductConf },
+  data() {
+    return {
+      //字典
+      requireOptions: [],
+      // 抽奖状态
+      lotteryStatusOptions: [],
+      //加载商品
+      loadingProducts: false,
+      //
+      productOptions: [],
+      isDetail: false,
+      canLiveId:false,
+      //parentLiveId
+      parentLiveId : null,
+      liveId: null,
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 直播抽奖配置表格数据
+      liveLotteryConfList: [],
+      // 弹出层标题
+      title: "",
+      titleProduct: "编辑抽奖商品",
+      // 是否显示弹出层
+      open: false,
+      openProduct: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null,
+        require: null,
+        desc: null,
+        createTime: null,
+        lotteryStatus: null
+      },
+      //商品信息列表
+      productList: [],
+      // 商品信息
+      product: {
+        productId: null,
+        prizeLevel: null,
+        perLotteryNum: null,
+        totalLots: null,
+        totalSend: null
+      },
+      // 表单参数
+      form:{
+        lotteryId: '',
+        liveId: '',
+        require: '',
+        requireConf: '',
+        duration: null,
+        desc: null
+      },
+      // 表单参数
+      form1: {
+        liveId: '',
+        lotteryId: '',
+        prizes: [this.getDefaultPrize()]
+      },
+      // 表单校验
+      rules: {
+        liveId: [
+          { required: true, message: "直播间ID不能为空", trigger: "blur" }
+        ],
+        require: [
+          { required: true, message: "参与抽奖方式", trigger: "blur" }
+        ],
+        //如果require为2或3,requireConf不能为空
+        requireConf: [
+          { validator: this.validRequireConf,message: "当参与方式选择为“送礼参与”或“下单参与”时,对应的配置:送礼数量/指定商品Id及数量不能为空", trigger: "blur" }
+        ],
+        duration: [
+          { required: true, message: "持续时间 单位:分不能为空", trigger: "blur" }
+        ],
+        desc: [
+          { required: true, message: "描述不能为空", trigger: "blur" }
+        ],
+      },
+      //抽奖商品表单
+      rules1: {
+        lotteryId: [
+          { required: true, message: '请输入抽奖ID', trigger: 'blur' }
+        ],
+        liveId: [
+          { required: true, message: '请输入直播间ID', trigger: 'blur' }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getDicts("sys_live_lottery_require").then(response => {
+      this.requireOptions = response.data;
+    });
+    this.getDicts("sys_live_lottery_status").then(response => {
+      this.lotteryStatusOptions = response.data;
+    });
+
+    if (this.$route.params.liveId) {
+      this.liveId = this.$route.params.liveId;
+    }else {
+      this.liveId = this.$route.query.liveId;
+    }
+    this.parentLiveId = this.liveId;
+    this.queryParams.liveId = this.parentLiveId;
+    if(this.queryParams.liveId){
+      this.form.liveId = this.parentLiveId;
+      //设置查询条件直播间ID不可修改
+      this.canLiveId = true;
+    }
+    this.getList();
+  },
+  mounted() {
+    this.$watch(
+      () => this.form.require,
+      (newVal) => {
+        this.$refs.form.validateField('requireConf');
+      }
+    );
+  },
+  methods: {
+    async fetchProducts(query) {
+      if (!query) {
+        this.productOptions = [];
+        return;
+      }
+      const queryParam = {
+        liveId : this.liveId,
+        keywords: query
+      }
+      this.loadingProducts = true;
+      try {
+        listLiveGoods(queryParam).then(response => {
+          this.productOptions = response.rows;
+        })
+      } catch (err) {
+        console.error('查询商品失败:', err);
+        this.productOptions = [];
+      } finally {
+        this.loadingProducts = false;
+      }
+    },
+    // 获取默认奖品配置
+    getDefaultPrize() {
+      return {
+        productId: '',
+        prizeLevel: '',
+        perLotteryNum: 1,
+        totalLots: 1,
+        totalSend: 0
+      }
+    },
+    // 添加奖品配置
+    addPrize() {
+      this.form1.prizes.push(this.getDefaultPrize())
+    },
+
+    // 删除奖品配置
+    removePrize(index) {
+      if (this.form1.prizes.length <= 1) {
+        this.$message.warning('至少需要保留一个奖品配置')
+        return
+      }
+      this.form1.prizes.splice(index, 1)
+    },
+
+    requireFormatter(row, column) {
+      return this.selectDictLabel(this.requireOptions, row.require);
+    },
+    lotteryStatusFormatter(row, column) {
+      return this.selectDictLabel(this.lotteryStatusOptions, row.lotteryStatus);
+    },
+    validRequireConf(rule, value, callback) {
+      if(this.form.require+"" === "2" || this.form.require+"" === "3"){
+        if(!value){
+          callback(new Error());
+          return false;
+        }
+      }
+      callback();
+      return true;
+    },
+    /** 查询直播抽奖配置列表 */
+    getList() {
+      this.loading = true;
+      listLiveLotteryConf(this.queryParams).then(response => {
+        this.liveLotteryConfList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 取消
+    cancel1() {
+      this.openProduct = false;
+    },
+
+    // 重置表单
+    resetForm1() {
+      this.form1 = {
+        lotteryId: '',
+        liveId: '',
+        prizes: [this.getDefaultPrize()]
+      }
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        lotteryId: null,
+        liveId: null,
+        require: null,
+        requireConf: null,
+        duration: null,
+        desc: null
+      };
+      this.resetForm("form");
+      this.checkParentLiveId();
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null,
+        require: null,
+        desc: null,
+        createTime: null,
+        lotteryStatus: null
+      }
+      this.resetForm("queryForm");
+      this.checkParentLiveId();
+      this.handleQuery();
+    },
+    //判断父页面传入参数
+    checkParentLiveId(){
+      if(this.parentLiveId){
+        this.form.liveId = this.parentLiveId;
+        this.queryParams.liveId = this.parentLiveId;
+      }
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.lotteryId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加直播抽奖配置";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const lotteryId = row.lotteryId || this.ids
+      //只能对未开始或暂停的抽奖进行修改
+      if(row.lotteryStatus+"" !== "0" && row.lotteryStatus+"" !== "3"){
+        this.msgError("只能对未开始或暂停的抽奖进行修改");
+        return;
+      }
+      getLiveLotteryConf(lotteryId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改直播抽奖配置";
+      });
+    },
+    /** 修改按钮操作 */
+    handleUpdateProduct(row) {
+      this.form1.lotteryId = row.lotteryId;
+      //如果状态为已结束,则不能修改
+      if(row.lotteryStatus+"" === "2"){
+        this.msgError("已结束的抽奖不能修改");
+        return;
+      }
+      this.openProduct = true;
+      this.isDetail = false;
+      listStoreProduct(row.lotteryId).then(response => {
+        this.form1 = response.data;
+        if(this.form1.prizes.length === 0)
+          this.form1.prizes = [this.getDefaultPrize()]
+        this.form1.liveId = row.liveId;
+      });
+    },
+    /** 详情按钮操作 */
+    handleDetailProduct(row) {
+      this.form1.lotteryId = row.lotteryId;
+      //如果状态为已结束,则不能修改
+      if(row.status+"" === "2"){
+        this.msgError("已结束的抽奖不能修改");
+        return;
+      }
+      this.openProduct = true;
+      this.isDetail = true;
+      listStoreProduct(row.lotteryId).then(response => {
+        this.form1 = response.data;
+        this.form1.liveId = row.liveId;
+      });
+    },
+    /** 抽奖状态修改 */
+    handleStatusChange(row, status) {
+      if (this.$store.state.liveWs[this.liveId] == null) {
+        this.msgError("请从直播间进行操作!");
+        return;
+      }
+      //结束的抽奖不能进行操作
+      if(row.lotteryStatus+"" === "2"){
+        this.msgError("已结束的抽奖不能进行操作");
+        return;
+      }
+      switch (status+"") {
+        case "1":
+          //只能对未开启的抽奖进行操作
+          if(row.lotteryStatus+"" !== "0" && row.lotteryStatus+"" !== "3"){
+            this.msgError("只能对未开启或暂停的抽奖进行开始操作");
+            return;
+          }
+          break;
+        case "2":
+          //只能对进行中或暂停的抽奖进行结算
+          if(row.lotteryStatus+"" !== "1" && row.lotteryStatus+"" !== "3"){
+            this.msgError("只能对进行中或暂停的抽奖进行结算");
+            return;
+          }
+          break;
+        case "3":
+          //只能对进行中的抽奖执行暂停操作
+          if(row.lotteryStatus+"" !== "1"){
+            this.msgError("只能对进行中的抽奖执行暂停操作");
+            return;
+          }
+          break;
+        default:
+          return;
+      }
+      const doLotteryParam = {
+        lotteryId: row.lotteryId,
+        lotteryStatus: status,
+        duration: row.duration
+      };
+      updateLiveLotteryConf(doLotteryParam).then(response => {
+        if(response.code === 200){
+          const msg = {
+            cmd: 'lottery',
+            data: doLotteryParam
+          };
+          this.$store.state.liveWs[this.liveId].send(JSON.stringify(msg));
+          this.msgSuccess("修改成功");
+        }else{
+          this.msgError(response.msg);
+        }
+          this.open = false;
+          this.getList();
+        });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.lotteryId != null) {
+            updateLiveLotteryConf(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveLotteryConf(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    submitForm1() {
+      this.$refs["form1"].validate(valid => {
+        if (valid) {
+          updateLiveLotteryProductConf(this.form1).then(response => {
+            //200 成功
+            this.msgSuccess("保存成功");
+            this.openProduct = false;
+            this.resetForm1();
+          });
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      //如果抽奖状态不为0,则不能删除
+      if(row.lotteryStatus+"" !== "0"){
+        this.msgError("只能删除未开始的抽奖配置");
+        return;
+      }
+      const lotteryIds = row.lotteryId || this.ids;
+      this.$confirm('是否确认删除直播抽奖配置编号为"' + lotteryIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveLotteryConf(lotteryIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+          const msg = {
+            cmd: 'lottery',
+            data: {
+              lotteryId: row.lotteryId,
+              lotteryStatus: 2,
+              duration: row.duration
+            }
+          };
+          this.$store.state.liveWs[this.liveId].send(JSON.stringify(msg));
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有直播抽奖配置数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveLotteryConf(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>
+<style scoped>
+.prize-card {
+  margin-bottom: 20px;
+}
+
+.prize-header {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.add-prize-btn {
+  margin-top: 10px;
+  text-align: center;
+}
+
+.dialog-footer {
+  text-align: right;
+}
+
+</style>

+ 46 - 22
src/views/live/liveRedConf/index.vue → src/views/live/liveConfig/liveRedConf.vue

@@ -30,22 +30,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="updateTime">
-        <el-date-picker clearable size="small"
-          v-model="queryParams.updateTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择修改日期">
-        </el-date-picker>
-      </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="updateTime">-->
+<!--        <el-date-picker clearable size="small"-->
+<!--          v-model="queryParams.updateTime"-->
+<!--          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>
@@ -261,7 +261,8 @@ export default {
         desc: [
           { required: true, message: "描述不能为空", trigger: "blur" }
         ],
-      }
+      },
+      liveId: null,
     };
   },
   created() {
@@ -271,6 +272,11 @@ export default {
     this.getDicts("sys_live_red_type").then(response => {
       this.redTypeOptions = response.data;
     });
+    if (this.$route.params.liveId) {
+      this.liveId = this.$route.params.liveId;
+    }else {
+      this.liveId = this.$route.query.liveId;
+    }
     this.parentLiveId = this.liveId;
     this.queryParams.liveId = this.parentLiveId;
     if(this.queryParams.liveId){
@@ -281,12 +287,13 @@ export default {
     this.getList();
   },
   computed: {
-    liveId() {
-      return this.$route.params.liveId;
-    }
   },
   methods: {
     handleStatusChange(row, status) {
+      if (this.$store.state.liveWs[this.liveId] == null) {
+        this.msgError("请从直播间进行操作!");
+        return;
+      }
       //结束的抽奖不能进行操作
       if(row.redStatus+"" === "2"){
         this.msgError("已结束的红包不能进行操作");
@@ -319,11 +326,18 @@ export default {
       }
       const doRedParam = {
         redId: row.redId,
-        redStatus: status
+        redStatus: status,
+        totalLots: row.totalLots,
+        duration: row.duration
       };
       updateLiveRedConf(doRedParam).then(response => {
         if(response.code === 200){
-          this.$store.state.liveWs.sendWs("red",response.msg, row.redId,this.liveId);
+          const msg = {
+            cmd: 'red',
+            data: doRedParam
+          };
+          this.$store.state.liveWs[this.liveId].send(JSON.stringify(msg));
+
           this.msgSuccess("修改成功");
         }else{
           this.msgError(response.msg);
@@ -455,6 +469,16 @@ export default {
         }).then(() => {
           this.getList();
           this.msgSuccess("删除成功");
+          const msg = {
+            cmd: 'red',
+            data: {
+              redId: row.redId,
+              redStatus: 2,
+              totalLots: row.totalLots,
+              duration: row.duration
+            }
+          };
+          this.$store.state.liveWs[this.liveId].send(JSON.stringify(msg));
         }).catch(() => {});
     },
     /** 导出按钮操作 */

+ 602 - 0
src/views/live/liveConfig/task.vue

@@ -0,0 +1,602 @@
+<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
+          :disabled="liveAbled"
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="任务名称" prop="taskName">
+        <el-input
+          v-model="queryParams.taskName"
+          placeholder="请输入任务名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="任务类型" prop="taskType">
+        <el-select v-model="queryParams.taskType" placeholder="请选择任务类型" clearable size="small">
+          <el-option v-for="i in taskTypeOptions" :key="i.value" :label="i.label" :value="i.value"></el-option>
+        </el-select>
+      </el-form-item>
+<!--      <el-form-item label="触发类型" prop="triggerType">-->
+<!--        <el-select v-model="queryParams.triggerType" placeholder="请选择触发类型" clearable size="small">-->
+<!--          <el-option v-for="i in triggerTypeOptions" :key="i.value" :label="i.label" :value="i.value"></el-option>-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
+          <el-option v-for="i in statusOptions" :key="i.value" :label="i.label" :value="i.value"></el-option>
+        </el-select>
+      </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>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['shop:task:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['shop:task:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['shop:task:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['shop:task:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="taskList" @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="taskName" />
+      <el-table-column label="任务类型" align="center" prop="taskType" :formatter="taskTypeFormatter" />
+      <el-table-column label="触发类型" align="center" prop="triggerType" :formatter="triggerTypeFormatter" />
+      <el-table-column label="触发时间" align="center" prop="triggerValue" :formatter="triggerValueFormatter" />
+      <el-table-column label="状态" align="center" prop="status" :formatter="statusFormatter" />
+      <el-table-column label="创建时间" align="center" prop="createdTime" 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="updatedTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updateTime, '{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
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['shop:task:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['shop:task:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改直播间自动化任务配置对话框 -->
+    <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 :disabled="liveAbled" v-model="form.liveId" placeholder="请输入直播间ID" />
+        </el-form-item>
+        <el-form-item label="任务名称" prop="taskName">
+          <el-input v-model="form.taskName" placeholder="请输入任务名称" />
+        </el-form-item>
+        <el-form-item label="任务类型" prop="taskType">
+          <el-select v-model="form.taskType" placeholder="请选择任务类型" @change="updateTaskType()">
+            <el-option v-for="i in taskTypeOptions" :key="i.value" :label="i.label" :value="i.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="商品选择" prop="content" v-if="form.taskType == 1">
+          <el-select v-model="form.content" placeholder="请选择商品" ref="selectRef" >
+            <el-option v-for="i in productOptions" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            <!-- 加载载中状态 -->
+            <div v-if="isLoading" class="loading-indicator">
+              <i class="el-icon-loading"></i>
+              <span>加载中...</span>
+            </div>
+
+            <!-- 没有更多数据 -->
+            <div v-if="!hasMore && !isLoading" class="no-more">
+              没有更多数据了
+            </div>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="触发时间" prop="content">
+          <el-time-picker
+            v-model="form.triggerValue"
+            :picker-options="{
+      selectableRange: '00:00:00 - 23:59:59'
+    }"
+            placeholder="任意时间点">
+          </el-time-picker>
+        </el-form-item>
+<!--        <el-form-item label="触发类型" prop="triggerType">-->
+<!--          <el-select v-model="form.triggerType" placeholder="请选择触发类型">-->
+<!--            <el-option label="请选择字典生成" value="" />-->
+<!--          </el-select>-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="触发值" prop="triggerValue">-->
+<!--          <el-input v-model="form.triggerValue" placeholder="请输入触发值" />-->
+<!--        </el-form-item>-->
+<!--        <el-form-item label="任务内容">-->
+<!--          <editor v-model="form.content" :min-height="192"/>-->
+<!--        </el-form-item>-->
+        <el-form-item label="状态">
+          <el-radio-group v-model="form.status">
+            <el-radio :label="1">启用</el-radio>
+            <el-radio :label="0">禁用</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listTask, getTask, delTask, addTask, updateTask, exportTask } from "@/api/live/task";
+import {listLiveGoods} from "@/api/live/liveGoods";
+
+export default {
+  name: "Task",
+  data() {
+    return {
+      taskTypeOptions:[
+        {
+          value: "1",
+          label: "定时卡片推荐商品"
+        },
+        // {
+        //   value: "1",
+        //   label: "请选择字典生成"
+        // },
+        // {
+        //   value: "1",
+        //   label: "请选择字典生成"
+        // }
+      ],
+      // triggerTypeOptions:[
+      //   {
+      //     value: "1",
+      //     label: "请选择字典生成"
+      //   },
+      //   {
+      //     value: "1",
+      //     label: "请选择字典生成"
+      //   }
+      // ],
+      statusOptions:[{
+        value: "0",
+        label: "禁用"
+      },
+        {
+          value: "1",
+          label: "启用"
+        }
+      ],
+      productOptions:[],
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      liveAbled: false,
+      // 直播间自动化任务配置表格数据
+      taskList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null,
+        taskName: null,
+        taskType: null,
+        triggerType: null,
+        triggerValue: null,
+        content: null,
+        status: null,
+        createdTime: null,
+        updatedTime: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        liveId: [
+          { required: true, message: "直播间ID不能为空", trigger: "blur" }
+        ],
+        taskName: [
+          { required: true, message: "任务名称不能为空", trigger: "blur" }
+        ],
+        taskType: [
+          { required: true, message: "任务类型:1-定时推送卡片商品 2-定时发送红包 ", trigger: "change" }
+        ],
+        triggerType: [
+          { required: true, message: "触发类型:相对直播开始时间不能为空", trigger: "change" }
+        ],
+        triggerValue: [
+          { required: true, message: "触发值:绝对时间用yyyy-MM-dd HH:mm:ss,相对时间用分钟数不能为空", trigger: "blur" }
+        ],
+        status: [
+          { required: true, message: "状态:0-禁用 1-启用不能为空", trigger: "blur" }
+        ],
+        createdTime: [
+          { required: true, message: "创建时间不能为空", trigger: "blur" }
+        ],
+        updatedTime: [
+          { required: true, message: "更新时间不能为空", trigger: "blur" }
+        ]
+      },
+      liveId: null,
+      goodsParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null
+      },
+      isLoading: false, // 是否正在加载
+      hasMore: true, // 是否还有更多数据
+      socket:null ,
+    };
+  },
+  created() {
+    if (this.$route.params.liveId) {
+      this.liveId = this.$route.params.liveId;
+    }else {
+      this.liveId = this.$route.query.liveId;
+    }
+    if(this.liveId == null) {
+      this.$message.error("页面错误,请联系管理员");
+      return;
+    }
+    this.liveAbled = true
+    this.queryParams.liveId = this.liveId;
+    this.getList();
+    this.socket = this.$store.state.liveWs[this.liveId]
+  },
+  methods: {
+
+    statusFormatter(row, column, value){
+      if (!value) return '--'; // 空值处理
+      switch ( value){
+        case 0:
+          return "禁用";
+        case 1:
+          return "启用";
+        default:
+          return "--";
+      }
+    },
+    taskTypeFormatter(row, column, value){
+      if (!value) return '--'; // 空值处理
+      switch (value) {
+        case 1:
+          return "定时推送卡片商品";
+        case 2:
+          return "定时发送红包";
+        default:
+          return "--";
+      }
+    },
+    triggerTypeFormatter(row, column, value){
+      if (!value) return '--'; // 空值处理
+      switch (value) {
+        case 1:
+          return "相对直播开始时间";
+        case 2:
+          return "相对时间";
+        default:
+          return "--";
+      }
+    },
+    triggerValueFormatter(row, column, value) {
+      if (!value) return '--'; // 空值处理
+
+      // 创建日期对象(兼容时间戳和字符串)
+      let date;
+      if (typeof value === 'number') {
+        // 处理时间戳(注意:如果是10位时间戳需要乘以1000)
+        date = new Date(value.toString().length === 10 ? value * 1000 : value);
+      } else if (typeof value === 'string') {
+        // 处理字符串格式(尝试直接转换)
+        date = new Date(value);
+      } else {
+        return '格式错误';
+      }
+
+      // 检查日期是否有效
+      if (isNaN(date.getTime())) {
+        return '无效时间';
+      }
+      // 格式化日期为 "yyyy-MM-dd HH:mm:ss"
+      const hours = String(date.getHours()).padStart(2, '0');
+      const minutes = String(date.getMinutes()).padStart(2, '0');
+      const seconds = String(date.getSeconds()).padStart(2, '0');
+
+      return `${hours}:${minutes}:${seconds}`;
+    },
+    async updateTaskType(){
+      if (this.form.taskType == 1) {
+        if (this.isLoading || !this.hasMore) return;
+        this.isLoading = true;
+        this.goodsParams.liveId = this.liveId;
+        try{
+          await this.addGoodsList();
+        }catch ( err){
+          console.error('加载数据失败:', err);
+        }finally {
+          this.isLoading = false;
+        }
+      }
+    },
+    addGoodsList() {
+      listLiveGoods(this.goodsParams).then(res => {
+        if(res.rows.length > 0) {
+          res.rows.forEach(item => {
+            // 根据productName和goodsId组装成为label和value
+            this.productOptions.push({
+              value: item.goodsId,
+              label: item.productName
+            })
+          })
+          this.goodsParams.pageNum++;
+          // 判断是否还有更多数据
+          this.hasMore = this.productOptions.length < res.total;
+          if(this.hasMore) {
+            this.addGoodsList();
+          }
+        } else {
+          this.hasMore = false;
+        }
+      });
+    },
+    /** 查询直播间自动化任务配置列表 */
+    getList() {
+      if(this.liveId == null) {
+        this.$message.error("页面错误,请联系管理员");
+        return;
+      }
+      this.loading = true;
+      listTask(this.queryParams).then(res => {
+        if(res.rows.length > 0) {
+          this.taskList = res.rows;
+        }
+        this.total = res.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        liveId: this.liveId,
+        taskName: null,
+        taskType: null,
+        triggerType: null,
+        triggerValue: null,
+        content: null,
+        status: 1,
+        createdTime: null,
+        updatedTime: null
+      };
+      this.goodsParams={
+          pageNum: 1,
+          pageSize: 10,
+          liveId: this.liveId
+      }
+      this.productOptions = [];
+      this.hasMore = true;
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加直播间自动化任务配置";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getTask(id).then(response => {
+        this.form = response.data;
+        this.form.content = null;
+        this.form.taskType = null;
+        this.open = true;
+        this.title = "修改直播间自动化任务配置";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.form.liveId = this.liveId;
+      if(this.liveId == null) {
+        this.msgError("请选择直播间");
+        return;
+      }
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateTask(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addTask(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      if(this.socket == null) {
+        this.$message.error("请进入直播间后,在进行操作!")
+        return;
+      }
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除直播间自动化任务配置编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delTask(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+          const msg={
+            cmd:'delAutoTask',
+            data:row.absValue,
+            liveId:this.liveId,
+            userType:1
+          }
+          this.socket.send(JSON.stringify( msg))
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有直播间自动化任务配置数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportTask(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    },
+  }
+};
+</script>
+
+<style scoped>
+.loading-indicator {
+  padding: 10px;
+  text-align: center;
+  color: #606266;
+  font-size: 12px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.loading-indicator .el-icon-loading {
+  margin-right: 5px;
+  animation: rotate 1s linear infinite;
+}
+
+.no-more {
+  padding: 10px;
+  text-align: center;
+  color: #909399;
+  font-size: 12px;
+}
+
+@keyframes rotate {
+  from { transform: rotate(0deg); }
+  to { transform: rotate(360deg); }
+}
+</style>

+ 392 - 0
src/views/live/liveConfig/watchReward.vue

@@ -0,0 +1,392 @@
+<template >
+  <div v-loading.fullscreen.lock="loading">
+    <!-- 提示信息 -->
+    <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>
+
+<script>
+import {addConfig, getConfig, updateConfig} from "@/api/live/liveQuestionLive";
+
+export default {
+  data() {
+    return {
+      loading: true,
+      liveId: null,
+      watchRewardForm: {
+        id: null,
+        liveId: null,
+        // 是否启用观看奖励
+        enabled: false,
+        // 参与条件
+        participateCondition: '1',
+        // 观看时长
+        watchDuration: '',
+        // 实施动作
+        action: '2',
+        // 领取提示语
+        receivePrompt: '',
+        // 红包发放方式(固定金额/随机金额)
+        redPacketType: '1',
+        // 红包金额
+        redPacketAmount: '',
+        // 红包发放数量
+        redPacketCount: '',
+        // 红包领取方式
+        receiveMethod: '1',
+        // 是否显示客服引导
+        showGuide: '1',
+        // 客服引导语
+        guideText: '',
+        // 积分值
+        scoreAmount: '',
+        // // 最大领取人数
+        // maxReceivers: '',
+        // 积分使用引导语
+        scoreGuideText: '',
+        // 积分使用引导链接
+        scoreGuideLink: ''
+      },
+      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'}
+        ]
+      },
+      // 添加实施动作选项
+      actionOptions: [
+        // {
+        //   label: '现金红包',
+        //   value: '1'
+        // },
+        {
+          label: '积分红包',
+          value: '2'
+        }
+      ],
+
+    };
+  },
+  created() {
+    this.liveId = this.$route.params.liveId
+    this.watchRewardForm.liveId = this.liveId
+    this.getLiveConfig();
+  },
+  methods: {
+    getLiveConfig(){
+      getConfig(this.liveId).then(response => {
+        if(response.code === 200 && response.data != null && response.data.length > 0){
+          this.watchRewardForm = JSON.parse(response.data)
+        }
+        this.loading = false
+      })
+    },
+    saveWatchReward() {
+      this.$refs["watchRewardForm"].validate(valid => {
+        console.log(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("修改成功");
+            });
+          }
+        }
+      })
+    },
+  }
+};
+</script>
+
+<style scoped>
+/* 提示信息样式 */
+.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>

+ 48 - 0
src/views/live/liveConfig/watchScore.vue

@@ -0,0 +1,48 @@
+<template>
+  <el-form ref="form"  label-width="80px">
+    <el-form-item>
+      <el-form-item label="上传图片" prop="materialUrl">
+        <ImageUpload @input="handleUrl" type="image" :num="10" :width="150" :height="150" />
+      </el-form-item>
+      <el-button type="primary" size="mini" @click="submit">保存</el-button>
+    </el-form-item>
+  </el-form>
+</template>
+
+<script>
+import ImageUpload from '@/components/ImageUpload/index';
+import {verifyIdInfo, getLive} from '@/api/live/live'
+
+export default {
+  components: { ImageUpload },
+  props: {
+    liveInfo: {
+      type: Object,
+      default: () => ({}) // 默认值为一个空对象
+    },
+  },
+  data() {
+    return {
+      liveId: this.liveInfo.liveId,
+    };
+  },
+  created() {
+  },
+  methods: {
+    submit(){
+      verifyIdInfo({ liveId: this.liveId, idCardUrl: this.idCardUrl}).then(response => {
+        if (response.code == 200) {
+          this.$message.success("保存成功");
+        } else {
+          this.$message.success(response.msg);
+        }
+      })
+    },
+    handleUrl(data){
+      if (data.length > 0) {
+        this.idCardUrl = data;
+      }
+    }
+  }
+};
+</script>

+ 446 - 133
src/views/live/liveConsole/index.vue

@@ -1,10 +1,164 @@
 <template>
   <!-- 直播中控台 start -->
-  <el-row type="flex" justify="center" class="live-console" :gutter="10">
+  <el-row type="flex" justify="center" class="live-console" :gutter="10" v-loading="loading">>
+    <!-- 聊天 start -->
+    <el-col class="live-console-col" :span="6">
+      <el-tabs class="live-console-tab-left" v-model="tabRight.activeName" @tab-click="handleClick" :stretch="true">
+        <el-tab-pane label="讨论" name="talk">
+          <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 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>
+                      <a style="cursor: pointer;color: #ff0000;padding: 8px 8px 0 0;font-size: 12px;" @click="blockUser(m)">拉黑</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 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
+              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>
+    </el-col>
+    <!-- 聊天 end -->
+
+
+    <!-- 直播/视频 start -->
+    <el-col class="live-console-col" :span="12">
+      <div style="background: #000; border-radius: 5px; overflow: hidden; margin: 10px 5px;">
+        <div style="border-radius: 5px; overflow: hidden;" v-if="!isAudit">
+          <img :src="require('@/assets/images/videoIsAudit.png')" style="width: 100%; height: 45vh;">
+        </div>
+        <div style="border-radius: 5px; overflow: hidden;" v-else-if="status != 2">
+          <img :src="require('@/assets/images/videoNotStart.png')" style="width: 100%; height: 45vh;">
+        </div>
+        <div style="border-radius: 5px; overflow: hidden;" v-else-if="liveType == 1">
+          <video
+            controls
+            ref="livingPlayer"
+            autoplay
+            width="100%"
+            style="display: block; background: #000; height: 45vh;"
+          ></video>
+        </div>
+        <div style="border-radius: 5px; overflow: hidden;" v-else-if="liveType == 2">
+          <video
+            controls
+            ref="videoPlayer"
+            loop
+            autoplay
+            width="100%"
+            muted
+            playsinline
+            @click.prevent
+            @contextmenu.prevent
+            class="custom-video"
+            style="display: block; background: #000; height: 40vh;"
+          >
+            <source :src="videoUrl" type="video/mp4">
+          </video>
+          <!-- 自定义进度条容器 -->
+          <div ref="progressBar" class="progress-container">
+            <div id="progressBar" class="progress-bar"></div>
+          </div>
+
+          <!-- 时间显示(可选) -->
+          <div ref="elapsedTime" class="time-display">
+            已播放:<span id="elapsedTime">00:00:00</span>
+          </div>
+        </div>
+        <div style="border-radius: 5px; overflow: hidden;" v-else>
+          <img :src="require('@/assets/images/videoNotStart.png')" style="width: 100%; height: 45vh;">
+        </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;" @click="handleClickRed">
+          <i class="el-icon-money" 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;" @click="handleClickLottery">
+          <i class="el-icon-present" 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;" @click="handleClickGoods">
+          <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;" @click="handleClickOrder">
+          <i class="el-icon-goods" style="font-size: 20px;"></i>
+          <span style="font-size: 12px; margin-top: 4px;">直播订单</span>
+        </div>
+      </div>
+      <el-radio-group v-model="tableRadio" >
+        <el-radio-button label="订单数">订单数</el-radio-button>
+      </el-radio-group>
+      <div  style="position: relative;width: 100%; height: 300px;">
+        <div ref="chartContainer" style="width: 100%; height: 100%;"></div>
+        <div style="position: absolute; top: 10px; right: 10px; background: #fff; padding: 5px; z-index: 1;">
+          <el-select v-model="searchQuery.timeOptions" placeholder="请选择" style="width: 150px"  @change="timeChange">
+            <el-option
+              v-for="item in timeOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+          <el-select v-model="searchQuery.timeGranularity" placeholder="请选择" style="width: 150px"  @change="timeGranularityChange">
+            <el-option
+              v-for="item in timeGranularity"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value">
+            </el-option>
+          </el-select>
+          <!--          <el-button type="primary" @click="applyFilter">搜索</el-button>-->
+        </div>
+      </div>
+    </el-col>
+    <!-- 直播/视频 end -->
 
     <!-- 用户列表 start -->
-    <el-col class="live-console-col" :span="5">
-      <el-tabs class="live-console-tab-left" v-model="tabLeft.activeName" @tab-click="handleClick" :stretch="true">
+    <el-col class="live-console-col" :span="6">
+      <el-tabs class="live-console-tab-right" v-model="tabLeft.activeName" @tab-click="handleClick" :stretch="true">
         <el-tab-pane :label="onlineLabel" name="online">
           <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">
@@ -20,6 +174,7 @@
                   width="100"
                   trigger="click">
                   <a style="cursor: pointer;color: #ff0000;" @click="changeUserState(u)">{{ u.msgStatus === 1 ? '解禁' : '禁言' }}</a>
+                  <a style="cursor: pointer;color: #ff0000;margin-left:10px" @click="blockUser(u)">拉黑</a>
                   <i class="el-icon-more" slot="reference"></i>
                 </el-popover>
               </el-col>
@@ -41,6 +196,7 @@
                   width="100"
                   trigger="click">
                   <a style="cursor: pointer;color: #ff0000;" @click="changeUserState(u)">{{ u.msgStatus === 1 ? '解禁' : '禁言' }}</a>
+                  <a style="cursor: pointer;color: #ff0000;margin-left:10px" @click="blockUser(u)">拉黑</a>
                   <i class="el-icon-more" slot="reference"></i>
                 </el-popover>
               </el-col>
@@ -62,6 +218,7 @@
                   width="100"
                   trigger="click">
                   <a style="cursor: pointer;color: #ff0000;" @click="changeUserState(u)">{{ u.msgStatus === 1 ? '解禁' : '禁言' }}</a>
+                  <a style="cursor: pointer;color: #ff0000;margin-left:10px" @click="blockUser(u)">拉黑</a>
                   <i class="el-icon-more" slot="reference"></i>
                 </el-popover>
               </el-col>
@@ -71,133 +228,28 @@
       </el-tabs>
     </el-col>
     <!-- 用户列表 end -->
-
-    <!-- 直播/视频 start -->
-    <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;" @click="handleClickRed">
-          <i class="el-icon-money" 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;" @click="handleClickLottery">
-          <i class="el-icon-present" 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-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 -->
-
-    <!-- 聊天 start -->
-    <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: 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 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 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
-              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>
-    </el-col>
-    <!-- 聊天 end -->
   </el-row>
   <!-- 直播中控台  end -->
 </template>
 
 <script>
-import { changeUserStatus, watchUserList } from '@/api/live/liveWatchUser'
+import { blockUser,changeUserStatus, watchUserList } from '@/api/live/liveWatchUser'
 import { getLiveVideoByLiveId } from '@/api/live/liveVideo'
-import { getLivingUrl } from '@/api/live/live'
+import {getLive, getLivingUrl} from '@/api/live/live'
+import { getLiveOrderTimeGranularity } from '@/api/live/liveOrder'
 import { listLiveMsg } from '@/api/live/liveMsg'
 import Hls from 'hls.js';
-import LiveLotteryConf from '@/views/live/liveLotteryConf/index.vue'
-import LiveRedConf from '@/views/live/liveRedConf/index.vue'
+import LiveLotteryConf from '@/views/live/liveConfig/liveLotteryConf.vue'
+import LiveRedConf from '@/views/live/liveConfig/liveRedConf.vue'
+import LiveGoods from '@/views/live/liveConfig/goods.vue'
+import echarts from 'echarts'
 
 export default {
   name: "LiveConsole",
   components: { LiveLotteryConf,LiveRedConf },
   data() {
     return {
+      loading:true,
       tabLeft: {
         activeName: "online",
       },
@@ -219,19 +271,38 @@ export default {
       },
       userList: [],
       msgList: [],
-      newMsg: ''
+      newMsg: '',
+      isAudit: false,
+      myChart: null, // 用于存储 ECharts 实例
+      liveType: 1,
+      tableRadio: '订单数',
+      searchQuery: {timeOptions:'2',timeGranularity:'10',liveId: null},
+      timeOptions: [
+        {value:'2',label:'最近2小时',key:'2'},
+        {value:'4',label:'最近4小时',key:'4'},
+        {value:'all',label:'全场',key:'all'},
+      ],
+      timeGranularity: [
+        {value:'10',label:'10分钟',key:'10'},
+        {value:'30',label:'30分钟',key:'30'},
+        {value:'60',label:'1小时',key:'60'},
+      ],
+      videoDuration: 0,
+      startTime: null,
+      processInterval: null,
+      // ... 其他数据
+      chatScrollTop: 0, // 保存聊天滚动位置
+      socket: null,
     }
   },
   created() {
     // this.getLiveVideo()
     this.getList()
     this.connectWebSocket()
-    this.getLiveUrl()
+    this.getLive()
+    this.searchQuery.liveId = this.liveId
   },
   computed: {
-    socket(){
-      return this.$store.state.liveWs
-    },
     liveId() {
       return this.$route.params.liveId;
     },
@@ -269,7 +340,207 @@ export default {
       return '禁言'
     }
   },
+  mounted() {
+    this.$nextTick(() => {
+      this.restoreChatScrollPosition();
+    });
+    this.getEchartsTables();
+    // 添加滚动事件监听器
+    this.$nextTick(() => {
+      if (this.$refs.manageRightRef && this.$refs.manageRightRef.wrap) {
+        this.$refs.manageRightRef.wrap.addEventListener('scroll', this.saveChatScrollPosition);
+      }
+    });
+  },
+  // 使用 deactivated 和 activated 钩子替代 beforeDestroy 和 destroyed
+  deactivated() {
+    this.saveChatScrollPosition();
+  },
+
+  activated() {
+    this.$nextTick(() => {
+      this.restoreChatScrollPosition();
+    });
+    this.$nextTick(() => {
+      const video = this.$refs.videoPlayer;
+      if (video != null) {
+        video.play();
+        this.initVideoPlayer(this.liveInfo.startTime)
+      }
+    })
+  },
   methods: {
+    updateVideoPosition(video){
+      const currentTime = new Date().getTime(); // 当前时间戳(毫秒)
+      const elapsedTime = currentTime - this.startTime; // 已流逝时间(毫秒)
+
+      if (elapsedTime < 0) {
+        // 未开播:视频停在初始位置
+        video.currentTime = 0;
+        return;
+      }
+
+      // 已开播:计算视频循环后的位置(流逝时间 % 视频时长)
+      const elapsedSeconds = elapsedTime / 1000; // 转换为秒
+      const videoPosition = elapsedSeconds % this.videoDuration; // 视频内的播放位置(秒)
+
+      // 设置视频播放位置
+      video.currentTime = videoPosition;
+    },
+    updateProgress() {
+      const progressBar = this.$refs.progressBar;
+      const elapsedTimeEl = this.$refs.elapsedTime;
+      if (!this.videoDuration) return; // 视频时长未加载时不更新
+
+      const currentTime = new Date().getTime();
+      const elapsedTime = currentTime - this.startTime; // 总流逝时间(毫秒)
+
+      if (elapsedTime < 0) {
+        // 未开播状态
+        progressBar.style.width = '0%';
+        elapsedTimeEl.textContent = '00:00:00';
+        return;
+      }
+
+      // 计算进度百分比(基于视频循环)
+      const elapsedSeconds = elapsedTime / 1000;
+      const videoPosition = elapsedSeconds % this.videoDuration; // 当前在视频中的位置
+      const progressPercent = (videoPosition / this.videoDuration) * 100; // 进度百分比
+
+      // 更新进度条宽度
+      progressBar.style.width = `${progressPercent}%`;
+
+      // 格式化总流逝时间为“时:分:秒”并显示
+      elapsedTimeEl.textContent = this.formatTime(elapsedTime);
+    },
+    formatTime(ms) {
+      const totalSeconds = Math.floor(ms / 1000);
+      const hours = Math.floor(totalSeconds / 3600);
+      const minutes = Math.floor((totalSeconds % 3600) / 60);
+      const seconds = totalSeconds % 60;
+
+      // 补零处理(确保两位数)
+      return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
+    },
+    initVideoPlayer: function (startTime) {
+      const video = this.$refs.videoPlayer;
+
+
+      // 1. 初始化开播时间
+      startTime = new Date(startTime).getTime();
+      this.startTime = startTime;
+      // 2. 监听视频元数据加载完成(获取视频时长)
+      video.addEventListener('loadedmetadata', () => {
+        this.videoDuration = video.duration; // 获取视频时长(秒)
+
+        // 初始化视频播放位置
+        this.updateVideoPosition(video);
+
+        // 启动实时进度更新(每秒刷新一次)
+        this.processInterval = setInterval(this.updateProgress, 1000);
+      });
+
+    },
+    // 保存聊天滚动位置
+    saveChatScrollPosition() {
+      if (this.$refs.manageRightRef && this.$refs.manageRightRef.wrap) {
+        this.chatScrollTop = this.$refs.manageRightRef.wrap.scrollHeight - this.$refs.manageRightRef.wrap.clientHeight;
+      }
+    },
+
+    // 恢复聊天滚动位置
+    restoreChatScrollPosition() {
+      if (this.$refs.manageRightRef && this.$refs.manageRightRef.wrap) {
+        this.$refs.manageRightRef.wrap.scrollTop = this.chatScrollTop;
+      }
+    },
+    // ... 其他方法 ...
+    timeChange(val) {
+      this.searchQuery.timeOptions = val
+      this.getEchartsTables(this.searchQuery)
+      this.initChart()
+    },
+    timeGranularityChange(val) {
+      this.searchQuery.timeGranularity =  val
+      this.getEchartsTables()
+      this.initChart()
+    },
+    getEchartsTables() {
+      getLiveOrderTimeGranularity(this.searchQuery).then(res => {
+        if (res.code == 200) {
+          this.echartsXLine = res.hourlySlots
+          this.echartsXValue = res.hourlySlotsValue
+          this.initChart()
+        }
+      })
+    },
+    initChart() {
+      const chartDom = this.$refs.chartContainer;
+      this.myChart = echarts.init(chartDom);
+      const option = {
+        tooltip: {trigger: 'axis'},
+        legend: {data: ['订单数']},
+        xAxis: {type: 'category', boundaryGap: false, data: this.echartsXLine},
+        yAxis: {type: 'value'},
+        series: [
+          {name: '订单数', type: 'line', data: this.echartsXValue}
+        ],
+      };
+      this.myChart.setOption(option);
+    },
+    handleClickGoods(){
+      this.$router.push({
+        name: 'LiveGoods',
+        query: {
+          liveId: this.liveId
+        }
+      })
+    },
+    handleClickOrder(){
+      this.$router.push({
+        name: 'LiveOrder',
+        query: {
+          liveId: this.liveId
+        }
+      })
+    },
+    getLive(){
+      getLive(this.liveId).then(res => {
+        if (res.code == 200) {
+          if (res.data.isAudit != 1) {
+            this.$message.error("当前直播间未经审核");
+            this.loading = false
+            return
+          }
+          this.isAudit = true
+          this.status = res.data.status
+          if (res.data.status != 2) {
+            this.$message.error("当前直播间未直播");
+            this.loading = false
+            return
+          }
+          if (res.data.liveType == 1) {
+            this.livingUrl = res.data.flvHlsUrl
+            this.$nextTick(() => {
+              this.initPlayer()
+            })
+          } else {
+            this.liveType = 2
+            this.videoUrl = res.data.videoUrl;
+            this.$nextTick(() => {
+              const video = this.$refs.videoPlayer;
+              video.play()
+              this.initVideoPlayer(res.data.startTime)
+            })
+          }
+          this.loading = false
+        } else {
+          this.$message.error(res.msg)
+          this.loading = false
+        }
+        this.liveInfo = res.data
+      })
+    },
     handleClickLottery(){
       this.$router.push({
         name: 'LiveLotteryConf',
@@ -296,16 +567,29 @@ export default {
     },
     initPlayer(){
       var isUrl = this.livingUrl === null || this.livingUrl.trim() === ''
+      if (isUrl) {
+        console.error('直播地址为空,无法初始化播放器')
+        return
+      }
       if (Hls.isSupported() && !isUrl) {
-        const videoElement = this.$refs.videoPlayer
-        const hls = new Hls();
-        hls.attachMedia(videoElement);
-        hls.on(Hls.Events.MEDIA_ATTACHED, () => {
-          hls.loadSource(this.livingUrl);
-          hls.on(Hls.Events.STREAM_LOADED, (event, data) => {
+        const videoElement = this.$refs.livingPlayer
+        if (!videoElement) {
+          console.error('找不到 video 元素')
+          return
+        }
+        this.hls = new Hls();
+        this.hls.attachMedia(videoElement);
+        this.hls.on(Hls.Events.MEDIA_ATTACHED, () => {
+          this.hls.loadSource(this.livingUrl);
+          this.hls.on(Hls.Events.STREAM_LOADED, (event, data) => {
             videoElement.play();
           });
         });
+        this.hls.on(Hls.Events.ERROR, (event, data) => {
+          console.error('HLS 错误:', data);
+        });
+      } else {
+        console.error('浏览器不支持 HLS')
       }
     },
     handleClick(tab) {
@@ -410,10 +694,28 @@ export default {
       })
     },
     manageRightScroll() {
-      let max = this.$refs.manageRightRef.wrap.scrollHeight - this.$refs.manageRightRef.wrap.clientHeight
-      let current = this.$refs.manageRightRef.wrap.scrollTop
-      console.log("manageRightMax", max);
-      console.log("manageRight", current)
+      this.saveChatScrollPosition();
+    },
+    blockUser(u){
+      this.$confirm('是否确认封禁用户账号为:"' + u.nickName + '-' + u.userId + '"?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        let msg = {
+          msg: "",
+          liveId: this.liveId,
+          userId: u.userId,
+          userType: 0,
+          cmd: 'blockUser',
+          avatar: this.$store.state.user.user.avatar,
+          nickName: this.$store.state.user.user.nickName
+        }
+        this.socket.send(JSON.stringify(msg))
+        return blockUser(u.userId);
+      }).then(() => {
+        this.msgSuccess("封禁成功");
+      }).catch(() => {});
     },
     changeUserState(u) {
       // 修改状态
@@ -447,6 +749,7 @@ export default {
         liveId: this.liveId,
         userId: this.userId
       })
+      this.socket = this.$store.state.liveWs[this.liveId]
       this.socket.onmessage = (event) => this.handleWsMessage(event)
     },
     handleWsMessage(event) {
@@ -464,7 +767,6 @@ export default {
           }
           delete message.params
           this.msgList.push(message)
-
           // 移动到底部
           this.$nextTick(() => {
             setTimeout(() => {
@@ -473,12 +775,16 @@ export default {
           })
         }
         else if (cmd === 'entry' || cmd === 'out') {
-
+          this.loadUserList()
           let user = data
           if(this.userList.length > 0){
             this.userList = this.userList.filter(u => u.userId !== user.userId)
           }
           this.userList.push(user)
+        } else if (cmd === 'live_start') {
+          this.msgSuccess("直播开始了!");
+        } else if (cmd === 'live_end') {
+          this.msgError("直播已结束!");
         }
       }
     },
@@ -505,6 +811,13 @@ export default {
   },
   destroyed() {
     this.socket?.close()
+    this.hls?.destroy();
+    this.$store.dispatch('closeLiveWs', {
+      liveWsUrl: this.liveWsUrl,
+      liveId: this.liveId,
+      userId: this.userId
+    })
+    clearInterval(this.processInterval)
   }
 }
 </script>

+ 13 - 21
src/views/live/liveData/index.vue

@@ -191,14 +191,10 @@
           { label: '低观看', value: 'lowView' },
           { label: '低流量', value: 'lowFlow' },
         ],
-        chart: null,
         selectedTimeRange: "day", // 默认选中“自然天”
         datePickerType: "date", // 默认 date 类型
-        trendData: [], // 直播趋势数据
         weekRange: "", // 存储选择周的时间范围
-        selectedMetric: {}, // 选中的指标
         selectedDate: new Date().toISOString().split("T")[0], // 默认今天
-        selectedMetric: "views", // 默认选中浏览量
         lives: [
           {
             id: 1,
@@ -396,10 +392,6 @@
           default: return 0;
         }
       },
-      selectRank(type) {
-        this.selectedRank = type;
-        console.log(`选中的排行方式: ${type}`);
-      },
       selectRank(type) {
         this.selectedRank = type; // 只允许一个按钮被选中
         console.log(`选中的排行方式: ${type}`);
@@ -446,19 +438,19 @@
         this.updateChart();
       },
       // 切换指标
-      changeMetric(metric) {
-        this.selectedMetric = metric;
-        this.updateChart();
-      },
-      updateTrendData() {
-        console.log("选择的时间:", this.selectedDate);
-        this.trendData = this.trendData.map(item => ({
-          ...item,
-          value: Math.floor(Math.random() * 50),
-          change: (Math.random() * 10 - 5).toFixed(2)
-        }));
-        this.updateChart();
-      },
+      // changeMetric(metric) {
+      //   this.selectedMetric = metric;
+      //   this.updateChart();
+      // },
+      // updateTrendData() {
+      //   console.log("选择的时间:", this.selectedDate);
+      //   this.trendData = this.trendData.map(item => ({
+      //     ...item,
+      //     value: Math.floor(Math.random() * 50),
+      //     change: (Math.random() * 10 - 5).toFixed(2)
+      //   }));
+      //   this.updateChart();
+      // },
       initChart() {
         let chartDom = document.getElementById("liveChart");
         if (!chartDom) return;

+ 352 - 332
src/views/live/liveGoods/index.vue

@@ -1,79 +1,19 @@
 <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-form :model="queryParams" class="live-goods-css" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="商品名称" prop="keywords" >
         <el-input
-          v-model="queryParams.liveId"
-          placeholder="请输入直播ID"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="商品名称" prop="goodsName">
-        <el-input
-          v-model="queryParams.goodsName"
+          v-model="queryParams.keywords"
           placeholder="请输入商品名称"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="描述" prop="goodsDesc">
-        <el-input
-          v-model="queryParams.goodsDesc"
-          placeholder="请输入描述"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="封图" prop="imgUrl">
+      <el-form-item label="上下架" prop="status" >
         <el-input
-          v-model="queryParams.imgUrl"
-          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="opPrice">
-        <el-input
-          v-model="queryParams.opPrice"
-          placeholder="请输入原价"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
-<!--          <el-option label="请选择字典生成" value="" />-->
-          <el-option v-for="(item,index) in goodsStatusOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="库存表" prop="stock">
-        <el-input
-          v-model="queryParams.stock"
-          placeholder="请输入库存表"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="排序号" prop="sort">
-        <el-input
-          v-model="queryParams.sort"
-          placeholder="请输入排序号"
+          v-model="queryParams.status"
+          placeholder="请输入直播间状态"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
@@ -85,322 +25,402 @@
       </el-form-item>
     </el-form>
 
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['live:liveGoods:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['live:liveGoods:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['live:liveGoods:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          :loading="exportLoading"
-          @click="handleExport"
-          v-hasPermi="['live:liveGoods:export']"
-        >导出</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
+    <div class="selection-toolbar">
+      <el-checkbox :indeterminate="isIndeterminate" v-model="allChecked" @change="toggleSelectAll">
+        {{ multipleSelection.length > 0 ? `已选 ${multipleSelection.length} 条` : '选中本页' }}
+      </el-checkbox>
+      <el-button  plain size="mini" @click="handleShelf">上架</el-button>
+      <el-button  plain size="mini" @click="handleUnshelf">下架</el-button>
+      <el-button  plain size="mini" @click="handleDeleteSelected">删除</el-button>
+      <el-button  plain type="mini" icon="el-icon-plus" @click="handleAddLiveGoods">添加商品</el-button>
+    </div>
 
-    <el-table border v-loading="loading" :data="liveGoodsList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="ID" align="center" prop="goodsId" />
-      <el-table-column label="直播ID" align="center" prop="liveId" />
-      <el-table-column label="商品名称" align="center" prop="goodsName" />
-      <el-table-column label="描述" align="center" prop="goodsDesc" />
-      <el-table-column label="封图" align="center" prop="imgUrl" />
-      <el-table-column label="组图" align="center" prop="images" />
-      <el-table-column label="单价" align="center" prop="price" />
-      <el-table-column label="原价" align="center" prop="opPrice" />
-      <el-table-column label="状态" align="center" prop="status" :formatter="goodsStatusFormatter"/>
-      <el-table-column label="库存表" align="center" prop="stock" />
-      <el-table-column label="排序号" align="center" prop="sort" />
-      <el-table-column label="备注" align="center" prop="remark" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+    <el-table
+      ref="goodTable"
+      :data="goodsLiveList"
+      style="width: 100%"
+      v-loading="loading"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55"></el-table-column>
+      <!-- 题干列:显示试题的主要内容 -->
+      <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
+        prop="status"
+        label="上下架"
+      >
+        <template slot-scope="scope">
+          <el-tag v-if="scope.row.status == 1">上架</el-tag>
+          <el-tag v-if="scope.row.status == 0">下架</el-tag>
+        </template>
+      </el-table-column>
+
+      <!-- 操作列:包含编辑和删除按钮 -->
+      <el-table-column
+        label="操作"
+        width="180"
+        fixed="right"
+      >
         <template slot-scope="scope">
           <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['live:liveGoods:edit']"
-          >修改</el-button>
-          <el-button
-            size="mini"
             type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['live:liveGoods:remove']"
+            size="small"
+            style="color: #F56C6C;"
+            @click="handleGoodDelete(scope.row)"
           >删除</el-button>
         </template>
       </el-table-column>
     </el-table>
 
+    <!-- 分页组件:用于分页展示试题列表 -->
     <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
+      v-show="goodsLiveTotal > 0"
+      :total="goodsLiveTotal"
+      :page.sync="goodsParams.pageNum"
+      :limit.sync="goodsParams.pageSize"
+      @pagination="getLiveGoodsList"
+      style="margin-top: 20px;"
     />
 
-    <!-- 添加或修改直播商品对话框 -->
-    <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="商品名称" prop="goodsName">
-          <el-input v-model="form.goodsName" placeholder="请输入商品名称" />
-        </el-form-item>
-        <el-form-item label="描述" prop="goodsDesc">
-          <el-input v-model="form.goodsDesc" placeholder="请输入描述" />
-        </el-form-item>
-        <el-form-item label="封图" prop="imgUrl">
-          <ImageUpload  v-model="form.imgUrl" type="image" :limit=1 :width="150"
-                        :height="150"/>
-        </el-form-item>
-        <el-form-item label="组图" prop="images">
-          <ImageUpload  v-model="form.images" type="image" :limit=10 :width="150"
-                        :height="150"/>
-        </el-form-item>
-        <el-form-item label="单价" prop="price">
-          <el-input v-model="form.price" placeholder="请输入单价" />
-        </el-form-item>
-        <el-form-item label="原价" prop="opPrice">
-          <el-input v-model="form.opPrice" placeholder="请输入原价" />
-        </el-form-item>
-        <el-form-item label="状态">
-          <el-radio-group v-model="form.status">
-            <el-radio :label="item.dictValue" v-for="item in goodsStatusOptions" >{{item.dictLabel}}</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="库存表" prop="stock">
-          <el-input v-model="form.stock" placeholder="请输入库存表" />
-        </el-form-item>
-        <el-form-item label="排序号" prop="sort">
-          <el-input v-model="form.sort" placeholder="请输入排序号" />
-        </el-form-item>
-        <el-form-item label="备注" prop="remark">
-          <el-input v-model="form.remark" placeholder="请输入备注" />
-        </el-form-item>
-      </el-form>
+    <!-- 添加商品弹窗 -->
+    <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
+          :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="goodsTotal > 0"
+          :total="goodsTotal"
+          :page.sync="queryGoodParams.pageNum"
+          :limit.sync="queryGoodParams.pageSize"
+          @pagination="getStoreProductLists"
+          style="margin-top: 20px;"
+        />
+      </div>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
+        <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>
 </template>
 
 <script>
-import { listLiveGoods, getLiveGoods, delLiveGoods, addLiveGoods, updateLiveGoods, exportLiveGoods } from "@/api/live/liveGoods";
+import { listLiveGoods, getLiveGoods, delLiveGoods, addLiveGoods, handleShelfOrUn, handleDeleteSelected } from "@/api/live/liveGoods";
 
 export default {
-  name: "LiveGoods",
   data() {
     return {
-      //字典
-      goodsStatusOptions: [],
-      // 遮罩层
+      liveId: '',
       loading: true,
-      // 导出遮罩层
-      exportLoading: false,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
+      searchTitle: '',
+      queryGoodParams: {
+        pageNum: 1,
+        pageSize: 10,
+        productName: null,
+        liveId: null
+      },
       // 显示搜索条件
       showSearch: true,
-      // 总条数
-      total: 0,
-      // 直播商品表格数据
-      liveGoodsList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
+      goodsLiveList: [],
+      goodsLiveTotal: 0,
+      goodsParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null
+      },
+      goodsList: [],
+      goodsTotal: 0,
+      selectedGoods: [],
+      goodsLoading: false,
+      goodsDialogVisible: false,
+      multipleSelection: [],
+      allChecked: false,
+      isIndeterminate: false,
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        liveId: null,
-        goodsName: null,
-        goodsDesc: null,
-        imgUrl: null,
-        images: null,
-        price: null,
-        opPrice: null,
+        keywords: null,
         status: null,
-        stock: null,
-        sort: null,
+        liveId: null,
+        desc: null,
+        createTime: null,
+        updateTime: null,
       },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-      }
     };
   },
   created() {
-    this.getList();
-    this.getDicts("sys_live_goods_show").then(response => {
-      this.goodsStatusOptions = response.data;
-    });
+    this.liveId = this.$route.query.liveId
+    this.goodsParams.liveId = this.liveId
+    this.queryParams.liveId = this.liveId
+    this.getLiveGoodsList();
   },
   methods: {
-    /** 查询直播商品列表 */
-    getList() {
-      this.loading = true;
-      listLiveGoods(this.queryParams).then(response => {
-        this.liveGoodsList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    goodsStatusFormatter(row, column) {
-        return this.selectDictLabel(this.statusOptions, row.status);
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        goodsId: null,
-        liveId: null,
-        goodsName: null,
-        goodsDesc: null,
-        imgUrl: null,
-        images: null,
-        price: null,
-        opPrice: null,
-        status: 0,
-        stock: null,
-        sort: null,
-        createTime: null,
-        createBy: null,
-        updateBy: null,
-        updateTime: null,
-        remark: null
-      };
-      this.resetForm("form");
-    },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
-      this.getList();
+      this.loading = true
+      listLiveGoods(this.queryParams).then(response => {
+        this.goodsLiveList = response.rows
+        this.goodsLiveTotal = response.total
+        this.loading = false
+      })
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.$refs.queryForm.resetFields();
+    },
+    handleShelf(){
+      this.handleShelfOrUn(1)
+    },
+    handleUnshelf(){
+      this.handleShelfOrUn(0)
+    },
+    handleShelfOrUn(type){
+      if (this.multipleSelection.length > 0) {
+        const goodsList = this.getSelectedList();
+        handleShelfOrUn({"goodsIds":goodsList,"status":type,"liveId":this.liveId}).then(res=>{
+          this.dealResult(res)
+        })
+      } else {
+        this.$message.info("请选择下架商品!")
+      }
+    },
+    handleDeleteSelected(){
+      if (this.multipleSelection.length > 0) {
+        const goodsList = this.getSelectedList();
+        handleDeleteSelected({"goodsIds":goodsList}).then(res=>{
+          this.dealResult(res)
+        })
+      } else {
+        this.$message.info("请选择被删除的商品!")
+      }
+    },
+    dealResult(res){
+      if (res.code == 200) {
+        this.getLiveGoodsList();
+        this.$refs.goodTable.clearSelection();
+      } else {
+        this.$message.error(res.msg);
+      }
+    },
+    getSelectedList(){
+      var goodsList = []
+      this.multipleSelection.forEach(item => {
+        goodsList.push(item.goodsId);
+      })
+      return goodsList;
+    },
+    // 全选或取消全选
+    toggleSelectAll(val) {
+      this.checked = val; // 更新 checkbox 的状态
+      if (val) {
+        // 如果 checkbox 被选中,则全选
+        this.toggleSelection(this.goodsLiveList);
+      } else {
+        // 如果 checkbox 被取消选中,则取消全选
+        this.toggleSelection();
+      }
+    },
+    toggleSelection(rows) {
+      if (rows && !this.isIndeterminate) {
+        rows.forEach(row => {
+          this.$refs.goodTable.toggleRowSelection(row);
+        });
+      } else {
+        this.$refs.goodTable.clearSelection();
+      }
     },
     // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.goodsId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+      // 根据选择项的数量更新 checkbox 的状态
+      this.allChecked = val.length === this.goodsLiveList.length;
+      this.isIndeterminate = val.length > 0 && val.length < this.goodsLiveList.length;
+    },
+
+    getLiveGoodsList() {
+      this.loading = true
+      listLiveGoods(this.goodsParams).then(response => {
+        this.goodsLiveList = response.rows
+        this.goodsLiveTotal = response.total
+        this.loading = false
+      })
+    },
+    handleAddLiveGoods(){
+      this.goodsDialogVisible = true;
+      this.getStoreProductLists()
     },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加直播商品";
+    handleGoodsSearch(){
+      this.queryGoodParams.pageNum = 1
+      this.queryGoodParams.productName = this.searchTitle
+      this.getStoreProductLists()
     },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const goodsId = row.goodsId || this.ids
-      getLiveGoods(goodsId).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改直播商品";
-      });
+    handleGoodsChange(goods) {
+      this.selectedGoods = goods
     },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.goodsId != null) {
-            updateLiveGoods(this.form).then(response => {
-              this.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addLiveGoods(this.form).then(response => {
-              this.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
+    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()
+      })
+    },
+    handleGoodDelete(row){
+      delLiveGoods(row.goodsId).then(response => {
+        this.getLiveGoodsList()
+      })
     },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const goodsIds = row.goodsId || this.ids;
-      this.$confirm('是否确认删除直播商品编号为"' + goodsIds + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delLiveGoods(goodsIds);
-        }).then(() => {
-          this.getList();
-          this.msgSuccess("删除成功");
-        }).catch(() => {});
+    /** 处理行点击事件 */
+    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)
     },
-    /** 导出按钮操作 */
-    handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有直播商品数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportLiveGoods(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+    getStoreProductLists() {
+      this.queryGoodParams.liveId = this.liveId
+      listStoreProduct(this.queryGoodParams).then(response => {
+        this.goodsList = response.rows
+        this.goodsTotal = response.total
+        this.loading = false
+      })
     }
+
   }
 };
 </script>
+
+
+<style scoped>
+.selection-toolbar {
+  display: flex;
+  align-items: center;
+  margin-bottom: 10px;
+  padding-left: 10px;
+}
+
+.selection-toolbar .el-checkbox {
+  margin-right: 10px;
+}
+
+/* 调整 checkbox 内部输入框的对齐 */
+.selection-toolbar .el-checkbox .el-checkbox__inner {
+  top: 8px; /* 根据实际需求调整 */
+}
+
+.live-goods-css {
+  padding-left: 10px;
+  padding-top: 30px;
+}
+</style>

+ 2 - 2
src/views/live/liveLotteryConf/index.vue

@@ -693,13 +693,13 @@ export default {
       };
       updateLiveLotteryConf(doLotteryParam).then(response => {
         if(response.code === 200){
-          this.$store.state.liveWs.sendWs("lottery",response.msg, row.lotteryId,this.liveId);
+          this.$store.state.liveWs[this.liveId].sendWs("lottery",response.msg, row.lotteryId,this.liveId);
+          this.getList();
           this.msgSuccess("修改成功");
         }else{
           this.msgError(response.msg);
         }
           this.open = false;
-          this.getList();
         });
     },
     /** 提交按钮 */

+ 113 - 460
src/views/live/liveOrder/index.vue

@@ -1,28 +1,19 @@
 <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-form-item label="订单号" prop="orderSn">
         <el-input
-          v-model="queryParams.liveId"
-          placeholder="请输入直播ID"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="店铺ID" prop="storeId">
-        <el-input
-          v-model="queryParams.storeId"
-          placeholder="请输入店铺ID"
+          v-model="queryParams.orderSn"
+          placeholder="请输入订单号"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="订单号" prop="orderCode">
+      <el-form-item label="用户ID" prop="userId">
         <el-input
-          v-model="queryParams.orderCode"
-          placeholder="请输入订单号"
+          v-model="queryParams.userId"
+          placeholder="请输入用户ID"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
@@ -37,203 +28,84 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="收货电话" prop="userPhone">
+      <el-form-item label="手机号" prop="mobile">
         <el-input
-          v-model="queryParams.userPhone"
-          placeholder="请输入收货人电话"
+          v-model="queryParams.mobile"
+          placeholder="请输入手机号"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="订单总价" prop="totalPrice">
-        <el-input
-          v-model="queryParams.totalPrice"
-          placeholder="请输入订单总价"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="支付方式" prop="payType">
-        <el-select v-model="queryParams.payType" placeholder="请选择支付方式" clearable size="small">
-          <el-option v-for="(item,index) in livePayTypeOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="订单状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择订单状态" clearable size="small">
-          <el-option v-for="(item,index) in orderStatusOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="退款状态" prop="refundStatus">
-        <el-select v-model="queryParams.refundStatus" placeholder="请选择退款状态" clearable size="small">
-            <el-option v-for="(item,index) in liveRefundStatusOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="退款时间" prop="refundTime">
-        <el-date-picker clearable size="small"
-                        v-model="queryParams.refundTime"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择退款时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="退款金额" prop="refundMoney">
+      <el-form-item label="地址" prop="address">
         <el-input
-          v-model="queryParams.refundMoney"
-          placeholder="请输入退款金额"
+          v-model="queryParams.address"
+          placeholder="请输入地址"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="快递单号" prop="deliverySn">
+      <el-form-item label="支付金额" prop="payMoney">
         <el-input
-          v-model="queryParams.deliverySn"
-          placeholder="请输入快递单号"
+          v-model="queryParams.payMoney"
+          placeholder="请输入支付金额"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="核销码" prop="verifyCode">
+      <el-form-item label="订单金额" prop="orderMoney">
         <el-input
-          v-model="queryParams.verifyCode"
-          placeholder="请输入核销码"
+          v-model="queryParams.orderMoney"
+          placeholder="请输入订单金额"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="结束时间" prop="finishTime">
-        <el-date-picker clearable size="small"
-                        v-model="queryParams.finishTime"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择结束时间">
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="收货电话" prop="userPhone">
+      <el-form-item label="物流编号" prop="deliveryCode">
         <el-input
-          v-model="queryParams.userPhone"
-          placeholder="请输入收货人电话"
+          v-model="queryParams.deliveryCode"
+          placeholder="请输入物流编号"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-<!--      <el-form-item label="推广佣金" prop="tuiMoney">
+      <el-form-item label="物流名称" prop="deliveryName">
         <el-input
-          v-model="queryParams.tuiMoney"
-          placeholder="请输入推广佣金"
+          v-model="queryParams.deliveryName"
+          placeholder="请输入物流名称"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="推广佣金状态 1已发放 0待发放" prop="tuiMoneyStatus">
-        <el-select v-model="queryParams.tuiMoneyStatus" placeholder="请选择推广佣金状态 1已发放 0待发放" clearable size="small">
-          <el-option label="请选择字典生成" value="" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="上级推荐人ID" prop="tuiUserId">
-        <el-input
-          v-model="queryParams.tuiUserId"
-          placeholder="请输入上级推荐人ID"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>-->
-<!--      <el-form-item label="优惠金额" prop="userCouponId">
+      <el-form-item label="物流单号" prop="deliverySn">
         <el-input
-          v-model="queryParams.userCouponId"
-          placeholder="请输入优惠金额"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>-->
-      <el-form-item label="销售公司" prop="companyId">
-        <el-input
-          v-model="queryParams.companyId"
-          placeholder="请输入公司id"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="员工id" prop="companyUserId">
-        <el-input
-          v-model="queryParams.companyUserId"
-          placeholder="请输入公司员工id"
+          v-model="queryParams.deliverySn"
+          placeholder="请输入物流单号"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="物流状态" prop="deliveryStatus">
-        <el-select v-model="queryParams.deliveryStatus" placeholder="请选择物流状态" clearable size="small">
-          <el-option v-for="(item,index) in deliveryStatusOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="跟踪状态" prop="deliveryType">
-        <el-select v-model="queryParams.deliveryType" placeholder="请选择物流跟踪状态" clearable size="small">
-          <el-option label="请选择字典生成" value="" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="发货时间" prop="deliverySendTime">
+      <el-form-item label="支付时间" prop="payTime">
         <el-date-picker clearable size="small"
-                        v-model="queryParams.deliverySendTime"
-                        type="date"
-                        value-format="yyyy-MM-dd"
-                        placeholder="选择发货时间">
+          v-model="queryParams.payTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择支付时间">
         </el-date-picker>
       </el-form-item>
-      <el-form-item label="是否售后" prop="isAfterSales">
-        <el-input
-          v-model="queryParams.isAfterSales"
-          placeholder="请输入是否可售后"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="部门id" prop="deptId">
-        <el-input
-          v-model="queryParams.deptId"
-          placeholder="请输入部门id"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="渠道" prop="channel">
-        <el-input
-          v-model="queryParams.channel"
-          placeholder="请输入渠道"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="订单来源" prop="source">
-        <el-input
-          v-model="queryParams.source"
-          placeholder="请输入订单来源"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item label="是否改价" prop="isEditMoney">
-        <el-input
-          v-model="queryParams.isEditMoney"
-          placeholder="请输入是否改价"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="完成时间" prop="finishTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.finishTime"
+          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>
@@ -242,6 +114,7 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
+
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -255,103 +128,44 @@
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
-
+    <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
+      <el-tab-pane label="全部订单" name="10"></el-tab-pane>
+      <el-tab-pane v-for="(item,index) in orderOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
+    </el-tabs>
     <el-table border v-loading="loading" :data="liveOrderList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="订单ID" align="center" prop="orderId" />
-      <el-table-column label="直播ID" align="center" prop="liveId" />
-      <el-table-column label="店铺ID" align="center" prop="storeId" />
-      <el-table-column label="订单号" align="center" prop="orderCode" />
-      <el-table-column label="用户id" align="center" prop="userId" />
+      <el-table-column label="订单ID" align="center" prop="orderId"/>
+      <el-table-column label="订单号" align="center" prop="orderSn" />
+      <el-table-column label="用户ID" align="center" prop="userId" />
       <el-table-column label="收货人" align="center" prop="userName" />
-      <el-table-column label="收货人电话" align="center" prop="userPhone" />
-      <el-table-column label="详细地址" align="center" prop="userAddress" />
-      <el-table-column label="购物车id" align="center" prop="cartId" />
-      <el-table-column label="订单商品总数" align="center" prop="totalNum" />
-      <el-table-column label="订单总价" align="center" prop="totalPrice" />
-      <el-table-column label="实际支付金额" align="center" prop="payPrice" />
+      <el-table-column label="手机号" align="center" prop="mobile" />
+      <el-table-column label="地址" align="center" prop="address" />
       <el-table-column label="支付金额" align="center" prop="payMoney" />
-      <el-table-column label="支付状态" align="center" prop="isPay" :formatter="liveIsPayFormatter"/>
+      <el-table-column label="订单金额" align="center" prop="orderMoney" />
+      <el-table-column label="物流编号" align="center" prop="deliveryCode" />
+      <el-table-column label="物流名称" align="center" prop="deliveryName" />
+      <el-table-column label="物流单号" align="center" prop="deliverySn" />
       <el-table-column label="支付时间" align="center" prop="payTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="支付方式" align="center" prop="payType" :formatter="livePayTypeFormatter"/>
-      <el-table-column label="订单状态" align="center" prop="status" :formatter="orderStatusFormatter"/>
-      <el-table-column label="退款状态" align="center" prop="refundStatus" :formatter="liveRefundStatusFormatter"/>
-      <el-table-column label="退款图片" align="center" prop="refundImg" />
-      <el-table-column label="退款用户说明" align="center" prop="refundExplain" />
-      <el-table-column label="退款时间" align="center" prop="refundTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.refundTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="不退款的理由" align="center" prop="refundReason" />
-      <el-table-column label="退款金额" align="center" prop="refundMoney" />
-      <el-table-column label="快递公司编号" align="center" prop="deliveryCode" />
-      <el-table-column label="快递名称" align="center" prop="deliveryName" />
-      <el-table-column label="快递单号" align="center" prop="deliverySn" />
-      <el-table-column label="备注" align="center" prop="remark" />
-      <el-table-column label="是否删除" align="center" prop="isDel" />
-      <el-table-column label="成本价" align="center" prop="costPrice" />
-      <el-table-column label="核销码" align="center" prop="verifyCode" />
-      <el-table-column label="配送方式" align="center" prop="shippingType" :formatter="liveShippingTypeFormatter"/>
-      <el-table-column label="支付渠道" align="center" prop="isChannel" />
-      <el-table-column label="结束时间" align="center" prop="finishTime" width="180">
+      <el-table-column label="完成时间" align="center" prop="finishTime" width="180">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.finishTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="发货时间" align="center" prop="deliveryTime" />
-      <el-table-column label="推广佣金" align="center" prop="tuiMoney" />
-      <el-table-column label="推广佣金状态" align="center" prop="tuiMoneyStatus" :formatter="liveTuiMoneyStatusFormatter"/>
-      <el-table-column label="上级推荐人ID" align="center" prop="tuiUserId" />
-      <el-table-column label="优惠金额" align="center" prop="discountMoney" />
-      <el-table-column label="优惠金额" align="center" prop="userCouponId" />
-      <el-table-column label="公司id" align="center" prop="companyId" />
-      <el-table-column label="公司员工id" align="center" prop="companyUserId" />
-      <el-table-column label="仓库代码" align="center" prop="storeHouseCode" />
-      <el-table-column label="扩展订单ID" align="center" prop="extendOrderId" />
-      <el-table-column label="支付运费" align="center" prop="payDelivery" />
-      <el-table-column label="剩余金额" align="center" prop="payRemain" />
-      <el-table-column label="物流状态" align="center" prop="deliveryStatus" :formatter="deliveryStatusFormat"/>
-      <el-table-column label="物流结算状态" align="center" prop="deliveryPayStatus" />
-      <el-table-column label="物流结算状态" align="center" prop="deliveryPayTime" />
-      <el-table-column label="物流跟踪状态" align="center" prop="deliveryType" />
-      <el-table-column label="物流结算金额" align="center" prop="deliveryPayMoney" />
-      <el-table-column label="回单导入时间" align="center" prop="deliveryImportTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.deliveryImportTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="发货时间" align="center" prop="deliverySendTime" width="180">
-        <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.deliverySendTime, '{y}-{m}-{d}') }}</span>
-        </template>
-      </el-table-column>
-      <el-table-column label="是否可售后" align="center" prop="isAfterSales" />
-      <el-table-column label="部门id" align="center" prop="deptId" />
-      <el-table-column label="渠道" align="center" prop="channel" />
-      <el-table-column label="订单来源" align="center" prop="source" />
-      <el-table-column label="开票金额" align="center" prop="billPrice" />
-      <el-table-column label="邮费" align="center" prop="totalPostage" />
-      <el-table-column label="支付邮费" align="center" prop="payPostage" />
-      <el-table-column label="消费赚取积分" align="center" prop="gainIntegral" />
-      <el-table-column label="使用积分" align="center" prop="useIntegral" />
-      <el-table-column label="实际支付积分" align="center" prop="payIntegral" />
-      <el-table-column label="给用户退了多少积分" align="center" prop="backIntegral" />
-      <el-table-column label="是否改价" align="center" prop="isEditMoney" />
-      <el-table-column label="取消理由" align="center" prop="cancelReason" />
+      <el-table-column label="状态" align="center" prop="status" :formatter="orderStatusFormatter"/>
+      <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
             size="mini"
             type="text"
-            icon="el-icon-location"
-            @click="showExpress(scope.row)"
-            v-hasPermi="['live:liveOrder:express']"
-          >物流信息</el-button>
+            icon="el-icon-edit"
+            @click="handledetails(scope.row)"
+            v-hasPermi="['live:liveOrder:edit']"
+          >查看</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -363,62 +177,27 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
+    <el-drawer
+      :with-header="false"
+      size="75%"
+      :title="show.title" :visible.sync="show.open">
+      <liveOrderDetails  ref="Details" />
+    </el-drawer>
 
-    <el-dialog :title="expressDialog.title" :visible.sync="expressDialog.open" width="600px" append-to-body>
-      <el-table style="margin-top: 20px;width: 100%"
-                ref="orderHistoryTable"
-                :data="traces" border>
-        <el-table-column label="操作时间"  width="160" align="center">
-          <template slot-scope="scope">
-            {{scope.row.AcceptTime}}
-          </template>
-        </el-table-column>
-        <el-table-column label="位置" align="center">
-          <template slot-scope="scope">
-            {{scope.row.Location}}
-          </template>
-        </el-table-column>
-        <el-table-column label="描述" align="center">
-          <template slot-scope="scope">
-            {{scope.row.AcceptStation}}
-          </template>
-        </el-table-column>
-      </el-table>
-    </el-dialog>
   </div>
 </template>
 
 <script>
-import { listLiveOrder,exportLiveOrder } from "@/api/live/liveOrder";
-import { getExpress} from '@/api/live/liveOrder'
-import { parseTime } from '../../../utils/common'
+import { listLiveOrder, exportLiveOrder } from "@/api/live/liveOrder";
+import liveOrderDetails from './liveOrderDetails.vue';
 
 export default {
   name: "LiveOrder",
+  components: { liveOrderDetails },
   data() {
     return {
       //字典
       orderStatusOptions: [],
-      livePayTypeOptions: [],
-      liveRefundStatusOptions: [],
-      deliveryStatusOptions:[],
-      liveIsPayOptions:[],
-      liveShippingTypeOptions:[],
-      liveTuiMoneyStatusOptions:[],
-      //用户
-      userOptions: [],
-      loadingUser:false,
-      //用户查询参数
-      userParams: {
-        nickName:null
-      },
-      //物流
-      express:null,
-      traces:[],
-      expressDialog:{
-        title:"物流信息",
-        open:false,
-      },
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -435,136 +214,61 @@ export default {
       total: 0,
       // 订单表格数据
       liveOrderList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
       // 查询参数
       queryParams: {
         pageNum: 1,
-        pageSize: 10,
         liveId: null,
-        storeId: null,
-        orderCode: null,
+        pageSize: 10,
+        orderSn: null,
         userId: null,
         userName: null,
-        userPhone: null,
-        userAddress: null,
-        cartId: null,
-        totalNum: null,
-        totalPrice: null,
-        payPrice: null,
+        mobile: null,
+        address: null,
         payMoney: null,
-        isPay: null,
-        payTime: null,
-        payType: null,
-        status: null,
-        refundStatus: null,
-        refundImg: null,
-        refundExplain: null,
-        refundTime: null,
-        refundReason: null,
-        refundMoney: null,
+        orderMoney: null,
         deliveryCode: null,
         deliveryName: null,
         deliverySn: null,
-        isDel: null,
-        costPrice: null,
-        verifyCode: null,
-        shippingType: null,
-        isChannel: null,
+        payTime: null,
         finishTime: null,
-        deliveryTime: null,
-        tuiMoney: null,
-        tuiMoneyStatus: null,
-        tuiUserId: null,
-        itemJson: null,
-        discountMoney: null,
-        userCouponId: null,
-        companyId: null,
-        companyUserId: null,
-        storeHouseCode: null,
-        extendOrderId: null,
-        payDelivery: null,
-        payRemain: null,
-        deliveryStatus: null,
-        deliveryPayStatus: null,
-        deliveryPayTime: null,
-        deliveryType: null,
-        deliveryPayMoney: null,
-        deliveryImportTime: null,
-        deliverySendTime: null,
-        isAfterSales: null,
-        deptId: null,
-        channel: null,
-        source: null,
-        billPrice: null,
-        totalPostage: null,
-        payPostage: null,
-        gainIntegral: null,
-        useIntegral: null,
-        payIntegral: null,
-        backIntegral: null,
-        isEditMoney: null
+        status: null,
+      },
+      orderOptions:[],
+      actName:"10",
+      show:{
+        title:"订单详情",
+        open:false,
       },
-      // 表单校验
-      rules: {
-        orderCode: [
-          { required: true, message: "订单号不能为空", trigger: "blur" }
-        ],
-        userId: [
-          { required: true, message: "用户id不能为空", trigger: "change" }
-        ],
-        totalNum: [
-          { required: true, message: "订单商品总数不能为空", trigger: "blur" }
-        ],
-        totalPrice: [
-          { required: true, message: "订单总价不能为空", trigger: "blur" }
-        ],
-        payPrice: [
-          { required: true, message: "实际支付金额不能为空", trigger: "blur" }
-        ],
-        status: [
-          { required: true, message: "订单状态不能为空", trigger: "blur" }
-        ],
-        totalPostage: [
-          { required: true, message: "邮费不能为空", trigger: "blur" }
-        ],
-        payPostage: [
-          { required: true, message: "支付邮费不能为空", trigger: "blur" }
-        ],
-      }
     };
   },
   created() {
+    this.queryParams.liveId = this.$route.query.liveId
     this.getList();
     this.getDicts("sys_live_order_status").then(response => {
       this.orderStatusOptions = response.data;
     });
-    this.getDicts("sys_live_pay_type").then(response => {
-      this.livePayTypeOptions = response.data;
-    });
-    this.getDicts("sys_live_refund_status").then(response => {
-      this.liveRefundStatusOptions = response.data;
-    });
-    this.getDicts("sys_store_order_delivery_status").then(response => {
-      this.deliveryStatusOptions = response.data;
-    });
-    //isPay
-    this.getDicts("sys_live_is_pay").then(response => {
-      this.liveIsPayOptions = response.data;
+    this.getDicts("sys_order_status").then(response => {
+      this.orderOptions = response.data;
     });
-    //sys_live_shipping_type
-    this.getDicts("sys_live_shipping_type").then(response => {
-      this.liveShippingTypeOptions = response.data;
-    });
-    //sys_live_tui_money_status
-    this.getDicts("sys_live_tui_money_status").then(response => {
-      this.liveTuiMoneyStatusOptions = response.data;
-    })
   },
   methods: {
-    parseTime,
+    // 查看详情
+    handledetails(row){
+      this.show.open=true;
+      setTimeout(() => {
+        this.$refs.Details.getDetails(row.orderId,row.nickName,row.storeName);
+      }, 1);
+    },
+    // 订单tab切换
+    handleClickX(tab, event) {
+      this.orderStatus = tab.name;
+      if(tab.name=="10"){
+        this.queryParams.status=null;
+      }else{
+        this.queryParams.status=tab.name;
+      }
+      this.handleQuery();
+    },
     /** 查询订单列表 */
     getList() {
       this.loading = true;
@@ -577,28 +281,6 @@ export default {
     orderStatusFormatter(row, column) {
       return this.selectDictLabel(this.orderStatusOptions, row.status);
     },
-    livePayTypeFormatter(row, column) {
-      return this.selectDictLabel(this.livePayTypeOptions, row.payType);
-    },
-    liveRefundStatusFormatter(row, column) {
-      return this.selectDictLabel(this.liveRefundStatusOptions, row.payType);
-    },
-    //liveTuiMoneyStatusOptions
-    liveTuiMoneyStatusFormatter(row, column) {
-      return this.selectDictLabel(this.liveTuiMoneyStatusOptions, row.status);
-    },
-    //liveShippingTypeOptions
-    liveShippingTypeFormatter(row, column) {
-      return this.selectDictLabel(this.liveShippingTypeOptions, row.shippingType);
-    },
-    //liveIsPayOptions
-    liveIsPayFormatter(row, column) {
-      return this.selectDictLabel(this.liveIsPayOptions, row.isPay);
-    },
-    //deliveryStatusOptions
-    deliveryStatusFormat(row, column) {
-      return this.selectDictLabel(this.deliveryStatusOptions, row.deliveryStatus);
-    },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
@@ -619,46 +301,17 @@ export default {
     handleExport() {
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有订单数据项?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        this.exportLoading = true;
-        return exportLiveOrder(queryParams);
-      }).then(response => {
-        this.download(response.msg);
-        this.exportLoading = false;
-      }).catch(() => {
-      });
-    },
-    showExpress(row){
-      this.expressDialog.open=true;
-      getExpress(row.orderId).then(response => {
-        this.express = response.data;
-        if(this.express!=null&&this.express.Traces!=null){
-          this.traces=this.express.Traces
-        }
-      });
-    }/* ,
-    syncExpress(){
-      var that=this;
-      this.$confirm('确定同步物流状态吗', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(function() {
-        const data = that.item.orderId
-        return syncExpress(data);
-      }).then(() => {
-        this.msgSuccess("操作成功");
-        this.expressDialog.open=false
-        getLiveOrder(this.item.orderId).then(response => {
-          this.item=response.data
-          that.getlogList(this.item.orderId);
-          that.$parent.$parent.getList();
-        });
-      }).catch(function() {});
-    } */
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveOrder(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
   }
 };
 </script>

+ 664 - 0
src/views/live/liveOrder/index_backup.vue

@@ -0,0 +1,664 @@
+<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="storeId">
+        <el-input
+          v-model="queryParams.storeId"
+          placeholder="请输入店铺ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <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="收货人" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入收货人"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="收货电话" prop="userPhone">
+        <el-input
+          v-model="queryParams.userPhone"
+          placeholder="请输入收货人电话"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="订单总价" prop="totalPrice">
+        <el-input
+          v-model="queryParams.totalPrice"
+          placeholder="请输入订单总价"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="支付方式" prop="payType">
+        <el-select v-model="queryParams.payType" placeholder="请选择支付方式" clearable size="small">
+          <el-option v-for="(item,index) in livePayTypeOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="订单状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择订单状态" clearable size="small">
+          <el-option v-for="(item,index) in orderStatusOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="退款状态" prop="refundStatus">
+        <el-select v-model="queryParams.refundStatus" placeholder="请选择退款状态" clearable size="small">
+            <el-option v-for="(item,index) in liveRefundStatusOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="退款时间" prop="refundTime">
+        <el-date-picker clearable size="small"
+                        v-model="queryParams.refundTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择退款时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="退款金额" prop="refundMoney">
+        <el-input
+          v-model="queryParams.refundMoney"
+          placeholder="请输入退款金额"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="快递单号" prop="deliverySn">
+        <el-input
+          v-model="queryParams.deliverySn"
+          placeholder="请输入快递单号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="核销码" prop="verifyCode">
+        <el-input
+          v-model="queryParams.verifyCode"
+          placeholder="请输入核销码"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="结束时间" prop="finishTime">
+        <el-date-picker clearable size="small"
+                        v-model="queryParams.finishTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择结束时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="收货电话" prop="userPhone">
+        <el-input
+          v-model="queryParams.userPhone"
+          placeholder="请输入收货人电话"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+<!--      <el-form-item label="推广佣金" prop="tuiMoney">
+        <el-input
+          v-model="queryParams.tuiMoney"
+          placeholder="请输入推广佣金"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="推广佣金状态 1已发放 0待发放" prop="tuiMoneyStatus">
+        <el-select v-model="queryParams.tuiMoneyStatus" placeholder="请选择推广佣金状态 1已发放 0待发放" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="上级推荐人ID" prop="tuiUserId">
+        <el-input
+          v-model="queryParams.tuiUserId"
+          placeholder="请输入上级推荐人ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>-->
+<!--      <el-form-item label="优惠金额" prop="userCouponId">
+        <el-input
+          v-model="queryParams.userCouponId"
+          placeholder="请输入优惠金额"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>-->
+      <el-form-item label="销售公司" prop="companyId">
+        <el-input
+          v-model="queryParams.companyId"
+          placeholder="请输入公司id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="员工id" prop="companyUserId">
+        <el-input
+          v-model="queryParams.companyUserId"
+          placeholder="请输入公司员工id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="物流状态" prop="deliveryStatus">
+        <el-select v-model="queryParams.deliveryStatus" placeholder="请选择物流状态" clearable size="small">
+          <el-option v-for="(item,index) in deliveryStatusOptions" :key="item.dictValue+index" :label="item.dictLabel" :value="item.dictValue" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="跟踪状态" prop="deliveryType">
+        <el-select v-model="queryParams.deliveryType" placeholder="请选择物流跟踪状态" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="发货时间" prop="deliverySendTime">
+        <el-date-picker clearable size="small"
+                        v-model="queryParams.deliverySendTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择发货时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="是否售后" prop="isAfterSales">
+        <el-input
+          v-model="queryParams.isAfterSales"
+          placeholder="请输入是否可售后"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="部门id" prop="deptId">
+        <el-input
+          v-model="queryParams.deptId"
+          placeholder="请输入部门id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="渠道" prop="channel">
+        <el-input
+          v-model="queryParams.channel"
+          placeholder="请输入渠道"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="订单来源" prop="source">
+        <el-input
+          v-model="queryParams.source"
+          placeholder="请输入订单来源"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="是否改价" prop="isEditMoney">
+        <el-input
+          v-model="queryParams.isEditMoney"
+          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>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['live:liveOrder:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveOrderList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="订单ID" align="center" prop="orderId" />
+      <el-table-column label="直播ID" align="center" prop="liveId" />
+      <el-table-column label="店铺ID" align="center" prop="storeId" />
+      <el-table-column label="订单号" align="center" prop="orderCode" />
+      <el-table-column label="用户id" align="center" prop="userId" />
+      <el-table-column label="收货人" align="center" prop="userName" />
+      <el-table-column label="收货人电话" align="center" prop="userPhone" />
+      <el-table-column label="详细地址" align="center" prop="userAddress" />
+      <el-table-column label="购物车id" align="center" prop="cartId" />
+      <el-table-column label="订单商品总数" align="center" prop="totalNum" />
+      <el-table-column label="订单总价" align="center" prop="totalPrice" />
+      <el-table-column label="实际支付金额" align="center" prop="payPrice" />
+      <el-table-column label="支付金额" align="center" prop="payMoney" />
+      <el-table-column label="支付状态" align="center" prop="isPay" :formatter="liveIsPayFormatter"/>
+      <el-table-column label="支付时间" align="center" prop="payTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.payTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="支付方式" align="center" prop="payType" :formatter="livePayTypeFormatter"/>
+      <el-table-column label="订单状态" align="center" prop="status" :formatter="orderStatusFormatter"/>
+      <el-table-column label="退款状态" align="center" prop="refundStatus" :formatter="liveRefundStatusFormatter"/>
+      <el-table-column label="退款图片" align="center" prop="refundImg" />
+      <el-table-column label="退款用户说明" align="center" prop="refundExplain" />
+      <el-table-column label="退款时间" align="center" prop="refundTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.refundTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="不退款的理由" align="center" prop="refundReason" />
+      <el-table-column label="退款金额" align="center" prop="refundMoney" />
+      <el-table-column label="快递公司编号" align="center" prop="deliveryCode" />
+      <el-table-column label="快递名称" align="center" prop="deliveryName" />
+      <el-table-column label="快递单号" align="center" prop="deliverySn" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="是否删除" align="center" prop="isDel" />
+      <el-table-column label="成本价" align="center" prop="costPrice" />
+      <el-table-column label="核销码" align="center" prop="verifyCode" />
+      <el-table-column label="配送方式" align="center" prop="shippingType" :formatter="liveShippingTypeFormatter"/>
+      <el-table-column label="支付渠道" align="center" prop="isChannel" />
+      <el-table-column label="结束时间" align="center" prop="finishTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.finishTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="发货时间" align="center" prop="deliveryTime" />
+      <el-table-column label="推广佣金" align="center" prop="tuiMoney" />
+      <el-table-column label="推广佣金状态" align="center" prop="tuiMoneyStatus" :formatter="liveTuiMoneyStatusFormatter"/>
+      <el-table-column label="上级推荐人ID" align="center" prop="tuiUserId" />
+      <el-table-column label="优惠金额" align="center" prop="discountMoney" />
+      <el-table-column label="优惠金额" align="center" prop="userCouponId" />
+      <el-table-column label="公司id" align="center" prop="companyId" />
+      <el-table-column label="公司员工id" align="center" prop="companyUserId" />
+      <el-table-column label="仓库代码" align="center" prop="storeHouseCode" />
+      <el-table-column label="扩展订单ID" align="center" prop="extendOrderId" />
+      <el-table-column label="支付运费" align="center" prop="payDelivery" />
+      <el-table-column label="剩余金额" align="center" prop="payRemain" />
+      <el-table-column label="物流状态" align="center" prop="deliveryStatus" :formatter="deliveryStatusFormat"/>
+      <el-table-column label="物流结算状态" align="center" prop="deliveryPayStatus" />
+      <el-table-column label="物流结算状态" align="center" prop="deliveryPayTime" />
+      <el-table-column label="物流跟踪状态" align="center" prop="deliveryType" />
+      <el-table-column label="物流结算金额" align="center" prop="deliveryPayMoney" />
+      <el-table-column label="回单导入时间" align="center" prop="deliveryImportTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.deliveryImportTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="发货时间" align="center" prop="deliverySendTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.deliverySendTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="是否可售后" align="center" prop="isAfterSales" />
+      <el-table-column label="部门id" align="center" prop="deptId" />
+      <el-table-column label="渠道" align="center" prop="channel" />
+      <el-table-column label="订单来源" align="center" prop="source" />
+      <el-table-column label="开票金额" align="center" prop="billPrice" />
+      <el-table-column label="邮费" align="center" prop="totalPostage" />
+      <el-table-column label="支付邮费" align="center" prop="payPostage" />
+      <el-table-column label="消费赚取积分" align="center" prop="gainIntegral" />
+      <el-table-column label="使用积分" align="center" prop="useIntegral" />
+      <el-table-column label="实际支付积分" align="center" prop="payIntegral" />
+      <el-table-column label="给用户退了多少积分" align="center" prop="backIntegral" />
+      <el-table-column label="是否改价" align="center" prop="isEditMoney" />
+      <el-table-column label="取消理由" align="center" prop="cancelReason" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-location"
+            @click="showExpress(scope.row)"
+            v-hasPermi="['live:liveOrder:express']"
+          >物流信息</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <el-dialog :title="expressDialog.title" :visible.sync="expressDialog.open" width="600px" append-to-body>
+      <el-table style="margin-top: 20px;width: 100%"
+                ref="orderHistoryTable"
+                :data="traces" border>
+        <el-table-column label="操作时间"  width="160" align="center">
+          <template slot-scope="scope">
+            {{scope.row.AcceptTime}}
+          </template>
+        </el-table-column>
+        <el-table-column label="位置" align="center">
+          <template slot-scope="scope">
+            {{scope.row.Location}}
+          </template>
+        </el-table-column>
+        <el-table-column label="描述" align="center">
+          <template slot-scope="scope">
+            {{scope.row.AcceptStation}}
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveOrder,exportLiveOrder } from "@/api/live/liveOrder";
+import { getExpress} from '@/api/live/liveOrder'
+import { parseTime } from '../../../utils/common'
+
+export default {
+  name: "LiveOrder",
+  data() {
+    return {
+      //字典
+      orderStatusOptions: [],
+      livePayTypeOptions: [],
+      liveRefundStatusOptions: [],
+      deliveryStatusOptions:[],
+      liveIsPayOptions:[],
+      liveShippingTypeOptions:[],
+      liveTuiMoneyStatusOptions:[],
+      //用户
+      userOptions: [],
+      loadingUser:false,
+      //用户查询参数
+      userParams: {
+        nickName:null
+      },
+      //物流
+      express:null,
+      traces:[],
+      expressDialog:{
+        title:"物流信息",
+        open:false,
+      },
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单表格数据
+      liveOrderList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null,
+        storeId: null,
+        orderCode: null,
+        userId: null,
+        userName: null,
+        userPhone: null,
+        userAddress: null,
+        cartId: null,
+        totalNum: null,
+        totalPrice: null,
+        payPrice: null,
+        payMoney: null,
+        isPay: null,
+        payTime: null,
+        payType: null,
+        status: null,
+        refundStatus: null,
+        refundImg: null,
+        refundExplain: null,
+        refundTime: null,
+        refundReason: null,
+        refundMoney: null,
+        deliveryCode: null,
+        deliveryName: null,
+        deliverySn: null,
+        isDel: null,
+        costPrice: null,
+        verifyCode: null,
+        shippingType: null,
+        isChannel: null,
+        finishTime: null,
+        deliveryTime: null,
+        tuiMoney: null,
+        tuiMoneyStatus: null,
+        tuiUserId: null,
+        itemJson: null,
+        discountMoney: null,
+        userCouponId: null,
+        companyId: null,
+        companyUserId: null,
+        storeHouseCode: null,
+        extendOrderId: null,
+        payDelivery: null,
+        payRemain: null,
+        deliveryStatus: null,
+        deliveryPayStatus: null,
+        deliveryPayTime: null,
+        deliveryType: null,
+        deliveryPayMoney: null,
+        deliveryImportTime: null,
+        deliverySendTime: null,
+        isAfterSales: null,
+        deptId: null,
+        channel: null,
+        source: null,
+        billPrice: null,
+        totalPostage: null,
+        payPostage: null,
+        gainIntegral: null,
+        useIntegral: null,
+        payIntegral: null,
+        backIntegral: null,
+        isEditMoney: null
+      },
+      // 表单校验
+      rules: {
+        orderCode: [
+          { required: true, message: "订单号不能为空", trigger: "blur" }
+        ],
+        userId: [
+          { required: true, message: "用户id不能为空", trigger: "change" }
+        ],
+        totalNum: [
+          { required: true, message: "订单商品总数不能为空", trigger: "blur" }
+        ],
+        totalPrice: [
+          { required: true, message: "订单总价不能为空", trigger: "blur" }
+        ],
+        payPrice: [
+          { required: true, message: "实际支付金额不能为空", trigger: "blur" }
+        ],
+        status: [
+          { required: true, message: "订单状态不能为空", trigger: "blur" }
+        ],
+        totalPostage: [
+          { required: true, message: "邮费不能为空", trigger: "blur" }
+        ],
+        payPostage: [
+          { required: true, message: "支付邮费不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getDicts("sys_live_order_status").then(response => {
+      this.orderStatusOptions = response.data;
+    });
+    this.getDicts("sys_live_pay_type").then(response => {
+      this.livePayTypeOptions = response.data;
+    });
+    this.getDicts("sys_live_refund_status").then(response => {
+      this.liveRefundStatusOptions = response.data;
+    });
+    this.getDicts("sys_store_order_delivery_status").then(response => {
+      this.deliveryStatusOptions = response.data;
+    });
+    //isPay
+    this.getDicts("sys_live_is_pay").then(response => {
+      this.liveIsPayOptions = response.data;
+    });
+    //sys_live_shipping_type
+    this.getDicts("sys_live_shipping_type").then(response => {
+      this.liveShippingTypeOptions = response.data;
+    });
+    //sys_live_tui_money_status
+    this.getDicts("sys_live_tui_money_status").then(response => {
+      this.liveTuiMoneyStatusOptions = response.data;
+    })
+  },
+  methods: {
+    parseTime,
+    /** 查询订单列表 */
+    getList() {
+      this.loading = true;
+      listLiveOrder(this.queryParams).then(response => {
+        this.liveOrderList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    orderStatusFormatter(row, column) {
+      return this.selectDictLabel(this.orderStatusOptions, row.status);
+    },
+    livePayTypeFormatter(row, column) {
+      return this.selectDictLabel(this.livePayTypeOptions, row.payType);
+    },
+    liveRefundStatusFormatter(row, column) {
+      return this.selectDictLabel(this.liveRefundStatusOptions, row.payType);
+    },
+    //liveTuiMoneyStatusOptions
+    liveTuiMoneyStatusFormatter(row, column) {
+      return this.selectDictLabel(this.liveTuiMoneyStatusOptions, row.status);
+    },
+    //liveShippingTypeOptions
+    liveShippingTypeFormatter(row, column) {
+      return this.selectDictLabel(this.liveShippingTypeOptions, row.shippingType);
+    },
+    //liveIsPayOptions
+    liveIsPayFormatter(row, column) {
+      return this.selectDictLabel(this.liveIsPayOptions, row.isPay);
+    },
+    //deliveryStatusOptions
+    deliveryStatusFormat(row, column) {
+      return this.selectDictLabel(this.deliveryStatusOptions, row.deliveryStatus);
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.orderId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有订单数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportLiveOrder(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {
+      });
+    },
+    showExpress(row){
+      this.expressDialog.open=true;
+      getExpress(row.orderId).then(response => {
+        this.express = response.data;
+        if(this.express!=null&&this.express.Traces!=null){
+          this.traces=this.express.Traces
+        }
+      });
+    }/* ,
+    syncExpress(){
+      var that=this;
+      this.$confirm('确定同步物流状态吗', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        const data = that.item.orderId
+        return syncExpress(data);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+        this.expressDialog.open=false
+        getLiveOrder(this.item.orderId).then(response => {
+          this.item=response.data
+          that.getlogList(this.item.orderId);
+          that.$parent.$parent.getList();
+        });
+      }).catch(function() {});
+    } */
+  }
+};
+</script>

+ 912 - 0
src/views/live/liveOrder/liveOrderDetails.vue

@@ -0,0 +1,912 @@
+<template>
+  <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
+    <div style="padding: 20px; background-color: #fff;">
+      订单详情
+    </div>
+    <div class="contentx" v-if="item!=null">
+      <div class="desct"></div>
+      <div class="order-status" v-if="item!=null" >
+        <el-steps  :active="item.status==4?item.status:item.status" align-center finish-status="success">
+          <el-step title="待支付"></el-step>
+          <el-step title="待发货"></el-step>
+          <el-step title="待收货"></el-step>
+          <el-step title="已完成"></el-step>
+        </el-steps>
+      </div>
+      <el-card shadow="never" style="margin-top: 15px">
+        <div class="operate-container"  v-if="item!=null">
+               <span style="margin-left: 20px" class="color-danger">订单状态:
+                  <el-tag prop="status" v-for="(ite, index) in orderOptions"    v-if="item.status==ite.dictValue">{{ite.dictLabel}}</el-tag>
+               </span>
+<!--          <div class="operate-button-container" v-if="item.status==3">-->
+<!--            <el-button size="mini" @click="finishOrder()" v-hasPermi="['his:liveOrder:good']">确认收货</el-button>-->
+<!--          </div>-->
+          <div class="operate-button-container"  v-if="item.status==2&&item.orderType==1">
+            <el-button size="mini" @click="sendVisible=true" v-hasPermi="['his:liveOrder:sendGoods']">发货</el-button>
+          </div>
+          <div class="operate-button-container"  v-if="item.status==2&&item.orderType==2">
+            <el-button size="mini" @click="tuiOrder()" v-hasPermi="['his:liveOrder:sendHisGoods']" >推送订单</el-button>
+          </div>
+<!--          <div class="operate-button-container" v-if="item.inquiryOrderId!=null&&item.inquiryOrderId!=''" v-hasPermi="['his:liveOrder:inquiry']">-->
+<!--            <el-button size="mini" @click="getInquiryOrder()" >问诊订单</el-button>-->
+<!--          </div>-->
+<!--          <div class="operate-button-container" v-if="item.packageOrderId!=null&&item.packageOrderId!=''" v-hasPermi="['his:liveOrder:package']" >-->
+<!--            <el-button size="mini" @click="getPackageOrder()" >套餐包订单</el-button>-->
+<!--          </div>-->
+          <div class="operate-button-container"   v-if="item.deliverySn!=null" v-hasPermi="['his:liveOrder:express']">
+            <el-button size="mini" @click="showExpress()" >查看物流</el-button>
+          </div>
+          <div class="operate-button-container" >
+            <el-button size="mini" @click="editDelivery()"  v-hasPermi="['his:liveOrder:updateDelivery']" >修改物流单号</el-button>
+          </div>
+
+          <div class="operate-button-container" >
+            <el-button size="mini" @click="editOrder()"  v-hasPermi="['his:liveOrder:edit']" >修改订单</el-button>
+          </div>
+<!--          <div class="operate-button-container" v-if="item.status ==2 && item.extendOrderId == null && item.deliverySn == null&&item.orderType==1"   v-hasPermi="['his:liveOrder:createErpOrder']">-->
+<!--            <el-button size="mini" @click="addErpOrder()" >创建ERP订单信息</el-button>-->
+<!--          </div>-->
+<!--          <div class="operate-button-container" v-if="item.extendOrderId!=null && item.orderType==1"  v-hasPermi="['his:liveOrder:getEroOrder']"  >-->
+<!--            <el-button size="mini" @click="showErpOrder()" >ERP订单信息</el-button>-->
+<!--          </div>-->
+<!--          <div class="operate-button-container" v-if="item.tuiMoneyStatus==0 && item.status==4"  v-hasPermi="['his:liveOrder:editTuiMoney']"  >-->
+<!--            <el-button size="mini" @click="editTuiMoney1()" >解冻</el-button>-->
+<!--          </div>-->
+<!--          <div class="operate-button-container" v-if="item.tuiMoneyStatus==1 && item.status==4"  v-hasPermi="['his:liveOrder:editTuiMoney']"  >-->
+<!--            <el-button size="mini" @click="editTuiMoney2()" >冻结</el-button>-->
+<!--          </div>-->
+<!--          <div class="operate-button-container"  v-if="item.followTime!=null&&item.followTime!=''"   v-hasPermi="['his:liveOrder:msgList']"  >-->
+<!--            <el-button size="mini" @click="followMsg()" >随访记录</el-button>-->
+<!--          </div>-->
+
+<!--          <div class="operate-button-container" v-if="item.status>1">-->
+<!--            <el-button size="mini" @click="refund()" v-hasPermi="['his:liveOrder:afterSales']">申请退款</el-button>-->
+<!--          </div>-->
+<!--          <div class="operate-button-container" v-if="item.status== -2" >-->
+<!--            <el-button size="mini" @click="returnCost()"  v-hasPermi="['his:liveOrder:returnCost']" >成本退还</el-button>-->
+<!--          </div>-->
+<!--          <div class="operate-button-container" >-->
+<!--            <el-button size="mini" @click="sendFollowMsg()" v-if="item.status>1" v-hasPermi="['his:liveOrder:sendMsg']">发送随访消息</el-button>-->
+<!--          </div>-->
+        </div>
+        <div class="desct">
+          基本信息
+        </div>
+        <el-descriptions :column="3" border  >
+          <el-descriptions-item label="订单编号"  ><span v-if="item!=null">{{item.orderCode}}</span></el-descriptions-item>
+          <el-descriptions-item label="会员"><span v-if="item.nickName!=null">{{item.nickName}}({{item.phone}})</span></el-descriptions-item>
+          <el-descriptions-item label="会员ID"  ><span v-if="item!=null">{{item.userId}}</span></el-descriptions-item>
+          <el-descriptions-item label="支付方式"  ><dict-tag :options="PayOptions" :value="item.payType"/></el-descriptions-item>
+          <el-descriptions-item label="订单来源"  ><dict-tag :options="sourceOptions" :value="item.source"/></el-descriptions-item>
+          <el-descriptions-item label="店铺名称"  ><span v-if="item!=null">{{item.storeName}}</span></el-descriptions-item>
+          <el-descriptions-item label="收货人" >  <span v-if="item!=null">{{item.userName}}</span>  </el-descriptions-item>
+          <el-descriptions-item label="收货人电话" > <span v-if="item!=null">{{item.userPhone}}</span>
+            <el-button icon="el-icon-search" size="mini" @click="handlePhone()" style="margin-left: 20px;" circle v-hasPermi="['his:liveOrder:queryPhone']"></el-button>
+          </el-descriptions-item>
+          <el-descriptions-item label="详细地址" > <span>{{item.userAddress}}</span>  </el-descriptions-item>
+          <el-descriptions-item label="所属公司"><span v-if="item!=null">{{item.companyName}}</span></el-descriptions-item>
+          <el-descriptions-item label="员工"><span v-if="item!=null">{{item.companyUserName}}</span></el-descriptions-item>
+          <el-descriptions-item label="推广佣金" ><span v-if="item.tuiMoney!=null">{{item.tuiMoney.toFixed(2)}}</span></el-descriptions-item>
+          <el-descriptions-item label="推广佣金状态" ><span v-if="item!=null"><dict-tag :options="tuiOptions" :value="item.tuiMoneyStatus"/> </span></el-descriptions-item>
+          <el-descriptions-item label="快递公司编号" > <span v-if="item!=null">{{item.deliveryCode}}</span></el-descriptions-item>
+          <el-descriptions-item label="快递名称" ><span v-if="item!=null">{{item.deliveryName}}</span></el-descriptions-item>
+          <el-descriptions-item label="快递单号" ><span v-if="item!=null">{{item.deliverySn}}</span></el-descriptions-item>
+          <el-descriptions-item label="ERP编号" ><span v-if="item!=null">{{item.extendOrderId}}</span></el-descriptions-item>
+          <el-descriptions-item label="物流状态" ><dict-tag :options="deliveryStatusOptions" :value="item.deliveryStatus"/></el-descriptions-item>
+          <el-descriptions-item label="物流结算状态" ><dict-tag :options="deliveryPayStatusOptions" :value="item.deliveryPayStatus"/></el-descriptions-item>
+          <el-descriptions-item label="物流结算时间" ><span v-if="item!=null">{{item.deliveryPayTime}}</span></el-descriptions-item>
+          <el-descriptions-item label="物流结算金额" ><span v-if="item!=null">{{item.deliveryPayMoney}}</span></el-descriptions-item>
+          <el-descriptions-item label="物流跟踪状态" ><span v-if="item!=null"><dict-tag :options="deliveryTypeOptions" :value="item.deliveryType"/> </span></el-descriptions-item>
+          <el-descriptions-item label="用户备注" ><span v-if="item!=null">{{item.remark}}</span></el-descriptions-item>
+          <el-descriptions-item label="档期归属" >
+            <el-tag prop="scheduleId" v-for="(schedule, index) in scheduleOptions"    v-if="item!=null&&item.scheduleId==schedule.id">{{schedule.name}}
+            </el-tag>
+          </el-descriptions-item>
+          <el-descriptions-item label="订单购买类型" ><span v-if="item!=null"><dict-tag :options="orderBuyTypeOptions" :value="item.orderBuyType"/></span></el-descriptions-item>
+          <el-descriptions-item label=" 公众号/渠道" ><span v-if="item!=null">{{item.channel}}</span></el-descriptions-item>
+          <el-descriptions-item label=" 渠道" ><span v-if="item!=null"><dict-tag :options="channelOptions" :value="item.orderChannel"/></span></el-descriptions-item>
+          <el-descriptions-item label=" 企微主体" ><span v-if="item!=null"><dict-tag :options="qwSubjectOptions" :value="item.qwSubject"/></span></el-descriptions-item>
+        </el-descriptions>
+      </el-card>
+    </div>
+
+    <div class="contentx" v-if="item!=null" style="padding-bottom: 70px;">
+      <div class="desct">
+        商品信息
+      </div>
+      <el-tooltip class="item" effect="dark" :content="showList ? '显示全部' : '隐藏'" placement="top" style="float: right;">
+        <el-button size="mini" circle icon="el-icon-search" @click="showListD()" />
+      </el-tooltip>
+      <el-table border v-if="showProd!=null" :data="showProd" size="small" style="width: 100%;margin-top: 20px" >
+        <el-table-column label="商品图片" width="150" align="center">
+          <template slot-scope="scope">
+            <img :src="scope.row.imgUrl" style="height: 80px">
+          </template>
+        </el-table-column>
+        <el-table-column label="商品编码" width="300" align="center">
+          <template slot-scope="scope">
+            <p>{{scope.row.productId}}</p>
+          </template>
+        </el-table-column>
+        <el-table-column label="商品名称" width="300" align="center">
+          <template slot-scope="scope">
+            <p>{{scope.row.productName}}</p>
+          </template>
+        </el-table-column>
+        <el-table-column label="单价" width="240" align="center">
+          <template slot-scope="scope">
+            <p>¥{{scope.row.price.toFixed(2)}}</p>
+          </template>
+        </el-table-column>
+        <el-table-column label="市场价" width="240" align="center">
+          <template slot-scope="scope">
+            {{scope.row.otPrice}}
+          </template>
+        </el-table-column>
+<!--        <el-table-column label="数量" width="180" align="center">-->
+<!--          <template slot-scope="scope">-->
+<!--            {{scope.row.num}}-->
+<!--          </template>-->
+<!--        </el-table-column>-->
+<!--        <el-table-column label="小计"  align="center">-->
+<!--          <template slot-scope="scope" >-->
+<!--            ¥{{(scope.row.num*scope.row.price).toFixed(2)}}-->
+<!--          </template>-->
+<!--        </el-table-column>-->
+      </el-table>
+      <div style="float: right;margin: 20px" v-if="item.totalPrice!=null">
+        合计:<span class="color-danger">¥{{item.totalPrice.toFixed(2)}}</span>
+      </div>
+    </div>
+
+
+    <el-dialog :title="edit.title" :visible.sync="edit.open" width="600px" append-to-body>
+      <el-form ref="editForm" :model="editForm" :rules="editRules" label-width="100px">
+
+        <el-form-item label="订单状态" prop="status" >
+          <el-select v-model="editForm.status" placeholder="请选择状态" clearable size="small" filterable>
+            <el-option
+              v-for="dict in orderOptions "
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="物流状态" prop="deliveryStatus" >
+          <el-select v-model="editForm.deliveryStatus" placeholder="请选择物流状态" clearable size="small" filterable>
+            <el-option
+              v-for="dict in deliveryStatusOptions "
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="物流跟踪状态" prop="deliveryType" >
+          <el-select v-model="editForm.deliveryType" placeholder="请选择状态" clearable size="small" filterable>
+            <el-option
+              v-for="dict in deliveryTypeOptions "
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="详情地址" prop="userAddress"  >
+          <el-input v-model="editForm.userAddress" placeholder="请输入" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remark"  >
+          <el-input v-model="editForm.remark" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitEditForm">确 定</el-button>
+      </div>
+    </el-dialog>
+
+
+    <el-dialog :title="editDy.title" :visible.sync="editDy.open" width="600px" append-to-body>
+      <el-form ref="editDyForm" :model="editDyForm" :rules="editDyRules" label-width="100px">
+        <div  v-hasPermi="['his:liveOrder:updateErpOrder']"  style="margin-bottom: 20px;" >
+          <el-button size="mini" @click="updateErpOrder" >同步物流单号信息</el-button>
+        </div>
+        <el-form-item label="物流公司" prop="deliveryCode" >
+          <el-select style="width:220px" v-model="editDyForm.deliveryCode" placeholder="请选择" clearable size="small">
+            <el-option key="SF"  label="顺丰" value="SF" />
+            <el-option key="EMS"  label="邮政" value="EMS" />
+            <el-option key="ZTO"  label="中通" value="ZTO" />
+            <el-option key="JD"  label="京东" value="JD" />
+            <el-option key="DBL"  label="德邦" value="DBL" />
+            <el-option key="YD"  label="韵达" value="YD" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="物流单号" prop="deliverySn"  >
+          <el-input v-model="editDyForm.deliverySn" placeholder="请输入物流单号" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitEditDyForm">确 定</el-button>
+        <el-button @click="editDy.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="expressDialog.title" :visible.sync="expressDialog.open" width="600px" append-to-body>
+      <div  v-hasPermi="['his:storeOrder:syncExpress']"  >
+        <el-button size="mini" @click="syncExpress()" >同步快递鸟物流状态</el-button>
+      </div>
+      <el-table style="margin-top: 20px;width: 100%"
+                ref="orderHistoryTable"
+                :data="traces" border>
+        <el-table-column label="操作时间"  width="160" align="center">
+          <template slot-scope="scope">
+            {{scope.row.AcceptTime}}
+          </template>
+        </el-table-column>
+        <el-table-column label="位置" align="center">
+          <template slot-scope="scope">
+            {{scope.row.Location}}
+          </template>
+        </el-table-column>
+        <el-table-column label="描述" align="center">
+          <template slot-scope="scope">
+            {{scope.row.AcceptStation}}
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+
+
+  </div>
+</template>
+
+
+<script>
+import {getLiveOrder, syncExpress, updateLiveOrder, updateErp, getExpress, listOrderitem, tuiOrder} from "@/api/live/liveOrder";
+
+
+export default {
+  props:["data"],
+  data() {
+    return {
+      expressDialog:{
+        title:"物流信息",
+        open:false,
+      },
+      editDy:{
+        title:"修改物流单号",
+        open:false,
+      },
+      sourceOptions:[],
+      followDialogVisible:false,
+      dialogVisible:false,
+      total: 0,
+      msgForm:{
+        pageNum: 1,
+        pageSize: 10,
+        userId:null,
+        followDoctorId:null,
+      },
+      editDyForm:{
+        orderId:null,
+        deliveryId:null,
+        deliveryCode:null,
+      },
+      showList:true,
+      edit:{
+        title:"修改订单",
+        open:false,
+      },
+      erpDialog:{
+        title:"ERP订单信息",
+        open:false,
+      },
+      show:{
+        title:"问诊详情",
+        open:false,
+      },
+      pack:{
+        title:"套餐包",
+        open:false,
+      },
+      followList:[],
+      money:null,
+      moneyVisible:false,
+      rules:{},
+      sendVisible:false,
+      logs:[],
+      pay:[],
+      nickName:null,
+      storeName:null,
+      PayOptions:[],
+      orderOptions:[],
+      payStatusOptions:[],
+      express:null,
+      traces:[],
+      msg:[],
+      sexOptions:[],
+      refundOptions:[],
+      channelOptions:[],
+      qwSubjectOptions:[],
+      tuiOptions:[],
+      orOptions:[],
+      storeOPtions:[],
+      deliveryStatusOptions:[],
+      deliveryPayStatusOptions:[],
+      deliveryTypeOptions:[],
+      orderTypeOptions:[],
+      orderBuyTypeOptions:[],
+      scheduleOptions:[],
+      item:null,
+      tuiMoneyLogs:[],
+      erpOrder:null,
+      prod:null,
+      showProd:null,
+      editForm:{
+        orderId:null,
+        status:null,
+        userAddress:null,
+        deliveryStatus:null,
+        deliveryType:null,
+        remark:"",
+      },
+      editDyRules:{
+        deliverySn: [
+          { required: true, message: "物流单号不能为空", trigger: "blur" }
+        ],
+        deliveryCode: [
+          { required: true, message: "物流公司不能为空", trigger: "blur" }
+        ],
+      },
+      editRules:{
+        userAddress: [
+          { required: true, message: "收货地址不能为空", trigger: "blur" }
+        ],
+      },
+      mrules:{
+      },
+      form: {
+        deliveryCode: null,
+        deliveryName:null,
+        deliverySn:null,
+        orderId:null,
+      }
+    }
+  },
+
+  created() {
+    this.getDicts("sys_store_pay_type").then(response => {
+      this.PayOptions = response.data;
+    });
+    this.getDicts("sys_order_status").then(response => {
+      this.orderOptions = response.data;
+    });
+    this.getDicts("sys_order_pay").then(response => {
+      this.payStatusOptions = response.data;
+    });
+    this.getDicts("sys_order_source").then(response => {
+      this.sourceOptions = response.data;
+    });
+    this.getDicts("sys_store_order_type").then(response => {
+      this.orderTypeOptions = response.data;
+    });
+    this.getDicts("sys_store_order_buy_type").then(response => {
+      this.orderBuyTypeOptions = response.data;
+    });
+    this.getDicts("sys_refund_status").then(response => {
+      this.refundOptions = response.data;
+    });
+    this.getDicts("sys_store_channel").then(response => {
+      this.channelOptions = response.data;
+    });
+    this.getDicts("sys_store_qw_subject").then(response => {
+      this.qwSubjectOptions = response.data;
+    });
+    this.getDicts("sys_tui_money_status").then(response => {
+      this.tuiOptions = response.data;
+    });
+    this.getDicts("sys_company_or").then(response => {
+      this.orOptions = response.data;
+    });
+    this.getDicts("sys_patient_sex").then(response => {
+      this.sexOptions = response.data;
+    });
+    this.getDicts("sys_store_delivery_pay_status").then(response => {
+      this.deliveryPayStatusOptions = response.data;
+    });
+    this.getDicts("sys_store_order_delivery_status").then(response => {
+      this.deliveryStatusOptions = response.data;
+    });
+    this.getDicts("sys_delivery_type").then(response => {
+      this.deliveryTypeOptions = response.data;
+    });
+  },
+  methods: {
+
+    followMsg(row){
+      const userId = this.item.userId;
+      const followDoctorId =this.item.followDoctorId;
+      const doctorName = this.item.doctorName;
+      const patientName = this.item.patientName;
+
+      setTimeout(() => {
+        this.$refs.msgDetails.getDetails(userId,followDoctorId,doctorName,patientName);
+      }, 500);
+      this.dialogVisible = true;
+    },
+    msgDialogClose(){
+      this.dialogVisible = false;
+    },
+    handlePhone(){
+      const orderId = this.item.orderId;
+      getOrderUserPhone(orderId).then(response =>{
+        this.item.userPhone = response.userPhone;
+      })
+    },
+    editDelivery(){
+      this.editDy.open = true;
+      this.editDyForm.orderId = this.item.orderId;
+
+    },
+    showListD(){
+      if(this.showList){
+        this.showProd=this.prod
+      }else{
+        this.showProd=[this.prod[0]]
+      }
+      this.showList=this.showList?false:true;
+    },
+
+    showExpress(){
+      this.expressDialog.open=true;
+      getExpress(this.item.orderId).then(response => {
+        this.express = response.data;
+        if(this.express!=null&&this.express.Traces!=null){
+          this.traces=this.express.Traces
+        }
+      });
+    },
+    updateErpOrder(){
+      var that=this;
+      this.$confirm('确定同步物流单号信息吗', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        var data={orderId:that.item.orderId}
+        return updateErp(data);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+        getLiveOrder(this.item.orderId).then(response => {
+          this.item=response.data
+          that.getlogList(this.item.orderId);
+          that.$parent.$parent.getList();
+        });
+        this.editDy.open = false
+      }).catch(function() {});
+
+    },
+    sendFollowMsg(){
+      var that=this;
+      this.$confirm('是否确认发送消息?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return sendMsg(that.item.orderId);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+      }).catch(function() {});
+    },
+    handleClose1(){
+      this.dialogVisible=false;
+    },
+    handleClose2(){
+      this.followDialogVisible=false;
+    },
+    follow(row){
+      getMsgFollow(row).then(response => {
+        if(response.data.formJson!=null&&response.data.formJson!=''&&response.data.writeStatus==1){
+          this.messageFollowList=JSON.parse(response.data.formJson );
+          this.followDialogVisible=true;
+        }else{
+          this.$message({
+            message: '未填写随访单',
+            type: 'info'
+          });
+          return
+        }
+      });
+    },
+
+    //修改订单状态
+    submitEditForm(){
+      this.$refs["editForm"].validate(valid => {
+        if (valid) {
+          updateLiveOrder(this.editForm).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess("操作成功");
+              this.edit.open = false;
+              getLiveOrder(this.item.orderId).then(response => {
+                this.item=response.data
+                that.getlogList(this.item.orderId);
+                that.$parent.$parent.getList();
+              });
+            }
+          });
+        }
+      });
+    },
+    editOrder(){
+      this.edit.open=true;
+      this.editForm.orderId=this.item.orderId;
+      this.editForm.remark=this.item.remark;
+      this.editForm.userAddress = this.item.userAddress == null ? '' : this.item.userAddress.toString();
+      this.editForm.status = this.item.status == null ? '' : this.item.status.toString();
+      this.editForm.deliveryType = this.item.deliveryType == null ? '' : this.item.deliveryType.toString();
+      this.editForm.deliveryStatus = this.item.deliveryStatus == null ? '' : this.item.deliveryStatus.toString();
+
+    },
+    updateExpress(){
+      var that=this;
+      this.$confirm('定同步物流信息吗,同步后将自动发货?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        var data=that.item.orderId
+        return updateExpress(data);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+        getLiveOrder(this.item.orderId).then(response => {
+          this.item=response.data
+          that.getlogList(this.item.orderId);
+          that.$parent.$parent.getList();
+        });
+      }).catch(function() {});
+    },
+    addErpOrder(){
+      var that=this;
+      this.$confirm('是否确认推送管易?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        var data=that.item.orderId
+        return createErpOrder(data);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+        getLiveOrder(this.item.orderId).then(response => {
+          this.item=response.data
+          that.getlogList(this.item.orderId);
+          that.$parent.$parent.getList();
+        });
+      }).catch(function() {});
+    },
+    showErpOrder(){
+      this.erpDialog.open=true;
+      var data=this.item.extendOrderId;
+      getEroOrder(data).then(response => {
+        this.erp = response.data;
+        if(response.data.orders!=null&&response.data.orders.length==1){
+          this.erpOrder=response.data.orders[0]
+        }
+      });
+    },
+
+    editTuiMoney1(){
+      var that=this;
+      this.$confirm('是否解冻此订单推广佣金吗?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        var data=that.item.orderId;
+        return editTuiMoney(data);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+        getLiveOrder(this.item.orderId).then(response => {
+          this.item=response.data
+          that.getlogList(this.item.orderId);
+          that.$parent.$parent.getList();
+        });
+      }).catch(function() {});
+    },
+    editTuiMoney2(){
+      var that=this;
+      this.$confirm('是否冻结此订单推广佣金吗?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        var data=that.item.orderId;
+        return editTuiMoney(data);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+        getLiveOrder(this.item.orderId).then(response => {
+          this.item=response.data
+          that.getlogList(this.item.orderId);
+          that.$parent.$parent.getList();
+        });
+      }).catch(function() {});
+    },
+    returnCost(){
+      var that=this;
+      this.$confirm('是否退还此订单成本吗?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        var data=that.item.orderId;
+        return returnCost(data);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+        this.getDetails(this.item.orderId,null,null)
+      }).catch(function() {});
+    },
+    moneyCancel(){
+      this.money=null;
+      this.moneyVisible=false;
+    },
+    refund(){
+      var that=this;
+      this.$confirm('是否确认申请退款?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        var data={
+          orderId:that.item.orderId
+        }
+        return afterSales(data);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+        getLiveOrder(this.item.orderId).then(response => {
+          this.item = response.data;
+          this.getlogList(this.item.orderId);
+          this.$parent.$parent.getList();
+        });
+      }).catch(function() {});
+    },
+    finishOrder(){
+      var that=this;
+      this.$confirm('是否确认客户已收货?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        var data={
+          orderId:that.item.orderId
+        }
+        return getGoods(data);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+        getLiveOrder(this.item.orderId).then(response => {
+          this.item = response.data;
+          this.getlistOrderitem(this.item.orderId);
+          // this.getlogList(this.item.orderId);
+          this.$parent.$parent.getList();
+        });
+      }).catch(function() {});
+    },
+
+
+    syncExpress(){
+      var that=this;
+      this.$confirm('确定同步物流状态吗', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        var data=that.item.orderId
+        return syncExpress(data);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+        this.expressDialog.open=false
+        getLiveOrder(this.item.orderId).then(response => {
+          this.item=response.data
+          that.getlogList(this.item.orderId);
+          that.$parent.$parent.getList();
+        });
+      }).catch(function() {});
+    },
+    getInquiryOrder(){
+
+      this.show.open=true;
+      setTimeout(() => {
+        this.$refs.Details.getDetails(this.item.inquiryOrderId);
+      }, 1);
+    },
+    getPackageOrder(){
+      this.pack.open=true;
+      console.log(this.item.packageOrderId)
+      setTimeout(() => {
+        this.$refs.packDetails.getDetails(this.item.packageOrderId);
+      }, 1);
+    },
+    tuiOrder(){
+      var that=this;
+      this.$confirm('是否确认推送订单?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        var data={
+          orderId:that.item.orderId
+        }
+        return tuiOrder(data);
+      }).then(() => {
+        this.msgSuccess("操作成功");
+        getLiveOrder(this.item.orderId).then(response => {
+          this.item = response.data;
+          this.getlogList(this.item.orderId);
+          this.$parent.$parent.getList();
+        });
+      }).catch(function() {});
+    },
+    getDetails(orderId,nickName,storeName) {
+      this.nickName=nickName;
+      this.storeName=storeName;
+      this.item=null;
+      this.tuiMoneyLogs=null;
+      getLiveOrder(orderId).then(response => {
+        this.item = response.data;
+        this.tuiMoneyLogs = response.tuiMoneyLogs;
+        // this.getlogList(orderId);
+        // this.getPayment(orderId);
+        this.msgForm.userId=response.data.userId;
+        this.msgForm.followDoctorId=response.data.followDoctorId;
+        this.getlistOrderitem(this.item.orderId);
+      });
+    },
+    getOrder(){
+      getLiveOrder(this.item.orderId).then(response => {
+        this.item = response.data;
+        this.getlistOrderitem(this.item.orderId);
+        // this.getlogList(this.item.orderId);
+        // this.getPayment(this.item.orderId);
+      });
+    },
+    submitEditDyForm(){
+      this.$refs["editDyForm"].validate(valid => {
+        if (valid) {
+          console.log(this.editDyForm)
+          updateLiveOrder(this.editDyForm).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess("操作成功");
+              this.editDy.open = false;
+              getLiveOrder(this.item.orderId).then(response => {
+                this.item = response.data;
+                // this.getlogList(this.item.orderId);
+                this.$parent.$parent.getList();
+              });
+            }
+          });
+        }
+      });
+    },
+    getlistOrderitem(orderId){
+      this.prod = null
+      this.showProd=[]
+      this.showList = true
+      listOrderitem(orderId).then(response => {
+        this.prod = response.rows;
+        if (this.prod.length > 0) {
+          this.showProd=[this.prod[0]];
+        }
+      });
+    },
+    // getlogList(orderId){
+    //   logList(orderId).then(response => {
+    //     this.logs = response.rows;
+    //   });
+    // },
+    // getPayment(orderId){
+    //   payment(orderId).then(response => {
+    //     console.log(response)
+    //     this.pay = response.data;
+    //   });
+    // }
+  }
+}
+
+</script>
+
+
+<style scoped>
+.content{
+  height: 100%;
+  background-color: #fff;
+  padding: 0px 20px;
+
+}
+.contentx{
+  height: 100%;
+  background-color: #fff;
+  padding: 0px 20px 20px;
+
+
+  margin: 20px;
+}
+.el-descriptions-item__label.is-bordered-label{
+  font-weight: normal;
+}
+.el-descriptions-item__content {
+  max-width: 150px;
+  min-width: 100px;
+}
+.desct{
+  padding-top: 20px;
+  padding-bottom: 20px;
+  color: #524b4a;
+  font-weight: bold;
+}
+
+.order-content{
+  margin: 10px;
+
+}
+
+.operate-container {
+  background: #F2F6FC;
+  height: 60px;
+  margin: -20px -20px 0;
+  line-height: 60px;
+}
+
+.operate-button-container {
+  float: right;
+  margin-right: 20px
+}
+</style>
+
+<style scoped>
+.chat-records {
+
+  overflow-y: auto;
+}
+.timestamp {
+  font-size: 12px;
+  color: #A9A9A9;
+}
+.chat-record {
+  margin: 10px;
+  flex-direction: column;
+  align-items: flex-start;
+}
+.sent {
+  background-color: #fbfdff;
+  color: #000839;
+}
+.sent .timestamp {
+  float: right;
+}
+.right{
+  float: right;
+}
+.received {
+  background-color: #fbfdff;
+  color: #000000;
+}
+
+.el-descriptions-item__content {
+  max-width: 150px;
+  min-width: 100px;
+}
+.order-content{
+  margin: 10px;
+
+}
+
+.operate-container {
+  background: #F2F6FC;
+  height: 60px;
+  margin: -20px -20px 0;
+  line-height: 60px;
+}
+
+.operate-button-container {
+  float: right;
+  margin-right: 20px
+}
+</style>

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

@@ -10,9 +10,9 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="敏感词添加时间" prop="createdAt" label-width="120px">
+      <el-form-item label="敏感词添加时间" prop="createTime" label-width="120px">
         <el-date-picker clearable size="small"
-          v-model="queryParams.createdAt"
+          v-model="queryParams.createTime"
           type="date"
           value-format="yyyy-MM-dd"
           placeholder="选择敏感词添加时间">
@@ -75,9 +75,9 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="敏感词唯一标识" align="center" prop="wordId" />
       <el-table-column label="需要过滤的敏感词" align="center" prop="word" />
-      <el-table-column label="敏感词添加时间" align="center" prop="createdAt" width="180">
+      <el-table-column label="敏感词添加时间" align="center" prop="createTime" width="180">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
+          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -155,7 +155,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
         word: null,
-        createdAt: null
+        createTime: null
       },
       // 表单参数
       form: {},
@@ -190,7 +190,7 @@ export default {
       this.form = {
         wordId: null,
         word: null,
-        createdAt: null
+        createTime: null
       };
       this.resetForm("form");
     },