Commit 48fea58e authored by wangqinghua's avatar wangqinghua

color

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