Commit 7b517dda authored by wangqinghua's avatar wangqinghua

update

parent 1c62b3e3
...@@ -7,11 +7,15 @@ ...@@ -7,11 +7,15 @@
"proxies": [ "proxies": [
{ {
"path": "/wisdomgroup", "path": "/wisdomgroup",
"proxyUrl": "http://47.103.33.196:8080/wisdomgroup" "proxyUrl": "http://218.78.19.169:8081/wisdomgroup"
}, },
{ {
"path": "/logistics", "path": "/logistics",
"proxyUrl": "http://47.103.33.196:8080/logistics" "proxyUrl": "http://47.103.33.196:8080/logistics"
},
{
"path": "/school",
"proxyUrl": "http://10.10.200.172:8080/school"
} }
] ]
} }
...@@ -60,7 +60,6 @@ export class MyApp { ...@@ -60,7 +60,6 @@ export class MyApp {
this.statusBar.backgroundColorByHexString('#e12724'); this.statusBar.backgroundColorByHexString('#e12724');
this.statusBar.styleLightContent(); this.statusBar.styleLightContent();
timer(4500).subscribe((res) => { timer(4500).subscribe((res) => {
this.showSplash = false; this.showSplash = false;
this.device(); this.device();
......
...@@ -47,10 +47,10 @@ ...@@ -47,10 +47,10 @@
</p> </p>
<div class="tag"> <div class="tag">
<span class="green" *ngIf="item.applyStatus == 2"> <span class="green" *ngIf="item.applyStatus == 2">
通过 通过
</span> </span>
<span class="red" *ngIf="item.applyStatus == 3"> <span class="red" *ngIf="item.applyStatus == 3">
驳回 驳回
</span> </span>
<span class="gray" *ngIf="item.applyStatus == 4"> <span class="gray" *ngIf="item.applyStatus == 4">
已过期 已过期
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<div #fixedTab> <div #fixedTab>
<div class="fixed-toolbar parent-toolbar"> <div class="fixed-toolbar parent-toolbar">
<div class="tabs-fixed "> <div class="tabs-fixed">
<div #scrollTab class="scroll-tab"> <div #scrollTab class="scroll-tab">
<div #newContentParent (scroll)="dragTo($event)" class="news-content parent"> <div #newContentParent (scroll)="dragTo($event)" class="news-content parent">
<div #tabsParent class="tabs-parent parent"> <div #tabsParent class="tabs-parent parent">
......
...@@ -305,10 +305,6 @@ page-discover { ...@@ -305,10 +305,6 @@ page-discover {
background-color: #fff1f0; background-color: #fff1f0;
} }
.scroll-content {
margin-bottom: 50px !important;
}
$slide-height: 220px; $slide-height: 220px;
.slides-content { .slides-content {
......
...@@ -88,40 +88,33 @@ ...@@ -88,40 +88,33 @@
</span> </span>
</div> </div>
</div> </div>
<div #fixedTab>
<!--true 隐藏 false 显示--> <!--true 隐藏 false 显示-->
<div [hidden]="isScroll" class="scroll-tab"> <div class="fixed-toolbar parent-toolbar">
<span class="more" (click)="moreTab()"> <div class="tabs-fixed ">
<ion-icon style="vertical-align: super" name="list"></ion-icon> <div #scrollTab class="scroll-tab">
</span> <div #newContentParent (scroll)="dragTo($event)" class="news-content parent">
<div (scroll)="dragTo($event)" class="news-content parent">
<div #tabsParent class="tabs-parent parent"> <div #tabsParent class="tabs-parent parent">
<div *ngFor="let item of tabsList;let i = index" (click)="change(item)" class="tabs-children"> <div #tabsChildren *ngFor="let item of tabsList;" (click)="change(item)"
<span #tabSpan [ngClass]="{'selectTab':index == i}">{{item.name}}</span> class="tabs-children">
</div> <span #tabSpan [style.color]="index == item.index ? '#e12724':''">
<span #tips class="tips"></span> {{item.name}}
</span>
</div> </div>
<span #tips id="tips"></span>
</div> </div>
</div> </div>
<div [hidden]="!isScroll" class="scroll-tab">
<span class="more" (click)="moreTab()"> <span class="more" (click)="moreTab()">
<ion-icon name="list"></ion-icon> <ion-icon name="list"></ion-icon>
</span> </span>
<!--固定 false -->
<div (scroll)="dragTo($event)" ion-fixed class="news-content ion-fixed parent">
<div class="tabs-parent parent">
<div *ngFor="let item of tabsList;let i = index" (click)="change(item)" class="tabs-children">
<span [ngClass]="{'selectTab':index == i}">{{item.name}}</span>
</div> </div>
<span #tips1 class="tips"></span>
</div> </div>
</div> </div>
</div> </div>
<div id="swiper-article" class="swiper-container">
<div class="swiper-wrapper"> <ion-slides (ionSlideDidChange)="slideChanged()" [loop]="false">
<ng-container *ngIf="slidersItems.length > 0"> <ng-container *ngFor="let item of slideList;let i = index;">
<div [style.top]="isScroll == true?'50px':''" class="swiper-slide" <ion-slide>
*ngFor="let item of slideList;let i = index;">
<ion-content> <ion-content>
<div class="main-news"> <div class="main-news">
<ng-container *ngFor="let new of item;"> <ng-container *ngFor="let new of item;">
...@@ -158,13 +151,15 @@ ...@@ -158,13 +151,15 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
</div> </div>
<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
<ion-infinite-scroll-content
loadingSpinner="bubbles"
loadingText="加载中"></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content> </ion-content>
</div> </ion-slide>
</ng-container> </ng-container>
</div> </ion-slides>
</div>
</ion-content> </ion-content>
<!--政治生日--> <!--政治生日-->
<div *ngIf="isBir" class="signMask" (click)="closeBir()"> <div *ngIf="isBir" class="signMask" (click)="closeBir()">
......
...@@ -176,11 +176,11 @@ page-home { ...@@ -176,11 +176,11 @@ page-home {
//新闻区 //新闻区
.main-news { .main-news {
padding: 0 1rem 4rem 1rem; padding: 0 1rem 0rem 1rem;
text-align: left; text-align: left;
.news-item { .news-item {
padding: .2rem 0; padding: .8rem 0;
.news-left { .news-left {
display: flex; display: flex;
...@@ -269,22 +269,101 @@ page-home { ...@@ -269,22 +269,101 @@ page-home {
.slide-zoom { .slide-zoom {
text-align: left; text-align: left;
height: 100%;
} }
//下拉刷新 .scroll-tab {
ion-infinite-scroll {
overflow: hidden;
}
.scroll-tab{
overflow: initial; overflow: initial;
} }
$slide-height: 220px; $slide-height: 220px;
.slides-content {
height: $slide-height;
.swiper-slide {
width: 100%;
height: $slide-height;
background-color: #e42417;
}
.swiper-wrapper {
width: 100%;
height: $slide-height;
}
.slide-image {
vertical-align: middle;
max-height: 220px;
}
.slide-zoom {
text-align: center;
max-height: 100%;
}
.swiper-container {
height: $slide-height;
width: 100%;
overflow-y: auto;
}
}
.slides-title {
margin-top: 5px;
color: #4c4c4c;
width: 100%;
text-align: left;
height: 2rem;
line-height: 2rem;
padding: 0 1rem;
font-size: 1.4rem;
font-weight: 500;
position: relative;
font-family: "Microsoft YaHei";
.slide-content {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 93%;
}
.slide-index {
position: absolute;
top: 2px;
right: 10px;
color: #e42417;
font-weight: 400;
span:first-child {
font-size: 1.8rem;
}
span:last-child {
font-size: 1.5rem;
}
}
}
.news-content { .news-content {
margin-top: 1.2rem; margin-top: 1.2rem;
} }
.tabs-fixed-scroll {
position: absolute;
z-index: 999;
-webkit-transform: translateZ(0);
transform: translateZ(0);
width: 100%;
.news-content {
margin-top: 0;
transition: all 500ms;
}
}
.slides-content { .slides-content {
height: $slide-height; height: $slide-height;
...@@ -372,5 +451,21 @@ page-home { ...@@ -372,5 +451,21 @@ page-home {
transform: scale(0.8); transform: scale(0.8);
} }
.swiper-slide {
align-items: baseline;
font-size: 1.4rem;
overflow-y: auto;
text-align: left;
}
.slide-zoom {
text-align: left;
width: 100%;
height: 100%;
}
.scroll-content {
margin-bottom: 0 !important;
}
} }
...@@ -21,6 +21,7 @@ import {DatePipe} from "@angular/common"; ...@@ -21,6 +21,7 @@ import {DatePipe} from "@angular/common";
import {SwiperComponent} from "../../../components/swiper/swiper"; import {SwiperComponent} from "../../../components/swiper/swiper";
import {FilterComponent} from "../../../components/filter/filter"; import {FilterComponent} from "../../../components/filter/filter";
import {AppMainService} from "../../../app/app.service"; import {AppMainService} from "../../../app/app.service";
import {timer} from "rxjs/observable/timer";
declare let Swiper: any; declare let Swiper: any;
...@@ -32,18 +33,22 @@ declare let Swiper: any; ...@@ -32,18 +33,22 @@ declare let Swiper: any;
export class HomePage { export class HomePage {
@ViewChild(Content) content: Content; @ViewChild(Content) content: Content;
@ViewChild(Slides) slides: Slides;
@ViewChild('tips') tips: ElementRef; @ViewChild('tips') tips: ElementRef;
@ViewChild('tips1') tips1: ElementRef; @ViewChild('fixedTab') fixedTab: ElementRef;
@ViewChild('verticaLamp') verticaLamp: ElementRef;
@ViewChild('tabsParent') tabsParent: ElementRef;
@ViewChild('topHeight') topHeight: ElementRef; @ViewChild('topHeight') topHeight: ElementRef;
@ViewChild('tabsParent') tabsParent: ElementRef;
@ViewChild('tabsChildren') tabsChildren: ElementRef;
@ViewChild('tabSpan') tabSpan: ElementRef;
@ViewChild('newsContent') newsContent: ElementRef;
@ViewChild('newContentParent') newContentParent: ElementRef;
@ViewChild('scrollTab') scrollTab: ElementRef;
@ViewChild('verticaLamp') verticaLamp: ElementRef;
@ViewChild('headerTag') headerTag: ElementRef; @ViewChild('headerTag') headerTag: ElementRef;
@ViewChild('homeMiddleTips') homeMiddleTips: ElementRef; @ViewChild('homeMiddleTips') homeMiddleTips: ElementRef;
@ViewChild('infiniteScrollContentEle') infiniteScrollContentEle: ElementRef; @ViewChild('infiniteScrollContentEle') infiniteScrollContentEle: ElementRef;
@ViewChild(InfiniteScrollContent) InfiniteScrollContent: InfiniteScrollContent;
swiperImg; swiperImg;
swiperArticle;
picture: string = AppGlobal.domain + '/wisdomgroup'; picture: string = AppGlobal.domain + '/wisdomgroup';
slideTitle; slideTitle;
...@@ -61,7 +66,6 @@ export class HomePage { ...@@ -61,7 +66,6 @@ export class HomePage {
]; ];
isSign = false; //签到弹窗 isSign = false; //签到弹窗
isBir = false; //政治生日弹窗 isBir = false; //政治生日弹窗
isScroll = false; //tabs置顶
noReadNum; noReadNum;
initSlide = 0; initSlide = 0;
...@@ -75,7 +79,7 @@ export class HomePage { ...@@ -75,7 +79,7 @@ export class HomePage {
partyObj; //政治生日 partyObj; //政治生日
plateType; plateType;
index = 0; index;
slideList = []; slideList = [];
itemWidth; itemWidth;
...@@ -133,18 +137,23 @@ export class HomePage { ...@@ -133,18 +137,23 @@ export class HomePage {
) )
} }
slideChanged() {
const index = this.slides.realIndex;
this.change(this.tabsList[index]);
}
ionViewDidLoad() { ionViewDidLoad() {
this.getBanner(); this.getBanner();
this.getInfo();
this.scrollHeight();
this.initSwiper();
timer(20).subscribe(() => {
const htmlFontSize = getComputedStyle(window.document.documentElement)['font-size']; const htmlFontSize = getComputedStyle(window.document.documentElement)['font-size'];
this.itemWidth = htmlFontSize.split("px")[0] * 8; this.itemWidth = htmlFontSize.split("px")[0] * 8;
this.spanWidth = this.tabsParent.nativeElement.children[0].children[0].offsetWidth; //文字宽度 this.spanWidth = this.tabsParent.nativeElement.children[0].children[0].offsetWidth; //文字宽度
this.tips.nativeElement.style.width = this.spanWidth + 'px';
this.tips1.nativeElement.style.width = this.spanWidth + 'px';
this.getInfo();
this.scrollHeight();
this.change(this.tabsList[0]); this.change(this.tabsList[0]);
this.initSwiper(); });
} }
//初始化swiper //初始化swiper
...@@ -179,42 +188,30 @@ export class HomePage { ...@@ -179,42 +188,30 @@ export class HomePage {
}, },
} }
}); });
this.swiperArticle = new Swiper('#swiper-article', {
slidesPerView: 1,
speed: 1000,
autoplay: false,//可选选项,自动滑动
observer: true,
observeParents: true,
observeSlideChildren: true,
loop: false,
on: {
slideChangeTransitionEnd: function () {
that.swiperArticle.update();
that.change(that.tabsList[this.activeIndex]);
},
}
})
} }
//文章分类固定
scrollHeight() { scrollHeight() {
const height = this.topHeight.nativeElement.offsetHeight; const height = this.topHeight.nativeElement.offsetHeight;
this.content.ionScroll.subscribe(($event) => { this.content.ionScroll.subscribe(($event) => {
this.zone.run(() => { this.zone.run(() => {
if (this.content.scrollTop > height) { if (this.content.scrollTop > height) {
this.isScroll = true; this.renderer.addClass(this.fixedTab.nativeElement, 'tabs-fixed-scroll')
} else { } else {
this.isScroll = false; this.renderer.removeClass(this.fixedTab.nativeElement, 'tabs-fixed-scroll')
} }
}) })
}) })
} }
change(item) { change(item) {
this.pageNum = 1; console.log('213');
if (this.index === item.index) return;
this.index = item.index; this.index = item.index;
this.pageNum = 1;
this.tips.nativeElement.style.width = this.tabSpan.nativeElement.offsetWidth + 'px';
// 自身div的一半 - 滑块的一半 // 自身div的一半 - 滑块的一半
this.tips.nativeElement.style.left = this.itemWidth * (this.index) + (this.itemWidth - this.spanWidth) / 2 + 'px'; this.tips.nativeElement.style.left = this.itemWidth * (this.index) + (this.itemWidth - this.spanWidth) / 2 + 'px';
this.tips1.nativeElement.style.left = this.itemWidth * (this.index) + (this.itemWidth - this.spanWidth) / 2 + 'px';
this.plateType = item.type; this.plateType = item.type;
const data = { const data = {
...@@ -228,6 +225,7 @@ export class HomePage { ...@@ -228,6 +225,7 @@ export class HomePage {
this.tabsSer.stuffPage(data).subscribe( this.tabsSer.stuffPage(data).subscribe(
(res) => { (res) => {
let arr = res.data.list; let arr = res.data.list;
this.total = res.data.total;
if (arr.length > 0) { if (arr.length > 0) {
arr.forEach(e => { arr.forEach(e => {
if (e.attachments.length > 0) { if (e.attachments.length > 0) {
...@@ -236,19 +234,23 @@ export class HomePage { ...@@ -236,19 +234,23 @@ export class HomePage {
}); });
this.slideList[this.index] = arr; this.slideList[this.index] = arr;
} }
if (this.swiperArticle) this.swiperArticle.slideTo(this.index, 500); console.log(arr);
this.getMore(res); this.slides.slideTo(this.index, 500);
} }
) )
} }
//加载更多 //加载更多
getMore(res) { doInfinite(e) {
const totalNum: number = res.data.total; console.log('doInfinite');
if (totalNum < this.pageSize) return false; if (this.total < this.pageSize || this.total == this.pageSize) {
e.complete();
return false;
}
this.pageNum++;
const data = { const data = {
pageNum: 1, pageNum: this.pageNum,
pageCount: totalNum, pageCount: 10,
obj: { obj: {
'plateType': this.plateType, 'plateType': this.plateType,
'resourceType': 1 'resourceType': 1
...@@ -256,7 +258,8 @@ export class HomePage { ...@@ -256,7 +258,8 @@ export class HomePage {
}; };
this.tabsSer.stuffPage(data).subscribe( this.tabsSer.stuffPage(data).subscribe(
(res) => { (res) => {
res.data.list.splice(0, 10); e.complete();
console.log('e.complete();');
res.data.list.forEach(e => { res.data.list.forEach(e => {
if (e.attachments.length > 0) { if (e.attachments.length > 0) {
e.imgUrl = e.attachments[0].path; e.imgUrl = e.attachments[0].path;
...@@ -419,7 +422,6 @@ export class HomePage { ...@@ -419,7 +422,6 @@ export class HomePage {
this.slideList[this.index] = arr; this.slideList[this.index] = arr;
setTimeout(() => { setTimeout(() => {
this.commonSer.toastTime('刷新成功!', 800); this.commonSer.toastTime('刷新成功!', 800);
this.getMore(res);
e.complete(); e.complete();
}, 800) }, 800)
} }
...@@ -446,7 +448,7 @@ export class HomePage { ...@@ -446,7 +448,7 @@ export class HomePage {
list: this.tabsList, list: this.tabsList,
type: this.plateType, type: this.plateType,
title: '我的频道', title: '我的频道',
desc:'点击进入我的频道' desc: '点击进入我的频道'
}, { }, {
enterAnimation: 'modal-from-right-enter', enterAnimation: 'modal-from-right-enter',
leaveAnimation: 'modal-from-right-leave' leaveAnimation: 'modal-from-right-leave'
......
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