Commit 7b517dda authored by wangqinghua's avatar wangqinghua

update

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