Commit 4f7f5c6b authored by wangqinghua's avatar wangqinghua

4.0.6

parent aefcc831
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.smart19.starter.test" version="4.0.4" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <widget id="io.ionic.smart19.starter.test" version="4.0.5" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>党建云平台(测试)</name> <name>党建云平台(测试)</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>
...@@ -83,13 +83,14 @@ ...@@ -83,13 +83,14 @@
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" /> <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
<plugin name="cordova-plugin-app-version" spec="^0.1.9" /> <plugin name="cordova-plugin-app-version" spec="^0.1.9" />
<plugin name="cordova-plugin-badge" spec="^0.8.7" /> <plugin name="cordova-plugin-badge" spec="^0.8.7" />
<plugin name="cordova-plugin-file" spec="^6.0.1" />
<plugin name="cordova-plugin-file-opener2" spec="^2.0.19" /> <plugin name="cordova-plugin-file-opener2" spec="^2.0.19" />
<plugin name="cordova-plugin-file-transfer" spec="^1.7.1" />
<plugin name="cordova-plugin-geolocation" spec="^4.0.1"> <plugin name="cordova-plugin-geolocation" spec="^4.0.1">
<variable name="GEOLOCATION_USAGE_DESCRIPTION" value="To locate you" /> <variable name="GEOLOCATION_USAGE_DESCRIPTION" value="To locate you" />
</plugin> </plugin>
<plugin name="cordova-plugin-statusbar" spec="^2.4.2" /> <plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
<plugin name="cordova-plugin-file-transfer" spec="^1.7.1" />
<plugin name="cordova-plugin-file" spec="^6.0.1" />
<plugin name="cordova.plugins.diagnostic" spec="^2.0.0" />
<engine name="ios" spec="4.5.5" /> <engine name="ios" spec="4.5.5" />
<engine name="browser" spec="5.0.4" /> <engine name="browser" spec="5.0.4" />
<engine name="android" spec="7.0.0" /> <engine name="android" spec="7.0.0" />
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -24,9 +24,10 @@ ...@@ -24,9 +24,10 @@
"@ionic-native/badge": "^4.11.0", "@ionic-native/badge": "^4.11.0",
"@ionic-native/calendar": "^4.11.0", "@ionic-native/calendar": "^4.11.0",
"@ionic-native/core": "4.4.0", "@ionic-native/core": "4.4.0",
"@ionic-native/file": "^4.11.0", "@ionic-native/diagnostic": "^5.4.0",
"@ionic-native/file": "^4.20.0",
"@ionic-native/file-opener": "^4.11.0", "@ionic-native/file-opener": "^4.11.0",
"@ionic-native/file-transfer": "^4.11.0", "@ionic-native/file-transfer": "^4.20.0",
"@ionic-native/geolocation": "^4.15.0", "@ionic-native/geolocation": "^4.15.0",
"@ionic-native/keyboard": "^4.6.0", "@ionic-native/keyboard": "^4.6.0",
"@ionic-native/splash-screen": "4.4.0", "@ionic-native/splash-screen": "4.4.0",
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
"cordova-plugin-splashscreen": "^5.0.2", "cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2", "cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3", "cordova-plugin-whitelist": "^1.3.3",
"cordova.plugins.diagnostic": "^2.0.0",
"ion2-calendar": "^2.2.0", "ion2-calendar": "^2.2.0",
"ionic-angular": "3.9.2", "ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1", "ionic-plugin-keyboard": "^2.2.1",
...@@ -78,7 +80,8 @@ ...@@ -78,7 +80,8 @@
"ionic-plugin-keyboard": {}, "ionic-plugin-keyboard": {},
"cordova-plugin-file-opener2": {}, "cordova-plugin-file-opener2": {},
"cordova-plugin-ionic-keyboard": {}, "cordova-plugin-ionic-keyboard": {},
"cordova-plugin-statusbar": {} "cordova-plugin-statusbar": {},
"cordova.plugins.diagnostic": {}
}, },
"platforms": [ "platforms": [
"ios", "ios",
......
...@@ -45,6 +45,9 @@ ...@@ -45,6 +45,9 @@
}, },
"cordova-plugin-statusbar": { "cordova-plugin-statusbar": {
"PACKAGE_NAME": "io.ionic.starter" "PACKAGE_NAME": "io.ionic.starter"
},
"cordova.plugins.diagnostic": {
"PACKAGE_NAME": "io.ionic.smart19.starter.test"
} }
}, },
"dependent_plugins": {} "dependent_plugins": {}
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
"cordova-plugin-file": { "cordova-plugin-file": {
"source": { "source": {
"type": "registry", "type": "registry",
"id": "cordova-plugin-file@6.0.1" "id": "cordova-plugin-file@^6.0.1"
}, },
"is_top_level": true, "is_top_level": true,
"variables": {} "variables": {}
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
"cordova-plugin-file-transfer": { "cordova-plugin-file-transfer": {
"source": { "source": {
"type": "registry", "type": "registry",
"id": "cordova-plugin-file-transfer" "id": "cordova-plugin-file-transfer@^1.7.1"
}, },
"is_top_level": true, "is_top_level": true,
"variables": {} "variables": {}
...@@ -112,5 +112,13 @@ ...@@ -112,5 +112,13 @@
}, },
"is_top_level": true, "is_top_level": true,
"variables": {} "variables": {}
},
"cordova.plugins.diagnostic": {
"source": {
"type": "registry",
"id": "cordova.plugins.diagnostic@3.0.0"
},
"is_top_level": true,
"variables": {}
} }
} }
\ No newline at end of file
...@@ -35,6 +35,7 @@ import {CommonService} from "../service/common.service"; ...@@ -35,6 +35,7 @@ import {CommonService} from "../service/common.service";
import {TabsService} from "../pages/tabs/tabs.service"; import {TabsService} from "../pages/tabs/tabs.service";
import {BackButtonService} from "../service/backButton.service"; import {BackButtonService} from "../service/backButton.service";
import {EmitService} from "../service/emit.service"; import {EmitService} from "../service/emit.service";
import {Diagnostic} from "@ionic-native/diagnostic/ngx";
@NgModule({ @NgModule({
declarations: [ declarations: [
...@@ -86,6 +87,7 @@ import {EmitService} from "../service/emit.service"; ...@@ -86,6 +87,7 @@ import {EmitService} from "../service/emit.service";
Keyboard, Keyboard,
Calendar, Calendar,
Badge, Badge,
Diagnostic,
Geolocation, Geolocation,
ActivityStatisticService, ActivityStatisticService,
DatePipe, DatePipe,
......
...@@ -16,9 +16,13 @@ ...@@ -16,9 +16,13 @@
</label> </label>
</div> </div>
<div class="item1-introduction"> <div class="item1-introduction">
<!--{{activity.activityIntro}}-->
{{introduce}} {{introduce}}
</div> </div>
<!--<div class="item1-introduction">-->
<!--<ng-container *ngFor="let file of activity?.fileUploadEntities">-->
<!--<p (click)="downLoad(file)" class="margin-bottom-15" >附件:{{file.showName}}</p>-->
<!--</ng-container>-->
<!--</div>-->
</div> </div>
</div> </div>
......
...@@ -3,11 +3,14 @@ import {IonicPage, NavController, NavParams, AlertController, ToastController} f ...@@ -3,11 +3,14 @@ import {IonicPage, NavController, NavParams, AlertController, ToastController} f
import {Http, Response} from '@angular/http'; import {Http, Response} from '@angular/http';
import {AppService,AppGlobal} from "../../../../service/appHttpService"; import {AppService, AppGlobal} from "../../../../service/appHttpService";
import {JoinDetailPage} from '../../activity-track/joinDetail/joinDetail'; import {JoinDetailPage} from '../../activity-track/joinDetail/joinDetail';
import {BatchDetailPage} from "../batch-detail/batch-detail"; import {BatchDetailPage} from "../batch-detail/batch-detail";
import {TabsService} from "../../../tabs/tabs.service"; import {TabsService} from "../../../tabs/tabs.service";
import {CommonService} from "../../../../service/common.service"; import {CommonService} from "../../../../service/common.service";
import {FileTransfer, FileTransferObject} from "@ionic-native/file-transfer";
import {File} from "@ionic-native/file";
import {Diagnostic} from '@ionic-native/diagnostic/ngx';
@IonicPage() @IonicPage()
@Component({ @Component({
...@@ -20,7 +23,7 @@ export class ActivityDetailPage { ...@@ -20,7 +23,7 @@ export class ActivityDetailPage {
batches: object[]; batches: object[];
activity = { activity = {
batchList: [], batchList: [],
activityIntro:'' activityIntro: ''
}; };
picture: string = AppGlobal.picture; picture: string = AppGlobal.picture;
batchList = []; batchList = [];
...@@ -32,25 +35,29 @@ export class ActivityDetailPage { ...@@ -32,25 +35,29 @@ export class ActivityDetailPage {
constructor(public navCtrl: NavController, constructor(public navCtrl: NavController,
public diagnostic: Diagnostic,
public navParams: NavParams, public navParams: NavParams,
public alertCtrl: AlertController,public commonSer:CommonService, private fileTransfer: FileTransfer,
public http: Http,public tabSer:TabsService, private fileTransferObject: FileTransferObject,
private file: File,
public alertCtrl: AlertController, public commonSer: CommonService,
public http: Http, public tabSer: TabsService,
public appService: AppService, public toast: ToastController) { public appService: AppService, public toast: ToastController) {
} }
ionViewDidEnter() { ionViewDidEnter() {
const index = this.navCtrl.length() -3; const index = this.navCtrl.length() - 3;
if(index > 1){ if (index > 1) {
this.navCtrl.remove(3, index); this.navCtrl.remove(3, index);
} }
this.activityId = this.navParams.get('id'); this.activityId = this.navParams.get('id');
this.findMyOrderByOrderId(); this.findMyOrderByOrderId();
this.addRecodings(); this.addRecodings();
} }
//增加阅读记录 //增加阅读记录
addRecodings(){ addRecodings() {
this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/addRecodings", null) this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/addRecodings", null)
.subscribe((res: Response) => { .subscribe((res: Response) => {
...@@ -74,7 +81,7 @@ export class ActivityDetailPage { ...@@ -74,7 +81,7 @@ export class ActivityDetailPage {
} else { // } else { //
this.batchList[i].signUp = true; this.batchList[i].signUp = true;
} }
if( this.batchList[i].order ){ if (this.batchList[i].order) {
this.hasOrder = true; this.hasOrder = true;
} }
} }
...@@ -111,8 +118,8 @@ export class ActivityDetailPage { ...@@ -111,8 +118,8 @@ export class ActivityDetailPage {
//不参加 //不参加
sayNo() { sayNo() {
if(this.hasOrder){ if (this.hasOrder) {
this.appService.popToastView('您已报名,请先取消报名再点击','middle',1500); this.appService.popToastView('您已报名,请先取消报名再点击', 'middle', 1500);
return false; return false;
} }
...@@ -142,7 +149,7 @@ export class ActivityDetailPage { ...@@ -142,7 +149,7 @@ export class ActivityDetailPage {
} }
//参加 //参加
sayYes(){ sayYes() {
const confirm = this.alertCtrl.create({ const confirm = this.alertCtrl.create({
title: '确定参加该活动?', title: '确定参加该活动?',
buttons: [ buttons: [
...@@ -167,13 +174,41 @@ export class ActivityDetailPage { ...@@ -167,13 +174,41 @@ export class ActivityDetailPage {
confirm.present(); confirm.present();
} }
//下载附件 // //下载附件
downLoad(file){ // downLoad(file){
this.tabSer.downFile(file.id).subscribe( // this.tabSer.downFile(file).subscribe(
(res)=>{ // (res)=>{
this.commonSer.downloadFile(file.name,res); // this.commonSer.downloadFile("附件.xlsx",res);
} // }
) // )
// }
downLoad(file) {
const fileTransfer: FileTransferObject = this.fileTransfer.create();
const url = encodeURI(AppGlobal.domain + '/wisdomgroup/modules/common/file/download/' + file.id);
alert(url);
const folder = this.file.externalRootDirectory + file.showName; //apk保存的目录
alert(folder)
this.diagnostic.requestExternalStorageAuthorization().then((status) => {
alert("Authorization request for external storage use was " + (status == this.diagnostic.permissionStatus.GRANTED ? "授予" : "拒绝"));
fileTransfer.download(url, folder).then((entry) => {
const alertSuccess = this.alertCtrl.create({
title: `Download Succeeded!`,
subTitle: `${url} was successfully downloaded to: ${entry.toURL()}`,
buttons: ['Ok']
});
alertSuccess.present();
}, (error) => {
const alertFailure = this.alertCtrl.create({
title: `Download Failed!`,
subTitle: `${url} was not successfully downloaded. Error code: ${error.exception}`,
buttons: ['Ok']
});
alertFailure.present();
});
}).catch(error => {
//Handle error
});
} }
} }
...@@ -35,7 +35,6 @@ export class LearningResultPage { ...@@ -35,7 +35,6 @@ export class LearningResultPage {
(res)=>{ (res)=>{
this.result = res.data; this.result = res.data;
let c = this.result.score/this.result.fullmarks; let c = this.result.score/this.result.fullmarks;
console.log(c)
if(this.result.score == 0){ if(this.result.score == 0){
this.starList = [{class: 'star-gray'}, {class: 'star-gray'}, {class: 'star-gray'},]; this.starList = [{class: 'star-gray'}, {class: 'star-gray'}, {class: 'star-gray'},];
} }
......
...@@ -16,11 +16,7 @@ export class ReviewResultPage { ...@@ -16,11 +16,7 @@ export class ReviewResultPage {
title; title;
result; result;
starList = [ starList = [];
{class: 'star-yellow'},
{class: 'star-yellow'},
{class: 'star-yellow'},
];
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
public learnSer:LearnService) { public learnSer:LearnService) {
...@@ -29,7 +25,22 @@ export class ReviewResultPage { ...@@ -29,7 +25,22 @@ export class ReviewResultPage {
ionViewDidLoad() { ionViewDidLoad() {
this.result = this.navParams.get('result'); this.result = this.navParams.get('result');
this.title = this.navParams.get('title'); this.title = this.navParams.get('title');
let c = this.result.score/this.result.fullmarks;
if(this.result.score == 0){
this.starList = [{class: 'star-gray'}, {class: 'star-gray'}, {class: 'star-gray'},];
}
if( 0.6 > c && c > 0.3){
this.starList = [{class: 'star-yellow'}, {class: 'star-gray'}, {class: 'star-gray'},];
}
if( 0.3 > c && c > 0){
this.starList = [{class: 'star-yellow'}, {class: 'star-gray'}, {class: 'star-gray'},];
}
if( 1 > c && c > 0.6){
this.starList = [{class: 'star-yellow'}, {class: 'star-yellow'}, {class: 'star-gray'},];
}
if( this.result.score == this.result.fullmarks){
this.starList = [{class: 'star-yellow'}, {class: 'star-yellow'}, {class: 'star-yellow'},];
}
this.navbar.backButtonClick = (event)=>{ this.navbar.backButtonClick = (event)=>{
let index = this.navCtrl.length() -2; let index = this.navCtrl.length() -2;
this.navCtrl.remove(2,index) this.navCtrl.remove(2,index)
......
...@@ -52,10 +52,10 @@ ...@@ -52,10 +52,10 @@
<img src="./assets/imgs/home/icon-xxcs.png" alt=""> <img src="./assets/imgs/home/icon-xxcs.png" alt="">
<label class="label2-2 more2-2">学习测试</label> <label class="label2-2 more2-2">学习测试</label>
</div> </div>
<div class="card" (click)="goTo('LearnManagePage')"> <!--<div class="card" (click)="goTo('LearnManagePage')">-->
<img src="./assets/imgs/home/icon-ccgl.png" alt=""> <!--<img src="./assets/imgs/home/icon-ccgl.png" alt="">-->
<label class="label2-2 more2-2">测试管理</label> <!--<label class="label2-2 more2-2">测试管理</label>-->
</div> <!--</div>-->
<div class="card" (click)="goTo('MoreAppPage')"> <div class="card" (click)="goTo('MoreAppPage')">
<img src="./assets/imgs/home/icon-more.png" alt=""> <img src="./assets/imgs/home/icon-more.png" alt="">
<label class="label2-2 more2-2">更多应用</label> <label class="label2-2 more2-2">更多应用</label>
......
...@@ -35,7 +35,7 @@ export class TabsService{ ...@@ -35,7 +35,7 @@ export class TabsService{
//下载文件 //下载文件
downFile(data): Observable<any>{ downFile(data): Observable<any>{
return this.http.get(AppGlobal.domain +'/modules/common/file/download/'+data); return this.http.get(AppGlobal.domain +'/wisdomgroup/modules/common/file/download/'+data,{responseType: 'blob'});
} }
} }
\ No newline at end of file
...@@ -33,7 +33,6 @@ export class BackButtonService { ...@@ -33,7 +33,6 @@ export class BackButtonService {
//如果可以返回上一页,则执行pop //如果可以返回上一页,则执行pop
if (activeNav.canGoBack()) { if (activeNav.canGoBack()) {
alert(this.isDo);
if(!this.isDo){ if(!this.isDo){
activeNav.pop(); activeNav.pop();
} }
......
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