提交 c12455e5 authored 作者: 王鹏飞's avatar 王鹏飞

新增学员须知

上级 1029715f
...@@ -44,4 +44,12 @@ export default class OtherAction extends BaseACTION { ...@@ -44,4 +44,12 @@ export default class OtherAction extends BaseACTION {
* 修改用户信息 * 修改用户信息
*/ */
updateUser (obj) { return Other.updateUser(obj).then(res => res) } updateUser (obj) { return Other.updateUser(obj).then(res => res) }
/**
* 签名
*/
createSign (obj) { return Other.createSign(obj).then(res => res) }
/**
* 获取签名文档
*/
getSignDocument (obj) { return Other.getSignDocument(obj).then(res => res) }
} }
...@@ -53,4 +53,14 @@ export default class OtherAPI extends BaseAPI { ...@@ -53,4 +53,14 @@ export default class OtherAPI extends BaseAPI {
this.post('/api/usercenter/user/update-user', obj, { this.post('/api/usercenter/user/update-user', obj, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' } headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}) })
/**
* 签名
*/
createSign = () => this.post('/api/usercenter/v1/sign/sign')
/**
* 获取签名文档
*/
getSignDocument = (obj = {}) => this.get('/api/usercenter/v1/sign/document', obj)
} }
<template> <template>
<div style="height: 100%; width: 100%"> <div style="height: 100%; width: 100%">
<router-view></router-view> <router-view></router-view>
<el-dialog
:title="$t('components.learnSysLayout.navigation.dialogTitle')"
:width="dialogWidth"
:visible.sync="dialogVisible"
:center="true"
:append-to-body="true"
:close-on-click-modal="false"
:close-on-press-escape="false"
@closed="handleClose"
>
<div class="sign">
<p>
{{ $t('components.learnSysLayout.navigation.dialogMessage1')
}}<a :href="$t('components.learnSysLayout.navigation.dialogMessageHref')" target="_blank">{{
$t('components.learnSysLayout.navigation.dialogMessage2')
}}</a
>{{ $t('components.learnSysLayout.navigation.dialogMessage3') }}
</p>
<el-checkbox v-model="checked">{{ $t('components.learnSysLayout.navigation.dialogCheckbox') }}</el-checkbox>
</div>
<template #footer>
<el-button type="primary" :disabled="!checked" @click="handlePrimary">{{
$t('components.learnSysLayout.navigation.dialogButton')
}}</el-button>
</template>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import cAction from '@/action'
export default { export default {
metaInfo() { metaInfo() {
return { return {
title: this.$t('title') title: this.$t('title')
} }
},
data() {
const UA = navigator.userAgent
return {
isMobile: /iphone/i.test(UA) || (/android/i.test(UA) && /mobile/i.test(UA)),
dialogVisible: false,
checked: false,
sign: {},
documentUrl: '',
timer: null
}
},
computed: {
dialogWidth() {
return this.isMobile ? '90%' : '460px'
}
},
methods: {
createSign() {
cAction.Other.createSign().then(response => {
const { code, data } = response
if (code === 1) {
this.sign = data
data.flowid &&
this.getSignDocument(data.flowid).then(() => {
if (!this.documentUrl) {
this.dialogVisible = true
}
})
} else {
this.$message.error('处理签名失败')
}
})
},
getSignDocument(flowid) {
return cAction.Other.getSignDocument({ flowid }).then(response => {
const { code, data } = response
if (code === 1) {
this.documentUrl = data.url
this.$store.commit('updateDocumentUrl', data.url)
}
return response
})
},
setTimer() {
this.timer = setInterval(() => {
this.getSignDocument(this.sign.flowid).then(response => {
if (response.code === 1) {
this.clearTimer()
this.dialogVisible = false
} else {
this.dialogVisible = true
}
})
}, 5000)
},
clearTimer() {
this.timer && clearInterval(this.timer)
},
handlePrimary() {
this.setTimer()
this.newWindowPreview(this.sign.shortUrl)
},
handleClose() {
if (!this.documentUrl) {
window.location.href = webConf.others.loginUrl
}
},
// 新窗口预览
newWindowPreview(url) {
const a = document.createElement('a')
a.href = url
a.target = '_blank'
document.body.appendChild(a)
a.click()
a.remove()
}
},
beforeMount() {
this.createSign()
},
destroyed() {
this.clearTimer()
} }
} }
</script> </script>
<style lang="scss" scoped>
.sign {
p {
text-indent: 2em;
line-height: 24px;
}
}
</style>
...@@ -26,7 +26,16 @@ ...@@ -26,7 +26,16 @@
"learnSysLayout": { "learnSysLayout": {
"navigation": { "navigation": {
"title": "Online Learning System", "title": "Online Learning System",
"tip": "Notifications" "tip": "Notifications",
"handlbook": "Handlbook",
"library": "Library",
"dialogTitle": "Notice",
"dialogMessage1": "Before using this online learning system, please read ",
"dialogMessage2": "《Zijing-CU MED Student Handbook》",
"dialogMessage3": " very carefully, and agree to follow the instructions, policies and requirements.",
"dialogMessageHref": "https://zws-imgs-pub.ezijing.com/pc/cu/%E5%AD%A6%E7%94%9F%E6%89%8B%E5%86%8C.pdf",
"dialogCheckbox": "I have read and agreed.",
"dialogButton": "OK"
}, },
"sideBar": { "sideBar": {
"updatePic": "Change profile photo", "updatePic": "Change profile photo",
......
...@@ -26,7 +26,16 @@ ...@@ -26,7 +26,16 @@
"learnSysLayout": { "learnSysLayout": {
"navigation": { "navigation": {
"title": "在线学习系统", "title": "在线学习系统",
"tip": "通知" "tip": "通知",
"handlbook": "查看学员手册",
"library": "电子图书馆",
"dialogTitle": "学员须知",
"dialogMessage1": "使用学习平台前,请认真阅读",
"dialogMessage2": "《紫荆教育-康博斯威尔大学教育学硕士学员手册》",
"dialogMessage3": "内容,并同意遵守其中的各项要求。",
"dialogMessageHref": "https://zws-imgs-pub.ezijing.com/pc/cu/%E5%AD%A6%E7%94%9F%E6%89%8B%E5%86%8C.pdf",
"dialogCheckbox": "我已阅读并同意",
"dialogButton": "确定"
}, },
"sideBar": { "sideBar": {
"updatePic": "修改头像", "updatePic": "修改头像",
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
<div class="text-title" @click="setStatus">{{ $t('components.learnSysLayout.navigation.title') }}</div> <div class="text-title" @click="setStatus">{{ $t('components.learnSysLayout.navigation.title') }}</div>
</div> </div>
<div class="nav-right"> <div class="nav-right">
<div class="nav-a">
<a :href="documentUrl" target="_blank">{{ $t('components.learnSysLayout.navigation.handlbook') }}</a>
<!-- <a href="https://library.ciis.edu" target="_blank">{{ $t('components.learnSysLayout.navigation.library') }}</a> -->
</div>
<div class="notify" @click="goNotify()"> <div class="notify" @click="goNotify()">
{{ $t('components.learnSysLayout.navigation.tip') }} {{ $t('components.learnSysLayout.navigation.tip') }}
<div class="num" v-if="this.$store.getters.myMsg != 0">{{ this.$store.getters.myMsg }}</div> <div class="num" v-if="this.$store.getters.myMsg != 0">{{ this.$store.getters.myMsg }}</div>
...@@ -25,6 +29,11 @@ export default { ...@@ -25,6 +29,11 @@ export default {
num: this.$store.getters.myMsg num: this.$store.getters.myMsg
} }
}, },
computed: {
documentUrl() {
return this.$store.state.documentUrl
}
},
mounted() { mounted() {
cAction.Other.getNavMsg() cAction.Other.getNavMsg()
.then(data => { .then(data => {
...@@ -115,4 +124,11 @@ export default { ...@@ -115,4 +124,11 @@ export default {
} }
} }
} }
.nav-a {
a {
margin: 0 10px;
color: #303133;
text-decoration: none;
}
}
</style> </style>
...@@ -4,7 +4,8 @@ Vue.use(Vuex) ...@@ -4,7 +4,8 @@ Vue.use(Vuex)
export default new Vuex.Store({ export default new Vuex.Store({
state: { state: {
myMsg: 0 myMsg: 0,
documentUrl: ''
}, },
getters: { getters: {
myMsg(state) { myMsg(state) {
...@@ -14,6 +15,9 @@ export default new Vuex.Store({ ...@@ -14,6 +15,9 @@ export default new Vuex.Store({
mutations: { mutations: {
myMsg(state, sum) { myMsg(state, sum) {
state.myMsg = sum state.myMsg = sum
},
updateDocumentUrl(state, url) {
state.documentUrl = url
} }
}, },
actions: {} actions: {}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论