This commit is contained in:
Paidax
2025-03-27 15:38:56 +08:00
parent 7410b3a181
commit 50aa04192a
47 changed files with 4438 additions and 686 deletions
@@ -61,11 +61,7 @@
</van-cell>
<van-cell title="活动内容" v-if="o.projectTypeCode!=='50004'">
<template #label>
<span style="white-space: pre-line">
{{o.activityContent}}
</span>
</template>
<span @click.stop="showActivityInfo(o.activityContent)" style="color: #0a84ff">点我查看详情</span>
</van-cell>
<van-cell title="签到点位" v-if="o.needSign">
<template #label>
@@ -1,11 +1,12 @@
const self_mixin = {
const self_mixin_h5 = {
data() {
return {
//已报名人数
hasRegUserNum: 0,
unionId: null,
unionLimitNum: 0,
isRegisterFull: false
isRegisterFull: false,
user: JSON.parse(window.sessionStorage.getItem('user'))
}
},
methods: {
@@ -15,7 +16,7 @@ const self_mixin = {
resp.data.location = JSON.parse(resp.data.location)
resp.data.unionUserNumberLimit = JSON.parse(resp.data.unionUserNumberLimit)
this.o = resp.data
this.unionId = "${@shiro.getPrincipalProperty('unit').getUnionid()}"
this.unionId = this.user.union.id
if (!this.unionId) {
this.$toast.fail('您的所属工会信息缺失,请联系管理员')
return
@@ -52,8 +53,9 @@ const self_mixin = {
zoomEnable: true,
dragEnable: false,
resizeEnable: true,
center: [114.402582, 30.521378],
zoom: 16
center: [119.743667, 30.216618],
zoom: 16,
scrollWheel: true,
});
if (this.o.location && Array.isArray(this.o.location)) {
@@ -61,7 +63,7 @@ const self_mixin = {
const lat = parseFloat(this.o.location[1])
marker = new AMap.Marker({
position: [lng, lat],
offset: new AMap.Pixel(-13, -30)
//offset: new AMap.Pixel(-13, -30)
})
map.add(marker)
// marker.setMap(map);
@@ -127,4 +129,4 @@ const self_mixin = {
return s.toFixed(2)
}
}
}
}
@@ -168,7 +168,7 @@ layout("/mobile/platform.html"){
if (o.projectTypeCode === '50004') {
pjaxReplace('/mobile/activity/myActivity/goMyProject?id=' + o.id)
} else {
pjaxReplace('/mobile/activity/unionActivity/goReg?id=' + o.id + '&signUpMethod=' + o.signUpMethod)
pjaxReplace('/mobile/activity/myActivity/goSign?id=' + o.id)
}
}
},
@@ -9,22 +9,43 @@ layout("/mobile/platform.html"){
height: 200px;
width: 100%;
}
.remark-content{
width: 100%;
max-width: 100%;
height: calc(100vh - 46px - 44px);
overflow-y: auto;
}
.remark-content *{
max-width: 100%!important;
}
.joinPopup {
width: 100%;
height: 100%;
background-color: #f6f7f9;
}
</style>
<div id="app" v-cloak>
<van-nav-bar title="签到" left-arrow placeholder fixed @click-left="history.back()"></van-nav-bar>
<van-nav-bar title="签到" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/activity/unionActivity')"></van-nav-bar>
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
<div style="margin: 20px 20px 10px 20px" v-if="o.needSign">
<van-button
:disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf() || isSign"
:disabled="isSign"
@click="doSign()" style="border-radius: 10px" block type="info"
:color="themeColor">
{{isSign?'签到成功':'立即签到'}}
</van-button>
</div>
<van-popup class="joinPopup" position="right" v-model:show="showActivityInfoPopup">
<van-nav-bar @click-left="showActivityInfoPopup = false" fixed left-arrow placeholder title="活动内容"></van-nav-bar>
<div class="remark-content" v-html="activityContent" @click="remarkClick"></div>
</van-popup>
</div>
@@ -36,15 +57,29 @@ layout("/mobile/platform.html"){
let geolocation = null
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, self_mixin],
mixins: [mobileMixins, self_mixin_h5],
data() {
return {
activityId: '',
o: {},
isSign: null
isSign: null,
activityContent: '',
showActivityInfoPopup: false
}
},
methods: {
remarkClick(event){
//如果点击的是图片
if(event.target.tagName === 'IMG'){
vant.ImagePreview([event.target.src])
}
},
showActivityInfo(activityContent){
this.activityContent = ''
this.activityContent = activityContent
this.showActivityInfoPopup = true
},
async getSignStatus() {
const resp = await $.post('/mobile/activity/unionActivity/isSign', {activityId: this.activityId})
if (resp.code === 0) {
@@ -52,6 +87,12 @@ layout("/mobile/platform.html"){
}
},
async doSign() {
const loading1 = this.$toast.loading({
message: '正在获取您的位置...',
forbidClick: true,
overlay: true,
duration: 0
})
geolocation.getCurrentPosition(async (status, result) => {
if (status !== 'complete') {
this.$toast.fail('定位失败!')
@@ -67,10 +108,21 @@ layout("/mobile/platform.html"){
const distance = this.getMapDistance(params)
console.log(distance)
console.log(this.o.rangeMeter)
loading1.close()
if (!moment().isBetween(moment(this.o.signStartTime), moment(this.o.signEndTime))) {
vant.Dialog.alert({
title: '温馨提示',
message: '未到签到时间<br/>签到开始时间:' + this.o.signStartTime + '<br/>签到结束时间:' + this.o.signEndTime,
})
return
}
if (distance > this.o.rangeMeter) {
this.$toast('距离活动打卡点还有' + distance + '米')
return
}
const confirm = await this.$dialog.confirm({
title: '提示',
message: '您确认要签到吗?',
@@ -83,23 +135,24 @@ layout("/mobile/platform.html"){
})
if (confirm === 'confirm') {
const resp = await $.post('/mobile/activity/unionActivity/singleSignUp', {activityId: this.activityId})
loading.close()
if (resp.code === 0) {
await this.getSignStatus()
loading.close()
this.$toast.success(resp.msg)
} else {
this.$toast.fail(resp.msg)
}
}
})
}
},
created() {
async created() {
const id = GetQueryString("id")
if (id) {
this.activityId = id
this.getActivityInfo()
this.getSignStatus()
await this.getActivityInfo()
await this.getSignStatus()
}
}
})
@@ -107,4 +160,4 @@ layout("/mobile/platform.html"){
<!--#
}
#-->
#-->
@@ -9,6 +9,23 @@ layout("/mobile/platform.html"){
/*height: 200px;*/
width: 100%;
}
.remark-content{
width: 100%;
max-width: 100%;
height: calc(100vh - 46px - 44px);
overflow-y: auto;
}
.remark-content *{
max-width: 100%!important;
}
.joinPopup {
width: 100%;
height: 100%;
background-color: #f6f7f9;
}
</style>
<div id="app" v-cloak>
@@ -41,7 +58,7 @@ layout("/mobile/platform.html"){
</van-button>
</div>
<div style="margin: 20px 20px 10px 20px"
<!--<div style="margin: 20px 20px 10px 20px"
v-if="isRegister && moment().valueOf() < moment(o.endTime).valueOf() && moment().valueOf() > moment(o.startTime).valueOf()">
<van-button
:color="themeColor"
@@ -50,25 +67,45 @@ layout("/mobile/platform.html"){
type="info">
{{isSign?'签到成功':'立即签到'}}
</van-button>
</div>
</div>-->
<van-popup class="joinPopup" position="right" v-model:show="showActivityInfoPopup">
<van-nav-bar @click-left="showActivityInfoPopup = false" fixed left-arrow placeholder title="活动内容"></van-nav-bar>
<div class="remark-content" v-html="activityContent" @click="remarkClick"></div>
</van-popup>
</div>
<script>
<!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, self_mixin],
mixins: [mobileMixins, self_mixin_h5],
data() {
return {
activityId: '',
o: {},
tagCloseable: true,
isRegister: false,
isSign: false
isSign: false,
activityContent: '',
showActivityInfoPopup: false
}
},
methods: {
remarkClick(event){
//如果点击的是图片
if(event.target.tagName === 'IMG'){
vant.ImagePreview([event.target.src])
}
},
showActivityInfo(activityContent){
console.log(activityContent)
this.activityContent = ''
this.activityContent = activityContent
this.showActivityInfoPopup = true
},
async isRegisterForMe() {
const resp = await $.get('/mobile/activity/unionActivity/isRegisterForMe', {activityId: this.activityId})
if (resp.code === 0) {
@@ -93,15 +130,21 @@ layout("/mobile/platform.html"){
})
await this.getHasRegUserNum()
const resp = await $.post('/mobile/activity/unionActivity/doSingleRegister', {activityId: this.activityId})
loading.close()
if (resp.code === 0) {
setTimeout(() => {
this.$toast.success(resp.msg)
loading.close()
pjaxReplace('/mobile/activity/unionActivity')
}, 500)
vant.Dialog.alert({
title: '温馨提示',
message: '您已报名成功,请按时参加活动哦',
}).then(() => {
window.location.reload()
}).catch(() => {
window.location.reload()
})
} else {
this.$toast.fail(resp.msg)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
}
}
},
@@ -110,23 +153,31 @@ layout("/mobile/platform.html"){
title: '提示',
message: '您确认要取消报名吗?',
})
const loading = this.$toast.loading({
message: '取消中...',
forbidClick: true,
overlay: true,
duration: 0
})
if (confirm === 'confirm') {
const loading = this.$toast.loading({
message: '取消中...',
forbidClick: true,
overlay: true,
duration: 0
})
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId})
loading.close()
if (resp.code === 0) {
setTimeout(() => {
this.$toast.success(resp.msg)
loading.close()
pjaxReplace('/mobile/activity/unionActivity')
}, 1000)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
}).then(() => {
window.location.reload()
}).catch(() => {})
// setTimeout(() => {
// this.$toast.success(resp.msg)
// pjaxReplace('/mobile/activity/unionActivity')
// }, 1000)
} else {
this.$toast.fail(resp.msg)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
}
}
},
@@ -39,10 +39,27 @@ layout("/mobile/platform.html"){
.van-search__action {
background-color: #edf0ff
}
.remark-content{
width: 100%;
max-width: 100%;
height: calc(100vh - 46px - 44px);
overflow-y: auto;
}
.remark-content *{
max-width: 100%!important;
}
.joinPopup {
width: 100%;
height: 100%;
background-color: #f6f7f9;
}
</style>
<div id="app" v-cloak>
<van-nav-bar :title="title" @click-left="history.back()" fixed left-arrow
<van-nav-bar :title="title" @click-left="pjaxReplace('/mobile/activity/unionActivity')" fixed left-arrow
placeholder></van-nav-bar>
<!--#include("/mobile/activity/unionActivity/common/activityInfo.html"){}#-->
@@ -51,47 +68,40 @@ layout("/mobile/platform.html"){
<van-cell class="regCell" title="报名人员">
<template #label>
<div>
<span v-if="o.userNumberLimit===1">
本活动限制总报名人数:({{o.totalUserNumberLimit}})人
</span>
<span v-if="o.userNumberLimit===1">本活动限制总报名人数:({{o.totalUserNumberLimit}})人</span>
<span v-else-if="o.userNumberLimit===2">
当前工会报名限额 <span style="color: orange">{{o.limitUnion.limitNum}})人</span>
当前基层工会报名限额
<span style="color: orange">{{o.limitUnion.limitNum}})人</span>
</span>
</div>
<div class="mt5" v-loading="tagCloseable">
<div v-if="registerList && registerList.length>0">
<template v-for="item in registerList">
<van-tag :closeable="tagCloseable" :color="themeColor"
@close="removeRegUser(item)"
size="medium"
type="primary">
<van-tag :closeable="tagCloseable" :color="themeColor" @close="removeRegUser(item)" size="medium" type="primary">
{{item.userName}}
</van-tag>
</template>
</div>
<div v-else>
<div style="text-align: center;margin-top: 20px;">
无报名人员
</div>
<div style="text-align: center; margin-top: 20px">无报名人员</div>
</div>
</div>
<div class="mt5" style="text-align: right"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()">
<van-button :color="themeColor" @click="openUserActionSheet" size="mini"
type="info" v-if="tagCloseable">选择报名人员
</van-button>
<div
class="mt5"
style="text-align: right"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"
>
<van-button :color="themeColor" @click="openUserActionSheet" size="mini" type="info" v-if="tagCloseable">选择报名人员</van-button>
</div>
</template>
</van-cell>
</van-cell-group>
<van-action-sheet class="userActionPopup" title="选择报名人员" v-model="userActionSheet">
<van-search @search="onSearchUser" placeholder="请输入姓名搜索" show-action
v-model="searchKey">
<van-search @search="onSearchUser" placeholder="请输入姓名搜索" show-action v-model="searchKey">
<template #action>
<div @click="onSearchUser(searchKey)">搜索</div>
</template>
</van-search>
<!-- <div class="van-hairline&#45;&#45;bottom">-->
@@ -101,50 +111,36 @@ layout("/mobile/platform.html"){
<van-loading size="24px" vertical>搜索中...</van-loading>
</template>
<div class="van-action-sheet__content mt5"
v-else-if="searchUserList && searchUserList.length>0">
<div class="van-action-sheet__content mt5" v-else-if="searchUserList && searchUserList.length>0">
<template>
<template v-for="item in searchUserList"
v-if="!registerList.map(v=>v.id).includes(item.id)">
<button @click="searchUserAdd(item)"
class="van-action-sheet__item van-hairline--bottom">
<template v-for="item in searchUserList" v-if="!registerList.map(v=>v.id).includes(item.id)">
<button @click="searchUserAdd(item)" class="van-action-sheet__item van-hairline--bottom">
<span class="van-action-sheet__name">{{item.userName}}{{item.loginName}}</span>
</button>
</template>
<!--<van-empty description="没有更多了" style="position:absolute;height: 70%"
<!--<van-empty description="没有更多了"
v-else></van-empty>-->
</template>
</div>
<van-empty description="暂无数据" style="position:absolute;height: 70%"
v-else-if="searchUserList.length===0"></van-empty>
<van-empty description="暂无数据" v-else-if="searchUserList.length===0"></van-empty>
</van-action-sheet>
<div style="margin: 20px 20px 10px 20px"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()">
<van-button :color="themeColor" @click="doSave()" block style="border-radius: 10px"
type="info"
v-if="tagCloseable">
提 交
</van-button>
<div
style="margin: 20px 20px 10px 20px"
v-if="moment(o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() < moment(o.applyEndTime).valueOf()"
>
<van-button :color="themeColor" @click="doSave()" block style="border-radius: 10px" type="info" v-if="tagCloseable">提 交</van-button>
<template v-else="!tagCloseable">
<van-button :color="themeColor" @click="tagCloseable = true"
block style="border-radius: 10px"
type="info">
修 改
</van-button>
<van-button
@click="doCancel"
block color="red" style="border-radius: 10px;margin-top: 10px"
type="info">
取消报名
</van-button>
<van-button :color="themeColor" @click="tagCloseable = true" block style="border-radius: 10px" type="info">修 改</van-button>
<van-button @click="doCancel" block color="red" style="border-radius: 10px; margin-top: 10px" type="info">取消报名</van-button>
</template>
</div>
<van-popup class="joinPopup" position="right" v-model:show="showActivityInfoPopup">
<van-nav-bar @click-left="showActivityInfoPopup = false" fixed left-arrow placeholder title="活动内容"></van-nav-bar>
<div class="remark-content" v-html="activityContent" @click="remarkClick"></div>
</van-popup>
<!-- <div style="margin: 20px 20px 10px 20px" v-if="tagCloseable">-->
<!-- <van-button-->
<!-- :disabled="moment().valueOf() > moment(o.endTime).valueOf() || moment().valueOf() < moment(o.startTime).valueOf()"-->
@@ -160,45 +156,58 @@ layout("/mobile/platform.html"){
<!--#include("/mobile/activity/unionActivity/common/initMap.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [mobileMixins, self_mixin],
el: "#app",
mixins: [mobileMixins, self_mixin_h5],
data() {
return {
title: "",
userId: "${@shiro.getPrincipalProperty('id')}",
userName: "${@shiro.getPrincipalProperty('username')}",
activityId: '',
activityId: "",
o: {},
registerList: [],
addRegisterList: [],
userActionSheet: false,
searchKey: '',
searchKey: "",
searchUserList: [],
tagCloseable: true,
searchLoading: false
searchLoading: false,
activityContent: '',
showActivityInfoPopup: false
}
},
methods: {
remarkClick(event){
//如果点击的是图片
if(event.target.tagName === 'IMG'){
vant.ImagePreview([event.target.src])
}
},
showActivityInfo(activityContent){
console.log(activityContent)
this.activityContent = ''
this.activityContent = activityContent
this.showActivityInfoPopup = true
},
async doCancel() {
const confirm = await this.$dialog.confirm({
title: '提示',
message: '您确认要取消报名吗?',
title: "提示",
message: "您确认要取消报名吗?"
})
const loading = this.$toast.loading({
message: '取消中...',
forbidClick: true,
overlay: true,
duration: 0
})
if (confirm === 'confirm') {
const resp = await $.post('/mobile/activity/unionActivity/doSingleCancelRegister', {activityId: this.activityId})
if (confirm === "confirm") {
const loading = this.$toast.loading({
message: "取消中...",
forbidClick: true,
overlay: true,
duration: 0
})
const resp = await $.post("/mobile/activity/unionActivity/doSingleCancelRegister", { activityId: this.activityId })
loading.close()
if (resp.code === 0) {
setTimeout(() => {
loading.close()
this.$toast.success(resp.msg)
setTimeout(() => {
window.history.back()
}, 400)
window.location.reload()
}, 1000)
} else {
this.$toast.fail(resp.msg)
@@ -206,10 +215,10 @@ layout("/mobile/platform.html"){
}
},
async getRegisterUser() {
const resp = await $.get('/mobile/activity/myActivity/selectRegisterList', {activityId: this.activityId})
const resp = await $.get("/mobile/activity/myActivity/selectRegisterList", { activityId: this.activityId })
if (resp.code === 0) {
if (this.o.signUpMethod === 3) {
this.registerList = resp.data.filter(v => v.applyUserId === this.userId)
this.registerList = resp.data.filter((v) => v.applyUserId === this.userId)
} else {
this.registerList = resp.data
}
@@ -220,9 +229,10 @@ layout("/mobile/platform.html"){
}
},
openUserActionSheet() {
this.searchKey = ''
this.searchKey = ""
this.searchUserList = []
this.userActionSheet = true
this.onSearchUser("1")
},
async onSearchUser(val) {
if (!val) {
@@ -230,21 +240,20 @@ layout("/mobile/platform.html"){
return
}
this.searchLoading = true
const resp = await $.get('/mobile/activity/unionActivity/searchNoRegisterUser', {
const resp = await $.get("/mobile/activity/unionActivity/searchNoRegisterUser", {
activityId: this.activityId,
searchKey: val
})
if (resp.code === 0) {
this.searchLoading = false
this.searchUserList = resp.data.list
} else {
this.$toast.fail(resp.msg)
}
},
searchUserAdd(item) {
const {id, userName} = item
this.registerList.push({id, userName})
const { id, userName } = item
this.registerList.push({ id, userName })
this.$toast.success("添加成功")
},
async removeRegUser(item) {
@@ -253,46 +262,42 @@ layout("/mobile/platform.html"){
return
}
const confirm = await this.$dialog.confirm({
title: '提示',
message: '您确认要移除吗?',
title: "提示",
message: "您确认要移除吗?"
})
if (confirm === 'confirm') {
const index = this.registerList.findIndex(v => v.id === item.id)
if (confirm === "confirm") {
const index = this.registerList.findIndex((v) => v.id === item.id)
this.registerList.splice(index, 1)
}
},
//保存
async doSave() {
if (this.registerList.length === 0) {
this.$toast('请添加报名人员后再提交!')
this.$toast("请添加报名人员后再提交!")
return
}
if (this.o.signUpMethod === 3) {
if (this.registerList.length !== this.o.teamNum) {
vant.Dialog.alert({
title: '温馨提示',
message: '此活动是双人报名模式您需要报名' + this.o.teamNum + '人!',
}).then(() => {
});
title: "温馨提示",
message: "此活动是双人报名模式您需要报名" + this.o.teamNum + "人!"
}).then(() => {})
return
}
if (!this.registerList.map(v => v.id).includes(this.userId)) {
if (!this.registerList.map((v) => v.id).includes(this.userId)) {
vant.Dialog.alert({
title: '温馨提示',
message: '此活动是组队模式请您找' + this.o.teamNum + '朋友一起报名!',
}).then(() => {
});
title: "温馨提示",
message: "此活动是组队模式请您找" + this.o.teamNum + "朋友一起报名!"
}).then(() => {})
return
}
// await this.getRegisterUser()
const resp = await $.get('/mobile/activity/myActivity/selectRegisterList', {activityId: this.activityId})
const resp = await $.get("/mobile/activity/myActivity/selectRegisterList", { activityId: this.activityId })
this.addRegisterList = resp.data
let arr = []
if (this.addRegisterList && this.addRegisterList.length > 0) {
this.addRegisterList.forEach(v => {
this.registerList.forEach(r => {
this.addRegisterList.forEach((v) => {
this.registerList.forEach((r) => {
if (v.id === r.id && v.applyUserId !== this.userId) {
arr.push(r.userName)
}
@@ -302,11 +307,9 @@ layout("/mobile/platform.html"){
if (arr && arr.length > 0) {
vant.Dialog.alert({
title: '温馨提示',
message: '【' + arr.toString() + '】已成功报名您无需再报名!',
}).then(() => {
});
title: "温馨提示",
message: "【" + arr.toString() + "】已成功报名您无需再报名!"
}).then(() => {})
return
}
@@ -319,41 +322,40 @@ layout("/mobile/platform.html"){
});
return
}*/
}
let message = ''
let message = ""
if (this.o.needSign) {
message = '此活动开启了签到,需要您活动当天前往签到点位核实活动报名人员后进行签到!'
message = "此活动开启了签到,需要您活动当天前往签到点位核实活动报名人员后进行签到!"
}
const confirm = await this.$dialog.confirm({
title: '提示',
message: message + '您确认要报名吗?',
title: "提示",
message: message + "您确认要报名吗?"
})
if (confirm === 'confirm') {
if (confirm === "confirm") {
const loading = this.$toast.loading({
message: '报名中...',
message: "报名中...",
forbidClick: true,
overlay: true,
duration: 0
})
const params = {
activityId: this.activityId,
personIds: JSON.stringify(this.registerList.map(v => v.id))
personIds: JSON.stringify(this.registerList.map((v) => v.id))
}
const resp = await $.post('/mobile/activity/unionActivity/doSaveUnionRegister', params)
const resp = await $.post("/mobile/activity/unionActivity/doSaveUnionRegister", params)
loading.close()
if (resp.code === 0) {
await this.getRegisterUser()
await this.getHasRegUserNum()
setTimeout(() => {
loading.close()
this.$toast.success(resp.msg)
}, 1000)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
} else {
setTimeout(() => {
loading.close()
this.$toast.fail(resp.msg)
}, 500)
vant.Dialog.alert({
title: '温馨提示',
message: resp.msg,
})
}
}
}
@@ -365,14 +367,12 @@ layout("/mobile/platform.html"){
await this.getActivityInfo()
await this.getRegisterUser()
if (this.o.signUpMethod === 3 && this.registerList.length === 0) {
this.registerList.push({id: this.userId, userName: this.userName})
this.registerList.push({ id: this.userId, userName: this.userName })
}
this.title = (this.o.signUpMethod === 2 ? '分工会报名' : '组队报名')
this.title = this.o.signUpMethod === 2 ? "基层工会报名" : "组队报名"
if (moment(this.o.applyStartTime).valueOf() < moment().valueOf() && moment().valueOf() > moment(this.o.applyEndTime).valueOf()) {
this.$toast.fail("不在活动范围内")
}
}
}
})
@@ -15,6 +15,12 @@
<link rel="stylesheet" href="${base!}/assets/mobile/css/main.css">
<link rel="stylesheet" href="${base!}/assets/platform/plugins/vant/vant.css">
<script>
window._AMapSecurityConfig = {
securityJsCode: "4fa1e1aeabba7eb9518129cf57ab17c1",
};
</script>
<script src="${base!}/assets/platform/plugins/vue/vue.min.js"></script>
<script src="${base!}/assets/platform/plugins/vant/vant.js"></script>
@@ -48,7 +54,7 @@
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="${base!}/assets/platform/js/scannerQrCodeJs.js"></script>
<script type="text/javascript"
src="https://webapi.amap.com/maps?v=2.0&key=6ab3452804ba35050880b5e047436853&plugin=AMap.PolyEditor,AMap.Geolocation"></script>
src="https://webapi.amap.com/maps?v=2.0&key=57f0d098ba1b881ecc436c4cfd23bbbf&plugin=AMap.PolyEditor,AMap.Geolocation"></script>
<!--字典混入-->
<script src="${base!}/components/plugins/sysDict/DictData.js"></script>
@@ -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">
@@ -161,8 +161,15 @@ layout("/mobile/platform.html"){
this.activity = res.data.activity
this.subjects = res.data.subjects
this.answerRecordId = res.data.answerRecordId
this.checkGroupPermission()
// this.checkGroupPermission()
this.getAnswerRecord()
} else {
vant.Dialog.alert({
title: '温馨提示',
message: res.msg,
}).then(() => {
pjaxReplace("/mobile/index")
})
}
})
},
@@ -307,8 +314,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 +330,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,12 @@ layout("/mobile/platform.html"){
</div>
<div class="button-control">
<van-button v-if="canAgainQuestion" type="primary" @click="againQuestion" 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 +241,9 @@ layout("/mobile/platform.html"){
activity: {},
list: [],
historyShow: false,
historyList: []
historyList: [],
canAgainQuestion: false
}
},
computed: {
@@ -268,12 +272,26 @@ layout("/mobile/platform.html"){
}
},
methods: {
/**
* 重新答题
*/
againQuestion() {
vant.Dialog.confirm({
title: '温馨提示',
message: '确定要重新答题吗?',
}).then(() => {
pjaxReplace('/platform/h5/qsv/quiz?id=' + this.activity.id)
}).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()
this.getHistoryQuestion()
}
})
},
@@ -305,16 +323,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
}
}
})
}