Browse Source

直播商品配置

mo 3 năm trước cách đây
mục cha
commit
b3461835d7

+ 2 - 1
src/router/index.js

@@ -557,7 +557,8 @@ export const asyncRoutes = {
   // 群组管理
   groupChatManager:()=>import('@/views/groupChatManager'),
   // 小小艺术家训练营
-  littleArtistCamp:()=>import('@/views/littleArtistCamp')
+  littleArtistCamp:()=>import('@/views/littleArtistCamp'),
+  liveShopManger:()=>import('@/views/liveShopManger'),
 }
 
 export default router

+ 1 - 0
src/router/notKeepAliveList.js

@@ -123,4 +123,5 @@ export default [
   '/memberShareList',
   '/agentList',
   '/groupChatManager', // 群组管理
+  '/littleArtistCamp', // 小小艺术家训练营
 ]

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 772 - 726
src/store/modules/permission.js


+ 1 - 1
src/utils/vueFilter.js

@@ -216,7 +216,7 @@ Vue.filter("coupontypeDetailType", val => constant.coupontypeDetail[val]);
 Vue.filter("feedbackTypeFilter", val => constant.feedbackType[val]);
 Vue.filter("feedbackTypeDescFilter", val => constant.feedbackTypeDesc[val]);
 // 小小训练营状态
-Vue.filter("campStateListFilter", val => constant.campStateList[val]);
+Vue.filter("campStateListFilter", val => constant.campState[val]);
 
 // 时间处理
 Vue.filter("timer", value => {

+ 1 - 1
src/views/groupChatManager/model/addGroupmsg.vue

@@ -7,7 +7,7 @@
       :before-close="onClose"
       append-to-body
     >
-      <div class="m-container">
+      <div >
         <el-form :inline="true" :model="searchForm">
           <el-form-item>
             <el-input

+ 1 - 1
src/views/groupChatManager/model/lookGroup.vue

@@ -6,7 +6,7 @@
       :visible.sync="lookVisible"
       :before-close="onClose"
     >
-      <div class="m-container">
+      <div >
         <el-form :inline="true" :model="searchForm">
           <el-form-item>
             <el-input

+ 53 - 0
src/views/littleArtistCamp/api.js

@@ -28,3 +28,56 @@ export const resetTrainingCamp = data => {
     requestType: 'json',
   })
 }
+
+// 删除
+export const delTrainingCamp = data => {
+  return request({
+    url: `/api-web/tempLittleArtistTrainingCamp/delete/${data}`,
+    method: 'get',
+  })
+}
+
+
+// 参与名单
+export const getTrainingCampUser = data => {
+  return request({
+    url: '/api-web/tempLittleArtistTrainingCamp/queryPageTrainingCampUser',
+    method: 'post',
+    data,
+    requestType: 'json',
+  })
+}
+
+
+// 训练营详情
+export const getUserTrainingDetail = data => {
+  return request({
+    url: '/api-web/tempLittleArtistTrainingCamp/queryUserTrainingDetail',
+    method: 'post',
+    data,
+    requestType: 'json',
+  })
+}
+
+// 获取训练营群组
+export const getCampImGroup = data => {
+  return request({
+    url: '/api-web/tempLittleArtistTrainingCamp/queryCampImGroup',
+    method: 'get',
+    data,
+    params:data
+
+  })
+}
+
+
+// 获取学生打卡记录
+export const getUserTrainingTime = data => {
+  return request({
+    url: '/api-web/tempLittleArtistTrainingCamp/queryUserTrainingTime',
+    method: 'post',
+    data,
+  })
+}
+
+

+ 138 - 76
src/views/littleArtistCamp/aristCampDetail.vue

@@ -1,89 +1,115 @@
 <template>
-  <div>
-    <el-page-header @back="goBack" content="抽奖记录" class="setTrophy" />
-    <save-form
-      :inline="true"
-      class="searchForm"
-      ref="searchForm"
-      @submit="search"
-      @reset="onReset"
-      :model="searchForm"
-    >
-      <el-form-item prop="userId">
-        <el-input
-          v-model.number="searchForm.userId"
-          maxlength="9"
-          clearable
-          placeholder="学员姓名/手机号/编号"
-          type="number"
-        ></el-input>
-      </el-form-item>
-      <el-form-item prop="name">
-        <el-input
-          v-model.trim="searchForm.name"
-          clearable
-          placeholder="所在群组"
-        ></el-input>
-      </el-form-item>
-
-      <el-form-item>
-        <el-button native-type="submit" type="danger">搜索</el-button>
-        <el-button native-type="reset" type="primary">重置</el-button>
-      </el-form-item>
-    </save-form>
-    <div class="tableWrap">
-      <el-table
-        :data="tableList"
-        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+  <div class="m-container">
+    <el-page-header @back="goBack" :content="title" class="setTrophy" />
+    <div class="m-core">
+      <save-form
+        :inline="true"
+        class="searchForm"
+        ref="searchForm"
+        @submit="search"
+        @reset="onReset"
+        :model="searchForm"
       >
-        <el-table-column align="center" prop="userId" label="学员编号">
-          <template slot-scope="scope">
-            <copy-text>{{ scope.row.userId }}</copy-text>
-          </template>
-        </el-table-column>
-        <el-table-column
-          align="center"
-          prop="user.username"
-          label="学员姓名"
-        ></el-table-column>
-        <el-table-column
-          align="center"
-          prop="user.phone"
-          label="手机号码"
-        ></el-table-column>
-        <el-table-column
-          align="center"
-          prop="user.organName"
-          label="所属分部"
-        ></el-table-column>
-        <el-table-column align="center" prop="luckDrawPrize.name" label="奖项">
-          <template slot-scope="scope">
-            <copy-text>{{ scope.row.luckDrawPrize.name }}</copy-text>
-          </template>
-        </el-table-column>
-        <el-table-column align="center" prop="createOn" label="抽奖时间">
-        </el-table-column>
-      </el-table>
-      <pagination
-        sync
-        :total.sync="pageInfo.total"
-        :page.sync="pageInfo.page"
-        :limit.sync="pageInfo.limit"
-        :page-sizes="pageInfo.page_size"
-        @pagination="getList"
-      />
+        <el-form-item prop="search">
+          <el-input
+            v-model="searchForm.search"
+            clearable
+            placeholder="学员姓名/手机号/编号"
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="imGroupId">
+          <el-select
+            v-model.trim="searchForm.imGroupId"
+            clearable
+            filterable
+            placeholder="所在群组"
+          >
+            <el-option
+              v-for="(item) in imGroupIdList"
+              :key="item.id"
+              :value="item.id"
+              :label="item.name"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item>
+          <el-button native-type="submit" type="danger">搜索</el-button>
+          <el-button native-type="reset" type="primary">重置</el-button>
+        </el-form-item>
+      </save-form>
+      <div class="tableWrap">
+        <el-table
+          :data="tableList"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+        >
+          <el-table-column align="center" prop="id" label="学员编号">
+            <template slot-scope="scope">
+              <copy-text>{{ scope.row.id }}</copy-text>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="username"
+            label="学员姓名"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="phone"
+            label="手机号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="imGroupName"
+            label="群组"
+          ></el-table-column>
+          <el-table-column align="center" prop="playDay" label="打卡天数">
+            <template slot-scope="scope"> {{ scope.row.playDay }}天 </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="playTime"
+            label="训练时长(分钟)"
+          >
+          </el-table-column>
+          <el-table-column align="center" prop="playTime" label="操作">
+            <template slot-scope="scope">
+              <div>
+                <auth auths="tempLittleArtistTrainingCamp/queryUserTrainingTime">
+                  <el-button type="text" @click="lookstudentCamp(scope.row)"
+                    >打卡记录</el-button
+                  >
+                </auth>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination
+          sync
+          :total.sync="pageInfo.total"
+          :page.sync="pageInfo.page"
+          :limit.sync="pageInfo.limit"
+          :page-sizes="pageInfo.page_size"
+          @pagination="getList"
+        />
+      </div>
     </div>
+    <artistClock ref="artistClock" />
   </div>
 </template>
 
 <script>
 import pagination from "@/components/Pagination/index";
+import artistClock from "./models/artistClock"
+import { getUserTrainingDetail,getCampImGroup } from "./api";
 export default {
-    components: { pagination },
+  components: { pagination,artistClock },
   data() {
     return {
-       tableList: [],
-
+      searchForm: {},
+      tableList: [],
+      imGroupIdList:[],
+      title:this.$route.query.name || '',
       pageInfo: {
         // 分页规则
         limit: 10, // 限制显示条数
@@ -93,11 +119,47 @@ export default {
       },
     };
   },
-  mounted() {},
+  mounted() {
+    this.getList();
+    this.getImgroupList()
+  },
   methods: {
+   async getImgroupList(){
+     try{
+       const res = await getCampImGroup({imGroupIds:this.$route.query.imGroupIds})
+       this.imGroupIdList = res.data
+     }catch(e){
+
+     }
+   },
     goBack() {},
+    search() {
+      this.pageInfo.page = 1;
+      this.getList();
+    },
+    onReset() {},
+    async getList() {
+      let params = {
+        ...this.searchForm,
+        page: this.pageInfo.page,
+        rows: this.pageInfo.limit,
+      };
+      try {
+        const res = await getUserTrainingDetail({ ...params });
+        this.tableList = res.data.rows;
+        this.pageInfo.total = res.data.total;
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    lookstudentCamp(row) {
+      this.$refs.artistClock.openDioag(row)
+    },
   },
 };
 </script>
 <style lang="scss" scoped>
+.setTrophy {
+  margin-bottom: 20px;
+}
 </style>

BIN
src/views/littleArtistCamp/images/icon_check.png


BIN
src/views/littleArtistCamp/images/icon_check_disabled.png


BIN
src/views/littleArtistCamp/images/icon_close.png


+ 79 - 39
src/views/littleArtistCamp/index.vue

@@ -71,7 +71,7 @@
       </save-form>
 
       <div class="buttunWtap">
-        <auth auths="sysCoupon/add">
+        <auth auths="tempLittleArtistTrainingCamp/add">
           <el-button
             type="primary"
             style="margin-bottom: 30px; margian-right: 10px"
@@ -79,8 +79,8 @@
             >新建训练营</el-button
           >
         </auth>
-        <auth auths="sysCoupon/add">
-          <el-button type="primary" style="margin-bottom: 30px"
+        <auth auths="tempLittleArtistTrainingCamp/queryPageTrainingCampUser">
+          <el-button type="primary" style="margin-bottom: 30px" @click="getRosterList"
             >参与名单</el-button
           >
         </auth>
@@ -93,49 +93,60 @@
         >
           <el-table-column
             align="center"
-            prop="studentId"
+            prop="id"
             label="训练营编号"
           ></el-table-column>
           <el-table-column
             align="center"
-            prop="studentId"
+            prop="name"
             label="训练营标题"
           ></el-table-column>
-          <el-table-column
-            align="center"
-            prop="studentId"
-            label="状态"
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            prop="studentId"
-            label="报名时间段"
-          ></el-table-column>
-          <el-table-column
-            align="center"
-            prop="studentId"
-            label="训练时间段"
-          ></el-table-column>
+          <el-table-column align="center" prop="studentId" label="状态">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.state | campStateListFilter }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="studentId" label="报名时间段">
+            <template slot-scope="scope">
+              <div>
+                <p>{{ scope.row.applyStartDate | dayjsFormat }}</p>
+                <p>{{ scope.row.applyEndDate | dayjsFormat }}</p>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="studentId" label="训练时间段">
+            <template slot-scope="scope">
+              <div>
+                <p>{{ scope.row.trainStartDate | dayjsFormat }}</p>
+                <p>{{ scope.row.trainEndDate | dayjsFormat }}</p>
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column align="center" prop="studentId" label="操作">
             <template slot-scope="scope">
               <div>
-                <auth auths="musicGroupQuestionnaire/get">
+                <auth auths="tempLittleArtistTrainingCamp/queryUserTrainingDetail">
                   <el-button type="text" @click="lookCamp(scope.row)"
                     >详情</el-button
                   >
                 </auth>
                 <auth
-                  :auths="[
-                    'musicGroupQuestionnaire/get',
-                    'musicGroupQuestionnaire/update',
-                  ]"
-                  mulit
+                  :auths="'tempLittleArtistTrainingCamp/update'"
+
                 >
-                  <el-button type="text" @click="resetCamp(scope.row)"
+                  <el-button
+                    type="text"
+                    @click="resetCamp(scope.row)"
+                    v-if="scope.row.state != 'ING' && scope.row.state != 'END'"
                     >修改</el-button
                   >
                 </auth>
-                <auth auths="musicGroupQuestionnaire/del">
+                <auth
+                  auths="tempLittleArtistTrainingCamp/delete"
+                  v-if="scope.row.state == 'READY'"
+                >
                   <el-button type="text" @click="deleteCamp(scope.row)"
                     >删除</el-button
                   >
@@ -154,7 +165,8 @@
         />
       </div>
     </div>
-    <eidtCamp  @getList="getList" ref='eidtCamp'/>
+    <eidtCamp @getList="getList" ref="eidtCamp" />
+    <campRosterList ref="campRosterList"/>
   </div>
 </template>
 
@@ -165,11 +177,13 @@ import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
 import { getTimes } from "@/utils";
 import { campStateList } from "@/utils/searchArray";
-import { getTrainingCampList } from "./api";
-import eidtCamp from './models/eidtCamp'
-// campStateListFilter
+import { getTrainingCampList,delTrainingCamp } from "./api";
+
+ import campRosterList from "./models/campRosterList";
+import eidtCamp from "./models/eidtCamp";
+//
 export default {
-  components: { pagination,eidtCamp },
+  components: { pagination, eidtCamp,campRosterList },
   data() {
     return {
       searchForm: {
@@ -198,7 +212,9 @@ export default {
     this.init();
   },
   methods: {
-    init() {},
+    init() {
+      this.getList();
+    },
     async getList() {
       let { applyTime, trainTime, ...rest } = this.searchForm;
       let params = {
@@ -221,12 +237,36 @@ export default {
       this.getList();
     },
     onReSet() {},
-    lookCamp(row) {},
-    resetCamp(row) {},
-    deleteCamp(row) {},
-    addCamp(){
-      this.$refs.eidtCamp.openDioag()
+    lookCamp(row) {
+      console.log(row)
+      this.$router.push({path:'/operateManager/aristCampDetail',query:{id:row.id,imGroupIds:row.imGroupIds,name:row.name}})
+    },
+    resetCamp(row) {
+      this.$refs.eidtCamp.openDioag(row);
+    },
+    deleteCamp(row) {
+      this.$confirm("确定删除?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          delTrainingCamp(row.id).then((res) => {
+            if (res.code === 200) {
+              this.$message.success("删除成功");
+              this.getList();
+              // this.routeOrderStatus = false;
+            }
+          });
+        })
+        .catch();
+    },
+    addCamp() {
+      this.$refs.eidtCamp.openDioag();
     },
+    getRosterList(){
+      this.$refs.campRosterList.openDioag();
+    }
   },
 };
 </script>

+ 100 - 0
src/views/littleArtistCamp/models/artistClock.vue

@@ -0,0 +1,100 @@
+<template>
+  <el-dialog
+    width="400px"
+    :title="activeRow.username|| ''"
+    :visible.sync="lookVisible"
+    :before-close="onClose"
+  >
+    <div class="days-list">
+      <div class="days-block" v-for="i in 21" :key="i">
+        <div class="days-item ">
+          <img
+            class="clock-img"
+            src="../images/icon_check_disabled.png"
+            alt=""
+          />
+          <p>6月20日</p>
+        </div>
+      </div>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getUserTrainingTime } from '../api'
+export default {
+  data() {
+    return {
+      lookVisible: false,
+      activeRow:{username:null},
+      trainingList:[]
+    };
+  },
+  methods: {
+   async openDioag(row) {
+      this.activeRow = row;
+      try {
+        const res = await getUserTrainingTime({userId:row.id})
+        this.trainingList = res.data
+      }catch(e){
+        console.log(e)
+      }
+      this.lookVisible = true;
+    },
+    onClose(){
+          this.lookVisible = false;
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.flex-center {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+}
+// .artistClock {
+//   background: url("../images/clock_bg.png") no-repeat center top #f8f9fc;
+
+.days-list {
+  display: flex;
+  flex-wrap: wrap;
+}
+.days-block {
+  width: 20%;
+  text-align: center;
+  margin-top: 10px;
+}
+.days-item {
+  display: flex;
+  align-items: center;
+  flex-direction: column;
+  justify-content: center;
+  margin: 0 auto;
+  width: 55px;
+  height: 66px;
+  background: linear-gradient(180deg, #f0f0f0 0%, #d3d3d3 100%);
+  box-shadow: 0px 6px 4px 0px rgba(125, 125, 125, 0.14);
+  border-radius: 0.06rem;
+  p {
+    font-size: 13px;
+    font-weight: 500;
+    color: #ffffff;
+  }
+  .clock-img {
+    width: 29px;
+    height: 29px;
+    margin-top: 5px;
+    margin-bottom: 3px;
+  }
+}
+.close {
+  background: linear-gradient(180deg, #ffccbb 0%, #ff9d8b 100%);
+  box-shadow: 0px 6px 4px 0px rgba(255, 160, 139, 0.29);
+}
+.check {
+  background: linear-gradient(180deg, #a1ee99 0%, #b9de66 100%);
+  box-shadow: 0px 6px 4px 0px rgba(83, 160, 75, 0.14);
+}
+</style>

+ 153 - 0
src/views/littleArtistCamp/models/campRosterList.vue

@@ -0,0 +1,153 @@
+<template>
+  <div>
+    <el-dialog
+      width="1200px"
+      title="参与名单"
+      :visible.sync="lookVisible"
+      :before-close="onClose"
+    >
+      <div class="">
+        <el-form :inline="true" :model="searchForm">
+          <el-form-item>
+            <el-input
+              v-model.trim="searchForm.search"
+              clearable
+              @keyup.enter.native="search"
+              placeholder="学员姓名/手机号/编号"
+            ></el-input>
+          </el-form-item>
+          <el-form-item prop="state">
+            <el-select
+              v-model.trim="searchForm.state"
+              clearable
+              placeholder="状态"
+            >
+              <el-option value="NOT_APPLY" label="未报名"></el-option>
+              <el-option value="APPLY" label="已报名"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button @click="search" type="primary">搜索</el-button>
+            <el-button @click="onReSet" type="danger">重置</el-button>
+          </el-form-item>
+        </el-form>
+
+        <div class="tableWrap">
+          <el-table
+            style="width: 100%"
+            :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+            :data="tableList"
+            ref="multipleSelection"
+          >
+            <el-table-column
+              align="center"
+              prop="id"
+              label="学员编号"
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              prop="username"
+              label="学员姓名"
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              prop="phone"
+              label="手机号"
+            ></el-table-column>
+            <el-table-column align="center" prop="state" label="状态">
+              <template slot-scope="scope">
+                <div>
+                  <p v-if="scope.row.state == 'NOT_APPLY'">未报名</p>
+                  <p v-else-if="scope.row.state == 'APPLY'">已报名</p>
+                  <p v-else>--</p>
+                </div>
+              </template>
+            </el-table-column>
+          </el-table>
+          <pagination
+            sync
+            :total.sync="rules.total"
+            :page.sync="rules.page"
+            :limit.sync="rules.limit"
+            :page-sizes="rules.page_size"
+            @pagination="getList"
+          />
+        </div>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="onClose">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { getTrainingCampUser } from "../api";
+import pagination from "@/components/Pagination/index";
+
+export default {
+  name: "campRosterList",
+  components: { pagination },
+  data() {
+    return {
+      searchForm: {
+        search: "",
+        state: "",
+      },
+      tableList: [],
+      organList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+      lookVisible: false,
+      activeRow: { sendFlag: false },
+    };
+  },
+
+  mounted() {},
+  methods: {
+    async getList() {
+      try {
+        const res = await getTrainingCampUser({
+          ...this.searchForm,
+          page: this.rules.page,
+          rows: this.rules.limit,
+        });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.searchForm.search = "";
+      this.searchForm.state = "";
+      this.search();
+    },
+
+    onClose() {
+      this.lookVisible = false;
+    },
+    openDioag(row) {
+      this.activeRow = row;
+      this.lookVisible = true;
+      this.getList();
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.w100 {
+  width: 100%;
+}
+.btnWrap {
+  justify-content: flex-start;
+}
+</style>

+ 35 - 19
src/views/littleArtistCamp/models/eidtCamp.vue

@@ -20,12 +20,13 @@
             class="w100"
             type="daterange"
             value-format="yyyy-MM-dd"
+            @change="()=>{
+              formes.trainTime = []
+            }"
             range-separator="至"
             start-placeholder="报名开始日期"
             end-placeholder="报名结束日期"
-            :picker-options="{
-              firstDayOfWeek: 1,
-            }"
+            :picker-options="payDate()"
           >
           </el-date-picker>
         </el-form-item>
@@ -38,9 +39,7 @@
             range-separator="至"
             start-placeholder="训练开始日期"
             end-placeholder="训练结束日期"
-            :picker-options="{
-              firstDayOfWeek: 1,
-            }"
+            :picker-options="payendTimer"
           >
           </el-date-picker>
         </el-form-item>
@@ -53,8 +52,9 @@
   </div>
 </template>
 <script>
-import { addTrainingCamp,resetTrainingCamp } from "../api";
+import { addTrainingCamp, resetTrainingCamp } from "../api";
 import { getTimes } from "@/utils";
+let that;
 export default {
   name: "eidtCamp",
   data() {
@@ -73,6 +73,7 @@ export default {
   },
 
   mounted() {
+    that = this
     this.init();
   },
   methods: {
@@ -82,7 +83,7 @@ export default {
       if (row && row.id) {
         this.activeRow = row;
         this.title = "修改训练营";
-        // this.formes = { ...row };
+        this.formes = { ...row ,applyTime:[row.applyStartDate,row.applyEndDate],trainTime:[row.trainStartDate,row.trainEndDate]};
       } else {
         this.title = "新建训练营";
       }
@@ -91,11 +92,9 @@ export default {
     onClose() {
       this.formes = {
         id: "",
-        postType: "0",
-        sendTime: "",
-        messageContent: "",
-        messageType: "",
-        fileName: "",
+        name: "",
+        applyTime: [],
+        trainTime: [],
       };
       this.$refs["eidtCamp"].resetFields();
       this.lookVisible = false;
@@ -105,27 +104,27 @@ export default {
         if (flag) {
           try {
             if (this.activeRow && this.activeRow.id) {
-              let { applyTime, trainTime, ...rest } = this.forms;
+              let { applyTime, trainTime, ...rest } = this.formes;
               let params = {
                 ...rest,
                 ...getTimes(applyTime, ["applyStartDate", "applyEndDate"]),
                 ...getTimes(trainTime, ["trainStartDate", "trainEndDate"]),
               };
-              const res = await resetTrainingCamp({ ...obj });
+              const res = await resetTrainingCamp({ ...params });
               this.$message.success("修改成功");
               this.onClose();
-              this.$emit('getList')
+              this.$emit("getList");
             } else {
-              let { applyTime, trainTime, ...rest } = this.forms;
+              let { applyTime, trainTime, ...rest } = this.formes;
               let params = {
                 ...rest,
                 ...getTimes(applyTime, ["applyStartDate", "applyEndDate"]),
                 ...getTimes(trainTime, ["trainStartDate", "trainEndDate"]),
               };
-              const res = await addTrainingCamp({ ...obj });
+              const res = await addTrainingCamp({ ...params });
               this.$message.success("新建成功");
               this.onClose();
-                 this.$emit('getList')
+              this.$emit("getList");
             }
           } catch (e) {
             console.log(e);
@@ -146,6 +145,23 @@ export default {
       };
     },
   },
+    computed: {
+    payendTimer: () => {
+      return {
+        firstDayOfWeek: 1,
+        disabledDate(time) {
+          if (that.formes.applyTime[1]) {
+            return (
+              time.getTime() + 86400000 <=
+              new Date(that.formes.applyTime[1]).getTime()
+            );
+          } else {
+            return time.getTime() + 86400000 <= new Date().getTime();
+          }
+        },
+      };
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>

+ 20 - 0
src/views/liveClassManager/api.js

@@ -106,3 +106,23 @@ export const opsPopularize= data => {
     params: data
   })
 }
+
+
+// 直播间商品列表
+export const getLiveGoodsMapper= data => {
+  return request({
+    url: '/api-web/liveGoodsMapper/page',
+    method: 'post',
+    data,
+  })
+}
+
+
+// 新增直播间商品
+export const addLiveGoodsMapper= data => {
+  return request({
+    url: '/api-web/liveGoodsMapper/add',
+    method: 'post',
+    data,
+  })
+}

+ 20 - 4
src/views/liveClassManager/index.vue

@@ -124,7 +124,10 @@
           <el-table-column align="center" prop="studentId" label="操作">
             <template slot-scope="scope">
               <div>
-                <auth auths="imLiveBroadcastRoom/opsPopularize"  v-if="scope.row.liveState != 2">
+                <auth
+                  auths="imLiveBroadcastRoom/opsPopularize"
+                  v-if="scope.row.liveState != 2"
+                >
                   <el-button type="text" @click="popularizeRoom(scope.row)">{{
                     scope.row.popularize == 1 ? "取消推广" : "首页推广"
                   }}</el-button>
@@ -144,6 +147,15 @@
                   @click="gotoDetail(scope.row)"
                   >直播详情</el-button
                 >
+                <auth auths="imLiveBroadcastRoom/roomDestroy">
+                  <el-button
+                    type="text"
+                    v-if="scope.row.liveState == 1 || scope.row.liveState == 0"
+                    @click="setShop(scope.row)"
+                    >商品设置</el-button
+                  >
+                </auth>
+
                 <auth auths="imLiveBroadcastRoom/shareGroup">
                   <el-button type="text" @click="shareLive(scope.row)"
                     >分享</el-button
@@ -322,13 +334,13 @@ export default {
       });
     },
     async popularizeRoom(row) {
-      let popularize,str;
+      let popularize, str;
       if (row.popularize) {
         popularize = 0;
-        str='取消推广'
+        str = "取消推广";
       } else {
         popularize = 1;
-        str='推广'
+        str = "推广";
       }
       this.$confirm(`您是否${str}直播间"${row.roomTitle}"`, "提示", {
         confirmButtonText: "确定",
@@ -349,6 +361,10 @@ export default {
         })
         .catch(() => {});
     },
+    setShop(row){
+      this.$router.push({path:'/business/liveShopControl',query:{roomUid:row.roomUid}})
+      //
+    }
   },
 };
 </script>

+ 224 - 0
src/views/liveClassManager/liveShopControl.vue

@@ -0,0 +1,224 @@
+<template>
+  <div class="m-container">
+    <h2>
+      <el-page-header @back="onCancel" :content="detail.roomTitle || ''"></el-page-header>
+    </h2>
+    <div class="m-core">
+      <el-alert title="直播课信息" :closable="false" type="info"> </el-alert>
+      <descriptions :column="4">
+        <descriptions-item label="直播课标题:">{{
+          detail.roomTitle || ""
+        }}</descriptions-item>
+        <descriptions-item label="主讲人:">{{
+          detail.speakerName || ""
+        }}</descriptions-item>
+        <descriptions-item label="直播开始时间:">{{
+          detail.liveStartTime | dateForMinFormat
+        }}</descriptions-item>
+        <descriptions-item label="状态:">{{
+          detail.liveState | liveState
+        }}</descriptions-item>
+      </descriptions>
+      <el-alert
+        title="直播商品"
+        :closable="false"
+        type="info"
+        style="margin: 20px 0"
+      >
+      </el-alert>
+      <save-form
+        :inline="true"
+        :model="searchForm"
+        @submit="search"
+        @reset="onReSet"
+      >
+        <el-form-item>
+          <el-input
+            v-model.trim="searchForm.search"
+            clearable
+            @keyup.enter.native="search"
+            placeholder="商品编号/名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item prop="status">
+          <el-select
+            v-model.trim="searchForm.status"
+            clearable
+            filterable
+            placeholder="状态"
+          >
+            <el-option label="上架" :value="1"></el-option>
+            <el-option label="下架" :value="0"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button native-type="submit" type="primary">搜索</el-button>
+          <el-button native-type="reset" type="danger">重置</el-button>
+        </el-form-item>
+      </save-form>
+      <auth auths="imLiveBroadcastRoom/add">
+        <el-button
+          @click="addShop"
+          type="primary"
+          style="margin-bottom: 20px"
+          >添加</el-button
+        >
+      </auth>
+      <div class="tableWrap">
+        <el-table
+          style="width: 100%"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+          :data="tableList"
+        >
+          <el-table-column
+            align="center"
+            prop="id"
+            label="商品编号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="name"
+            label="商品名称"
+          ></el-table-column>
+          <el-table-column align="center" prop="originalPrice" label="原价">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.originalPrice | moneyFormat(true) }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="currentPrice" label="直播价">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.currentPrice | moneyFormat(true) }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="stockCount"
+            label="库存"
+          ></el-table-column>
+          <el-table-column align="center" prop="status" label="状态">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.status ? "上架" : "下架" }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="studentId" label="操作">
+            <template slot-scope="scope">
+              <div>
+                <auth auths="liveGoods/update">
+                  <el-button type="text" @click="resetShop(scope.row)"
+                    >上架</el-button
+                  >
+                </auth>
+                <auth auths="liveGoods/delete">
+                  <el-button type="text" @click="deteleShop(scope.row)"
+                    >删除</el-button
+                  >
+                </auth>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination
+          sync
+          :total.sync="rules.total"
+          :page.sync="rules.page"
+          :limit.sync="rules.limit"
+          :page-sizes="rules.page_size"
+          @pagination="getList"
+        />
+      </div>
+    </div>
+    <addLiveShop ref='addLiveShop' @getList='getList'/>
+  </div>
+</template>
+<script>
+import { getToken, getTenantId } from "@/utils/auth";
+import { getLiveBroadcastRoomDetail, getLiveGoodsMapper } from "./api";
+import pagination from "@/components/Pagination/index";
+import addLiveShop from './modals/addLiveShop'
+export default {
+  components: { pagination,addLiveShop },
+  data() {
+    return {
+
+      detail: {
+        roomTitle: "",
+        speakerName: "",
+        liveStartTime: "",
+        liveState: "",
+      },
+      searchForm: {
+        search: "",
+        status: "",
+      },
+
+      tableList: [],
+      organList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+    };
+  },
+  mounted() {
+    this.getDetail();
+  },
+  methods: {
+    async getList() {
+      let params = {
+        ...this.searchForm,
+        page: this.rules.page,
+        rows: this.rules.limit,
+      };
+      try {
+        const res = await getLiveGoodsMapper({ ...params });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.searchForm.search = "";
+      this.searchForm.status = "";
+      this.search();
+    },
+    onCancel() {
+      this.$store.dispatch("delVisitedViews", this.$route);
+      this.$router.push("/liveClassManager");
+    },
+    async getDetail() {
+      try {
+        let obj = {
+          roomUid: this.$route.query.roomUid,
+        };
+
+        const res = await getLiveBroadcastRoomDetail(obj);
+        this.detail = { ...res.data };
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    addShop(){
+      this.$refs.addLiveShop.openDioag({id:123})
+    }
+  },
+};
+</script>
+<style lang="scss" scoped>
+/deep/.description-tr {
+  border-bottom: none !important;
+}
+</style>

+ 244 - 0
src/views/liveClassManager/modals/addLiveShop.vue

@@ -0,0 +1,244 @@
+<template>
+  <div>
+    <el-dialog
+      width="1000px"
+      title="添加商品"
+      :visible.sync="lookVisible"
+      :before-close="onClose"
+      append-to-body
+    >
+      <div>
+        <el-form :inline="true" :model="searchForm">
+          <el-form-item>
+            <el-input
+              v-model.trim="searchForm.search"
+              clearable
+              @keyup.enter.native="search"
+              placeholder="商品名称"
+            ></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button @click="search" type="primary">搜索</el-button>
+            <el-button @click="onReSet" type="danger">重置</el-button>
+          </el-form-item>
+        </el-form>
+        <div class="tableWrap">
+          <el-table
+            style="width: 100%"
+            :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+            :data="tableList"
+            @selection-change="handleSelectionChange"
+            @select="onTableSelect"
+            ref="multipleSelection"
+          >
+            <el-table-column type="selection" width="55"> </el-table-column>
+            <el-table-column
+              align="center"
+              prop="id"
+              label="商品编号"
+            ></el-table-column>
+            <el-table-column
+              align="center"
+              prop="name"
+              label="商品名称"
+            ></el-table-column>
+            <el-table-column align="center" prop="originalPrice" label="原价">
+              <template slot-scope="scope">
+                <div>
+                  {{ scope.row.originalPrice | moneyFormat(true) }}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" prop="currentPrice" label="直播价">
+              <template slot-scope="scope">
+                <div>
+                  {{ scope.row.currentPrice | moneyFormat(true) }}
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column
+              align="center"
+              prop="stockCount"
+              label="库存"
+            ></el-table-column>
+          </el-table>
+          <pagination
+            sync
+            :total.sync="rules.total"
+            :page.sync="rules.page"
+            :limit.sync="rules.limit"
+            :page-sizes="rules.page_size"
+            @pagination="getList"
+          />
+        </div>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submit">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { getGroupList, addGroupMessageList } from "../api";
+import { getLiveGoodsMapperList } from "@/views/liveShopManger/api";
+import pagination from "@/components/Pagination/index";
+export default {
+  name: "eidtPostMsg",
+  components: { pagination },
+  data() {
+    return {
+      searchForm: {
+        search: "",
+      },
+      tableList: [],
+      organList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+      addMuiscVisible: false,
+      multipleSelection: [],
+      chioseIdList: [],
+      isNewPage: false,
+      lookVisible: false,
+      activeRow: { sendFlag: false },
+    };
+  },
+
+  mounted() {},
+  methods: {
+    async getList() {
+      try {
+        const res = await getLiveGoodsMapperList({
+          ...this.searchForm,
+          page: this.rules.page,
+          rows: this.rules.limit,
+          imSendGroupMessageId: this.activeRow.id,
+        });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
+        let idList = this.chioseIdList.map((group) => {
+          return group.id;
+        });
+        this.isNewPage = true;
+        this.$nextTick(() => {
+          this.tableList.forEach((course) => {
+            if (idList.indexOf(course.id) != -1) {
+              this.$refs.multipleSelection.toggleRowSelection(course, true);
+            }
+          });
+          this.isNewPage = false;
+        });
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.searchForm.search = "";
+      this.clearCom();
+      this.search();
+    },
+    async submit() {
+      if (!this.chioseIdList || this.chioseIdList.length <= 0) {
+        this.$message.error("请至少选择一件商品");
+        return;
+      }
+      try {
+        let idList = this.chioseIdList
+          .map((group) => {
+            return group.id;
+          })
+          .join(",");
+        const res = await addGroupMessageList({
+          groupIds: idList,
+          imSendGroupMessageId: this.activeRow.id,
+        });
+        this.$message.success("添加成功");
+        this.$emit("getList");
+        this.onClose();
+      } catch (e) {
+        console.log(e);
+      }
+
+      // 开始  addGroupMessageList
+      /**
+       *
+
+       */
+      console.log(this.chioseIdList);
+    },
+    handleSelectionChange(val) {
+      if (val.length > 0) {
+        this.chioseIdList = this.chioseIdList.concat(val);
+        this.chioseIdList = this.$helpers.lodash.uniqBy(
+          this.chioseIdList,
+          "id"
+        );
+      } else {
+        if (this.isNewPage) return;
+        let idList = this.chioseIdList.map((group) => {
+          return group.id;
+        });
+        this.$nextTick(() => {
+          let tableIdList = [];
+          this.tableList.forEach((group) => {
+            tableIdList.push(group.id);
+            if (idList.indexOf(group.id) != -1) {
+              this.$refs.multipleSelection.toggleRowSelection(group, false);
+            }
+          });
+          this.chioseIdList = this.$helpers.lodash.remove(
+            this.chioseIdList,
+            function (item) {
+              return tableIdList.indexOf(item.id) == -1;
+            }
+          );
+          if (this.chioseIdList.length <= 0) {
+            this.clearCom();
+          }
+        });
+      }
+    },
+    clearCom() {
+      this.chioseIdList = [];
+      this.$refs.multipleSelection.clearSelection();
+    },
+    onTableSelect(rows, row) {
+      let idList = this.chioseIdList.map((group) => {
+        return group.id;
+      });
+      if (idList.indexOf(row.id) != -1) {
+        this.chioseIdList.splice(idList.indexOf(row.id), 1);
+        if (this.chioseIdList.length <= 0) {
+          this.clearCom();
+        }
+      }
+    },
+    onClose() {
+      this.clearCom();
+      this.lookVisible = false;
+    },
+    openDioag(row) {
+      this.activeRow = row;
+      this.lookVisible = true;
+      console.log(row);
+      this.getList();
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.w100 {
+  width: 100%;
+}
+.btnWrap {
+  justify-content: flex-start;
+}
+</style>

+ 41 - 0
src/views/liveShopManger/api.js

@@ -0,0 +1,41 @@
+import request from '@/utils/request2'
+// 获取商品列表
+export const getLiveGoodsMapperList = data => {
+  return request({
+    url: '/api-web/liveGoods/page',
+    method: 'post',
+    data,
+    requestType:'form'
+  })
+}
+
+// 新建直播商品
+export const addLiveGoods = data => {
+  return request({
+    url: '/api-web/liveGoods/add',
+    method: 'post',
+    data,
+    requestType: 'json',
+  })
+}
+
+
+// 修改直播商品
+export const resetLiveGoods = data => {
+  return request({
+    url: '/api-web/liveGoods/update',
+    method: 'post',
+    data,
+    requestType: 'json',
+  })
+}
+
+// 删除
+export const delLiveGoods = data => {
+  return request({
+    url: '/api-web/liveGoods/delete',
+    method: 'post',
+    data,
+    requestType:'form'
+  })
+}

+ 194 - 0
src/views/liveShopManger/index.vue

@@ -0,0 +1,194 @@
+<!--  -->
+<template>
+  <div class="m-container">
+    <h2>
+      <div class="squrt"></div>
+      直播商品管理
+    </h2>
+    <div class="m-core">
+      <auth auths="liveGoods/add">
+        <el-button
+          type="primary"
+          style="margin-bottom: 30px; margian-right: 10px"
+          @click="addLiveShop"
+          >新建商品</el-button
+        >
+      </auth>
+      <save-form
+        :inline="true"
+        :model="searchForm"
+        @submit="search"
+        @reset="onReSet"
+      >
+        <el-form-item>
+          <el-input
+            v-model.trim="searchForm.search"
+            clearable
+            @keyup.enter.native="search"
+            placeholder="商品编号/名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button native-type="submit" type="primary">搜索</el-button>
+          <el-button native-type="reset" type="danger">重置</el-button>
+        </el-form-item>
+      </save-form>
+      <div class="tableWrap">
+        <el-table
+          style="width: 100%"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+          :data="tableList"
+        >
+          <el-table-column
+            align="center"
+            prop="id"
+            label="商品编号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="name"
+            label="商品名称"
+          ></el-table-column>
+          <el-table-column align="center" prop="originalPrice" label="原价">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.originalPrice | moneyFormat(true) }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="currentPrice" label="直播价">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.currentPrice | moneyFormat(true) }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="stockCount"
+            label="库存"
+          ></el-table-column>
+          <el-table-column align="center" prop="studentId" label="操作">
+            <template slot-scope="scope">
+              <div>
+                <auth
+                  auths="liveGoods/update"
+                >
+                  <el-button type="text" @click="resetShop(scope.row)"
+                    >修改</el-button
+                  >
+                </auth>
+                <auth
+                  auths="liveGoods/delete"
+                >
+                  <el-button type="text" @click="deteleShop(scope.row)"
+                    >删除</el-button
+                  >
+                </auth>
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination
+          sync
+          :total.sync="rules.total"
+          :page.sync="rules.page"
+          :limit.sync="rules.limit"
+          :page-sizes="rules.page_size"
+          @pagination="getList"
+        />
+      </div>
+    </div>
+    <eidtLiveShop ref="eidtLiveShop" @getList="getList" />
+  </div>
+</template>
+
+<script>
+import axios from "axios";
+import { getToken } from "@/utils/auth";
+import pagination from "@/components/Pagination/index";
+import load from "@/utils/loading";
+import { getTimes } from "@/utils";
+import { getLiveGoodsMapperList,delLiveGoods } from "./api";
+import eidtLiveShop from "./models/eidtLiveShop";
+export default {
+  components: { pagination, eidtLiveShop },
+  data() {
+    return {
+      searchForm: {
+        search: null,
+      },
+
+      tableList: [],
+      organList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+    };
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    // 获取分部
+
+    this.init();
+  },
+  methods: {
+    init() {
+      this.getList();
+    },
+    async getList() {
+      let params = {
+        ...this.searchForm,
+        page: this.rules.page,
+        rows: this.rules.limit,
+      };
+      try {
+        const res = await getLiveGoodsMapperList({ ...params });
+        this.tableList = res.data.rows;
+        this.rules.total = res.data.total;
+      } catch (e) {
+        console.log(e);
+      }
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.searchForm.search = "";
+      this.search();
+    },
+    resetShop(row) {
+      this.$refs.eidtLiveShop.openDioag(row);
+    },
+    addLiveShop() {
+      this.$refs.eidtLiveShop.openDioag();
+    },
+    deteleShop(row) {
+      this.$confirm(`确定删除"${row.name}"?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          delLiveGoods({ goodsId: row.id }).then((res) => {
+            if (res.code === 200) {
+              this.$message.success("删除成功");
+              this.getList();
+              // this.routeOrderStatus = false;
+            }
+          });
+        })
+        .catch();
+    },
+  },
+};
+</script>
+<style lang='scss' scoped>
+</style>

+ 248 - 0
src/views/liveShopManger/models/eidtLiveShop.vue

@@ -0,0 +1,248 @@
+<template>
+  <div>
+    <el-dialog
+      width="800px"
+      :title="title"
+      :visible.sync="lookVisible"
+      :before-close="onClose"
+    >
+      <el-form :model="formes" label-width="120px" ref="eidtCamp">
+        <el-row :gutter="10">
+          <el-col :xl="12" :lg="12" :md="12" :xs="12">
+            <el-form-item
+              label="商品名称"
+              :rules="[{ required: true, message: '请输入商品名称' }]"
+              prop="name"
+            >
+              <el-input class="w100" v-model="formes.name"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xl="12" :lg="12" :md="12" :xs="12">
+            <el-form-item
+              label="库存"
+              :rules="[{ required: true, message: '请输入库存数量' }]"
+              prop="stockCount"
+            >
+              <el-input class="w100" v-model="formes.stockCount">
+                <template slot="append">件</template>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="10">
+          <el-col :xl="12" :lg="12" :md="12" :xs="12">
+            <el-form-item
+              label="原价"
+              :rules="[
+                { required: true, message: '请输入商品原价' },
+                {
+                  pattern:
+                    /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                  message: '请输入正确的金额',
+                },
+              ]"
+              prop="originalPrice"
+            >
+              <el-input class="w100" v-model="formes.originalPrice">
+                <template slot="append">原价</template>
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xl="12" :lg="12" :md="12" :xs="12">
+            <el-form-item
+              label="直播价"
+              :rules="[
+                { required: true, message: '请输入商品直播价' },
+                {
+                  pattern:
+                    /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+                  message: '请输入正确的金额',
+                },
+              ]"
+              prop="currentPrice"
+            >
+              <el-input class="w100" v-model="formes.currentPrice">
+                <template slot="append">元</template>
+              </el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="10">
+          <el-col :xl="24" :lg="24" :md="24" :xs="24">
+            <el-form-item
+              label="描述"
+              :rules="[{ required: true, message: '请输入商品描述' }]"
+              prop="desc"
+            >
+              <el-input class="w100" v-model="formes.desc"> </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xl="24" :lg="24" :md="24" :xs="24">
+            <el-form-item
+              label="商品详情链接"
+              :rules="[{ required: true, message: '请输入商品详情链接' }]"
+              prop="goodsDetailUrl"
+            >
+              <el-input class="w100" v-model="formes.goodsDetailUrl">
+              </el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xl="24" :lg="24" :md="24" :xs="24">
+            <el-form-item
+              label="商品图片"
+              :rules="[{ required: true, message: '请选择商品图片' }]"
+              prop="image"
+            >
+              <image-cropper
+                :options="cropperOptions"
+                :imgSize="2"
+                :imageUrl="formes.image"
+                @crop-upload-success="cropSuccess"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="onClose">取 消</el-button>
+        <el-button type="primary" @click="submitMsg">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import { addLiveGoods, resetLiveGoods } from "../api";
+import ImageCropper from "@/components/ImageCropper";
+import { getTimes } from "@/utils";
+let that;
+export default {
+  name: "eidtCamp",
+  components: { ImageCropper },
+  data() {
+    return {
+      title: "",
+      formes: {
+        id: "",
+        name: "",
+        currentPrice: "",
+        originalPrice: "",
+        image: "",
+        stockCount: "",
+        desc: "",
+        goodsDetailUrl: "",
+      },
+      lookVisible: false,
+      chioseIdList: null,
+      activeRow: null,
+      cropperOptions: {
+        autoCrop: true, //是否默认生成截图框
+        autoCropWidth: 200, //默认生成截图框宽度
+        autoCropHeight: 200, //默认生成截图框高度
+        fixedBox: true, //是否固定截图框大小 不允许改变
+        previewsCircle: false, //预览图是否是圆形
+        title: "商品图片", //模态框上显示的标题
+      },
+    };
+  },
+
+  mounted() {
+    that = this;
+    this.init();
+  },
+  methods: {
+    init() {},
+
+    openDioag(row) {
+      if (row && row.id) {
+        this.activeRow = row;
+        this.title = "修改直播商品";
+        this.formes = {
+          ...row,
+        };
+      } else {
+        this.title = "新建直播商品";
+      }
+      this.lookVisible = true;
+    },
+    onClose() {
+      this.formes = {
+        id: "",
+        name: "",
+        currentPrice: "",
+        originalPrice: "",
+        image: "",
+        stockCount: "",
+        desc: "",
+        goodsDetailUrl: "",
+      };
+      this.$refs["eidtCamp"].resetFields();
+      this.lookVisible = false;
+    },
+    submitMsg() {
+      this.$refs.eidtCamp.validate(async (flag) => {
+        if (flag) {
+          try {
+            if (this.activeRow && this.activeRow.id) {
+              let params = {
+                ...this.formes,
+              };
+              const res = await resetLiveGoods({ ...params });
+              this.$message.success("修改成功");
+              this.onClose();
+              this.$emit("getList");
+            } else {
+              let params = {
+                ...this.formes,
+              };
+              const res = await addLiveGoods({ ...params });
+              this.$message.success("新建成功");
+              this.onClose();
+              this.$emit("getList");
+            }
+          } catch (e) {
+            console.log(e);
+          }
+        }
+      });
+    },
+    getName(val) {
+      this.formes.fileName = val.data.name;
+    },
+    payDate() {
+      let self = this;
+      return {
+        firstDayOfWeek: 1,
+        disabledDate(time) {
+          return time.getTime() + 86400000 < new Date().getTime();
+        },
+      };
+    },
+    cropSuccess(data) {
+      console.log(data);
+      this.formes.image = data.data.url;
+    },
+  },
+  computed: {
+    payendTimer: () => {
+      return {
+        firstDayOfWeek: 1,
+        disabledDate(time) {
+          if (that.formes.applyTime[1]) {
+            return (
+              time.getTime() + 86400000 <=
+              new Date(that.formes.applyTime[1]).getTime()
+            );
+          } else {
+            return time.getTime() + 86400000 <= new Date().getTime();
+          }
+        },
+      };
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.w100 {
+  width: 100%;
+}
+</style>

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác