Browse Source

红包、抽奖新增代码

chenguo 3 days ago
parent
commit
597f3feca2

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

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询直播触发事件配置列表
+export function listLiveEventConf(query) {
+  return request({
+    url: '/live/liveEventConf/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询直播触发事件配置详细
+export function getLiveEventConf(eventId) {
+  return request({
+    url: '/live/liveEventConf/' + eventId,
+    method: 'get'
+  })
+}
+
+// 新增直播触发事件配置
+export function addLiveEventConf(data) {
+  return request({
+    url: '/live/liveEventConf',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改直播触发事件配置
+export function updateLiveEventConf(data) {
+  return request({
+    url: '/live/liveEventConf',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除直播触发事件配置
+export function delLiveEventConf(eventId) {
+  return request({
+    url: '/live/liveEventConf/' + eventId,
+    method: 'delete'
+  })
+}
+
+// 导出直播触发事件配置
+export function exportLiveEventConf(query) {
+  return request({
+    url: '/live/liveEventConf/export',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询直播抽奖配置列表
+export function listLiveLotteryConf(query) {
+  return request({
+    url: '/live/liveLotteryConf/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询直播抽奖配置详细
+export function getLiveLotteryConf(lotteryId) {
+  return request({
+    url: '/live/liveLotteryConf/' + lotteryId,
+    method: 'get'
+  })
+}
+
+// 新增直播抽奖配置
+export function addLiveLotteryConf(data) {
+  return request({
+    url: '/live/liveLotteryConf',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改直播抽奖配置
+export function updateLiveLotteryConf(data) {
+  return request({
+    url: '/live/liveLotteryConf',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除直播抽奖配置
+export function delLiveLotteryConf(lotteryId) {
+  return request({
+    url: '/live/liveLotteryConf/' + lotteryId,
+    method: 'delete'
+  })
+}
+
+// 导出直播抽奖配置
+export function exportLiveLotteryConf(query) {
+  return request({
+    url: '/live/liveLotteryConf/export',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询直播抽奖记录列表
+export function listLiveLotteryRecord(query) {
+  return request({
+    url: '/live/liveLotteryRecord/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询直播抽奖记录详细
+export function getLiveLotteryRecord(lotteryId) {
+  return request({
+    url: '/live/liveLotteryRecord/' + lotteryId,
+    method: 'get'
+  })
+}
+
+// 新增直播抽奖记录
+export function addLiveLotteryRecord(data) {
+  return request({
+    url: '/live/liveLotteryRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改直播抽奖记录
+export function updateLiveLotteryRecord(data) {
+  return request({
+    url: '/live/liveLotteryRecord',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除直播抽奖记录
+export function delLiveLotteryRecord(lotteryId) {
+  return request({
+    url: '/live/liveLotteryRecord/' + lotteryId,
+    method: 'delete'
+  })
+}
+
+// 导出直播抽奖记录
+export function exportLiveLotteryRecord(query) {
+  return request({
+    url: '/live/liveLotteryRecord/export',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询直播抽奖登记列表
+export function listLiveLotteryRegistration(query) {
+  return request({
+    url: '/live/liveLotteryRegistration/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询直播抽奖登记详细
+export function getLiveLotteryRegistration(registrationId) {
+  return request({
+    url: '/live/liveLotteryRegistration/' + registrationId,
+    method: 'get'
+  })
+}
+
+// 新增直播抽奖登记
+export function addLiveLotteryRegistration(data) {
+  return request({
+    url: '/live/liveLotteryRegistration',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改直播抽奖登记
+export function updateLiveLotteryRegistration(data) {
+  return request({
+    url: '/live/liveLotteryRegistration',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除直播抽奖登记
+export function delLiveLotteryRegistration(registrationId) {
+  return request({
+    url: '/live/liveLotteryRegistration/' + registrationId,
+    method: 'delete'
+  })
+}
+
+// 导出直播抽奖登记
+export function exportLiveLotteryRegistration(query) {
+  return request({
+    url: '/live/liveLotteryRegistration/export',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询直播红包记录配置列表
+export function listLiveRedConf(query) {
+  return request({
+    url: '/live/liveRedConf/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询直播红包记录配置详细
+export function getLiveRedConf(redId) {
+  return request({
+    url: '/live/liveRedConf/' + redId,
+    method: 'get'
+  })
+}
+
+// 新增直播红包记录配置
+export function addLiveRedConf(data) {
+  return request({
+    url: '/live/liveRedConf',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改直播红包记录配置
+export function updateLiveRedConf(data) {
+  return request({
+    url: '/live/liveRedConf',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除直播红包记录配置
+export function delLiveRedConf(redId) {
+  return request({
+    url: '/live/liveRedConf/' + redId,
+    method: 'delete'
+  })
+}
+
+// 导出直播红包记录配置
+export function exportLiveRedConf(query) {
+  return request({
+    url: '/live/liveRedConf/export',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询直播用户中奖记录列表
+export function listLiveUserLotteryRecord(query) {
+  return request({
+    url: '/live/liveUserLotteryRecord/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询直播用户中奖记录详细
+export function getLiveUserLotteryRecord(id) {
+  return request({
+    url: '/live/liveUserLotteryRecord/' + id,
+    method: 'get'
+  })
+}
+
+// 新增直播用户中奖记录
+export function addLiveUserLotteryRecord(data) {
+  return request({
+    url: '/live/liveUserLotteryRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改直播用户中奖记录
+export function updateLiveUserLotteryRecord(data) {
+  return request({
+    url: '/live/liveUserLotteryRecord',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除直播用户中奖记录
+export function delLiveUserLotteryRecord(id) {
+  return request({
+    url: '/live/liveUserLotteryRecord/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出直播用户中奖记录
+export function exportLiveUserLotteryRecord(query) {
+  return request({
+    url: '/live/liveUserLotteryRecord/export',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -0,0 +1,53 @@
+import request from '@/utils/request'
+
+// 查询直播用户红包记录列表
+export function listLiveUserRedRecord(query) {
+  return request({
+    url: '/live/liveUserRedRecord/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询直播用户红包记录详细
+export function getLiveUserRedRecord(id) {
+  return request({
+    url: '/live/liveUserRedRecord/' + id,
+    method: 'get'
+  })
+}
+
+// 新增直播用户红包记录
+export function addLiveUserRedRecord(data) {
+  return request({
+    url: '/live/liveUserRedRecord',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改直播用户红包记录
+export function updateLiveUserRedRecord(data) {
+  return request({
+    url: '/live/liveUserRedRecord',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除直播用户红包记录
+export function delLiveUserRedRecord(id) {
+  return request({
+    url: '/live/liveUserRedRecord/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出直播用户红包记录
+export function exportLiveUserRedRecord(query) {
+  return request({
+    url: '/live/liveUserRedRecord/export',
+    method: 'get',
+    params: query
+  })
+}

+ 315 - 0
src/views/live/liveEventConf/index.vue

@@ -0,0 +1,315 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="直播间ID" prop="liveId">
+        <el-input
+          v-model="queryParams.liveId"
+          placeholder="请输入直播间ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="事件类型 (0:用户进入直播间, 1:用户发言, 2:用户点赞, 3:用户关注)" prop="eventType">
+        <el-select v-model="queryParams.eventType" placeholder="请选择事件类型 (0:用户进入直播间, 1:用户发言, 2:用户点赞, 3:用户关注)" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="创建日期" prop="createTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.createTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择创建日期">
+        </el-date-picker>
+      </el-form-item>
+      <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:liveEventConf: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:liveEventConf: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:liveEventConf: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:liveEventConf:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveEventConfList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="创建日期" align="center" prop="eventId" />
+      <el-table-column label="直播间ID" align="center" prop="liveId" />
+      <el-table-column label="事件类型 (0:用户进入直播间, 1:用户发言, 2:用户点赞, 3:用户关注)" align="center" prop="eventType" />
+      <el-table-column label="触发阈值" align="center" prop="triggerCount" />
+      <el-table-column label="关联红包ID" align="center" prop="redId" />
+      <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:liveEventConf:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveEventConf: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 v-model="form.liveId" placeholder="请输入直播间ID" />
+        </el-form-item>
+        <el-form-item label="事件类型 (0:用户进入直播间, 1:用户发言, 2:用户点赞, 3:用户关注)" prop="eventType">
+          <el-select v-model="form.eventType" placeholder="请选择事件类型 (0:用户进入直播间, 1:用户发言, 2:用户点赞, 3:用户关注)">
+            <el-option label="请选择字典生成" value="" />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="触发阈值" prop="triggerCount">
+          <el-input v-model="form.triggerCount" placeholder="请输入触发阈值" />
+        </el-form-item>
+        <el-form-item label="关联红包ID" prop="redId">
+          <el-input v-model="form.redId" placeholder="请输入关联红包ID" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveEventConf, getLiveEventConf, delLiveEventConf, addLiveEventConf, updateLiveEventConf, exportLiveEventConf } from "@/api/live/liveEventConf";
+
+export default {
+  name: "LiveEventConf",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 直播触发事件配置表格数据
+      liveEventConfList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null,
+        eventType: null,
+        createTime: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        liveId: [
+          { required: true, message: "直播间ID不能为空", trigger: "blur" }
+        ],
+        eventType: [
+          { required: true, message: "事件类型 (0:用户进入直播间, 1:用户发言, 2:用户点赞, 3:用户关注)不能为空", trigger: "change" }
+        ],
+        triggerCount: [
+          { required: true, message: "触发阈值不能为空", trigger: "blur" }
+        ],
+        redId: [
+          { required: true, message: "关联红包ID不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询直播触发事件配置列表 */
+    getList() {
+      this.loading = true;
+      listLiveEventConf(this.queryParams).then(response => {
+        this.liveEventConfList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        eventId: null,
+        liveId: null,
+        eventType: null,
+        triggerCount: null,
+        redId: null,
+        createTime: null,
+        udpateTime: null,
+        createBy: null,
+        updateBy: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.eventId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加直播触发事件配置";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const eventId = row.eventId || this.ids
+      getLiveEventConf(eventId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改直播触发事件配置";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.eventId != null) {
+            updateLiveEventConf(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveEventConf(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const eventIds = row.eventId || this.ids;
+      this.$confirm('是否确认删除直播触发事件配置编号为"' + eventIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveEventConf(eventIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有直播触发事件配置数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveEventConf(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 397 - 0
src/views/live/liveLotteryConf/index.vue

@@ -0,0 +1,397 @@
+<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="productId">
+        <el-input
+          v-model="queryParams.productId"
+          placeholder="请输入商品ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="奖品等级" prop="prizeLevel">
+        <el-input
+          v-model="queryParams.prizeLevel"
+          placeholder="请输入奖品等级"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与" prop="require">
+        <el-input
+          v-model="queryParams.require"
+          placeholder="请输入参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与"
+          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="直播间ID" align="center" prop="liveId" />
+      <el-table-column label="商品ID" align="center" prop="productId" />
+      <el-table-column label="奖品等级" align="center" prop="prizeLevel" />
+      <el-table-column label="单次中奖商品数量" align="center" prop="perLotteryNum" />
+      <el-table-column label="可中奖份量" align="center" prop="totalLots" />
+      <el-table-column label="实际发放奖励份量" align="center" prop="totalSend" />
+      <el-table-column label="参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与" align="center" prop="require" />
+      <el-table-column label="参与抽奖方式 2/3对应的配置,2:送礼数量,以最低档位礼物为单位 3:指定商品Id及数量,|竖线分割" align="center" prop="requireConf" />
+      <el-table-column label="持续时间 单位:分" align="center" prop="duration" />
+      <el-table-column label="描述/标题" align="center" prop="desc" />
+      <el-table-column label="创建日期" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="修改日期" align="center" prop="udpateTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.udpateTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建日期" align="center" prop="createBy" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createBy, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="修改日期" align="center" prop="updateBy" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updateBy, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            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: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 v-model="form.liveId" placeholder="请输入直播间ID" />
+        </el-form-item>
+        <el-form-item label="商品ID" prop="productId">
+          <el-input v-model="form.productId" placeholder="请输入商品ID" />
+        </el-form-item>
+        <el-form-item label="奖品等级" prop="prizeLevel">
+          <el-input v-model="form.prizeLevel" placeholder="请输入奖品等级" />
+        </el-form-item>
+        <el-form-item label="单次中奖商品数量" prop="perLotteryNum">
+          <el-input v-model="form.perLotteryNum" placeholder="请输入单次中奖商品数量" />
+        </el-form-item>
+        <el-form-item label="可中奖份量" prop="totalLots">
+          <el-input v-model="form.totalLots" placeholder="请输入可中奖份量" />
+        </el-form-item>
+        <el-form-item label="实际发放奖励份量" prop="totalSend">
+          <el-input v-model="form.totalSend" placeholder="请输入实际发放奖励份量" />
+        </el-form-item>
+        <el-form-item label="参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与" prop="require">
+          <el-input v-model="form.require" placeholder="请输入参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与" />
+        </el-form-item>
+        <el-form-item label="参与抽奖方式 2/3对应的配置,2:送礼数量,以最低档位礼物为单位 3:指定商品Id及数量,|竖线分割" prop="requireConf">
+          <el-input v-model="form.requireConf" placeholder="请输入参与抽奖方式 2/3对应的配置,2:送礼数量,以最低档位礼物为单位 3:指定商品Id及数量,|竖线分割" />
+        </el-form-item>
+        <el-form-item label="持续时间 单位:分" prop="duration">
+          <el-input v-model="form.duration" placeholder="请输入持续时间 单位:分" />
+        </el-form-item>
+        <el-form-item label="描述/标题" prop="desc">
+          <el-input v-model="form.desc" placeholder="请输入描述/标题" />
+        </el-form-item>
+      </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 { listLiveLotteryConf, getLiveLotteryConf, delLiveLotteryConf, addLiveLotteryConf, updateLiveLotteryConf, exportLiveLotteryConf } from "@/api/live/liveLotteryConf";
+
+export default {
+  name: "LiveLotteryConf",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 直播抽奖配置表格数据
+      liveLotteryConfList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null,
+        productId: null,
+        prizeLevel: null,
+        require: null,
+        createTime: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        liveId: [
+          { required: true, message: "直播间ID不能为空", trigger: "blur" }
+        ],
+        productId: [
+          { required: true, message: "商品ID不能为空", trigger: "blur" }
+        ],
+        prizeLevel: [
+          { required: true, message: "奖品等级不能为空", trigger: "blur" }
+        ],
+        perLotteryNum: [
+          { required: true, message: "单次中奖商品数量不能为空", trigger: "blur" }
+        ],
+        totalLots: [
+          { required: true, message: "可中奖份量不能为空", trigger: "blur" }
+        ],
+        totalSend: [
+          { required: true, message: "实际发放奖励份量不能为空", trigger: "blur" }
+        ],
+        require: [
+          { required: true, message: "参与抽奖方式 0:在线观众参与 1:关注参与 2:送礼参与 3:下单参与不能为空", trigger: "blur" }
+        ],
+        duration: [
+          { required: true, message: "持续时间 单位:分不能为空", trigger: "blur" }
+        ],
+        desc: [
+          { required: true, message: "描述/标题不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询直播抽奖配置列表 */
+    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();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        lotteryId: null,
+        liveId: null,
+        productId: null,
+        prizeLevel: null,
+        perLotteryNum: null,
+        totalLots: null,
+        totalSend: null,
+        require: null,
+        requireConf: null,
+        duration: null,
+        desc: null,
+        createTime: null,
+        udpateTime: null,
+        createBy: null,
+        updateBy: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    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
+      getLiveLotteryConf(lotteryId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改直播抽奖配置";
+      });
+    },
+    /** 提交按钮 */
+    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();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const lotteryIds = row.lotteryId || this.ids;
+      this.$confirm('是否确认删除直播抽奖配置编号为"' + lotteryIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveLotteryConf(lotteryIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).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>

+ 265 - 0
src/views/live/liveLotteryRecord/index.vue

@@ -0,0 +1,265 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <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:liveLotteryRecord: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:liveLotteryRecord: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:liveLotteryRecord: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:liveLotteryRecord:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveLotteryRecordList" @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="直播间ID" align="center" prop="liveId" />
+      <el-table-column label="抽奖状态 0:未开始 1:进行中 2:已结束" align="center" prop="lotteryStauts" />
+      <el-table-column label="创建日期" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建日期" align="center" prop="createBy" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createBy, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveLotteryRecord:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveLotteryRecord: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>
+      <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 { listLiveLotteryRecord, getLiveLotteryRecord, delLiveLotteryRecord, addLiveLotteryRecord, updateLiveLotteryRecord, exportLiveLotteryRecord } from "@/api/live/liveLotteryRecord";
+
+export default {
+  name: "LiveLotteryRecord",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 直播抽奖记录表格数据
+      liveLotteryRecordList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询直播抽奖记录列表 */
+    getList() {
+      this.loading = true;
+      listLiveLotteryRecord(this.queryParams).then(response => {
+        this.liveLotteryRecordList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        lotteryId: null,
+        liveId: null,
+        lotteryStauts: null,
+        createTime: null,
+        udpateTime: null,
+        createBy: null,
+        updateBy: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    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
+      getLiveLotteryRecord(lotteryId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改直播抽奖记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.lotteryId != null) {
+            updateLiveLotteryRecord(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveLotteryRecord(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const lotteryIds = row.lotteryId || this.ids;
+      this.$confirm('是否确认删除直播抽奖记录编号为"' + lotteryIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveLotteryRecord(lotteryIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有直播抽奖记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveLotteryRecord(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

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

@@ -0,0 +1,367 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="直播间ID" prop="liveId">
+        <el-input
+          v-model="queryParams.liveId"
+          placeholder="请输入直播间ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="用户ID" prop="userId">
+        <el-input
+          v-model="queryParams.userId"
+          placeholder="请输入用户ID"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="是否中奖 0否1是" prop="isWin">
+        <el-input
+          v-model="queryParams.isWin"
+          placeholder="请输入是否中奖 0否1是"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="奖品等级" prop="rizeLevel">
+        <el-input
+          v-model="queryParams.rizeLevel"
+          placeholder="请输入奖品等级"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="创建日期" prop="createTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.createTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择创建日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="修改日期" prop="udpateTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.udpateTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择修改日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="创建日期" prop="createBy">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.createBy"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择创建日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="修改日期" prop="updateBy">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.updateBy"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择修改日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </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:liveLotteryRegistration: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:liveLotteryRegistration: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:liveLotteryRegistration: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:liveLotteryRegistration:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveLotteryRegistrationList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="登记ID" align="center" prop="registrationId" />
+      <el-table-column label="直播间ID" align="center" prop="liveId" />
+      <el-table-column label="用户ID" align="center" prop="userId" />
+      <el-table-column label="是否中奖 0否1是" align="center" prop="isWin" />
+      <el-table-column label="奖品等级" align="center" prop="rizeLevel" />
+      <el-table-column label="创建日期" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="修改日期" align="center" prop="udpateTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.udpateTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建日期" align="center" prop="createBy" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createBy, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="修改日期" align="center" prop="updateBy" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updateBy, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveLotteryRegistration:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveLotteryRegistration: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 v-model="form.liveId" placeholder="请输入直播间ID" />
+        </el-form-item>
+        <el-form-item label="用户ID" prop="userId">
+          <el-input v-model="form.userId" placeholder="请输入用户ID" />
+        </el-form-item>
+        <el-form-item label="是否中奖 0否1是" prop="isWin">
+          <el-input v-model="form.isWin" placeholder="请输入是否中奖 0否1是" />
+        </el-form-item>
+        <el-form-item label="奖品等级" prop="rizeLevel">
+          <el-input v-model="form.rizeLevel" placeholder="请输入奖品等级" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listLiveLotteryRegistration, getLiveLotteryRegistration, delLiveLotteryRegistration, addLiveLotteryRegistration, updateLiveLotteryRegistration, exportLiveLotteryRegistration } from "@/api/live/liveLotteryRegistration";
+
+export default {
+  name: "LiveLotteryRegistration",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 直播抽奖登记表格数据
+      liveLotteryRegistrationList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        liveId: null,
+        userId: null,
+        isWin: null,
+        rizeLevel: null,
+        createTime: null,
+        udpateTime: null,
+        createBy: null,
+        updateBy: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询直播抽奖登记列表 */
+    getList() {
+      this.loading = true;
+      listLiveLotteryRegistration(this.queryParams).then(response => {
+        this.liveLotteryRegistrationList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        registrationId: null,
+        liveId: null,
+        userId: null,
+        isWin: null,
+        rizeLevel: null,
+        createTime: null,
+        udpateTime: null,
+        createBy: null,
+        updateBy: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.registrationId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加直播抽奖登记";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const registrationId = row.registrationId || this.ids
+      getLiveLotteryRegistration(registrationId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改直播抽奖登记";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.registrationId != null) {
+            updateLiveLotteryRegistration(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveLotteryRegistration(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const registrationIds = row.registrationId || this.ids;
+      this.$confirm('是否确认删除直播抽奖登记编号为"' + registrationIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveLotteryRegistration(registrationIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有直播抽奖登记数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveLotteryRegistration(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 2 - 5
src/views/live/liveOrder/index.vue

@@ -342,6 +342,7 @@
       <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
@@ -364,9 +365,6 @@
     />
 
     <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>
@@ -391,8 +389,7 @@
 </template>
 
 <script>
-import { listLiveOrder, getLiveOrder, delLiveOrder, addLiveOrder, updateLiveOrder, exportLiveOrder } from "@/api/live/liveOrder";
-import { listBySearch } from '@/api/his/user';
+import { listLiveOrder,exportLiveOrder } from "@/api/live/liveOrder";
 import { getExpress} from '@/api/live/liveOrder'
 import { parseTime } from '../../../utils/common'
 

+ 386 - 0
src/views/live/liveRedConf/index.vue

@@ -0,0 +1,386 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="红包状态 0:未发放 1:已发放 2:已结束" prop="redStauts">
+        <el-input
+          v-model="queryParams.redStauts"
+          placeholder="请输入红包状态 0:未发放 1:已发放 2:已结束"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="有效时间 单位:分" prop="duration">
+        <el-input
+          v-model="queryParams.duration"
+          placeholder="请输入有效时间 单位:分"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="红包类型 1:主播发起 2:事件红包" prop="redType">
+        <el-select v-model="queryParams.redType" placeholder="请选择红包类型 1:主播发起 2:事件红包" clearable size="small">
+          <el-option label="请选择字典生成" value="" />
+        </el-select>
+      </el-form-item>
+      <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="红包数量" prop="redNum">
+        <el-input
+          v-model="queryParams.redNum"
+          placeholder="请输入红包数量"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="可中奖份量" prop="totalLots">
+        <el-input
+          v-model="queryParams.totalLots"
+          placeholder="请输入可中奖份量"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="实际发放奖励份量" prop="totalSend">
+        <el-input
+          v-model="queryParams.totalSend"
+          placeholder="请输入实际发放奖励份量"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="描述" prop="desc">
+        <el-input
+          v-model="queryParams.desc"
+          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="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['live:liveRedConf: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:liveRedConf: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:liveRedConf: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:liveRedConf:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveRedConfList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="红包ID" align="center" prop="redId" />
+      <el-table-column label="红包状态 0:未发放 1:已发放 2:已结束" align="center" prop="redStauts" />
+      <el-table-column label="有效时间 单位:分" align="center" prop="duration" />
+      <el-table-column label="红包类型 1:主播发起 2:事件红包" align="center" prop="redType" />
+      <el-table-column label="直播间ID" align="center" prop="liveId" />
+      <el-table-column label="红包数量" align="center" prop="redNum" />
+      <el-table-column label="可中奖份量" align="center" prop="totalLots" />
+      <el-table-column label="实际发放奖励份量" align="center" prop="totalSend" />
+      <el-table-column label="描述" align="center" prop="desc" />
+      <el-table-column label="创建日期" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="修改日期" align="center" prop="updateBy" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updateBy, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveRedConf:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveRedConf: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="有效时间 单位:分" prop="duration">
+          <el-input v-model="form.duration" placeholder="请输入有效时间 单位:分" />
+        </el-form-item>
+        <el-form-item label="红包数量" prop="redNum">
+          <el-input v-model="form.redNum" placeholder="请输入红包数量" />
+        </el-form-item>
+        <el-form-item label="可中奖份量" prop="totalLots">
+          <el-input v-model="form.totalLots" 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>
+  </div>
+</template>
+
+<script>
+import { listLiveRedConf, getLiveRedConf, delLiveRedConf, addLiveRedConf, updateLiveRedConf, exportLiveRedConf } from "@/api/live/liveRedConf";
+
+export default {
+  name: "LiveRedConf",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 直播红包记录配置表格数据
+      liveRedConfList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        redStauts: null,
+        duration: null,
+        redType: null,
+        liveId: null,
+        redNum: null,
+        totalLots: null,
+        totalSend: null,
+        desc: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        duration: [
+          { required: true, message: "有效时间 单位:分不能为空", trigger: "blur" }
+        ],
+        redType: [
+          { required: true, message: "红包类型 1:主播发起 2:事件红包不能为空", trigger: "change" }
+        ],
+        liveId: [
+          { required: true, message: "直播间ID不能为空", trigger: "blur" }
+        ],
+        redNum: [
+          { required: true, message: "红包数量不能为空", trigger: "blur" }
+        ],
+        totalLots: [
+          { required: true, message: "可中奖份量不能为空", trigger: "blur" }
+        ],
+        totalSend: [
+          { required: true, message: "实际发放奖励份量不能为空", trigger: "blur" }
+        ],
+        desc: [
+          { required: true, message: "描述不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询直播红包记录配置列表 */
+    getList() {
+      this.loading = true;
+      listLiveRedConf(this.queryParams).then(response => {
+        this.liveRedConfList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        redId: null,
+        redStauts: null,
+        duration: null,
+        redType: null,
+        liveId: null,
+        redNum: null,
+        totalLots: null,
+        totalSend: null,
+        desc: null,
+        createTime: null,
+        udpateTime: null,
+        createBy: null,
+        updateBy: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.redId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加直播红包记录配置";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const redId = row.redId || this.ids
+      getLiveRedConf(redId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改直播红包记录配置";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.redId != null) {
+            updateLiveRedConf(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveRedConf(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const redIds = row.redId || this.ids;
+      this.$confirm('是否确认删除直播红包记录配置编号为"' + redIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveRedConf(redIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有直播红包记录配置数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveRedConf(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 279 - 0
src/views/live/liveUserLotteryRecord/index.vue

@@ -0,0 +1,279 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <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:liveUserLotteryRecord: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:liveUserLotteryRecord: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:liveUserLotteryRecord: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:liveUserLotteryRecord:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveUserLotteryRecordList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="修改日期" align="center" prop="id" />
+      <el-table-column label="抽奖ID" align="center" prop="lotteryId" />
+      <el-table-column label="直播间ID" align="center" prop="liveId" />
+      <el-table-column label="中奖用户ID" align="center" prop="userId" />
+      <el-table-column label="商品ID" align="center" prop="productId" />
+      <el-table-column label="创建日期" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="修改日期" align="center" prop="udpateTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.udpateTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建日期" align="center" prop="createBy" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createBy, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="修改日期" align="center" prop="updateBy" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updateBy, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveUserLotteryRecord:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveUserLotteryRecord: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>
+      <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 { listLiveUserLotteryRecord, getLiveUserLotteryRecord, delLiveUserLotteryRecord, addLiveUserLotteryRecord, updateLiveUserLotteryRecord, exportLiveUserLotteryRecord } from "@/api/live/liveUserLotteryRecord";
+
+export default {
+  name: "LiveUserLotteryRecord",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 直播用户中奖记录表格数据
+      liveUserLotteryRecordList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询直播用户中奖记录列表 */
+    getList() {
+      this.loading = true;
+      listLiveUserLotteryRecord(this.queryParams).then(response => {
+        this.liveUserLotteryRecordList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        lotteryId: null,
+        liveId: null,
+        userId: null,
+        productId: null,
+        createTime: null,
+        udpateTime: null,
+        createBy: null,
+        updateBy: null
+      };
+      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
+      getLiveUserLotteryRecord(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改直播用户中奖记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateLiveUserLotteryRecord(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveUserLotteryRecord(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除直播用户中奖记录编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveUserLotteryRecord(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有直播用户中奖记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveUserLotteryRecord(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 279 - 0
src/views/live/liveUserRedRecord/index.vue

@@ -0,0 +1,279 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <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:liveUserRedRecord: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:liveUserRedRecord: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:liveUserRedRecord: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:liveUserRedRecord:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="liveUserRedRecordList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="修改日期" align="center" prop="id" />
+      <el-table-column label="抽奖ID" align="center" prop="redId" />
+      <el-table-column label="直播间ID" align="center" prop="liveId" />
+      <el-table-column label="中奖用户ID" align="center" prop="userId" />
+      <el-table-column label="芳华币数量" align="center" prop="integral" />
+      <el-table-column label="创建日期" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="修改日期" align="center" prop="udpateTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.udpateTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建日期" align="center" prop="createBy" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createBy, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="修改日期" align="center" prop="updateBy" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updateBy, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['live:liveUserRedRecord:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['live:liveUserRedRecord: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>
+      <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 { listLiveUserRedRecord, getLiveUserRedRecord, delLiveUserRedRecord, addLiveUserRedRecord, updateLiveUserRedRecord, exportLiveUserRedRecord } from "@/api/live/liveUserRedRecord";
+
+export default {
+  name: "LiveUserRedRecord",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 直播用户红包记录表格数据
+      liveUserRedRecordList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询直播用户红包记录列表 */
+    getList() {
+      this.loading = true;
+      listLiveUserRedRecord(this.queryParams).then(response => {
+        this.liveUserRedRecordList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        redId: null,
+        liveId: null,
+        userId: null,
+        integral: null,
+        createTime: null,
+        udpateTime: null,
+        createBy: null,
+        updateBy: null
+      };
+      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
+      getLiveUserRedRecord(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改直播用户红包记录";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateLiveUserRedRecord(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addLiveUserRedRecord(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除直播用户红包记录编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLiveUserRedRecord(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有直播用户红包记录数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportLiveUserRedRecord(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>