消息推送,详情页header

This commit is contained in:
熊丽君
2021-08-20 17:36:05 +08:00
parent eb782ddaf4
commit 19f379a826
7 changed files with 168 additions and 44 deletions

16
src/api/home/news.js Normal file
View File

@ -0,0 +1,16 @@
import request from '@/utils/request';
// 消息通知列表
export function getUserMsgPush(params) {
return request({
url: '/mobile/getUserMsgPush',
params
});
}
// 一条消息已读
export function readPush(params) {
return request({
url: '/mobile/readPush',
params
});
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -5,7 +5,7 @@
ref="form"
:model="form"
:rules="rules"
label-width="80px"
label-width="100px"
style="width:514px"
>
<el-form-item label="企业全称">
@ -131,11 +131,11 @@ export default {
},
optionList1: [
{
value: 1,
value: 2,
label: '地级市'
},
{
value: 2,
value: 3,
label: '合肥区县'
}
],
@ -161,7 +161,7 @@ export default {
userInfo().then(({ data }) => {
if (data) {
data.addressType = data.addressType - 0;
if (data.addressType == 1) {
if (data.addressType == 2) {
this.getType(true, data);
} else {
this.getCity(true, data);
@ -199,7 +199,7 @@ export default {
handleCity(e) {
this.form.cityId = '';
// 地级市
if (e === 1) {
if (e === 2) {
this.getType(false);
} else {
this.getCity(false);
@ -213,7 +213,7 @@ export default {
if (edit) this.form = info;
});
},
// 获取地级市
// 获取区县
getCity(edit, info) {
getDictListByStatus({ type: 6 }).then(({ data }) => {
this.optionList2 = data;
@ -266,5 +266,8 @@ export default {
}
}
}
/deep/.el-form-item__label {
font-size: 16px;
}
}
</style>

View File

@ -38,6 +38,13 @@ export default {
]
};
},
watch: {
$route(newVal, oldVal) {
if (newVal.path === '/mine/info') {
this.index = 0;
}
}
},
methods: {
async logout() {
this.$confirm('确定退出账号吗?', '提示', {

View File

@ -1,15 +1,17 @@
<template>
<div class="news_page">
<div class="list">
<div class="item">
<div class="item" v-for="item in newsList" :key="item.id">
<div class="item_icon">
<div class="red"></div>
<div class="red" v-if="!item.status"></div>
</div>
<div class="item_r">
<div class="item_r_t">
<div class="flex">
<div class="col_333">新政策匹配通知</div>
<div class="col_999">5-29</div>
<div class="col_999">
{{ parseTime(item.createTime, '{m}-{d}') }}
</div>
</div>
</div>
<div class="item_r_b">
@ -18,8 +20,14 @@
现有一项新的符合贵公司条件的政策可申报快查看详情吧
</div>
<!-- 跳转详情 -->
<router-link to="">
<div class="col_333">
<router-link
target="_blank"
:to="{
path: '/result',
query: { key: 'policy', id: item.policyId }
}"
>
<div class="col_333" @click="handleStatus(item)">
查看详情<i class="el-icon-arrow-right"></i>
</div>
</router-link>
@ -27,9 +35,48 @@
</div>
</div>
</div>
<pagination
style="background-color:unset"
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getNewsList"
/>
</div>
</div>
</template>
<script>
import { getUserMsgPush, readPush } from '@/api/home/news';
export default {
data() {
return {
queryParams: {
pageNum: 1,
pageSize: 10
},
total: 0,
newsList: []
};
},
methods: {
getNewsList() {
getUserMsgPush(this.queryParams).then(({ data }) => {
this.newsList = data.list;
this.total = data.total;
});
},
handleStatus(item) {
readPush({ id: item.id }).then(res => {
item.status = 1;
});
}
},
created() {
this.getNewsList();
}
};
</script>
<style lang="scss" scoped>
.news_page {
.list {
@ -39,6 +86,7 @@
padding: 10px;
border-radius: 10px;
background-color: #fff;
margin-bottom: 15px;
.item_icon {
position: relative;
margin-right: 15px;

View File

@ -3,8 +3,19 @@
<div class="list" v-for="item in policyList" :key="item.id">
<div class="item">
<div style="max-width:520px">
<h4 class="pointer text_hidden_one" @click="handleItem(item.id)">
<!-- <h4 class="pointer text_hidden_one" @click="handleItem(item.id)">
{{ item.title }}
</h4> -->
<h4 class="pointer text_hidden_one">
<router-link
target="_blank"
:to="{
path: '/result',
query: { key: 'policy', id: item.id }
}"
>
{{ item.title }}
</router-link>
</h4>
<div class="info">
<div>来源{{ item.source }}</div>

View File

@ -5,20 +5,35 @@
<div class="my_header">
<div class="title content p0-100">
<el-row :gutter="20">
<el-col :span="8"><span>嘉策科技创新服务平台</span></el-col>
<el-col :span="8"
><el-input
<el-col :span="8">
<!-- <span>嘉策科技创新服务平台</span> -->
<img
src="@/assets/logo/logo2.png"
alt=""
style="vertical-align: middle;"
/>
</el-col>
<el-col :span="16">
<el-row
style="justify-content: flex-end;height: 100%;align-items: center;padding-right: 30px;"
>
<el-col :span="8">
<div class="search">
<el-input
v-model.trim="input"
placeholder="请输入搜索关键字"
prefix-icon="el-icon-search"
@keyup.enter.native="toSearch"
></el-input
></el-col>
<el-col :span="8" style="text-align: right">
></el-input>
<el-button type="warning" @click="toSearch">一站搜</el-button>
</div>
</el-col>
</el-row>
</el-col>
<!-- <el-col :span="8" style="text-align: right">
<span
>服务热线<span style="color: #ffa32c">400-0507-580</span></span
>
</el-col>
</el-col> -->
</el-row>
</div>
</div>
@ -98,7 +113,7 @@
target="_blank"
:to="{
path: '/result',
query: { key: 'policy', id: item.id },
query: { key: 'policy', id: item.id }
}"
>
<span></span>{{ item.title }}
@ -115,12 +130,12 @@
<div class="footer_one content">
<p>
<span>
<i><img src="@/assets/image/icon1.png" alt="" /></i>
总浏览量{{total.count}}</span
<i><img src="@/assets/image/icon1.png" alt=""/></i>
总浏览量{{ total.count }}</span
>
<span>
<i><img src="@/assets/image/icon1.png" alt="" /></i>
今日浏览{{total.today}}</span
<i><img src="@/assets/image/icon1.png" alt=""/></i>
今日浏览{{ total.today }}</span
>
</p>
<div class="footer_two">
@ -128,7 +143,7 @@
<div class="footer_left_one">
<span class="footer_left_l">版权声明</span>
<span class="footer_left_r">
<i><img src="@/assets/image/icon3.png" alt="" /></i>
<i><img src="@/assets/image/icon3.png" alt=""/></i>
客服热线(周一至周五8:30-18:00)
</span>
</div>
@ -138,7 +153,7 @@
<div class="footer_left_three">
<span class="footer_left_l">意见反馈</span>
<span class="footer_left_r">
<i><img src="@/assets/image/icon2.png" alt="" /></i>
<i><img src="@/assets/image/icon2.png" alt=""/></i>
公司地址安徽省合肥市蜀山区黄山市601号412-414
</span>
</div>
@ -174,7 +189,7 @@ import {
getPolicyReadInfo,
getInfo,
getInfo2,
getInfo3,
getInfo3
} from '@/api/search';
import { getPolicyList, getRead } from '@/api/home/notice';
import { mapGetters } from 'vuex';
@ -182,7 +197,7 @@ import { add, cancel } from '@/api/search';
import Editor from '@/components/Editor';
export default {
components: {
Editor,
Editor
},
data() {
return {
@ -190,43 +205,43 @@ export default {
type: '',
formData: {},
noticeList: [],
total: {},
total: {}
};
},
watch: {
formData: {
handler: function () {
handler: function() {
this.$nextTick(() => {
this.formatRichText(this.formData.downloadUrl, this.formData.id);
});
}
},
},
deep: true,
deep: true
},
computed: {
...mapGetters(['token']),
...mapGetters(['token'])
},
methods: {
toSearch() {
if (!this.input.length) return this.msgError('请输入搜索关键字');
let routerJump = this.$router.resolve({
path: '/search',
query: { val: this.input },
query: { val: this.input }
});
window.open(routerJump.href, '_blank');
},
addItem() {
add({ policyId: this.formData.id }).then((res) => {
add({ policyId: this.formData.id }).then(res => {
this.formData.collected = 1;
this.msgSuccess('操作成功');
});
},
cancelItem() {
cancel({ policyId: this.formData.id }).then((res) => {
cancel({ policyId: this.formData.id }).then(res => {
this.formData.collected = 0;
this.msgSuccess('操作成功');
});
},
}
},
created() {
let { key, id } = this.$route.query;
@ -263,7 +278,7 @@ export default {
getPolicyList({ pageNum: 1, pageSize: 5 }).then(({ data }) => {
this.noticeList = data.list;
});
},
}
};
</script>
@ -292,11 +307,35 @@ export default {
position: fixed;
z-index: 1;
width: 100%;
height: 46px;
line-height: 46px;
height: 48px;
line-height: 48px;
background: #3d3e3e;
.title {
color: #fff;
.el-row {
display: flex;
.search {
align-items: center;
display: flex;
height: 30px;
overflow: hidden;
/deep/input {
color: #fff;
border-left: 0;
border-right: 0;
border-radius: 6px 0 0 6px;
background-color: rgba(255, 255, 255, 0.2);
}
.el-button {
height: 30px;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
background-color: #ffa32c;
font-size: 16px;
padding: 0 16px;
}
}
}
}
}
.my_main {