heyiwen 3 months ago
commit
295a4a70c7
100 changed files with 12231 additions and 0 deletions
  1. 17 0
      .editorconfig
  2. 35 0
      .gitignore
  3. 1 0
      .nvmdrc
  4. 18 0
      .project
  5. 8 0
      .settings/.jsdtscope
  6. 20 0
      .tern-project
  7. 9 0
      MyApp.iml
  8. 26 0
      README.md
  9. 88 0
      config.xml
  10. 7 0
      ionic.config.json
  11. 10188 0
      package-lock.json
  12. 67 0
      package.json
  13. 8 0
      resources/README.md
  14. BIN
      resources/android/icon/drawable-hdpi-icon.png
  15. BIN
      resources/android/icon/drawable-ldpi-icon.png
  16. BIN
      resources/android/icon/drawable-mdpi-icon.png
  17. BIN
      resources/android/icon/drawable-xhdpi-icon.png
  18. BIN
      resources/android/icon/drawable-xxhdpi-icon.png
  19. BIN
      resources/android/icon/drawable-xxxhdpi-icon.png
  20. BIN
      resources/android/splash/drawable-land-hdpi-screen.png
  21. BIN
      resources/android/splash/drawable-land-ldpi-screen.png
  22. BIN
      resources/android/splash/drawable-land-mdpi-screen.png
  23. BIN
      resources/android/splash/drawable-land-xhdpi-screen.png
  24. BIN
      resources/android/splash/drawable-land-xxhdpi-screen.png
  25. BIN
      resources/android/splash/drawable-land-xxxhdpi-screen.png
  26. BIN
      resources/android/splash/drawable-port-hdpi-screen.png
  27. BIN
      resources/android/splash/drawable-port-ldpi-screen.png
  28. BIN
      resources/android/splash/drawable-port-mdpi-screen.png
  29. BIN
      resources/android/splash/drawable-port-xhdpi-screen.png
  30. BIN
      resources/android/splash/drawable-port-xxhdpi-screen.png
  31. BIN
      resources/android/splash/drawable-port-xxxhdpi-screen.png
  32. BIN
      resources/icon.png
  33. BIN
      resources/ios/icon/icon-1024.png
  34. BIN
      resources/ios/icon/icon-40.png
  35. BIN
      resources/ios/icon/icon-40@2x.png
  36. BIN
      resources/ios/icon/icon-40@3x.png
  37. BIN
      resources/ios/icon/icon-50.png
  38. BIN
      resources/ios/icon/icon-50@2x.png
  39. BIN
      resources/ios/icon/icon-60.png
  40. BIN
      resources/ios/icon/icon-60@2x.png
  41. BIN
      resources/ios/icon/icon-60@3x.png
  42. BIN
      resources/ios/icon/icon-72.png
  43. BIN
      resources/ios/icon/icon-72@2x.png
  44. BIN
      resources/ios/icon/icon-76.png
  45. BIN
      resources/ios/icon/icon-76@2x.png
  46. BIN
      resources/ios/icon/icon-83.5@2x.png
  47. BIN
      resources/ios/icon/icon-small.png
  48. BIN
      resources/ios/icon/icon-small@2x.png
  49. BIN
      resources/ios/icon/icon-small@3x.png
  50. BIN
      resources/ios/icon/icon.png
  51. BIN
      resources/ios/icon/icon@2x.png
  52. BIN
      resources/ios/splash/Default-568h@2x~iphone.png
  53. BIN
      resources/ios/splash/Default-667h.png
  54. BIN
      resources/ios/splash/Default-736h.png
  55. BIN
      resources/ios/splash/Default-Landscape-736h.png
  56. BIN
      resources/ios/splash/Default-Landscape@2x~ipad.png
  57. BIN
      resources/ios/splash/Default-Landscape@~ipadpro.png
  58. BIN
      resources/ios/splash/Default-Landscape~ipad.png
  59. BIN
      resources/ios/splash/Default-Portrait@2x~ipad.png
  60. BIN
      resources/ios/splash/Default-Portrait@~ipadpro.png
  61. BIN
      resources/ios/splash/Default-Portrait~ipad.png
  62. BIN
      resources/ios/splash/Default@2x~iphone.png
  63. BIN
      resources/ios/splash/Default@2x~universal~anyany.png
  64. BIN
      resources/ios/splash/Default~iphone.png
  65. BIN
      resources/splash.png
  66. 78 0
      src/app/app.component.ts
  67. 12 0
      src/app/app.config.ts
  68. 1 0
      src/app/app.html
  69. 119 0
      src/app/app.module.ts
  70. 13 0
      src/app/app.scss
  71. 10 0
      src/app/components/components.module.ts
  72. 4 0
      src/app/components/wx-img/wx-img.component.html
  73. 9 0
      src/app/components/wx-img/wx-img.component.scss
  74. 107 0
      src/app/components/wx-img/wx-img.component.ts
  75. 34 0
      src/app/directives/equal-validator.directive.ts
  76. 5 0
      src/app/main.ts
  77. 85 0
      src/app/services/announcement/announcement.service.ts
  78. 47 0
      src/app/services/certisfier/certisfier.service.ts
  79. 2 0
      src/app/services/jweixin/jweixin.d.ts
  80. 100 0
      src/app/services/message.service.ts
  81. 69 0
      src/app/services/myexam/myexam.service.ts
  82. 193 0
      src/app/services/register/register.service.ts
  83. 14 0
      src/app/services/service.common.ts
  84. 65 0
      src/app/services/student/student.service.ts
  85. 59 0
      src/app/services/system.service.ts
  86. 279 0
      src/app/services/user/user.service.ts
  87. 158 0
      src/app/services/wxService.ts
  88. 8 0
      src/app/utility/dateFunction.ts
  89. 36 0
      src/app/utility/dictionary.ts
  90. 11 0
      src/app/utility/urlHelper.ts
  91. 65 0
      src/assets/font/iconfont.css
  92. BIN
      src/assets/font/iconfont.eot
  93. 1 0
      src/assets/font/iconfont.js
  94. 93 0
      src/assets/font/iconfont.json
  95. 62 0
      src/assets/font/iconfont.svg
  96. BIN
      src/assets/font/iconfont.ttf
  97. BIN
      src/assets/font/iconfont.woff
  98. BIN
      src/assets/font/iconfont.woff2
  99. BIN
      src/assets/icon/favicon.ico
  100. 0 0
      src/assets/icon/icon-evaluation.png

+ 17 - 0
.editorconfig

@@ -0,0 +1,17 @@
+# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
+# editorconfig.org
+
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+
+# We recommend you to keep these unchanged
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.md]
+trim_trailing_whitespace = false

+ 35 - 0
.gitignore

@@ -0,0 +1,35 @@
+# Specifies intentionally untracked files to ignore when using Git
+# http://git-scm.com/docs/gitignore
+
+*~
+*.sw[mnpcod]
+*.log
+*.tmp
+*.tmp.*
+log.txt
+*.sublime-project
+*.sublime-workspace
+.vscode/
+npm-debug.log*
+
+.idea/
+.sourcemaps/
+.sass-cache/
+.tmp/
+.versions/
+coverage/
+dist/
+node_modules/
+tmp/
+temp/
+hooks/
+platforms/
+plugins/
+plugins/android.json
+plugins/ios.json
+www/
+$RECYCLE.BIN/
+
+.DS_Store
+Thumbs.db
+UserInterfaceState.xcuserstate

+ 1 - 0
.nvmdrc

@@ -0,0 +1 @@
+12.22.12

+ 18 - 0
.project

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>MyApp</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.thym.core.HybridAppNature</nature>
+		<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+	</natures>
+</projectDescription>

+ 8 - 0
.settings/.jsdtscope

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
+	<classpathentry kind="con" path="org.eclipse.thym.core.CordovaContainerInitializer"/>
+	<classpathentry kind="src" path="www"/>
+	<classpathentry kind="output" path=""/>
+</classpath>

+ 20 - 0
.tern-project

@@ -0,0 +1,20 @@
+{
+  "plugins": {
+    "guess-types": {
+      
+    },
+    "outline": {
+      
+    },
+    "angular": {
+      
+    },
+    "cordovajs": {
+      
+    }
+  },
+  "libs": [
+    "ecma5",
+    "browser"
+  ]
+}

+ 9 - 0
MyApp.iml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/bin" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 26 - 0
README.md

@@ -0,0 +1,26 @@
+This is a starter template for [Ionic](http://ionicframework.com/docs/) projects.
+
+## How to use this template
+
+*This template does not work on its own*. The shared files for each starter are found in the [ionic2-app-base repo](https://github.com/ionic-team/ionic2-app-base).
+
+To use this template, either create a new ionic project using the ionic node.js utility, or copy the files from this repository into the [Starter App Base](https://github.com/ionic-team/ionic2-app-base).
+
+### With the Ionic CLI:
+
+Take the name after `ionic2-starter-`, and that is the name of the template to be used when using the `ionic start` command below:
+
+```bash
+$ sudo npm install -g ionic cordova
+$ ionic start myBlank blank
+```
+
+Then, to run it, cd into `myBlank` and run:
+
+```bash
+$ ionic cordova platform add ios
+$ ionic cordova run ios
+```
+
+Substitute ios for android if not on a Mac.
+

+ 88 - 0
config.xml

@@ -0,0 +1,88 @@
+<?xml version='1.0' encoding='utf-8'?>
+<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+    <name>博颖教务</name>
+    <description>博颖教务信息管理系统</description>
+    <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team
+	</author>
+    <content src="index.html" />
+    <access origin="*" />
+    <allow-intent href="http://*/*" />
+    <allow-intent href="https://*/*" />
+    <allow-intent href="tel:*" />
+    <allow-intent href="sms:*" />
+    <allow-intent href="mailto:*" />
+    <allow-intent href="geo:*" />
+    <preference name="ScrollEnabled" value="false" />
+    <preference name="android-minSdkVersion" value="16" />
+    <preference name="BackupWebStorage" value="none" />
+    <preference name="SplashMaintainAspectRatio" value="true" />
+    <preference name="FadeSplashScreenDuration" value="300" />
+    <preference name="SplashShowOnlyFirstTime" value="false" />
+    <preference name="SplashScreen" value="screen" />
+    <preference name="SplashScreenDelay" value="3000" />
+    <platform name="android">
+        <allow-intent href="market:*" />
+        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
+        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
+        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
+        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
+        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
+        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
+        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
+        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
+        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
+        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
+        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
+        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
+        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
+        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
+        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
+        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
+        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
+        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
+    </platform>
+    <platform name="ios">
+        <allow-intent href="itms:*" />
+        <allow-intent href="itms-apps:*" />
+        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
+        <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" />
+        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
+        <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" />
+        <icon height="120" src="resources/ios/icon/icon-40@3x.png" width="120" />
+        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
+        <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" />
+        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
+        <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" />
+        <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" />
+        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
+        <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" />
+        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
+        <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" />
+        <icon height="167" src="resources/ios/icon/icon-83.5@2x.png" width="167" />
+        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
+        <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" />
+        <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
+        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
+        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
+        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
+        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
+        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
+        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
+        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
+        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
+        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
+        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
+        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
+        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
+        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
+        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
+    </platform>
+    <engine name="android" spec="^6.3.0" />
+    <engine name="browser" spec="~5.0.2" />
+    <plugin name="cordova-plugin-file" spec="git+https://github.com/apache/cordova-plugin-file.git" />
+    <plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
+    <plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
+    <plugin name="cordova-plugin-device" spec="^1.1.4" />
+    <plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
+    <plugin name="cordova-plugin-ionic-webview" spec="^1.1.15" />
+</widget>

+ 7 - 0
ionic.config.json

@@ -0,0 +1,7 @@
+{
+  "name": "EMIS.MobileWeb",
+  "integrations": {
+    "cordova": {}
+  },
+  "type": "ionic-angular"
+}

File diff suppressed because it is too large
+ 10188 - 0
package-lock.json


+ 67 - 0
package.json

@@ -0,0 +1,67 @@
+{
+  "name": "LIOTMobileWeb",
+  "version": "0.0.1",
+  "author": "Ionic Framework",
+  "homepage": "http://ionicframework.com/",
+  "private": true,
+  "scripts": {
+    "clean": "ionic-app-scripts clean",
+    "build": "ionic-app-scripts build",
+    "lint": "ionic-app-scripts lint",
+    "ionic:build": "ionic-app-scripts build",
+    "ionic:serve": "ionic-app-scripts serve",
+    "start": "node index.js"
+  },
+  "dependencies": {
+    "@angular/common": "4.4.3",
+    "@angular/compiler": "^4.4.3",
+    "@angular/compiler-cli": "^4.4.3",
+    "@angular/core": "^4.4.3",
+    "@angular/forms": "4.4.3",
+    "@angular/http": "4.4.3",
+    "@angular/platform-browser": "4.4.3",
+    "@angular/platform-browser-dynamic": "4.4.3",
+    "@angular/tsc-wrapped": "^4.4.6",
+    "@ionic-native/core": "4.3.0",
+    "@ionic-native/splash-screen": "^4.3.0",
+    "@ionic-native/status-bar": "^4.3.0",
+    "@ionic/storage": "2.0.1",
+    "cordova": "^9.0.0",
+    "cordova-android": "^6.3.0",
+    "cordova-browser": "~5.0.2",
+    "cordova-plugin-compat": "^1.2.0",
+    "cordova-plugin-device": "^1.1.4",
+    "cordova-plugin-file": "git+https://github.com/apache/cordova-plugin-file.git",
+    "cordova-plugin-ionic-webview": "^1.1.15",
+    "cordova-plugin-splashscreen": "^4.0.3",
+    "cordova-plugin-whitelist": "^1.3.1",
+    "ionic": "^5.4.16",
+    "ionic-angular": "^3.7.1",
+    "ionic-plugin-keyboard": "^2.2.1",
+    "ionicons": "3.0.0",
+    "rxjs": "5.4.3",
+    "string-width": "^5.1.2",
+    "sw-toolbox": "3.6.0",
+    "zone.js": "0.8.18"
+  },
+  "devDependencies": {
+    "@ionic/app-scripts": "^3.2.4",
+    "node-sass": "^4.14.1",
+    "typescript": "2.3.4"
+  },
+  "description": "An Ionic project",
+  "cordova": {
+    "plugins": {
+      "cordova-plugin-file": {},
+      "ionic-plugin-keyboard": {},
+      "cordova-plugin-whitelist": {},
+      "cordova-plugin-device": {},
+      "cordova-plugin-splashscreen": {},
+      "cordova-plugin-ionic-webview": {}
+    },
+    "platforms": [
+      "android",
+      "browser"
+    ]
+  }
+}

+ 8 - 0
resources/README.md

@@ -0,0 +1,8 @@
+These are Cordova resources. You can replace icon.png and splash.png and run
+`ionic cordova resources` to generate custom icons and splash screens for your
+app. See `ionic cordova resources --help` for details.
+
+Cordova reference documentation:
+
+- Icons: https://cordova.apache.org/docs/en/latest/config_ref/images.html
+- Splash Screens: https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-splashscreen/

BIN
resources/android/icon/drawable-hdpi-icon.png


BIN
resources/android/icon/drawable-ldpi-icon.png


BIN
resources/android/icon/drawable-mdpi-icon.png


BIN
resources/android/icon/drawable-xhdpi-icon.png


BIN
resources/android/icon/drawable-xxhdpi-icon.png


BIN
resources/android/icon/drawable-xxxhdpi-icon.png


BIN
resources/android/splash/drawable-land-hdpi-screen.png


BIN
resources/android/splash/drawable-land-ldpi-screen.png


BIN
resources/android/splash/drawable-land-mdpi-screen.png


BIN
resources/android/splash/drawable-land-xhdpi-screen.png


BIN
resources/android/splash/drawable-land-xxhdpi-screen.png


BIN
resources/android/splash/drawable-land-xxxhdpi-screen.png


BIN
resources/android/splash/drawable-port-hdpi-screen.png


BIN
resources/android/splash/drawable-port-ldpi-screen.png


BIN
resources/android/splash/drawable-port-mdpi-screen.png


BIN
resources/android/splash/drawable-port-xhdpi-screen.png


BIN
resources/android/splash/drawable-port-xxhdpi-screen.png


BIN
resources/android/splash/drawable-port-xxxhdpi-screen.png


BIN
resources/icon.png


BIN
resources/ios/icon/icon-1024.png


BIN
resources/ios/icon/icon-40.png


BIN
resources/ios/icon/icon-40@2x.png


BIN
resources/ios/icon/icon-40@3x.png


BIN
resources/ios/icon/icon-50.png


BIN
resources/ios/icon/icon-50@2x.png


BIN
resources/ios/icon/icon-60.png


BIN
resources/ios/icon/icon-60@2x.png


BIN
resources/ios/icon/icon-60@3x.png


BIN
resources/ios/icon/icon-72.png


BIN
resources/ios/icon/icon-72@2x.png


BIN
resources/ios/icon/icon-76.png


BIN
resources/ios/icon/icon-76@2x.png


BIN
resources/ios/icon/icon-83.5@2x.png


BIN
resources/ios/icon/icon-small.png


BIN
resources/ios/icon/icon-small@2x.png


BIN
resources/ios/icon/icon-small@3x.png


BIN
resources/ios/icon/icon.png


BIN
resources/ios/icon/icon@2x.png


BIN
resources/ios/splash/Default-568h@2x~iphone.png


BIN
resources/ios/splash/Default-667h.png


BIN
resources/ios/splash/Default-736h.png


BIN
resources/ios/splash/Default-Landscape-736h.png


BIN
resources/ios/splash/Default-Landscape@2x~ipad.png


BIN
resources/ios/splash/Default-Landscape@~ipadpro.png


BIN
resources/ios/splash/Default-Landscape~ipad.png


BIN
resources/ios/splash/Default-Portrait@2x~ipad.png


BIN
resources/ios/splash/Default-Portrait@~ipadpro.png


BIN
resources/ios/splash/Default-Portrait~ipad.png


BIN
resources/ios/splash/Default@2x~iphone.png


BIN
resources/ios/splash/Default@2x~universal~anyany.png


BIN
resources/ios/splash/Default~iphone.png


BIN
resources/splash.png


+ 78 - 0
src/app/app.component.ts

@@ -0,0 +1,78 @@
+import {Component, ViewChild} from '@angular/core';
+import {NavController, Platform, App} from 'ionic-angular';
+import { StatusBar } from '@ionic-native/status-bar';
+import { SplashScreen } from '@ionic-native/splash-screen';
+import {MessageBody} from "../viewmodel/system/message";
+
+import { LoginPage } from '../pages/login/login';
+import {wxService} from "./services/wxService";
+import {HomePage} from "../pages/home/home";
+
+@Component({
+  templateUrl: 'app.html'
+})
+export class EMISWeb {
+  rootPage:any = LoginPage;
+  @ViewChild("nav")private navCtrl: NavController;
+
+  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen,
+              public appCtrl: App,
+              private wxService: wxService) {
+    platform.ready().then(() => {
+      this.wxService.getConfig();
+
+      wx.ready(function () {
+        this.presentToast("微信OK","error");
+      });
+      wx.error(function (res) {
+        this.presentToast("微信OK","error");
+      });
+
+      localStorage.openID = null;
+      localStorage.name = null;
+      localStorage.userID = null;
+      localStorage.loginID = null;
+
+      this.wxService.getOpenID().then(res => {
+        if (res.isSuccess) {
+          let openID: string = res.data;
+          localStorage.openID = openID;
+          this.wxService.getUserInfo(openID).then(user => {
+            if (user && user.userID) {
+              localStorage.name = user.userName;
+              localStorage.userID = user.userID;
+              localStorage.loginID = user.loginID;
+              this.navCtrl.push(HomePage);
+            }
+          });
+        } else if (res.errorCode == 40163) {//表示code已被使用
+          location.href = "../Weixin/Index";
+        }
+      });
+      this.setupBackButtonBehavior();
+
+      statusBar.styleDefault();
+      splashScreen.hide();
+      if (!localStorage.messageList || localStorage.messageList == "") {
+        let messageList = [] as MessageBody[];
+        localStorage.messageList = JSON.stringify(messageList);
+      }
+    });
+  }
+
+  private setupBackButtonBehavior() {
+    let that = this;
+    window.onpopstate = (e) => {
+      if (that.navCtrl.canGoBack()){
+        that.appCtrl.goBack();
+      } else {
+        WeixinJSBridge.call("closeWindow");
+      }
+    };
+
+    this.appCtrl.viewDidEnter.subscribe((app) => {
+      history.pushState(null, null, "#this");
+      localStorage.backButtonClicked = null;
+    })
+  }
+}

+ 12 - 0
src/app/app.config.ts

@@ -0,0 +1,12 @@
+export class AppConfig {
+	public static getServiceUrl() {
+		 // return "http://192.168.0.66:8301/";
+    // return "http://localhost/";
+    // return "https://jdks.lnc.edu.cn/";
+    // return "http://localhost/LIOT/";
+    //  return "http://liot.bowintek.com/";
+    return "http://localhost:18634/";
+  }
+
+	public static backButtonClicked: Function = null;
+}

+ 1 - 0
src/app/app.html

@@ -0,0 +1 @@
+<ion-nav [root]="rootPage" #nav></ion-nav>

+ 119 - 0
src/app/app.module.ts

@@ -0,0 +1,119 @@
+import { NgModule, ErrorHandler } from '@angular/core';
+import { ReactiveFormsModule } from '@angular/forms';
+import { HttpModule }    from '@angular/http'
+import { BrowserModule } from '@angular/platform-browser';
+import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
+import { EMISWeb } from './app.component';
+import { StatusBar } from '@ionic-native/status-bar';
+import { SplashScreen } from '@ionic-native/splash-screen';
+
+//page
+import { HomePage } from '../pages/home/home';
+import { LoginPage } from '../pages/login/login';
+import { AnnouncementPage } from "../pages/announcement/announcement";
+import {AnnouncementListPage} from "../pages/announcementlist/announcementlist";
+import {MePage} from "../pages/me/me";
+import {RegisterPage} from "../pages/register/register";
+import {SubjectPage} from "../pages/subejct/subject";
+import {MustReadPage} from "../pages/mustRead/mustRead";
+import {MyInfoPage} from "../pages/myInfo/myInfo";
+import {CertisfierPage} from "../pages/certisfier/certisfier";
+import {MyexamPage} from "../pages/myexam/myexam";
+import {CardMessagePage} from "../pages/myexam/CardMessage/cardMessage";
+//service
+import { UserService } from './services/user/user.service';
+import {MessageService} from "./services/message.service";
+import { AnnouncementService } from "./services/announcement/announcement.service";
+import {StudentService} from "./services/student/student.service";
+import {RegisterService} from "./services/register/register.service";
+import {ServiceCommon} from './services/service.common';
+import {CertisfierService} from "./services/certisfier/certisfier.service";
+import {MyexamService} from './services/myexam/myexam.service';
+//module
+import {AnnouncementPageModule} from "../pages/announcement/announcement.module";
+import {AnnouncementListPageModule} from "../pages/announcementlist/announcementlist.module";
+import {HomePageModule} from "../pages/home/home.module";
+import {LoginPageModule} from "../pages/login/login.module";
+import {MePageModule} from "../pages/me/me.module";
+import {RegisterPageModule} from '../pages/register/register.module';
+import {SubjectPageModule} from "../pages/subejct/subject.module";
+import { MustReadPageModule } from "../pages/mustRead/mustRead.module";
+import {MyInfoPageModule} from "../pages/myInfo/myInfo.module";
+import {UserRegistPageModule} from "../pages/userregist/userregist.module";
+import {UserRegistPage} from "../pages/userregist/userregist";
+import { CertisfierPageModule } from "../pages/certisfier/certisfier.module";
+import {MyexamPageModule} from "../pages/myexam/myexam.module";
+import {wxService} from "./services/wxService";
+import {ComponentsModule} from "./components/components.module";
+import {SystemService} from "./services/system.service";
+import {UrlHelper} from "./utility/urlHelper";
+import {CertisfierDistributePageModule} from "../pages/certisfier/certisfierdistribute/certisfierdistribute.module";
+import {CardMessagePageModule} from "../pages/myexam/CardMessage/cardMessage.module";
+import {CertisfierDistributePage} from "../pages/certisfier/certisfierdistribute/certisfierdistribute";
+
+
+@NgModule({
+  declarations: [
+    EMISWeb
+  ],
+  imports: [
+    BrowserModule,
+    // IonicModule.forRoot(EMISWeb,{
+    //   backButtonText: '返回', iconMode: 'ios',//安卓icon强制使用ios的icon以及样式
+    //   mode: 'ios',//样式强制使用ios样式
+    // }),
+    ReactiveFormsModule,
+    HttpModule,
+    IonicModule.forRoot(EMISWeb),
+    HomePageModule,
+    AnnouncementPageModule,
+    AnnouncementListPageModule,
+    LoginPageModule,
+    UserRegistPageModule,
+    MePageModule,
+    RegisterPageModule,
+    SubjectPageModule,
+    MustReadPageModule,
+    MyInfoPageModule,
+    CertisfierPageModule,
+    CertisfierDistributePageModule,
+    MyexamPageModule,
+    CardMessagePageModule
+  ],
+  bootstrap: [IonicApp],
+  entryComponents: [
+    EMISWeb,
+    HomePage,
+    LoginPage,
+    UserRegistPage,
+    AnnouncementPage,
+    AnnouncementListPage,
+    MePage,
+    RegisterPage,
+    SubjectPage,
+    MustReadPage,
+    MyInfoPage,
+    CertisfierPage,
+    CertisfierDistributePage,
+    MyexamPage,
+    CardMessagePage
+  ],
+  providers: [
+    StatusBar,
+    SplashScreen,
+    UserService,
+    MessageService,
+    AnnouncementService,
+    StudentService,
+    RegisterService,
+    wxService,
+    SystemService,
+    ServiceCommon,
+ 	CertisfierService,
+    MyexamService,
+    ComponentsModule,
+    UrlHelper,
+    {provide: ErrorHandler, useClass: IonicErrorHandler}
+  ]
+})
+export class AppModule {}

+ 13 - 0
src/app/app.scss

@@ -0,0 +1,13 @@
+//@import "../components/calendar/calendar";
+.index-bg{ background: #dfeffc url(../assets/images/bannernew.png) no-repeat center top; background-size: 100%;height: 100vh; }
+
+.noMassage-img{
+  background: url(../assets/images/zanwushuju.png) no-repeat center center;background-size: 100%;height: 100vh;
+}
+ion-content {
+  background-color: #f1f6f7 !important;
+}
+
+.help-block {
+  color:brown;
+}

+ 10 - 0
src/app/components/components.module.ts

@@ -0,0 +1,10 @@
+import { NgModule } from '@angular/core';
+import {IonicModule} from "ionic-angular";
+import {WxImgComponent} from "./wx-img/wx-img.component";
+@NgModule({
+	declarations: [WxImgComponent],
+	imports: [IonicModule],
+	exports: [WxImgComponent
+  ]
+})
+export class ComponentsModule {}

+ 4 - 0
src/app/components/wx-img/wx-img.component.html

@@ -0,0 +1,4 @@
+<ion-item text-wrap>
+  <img class="wx-img-item" (click)="openFile()" [src]="pictureUrl" [hidden]="!hasPicture" />
+  <div class="wx-img-item" (click)="openFile()" [hidden]="hasPicture" style="background: url(assets/images/bg-upload-pic.png)"></div>
+</ion-item>

+ 9 - 0
src/app/components/wx-img/wx-img.component.scss

@@ -0,0 +1,9 @@
+:host {width: 100%;}
+.wx-img-item {
+  //box-sizing:border-box;
+  //display: flex;
+  //flex: 0 0 25% 25%;
+  //margin: 2px;
+  width: 80px;
+  height: 100px;
+}

+ 107 - 0
src/app/components/wx-img/wx-img.component.ts

@@ -0,0 +1,107 @@
+import {Component, forwardRef, Input, Output} from '@angular/core';
+import {wxService} from "../../services/wxService";
+import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
+import {NavController, NavParams, ToastController} from "ionic-angular";
+
+@Component({
+    selector: 'app-wx-img',
+    templateUrl: './wx-img.component.html',
+    providers: [{
+      provide: NG_VALUE_ACCESSOR,
+      useExisting: forwardRef(() => WxImgComponent),
+      multi: true
+    }]
+})
+export class WxImgComponent implements ControlValueAccessor {
+  registerOnChange(fn: any): void {
+    this.propagateChange = fn;
+  }
+
+  registerOnTouched(fn: any): void {
+  }
+
+  setDisabledState(isDisabled: boolean): void {
+  }
+
+  writeValue(obj: any): void {
+    if (obj) {
+      this.pictureUrl = obj;
+      this.urlChanged();
+    }
+  }
+  @Output() @Input() public pictureUrl: string;
+  hasPicture: boolean = false;
+  private propagateChange: any = {};
+
+  constructor(private wxService: wxService,public navCtrl: NavController, public navParams: NavParams,public toastCtrl: ToastController,) {
+  }
+
+  ngOnInit() {
+    this.urlChanged();
+  }
+
+  urlChanged() {
+    if (this.pictureUrl) {
+      this.hasPicture = true;
+    } else {
+      this.hasPicture = false;
+    }
+  }
+
+  openFile(): void {
+    let $wxService = this.wxService;
+    let that = this;
+    wx.chooseImage({
+      count: 1, // 默认9
+      sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
+      sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
+      success: function (chooseRes) {
+        //console.log(chooseRes);
+        that.presentToast(chooseRes[0].toString(),"success");
+        that.presentToast(chooseRes[1],"success");
+        that.presentToast(chooseRes,"success");
+        that.presentToast(chooseRes.localIds,"success");
+        if (chooseRes.localIds.length > 0) {
+          let localId = chooseRes.localIds[0];// 返回选定照片的本地ID列表,localId可以作为img标签的src属性显示图片
+          that.presentToast(localId,"success");
+          if (localId.indexOf("wxlocalresource") != -1) {
+            localId = localId.replace("wxlocalresource", "wxLocalResource");
+          }
+          wx.uploadImage({
+            localId: localId,
+            isShowProgressTips: 1,
+            success: function (uploadRes) {
+              $wxService.uploadMediaID(uploadRes.serverId)
+              .then(res => {
+                if (res.isSuccess) {
+                  let pictureUrl = res.message;
+                  that.hasPicture = true;
+                  that.pictureUrl = pictureUrl;
+                  that.propagateChange(that.pictureUrl);
+                } else {
+                  that.presentToast(res.message,res.isSuccess?"success":"error");
+                  // that.reload();
+                }
+              }); // localData是图片的base64数据,可以用img标签显示
+            }
+          });
+        }
+      }
+    });
+  }
+
+  presentToast(message:string,classstyle:string) {
+    let toast = this.toastCtrl.create({
+      message:  message,
+      duration: 3000,
+      position: 'middle',
+      cssClass: classstyle
+    });
+
+    toast.onDidDismiss(() => {
+      //console.log('Dismissed toast');
+    });
+
+    toast.present();
+  }
+}

+ 34 - 0
src/app/directives/equal-validator.directive.ts

@@ -0,0 +1,34 @@
+import {Directive, Input} from '@angular/core';
+import { Validator, AbstractControl, NG_VALIDATORS } from '@angular/forms';
+
+@Directive({
+  selector: '[validateEqual]',
+  providers: [
+  { provide: NG_VALIDATORS, useExisting: EqualValidatorDirective,
+    multi: true }
+]
+})
+export class EqualValidatorDirective implements Validator {
+  @Input('validateEqual') public validateEqual: string
+
+  validate(c: AbstractControl): {[key: string]: any} | null {
+    // self value
+    let v = c.value;
+
+    // control vlaue
+    let e = c.root.get(this.validateEqual);
+
+    // value not equal
+    if (e && v !== e.value) {
+      return {
+        validateEqual: true
+      }
+    } else {
+      if (e) {
+        delete e.errors['validateEqual'];
+        if (!Object.keys(e.errors).length) e.setErrors(null);
+        return null;
+      }
+    }
+  }
+}

+ 5 - 0
src/app/main.ts

@@ -0,0 +1,5 @@
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+
+import { AppModule } from './app.module';
+
+platformBrowserDynamic().bootstrapModule(AppModule);

+ 85 - 0
src/app/services/announcement/announcement.service.ts

@@ -0,0 +1,85 @@
+import { Injectable }    from '@angular/core';
+import { Http } from '@angular/http';
+import { AppConfig } from '../../app.config';
+import { ResultMessage } from '../../../viewmodel/result';
+import { ServiceCommon } from "../service.common";
+import {AnnouncementView} from "../../../viewmodel/system/announcement";
+
+import 'rxjs/add/operator/toPromise';
+
+@Injectable()
+export class AnnouncementService {
+  constructor(private http: Http) { }
+
+  getTopAnnouncementList(count: number): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "AnnouncementServices/GetUserAnnouncementView";
+    return this.http.post(url, JSON.stringify({ userID: localStorage.userID, pageIndex: 0, pageSize: count }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        return {
+          isSuccess: true,
+          message: "",
+          data: res.json().rows
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+
+  getAnnouncementList(count: number): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "AnnouncementServices/GetUserAnnouncementView";
+    return this.http.post(url, JSON.stringify({ userID: localStorage.userID, pageIndex: 0, pageSize: count }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        //let announcement = res.json();
+        return {
+          isSuccess: true,
+          message: "",
+          data: res.json().rows.map(x => {
+            return {
+              AnnouncementID:x.AnnouncementID,
+              AnnouncementTypeID: x.AnnouncementTypeID,
+              AnnouncementTypeDesc:x.AnnouncementTypeDesc,
+              Title:x.Title,
+              Content:x.Content,
+              StartTimeStr:x.StartTime != null ? x.StartTime.substring(6,19): x.StartTime,
+              EndTimeStr:x.EndTime != null ? x.EndTime.substring(6,19): x.EndTime,
+              IsTop:x.IsTop,
+              CreateTimeStr:x.CreateTimeDec,
+              //!= null ? x.CreateTime.substring(6,19): x.CreateTime,
+            } as AnnouncementView
+          })
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+  getAnnouncementByID(announcementID:string): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "AnnouncementServices/GetAnnouncementViewInfo";
+    return this.http.post(url, JSON.stringify({ announcementID: announcementID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let announcement = res.json();
+        return {
+          isSuccess: true,
+          message: "",
+          data: {
+            AnnouncementID:announcement.AnnouncementID,
+            AnnouncementTypeID: announcement.AnnouncementTypeID,
+            AnnouncementTypeDesc:announcement.AnnouncementTypeDesc,
+            Title:announcement.Title,
+            Content:announcement.Content,
+            StartTimeStr:announcement.StartTime != null ? announcement.StartTime.substring(6,19): announcement.StartTime,
+            EndTimeStr:announcement.EndTime!= null ? announcement.EndTime.substring(6,19): announcement.EndTime,
+            CreateTimeStr:announcement.CreateTime!= null ? announcement.CreateTime.substring(6,19): announcement.CreateTime,
+            IsTop:announcement.IsTop == "true" ? true: false,
+            IsTopStr: announcement.IsTop,
+          }
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+}

+ 47 - 0
src/app/services/certisfier/certisfier.service.ts

@@ -0,0 +1,47 @@
+import { Injectable }    from '@angular/core';
+import { Http } from '@angular/http';
+import { AppConfig } from '../../app.config';
+import { ResultMessage } from '../../../viewmodel/result';
+import { ServiceCommon } from "../service.common";
+import {CertisfierInfo} from "../../../viewmodel/certisfier/certisfierInfo";
+import 'rxjs/add/operator/toPromise';
+
+@Injectable()
+export class CertisfierService {
+  constructor(private http: Http) { }
+
+  getCertisfierList(count: number): Promise<CertisfierInfo[]> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "CertisfierServices/CertisfierListView";
+    return this.http.post(url, JSON.stringify({ userID: localStorage.userID, pageIndex: 0, pageSize: count }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        return res.json().rows as CertisfierInfo[];
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+  getCertisfierTypeList(): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "CertisfierServices/DictionaryDropDown";
+    return this.http.post(url, JSON.stringify({  }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        return {
+          isSuccess: true,
+          message: "",
+          data: res.json()
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+  updateCertisfierType(certisfier:CertisfierInfo): Promise<ResultMessage>{
+    let url: string = AppConfig.getServiceUrl();
+    url += "CertisfierServices/StuEdit";
+    return this.http.post(url, JSON.stringify(certisfier), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        return res.json() as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+}

+ 2 - 0
src/app/services/jweixin/jweixin.d.ts

@@ -0,0 +1,2 @@
+declare let wx:any;
+declare let WeixinJSBridge:any;

+ 100 - 0
src/app/services/message.service.ts

@@ -0,0 +1,100 @@
+import {Injectable} from "@angular/core";
+import {AnnouncementService} from "./announcement/announcement.service";
+// import {EvaluationService} from "./evaluation/evaluation.service";
+import {MessageBody} from "../../viewmodel/system/message";
+import {Events} from "ionic-angular";
+// import {EvaluationEnterInfo} from "../../viewmodel/evaluation/evaluationEnterInfo";
+import {AnnouncementView} from "../../viewmodel/system/announcement";
+
+@Injectable()
+export class MessageService {
+  constructor (public announcementService : AnnouncementService,
+               //public evaluationService: EvaluationService,
+               public events: Events) {
+  }
+
+  loadAnnouncemnt() {
+    this.announcementService.getTopAnnouncementList(1000)
+      .then(res => {
+        if (res.isSuccess) {
+          let storageMessageList : MessageBody[] = (eval(localStorage.messageList) as MessageBody[]);
+          let existsAnnouncementList : MessageBody[] = storageMessageList
+            .filter(w => w.type == "announcement")
+          let announcementList = res.data;
+          let newAnnouncementList = announcementList.filter(x => !existsAnnouncementList.some(w => w.key == x.AnnouncementID && w.data.Content == this.escape2Html(this.escape2Html(x.Content))));
+          //let newAnnouncementList   = announcementList.filter(x => !existsAnnouncementList.some(w => w.data.Content == this.escape2Html(this.escape2Html(x.Content))));
+          let oldMessageList : MessageBody[] = storageMessageList.filter(x => announcementList.some(w => w.AnnouncementID==x.key && this.escape2Html(this.escape2Html(w.Content))==x.data.Content));
+          //let oldMessageList : MessageBody[] = storageMessageList;
+          storageMessageList = [];
+          for (let announcement of newAnnouncementList) {
+            announcement.Content = this.escape2Html(this.escape2Html(announcement.Content));
+            storageMessageList.push({
+              type: "announcement",
+              key: announcement.AnnouncementID,
+              message: announcement.Title,
+              readed: false,
+              data: {
+                AnnouncementTypeID: announcement.AnnouncementTypeID,
+                AnnouncementTypeDesc: announcement.AnnouncementTypeDesc,
+                Content: announcement.Content
+              } as AnnouncementView
+            } as MessageBody);
+          }
+          for(let oldMessage of oldMessageList) {
+            storageMessageList.push({
+              type : oldMessage.type,
+              key : oldMessage.key,
+              message : oldMessage.message,
+              readed : oldMessage.readed,
+              data : oldMessage.data
+            } as MessageBody);
+          }
+          localStorage.messageList = JSON.stringify(storageMessageList);
+          this.events.publish('message.refreshed', storageMessageList.filter(x => x.readed == false).length);
+        }
+      });
+  }
+
+  escape2Html(str) {
+    var arrEntities={'lt':'<','gt':'>','nbsp':' ','amp':'&','quot':'"'};
+    return str.replace(/&(lt|gt|nbsp|amp|quot);/ig,function(all,t){return arrEntities[t];});
+   }
+
+  loadEvaluation() {
+    // this.evaluationService.getStudentEvaluationEnterViewList(0, 1000)
+    //   .then(res => {
+    //     if (res.isSuccess) {
+    //       let storageMessageList : MessageBody[] = (eval(localStorage.messageList) as MessageBody[]);
+    //       let existsEvaluationList : string[] =storageMessageList
+    //         .filter(w => w.type == "evaluation" || w.type == "oldevaluation")
+    //         .map(w => w.key);
+    //       let evaluationList : EvaluationEnterInfo[] = res.data;
+    //       let newMessageList = (evaluationList.filter(x => !existsEvaluationList.some(w => w == x.missionClassID)));
+    //       for (let message of newMessageList) {
+    //         storageMessageList.push({
+    //           type: "evaluation",
+    //           key: message.missionClassID,
+    //           message: '任务班:'+message.missionClassName+'需要你进行评价,请点击进入评价页面。',
+    //           readed: false,
+    //           data: message
+    //         } as MessageBody);
+    //       }
+    //       localStorage.messageList = JSON.stringify(storageMessageList);
+    //       this.events.publish('message.refreshed', storageMessageList.filter(x => x.readed == false).length);
+    //     }
+    //   });
+  }
+
+  loadMessage() {
+    this.loadAnnouncemnt();
+    //this.loadEvaluation();
+  }
+
+  setReaded(type: string, key: string) {
+    let storageMessageList : MessageBody[] = (eval(localStorage.messageList) as MessageBody[]);
+    storageMessageList.filter(x => x.type == type && x.key == key).forEach(x => x.readed = true);
+
+    localStorage.messageList = JSON.stringify(storageMessageList);
+    this.events.publish('message.refreshed', storageMessageList.filter(x => x.readed == false).length);
+  }
+}

+ 69 - 0
src/app/services/myexam/myexam.service.ts

@@ -0,0 +1,69 @@
+import { Injectable }    from '@angular/core';
+import { Http } from '@angular/http';
+import { AppConfig } from '../../app.config';
+import { ResultMessage } from '../../../viewmodel/result';
+import { ServiceCommon } from "../service.common";
+import {RefundView} from "../../../viewmodel/myexam/RefundView";
+import 'rxjs/add/operator/toPromise';
+
+@Injectable()
+export class MyexamService {
+  constructor(private http: Http) { }
+
+  getMyexamListView(count: number): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "MyexamServices/MyexamListView";
+    return this.http.post(url, JSON.stringify({
+      userID: localStorage.userID,
+      pageIndex: 0,
+      pageSize: count
+    }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        return {
+          isSuccess: true,
+          message: "",
+          data: res.json().rows
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+  canPay(examinationRegistrationID:string): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "ExamineApply/CanPay";
+    return this.http.post(url, JSON.stringify({
+      examinationRegistrationID: examinationRegistrationID
+    }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let result = res.json();
+        return {
+          isSuccess: result.IsSuccess,
+          message: result.Message,
+          data: null
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+   cancel(ExaminationRegistrationID:string): Promise<ResultMessage>{
+    let url: string = AppConfig.getServiceUrl();
+    url += "MyexamServices/Cancel";
+    return this.http.post(url, JSON.stringify({ExaminationRegistrationID:ExaminationRegistrationID}), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        return res.json() as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  messageSubmit(ExaminationRegistrationID:string,refundView:RefundView): Promise<ResultMessage>{
+    let url: string = AppConfig.getServiceUrl();
+    url += "MyexamServices/CancelApply";
+    return this.http.post(url, JSON.stringify({ExaminationRegistrationID:ExaminationRegistrationID,RefundView:refundView}), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        return res.json() as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+}

+ 193 - 0
src/app/services/register/register.service.ts

@@ -0,0 +1,193 @@
+import { Injectable }    from '@angular/core';
+import { Http } from '@angular/http';
+import { AppConfig } from '../../app.config';
+import { ResultMessage } from '../../../viewmodel/result';
+import { ServiceCommon } from "../service.common";
+import {SubjectView} from "../../../viewmodel/register/subjectView";
+
+import 'rxjs/add/operator/toPromise';
+import {StudentListView} from "../../../viewmodel/register/studentListView";
+import {DictionaryItemView} from "../../../viewmodel/common/dictionaryItemView";
+import {RegistView} from "../../../viewmodel/register/registView";
+import {ExaminationTypeView} from "../../../viewmodel/register/ExaminationTypeView";
+
+@Injectable()
+export class RegisterService {
+  constructor(private http: Http) { }
+
+  getRegeisterSubjectList(): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "ExamineRegisterServices/GetSubjectListByUserID";
+    return this.http.post(url, JSON.stringify({ userID: localStorage.userID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        return {
+          isSuccess: true,
+          message: "",
+          data: res.json().rows.map(x => {
+          return {
+            ExaminationProjectID:x.ExaminationProjectID,
+            ExaminationProjectName:x.ExaminationProjectName,
+            SchoolYearID:x.SchoolYearID,
+            SchoolYearCode:x.SchoolYearCode,
+            ExaminationLevelID:x.ExaminationLevelID,
+            ExaminationLevelName:x.ExaminationLevelName,
+            PreposeProjectID:x.PreposeProjectID,
+            PreposeProjectName:x.PreposeProjectName,
+            Remark:x.Remark,
+            ExaminationBatchID:x.ExaminationBatchID,
+            ExaminationBatchName:x.ExaminationBatchName,
+            ExaminationTypeID: x.ExaminationTypeID,
+            ExaminationTypeName: x.ExaminationTypeName,
+            ExaminationBatchProjectID:x.ExaminationBatchProjectID,
+            SimulateTime: x.SimulateTime,
+            StartDateStr:x.StartTime != null ? x.StartTime.substring(6,19): x.StartTime,
+            EndDateStr:x.EndDate != null ? x.EndDate.substring(6,19): x.EndDate,
+            ExaminationDate:x.ExaminationDate,
+            MaxRegistCount:x.MaxRegistCount,
+            RegisterNum:x.RegisterNum,
+            SchoolYearNum:x.SchoolYearNum,
+          } as SubjectView
+        })
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  getSubjectForRegister(examinationBatchProjectID:string): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "ExamineRegisterServices/GetSubjectByUserIDAndExaminationBatchProjectID";
+    return this.http.post(url, JSON.stringify({examinationBatchProjectID:examinationBatchProjectID, userID: localStorage.userID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let subject = res.json();
+        return {
+          isSuccess: true,
+          message: "",
+          data: {
+            ExaminationProjectID:subject.ExaminationProjectID,
+            ExaminationProjectName:subject.ExaminationProjectName,
+            SchoolYearID:subject.SchoolYearID,
+            SchoolYearCode:subject.SchoolyearCode,
+            ExaminationLevelID:subject.ExaminationLevelID,
+            ExaminationLevelName:subject.ExaminationLevelName,
+            PreposeProjectID:subject.PreposeProjectID,
+            PreposeProjectName:subject.PreposeProjectName,
+            Remark:subject.Remark,
+            ExaminationBatchID:subject.ExaminationBatchID,
+            ExaminationBatchName:subject.ExaminationBatchName,
+            ExaminationBatchProjectID:subject.ExaminationBatchProjectID,
+            StartDate:new Date(parseInt(subject.StartDate.substring(6,19))),
+            EndDate:new Date(parseInt(subject.EndDate.substring(6,19))),
+            ExaminationDate:subject.ExaminationDate,
+            MaxRegistCount:subject.MaxRegistCount,
+            RegisterNum:subject.RegisterNum,
+            SchoolYearNum:subject.SchoolYearNum,
+            ExaminationTypeID: subject.ExaminationTypeID,
+            ExaminationTypeName: subject.ExaminationTypeName,
+            ExaminationProjectFeeID:subject.ExaminationProjectFeeID,
+            ExaminationProjectFeeName:subject.ExaminationProjectFeeName,
+          }
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  studentExamineRegister(studentListView:StudentListView):Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "ExamineRegisterServices/Register";
+    return this.http.post(url, JSON.stringify({ registerView: studentListView, UserID: localStorage.userID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let IsSuccess = res.json();
+        if (IsSuccess.IsSuccess) {
+          return {
+            isSuccess: true,
+            message: IsSuccess.Message,
+            data: null
+          } as ResultMessage
+        } else {
+          return {
+            isSuccess: false,
+            message: IsSuccess.Message,
+            data: null
+          } as ResultMessage
+        }
+      })
+  }
+
+  getFeeTypeViewByProjectFeeID(projectFeeID:string):Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "ExamineRegisterServices/GetFeeTypeViewGrid";
+    return this.http.post(url, JSON.stringify({ examinationProjectFeeID: projectFeeID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        return {
+          isSuccess: true,
+          message: "",
+          data: res.json().rows.map(x => {
+            return {
+              dictionaryItemID:x.DictionaryItemID,
+              dictionaryCode:x.DictionaryCode,
+              dictionaryName:x.DictionaryName,
+              orderNo:x.OrderNo,
+              code:x.Code,
+              name:x.Name,
+              value:x.Value,
+            } as DictionaryItemView
+          })
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  getRegistViewByUserID():Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "ExamineRegisterServices/GetRegistViewByUserID";
+    return this.http.post(url, JSON.stringify({ userID: localStorage.userID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let registerView = res.json();
+        return {
+          isSuccess: true,
+          message: "",
+          data: {
+            userID:registerView.UserID,
+            certificatesType:registerView.CertificatesType,
+            loginID:registerView.LoginID,
+            userName:registerView.UserName,
+            mobile:registerView.Mobile,
+            photoUrl:registerView.PhotoUrl,
+            email:registerView.Email,
+            sex:registerView.Sex,
+            birthDate:registerView.BirthDate != null ? new Date(parseInt(registerView.BirthDate.substring(6,19))) : registerView.BirthDate,
+          }as RegistView
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  getCanRegisterExaminationTypeView():Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "ExamineRegisterServices/GetCanRegisterExaminationType";
+    return this.http.post(url, JSON.stringify({ userID: localStorage.userID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        return {
+          isSuccess: true,
+          message: "",
+          data: res.json().rows.map(x => {
+            return {
+              ExaminationTypeID:x.ExaminationTypeID,
+              ExaminationBatchID:x.ExaminationBatchID,
+              ExaminationTypeName:x.Name,
+              IsTimesLimit:x.IsTimesLimitDesc,
+              RecordStatus:x.RecordStatus,
+            } as ExaminationTypeView
+          })
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+}

+ 14 - 0
src/app/services/service.common.ts

@@ -0,0 +1,14 @@
+import {Headers} from '@angular/http';
+
+export class ServiceCommon {
+  //constructor(private http: Http) { }
+  private static headers = new Headers({'Content-Type': 'application/json; charset=utf-8' });
+
+  static getHeader() : Headers {
+    return this.headers;
+  }
+
+  static serviceErrorHandler(error: any): Promise<any> {
+    return Promise.resolve({ isSuccess: false, message: error.toString(), data: null });
+  }
+}

+ 65 - 0
src/app/services/student/student.service.ts

@@ -0,0 +1,65 @@
+import { Injectable }    from '@angular/core';
+import { Http } from '@angular/http';
+import { AppConfig } from '../../app.config';
+import { ResultMessage } from '../../../viewmodel/result';
+import { StudentView } from '../../../viewmodel/user/studentView';
+import { ServiceCommon } from "../service.common";
+
+import 'rxjs/add/operator/toPromise';
+import {StudentInfoView} from "../../../viewmodel/user/studentInfo";
+
+@Injectable()
+export class StudentService {
+  constructor(private http: Http) { }
+  getStudentViewByUserID(count: number): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "StudentServices/GetStudentViewByUserID";
+    return this.http.post(url, JSON.stringify({ userID: localStorage.userID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let student = res.json();
+        if(student) {
+          return {
+            isSuccess: true,
+            message: "",
+            data: {
+              UserID: student.UserID,
+              UserName: student.UserName,
+              IDNumber: student.IDNumber,
+              Mobile: student.Mobile,
+              Email: student.Email,
+              PhotoUrl: student.PhotoUrl,
+              LoginID: student.LoginID,
+              CertificatesType: student.CertificatesType,
+              BirthDate:student.BirthDate != null ? new Date(parseInt(student.BirthDate.substring(6,19))+8*60*60*1000).toISOString() : student.BirthDate,
+              Sex:student.Sex
+            }as StudentView
+          } as ResultMessage;
+        }
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  saveStudentChange(StudentInfoView: StudentInfoView, UserID: string): Promise<ResultMessage>{
+    let url: string = AppConfig.getServiceUrl();
+    url += "StudentServices/SaveStudentChange";
+    return this.http.post(url, JSON.stringify({ Model: StudentInfoView, UserID: UserID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let IsSuccess = res.json();
+        if(IsSuccess.IsSuccess){
+          return{
+            isSuccess: true,
+            message: "保存成功",
+            data:null
+          } as ResultMessage
+        }else{
+          return{
+            isSuccess: false,
+            message: IsSuccess.Message,
+            data:null
+          } as ResultMessage
+        }
+      })
+  }
+}

+ 59 - 0
src/app/services/system.service.ts

@@ -0,0 +1,59 @@
+import {Injectable} from "@angular/core";
+import {Events} from "ionic-angular";
+import {AppConfig} from "../app.config";
+import {ServiceCommon} from "./service.common";
+import {Http} from "@angular/http";
+import {ResultMessage} from "../../viewmodel/result";
+import {DictionaryItemView} from "../../viewmodel/common/dictionaryItemView";
+
+@Injectable()
+export class SystemService {
+  constructor (public events: Events, private http: Http) {
+  }
+
+  getDictionaryItemViewList(dictionaryCode:string): Promise<ResultMessage>{
+    let url: string = AppConfig.getServiceUrl();
+    url += "CommonServices/GetDictionaryViewList";
+    return this.http.post(url, JSON.stringify({ dictionaryCode:dictionaryCode}), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let dictionaryItemList = res.json();
+        if(dictionaryItemList)
+        {
+          return{
+            isSuccess: true,
+            message: "",
+            data: res.json().map(x => {
+              return {
+                dictionaryItemID:x.DictionaryItemID,
+                dictionaryCode:x.DictionaryCode,
+                dictionaryName:x.DictionaryName,
+                orderNo:x.OrderNo,
+                code:x.Code,
+                name:x.Name,
+                value:x.Value,
+              } as DictionaryItemView
+            })
+          }as ResultMessage;
+        }
+      })
+  }
+
+  getSchoolAreaListWithoutSocial(): Promise<ResultMessage>{
+    let url: string = AppConfig.getServiceUrl();
+    url += "UserServices/GetSchoolAreaWithoutSocial";
+    return this.http.post(url, JSON.stringify({ bindType:2}), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let dictionaryItemList = res.json();
+        if(dictionaryItemList)
+        {
+          return{
+            isSuccess: true,
+            message: "",
+            data: dictionaryItemList
+          } as ResultMessage;
+        }
+      })
+  }
+}

+ 279 - 0
src/app/services/user/user.service.ts

@@ -0,0 +1,279 @@
+import { Injectable }    from '@angular/core';
+import { Http } from '@angular/http';
+import { AppConfig } from '../../app.config';
+import { ResultMessage } from '../../../viewmodel/result';
+import { ServiceCommon } from "../service.common";
+
+import 'rxjs/add/operator/toPromise';
+import {StudentInfoView} from "../../../viewmodel/user/studentInfo";
+import {StudentView} from "../../../viewmodel/user/studentView";
+import {DictionaryItemView} from "../../../viewmodel/common/dictionaryItemView";
+import {RegistView} from "../../../viewmodel/user/registView";
+
+@Injectable()
+export class UserService {
+	constructor(private http: Http) { }
+
+	login(loginID: string, password: string): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "UserServices/Login";
+    let openID: string = localStorage.openID;
+    if (!openID) openID = null;
+    return this.http.post(url, JSON.stringify({ loginID: loginID, password: password, openID: openID }), {headers: ServiceCommon.getHeader() })
+      .toPromise()
+      .then(res => {
+        var result = res.json();
+        return {
+          isSuccess: result.IsSuccess,
+          message: result.Message,
+          errorCode: result.ErrorCode,
+          data: result.Data
+          // isSuccess: res.json(),
+          // message: res.json() ? "" : "用户名或密码不正确",
+          // data: null
+          } as ResultMessage;
+        })
+      .catch(ServiceCommon.serviceErrorHandler);
+	}
+
+	getUserByLoginID(loginID: string): Promise<ResultMessage> {
+		let baseurl: string = AppConfig.getServiceUrl();
+    let studenturl = baseurl + "StudentServices/GetStudentViewByLoginID";
+
+    return this.http.post(studenturl, JSON.stringify({ loginID: loginID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let student = res.json();
+        if (student) {
+          return {
+            isSuccess: true,
+            message: "",
+            data: {
+              UserID: student.UserID,
+              LoginID: loginID,
+              UserName: student.UserName,
+              classmajorID: student.ClassMajorID,
+              classmajorName: student.ClassMajorName
+            }
+          } as ResultMessage;
+        } else {
+          return {
+            isSuccess: false,
+            message: "当前登录并非学生用户,请重新登录。",
+            data: null
+          } as ResultMessage;
+        }
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+	}
+
+  getStudentByUserID(userID: string): Promise<ResultMessage> {
+    let baseurl: string = AppConfig.getServiceUrl();
+    let studenturl = baseurl + "StudentServices/GetStudentViewByUserID";
+
+    return this.http.post(studenturl, JSON.stringify({ userID: userID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let student = res.json();
+        if (student) {
+          return {
+            isSuccess: true,
+            message: "",
+            data: {
+              UserID: student.UserID,
+              LoginID: student.LoginID,
+              Name: student.Name,
+              UserName:student.UserName,
+              UsedName: student.UsedName,
+              Sex: student.Sex,
+              SexName: student.SexName,
+              Nation:student.Nation,
+              NationName: student.NationName,
+              BirthDate: student.BirthDate == null ? null :new Date(parseInt(student.BirthDate.substring(6,19))+8*60*60*1000).toISOString(),
+              Politics:student.Politics,
+              PoliticsName: student.PoliticsName,
+              CertificatesType:student.CertificatesType,
+              CertificatesTypeName: student.CertificatesTypeName,
+              IDNumber: student.IDNumber,
+              ClassMajorID: student.ClassMajorID,
+              ClassMajorName: student.ClassMajorName,
+              EducationID:student.EducationID,
+              EducationName: student.EducationName,
+              StudentType:student.StudentType,
+              StudentTypeName: student.StudentTypeName,
+              PhotoUrl: student.PhotoUrl,//AppConfig.getServiceUrl() + student.PhotoUrl.replace(/(^[/]*)/g, ''),
+              StudentStatus: student.StudentStatus,
+              StudentStatusName: student.StudentStatusName,
+              InSchoolStatusID:student.InSchoolStatusID,
+              InSchoolStatusName: student.InSchoolStatusName,
+              EntranceDate: student.EntranceDate == null ? null :new Date(parseInt(student.EntranceDate.substring(6,19))+8*60*60*1000).toISOString(),
+              EntranceWay:student.EntranceWay,
+              EntranceWayName: student.EntranceWayName,
+              ExamineeNum: student.ExamineeNum,
+              ExamineeType:student.ExamineeType,
+              ExamineeTypeName: student.ExamineeTypeName,
+              Features:student.Features,
+              FeaturesName: student.FeaturesName,
+              Score: student.Score,
+              Territorial:student.Territorial,
+              TerritorialName: student.TerritorialName,
+              Area: student.Area,
+              Place: student.Place,
+              Healthy:student.Healthy,
+              HealthyName: student.HealthyName,
+              Specialty: student.Specialty,
+              Height: student.Height,
+              Weight: student.Weight,
+              Email: student.Email,
+              QQ: student.QQ,
+              Dormitory: student.Dormitory,
+              Telephone: student.Telephone,
+              Mobile: student.Mobile,
+              Address: student.Address,
+              WorkUnit: student.WorkUnit,
+              ZipCode: student.ZipCode,
+              Recipient: student.Recipient,
+              BankName: student.BankName,
+              CardNo: student.CardNo,
+              Remarks: student.Remarks
+            } as StudentInfoView
+          } as ResultMessage;
+        }
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  getStudentChangeFeilds(UserID:string) : Promise<ResultMessage> {
+    let baseurl: string = AppConfig.getServiceUrl();
+    let studenturl = baseurl + "StudentServices/GetStudentChangeFeilds";
+    return this.http.post(studenturl, JSON.stringify({ UserID: UserID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let studentChangeFilds = res.json();
+        if (studentChangeFilds) {
+          return {
+            isSuccess: true,
+            message: "",
+            data:res.json()
+          }as ResultMessage;
+        }
+      })
+  }
+
+  studentChangeSave(StudentView: StudentView, UserID: string): Promise<ResultMessage>{
+    let url: string = AppConfig.getServiceUrl();
+    url += "StudentServices/GetStudentChangeSave";
+    return this.http.post(url, JSON.stringify({ Model: StudentView, UserID: UserID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let IsSuccess = res.json();
+        if(IsSuccess.IsSuccess){
+          return{
+            isSuccess: true,
+            message: "保存成功",
+            data:null
+          } as ResultMessage
+        }else{
+          return{
+            isSuccess: false,
+            message: IsSuccess.Message,
+            data:null
+          } as ResultMessage
+        }
+      })
+  }
+
+  getSchoolYear(): Promise<ResultMessage>{
+    let url: string = AppConfig.getServiceUrl();
+    url += "CommonServices/GetSchoolYearForDropdownList";
+    return this.http.post(url, JSON.stringify({ }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let schoolyearList = res.json();
+        if(schoolyearList)
+        {
+          return{
+            isSuccess: true,
+            message: "",
+            data: res.json()
+          }as ResultMessage;
+        }
+      })
+  }
+
+  forgotPassword(loginID:string): Promise<ResultMessage>{
+    let url: string = AppConfig.getServiceUrl();
+    url += "UserServices/ForgotPassword";
+    return this.http.post(url, JSON.stringify({LoginID:loginID}), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+          return{
+            isSuccess: res.json().IsSuccess,
+            message: res.json().Message,
+            data: null
+          }as ResultMessage;
+      })
+  }
+
+  regist(registView: RegistView): Promise<ResultMessage>{
+    let url: string = AppConfig.getServiceUrl();
+    url += "UserServices/Regist";
+    let openID: string = localStorage.openID;
+    if (!openID) openID = null;
+    return this.http.post(url, JSON.stringify({ model: registView, openID: openID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let resMessage = res.json();
+        return{
+          isSuccess: resMessage.IsSuccess,
+          message: resMessage.Message,
+          data: resMessage.Data
+        }as ResultMessage;
+      })
+  }
+
+  unbind(): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "UserServices/UnBind";
+    let openID: string = localStorage.openID;
+    if (!openID) openID = null;
+    return this.http.post(url, JSON.stringify({ openID: openID }), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let resMessage = res.json();
+        return{
+          isSuccess: resMessage.IsSuccess,
+          message: resMessage.Message,
+          data: resMessage.Data
+        }as ResultMessage;
+      });
+  }
+
+  getDictionaryItemViewList(dictionaryCode:string): Promise<ResultMessage>{
+    let url: string = AppConfig.getServiceUrl();
+    url += "CommonServices/GetDictionaryViewList";
+    return this.http.post(url, JSON.stringify({ dictionaryCode:dictionaryCode}), {headers: ServiceCommon.getHeader()})
+      .toPromise()
+      .then(res => {
+        let dictionaryItemList = res.json();
+        if(dictionaryItemList)
+        {
+          return{
+            isSuccess: true,
+            message: "",
+            data: res.json().map(x => {
+              return {
+                dictionaryItemID:x.DictionaryItemID,
+                dictionaryCode:x.DictionaryCode,
+                dictionaryName:x.DictionaryName,
+                orderNo:x.OrderNo,
+                code:x.Code,
+                name:x.Name,
+                value:x.Value,
+              } as DictionaryItemView
+            })
+          }as ResultMessage;
+        }
+      })
+  }
+}

+ 158 - 0
src/app/services/wxService.ts

@@ -0,0 +1,158 @@
+///<reference path="./jweixin/jweixin.d.ts"/>
+import {Injectable} from "@angular/core";
+import {Events} from "ionic-angular";
+import {AppConfig} from "../app.config";
+import {ServiceCommon} from "./service.common";
+import {Http} from "@angular/http";
+import {UrlHelper} from "../utility/urlHelper";
+import {WechatUserInfo} from "../../viewmodel/user/wechatUserInfo";
+import {ResultMessage} from "../../viewmodel/result";
+import {JsPayView} from "../../viewmodel/system/jspayview";
+
+@Injectable()
+export class wxService {
+  constructor (public events: Events, private http: Http) {
+  }
+
+  getConfig() : Promise<any> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "WxMpServices/GetJSConfigData";
+    return this.http.post(url, JSON.stringify({ url: location.href }), {headers: ServiceCommon.getHeader() })
+      .toPromise()
+      .then(res => {
+        let configData: any = res.json();
+        wx.config({
+          debug: false,
+          appId: configData.AppId,
+          timestamp: configData.Timestamp,
+          nonceStr: configData.NonceStr,
+          signature: configData.Signature,
+          jsApiList: [
+            "openLocation", "chooseImage", "uploadImage"
+          ]
+        });
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  uploadBase64Img(base64Data: string) : Promise<any> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "WxMpServices/UploadBase64Img";
+    return this.http.post(url, JSON.stringify({ base64Image: base64Data }), {headers: ServiceCommon.getHeader() })
+      .toPromise()
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  uploadMediaID(mediaID: string): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "WxMpServices/UploadMediaID";
+    return this.http.post(url, JSON.stringify({ mediaID: mediaID }), {headers: ServiceCommon.getHeader() })
+      .toPromise()
+      .then(res => {
+        var result = res.json();
+        return {
+          isSuccess: result.IsSuccess,
+          message: result.Message,
+          errorCode: result.ErrorCode,
+          data: result.Data
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  getOpenID(): Promise<ResultMessage> {
+    let url: string = AppConfig.getServiceUrl();
+    url += "WxMpServices/GetOpenID";
+    let code: string = new UrlHelper().getUrlParam("code");
+    return this.http.post(url, JSON.stringify({ code: code }), {headers: ServiceCommon.getHeader() })
+      .toPromise()
+      .then(res => {
+        var result = res.json();
+        return {
+          isSuccess: result.IsSuccess,
+          message: result.Message,
+          errorCode: result.ErrorCode,
+          data: result.Data
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+  getUserInfo(openID: string): Promise<any> {
+    let getInfoUrl: string = AppConfig.getServiceUrl();
+    getInfoUrl += "WxMpServices/GetUserInfoByOpenID";
+    return this.http.post(getInfoUrl, JSON.stringify({ openID: openID }), {headers: ServiceCommon.getHeader() })
+      .toPromise()
+      .then(res => {
+        let userInfo = res.json();
+        return {
+          openID: openID,
+          userID: userInfo.UserID,
+          loginID: userInfo.LoginID,
+          userName: userInfo.Name
+        } as WechatUserInfo
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+  unbind(): Promise<ResultMessage> {
+    let openID = localStorage.openID;
+    let getInfoUrl: string = AppConfig.getServiceUrl();
+    getInfoUrl += "WxMpServices/UnbindOpenID";
+    return this.http.post(getInfoUrl, JSON.stringify({ openID: openID }), {headers: ServiceCommon.getHeader() })
+      .toPromise()
+      .then(res => {
+        let resultMessage = res.json();
+        return {
+          isSuccess: resultMessage.IsSuccess,
+          message: resultMessage.Message
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  jsPay(examinationRegistrationID: string): Promise<ResultMessage> {
+    let openID = localStorage.openID;
+    let getInfoUrl: string = AppConfig.getServiceUrl();
+    getInfoUrl += "WxMpServices/GetJSPayInfo";
+    return this.http.post(getInfoUrl, JSON.stringify({ examinationRegistrationID: examinationRegistrationID, openID: openID }), {headers: ServiceCommon.getHeader() })
+      .toPromise()
+      .then(res => {
+        let returnInfo = res.json();
+        return {
+          isSuccess: returnInfo.IsSuccess,
+          message: returnInfo.Message,
+          data: returnInfo.Data as JsPayView
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  payConfirm(examinationRegistrationID: string): Promise<ResultMessage> {
+    let confirmUrl: string = AppConfig.getServiceUrl();
+    confirmUrl += "WxMpServices/PayConfirm";
+    return this.http.post(confirmUrl, JSON.stringify({ examinationRegistrationID: examinationRegistrationID }), {headers: ServiceCommon.getHeader() })
+      .toPromise()
+      .then(res => {
+        let returnInfo = res.json();
+        return {
+          isSuccess: returnInfo.IsSuccess,
+          message: returnInfo.Message
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+
+  payFail(examinationRegistrationID: string, payForm: string): Promise<ResultMessage> {
+    let failUrl: string = AppConfig.getServiceUrl();
+    failUrl += "WxMpServices/PayFail";
+    return this.http.post(failUrl, JSON.stringify({ examinationRegistrationID: examinationRegistrationID, payForm: payForm }), {headers: ServiceCommon.getHeader() })
+      .toPromise()
+      .then(res => {
+        let returnInfo = res.json();
+        return {
+          isSuccess: returnInfo.IsSuccess,
+          message: returnInfo.Message
+        } as ResultMessage;
+      })
+      .catch(ServiceCommon.serviceErrorHandler);
+  }
+}

+ 8 - 0
src/app/utility/dateFunction.ts

@@ -0,0 +1,8 @@
+export class DateFunction {
+  static procDate(dateObj: object): any {
+    if (dateObj) {
+      return null;
+    }
+    return dateObj.toString().replace('/Date(','').replace(')/','');
+  }
+}

+ 36 - 0
src/app/utility/dictionary.ts

@@ -0,0 +1,36 @@
+export class Dictionary {
+  items: object;
+  onchange: (key: string, val: any) => void;
+  constructor() {
+    this.items = {};
+  }
+  has(key: any): boolean {
+    return this.items.hasOwnProperty(key);
+  }
+  set(key: any, val: any) {
+    this.items[key] = val;
+    if (this.onchange != null) {
+      this.onchange(key, val);
+    }
+  }
+  delete(key: any): boolean {
+    if (this.has(key)) {
+      let val = this.items[key];
+      delete this.items[key];
+      this.onchange(key, val);
+    }
+    return false;
+  }
+  get(key: any): any {
+    return this.has(key) ? this.items[key] : undefined;
+  }
+  values(): any[] {
+    let values: any[] = [];
+    for (let k in this.items) {
+      if (this.has(k)) {
+        values.push(this.items[k]);
+      }
+    }
+    return values;
+  }
+}

+ 11 - 0
src/app/utility/urlHelper.ts

@@ -0,0 +1,11 @@
+declare function unescape(s:string): string;
+
+export class UrlHelper  {
+  getUrlParam(name: string): string {
+    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
+    var r = window.location.search.substr(1).match(reg);  //匹配目标参数
+    if (r != null)
+      return unescape(r[2]);
+    return null; //返回参数值
+  }
+}

File diff suppressed because it is too large
+ 65 - 0
src/assets/font/iconfont.css


BIN
src/assets/font/iconfont.eot


File diff suppressed because it is too large
+ 1 - 0
src/assets/font/iconfont.js


+ 93 - 0
src/assets/font/iconfont.json

@@ -0,0 +1,93 @@
+{
+  "id": "1294357",
+  "name": "岭南手机端图标",
+  "font_family": "iconfont",
+  "css_prefix_text": "icon",
+  "description": "",
+  "glyphs": [
+    {
+      "icon_id": "3216613",
+      "name": "费用",
+      "font_class": "jiaofei",
+      "unicode": "e68e",
+      "unicode_decimal": 59022
+    },
+    {
+      "icon_id": "5743189",
+      "name": "撤销-填充",
+      "font_class": "quxiao",
+      "unicode": "e81e",
+      "unicode_decimal": 59422
+    },
+    {
+      "icon_id": "9830764",
+      "name": "password-copy",
+      "font_class": "password",
+      "unicode": "e60f",
+      "unicode_decimal": 58895
+    },
+    {
+      "icon_id": "9830765",
+      "name": "yonghu",
+      "font_class": "yonghu",
+      "unicode": "e610",
+      "unicode_decimal": 58896
+    },
+    {
+      "icon_id": "9830509",
+      "name": "down",
+      "font_class": "down",
+      "unicode": "e605",
+      "unicode_decimal": 58885
+    },
+    {
+      "icon_id": "9830510",
+      "name": "arrow",
+      "font_class": "arrow",
+      "unicode": "e606",
+      "unicode_decimal": 58886
+    },
+    {
+      "icon_id": "9830511",
+      "name": "i-1",
+      "font_class": "i-",
+      "unicode": "e607",
+      "unicode_decimal": 58887
+    },
+    {
+      "icon_id": "9830512",
+      "name": "i-2",
+      "font_class": "i-1",
+      "unicode": "e608",
+      "unicode_decimal": 58888
+    },
+    {
+      "icon_id": "9830513",
+      "name": "i-3",
+      "font_class": "i-2",
+      "unicode": "e609",
+      "unicode_decimal": 58889
+    },
+    {
+      "icon_id": "9830514",
+      "name": "i-4",
+      "font_class": "i-3",
+      "unicode": "e60a",
+      "unicode_decimal": 58890
+    },
+    {
+      "icon_id": "9830515",
+      "name": "i-5",
+      "font_class": "i-4",
+      "unicode": "e60b",
+      "unicode_decimal": 58891
+    },
+    {
+      "icon_id": "9830518",
+      "name": "user-bg",
+      "font_class": "user-bg",
+      "unicode": "e60e",
+      "unicode_decimal": 58894
+    }
+  ]
+}

File diff suppressed because it is too large
+ 62 - 0
src/assets/font/iconfont.svg


BIN
src/assets/font/iconfont.ttf


BIN
src/assets/font/iconfont.woff


BIN
src/assets/font/iconfont.woff2


BIN
src/assets/icon/favicon.ico


+ 0 - 0
src/assets/icon/icon-evaluation.png


Some files were not shown because too many files changed in this diff