This commit is contained in:
@jyuhsin
2025-04-24 16:06:36 +08:00
parent e4ef2da1ae
commit fd3dda9bb2
25 changed files with 377 additions and 95 deletions
+4 -3
View File
@@ -223,10 +223,11 @@ layout("/mobile/platform.html"){
<template slot="loading">
<van-loading size="13" type="spinner"/>
</template>
<template slot="error">
<van-image src="/assets/mobile/img/commonActivity.png" class="middle_item_img"></van-image>
</template>
</van-image>
<van-image height="84" src="xxxxxx" v-else width="120">
<template slot="error">图片查询失败</template>
</van-image>
<van-image src="/assets/mobile/img/commonActivity.png" class="middle_item_img" v-else></van-image>
</div>
<div class="middle_item_text">
@@ -110,9 +110,20 @@ layout("/mobile/platform.html"){
if (path) {
pjaxReplace(path + "?id=" + item.id)
}
},
init() {
const queryId = GetQueryString('id')
const category = GetQueryString('category')
if(category) {
this.pageForm.category = category
}
if(queryId) {
this.pageForm.queryId = queryId
}
}
},
created() {
this.init()
this.onLoad()
}
})
@@ -11,8 +11,8 @@ layout("/mobile/platform.html"){
text-align: center;
padding: 20px;
background: #ffffff;
/*margin: 10px 0;*/
margin-bottom: 10px;
margin: 0 0 10px 0 !important;
/*margin-bottom: 10px;*/
color: var(--color-primary);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
@@ -80,7 +80,7 @@ layout("/mobile/platform.html"){
<h2 class="title">{{ activity.title }}</h2>
</van-sticky>
<div v-if="!answerRecord.isFinish">
<div style="margin-top: 50px" v-if="!answerRecord.isFinish">
<div v-for="(subject, index) in subjects" :key="index" class="subject">
<p>{{index+1}}、{{ subject.title }}</p>
<div class="tag">
@@ -125,6 +125,7 @@ layout("/mobile/platform.html"){
return {
list: [],
id: GetQueryString("id"),
H5JumpTo: GetQueryString("H5JumpTo"),
subjects: [],
activity: {},
// remainingTime: 0,
@@ -161,8 +162,30 @@ layout("/mobile/platform.html"){
this.activity = res.data.activity
this.subjects = res.data.subjects
this.answerRecordId = res.data.answerRecordId
this.checkGroupPermission()
this.getAnswerRecord()
// this.checkGroupPermission()
if (!this.H5JumpTo && this.activity.repeatable && res.data.repeatTips){
// 如果是可重复答题,第二次答题进来弹出提示
vant.Dialog.confirm({
title: '温馨提示',
message: '您已完成本次答题,是否要重新答题?',
confirmButtonText: '重新答题',
cancelButtonText: '查看答题记录',
}).then(() => {
this.getAnswerRecord()
}).catch(() => {
pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId)
// pjaxReplace("/mobile/index")
});
} else {
this.getAnswerRecord()
}
} else {
vant.Dialog.alert({
title: '温馨提示',
message: res.msg,
}).then(() => {
pjaxReplace("/mobile/index")
})
}
})
},
@@ -174,7 +197,7 @@ layout("/mobile/platform.html"){
this.answerRecord = res.data
if (this.answerRecord.isFinish || this.$moment().unix() > this.$moment(this.activity.endTime)) {
this.$pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId)
pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId)
}
this.initAnswer()
@@ -307,8 +330,7 @@ layout("/mobile/platform.html"){
//自动提交
autoSubmit(loading = null) {
$
.post("/platform/h5/qsv/quiz/submitAnswer", {
$.post("/platform/h5/qsv/quiz/submitAnswer", {
answer: JSON.stringify({
activityId: this.id,
answerRecordId: this.answerRecordId,
@@ -324,35 +346,35 @@ layout("/mobile/platform.html"){
.then((res) => {
if (res.code === 0) {
this.$toast.success(res.msg)
this.$pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId)
pjaxReplace("/platform/h5/qsv/quiz/result?answerRecordId=" + this.answerRecordId)
// this.getAnswerRecord()
}
})
.finally(() => {
.always(() => {
if (loading) {
loading.clear()
}
})
},
async checkGroupPermission() {
const groupId = this.activity.groupId
if (groupId) {
const { code, data } = await $.post("/open/common/checkGroupPermission", { groupId })
if (code === 0) {
if (!data) {
this.$dialog
.alert({
title: "提示",
message: "您没有权限参与"
})
.then(() => {
location.back()
})
}
}
}
}
// async checkGroupPermission() {
// const groupId = this.activity.groupId
// if (groupId) {
// const { code, data } = await $.post("/open/common/checkGroupPermission", { groupId })
// if (code === 0) {
// if (!data) {
// this.$dialog
// .alert({
// title: "提示",
// message: "您没有权限参与"
// })
// .then(() => {
// location.back()
// })
// }
// }
// }
// }
},
created() {
if (this.timerInterval) {
@@ -10,6 +10,7 @@ layout("/mobile/platform.html"){
.container .title {
text-align: center;
padding: 20px;
margin: 0 !important;
background: #ffffff;
color: var(--color-primary);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
@@ -168,7 +169,7 @@ layout("/mobile/platform.html"){
</div>
</van-sticky>
<div>
<div style="margin-top: 50px">
<div v-for="(subject, index) in subjects" :key="index" class="subject">
<p>{{index+1}}、{{ subject.title }}</p>
<div class="tag">
@@ -208,11 +209,14 @@ layout("/mobile/platform.html"){
</div>
<div class="button-control">
<van-button v-if="canAgainQuestion" type="primary" @click="againQuestion" block>重新答题</van-button>
<!-- 女性知识答题 -->
<van-button v-if="activity.id === 'c3372eb3ee774e86b373fcacf8eb89c7'" type="primary" @click="goWelfareChoose" block>纪念品选择</van-button>
<van-button type="primary" @click="openHistory" block>查看全部答题记录</van-button>
</div>
</div>
<van-action-sheet v-model="historyShow" title="历史记录">
<van-action-sheet v-model="historyShow" title="历史记录" >
<div class="history-list">
<div v-for="item in historyList" class="history-item">
<div class="history-header">
@@ -239,7 +243,9 @@ layout("/mobile/platform.html"){
activity: {},
list: [],
historyShow: false,
historyList: []
historyList: [],
canAgainQuestion: false
}
},
computed: {
@@ -268,12 +274,44 @@ layout("/mobile/platform.html"){
}
},
methods: {
/**
* 福利选择
*/
goWelfareChoose(){
// 女性答题的福利
pjaxReplace('/mobile/welfare/list/receive?projectId=8799d66b0bb640078f50feb029e506ed')
},
/**
* 重新答题
*/
againQuestion() {
vant.Dialog.confirm({
title: '温馨提示',
message: '确定要重新答题吗?',
}).then(() => {
pjaxReplace('/platform/h5/qsv/quiz?id=' + this.activity.id + "&H5JumpTo=true")
}).catch(() => {
// on cancel
});
},
getAnswerResult() {
$.post("/platform/h5/qsv/quiz/answerResult", { answerRecordId: this.answerRecordId }).then((res) => {
if (res.code === 0) {
this.subjects = res.data.subjects
this.activity = res.data.activity
this.getAnswerRecord()
if (this.activity.id === 'c3372eb3ee774e86b373fcacf8eb89c7') {
vant.Dialog.alert({
title: '温馨提示',
message: "感谢您参与女性健康知识竞赛。请选取活动纪念品",
}).then(() => {
this.getAnswerRecord()
this.getHistoryQuestion()
})
} else {
this.getAnswerRecord()
this.getHistoryQuestion()
}
}
})
},
@@ -305,16 +343,19 @@ layout("/mobile/platform.html"){
}
})
},
historyBack() {
pjaxReplace('/platform/h5/qsv')
},
openHistory() {
this.historyShow = true
},
getHistoryQuestion() {
$.post("/platform/h5/qsv/quiz/historyScore", { activityId: this.activity.id }).then((res) => {
if (res.code === 0) {
this.historyList = res.data
if (this.activity.maxAttempts > res.data.length) {
this.canAgainQuestion = true
}
}
})
}
@@ -90,6 +90,16 @@ layout("/mobile/platform.html"){
max-width: 100%!important;
}
.desc {
background: #ffffff;
margin: 0 0 10px 0;
padding: 10px;
line-height: 22px;
}
.desc p{
margin: 0;
}
</style>
@@ -97,6 +107,7 @@ layout("/mobile/platform.html"){
<van-nav-bar title="问卷调查" left-arrow @click-left="pjaxReplace('/mobile/index')" placeholder fixed></van-nav-bar>
<div class="container" :style="{'padding-bottom': answerRecord.isFinish ? 0 : '84px'}">
<h2 class="title">{{ activity.title }}</h2>
<div class="desc" v-html="activity.description"></div>
<div v-if="!isFinished">
<div v-for="(subject, index) in subjects" :key="index" class="subject">
<p>{{index+1}}、{{ subject.title }}</p>
@@ -97,7 +97,7 @@ layout("/layouts/platform.html"){
code="PREPARED_BY"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">费用类型:</div>
<div class="search-item-option">
@@ -108,7 +108,7 @@ layout("/layouts/platform.html"){
code="USER_PERSONAL_STATUS"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">变更类型:</div>
<div class="search-item-option">
@@ -178,9 +178,9 @@ layout("/layouts/platform.html"){
<el-select v-model="pageForm.isMember" @change="doSearch()"
:clearable="false" size="small"
style="width: 130px;margin-right: 5px">
<el-option label="全部" value=""></el-option>
<el-option label="全部教工" value=""></el-option>
<el-option label="是会员" value="1"></el-option>
<el-option label="不是会员" value="0"></el-option>
<el-option label="会员" value="0"></el-option>
</el-select>
<el-radio-group v-model="pageForm.changed" @change="doSearch" class="mr5"
@@ -2,7 +2,7 @@ const basicForm = {
template: /*language=HTML*/ `
<el-dialog :visible.sync="dialogVisible" title="基础设置">
<div style="overflow-y: auto">
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="150px">
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="120px">
<el-form-item label="类型" prop="category">
<el-radio-group v-model="formData.category" size="small">
<el-radio v-for="item in dict.type.ACTIVITY_QSV_CATEGORY" :label="item.value"
@@ -44,8 +44,7 @@ const subjectForm = {
</div>
<div v-if="subject.type === 'checkbox'">
最大选择数:
<el-input v-model="subject.maxMulti" placeholder="最多可选数量"></el-input>
最大选择数:<el-input v-model="subject.maxMulti" placeholder="最多可选数量" style="width: 200px"></el-input>
</div>
@@ -127,7 +127,7 @@ layout("/layouts/platform.html"){
})
},
exportXlsx() {
// this.$downLoad("/platform/qsv/quizRank/exportXlsx", this.pageForm)
this.$downLoad("/platform/qsv/quizRank/exportXlsx", this.pageForm)
}
},
async created() {
@@ -1,13 +1,13 @@
const answer = {
/*language=HTML*/
template: `
<el-dialog title="查看答卷" :visible.sync="dialogVisible" width="50%">
<el-dialog title="查看答卷" :visible.sync="dialogVisible" width="70%" top="2%">
<el-row type="flex" justify="end" class="mb10">
<el-button type="primary" size="small" icon="el-icon-download" @click="exportUserAnswerXlsx">导出xlsx</el-button>
</el-row>
<el-table :data="tableData">
<el-table-column label="序号" type="index" width="70"></el-table-column>
<el-table-column v-for="item in tableColumns" :key="item.prop" :label="item.label" :prop="item.prop"></el-table-column>
<el-table-column v-for="item in tableColumns" :key="item.prop" :label="item.label" :prop="item.prop" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" fixed="right" width="100px">
<template slot-scope="scope">
<el-button type="danger" size="mini" icon="el-icon-delete" @click="onDelete(scope.row.id)"></el-button>
@@ -56,7 +56,7 @@ const answer = {
},
exportUserAnswerXlsx() {
// this.$downLoad("/platform/qsv/survey/exportUserAnswerXlsx", { activityId: this.activityId })
this.$downLoad("/platform/qsv/survey/exportUserAnswerXlsx", { activityId: this.activityId })
}
}
}
@@ -22,11 +22,11 @@ layout("/layouts/platform.html"){
</el-card>
<el-card shadow="never" class="mt10">
<table-tool :app="this" label="数据列表">
<!-- <el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>-->
<!-- <el-button @click="exportXlsx" icon="el-icon-download" size="small" type="primary" class="mr5">导出xlsx</el-button>-->
</table-tool>
<el-table :data="tableData" ref="tableRef" @sort-change="pageOrder">
<el-table-column label="序号" width="50" type="index" :index="indexMethod"></el-table-column>
<el-table-column label="标题" prop="title" width="120" sortable></el-table-column>
<el-table-column label="标题" prop="title" width="320" sortable></el-table-column>
<el-table-column label="类型" prop="category" sortable>
<template scope="{row}">
<dict-tag :options="dict.type.ACTIVITY_QSV_CATEGORY" :value="row.category"></dict-tag>
@@ -60,7 +60,7 @@ layout("/layouts/platform.html"){
},
methods: {
exportXlsx() {
$.post("/platform/qsv/survey/exportXlsx", this.pageForm)
this.$downLoad("/platform/qsv/survey/exportXlsx", this.pageForm)
}
},
created() {
@@ -1,8 +1,41 @@
const report = {
/*language=HTML*/
template: `
<el-dialog title="分析报告" :visible.sync="dialogVisible" width="50%">
<div v-for="(subject,subjectIndex) in subjects" class="subject">
<el-dialog title="分析报告" :visible.sync="dialogVisible" width="70%" top="2%">
<el-collapse v-model="activeName" accordion>
<el-collapse-item :name="subjectIndex + 1" v-for="(subject,subjectIndex) in subjects">
<template slot="title">
<div class="title">
第{{subjectIndex+1}}题: {{subject.title}}
<span class="type" v-if="subject.type==='text'">[填空题]</span>
<span class="type" v-else-if="subject.type==='radio'">[单选题]</span>
<span class="type" v-else-if="subject.type==='text'">[多选题]</span>
</div>
</template>
<div v-if="subject.type==='text'">
{{subject.texts.join('、')}}
</div>
<div v-else-if="subject.type==='radio' || subject.type==='checkbox'">
<el-table :data="subject.options" size="small">
<el-table-column label="选项" prop="text"></el-table-column>
<el-table-column label="小计" prop="selectCount" width="100"></el-table-column>
<el-table-column label="比例" width="500">
<template slot-scope="scope">
<el-progress
:percentage="Math.round(scope.row.selectCount / subject.selectTotal * 100)"></el-progress>
</template>
</el-table-column>
<el-table-column label="详情" width="100px">
<template slot-scope="{row}">
<el-button type="text" @click="openDetail(subject.id,row.id)">详情</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-collapse-item>
</el-collapse>
<!--<div v-for="(subject,subjectIndex) in subjects" class="subject">
<div>
<div class="title">
第{{subjectIndex+1}}题: {{subject.title}}
@@ -32,11 +65,10 @@ const report = {
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>-->
<el-dialog title="选择详情" :visible.sync="optionVisible" width="50%" append-to-body>
<el-dialog title="选择详情" :visible.sync="optionVisible" width="50%" append-to-body top="2%">
<el-table :data="optionUsers" size="small">
<el-table-column label="姓名" prop="userName"></el-table-column>
<el-table-column label="工号" prop="loginName"></el-table-column>
@@ -56,7 +88,8 @@ const report = {
report: null,
subjects: [],
optionVisible: false,
optionUsers: []
optionUsers: [],
activeName: 1
}
},
methods: {
@@ -91,10 +124,21 @@ const report = {
}
.subject .title{
margin-bottom: 5px;
font-weight: bold;
}
.subject .type{
color: #a6a6a6;
margin-left: 10px;
}
.el-collapse {
border-top: 0;
border-bottom: 0;
}
.el-collapse .title{
font-weight: bold;
}
.el-collapse-item__header,.el-collapse-item__wrap {
border-bottom: 0;
}
`
}
@@ -53,10 +53,8 @@ const activity = {
enterActivity(item) {
if (item.url) {
sublime.jumpPagePjax(item.url)
} else if (item.url) {
this.$refs.openQRCode.openCode(item.url, "该活动只支持手机端报名,请使用手机扫描二维码报名!")
} else {
this.$message.warning("该活动支持")
this.$refs.openQRCode.openCode(item.url, "该活动支持手机端报名,请使用手机扫描二维码报名!")
}
}
},