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

chore: 持续优化

上级 63425f38
const fs = require('fs')
const path = require('path')
const chalk = require('chalk')
const OSS = require('ali-oss')
const log = console.log
const client = new OSS({
region: 'oss-cn-beijing',
accessKeyId: 'LTAIOTuuLTaWoGJj',
accessKeySecret: 'dE5tTGm2lh35eItct2krW2DeH2lf2I',
bucket: 'webapp-pub'
})
async function uploadTarget(src, dist) {
try {
const result = await client.put(dist, path.join(__dirname, src))
log(chalk.green('上传成功', result.url))
} catch (e) {
log(chalk.red('上传失败', src))
log(e)
}
}
function generateUploadTarget(src, dist) {
fs.readdir(path.join(__dirname, src), function (err, files) {
if (err) {
log(err)
return
}
files.forEach(function (file) {
const _src = src + '/' + file
const _dist = dist + '/' + file
const stats = fs.statSync(path.join(__dirname, _src))
// 判断是否为文件
stats.isFile() && uploadTarget(_src, _dist)
// 判断是否为文件夹
stats.isDirectory() && generateUploadTarget(_src, _dist)
})
})
}
generateUploadTarget('./client-dist', '/website/prod/eec')
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview", "preview": "vite preview",
"deploy": "node ./deploy.js",
"lint": "eslint --ext .js --ext .jsx --ext .vue src/", "lint": "eslint --ext .js --ext .jsx --ext .vue src/",
"lint:fix": "eslint --fix --ext .js --ext .jsx --ext .vue src/" "lint:fix": "eslint --fix --ext .js --ext .jsx --ext .vue src/"
}, },
...@@ -14,25 +13,21 @@ ...@@ -14,25 +13,21 @@
"axios": "^1.5.0", "axios": "^1.5.0",
"element-ui": "^2.15.14", "element-ui": "^2.15.14",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"js-cookie": "^2.2.1",
"js-md5": "^0.7.3",
"lodash": "^4.17.20", "lodash": "^4.17.20",
"print-js": "^1.6.0", "print-js": "^1.6.0",
"qrcode.vue": "^1.7.0", "qrcode.vue": "^1.7.0",
"swiper": "^6.3.5", "swiper": "^6.3.5",
"viewerjs": "^1.9.0",
"vue": "^2.7.16", "vue": "^2.7.16",
"vue-awesome-swiper": "3.1.3", "vue-awesome-swiper": "3.1.3",
"vue-meta-info": "^0.1.7",
"vue-mobile-calendar": "^3.3.0", "vue-mobile-calendar": "^3.3.0",
"vue-router": "^3.6.5", "vue-router": "^3.6.5",
"vuex": "^3.6.2" "vuex": "^3.6.2"
}, },
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue2": "^2.3.3", "@vitejs/plugin-vue2": "^2.3.3",
"ali-oss": "^6.11.2",
"eslint": "^8.48.0", "eslint": "^8.48.0",
"eslint-plugin-vue": "^9.17.0", "eslint-plugin-vue": "^9.17.0",
"qs": "^6.14.0",
"sass": "1.66.1", "sass": "1.66.1",
"vite": "^4.5.9", "vite": "^4.5.9",
"vite-plugin-mkcert": "^1.16.0" "vite-plugin-mkcert": "^1.16.0"
......
import { articleApi } from '@api'
export default class ArticleAction {
getAllClassify (obj) { return articleApi.getAllClassify(obj).then(res => res) }
getArticle (obj) { return articleApi.getArticle(obj).then(res => res) }
getArticleDetail (id) { return articleApi.getArticleDetail(id).then(res => res) }
formCommit (data) { return articleApi.formCommit(data).then(res => res) }
getBanner (obj) { return articleApi.getBanner(obj).then(res => res) }
sendCheckedCode (obj) { return articleApi.sendCheckedCode(obj).then(res => res) }
register (obj) { return articleApi.register(obj).then(res => res) }
register2 (obj) { return articleApi.register2(obj).then(res => res) }
getUserInfo (obj) { return articleApi.getUserInfo(obj).then(res => res) }
getFormDetail (obj) { return articleApi.getFormDetail(obj).then(res => res) }
getOrder (obj) { return articleApi.getOrder(obj).then(res => res) }
checkPay (id) { return articleApi.checkPay(id).then(res => res) }
payEnd (obj) { return articleApi.payEnd(obj).then(res => res) }
updateUserInfo (obj) { return articleApi.updateUserInfo(obj).then(res => res) }
getCard (obj) { return articleApi.getCard(obj).then(res => res) }
}
import ArticleAction from './ArticleAction'
let articleAction = new ArticleAction()
const cAction = {
articleAction
}
/**
* 统一处理接口返回请求
* 由于使用 axios ,返回 then + finally 可能存在 部分浏览器不支持情况
* 需要 添加兼容
* @param {[object]} obj 整个对象
* @param {[object]} obj.component 当前调用组件对象 传过来,必传
* @param {[string]} obj.actionName action名字,必传
* @param {[string]} obj.functionName action类中的方法名,必传
* @param {[object]} obj.data 传输数据,必传
* @param {[function]} obj.thenCallback 异步成功返回回调值,必传
* @param {[function]} obj.catchCallback 异常抛出时,返回错误抓取回调值,必传
* @param {[function]} obj.finallyCallback 最终finally回调,必传
*/
export const request = obj => {
cAction[obj.actionName]
[obj.functionName](obj.data)
.then(res => {
obj.thenCallback(res)
})
.catch(e => {
obj.component.$message.error(e.message)
obj.catchCallback(e)
})
.finally(e => {
obj.finallyCallback(e)
})
}
export default cAction
import httpRequest from '@/utils/httpRequest'
// 获取文章分类
export function getAllClassify(params) {
return httpRequest.get('/api/microservices/api/category/articles', { params })
}
// 获取文章
export function getArticle(params) {
return httpRequest.get('/api/microservices/api/article/list', { params })
}
// 获取文章详情
export function getArticleDetail(id) {
return httpRequest.get(`/api/microservices/api/article/${id}/info`)
}
export function formCommit(data) {
return httpRequest.post('/api/microservices/api/v3/apply/teacher-form', data)
}
// 获取轮播
export function getBanner(params) {
return httpRequest.get('/api/microservices/api/carousel/list', { params })
}
// 发送验证码
export function sendCheckedCode(data) {
return httpRequest.post('/api/usercenter/user/send-code', data)
}
// 注册
export function register(data) {
return httpRequest.post('/api/usercenter/user/register', data)
}
// 注册
export function register2(data) {
return httpRequest.post('/api/usercenter/user/register-and-login-by-mobile', data)
}
// 获取用户信息
export function getUserInfo() {
return httpRequest.get('/api/passport/account/get-user-info')
}
// 表单回显
export const getFormDetail = (params) => {
return httpRequest.get('/api/microservices/api/v3/apply/teacher-form-detail', { params })
}
// 下单
export function getOrder(data) {
return httpRequest.post('/api/microservices/api/v3/apply/unified-order', data)
}
// 查看订单状态
export function checkPay(id) {
return httpRequest.post('/api/pay/order/query', { order_id: id }, { headers: { 'Content-Type': 'application/json' } })
}
// 支付完成通知
export function payEnd(data) {
return httpRequest.post('/api/microservices/api/v3/apply/pay-end', data)
}
// 更新用户信息
export function updateUserInfo(data) {
return httpRequest.post('/api/usercenter/user/update-user', data)
}
// 获取证书
export function getCard(params) {
return httpRequest.get('/api/cert/api/v1/cert/detail', { params })
}
/**
* 提交留咨信息
*/
export function postNes(data) {
return httpRequest.post('/api/enrollment/v1.0/applications', data)
}
import BaseAPI from './base_api'
export default class ScoreAPI extends BaseAPI {
// 获取文章分类
getAllClassify = (obj = {}) => this.get('/api/microservices/api/category/articles', obj, {})
// 获取文章
getArticle = (obj = {}) => this.get('/api/microservices/api/article/list', obj, {})
// 获取文章详情
getArticleDetail = id => this.get(`/api/microservices/api/article/${id}/info`)
// formCommit = (data) => this.post('/api/microservices/api/form/commit', data)
formCommit = data => this.post('/api/microservices/api/v3/apply/teacher-form', data)
// 获取轮播
getBanner = (obj = {}) => this.get('/api/microservices/api/carousel/list', obj, {})
// 发送验证码
sendCheckedCode = (obj = {}) => this.post('/api/usercenter/user/send-code', obj)
// 注册
register = (obj = {}) => this.post('/api/usercenter/user/register', obj)
// 注册
register2 = (obj = {}) => this.post('/api/usercenter/user/register-and-login-by-mobile', obj)
// 获取用户信息
getUserInfo = () => this.get('/api/passport/account/get-user-info')
// 表单回显
getFormDetail = (params = {}) => {
return this.get('/api/microservices/api/v3/apply/teacher-form-detail', params, {})
}
// 下单
getOrder = (obj = {}) => this.post('/api/microservices/api/v3/apply/unified-order', obj)
// 查看订单状态
checkPay = id =>
this.post('/api/pay/order/query', { order_id: id }, { headers: { 'Content-Type': 'application/json' } })
// 支付完成通知
payEnd = (obj = {}) => this.post('/api/microservices/api/v3/apply/pay-end', obj)
// 更新用户信息
updateUserInfo = (obj = {}) => this.post('/api/usercenter/user/update-user', obj)
// 获取证书
getCard = (obj = {}) => this.get('/api/cert/api/v1/cert/detail', obj, {})
}
import axios from 'axios'
import _ from 'lodash'
import qs from 'qs'
export default class API {
constructor() {
/* 创建一个 自定义配置axios实例 */
// 让ajax携带cookie
axios.defaults.withCredentials = true
this._axios = axios.create({
timeout: 5 * 1000,
baseURL: import.meta.env.VITE_API_BASE_URL,
/* 即将被发送的自定义请求头 */
headers: {
Accept: '*/*',
'Accept-Language': '',
'Content-Type': 'application/x-www-form-urlencoded'
}
})
}
/* 获取当前Vue创建实例 */
getVueInstance() {
return window.G.$instance_vue
}
/* 重新封装 请求时的执行函数 */
_request(_config = {}) {
/* 具体执行请求成功后业务逻辑前,先执行该方法 */
const beforeSuccess = _config.beforeSuccess ? _config.beforeSuccess : this._reqSuccess
/* 具体执行请求失败后业务逻辑前,先执行该方法 */
const beforeFail = _config.beforeFail ? _config.beforeFail : this._reqFail
const headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
_config.headers = _.assignIn(headers, _config.headers)
/* 判别 传输方式 */
if (_config.headers['Content-Type'] === 'application/x-www-form-urlencoded') {
_config.data = qs.stringify(_config.data)
}
if (_config.headers['Content-Type'] === 'multipart/form-data') {
let fr = new FormData() // eslint-disable-line
const _obj = _config.data || _config.params
for (const key in _obj) {
fr.append(key, _obj[key])
}
_config.data = fr
}
/* 创建并根据参数发起请求 */
return this._axios(_config).then(beforeSuccess.bind(this), beforeFail.bind(this))
}
/**
* 统一处理request success操作,在实现业务逻辑前进行统一处理。
* 注意:如果不能满足需求,可在接口定义处重新实现
* @param {[object]} res 返回数据
*/
_reqSuccess(res) {
const { status, data } = res
let err = null
if (status === 200) {
return data
} else {
err = new Error(JSON.stringify(res.data))
throw err
}
}
/**
* 统一处理request fail操作,在实现业务逻辑前进行统一处理。
* 注意:如果不能满足需求,可在接口定义处重新实现
* @param {[object]} res 如果未到达 response 阶段,则无res.response
*/
_reqFail(res) {
let err = null
if (res.code === 'ECONNABORTED') {
err = new Error('网络超时,请稍后重试')
} else if (res.response) {
err = new Error(JSON.stringify(res.response))
} else {
err = new Error('msg:' + res.message + 'stack:' + res.stack)
err.code = 500
}
/* 如果出错,创建错误对象,并抛出一个错误。 */
throw err
}
/* 重新实现 get请求 */
get(url, data, config) {
return this._request(_.assignIn({ url, method: 'GET', params: data }, config))
}
/* 重新实现 post请求 */
post(url, data, config) {
return this._request(_.assignIn({ url, method: 'POST', data: data }, config))
}
/* 重新实现 put请求 */
put(url, data, config) {
return this._request(_.assignIn({ url, method: 'PUT', data: data }, config))
}
/* 重新实现 delete请求 */
delete(url, data, config) {
return this._request(_.assignIn({ url, method: 'DELETE', params: data }, config))
}
}
// import LoginAPI from './login_api'
import ArticleAPI from './article_api'
import httpRequest from '@/utils/httpRequest'
// let loginApi = new LoginAPI(webConf)
const articleApi = new ArticleAPI({})
/**
* 提交留咨信息
*/
export function postNes(data) {
return httpRequest.post('/api/enrollment/v1.0/applications', data)
}
export { articleApi }
<template>
<div class="school-box">
<div class="module1 content-max-width">
<div class="title" id="points5">申报试点</div>
<div class="p">试点申报请前往职业技能等级证书信息管理服务平台(网址: https://vslc.ncb.edu.cn/csr-declaraPlatform)进行申请。</div>
<img src="https://zws-imgs-pub.ezijing.com/static/public/fef814a1209bab02367cfdf8ab4f51dc.png" alt="" class="img">
<div class="p1">
<span>试点申报说明:</span>
<div class="all-btn" @click="goPage('/news')">看通知</div>
</div>
<div class="p1">
<span>试点申报入口:</span>
<div class="all-btn" @click="goPage('https://vslc.ncb.edu.cn/csr-declaraPlatform', 1)">去申请</div>
</div>
<div class="p1" style="align-items: baseline;">
<span style="white-space:nowrap;">申报审核结果:</span>
<div class="color-c">我司会联系您,请关注校方注册网站时联系人注册手机的通知。</div>
</div>
<div class="content-max-width" id="points1">
<div class="title">考点申报</div>
<div class="p">在职业技能等级证书信息管理服务平台-试点院校业务平台-考试管理菜单中,打开申报考点栏目申报考核站点。<br/>
学校如果要组织证书的考试,需要向紫荆教育申报考点,审批通过后方可组织学生考试。<br/>
若学校不符合紫荆教育公布的考核站点建设标准要求,可以向紫荆教育申请去其他考核站点借考,借考分配由紫荆教育操作处理。</div>
</div>
<div class="p1">
<span>考点申报说明:</span>
<div class="all-btn" @click="goPage('/news')">看通知</div>
</div>
<div class="p1">
<span>考点申报入口:</span>
<div class="all-btn" @click="goPage('https://vslc.ncb.edu.cn/csr-declaraPlatform', 1)">去申请</div>
</div>
</div>
<div class="module2">
<div class="content-max-width" id="points2">
<!-- <div class="p">
<div class="title tnew">集中报名师训</div>
<div class="p">有关单位意向申报成为1+X职业技能等级证书考核站点,请按要求登录政府网站申请试点院校业务平台(网址: https://vslc.ncb.edu.cn )输入试点学校管理员的账号密码,在考试管理菜单中,打开申报考点栏目,即可自主申报考核站点</div>
<div class="all-btn" @click="goPage('/school/form')">去申请</div>
</div> -->
<!-- <div class="title">组织老师培训</div>
<div class="p">根据紫荆教育发布的师资培训方案,学校组织符合条件的专业老师参加师资培训。</div>
<div class="p1">
<span>通知关注:</span>
<div class="all-btn con-btn" @click="goPage('/news')">看通知</div>
</div>
<div class="p1">
<span>报名入口:</span>
<div class="all-btn con-btn" @click="goPage('/train')">去报名</div>
</div> -->
<!-- <div class="all-btn con-btn" @click="goPage('/train')">去报名</div>
<div class="all-btn con-btn" @click="goPage('/news')">看通知</div> -->
<div class="title mar-t36" id="points3">统一实施教学</div>
<div class="item">
<div class="content" style="margin-left:0px;">
<div class="text">
学校可统一组织开班授课。线上课程可使用我司学习系统的辅助教学功能。<br/>
支持视频课程教学播放、PPT课程讲义播放。<br/>
管理班级学员和开班课,了解各班学习进度
</div>
<div class="all-btn" @click="goPage('https://x-learning.ezijing.com/', 1)">进入系统</div>
</div>
</div>
<img style="margin: 0 auto;display:block;" src="https://zws-imgs-pub.ezijing.com/static/public/5bc16cb6a3a5cda51df669315991a69a.png" alt="">
</div>
</div>
<div class="module3 content-max-width">
<div class="title" id="points4">批量报名考试</div>
<div class="text-box" style="display:block">
<div class="text">成绩查询请前往职业技能等级证书信息管理服务平台(网址: https://vslc.ncb.edu.cn/csr-scoreCertificate)进行查询。</div>
<!-- <div class="text">1、设置考场信息:考核站点申请后,需要在职业技能等级证书信息管理服务平台-试点院校业务平台-考场管理栏目中为考核站点设置考场信息,考场信息每次考试均需设置一次。</div> -->
<!-- <div class="text">2、为学生报考:请在职业技能等级证书信息管理服务平台-试点院校业务平台-报考管理功能中为学生进行报考。</div> -->
<!-- <div class="text">成绩查询请前往职业技能等级证书信息管理服务平台(网址: https://vslc.ncb.edu.cn/csr-scoreCertificate)进行查询。</div> -->
<div class="all-btn" style="margin-left:0px;" @click="goPage('https://vslc.ncb.edu.cn/csr-scoreCertificate', 1)">进入系统</div>
</div>
<div class="img-box">
<img src="https://zws-imgs-pub.ezijing.com/static/public/182e9ee4459c70648ddd626075d666a8.png" alt="">
<!-- <img style="height:188px;" src="https://zws-imgs-pub.ezijing.com/static/public/94d7bf72697b2b6e452e93b555b50038.png" alt=""> -->
</div>
</div>
</div>
</template>
<script>
import action from '@action'
export default {
mounted() {
// this.newsList()
if (this.$route.query.point) {
setTimeout(() => {
this.pointScroll()
}, 500)
}
},
methods: {
pointScroll(){
if (this.$route.query.point !== undefined) {
const element = document.getElementById(`point${this.$route.query.point}`);
if (element) {
const offsetTop = element.getBoundingClientRect().top + window.scrollY;
window.scrollTo({
top: offsetTop,
behavior: 'smooth'
});
}
}
},
goPage(path, n) {
if (n) {
window.open(path)
} else {
this.$router.push({
path: path
})
}
},
newsList() {
if (!Object.keys(this.$store.state.classify).length) {
setTimeout(() => {
this.articleClassify = this.$store.state.classify
this.newsList()
}, 2000)
} else {
const findId = this.articleClassify[0].children.find(item => {
return item.display_name === '我是学校'
})
action.articleAction.getArticle({ category_id: findId.id }).then(res => {
this.data = res.data.list[0].content
})
}
}
},
watch: {
'$route': {
handler: function(val, oldVal){
this.pointScroll()
},
deep: true
}
}
}
</script>
<style lang="scss" scoped>
.content-max-width{
width: 1200px;
margin: 0 auto;
}
.title{
font-size: 24px;
font-weight: bold;
color: #333333;
line-height: 33px;
}
.all-btn{
width: 104px;
height: 40px;
background: linear-gradient(315deg, rgba(225, 47, 116, 0.83) 0%, #C01540 100%);
border-radius: 4px;
text-align: center;
line-height: 40px;
color: #fff;
font-size: 14px;
cursor: pointer;
&.autos{
margin: 0 auto;
}
}
.school-box{
background: #F8F8F9;
.module1{
padding: 36px 0;
.dosc{
// padding-bottom: 32px;
}
.p{
font-size: 18px;
color: #666666;
line-height: 36px;
margin: 16px 0;
}
.img{
width: 600px;
margin: 0 auto;
display: block;
}
.p1{
margin: 16px 0;
display: flex;
align-items: center;
.color-c{
line-height: 30px;
color: #666666;
font-size: 18px;
}
span{
font-size: 18px;
font-weight: bold;
color: #222222;
line-height: 30px;
&.text-index-2em{
text-indent: 2em;
}
}
}
}
.module2{
padding: 36px 0;
background: #fff;
.mar-t36{
margin-top: 36px;
}
.p1{
margin: 16px 0;
display: flex;
align-items: center;
.color-c{
line-height: 30px;
color: #666666;
font-size: 18px;
}
span{
font-size: 18px;
font-weight: bold;
color: #222222;
line-height: 30px;
&.text-index-2em{
text-indent: 2em;
}
}
}
.p{
font-size: 18px;
color: #666666;
line-height: 36px;
margin: 16px 0;
}
.con-btn{
// margin: 0 auto;
// margin-bottom: 16px;
}
.item{
display: flex;
margin-top: 16px;
img{
width: 326px;
height: 180px;
margin-left: 47px;
}
.content{
margin-left: 40px;
.text{
font-size: 18px;
color: #666666;
line-height: 36px;
}
.all-btn{
margin-top: 16px;
}
}
}
}
.module3{
padding: 46px 0 36px;
.text-box{
display: flex;
// align-items: center;
margin: 24px 0 16px;
.text{
font-size: 18px;
color: #666666;
line-height: 36px;
}
.all-btn{
margin-left: 25px;
}
}
.img-box{
display: flex;
justify-content: center;
img{
&:nth-child(1){
margin-right: 74px;
}
&:nth-child(2){
margin-top: 16px;
}
}
}
}
}
</style>
差异被折叠。
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
</template> </template>
<script> <script>
import action from '@action' import * as api from '@/api/article'
import headBanner from '@/components/headBanner.vue' import headBanner from '@/components/headBanner.vue'
export default { export default {
components: { headBanner }, components: { headBanner },
...@@ -117,7 +117,7 @@ export default { ...@@ -117,7 +117,7 @@ export default {
}, },
}, },
created() { created() {
action.articleAction.getUserInfo().then((res) => { api.getUserInfo().then((res) => {
if (res && res.code === 0) { if (res && res.code === 0) {
this.isLogin = true this.isLogin = true
} }
...@@ -188,7 +188,7 @@ export default { ...@@ -188,7 +188,7 @@ export default {
const findId = this.articleClassify[0].children.find((item) => { const findId = this.articleClassify[0].children.find((item) => {
return item.display_name === (this.newsTabIndex ? '工作动态' : '新闻动态') return item.display_name === (this.newsTabIndex ? '工作动态' : '新闻动态')
}) })
action.articleAction.getArticle({ category_id: findId ? findId.id : 23 }).then((res) => { api.getArticle({ category_id: findId ? findId.id : 23 }).then((res) => {
this.list = res.data.list this.list = res.data.list
}) })
} }
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<script> <script>
import printJS from 'print-js' import printJS from 'print-js'
import action from '@action' import * as api from '@/api/article'
import { saveAs } from 'file-saver' import { saveAs } from 'file-saver'
export default { export default {
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
// 获取证书列表 // 获取证书列表
handleGetCard() { handleGetCard() {
const params = { project_prefix: 'x1' } const params = { project_prefix: 'x1' }
action.articleAction.getCard(params).then((res) => { api.getCard(params).then((res) => {
this.cardList = res.data?.list this.cardList = res.data?.list
}) })
}, },
......
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
</div> </div>
</template> </template>
<script> <script>
import action from '@action' import * as api from '@/api/article'
import breadcrumb from '@/components/breadcrumb.vue' import breadcrumb from '@/components/breadcrumb.vue'
export default { export default {
components: { components: {
breadcrumb breadcrumb,
}, },
data() { data() {
return { return {
...@@ -21,12 +21,12 @@ export default { ...@@ -21,12 +21,12 @@ export default {
crumbData: [ crumbData: [
{ {
path: '/', path: '/',
name: '首页' name: '首页',
}, },
{ {
name: parseInt(this.$route.query.tabs) === 1 ? '工作动态' : '通知公告' name: parseInt(this.$route.query.tabs) === 1 ? '工作动态' : '通知公告',
} },
] ],
} }
}, },
mounted() { mounted() {
...@@ -35,21 +35,21 @@ export default { ...@@ -35,21 +35,21 @@ export default {
this.crumbData = [ this.crumbData = [
{ {
path: '/', path: '/',
name: '首页' name: '首页',
}, },
{ {
name: parseInt(this.$route.query.tabs) === 1 ? '工作动态' : '通知公告' name: parseInt(this.$route.query.tabs) === 1 ? '工作动态' : '通知公告',
} },
] ]
} }
}, },
methods: { methods: {
getData() { getData() {
action.articleAction.getArticleDetail(this.$route.query.id).then(res => { api.getArticleDetail(this.$route.query.id).then((res) => {
this.data = res.data this.data = res.data
}) })
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -20,20 +20,20 @@ import headBanner from '@/components/headBanner.vue' ...@@ -20,20 +20,20 @@ import headBanner from '@/components/headBanner.vue'
import item from './components/listItem.vue' import item from './components/listItem.vue'
import btnTabs from '@/components/tabs/btnTabs.vue' import btnTabs from '@/components/tabs/btnTabs.vue'
import breadcrumb from '@/components/breadcrumb.vue' import breadcrumb from '@/components/breadcrumb.vue'
import action from '@action' import * as api from '@/api/article'
export default { export default {
components: { components: {
item, item,
btnTabs, btnTabs,
breadcrumb, breadcrumb,
headBanner headBanner,
}, },
data() { data() {
return { return {
articleClassify: this.$store.state.classify, articleClassify: this.$store.state.classify,
tabsData: { tabsData: {
options: ['通知公告', '工作动态'], options: ['通知公告', '工作动态'],
index: 0 index: 0,
}, },
tabsDataIndex: 0, tabsDataIndex: 0,
list: [], list: [],
...@@ -41,12 +41,12 @@ export default { ...@@ -41,12 +41,12 @@ export default {
crumbData: [ crumbData: [
{ {
path: '/', path: '/',
name: '首页' name: '首页',
}, },
{ {
name: '工作动态' name: '工作动态',
} },
] ],
} }
}, },
created() { created() {
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
lock: true, lock: true,
text: 'Loading', text: 'Loading',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)',
}) })
if (!Object.keys(this.$store.state.classify).length) { if (!Object.keys(this.$store.state.classify).length) {
setTimeout(() => { setTimeout(() => {
...@@ -77,11 +77,11 @@ export default { ...@@ -77,11 +77,11 @@ export default {
} else { } else {
console.log(this.tabsDataIndex) console.log(this.tabsDataIndex)
console.log(this.articleClassify[0].children) console.log(this.articleClassify[0].children)
const findId = this.articleClassify[0].children.find(item => { const findId = this.articleClassify[0].children.find((item) => {
return item.display_name === (this.tabsDataIndex ? '工作动态' : '新闻动态') return item.display_name === (this.tabsDataIndex ? '工作动态' : '新闻动态')
}) })
console.log(findId.id) console.log(findId.id)
action.articleAction.getArticle({ category_id: findId.id }).then(res => { api.getArticle({ category_id: findId.id }).then((res) => {
this.list = res.data.list this.list = res.data.list
this.pages = res.data.pages this.pages = res.data.pages
this.$nextTick(() => { this.$nextTick(() => {
...@@ -90,20 +90,20 @@ export default { ...@@ -90,20 +90,20 @@ export default {
loading.close() loading.close()
}) })
} }
} },
}, },
watch: { watch: {
$route: { $route: {
handler: function(val, oldVal) { handler: function (val, oldVal) {
if (this.$route.query.type !== undefined || this.$route.query.type !== 'undefined') { if (this.$route.query.type !== undefined || this.$route.query.type !== 'undefined') {
this.tabsData.index = parseInt(this.$route.query.type) this.tabsData.index = parseInt(this.$route.query.type)
this.tabsDataIndex = parseInt(this.$route.query.type) this.tabsDataIndex = parseInt(this.$route.query.type)
this.newsList() this.newsList()
} }
}, },
deep: true deep: true,
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</template> </template>
<script> <script>
import { postNes } from '@/api' import { postNes } from '@/api/article'
export default { export default {
components: {}, components: {},
data() { data() {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</div> </div>
</template> </template>
<script> <script>
import action from '@action' import * as api from '@/api/article'
export default { export default {
data() { data() {
return { return {
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
const findId = this.articleClassify[0].children.find((item) => { const findId = this.articleClassify[0].children.find((item) => {
return item.display_name === (this.newsTabIndex ? '工作动态' : '新闻动态') return item.display_name === (this.newsTabIndex ? '工作动态' : '新闻动态')
}) })
action.articleAction.getArticle({ category_id: findId ? findId.id : 23 }).then((res) => { api.getArticle({ category_id: findId ? findId.id : 23 }).then((res) => {
this.list = res.data.list this.list = res.data.list
}) })
} }
......
<template>
<div class="chapter-box">
<breadcrumb class="content-max-width crumb" :data="crumbData" />
<div class="intr">
<div class="title">
<div class="content-max-width">资源介绍</div>
</div>
<div class="content content-max-width">
<div class="con-left">
<div class="text-box">
<div class="name">所属课程:</div>
<div class="nr">金融数字化营销</div>
</div>
<div class="text-box">
<div class="name">上传时间:</div>
<div class="nr">2020/09/03</div>
</div>
<div class="text-box">
<div class="name">浏览数:</div>
<div class="nr">35</div>
</div>
</div>
<div class="v-code-box">
<div class="code"></div>
<div class="text">手机扫码浏览</div>
</div>
</div>
</div>
<div class="screenshot">
<div class="title">
<div class="content-max-width">屏幕截图</div>
</div>
<div class="content-max-width">
<div class="block"></div>
</div>
</div>
</div>
</template>
<script>
import breadcrumb from '@/components/breadcrumb.vue'
export default {
components: {
breadcrumb
},
data() {
return {
crumbData: [
{
path: '/',
name: '首页'
},
{
path: '/textBook',
name: '教材中心'
},
{
path: '/textBook/detail',
name: '金融数字化营销'
},
{
name: '目录'
}
]
}
}
}
</script>
<style lang="scss" scoped>
.crumb {
padding-bottom: 24px;
}
.content-max-width {
width: 1109px;
margin: 0 auto;
}
.chapter-box {
padding-top: 24px;
.intr {
.title {
width: 100%;
height: 40px;
background: #f9f9f9;
.content-max-width {
line-height: 40px;
font-size: 14px;
font-weight: bold;
color: #c0004f;
}
}
.content {
display: flex;
.con-left {
width: 427px;
margin-left: 56px;
.text-box {
margin-top: 12px;
display: flex;
.name {
font-size: 14px;
font-weight: bold;
color: #222222;
line-height: 20px;
}
.nr {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
color: #717171;
line-height: 20px;
}
}
}
.v-code-box {
width: 136px;
margin-top: 12px;
.code {
width: 136px;
height: 136px;
background: #d8d8d8;
}
.text {
font-size: 14px;
color: #222222;
line-height: 20px;
text-align: center;
margin-top: 8px;
}
}
}
}
.screenshot {
margin-top: 24px;
.title {
width: 100%;
height: 40px;
background: #f9f9f9;
.content-max-width {
line-height: 40px;
font-size: 14px;
font-weight: bold;
color: #c0004f;
}
}
.block {
width: 444px;
height: 250px;
background: #d8d8d8;
margin: 12px auto;
}
}
}
</style>
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论