This commit is contained in:
2024-09-02 14:08:37 +08:00
parent c409249f61
commit 4f3a1910bc
82 changed files with 9497 additions and 2733 deletions
+52 -28
View File
@@ -75,19 +75,19 @@ layout("/mobile/platform.html"){
<div class="user_info">
<van-row style="height: 200px">
<van-image
width="100%"
height="200px"
src="/back2.png"
width="100%"
></van-image>
</van-row>
<van-row class="user_avatar" style="height: 80px">
<van-col span="6" class="text-center">
<van-col class="text-center" span="6">
<van-image
:src="avatar"
height="70"
round
width="70"
height="70"
:src="avatar"
></van-image>
</van-col>
<van-col span="18">
@@ -99,7 +99,8 @@ layout("/mobile/platform.html"){
${@shiro.getPrincipalProperty('loginname')}
</span>
</div>
<div class="van-ellipsis" style="height: 40px;line-height: 40px;font-size: 14px;color: #969799">
<div class="van-ellipsis"
style="height: 40px;line-height: 40px;font-size: 14px;color: #969799">
<!--#if(@shiro.getPrincipalProperty('union')!=null){#-->
${@shiro.getPrincipalProperty('union').getUnionname()}
<!--#}#-->
@@ -109,23 +110,24 @@ layout("/mobile/platform.html"){
</div>
<div v-if="paramType === '会员管理'">
<div v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('public')||@shiro.hasRole('H01')}"
class="van-sidebar-item van-sidebar-item--select">
<div class="van-sidebar-item van-sidebar-item--select"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('public')||@shiro.hasRole('H01')}">
会员管理
</div>
<van-grid :column-num="3" :border="false">
<van-grid-item v-if="${@shiro.hasRole('H01')}" url="/mobile/member/detail">
<van-grid :border="false" :column-num="3">
<van-grid-item url="/mobile/member/detail" v-if="${@shiro.hasRole('H01')}">
<image src="/assets/mobile/icon/member/da.png"></image>
<span class="icon_text"> 会员档案</span>
</van-grid-item>
<van-grid-item v-if="${@shiro.lacksRole('H01')}" url="/mobile/member/apply">
<van-grid-item url="/mobile/member/apply" v-if="${@shiro.lacksRole('H01')}">
<image src="/assets/mobile/icon/member/apply.png"></image>
<span class="icon_text"> 申请入会</span>
</van-grid-item>
<van-grid-item v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('A06')}"
url="/mobile/member/audit">
<van-grid-item
url="/mobile/member/audit"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('A06')}">
<image src="/assets/mobile/icon/member/audit.png"></image>
<span class="icon_text"> 会员审核</span>
</van-grid-item>
@@ -145,32 +147,33 @@ layout("/mobile/platform.html"){
民主管理
</div>
<van-grid
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')||@shiro.hasRole('jdhdbt01')||@shiro.hasRole('jdhdb01') || @shiro.hasRole('jdh12')}"
:border="false" :column-num="3">
<van-grid-item v-if="${@shiro.hasRole('jdhdb01')}"
url="/platform/mobile/proposal/compose">
:border="false"
:column-num="3"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')||@shiro.hasRole('jdhdbt01')||@shiro.hasRole('jdhdb01') || @shiro.hasRole('jdh12')}">
<van-grid-item url="/platform/mobile/proposal/compose"
v-if="${@shiro.hasRole('jdhdb01')}">
<image src="/assets/mobile/icon/proposal/myProposal.png"></image>
<span class="icon_text">个人提案阅览</span>
</van-grid-item>
<van-grid-item v-if="${@shiro.hasRole('jdhdb01')}"
url="/platform/mobile/proposal/seconded">
<van-grid-item url="/platform/mobile/proposal/seconded"
v-if="${@shiro.hasRole('jdhdb01')}">
<image src="/assets/mobile/icon/proposal/fy.png"></image>
<span class="icon_text">附议提案</span>
</van-grid-item>
<van-grid-item
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')||@shiro.hasRole('jdhdbt01')}"
url="/platform/mobile/proposal/delegation">
<image style="width: 59px" src="/assets/mobile/icon/proposal/tz.png"></image>
url="/platform/mobile/proposal/delegation"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')||@shiro.hasRole('jdhdbt01')}">
<image src="/assets/mobile/icon/proposal/tz.png" style="width: 59px"></image>
<span class="icon_text">团长审议</span>
</van-grid-item>
<van-grid-item v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')}"
url="/platform/mobile/proposal/integrated">
<van-grid-item url="/platform/mobile/proposal/integrated"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')}">
<image src="/assets/mobile/icon/proposal/search.png"></image>
<span class="icon_text">提案查询</span>
</van-grid-item>
<van-grid-item v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')}"
url="/mobile/proposal/delegate/index">
<van-grid-item url="/mobile/proposal/delegate/index"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('tamange')}">
<image src="/assets/mobile/icon/proposal/cx.png"></image>
<span class="icon_text">代表查询</span>
</van-grid-item>
@@ -284,6 +287,26 @@ layout("/mobile/platform.html"){
</van-grid-item>
</van-grid>
</van-row>
<van-row v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H01')}">
<div class="van-sidebar-item van-sidebar-item--select">
会议管理
</div>
<van-grid :border="false" :column-num="3">
<van-grid-item url="/mobile/meeting/mine/myMeeting"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('jdhdb01')||@shiro.hasRole('H01')}">
<image src="/assets/mobile/icon/meeting/会议(我的会议).png"></image>
<span class="icon_text">我的会议</span>
</van-grid-item>
<van-grid-item url="/mobile/meeting/audit"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('jdhdbt01')}">
<image src="/assets/mobile/icon/meeting/会议(会议审核).png"></image>
<span class="icon_text">会议审核</span>
</van-grid-item>
</van-grid>
</van-row>
</div>
<div v-if="paramType === '福利慰问'">
@@ -291,7 +314,8 @@ layout("/mobile/platform.html"){
职工慰问
</div>
<van-grid :border="false" :column-num="3">
<template v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('H01')}">
<template
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('H01')}">
<van-grid-item url="/mobile/condolence/apply/for">
<image src="/assets/mobile/icon/condolence/apply.png"></image>
<span class="icon_text">慰问申请</span>
@@ -303,8 +327,8 @@ layout("/mobile/platform.html"){
</van-grid-item>
</template>
<van-grid-item
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('A06')||@shiro.hasRole('xghkj')}"
url="/mobile/condolence/audit">
url="/mobile/condolence/audit"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H04')||@shiro.hasRole('A06')||@shiro.hasRole('xghkj')}">
<image src="/assets/mobile/icon/condolence/audit.png"></image>
<span class="icon_text">慰问审核</span>
</van-grid-item>
@@ -0,0 +1,504 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.van-index-bar__sidebar {
display: none;
}
.van-doc-card {
margin: 14px;
padding: 12px 12px 12px 12px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 20px;
font-size: 13px;
position: relative;
}
.van-divider {
margin: 6px 0 6px 0px;
border-color: lightgray;
}
.van-button--small {
border-radius: revert;
width: 40%;
height: 30px;
}
.van-col {
line-height: 20px;
}
.title_span {
font-size: 16px;
font-weight: bold;
position: absolute;
left: -1px;
top: 11px;
color: #1867b0;
}
.title {
font-size: 13px;
font-weight: bold;
flex: 1;
overflow: hidden;
white-space: nowrap;
}
.cus_overflow {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.showMore {
color: #1867b0;
}
.cus_popup {
width: 70%;
height: 50%;
/*border-radius: 10px;*/
padding: 10px 14px;
font-size: 15px;
/*background-color: #E5E7E9;
background-image: url("https://www.transparenttextures.com/patterns/green-cup.png");*/
}
.cus_icon {
z-index: 10000;
color: white;
font-size: 35px;
position: fixed;
top: 81%;
left: 44%;
}
.userPopup {
height: 80%;
background-color: #f6f7f9;
font-size: 14px;
}
.van-row div {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.firstName {
width: 45px;
background-color: lightgrey;
border-radius: 45px;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
color: white;
}
.content {
height: 84%;
overflow: auto;
}
.van-dialog__header {
padding-top: 8px;
}
.van-dialog__confirm {
color: #1867b0;
}
.van-field__label {
width: 5em;
}
.cus_cell {
padding: 4px 0px;
font-size: 12px;
}
.van-checkbox-group {
max-height: 260px;
overflow-y: auto;
margin-top: 6px;
}
.unit {
display: inline-block;
max-width: 160px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
position: absolute;
}
.cus_button {
border-top-right-radius: 16px;
border-bottom-left-radius: 16px;
height: 26px;
}
.audit_icon {
font-size: 24px;
position: absolute;
font-weight: bolder;
right: 0;
}
.van-dropdown-menu__item {
flex: auto;
}
</style>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏-->
<van-nav-bar
@click-left="history.go(-1)"
fixed
left-arrow
placeholder
safe-area-inset-top
title="会议请假审核"
></van-nav-bar>
<!--筛选框-->
<div class="search-fixed">
<van-search
@search="doSearch"
maxlength="10"
placeholder="请输入会议名称、会议地点进行查询"
shape="round"
v-model="pageForm.searchKeyword"
>
</van-search>
<van-dropdown-menu>
<van-dropdown-item :options="meetingTimeList" @change="doSearch"
v-model="pageForm.meetingTime"></van-dropdown-item>
<van-dropdown-item :options="typeList" @change="doSearch"
v-model="pageForm.typeId"></van-dropdown-item>
</van-dropdown-menu>
</div>
<!--列表-->
<div style="margin-top: 116px">
<van-list
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''" :immediate-check="false"
@load="onLoad"
v-model="loading">
<div class="van-doc-card" v-for="o in tableData">
<div @click="openView(o.id, o.modulename)">
<div style="display: flex; justify-content: space-between">
<div style="width: 70%">
<div class="van-ellipsis title">
<span class="title_span">|</span>
<span>{{o.meetingname}}</span>
</div>
<div style="color: grey">{{o.location}}</div>
</div>
<div style="color: #1867b0;">
{{o.meetingtypename}}
</div>
</div>
<div style="margin-top: 10px">
<van-row>
<span style="color: grey">会议时间:</span>
{{o.starttime}}
<!--<van-col span="12"><span style="color: grey">结束时间:</span></van-col>-->
</van-row>
<van-row>
<!--<van-col span="12">{{o.endtime}}</van-col>-->
</van-row>
</div>
<div style="display: flex; justify-content: space-between; margin-top: 8px;">
<div class="cus_overflow" style="line-height: 20px; width: 83%">
<span style="color: grey">会议描述:</span>
{{o.meetingdescription}}
</div>
<span @click.stop="desc = o.meetingdescription; popupShow = true" class="showMore">查看更多</span>
</div>
<van-divider></van-divider>
<div style="display: flex; justify-content: flex-end; margin-top: 4px">
<div>
<van-button @click.stop="getAuditList(o)" class="cus_button"
color="#1867b0" size="small" style="margin-right: 8px; width: auto;"
type="primary">已审{{o.audit}}
</van-button>
<van-button @click.stop="openView(o.id, o.modulename)" class="cus_button"
color="#1867b0" size="small" style="margin-right: 8px; width: auto;"
type="primary">未审{{o.no_audit}}
</van-button>
</div>
</div>
</div>
</div>
</van-list>
<van-empty
class="custom-image"
description="暂无数据"
image="/none.svg"
v-if="mLoading==false&&tableData.length==0"
></van-empty>
</div>
<!--弹出框-->
<van-popup class="cus_popup" v-model:show="popupShow">
<pre style="margin: 0; white-space: break-spaces">{{desc}}</pre>
</van-popup>
<van-icon @click="popupShow = false" class="cus_icon" name="close" v-if="popupShow"></van-icon>
<!--审核人员-->
<van-action-sheet :title="queryType === 'notAudit' ? '请假人员列表' : '请假人员列表'" @close="popClose" class="userPopup"
v-model:show="userShow">
<div class="content">
<div class="van-doc-card" v-for="(item, i) in userList">
<div style="display: flex; justify-content: space-between">
<div style="width: 80%">
<!--<span>{{moment(item.startTime).format('YYYY-MM-DD HH:mm') + ' ~ ' + moment(item.endTime).format('YYYY-MM-DD HH:mm')}}</span>-->
<span>{{'会议时间:' + moment(item.startTime).format('YYYY-MM-DD HH:mm')}}</span>
</div>
<div v-if="queryType === 'notAudit'">
<span @click="checkAll(i)">全选</span>
<span @click="toggleAll(i)" style="margin-left: 4px">反选</span>
</div>
</div>
<div style="margin-top: 4px">
<van-row>
<van-col span="24">
会议名称:
<van-tag size="medium" type="primary">{{item.timePeriodName}}</van-tag>
</van-col>
</van-row>
</div>
<van-checkbox-group ref="checkboxGroup" v-if="item.users !== null" v-model="result">
<van-cell-group>
<van-cell
:key="obj.id"
@click="toggle(i, index)" class="cus_cell"
clickable
v-for="(obj, index) in item.users">
<span style="display: inline-block; width: 40px">{{obj.username}}</span>
<span style="display: inline-block; width: 20px">{{obj.sex}}</span>
<span style="display: inline-block; width: 60px">{{obj.loginname}}</span>
<span class="unit">{{obj.unitname}}</span>
<van-icon class="audit_icon" color="green" name="passed"
v-if="queryType === 'hasAudit' && obj.auditState === true"></van-icon>
<van-icon class="audit_icon" color="grey" name="close"
v-if="queryType === 'hasAudit' && obj.auditState === false"></van-icon>
<template #right-icon v-if="queryType === 'notAudit'">
<van-checkbox :name="obj.id" ref="checkboxes"></van-checkbox>
</template>
</van-cell>
</van-cell-group>
</van-checkbox-group>
<div style="margin-top: 4px; text-align: center" v-else>暂无请假人员</div>
</div>
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 56px; width: 95%"
v-if="queryType === 'notAudit'">
<van-button @click="audit('many', 'reject')" color="#ff976a" size="small" style="height: 38px">驳回
</van-button>
<van-button @click="audit('many', 'pass')" color="#1867b0" size="small" style="height: 38px">通过
</van-button>
</div>
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 10px; width: 95%"
v-if="queryType === 'notAudit'">
<van-button @click="audit('all', 'reject')" color="#ff976a" size="small" style="height: 38px">一键全部驳回
</van-button>
<van-button @click="audit('all', 'pass')" color="#1867b0" size="small" style="height: 38px">一键全部通过
</van-button>
</div>
</div>
</van-action-sheet>
<!--审核弹框-->
<van-dialog @confirm="auditDo" show-cancel-button title="温馨提示" v-model:show="auditShow">
<div style="padding-top: 8px; text-align: center; font-size: 14px; color: #646566">{{str}}</div>
<van-divider style="margin: 12px 0 1px 0px;"></van-divider>
<van-field
autosize
label="审核意见:"
maxlength="50"
placeholder="请输入审核意见"
rows="2"
show-word-limit
type="textarea"
v-model="reason"
></van-field>
</van-dialog>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
desc: '',
list: ['a', 'b'],
result: [],
reason: '',
auditShow: false,
popupShow: false,
userShow: false,
userList: [],
userClickList: [],
str: '',
type: '',
auditType: '',
queryType: '',
typeList: [],
meetingTimeList: [{text: '全部时间', value: null}, {text: '即将开始', value: 0}, {text: '已结束', value: 1}],
}
},
methods: {
async getAuditList(o) {
this.queryType = 'hasAudit'
const resp = await $.post('/mobile/meeting/audit/getLeaveUser', {
meetingId: o.id,
auditType: 'hasAudit',
})
if (resp.code === 0) {
this.userList = resp.data
this.userList.forEach(item => {
if (item.users && item.users.length > 1) {
item.users.sort((a, b) => {
return b.auditState - a.auditState
})
}
})
this.userShow = true
}
},
checkAll(i) {
this.$refs.checkboxGroup[i].children.forEach(item => item.toggle(true))
},
toggleAll(i) {
this.$refs.checkboxGroup[i].children.forEach(item => item.toggle())
},
toggle(i, index) {
if (i > 0) {
let length = 0
for (let m = 0; m < i; m++) {
length += this.userList[m].users.length
}
index = length + index
}
this.$refs.checkboxes[index].toggle();
},
async auditDo() {
let idList = this.result
if (this.type === 'all') {
this.userList.forEach(item => {
if (item.users !== null && item.users !== undefined) {
idList = idList.concat(item.users.map(o => o.id))
}
})
}
const resp = await $.post('/mobile/meeting/audit/audit', {
tpuIds: JSON.stringify(idList),
auditOpinion: this.reason,
isPass: this.auditType === 'pass'
})
if (resp.code === 0) {
this.doSearch()
}
vant.Toast(resp.msg)
this.userShow = false
},
audit(type, auditType) {
this.type = type
this.auditType = auditType
if (type === 'many' && this.result.length === 0) {
vant.Toast('请先选择人员')
return
}
this.str = type === 'many' ? '您选择了' + this.result.length + '个人,请确认您的选择' : '您确定要一键全部审核吗?'
this.reason = auditType === 'pass' ? '同意' : '拒绝'
this.auditShow = true
},
async openView(id, modulename) {
this.queryType = 'notAudit'
this.userList = []
const resp = await $.post('/mobile/meeting/audit/getLeaveUser', {
meetingId: id,
moduleName: modulename,
auditType: 'canAudit',
})
if (resp.code === 0) {
this.userList = resp.data
this.userClickList = []
if (this.userList.length === 0) {
vant.Toast('暂无请假人员')
} else {
this.userShow = true
}
return
}
vant.Toast('系统错误,请联系管理员')
},
popClose() {
this.$nextTick(function () {
if (this.$refs.checkboxes !== undefined) {
this.$refs.checkboxes.forEach(item => item.toggle(false));
}
})
},
doSearch() {
this.pageForm.pageNumber = 1
this.tableData = []
this.finished = false
this.onLoad()
},
async onLoad() {
this.loading = true
$.post('/mobile/meeting/audit/pageData', this.pageForm).then(res => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.loading = false
})
},
},
async created() {
this.typeList = await meetUtil.getAllMeetingType()
this.typeList.unshift({text: '全部会议类型'})
if (this.typeList && this.typeList.length > 0) {
this.$set(this.pageForm, "typeId", this.typeList[0].value)
}
this.$set(this.pageForm, "meetingTime", this.meetingTimeList[1].value)
this.onLoad()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,532 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.van-index-bar__sidebar {
display: none;
}
.van-doc-card {
margin: 14px;
padding: 12px 12px 12px 12px;
background-color: #fff;
border-radius: 10px;
box-shadow: 0 8px 12px #ebedf0;
line-height: 20px;
font-size: 13px;
position: relative;
}
.van-divider {
margin: 6px 0 6px 0px;
border-color: lightgray;
}
.van-button--small {
border-top-right-radius: 16px;
border-bottom-left-radius: 16px;
height: 26px;
}
.van-col {
line-height: 20px;
}
.title_span {
font-size: 16px;
font-weight: bold;
position: absolute;
left: -1px;
top: 11px;
color: #1867b0;
}
.title {
font-size: 13px;
font-weight: bold;
flex: 1;
overflow: hidden;
white-space: nowrap;
}
.cus_overflow {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.showMore {
color: #1867b0;
}
.cus_popup {
width: 70%;
height: 50%;
/*border-radius: 10px;*/
padding: 10px 14px;
font-size: 15px;
/*background-color: #E5E7E9;
background-image: url("https://www.transparenttextures.com/patterns/green-cup.png");*/
}
.cus_icon {
z-index: 10000;
color: white;
font-size: 35px;
position: fixed;
top: 81%;
left: 44%;
}
.van-dropdown-menu__item {
flex: auto;
}
.leave_pop {
height: 80%;
background-color: #f6f7f9;
}
.content {
height: 82%;
overflow: auto;
}
.van-field__label {
width: 4.6em;
}
.checkDiv {
font-size: 33px;
color: #1867b0;
position: absolute;
right: 4px;
top: 30px;
}
.auditState {
position: absolute;
right: -10px;
top: -3px;
border-radius: 4px;
padding: 1px 8px;
border: 1px #1867b0 solid;
background: #1867b0;
opacity: 0.6;
color: white;
transform: skewY(5deg);
}
.van-field--min-height .van-field__control {
min-height: auto;
font-size: 13px;
}
.border_div {
width: 33px;
height: 33px;
border: 1px lightgrey solid;
border-radius: 14px;
position: absolute;
right: 4px;
top: 28px;
}
</style>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<!--top栏-->
<van-nav-bar
@click-left="history.go(-1)"
fixed
left-arrow
placeholder
safe-area-inset-top
title="我的会议"
></van-nav-bar>
<!--筛选框-->
<div class="search-fixed">
<van-search
@search="doSearch"
maxlength="10"
placeholder="请输入会议名称、会议地点进行查询"
shape="round"
v-model="pageForm.searchKeyWord"
>
</van-search>
<van-dropdown-menu>
<van-dropdown-item :options="meetingList" @change="doSearch"
v-model="pageForm.tabNameIndex"></van-dropdown-item>
<van-dropdown-item :options="meetingTimeList" @change="doSearch"
v-model="pageForm.meetingTime"></van-dropdown-item>
<van-dropdown-item :options="typeList" @change="doSearch"
v-model="pageForm.typeId"></van-dropdown-item>
</van-dropdown-menu>
</div>
<!--列表-->
<div style="margin-top: 116px">
<van-list
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''" :immediate-check="false"
@load="onLoad"
v-model="loading"
>
<div class="van-doc-card" v-for="o in tableData">
<div @click="openView(o.id)">
<div style="display: flex; justify-content: space-between">
<div style="width: 74%">
<div class="van-ellipsis title">
<span class="title_span">|</span>
<span>{{o.meetingName}}</span>
</div>
</div>
<div style="color: #1867b0; white-space: nowrap;">
{{o.meetingTypeName}}
</div>
</div>
<div style="margin-top: 10px">
<van-row>
<span style="color: grey">会议地点:</span>
{{o.location}}
</van-row>
</div>
<div style="margin-top: 10px">
<van-row>
<span style="color: grey">会议时间:</span>
{{o.startTime}}
<!--<van-col span="12"><span style="color: grey">结束时间:</span></van-col>-->
</van-row>
<van-row>
<!--<van-col span="12">{{o.endTime}}</van-col>-->
</van-row>
</div>
<div style="display: flex; justify-content: space-between; margin-top: 8px">
<div class="cus_overflow" style="line-height: 20px; width: 83%">
<span style="color: grey">会议描述:</span>
{{o.meetingDescription}}
</div>
<span @click.stop="popupShow = true; clickRow = o"
class="showMore">查看更多</span>
</div>
<van-divider></van-divider>
<div style="display: flex; justify-content: flex-end">
<!--<div style="display: flex; align-items: center">
<span style="color: grey">审核状态:</span>
<span :style="'color: ' + o.stateColor">{{o.stateName}}</span>
</div>-->
<div>
<!--<van-button @click="needLeave(o)" v-if="o.isCanLeave === null && o.isJoin === null"
type="primary" size="small" color="#1867b0" style="margin-right: 8px">我要请假</van-button>
<van-button v-if="o.isJoin === false" size="small" disabled color="grey" style="margin-right: 8px">已请假</van-button>
<van-button type="primary" v-if="o.isJoin !== false" size="small" color="#1867b0">我要签到</van-button>
<van-button v-if="o.isJoin === true" size="small" disabled color="grey">已签到</van-button>-->
<van-button
:disabled="moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false"
@click="needLeave(o, false)"
color="#1867b0" size="small" style="margin-right: 8px"
type="primary">查看请假状态
</van-button>
<van-button
:disabled="moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false"
@click="needLeave(o, true)"
color="#1867b0" size="small" style="margin-right: 8px"
type="primary">我要请假
</van-button>
</div>
</div>
</div>
</div>
</van-list>
<van-empty
class="custom-image"
description="暂无数据"
image="/none.svg"
v-if="mLoading==false&&tableData.length==0"
></van-empty>
</div>
<!--弹出框-->
<van-popup class="cus_popup" v-model:show="popupShow">
<pre style="margin: 0; white-space: break-spaces; line-height: 28px">{{clickRow.meetingDescription}}</pre>
</van-popup>
<van-icon @click="popupShow = false" class="cus_icon" name="close" v-if="popupShow"></van-icon>
<!--请假弹框-->
<van-action-sheet class="leave_pop" title="会议信息" v-model="leaveShow">
<div v-if="flag === true"
style="padding: 0px 0px 10px 0px; text-align: center; font-size: 14px; color: #646566">
请<span style="color: red">点击选择</span>请假时间段,填写请假原因
</div>
<div class="content">
<div class="van-doc-card" v-for="(item, index) in timeList">
<div>
<div><span style="color: grey">会议名称:</span>{{item.timePeriodName}}</div>
</div>
<div @click="leaveClick(item, index)"
style="display: flex; justify-content: space-between">
<div>
<div>
<span style="color: grey">会议时间:</span>
{{moment(item.startTime).format('YYYY-MM-DD HH:mm')}}
</div>
<!--<div><span style="color: grey">结束时间:</span>{{moment(item.endTime).format('YYYY-MM-DD HH:mm')}}</div>-->
</div>
<div>
<div v-if="flag === true" class="border_div"></div>
<van-icon v-if="flag === true" :class="'checkDiv checkDiv' + index"
name="success" style="display: none;"></van-icon>
<span class="auditState"
v-if="item.isJoin === false">{{item.stateName}}</span>
</div>
</div>
<div v-if="item.isJoin === false">
<div><span style="color: grey">审核状态:</span>{{item.stateName}}</div>
</div>
<div>
<span style="float: left; color: grey">请假原因:</span>
<van-field :disabled="item.isJoin === false" placeholder="请输入请假原因" rows="1"
style="font-size: 12px; padding: 0; width: 70%; line-height: 20px"
type="textarea" autosize
v-model="item.leaveReason"></van-field>
</div>
<div v-if="flag === false && item.stateCode === clickRow.firstState && item.stateAuditType !== 1"
style="text-align: right">
<van-button @click.stop="cancelLeave(item)" border color="#1867b0" size="small">
取消请假
</van-button>
</div>
<div v-if="flag === false && item.stateAuditType === 1" style="text-align: right">
<van-button @click.stop="refreshApply(item)" border color="#1867b0"
size="small">重新申请
</van-button>
</div>
</div>
</div>
<div v-if="flag === true">
<div style="display: flex; justify-content: space-evenly; position: fixed; bottom: 20px; width: 100%">
<van-button @click="leaveShow = false" color="lightgrey" size="small"
style="width: 40%; border-radius: revert; height: 38px">取消
</van-button>
<van-button @click="leave" color="#1867b0" size="small"
style="width: 40%; border-radius: revert; height: 38px">确定
</van-button>
</div>
</div>
</van-action-sheet>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
timeList: [],
checked: [],
checkboxRefs: [],
leaveReason: '',
leaveShow: false,
popupShow: false,
tabNameIndex: 0,
clickRow: {},
meetingList: [{text: '全部', value: '0'}, {text: '我参与的', value: '1'}, {
text: '我请假的',
value: '2'
}],
typeList: [],
meetingTimeList: [{text: '全部时间', value: null}, {
text: '即将开始',
value: 0
}, {text: '已结束', value: 1}],
flag: true,
}
},
methods: {
refreshApply(o) {
vant.Dialog.confirm({
title: '温馨提示',
message: '您确定要重新申请吗?',
}).then(async () => {
await this.needLeave(this.clickRow, true)
this.timeList.forEach((re, index) => {
if (re.stateAuditType === 1) {
re.isJoin = null
re.stateCode = null
re.leaveReason = null
$('.checkDiv' + index).css('display', 'none')
this.checked = this.checked.filter(function (item, index) {
return item.id !== re.id
})
}
})
}).catch(() => {
})
},
cancelLeave(o) {
vant.Dialog.confirm({
title: '温馨提示',
message: '您确定要取消请假吗?',
}).then(async () => {
const res = await $.post('/mobile/meeting/mine/cancelLeave', {id: o.id})
if (res.code === 0) {
vant.Toast('操作成功')
this.doSearch()
this.leaveShow = false
}
}).catch(() => {
})
},
leaveClick(item, index) {
if (item.isJoin === false) {
return
}
const isExist = this.checked.some(o => o.tpuId === item.tpuId)
if (!isExist) {
$('.checkDiv' + index).css('display', '')
this.checked.push(item)
} else {
$('.checkDiv' + index).css('display', 'none')
this.checked = this.checked.filter(o => o.tpuId !== item.tpuId)
}
},
toggle(item, index) {
if (item.auditIdList === null) {
this.$refs.checkboxes[index].toggle();
}
},
openView(id) {
},
doSearch() {
this.pageForm.pageNumber = 1
this.tableData = []
this.finished = false
this.onLoad()
},
async onLoad() {
this.loading = true
$.post('/mobile/meeting/mine/pageData', this.pageForm).then(res => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.loading = false
})
},
async needLeave(o, flag) {
this.flag = flag
this.clickRow = o
if (moment().valueOf() > moment(o.leaveDeadline).valueOf() || o.isCanLeave === false) {
vant.Toast('抱歉,已过请假截止时间');
return
}
this.leaveReason = ''
this.checked = []
const res = await $.post('/mobile/meeting/mine/findMyMeetPeriod', {meetingId: o.id})
if (res.code === 0) {
this.timeList = res.data
if (this.timeList.length === 0) {
vant.Toast('您暂无可请假的假时间段');
return
}
this.leaveShow = true
this.$nextTick(function () {
this.timeList.forEach((re, index) => {
if (re.isJoin === false) {
this.checked.push(re)
$('.checkDiv' + index).css('display', '')
}
})
})
return
}
vant.Toast('系统错误,请联系管理员');
},
async leave() {
if (this.checked.length === 0) {
vant.Toast('请选择请假时间段');
return
}
const array = this.timeList.find(o => o.stateCode === null || o.stateCode < this.clickRow.firstState)
if (array === undefined) {
vant.Toast('您的所有请假均已处于审核阶段');
return
}
const paramArray = []
let valid = false
this.checked.forEach(item => {
if (item.leaveReason === '' || item.leaveReason === undefined) {
vant.Toast('请填写请假原因');
valid = true
return
}
if (!item.stateCode) {
paramArray.push(
{
id: item.tpuId,
meetingId: this.clickRow.id,
leaveReason: item.leaveReason
}
)
}
})
if (paramArray.length === 0) {
vant.Toast('请选择请假时间段');
return
}
if (valid) {
return
}
const resp = await $.post('/mobile/meeting/mine/askForLeave', {
meetingId: this.clickRow.id,
data: JSON.stringify(paramArray)
})
if (resp.code === 0) {
vant.Toast('操作成功');
this.doSearch()
this.leaveShow = false
}
$('.checkDiv').css('display', 'none')
}
},
async created() {
this.typeList = await meetUtil.getAllMeetingType()
this.typeList.unshift({'text': '全部会议类型'})
if (this.typeList && this.typeList.length > 0) {
this.$set(this.pageForm, "typeId", this.typeList[0].value)
}
this.$set(this.pageForm, "tabNameIndex", this.meetingList[0].value)
this.$set(this.pageForm, "meetingTime", this.meetingTimeList[1].value)
this.onLoad()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,320 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
[v-cloak] {
display: none !important;
}
#app {
max-height: 100vh;
opacity: 0;
}
.header {
height: 400px;
max-height: 400px;
background-color: white
}
.body {
background-color: white;
margin-top: 6px;
height: calc(100vh - (400px + 6px + 26px + 70px));
max-height: calc(100vh - (400px + 6px + 26px + 70px));
padding: 10px;
}
.footer {
background-color: white;
margin-top: 6px;
width: 100%;
height: 70px;
display: flex;
align-items: center;
}
.meeting_info {
height: 200px;
width: 86%;
margin: 0 auto;
transform: translateY(-60%);
background-color: white;
box-shadow: 0 8px 12px #ebedf0;
padding: 10px 10px;
border-radius: 10px;
}
.header .text {
color: white;
text-align: center;
letter-spacing: 3px;
line-height: 40px;
}
.meeting_info .meeting_name {
text-align: center;
font-weight: bold;
}
.meeting_info .meeting_address {
text-align: center;
color: grey;
font-size: 14px;
}
.van-button--block {
margin: 0 auto;
width: 92%;
}
.tag {
color: #1867b0;
font-weight: bold;
font-size: 20px;
margin-right: 6px;
}
.span_text {
color: grey;
font-size: 14px;
}
.van-col {
font-size: 14px;
}
.van-col span {
color: grey;
font-size: 14px;
}
.icon {
width: 6.4em;
height: 6.4em;
display: inline-block;
vertical-align: middle;
font-size: 10px;
-webkit-mask-size: 100%;
-webkit-mask-position: 50% 50%;
background-color: currentColor;
}
.icon_ok {
-webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-1.177-7.86l-2.765-2.767L7%2012.431l3.119%203.121a1%201%200%20001.414%200l5.952-5.95-1.062-1.062-5.6%205.6z%22%2F%3E%3C%2Fsvg%3E);
color: #07c160;
}
.icon_no {
-webkit-mask-image: url(data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M12%2022C6.477%2022%202%2017.523%202%2012S6.477%202%2012%202s10%204.477%2010%2010-4.477%2010-10%2010zm-.763-15.864l.11%207.596h1.305l.11-7.596h-1.525zm.759%2010.967c.512%200%20.902-.383.902-.882%200-.5-.39-.882-.902-.882a.878.878%200%2000-.896.882c0%20.499.396.882.896.882z%22%2F%3E%3C%2Fsvg%3E);
color: #fa5151;
}
.weui-msg__text-area {
margin-bottom: 32px;
padding: 0 32px;
-webkit-box-flex: 1;
line-height: 1.6;
}
.weui-msg__text-area .weui-msg__title {
margin-bottom: 16px;
font-weight: 500;
font-size: 22px;
color: rgba(0, 0, 0, 0.9);
}
.weui-msg__desc {
font-size: 17px;
font-weight: 400;
color: rgba(0, 0, 0, 0.9);
margin-bottom: 16px;
}
.meeting_index {
width: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background-color: lightgrey;
color: white;
font-size: 20px;
font-weight: bold;
}
.meeting_peri {
width: 90%;
line-height: 19px;
margin-left: 10px
}
.meeting_primary {
display: flex;
justify-content: space-between;
margin-bottom: 10px
}
.weui-btn_primary:not(.weui-btn_disabled):visited {
color: #fff;
}
.weui-btn_primary {
background-color: #1867b0;
}
.weui-btn {
position: relative;
display: block;
width: 184px;
margin-left: auto;
margin-right: auto;
padding: 8px 24px;
box-sizing: border-box;
font-weight: 700;
font-size: 17px;
text-align: center;
text-decoration: none;
color: #fff;
line-height: 1.88235294;
border-radius: 8px;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
</style>
<div id="app">
<div v-if="isCanAudit">
<div class="header">
<div style="height: 300px; background-color: #1867b0; border-radius: 0 0 16% 16%;">
<div class="text">会议签到</div>
</div>
<div class="meeting_info">
<div class="meeting_name">{{meetingInfo.meetingName}}</div>
<div class="meeting_address">{{meetingInfo.location}}</div>
<div style="position: relative; top: 55px">
<van-row>
<van-col span="24"><span>会议类型:</span>{{typeName}}</van-col>
</van-row>
<div style="position: relative; top: 30px">
<van-row>
<van-col span="24">
<span style="color: grey; font-size: 14px;">会议时间:</span>
{{moment(meetingInfo.startTime).format('YYYY-MM-DD HH:mm')}}
</van-col>
</van-row>
<van-row>
<van-col span="24">
<span style="color: grey; font-size: 14px;">结束时间:</span>
{{moment(meetingInfo.endTime).format('YYYY-MM-DD HH:mm')}}
</van-col>
</van-row>
</div>
</div>
</div>
</div>
<div class="body">
<div><span class="tag">|</span>会议名称</div>
<div style="overflow-y: auto; height: 100%; font-size: 13px;margin-top: 16px">
<div class="meeting_primary" v-for="(item,index) in meetingInfo.meetingTimePeriods">
<div :style="item.id === mtpId ? 'background-color: #43b26a; font-size: 15px' : ''"
class="meeting_index" v-if="item.id === mtpId">
当前
</div>
<div class="meeting_index" style="font-weight: normal" v-else>
{{index + 1}}
</div>
<div class="meeting_peri">
<div>{{item.timePeriodName}}</div>
<div>{{moment(item.startTime).format('YYYY-MM-DD HH:mm')}}</div>
</div>
</div>
</div>
</div>
<div class="footer">
<van-button :disabled="signInfo.isSignIn" @click="signIn" block color="#1867b0" round type="primary">
{{signInfo.isSignIn ? '您已签到' : '点击签到'}}
</van-button>
</div>
</div>
<div style="text-align: center; padding-top: calc(100% - 50%)" v-cloak v-else>
<div style="margin-bottom: 32px;">
<span :class="isIncorrect === true ? 'icon icon_ok' : 'icon icon_no'"></span>
</div>
<div class="weui-msg__text-area">
<h2 class="weui-msg__title">{{isIncorrect === true ? '操作成功' : '温馨提示'}}</h2>
<p class=".weui-msg__desc">{{incorrectMag}}</p>
</div>
<p style="margin-top: 190px">
<span @click="back" class="weui-btn weui-btn_primary" role="button">点击返回</span>
</p>
</div>
</div>
<script>
<!--# include("/platform/meeting/includeJs/meetingUtil.js"){} #-->
const meetUtil = new meetingUtil()
function getQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return decodeURI(r[2]);
return null;
}
const vue = new Vue({
el: '#app',
data() {
return {
meetingInfo: {},
signInfo: {},
isCanAudit: true,
incorrectMag: '',
meetingId: '',
mtpId: '',
isIncorrect: true,
typeName: '',
}
},
methods: {
async pageData() {
const res = await $.get('/mobile/meeting/mine/getMeetingInfo', {
meetingId: this.meetingId,
mtpId: this.mtpId,
})
if (res.code === 0) {
this.meetingInfo = res.data.meetingInfo
this.signInfo = res.data.signInfo
const typeList = await meetUtil.getAllMeetingType()
const type = typeList.find(o => o.id === this.meetingInfo.typeId)
this.typeName = type !== undefined ? type.meetingTypeName : ''
} else {
this.isCanAudit = false
this.incorrectMag = res.msg
this.isIncorrect = false
}
$('#app').css('opacity', '1')
},
async signIn() {
const res = await $.post('/mobile/meeting/mine/signIn', {
mtpId: this.mtpId,
})
this.isIncorrect = res.code === 0
this.isCanAudit = false
this.incorrectMag = res.msg
},
back() {
const str = this.incorrectMag === '你不是当前会议人员' ? 'http://' + window.location.host : '/mobile/meeting/mine/go_sign?meetingId=' + this.meetingId + '&mtpId=' + this.mtpId
location.href = str
},
},
async created() {
this.meetingId = getQueryString('meetingId')
this.mtpId = getQueryString('mtpId')
await this.pageData()
}
})
</script>
<!--#
}
#-->
File diff suppressed because it is too large Load Diff
@@ -1,391 +0,0 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.page-survey {
background-color: rgba(242, 242, 242, 1);
}
.page-survey .survey-container {
height: 100%;
overflow: visible;
padding-top: 0;
display: flex;
flex-direction: column;
}
.survey-container .question-list {
flex: auto;
padding-bottom: 84px;
}
.question {
position: relative;
margin-bottom: 20px;
background: rgba(255, 255, 255, 1);
}
.question-head {
overflow: hidden;
position: relative;
padding: 20px;
background: rgba(255, 255, 255, 1);
}
.question-tags {
position: absolute;
top: -2px;
}
.question-title {
position: relative;
font-size: 1.125em;
font-weight: normal;
word-wrap: break-word;
word-break: break-word;
outline: 0;
}
.question-seq {
display: block;
margin-right: 8px;
font-size: 18px;
float: left;
}
.question-title .text {
margin-right: 4px;
}
.question-body {
background-color: rgba(255, 255, 255, 1);
user-select: none;
}
.van-checkbox {
margin-right: 10px;
}
.van-cell__title {
font-size: 16px;
color: rgba(0, 0, 0, 1);
}
.page-control {
padding: 20px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 20px;
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #fff;
}
.survey-head {
padding: 20px;
background: #fff;
margin-bottom: 10px;
}
.survey-head .title {
font-size: 22px;
font-weight: 600;
text-align: center;
}
.survey-head .desc {
padding: 10px;
font-size: 14px;
}
</style>
<div id="app" v-cloak>
<div class="root">
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="知识竞答" left-arrow placeholder fixed
@click-left="history.go(-1)"></van-nav-bar>
<template v-if="!mLoading">
<div v-if="finishAnswer">
{{finishAnswer}}
<van-empty description="您已经答完该问卷">
<div>
<van-button type="info" @click="viewScore">查看成绩</van-button>
<van-button type="info" @click="viewAnswerSheet">查看答卷</van-button>
<!-- <van-button type="info" @click="answerAgain">再答一次</van-button>-->
</div>
</van-empty>
</div>
<div v-else class="page-survey" style="touch-action: manipulation;min-height: 100vh;">
<div class="survey-container">
<div class="survey-head">
<div class="title">
{{questionData.qtitle}}
</div>
<div class="desc">
{{titleMsg}}
</div>
</div>
<div class="question-list">
<section v-for="(issue,issueIdx) in issueList" :key="issue.iid" class="question"
:id="'issue'+issue.iid">
<div class="question-head">
<div class="question-tags">
<template v-if="issue.itx===1">
<van-tag :type="issue.iisdx?'primary':'warning'">{{issue.iisdx?'单选':'多选'}}
</van-tag>
</template>
<van-tag v-if="issue.fraction" type="primary">{{issue.fraction}}分</van-tag>
</div>
<h2 class="question-title">
<span class="question-seq">
<b>
{{issueIdx+1}}
</b>
</span>
<div class="text" v-html="issue.iname"></div>
</h2>
</div>
<div class="question-body">
<van-checkbox-group v-model="issue.userSelect" :ref="'checkboxGroup'+issue.iid">
<van-cell-group>
<van-cell
v-for="(item,index) in issue.wors"
clickable
:key="item"
:title="item.wtxt"
@click="toggle(issue,item.wid)"
>
<template #icon>
<van-checkbox :name="item.wid" :ref="'checkboxes'+item.wid"
:shape="issue.iisdx?'round':'square'"></van-checkbox>
</template>
</van-cell>
</van-cell-group>
</van-checkbox-group>
</div>
</section>
</div>
<div class="page-control">
<van-button type="info" block @click="save()">保存</van-button>
<van-button type="info" block @click="submit()">提交</van-button>
</div>
</div>
</div>
</template>
</div>
</div>
<script>
const BASE_URL = '/mobile/question/h5ctgu'
const vue = new Vue({
el: '#app',
data() {
return {
questionData: {
issues: []
},
currentIssueIndex: 0,
replyInfo: [],
finishAnswer: false,
mLoading: true
}
},
computed: {
issueList() {
return this.questionData.issues
},
titleMsg() {
debugger
const radios = this.issueList.filter(v => v.itx === 1 && v.iisdx)
const checkBoxes = this.issueList.filter(v => v.itx === 1 && !v.iisdx)
const radioScore = radios.length > 0 ? radios[0].fraction : 0
const checkBoxesScore = checkBoxes.length > 0 ? checkBoxes[0].fraction : 0
const radioScoreSum = radios.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b, 0)
const checkBoxesScoreSum = checkBoxes.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b, 0)
const sumScore = radioScoreSum + checkBoxesScoreSum
return "说明:单选题" + radios.length + "题,每题" + radioScore + "分,合计" + radioScoreSum + "分;多选题" + checkBoxes.length + "题,每题" + checkBoxesScore + "分,合计" + checkBoxesScoreSum + "分;总分" + sumScore + "分。"
},
fullScore() {
return this.issueList.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b)
},
radioNum() {
return this.issueList.filter(v => v.idx === 1 && v.iisdx).map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b)
},
checkBoxNum() {
}
},
methods: {
async getQuestionData() {
const resp = await $.get(BASE_URL + '/questionInfo/' + this.id)
this.questionData = resp.data
this.questionData.issues.forEach(i => {
// i.userSelect = null
})
},
toggle(issue, worId) {
//单选
if (issue.iisdx) {
vue.$refs['checkboxGroup' + issue.iid][0].toggleAll(false)
} else {
}
console.log(issue.userSelect)
this.$refs['checkboxes' + worId][0].toggle()
setTimeout(() => {
console.log(issue.userSelect)
})
},
save() {
this.$modal.confirm('保存后下次可继续做答,您确定要保存吗?').then(async () => {
const replies = this.questionData.issues.map(v => {
return {
qid: v.iid,
issueId: v.iid,
userSelect: v.userSelect,
}
})
const {code} = await $.post(BASE_URL + '/saveAnswer', {
replies: JSON.stringify(replies),
questionId: this.questionData.qid,
isSave: true
})
this.$modal.closeLoading()
if (code === 0) {
this.$modal.msg('保存成功')
} else {
this.$modal.msg('保存失败')
}
})
},
submit() {
const iids = this.questionData.issues.filter(v => !v.userSelect).map(v => v.iid)
if (iids.length > 0) {
vant.Toast('您还有' + iids.length + '题未作答,请答完后再提交!')
document.getElementById('issue' + iids[0]).scrollIntoView({behavior: 'smooth', block: 'center','inline':'start'});
return
}
const msg = '一旦提交不可修改,您确定要提交吗?'
this.$modal.confirm(msg).then(async () => {
const replies = this.questionData.issues.map(v => {
return {
qid: v.iid,
issueId: v.iid,
userSelect: v.userSelect,
}
})
const {code} = await $.post(BASE_URL + '/saveAnswer', {
replies: JSON.stringify(replies),
questionId: this.questionData.qid,
isSave: false
})
this.$modal.closeLoading()
if (code === 0) {
this.$modal.msg('提交成功')
await this.checkUserFinishAnswer()
if (this.finishAnswer) {
//查看分数
this.viewScore()
}
}
})
},
//获取回答信息
async getReply() {
const resp = await $.get(BASE_URL + '/answerInfo/' + this.id)
this.replyInfo = resp.data
},
//用户是否全部答完提交
async checkUserFinishAnswer() {
this.mLoading = true
const resp = await $.get(BASE_URL + '/checkUserFinishAnswer', {questionId: this.id})
setTimeout(async () => {
this.mLoading = false
this.finishAnswer = resp.data
if (resp.data) {
} else {
await this.getReply()
await this.assignmentAnswer()
}
}, 1000)
},
//答案赋值
assignmentAnswer() {
this.questionData.issues.forEach(issue => {
const rwids = this.replyInfo.filter(v => v.issueId === issue.iid).map(v => v.rwid)
rwids.forEach(rwid => {
this.toggle(issue, rwid)
})
})
},
answerAgain() {
this.finishAnswer = false
setTimeout(() => {
this.questionData.issues.forEach(issue => {
issue.wors.forEach(wor => {
this.$refs['checkboxes' + wor.wid][0].toggle(false)
})
})
}, 0)
},
viewScore() {
window.location.href = BASE_URL + '/score?id=' + this.id
},
viewAnswerSheet(){
window.location.href = BASE_URL + '/answerSheet?id=' + this.id
}
},
async created() {
this.id = GetQueryString("id")
await this.getQuestionData()
await this.checkUserFinishAnswer()
// await this.getReply()
// this.assignmentAnswer()
}
})
window.addEventListener('pageshow', async e => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.id = GetQueryString("id")
await vue.getQuestionData()
await vue.checkUserFinishAnswer()
}
})
</script>
<!--#
}
#-->
@@ -1,323 +0,0 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.page-survey {
background-color: rgba(242, 242, 242, 1);
}
.page-survey .survey-container {
height: 100%;
overflow: visible;
padding-top: 0;
display: flex;
flex-direction: column;
}
.survey-container .question-list {
flex: auto;
padding-bottom: 84px;
}
.question {
position: relative;
margin-bottom: 20px;
background: rgba(255, 255, 255, 1);
}
.question-head {
overflow: hidden;
position: relative;
padding: 20px;
background: rgba(255, 255, 255, 1);
}
.question-tags {
position: absolute;
top: -2px;
}
.question-title {
position: relative;
font-size: 1.125em;
font-weight: normal;
word-wrap: break-word;
word-break: break-word;
outline: 0;
}
.question-seq {
display: block;
margin-right: 8px;
font-size: 18px;
float: left;
}
.question-title .text {
margin-right: 4px;
}
.question-body {
background-color: rgba(255, 255, 255, 1);
user-select: none;
}
.van-checkbox {
margin-right: 10px;
}
.van-cell__title {
font-size: 16px;
color: rgba(0, 0, 0, 1);
}
.page-control {
padding: 20px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 20px;
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #fff;
}
.survey-head {
padding: 20px;
background: #fff;
margin-bottom: 10px;
}
.survey-head .title {
font-size: 22px;
font-weight: 600;
text-align: center;
}
.survey-head .desc {
padding: 10px;
font-size: 14px;
}
@font-face {
font-family: 'Indie Flower';
font-style: normal;
font-weight: 400;
src: url(/assets/platform/fonts/m8JVjfNVeKWVnh3QMuKkFcZVaUuH.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
.survey-head .score{
color: red;
font-family: 'Indie Flower', cursive;
font-size: 30px;
text-align: right;
}
.question-footer {
padding: 16px;
}
.van-checkbox--disabled .van-checkbox__icon--checked .van-icon {
color: #fff;
background-color: #1989fa;
border-color: #1989fa;
}
</style>
<div id="app" v-cloak>
<div class="page-survey" style="touch-action: manipulation;min-height: 100vh;">
<div class="survey-container">
<div class="survey-head">
<div class="title">
{{questionData.qtitle}}
</div>
<div class="desc">
{{titleMsg}}
</div>
<div class="score">
{{score}}
</div>
</div>
<div class="question-list">
<section v-for="(issue,issueIdx) in issueList" :key="issue.iid" class="question"
:id="'issue'+issue.iid">
<div class="question-head">
<div class="question-tags">
<template v-if="issue.itx===1">
<van-tag :type="issue.iisdx?'primary':'warning'">{{issue.iisdx?'单选':'多选'}}
</van-tag>
</template>
<van-tag v-if="issue.fraction" type="primary">{{issue.fraction}}分</van-tag>
</div>
<h2 class="question-title">
<span class="question-seq">
<b>
{{issueIdx+1}}
</b>
</span>
<div class="text" v-html="issue.iname"></div>
</h2>
</div>
<div class="question-body">
<van-checkbox-group v-model="issue.userSelect" :ref="'checkboxGroup'+issue.iid" disabled>
<van-cell-group>
<van-cell
v-for="(item,index) in issue.wors"
clickable
:key="item"
:title="item.wtxt"
>
<template #label>
<div>
{{item.correct?'正确答案':''}}
</div>
</template>
<template #icon>
<van-checkbox :name="item.wid" :ref="'checkboxes'+item.wid"
:shape="issue.iisdx?'round':'square'"></van-checkbox>
</template>
</van-cell>
</van-cell-group>
</van-checkbox-group>
</div>
<div class="question-footer" v-if="replyInfo">
<div>
<div style="display: flex;align-items: center;"
:style="{color:(issue.isEqual?'#15db81':'red')}">
{{issue.isEqual?'回答正确':'回答错误'}}
</div>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
<script>
const BASE_URL = '/mobile/question/h5ctgu'
const vue = new Vue({
el: '#app',
data() {
return {
questionData: {
issues: []
},
currentIssueIndex: 0,
replyInfo: [],
finishAnswer: false,
mLoading: true,
score: 0
}
},
computed: {
issueList() {
return this.questionData.issues
},
titleMsg() {
// const radios = this.issueList.filter(v => v.itx === 1 && v.iisdx)
// const checkBoxes = this.issueList.filter(v => v.itx === 1 && !v.iisdx)
//
// const radioScore = radios ? radios[0].fraction : 0
// const checkBoxesScore = checkBoxes ? checkBoxes[0].fraction : 0
//
// const radioScoreSum = radios.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b, 0)
// const checkBoxesScoreSum = checkBoxes.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b, 0)
//
// const sumScore = radioScoreSum + checkBoxesScoreSum
//
// return "说明:单选题" + radios.length + "题,每题" + radioScore + "分,合计" + radioScoreSum + "分;多选题" + checkBoxes.length + "题,每题" + checkBoxesScore + "分,合计" + checkBoxesScoreSum + "分;总分" + sumScore + "分。"
return null
},
fullScore() {
return this.issueList.map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b)
},
radioNum() {
return this.issueList.filter(v => v.idx === 1 && v.iisdx).map(v => v.fraction ? v.fraction : 0).reduce((a, b) => a + b)
},
checkBoxNum() {
}
},
methods: {
async getQuestionData() {
const resp = await $.get(BASE_URL + '/questionInfo/' + this.id)
this.questionData = resp.data
},
toggle(issue, worId) {
//单选
if (issue.iisdx) {
vue.$refs['checkboxGroup' + issue.iid][0].toggleAll(false)
} else {
}
this.$refs['checkboxes' + worId][0].toggle()
},
async getReply() {
const resp = await $.get(BASE_URL + '/answerInfo/' + this.id)
this.replyInfo = resp.data
},
//用户是否全部答完提交
async checkUserFinishAnswer() {
this.mLoading = true
const resp = await $.get(BASE_URL + '/checkUserFinishAnswer', {questionId: this.id})
this.finishAnswer = resp.data
if (resp.data) {
await this.getReply()
await this.assignmentAnswer()
} else {
// await this.getReply()
// await this.assignmentAnswer()
}
},
//答案赋值
assignmentAnswer() {
this.questionData.issues.forEach(issue => {
const rwids = this.replyInfo.filter(v => v.issueId === issue.iid).map(v => v.rwid)
rwids.forEach(rwid => {
this.toggle(issue, rwid)
})
const wids = issue.wors.filter(v => v.correct).map(v => v.wid)
const userSelects = this.replyInfo.filter(v => v.issueId === issue.iid).map(v => v.rwid)
const isEqual = wids.length === userSelects.length && wids.every(value => userSelects.includes(value))
issue.isEqual = isEqual
})
},
checkIsCorrect(issue) {
const wids = issue.wors.filter(v => v.correct).map(v => v.wid)
const userSelects = this.replyInfo.filter(v => v.issueId === issue.iid).map(v => v.rwid)
const isEqual = wids.length === userSelects.length && wids.every(value => userSelects.includes(value))
return isEqual
},
async getScore() {
const resp = await $.get(BASE_URL + '/getScore', {questionId: this.id})
this.score = resp.data.score
},
},
async created() {
this.id = GetQueryString("id")
await this.getScore()
await this.getQuestionData()
await this.checkUserFinishAnswer()
}
})
</script>
<!--#
}
#-->
@@ -1,163 +0,0 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.transcript-container {
background-image: url(/assets/mobile/img/question/score.jpg);
background-size: 100% 100%;
min-height: 100%;
padding: 15px;
width: 100%;
max-width: 1128px;
box-sizing: border-box;
height: 100vh;
}
.transcript-header {
margin-bottom: 15px;
flex-direction: column;
text-align: center;
display: flex;
justify-content: space-between;
align-items: center;
color: #fff;
}
.score-detail-group {
align-self: stretch;
background: rgba(255, 255, 255, 0.01);
-webkit-backdrop-filter: blur(50px);
backdrop-filter: blur(50px);
border-radius: 20px;
padding: 20px 0;
margin: 20px 0 0 0 !important;
border: 1px solid rgba(255, 255, 255, 0.1);
flex: none;
text-align: center;
}
.score-total {
margin: 40px 0;
transform: translate3d(0px, 0px, 0px);
display: flex;
align-items: stretch;
justify-content: center;
height: 120px;
line-height: 1;
}
.score-number {
display: flex;
flex-direction: column;
justify-content: center;
margin: 0 20px;
}
.score-text-title {
font-size: 16px;
font-weight: 600;
line-height: 32px;
margin-bottom: 30px;
color: #FFFFFF;
}
.score-text-info {
font-size: 32px;
font-weight: 600;
line-height: 50px;
}
.total-number {
font-size: 64px;
min-width: 100px;
}
.total-percent {
margin-top: 10px;
font-size: 20px;
}
</style>
<div id="app">
<van-nav-bar title="知识竞答分数" left-arrow placeholder fixed
@click-left="history.go(-1)"></van-nav-bar>
<div class="transcript-container">
<div class="transcript-header transcript-header-mobile">
<div class="score-text-container">
<div class="score-text-title">
{{title}}
</div>
<div class="score-text-info">
{{message}}
<!-- <ul>-->
<!-- <li>姓名:{{user.username}}</li>-->
<!-- <li>工号:{{user.loginname}}</li>-->
<!-- <li>单位:{{user.unitname}}</li>-->
<!-- <li>工会:{{user.unionname}}</li>-->
<!-- </ul>-->
</div>
</div>
<div class="score-detail-group">
<div class="score-total" style="transform: translate3d(0px, 0px, 0px);">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 88 188">
<path fill="#fff"
d="M41.035 41.216c1.313-.407 2.5-.657 3.844-.875 2.812-.438 5.687-.438 8.437-.094a21.44 21.44 0 01-3.188 5.25s-.125.125-.125.156c-5.468 6.062-11.999 8.78-20.123 8.75-.625-7.25 4.968-11.125 11.155-13.187zM25.63 76.244c-2.281-8.999 5.062-14.561 12.562-17.436 2.75-.937 5.655-1.437 8.53-1.625C44.38 66.87 35.223 74.682 25.63 76.244zm1.844 9.562c2.218-3.25 4.562-5.25 7.905-7.28 2.594-1.532 5.406-2.657 8.312-3.406-.656 10.53-7.78 19.998-17.623 24.06-2.375-4.75-1.25-9.03 1.406-13.374zm3.687 35.06c-5.75-7.843-.531-16.311 5.53-22.06 2.313-2.032 4.907-3.72 7.688-5.063 1.28 10.499-4.344 21.717-13.218 27.123zm9.28 19.717c-7.218-6.718-3.468-16.155 1.532-22.935 1.968-2.438 4.28-4.594 6.812-6.5 3.156 10.124-.656 22.467-8.343 29.435zm7.781.438c.625-2.406 1.406-4.312 2.563-6.5 1.5-2.812 3.437-5.406 5.624-7.749a24.494 24.494 0 012.25 6.249c1.937 8.75.125 17.812-4.906 25.186-6.25-3.906-6.874-10.499-5.53-17.186zm22.218 31.748c-9.75-3.969-9.906-14.562-7.594-23.374.969-3.187 2.375-6.187 4.125-8.968 6.718 8.656 8.093 22.592 3.468 32.342zM38.504 34.216c.938-8.655 9.437-10.999 16.936-11.03 2.782.093 5.5.625 8.156 1.437a22.477 22.477 0 01-3.968 4.469c-5.656 4.843-13.874 6.78-21.124 5.124zm7.031-16.155c7.562.219 12.687-4.874 15.686-11.343 1-2.125 1.75-4.406 2.313-6.718-2.438.062-4.844.469-7.156 1.281-6.937 2.437-12.937 9-10.843 16.78zM25.63 33.591c-.406-1.375-.812-2.718-1.312-4.062-1.032-2.906-2.313-5.75-3.719-8.468a28.868 28.868 0 00-3.843 7.812c-2.813 8.968-.531 18.123 7.218 23.686 4.593-5.75 3.468-12.343 1.656-18.968zm-6.25 42.091c3.969-7.562-.718-17.28-4.874-23.717a63.492 63.492 0 00-5.656-7.562C4.257 55.653 6.975 71.12 19.38 75.682zm-2.687 10.124c-2.156-3.53-4.437-6.25-7.312-9.218-2.28-2.312-4.718-4.5-7.312-6.468-.812 5.03-.375 10.905 1.469 15.686 3.156 7.75 7.812 12.75 16.28 14.155 1.125-5.374-.5-9.53-3.125-14.155zm8.5 37.154c.156-8.843-9.03-16.155-15.718-20.436a73.267 73.267 0 00-8.812-4.875 33.031 33.031 0 002.125 9.624c3.594 9.281 11.937 16.874 22.405 15.687zm9.843 20.904c-1.844-8.78-12.656-13.842-20.249-16.53a77.954 77.954 0 00-9.843-2.749 32.908 32.908 0 004.281 8.968c5.718 8.405 15.718 13.874 25.81 10.311zm-2.626 7.656c-2.53-.594-4.936-1-7.53-1.312-3.468-.407-6.968-.563-10.405-.532a33.547 33.547 0 006.25 7.969c.124.125.937.906 1.03.937 8.437 6.75 17.437 9.437 27.342 3.937-3.5-6.655-9.75-9.093-16.686-10.999zm34.373 26.436c-5.937-7.469-18.53-7.781-27.185-7.031a72.233 72.233 0 00-10.624 1.656 36.742 36.742 0 008.249 6.812c9.187 5.468 21.436 6.562 29.56-1.437zM33.067 31.216c6.593-4.593 6.468-14.811 5.53-21.904A60.312 60.312 0 0036.818.5c-8.75 7.843-12.25 21.905-3.75 30.717z"></path>
<path fill="#fff"
d="M33.629 37.56c3.5-7.219 7.062-13 11.843-19.405-5.031 6.28-8.718 11.968-12.468 19.123-8.124 16.5-11.405 30.154-11.905 48.56.312 23.748 5.374 41.184 17.967 61.276 13.062 18.999 26.654 30.592 47.528 40.435.469-1.063.937-2.125 1.406-3.156-20.342-9.437-33.623-20.561-46.528-38.904-12.561-19.53-17.748-36.497-18.467-59.683.125-18.186 3.093-31.716 10.624-48.246z"></path>
</svg>
<div class="score-number">
<div class="total-number">{{score}}分</div>
<div v-if="answerCount>1" class="total-percent">历史最高分:{{maxScore}}</div>
</div>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 88 188"
style="transform: rotateY(180deg);">
<path fill="#fff"
d="M41.035 41.216c1.313-.407 2.5-.657 3.844-.875 2.812-.438 5.687-.438 8.437-.094a21.44 21.44 0 01-3.188 5.25s-.125.125-.125.156c-5.468 6.062-11.999 8.78-20.123 8.75-.625-7.25 4.968-11.125 11.155-13.187zM25.63 76.244c-2.281-8.999 5.062-14.561 12.562-17.436 2.75-.937 5.655-1.437 8.53-1.625C44.38 66.87 35.223 74.682 25.63 76.244zm1.844 9.562c2.218-3.25 4.562-5.25 7.905-7.28 2.594-1.532 5.406-2.657 8.312-3.406-.656 10.53-7.78 19.998-17.623 24.06-2.375-4.75-1.25-9.03 1.406-13.374zm3.687 35.06c-5.75-7.843-.531-16.311 5.53-22.06 2.313-2.032 4.907-3.72 7.688-5.063 1.28 10.499-4.344 21.717-13.218 27.123zm9.28 19.717c-7.218-6.718-3.468-16.155 1.532-22.935 1.968-2.438 4.28-4.594 6.812-6.5 3.156 10.124-.656 22.467-8.343 29.435zm7.781.438c.625-2.406 1.406-4.312 2.563-6.5 1.5-2.812 3.437-5.406 5.624-7.749a24.494 24.494 0 012.25 6.249c1.937 8.75.125 17.812-4.906 25.186-6.25-3.906-6.874-10.499-5.53-17.186zm22.218 31.748c-9.75-3.969-9.906-14.562-7.594-23.374.969-3.187 2.375-6.187 4.125-8.968 6.718 8.656 8.093 22.592 3.468 32.342zM38.504 34.216c.938-8.655 9.437-10.999 16.936-11.03 2.782.093 5.5.625 8.156 1.437a22.477 22.477 0 01-3.968 4.469c-5.656 4.843-13.874 6.78-21.124 5.124zm7.031-16.155c7.562.219 12.687-4.874 15.686-11.343 1-2.125 1.75-4.406 2.313-6.718-2.438.062-4.844.469-7.156 1.281-6.937 2.437-12.937 9-10.843 16.78zM25.63 33.591c-.406-1.375-.812-2.718-1.312-4.062-1.032-2.906-2.313-5.75-3.719-8.468a28.868 28.868 0 00-3.843 7.812c-2.813 8.968-.531 18.123 7.218 23.686 4.593-5.75 3.468-12.343 1.656-18.968zm-6.25 42.091c3.969-7.562-.718-17.28-4.874-23.717a63.492 63.492 0 00-5.656-7.562C4.257 55.653 6.975 71.12 19.38 75.682zm-2.687 10.124c-2.156-3.53-4.437-6.25-7.312-9.218-2.28-2.312-4.718-4.5-7.312-6.468-.812 5.03-.375 10.905 1.469 15.686 3.156 7.75 7.812 12.75 16.28 14.155 1.125-5.374-.5-9.53-3.125-14.155zm8.5 37.154c.156-8.843-9.03-16.155-15.718-20.436a73.267 73.267 0 00-8.812-4.875 33.031 33.031 0 002.125 9.624c3.594 9.281 11.937 16.874 22.405 15.687zm9.843 20.904c-1.844-8.78-12.656-13.842-20.249-16.53a77.954 77.954 0 00-9.843-2.749 32.908 32.908 0 004.281 8.968c5.718 8.405 15.718 13.874 25.81 10.311zm-2.626 7.656c-2.53-.594-4.936-1-7.53-1.312-3.468-.407-6.968-.563-10.405-.532a33.547 33.547 0 006.25 7.969c.124.125.937.906 1.03.937 8.437 6.75 17.437 9.437 27.342 3.937-3.5-6.655-9.75-9.093-16.686-10.999zm34.373 26.436c-5.937-7.469-18.53-7.781-27.185-7.031a72.233 72.233 0 00-10.624 1.656 36.742 36.742 0 008.249 6.812c9.187 5.468 21.436 6.562 29.56-1.437zM33.067 31.216c6.593-4.593 6.468-14.811 5.53-21.904A60.312 60.312 0 0036.818.5c-8.75 7.843-12.25 21.905-3.75 30.717z"></path>
<path fill="#fff"
d="M33.629 37.56c3.5-7.219 7.062-13 11.843-19.405-5.031 6.28-8.718 11.968-12.468 19.123-8.124 16.5-11.405 30.154-11.905 48.56.312 23.748 5.374 41.184 17.967 61.276 13.062 18.999 26.654 30.592 47.528 40.435.469-1.063.937-2.125 1.406-3.156-20.342-9.437-33.623-20.561-46.528-38.904-12.561-19.53-17.748-36.497-18.467-59.683.125-18.186 3.093-31.716 10.624-48.246z"></path>
</svg>
</div>
</div>
</div>
</div>
</div>
<script>
const BASE_URL = '/mobile/question/h5ctgu'
const vue = new Vue({
el: '#app',
data() {
return {
score: 0,
maxScore: 0,
title: null,
user: {},
message: null,
answerCount: 0,
questionId: null,
}
},
methods: {
async getScore() {
const resp = await $.get(BASE_URL + '/getScore', {questionId: this.questionId})
this.score = resp.data.score
this.maxScore = resp.data.maxScore
this.title = resp.data.title
this.user = resp.data.user
this.answerCount = resp.data.answerCount
this.message = resp.data.message
},
},
created() {
this.questionId = GetQueryString("id")
this.getScore()
}
})
</script>
<!--#
}
#-->
@@ -86,13 +86,14 @@ layout("/mobile/platform.html"){
width: 100%;
background: transparent;
}
.winPopup img{
.winPopup img {
transform: translateY(-50%);
position: absolute;
top: 50%;
}
.winPopup .van-popup__close-icon{
.winPopup .van-popup__close-icon {
}
@@ -107,7 +108,7 @@ layout("/mobile/platform.html"){
width: 100%;
}
.win_tag{
.win_tag {
position: relative;
top: 16px;
left: 5px;
@@ -138,19 +139,25 @@ layout("/mobile/platform.html"){
<div class="quizzes-item-info-v">
<div class="quizzes-item-info-title">{{ item.qtitle }}</div>
<div class="quizzes-item-info-right">
<span class="quizzes-item-info-tip">创建时间:</span>
<span class="quizzes-item-info-tip">活动开始时间:</span>
<span class="quizzes-item-info-text">
{{ moment(item.createTime).format('YYYY年MM月DD日') }}
{{ moment(item.startTime).format('YYYY年MM月DD日') }}
</span>
</div>
<div class="quizzes-item-info-right" v-if="item.qlx!==4">
<span class="quizzes-item-info-tip">题目数量:</span>
<div class="quizzes-item-info-right">
<span class="quizzes-item-info-tip">活动结束时间:</span>
<span class="quizzes-item-info-text">
{{item.ctMode === 1 ? item.topicTotal : item.ctNum }}
</span>
<span class="quizzes-item-info-text" style="position: absolute;right: 0" >
<van-tag @click.stop="showWinInfo(item)" type="primary" class="win_tag" v-if="item.qlx===2 && item.isRaffle && moment(item.startTime).diff(moment(new Date().getTime()),'days') < 0">获奖信息</van-tag>
<!-- v-if="moment(item.startTime).diff(moment(new Date().getTime()),'days') < 0"-->
{{ moment(item.endTime).format('YYYY年MM月DD日') }}
</span>
</div>
<div class="quizzes-item-info-right" v-if="item.isRaffle">
<!-- <span class="quizzes-item-info-tip">题目数量:</span>-->
<!-- <span class="quizzes-item-info-text">-->
<!-- {{item.ctMode === 1 ? item.topicTotal : item.ctNum }}-->
<!-- </span>-->
<span class="quizzes-item-info-text" style="position: absolute;right: 0;bottom: 0">
<van-tag @click.stop="showWinInfo(item)" type="primary" class="win_tag"
v-if="item.qlx===2 && item.isRaffle && moment().isAfter(moment('2024-06-18 00:05:00'))">获奖信息</van-tag>
</span>
</div>
</div>
@@ -166,17 +173,22 @@ layout("/mobile/platform.html"){
<van-popup v-model="winPopupShow" class="winPopup"
:style="{ height: '100%' }"
>
>
<div style="display: flex;align-items: center">
<img v-if="isWin" width="100%" height="60%" src="/assets/mobile/img/question/win.png"/>
<!-- <img v-if="!isWin" width="100%" height="50%" src="/assets/mobile/img/question/noWin1.png"/>-->
<img v-if="!isWin" width="100%" height="50%" src="https://img1.baidu.com/it/u=3192248910,26901819&fm=253&fmt=auto&app=138&f=JPEG?w=403&h=500"/>
<img v-if="!isWin" width="100%" height="50%"
src="/assets/mobile/img/question/noWin1-removebg-preview.png"/>
</div>
<div class="iconDiv">
<div v-if="isWin" style="font-size: 14px;!important;">恭喜您中奖了,本次活动中奖机会只有一次喔!</div>
<van-icon @click="winPopupShow = false" name="close"></van-icon>
</div>
</van-popup>
<van-dialog v-model="tipShow" title="提示">
<div>活动期间,每天答题次数不限,每天答题的最终成绩取最高分。每天答题得90分(含)以上者,可参加线上抽奖活动。</div>
<div>6月17日至6月23日每天线上抽取“幸运奖”100名'。</div>
</van-dialog>
</div>
</div>
@@ -193,8 +205,10 @@ layout("/mobile/platform.html"){
queryForm: {
status: '1'
},
winPopupShow:false,
isWin:false
winPopupShow: false,
isWin: false,
tipShow:false
}
},
created() {
@@ -270,6 +284,7 @@ layout("/mobile/platform.html"){
async openAnswer(item) {
const {qid, qlx, qflag, activityUserScopeId} = item
if (qflag !== 2) {
this.$modal.msg('该问卷未发布')
return
@@ -289,12 +304,38 @@ layout("/mobile/platform.html"){
}
}
if (qid === '827cc4ef9cde47ed97bc21f6be75f91a') {
this.$dialog.alert({
title:'提示',
messageAlign:'left',
message: '<div style="text-indent: 2em;">活动期间,每天答题次数不限,每天答题的最终成绩取最高分。每天答题得90分(含)以上者,可参加线上抽奖活动。<div>' +
'<div style="text-indent: 2em;">6月17日至6月23日每天线上抽取“幸运奖”100名。</div>'+
'<div style="text-indent: 2em;">答题并提交成功后,可于次日查看获奖信息。</div>'
,
}).then(()=>{
if (qlx === 1) {
//调查
location.href = '/mobile/question/h5/poll/index?id=' + qid
} else if (qlx === 2) {
//答题
location.href = '/mobile/question/h5/answer/index?id=' + qid
} else if (qlx === 3) {
//购物
location.href = '/mobile/question/h5/shop/index?id=' + qid
} else if (qlx === 4) {
//蛋糕卡
location.href = '/mobile/question/h5/cake/index?id=' + qid
}
})
return
}
if (qlx === 1) {
//调查
location.href = '/mobile/question/h5/poll/index?id=' + qid
} else if (qlx === 2) {
//答题
location.href = '/mobile/question/h5/answer/index_ctgu?id=' + qid
location.href = '/mobile/question/h5/answer/index?id=' + qid
} else if (qlx === 3) {
//购物
location.href = '/mobile/question/h5/shop/index?id=' + qid
@@ -344,4 +385,4 @@ layout("/mobile/platform.html"){
<!--#
}
#-->
#-->
@@ -58,7 +58,7 @@ layout("/mobile/platform.html"){
margin-bottom: 1rem;
padding: 10px;
border-radius: 10px;
/*box-shadow: 2px 2px 12px 4px rgba(0, 0, 0, 0.1);*/
box-shadow: 2px 2px 12px 4px rgba(0, 0, 0, 0.1);
position: relative;
}
@@ -143,7 +143,7 @@ layout("/mobile/platform.html"){
right: 0;
max-height: 64px;
background-color: #FFF;
/*box-shadow: 0 0 20px rgb(230, 230, 230);*/
box-shadow: 0 0 20px rgb(230, 230, 230);
z-index: 999;
padding: 10px 20px;
display: flex;
@@ -324,17 +324,6 @@ layout("/mobile/platform.html"){
})
},
submitAnswer() {
const v1 = this.issueList.some(v => v.itx === 1 && v.iisbd && v.rwid == null)
if (v1) {
this.$modal.msg('请选择后再提交')
return
}
const v2 = this.issueList.some(v => v.itx === 2 && v.iisbd && (v.rval == null || v.rval === ''))
if (v2) {
this.$modal.msg('请填写后再提交')
return
}
const formData = this.formatFormData()
formData.forEach(v => v.save = false)
this.$modal.confirm('您确定要提交吗?提交后不能修改!').then(() => {
@@ -0,0 +1,502 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.middle-subject {
width: 100%;
height: 100vh;
background-color: #f6f7f9;
position: relative;
}
.middle-subject-info-padding {
padding: 10px;
background-color: #f6f7f9;
}
.middle-subject-info-scroll {
/*height: 100%;*/
height: calc(100vh - 110px);
max-height: calc(100vh - 110px);
overflow-y: scroll;
}
.middle-subject-info-head {
text-align: center;
}
.middle-subject-topic-icon {
width: 30px;
padding: 2px;
font-size: 10px;
background-color: #1678ff;
color: #fff;
text-align: center;
border-radius: 0 0 5px 5px;
position: absolute;
top: 0;
right: 10px;
}
.middle-subject-title {
margin-bottom: 1rem;
font-weight: bolder;
font-size: 16px;
}
.middle-subject-other {
color: #909399;
font-size: 13px;
display: flex;
justify-content: space-around;
margin-bottom: 1rem;
}
.middle-subject-topic {
background-color: #FFFFFF;
margin-bottom: 1rem;
padding: 10px;
border-radius: 10px;
box-shadow: 2px 2px 12px 4px rgba(0, 0, 0, 0.1);
position: relative;
}
.middle-subject-topic-title {
font-weight: bolder;
}
.middle-subject-topic-submit {
margin-top: 30px;
margin-bottom: 30px;
text-align: center;
}
.middle-subject-topic-desc {
color: rgb(160, 160, 160);
text-align: left;
margin-left: 20px;
font-size: 12px;
margin-bottom: 10px;
padding: 20px 0;
}
.itx_field {
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #606266;
display: inline-block;
font-size: inherit;
height: 40px;
line-height: 40px;
outline: none;
padding: 0 15px;
transition: border-color .2s cubic-bezier(.645, .045, .355, 1);
width: 100%;
}
.middle-subject-topic-submit .u-btn {
width: 60%;
}
.middle-subject-info-search {
position: absolute;
bottom: 45%;
right: 0;
height: 40px;
z-index: 999;
background-color: #FFF;
box-shadow: 0 0 20px rgb(230, 230, 230);
border-radius: 20px 0 0 20px;
}
.middle-subject-info-search-icon {
height: 40px;
width: 40px;
box-shadow: 0 0 10px #1678ff;
border-radius: 20px 0 0 20px;
background-color: #FFF;
display: flex;
justify-content: center;
align-items: center;
}
.middle-subject-info-search-info {
padding: 0 10px;
display: flex;
height: inherit;
z-index: 999;
align-items: center;
box-shadow: 0 0 10px #1678ff;
border-radius: 20px 0 0 20px;
background-color: #FFF;
}
.middle-subject-info-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
max-height: 64px;
background-color: #FFF;
box-shadow: 0 0 20px rgb(230, 230, 230);
z-index: 999;
padding: 10px 20px;
display: flex;
}
.middle-subject-info-footer-save {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
}
.middle-subject-info-footer-save .van-button {
/*width: 40%;*/
width: calc((100% - 100px) / 2);
}
.middle-subject-info-footer-pagination {
display: flex;
justify-content: space-between;
align-items: center;
width: 70%;
}
.van-radio__label {
width: 100%;
}
.totalMoney {
width: 80px;
max-width: 80px;
white-space: nowrap;
overflow: hidden;
overflow-x: scroll;
color: red;
font-size: 20px;
}
</style>
<div id="app" v-cloak>
<div class="middle-subject">
<van-nav-bar title="在线调查" left-arrow
@click-left="history.back()"></van-nav-bar>
<div class="middle-subject-info">
<div class="middle-subject-info-scroll">
<div class="middle-subject-info-padding">
<div class="middle-subject-info-head">
<div class="middle-subject-title">{{ questionData.qtitle }}</div>
<div class="middle-subject-other">
<template v-if="questionData.qlx!==3">
<!-- <span>创建人:{{ questionData.username }}</span>-->
<!-- <span>总题数:{{ issueList.length }}</span>-->
</template>
</div>
</div>
<div class="middle-subject-info-body">
<div class="middle-subject-topic" v-for="(issue,issueIndex) in issueList" :key="issue.qid">
<div v-if="!issue.iisdx" class="middle-subject-topic-icon">
<span>多选</span>
</div>
<div style="margin-bottom: 10px">
<span v-if="issue.iisbd" style="color: red;">*</span>
<span class="middle-subject-topic-title">
{{ issueIndex + 1 }}.
{{ removeHTMLTag(issue.iname) }}
<span v-if="issue.iminselect">(最少选择:{{issue.iminselect}})</span>
<span v-if="issue.imaxselect">(最多选择:{{issue.imaxselect}})</span>
<div v-if="issue.its" class="middle-subject-topic-desc"
style="margin-left: 17px;font-size: 12px;font-weight: 500;">
{{ issue.its }}
</div>
</span>
</div>
<!-- 选择题 -->
<template v-if="issue.itx===1">
<!-- 单选题 -->
<van-radio-group v-if="issue.iisdx" v-model="issue.rwid" :disabled="replyFinish">
<div v-for="(wor,worIndex) in issue.wors" :key="wor.wid">
<van-radio :ref="wor.wid" :name="wor.wid">
{{ letterList[worIndex] }}.&ensp;{{ wor.wtxt }}
</van-radio>
<div class="middle-subject-topic-desc">
<van-row gutter="16">
<van-col span="8" v-if="wor.wimg">
<image style="height: 80px;width: 80px" :src="wor.wimg"
mode="aspectFit">
</image>
</van-col>
<van-col span="16" v-if="wor.wsm">
{{ wor.wsm }}
</van-col>
</van-row>
<van-row style="margin-top: 10px;">
<van-col :span="8"
style="height: 28px;line-height: 28px;font-size: 14px;color: #d16565">
单价:¥{{ wor.price }}
</van-col>
<van-col :span="16" style="display: flex;justify-content: right"
v-if="issue.rwid === wor.wid">
<view style="height: 28px;line-height: 28px;font-size: 14px;color: #d16565;">
数量:
</view>
<van-stepper v-model="wor.number" :disabled="replyFinish" integer
disable-input :default-value="0"
:min="0"></van-stepper>
</van-col>
</van-row>
</div>
</div>
</van-radio-group>
<!-- 多选题 -->
<van-checkbox-group v-else-if="!issue.iisdx" v-model="issue.rwid"
:disabled="replyFinish"
:max="issue.imaxselect ? issue.imaxselect:0">
<div v-for="(wor,worIndex) in issue.wors" :key="wor.wid">
<van-checkbox :ref="wor.wid" :name="wor.wid" shape="square">
{{ letterList[worIndex] }}.&ensp;{{ wor.wtxt }}
</van-checkbox>
<div class="middle-subject-topic-desc">
<van-row gutter="16">
<van-col span="8" v-if="wor.wimg">
<image style="height: 80px;width: 80px" :src="wor.wimg"
mode="aspectFit">
</image>
</van-col>
<van-col span="16" v-if="wor.wsm">
{{ wor.wsm }}
</van-col>
</van-row>
<van-row style="margin-top: 10px;">
<van-col :span="8"
style="height: 28px;line-height: 28px;font-size: 14px;color: #d16565">
单价:¥{{ wor.price }}
</van-col>
<van-col :span="16" style="display: flex;justify-content: right"
v-if="issue.rwid && issue.rwid.includes(wor.wid)">
<view style="height: 28px;line-height: 28px;font-size: 14px;color: #d16565;">
数量:
</view>
<van-stepper v-model="wor.number" :disabled="replyFinish" integer
disable-input :default-value="0"
:min="0"></van-stepper>
</van-col>
</van-row>
</div>
</div>
</van-checkbox-group>
</template>
<!-- 填空题 -->
<template v-if="issue.itx===2">
<van-field v-model="issue.rval" type="text" border
class="itx_field"
cursor-spacing="100"
:show-confirmbar="false"
:disabled="replyFinish" :auto-height="true" maxlength="2000"></van-field>
</template>
</div>
</div>
</div>
</div>
<div class="middle-subject-info-footer">
<div class="middle-subject-info-footer-save">
<div class="totalMoney">
¥{{ totalMoney }}
</div>
<van-button size="medium" type="primary" @click="saveAnswer" :disabled="replyFinish">
保存
</van-button>
<van-button size="medium" type="info" :disabled="replyFinish" @click="submitAnswer">
提交
</van-button>
</div>
</div>
</div>
</div>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
id: null,
questionData: {},
issueList: [],
replyInfo: []
}
},
computed: {
letterList() {
const alphabet = Array.from(new Array(26), (ele, index) => {
return String.fromCharCode(65 + index);
})
return alphabet
},
replyFinish() {
return this.replyInfo.some(v => !v.save)
},
totalMoney() {
let sum = 0
this.issueList.forEach(v => {
if (v.itx === 1 && v.iisdx && v.rwid) {
//单选
const sel = v.wors.find(w => w.wid === v.rwid)
sum += sel.number * sel.price
} else if (v.itx === 1 && !v.iisdx && v.rwid) {
//多选
sum += v.wors.filter(w => v.rwid.includes(w.wid)).map(w => isNaN(w.price * w.number) ? 0 : w.price * w.number).reduce((a, b) => a + b, 0)
}
})
return sum
}
},
methods: {
async getQuestionData() {
const resp = await $.get('/mobile/question/h5/questionInfo/' + this.id)
this.questionData = resp.data
this.issueList = this.questionData && this.questionData.issues
},
saveAnswer() {
const formData = this.formatFormData(true)
if (formData.length === 0) {
this.$modal.msg('请先选择后再保存')
return
}
if (formData.some(v => v.number === 0)) {
this.$modal.msg('最少选择一项')
return
}
this.$modal.loading('保存中')
$.post('/mobile/question/h5/saveAnswer', {repliesArray: JSON.stringify(formData)}).then(res => {
this.$modal.closeLoading()
if (res.code === 0) {
this.$modal.msg('保存成功')
this.getReply()
} else {
this.$modal.msg('保存失败')
}
})
},
submitAnswer() {
const formData = this.formatFormData(false)
if (formData.length === 0) {
this.$modal.msg('请先选择后再提交')
return
}
if (formData.some(v => v.number === 0)) {
this.$modal.msg('最少选择一项')
return
}
this.$modal.confirm('您确定要提交吗?提交后不能修改!').then(() => {
this.$modal.loading('提交中')
$.post('/mobile/question/h5/saveAnswer', {repliesArray: JSON.stringify(formData)}).then(res => {
this.$modal.closeLoading()
if (res.code === 0) {
this.$modal.msg('提交成功')
this.getReply()
} else {
this.$modal.msg('提交失败')
}
})
})
},
//格式化提交数据
formatFormData(save) {
const formData = []
this.issueList.forEach(v => {
if (v.itx === 1 && v.iisdx) {
//单选
if (v.rwid) {
formData.push({
"rwid": v.rwid,
"qid": this.questionData.qid,
"issueId": v.iid,
"number": v.wors.find(w => w.wid === v.rwid).number,
"save": save
})
}
} else if (v.itx === 1 && !v.iisdx) {
//多选
if (v.rwid) {
v.rwid.forEach(r => {
formData.push({
"rwid": r,
"qid": this.questionData.qid,
"issueId": v.iid,
"number": v.wors.find(w => w.wid === r).number,
"save": save
})
})
}
} else if (v.itx === 2) {
if (v.rval) {
formData.push({
"rval": v.rval,
"qid": this.questionData.qid,
"issueId": v.iid,
"save": save
})
}
}
})
return formData
},
//获取回答信息并赋值
async getReply() {
const resp = await $.get('/mobile/question/h5/answerInfo/' + this.id)
this.replyInfo = resp.data
this.issueList.forEach((issue, issueIndex) => {
if (issue.itx === 1 && issue.iisdx) {
//单选
const rw = this.replyInfo.find(answer => answer.issueId === issue.iid)
this.$set(this.issueList[issueIndex], 'rwid', rw ? rw.rwid : null)
if (rw) {
const worIndex = issue.wors.findIndex(v => v.wid === rw.rwid)
this.$set(this.issueList[issueIndex]['wors'][worIndex], 'number', rw ? rw.number : 0)
}
} else if (issue.itx === 1 && !issue.iisdx) {
//多选
const rws = this.replyInfo.filter(answer => answer.issueId === issue.iid)
this.$set(this.issueList[issueIndex], 'rwid', rws ? rws.map(v => v.rwid) : [])
if (rws) {
rws.forEach(rw => {
const worIndex = issue.wors.findIndex(v => v.wid === rw.rwid)
this.$set(issue.wors[worIndex], 'number', rw ? rw.number : 0)
})
}
} else if (issue.itx === 2) {
//填空题
const rw = this.replyInfo.find(answer => answer.issueId === issue.iid)
this.$set(this.issueList[issueIndex], 'rval', rw ? rw.rval : null)
}
})
}
},
async created() {
this.id = GetQueryString("id")
await this.getQuestionData()
await this.getReply()
},
})
</script>
<!--#
}
#-->