Selaa lähdekoodia

Merge branch 'master' of http://git.9026.com/roobe/miao.git

Ben 7 vuotta sitten
vanhempi
commit
bdb665e618
31 muutettua tiedostoa jossa 833 lisäystä ja 214 poistoa
  1. 99 101
      miaomiao/config.xml
  2. 55 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/README.md
  3. 36 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/package.json
  4. 76 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/plugin.xml
  5. 109 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/AliPay.java
  6. 1 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/PayResult.java
  7. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/libs/alipaySdk-20160825.jar
  8. 11 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/AlipayPlugin.h
  9. 83 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/AlipayPlugin.m
  10. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/bar@2x.png
  11. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/refresh@2x.png
  12. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/refresh_click@2x.png
  13. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/shutdown@2x.png
  14. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/shutdown_click@2x.png
  15. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/AlipaySDK
  16. 33 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Headers/APayAuthInfo.h
  17. 177 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Headers/AlipaySDK.h
  18. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Info.plist
  19. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/en.lproj/InfoPlist.strings
  20. 9 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/www/AliPay.js
  21. 3 2
      miaomiao/plugins/fetch.json
  22. 63 50
      miaomiao/www/.idea/workspace.xml
  23. 1 1
      miaomiao/www/chcp.json
  24. 14 14
      miaomiao/www/chcp.manifest
  25. BIN
      miaomiao/www/img/demo/photo_default_user.png
  26. 26 26
      miaomiao/www/js/controllers/account.js
  27. 15 11
      miaomiao/www/js/controllers/home.js
  28. 17 4
      miaomiao/www/js/directives/directive.js
  29. 2 2
      miaomiao/www/templates/home/dream-detail.html
  30. 2 2
      server/app/Http/Controllers/Api/V1/AuthController.php
  31. 1 1
      server/app/Http/Controllers/Api/V1/InteractionController.php

+ 99 - 101
miaomiao/config.xml

xqd
@@ -1,106 +1,104 @@
-<?xml version='1.0' encoding='utf-8'?>
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <widget id="com.miaomiao.app" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
-    <name>瞄喵</name>
-    <description>
+  <name>瞄喵</name>
+  <description>
         An Ionic Framework and Cordova project.
     </description>
-    <author email="you@example.com" href="http://example.com.com/">
+  <author email="you@example.com" href="http://example.com.com/">
       Mike
   </author>
-    <content src="index.html" />
-    <access origin="*" />
-    <allow-intent href="*" />
-    <allow-navigation href="*" />
-    <preference name="webviewbounce" value="false" />
-    <preference name="UIWebViewBounce" value="false" />
-    <preference name="DisallowOverscroll" value="true" />
-    <preference name="android-minSdkVersion" value="16" />
-    <preference name="BackupWebStorage" value="none" />
-    <preference name="KeepRunning" value="True" />
-    <preference name="ShowTitle" value="True" />
-    <preference name="InAppBrowserStorageEnabled" value="True" />
-    <preference name="SuppressesIncrementalRendering" value="True" />
-    <preference name="windows-target-version" value="10.0" />
-    <preference name="SplashScreen" value="screen" />
-    <preference name="SplashScreenDelay" value="3000" />
-    <feature name="StatusBar">
-        <param name="ios-package" onload="true" value="CDVStatusBar" />
-    </feature>
-    <platform name="ios">
-        <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="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" />
-        <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" />
-    </platform>
-    <platform name="android">
-        <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>
-    <engine name="android" spec="^6.2.3" />
-    <plugin name="cordova-hot-code-push-plugin" spec="^1.5.3" />
-    <plugin name="cordova-plugin-actionsheet" spec="2.3.3" />
-    <plugin name="cordova-plugin-camera" spec="file:node_modules\cordova-plugin-camera" />
-    <plugin name="cordova-plugin-compat" spec="1.1.0" />
-    <plugin name="cordova-plugin-console" spec="~1.0.2" />
-    <plugin name="cordova-plugin-device" spec="~1.1.1" />
-    <plugin name="cordova-plugin-file" spec="4.3.2" />
-    <plugin name="cordova-plugin-file-transfer" spec="1.6.2" />
-    <plugin name="cordova-plugin-media-capture" spec="1.4.3" />
-    <plugin name="cordova-plugin-offbye-alipay" spec="git+https://github.com/offbye/cordova-plugin-alipay.git">
-        <variable name="PARTNER_ID" value="2088721135315822" />
-    </plugin>
-    <plugin name="cordova-plugin-splashscreen" spec="4.0.3" />
-    <plugin name="cordova-plugin-statusbar" spec="~2.1.0" />
-    <plugin name="cordova-plugin-wechat" spec="^2.0.0">
-        <variable name="WECHATAPPID" value="wxc5181c0d406023e6" />
-    </plugin>
-    <plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
-    <plugin name="ionic-plugin-keyboard" spec="~1.0.9" />
-    <plugin name="jpush-phonegap-plugin" spec="^3.2.3">
-        <variable name="APP_KEY" value="69838317211448192366f9d8" />
-    </plugin>
-    <plugin name="phonegap-plugin-barcodescanner" spec="git+https://github.com/phonegap/phonegap-plugin-barcodescanner.git">
-        <variable name="CAMERA_USAGE_DESCRIPTION" value="请摄像头对准条码" />
-    </plugin>
-</widget>
+  <content src="index.html"/>
+  <access origin="*"/>
+  <allow-intent href="*"/>
+  <allow-navigation href="*"/>
+  <preference name="webviewbounce" value="false"/>
+  <preference name="UIWebViewBounce" value="false"/>
+  <preference name="DisallowOverscroll" value="true"/>
+  <preference name="android-minSdkVersion" value="16"/>
+  <preference name="BackupWebStorage" value="none"/>
+  <preference name="KeepRunning" value="True"/>
+  <preference name="ShowTitle" value="True"/>
+  <preference name="InAppBrowserStorageEnabled" value="True"/>
+  <preference name="SuppressesIncrementalRendering" value="True"/>
+  <preference name="windows-target-version" value="10.0"/>
+  <preference name="SplashScreen" value="screen"/>
+  <preference name="KeyboardDisplayRequiresUserAction" value="false"/>
+  <preference name="SplashScreenDelay" value="3000"/>
+  <feature name="StatusBar">
+    <param name="ios-package" onload="true" value="CDVStatusBar"/>
+  </feature>
+  <platform name="ios">
+    <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="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"/>
+    <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"/>
+  </platform>
+  <platform name="android">
+    <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>
+  <engine name="android" spec="^6.2.3"/>
+  <plugin name="cordova-hot-code-push-plugin" spec="^1.5.3"/>
+  <plugin name="cordova-plugin-actionsheet" spec="2.3.3"/>
+  <plugin name="cordova-plugin-camera" spec="file:node_modules\cordova-plugin-camera"/>
+  <plugin name="cordova-plugin-compat" spec="1.1.0"/>
+  <plugin name="cordova-plugin-console" spec="~1.0.2"/>
+  <plugin name="cordova-plugin-device" spec="~1.1.1"/>
+  <plugin name="cordova-plugin-file" spec="4.3.2"/>
+  <plugin name="cordova-plugin-file-transfer" spec="1.6.2"/>
+  <plugin name="cordova-plugin-media-capture" spec="1.4.3"/>
+  <plugin name="cordova-plugin-splashscreen" spec="4.0.3"/>
+  <plugin name="cordova-plugin-statusbar" spec="~2.1.0"/>
+  <plugin name="cordova-plugin-wechat" spec="^2.0.0">
+    <variable name="WECHATAPPID" value="wxc5181c0d406023e6"/>
+  </plugin>
+  <plugin name="cordova-plugin-whitelist" spec="^1.3.2"/>
+  <plugin name="ionic-plugin-keyboard" spec="~1.0.9"/>
+  <plugin name="jpush-phonegap-plugin" spec="^3.2.3">
+    <variable name="APP_KEY" value="69838317211448192366f9d8"/>
+  </plugin>
+  <plugin name="phonegap-plugin-barcodescanner" spec="git+https://github.com/phonegap/phonegap-plugin-barcodescanner.git">
+    <variable name="CAMERA_USAGE_DESCRIPTION" value="请摄像头对准条码"/>
+  </plugin>
+</widget>

+ 55 - 0
miaomiao/plugins/cordova-plugin-offbye-alipay/README.md

xqd
@@ -0,0 +1,55 @@
+## cordova-plugin-alipay ##
+
+Makes your Cordova application enable to use the [Alipay SDK](https://doc.open.alipay.com/docs/doc.htm?spm=a219a.7629140.0.0.hT44dE&treeId=54&articleId=104509&docType=1)
+for mobile payment with Alipay App or Mobile Web. Requires cordova-android 4.0 or greater.
+
+### ChangeLogs
+  本cordova插件是基于支付宝App支付SDK的Demo实现
+ - 升级支付宝SDK版本到20160825;
+ - 修改了一些bug;
+ - 支持Android和iOS Alipay SDK
+###主要功能
+
+ - 主要功能是:服务器把订单信息签名后,调用该插件调用支付宝sdk进行支付,支付完成后如支付成功,如果是9000状态,还要去服务端去验证是否真正支付
+
+### Install 安装
+
+The following directions are for cordova-cli (most people).  
+
+* Open an existing cordova project, with cordova-android 4.0.0+, and using the latest CLI. TBS X5  variables can be configured as an option when installing the plugin
+* Add this plugin
+
+  ```sh
+  cordova plugin add https://github.com/offbye/cordova-plugin-alipay.git --variable PARTNER_ID=[你的商户PID可以在账户中查询]
+  ```
+  (对于android,可以不传PARTNER_ID)
+
+   offline:下载后再进行安装 `cordova plugin add  YOUR_DIR`
+
+### 支持平台
+
+		Android IOS
+
+### Android API
+
+* js调用插件方法
+
+```js
+
+    //第一步:订单在服务端签名生成订单信息,具体请参考官网进行签名处理
+    var payInfo  = "xxxx";
+
+    //第二步:调用支付插件        	
+    cordova.plugins.AliPay.pay(payInfo,function success(e){},function error(e){});
+
+	 //e.resultStatus  状态代码  e.result  本次操作返回的结果数据 e.memo 提示信息
+	 //e.resultStatus  9000  订单支付成功 ;8000 正在处理中  调用function success
+	 //e.resultStatus  4000  订单支付失败 ;6001  用户中途取消 ;6002 网络连接出错  调用function error
+	 //当e.resultStatus为9000时,请去服务端验证支付结果
+	 			/**
+				 * 同步返回的结果必须放置到服务端进行验证(验证的规则请看https://doc.open.alipay.com/doc2/
+				 * detail.htm?spm=0.0.0.0.xdvAU6&treeId=59&articleId=103665&
+				 * docType=1) 建议商户依赖异步通知
+				 */
+
+```

+ 36 - 0
miaomiao/plugins/cordova-plugin-offbye-alipay/package.json

xqd
@@ -0,0 +1,36 @@
+{
+  "name": "cordova-plugin-offbye-alipay",
+  "version": "1.0.1",
+  "description": "Makes your Cordova application enable to use the Alipay SDK",
+  "cordova": {
+    "id": "cordova-plugin-offbye-alipay",
+    "platforms": [
+      "android", "ios"
+    ]
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/offbye/cordova-plugin-alipay.git"
+  },
+  "keywords": [
+    "cordova",
+    "chromium",
+    "alipay",
+    "ecosystem:cordova",
+    "cordova-ios",
+    "cordova-android"
+  ],
+  "engines": [{
+    "name": "cordova-android",
+    "version": ">=4"
+  }, {
+    "name": "cordova-plugman",
+    "version": ">=4.2.0"
+  }],
+  "author": "",
+  "license": "Apache 2.0",
+  "bugs": {
+    "url": "https://github.com/offbye/cordova-plugin-alipay"
+  },
+  "homepage": "https://github.com/offbye/cordova-plugin-alipay"
+}

+ 76 - 0
miaomiao/plugins/cordova-plugin-offbye-alipay/plugin.xml

xqd
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
+xmlns:android="http://schemas.android.com/apk/res/android"
+    id="cordova-plugin-offbye-alipay"
+    version="1.0.1">
+    <name>AliPay</name>
+
+    <preference name="PARTNER_ID"/>
+    <js-module src="www/AliPay.js" name="AliPay">
+     		<clobbers target="cordova.plugins.AliPay" />
+    </js-module>
+    <platform name="android">
+        <config-file target="res/xml/config.xml" parent="/*">
+            <feature name="AliPay">
+                <param name="android-package" value="com.offbye.cordova.alipay.AliPay"/>
+            </feature>
+        </config-file>
+         <config-file target="AndroidManifest.xml" parent="/manifest">
+		      <uses-permission android:name="android.permission.INTERNET" />
+		      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+		      <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+		      <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+		      <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+        </config-file>
+        <config-file target="AndroidManifest.xml" parent="/manifest/application">
+                 <!-- alipay sdk begin -->
+        <activity
+            android:name="com.alipay.sdk.app.H5PayActivity"
+            android:configChanges="orientation|keyboardHidden|navigation|screenSize"
+            android:exported="false"
+            android:screenOrientation="behind"
+            android:windowSoftInputMode="adjustResize|stateHidden" >
+        </activity>
+        <!-- alipay sdk end -->
+        </config-file>
+        <source-file src="src/android/libs/alipaySdk-20160825.jar" target-dir="libs"/>
+        <source-file src="src/android/AliPay.java" target-dir="src/com/offbye/cordova/alipay" />
+        <source-file src="src/android/PayResult.java" target-dir="src/com/offbye/cordova/alipay" />
+    </platform>
+    <platform name="ios">
+        <config-file target="config.xml" parent="/widget">
+        <preference name="partner" value="$PARTNER_ID" />
+        <feature name="AliPay">
+            <param name="ios-package" value="AlipayPlugin" />
+            <param name="onload" value="true" />
+          </feature>
+        </config-file>
+
+        <config-file target="*-Info.plist" parent="CFBundleURLTypes">
+          <array>
+              <dict>
+                  <key>CFBundleURLName</key>
+                  <string>alipay</string>
+                  <key>CFBundleURLSchemes</key>
+                  <array>
+                      <string>a$PARTNER_ID</string>
+                  </array>
+              </dict>
+          </array>
+        </config-file>
+
+        <framework src="CoreTelephony.framework" weak="true" />
+        <framework src="Security.framework" weak="true" />
+        <framework src="SystemConfiguration.framework" weak="true" />
+        <framework src="CoreMotion.framework" weak="true" />
+        <framework src="CFNetwork.framework" weak="true" />
+        <framework src="libc++.tbd" weak="true" />
+
+        <framework src="src/ios/lib/AlipaySDK.framework" custom="true" />
+        <resource-file src="src/lib/AlipaySDK.bundle"/>
+
+        <header-file src="src/ios/AlipayPlugin.h"/>
+        <source-file src="src/ios/AlipayPlugin.m"/>
+
+    </platform>
+</plugin>

+ 109 - 0
miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/AliPay.java

xqd
@@ -0,0 +1,109 @@
+package com.offbye.cordova.alipay;
+
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.PluginResult;
+import org.json.JSONArray;
+import org.json.JSONException;
+
+import android.os.Handler;
+import android.os.Message;
+import android.text.TextUtils;
+import android.util.Log;
+import android.widget.Toast;
+
+import com.alipay.sdk.app.PayTask;
+
+public class AliPay extends CordovaPlugin {
+
+	private static final int SDK_PAY_FLAG = 1;
+	private static String TAG = "AliPay";
+
+	private Handler mHandler = new Handler() {
+		public void handleMessage(Message msg) {
+			switch (msg.what) {
+			case SDK_PAY_FLAG: {
+				PayResult payResult = new PayResult((String) msg.obj);
+				/**
+				 * 同步返回的结果必须放置到服务端进行验证(验证的规则请看https://doc.open.alipay.com/doc2/
+				 * detail.htm?spm=0.0.0.0.xdvAU6&treeId=59&articleId=103665&
+				 * docType=1) 建议商户依赖异步通知
+				 */
+				String resultInfo = payResult.getResult();// 同步返回需要验证的信息
+
+				String resultStatus = payResult.getResultStatus();
+				if (TextUtils.equals(resultStatus, "9000")) {
+					Toast.makeText(cordova.getActivity(), "支付成功",
+							Toast.LENGTH_SHORT).show();
+				} else {
+
+					if (TextUtils.equals(resultStatus, "8000")) {
+						Toast.makeText(cordova.getActivity(), "支付结果确认中",
+								Toast.LENGTH_SHORT).show();
+					} else {
+						Toast.makeText(cordova.getActivity(), "支付失败",
+								Toast.LENGTH_SHORT).show();
+					}
+				}
+				break;
+			}
+			default:
+				break;
+			}
+		}
+	};
+
+	@Override
+	public boolean execute(String action, JSONArray args,
+			final CallbackContext callbackContext) throws JSONException {
+		PluginResult result = null;
+		if ("pay".equals(action)) {
+
+			 //订单信息在服务端签名后返回
+			 final String payInfo = args.getString(0);
+
+			 if (payInfo == null || payInfo.equals("") || payInfo.equals("null")) {
+				callbackContext.error("Please enter order information");
+			 	return true;
+			 }
+
+			cordova.getThreadPool().execute(new Runnable() {
+				@Override
+				public void run() {
+					Log.i(TAG, " 构造PayTask 对象 ");
+					PayTask alipay = new PayTask(cordova.getActivity());
+					Log.i(TAG, " 调用支付接口,获取支付结果 ");
+					String result = alipay.pay(payInfo, true);
+
+					// 更新主ui的Toast
+					Message msg = new Message();
+					msg.what = SDK_PAY_FLAG;
+					msg.obj = result;
+					mHandler.sendMessage(msg);
+
+					PayResult payResult = new PayResult(result);
+					if (TextUtils.equals(payResult.getResultStatus(), "9000")) {
+						Log.i(TAG, " 9000则代表支付成功,具体状态码代表含义可参考接口文档 ");
+						callbackContext.success(payResult.toJson());
+					} else {
+						Log.i(TAG, " 为非9000则代表可能支付失败 ");
+						if (TextUtils.equals(payResult.getResultStatus(),
+								"8000")) {
+							Log.i(TAG,
+									" 8000代表支付结果因为支付渠道原因或者系统原因还在等待支付结果确认,最终交易是否成功以服务端异步通知为准(小概率状态) ");
+							callbackContext.success(payResult.toJson());
+						} else {
+							Log.i(TAG, " 其他值就可以判断为支付失败,包括用户主动取消支付,或者系统返回的错误 ");
+							callbackContext.error(payResult.toJson());
+						}
+					}
+				}
+			});
+			return true;
+		} else {
+			callbackContext.error("no such method:" + action);
+			return false;
+		}
+	}
+
+}

+ 1 - 0
miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/PayResult.java

xqd
@@ -0,0 +1 @@
+package com.offbye.cordova.alipay;

import java.util.HashMap;
import java.util.Map;

import org.json.JSONObject;

import android.text.TextUtils;

public class PayResult {
	private String resultStatus;
	private String result;
	private String memo;

	public PayResult(String rawResult) {

		if (TextUtils.isEmpty(rawResult))
			return;

		String[] resultParams = rawResult.split(";");
		for (String resultParam : resultParams) {
			if (resultParam.startsWith("resultStatus")) {
				resultStatus = gatValue(resultParam, "resultStatus");
			}
			if (resultParam.startsWith("result")) {
				result = gatValue(resultParam, "result");
			}
			if (resultParam.startsWith("memo")) {
				memo = gatValue(resultParam, "memo");
			}
		}
	}

	@Override
	public String toString() {
		return "resultStatus={" + resultStatus + "};memo={" + memo
				+ "};result={" + result + "}";
	}
    public JSONObject toJson(){
        Map<String, String> payResultsMap = new HashMap<String, String>() {{
            put("resultStatus", resultStatus);
            put("memo", memo);
            put("result", result);
        }};
        return new JSONObject(payResultsMap);
    }

	private String gatValue(String content, String key) {
		String prefix = key + "={";
		return content.substring(content.indexOf(prefix) + prefix.length(),
				content.lastIndexOf("}"));
	}

	/**
	 * @return the resultStatus
	 */
	public String getResultStatus() {
		return resultStatus;
	}

	/**
	 * @return the memo
	 */
	public String getMemo() {
		return memo;
	}

	/**
	 * @return the result
	 */
	public String getResult() {
		return result;
	}
}

BIN
miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/libs/alipaySdk-20160825.jar


+ 11 - 0
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/AlipayPlugin.h

xqd
@@ -0,0 +1,11 @@
+#import <Cordova/CDV.h>
+
+@interface AlipayPlugin : CDVPlugin
+
+@property(nonatomic,strong)NSString *partner;
+// @property(nonatomic,strong)NSString *seller;
+// @property(nonatomic,strong)NSString *privateKey;
+@property(nonatomic,strong)NSString *currentCallbackId;
+
+- (void) pay:(CDVInvokedUrlCommand*)command;
+@end

+ 83 - 0
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/AlipayPlugin.m

xqd
@@ -0,0 +1,83 @@
+#import "AlipayPlugin.h"
+#import <AlipaySDK/AlipaySDK.h>
+
+@implementation AlipayPlugin
+
+-(void)pluginInitialize{
+    CDVViewController *viewController = (CDVViewController *)self.viewController;
+    self.partner = [viewController.settings objectForKey:@"partner"];
+}
+
+- (void) pay:(CDVInvokedUrlCommand*)command
+{
+    self.currentCallbackId = command.callbackId;
+    //partner和seller获取失败,提示
+    if ([self.partner length] == 0)
+    {
+        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示"
+                                                        message:@"缺少partner。"
+                                                       delegate:self
+                                              cancelButtonTitle:@"确定"
+                                              otherButtonTitles:nil];
+        [alert show];
+        return;
+    }
+
+    //从API请求获取支付信息
+    NSString *signedString = [command argumentAtIndex:0];
+
+    if (signedString != nil) {
+
+        [[AlipaySDK defaultService] payOrder:signedString fromScheme:[NSString stringWithFormat:@"a%@", self.partner] callback:^(NSDictionary *resultDic) {
+            if ([[resultDic objectForKey:@"resultStatus"]  isEqual: @"9000"]) {
+                [self successWithCallbackID:self.currentCallbackId messageAsDictionary:resultDic];
+            } else {
+                [self failWithCallbackID:self.currentCallbackId messageAsDictionary:resultDic];
+            }
+            
+            NSLog(@"reslut = %@",resultDic);
+        }];
+
+    }
+}
+
+- (void)handleOpenURL:(NSNotification *)notification
+{
+    NSURL* url = [notification object];
+    
+    if ([url isKindOfClass:[NSURL class]] && [url.scheme isEqualToString:[NSString stringWithFormat:@"a%@", self.partner]])
+    {
+        [[AlipaySDK defaultService] processOrderWithPaymentResult:url standbyCallback:^(NSDictionary *resultDic) {
+            if ([[resultDic objectForKey:@"resultStatus"]  isEqual: @"9000"]) {
+                [self successWithCallbackID:self.currentCallbackId messageAsDictionary:resultDic];
+            } else {
+                [self failWithCallbackID:self.currentCallbackId messageAsDictionary:resultDic];
+            }
+        }];
+    }
+}
+
+- (void)successWithCallbackID:(NSString *)callbackID withMessage:(NSString *)message
+{
+    CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:message];
+    [self.commandDelegate sendPluginResult:commandResult callbackId:callbackID];
+}
+
+- (void)failWithCallbackID:(NSString *)callbackID withMessage:(NSString *)message
+{
+    CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:message];
+    [self.commandDelegate sendPluginResult:commandResult callbackId:callbackID];
+}
+- (void)successWithCallbackID:(NSString *)callbackID messageAsDictionary:(NSDictionary *)message
+{
+    CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:message];
+    [self.commandDelegate sendPluginResult:commandResult callbackId:callbackID];
+}
+
+- (void)failWithCallbackID:(NSString *)callbackID messageAsDictionary:(NSDictionary *)message
+{
+    CDVPluginResult *commandResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:message];
+    [self.commandDelegate sendPluginResult:commandResult callbackId:callbackID];
+}
+
+@end

BIN
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/bar@2x.png


BIN
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/refresh@2x.png


BIN
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/refresh_click@2x.png


BIN
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/shutdown@2x.png


BIN
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/shutdown_click@2x.png


BIN
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/AlipaySDK


+ 33 - 0
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Headers/APayAuthInfo.h

xqd
@@ -0,0 +1,33 @@
+//
+//  APAuthInfo.h
+//  AliSDKDemo
+//
+//  Created by 方彬 on 14-7-18.
+//  Copyright (c) 2014年 Alipay.com. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface APayAuthInfo : NSObject
+
+@property(nonatomic, copy)NSString *appID;
+@property(nonatomic, copy)NSString *pid;
+@property(nonatomic, copy)NSString *redirectUri;
+
+/**
+ *  初始化AuthInfo
+ *
+ *  @param appIDStr     应用ID
+ *  @param productIDStr 产品码 该商户在aboss签约的产品,用户获取pid获取的参数
+ *  @param pidStr       商户ID   可不填
+ *  @param uriStr       授权的应用回调地址  比如:alidemo://auth
+ *
+ *  @return authinfo实例
+ */
+- (id)initWithAppID:(NSString *)appIDStr
+                pid:(NSString *)pidStr
+        redirectUri:(NSString *)uriStr;
+
+- (NSString *)description;
+- (NSString *)wapDescription;
+@end

+ 177 - 0
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Headers/AlipaySDK.h

xqd
@@ -0,0 +1,177 @@
+//
+//  AlipaySDK.h
+//  AlipaySDK
+//
+//  Created by 方彬 on 14-4-28.
+//  Copyright (c) 2014年 Alipay. All rights reserved.
+//
+
+
+////////////////////////////////////////////////////////
+////////////////version:2.1  motify:2014.12.24//////////
+///////////////////Merry Christmas=。=//////////////////
+////////////////////////////////////////////////////////
+
+
+#import "APayAuthInfo.h"
+typedef enum {
+    ALIPAY_TIDFACTOR_IMEI,
+    ALIPAY_TIDFACTOR_IMSI,
+    ALIPAY_TIDFACTOR_TID,
+    ALIPAY_TIDFACTOR_CLIENTKEY,
+    ALIPAY_TIDFACTOR_VIMEI,
+    ALIPAY_TIDFACTOR_VIMSI,
+    ALIPAY_TIDFACTOR_CLIENTID,
+    ALIPAY_TIDFACTOR_APDID,
+    ALIPAY_TIDFACTOR_MAX
+} AlipayTidFactor;
+
+typedef void(^CompletionBlock)(NSDictionary *resultDic);
+
+@interface AlipaySDK : NSObject
+
+/**
+ *  创建支付单例服务
+ *
+ *  @return 返回单例对象
+ */
++ (AlipaySDK *)defaultService;
+
+/**
+ *  用于设置SDK使用的window,如果没有自行创建window无需设置此接口
+ */
+@property (nonatomic, weak) UIWindow *targetWindow;
+
+/**
+ *  支付接口
+ *
+ *  @param orderStr       订单信息
+ *  @param schemeStr      调用支付的app注册在info.plist中的scheme
+ *  @param compltionBlock 支付结果回调Block,用于wap支付结果回调(非跳转钱包支付)
+ */
+- (void)payOrder:(NSString *)orderStr
+      fromScheme:(NSString *)schemeStr
+        callback:(CompletionBlock)completionBlock;
+
+/**
+ *  处理钱包或者独立快捷app支付跳回商户app携带的支付结果Url
+ *
+ *  @param resultUrl        支付结果url
+ *  @param completionBlock  支付结果回调
+ */
+- (void)processOrderWithPaymentResult:(NSURL *)resultUrl
+                      standbyCallback:(CompletionBlock)completionBlock;
+
+
+
+/**
+ *  获取交易token。
+ *
+ *  @return 交易token,若无则为空。
+ */
+- (NSString *)fetchTradeToken;
+
+/**
+ *  是否已经使用过
+ *
+ *  @return YES为已经使用过,NO反之
+ */
+- (BOOL)isLogined;
+
+/**
+ *  当前版本号
+ *
+ *  @return 当前版本字符串
+ */
+- (NSString *)currentVersion;
+
+/**
+ *  当前版本号
+ *
+ *  @return tid相关信息
+ */
+- (NSString*)queryTidFactor:(AlipayTidFactor)factor;
+
+/**
+ *  測試所用,realse包无效
+ *
+ *  @param url  测试环境
+ */
+- (void)setUrl:(NSString *)url;
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////h5 拦截支付入口///////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  url order 获取接口
+ *
+ *  @param urlStr     拦截的 url string
+ *
+ *  @return 获取到的url order info
+ */
+- (NSString*)fetchOrderInfoFromH5PayUrl:(NSString*)urlStr;
+
+
+/**
+ *  url支付接口
+ *
+ *  @param orderStr       订单信息
+ *  @param schemeStr      调用支付的app注册在info.plist中的scheme
+ *  @param compltionBlock 支付结果回调Block
+ */
+- (void)payUrlOrder:(NSString *)orderStr
+         fromScheme:(NSString *)schemeStr
+           callback:(CompletionBlock)completionBlock;
+
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////授权1.0//////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  快登授权
+ *  @param authInfo         需授权信息
+ *  @param completionBlock  授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效,
+                            需要调用方在appDelegate中调用processAuthResult:standbyCallback:方法获取授权结果
+ */
+- (void)authWithInfo:(APayAuthInfo *)authInfo
+             callback:(CompletionBlock)completionBlock;
+
+
+/**
+ *  处理授权信息Url
+ *
+ *  @param resultUrl        钱包返回的授权结果url
+ *  @param completionBlock  授权结果回调
+ */
+- (void)processAuthResult:(NSURL *)resultUrl
+          standbyCallback:(CompletionBlock)completionBlock;
+
+//////////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////授权2.0//////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////////
+
+/**
+ *  快登授权2.0
+ *
+ *  @param infoStr          授权请求信息字符串
+ *  @param schemeStr        调用授权的app注册在info.plist中的scheme
+ *  @param completionBlock  授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效,
+                            需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果
+ */
+- (void)auth_V2WithInfo:(NSString *)infoStr
+             fromScheme:(NSString *)schemeStr
+               callback:(CompletionBlock)completionBlock;
+
+/**
+ *  处理授权信息Url
+ *
+ *  @param resultUrl        钱包返回的授权结果url
+ *  @param completionBlock  授权结果回调
+ */
+- (void)processAuth_V2Result:(NSURL *)resultUrl
+             standbyCallback:(CompletionBlock)completionBlock;
+
+@end

BIN
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Info.plist


BIN
miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/en.lproj/InfoPlist.strings


+ 9 - 0
miaomiao/plugins/cordova-plugin-offbye-alipay/www/AliPay.js

xqd
@@ -0,0 +1,9 @@
+var exec = require('cordova/exec');
+
+exports.pay = function (paymentInfo, successCallback, errorCallback) {   
+		if(!paymentInfo){
+			errorCallback && errorCallback("Please enter order information");  
+		}else{
+			exec(successCallback, errorCallback, "AliPay", "pay", [paymentInfo]);
+		}
+};

+ 3 - 2
miaomiao/plugins/fetch.json

xqd
@@ -94,8 +94,9 @@
     },
     "cordova-plugin-offbye-alipay": {
         "source": {
-            "type": "registry",
-            "id": "cordova-plugin-offbye-alipay@git+https://github.com/offbye/cordova-plugin-alipay.git"
+            "type": "git",
+            "url": "https://github.com/offbye/cordova-plugin-alipay.git",
+            "subdir": "."
         },
         "is_top_level": true,
         "variables": {

+ 63 - 50
miaomiao/www/.idea/workspace.xml

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -20,7 +20,38 @@
     <favorites_list name="www" />
   </component>
   <component name="FileEditorManager">
-    <leaf />
+    <leaf>
+      <file leaf-file-name="dream-detail.html" pinned="false" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/templates/home/dream-detail.html">
+          <provider selected="true" editor-type-id="text-editor">
+            <state vertical-scroll-proportion="0.25333333">
+              <caret line="13" column="32" selection-start-line="13" selection-start-column="32" selection-end-line="13" selection-end-column="32" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="home.js" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/js/controllers/home.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state vertical-scroll-proportion="-6.133333">
+              <caret line="229" column="42" selection-start-line="229" selection-start-column="42" selection-end-line="229" selection-end-column="42" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="account.js" pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/js/controllers/account.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state vertical-scroll-proportion="0.0">
+              <caret line="32" column="13" selection-start-line="32" selection-start-column="13" selection-end-line="32" selection-end-column="13" />
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
   </component>
   <component name="FileTemplateManagerImpl">
     <option name="RECENT_TEMPLATES">
@@ -78,13 +109,13 @@
         <option value="$PROJECT_DIR$/../../../51zhupai/css/detail.css" />
         <option value="$PROJECT_DIR$/../../../51zhupai/templates/detail.html" />
         <option value="$PROJECT_DIR$/../../../51zhupai/index.html" />
-        <option value="$PROJECT_DIR$/js/controllers/account.js" />
-        <option value="$PROJECT_DIR$/templates/home/dream-detail.html" />
         <option value="$PROJECT_DIR$/css/style.css" />
         <option value="$PROJECT_DIR$/templates/home/index.html" />
         <option value="$PROJECT_DIR$/js/controllers/my.js" />
         <option value="$PROJECT_DIR$/js/controllers/home.js" />
         <option value="$PROJECT_DIR$/templates/home/userDetail.html" />
+        <option value="$PROJECT_DIR$/js/controllers/account.js" />
+        <option value="$PROJECT_DIR$/templates/home/dream-detail.html" />
       </list>
     </option>
   </component>
@@ -94,8 +125,8 @@
     <detection-done>true</detection-done>
   </component>
   <component name="ProjectFrameBounds">
-    <option name="x" value="-8" />
-    <option name="y" value="-8" />
+    <option name="x" value="364" />
+    <option name="y" value="20" />
     <option name="width" value="1382" />
     <option name="height" value="744" />
   </component>
@@ -148,7 +179,7 @@
     <panes />
   </component>
   <component name="PropertiesComponent">
-    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../../51zhupai" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
     <property name="WebServerToolWindowFactoryState" value="false" />
     <property name="HbShouldOpenHtmlAsHb" value="" />
     <property name="js-jscs-nodeInterpreter" value="D:\HPE\Note.js\Install\node.exe" />
@@ -239,25 +270,25 @@
     <servers />
   </component>
   <component name="ToolWindowManager">
-    <frame x="-8" y="-8" width="1382" height="744" extended-state="6" />
-    <editor active="false" />
+    <frame x="364" y="20" width="1382" height="744" extended-state="0" />
+    <editor active="true" />
     <layout>
       <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.16648169" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
       <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
       <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32843137" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
       <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32885906" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24916202" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
       <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3296131" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
       <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
       <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
       <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
       <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
-      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32885906" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
       <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
       <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
       <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
-      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
     </layout>
   </component>
   <component name="Vcs.Log.UiProperties">
@@ -313,27 +344,6 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/../../../test/package.json">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-0.6785714">
-          <caret line="1" column="17" selection-start-line="1" selection-start-column="17" selection-end-line="1" selection-end-column="17" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/../../../test/gulpfile.js">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.35849056">
-          <caret line="11" column="0" selection-start-line="11" selection-start-column="0" selection-end-line="11" selection-end-column="0" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/../../../test/index.html">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.44504505">
-          <caret line="13" column="23" selection-start-line="13" selection-start-column="23" selection-end-line="13" selection-end-column="23" />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://E:/Work/HPE/homework/Bootstrap/项目实战5/index.html">
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="0.34234235">
@@ -579,13 +589,6 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/js/controllers/account.js">
-      <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.0">
-          <caret line="55" column="53" selection-start-line="55" selection-start-column="53" selection-end-line="55" selection-end-column="53" />
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$PROJECT_DIR$/../../../51zhupai/index.html">
       <provider selected="true" editor-type-id="text-editor">
         <state vertical-scroll-proportion="-14.535714">
@@ -607,31 +610,41 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/js/controllers/home.js">
+    <entry file="file://$PROJECT_DIR$/templates/home/index.html">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.2983725">
-          <caret line="1109" column="17" selection-start-line="1109" selection-start-column="17" selection-end-line="1109" selection-end-column="17" />
+        <state vertical-scroll-proportion="0.4108108">
+          <caret line="12" column="17" selection-start-line="12" selection-start-column="17" selection-end-line="12" selection-end-column="17" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/templates/home/index.html">
+    <entry file="file://$PROJECT_DIR$/templates/home/userDetail.html">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.4108108">
-          <caret line="12" column="17" selection-start-line="12" selection-start-column="17" selection-end-line="12" selection-end-column="17" />
+        <state vertical-scroll-proportion="0.7676191">
+          <caret line="100" column="47" selection-start-line="100" selection-start-column="47" selection-end-line="100" selection-end-column="47" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/templates/home/dream-detail.html">
+    <entry file="file://$PROJECT_DIR$/js/controllers/account.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="-4.6551723">
-          <caret line="465" column="18" selection-start-line="457" selection-start-column="25" selection-end-line="465" selection-end-column="18" />
+        <state vertical-scroll-proportion="0.0">
+          <caret line="32" column="13" selection-start-line="32" selection-start-column="13" selection-end-line="32" selection-end-column="13" />
+          <folding />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/templates/home/userDetail.html">
+    <entry file="file://$PROJECT_DIR$/js/controllers/home.js">
       <provider selected="true" editor-type-id="text-editor">
-        <state vertical-scroll-proportion="0.7676191">
-          <caret line="100" column="47" selection-start-line="100" selection-start-column="47" selection-end-line="100" selection-end-column="47" />
+        <state vertical-scroll-proportion="-6.133333">
+          <caret line="229" column="42" selection-start-line="229" selection-start-column="42" selection-end-line="229" selection-end-column="42" />
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/templates/home/dream-detail.html">
+      <provider selected="true" editor-type-id="text-editor">
+        <state vertical-scroll-proportion="0.25333333">
+          <caret line="13" column="32" selection-start-line="13" selection-start-column="32" selection-end-line="13" selection-end-column="32" />
+          <folding />
         </state>
       </provider>
     </entry>

+ 1 - 1
miaomiao/www/chcp.json

xqd
@@ -1,5 +1,5 @@
 {
   "update": "now",
   "content_url": "http://i.9026.com/miaomiao",
-  "release": "2017.09.04-20.24.33"
+  "release": "2017.09.06-21.51.15"
 }

+ 14 - 14
miaomiao/www/chcp.manifest

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -13,7 +13,7 @@
   },
   {
     "file": ".idea/workspace.xml",
-    "hash": "679bce57f2f5e8b9723eeba62e95fbd8"
+    "hash": "48ff09cf15bd74be400b11bfa4890dd2"
   },
   {
     "file": ".idea/www.iml",
@@ -29,7 +29,7 @@
   },
   {
     "file": "css/style.css",
-    "hash": "bd07829df14f7db763e988e32c722b60"
+    "hash": "d9e66499943de2a72222c0a7c9451801"
   },
   {
     "file": "img/alipay.png",
@@ -97,7 +97,7 @@
   },
   {
     "file": "img/demo/photo_default_user.png",
-    "hash": "a75889547fdb19055f3ae55ae7049513"
+    "hash": "4f6596f90be587cd0ef96444576c23ec"
   },
   {
     "file": "img/demo/photo_default_user.svg",
@@ -389,7 +389,7 @@
   },
   {
     "file": "js/app.js",
-    "hash": "5411129ea442c6f240ae625312c0359f"
+    "hash": "ae998776e03d7e3a0dc055965a39e22d"
   },
   {
     "file": "js/config/config.js",
@@ -397,23 +397,23 @@
   },
   {
     "file": "js/config/router.js",
-    "hash": "b7a41bc21bfcdc5df31023e157bd39d1"
+    "hash": "352fde367fb21b964bd229584a1aa92b"
   },
   {
     "file": "js/controllers/account.js",
-    "hash": "bfc6325b22920144759977e4b05565c7"
+    "hash": "ef71142cb9f2f470ee59161a288255f1"
   },
   {
     "file": "js/controllers/add.js",
-    "hash": "c71ffcad7e66ca4529b9001f54cb24a8"
+    "hash": "8533f5122772d6eac2abc353f596e53c"
   },
   {
     "file": "js/controllers/home.js",
-    "hash": "ea81f908ccba442716454ee3edbe1aae"
+    "hash": "df78a480ffb73b8b004ed18b5537aedf"
   },
   {
     "file": "js/controllers/my.js",
-    "hash": "f30b10fcb778c85095e8ad27294d60bd"
+    "hash": "709bb690c3c5f1969a2a97956dcad43f"
   },
   {
     "file": "js/controllers/tabs.js",
@@ -421,7 +421,7 @@
   },
   {
     "file": "js/directives/directive.js",
-    "hash": "d7a3cab12d6df7b0bdd75273b193a702"
+    "hash": "5a34d49ae1f1c53159d14dbde74d687a"
   },
   {
     "file": "js/filters/filter.js",
@@ -441,7 +441,7 @@
   },
   {
     "file": "js/services/homeservice.js",
-    "hash": "7cc80dc57709c4e8fc2d5a99502bfe07"
+    "hash": "aa976bb925efad3887e78f07538c2ca7"
   },
   {
     "file": "js/services/httpinterceptor.js",
@@ -449,7 +449,7 @@
   },
   {
     "file": "js/services/jpushservice.js",
-    "hash": "18ba49363595b4e8d366ed944e9cd4cc"
+    "hash": "efd4081418f9940b11c2ef4ec98e6250"
   },
   {
     "file": "js/services/msgservice.js",
@@ -761,7 +761,7 @@
   },
   {
     "file": "templates/home/dream-detail.html",
-    "hash": "a2f58837798e61eadd85e24b78537359"
+    "hash": "b12541e39a09c347d69ab0fdf211f868"
   },
   {
     "file": "templates/home/index.html",
@@ -853,7 +853,7 @@
   },
   {
     "file": "templates/my/withdraw.html",
-    "hash": "ce44c21406cc947aa415669395e95ae8"
+    "hash": "794b42a7abfeec02cab4d6246c435426"
   },
   {
     "file": "templates/tabs.html",

BIN
miaomiao/www/img/demo/photo_default_user.png


+ 26 - 26
miaomiao/www/js/controllers/account.js

xqd
@@ -4,32 +4,32 @@
              //$ionicNavBarDelegate.showBackButton(false);
             $scope.wechat_login = function(){
                 var scope = "snsapi_userinfo", state = "_" + (+new Date());
-                // Wechat.auth(scope, state, function (response) {
-                //     // alert("response:"+JSON.stringify(response));
-                //     // var response={code:1231};
-                //    if(response.code){
-                //        msg.loading('登录中...');
-                //        userService.wechat_login(response.code).then(function(result){
-                //            msg.hide();
-                //             // alert("wechat_login success: " + JSON.stringify(result));
-                //            if(result.data.data){
-                //                storage.setObject('user', result.data.data.user);
-                //                storage.set('token', result.data.data.token);
-                //                $http.defaults.headers.common["Authorization"] = 'Bearer ' + result.data.data.token;
-                //                $scope.user=storage.getObject('user');
-                //                $state.go('app.home');
-                //            }else{
-                //                $state.go("loginAccount",{wechat:response.code})
-                //            }
-                //        },function(error){
-                //             console.log("loginbywx Failed: " + JSON.stringify(error));
-                //            $state.go("loginAccount",{wechat:$scope.wecaht});
-                //        });
-                //    }
-                // }, function (error) {
-                //    console.log("Failed: " + JSON.stringify(error));
-                // })  
-                $state.go("loginAccount",{wechat:1231});
+                 Wechat.auth(scope, state, function (response) {
+                     // alert("response:"+JSON.stringify(response));
+                     // var response={code:1231};
+                    if(response.code){
+                        msg.loading('登录中...');
+                        userService.wechat_login(response.code).then(function(result){
+                            msg.hide();
+                             // alert("wechat_login success: " + JSON.stringify(result));
+                            if(result.data.data){
+                                storage.setObject('user', result.data.data.user);
+                                storage.set('token', result.data.data.token);
+                                $http.defaults.headers.common["Authorization"] = 'Bearer ' + result.data.data.token;
+                                $scope.user=storage.getObject('user');
+                                $state.go('app.home');
+                            }else{
+                                $state.go("loginAccount",{wechat:response.code})
+                            }
+                        },function(error){
+                             console.log("loginbywx Failed: " + JSON.stringify(error));
+                            $state.go("loginAccount",{wechat:$scope.wecaht});
+                        });
+                    }
+                 }, function (error) {
+                    console.log("Failed: " + JSON.stringify(error));
+                 })
+                //$state.go("loginAccount",{wechat:1231});
             }
     }]);
     app.controller('loginCtrl', ["$scope", "userService","$stateParams","$ionicNavBarDelegate", "storage", "$state", "msg", "$http", "util","$timeout",

+ 15 - 11
miaomiao/www/js/controllers/home.js

xqd xqd
@@ -481,17 +481,19 @@
                 $scope.dream.interactions[index].showmore = true;
             }
         }
-            $scope.replay = function ($event, name, index) {
-                $event.stopPropagation();
-                    $scope.input.focus = true;
-                    $scope.input.show = true;
-                    angular.forEach($scope.dream.interactions, function (item) {
-                        item.show = false;
-                    })
-                    $scope.dream.interactions[index].show = true;
-                    $scope.input.placeholder = "评论" + name+":";
-                    $scope.vm.title='';
-                }
+        $scope.replay = function ($event, name, index) {
+            $event.stopPropagation();
+            $scope.input.focus = true;
+            $scope.input.show = true;
+            angular.forEach($scope.dream.interactions, function (item) {
+                item.show = false;
+            })
+            $scope.dream.interactions[index].show = true;
+            $scope.dream.interactions[index].focus = true;
+            $scope.input.placeholder = "评论" + name+":";
+            $scope.vm.title='';
+            $scope.vm.comment='';
+        }
         $scope.replayOther = function ($event, name, index,currentindex) {
             $event.stopPropagation();
             if($scope.dream.interactions[index].comments[currentindex].user_id!=$scope.user.id){
@@ -501,8 +503,10 @@
                     item.show = false;
                 })
                 $scope.dream.interactions[index].show = true;
+                $scope.dream.interactions[index].focus = true;
                 $scope.input.placeholder = "评论" + name+":";
                 $scope.vm.title='';
+                $scope.vm.comment='';
             }
             else {
                 msg.confirm("评论","是否删除评论").then(function(result){

+ 17 - 4
miaomiao/www/js/directives/directive.js

xqd
@@ -2,18 +2,31 @@
     module.directive('focusMe', function ($timeout) {
         return {
             scope: { trigger: '=focusMe' },
-            link: function (scope, element) {
+            link: function (scope, element, $attr) {
+                console.log("focusMe:"+JSON.stringify(element))
                 scope.$watch('trigger', function (value) {
+                    console.log(value);
                     if (value === true) {
                         $timeout(function() {
-                        element[0].focus();
-                        scope.trigger = false;
-                        });
+                            element[0].focus();
+                            cordova.plugins.Keyboard.show();
+                            scope.trigger = false;
+                        },1000);
                     }
                 });
             }
         };
     });
+    module.directive('showFocus', function($timeout) {
+      return function(scope, element, attrs) {
+        scope.$watch(attrs.showFocus, 
+          function (newValue) { 
+            $timeout(function() {
+                newValue && element.focus();
+            });
+          },true);
+      };    
+    });
     module.factory('WechatService', [ function () {
         function share(params) {
             if (typeof Wechat === "undefined") {

+ 2 - 2
miaomiao/www/templates/home/dream-detail.html

xqd
@@ -195,13 +195,13 @@
                             </div>
                             <div class="row">
                                 <div class="col-offset-20 col-80">
-                                    <p ng-click="showmore($index)" ng-if="interaction.comments.length>4" style="color: #00C3DA; margin-top: 10px; margin-bottom: 10px"> {{interaction.showmore?"关闭更多":"查看更多评论"}}</p>
+                                    <p ng-click="showmore($index)" ng-if="interaction.comments.length>4" style="color: #00C3DA; margin-top: 10px; margin-bottom: 10px"> {{interaction.showmore?"只看最近评论":"查看更多评论"}}</p>
                                 </div>
                             </div>
                         </div>
                         <!--<p ng-click="replay($event,dream.user.nickname,$index)" style="margin: 10px 0 0 50px; color: #00C3DA">评论</p>-->
                         <div class="item item-input" ng-if="input.show&&interaction.show">
-                            <textarea name="comment"  focus-me="input.focus" placeholder="{{input.placeholder}}" ng-model="vm.comment" style="padding: 0 20px;"></textarea>
+                            <textarea name="comment" focus-me="input.focus" placeholder="{{input.placeholder}}" ng-model="vm.comment" style="padding: 0 20px;"></textarea>
                             <a class="button button-calm" style="margin-right:5px;line-height:35px;min-width:30px" ng-click="submitComment($index)">
                                 发送
                             </a>

+ 2 - 2
server/app/Http/Controllers/Api/V1/AuthController.php

xqd
@@ -108,10 +108,10 @@ class AuthController extends Controller
                 'phone'=>$phone,
                 'wechat'=>$openid,
                 'jpush'=>$jpush,
+                'nickname'=>'瞄喵',
+                'status'=>1,
                 'password'=>bcrypt(123456)
             ]);
-            $user->status=1;
-            $user->save();
         }else{
             //用户已经存在,重新绑定
             $user->wechat=$wechat;

+ 1 - 1
server/app/Http/Controllers/Api/V1/InteractionController.php

xqd
@@ -182,7 +182,7 @@ class InteractionController extends Controller
 
         $user = $this->getUser();
         $data['to_user_id'] = $user->id;
-        $data['to_user_avatar'] = $user->avatar;
+//        $data['to_user_avatar'] = $user->avatar;
         $data['to_user_nickname'] = $user->nickname;
         $data['user_id'] =CommentInfoModel::find($request->id)->user_id;
         $data['user_avatar'] =CommentInfoModel::find($request->id)->user_avatar;