Files
zhgh_hrbnu/src/main/resources/views/mobile/question/index.html
T
2025-04-03 17:51:01 +08:00

94 lines
2.9 KiB
HTML

<!--#
layout("/mobile/platform.html"){
#-->
<style>
#app {
height: 100%;
}
.cell-card {
padding: 20px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
width: 90%;
margin: 20px auto;
border-radius: 20px;
}
.text-overflow {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
</style>
<div id="app" v-cloak>
<van-nav-bar title="问卷调查" left-arrow placeholder fixed @click-left="pjaxReplace('/mobile/index')"></van-nav-bar>
<div>
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list v-model="loading" :finished="finished" :finished-text="tableData.length>0?'没有更多了':''" @load="onLoad">
<van-cell v-for="item in tableData" class="cell-card" @click="openView(item.qid)">
<div class="text-overflow" style="font-weight: bold">{{item.qtitle}}</div>
<div style="font-size: 12px" v-html="item.qsm"></div>
</van-cell>
</van-list>
</van-pull-refresh>
<van-empty v-if="tableData.length==0" class="custom-image" image="/none.svg" description="暂无数据"></van-empty>
</div>
</div>
<script>
new Vue({
el: "#app",
data() {
return {
list: [],
loading: false,
finished: false,
refreshing: false,
pageForm: {
pageNumber: 1,
pageSize: 5,
totalCount: 0
},
tableData: [],
appid: "wx9fd2b07ea126f9f6",
redirect_uri: location.protocol + "//" + location.host
}
},
methods: {
async onRefresh() {
this.tableData = []
this.pageForm = {
pageNumber: 1,
pageSize: 5,
totalCount: 0
}
await this.onLoad()
setTimeout(() => {
this.refreshing = false
}, 1000)
},
async onLoad() {
this.loading = true
$.post("/mobile/question/list/pageData", this.pageForm).then((res) => {
this.loading = false
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++
}
}
})
},
openView(id) {
window.location.href = this.redirect_uri + "/platform/zgfw/mobile/questionnaire?qid=" + id
}
},
created() {}
})
</script>
<!--#
}
#-->