Commit 54c4cd17 authored by wangqinghua's avatar wangqinghua

common.service

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