Files
zhgh_hhu/target/classes/views/mobile/wmhd/statistics.html
T
2026-09-20 15:46:34 +08:00

322 lines
13 KiB
HTML

<!--#
layout("/mobile/platform.html"){
#-->
<style>
.register-icon {
position: absolute;
bottom: 8px;
right: 16px;
z-index: 1;
}
</style>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar
@click-left="history.go(-1)"
fixed
left-arrow
placeholder
title="作品列表"
></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item :options="yearOption" @change="yearChange"
v-model="pageForm.year"></van-dropdown-item>
<van-dropdown-item :options="hdxxlist" @change="hdlbchange();"
v-model="pageForm.hdid"></van-dropdown-item>
<van-dropdown-item :options="hdlblist" @change="onRefresh()"
v-model="pageForm.hdlb"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 60px auto">
<van-list
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
@load="onLoad"
v-model="mLoading">
<div class="list-card" v-for="o in tableData">
<van-cell-group inset>
<van-cell :border="false" title="姓名">{{o.sbrname}}</van-cell>
<van-cell :border="false" title="工号">{{o.loginname}}</van-cell>
<van-cell :border="false" title="单位">{{o.dwname}}</van-cell>
<van-cell :border="false" title="工会">{{o.ghname}}</van-cell>
<van-cell :border="false" title="活动类别">{{o.hdlbname}}</van-cell>
<van-cell :border="false" title="作品类别" v-if="o.zplbname">{{o.zplbname}}
</van-cell>
<van-cell :border="false" title="上传时间">{{o.hdsbsj}}</van-cell>
<van-cell :border="false" title="总点赞数">{{o.dz_znum}}次</van-cell>
<van-field readonly :value="o.hdsbzpms" label="创作说明"
input-align="left"
style="flex-flow: column"
rows="2" type="textarea" show-word-limit autosize></van-field>
<van-field label="作品" style="flex-flow: column" input-align="left">
<template #input>
<vant-file-upload :files.sync="o.files" view :del="false"
v-if="o.files&&o.files.length>0"></vant-file-upload>
<div v-if="o.files.length===0"
style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有照片。
</div>
</template>
</van-field>
<!-- <van-cell :border="false" title="审核状态">
<span :style="'color:'+o.statecolor">{{o.statename}}</span>
</van-cell>-->
<van-cell>
<div style="display: flex;justify-content: flex-end;">
<van-button :color="themeColor" round disabled
style="width: 90px;height: 30px;" v-if="o.dz_num>0">
已点赞
</van-button>
<div style="display: flex;justify-content: center;"
v-if="o.dzjssj&&moment().valueOf()>moment(o.dzkssj).valueOf()&&moment().valueOf()<moment(o.dzjssj).valueOf()">
<van-button :color="themeColor" round @click.stop="doDz(o.id)"
style="width: 90px;height: 30px;" v-if="o.dz_num<=0">
点赞
</van-button>
</div>
<van-button :color="themeColor" @click.stop="openView(o)" round
style="width: 90px;height: 30px;margin-left: 5px">
查看
</van-button>
</div>
</van-cell>
</van-cell-group>
</div>
</van-list>
<van-empty
class="custom-image"
description="暂无数据"
image="/none.svg"
v-if="mLoading==false&&tableData.length==0"
></van-empty>
</div>
<van-popup :style="{ height: '100%',width:'100%' }" position="right"
v-model="viewShow">
<van-nav-bar @click-left="viewShow=false" fixed left-arrow placeholder
title="详细信息"></van-nav-bar>
<mobile-wmhd-info handle ref="minfo">
<template #handle>
<div style="display: flex;justify-content: center;"
v-if="zpData.dzjssj&&moment().valueOf()>moment(zpData.dzkssj).valueOf()&&moment().valueOf()<moment(zpData.dzjssj).valueOf()">
<van-button :color="themeColor" @click.stop="doDz" round
style="width: 80%" v-if="zpData.zpDzNum<1">
点赞
</van-button>
<van-button :color="themeColor" disabled round
style="width: 80%" v-else>
已点赞
</van-button>
</div>
</template>
</mobile-wmhd-info>
</van-popup>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/mobile/wmhd/apply">教工作品征集</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/mobile/wmhd/list">我的教工作品
</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/mobile/wmhd/statistics">点赞教工作品
</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
viewShow: false,
tarBarActive: 2,
yearOption: [],
pageForm: {
pageNumber: 1,
pageSize: 5,
year: '',
hdtype: 1,
},
yearActivityList: [],
hdxxlist: [],
hdlblist: [],
zpData: {}
}
},
components: {
'mobile-wmhd-info': httpVueLoader('/components/mobile/wmhd/info.vue?v=' + new Date().getTime()),
},
methods: {
async doDz(id) {
const toast1 = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '加载中...',
})
if ("${@shiro.getPrincipalProperty('loginname')}" === this.zpData.loginname) {
vant.Dialog.alert({
title: '温馨提示',
message: '自己暂时不能给自己点赞哦!',
}).then(() => {
// on close
});
return
}
const hd = this.hdxxlist.find(h => h.value === this.pageForm.hdid)
const dzNum = await this.findDzNum(hd.value)
toast1.clear()
if (dzNum >= hd.dzNum) {
vant.Dialog.alert({
title: '温馨提示',
message: '您当前活动,今日点赞次数已满' + hd.dzNum + '次,请明日在进行点赞',
}).then(() => {
// on close
});
return
}
vant.Dialog.confirm({
title: '温馨提示',
message: '点赞后不能取消,您确定要给当前作品点赞吗?',
}).then(async () => {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const resp = await $.post('/mobile/wmhd/statistics/doDz', {
id: this.zpData.id ? this.zpData.id : id,
hdid: hd.value
})
if (resp.code === 0) {
await this.findDzByZpId(this.zpData.id)
this.tableData.map(t => {
if (t.id === (this.zpData.id ? this.zpData.id : id)) {
t.dz_num = 1
t.dz_znum = t.dz_znum + 1
}
})
setTimeout(async () => {
toast.clear()
vant.Toast.success('点赞成功');
}, 700)
} else {
vant.Toast.fail(resp.msg);
}
})
},
async findDzNum(hdid) {
const resp = await $.post('/mobile/wmhd/statistics/findDzNum', {hdid})
return resp.data
},
async findDzByZpId(id) {
const resp = await $.post('/mobile/wmhd/statistics/findDzByZpId', {id})
this.$set(this.zpData, "zpDzNum", resp.data)
},
async onRefresh() {
this.tableData = []
this.refreshing = true;
this.finished = false;
this.pageForm.pageNumber = 1
this.loading = true;
await this.onLoad();
},
async yearChange() {
const activityList = this.yearActivityList.find(y => y.value === this.pageForm.year)
if (activityList && activityList.children.length > 0) {
activityList.children.map(h => {
h.text = h.label
})
this.hdxxlist = activityList.children
this.$set(this.pageForm, "hdid", this.hdxxlist[0].value)
} else {
this.hdxxlist = []
this.$set(this.pageForm, "hdid", null)
}
await this.onRefresh()
},
async onLoad() {
this.mLoading = true
$.post('/mobile/wmhd/statistics/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.mLoading = false
})
},
async openView(o) {
this.zpData = o
await this.findDzByZpId(o.id)
this.viewShow = true
setTimeout(() => {
this.$refs.minfo.getInfo(o.id)
}, 300)
},
async initHdxxlist() {
const data = await $.post('/mobile/wmhd/statistics/initHdxxlist')
if (data.code == 0) {
this.yearActivityList = data.data
}
},
async hdlbchange() {
this.$set(this.pageForm, 'zplb', '');
const data = await $.post('/platform/hd/childhd/zpxx/gethdlblist', {id: this.pageForm.hdid})
if (data.code === 0) {
data.data.map(h => {
h.text = h.lname
h.value = h.lid
})
this.hdlblist = data.data;
}
},
},
async created() {
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearOption.unshift({value: i, text: i + '年'},)
}
this.$set(this.pageForm, "year", this.yearOption[0].value)
setTimeout(async () => {
await this.initHdxxlist()
this.yearChange()
this.hdlbchange()
}, 300)
}
})
</script>
<!--#
}
#-->