Commit c5a3660a authored by wangqinghua's avatar wangqinghua

上传进度

parent ab1071c7
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"proxies": [ "proxies": [
{ {
"path": "/wisdomgroup", "path": "/wisdomgroup",
"proxyUrl": "http://47.103.35.216:8080/wisdomgroup" "proxyUrl": "http://192.168.2.235:8080/wisdomgroup"
} }
] ]
} }
\ No newline at end of file
This diff is collapsed.
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":303},"path":"app-debug.apk","properties":{"packageId":"io.ionic.partyCloud.starter.test","split":"","minSdkVersion":"16"}}] [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":305},"path":"app-debug.apk","properties":{"packageId":"io.ionic.partyCloud.starter.test","split":"","minSdkVersion":"16"}}]
\ No newline at end of file \ No newline at end of file
...@@ -176,7 +176,7 @@ document.getElementById(id).style.display = 'none'; ...@@ -176,7 +176,7 @@ document.getElementById(id).style.display = 'none';
<span class="mdl-layout-title">Lint Report: 1 error</span> <span class="mdl-layout-title">Lint Report: 1 error</span>
<div class="mdl-layout-spacer"></div> <div class="mdl-layout-spacer"></div>
<nav class="mdl-navigation mdl-layout--large-screen-only"> <nav class="mdl-navigation mdl-layout--large-screen-only">
Check performed at Wed May 15 17:47:29 CST 2019 </nav> Check performed at Mon May 20 10:39:15 CST 2019 </nav>
</div> </div>
</header> </header>
<div class="mdl-layout__drawer"> <div class="mdl-layout__drawer">
......
...@@ -175,7 +175,6 @@ ion-navbar .header-ios .toolbar-ios:last-child .toolbar-background-ios { ...@@ -175,7 +175,6 @@ ion-navbar .header-ios .toolbar-ios:last-child .toolbar-background-ios {
width: 100%; width: 100%;
.tabs-parent { .tabs-parent {
position: relative; position: relative;
margin-bottom: .5rem;
font-size: 1.7rem; font-size: 1.7rem;
white-space: nowrap; white-space: nowrap;
background-color: #fff1f0; background-color: #fff1f0;
...@@ -210,7 +209,7 @@ ion-navbar .header-ios .toolbar-ios:last-child .toolbar-background-ios { ...@@ -210,7 +209,7 @@ ion-navbar .header-ios .toolbar-ios:last-child .toolbar-background-ios {
#tips,.tips { #tips,.tips {
position: absolute; position: absolute;
bottom: 0px; bottom: 1px;
height: 2px; height: 2px;
width: 3rem; width: 3rem;
background-color: #e12724; background-color: #e12724;
...@@ -394,7 +393,7 @@ a[disabled], button[disabled], [ion-button][disabled], ...@@ -394,7 +393,7 @@ a[disabled], button[disabled], [ion-button][disabled],
font-size: 2.5rem; font-size: 2.5rem;
} }
50%{ 50%{
font-size: 3.5rem; font-size: 4.2rem;
} }
100%{ 100%{
font-size: 2.5rem; font-size: 2.5rem;
...@@ -429,4 +428,4 @@ a[disabled], button[disabled], [ion-button][disabled], ...@@ -429,4 +428,4 @@ a[disabled], button[disabled], [ion-button][disabled],
} }
} }
} }
} }
\ No newline at end of file
...@@ -5,8 +5,11 @@ ...@@ -5,8 +5,11 @@
</ion-slide> </ion-slide>
</ion-slides> </ion-slides>
</div> </div>
<p class="slides-title" *ngIf="slidersItems.length>0"> <div class="slides-title" *ngIf="slidersItems.length>0">
{{slideTitle}}<span class="slide-index" float-end> <div class="slide-content">
{{slideTitle}}
</div>
<span class="slide-index">
<span>{{slideIndex}}</span><span>/{{slidersItems.length}}</span> <span>{{slideIndex}}</span><span>/{{slidersItems.length}}</span>
</span> </span>
</p> </div>
\ No newline at end of file
...@@ -43,8 +43,18 @@ slide { ...@@ -43,8 +43,18 @@ slide {
padding: 0 1rem; padding: 0 1rem;
font-size: 1.4rem; font-size: 1.4rem;
font-weight: 500; font-weight: 500;
position: relative;
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
.slide-content{
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis;
width: 93%;
}
.slide-index{ .slide-index{
position: absolute;
top: 2px;
right: 10px;
color: #e42417; color: #e42417;
font-weight: 400; font-weight: 400;
span:first-child{ span:first-child{
......
...@@ -39,9 +39,6 @@ export class SlideComponent implements AfterViewInit{ ...@@ -39,9 +39,6 @@ export class SlideComponent implements AfterViewInit{
this.slidersItems = res.data.list; this.slidersItems = res.data.list;
if(this.slidersItems.length > 0){ if(this.slidersItems.length > 0){
this.slidersItems.forEach(e => { this.slidersItems.forEach(e => {
if (e.title.length > 16) {
e.title = e.title.substr(0, 20) + '...';
}
if (e.attachments.length > 0) { if (e.attachments.length > 0) {
e.imgUrl = e.attachments[0].path; e.imgUrl = e.attachments[0].path;
} }
......
...@@ -111,7 +111,7 @@ export class PublishPage { ...@@ -111,7 +111,7 @@ export class PublishPage {
const option: FileUploadOptions = { const option: FileUploadOptions = {
httpMethod: 'POST', httpMethod: 'POST',
headers: { headers: {
'Accept': 'application/json', //不加入 发生错误!! 'Accept': 'application/json',
}, },
fileName:'image.png' fileName:'image.png'
}; };
...@@ -198,6 +198,11 @@ export class PublishPage { ...@@ -198,6 +198,11 @@ export class PublishPage {
uploadLoading.dismiss(); uploadLoading.dismiss();
this.commonSer.toast('上传错误'); this.commonSer.toast('上传错误');
}); });
fileTransfer.onProgress((listener)=>{
let per =<any> (listener.loaded / listener.total) *100;
per = Math.round(per*Math.pow(10,2))/Math.pow(10,2)
uploadLoading.setContent('上传中...' + per + '%' );
})
} }
//发布 //发布
...@@ -231,7 +236,7 @@ export class PublishPage { ...@@ -231,7 +236,7 @@ export class PublishPage {
plateType: this.obj.type, plateType: this.obj.type,
source: '上海市委组织部', source: '上海市委组织部',
publishStatus: '2', //已提交 publishStatus: '2', //已提交
content: content, content: `&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;` + content,
publishRange: this.obj.publishRange, publishRange: this.obj.publishRange,
submitter: this.userid, submitter: this.userid,
stuffType: this.type === 'image'?1:2, //图片 1 视频 2 stuffType: this.type === 'image'?1:2, //图片 1 视频 2
...@@ -249,7 +254,6 @@ export class PublishPage { ...@@ -249,7 +254,6 @@ export class PublishPage {
}) })
} }
check(){ check(){
if(!this.obj.title){ if(!this.obj.title){
this.commonSer.toast('请输入文章标题!'); this.commonSer.toast('请输入文章标题!');
...@@ -290,7 +294,7 @@ export class PublishPage { ...@@ -290,7 +294,7 @@ export class PublishPage {
title:this.obj.title, title:this.obj.title,
source: '上海市委组织部', source: '上海市委组织部',
publishTime:new Date().getTime(), publishTime:new Date().getTime(),
content:content, content:`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;` + content ,
attachments:this.fileList, attachments:this.fileList,
} }
this.navCtrl.push('PreviewPage',{ this.navCtrl.push('PreviewPage',{
......
...@@ -101,7 +101,7 @@ export class PersonInfoPage { ...@@ -101,7 +101,7 @@ export class PersonInfoPage {
const option: FileUploadOptions = { const option: FileUploadOptions = {
httpMethod: 'post', httpMethod: 'post',
headers: { headers: {
'Accept': 'application/json', //不加入 发生错误!! 'Accept': 'application/json',
}, },
fileName:'image.png' fileName:'image.png'
}; };
...@@ -133,6 +133,11 @@ export class PersonInfoPage { ...@@ -133,6 +133,11 @@ export class PersonInfoPage {
uploadLoading.dismiss(); uploadLoading.dismiss();
this.commonSer.toast('上传错误'); this.commonSer.toast('上传错误');
}); });
fileTransfer.onProgress((listener)=>{
let per =<any> (listener.loaded / listener.total) *100;
per = Math.round(per*Math.pow(10,2))/Math.pow(10,2)
uploadLoading.setContent('上传中...' + per + '%' );
})
} }
goBack() { goBack() {
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
<ion-icon class="search-icon" name="search"></ion-icon> <ion-icon class="search-icon" name="search"></ion-icon>
</button> </button>
</ion-buttons> </ion-buttons>
<ion-buttons>
积分
</ion-buttons>
<ion-buttons>
庆华
</ion-buttons>
<ion-buttons end> <ion-buttons end>
<button ion-button icon-only (click)="signNow()" class="toolbar-signUp"> <button ion-button icon-only (click)="signNow()" class="toolbar-signUp">
<span class="signUp-span"> <span class="signUp-span">
...@@ -22,6 +28,7 @@ ...@@ -22,6 +28,7 @@
</ion-buttons> </ion-buttons>
</ion-navbar> </ion-navbar>
</ion-header> </ion-header>
<ion-content overflow-scroll="false"> <ion-content overflow-scroll="false">
<ion-refresher (ionRefresh)="doRefresh($event)"> <ion-refresher (ionRefresh)="doRefresh($event)">
<ion-refresher-content pullingText="下拉刷新" <ion-refresher-content pullingText="下拉刷新"
...@@ -47,8 +54,8 @@ ...@@ -47,8 +54,8 @@
<slide (done)="goToDetail($event)"></slide> <slide (done)="goToDetail($event)"></slide>
</div> </div>
<!--true 隐藏 false 显示--> <!--true 隐藏 false 显示-->
<div [hidden]="isScroll" class="news-content"> <div [hidden]="isScroll" class="news-content parent">
<div class="tabs-parent"> <div class="tabs-parent parent">
<div *ngFor="let item of tabsList;let i = index" (click)="change(item)" class="tabs-children"> <div *ngFor="let item of tabsList;let i = index" (click)="change(item)" class="tabs-children">
<span #tabSpan [ngClass]="{'selectTab':index == i}">{{item.name}}</span> <span #tabSpan [ngClass]="{'selectTab':index == i}">{{item.name}}</span>
</div> </div>
...@@ -57,8 +64,8 @@ ...@@ -57,8 +64,8 @@
</div> </div>
<!--固定 false --> <!--固定 false -->
<div [hidden]="!isScroll" ion-fixed class="news-content ion-fixed"> <div [hidden]="!isScroll" ion-fixed class="news-content ion-fixed parent">
<div class="tabs-parent"> <div class="tabs-parent parent">
<div *ngFor="let item of tabsList;let i = index" (click)="change(item)" class="tabs-children"> <div *ngFor="let item of tabsList;let i = index" (click)="change(item)" class="tabs-children">
<span #tabSpan1 [ngClass]="{'selectTab':index == i}">{{item.name}}</span> <span #tabSpan1 [ngClass]="{'selectTab':index == i}">{{item.name}}</span>
</div> </div>
......
...@@ -111,6 +111,12 @@ page-home { ...@@ -111,6 +111,12 @@ page-home {
.news-content.ion-fixed{ .news-content.ion-fixed{
margin: 0; margin: 0;
} }
.parent.tabs-parent{
background-color: #fff1f0;
}
.parent.news-content{
background-color: #fff1f0;
}
.ion-fixed + ion-slides{ .ion-fixed + ion-slides{
margin-top: 2rem; margin-top: 2rem;
} }
......
import {Component, ElementRef, ViewChild, NgZone, Renderer2, Input} from '@angular/core'; import {Component, ElementRef, ViewChild, NgZone, Renderer2, Input} from '@angular/core';
import {NavController, IonicPage, Slides, Content, InfiniteScrollContent} from 'ionic-angular'; import {NavController, IonicPage, Slides, Content, InfiniteScrollContent, FabList, FabContainer} from 'ionic-angular';
import {Http, Response} from '@angular/http'; import {Http, Response} from '@angular/http';
import {AppService, AppGlobal} from '../../../service/http.service'; import {AppService, AppGlobal} from '../../../service/http.service';
import {Storage} from '@ionic/storage'; import {Storage} from '@ionic/storage';
...@@ -22,7 +22,6 @@ import {SlideComponent} from "../../../components/slide/slide"; ...@@ -22,7 +22,6 @@ import {SlideComponent} from "../../../components/slide/slide";
}) })
export class HomePage { export class HomePage {
@ViewChild(Slides) slides1: Slides; @ViewChild(Slides) slides1: Slides;
@ViewChild(Content) content: Content; @ViewChild(Content) content: Content;
@ViewChild('tips') tips: ElementRef; @ViewChild('tips') tips: ElementRef;
...@@ -47,10 +46,11 @@ export class HomePage { ...@@ -47,10 +46,11 @@ export class HomePage {
// {name: "本市部署", type: 4, index: 3} // {name: "本市部署", type: 4, index: 3}
// ]; // ];
tabsList = [ tabsList = [
{name: "系列讲话", type: 2, index: 0}, {name: "最新", type: 0, index: 0},
{name: "党章党规", type: 1, index: 1}, {name: "系列讲话", type: 2, index: 1},
{name: "中央精神", type: 3, index: 2}, {name: "党章党规", type: 1, index: 2},
{name: "本市部署", type: 4, index: 3} {name: "中央精神", type: 3, index: 3},
{name: "本市部署", type: 4, index: 4}
]; ];
isSign = false; //签到弹窗 isSign = false; //签到弹窗
isBir = false; //政治生日弹窗 isBir = false; //政治生日弹窗
...@@ -68,6 +68,7 @@ export class HomePage { ...@@ -68,6 +68,7 @@ export class HomePage {
partyObj; //政治生日 partyObj; //政治生日
plateType; plateType;
isRecent = 1; //0 否 1是
index = 0; index = 0;
slideList = []; slideList = [];
...@@ -105,6 +106,7 @@ export class HomePage { ...@@ -105,6 +106,7 @@ export class HomePage {
); );
} }
ionViewDidLoad() { ionViewDidLoad() {
this.change(this.tabsList[0]); this.change(this.tabsList[0]);
this.itemWidth = window.screen.width / 4; this.itemWidth = window.screen.width / 4;
...@@ -134,6 +136,11 @@ export class HomePage { ...@@ -134,6 +136,11 @@ export class HomePage {
this.loadMore = true; this.loadMore = true;
// this.infiniteScrollContent.inf.enable(true); // this.infiniteScrollContent.inf.enable(true);
this.index = item.index; this.index = item.index;
if(item.type == 0){
this.isRecent = 1;
}else{
this.isRecent = 0;
}
// 自身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.tips1.nativeElement.style.left = this.itemWidth * (this.index) + (this.itemWidth - this.spanWidth) / 2 + 'px';
...@@ -141,6 +148,7 @@ export class HomePage { ...@@ -141,6 +148,7 @@ export class HomePage {
const data = { const data = {
pageNum: this.pageNum, pageNum: this.pageNum,
pageCount: this.pageCount, pageCount: this.pageCount,
isRecent:this.isRecent,
obj: { obj: {
'plateType': this.plateType, 'plateType': this.plateType,
'resourceType': 1 'resourceType': 1
...@@ -238,6 +246,7 @@ export class HomePage { ...@@ -238,6 +246,7 @@ export class HomePage {
//签到倒计时 //签到倒计时
signNow() { signNow() {
if(this.signObj.isSign == 'no') this.disabledClick = true;
this.isSign = true; this.isSign = true;
let totalTime = 5; let totalTime = 5;
this.signText = '(倒计时' + totalTime + 's)'; this.signText = '(倒计时' + totalTime + 's)';
...@@ -281,6 +290,7 @@ export class HomePage { ...@@ -281,6 +290,7 @@ export class HomePage {
const data = { const data = {
pageNum: this.pageNum, pageNum: this.pageNum,
pageCount: this.pageCount, pageCount: this.pageCount,
isRecent:this.isRecent,
obj: { obj: {
'plateType': this.plateType, 'plateType': this.plateType,
'resourceType': 1 'resourceType': 1
...@@ -312,6 +322,7 @@ export class HomePage { ...@@ -312,6 +322,7 @@ export class HomePage {
const data = { const data = {
pageNum: 1, pageNum: 1,
pageCount: this.pageCount, pageCount: this.pageCount,
isRecent:this.isRecent,
obj: { obj: {
'plateType': this.plateType, 'plateType': this.plateType,
'resourceType': 1 'resourceType': 1
......
...@@ -15,9 +15,9 @@ export class AppGlobal { ...@@ -15,9 +15,9 @@ export class AppGlobal {
//接口基地址 //接口基地址
// static domain = "http://101.89.112.92:80"; //正式环境 // static domain = "http://101.89.112.92:80"; //正式环境
// static domain = "http://192.168.2.235:8080"; //测试环境 // static domain = "http://192.168.2.235:8080"; //测试环境
// static domain = "http://47.103.33.196:8080"; //阿里云测试地址 static domain = "http://47.103.33.196:8080"; //阿里云测试地址
// static domain = "http://47.103.35.216:8080"; //阿里云正式地址 // static domain = "http://47.103.35.216:8080"; //阿里云正式地址
static domain = ""; //本地环境/ // static domain = ""; //本地环境
//图片地址 //图片地址
// static picture = AppGlobal.domain + "/wisdomgroup/manager/getIcon/"; //正式地址 // static picture = AppGlobal.domain + "/wisdomgroup/manager/getIcon/"; //正式地址
......
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