..
This commit is contained in:
@@ -25,12 +25,6 @@ import org.nutz.mvc.annotation.Param;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName H5EduController
|
|
||||||
* @Description 移动端教育培训控制器
|
|
||||||
* @Author AI Assistant
|
|
||||||
* @Date 2024/01/01
|
|
||||||
*/
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@IocBean
|
@IocBean
|
||||||
@At("/platform/h5/edu")
|
@At("/platform/h5/edu")
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@ public class ProposalDelegationController {
|
|||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At("/h5")
|
||||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/delegation/index.html")
|
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/delegation/index.html")
|
||||||
@SaCheckPermission("proposal.delegation")
|
@SaCheckPermission("proposal.delegation")
|
||||||
public void h5Index() {
|
public void h5Index() {
|
||||||
|
|||||||
+1
-1
@@ -46,7 +46,7 @@ public class ProposalFeedbackEvaluationController {
|
|||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At("/h5")
|
||||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/feedbackEvaluation/index.html")
|
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/feedbackEvaluation/index.html")
|
||||||
@SaCheckPermission("proposal.feedbackEvaluation")
|
@SaCheckPermission("proposal.feedbackEvaluation")
|
||||||
public void h5Index() {
|
public void h5Index() {
|
||||||
|
|||||||
+1
-1
@@ -67,7 +67,7 @@ public class ProposalMineController {
|
|||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At("/h5")
|
||||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/mine/index.html")
|
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/mine/index.html")
|
||||||
@SaCheckPermission("proposal.mine")
|
@SaCheckPermission("proposal.mine")
|
||||||
public void h5Index() {
|
public void h5Index() {
|
||||||
|
|||||||
+1
-1
@@ -50,7 +50,7 @@ public class ProposalSchoolLeaderApprovalController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At("/h5")
|
||||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/schoolLeaderApproval/index.html")
|
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/schoolLeaderApproval/index.html")
|
||||||
@SaCheckPermission("proposal.schoolLeaderApproval")
|
@SaCheckPermission("proposal.schoolLeaderApproval")
|
||||||
public void h5Index() {
|
public void h5Index() {
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ public class ProposalSecondedController {
|
|||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At("/h5")
|
||||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/seconded/index.html")
|
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/seconded/index.html")
|
||||||
@SaCheckPermission("proposal.seconded")
|
@SaCheckPermission("proposal.seconded")
|
||||||
public void h5Index() {
|
public void h5Index() {
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ public class ProposalUnderTakeReplyController {
|
|||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At("/h5")
|
||||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/unitReply/index.html")
|
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/unitReply/index.html")
|
||||||
@SaCheckPermission("proposal.unitReply")
|
@SaCheckPermission("proposal.unitReply")
|
||||||
public void h5Index() {
|
public void h5Index() {
|
||||||
|
|||||||
+1
-3
@@ -15,7 +15,6 @@ import com.budwk.app.sys.models.Sys_dict;
|
|||||||
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
|
||||||
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
import com.budwk.app.zhgh.democratic.proposal.models.ProposalInfo;
|
||||||
import com.budwk.app.zhgh.democratic.proposal.service.ProposalWriteService;
|
import com.budwk.app.zhgh.democratic.proposal.service.ProposalWriteService;
|
||||||
import com.budwk.app.zhgh.democratic.suggestionBox.models.SuggestionBox;
|
|
||||||
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
import com.budwk.app.zhgh.democratic.teachercongress.delegate.models.Teacher_congress_delegate;
|
||||||
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
|
import com.budwk.app.zhgh.democratic.teachercongress.prepare.models.Teacher_congress_session;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -30,7 +29,6 @@ import org.nutz.ioc.loader.annotation.IocBean;
|
|||||||
import org.nutz.mvc.annotation.At;
|
import org.nutz.mvc.annotation.At;
|
||||||
import org.nutz.mvc.annotation.Ok;
|
import org.nutz.mvc.annotation.Ok;
|
||||||
import org.nutz.mvc.annotation.Param;
|
import org.nutz.mvc.annotation.Param;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -59,7 +57,7 @@ public class ProposalWriteController {
|
|||||||
public void index() {
|
public void index() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@At
|
@At("/h5")
|
||||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/write/index.html")
|
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/write/index.html")
|
||||||
@SaCheckPermission("proposal.write")
|
@SaCheckPermission("proposal.write")
|
||||||
public void h5Index(){
|
public void h5Index(){
|
||||||
|
|||||||
-21
@@ -1,21 +0,0 @@
|
|||||||
package com.budwk.app.zhgh.democratic.proposal.h5controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
|
||||||
import org.nutz.mvc.annotation.At;
|
|
||||||
import org.nutz.mvc.annotation.Ok;
|
|
||||||
|
|
||||||
@IocBean
|
|
||||||
@At("/platform/h5/proposal/delegation")
|
|
||||||
@Ok("json:full")
|
|
||||||
@Api("h5提案附议")
|
|
||||||
public class H5ProposalDelegationController {
|
|
||||||
|
|
||||||
@At("")
|
|
||||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/delegation/index.html")
|
|
||||||
@SaCheckPermission("h5.proposal.delegation")
|
|
||||||
public void index() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-21
@@ -1,21 +0,0 @@
|
|||||||
package com.budwk.app.zhgh.democratic.proposal.h5controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
|
||||||
import org.nutz.mvc.annotation.At;
|
|
||||||
import org.nutz.mvc.annotation.Ok;
|
|
||||||
|
|
||||||
@IocBean
|
|
||||||
@At("/platform/h5/proposal/mine")
|
|
||||||
@Ok("json:full")
|
|
||||||
@Api("h5我的提案")
|
|
||||||
public class H5ProposalMineController {
|
|
||||||
|
|
||||||
@At("")
|
|
||||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/mine/index.html")
|
|
||||||
@SaCheckPermission("h5.proposal.mine")
|
|
||||||
public void index() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-21
@@ -1,21 +0,0 @@
|
|||||||
package com.budwk.app.zhgh.democratic.proposal.h5controller;
|
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import org.nutz.ioc.loader.annotation.IocBean;
|
|
||||||
import org.nutz.mvc.annotation.At;
|
|
||||||
import org.nutz.mvc.annotation.Ok;
|
|
||||||
|
|
||||||
@IocBean
|
|
||||||
@At("/platform/h5/proposal/seconded")
|
|
||||||
@Ok("json:full")
|
|
||||||
@Api("h5提案附议")
|
|
||||||
public class H5ProposalSecondedController {
|
|
||||||
|
|
||||||
@At("")
|
|
||||||
@Ok("beetl:/platform/zhghh5/democratic/proposal/transact/seconded/index.html")
|
|
||||||
@SaCheckPermission("h5.proposal.seconded")
|
|
||||||
public void index() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,201 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="file-preview-container" v-if="fileList && fileList.length > 0">
|
||||||
|
<div class="file-item" v-for="item in fileList" :key="item.id">
|
||||||
|
<img
|
||||||
|
v-if="item.suffix === 'jpg' || item.suffix === 'png' || item.suffix === 'jpeg' || item.suffix === 'gif'"
|
||||||
|
:src="item.thumbnail"
|
||||||
|
@click.stop="$commonUtil.previewFile(item)"
|
||||||
|
class="file-image"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<img
|
||||||
|
v-else
|
||||||
|
:src="$commonUtil.getFileItemShowIcon(item.suffix)"
|
||||||
|
@click.stop="$commonUtil.previewFile(item)"
|
||||||
|
class="file-image"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div class="file-download" @click="$downLoad(item.downloadPath)">
|
||||||
|
<i class="el-icon-download"></i>
|
||||||
|
{{ item.name }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-else class="empty-container">
|
||||||
|
<div class="empty-text">暂无</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
module.exports = {
|
||||||
|
name: "H5Index",
|
||||||
|
props: {
|
||||||
|
files: {
|
||||||
|
type: [String, Array],
|
||||||
|
default: undefined,
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
complete_result: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
required: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
files: {
|
||||||
|
handler(val) {
|
||||||
|
if (val) {
|
||||||
|
this.buildEchoFileObject(val)
|
||||||
|
} else {
|
||||||
|
this.fileList = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
fileList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
buildEchoFileObject(val) {
|
||||||
|
let ids = []
|
||||||
|
if (this.complete_result) {
|
||||||
|
if (Array.isArray(val)) {
|
||||||
|
ids = val.map((item) => {
|
||||||
|
if (item.response.data.includes("=")) {
|
||||||
|
return item?.response?.data.substring(item?.response?.data.lastIndexOf("=") + 1)
|
||||||
|
} else {
|
||||||
|
return item?.response?.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
ids = JSON.parse(val).map((item) => {
|
||||||
|
if (item.response.data.includes("=")) {
|
||||||
|
return item?.response?.data.substring(item?.response?.data.lastIndexOf("=") + 1)
|
||||||
|
} else {
|
||||||
|
return item?.response?.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
this.fileList = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//那就是链接 没有直接存id的吧。。
|
||||||
|
if (Array.isArray(val)) {
|
||||||
|
ids = val.map((item) => {
|
||||||
|
return item.substring(item.lastIndexOf("=") + 1)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
ids = val.split(",").map((item) => {
|
||||||
|
return item.substring(item.lastIndexOf("=") + 1)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.requestFullFile(ids)
|
||||||
|
},
|
||||||
|
|
||||||
|
requestFullFile(ids) {
|
||||||
|
this.$axios.post("/platform/sys/file/previewFileData", {ids: JSON.stringify(ids)}).then((res) => {
|
||||||
|
if (res.code === 0) {
|
||||||
|
this.fileList = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.file-preview-container {
|
||||||
|
position: relative;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
gap: 8px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-preview-container .file-item {
|
||||||
|
aspect-ratio: 1;
|
||||||
|
position: relative;
|
||||||
|
transition: all 300ms;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
text-align: center;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background: #f8f9fa;
|
||||||
|
border: 1px solid #e9ecef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-preview-container .file-item:active {
|
||||||
|
background: #e9ecef;
|
||||||
|
transform: scale(0.98);
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-preview-container .file-item .file-image {
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
object-fit: cover;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-preview-container .file-item .file-download {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 28px;
|
||||||
|
line-height: 28px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
color: white;
|
||||||
|
background-color: rgba(0, 0, 0, 0.7);
|
||||||
|
border-radius: 0 0 8px 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 0 8px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 120px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-text {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 响应式设计 */
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
.file-preview-container {
|
||||||
|
gap: 4px;
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-preview-container .file-item .file-image {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-preview-container .file-item .file-download {
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -39,6 +39,10 @@
|
|||||||
<script src="${base!}/assets/platform/plugins/form-create/form-create.min.js?v=0.0.1"></script>
|
<script src="${base!}/assets/platform/plugins/form-create/form-create.min.js?v=0.0.1"></script>
|
||||||
<script src="${base!}/assets/platform/plugins/form-create/designer/index.umd.js"></script>
|
<script src="${base!}/assets/platform/plugins/form-create/designer/index.umd.js"></script>
|
||||||
|
|
||||||
|
<!--图片预览-->
|
||||||
|
<link rel="stylesheet" href="${base!}/assets/platform/plugins/viewerjs/viewer.css" />
|
||||||
|
<script src="${base!}/assets/platform/plugins/viewerjs/viewer.js"></script>
|
||||||
|
|
||||||
<script src="${base!}/components/plugins/sysDict/DictData.js"></script>
|
<script src="${base!}/components/plugins/sysDict/DictData.js"></script>
|
||||||
<script src="${base!}/assets/platform/js/util/commonUtil.js"></script>
|
<script src="${base!}/assets/platform/js/util/commonUtil.js"></script>
|
||||||
<script src="${base!}/assets/platform/js/main.js"></script>
|
<script src="${base!}/assets/platform/js/main.js"></script>
|
||||||
@@ -145,17 +149,20 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function historyBack() {
|
function historyBack(func) {
|
||||||
if (window.history.length > 1) {
|
if (window.history.length > 1) {
|
||||||
window.history.back()
|
window.history.back()
|
||||||
} else {
|
} else {
|
||||||
window.location.href = "/platform/h5/home"
|
window.location.href = "/platform/h5/home"
|
||||||
}
|
}
|
||||||
|
func && func()
|
||||||
}
|
}
|
||||||
|
|
||||||
Vue.mixin({
|
Vue.mixin({
|
||||||
methods: {
|
methods: {
|
||||||
historyBack: historyBack
|
historyBack: function(func) {
|
||||||
|
historyBack(func);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
@@ -353,6 +360,7 @@
|
|||||||
//挂载
|
//挂载
|
||||||
Vue.prototype.$moment = moment
|
Vue.prototype.$moment = moment
|
||||||
Vue.prototype.$businessTool = businessTool
|
Vue.prototype.$businessTool = businessTool
|
||||||
|
Vue.prototype.$commonUtil = commonUtil
|
||||||
Vue.prototype.$auth = commonUtil.authService()
|
Vue.prototype.$auth = commonUtil.authService()
|
||||||
Vue.prototype.$axios = commonUtil.axiosService()
|
Vue.prototype.$axios = commonUtil.axiosService()
|
||||||
Vue.prototype.$downLoad = commonUtil.downLoadService.bind(commonUtil)
|
Vue.prototype.$downLoad = commonUtil.downLoadService.bind(commonUtil)
|
||||||
@@ -371,6 +379,7 @@
|
|||||||
Vue.component("enum-tag", httpVueLoader("/components/plugins/sysEnum/EnumTag.vue?v=" + new Date().getTime()))
|
Vue.component("enum-tag", httpVueLoader("/components/plugins/sysEnum/EnumTag.vue?v=" + new Date().getTime()))
|
||||||
Vue.component("table-list", httpVueLoader("/components/plugins/h5/TableList.vue?v=" + new Date().getTime()))
|
Vue.component("table-list", httpVueLoader("/components/plugins/h5/TableList.vue?v=" + new Date().getTime()))
|
||||||
Vue.component("table-column", httpVueLoader("/components/plugins/h5/TableColumn.vue?v=" + new Date().getTime()))
|
Vue.component("table-column", httpVueLoader("/components/plugins/h5/TableColumn.vue?v=" + new Date().getTime()))
|
||||||
|
Vue.component("file-preview", httpVueLoader("/components/plugins/sysFilePreview/H5Index.vue?v=" + new Date().getTime()))
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ layout("/layouts/platform.html"){
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<!--#include("/layouts/pagination.html"){}#-->
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-dialog :visible.sync="formDialogVisible" :title="formData.id ? '编辑模块' : '添加模块'">
|
<el-dialog :visible.sync="formDialogVisible" :title="formData.id ? '编辑模块' : '添加模块'">
|
||||||
|
|||||||
@@ -25,13 +25,13 @@ const PROPOSAL_INFO = {
|
|||||||
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT"
|
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT"
|
||||||
:value="viewData.caseFilingResult"></dict-tag>
|
:value="viewData.caseFilingResult"></dict-tag>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="提案摘要" :span="3">
|
<el-descriptions-item label="调研情况" :span="3">
|
||||||
<div class="text-left">{{viewData.excerpt}}</div>
|
<div class="text-left">{{viewData.researchFindings}}</div>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="提案内容" :span="3">
|
<el-descriptions-item label="提案案由" :span="3">
|
||||||
<div class="text-left" v-html="viewData.brief"></div>
|
<div class="text-left" v-html="viewData.brief"></div>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="改进建议和措施" :span="3">
|
<el-descriptions-item label="建议措施" :span="3">
|
||||||
<div class="text-left" v-html="viewData.measures"></div>
|
<div class="text-left" v-html="viewData.measures"></div>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="附件" :span="3">
|
<el-descriptions-item label="附件" :span="3">
|
||||||
|
|||||||
@@ -2,6 +2,157 @@
|
|||||||
layout("/layouts/platform_h5.html"){
|
layout("/layouts/platform_h5.html"){
|
||||||
#-->
|
#-->
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.course-cover {
|
||||||
|
width: 100%;
|
||||||
|
height: 200px;
|
||||||
|
background: linear-gradient(45deg, #f0f2f5, #e9ecef);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-cover .van-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-info {
|
||||||
|
padding: 16px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-info .van-cell-group {
|
||||||
|
padding: 20px;
|
||||||
|
background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-title {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1a1a1a;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
line-height: 1.3;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-desc {
|
||||||
|
font-size: 15px;
|
||||||
|
color: #555;
|
||||||
|
line-height: 1.7;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-meta {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 13px;
|
||||||
|
padding-top: 16px;
|
||||||
|
border-top: 1px solid #f0f0f0;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-date {
|
||||||
|
color: #888;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-section {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-container .van-progress {
|
||||||
|
flex: 1;
|
||||||
|
margin-right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.progress-text {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333;
|
||||||
|
min-width: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapters-section {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapter-card {
|
||||||
|
background: #fff;
|
||||||
|
border: 1px solid #f0f0f0;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapter-header {
|
||||||
|
padding: 16px;
|
||||||
|
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
|
||||||
|
border-bottom: 1px solid #f0f0f0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapter-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #333;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapter-videos {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 12px 16px;
|
||||||
|
border-bottom: 1px solid #f8f9fa;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item:hover {
|
||||||
|
background-color: #f8f9fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-item:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-icon {
|
||||||
|
margin-right: 12px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-content {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-title {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-duration {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-status {
|
||||||
|
margin-left: 8px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<div id="app" v-cloak>
|
<div id="app" v-cloak>
|
||||||
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="课程详情" placeholder fixed></van-nav-bar>
|
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="课程详情" placeholder fixed></van-nav-bar>
|
||||||
|
|
||||||
@@ -17,7 +168,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<van-icon name="photo-fail" size="48" color="#ddd"></van-icon>
|
<van-icon name="photo-fail" size="48" color="#ddd"></van-icon>
|
||||||
</template>
|
</template>
|
||||||
</van-image>
|
</van-image>
|
||||||
<van-icon v-else name="graduation" size="48" color="#ddd" ></van-icon>
|
<van-icon v-else name="graduation" size="48" color="#ddd"></van-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 课程信息 -->
|
<!-- 课程信息 -->
|
||||||
@@ -35,7 +186,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<van-cell>
|
<van-cell>
|
||||||
<template #default>
|
<template #default>
|
||||||
<div class="progress-container">
|
<div class="progress-container">
|
||||||
<van-progress :percentage="progressPercentage" stroke-width="6" color="#1989fa" />
|
<van-progress :percentage="progressPercentage" stroke-width="6"></van-progress>
|
||||||
<span class="progress-text">{{ progressPercentage }}%</span>
|
<span class="progress-text">{{ progressPercentage }}%</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -43,227 +194,156 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
|
|
||||||
<!-- 课程章节 -->
|
<!-- 课程章节 -->
|
||||||
<van-cell-group title="课程章节" class="chapters-section">
|
<div class="chapters-section">
|
||||||
<van-collapse v-model="activeChapters">
|
<h3 style="margin: 0 0 16px 0; padding-left:16px;font-size: 16px; font-weight: 600; color: #333;">课程章节</h3>
|
||||||
<van-collapse-item
|
|
||||||
v-for="(chapter, index) in course.chapters"
|
<div v-if="course.chapters && course.chapters.length">
|
||||||
:key="chapter.id"
|
<div
|
||||||
:name="index"
|
v-for="(chapter, index) in course.chapters"
|
||||||
:title="chapter.title || `第${index + 1}章`"
|
v-if="chapter.videos && chapter.videos.length"
|
||||||
|
:key="chapter.id"
|
||||||
|
class="chapter-card"
|
||||||
>
|
>
|
||||||
<van-cell
|
<div class="chapter-header">
|
||||||
v-for="video in chapter.videos"
|
<h4 class="chapter-title">{{ chapter.title || '第' + (index + 1) + '章' }}</h4>
|
||||||
:key="video.id"
|
</div>
|
||||||
:title="video.title || '未命名视频'"
|
|
||||||
:label="formatDuration(video.duration)"
|
<div class="chapter-videos">
|
||||||
is-link
|
<div
|
||||||
@click="playVideo(video.id, video.title)"
|
v-for="video in chapter.videos"
|
||||||
>
|
:key="video.id"
|
||||||
<template #icon>
|
class="video-item"
|
||||||
<van-icon
|
@click="playVideo(video.id, video.title)"
|
||||||
:name="isVideoCompleted(video.id) ? 'success' : 'play-circle-o'"
|
>
|
||||||
:color="isVideoCompleted(video.id) ? '#07c160' : '#1989fa'"
|
<div class="video-icon">
|
||||||
/>
|
<van-icon
|
||||||
</template>
|
:name="isVideoCompleted(video.id) ? 'success' : 'play-circle-o'"
|
||||||
<template #right-icon v-if="isVideoCompleted(video.id)">
|
:color="isVideoCompleted(video.id) ? '#07c160' : '#1989fa'"
|
||||||
<van-tag type="success" size="mini">已完成</van-tag>
|
size="20"
|
||||||
</template>
|
></van-icon>
|
||||||
</van-cell>
|
</div>
|
||||||
<van-empty v-if="!chapter.videos || !chapter.videos.length" description="暂无视频" />
|
|
||||||
</van-collapse-item>
|
<div class="video-content">
|
||||||
</van-collapse>
|
<div class="video-title">{{ video.title || '未命名视频' }}</div>
|
||||||
<van-empty v-if="!course.chapters || !course.chapters.length" description="暂无章节内容" />
|
<div class="video-duration">{{ formatDuration(video.duration) }}</div>
|
||||||
</van-cell-group>
|
</div>
|
||||||
|
|
||||||
|
<div class="video-status" v-if="isVideoCompleted(video.id)">
|
||||||
|
<van-tag type="success" size="mini">已完成</van-tag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<van-empty v-else description="暂无章节内容" style="padding: 40px 20px;"></van-empty>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<van-empty v-else description="课程不存在" />
|
<van-empty v-else description="课程不存在"></van-empty>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
|
||||||
.loading-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 200px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-cover {
|
|
||||||
width: 100%;
|
|
||||||
height: 200px;
|
|
||||||
background: linear-gradient(45deg, #f0f2f5, #e9ecef);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-cover .van-image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-info {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-info .van-cell-group {
|
|
||||||
padding: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-title {
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
line-height: 1.4;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-desc {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #666;
|
|
||||||
line-height: 1.6;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-meta {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 12px;
|
|
||||||
padding-top: 12px;
|
|
||||||
border-top: 1px solid #eee;
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-date {
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progress-section {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progress-container {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progress-container .van-progress {
|
|
||||||
flex: 1;
|
|
||||||
margin-right: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progress-text {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #333;
|
|
||||||
min-width: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.chapters-section {
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const vue = new Vue({
|
const vue = new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
store,
|
store,
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
course: null,
|
course: null,
|
||||||
loading: true,
|
loading: true,
|
||||||
courseId: null,
|
courseId: null,
|
||||||
activeChapters: [],
|
activeChapters: [],
|
||||||
progressData: null
|
progressData: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
progressPercentage() {
|
progressPercentage() {
|
||||||
if (!this.progressData || !this.progressData.totalVideos) return 0;
|
if (!this.progressData || !this.progressData.totalVideos) return 0;
|
||||||
return Math.round(this.progressData.completedVideos / this.progressData.totalVideos * 100);
|
return Math.round(this.progressData.completedVideos / this.progressData.totalVideos * 100);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
historyBack,
|
historyBack,
|
||||||
|
|
||||||
|
// 加载课程详情
|
||||||
|
async loadCourseDetail() {
|
||||||
|
if (!this.courseId) {
|
||||||
|
this.$toast.fail('缺少课程ID参数');
|
||||||
|
this.loading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const {code, data, msg} = await $.get('/platform/h5/edu/course/detail/data', {
|
||||||
|
courseId: this.courseId
|
||||||
|
});
|
||||||
|
|
||||||
|
if (code === 0 && data) {
|
||||||
|
this.course = data;
|
||||||
|
this.loadCourseProgress();
|
||||||
|
} else {
|
||||||
|
this.$toast.fail(msg || '加载课程详情失败');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
this.$toast.fail('网络错误');
|
||||||
|
}
|
||||||
|
|
||||||
// 加载课程详情
|
|
||||||
async loadCourseDetail() {
|
|
||||||
if (!this.courseId) {
|
|
||||||
this.$toast.fail('缺少课程ID参数');
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
return;
|
},
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
// 加载课程进度
|
||||||
const { code, data, msg } = await $.get('/platform/h5/edu/course/detail/data', {
|
async loadCourseProgress() {
|
||||||
courseId: this.courseId
|
try {
|
||||||
});
|
const {code, data} = await $.get('/platform/h5/edu/course/progress', {
|
||||||
|
courseId: this.courseId
|
||||||
|
});
|
||||||
|
|
||||||
if (code === 0 && data) {
|
if (code === 0 && data) {
|
||||||
this.course = data;
|
this.progressData = data;
|
||||||
this.loadCourseProgress();
|
}
|
||||||
} else {
|
} catch (error) {
|
||||||
this.$toast.fail(msg || '加载课程详情失败');
|
console.error('加载进度失败:', error);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
},
|
||||||
this.$toast.fail('网络错误');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loading = false;
|
// 检查视频是否已完成
|
||||||
},
|
isVideoCompleted(videoId) {
|
||||||
|
return this.progressData &&
|
||||||
|
this.progressData.completedVideoIds &&
|
||||||
|
this.progressData.completedVideoIds.includes(videoId);
|
||||||
|
},
|
||||||
|
|
||||||
// 加载课程进度
|
// 播放视频
|
||||||
async loadCourseProgress() {
|
playVideo(videoId, videoTitle) {
|
||||||
try {
|
pjaxReplace('/platform/h5/edu/video/play?videoId=' + videoId + '&courseId=' + this.courseId + '&title=' + encodeURIComponent(videoTitle || ''));
|
||||||
const { code, data } = await $.get('/platform/h5/edu/course/progress', {
|
},
|
||||||
courseId: this.courseId
|
|
||||||
});
|
|
||||||
|
|
||||||
if (code === 0 && data) {
|
// 格式化日期
|
||||||
this.progressData = data;
|
formatDate(dateStr) {
|
||||||
}
|
if (!dateStr) return '';
|
||||||
} catch (error) {
|
const date = new Date(dateStr);
|
||||||
console.error('加载进度失败:', error);
|
return date.getFullYear() + '-' +
|
||||||
|
String(date.getMonth() + 1).padStart(2, '0') + '-' +
|
||||||
|
String(date.getDate()).padStart(2, '0');
|
||||||
|
},
|
||||||
|
|
||||||
|
// 格式化时长
|
||||||
|
formatDuration(seconds) {
|
||||||
|
if (!seconds) return '00:00';
|
||||||
|
const minutes = Math.floor(seconds / 60);
|
||||||
|
const remainingSeconds = seconds % 60;
|
||||||
|
return String(minutes).padStart(2, '0') + ':' + String(remainingSeconds).padStart(2, '0');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 检查视频是否已完成
|
mounted() {
|
||||||
isVideoCompleted(videoId) {
|
// 获取URL参数
|
||||||
return this.progressData &&
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
this.progressData.completedVideoIds &&
|
this.courseId = urlParams.get('courseId');
|
||||||
this.progressData.completedVideoIds.includes(videoId);
|
|
||||||
},
|
|
||||||
|
|
||||||
// 播放视频
|
this.loadCourseDetail();
|
||||||
playVideo(videoId, videoTitle) {
|
|
||||||
pjaxReplace(`/platform/h5/edu/video/play?videoId=${videoId}&courseId=${this.courseId}&title=${encodeURIComponent(videoTitle || '')}`);
|
|
||||||
},
|
|
||||||
|
|
||||||
// 格式化日期
|
|
||||||
formatDate(dateStr) {
|
|
||||||
if (!dateStr) return '';
|
|
||||||
const date = new Date(dateStr);
|
|
||||||
return date.getFullYear() + '-' +
|
|
||||||
String(date.getMonth() + 1).padStart(2, '0') + '-' +
|
|
||||||
String(date.getDate()).padStart(2, '0');
|
|
||||||
},
|
|
||||||
|
|
||||||
// 格式化时长
|
|
||||||
formatDuration(seconds) {
|
|
||||||
if (!seconds) return '00:00';
|
|
||||||
const minutes = Math.floor(seconds / 60);
|
|
||||||
const remainingSeconds = seconds % 60;
|
|
||||||
return String(minutes).padStart(2, '0') + ':' + String(remainingSeconds).padStart(2, '0');
|
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
|
|
||||||
mounted() {
|
|
||||||
// 获取URL参数
|
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
|
||||||
this.courseId = urlParams.get('courseId');
|
|
||||||
|
|
||||||
this.loadCourseDetail();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!--#
|
<!--#
|
||||||
|
|||||||
@@ -13,11 +13,6 @@ layout("/layouts/platform_h5.html"){
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.course-item:active {
|
|
||||||
transform: translateY(2px) scale(0.98);
|
|
||||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
|
|
||||||
}
|
|
||||||
|
|
||||||
.course-cover {
|
.course-cover {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
|
|||||||
@@ -2,8 +2,38 @@
|
|||||||
layout("/layouts/platform_h5.html"){
|
layout("/layouts/platform_h5.html"){
|
||||||
#-->
|
#-->
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.video-container {
|
||||||
|
background: #000;
|
||||||
|
min-height: calc(100vh - 46px);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 300px;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-player {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.video-element {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
max-height: calc(100vh - 46px);
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<div id="app" v-cloak>
|
<div id="app" v-cloak>
|
||||||
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" :title="videoTitle" placeholder fixed />
|
<van-nav-bar @click-left="pageBack" left-arrow left-text="返回" :title="videoTitle" placeholder fixed></van-nav-bar>
|
||||||
|
|
||||||
<div class="video-container">
|
<div class="video-container">
|
||||||
<div v-if="loading" class="loading-container">
|
<div v-if="loading" class="loading-container">
|
||||||
@@ -11,13 +41,14 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="videoInfo" class="video-player">
|
<div v-else-if="videoInfo" class="video-player">
|
||||||
<video
|
<video
|
||||||
ref="videoElement"
|
ref="videoElement"
|
||||||
class="video-element"
|
class="video-element"
|
||||||
:src="videoInfo.url"
|
:src="videoInfo.url"
|
||||||
controls
|
controls
|
||||||
preload="metadata"
|
preload="metadata"
|
||||||
@loadedmetadata="onVideoLoaded"
|
@loadedmetadata="onVideoLoaded"
|
||||||
|
@canplay="onVideoCanPlay"
|
||||||
@play="onVideoPlay"
|
@play="onVideoPlay"
|
||||||
@pause="onVideoPause"
|
@pause="onVideoPause"
|
||||||
@timeupdate="onTimeUpdate"
|
@timeupdate="onTimeUpdate"
|
||||||
@@ -28,12 +59,12 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<van-empty v-else description="视频加载失败" />
|
<van-empty v-else description="视频加载失败"></van-empty>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 进度保存提示 -->
|
<!-- 进度保存提示 -->
|
||||||
<van-toast v-model="showProgressToast" message="进度已保存" :duration="1000" />
|
<van-toast v-model="showProgressToast" message="进度已保存" :duration="1000" />
|
||||||
|
|
||||||
<!-- 完成学习弹窗 -->
|
<!-- 完成学习弹窗 -->
|
||||||
<van-dialog
|
<van-dialog
|
||||||
v-model="showCompletionDialog"
|
v-model="showCompletionDialog"
|
||||||
@@ -43,39 +74,9 @@ layout("/layouts/platform_h5.html"){
|
|||||||
cancel-button-text="继续观看"
|
cancel-button-text="继续观看"
|
||||||
confirm-button-text="返回课程"
|
confirm-button-text="返回课程"
|
||||||
@confirm="backToCourse"
|
@confirm="backToCourse"
|
||||||
/>
|
></van-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
|
||||||
.video-container {
|
|
||||||
background: #000;
|
|
||||||
min-height: calc(100vh - 46px);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading-container {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 300px;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-player {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-element {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
max-height: calc(100vh - 46px);
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const vue = new Vue({
|
const vue = new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
@@ -90,11 +91,14 @@ const vue = new Vue({
|
|||||||
isPlaying: false,
|
isPlaying: false,
|
||||||
progressSaveTimer: null,
|
progressSaveTimer: null,
|
||||||
showProgressToast: false,
|
showProgressToast: false,
|
||||||
showCompletionDialog: false
|
showCompletionDialog: false,
|
||||||
|
savedProgress: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
historyBack,
|
pageBack(){
|
||||||
|
this.historyBack(this.clearProgressSave)
|
||||||
|
},
|
||||||
|
|
||||||
// 加载视频信息
|
// 加载视频信息
|
||||||
async loadVideoInfo() {
|
async loadVideoInfo() {
|
||||||
@@ -105,7 +109,7 @@ const vue = new Vue({
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { code, data, msg } = await $.get('${base}/platform/h5/edu/video/detail', {
|
const { code, data, msg } = await this.$axios.post('/platform/h5/edu/video/detail', {
|
||||||
videoId: this.videoId
|
videoId: this.videoId
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -126,7 +130,14 @@ const vue = new Vue({
|
|||||||
|
|
||||||
// 视频加载完成
|
// 视频加载完成
|
||||||
onVideoLoaded() {
|
onVideoLoaded() {
|
||||||
console.log('视频加载完成');
|
console.log('视频元数据加载完成');
|
||||||
|
},
|
||||||
|
|
||||||
|
// 视频可以播放
|
||||||
|
onVideoCanPlay() {
|
||||||
|
console.log('视频可以播放');
|
||||||
|
// 视频可以播放时,设置观看进度
|
||||||
|
this.setWatchProgress();
|
||||||
},
|
},
|
||||||
|
|
||||||
// 视频开始播放
|
// 视频开始播放
|
||||||
@@ -143,6 +154,7 @@ const vue = new Vue({
|
|||||||
|
|
||||||
// 时间更新
|
// 时间更新
|
||||||
onTimeUpdate() {
|
onTimeUpdate() {
|
||||||
|
console.log('时间更新')
|
||||||
// 可以在这里添加进度更新逻辑
|
// 可以在这里添加进度更新逻辑
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -162,31 +174,48 @@ const vue = new Vue({
|
|||||||
if (!this.videoId || !this.courseId) return;
|
if (!this.videoId || !this.courseId) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { code, data } = await $.get('${base}/platform/h5/edu/study/record', {
|
const { code, data } = await this.$axios.post('/platform/h5/edu/study/record', {
|
||||||
videoId: this.videoId
|
videoId: this.videoId
|
||||||
});
|
});
|
||||||
|
|
||||||
if (code === 0 && data && data.watchDuration > 0) {
|
if (code === 0 && data && data.watchedDuration > 0) {
|
||||||
const video = this.$refs.videoElement;
|
this.savedProgress = data.watchedDuration;
|
||||||
if (video) {
|
|
||||||
video.currentTime = data.watchDuration;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载观看进度失败:', error);
|
console.error('加载观看进度失败:', error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 设置观看进度
|
||||||
|
setWatchProgress() {
|
||||||
|
if (this.savedProgress > 0) {
|
||||||
|
const video = this.$refs.videoElement;
|
||||||
|
if (video && video.readyState >= 3) {
|
||||||
|
// 使用setTimeout确保DOM更新完成
|
||||||
|
setTimeout(() => {
|
||||||
|
try {
|
||||||
|
video.currentTime = this.savedProgress;
|
||||||
|
console.log('设置观看进度成功:', this.savedProgress);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('设置观看进度失败:', error);
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
} else {
|
||||||
|
console.log('视频还未准备好,readyState:', video ? video.readyState : 'video不存在');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// 保存观看进度
|
// 保存观看进度
|
||||||
async saveProgress() {
|
async saveProgress() {
|
||||||
const video = this.$refs.videoElement;
|
const video = this.$refs.videoElement;
|
||||||
if (!video || !this.videoId || !this.courseId) return;
|
if (!video || !this.videoId || !this.courseId) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await $.post('${base}/platform/h5/edu/study/progress/save', {
|
await $.post('/platform/h5/edu/study/progress/save', {
|
||||||
videoId: this.videoId,
|
videoId: this.videoId,
|
||||||
courseId: this.courseId,
|
courseId: this.courseId,
|
||||||
watchDuration: Math.floor(video.currentTime)
|
watchedDuration: Math.floor(video.currentTime)
|
||||||
});
|
});
|
||||||
|
|
||||||
this.showProgressToast = true;
|
this.showProgressToast = true;
|
||||||
@@ -216,7 +245,7 @@ const vue = new Vue({
|
|||||||
if (!this.videoId || !this.courseId) return;
|
if (!this.videoId || !this.courseId) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { code } = await $.post('${base}/platform/h5/edu/study/complete', {
|
const { code } = await $.post('/platform/h5/edu/study/complete', {
|
||||||
videoId: this.videoId,
|
videoId: this.videoId,
|
||||||
courseId: this.courseId
|
courseId: this.courseId
|
||||||
});
|
});
|
||||||
@@ -232,7 +261,7 @@ const vue = new Vue({
|
|||||||
// 返回课程
|
// 返回课程
|
||||||
backToCourse() {
|
backToCourse() {
|
||||||
if (this.courseId) {
|
if (this.courseId) {
|
||||||
this.$router.push(`/course/detail?courseId=${this.courseId}`);
|
|
||||||
} else {
|
} else {
|
||||||
this.historyBack();
|
this.historyBack();
|
||||||
}
|
}
|
||||||
@@ -259,4 +288,4 @@ const vue = new Vue({
|
|||||||
|
|
||||||
<!--#
|
<!--#
|
||||||
}
|
}
|
||||||
#-->
|
#-->
|
||||||
|
|||||||
@@ -24,20 +24,18 @@ const PROPOSAL_INFO = {
|
|||||||
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT"
|
<dict-tag :options="dict.type.PROPOSAL_CASE_FILING_RESULT"
|
||||||
:value="viewData.caseFilingResult"></dict-tag>
|
:value="viewData.caseFilingResult"></dict-tag>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell title="提案摘要" class="direction-column-cell">
|
<van-cell title="调研情况" class="direction-column-cell">
|
||||||
<div v-html="viewData.excerpt"></div>
|
<div v-html="viewData.researchFindings"></div>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell title="提案内容" class="direction-column-cell">
|
<van-cell title="提案案由" class="direction-column-cell">
|
||||||
<div v-html="viewData.brief"></div>
|
<div v-html="viewData.brief"></div>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell title="可行性分析" class="direction-column-cell">
|
<van-cell title="建议措施" class="direction-column-cell">
|
||||||
<div v-html="viewData.measures"></div>
|
<div v-html="viewData.measures"></div>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<!-- <van-cell title="附件">
|
<van-cell title="附件" class="direction-column-cell">
|
||||||
<div slot="label">
|
<file-preview :files="viewData.files" complete_result></file-preview>
|
||||||
{{viewData.files}}
|
</van-cell>
|
||||||
</div>
|
|
||||||
</van-cell>-->
|
|
||||||
<!-- <van-cell title="签字">-->
|
<!-- <van-cell title="签字">-->
|
||||||
<!-- <div slot="label">-->
|
<!-- <div slot="label">-->
|
||||||
<!-- <van-image :src="viewData.signature"-->
|
<!-- <van-image :src="viewData.signature"-->
|
||||||
@@ -63,37 +61,40 @@ const PROPOSAL_INFO = {
|
|||||||
<van-cell title="办理用户">{{ task.taskFormData.userName }}({{task.taskFormData.loginName}})
|
<van-cell title="办理用户">{{ task.taskFormData.userName }}({{task.taskFormData.loginName}})
|
||||||
</van-cell>
|
</van-cell>
|
||||||
<van-cell title="办理时间">{{ task.finishTime }}</van-cell>
|
<van-cell title="办理时间">{{ task.finishTime }}</van-cell>
|
||||||
<van-cell title="附议人" v-if="task.taskName === '85b7b9bd-d706-48cb-99a1-ef1370fb1819'" class="direction-column-cell">
|
<van-cell title="附议人" v-if="task.taskName === '85b7b9bd-d706-48cb-99a1-ef1370fb1819'"
|
||||||
|
class="direction-column-cell">
|
||||||
<el-table :data="task?.taskFormData?.seconder">
|
<el-table :data="task?.taskFormData?.seconder">
|
||||||
<el-table-column label="姓名" prop="userName"></el-table-column>
|
<el-table-column label="姓名" prop="userName"></el-table-column>
|
||||||
<el-table-column label="工号" prop="loginName"></el-table-column>
|
<el-table-column label="工号" prop="loginName"></el-table-column>
|
||||||
<el-table-column label="性别" prop="sex"></el-table-column>
|
<el-table-column label="性别" prop="sex"></el-table-column>
|
||||||
<el-table-column label="单位" prop="unitName" show-overflow-tooltip></el-table-column>
|
<el-table-column label="单位" prop="unitName" show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column label="分工会" prop="unionName" show-overflow-tooltip></el-table-column>
|
<el-table-column label="分工会" prop="unionName"
|
||||||
<el-table-column label="代表团" prop="delegationName" show-overflow-tooltip></el-table-column>
|
show-overflow-tooltip></el-table-column>
|
||||||
|
<el-table-column label="代表团" prop="delegationName"
|
||||||
|
show-overflow-tooltip></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- <table>-->
|
<!-- <table>-->
|
||||||
<!-- <thead>-->
|
<!-- <thead>-->
|
||||||
<!-- <tr>-->
|
<!-- <tr>-->
|
||||||
<!-- <th>姓名</th>-->
|
<!-- <th>姓名</th>-->
|
||||||
<!-- <th>工号</th>-->
|
<!-- <th>工号</th>-->
|
||||||
<!-- <th>性别</th>-->
|
<!-- <th>性别</th>-->
|
||||||
<!-- <th>单位</th>-->
|
<!-- <th>单位</th>-->
|
||||||
<!-- <th>分工会</th>-->
|
<!-- <th>分工会</th>-->
|
||||||
<!-- <th>代表团</th>-->
|
<!-- <th>代表团</th>-->
|
||||||
<!-- </tr>-->
|
<!-- </tr>-->
|
||||||
<!-- </thead>-->
|
<!-- </thead>-->
|
||||||
<!-- <tbody>-->
|
<!-- <tbody>-->
|
||||||
<!-- <tr v-for="item in task?.taskFormData?.seconder">-->
|
<!-- <tr v-for="item in task?.taskFormData?.seconder">-->
|
||||||
<!-- <td>{{item.userName}}</td>-->
|
<!-- <td>{{item.userName}}</td>-->
|
||||||
<!-- <td>{{item.loginName}}</td>-->
|
<!-- <td>{{item.loginName}}</td>-->
|
||||||
<!-- <td>{{item.sex}}</td>-->
|
<!-- <td>{{item.sex}}</td>-->
|
||||||
<!-- <td>{{item.unitName}}</td>-->
|
<!-- <td>{{item.unitName}}</td>-->
|
||||||
<!-- <td>{{item.unionName}}</td>-->
|
<!-- <td>{{item.unionName}}</td>-->
|
||||||
<!-- <td>{{item.delegationName}}</td>-->
|
<!-- <td>{{item.delegationName}}</td>-->
|
||||||
<!-- </tr>-->
|
<!-- </tr>-->
|
||||||
<!-- </tbody>-->
|
<!-- </tbody>-->
|
||||||
<!-- </table>-->
|
<!-- </table>-->
|
||||||
</van-cell>
|
</van-cell>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -109,7 +109,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
},
|
},
|
||||||
|
|
||||||
onEdit(row) {
|
onEdit(row) {
|
||||||
this.$pjaxReplace("/platform/h5/proposal/write?bizId=" + row.id + "&taskId=" + row.startTaskId)
|
this.$pjaxReplace("/platform/proposal/write/h5?bizId=" + row.id + "&taskId=" + (row.startTaskId || ''))
|
||||||
},
|
},
|
||||||
|
|
||||||
doSearch() {
|
doSearch() {
|
||||||
|
|||||||
+2
-2
@@ -40,9 +40,9 @@ layout("/layouts/platform_h5.html"){
|
|||||||
</div>
|
</div>
|
||||||
<div class="action-btn" v-if="row.taskState === 10" @click="onApproval(row)">
|
<div class="action-btn" v-if="row.taskState === 10" @click="onApproval(row)">
|
||||||
<i class="fa fa-edit"></i>
|
<i class="fa fa-edit"></i>
|
||||||
<span>审核</span>
|
<span>附议</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="action-btn delete" v-if="row.taskState === 10" @click="onRevoke(row)">
|
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
|
||||||
<i class="fa fa-reply"></i>
|
<i class="fa fa-reply"></i>
|
||||||
<span>撤回</span>
|
<span>撤回</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+13
-13
@@ -159,7 +159,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
|
|
||||||
<van-field
|
<van-field
|
||||||
v-model="formData.brief"
|
v-model="formData.brief"
|
||||||
label="案由"
|
label="提案案由"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
rows="6"
|
rows="6"
|
||||||
autosize
|
autosize
|
||||||
@@ -184,15 +184,15 @@ layout("/layouts/platform_h5.html"){
|
|||||||
<!-- 附件上传 -->
|
<!-- 附件上传 -->
|
||||||
<van-cell-group title="附件上传" class="form-group">
|
<van-cell-group title="附件上传" class="form-group">
|
||||||
<van-field label="附件" name="files" required class="direction-column-field">
|
<van-field label="附件" name="files" required class="direction-column-field">
|
||||||
<!-- <h5-file-upload-->
|
<h5-file-upload
|
||||||
<!-- slot="input"-->
|
slot="input"
|
||||||
<!-- :value.sync="formData.files"-->
|
:value.sync="formData.files"
|
||||||
<!-- :upload_number="10"-->
|
:upload_number="10"
|
||||||
<!-- upload_mode="file"-->
|
upload_mode="file"
|
||||||
<!-- upload_result_category="array"-->
|
upload_result_category="array"
|
||||||
<!-- upload_result_type="url"-->
|
upload_result_type="url"
|
||||||
<!-- complete_result-->
|
complete_result
|
||||||
<!-- ></h5-file-upload>-->
|
></h5-file-upload>
|
||||||
</van-field>
|
</van-field>
|
||||||
</van-cell-group>
|
</van-cell-group>
|
||||||
|
|
||||||
@@ -293,7 +293,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.$toast.clear();
|
this.$toast.clear();
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$toast.success(res.msg);
|
this.$toast.success(res.msg);
|
||||||
pjaxReplace('/platform/h5/proposal/mine')
|
pjaxReplace('/platform/proposal/mine/h5')
|
||||||
} else {
|
} else {
|
||||||
this.$toast.fail(res.msg || '保存失败');
|
this.$toast.fail(res.msg || '保存失败');
|
||||||
}
|
}
|
||||||
@@ -337,7 +337,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
this.$toast.clear();
|
this.$toast.clear();
|
||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$toast.success("提交成功");
|
this.$toast.success("提交成功");
|
||||||
pjaxReplace('/platform/h5/proposal/mine')
|
pjaxReplace('/platform/proposal/mine/h5')
|
||||||
} else {
|
} else {
|
||||||
this.$toast.fail(res.msg || '提交失败');
|
this.$toast.fail(res.msg || '提交失败');
|
||||||
}
|
}
|
||||||
@@ -387,7 +387,7 @@ layout("/layouts/platform_h5.html"){
|
|||||||
if (res.code === 0) {
|
if (res.code === 0) {
|
||||||
this.$toast.success("提交成功");
|
this.$toast.success("提交成功");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
pjaxReplace('/platform/h5/proposal/mine')
|
pjaxReplace('/platform/proposal/mine/h5')
|
||||||
}, 1500);
|
}, 1500);
|
||||||
} else {
|
} else {
|
||||||
this.$toast.fail(res.msg || '提交失败');
|
this.$toast.fail(res.msg || '提交失败');
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const apps = {
|
const apps = {
|
||||||
template: /*language=HTML*/ `
|
template: /*language=HTML*/ `
|
||||||
<div class="apps-container">
|
<div class="apps-container">
|
||||||
<van-nav-bar title="代表阅览" placeholder fixed></van-nav-bar>
|
<van-nav-bar title="应用中心" placeholder fixed></van-nav-bar>
|
||||||
<!-- 搜索栏 -->
|
<!-- 搜索栏 -->
|
||||||
<van-sticky offset-top="46px">
|
<van-sticky offset-top="46px">
|
||||||
<van-search
|
<van-search
|
||||||
@@ -13,14 +13,25 @@ const apps = {
|
|||||||
></van-search>
|
></van-search>
|
||||||
</van-sticky>
|
</van-sticky>
|
||||||
|
|
||||||
<!-- 使用TreeSelect组件 -->
|
<div class="custom-tree-select">
|
||||||
<van-tree-select
|
<!-- 左侧导航 -->
|
||||||
:items="treeSelectItems"
|
<div class="tree-nav">
|
||||||
:main-active-index.sync="activeTab"
|
<div
|
||||||
@click-nav="onClickNav"
|
v-for="(category, index) in allCategories"
|
||||||
>
|
:key="category.id"
|
||||||
<template #content>
|
:class="['nav-item', { active: activeTab === index }]"
|
||||||
|
@click="onClickNav(index)"
|
||||||
|
>
|
||||||
|
<div class="nav-icon" v-if="category.icon">
|
||||||
|
<i :class="category.icon"></i>
|
||||||
|
</div>
|
||||||
|
<div class="nav-text">{{ category.name }}</div>
|
||||||
|
<div class="nav-indicator" v-if="activeTab === index"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 右侧内容 -->
|
||||||
|
<div class="tree-content">
|
||||||
<!-- 应用列表 -->
|
<!-- 应用列表 -->
|
||||||
<div class="app-list" v-if="applications.length > 0">
|
<div class="app-list" v-if="applications.length > 0">
|
||||||
<div
|
<div
|
||||||
@@ -50,15 +61,39 @@ const apps = {
|
|||||||
:name="app.isFavorite ? 'star' : 'star-o'"
|
:name="app.isFavorite ? 'star' : 'star-o'"
|
||||||
:class="['favorite-icon', app.isFavorite ? 'active' : '']"
|
:class="['favorite-icon', app.isFavorite ? 'active' : '']"
|
||||||
@click.stop="toggleFavorite(app.id)"
|
@click.stop="toggleFavorite(app.id)"
|
||||||
/>
|
></van-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 空状态 -->
|
<!-- 空状态 -->
|
||||||
<van-empty v-else description="暂无应用"></van-empty>
|
<van-empty v-else description="暂无应用"></van-empty>
|
||||||
</template>
|
</div>
|
||||||
</van-tree-select>
|
</div>
|
||||||
|
|
||||||
|
<!-- 应用菜单弹框 -->
|
||||||
|
<van-popup v-model="showMenuPopup" position="bottom" :style="{ width: '100%', maxHeight: '60%' }" round>
|
||||||
|
<div class="menu-popup">
|
||||||
|
<div class="popup-header">
|
||||||
|
<div class="popup-title">{{ currentApp.name }}</div>
|
||||||
|
<van-icon name="cross" @click="showMenuPopup = false" class="close-icon"></van-icon>
|
||||||
|
</div>
|
||||||
|
<div class="menu-grid">
|
||||||
|
<div
|
||||||
|
v-for="menu in currentMenus"
|
||||||
|
:key="menu.id"
|
||||||
|
class="grid-item"
|
||||||
|
@click="navigateToMenu(menu)"
|
||||||
|
>
|
||||||
|
<div class="grid-icon">
|
||||||
|
<van-icon :name="menu.icon || 'apps-o'" size="24"></van-icon>
|
||||||
|
</div>
|
||||||
|
<div class="grid-name">{{ menu.name }}</div>
|
||||||
|
<div class="grid-desc" v-if="menu.aliasName">{{ menu.aliasName }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</van-popup>
|
||||||
</div>
|
</div>
|
||||||
`,
|
`,
|
||||||
data() {
|
data() {
|
||||||
@@ -67,9 +102,9 @@ const apps = {
|
|||||||
applications: [],
|
applications: [],
|
||||||
// 固定分类列表
|
// 固定分类列表
|
||||||
categories: [
|
categories: [
|
||||||
{id: "all", name: "全部应用", icon: "apps-o"},
|
{id: "all", name: "全部应用", icon: "fa fa-th-large"},
|
||||||
{id: "favorites", name: "我的收藏", icon: "star-o"},
|
{id: "favorites", name: "我的收藏", icon: "fa fa-star-o"},
|
||||||
{id: "recommended", name: "推荐应用", icon: "like-o"}
|
{id: "recommended", name: "推荐应用", icon: "fa fa-thumbs-o-up"}
|
||||||
],
|
],
|
||||||
// 动态加载的分类
|
// 动态加载的分类
|
||||||
dynamicCategories: [],
|
dynamicCategories: [],
|
||||||
@@ -78,7 +113,11 @@ const apps = {
|
|||||||
// 搜索关键词
|
// 搜索关键词
|
||||||
searchKeyword: "",
|
searchKeyword: "",
|
||||||
// 列表相关
|
// 列表相关
|
||||||
loading: true
|
loading: true,
|
||||||
|
// 弹框相关
|
||||||
|
showMenuPopup: false,
|
||||||
|
currentApp: {},
|
||||||
|
currentMenus: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -90,13 +129,7 @@ const apps = {
|
|||||||
currentCategoryId() {
|
currentCategoryId() {
|
||||||
return this.allCategories[this.activeTab]?.id || "all"
|
return this.allCategories[this.activeTab]?.id || "all"
|
||||||
},
|
},
|
||||||
// TreeSelect组件所需的数据格式
|
|
||||||
treeSelectItems() {
|
|
||||||
return this.allCategories.map(category => ({
|
|
||||||
text: category.name,
|
|
||||||
className: 'category-item'
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 页面加载时获取分类和应用数据
|
// 页面加载时获取分类和应用数据
|
||||||
@@ -106,17 +139,13 @@ const apps = {
|
|||||||
methods: {
|
methods: {
|
||||||
// 加载分类数据
|
// 加载分类数据
|
||||||
loadCategories() {
|
loadCategories() {
|
||||||
$.get("/platform/v4/apps/categories", {platform: "H5"})
|
this.$axios.post("/platform/v4/apps/categories", {platform: "H5"}).then((res) => {
|
||||||
.then((result) => {
|
if (res.code === 0) {
|
||||||
if (result.code === 0) {
|
this.dynamicCategories = res.data || []
|
||||||
this.dynamicCategories = result.data || []
|
} else {
|
||||||
} else {
|
console.error("获取应用分类失败:", res.msg)
|
||||||
console.error("获取应用分类失败:", result.msg)
|
}
|
||||||
}
|
})
|
||||||
})
|
|
||||||
.fail((error) => {
|
|
||||||
console.error("获取应用分类异常:", error)
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 加载应用数据
|
// 加载应用数据
|
||||||
@@ -147,24 +176,19 @@ const apps = {
|
|||||||
|
|
||||||
// 如果是"推荐应用"分类
|
// 如果是"推荐应用"分类
|
||||||
if (this.currentCategoryId === "recommended") {
|
if (this.currentCategoryId === "recommended") {
|
||||||
$.get("/platform/v4/apps/recommended")
|
this.$axios.post("/platform/v4/apps/recommended").then((result) => {
|
||||||
.then((result) => {
|
if (result.code === 0) {
|
||||||
if (result.code === 0) {
|
this.applications = result.data.list || []
|
||||||
this.applications = result.data.list || []
|
} else {
|
||||||
} else {
|
console.error("获取推荐应用失败:", result.msg)
|
||||||
console.error("获取推荐应用失败:", result.msg)
|
}
|
||||||
}
|
this.loading = false
|
||||||
this.loading = false
|
})
|
||||||
})
|
|
||||||
.fail((error) => {
|
|
||||||
console.error("获取推荐应用异常:", error)
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 发送请求获取普通应用列表
|
// 发送请求获取普通应用列表
|
||||||
$.get("/platform/v4/apps/list?" + queryString)
|
this.$axios.post("/platform/v4/apps/list?" + queryString)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result.code === 0) {
|
if (result.code === 0) {
|
||||||
this.applications = result.data || []
|
this.applications = result.data || []
|
||||||
@@ -173,15 +197,11 @@ const apps = {
|
|||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
.fail((error) => {
|
|
||||||
console.error("获取应用列表异常:", error)
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 加载收藏的应用
|
// 加载收藏的应用
|
||||||
loadFavorites() {
|
loadFavorites() {
|
||||||
$.get("/platform/v4/apps/favorite")
|
this.$axios.post("/platform/v4/apps/favorite")
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result.code === 0) {
|
if (result.code === 0) {
|
||||||
this.applications = result.data || []
|
this.applications = result.data || []
|
||||||
@@ -190,10 +210,6 @@ const apps = {
|
|||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
.fail((error) => {
|
|
||||||
console.error("获取收藏应用异常:", error)
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 切换应用收藏状态
|
// 切换应用收藏状态
|
||||||
@@ -239,10 +255,48 @@ const apps = {
|
|||||||
|
|
||||||
// 打开应用
|
// 打开应用
|
||||||
openApp(app) {
|
openApp(app) {
|
||||||
// 储存到缓存
|
this.$axios.post("/platform/sys/user/subAppMenus", {appId: app.id}).then((res) => {
|
||||||
window.sessionStorage.setItem("zhgh_sub_app", JSON.stringify(app))
|
if (res.code === 0) {
|
||||||
// 新标签页打开
|
this.showAppMenus(app, res.data)
|
||||||
window.open("/platform/v4/subApp?appId=" + app.id, "_blank")
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 显示应用菜单弹框
|
||||||
|
showAppMenus(app, menus) {
|
||||||
|
if (!menus || menus.length === 0) {
|
||||||
|
this.$toast('该应用暂无可用功能')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果只有一个菜单项,直接跳转
|
||||||
|
if (menus.length === 1) {
|
||||||
|
this.navigateToMenu(menus[0])
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多个菜单项时显示popup弹框
|
||||||
|
this.currentApp = app
|
||||||
|
this.currentMenus = menus
|
||||||
|
this.showMenuPopup = true
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导航到菜单
|
||||||
|
navigateToMenu(menu) {
|
||||||
|
// 关闭弹框
|
||||||
|
this.showMenuPopup = false
|
||||||
|
|
||||||
|
if (menu.href) {
|
||||||
|
// 如果是H5平台,直接跳转
|
||||||
|
if (menu.platform === 'H5') {
|
||||||
|
window.location.href = menu.href
|
||||||
|
} else {
|
||||||
|
// 其他平台可能需要特殊处理
|
||||||
|
window.open(menu.href, '_blank')
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$toast('该功能暂不可用')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
style: /*language=CSS*/ `
|
style: /*language=CSS*/ `
|
||||||
@@ -252,20 +306,81 @@ const apps = {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-tree-select {
|
/* 自定义树形选择组件样式 */
|
||||||
height: calc(100vh - 150px) !important;
|
.custom-tree-select {
|
||||||
|
display: flex;
|
||||||
|
height: calc(100vh - 150px);
|
||||||
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-tree-select__nav {
|
.tree-nav {
|
||||||
flex: 0 0 90px;
|
flex: 0 0 90px;
|
||||||
|
background: #f7f8fa;
|
||||||
|
border-right: 1px solid #ebedf0;
|
||||||
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.van-tree-select__content {
|
.nav-item {
|
||||||
padding: 0;
|
position: relative;
|
||||||
|
padding: 12px 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
border-bottom: 1px solid #ebedf0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.category-item {
|
.nav-item:hover {
|
||||||
font-size: 14px;
|
background: #f2f3f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item.active {
|
||||||
|
background: #fff;
|
||||||
|
color: var(--color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-item.active::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: 3px;
|
||||||
|
background: #1989fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-icon {
|
||||||
|
font-size: 18px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-text {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 1.2;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-indicator {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
width: 0;
|
||||||
|
height: 0;
|
||||||
|
border-left: 6px solid #1989fa;
|
||||||
|
border-top: 6px solid transparent;
|
||||||
|
border-bottom: 6px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tree-content {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app-list {
|
.app-list {
|
||||||
@@ -327,5 +442,107 @@ const apps = {
|
|||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 菜单弹框样式 */
|
||||||
|
::v-deep .menu-popup {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .popup-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 16px 20px;
|
||||||
|
border-bottom: 1px solid #ebedf0;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .popup-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #323233;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .close-icon {
|
||||||
|
font-size: 18px;
|
||||||
|
color: #969799;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .menu-grid {
|
||||||
|
flex: 1;
|
||||||
|
overflow-y: auto;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .grid-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
padding: 20px 12px;
|
||||||
|
background: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .grid-item:active {
|
||||||
|
transform: scale(0.95);
|
||||||
|
background: #f2f3f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .grid-icon {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .grid-name {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #323233;
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
line-height: 1.2;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
max-width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .grid-desc {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #969799;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .menu-name {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #323233;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .menu-desc {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #969799;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .menu-arrow {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #c8c9cc;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user