Commit 5c38ee91 authored by wangqinghua's avatar wangqinghua

发现二级菜单

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