After Width: | Height: | Size: 612 B |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1,150 @@ |
|||
<!-- |
|||
Copyright (c) 2020. |
|||
author: song |
|||
email: 15235360226@163.com |
|||
--> |
|||
|
|||
<template> |
|||
<div class="wrap"> |
|||
<div class="d-flex flex-nowrap align-center baseColor" v-if="i === 0"> |
|||
<span class="font-bold-24">行业资讯</span> |
|||
<img class="bullhorn ml-4" src="@/assets/bullhorn.png" /> |
|||
<div class="flex-1"></div> |
|||
<a-button |
|||
class="d-flex align-center font-16 baseColor" |
|||
style="display: inline-block;" |
|||
type="link" |
|||
> |
|||
more |
|||
<a-icon style="font-size:12px" type="right" /> |
|||
</a-button> |
|||
</div> |
|||
<div class="d-flex flex-nowrap align-center baseColor" v-else> |
|||
<span class="font-bold-24">活动公告</span> |
|||
<img class="bullhorn ml-4" src="@/assets/bullhorn.png" /> |
|||
<div class="flex-1"></div> |
|||
<a-button |
|||
class="d-flex align-center font-16 baseColor" |
|||
style="display: inline-block;" |
|||
type="link" |
|||
> |
|||
more |
|||
<a-icon style="font-size:12px" type="right" /> |
|||
</a-button> |
|||
</div> |
|||
<div class="policy-box" v-if="lists && lists[i].news && lists[i].news.length>0"> |
|||
<div :key="index" class="div-box" v-for="(item, index) in lists[i].news"> |
|||
<div @click="jumpDetails(item)" class="d-flex flex-nowrap" style="cursor: pointer"> |
|||
<div class="time d-flex flex-column align-center mr-3"> |
|||
<span class="font-20">Dec.</span> |
|||
<span class="font-bold-32 day">03</span> |
|||
</div> |
|||
<div class="d-flex flex-1 flex-column"> |
|||
<div class="item-title">{{ item.title }}</div> |
|||
<div class="original"></div> |
|||
<div class="item-content">{{ item.content }}</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { mapState, mapMutations } from 'vuex'; |
|||
import { front } from 'config/api'; |
|||
export default { |
|||
name: 'IndexNewList', |
|||
props: { |
|||
i: { |
|||
type: Number, |
|||
default: 0, |
|||
}, |
|||
lists: { |
|||
type: Array, |
|||
default: () => [], |
|||
}, |
|||
}, |
|||
data() { |
|||
return {}; |
|||
}, |
|||
|
|||
created() { |
|||
console.log('lists: ', this.lists); |
|||
}, |
|||
|
|||
methods: { |
|||
...mapMutations('home', ['setActDetail']), |
|||
|
|||
// 跳转到详情界面 |
|||
jumpDetails(item) { |
|||
this.setActDetail(item); |
|||
this.$router.push('/ActDetails'); |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="stylus"> |
|||
.wrap { |
|||
width: 90%; |
|||
height: 342px; |
|||
margin: 15px auto 15px auto; |
|||
overflow: hidden; |
|||
opacity: 1; |
|||
} |
|||
|
|||
.bullhorn { |
|||
width: 25px; |
|||
height: 25px; |
|||
} |
|||
|
|||
.policy-box { |
|||
.div-box { |
|||
position: relative; |
|||
background: #fff; |
|||
padding-top: 24px; |
|||
|
|||
.time { |
|||
color: rgba(0, 0, 0, 0.25); |
|||
|
|||
.day { |
|||
position: relative; |
|||
top: -15px; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.item-title { |
|||
overflow: hidden; |
|||
display: -webkit-box; |
|||
font-size: 16px; |
|||
color: rgba(0, 0, 0, 0.65); |
|||
font-family: Microsoft YaHei; |
|||
font-weight: bold; |
|||
-webkit-line-clamp: 1; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
|
|||
.original { |
|||
position: relative; |
|||
top: 1px; |
|||
left: 0; |
|||
width: 30px; |
|||
height: 2px; |
|||
background: #13ACC4; |
|||
} |
|||
|
|||
.item-content { |
|||
overflow: hidden; |
|||
display: -webkit-box; |
|||
margin-top: 8px; |
|||
line-height: 28px; |
|||
font-size: 14px; |
|||
color: rgba(0, 0, 0, 0.45); |
|||
font-family: Microsoft YaHei; |
|||
-webkit-line-clamp: 2; |
|||
-webkit-box-orient: vertical; |
|||
} |
|||
</style> |
@ -1,16 +1,7 @@ |
|||
import Vue from "vue"; |
|||
import Vuex from "vuex"; |
|||
import mutations from './mutations'; |
|||
import actions from './actions'; |
|||
import state from './state'; |
|||
import getters from './getters'; |
|||
import Vue from 'vue'; |
|||
import Vuex from 'vuex'; |
|||
import home from './modules/home/index'; |
|||
import user from './modules/user/index'; |
|||
|
|||
Vue.use(Vuex); |
|||
|
|||
const store = new Vuex.Store({ |
|||
state, |
|||
mutations, |
|||
actions, |
|||
}); |
|||
|
|||
export default store; |
|||
export default new Vuex.Store({ modules: { home, user } }); |
|||
|
@ -0,0 +1,47 @@ |
|||
import axios from 'axios'; |
|||
import { message } from 'ant-design-vue'; |
|||
import { industryInfo, front } from '@/config/api'; |
|||
|
|||
const actions = { |
|||
/** |
|||
* 获取行业资讯列表 |
|||
* @param {any} commit |
|||
* @param {object} params 提交的数据 |
|||
*/ |
|||
async getIndustryInfoList({ commit }, params) { |
|||
try { |
|||
const res = await industryInfo(params); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
return data; |
|||
} else { |
|||
message.error(msg || '获取失败'); |
|||
throw msg; |
|||
} |
|||
} catch (error) { |
|||
throw error || '获取失败'; |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* 获取活动公告列表 |
|||
* @param {any} commit |
|||
* @param {object} params 提交的数据 |
|||
*/ |
|||
async getFrontList({ commit }, params) { |
|||
try { |
|||
const res = await front(params); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
return data; |
|||
} else { |
|||
message.error(msg || '获取失败'); |
|||
throw msg; |
|||
} |
|||
} catch (error) { |
|||
throw error || '获取失败'; |
|||
} |
|||
}, |
|||
}; |
|||
|
|||
export default actions; |
@ -0,0 +1,6 @@ |
|||
import mutations from './mutations'; |
|||
import actions from './actions'; |
|||
import state from './state'; |
|||
import getters from './getters'; |
|||
|
|||
export default { namespaced: true, state, getters, mutations, actions }; |
@ -1,36 +1,5 @@ |
|||
import { List } from 'ant-design-vue'; |
|||
|
|||
const mutations = { |
|||
/** |
|||
* 设置token |
|||
* @param { object } state |
|||
* @param { string } token |
|||
*/ |
|||
sign(state, token) { |
|||
state.anyringToken = token; |
|||
sessionStorage.setItem('anyringToken', token); |
|||
}, |
|||
|
|||
/** |
|||
* 设置user用户信息 |
|||
* @param {object} state |
|||
* @param {object} user {id, account, phone} |
|||
*/ |
|||
setUser(state, user) { |
|||
if (!user) return; |
|||
state.user = { ...user }; |
|||
sessionStorage.setItem('user', JSON.stringify(user)); |
|||
}, |
|||
|
|||
/** |
|||
* 图片验证码 |
|||
* @param {object} state |
|||
* @param {object} picCode |
|||
*/ |
|||
setPicCode(state, picCode) { |
|||
state.picCode = { ...picCode }; |
|||
}, |
|||
|
|||
/** |
|||
* 获取显示政策的ID |
|||
* @param {object} state |
@ -1,6 +1,4 @@ |
|||
const state = { |
|||
anyringToken: '', |
|||
user: { id: '', phone: '', account: '' }, |
|||
policyId: 0, |
|||
current: 1, // 政策当前处于第几页,默认1
|
|||
comCurrent: 1, // 帖子列表当前处于第几页,默认1
|
@ -0,0 +1,7 @@ |
|||
const getters = {}; |
|||
// 域定制导航展示形式
|
|||
// 0 -> 无特殊导航文字
|
|||
// 1 -> 横向定制导航
|
|||
// 2 -> 纵向定制导航
|
|||
|
|||
export default getters; |
@ -0,0 +1,6 @@ |
|||
import mutations from './mutations'; |
|||
import actions from './actions'; |
|||
import state from './state'; |
|||
import getters from './getters'; |
|||
|
|||
export default { namespaced: true, state, getters, mutations, actions }; |
@ -0,0 +1,33 @@ |
|||
const mutations = { |
|||
/** |
|||
* 设置token |
|||
* @param { object } state |
|||
* @param { string } token |
|||
*/ |
|||
sign(state, token) { |
|||
state.anyringToken = token; |
|||
sessionStorage.setItem('anyringToken', token); |
|||
}, |
|||
|
|||
/** |
|||
* 设置user用户信息 |
|||
* @param {object} state |
|||
* @param {object} user {id, account, phone} |
|||
*/ |
|||
setUser(state, user) { |
|||
if (!user) return; |
|||
state.user = { ...user }; |
|||
sessionStorage.setItem('user', JSON.stringify(user)); |
|||
}, |
|||
|
|||
/** |
|||
* 图片验证码 |
|||
* @param {object} state |
|||
* @param {object} picCode |
|||
*/ |
|||
setPicCode(state, picCode) { |
|||
state.picCode = { ...picCode }; |
|||
}, |
|||
}; |
|||
|
|||
export default mutations; |
@ -0,0 +1,6 @@ |
|||
const state = { |
|||
anyringToken: '', |
|||
user: { id: '', phone: '', account: '' }, |
|||
}; |
|||
|
|||
export default state; |