Commit 5c38ee91 authored by wangqinghua's avatar wangqinghua

发现二级菜单

parent eb1043ff
......@@ -203,8 +203,8 @@ p {
#tips {
position: absolute;
bottom: 0;
height: 3px;
bottom: 5px;
height: 2px;
width: 3rem;
background-color: #e12724;
-webkit-transition: left 500ms;
......
[
{
"name": "支部风采",
"type": 13,
"index": 0,
"children": [
{
"name": "推荐",
"type": 13
},
{
"name": "支部活动",
"type": 13
},
{
"name": "党建联建",
"type": 14
},
{
"name": "结对帮扶",
"type": 15
}
]
},
{
"name": "机关党委",
"type": 5,
"index": 1,
"children": [
{
"name": "最新",
"type": 5
},
{
"name": "通知公告",
"type": 5
},
{
"name": "党建动态",
"type": 6
},
{
"name": "工作提示",
"type": 7
},
{
"name": "党务参考",
"type": 8
}
]
},
{
"name": "党风廉政",
"type": 9,
"index": 2,
"children": [
{
"name": "最新",
"type": 9
},
{
"name": "廉政格言",
"type": 9
},
{
"name": "纪检提示",
"type": 10
},
{
"name": "风险排查",
"type": 11
},
{
"name": "警示教育",
"type": 12
}
]
},
{
"name": "互动交流",
"type": -1,
"index": 3,
"children": [
{
"name": "最新",
"type": -1
},
{
"name": "学思践悟",
"type": -1
},
{
"name": "话题讨论",
"type": -1
},
{
"name": "你问我答",
"type": -1
}
]
},
{
"name": "知识拓展",
"type": -1,
"index": 4,
"children": []
}
]
\ No newline at end of file
......@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>智汇组工</title>
<title>部机关党建云平台</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<!-- <meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> -->
......
......@@ -38,24 +38,43 @@
<span>{{item.publishTime | date:'yyyy-MM-dd'}}</span>
</p>
<div class="item-news">
<ion-row class="news-item">
<ion-col col-8 class="news-left">
<p class="news-title">{{item.title}}</p>
<p class="news-end">
<ion-icon style="font-size: 2.5rem;vertical-align: sub" name="eye"></ion-icon>
<span>{{item.browseCount}}</span>
<ion-icon name="chatboxes"></ion-icon>
<span>{{item.commentCount}}</span>
<ion-icon name="thumbs-up"></ion-icon>
<span>{{item.likeCount}}</span>
<ion-icon name="heart"></ion-icon>
<span>{{item.collectionCount}}</span>
</p>
</ion-col>
<ion-col col-4 class="news-right">
<img src="./assets/imgs/demo.png">
</ion-col>
</ion-row>
<ng-container *ngIf="item.imgUrl">
<ion-row class="news-item">
<ion-col col-8 class="news-left">
<p class="news-title">{{item.title}}</p>
<p class="news-end">
<ion-icon style="font-size: 2.5rem;vertical-align: sub" name="eye"></ion-icon>
<span>{{item.browseCount}}</span>
<ion-icon name="chatboxes"></ion-icon>
<span>{{item.commentCount}}</span>
<ion-icon name="thumbs-up"></ion-icon>
<span>{{item.likeCount}}</span>
<ion-icon name="heart"></ion-icon>
<span>{{item.collectionCount}}</span>
</p>
</ion-col>
<ion-col col-4 class="news-right">
<img [src]="picture+item.imgUrl">
</ion-col>
</ion-row>
</ng-container>
<ng-container *ngIf="!item.imgUrl">
<ion-row class="news-item">
<ion-col col-12 class="news-left">
<p class="news-title">{{item.title}}</p>
<p class="news-end">
<ion-icon style="font-size: 2.5rem;vertical-align: sub" name="eye"></ion-icon>
<span>{{item.browseCount}}</span>
<ion-icon name="chatboxes"></ion-icon>
<span>{{item.commentCount}}</span>
<ion-icon name="thumbs-up"></ion-icon>
<span>{{item.likeCount}}</span>
<ion-icon name="heart"></ion-icon>
<span>{{item.collectionCount}}</span>
</p>
</ion-col>
</ion-row>
</ng-container>
</div>
</div>
</ng-container>
......
......@@ -55,6 +55,7 @@ page-search-new {
align-self: flex-start;
font-weight: bold;
width: 100%;
padding: .5rem 0;
}
.news-end{
align-self: flex-end;
......@@ -66,8 +67,9 @@ page-search-new {
}
}
.news-right{
padding: 5px 0;
text-align: center;
img{
height: 60px;
border-radius: .5rem;
}
}
......
......@@ -2,6 +2,7 @@ import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {TabsService} from "../../tabs/tabs.service";
import {StuffDetailPage} from "../stuff-detail/stuff-detail";
import {AppGlobal} from "../../../service/http.service";
@IonicPage()
......@@ -11,6 +12,7 @@ import {StuffDetailPage} from "../stuff-detail/stuff-detail";
})
export class SearchNewPage {
picture: string = AppGlobal.domain + '/wisdomgroup';
newList = [];
searchObj = {
title:'',
......@@ -41,6 +43,11 @@ export class SearchNewPage {
this.tabs.stuffPage(data).subscribe(
(res)=>{
this.newList = res.data;
this.newList.forEach(e => {
if (e.attachments.length > 0) {
e.imgUrl = e.attachments[0].path;
}
})
}
)
}
......
......@@ -25,4 +25,20 @@ page-learn-manage {
font-size: 1.5rem;
border-radius: 2px;
}
.tabs-parent {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
position: relative;
background-color: #fff;
margin-bottom: .5rem;
font-size: 1.7rem;
.tabs-children {
flex: 1;
text-align: center;
cursor: pointer;
height: 4rem;
line-height: 4rem;
}
}
}
......@@ -18,7 +18,7 @@
<ion-content padding>
<ion-list radio-group [(ngModel)]="group" >
<ion-list radio-group [(ngModel)]="group" (ionChange)="change()">
<ion-item *ngFor="let item of batchList;let i = index;" >
<ion-label>{{item.groupName}}</ion-label>
<ion-label>{{item.groupCount}}人</ion-label>
......
......@@ -27,13 +27,22 @@
<div class="scroll-tab">
<div class="news-content">
<div #tabsParent class="tabs-parent">
<div #tabsChildren *ngFor="let item of tabsList;" (click)="change(item)" class="tabs-children">
<span #tabSpan [style.color]="index == item.type ? '#e12724':''">{{item.name}}</span>
</div>
<div #tabsChildren *ngFor="let item of tabsList;" (click)="changeParent(item)" class="tabs-children">
<span #tabSpan [style.color]="indexParent == item.indexParent ? '#e12724':''">{{item.name}}</span>
</div>
<span #tips id="tips"></span>
</div>
</div>
</div>
<div class="scroll-tab">
<div class="news-content" #newsContent>
<div class="tabs-parent">
<div class="tabs-child">
<span *ngFor="let ch of childrenList" [ngClass]="{'select':indexChildren == ch.indexChildren}" (click)="changeChildren(ch)">{{ch.name}}</span>
</div>
</div>
</div>
</div>
<div class="search-content">
<ng-container *ngFor="let item of newList">
......
......@@ -73,7 +73,7 @@ page-discover {
display: flex;
flex-flow: row wrap;
min-height: 100%;
padding: 5px 0;
padding: 5px;
.news-title{
align-self: flex-start;
font-weight: bold;
......@@ -91,7 +91,8 @@ page-discover {
}
}
.news-right{
padding: 5px 0;
padding: 5px;
text-align: center;
img{
border-radius: .5rem;
}
......@@ -101,4 +102,24 @@ page-discover {
border-top: 1px solid #eeeeee;
}
}
.tabs-child{
padding: 0 1rem;
span{
display: inline-block;
background-color: #f2f2f2;
color: #777777;
border-radius: 5px;
margin-right: 10px;
width: 6rem;
padding: 3px 0;
text-align: center;
font-size: 1.4rem;
border: 1px solid #f2f2f2;
}
span.select{
background-color: #fed3d3;
color: #e12724;
border: 1px solid #e12724;
}
}
}
......@@ -19,15 +19,123 @@ export class DiscoverPage {
@ViewChild('tabsParent') tabsParent: ElementRef;
@ViewChild('tabsChildren') tabsChildren: ElementRef;
@ViewChild('tabSpan') tabSpan: ElementRef;
@ViewChild('newsContent') newsContent: ElementRef;
//所属板块类型:
//1党章党规,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,8党务参考
//9廉政格言,10纪检提示,11风险排查,12警示教育,13支部活动,14党建联建,15结对帮扶
tabsList = [
{name: "支部风采", type: 13, index: 0},
{name: "机关党委", type: 5, index: 1},
{name: "党风廉政", type: 9, index: 2},
{name: "互动交流", type: -1, index: 3},
{name: "知识拓展", type: -1, index: 4},
{
"name": "支部风采", "type": 13, "indexParent": 0, "children": [
{
"name": "推荐",
"type": 13,
"indexChildren": '01'
},
{
"name": "支部活动",
"type": 13,
"indexChildren": '02'
},
{
"name": "党建联建",
"type": 14,
"indexChildren": '03'
},
{
"name": "结对帮扶",
"type": 15,
"indexChildren": '04'
}
]
},
{
"name": "机关党委", "type": 5, "indexParent": 1, "children": [
{
"name": "最新",
"type": 5,
"indexChildren": '11'
},
{
"name": "通知公告",
"type": 5,
"indexChildren": '12'
},
{
"name": "党建动态",
"type": 6,
"indexChildren": '13'
},
{
"name": "工作提示",
"type": 7,
"indexChildren": '14'
},
{
"name": "党务参考",
"type": 8,
"indexChildren": '15'
}
]
},
{
"name": "党风廉政", "type": 9, "indexParent": 2, "children": [
{
"name": "最新",
"type": 9,
"indexChildren": '21'
},
{
"name": "廉政格言",
"type": 9,
"indexChildren": '22'
},
{
"name": "纪检提示",
"type": 10,
"indexChildren": '23'
},
{
"name": "风险排查",
"type": 11,
"indexChildren": '24'
},
{
"name": "警示教育",
"type": 12,
"indexChildren": '25'
}
]
},
{
"name": "互动交流", "type": -1, "indexParent": 3, "children": [
{
"name": "最新",
"type": -1,
"indexChildren": '31'
},
{
"name": "学思践悟",
"type": -1,
"indexChildren": '32'
},
{
"name": "话题讨论",
"type": -1,
"indexChildren": '33'
},
{
"name": "你问我答",
"type": -1,
"indexChildren": '34'
}]
},
{"name": "知识拓展", "type": -1, "indexParent": 4, "children": []}
];
index = 0;
childrenList = [];
indexParent = 0;
indexChildren = 0;
isSign = false;
newList; //新闻列表
noReadNum;
......@@ -44,28 +152,54 @@ export class DiscoverPage {
}
ionViewDidEnter() {
this.change(this.tabsList[0]);
this.changeParent(this.tabsList[0]);
}
//所属板块类型:
//1党章党规,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,8党务参考
//9廉政格言,10纪检提示,11风险排查,12警示教育,13支部活动,14党建联建,15结对帮扶
change(item) {
const index = item.index;
//父级选择
changeParent(item) {
console.log(this.newsContent);
this.newsContent.nativeElement.scrollLeft = 0; //二级菜单滑动重置
const index = item.indexParent;
this.indexParent = index;
this.childrenList = item.children;
this.indexChildren = this.childrenList[0].indexChildren;
let itemWidth = window.screen.width / 4;
let spanWidth = this.tabSpan.nativeElement.offsetWidth; //文字宽度
this.tips.nativeElement.style.width = this.tabSpan.nativeElement.offsetWidth + 'px';
// 自身div的一半 - 滑块的一半
this.tips.nativeElement.style.left = itemWidth * (index) + (itemWidth - spanWidth) / 2 + 'px';
this.index = index;
const data = {
pageSize: 1,
pageCount: 100,
obj: {
'plateType': item.type,
resourceType: 1
'resourceType': 1
}
};
this.tabsSer.stuffPage(data).subscribe(
(res) => {
this.newList = res.data;
this.newList.forEach(e => {
if (e.attachments.length > 0) {
e.imgUrl = e.attachments[0].path;
}
})
}
)
}
//子级选择
changeChildren(item) {
this.indexChildren = item.indexChildren;
const data = {
pageSize: 1,
pageCount: 100,
obj: {
'plateType': item.type,
'resourceType': 1
}
}
};
this.tabsSer.stuffPage(data).subscribe(
(res) => {
this.newList = res.data;
......
......@@ -10,12 +10,9 @@
<ion-icon class="search-icon" name="search"></ion-icon>
</ion-buttons>
<ion-buttons end>
<button ion-button icon-only *ngIf="signObj.isSign == 'no'" (click)="signNow()" class="toolbar-signUp">
<button ion-button icon-only (click)="signNow()" class="toolbar-signUp">
<span class="signUp-span">签到</span>
</button>
<button ion-button icon-only *ngIf="signObj.isSign == 'yes'" class="toolbar-signUp">
<span class="signUp-span">已签到</span>
</button>
</ion-buttons>
<ion-buttons end>
<button ion-button icon-only (click)="goToNotice()" class="toolbar-icon">
......@@ -95,8 +92,8 @@
{{signObj.text}}
</div>
<div class="mask-button">
<button *ngIf="signObj.isSign == 'no'" [disabled]="disabledClick" class="submit-btn submit"
(click)="signUp()">签到{{signText}}</button>
<button *ngIf="signObj.isSign == 'no'" [disabled]="disabledClick" class="submit-btn submit" (click)="signUp()">签到{{signText}}</button>
<button *ngIf="signObj.isSign == 'yes'" [disabled]="true" class="submit-btn submit">已签到</button>
</div>
</div>
</div>
......@@ -146,6 +146,7 @@ page-home {
}
.news-right {
text-align: center;
img {
border-radius: .5rem;
height: 60px;
......
......@@ -82,6 +82,7 @@ export class HomePage {
}
//跑马灯
lineChange() {
let child_div = this.lineChangeEle.nativeElement.children;
setTimeout(() => {
......@@ -197,9 +198,8 @@ export class HomePage {
)
}
//签到
//签到接口
signUp() {
this.signObj.isSign = 'yes';
this.tabsSer.sign().subscribe(
(res) => {
this.isSign = false;
......@@ -212,7 +212,7 @@ export class HomePage {
)
}
//签到
//签到倒计时
signNow() {
this.isSign = true;
let totalTime = 5;
......@@ -240,7 +240,6 @@ export class HomePage {
this.navCtrl.push(SearchNewPage);
}
//消息提醒页面
goToNotice() {
this.navCtrl.push(NoticePage);
......
......@@ -139,5 +139,10 @@ export class TabsService {
return this.http.get(AppGlobal.domain + '/wisdomgroup/sysmanagement/usergroup/search.ajax');
}
//获取文章分类
getType(): Observable<any> {
return this.http.get('./assets/json/party.json');
}
}
\ No newline at end of file
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 to comment