This commit is contained in:
yanran200730
2023-02-07 15:46:45 +08:00
parent 6ddadfe53c
commit 35ad7b031d
5 changed files with 378 additions and 414 deletions

View File

@@ -7,9 +7,10 @@
</template> </template>
<script> <script>
import Detail from './components/Detail'
import List from './components/List'
import Add from './components/Add' import Add from './components/Add'
import List from './components/List'
import Detail from './components/Detail'
import Comment from './components/Comment'
export default { export default {
name: 'AppCurriculumManage', name: 'AppCurriculumManage',
@@ -22,7 +23,7 @@
data () { data () {
return { return {
component: 'List', component: 'Comment',
params: {}, params: {},
include: [] include: []
} }
@@ -31,7 +32,8 @@
components: { components: {
Add, Add,
List, List,
Detail Detail,
Comment
}, },
methods: { methods: {
@@ -41,6 +43,11 @@
this.params = data.params this.params = data.params
} }
if (data.type === 'Comment') {
this.component = 'Comment'
this.params = data.params
}
if (data.type === 'Detail') { if (data.type === 'Detail') {
this.component = 'Detail' this.component = 'Detail'
this.params = data.params this.params = data.params

View File

@@ -1,123 +1,72 @@
<template> <template>
<ai-detail class="content-add"> <ai-detail class="content-add" v-loading="isLoading">
<template slot="title"> <template slot="title">
<ai-title :title="params.id ? '编辑活动' : '添加活动'" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> <ai-title :title="params.id ? '编辑' + '课程' : '添加' + '课程'" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
</ai-title>
</template> </template>
<template slot="content"> <template slot="content">
<ai-card title="基本信息"> <ai-card title="基本信息">
<template #content> <template #content>
<el-form class="ai-form" :model="form" label-width="180px!important" ref="form"> <el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form-item prop="title" style="width: 100%;" label="标题" :rules="[{required: true, message: '请输入活动标题', trigger: 'change'}]"> <el-form-item label="标题" style="width: 100%;" prop="title" :rules="[{required: true, message: '请输入标题', trigger: 'blur'}]">
<el-input size="small" placeholder="请输入活动标题" v-model="form.title"></el-input> <el-input size="small" v-model="form.title" clearable placeholder="请输入..." :maxlength="50" :show-word-limit="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="beginTime" label="开始时间" :rules="[{required: true, message: '请选择开始时间', trigger: 'change'}]"> <el-form-item prop="contentType" label="课程类型" :rules="[{required: true, message: '请选择课程类型', trigger: 'change'}]">
<el-date-picker <el-select style="width: 100%;" v-model="form.contentType" size="small" placeholder="请选择课程类型">
v-model="form.beginTime" <el-option
type="datetime" v-for="item in contentTypeList"
style="width: 100%" :key="item.value"
size="small" :label="item.name"
value-format="yyyy-MM-dd HH:mm:ss" :value="item.value">
placeholder="请选择开始时间"> </el-option>
</el-date-picker> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="endTime" label="结束时间" :rules="[{required: true, message: '请选择结束时间', trigger: 'change'}]"> <el-form-item prop="showIndex" label="排序" :rules="[{required: true, message: '请选择文章类型', trigger: 'change'}]">
<el-date-picker <el-input-number size="small" v-model="form.showIndex" :min="0"></el-input-number>
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> </el-form-item>
<el-form-item prop="round1ActiveLimit" label="第一轮抽奖限制日活天数"> <el-form-item v-if="form.contentType === '0'" label="正文" prop="content" style="width: 100%;" :rules="[{required: true, message: '请输入内容', trigger: 'change'}]">
<el-input-number size="small" v-model="form.round1ActiveLimit" :min="0"></el-input-number> <ai-editor v-model="form.content" :instance="instance"/>
</el-form-item> </el-form-item>
<el-form-item prop="round2ActiveLimit" label="第二轮抽奖限制日活天数" :rules="[{required: true, message: '请输入', trigger: 'change'}]"> <el-form-item v-if="form.contentType === '0' && !isHideCoverimg" label="封面图片" prop="files" style="width: 100%;">
<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'}]">
<ai-uploader <ai-uploader
:instance="instance" :instance="instance"
v-model="form.wxQrcode" v-model="form.files"
:limit="1"> key="file"
:limit="9">
<template slot="tips">
<p>最多上传9张图片,单个文件最大10MB支持jpgjpegpng格式</p>
</template>
</ai-uploader> </ai-uploader>
</el-form-item> </el-form-item>
<div> <el-form-item v-if="form.contentType === '1'" label="视频" prop="files" style="width: 100%;" :rules="[{required: true, message: '请上传视频', trigger: 'change'}]">
<el-form-item :label="'奖品' + (index + 1)" style="width: 100%;" v-for="(item, index) in form.prizes" :key="'prizes' + (index + 1)"> <el-upload :show-file-list="false" ref="upload1" action :http-request="submitUpload" :accept="accept" :limit="1">
<div> <div class="video" v-if="!form.files.length">
<div class="form-flex"> <div class="icon">
<div class="prize-item"> <ai-icon type="svg" icon="iconVideo"/>
<span>奖品名称</span> <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>
</div> </div>
<span class="tips">支持mp4格式单个文件最大100MB</span>
</div> </div>
</el-form-item> </el-upload>
</div> <video class="video-com" style="width:100%; height:100%; object-fit: fill;" muted
<el-form-item style="width: 100%;"> :src="form.files[0].url" controls="controls" v-if="form.files.length"></video>
<el-button type="primary" @click="add">添加奖品</el-button> <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支持jpgjpegpng格式</p>
<p>图片比例1.61</p>
</template>
</ai-uploader>
</el-form-item> </el-form-item>
</el-form> </el-form>
</template> </template>
@@ -125,12 +74,13 @@
</template> </template>
<template #footer> <template #footer>
<el-button @click="cancel">取消</el-button> <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> </template>
</ai-detail> </ai-detail>
</template> </template>
<script> <script>
import mp4box from 'mp4box'
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
name: 'Add', name: 'Add',
@@ -138,29 +88,41 @@
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
params: Object params: Object,
areaId: String
}, },
data () { data () {
return { return {
info: {}, info: {},
accept: '.mp4',
form: { form: {
title: '', title: '',
beginTime: '', content: '',
beginTime1: '', showIndex: '',
beginTime2: '', files: [],
beginTime3: '', pictureUrl: [],
beginTime4: '', contentType: '0',
beginTime5: '', thumbUrl: []
endTime: '',
round1ActiveLimit: '',
round2ActiveLimit: '',
round3ActiveLimit: '',
round4ActiveLimit: '',
round5ActiveLimit: '',
wxQrcode: [],
prizes: []
}, },
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: { methods: {
getInfo (id) { 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) { if (res.code === 0) {
this.form = res.data this.form = res.data
this.form.pictureUrl = res.data.pictureUrl ? [{
this.form.wxQrcode = [{ url: res.data.pictureUrl
url: res.data.wxQrcode }] : []
}]
if (res.data.prizes.length) {
this.form.prizes = res.data.prizes.map(v => {
return {
...v,
picture: [{
url: v.picture
}]
}
})
}
} }
}) })
}, },
add () { onChange () {
this.form.prizes.push({ this.form.files = []
name: '',
picture: [],
rule: '',
showIndex: '',
total: '',
defaultPrize: '',
belongRound: ''
})
}, },
remove (index) { submitUpload(file) {
this.form.prizes.splice(index, 1) 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 () { confirm () {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.instance.post(`/app/appmarketingactivityinfo/addOrUpdate`, { this.isLoading = true
this.instance.post(`/app/appcontentinfo/addOrUpdate`, {
...this.form, ...this.form,
id: this.params.id || '', pictureUrl: this.form.pictureUrl.length ? this.form.pictureUrl[0].url : ''
wxQrcode: this.form.wxQrcode[0].url,
prizes: this.form.prizes.map(v => {
return {
...v,
picture: v.picture[0].url
}
})
}).then(res => { }).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.$message.success('提交成功') if (this.needExamine === '1') {
this.$message.success('提交成功,等待管理员审核')
} else {
this.$message.success('提交成功')
}
setTimeout(() => { setTimeout(() => {
this.cancel(true) this.cancel(true)
}, 600) }, 600)
} else {
this.isLoading = false
} }
}).catch(() => {
this.isLoading = false
}) })
} }
}) })
@@ -250,24 +239,52 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.form-flex { .content-add {
display: flex; .video {
justify-content: space-between; width: 640px;
flex-wrap: wrap; height: 360px;
} border-radius: 4px;
border: 1px dashed #D0D4DC;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.prize-item { .icon {
display: flex; display: flex;
align-items: center; flex-direction: column;
margin-bottom: 14px; align-items: center;
width: 50%; justify-content: center;
span { span:nth-child(2) {
color: #666; 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 { .video-com {
margin-bottom: 0; width: 640px;
height: 360px;
background: rgba(0, 0, 0, 0.5);
border-radius: 2px;
border: 1px solid #D0D4DC;
margin-top: -40px;
} }
} }
</style> </style>

View 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>

View File

@@ -1,154 +1,42 @@
<template> <template>
<ai-detail isHasSidebar class="AppMarketingActivity-detail"> <ai-detail>
<template slot="title"> <template slot="title">
<ai-title title="活动详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"> <ai-title title="课程详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title> </ai-title>
</template> </template>
<template slot="content"> <template slot="content">
<AiSidebar :tabTitle="tabList" v-model="currIndex"></AiSidebar> <ai-card title="基本信息">
<div v-show="currIndex === 0"> <template #content>
<ai-card title="基本信息"> <ai-wrapper
<template #content> label-width="120px">
<ai-wrapper <ai-info-item label="标题" isLine :value="info.title"></ai-info-item>
label-width="180px"> <ai-info-item label="发布地区" isLine :value="info.areaName"></ai-info-item>
<ai-info-item label="活动标题" isLine :value="info.title"></ai-info-item> <ai-info-item label="文章类型" isLine :value="info.contentType === '0' ? '图文' : '视频'"></ai-info-item>
<ai-info-item label="开始时间" :value="info.beginTime"></ai-info-item> <ai-info-item label="正文" v-if="info.contentType === '0'" isLine>
<ai-info-item label="结束时间" :value="info.endTime"></ai-info-item> <AiArticle :value="info.content"></AiArticle>
<ai-info-item label="第一轮抽奖限制日活天数" :value="info.round1ActiveLimit"></ai-info-item> </ai-info-item>
<ai-info-item label="第二轮抽奖限制日活天数" :value="info.round2ActiveLimit"></ai-info-item> <ai-info-item v-if="info.contentType === '0'" isLine label="封面图片">
<ai-info-item label="第三轮抽奖限制日活天数" :value="info.round3ActiveLimit"></ai-info-item> <ai-uploader
<ai-info-item label="第四轮抽奖限制日活天数" :value="info.round4ActiveLimit"></ai-info-item> :instance="instance"
<ai-info-item label="第五轮抽奖开始时间" :value="info.beginTime5"></ai-info-item> disabled
<ai-info-item label="第五轮抽奖限制日活天数" :value="info.round5ActiveLimit"></ai-info-item> v-model="info.files"
<ai-info-item label="微信插件二维码"> :limit="9">
<ai-uploader </ai-uploader>
:instance="instance" </ai-info-item>
disabled <ai-info-item v-if="info.contentType === '1'" isLine label="封面图片">
:value="[{ <video style="width:100%; height:100%; object-fit: fill;" :src="info.files[0].url" controls></video>
url: info.wxQrcode </ai-info-item>
}]" <ai-info-item v-if="info.contentType === '1'" isLine label="视频封面">
:limit="1"> <ai-uploader
</ai-uploader> :instance="instance"
</ai-info-item> disabled
</ai-wrapper> v-model="info.pictureUrl"
</template> :limit="1">
</ai-card> </ai-uploader>
<ai-card title="奖品"> </ai-info-item>
<template #content> </ai-wrapper>
<ai-wrapper </template>
class="prize-item" </ai-card>
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>
</template> </template>
</ai-detail> </ai-detail>
</template> </template>
@@ -160,96 +48,40 @@
props: { props: {
instance: Function, instance: Function,
dict: Object, dict: Object,
params: Object params: Object,
moduleId: String
}, },
data () { data () {
return { return {
currIndex: 0, info: {},
tabList: ['基本信息', '报名记录', '抽奖记录'], id: ''
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: {}
} }
}, },
created () { created () {
this.getInfo() if (this.params && this.params.id) {
this.getList() this.id = this.params.id
this.getPrizeList() this.getInfo(this.params.id)
}
}, },
methods: { methods: {
getList() { getInfo (id) {
this.instance.post(`/app/appmarketingactivityinfo/signUpList?activityId=${this.params.id}`, null, { this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
params: { if (res.code === 0) {
...this.search this.info = res.data
} this.info.pictureUrl = res.data.pictureUrl ? [{
}).then(res => { url: res.data.pictureUrl
if (res.code == 0) { }] : []
this.tableData = res.data.records
this.total = res.data.total
} }
}) })
}, },
getPrizeList() { cancel (isRefresh) {
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 () {
this.$emit('change', { this.$emit('change', {
type: 'List', type: 'List',
isRefresh: true isRefresh: !!isRefresh
}) })
} }
} }
@@ -257,14 +89,4 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.AppMarketingActivity-detail {
.prize-item {
padding: 20px 0 0;
border-bottom: 1px solid #eee;
&:first-child {
padding-top: 0;
}
}
}
</style> </style>

View File

@@ -1,8 +1,7 @@
<template> <template>
<ai-list class="notice"> <ai-list class="notice">
<template slot="title"> <template slot="title">
<ai-title title="课程管理" isShowBottomBorder> <ai-title title="在线课程" isShowBottomBorder></ai-title>
</ai-title>
</template> </template>
<template slot="content"> <template slot="content">
<ai-search-bar class="search-bar"> <ai-search-bar class="search-bar">
@@ -10,7 +9,7 @@
<ai-select <ai-select
v-model="search.status" v-model="search.status"
clearable clearable
placeholder="请选择活动状态" placeholder="请选择课程状态"
:selectList="statusList" :selectList="statusList"
@change="search.current = 1, getList()"> @change="search.current = 1, getList()">
</ai-select> </ai-select>
@@ -22,7 +21,7 @@
class="search-input" class="search-input"
size="small" size="small"
v-throttle="() => {search.current = 1, getList()}" v-throttle="() => {search.current = 1, getList()}"
placeholder="请输入活动标题" placeholder="请输入标题"
clearable clearable
@clear="search.current = 1, getList()" @clear="search.current = 1, getList()"
suffix-icon="iconfont iconSearch"> suffix-icon="iconfont iconSearch">
@@ -70,11 +69,11 @@
}, },
total: 10, total: 10,
colConfigs: [ colConfigs: [
{ prop: 'title', label: '活动标题', align: 'left' }, { prop: 'title', label: '课程名称', align: 'left' },
{ prop: 'createUserName', label: '创建人', align: 'center' }, { prop: 'createUserName', label: '课程类型', align: 'center' },
{ prop: 'beginTime', label: '开始时间', align: 'center' }, { prop: 'beginTime', label: '状态', align: 'center' },
{ prop: 'endTime', label: '结束时间', align: 'center' }, { prop: 'endTime', label: '已学习人数', align: 'center' },
{ prop: 'createTime', label: '创建时间', align: 'center' } { prop: 'createTime', label: '评论数', align: 'center' }
], ],
tableData: [], tableData: [],
statusList: [ statusList: [