Commit 54c4cd17 authored by wangqinghua's avatar wangqinghua

common.service

query结构调整
parent 80daba30
......@@ -9,6 +9,6 @@
<ion-content>
<p class="explain margin-top-100">本次答题共计{{item?.questionCount}}题,满分{{item?.fullMarks}}分</p>
<p class="explain margin-top-20">限时{{item?.timeLimit}}分钟</p>
<p class="explain margin-top-20">限时{{item?.timeLimit / 60}}分钟</p>
<button class="submit-btn submit" (click)="goToDO()">开始答题</button>
</ion-content>
......@@ -16,7 +16,7 @@ export class LearningExplainPage {
item = {
questionCount: 0,
fullMarks: '0',
timeLimit: '0',
timeLimit: 0,
testId:null
}; //测试对象
constructor(public navCtrl: NavController, public navParams: NavParams,
......
......@@ -278,10 +278,9 @@ export class HomePage {
let month = date.getMonth() + 1;
//2.参加活动日期
this.appService.ObserverHttpGetOption("/wisdomgroup/modules/order/appOrderCal", null)
.subscribe((res: Response) => {
let response = res.json();
response.forEach(event => {
this.tabsSer.appOrderCal().subscribe(
(order)=>{
order.forEach(event => {
this.newArr.push({
date: new Date(event.batch.batchGoDate),
disable: true,
......@@ -289,24 +288,21 @@ export class HomePage {
})
});
//3.离沪日期
this.appService.ObserverHttpGetOption("/wisdomgroup/modules/userpre/appPreCal", null)
.subscribe((res: Response) => {
let response = res.json();
response.forEach(event => {
this.tabsSer.appPreCal().subscribe(
(pre)=>{
pre.forEach(event => {
this.newArr.push({
date: new Date(event.formshTime),
disable: true,
cssClass: 'dayOff4'
})
});
}, error => {
});
this.loadEvent(year, month);
}, error => {
});
this.loadEvent(year, month);
}
)
}
);
}
loadEvent(year, month) {
......@@ -314,35 +310,31 @@ export class HomePage {
const data = {
date: year + '/' + month + '/01'
};
this.appService.ObserverHttpGetOption("/wisdomgroup/schedule/app/getMyScheduleOnMonth", data)
.subscribe((res: Response) => {
let response = res.json();
for (let i = 0; i < response.length; i++) {
const data = {
date: new Date(response[i].dutyDate),
disable: true,
cssClass: 'dayOff3'
};
this.newArr.push(data);
}
//1.获取节假日
this.appService.ObserverHttpGetOption("/wisdomgroup/workCalendar/getFestivalAboutMonth", data)
.subscribe((res) => {
let data = res.json();
data.forEach(event => {
const data = {
date: new Date(event.date),
disable: true,
cssClass: 'dayOff1'
};
this.newArr.push(data);
});
this.setCalendar(year, month);
});
}, error => {
this.tabsSer.getMyScheduleOnMonth(data).subscribe(
(schedule)=>{
for (let i = 0; i < schedule.length; i++) {
const ev = {
date: new Date(schedule[i].dutyDate),
disable: true,
cssClass: 'dayOff3'
};
this.newArr.push(ev);
}
);
this.tabsSer.getFestivalAboutMonth(data).subscribe(
(festival)=>{
festival.forEach(event => {
const data = {
date: new Date(event.date),
disable: true,
cssClass: 'dayOff1'
};
this.newArr.push(data);
});
this.setCalendar(year, month);
}
)
}
)
}
......
......@@ -8,7 +8,30 @@ import {CommonService} from "../../service/common.service";
export class TabsService{
constructor(private http:HttpClient,private commonSer:CommonService){}
//获取权限
getRoles(): Observable<any>{
return this.http.get(AppGlobal.domain+'/wisdomgroup/app/getRoles', );
return this.http.get(AppGlobal.domain +'/wisdomgroup/app/getRoles', );
}
//获取参加活动的日期
appOrderCal(): Observable<any>{
return this.http.get(AppGlobal.domain +'/wisdomgroup/modules/order/appOrderCal');
}
//获取离沪日期
appPreCal(): Observable<any>{
return this.http.get(AppGlobal.domain +'/wisdomgroup/modules/userpre/appPreCal');
}
//每月值班信息
getMyScheduleOnMonth(data): Observable<any>{
return this.http.get(AppGlobal.domain +'/wisdomgroup/schedule/app/getMyScheduleOnMonth?'+this.commonSer.toQuery(data));
}
//获取节假日
getFestivalAboutMonth(data): Observable<any>{
return this.http.get(AppGlobal.domain +'/wisdomgroup/workCalendar/getFestivalAboutMonth?'+this.commonSer.toQuery(data));
}
}
\ No newline at end of file
......@@ -11,7 +11,7 @@ export class CommonService{
* @param data json格式的数据
* @returns {string}
*/
static toQuery(data){
toQuery(data){
let str = '';
for (let key in data) {
if (data.hasOwnProperty(key)) {
......
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