Merge remote-tracking branch 'origin/build' into build
This commit is contained in:
@@ -7,9 +7,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Detail from './components/Detail'
|
||||
import List from './components/List'
|
||||
import Add from './components/Add'
|
||||
import List from './components/List'
|
||||
import Detail from './components/Detail'
|
||||
import Comment from './components/Comment'
|
||||
|
||||
export default {
|
||||
name: 'AppCurriculumManage',
|
||||
@@ -22,7 +23,7 @@
|
||||
|
||||
data () {
|
||||
return {
|
||||
component: 'List',
|
||||
component: 'Comment',
|
||||
params: {},
|
||||
include: []
|
||||
}
|
||||
@@ -31,7 +32,8 @@
|
||||
components: {
|
||||
Add,
|
||||
List,
|
||||
Detail
|
||||
Detail,
|
||||
Comment
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -41,6 +43,11 @@
|
||||
this.params = data.params
|
||||
}
|
||||
|
||||
if (data.type === 'Comment') {
|
||||
this.component = 'Comment'
|
||||
this.params = data.params
|
||||
}
|
||||
|
||||
if (data.type === 'Detail') {
|
||||
this.component = 'Detail'
|
||||
this.params = data.params
|
||||
|
||||
@@ -1,123 +1,72 @@
|
||||
<template>
|
||||
<ai-detail class="content-add">
|
||||
<ai-detail class="content-add" v-loading="isLoading">
|
||||
<template slot="title">
|
||||
<ai-title :title="params.id ? '编辑活动' : '添加活动'" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||
</ai-title>
|
||||
<ai-title :title="params.id ? '编辑' + '课程' : '添加' + '课程'" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-card title="基本信息">
|
||||
<template #content>
|
||||
<el-form class="ai-form" :model="form" label-width="180px!important" ref="form">
|
||||
<el-form-item prop="title" style="width: 100%;" label="标题" :rules="[{required: true, message: '请输入活动标题', trigger: 'change'}]">
|
||||
<el-input size="small" placeholder="请输入活动标题" v-model="form.title"></el-input>
|
||||
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
|
||||
<el-form-item label="标题" style="width: 100%;" prop="title" :rules="[{required: true, message: '请输入标题', trigger: 'blur'}]">
|
||||
<el-input size="small" v-model="form.title" clearable placeholder="请输入..." :maxlength="50" :show-word-limit="true"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="beginTime" label="开始时间" :rules="[{required: true, message: '请选择开始时间', trigger: 'change'}]">
|
||||
<el-date-picker
|
||||
v-model="form.beginTime"
|
||||
type="datetime"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择开始时间">
|
||||
</el-date-picker>
|
||||
<el-form-item prop="contentType" label="课程类型" :rules="[{required: true, message: '请选择课程类型', trigger: 'change'}]">
|
||||
<el-select style="width: 100%;" v-model="form.contentType" size="small" placeholder="请选择课程类型">
|
||||
<el-option
|
||||
v-for="item in contentTypeList"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="endTime" label="结束时间" :rules="[{required: true, message: '请选择结束时间', trigger: 'change'}]">
|
||||
<el-date-picker
|
||||
v-model="form.endTime"
|
||||
type="datetime"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择结束时间">
|
||||
</el-date-picker>
|
||||
<el-form-item prop="showIndex" label="排序" :rules="[{required: true, message: '请选择文章类型', trigger: 'change'}]">
|
||||
<el-input-number size="small" v-model="form.showIndex" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item prop="round1ActiveLimit" label="第一轮抽奖限制日活天数">
|
||||
<el-input-number size="small" v-model="form.round1ActiveLimit" :min="0"></el-input-number>
|
||||
<el-form-item v-if="form.contentType === '0'" label="正文" prop="content" style="width: 100%;" :rules="[{required: true, message: '请输入内容', trigger: 'change'}]">
|
||||
<ai-editor v-model="form.content" :instance="instance"/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="round2ActiveLimit" label="第二轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]">
|
||||
<el-input-number size="small" v-model="form.round2ActiveLimit" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item prop="round3ActiveLimit" label="第三轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]">
|
||||
<el-input-number size="small" v-model="form.round3ActiveLimit" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item prop="round4ActiveLimit" label="第四轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]">
|
||||
<el-input-number size="small" v-model="form.round4ActiveLimit" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item prop="beginTime5" label="第五轮抽奖开始时间" :rules="[{required: true, message: '第五轮抽奖开始时间', trigger: 'change'}]">
|
||||
<el-date-picker
|
||||
v-model="form.beginTime5"
|
||||
type="datetime"
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="第五轮抽奖开始时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item prop="round5ActiveLimit" label="第五轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]">
|
||||
<el-input-number size="small" v-model="form.round5ActiveLimit" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%;" prop="wxQrcode" label="微信插件二维码" :rules="[{required: true, message: '请上传', trigger: 'change'}]">
|
||||
<el-form-item v-if="form.contentType === '0' && !isHideCoverimg" label="封面图片" prop="files" style="width: 100%;">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
v-model="form.wxQrcode"
|
||||
:limit="1">
|
||||
v-model="form.files"
|
||||
key="file"
|
||||
:limit="9">
|
||||
<template slot="tips">
|
||||
<p>最多上传9张图片,单个文件最大10MB,支持jpg、jpeg、png格式</p>
|
||||
</template>
|
||||
</ai-uploader>
|
||||
</el-form-item>
|
||||
<div>
|
||||
<el-form-item :label="'奖品' + (index + 1)" style="width: 100%;" v-for="(item, index) in form.prizes" :key="'prizes' + (index + 1)">
|
||||
<div>
|
||||
<div class="form-flex">
|
||||
<div class="prize-item">
|
||||
<span>奖品名称:</span>
|
||||
<el-input size="small" style="width: 265px;" placeholder="请输入奖品名称" v-model="item.name"></el-input>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>中奖规则:</span>
|
||||
<el-input size="small" style="width: 265px;" placeholder="指定第x个抽奖的人中奖,多个逗号隔开" v-model="item.rule"></el-input>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>奖品总数:</span>
|
||||
<el-input-number size="small" v-model="item.total" :min="1"></el-input-number>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>奖品排序:</span>
|
||||
<el-input-number size="small" v-model="item.showIndex" :min="1"></el-input-number>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>开放轮次:</span>
|
||||
<el-radio-group v-model="item.belongRound">
|
||||
<el-radio :label="1">第一轮</el-radio>
|
||||
<el-radio :label="2">第二轮</el-radio>
|
||||
<el-radio :label="3">第三轮</el-radio>
|
||||
<el-radio :label="4">第四轮</el-radio>
|
||||
<el-radio :label="5">第五轮</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>是否默认:</span>
|
||||
<el-switch
|
||||
v-model="item.defaultPrize"
|
||||
active-value="1"
|
||||
inactive-value="0">
|
||||
</el-switch>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<span>奖品图片:</span>
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
v-model="item.picture"
|
||||
:limit="1">
|
||||
</ai-uploader>
|
||||
</div>
|
||||
<div class="prize-item">
|
||||
<el-button type="danger" @click="remove(index)">删除</el-button>
|
||||
</div>
|
||||
<el-form-item v-if="form.contentType === '1'" label="视频" prop="files" style="width: 100%;" :rules="[{required: true, message: '请上传视频', trigger: 'change'}]">
|
||||
<el-upload :show-file-list="false" ref="upload1" action :http-request="submitUpload" :accept="accept" :limit="1">
|
||||
<div class="video" v-if="!form.files.length">
|
||||
<div class="icon">
|
||||
<ai-icon type="svg" icon="iconVideo"/>
|
||||
<span>上传视频</span>
|
||||
</div>
|
||||
<span class="tips">支持mp4格式,单个文件最大100MB</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item style="width: 100%;">
|
||||
<el-button type="primary" @click="add">添加奖品</el-button>
|
||||
</el-upload>
|
||||
<video class="video-com" style="width:100%; height:100%; object-fit: fill;" muted
|
||||
:src="form.files[0].url" controls="controls" v-if="form.files.length"></video>
|
||||
<el-upload :show-file-list="false" ref="upload2" action :http-request="submitUpload" :accept="accept"
|
||||
:limit="1" v-if="form.files.length">
|
||||
<el-button style="margin-top: 10px;">重新选择</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="视频封面" prop="pictureUrl" style="width: 100%;" v-if="form.contentType === '1'" :rules="[{required: true, message: '请上传视频封面', trigger: 'change'}]">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
isShowTip
|
||||
v-model="form.pictureUrl"
|
||||
:limit="1"
|
||||
:cropOps="cropOps"
|
||||
is-crop>
|
||||
<template slot="tips">
|
||||
<p>最多上传1张图片,单个文件最大10MB,支持jpg、jpeg、png格式</p>
|
||||
<p>图片比例:1.6:1</p>
|
||||
</template>
|
||||
</ai-uploader>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
@@ -125,12 +74,13 @@
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="confirm">提交</el-button>
|
||||
<el-button type="primary" :loading="isLoading" @click="confirm">提交</el-button>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mp4box from 'mp4box'
|
||||
import { mapState } from 'vuex'
|
||||
export default {
|
||||
name: 'Add',
|
||||
@@ -138,29 +88,41 @@
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
params: Object
|
||||
params: Object,
|
||||
areaId: String
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
info: {},
|
||||
accept: '.mp4',
|
||||
form: {
|
||||
title: '',
|
||||
beginTime: '',
|
||||
beginTime1: '',
|
||||
beginTime2: '',
|
||||
beginTime3: '',
|
||||
beginTime4: '',
|
||||
beginTime5: '',
|
||||
endTime: '',
|
||||
round1ActiveLimit: '',
|
||||
round2ActiveLimit: '',
|
||||
round3ActiveLimit: '',
|
||||
round4ActiveLimit: '',
|
||||
round5ActiveLimit: '',
|
||||
wxQrcode: [],
|
||||
prizes: []
|
||||
content: '',
|
||||
showIndex: '',
|
||||
files: [],
|
||||
pictureUrl: [],
|
||||
contentType: '0',
|
||||
thumbUrl: []
|
||||
},
|
||||
id: ''
|
||||
isLoading: false,
|
||||
cropOps: {
|
||||
width: "336px",
|
||||
height: "210px"
|
||||
},
|
||||
id: '',
|
||||
contentTypeList: [
|
||||
{
|
||||
name: '图文',
|
||||
value: '0'
|
||||
},
|
||||
{
|
||||
name: '视频',
|
||||
value: '1'
|
||||
}
|
||||
],
|
||||
isHideCoverimg: false,
|
||||
cateList: [],
|
||||
needExamine: '0'
|
||||
}
|
||||
},
|
||||
|
||||
@@ -177,63 +139,90 @@
|
||||
|
||||
methods: {
|
||||
getInfo (id) {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/queryDetailById?id=${id}`).then(res => {
|
||||
this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.form = res.data
|
||||
|
||||
this.form.wxQrcode = [{
|
||||
url: res.data.wxQrcode
|
||||
}]
|
||||
if (res.data.prizes.length) {
|
||||
this.form.prizes = res.data.prizes.map(v => {
|
||||
return {
|
||||
...v,
|
||||
picture: [{
|
||||
url: v.picture
|
||||
}]
|
||||
}
|
||||
})
|
||||
}
|
||||
this.form.pictureUrl = res.data.pictureUrl ? [{
|
||||
url: res.data.pictureUrl
|
||||
}] : []
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
add () {
|
||||
this.form.prizes.push({
|
||||
name: '',
|
||||
picture: [],
|
||||
rule: '',
|
||||
showIndex: '',
|
||||
total: '',
|
||||
defaultPrize: '',
|
||||
belongRound: ''
|
||||
})
|
||||
onChange () {
|
||||
this.form.files = []
|
||||
},
|
||||
|
||||
remove (index) {
|
||||
this.form.prizes.splice(index, 1)
|
||||
submitUpload(file) {
|
||||
this.$refs['upload1']?.clearFiles();
|
||||
this.$refs['upload2']?.clearFiles();
|
||||
this.$refs['ruleForm']?.clearValidate('videoFile');
|
||||
const fileType = file.file.name.split(".")[1];
|
||||
const size = file.file.size / 1024 / 1024 > 100;
|
||||
let mp4boxfile = mp4box.createFile();
|
||||
const reader = new FileReader();
|
||||
reader.readAsArrayBuffer(file.file);
|
||||
reader.onload = (e) => {
|
||||
const arrayBuffer = e.target.result;
|
||||
arrayBuffer.fileStart = 0;
|
||||
mp4boxfile.appendBuffer(arrayBuffer);
|
||||
};
|
||||
mp4boxfile.onReady = (info) => {
|
||||
let codec = info.mime.match(/codecs="(\S*),/)[1]
|
||||
if (codec.indexOf('avc') === -1) {
|
||||
return this.$message.error("视频编码格式不支持")
|
||||
}
|
||||
|
||||
if (size) {
|
||||
return this.$message.error("视频大小不能超过100M");
|
||||
}
|
||||
|
||||
if (fileType && this.accept.indexOf(fileType.toLocaleLowerCase()) > -1) {
|
||||
let formData = new FormData()
|
||||
formData.append('file', file.file);
|
||||
this.isLoading = true
|
||||
this.instance.post(`/admin/file/add-unlimited`, formData).then(res => {
|
||||
if (res && res.data) {
|
||||
let videoList = res.data[0].split(";");
|
||||
|
||||
this.form.files = [{
|
||||
id: videoList[1],
|
||||
url: videoList[0]
|
||||
}]
|
||||
}
|
||||
|
||||
this.isLoading = false
|
||||
}).catch(() => {
|
||||
this.isLoading = false
|
||||
})
|
||||
} else {
|
||||
return this.$message.error("视频格式错误")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
confirm () {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/addOrUpdate`, {
|
||||
this.isLoading = true
|
||||
this.instance.post(`/app/appcontentinfo/addOrUpdate`, {
|
||||
...this.form,
|
||||
id: this.params.id || '',
|
||||
wxQrcode: this.form.wxQrcode[0].url,
|
||||
prizes: this.form.prizes.map(v => {
|
||||
return {
|
||||
...v,
|
||||
picture: v.picture[0].url
|
||||
}
|
||||
})
|
||||
pictureUrl: this.form.pictureUrl.length ? this.form.pictureUrl[0].url : ''
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('提交成功')
|
||||
if (this.needExamine === '1') {
|
||||
this.$message.success('提交成功,等待管理员审核')
|
||||
} else {
|
||||
this.$message.success('提交成功')
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.cancel(true)
|
||||
}, 600)
|
||||
} else {
|
||||
this.isLoading = false
|
||||
}
|
||||
}).catch(() => {
|
||||
this.isLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -250,24 +239,52 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.form-flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.content-add {
|
||||
.video {
|
||||
width: 640px;
|
||||
height: 360px;
|
||||
border-radius: 4px;
|
||||
border: 1px dashed #D0D4DC;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.prize-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 14px;
|
||||
width: 50%;
|
||||
.icon {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
span {
|
||||
color: #666;
|
||||
span:nth-child(2) {
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
color: #333333;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
display: inline-block;
|
||||
font-size: 40px;
|
||||
color: #2266FF;
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
color: #999999;
|
||||
line-height: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
.video-com {
|
||||
width: 640px;
|
||||
height: 360px;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
border-radius: 2px;
|
||||
border: 1px solid #D0D4DC;
|
||||
margin-top: -40px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
119
project/qujing/app/AppCurriculumManage/components/Comment.vue
Normal file
119
project/qujing/app/AppCurriculumManage/components/Comment.vue
Normal file
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<ai-list class="notice">
|
||||
<template slot="title">
|
||||
<ai-title title="评论管理" isShowBottomBorder isShowBack @onBackClick="cancel(false)"></ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
</template>
|
||||
<template #right>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
style="margin-top: 6px;"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<el-table-column slot="options" width="90px" fixed="right" label="操作" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" @click="toAdd(row.id)">显示</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Comment',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
search: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
title: '',
|
||||
status: ''
|
||||
},
|
||||
total: 10,
|
||||
colConfigs: [
|
||||
{ prop: 'title', label: '微信昵称', align: 'left' },
|
||||
{ prop: 'createUserName', label: '评论', align: 'center' },
|
||||
{ prop: 'beginTime', label: '状态', align: 'center' },
|
||||
{ prop: 'endTime', label: '已学习人数', align: 'center' },
|
||||
{ prop: 'createTime', label: '评论数', align: 'center' }
|
||||
],
|
||||
tableData: []
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/list`, null, {
|
||||
params: {
|
||||
...this.search
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
cancel (isRefresh) {
|
||||
this.$emit('change', {
|
||||
type: 'List',
|
||||
isRefresh: !!isRefresh
|
||||
})
|
||||
},
|
||||
|
||||
remove (id) {
|
||||
this.$confirm('确定删除该活动?').then(() => {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/delete?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('删除成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
toDetail (id) {
|
||||
this.$emit('change', {
|
||||
type: 'Detail',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toAdd(id) {
|
||||
this.$emit('change', {
|
||||
type: 'Add',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
@@ -1,154 +1,42 @@
|
||||
<template>
|
||||
<ai-detail isHasSidebar class="AppMarketingActivity-detail">
|
||||
<ai-detail>
|
||||
<template slot="title">
|
||||
<ai-title title="活动详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||
<ai-title title="课程详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
|
||||
</ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<AiSidebar :tabTitle="tabList" v-model="currIndex"></AiSidebar>
|
||||
<div v-show="currIndex === 0">
|
||||
<ai-card title="基本信息">
|
||||
<template #content>
|
||||
<ai-wrapper
|
||||
label-width="180px">
|
||||
<ai-info-item label="活动标题" isLine :value="info.title"></ai-info-item>
|
||||
<ai-info-item label="开始时间" :value="info.beginTime"></ai-info-item>
|
||||
<ai-info-item label="结束时间" :value="info.endTime"></ai-info-item>
|
||||
<ai-info-item label="第一轮抽奖限制日活天数" :value="info.round1ActiveLimit"></ai-info-item>
|
||||
<ai-info-item label="第二轮抽奖限制日活天数" :value="info.round2ActiveLimit"></ai-info-item>
|
||||
<ai-info-item label="第三轮抽奖限制日活天数" :value="info.round3ActiveLimit"></ai-info-item>
|
||||
<ai-info-item label="第四轮抽奖限制日活天数" :value="info.round4ActiveLimit"></ai-info-item>
|
||||
<ai-info-item label="第五轮抽奖开始时间" :value="info.beginTime5"></ai-info-item>
|
||||
<ai-info-item label="第五轮抽奖限制日活天数" :value="info.round5ActiveLimit"></ai-info-item>
|
||||
<ai-info-item label="微信插件二维码">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
disabled
|
||||
:value="[{
|
||||
url: info.wxQrcode
|
||||
}]"
|
||||
:limit="1">
|
||||
</ai-uploader>
|
||||
</ai-info-item>
|
||||
</ai-wrapper>
|
||||
</template>
|
||||
</ai-card>
|
||||
<ai-card title="奖品">
|
||||
<template #content>
|
||||
<ai-wrapper
|
||||
class="prize-item"
|
||||
v-for="(item, key) in info.prizes"
|
||||
:key="key"
|
||||
label-width="180px">
|
||||
<ai-info-item label="奖品名称" isLine :value="item.name"></ai-info-item>
|
||||
<ai-info-item label="中奖规则" :value="item.rule"></ai-info-item>
|
||||
<ai-info-item label="奖品总数" :value="item.total"></ai-info-item>
|
||||
<ai-info-item label="奖品排序" :value="item.showIndex"></ai-info-item>
|
||||
<ai-info-item label="开放轮次" :value="item.belongRound"></ai-info-item>
|
||||
<ai-info-item label="是否默认" :value="item.defaultPrize === '0' ? '否' : '是'"></ai-info-item>
|
||||
<ai-info-item label="奖品图片" isLine>
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
disabled
|
||||
:value="[{
|
||||
url: item.picture
|
||||
}]"
|
||||
:limit="1">
|
||||
</ai-uploader>
|
||||
</ai-info-item>
|
||||
</ai-wrapper>
|
||||
</template>
|
||||
</ai-card>
|
||||
</div>
|
||||
<div v-show="currIndex === 1">
|
||||
<ai-card title="报名记录">
|
||||
<template #content>
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
<ai-download
|
||||
:instance="instance"
|
||||
url="/app/appmarketingactivityinfo/exportSignUpList"
|
||||
:params="{
|
||||
...search,
|
||||
activityId: params.id
|
||||
}"
|
||||
fileName="报名记录"
|
||||
:disabled="!tableData.length">
|
||||
</ai-download>
|
||||
</template>
|
||||
<template #right>
|
||||
<el-input
|
||||
v-model="search.name"
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
@clear="search.current = 1, getList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
</el-input>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
style="margin-top: 6px;"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-card>
|
||||
</div>
|
||||
<div v-show="currIndex === 2">
|
||||
<ai-card title="抽奖记录">
|
||||
<template #content>
|
||||
<ai-search-bar class="search-bar">
|
||||
<template #left>
|
||||
<ai-select
|
||||
v-model="prizeSearch.prizeId"
|
||||
clearable
|
||||
placeholder="请选择奖品"
|
||||
:selectList="prizes"
|
||||
@change="prizeSearch.current = 1, getPrizeList()">
|
||||
</ai-select>
|
||||
<ai-download
|
||||
:instance="instance"
|
||||
url="/app/appmarketingactivityinfo/exportTaffleList"
|
||||
:params="{
|
||||
...prizeSearch,
|
||||
activityId: params.id
|
||||
}"
|
||||
fileName="抽奖记录"
|
||||
:disabled="!tableData.length">
|
||||
</ai-download>
|
||||
</template>
|
||||
<template #right>
|
||||
<el-input
|
||||
v-model="prizeSearch.name"
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {prizeSearch.current = 1, getPrizeList()}"
|
||||
placeholder="请输入奖品名称"
|
||||
clearable
|
||||
@clear="prizeSearch.current = 1, getPrizeList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
</el-input>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
:tableData="prizeList"
|
||||
:col-configs="prizeColConfigs"
|
||||
:total="prizeSearch.total"
|
||||
style="margin-top: 6px;"
|
||||
:current.sync="prizeSearch.current"
|
||||
:size.sync="prizeSearch.size"
|
||||
@getList="getPrizeList">
|
||||
</ai-table>
|
||||
</template>
|
||||
</ai-card>
|
||||
</div>
|
||||
<ai-card title="基本信息">
|
||||
<template #content>
|
||||
<ai-wrapper
|
||||
label-width="120px">
|
||||
<ai-info-item label="标题" isLine :value="info.title"></ai-info-item>
|
||||
<ai-info-item label="发布地区" isLine :value="info.areaName"></ai-info-item>
|
||||
<ai-info-item label="文章类型" isLine :value="info.contentType === '0' ? '图文' : '视频'"></ai-info-item>
|
||||
<ai-info-item label="正文" v-if="info.contentType === '0'" isLine>
|
||||
<AiArticle :value="info.content"></AiArticle>
|
||||
</ai-info-item>
|
||||
<ai-info-item v-if="info.contentType === '0'" isLine label="封面图片">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
disabled
|
||||
v-model="info.files"
|
||||
:limit="9">
|
||||
</ai-uploader>
|
||||
</ai-info-item>
|
||||
<ai-info-item v-if="info.contentType === '1'" isLine label="封面图片">
|
||||
<video style="width:100%; height:100%; object-fit: fill;" :src="info.files[0].url" controls></video>
|
||||
</ai-info-item>
|
||||
<ai-info-item v-if="info.contentType === '1'" isLine label="视频封面">
|
||||
<ai-uploader
|
||||
:instance="instance"
|
||||
disabled
|
||||
v-model="info.pictureUrl"
|
||||
:limit="1">
|
||||
</ai-uploader>
|
||||
</ai-info-item>
|
||||
</ai-wrapper>
|
||||
</template>
|
||||
</ai-card>
|
||||
</template>
|
||||
</ai-detail>
|
||||
</template>
|
||||
@@ -160,96 +48,40 @@
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
params: Object
|
||||
params: Object,
|
||||
moduleId: String
|
||||
},
|
||||
|
||||
data () {
|
||||
return {
|
||||
currIndex: 0,
|
||||
tabList: ['基本信息', '报名记录', '抽奖记录'],
|
||||
colConfigs: [
|
||||
{ prop: 'name', label: '姓名', align: 'left', width: '200px' },
|
||||
{ prop: 'phone', label: '手机号', align: 'center' },
|
||||
{ prop: 'createTime', label: '报名时间', align: 'center' }
|
||||
],
|
||||
prizeColConfigs: [
|
||||
{ prop: 'name', label: '姓名', align: 'left', width: '200px' },
|
||||
{ prop: 'phone', label: '手机号', align: 'center' },
|
||||
{ prop: 'prizeName', label: '奖品名称', align: 'center' },
|
||||
{ prop: 'createTime', label: '抽奖时间', align: 'center' }
|
||||
],
|
||||
prizeList: [],
|
||||
prizeSearch: {
|
||||
size: 10,
|
||||
current: 1,
|
||||
name: '',
|
||||
prizeId: ''
|
||||
},
|
||||
search: {
|
||||
size: 10,
|
||||
name: '',
|
||||
current: 1
|
||||
},
|
||||
prizes: [],
|
||||
tableData: [],
|
||||
total: 0,
|
||||
info: {}
|
||||
info: {},
|
||||
id: ''
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
this.getInfo()
|
||||
this.getList()
|
||||
this.getPrizeList()
|
||||
if (this.params && this.params.id) {
|
||||
this.id = this.params.id
|
||||
this.getInfo(this.params.id)
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/signUpList?activityId=${this.params.id}`, null, {
|
||||
params: {
|
||||
...this.search
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
getInfo (id) {
|
||||
this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.info = res.data
|
||||
this.info.pictureUrl = res.data.pictureUrl ? [{
|
||||
url: res.data.pictureUrl
|
||||
}] : []
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getPrizeList() {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/raffleList?activityId=${this.params.id}`, null, {
|
||||
params: {
|
||||
...this.prizeSearch
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.prizeList = res.data.records
|
||||
this.prizeSearch.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getInfo () {
|
||||
this.instance.post(`/app/appmarketingactivityinfo/queryDetailById?id=${this.params.id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data) {
|
||||
this.info = res.data
|
||||
this.prizes = res.data.prizes.map(v => {
|
||||
return {
|
||||
dictValue: v.id,
|
||||
dictName: v.name
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
cancel () {
|
||||
cancel (isRefresh) {
|
||||
this.$emit('change', {
|
||||
type: 'List',
|
||||
isRefresh: true
|
||||
isRefresh: !!isRefresh
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -257,14 +89,4 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.AppMarketingActivity-detail {
|
||||
.prize-item {
|
||||
padding: 20px 0 0;
|
||||
border-bottom: 1px solid #eee;
|
||||
|
||||
&:first-child {
|
||||
padding-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<template>
|
||||
<ai-list class="notice">
|
||||
<template slot="title">
|
||||
<ai-title title="课程管理" isShowBottomBorder>
|
||||
</ai-title>
|
||||
<ai-title title="在线课程" isShowBottomBorder></ai-title>
|
||||
</template>
|
||||
<template slot="content">
|
||||
<ai-search-bar class="search-bar">
|
||||
@@ -10,7 +9,7 @@
|
||||
<ai-select
|
||||
v-model="search.status"
|
||||
clearable
|
||||
placeholder="请选择活动状态"
|
||||
placeholder="请选择课程状态"
|
||||
:selectList="statusList"
|
||||
@change="search.current = 1, getList()">
|
||||
</ai-select>
|
||||
@@ -22,7 +21,7 @@
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
placeholder="请输入活动标题"
|
||||
placeholder="请输入标题"
|
||||
clearable
|
||||
@clear="search.current = 1, getList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
@@ -70,11 +69,11 @@
|
||||
},
|
||||
total: 10,
|
||||
colConfigs: [
|
||||
{ prop: 'title', label: '活动标题', align: 'left' },
|
||||
{ prop: 'createUserName', label: '创建人', align: 'center' },
|
||||
{ prop: 'beginTime', label: '开始时间', align: 'center' },
|
||||
{ prop: 'endTime', label: '结束时间', align: 'center' },
|
||||
{ prop: 'createTime', label: '创建时间', align: 'center' }
|
||||
{ prop: 'title', label: '课程名称', align: 'left' },
|
||||
{ prop: 'createUserName', label: '课程类型', align: 'center' },
|
||||
{ prop: 'beginTime', label: '状态', align: 'center' },
|
||||
{ prop: 'endTime', label: '已学习人数', align: 'center' },
|
||||
{ prop: 'createTime', label: '评论数', align: 'center' }
|
||||
],
|
||||
tableData: [],
|
||||
statusList: [
|
||||
|
||||
Reference in New Issue
Block a user