Commit 8cf66ff8 by 梁建民

资料下载

parents 2241881a 338bbe69
......@@ -425,7 +425,11 @@ export const apis = {
/**
* 发送验证码
*/
smsVerifys: productionUrlApi + 'public/smsVerify'
smsVerifys: productionUrlApi + 'public/smsVerify',
/**
* 资料下载分类获取
*/
showClass: productionUrlApi + 'article/show_class'
}
......@@ -719,5 +723,8 @@ export const services = {
},
getSampleInfo(params) {
return axios.post(apis.getsampleinfo, params)
},
showClass(params) {
return axios.post(apis.showClass, params)
}
};
\ No newline at end of file
......@@ -91,6 +91,7 @@
}
.news .a {
margin-bottom: 0.5rem;
min-height: 200px;
}
.news .new-head {
height: 49px;
......@@ -116,6 +117,25 @@
font-weight: 500;
margin-left: 0.267rem;
}
.news .nav-tab ul {
display: flex;
background: #f3f3f3;
flex-wrap: wrap;
padding-top: 0.667rem;
}
.news .nav-tab ul li {
flex: 1;
width: 25%;
min-width: 25%;
max-width: 25%;
margin-bottom: 0.653rem;
text-align: center;
font-size: 14px;
color: #333333;
}
.news .nav-tab ul li.curr {
color: #1080d0;
}
.news .down-list ul {
padding: 0 0.4rem;
}
......@@ -123,9 +143,6 @@
padding: 0.4rem 0;
border-bottom: 1px solid #e5e5e5;
}
.news .down-list ul li:last-child {
border-bottom: none;
}
.news .down-list ul li .t1 {
font-size: 16px;
color: #333333;
......@@ -159,6 +176,13 @@
text-align: center;
line-height: 30px;
}
.news .down-list .txt-tip {
padding: 0.4rem 0;
font-size: 12px;
color: #999999;
background: #fff;
text-align: center;
}
.news .islogin {
height: 50px;
background: #f3f3f3;
......
{"version":3,"sources":["down.less"],"names":[],"mappings":"AAAA,KAEE;EACE,gCAAA;;AAHJ,KAME;EACE,gCAAA;EACA,eAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,gBAAA;;AAdJ,KAME,SAUE;EACE,kBAAA;EACA,aAAA;EACA,WAAA;EACA,WAAA;EACA,eAAA;EACA,YAAA;EACA,iBAAA;;AAvBN,KAME,SA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,WACE,GAGE,GAQE;EACE,eAAA;EACA,cAAA;EACA,iBAAA;EACA,gBAAA;EACA,uBAAA;EACA,mBAAA;EACA,oBAAA;EACA,qBAAA;EACA,4BAAA;;AA3IV,KAsHE,WACE,GAGE,GAoBE;EACE,aAAA;EACA,mBAAA;EACA,8BAAA;EACA,oBAAA;EACA,qBAAA;;AAnJV,KAsHE,WACE,GAGE,GAoBE,KAOE;EACE,eAAA;EACA,cAAA;;AAvJZ,KAsHE,WACE,GAGE,GAoBE,KAYE;EACE,WAAA;EACA,YAAA;EACA,kBAAA;EACA,yBAAA;EACA,cAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,iBAAA;;AAnKZ,KA0KE;EACE,YAAA;EACA,mBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;;AAhLJ,KA0KE,SAOE;EACE,WAAA;EACA,YAAA;;AAnLN,KA0KE,SAWE;EACE,oBAAA;EACA,eAAA;EACA,cAAA","file":"down.css"}
\ No newline at end of file
{"version":3,"sources":["down.less"],"names":[],"mappings":"AAAA,KAEE;EACE,gCAAA;;AAHJ,KAME;EACE,gCAAA;EACA,eAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,gBAAA;;AAdJ,KAME,SAUE;EACE,kBAAA;EACA,aAAA;EACA,WAAA;EACA,WAAA;EACA,eAAA;EACA,YAAA;EACA,iBAAA;;AAvBN,KAME,SAoBE,EAAC;EACC,cAAA;EACA,gCAAA;;AA5BN,KAgCE;EAzBE,gCAAA;EACA,eAAA;EACA,WAAA;EACA,YAAA;EACA,iBAAA;EACA,eAAA;EACA,gBAAA;EACA,gBAAA;EAoBA,eAAA;EACA,SAAA;EACA,OAAA;EACA,UAAA;;AArCJ,KAgCE,cAhBE;EACE,kBAAA;EACA,aAAA;EACA,WAAA;EACA,WAAA;EACA,eAAA;EACA,YAAA;EACA,iBAAA;;AAvBN,KAgCE,cANE,EAAC;EACC,cAAA;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KAiJE,WACE,GAGE,GAgBE;EACE,aAAA;EACA,mBAAA;EACA,8BAAA;EACA,oBAAA;EACA,qBAAA;;AA1KV,KAiJE,WACE,GAGE,GAgBE,KAOE;EACE,eAAA;EACA,cAAA;;AA9KZ,KAiJE,WACE,GAGE,GAgBE,KAYE;EACE,WAAA;EACA,YAAA;EACA,kBAAA;EACA,yBAAA;EACA,cAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,iBAAA;;AA1LZ,KAiJE,WA8CE;EACE,iBAAA;EACA,eAAA;EACA,cAAA;EACA,gBAAA;EACA,kBAAA;;AApMN,KAwME;EACE,YAAA;EACA,mBAAA;EACA,aAAA;EACA,mBAAA;EACA,mBAAA;EACA,uBAAA;;AA9MJ,KAwME,SAQE;EACE,WAAA;EACA,YAAA;;AAlNN,KAwME,SAaE;EACE,oBAAA;EACA,eAAA;EACA,cAAA","file":"down.css"}
\ No newline at end of file
.news { .borderBottom { border-bottom: 1px solid #e5e5e5; } .navList { border-bottom: 1px solid #e5e5e5; padding: 0 10px; clear: both; height: 40px; line-height: 40px; font-size: 14px; background: #fff; overflow: hidden; p { text-align: center; width: 33.33%; color: #333; float: left; cursor: pointer; height: 40px; line-height: 40px; } p.act { color: #e10601; border-bottom: 2px solid #e10601; } } .navListfixed { .navList; position: fixed; top: 39px; left: 0; right: 0px; } .navList44 { p { width: 25%; } } .listBox { li { padding: 10px; height: 100px; .borderBottom; box-sizing: border-box; img { height: 75px; width: 27%; float: left; border: 0px; outline: none; } .boxgrt { height: 75px; width: 66%; float: right; .title { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #333; font-size: 0.32rem; font-weight: bold; height: 50px; line-height: 25px; } .titleLook { font-size: 14px; color: #999; margin-top: 5px; } } } } .a{ margin-bottom: 0.5rem; } .new-head { height: 49px; background: #f3f3f3; padding: 0 0.4rem; display: flex; flex-direction: row; align-items: center; .logo { width: 30px; height: 30px; display: block; img { width: 30px; height: 30px; display: block; } } .t1 { font-size: 16px; color: #1080d0; font-weight: 500; margin-left: 0.267rem; } } .down-list { ul { padding: 0 0.4rem; li { padding: 0.4rem 0; border-bottom: 1px solid #e5e5e5; &:last-child { border-bottom: none; } .t1 { font-size: 16px; color: #333333; line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .bar { display: flex; flex-direction: row; justify-content: space-between; margin-top: 0.387rem; align-items: flex-end; .t2 { font-size: 14px; color: #999999; } .btn { width: 85px; height: 30px; border-radius: 3px; border: solid 1px #1080d0; display: block; font-size: 14px; color: #1080d0; text-align: center; line-height: 30px; } } } } } .islogin{ height: 50px; background: #f3f3f3; display: flex; flex-direction: row; align-items: center; justify-content: center; img{ width: 20px; height: 20px; } a{ margin-left: 0.28rem; font-size: 12px; color: #333333; } } }
\ No newline at end of file
.news { .borderBottom { border-bottom: 1px solid #e5e5e5; } .navList { border-bottom: 1px solid #e5e5e5; padding: 0 10px; clear: both; height: 40px; line-height: 40px; font-size: 14px; background: #fff; overflow: hidden; p { text-align: center; width: 33.33%; color: #333; float: left; cursor: pointer; height: 40px; line-height: 40px; } p.act { color: #e10601; border-bottom: 2px solid #e10601; } } .navListfixed { .navList; position: fixed; top: 39px; left: 0; right: 0px; } .navList44 { p { width: 25%; } } .listBox { li { padding: 10px; height: 100px; .borderBottom; box-sizing: border-box; img { height: 75px; width: 27%; float: left; border: 0px; outline: none; } .boxgrt { height: 75px; width: 66%; float: right; .title { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #333; font-size: 0.32rem; font-weight: bold; height: 50px; line-height: 25px; } .titleLook { font-size: 14px; color: #999; margin-top: 5px; } } } } .a { margin-bottom: 0.5rem; min-height: 200px; } .new-head { height: 49px; background: #f3f3f3; padding: 0 0.4rem; display: flex; flex-direction: row; align-items: center; .logo { width: 30px; height: 30px; display: block; img { width: 30px; height: 30px; display: block; } } .t1 { font-size: 16px; color: #1080d0; font-weight: 500; margin-left: 0.267rem; } } .nav-tab { ul { display: flex; background: #f3f3f3; flex-wrap: wrap; padding-top: 0.667rem; li { flex: 1; width: 25%; min-width: 25%; max-width: 25%; margin-bottom: 0.653rem; text-align: center; font-size: 14px; color: #333333; &.curr { color: #1080d0; } } } } .down-list { ul { padding: 0 0.4rem; li { padding: 0.4rem 0; border-bottom: 1px solid #e5e5e5; .t1 { font-size: 16px; color: #333333; line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .bar { display: flex; flex-direction: row; justify-content: space-between; margin-top: 0.387rem; align-items: flex-end; .t2 { font-size: 14px; color: #999999; } .btn { width: 85px; height: 30px; border-radius: 3px; border: solid 1px #1080d0; display: block; font-size: 14px; color: #1080d0; text-align: center; line-height: 30px; } } } } .txt-tip{ padding: 0.4rem 0; font-size: 12px; color: #999999; background: #fff; text-align: center; } } .islogin { height: 50px; background: #f3f3f3; display: flex; flex-direction: row; align-items: center; justify-content: center; img { width: 20px; height: 20px; } a { margin-left: 0.28rem; font-size: 12px; color: #333333; } } }
\ No newline at end of file
......
......@@ -10,7 +10,7 @@ const state = {
loading: false,
getfileuploadbanner: [],
articleShowData: [],
showClass: []
}
const mutations = {
......@@ -19,6 +19,9 @@ const mutations = {
},
articleShowData(state, payload) {
state.articleShowData = payload.data;
},
showClass(state, payload) {
state.showClass = payload.data;
}
}
......@@ -40,12 +43,13 @@ const actions = {
});
},
downloadFile: function ({commit}, payload) {
var param = {
data_id: payload.id
let param = {
data_id: payload.id,
download:payload.download
}
var params = Util.getParams(param);
let params = Util.getParams(param);
Services.downloadFile(params).then((res) => {
......@@ -54,16 +58,23 @@ const actions = {
if (data.err_code == 0) {
let platform = Util.isUerAgent();
if (platform == 'ios') {
if(payload.download == 1){
Toast({
message: '该文件只能在safari浏览器中下载保存,请在safari中打开页面并下载\n',
message: data.err_msg,
duration: 2000
});
setTimeout(() => {
}else{
if (platform == 'ios') {
Toast({
message: '该文件只能在safari浏览器中下载保存,请在safari中打开页面并下载\n',
duration: 2000
});
setTimeout(() => {
window.location.href = data.data[0].file_url;
}, 2000)
} else {
window.location.href = data.data[0].file_url;
}, 2000)
} else {
window.location.href = data.data[0].file_url;
}
}
} else if (data.err_code == 1) {
......@@ -71,9 +82,7 @@ const actions = {
message: data.err_msg,
duration: 2000
});
setTimeout(function () {
window.location.href = '/v3/login?referer=%2fh5%2fview%2f%23%2fdownoad&from=download'
}, 2000);
} else {
......@@ -89,7 +98,15 @@ const actions = {
});
},
articleShowData({commit}, payload) {
var params = Util.getParams();
Toast.loading({
message: '加载中...',
forbidClick: true,
loadingType: 'spinner'
});
let param={
class_id:payload.class_id
}
let params = Util.getParams(param);
Services.articleShowData(params).then((res) => {
let data = res.data;
......@@ -104,6 +121,27 @@ const actions = {
duration: 2000
});
}
Toast.clear();
}).catch(function (err) {
Toast.clear();
});
},
showClass({commit}, payload) {
var params = Util.getParams();
Services.showClass(params).then((res) => {
let data = res.data;
if (data.err_code == 0) {
commit({
type: 'showClass',
data: data.data
});
} else {
Toast({
message: data.err_msg,
duration: 2000
});
}
}).catch(function (err) {
......
......@@ -16,14 +16,24 @@
</van-swipe-item>
</van-swipe>
</template>
<div class="nav-tab">
<ul>
<li @click="handleSelect(index,item.class_id)" :class="{'curr':active==index}" v-for="(item, index) in showClass" :key="index">{{item.class_name}}</li>
</ul>
</div>
<div class="down-list">
<ul class="boxsiz">
<li class="boxsiz" v-for="(item, index) in articleShowData" :key="index">
<p class="t1">{{item.title}}</p>
<template v-if="loginCheck">
<p class="t1">{{item.title}}</p>
</template>
<template v-else>
<p class="t1" @click="toUrl">{{item.title}}</p>
</template>
<div class="bar">
<p class="t2">已下载{{item.download_num}}次</p>
<template v-if="loginCheck">
<a class="btn" @click="download(item.data_id)">下载</a>
<a class="btn" @click="download(item.data_id,1)">下载</a>
</template>
<template v-else>
<a class="btn" @click="toUrl">下载</a>
......@@ -31,6 +41,9 @@
</div>
</li>
</ul>
<p class="txt-tip">
法律声明:本资料库的文档为网络收集,仅供学习使用,勿做商用
</p>
</div>
<template v-if="!loginCheck">
<div class="islogin" @click="toUrl">
......@@ -60,6 +73,7 @@
return {
title: "资料下载",
p: 1,
active: 0,
meaushow: true,
bannerHeight: 200,
navListfixed: false
......@@ -69,7 +83,8 @@
...mapState({
getfileuploadbanner: state => state.download.getfileuploadbanner,
articleShowData: state => state.download.articleShowData,
loginCheck: state => state.common.loginCheck
loginCheck: state => state.common.loginCheck,
showClass: state => state.download.showClass
})
},
created() {
......@@ -84,6 +99,9 @@
type: "getfileuploadbanner"
});
this.$store.dispatch({
type: "showClass"
});
this.$store.dispatch({
type: "articleShowData"
});
this.$store.dispatch({
......@@ -91,10 +109,19 @@
is_jump: false
});
},
download(id) {
handleSelect(index, id) {
this.active = index;
this.$store.dispatch({
type: "articleShowData",
class_id: id
});
},
download(id, download) {
this.$store.dispatch({
type: "downloadFile",
id: id
id: id,
download, download
});
},
toUrl() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment