Commit 48fea58e authored by wangqinghua's avatar wangqinghua

color

parent 22ab2b7b
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.starter" version="1.3.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="io.ionic.starter2" version="1.3.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>智汇19号</name> <name>智汇19号(测)</name>
<description>An awesome Ionic/Cordova app.</description> <description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author> <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" /> <content src="index.html" />
......
...@@ -96,8 +96,8 @@ ...@@ -96,8 +96,8 @@
<button ion-button round class="btn color3">未报名</button> <button ion-button round class="btn color3">未报名</button>
</div> </div>
<div class="margin-top-5"> <div class="margin-top-5">
<span disabled (click)="goSignUp(item)" ion-button round class="btn color3 blue-btn">代报名</span> <span (click)="goSignUp(item)" ion-button round class="btn color3 blue-btn">代报名</span>
<span disabled (click)="sayNo(item)" ion-button round class="btn color3 red-btn">不参加</span> <span (click)="sayNo(item)" ion-button round class="btn color3 red-btn">不参加</span>
</div> </div>
</div> </div>
</div> </div>
......
import { Component } from '@angular/core'; import {Component} from '@angular/core';
import {IonicPage, ModalController, NavController, NavParams} from 'ionic-angular'; import {IonicPage, ModalController, NavController, NavParams} from 'ionic-angular';
import {Response} from "@angular/http"; import {Response} from "@angular/http";
import {AppService} from "../../../service/appHttpService"; import {AppService} from "../../../service/appHttpService";
...@@ -18,7 +18,7 @@ export class ReplaceApplyPage { ...@@ -18,7 +18,7 @@ export class ReplaceApplyPage {
personInfo; //报名人信息 personInfo; //报名人信息
activity; //活动信息 activity; //活动信息
batchList; //批次列表 batchList; //批次列表
item ; //批次信息 item; //批次信息
itemName = '请选择批次'; itemName = '请选择批次';
//报名信息 //报名信息
...@@ -27,30 +27,30 @@ export class ReplaceApplyPage { ...@@ -27,30 +27,30 @@ export class ReplaceApplyPage {
Orderbz: '', //报名备注 Orderbz: '', //报名备注
Activityid: '', //关联活动id Activityid: '', //关联活动id
Batchid: '', //关联批次id Batchid: '', //关联批次id
UserID:'', //用户id UserID: '', //用户id
Username:'', //用户名称 Username: '', //用户名称
Usertel:'' //用户手机 Usertel: '' //用户手机
}; };
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService, public modalCtrl:ModalController) { public appService: AppService, public modalCtrl: ModalController) {
} }
ionViewDidLoad() { ionViewDidLoad() {
console.log('ionViewDidLoad ReplaceApplyPage'); console.log('ionViewDidLoad ReplaceApplyPage');
} }
ionViewDidEnter(){ ionViewDidEnter() {
this.activityId = this.navParams.get("id"); this.activityId = this.navParams.get("id");
this.personInfo = this.navParams.get("personInfo"); this.personInfo = this.navParams.get("personInfo");
this.getActivety(); this.getActivety();
} }
//获取活动信息 //获取活动信息
getActivety(){ getActivety() {
let now = new Date().getTime(); let now = new Date().getTime();
this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/findAllActivityForAppWithXQ", {"id":this.activityId}) this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/findAllActivityForAppWithXQ", {"id": this.activityId})
.subscribe((res :Response) => { .subscribe((res: Response) => {
this.activity = res.json(); this.activity = res.json();
this.batchList = this.activity.batchList; this.batchList = this.activity.batchList;
}, (error) => { }, (error) => {
...@@ -61,17 +61,17 @@ export class ReplaceApplyPage { ...@@ -61,17 +61,17 @@ export class ReplaceApplyPage {
//携带人数 数字加减 //携带人数 数字加减
add() { add() {
if(!this.item){ if (!this.item) {
return false; return false;
} }
console.log("1:"+this.order.Personnumber); console.log("1:" + this.order.Personnumber);
if(this.order.Personnumber < this.item.batchPerNumber){ if (this.order.Personnumber < this.item.batchPerNumber) {
this.order.Personnumber++; this.order.Personnumber++;
} }
} }
next() { next() {
if(!this.item){ if (!this.item) {
return false; return false;
} }
if (this.order.Personnumber >= 1) { if (this.order.Personnumber >= 1) {
...@@ -80,10 +80,10 @@ export class ReplaceApplyPage { ...@@ -80,10 +80,10 @@ export class ReplaceApplyPage {
} }
//选择批次 //选择批次
selectblock(){ selectblock() {
let modal = this.modalCtrl.create(BlockModalPage,{blockList: this.batchList}); let modal = this.modalCtrl.create(BlockModalPage, {blockList: this.batchList});
modal.onDidDismiss(res=>{ modal.onDidDismiss(res => {
if(res){ if (res) {
this.item = res; this.item = res;
this.itemName = res.batchName; this.itemName = res.batchName;
} }
...@@ -100,48 +100,61 @@ export class ReplaceApplyPage { ...@@ -100,48 +100,61 @@ export class ReplaceApplyPage {
applyNum:报名批次数量 applyNum:报名批次数量
**/ **/
if(!this.item){ if (!this.item) {
this.appService.popToastView("请选择报名批次",'middle',1000); this.appService.popToastView("请选择报名批次", 'middle', 1000);
return false; return false;
} }
if( new Date().getTime() > new Date(this.item.batchEndDate).getTime() ){ if (new Date().getTime() > new Date(this.item.batchEndDate).getTime()) {
this.appService.popToastView("该批次已过截止时间",'middle',1000); this.appService.popToastView("该批次已过截止时间", 'middle', 1000);
return false; return false;
} }
let leaveNum = this.item.batchLimitNumber - this.item.hasSignUpCount; let leaveNum = this.item.batchLimitNumber - this.item.hasSignUpCount;
let applyNum = 0; let applyNum = 0;
this.activity.batchList.forEach((res)=>{ this.activity.batchList.forEach((res) => {
if(res.order){ if (res.order) {
console.log(res.order); console.log(res); //
applyNum ++; applyNum++;
} }
}); });
//报名次数 applyCount 1,2,3,4,5,0-> 不限 //报名次数 applyCount 1,2,3,4,5,0-> 不限
if(this.activity.applyCount > 0){ console.log(Number(this.order.Personnumber + 1), Number(leaveNum));
if(applyNum >= this.activity.applyCount){ console.log(applyNum, this.activity.applyCount);
this.appService.popToastView("提交失败,报名批次达到上限",'middle',1000);
return false; if (this.activity.applyCount == 0) {
}else if (Number(this.order.Personnumber +1) > Number(leaveNum)) { console.log('true1');
this.appService.popToastView("报名人数超过了该批次的剩余人数",'middle',1000); if (Number(this.order.Personnumber + 1) > Number(leaveNum)) {
console.log('报名人数超过了该批次的剩余人数');
this.appService.popToastView("报名人数超过了该批次的剩余人数", 'middle', 1000);
return false; return false;
}else{ }else{
this.submitOrder(); // this.submitOrder();
} }
} else { //报名(新增) } else { //报名(新增)
this.submitOrder(); if (applyNum >= this.activity.applyCount) {
console.log('提交失败,报名批次达到上限');
this.appService.popToastView("提交失败,报名批次达到上限", 'middle', 1000);
return false;
} else if (Number(this.order.Personnumber + 1) > Number(leaveNum)) {
console.log('报名人数超过了该批次的剩余人数');
this.appService.popToastView("报名人数超过了该批次的剩余人数", 'middle', 1000);
return false;
} else {
console.log('true');
// this.submitOrder();
}
} }
} }
// 提交订单 // 提交订单
submitOrder(){ submitOrder() {
const order = { const order = {
Personnumber: this.order.Personnumber, //携带人数 Personnumber: this.order.Personnumber, //携带人数
Orderbz: this.order.Orderbz, //报名备注 Orderbz: this.order.Orderbz, //报名备注
Activityid: this.activityId, //关联活动id Activityid: this.activityId, //关联活动id
Batchid: this.item.id, //关联批次id Batchid: this.item.id, //关联批次id
UserID:this.personInfo.id, UserID: this.personInfo.id,
Username:this.personInfo.name, Username: this.personInfo.name,
Usertel:this.personInfo.mobile Usertel: this.personInfo.mobile
}; };
this.order.Batchid = this.item.id; this.order.Batchid = this.item.id;
this.order.Activityid = this.item.activityId; this.order.Activityid = this.item.activityId;
......
...@@ -29,5 +29,5 @@ ...@@ -29,5 +29,5 @@
<ion-textarea [(ngModel)]="order.Orderbz" class="content-textarea"></ion-textarea> <ion-textarea [(ngModel)]="order.Orderbz" class="content-textarea"></ion-textarea>
</ion-item> </ion-item>
<button class="submit-btn submit" (click)="confirmOrder()">提交订单</button> <button class="submit-btn submit" (click)="condirmAlert()">提交订单</button>
</ion-content> </ion-content>
...@@ -131,8 +131,14 @@ export class ActivityApplyPage { ...@@ -131,8 +131,14 @@ export class ActivityApplyPage {
this.isCover = true; this.isCover = true;
} }
condirmAlert(){
this.appService.alert('确定提交该活动订单?',(res)=>{
this.confirmOrder();
})
}
//报名 //报名
confirmOrder(orderId) { confirmOrder() {
//验证信息: //验证信息:
/**0.对于暂未有批次的。 /**0.对于暂未有批次的。
1.判断携带人数是否超过限额人数。 1.判断携带人数是否超过限额人数。
......
...@@ -11,11 +11,13 @@ ...@@ -11,11 +11,13 @@
</div> </div>
<div class="item1-content"> <div class="item1-content">
<div class="margin-5-0"> <div class="margin-5-0">
<label class="item1-title">{{activity?.activityName}}</label> <label class="item1-title">{{activity?.activityName}}
<button class="btn-introduce" (click)="show()">具体介绍</button>
</label>
</div> </div>
<div class="item1-introduction"> <div class="item1-introduction">
{{activity.activityIntro}} <!--{{activity.activityIntro}}-->
<button class="btn-introduce" (click)="show()">具体介绍</button> {{introduce}}
</div> </div>
</div> </div>
</div> </div>
...@@ -31,7 +33,7 @@ ...@@ -31,7 +33,7 @@
<span *ngIf="activity.applyCount == 0 || !activity.applyCount">{{ batchList.length}}</span> <span *ngIf="activity.applyCount == 0 || !activity.applyCount">{{ batchList.length}}</span>
<span *ngIf="activity.applyCount != 0">{{activity.applyCount}}</span> <span *ngIf="activity.applyCount != 0">{{activity.applyCount}}</span>
个批次) 个批次)
<ng-container *ngIf="batch?.order?.orderstate == 1 || batch?.order?.orderstate == 2"> <ng-container *ngIf="batch?.order?.orderstate != 1 && batch?.order?.orderstate != 2">
<span *ngIf="activity?.activityNo == '0'" <span *ngIf="activity?.activityNo == '0'"
(click)="sayNo()" class="item-type">不想参加</span> (click)="sayNo()" class="item-type">不想参加</span>
......
...@@ -196,6 +196,7 @@ page-activityDetail { ...@@ -196,6 +196,7 @@ page-activityDetail {
float: right; float: right;
color: #666666; color: #666666;
border-radius: 4px; border-radius: 4px;
margin-right: 18px;
} }
.back-btn { .back-btn {
......
...@@ -17,7 +17,8 @@ export class ActivityDetailPage { ...@@ -17,7 +17,8 @@ export class ActivityDetailPage {
activityId; //活动ID activityId; //活动ID
batches: object[]; batches: object[];
activity = { activity = {
batchList: [] batchList: [],
activityIntro:''
}; };
picture: string = AppGlobal.picture; picture: string = AppGlobal.picture;
batchList = []; batchList = [];
...@@ -45,12 +46,12 @@ export class ActivityDetailPage { ...@@ -45,12 +46,12 @@ export class ActivityDetailPage {
} }
findMyOrderByOrderId() { findMyOrderByOrderId() {
let now = new Date().getTime(); let now = new Date().getTime();
this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/findAllActivityForAppWithXQ", {"id": this.activityId}) this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/findAllActivityForAppWithXQ", {"id": this.activityId})
.subscribe((res: Response) => { .subscribe((res: Response) => {
this.activity = res.json(); this.activity = res.json();
this.batchList = this.activity.batchList; this.batchList = this.activity.batchList;
this.subIntroduce(this.activity.activityIntro);
for (let i = 0; i < this.batchList.length; i++) { for (let i = 0; i < this.batchList.length; i++) {
let endDate = this.batchList[i].batchEndDate + " 24:00:00"; let endDate = this.batchList[i].batchEndDate + " 24:00:00";
endDate = new Date(endDate).getTime() + ''; //判断是否过截止日期 endDate = new Date(endDate).getTime() + ''; //判断是否过截止日期
......
...@@ -25,7 +25,10 @@ ...@@ -25,7 +25,10 @@
<p><span>出行日期:</span><span>{{batch?.batchGoDate}}</span></p> <p><span>出行日期:</span><span>{{batch?.batchGoDate}}</span></p>
<p><span>集合时间:</span><span>{{batch?.batchSetTime}}</span></p> <p><span>集合时间:</span><span>{{batch?.batchSetTime}}</span></p>
<p><span>集合地点:</span><span>{{batch?.batchSetAddress}}</span></p> <p><span>集合地点:</span><span>{{batch?.batchSetAddress}}</span></p>
<p><span>活动须知:</span><span>{{batch?.batchNotice}}</span></p> <p><span>联络员:</span><span>{{batch?.liamand}}</span></p>
<p><span>联络电话:</span><span>{{batch?.liamantel}}</span></p>
<p><span>活动须知:</span><br>
<span [innerHtml]='batch.batchNotice' ></span>
</div> </div>
</div> </div>
<div class="content-button"> <div class="content-button">
......
...@@ -2,6 +2,7 @@ import {Component} from '@angular/core'; ...@@ -2,6 +2,7 @@ import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular'; import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {Response} from "@angular/http"; import {Response} from "@angular/http";
import {AppService} from "../../../service/appHttpService"; import {AppService} from "../../../service/appHttpService";
import {DomSanitizer} from "@angular/platform-browser";
@IonicPage() @IonicPage()
...@@ -19,19 +20,23 @@ export class OrderDetailPage { ...@@ -19,19 +20,23 @@ export class OrderDetailPage {
activityName: '', activityName: '',
activityIntro: '' activityIntro: ''
}; //活动 }; //活动
batch; //批次 batch = {
batchNotice:<any>''
}; //批次
isCover = false; isCover = false;
isIntroduce = false; isIntroduce = false;
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) { public appService: AppService ,public sanitizer: DomSanitizer) {
} }
ionViewDidEnter() { ionViewDidEnter() {
this.order = this.navParams.get('item'); this.order = this.navParams.get('item');
this.activity = this.navParams.get('item').activity; this.activity = this.navParams.get('item').activity;
this.batch = this.navParams.get('item').batch; this.batch = this.navParams.get('item').batch;
let con = this.batch.batchNotice.replace(/\r?\n/g, "<br />");
this.batch.batchNotice = this.sanitizer.bypassSecurityTrustHtml(con);
console.log(this.order); console.log(this.order);
} }
......
...@@ -18,8 +18,15 @@ ...@@ -18,8 +18,15 @@
<ion-item-sliding *ngFor="let contactPerson of contactPersons"> <ion-item-sliding *ngFor="let contactPerson of contactPersons">
<ion-item> <ion-item>
<div class="contact-box" (click)="contactPersonInfo(contactPerson)"> <div class="contact-box" (click)="contactPersonInfo(contactPerson)">
<ng-container *ngIf="contactPerson?.picUrl && contactPerson?.picUrl != ''">
<img src="{{picture+contactPerson.picUrl}}" class="contact-img">
</ng-container>
<ng-container *ngIf="!contactPerson?.picUrl || contactPerson?.picUrl == ''">
<img src="./assets/imgs/man.png" class="contact-img" *ngIf="contactPerson.gender =='1'||contactPerson.gender==null"> <img src="./assets/imgs/man.png" class="contact-img" *ngIf="contactPerson.gender =='1'||contactPerson.gender==null">
<img src="./assets/imgs/woman.png" class="contact-img" *ngIf="contactPerson.gender =='0'"> <img src="./assets/imgs/woman.png" class="contact-img" *ngIf="contactPerson.gender =='0'">
</ng-container>
<div class="contact-box-right"> <div class="contact-box-right">
<div> <div>
<span class="contact-name">{{contactPerson.name}}</span> <span class="contact-name">{{contactPerson.name}}</span>
......
import {Component} from '@angular/core'; import {Component} from '@angular/core';
import {IonicPage, ModalController, NavController, NavParams, ToastController} from 'ionic-angular'; import {IonicPage, ModalController, NavController, NavParams, ToastController} from 'ionic-angular';
import {AppService} from "../../../service/appHttpService"; import {AppGlobal, AppService} from "../../../service/appHttpService";
import {ContactModalPage} from "../contact-modal/contact-modal"; import {ContactModalPage} from "../contact-modal/contact-modal";
import {PersonListPage} from "../person-list/person-list"; import {PersonListPage} from "../person-list/person-list";
import {message} from "../../../app/main"; import {message} from "../../../app/main";
...@@ -16,7 +16,7 @@ export class BlockListPage { ...@@ -16,7 +16,7 @@ export class BlockListPage {
orgid; orgid;
orgName; orgName;
contactPersons; contactPersons;
picture: string = AppGlobal.picture;
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService, public modalCtrl: ModalController, public appService: AppService, public modalCtrl: ModalController,
public toastCtrl: ToastController) { public toastCtrl: ToastController) {
......
...@@ -387,22 +387,6 @@ export class HomePage { ...@@ -387,22 +387,6 @@ export class HomePage {
} }
loadEvent(year, month) { loadEvent(year, month) {
let date = new Date();
//4.每月的周末
let d = new Date(year, month, 0).getDate();
for (let i = 1; i < d + 1; i++) {
date.setFullYear(year, month - 1, i);
let day = date.getDay();
if (day == 6 || day == 0) {
const data = {
date: new Date(year, month - 1, i),
disable: true,
cssClass: 'dayOff1'
};
this.newArr.push(data);
}
}
//5.获取每月值班信息 //5.获取每月值班信息
const data = { const data = {
date: year + '/' + month + '/01' date: year + '/' + month + '/01'
...@@ -430,6 +414,33 @@ export class HomePage { ...@@ -430,6 +414,33 @@ export class HomePage {
cssClass: 'dayOff1' cssClass: 'dayOff1'
}; };
this.newArr.push(data); this.newArr.push(data);
});
this.setCalendar(year,month);
});
}, error => {
this.appService.alert('网络异常!');
}
);
}
setCalendar(year,month){
let date = new Date();
//4.每月的周末
let d = new Date(year, month, 0).getDate();
for (let i = 1; i < d + 1; i++) {
date.setFullYear(year, month - 1, i);
let day = date.getDay();
if (day == 6 || day == 0) {
const data = {
date: new Date(year, month - 1, i),
disable: true,
cssClass: 'dayOff1'
};
this.newArr.push(data);
}
}
this.optionsMulti = { this.optionsMulti = {
pickMode: 'multi', pickMode: 'multi',
monthFormat: 'YYYY 年 MM 月 ', monthFormat: 'YYYY 年 MM 月 ',
...@@ -439,13 +450,6 @@ export class HomePage { ...@@ -439,13 +450,6 @@ export class HomePage {
disableWeeks: [0, 1, 2, 3, 4, 5, 6], disableWeeks: [0, 1, 2, 3, 4, 5, 6],
daysConfig: this.newArr daysConfig: this.newArr
}; };
})
});
}, error => {
this.appService.alert('网络异常!');
}
);
} }
onChange(e) { onChange(e) {
......
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