Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonz1987 committed Dec 7, 2017
1 parent 517a066 commit 9ab9ea8
Show file tree
Hide file tree
Showing 15 changed files with 194 additions and 3,290 deletions.
8 changes: 4 additions & 4 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="me.growu.drip" version="1.1.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget id="me.growu.drip" version="1.2.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>水滴打卡</name>
<description>一款习惯养成和目标管理工具</description>
<author email="drip@growu.me" href="http://drip.growu.me/">格吾社区</author>
Expand Down Expand Up @@ -29,7 +29,7 @@
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
<preference name="KeyboardResize" value="true" />
<preference name="KeyboardResizeMode" value="native" />
<preference name="KeyboardResizeMode" value="ionic" />
<platform name="android">
<allow-intent href="market:*" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
Expand Down Expand Up @@ -89,7 +89,7 @@
<allow-navigation href="http://localhost:8080/*" />
<chcp>
<config-file url="http://drip.growu.me/www/chcp.json" />
<native-interface version="11" />
<native-interface version="12" />
</chcp>
<engine name="android" spec="^6.2.3" />
<engine name="ios" spec="^4.4.0" />
Expand All @@ -98,7 +98,6 @@
<plugin name="cordova-plugin-device" spec="^1.1.4" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
<plugin name="cordova-plugin-apprate" spec="^1.3.0" />
<plugin name="cordova-plugin-inappbrowser" spec="^1.7.1" />
<plugin name="com.synconset.imagepicker" spec="~2.1.8">
<variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value=" " />
Expand Down Expand Up @@ -131,4 +130,5 @@
</plugin>
<plugin name="cordova-plugin-x-socialsharing" spec="^5.2.1" />
<plugin name="cordova-plugin-ionic-webview" spec="^1.1.16" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.4" />
</widget>
3,299 changes: 78 additions & 3,221 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@ionic-native-mocks/keyboard": "^2.0.6",
"@ionic-native/app-rate": "4.4.2",
"@ionic-native/camera": "4.4.2",
"@ionic-native/core": "^3.12.0",
"@ionic-native/core": "^4.4.2",
"@ionic-native/crop": "4.4.2",
"@ionic-native/date-picker": "4.4.2",
"@ionic-native/device": "4.4.2",
Expand All @@ -45,27 +45,25 @@
"@ionic-native/status-bar": "4.4.2",
"@ionic/storage": "2.1.3",
"ajv": "^5.3.0",
"angular-svg-round-progressbar": "^1.1.1",
"angular-svg-round-progressbar": "^1.2.1",
"angular2-moment": "^1.7.0",
"autoprefixer": "^7.1.4",
"chart.js": "^2.7.1",
"com.synconset.imagepicker": "~2.1.8",
"cordova-android": "^6.2.3",
"cordova-hot-code-push-plugin": "^1.5.3",
"cordova-ios": "^4.4.0",
"cordova-plugin-apprate": "^1.3.0",
"cordova-plugin-bugly-sdk": "0.0.1",
"cordova-plugin-camera": "^2.4.1",
"cordova-plugin-compat": "^1.1.0",
"cordova-plugin-console": "^1.0.5",
"cordova-plugin-crop": "^0.4.0",
"cordova-plugin-datepicker": "^0.9.3",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-dialogs": "^1.3.3",
"cordova-plugin-file": "^4.3.3",
"cordova-plugin-file-transfer": "^1.6.3",
"cordova-plugin-globalization": "^1.0.7",
"cordova-plugin-inappbrowser": "^1.7.1",
"cordova-plugin-ionic-keyboard": "^2.0.4",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-jcore": "^1.1.9",
"cordova-plugin-qqsdk": "^0.9.6",
Expand All @@ -84,7 +82,7 @@
"ion2-calendar": "2.1.4",
"ionic-angular": "^3.9.2",
"ionic-img-viewer": "2.9.0",
"ionic2-super-tabs": "4.1.5",
"ionic2-super-tabs": "^4.1.4",
"ionicons": "3.0.0",
"jpush-phonegap-plugin": "3.2.12",
"moment": "2.19.3",
Expand All @@ -109,7 +107,6 @@
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-apprate": {},
"cordova-plugin-inappbrowser": {},
"com.synconset.imagepicker": {
"PHOTO_LIBRARY_USAGE_DESCRIPTION": " "
Expand Down Expand Up @@ -141,11 +138,12 @@
"PHOTOLIBRARY_USAGE_DESCRIPTION": " "
},
"cordova-plugin-x-socialsharing": {},
"cordova-plugin-ionic-webview": {}
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {}
},
"platforms": [
"android",
"ios"
]
}
}
}
4 changes: 2 additions & 2 deletions src/pages/about/about.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export class AboutPage {
public isUpdate: boolean = false;
public isInstall: boolean = false;

public appVersion: string = '1.1.1';
public webVersion: string = '20171113000000';
public appVersion: string = '1.2.0';
public webVersion: string = '20171207000000';

constructor(public navCtrl: NavController,
public navParams: NavParams,
Expand Down
4 changes: 2 additions & 2 deletions src/pages/event-detail/event-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ <h2>{{comment.user.nickname}}</h2>
<ion-toolbar *ngIf="isComment">

<ion-item >
<ion-input type="text" (blur)="hideComment()" clearInput #commentInput [(ngModel)]="content" [placeholder]="reply_comment?'回复'+reply_comment.user?.nickname||''+': ':'据说评论别人可以变得更强?.'"></ion-input>
<button clear ion-button item-end (click)="doComment()">发布</button>
<ion-input type="text" clearInput #commentInput [(ngModel)]="content" [placeholder]="reply_comment?'回复'+reply_comment.user?.nickname||''+': ':'据说评论别人可以变得更强?.'"></ion-input>
<button ion-button item-end (click)="doComment()">发布</button>
</ion-item>

</ion-toolbar>
Expand Down
32 changes: 26 additions & 6 deletions src/pages/event-detail/event-detail.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {Component, ElementRef, ViewChild} from '@angular/core';
import {ActionSheetController, IonicPage, NavController, NavParams} from 'ionic-angular';
import {ActionSheetController, IonicPage, NavController, NavParams, Platform} from 'ionic-angular';
import {EventProvider} from '../../providers/event/event'
import {MyShareController} from '../../components/my-share/my-share.controller'
import {ToastProvider} from "../../providers/toast/toast";
import {Keyboard} from "@ionic-native/keyboard";
import {CommentProvider} from "../../providers/comment/comment";

declare var Keyboard;

@IonicPage({
name: 'event-detail',
segment: 'event/:id/detail'
Expand All @@ -25,14 +26,20 @@ export class EventDetailPage {

constructor(public navCtrl: NavController,
public navParams: NavParams,
private platform: Platform,
public eventProvider: EventProvider,
private toastProvider: ToastProvider,
private keyboard:Keyboard,
private commentProvider: CommentProvider,
public actionSheetCtrl: ActionSheetController,
private myShareCtrl: MyShareController) {

this.keyboard.onKeyboardHide().subscribe(() =>{
// this.keyboard.onKeyboardHide().subscribe(() =>{
// this.content = null;
// this.reply_comment = null;
// this.isComment = false;
// });

window.addEventListener('keyboardDidHide', () => {
this.content = null;
this.reply_comment = null;
this.isComment = false;
Expand Down Expand Up @@ -87,9 +94,13 @@ export class EventDetailPage {
showComment(){
this.isComment = true;

// if(this.platform.is('cordova')) {
// Keyboard.show();
// }

setTimeout(() => {
this.commentInput.setFocus();
},150);
},1000);
}

doComment() {
Expand All @@ -102,6 +113,10 @@ export class EventDetailPage {
this.eventProvider.comment(this.event.id,body).then((data) => {
this.toastProvider.show("评论成功",'success');
this.event.comments.unshift(data);

if(this.platform.is('cordova')) {
Keyboard.close();
}
// this.keyboard.close();
}).catch((err)=>{

Expand Down Expand Up @@ -150,7 +165,7 @@ export class EventDetailPage {
}

doFavorite() {
this.toastProvider.show("程序小哥正在加紧开发中...","success");
this.toastProvider.show("该功能正在开发中...","success");
}

showCommentMenu(comment) {
Expand Down Expand Up @@ -188,6 +203,10 @@ export class EventDetailPage {
this.isComment = true;
this.reply_comment = comment;

// if(this.platform.is('cordova')) {
// Keyboard.show();
// }

setTimeout(() => {
this.commentInput.setFocus();
},1000);
Expand All @@ -197,5 +216,6 @@ export class EventDetailPage {
hideComment(){
this.isComment = false;
this.reply_comment = null;
this.content = null;
}
}
9 changes: 8 additions & 1 deletion src/pages/goal-checkin/goal-checkin.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@

<ion-list>
<ion-item>
<ion-textarea rows="5" formControlName="content" placeholder="记录一下"></ion-textarea>
<ion-label>打卡日期</ion-label>
<ion-datetime placeholder="今天" displayFormat="YYYY-MM-DD" pickerFormat="YYYY MM DD" cancelText="取消" doneText="保存" [min]="min" [max]="max" formControlName="day" [(ngModel)]="day"></ion-datetime>
</ion-item>
</ion-list>

<ion-list>
<ion-item>
<ion-textarea rows="5" formControlName="content" placeholder="记录你的打卡内容。"></ion-textarea>
</ion-item>
<ion-item no-border no-lines>
<ion-icon name="camera" large item-start (click)="choosePic($event)"></ion-icon>
Expand Down
27 changes: 23 additions & 4 deletions src/pages/goal-checkin/goal-checkin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {App, NavController, NavParams, IonicPage} from "ionic-angular";
import {FormBuilder, FormGroup} from '@angular/forms';
import {UserProvider} from "../../providers/user/user";
import {ToolProvider} from "../../providers/tool/tool";
import * as moment from 'moment'

@IonicPage({
name: "goal-checkin",
Expand All @@ -16,6 +17,11 @@ export class GoalCheckinPage {

private checkinForm: FormGroup;
public attachs: any = [];
public goal;
public day;

public min: string = '';
public max: string = moment().format('YYYY-MM-DD');

constructor(public navCtrl: NavController,
public navParams: NavParams,
Expand All @@ -26,11 +32,28 @@ export class GoalCheckinPage {
) {
this.checkinForm = this.formBuilder.group({
'content': ['', []],
'day':['',[]]
});

if (this.navParams.get('day')) {
this.day = this.navParams.get('day');
} else {
this.day = moment().format('YYYY-MM-DD');
}
}

ionViewDidLoad() {
let goal_id = this.navParams.get('id');

this.userProvider.getGoal(goal_id).then((data)=>{
this.goal = data;
this.min = data.start_date;
if(data.end_date) {
this.max = data.end_date;
}
}).catch((err)=> {

});
}

doCheckin($event) {
Expand All @@ -40,10 +63,6 @@ export class GoalCheckinPage {

let body = this.checkinForm.value;

if (this.navParams.get('day')) {
body.day = this.navParams.get('day');
}

body.attachs = this.attachs;

this.userProvider.checkinGoal(goal_id, body).then(data => {
Expand Down
12 changes: 1 addition & 11 deletions src/pages/user-home-events/user-home-events.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@

<ion-content >
<ion-scroll scrollX="true" style="height: 100%">
<ion-refresher (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="arrow-dropdown"
pullingText="下拉刷新"
refreshingSpinner="circles"
refreshingText="加载中...">
</ion-refresher-content>
</ion-refresher>
<ion-content>

<my-event [eventSource]="events" *ngIf="events.length>0"></my-event>

Expand All @@ -22,5 +13,4 @@
loadingText="加载更多">
</ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-scroll>
</ion-content>
23 changes: 13 additions & 10 deletions src/pages/user-home-events/user-home-events.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component} from '@angular/core';
import {App, IonicPage, NavController, NavParams} from 'ionic-angular';
import {Component, ViewChild} from '@angular/core';
import {App, IonicPage, NavController, NavParams,Content} from 'ionic-angular';
import {UserProvider} from "../../providers/user/user";

@IonicPage({
Expand All @@ -20,6 +20,9 @@ export class UserHomeEventsPage {
private userProvider: UserProvider) {
}

ionViewDidLoad() {
}

ionViewDidEnter() {
this.getUserEvents(1);
}
Expand All @@ -38,14 +41,14 @@ export class UserHomeEventsPage {
});
}

doRefresh(refresher) {

this.getUserEvents(1);

setTimeout(() => {
refresher.complete();
}, 2000);
}
// doRefresh(refresher) {
//
// this.getUserEvents(1);
//
// setTimeout(() => {
// refresher.complete();
// }, 2000);
// }

doInfinite(infiniteScroll) {

Expand Down
2 changes: 0 additions & 2 deletions src/pages/user-home-goals/user-home-goals.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<ion-content >
<ion-scroll scrollX="true" style="height: 100%">

<ion-list *ngIf="goals.length>0">

Expand All @@ -17,5 +16,4 @@ <h2>{{goal.name}}</h2>
<div text-center style="position: absolute;left: 0;right: 0;top: 40%;" *ngIf="goals.length == 0">
<p>暂时还没有目标</p>
</div>
</ion-scroll>
</ion-content>
2 changes: 0 additions & 2 deletions src/pages/user-home-photos/user-home-photos.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<ion-content>
<ion-scroll scrollX="true" style="height: 100%">

<ion-row *ngIf="photos.length>0">
<ion-col col-4 *ngFor="let photo of photos">
Expand All @@ -13,6 +12,5 @@
<div text-center style="position: absolute;left: 0;right: 0;top: 40%;" *ngIf="photos.length == 0">
<p>暂时还没有图片</p>
</div>
</ion-scroll>

</ion-content>
Loading

0 comments on commit 9ab9ea8

Please sign in to comment.