Commit b81d276b by 梁建民

Merge branch 'ljm_home'

parents 24ee2413 1fc25867
.news .borderBottom {
border-bottom: 1px solid #e5e5e5;
}
.news .navList {
border-bottom: 1px solid #e5e5e5;
padding: 0 10px;
clear: both;
height: 40px;
line-height: 40px;
font-size: 14px;
background: #fff;
overflow: hidden;
}
.news .navList p {
text-align: center;
width: 33.33%;
color: #333;
float: left;
cursor: pointer;
height: 40px;
line-height: 40px;
}
.news .navList p.act {
color: #e10601;
border-bottom: 2px solid #e10601;
}
.news .navListfixed {
border-bottom: 1px solid #e5e5e5;
padding: 0 10px;
clear: both;
height: 40px;
line-height: 40px;
font-size: 14px;
background: #fff;
overflow: hidden;
position: fixed;
top: 39px;
left: 0;
right: 0px;
}
.news .navListfixed p {
text-align: center;
width: 33.33%;
color: #333;
float: left;
cursor: pointer;
height: 40px;
line-height: 40px;
}
.news .navListfixed p.act {
color: #e10601;
border-bottom: 2px solid #e10601;
}
.news .navList44 p {
width: 25%;
}
.news .listBox li {
padding: 10px;
height: 100px;
border-bottom: 1px solid #e5e5e5;
box-sizing: border-box;
}
.news .listBox li img {
height: 75px;
width: 27%;
float: left;
border: 0px;
outline: none;
}
.news .listBox li .boxgrt {
height: 75px;
width: 66%;
float: right;
}
.news .listBox li .boxgrt .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;
}
.news .listBox li .boxgrt .titleLook {
font-size: 14px;
color: #999;
margin-top: 5px;
}
.news .a {
margin-bottom: 0.5rem;
}
.news .new-head {
height: 49px;
background: #f3f3f3;
padding: 0 0.4rem;
display: flex;
flex-direction: row;
align-items: center;
}
.news .new-head .logo {
width: 30px;
height: 30px;
display: block;
}
.news .new-head .logo img {
width: 30px;
height: 30px;
display: block;
}
.news .new-head .t1 {
font-size: 16px;
color: #1080d0;
font-weight: 500;
margin-left: 0.267rem;
}
.news .down-list ul {
padding: 0 0.4rem;
}
.news .down-list ul li {
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;
line-height: 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: normal;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.news .down-list ul li .bar {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 0.387rem;
align-items: flex-end;
}
.news .down-list ul li .bar .t2 {
font-size: 14px;
color: #999999;
}
.news .down-list ul li .bar .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;
}
.news .islogin {
height: 50px;
background: #f3f3f3;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.news .islogin img {
width: 20px;
height: 20px;
}
.news .islogin a {
margin-left: 0.28rem;
font-size: 12px;
color: #333333;
}
/*# sourceMappingURL=down.css.map */
\ 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,K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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
.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
......@@ -40,6 +40,10 @@ const userAddress = resolve => require(['@/views/user/address'], resolve);
const brand = resolve => require(['@/views/brand/brand'], resolve);
const brandList = resolve => require(['@/views/brand/brandList'], resolve);
const ranking = resolve => require(['@/views/rank/ranking'], resolve);
const Download = resolve => require(['@/views/download/Index'], resolve);
Vue.use(Router);
const routes = [{
......@@ -331,7 +335,13 @@ const routes = [{
title: '猎芯网-京东战投电子元器件商城_一站式解决电子元器件采购难题'
}
},
{
path: '/downoad',
component: Download,
meta: {
title: '资料下载'
}
},
{
path: '*',
redirect: '/'
......
import Vue from 'vue'
import {Toast} from 'vant';
import {services as Services} from '../../../api/index'
import Util from '../../../util/index'
Vue.use(Toast);
const state = {
loading: false,
getfileuploadbanner: [],
articleShowData: [],
}
const mutations = {
getfileuploadbanner(state, payload) {
state.getfileuploadbanner = payload.data;
},
articleShowData(state, payload) {
state.articleShowData = payload.data;
}
}
const actions = {
getfileuploadbanner({commit}, payload) {
var params = Util.getParams();
Services.getfileuploadbanner(params).then((res) => {
let data = res.data;
if (data.err_code == 0) {
commit({
type: 'getfileuploadbanner',
data: data.data.data
});
}
}).catch(function (err) {
});
},
downloadFile: function ({commit}, payload) {
var param = {
data_id: payload.id
}
var params = Util.getParams(param);
Services.downloadFile(params).then((res) => {
let data = res.data;
if (data.err_code == 0) {
let platform = Util.isUerAgent();
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;
}
} else if (data.err_code == 1) {
Toast({
message: data.err_msg,
duration: 2000
});
setTimeout(function () {
window.location.href = '/v3/login?referer=%2fh5%2fview%2f%23%2fdownoad&from=download'
}, 2000);
} else {
Toast({
message: data.err_msg,
duration: 2000
});
}
}).catch(function (err) {
});
},
articleShowData({commit}, payload) {
var params = Util.getParams();
Services.articleShowData(params).then((res) => {
let data = res.data;
if (data.err_code == 0) {
commit({
type: 'articleShowData',
data: data.data
});
} else {
Toast({
message: data.err_msg,
duration: 2000
});
}
}).catch(function (err) {
});
}
}
const getters = {}
export default {
state,
mutations,
actions,
getters
}
\ No newline at end of file
......@@ -26,6 +26,7 @@ import userInfo from './modules/user/userInfo'
import address from './modules/user/address'
import brand from './modules/brand/brand'
import rank from './modules/rank/index'
import download from './modules/download/index'
Vue.use(Vuex)
......@@ -57,6 +58,7 @@ export default new Vuex.Store({
coupon,
address,
brand,
rank
rank,
download
}
})
......@@ -104,12 +104,12 @@ export default {
* *
* /
*/
isLogin(){
var state_=0;
if(this.getCookie("Yo4teW_uid")){
state_= 2;//强弱登录态
if(this.getCookie("Yo4teW_skey")){
state_=1;//强登录态
isLogin() {
var state_ = 0;
if (this.getCookie("Yo4teW_uid")) {
state_ = 2;//强弱登录态
if (this.getCookie("Yo4teW_skey")) {
state_ = 1;//强登录态
}
}
return state_
......@@ -120,8 +120,8 @@ export default {
* *
* /
*/
loginBack:function(){
loginBack: function () {
},
/**
* *
......@@ -129,13 +129,13 @@ export default {
* *
* /
*/
compare(property,state){
return function(a,b){
compare(property, state) {
return function (a, b) {
var value1 = a[property];
var value2 = b[property];
if(state){
if (state) {
return value1 - value2;
}else{
} else {
return value2 - value1;
}
}
......@@ -146,12 +146,12 @@ export default {
* *
* /
*/
distinct(array){
distinct(array) {
var arr = array,
result = [],i,j,len = arr.length;
for(i = 0; i < len; i++){
for(j = i + 1; j < len; j++){
if(arr[i] === arr[j]){
result = [], i, j, len = arr.length;
for (i = 0; i < len; i++) {
for (j = i + 1; j < len; j++) {
if (arr[i] === arr[j]) {
j = ++i;
}
}
......@@ -160,13 +160,29 @@ export default {
return result;
},
/**
* 判断终端
* @param
*/
isUerAgent() {
var u = navigator.userAgent;
var platform = '';
if (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1) {
platform = 'android'
} else if (!!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
platform = 'ios'
} else {
platform = ''
}
return platform;
},
/**
* *
* 数字解密
* *
* /
*/
aggxde(str){
var str=String(str);
aggxde(str) {
var str = String(str);
if (str && str.indexOf("font") != -1) {
var sff = (str.split('class="'));
sff.shift();
......@@ -192,9 +208,9 @@ export default {
}
}
return Number(numb)
}else{
} else {
return Number(str)
}
}
}
<template>
<section class="news">
<Header bgcolor="#fff" :title="title" :meaushow="meaushow"></Header>
<div class="new-head boxsiz">
<a class="logo" href="/">
<img src="../../assets/images/download/logo.png" alt="猎芯网">
</a>
<span class="t1">猎芯网</span>
</div>
<template v-if="getfileuploadbanner.length > 0">
<van-swipe :autoplay="3000" :height="bannerHeight" class="a">
<van-swipe-item v-for="(item, index) in getfileuploadbanner" :key="index">
<a :href="item.url" :target="item.window_open > 0 ?'_blank':'_self'">
<img :src="item.images" height="100%" width="100%"/>
</a>
</van-swipe-item>
</van-swipe>
</template>
<div class="down-list">
<ul class="boxsiz">
<li class="boxsiz" v-for="(item, index) in articleShowData" :key="index">
<p class="t1">{{item.title}}</p>
<div class="bar">
<p class="t2">已下载{{item.download_num}}次</p>
<template v-if="loginCheck">
<a class="btn" @click="download(item.data_id)">下载</a>
</template>
<template v-else>
<a class="btn" @click="toUrl">下载</a>
</template>
</div>
</li>
</ul>
</div>
<template v-if="!loginCheck">
<div class="islogin" @click="toUrl">
<img src="../../assets/images/download/loading.png" alt="">
<a href="javascript:;">登录查看更多哦</a>
</div>
</template>
<div class="slide-bar" v-backTopWindow style="cursor: pointer;">
<div class="backtop" v-if="navListfixed">
<i class="iconfont icon-xiangshang1"></i>
</div>
</div>
</section>
</template>
<script>
import Vue from "vue";
import {mapState} from "vuex";
import {Swipe, SwipeItem, Toast} from "vant";
import Header from "@/views/common/Header.vue";
Vue.use(Swipe).use(SwipeItem).use(Toast);
export default {
name: "news",
data() {
return {
title: "资料下载",
p: 1,
meaushow: true,
bannerHeight: 200,
navListfixed: false
};
},
computed: {
...mapState({
getfileuploadbanner: state => state.download.getfileuploadbanner,
articleShowData: state => state.download.articleShowData,
loginCheck: state => state.common.loginCheck
})
},
created() {
this.getData();
},
mounted() {
this.scrollFns();
},
methods: {
getData() {
this.$store.dispatch({
type: "getfileuploadbanner"
});
this.$store.dispatch({
type: "articleShowData"
});
this.$store.dispatch({
type: "loginCheck",
is_jump: false
});
},
download(id) {
this.$store.dispatch({
type: "downloadFile",
id: id
});
},
toUrl() {
Toast({
message: "请登录后下载",
duration: 1000
});
setTimeout(() => {
window.location.href = '/v3/login?referer=%2fh5%2fview%2f%23%2fdownoad&from=download'
}, 1000)
},
scrollFns() {
var self = this;
window.onscroll = function () {
var t = document.documentElement.scrollTop || document.body.scrollTop;
if (t >= 300) {
self.navListfixed = true;
} else {
self.navListfixed = false;
}
};
}
},
components: {
Header
}
};
</script>
<style scoped>
@import "../../assets/css/news/down.css";
</style>
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
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