Bläddra i källkod

销售直播代码 直播间

yuhongqi 2 månader sedan
förälder
incheckning
eb122aa953

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

@@ -54,7 +54,7 @@ export function exportLive(query) {
 
 export function selectLiveToStudent(query) {
   return request({
-    url: '/live/live/selectLiveToStudent',
+    url: '/live/live/selectLiveToStudent?pageNum=' + query.pageNum + '&pageSize=' + query.pageSize,
     method: 'post',
     data: query
   })

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

@@ -101,7 +101,7 @@
       <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" width="200" class-name="small-padding fixed-width">

+ 2 - 1
src/views/live/liveConfig/idCard.vue

@@ -2,6 +2,7 @@
   <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>
@@ -10,7 +11,7 @@
 </template>
 
 <script>
-import ImageUpload from "@/views/qw/material/ImageUpload.vue";
+import ImageUpload from '@/components/ImageUpload/index';
 import {verifyIdInfo, getLive} from '@/api/live/live'
 
 export default {

+ 7 - 7
src/views/live/liveConfig/liveLotteryConf.vue

@@ -17,7 +17,7 @@
         </el-select>
       </el-form-item>
       <el-form-item label="抽奖状态" prop="require">
-        <el-select v-model="queryParams.lottery_status" placeholder="请输入参与抽奖方式">
+        <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>
@@ -179,9 +179,9 @@
         </el-form-item>
         <el-form-item label="方式配置" prop="requireConf">
           <el-input v-model="form.requireConf" placeholder="请输入参与抽奖方式" />
-          <span style="font-size: 10px; font-family: Arial,serif">当参与方式选择为“送礼参与”或“下单参与”时,此处填写商品ID及数量</span>
+          <span style="margin-bottom:10px;font-size: 10px; font-family: Arial,serif">当参与方式选择为“送礼参与”或“下单参与”时,此处填写商品ID及数量</span>
         </el-form-item>
-        <el-form-item label="持续时间" prop="duration">
+        <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">
@@ -394,7 +394,7 @@ export default {
         require: null,
         desc: null,
         createTime: null,
-        lottery_status: null
+        lotteryStatus: null
       },
       //商品信息列表
       productList: [],
@@ -459,7 +459,7 @@ export default {
       this.lotteryStatusOptions = response.data;
     });
 
-    this.liveId = this.$route.params.liveId;
+    this.liveId = this.$route.query.liveId;
     this.parentLiveId = this.liveId;
     this.queryParams.liveId = this.parentLiveId;
     if(this.queryParams.liveId){
@@ -658,7 +658,7 @@ export default {
     },
     /** 抽奖状态修改 */
     handleStatusChange(row, status) {
-      if (this.$store.state.liveWs == null) {
+      if (this.$store.state.liveWs[this.liveId] == null) {
         this.msgError("请从直播间进行操作!");
         return;
       }
@@ -698,7 +698,7 @@ 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.msgSuccess("修改成功");
         }else{
           this.msgError(response.msg);

+ 7 - 4
src/views/live/liveConfig/liveRedConf.vue

@@ -271,7 +271,7 @@ export default {
     this.getDicts("sys_live_red_type").then(response => {
       this.redTypeOptions = response.data;
     });
-    this.parentLiveId = this.$route.params.liveId;
+    this.parentLiveId = this.$route.query.liveId;
     this.queryParams.liveId = this.parentLiveId;
     if(this.queryParams.liveId){
       this.form.liveId = this.parentLiveId;
@@ -282,12 +282,12 @@ export default {
   },
   computed: {
     liveId() {
-      return this.$route.params.liveId;
+      return this.$route.query.liveId;
     }
   },
   methods: {
     handleStatusChange(row, status) {
-      if (this.$store.state.liveWs == null) {
+      if (this.$store.state.liveWs[this.liveId] == null) {
         this.msgError("请从直播间进行操作!");
         return;
       }
@@ -331,13 +331,16 @@ export default {
             cmd: 'red',
             data: doRedParam
           }
-          this.$store.state.liveWs.send(JSON.stringify(msg));
+          this.$store.state.liveWs[this.liveId].send(JSON.stringify(msg));
           this.msgSuccess("修改成功");
+          console.log(1)
         }else{
           this.msgError(response.msg);
+          console.log(2)
         }
         this.open = false;
         this.getList();
+        console.log(3)
       });
     },
     redStatusFormatter(row, column) {

+ 3 - 2
src/views/live/liveConsole/index.vue

@@ -235,8 +235,8 @@ import { getLivingUrl,getLive } 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/liveGoods/index.vue'
 import LiveOrder from '@/views/live/liveOrder/index.vue'
 import echarts from 'echarts'
@@ -738,6 +738,7 @@ 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)

+ 3 - 42
src/views/live/liveData/index.vue

@@ -264,8 +264,8 @@
             <pagination
               v-show="liveTotal>0"
               :total="liveTotal"
-              :page.sync="queryParams.pageNum"
-              :limit.sync="queryParams.pageSize"
+              :page.sync="liveFiltersParam.pageNum"
+              :limit.sync="liveFiltersParam.pageSize"
               @pagination="getLive"
             />
             <!-- 确认按钮 -->
@@ -474,8 +474,7 @@
   export default {
 
     name: "LiveData",
-    components: { Editor },
-    components: { draggable,Treeselect },
+    components: { Editor,draggable,Treeselect },
     data() {
       return {
         // 部门树选项
@@ -546,11 +545,7 @@
           category:"page_views"
         },
         chart: null,
-        selectedTimeRange: "day", // 默认选中“自然天”
-        datePickerType: "date", // 默认 date 类型
         trendData: {}, // 直播趋势数据
-        weekRange: "", // 存储选择周的时间范围
-        selectedDate: new Date().toISOString().split("T")[0], // 默认今天
         selectedMetric: "page_views", // 默认选中浏览量
         lives: [],
       };
@@ -639,10 +634,7 @@
         });
       },
       getLive(){
-        console.log(this.liveFiltersParam)
         selectLiveToStudent(this.liveFiltersParam).then(response => {
-          console.log(this.liveFiltersParam)
-          console.log(response)
           this.liveList = response.rows;
           this.liveTotal = response.total;
         });
@@ -656,14 +648,6 @@
           finishTime:""
         }
       },
-      getStatusText(status) {
-        switch (status) {
-          case 1: return "待直播";
-          case 2: return "直播中";
-          case 3: return "已结束";
-          default: return "";
-        }
-      },
       // 确认选择
       confirmSelection() {
         this.filters.liveNames = this.selectedLives.map(item => item.liveName);
@@ -840,21 +824,6 @@
         const day = String(date_.getDate()).padStart(2, '0');
         return `${year}-${month}-${day}`;
       },
-      // 获取周范围
-      getWeekRange(date) {
-        console.log("原始 date:", date);
-
-        // 确保 date 是 Date 类型
-        let parsedDate = new Date(date);
-        if (isNaN(parsedDate.getTime())) {
-          console.error("无效的日期:", date);
-          return "日期错误";
-        }
-
-        const startOfWeek = this.getStartOfWeek(parsedDate);
-        const endOfWeek = this.getEndOfWeek(parsedDate);
-        return `${this.formatDate(startOfWeek)} - ${this.formatDate(endOfWeek)}`;
-      },
 
       // 获取一周的起始日期(周一)
       getStartOfWeek(date) {
@@ -923,14 +892,6 @@
         this.getTrendData()
         this.updateChart();
       },
-      updateTrendData() {
-        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;

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

@@ -694,12 +694,12 @@ export default {
       updateLiveLotteryConf(doLotteryParam).then(response => {
         if(response.code === 200){
           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();
         });
     },
     /** 提交按钮 */

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

@@ -324,12 +324,12 @@ export default {
       updateLiveRedConf(doRedParam).then(response => {
         if(response.code === 200){
           this.$store.state.liveWs[this.liveId].sendWs("red",response.msg, row.redId,this.liveId);
+          this.getList();
           this.msgSuccess("修改成功");
         }else{
           this.msgError(response.msg);
         }
         this.open = false;
-        this.getList();
       });
     },
     redStatusFormatter(row, column) {

+ 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");
     },