Ben 7 gadi atpakaļ
vecāks
revīzija
ca5b603f48
63 mainītis faili ar 4106 papildinājumiem un 110 dzēšanām
  1. BIN
      .vs/miaomiao/v14/.suo
  2. BIN
      miaomiao/bin/Android/Debug/android-debug-unaligned.apk
  3. BIN
      miaomiao/bin/Android/Debug/android-debug.apk
  4. 106 100
      miaomiao/config.xml
  5. 10 1
      miaomiao/package.json
  6. 8 0
      miaomiao/plugins/android.json
  7. 55 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/README.md
  8. 93 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/package.json
  9. 76 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/plugin.xml
  10. 109 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/AliPay.java
  11. 1 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/PayResult.java
  12. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/libs/alipaySdk-20160825.jar
  13. 11 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/AlipayPlugin.h
  14. 83 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/AlipayPlugin.m
  15. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/bar@2x.png
  16. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/refresh@2x.png
  17. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/refresh_click@2x.png
  18. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/shutdown@2x.png
  19. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/shutdown_click@2x.png
  20. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/AlipaySDK
  21. 33 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Headers/APayAuthInfo.h
  22. 177 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Headers/AlipaySDK.h
  23. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Info.plist
  24. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/en.lproj/InfoPlist.strings
  25. 9 0
      miaomiao/plugins/cordova-plugin-offbye-alipay/www/AliPay.js
  26. 22 0
      miaomiao/plugins/cordova-plugin-weibosdk/LICENSE
  27. 119 0
      miaomiao/plugins/cordova-plugin-weibosdk/README.md
  28. 118 0
      miaomiao/plugins/cordova-plugin-weibosdk/README_ZH.md
  29. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/ScreenShot.png
  30. 802 0
      miaomiao/plugins/cordova-plugin-weibosdk/example_www/css/bootstrap.css
  31. 115 0
      miaomiao/plugins/cordova-plugin-weibosdk/example_www/css/index.css
  32. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/example_www/img/logo.png
  33. 31 0
      miaomiao/plugins/cordova-plugin-weibosdk/example_www/index.html
  34. 60 0
      miaomiao/plugins/cordova-plugin-weibosdk/example_www/js/index.js
  35. 104 0
      miaomiao/plugins/cordova-plugin-weibosdk/package.json
  36. 126 0
      miaomiao/plugins/cordova-plugin-weibosdk/plugin.xml
  37. 457 0
      miaomiao/plugins/cordova-plugin-weibosdk/src/android/WeiboSDKPlugin.java
  38. 10 0
      miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/WeiboSDKPlugin.gradle
  39. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/openDefault-2.0.6.aar
  40. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/arm64-v8a/libweibosdkcore.so
  41. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/armeabi-v7a/libweibosdkcore.so
  42. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/armeabi/libweibosdkcore.so
  43. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/mips/libweibosdkcore.so
  44. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/mips64/libweibosdkcore.so
  45. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/x86/libweibosdkcore.so
  46. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/x86_64/libweibosdkcore.so
  47. 22 0
      miaomiao/plugins/cordova-plugin-weibosdk/src/ios/CDVWeiboSDK.h
  48. 314 0
      miaomiao/plugins/cordova-plugin-weibosdk/src/ios/CDVWeiboSDK.m
  49. 30 0
      miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WBHttpRequest+WeiboToken.h
  50. 184 0
      miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WBHttpRequest.h
  51. 89 0
      miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK+Statistics.h
  52. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK.bundle/images/common_button_white@2x.png
  53. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK.bundle/images/common_button_white_highlighted@2x.png
  54. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK.bundle/images/empty_failed@2x.png
  55. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK.bundle/others/mfp.cer
  56. 573 0
      miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK.h
  57. BIN
      miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/libWeiboSDK.a
  58. 30 0
      miaomiao/plugins/cordova-plugin-weibosdk/www/weibo.js
  59. 20 0
      miaomiao/plugins/fetch.json
  60. 50 2
      miaomiao/www/js/controllers/home.js
  61. 55 3
      miaomiao/www/js/controllers/my.js
  62. 2 2
      miaomiao/www/templates/home/dream-detail.html
  63. 2 2
      miaomiao/www/templates/my/my-recharge.html

BIN
.vs/miaomiao/v14/.suo


BIN
miaomiao/bin/Android/Debug/android-debug-unaligned.apk


BIN
miaomiao/bin/Android/Debug/android-debug.apk


+ 106 - 100
miaomiao/config.xml

xqd
@@ -1,105 +1,111 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version='1.0' encoding='utf-8'?>
 <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="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" />
-    <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>
-  <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="2.4.0" />
-  <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-jcore" spec="1.1.5" />
-  <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="^1.4.0">
-    <variable name="WECHATAPPID" value="wxc5181c0d406023e6" />
-  </plugin>
-  <plugin name="ionic-plugin-keyboard" spec="~1.0.9" />
-  <plugin name="jpush-phonegap-plugin" spec="^3.2.3">
-    <variable name="APP_KEY" value="041b70b4c7eee686870a32cd" />
-    <variable name="API_KEY" value="041b70b4c7eee686870a32cd" />
-  </plugin>
-  <plugin name="phonegap-plugin-barcodescanner" spec="https://github.com/phonegap/phonegap-plugin-barcodescanner.git">
-    <variable name="CAMERA_USAGE_DESCRIPTION" value="请摄像头对准条码" />
-  </plugin>
-  <plugin name="cordova-plugin-whitelist" spec="^1.2.2" />
-</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="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="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" />
+        <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>
+    <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="2.4.0" />
+    <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-jcore" spec="1.1.5" />
+    <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="^1.4.0">
+        <variable name="WECHATAPPID" value="wxc5181c0d406023e6" />
+    </plugin>
+    <plugin name="ionic-plugin-keyboard" spec="~1.0.9" />
+    <plugin name="jpush-phonegap-plugin" spec="^3.2.3">
+        <variable name="APP_KEY" value="041b70b4c7eee686870a32cd" />
+        <variable name="API_KEY" value="041b70b4c7eee686870a32cd" />
+    </plugin>
+    <plugin name="phonegap-plugin-barcodescanner" spec="https://github.com/phonegap/phonegap-plugin-barcodescanner.git">
+        <variable name="CAMERA_USAGE_DESCRIPTION" value="请摄像头对准条码" />
+    </plugin>
+    <plugin name="cordova-plugin-whitelist" spec="^1.2.2" />
+    <plugin name="cordova-plugin-offbye-alipay" spec="https://github.com/offbye/cordova-plugin-alipay.git">
+        <variable name="PARTNER_ID" value="2088721135315822" />
+    </plugin>
+    <plugin name="cordova-plugin-weibosdk" spec="^0.6.0">
+        <variable name="WEIBO_APP_ID" value="YOUR_WEIBO_APPID" />
+    </plugin>
+</widget>

+ 10 - 1
miaomiao/package.json

xqd xqd xqd
@@ -14,9 +14,11 @@
     "cordova-plugin-file-transfer": "1.6.2",
     "cordova-plugin-jcore": "1.1.5",
     "cordova-plugin-media-capture": "1.4.3",
+    "cordova-plugin-offbye-alipay": "git+https://github.com/offbye/cordova-plugin-alipay.git",
     "cordova-plugin-splashscreen": "4.0.3",
     "cordova-plugin-statusbar": "~2.1.0",
     "cordova-plugin-wechat": "^1.4.0",
+    "cordova-plugin-weibosdk": "^0.6.0",
     "cordova-plugin-whitelist": "^1.2.2",
     "gulp": "^3.5.6",
     "gulp-concat": "^2.2.0",
@@ -47,7 +49,8 @@
     "cordova-plugin-wechat",
     "phonegap-plugin-barcodescanner",
     "jpush-phonegap-plugin@2.2.8",
-    "cordova-plugin-whitelist"
+    "cordova-plugin-whitelist",
+    "cordova-plugin-weibosdk"
   ],
   "cordovaPlatforms": [
     "ios"
@@ -77,6 +80,12 @@
       "cordova-plugin-jcore": {},
       "phonegap-plugin-barcodescanner": {
         "CAMERA_USAGE_DESCRIPTION": "请摄像头对准条码"
+      },
+      "cordova-plugin-offbye-alipay": {
+        "PARTNER_ID": "2088721135315822"
+      },
+      "cordova-plugin-weibosdk": {
+        "WEIBO_APP_ID": "YOUR_WEIBO_APPID"
       }
     }
   }

+ 8 - 0
miaomiao/plugins/android.json

xqd
@@ -42,6 +42,14 @@
         },
         "cordova-plugin-statusbar": {
             "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-offbye-alipay": {
+            "PARTNER_ID": "2088721135315822",
+            "PACKAGE_NAME": "com.miaomiao.app"
+        },
+        "cordova-plugin-weibosdk": {
+            "WEIBO_APP_ID": "YOUR_WEIBO_APPID",
+            "PACKAGE_NAME": "com.miaomiao.app"
         }
     },
     "dependent_plugins": {}

+ 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) 建议商户依赖异步通知
+				 */
+
+```

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 93 - 0
miaomiao/plugins/cordova-plugin-offbye-alipay/package.json


+ 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]);
+		}
+};

+ 22 - 0
miaomiao/plugins/cordova-plugin-weibosdk/LICENSE

xqd
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Van
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+

+ 119 - 0
miaomiao/plugins/cordova-plugin-weibosdk/README.md

xqd
@@ -0,0 +1,119 @@
+# cordova-plugin-weibosdk
+[![npm](https://img.shields.io/npm/v/cordova-plugin-weibosdk.svg)](https://www.npmjs.com/package/cordova-plugin-weibosdk)
+[![npm](https://img.shields.io/npm/dm/cordova-plugin-weibosdk.svg)](https://www.npmjs.com/package/cordova-plugin-weibosdk)
+[![platform](https://img.shields.io/badge/platform-iOS%2FAndroid-lightgrey.svg?style=flat)](https://github.com/iVanPan/cordova_weibo)
+[![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat)](https://github.com/iVanPan/cordova_weibo/blob/master/LICENSE)
+
+A Cordova wrapper around the Sina WeiboSDK for Android and iOS. Provides access to ssoLogin, WeiboSharing etc... [简体中文](https://github.com/iVanPan/cordova_weibo/blob/master/README_ZH.md)  
+
+
+## Feature
+- Weibo SSO Login
+- Weibo Logout
+- Weibo Share (WebPage,Text,Image)
+- Check Weibo Client is Installed
+
+## Requirements
+- Cordova Version 3.5+
+- Cordova-Android >= 4.0
+- Cordova-iOS >= 4.0			
+
+## Installation
+1. ```cordova plugin add cordova-plugin-weibosdk --variable WEIBO_APP_ID=YOUR_WEIBO_APPID```
+2. Add ```<preference name="REDIRECTURI" value="YOUR_WEIBO_REDIRECTURI" />``` in your config.xml If you don't add this preference the defualt redirecturi is https://api.weibo.com/oauth2/default.html               
+3. cordova build
+
+
+## Notes
+1. This plugin is required Cordova-Android version >= 4.0,so using Cordova 5.0 or higher is recommended
+2. This plugin should be used after the deviceready event has been fired!!!				
+3. ~~If Cordova version  <5.1.1,when two Cordova plugins are modifying “*-Info.plist” CFBundleURLTypes, only the first added plugin is getting the changes applied.so after installing plugin,please check the URLTypes in your Xcode project.You can find this issue [here](https://issues.apache.org/jira/browse/CB-8007).~~  Update:This Bug is fixed in last Cordova version(5.1.1)	
+
+
+## Usage
+
+### Weibo SSO Login
+```Javascript
+WeiboSDK.ssoLogin(function (args) {
+   alert('access token is ' + args.access_token);
+   alert('userId is ' + args.userId);
+   alert('expires_time is ' + new Date(parseInt(args.expires_time)) + ' TimeStamp is ' + args.expires_time);
+}, function (failReason) {
+   alert(failReason);
+});
+```
+
+### Weibo Logout
+```Javascript
+WeiboSDK.logout(function () {
+   alert('logout success');
+}, function (failReason) {
+   alert(failReason);
+});
+```
+
+### Weibo WebPage Share
+```Javascript
+var args = {};
+args.url = 'https://cordova.apache.org/';
+args.title = 'Apache Cordova';
+args.description = 'This is a Cordova Plugin';
+args.image = 'https://cordova.apache.org/static/img/pluggy.png';
+WeiboSDK.shareToWeibo(function () {
+   alert('share success');
+}, function (failReason) {
+   alert(failReason);
+}, args);
+```
+### Weibo Image Share
+```Javascript
+var args = {};
+args.image = 'https://cordova.apache.org/static/img/pluggy.png';
+WeiboSDK.shareImageToWeibo(function () {
+   alert('share success');
+}, function (failReason) {
+   alert(failReason);
+}, args);
+```
+### Weibo Text Share
+```Javascript
+var args = {};
+args.text = 'This is a Cordova Plugin';
+WeiboSDK.shareTextToWeibo(function () {
+   alert('share success');
+}, function (failReason) {
+   alert(failReason);
+}, args);
+```
+### CheckClientInstalled
+```Javascript
+WeiboSDK.checkClientInstalled(function () {
+   alert('client is installed');
+}, function () {
+   alert('client is not installed');
+});
+```
+### GetUserInfo
+```Javascript
+var url = 'https://api.weibo.com/2/users/show.json?uid=' + usrid + '&&access_token=' + token;
+http.get(url)
+```
+
+## Example			
+1. install this plugin
+2. backup www folder in your cordova project
+3. replace www by example_www
+4. cordova build & test
+
+<div style="text-align:center"><img src="https://github.com/iVanPan/cordova_weibo/blob/master/ScreenShot.png?raw=true" alt="example" style="width:300px"></div> 
+
+## About WeiboSdk
+you can downlaod last weibosdk [here](https://github.com/sinaweibosdk) .if you find any problem about weibosdk, open an isssus please.
+
+## Contributing
+Feel free to contribute                 
+
+## License
+
+**cordova-plugin-weibosdk** is released under the **MIT** license. See [LICENSE](https://github.com/iVanPan/cordova_weibo/blob/master/LICENSE) file for more information.
+

+ 118 - 0
miaomiao/plugins/cordova-plugin-weibosdk/README_ZH.md

xqd
@@ -0,0 +1,118 @@
+# cordova-plugin-weibosdk
+[![npm](https://img.shields.io/npm/v/cordova-plugin-weibosdk.svg)](https://www.npmjs.com/package/cordova-plugin-weibosdk)
+[![npm](https://img.shields.io/npm/dm/cordova-plugin-weibosdk.svg)](https://www.npmjs.com/package/cordova-plugin-weibosdk)
+[![platform](https://img.shields.io/badge/platform-iOS%2FAndroid-lightgrey.svg?style=flat)](https://github.com/iVanPan/cordova_weibo)
+[![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat)](https://github.com/iVanPan/cordova_weibo/blob/master/LICENSE)
+
+
+这是一个微博的 Cordova 插件. [English](https://github.com/iVanPan/cordova_weibo)    
+如果有任何问题或是建议,请开 issuss,也欢迎 star 或是 fork。微博SDK部分如有涉及版权问题,版权归新浪微博所有
+
+## 功能
+- 微博 SSO 登录
+- 微博登出
+- 微博分享(网页、文字、图片)
+- 检查微博官方客户端是否安装
+
+## 安装要求
+- Cordova Version >= 3.5
+- Cordova-Android >= 4.0
+- Cordova-iOS >= 4.0
+
+## 安装
+1. 命令行运行 ```cordova plugin add cordova-plugin-weibosdk --variable WEIBO_APP_ID=YOUR_WEIBO_APPID```			
+2. 在你的config.xml文件中添加 ```<preference name="REDIRECTURI" value="YOUR_WEIBO_REDIRECTURI" />``` 如果你不添加这个选项,那么默认的 redirecturi 是 https://api.weibo.com/oauth2/default.html               
+3. 命令行运行 cordova build   					
+
+# 注意事项
+1. 这个插件要求 Cordova-Android 的版本 >=4.0,推荐使用 Cordova 5.0 或更高的版本,因为从 Cordova 5.0 开始 Cordova-Android 4.0 是默认使用的 Android 版本
+2. 请在 Cordova 的 deviceready 事件触发以后再调用本插件!!!!!  
+3. <del>在低于5.1.1的 Cordova 版本中存在一个 Bug,如果你有多个插件要修改 iOS 工程中的 “*-Info.plist” CFBundleURLTypes, 只有第一个安装的插件才会生效.所以安装完插件请务必在你的 Xcode 工程里面检查一下 URLTypes。 关于这个 bug 的详情你可以在 [这里](https://issues.apache.org/jira/browse/CB-8007)找到</del> 建议安装使用5.1.1及以上的 Cordova 版本 						
+
+## 使用方法
+### 微博SSO登录
+```Javascript
+WeiboSDK.ssoLogin(function (args) {
+   alert('access token is ' + args.access_token);
+   alert('userId is ' + args.userId);
+   alert('expires_time is ' + new Date(parseInt(args.expires_time)) + ' TimeStamp is ' + args.expires_time);
+}, function (failReason) {
+   alert(failReason);
+});
+```
+
+
+### 微博登出
+```Javascript
+WeiboSDK.logout(function () {
+   alert('logout success');
+}, function (failReason) {
+   alert(failReason);
+});
+```
+
+### 微博网页分享
+```Javascript
+var args = {};
+args.url = 'https://cordova.apache.org/';
+args.title = 'Apache Cordova';
+args.description = 'This is a Cordova Plugin';
+args.image = 'https://cordova.apache.org/static/img/pluggy.png';
+WeiboSDK.shareToWeibo(function () {
+   alert('share success');
+}, function (failReason) {
+   alert(failReason);
+}, args);
+```
+
+### 微博图片分享
+```Javascript
+var args = {};
+args.image = 'https://cordova.apache.org/static/img/pluggy.png';
+WeiboSDK.shareImageToWeibo(function () {
+   alert('share success');
+}, function (failReason) {
+   alert(failReason);
+}, args);
+```
+
+### 微博文字分享
+```Javascript
+var args = {};
+args.text = 'This is a Cordova Plugin';
+WeiboSDK.shareTextToWeibo(function () {
+   alert('share success');
+}, function (failReason) {
+   alert(failReason);
+}, args);
+```
+
+### 检查微博客户端是否安装
+```Javascript
+WeiboSDK.checkClientInstalled(function () {
+   alert('client is installed');
+}, function () {
+   alert('client is not installed');
+});
+```
+
+### 获取用户信息
+```Javascript
+var url = 'https://api.weibo.com/2/users/show.json?uid=' + usrid + '&&access_token=' + token;
+http.get(url)
+```
+
+# 测试Demo
+在安装完这个插件以后,把 Cordova 工程中的代码替换为 example_www 中的代码,在 build 以后可以进行各个功能测试,以下为运行效果图:
+<div style="text-align:center"><img src="https://github.com/iVanPan/cordova_weibo/blob/master/ScreenShot.png?raw=true" alt="example" style="width:300px"></div>		
+
+## 关于微博SDK
+你可以在[这里](https://github.com/sinaweibosdk),找到最新的微博 SDK,如果发现 bug 请开 issus,同时也欢迎 star 和 fork
+
+## 贡献代码
+欢迎提交 PR,贡献你的代码,如果有新功能,请提供 Demo。
+
+## 开源证书
+
+**cordova-plugin-weibosdk** 遵照了 **MIT** 证书. 详情可以查看 [证书](https://github.com/iVanPan/cordova_weibo/blob/master/LICENSE) 文件
+

BIN
miaomiao/plugins/cordova-plugin-weibosdk/ScreenShot.png


+ 802 - 0
miaomiao/plugins/cordova-plugin-weibosdk/example_www/css/bootstrap.css

xqd
@@ -0,0 +1,802 @@
+/*!
+ * Bootstrap v3.3.7 (http://getbootstrap.com)
+ * Copyright 2011-2017 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+
+/*!
+ * Generated using the Bootstrap Customizer (<none>)
+ * Config saved to config.json and <none>
+ */
+/*!
+ * Bootstrap v3.3.7 (http://getbootstrap.com)
+ * Copyright 2011-2016 Twitter, Inc.
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ */
+/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
+html {
+  font-family: sans-serif;
+  -ms-text-size-adjust: 100%;
+  -webkit-text-size-adjust: 100%;
+}
+body {
+  margin: 0;
+}
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+menu,
+nav,
+section,
+summary {
+  display: block;
+}
+audio,
+canvas,
+progress,
+video {
+  display: inline-block;
+  vertical-align: baseline;
+}
+audio:not([controls]) {
+  display: none;
+  height: 0;
+}
+[hidden],
+template {
+  display: none;
+}
+a {
+  background-color: transparent;
+}
+a:active,
+a:hover {
+  outline: 0;
+}
+abbr[title] {
+  border-bottom: 1px dotted;
+}
+b,
+strong {
+  font-weight: bold;
+}
+dfn {
+  font-style: italic;
+}
+h1 {
+  font-size: 2em;
+  margin: 0.67em 0;
+}
+mark {
+  background: #ff0;
+  color: #000;
+}
+small {
+  font-size: 80%;
+}
+sub,
+sup {
+  font-size: 75%;
+  line-height: 0;
+  position: relative;
+  vertical-align: baseline;
+}
+sup {
+  top: -0.5em;
+}
+sub {
+  bottom: -0.25em;
+}
+img {
+  border: 0;
+}
+svg:not(:root) {
+  overflow: hidden;
+}
+figure {
+  margin: 1em 40px;
+}
+hr {
+  -webkit-box-sizing: content-box;
+     -moz-box-sizing: content-box;
+          box-sizing: content-box;
+  height: 0;
+}
+pre {
+  overflow: auto;
+}
+code,
+kbd,
+pre,
+samp {
+  font-family: monospace, monospace;
+  font-size: 1em;
+}
+button,
+input,
+optgroup,
+select,
+textarea {
+  color: inherit;
+  font: inherit;
+  margin: 0;
+}
+button {
+  overflow: visible;
+}
+button,
+select {
+  text-transform: none;
+}
+button,
+html input[type="button"],
+input[type="reset"],
+input[type="submit"] {
+  -webkit-appearance: button;
+  cursor: pointer;
+}
+button[disabled],
+html input[disabled] {
+  cursor: default;
+}
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+  border: 0;
+  padding: 0;
+}
+input {
+  line-height: normal;
+}
+input[type="checkbox"],
+input[type="radio"] {
+  -webkit-box-sizing: border-box;
+     -moz-box-sizing: border-box;
+          box-sizing: border-box;
+  padding: 0;
+}
+input[type="number"]::-webkit-inner-spin-button,
+input[type="number"]::-webkit-outer-spin-button {
+  height: auto;
+}
+input[type="search"] {
+  -webkit-appearance: textfield;
+  -webkit-box-sizing: content-box;
+     -moz-box-sizing: content-box;
+          box-sizing: content-box;
+}
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+  -webkit-appearance: none;
+}
+fieldset {
+  border: 1px solid #c0c0c0;
+  margin: 0 2px;
+  padding: 0.35em 0.625em 0.75em;
+}
+legend {
+  border: 0;
+  padding: 0;
+}
+textarea {
+  overflow: auto;
+}
+optgroup {
+  font-weight: bold;
+}
+table {
+  border-collapse: collapse;
+  border-spacing: 0;
+}
+td,
+th {
+  padding: 0;
+}
+* {
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+}
+*:before,
+*:after {
+  -webkit-box-sizing: border-box;
+  -moz-box-sizing: border-box;
+  box-sizing: border-box;
+}
+html {
+  font-size: 10px;
+  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+body {
+  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+  font-size: 14px;
+  line-height: 1.42857143;
+  color: #333333;
+  background-color: #ffffff;
+}
+input,
+button,
+select,
+textarea {
+  font-family: inherit;
+  font-size: inherit;
+  line-height: inherit;
+}
+a {
+  color: #337ab7;
+  text-decoration: none;
+}
+a:hover,
+a:focus {
+  color: #23527c;
+  text-decoration: underline;
+}
+a:focus {
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+figure {
+  margin: 0;
+}
+img {
+  vertical-align: middle;
+}
+.img-responsive {
+  display: block;
+  max-width: 100%;
+  height: auto;
+}
+.img-rounded {
+  border-radius: 6px;
+}
+.img-thumbnail {
+  padding: 4px;
+  line-height: 1.42857143;
+  background-color: #ffffff;
+  border: 1px solid #dddddd;
+  border-radius: 4px;
+  -webkit-transition: all 0.2s ease-in-out;
+  -o-transition: all 0.2s ease-in-out;
+  transition: all 0.2s ease-in-out;
+  display: inline-block;
+  max-width: 100%;
+  height: auto;
+}
+.img-circle {
+  border-radius: 50%;
+}
+hr {
+  margin-top: 20px;
+  margin-bottom: 20px;
+  border: 0;
+  border-top: 1px solid #eeeeee;
+}
+.sr-only {
+  position: absolute;
+  width: 1px;
+  height: 1px;
+  margin: -1px;
+  padding: 0;
+  overflow: hidden;
+  clip: rect(0, 0, 0, 0);
+  border: 0;
+}
+.sr-only-focusable:active,
+.sr-only-focusable:focus {
+  position: static;
+  width: auto;
+  height: auto;
+  margin: 0;
+  overflow: visible;
+  clip: auto;
+}
+[role="button"] {
+  cursor: pointer;
+}
+.btn {
+  display: inline-block;
+  margin-bottom: 0;
+  font-weight: normal;
+  text-align: center;
+  vertical-align: middle;
+  -ms-touch-action: manipulation;
+      touch-action: manipulation;
+  cursor: pointer;
+  background-image: none;
+  border: 1px solid transparent;
+  white-space: nowrap;
+  padding: 6px 12px;
+  font-size: 14px;
+  line-height: 1.42857143;
+  border-radius: 4px;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+.btn:focus,
+.btn:active:focus,
+.btn.active:focus,
+.btn.focus,
+.btn:active.focus,
+.btn.active.focus {
+  outline: 5px auto -webkit-focus-ring-color;
+  outline-offset: -2px;
+}
+.btn:hover,
+.btn:focus,
+.btn.focus {
+  color: #333333;
+  text-decoration: none;
+}
+.btn:active,
+.btn.active {
+  outline: 0;
+  background-image: none;
+  -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
+}
+.btn.disabled,
+.btn[disabled],
+fieldset[disabled] .btn {
+  cursor: not-allowed;
+  opacity: 0.65;
+  filter: alpha(opacity=65);
+  -webkit-box-shadow: none;
+  box-shadow: none;
+}
+a.btn.disabled,
+fieldset[disabled] a.btn {
+  pointer-events: none;
+}
+.btn-default {
+  color: #333333;
+  background-color: #ffffff;
+  border-color: #cccccc;
+}
+.btn-default:focus,
+.btn-default.focus {
+  color: #333333;
+  background-color: #e6e6e6;
+  border-color: #8c8c8c;
+}
+.btn-default:hover {
+  color: #333333;
+  background-color: #e6e6e6;
+  border-color: #adadad;
+}
+.btn-default:active,
+.btn-default.active,
+.open > .dropdown-toggle.btn-default {
+  color: #333333;
+  background-color: #e6e6e6;
+  border-color: #adadad;
+}
+.btn-default:active:hover,
+.btn-default.active:hover,
+.open > .dropdown-toggle.btn-default:hover,
+.btn-default:active:focus,
+.btn-default.active:focus,
+.open > .dropdown-toggle.btn-default:focus,
+.btn-default:active.focus,
+.btn-default.active.focus,
+.open > .dropdown-toggle.btn-default.focus {
+  color: #333333;
+  background-color: #d4d4d4;
+  border-color: #8c8c8c;
+}
+.btn-default:active,
+.btn-default.active,
+.open > .dropdown-toggle.btn-default {
+  background-image: none;
+}
+.btn-default.disabled:hover,
+.btn-default[disabled]:hover,
+fieldset[disabled] .btn-default:hover,
+.btn-default.disabled:focus,
+.btn-default[disabled]:focus,
+fieldset[disabled] .btn-default:focus,
+.btn-default.disabled.focus,
+.btn-default[disabled].focus,
+fieldset[disabled] .btn-default.focus {
+  background-color: #ffffff;
+  border-color: #cccccc;
+}
+.btn-default .badge {
+  color: #ffffff;
+  background-color: #333333;
+}
+.btn-primary {
+  color: #ffffff;
+  background-color: #337ab7;
+  border-color: #2e6da4;
+}
+.btn-primary:focus,
+.btn-primary.focus {
+  color: #ffffff;
+  background-color: #286090;
+  border-color: #122b40;
+}
+.btn-primary:hover {
+  color: #ffffff;
+  background-color: #286090;
+  border-color: #204d74;
+}
+.btn-primary:active,
+.btn-primary.active,
+.open > .dropdown-toggle.btn-primary {
+  color: #ffffff;
+  background-color: #286090;
+  border-color: #204d74;
+}
+.btn-primary:active:hover,
+.btn-primary.active:hover,
+.open > .dropdown-toggle.btn-primary:hover,
+.btn-primary:active:focus,
+.btn-primary.active:focus,
+.open > .dropdown-toggle.btn-primary:focus,
+.btn-primary:active.focus,
+.btn-primary.active.focus,
+.open > .dropdown-toggle.btn-primary.focus {
+  color: #ffffff;
+  background-color: #204d74;
+  border-color: #122b40;
+}
+.btn-primary:active,
+.btn-primary.active,
+.open > .dropdown-toggle.btn-primary {
+  background-image: none;
+}
+.btn-primary.disabled:hover,
+.btn-primary[disabled]:hover,
+fieldset[disabled] .btn-primary:hover,
+.btn-primary.disabled:focus,
+.btn-primary[disabled]:focus,
+fieldset[disabled] .btn-primary:focus,
+.btn-primary.disabled.focus,
+.btn-primary[disabled].focus,
+fieldset[disabled] .btn-primary.focus {
+  background-color: #337ab7;
+  border-color: #2e6da4;
+}
+.btn-primary .badge {
+  color: #337ab7;
+  background-color: #ffffff;
+}
+.btn-success {
+  color: #ffffff;
+  background-color: #5cb85c;
+  border-color: #4cae4c;
+}
+.btn-success:focus,
+.btn-success.focus {
+  color: #ffffff;
+  background-color: #449d44;
+  border-color: #255625;
+}
+.btn-success:hover {
+  color: #ffffff;
+  background-color: #449d44;
+  border-color: #398439;
+}
+.btn-success:active,
+.btn-success.active,
+.open > .dropdown-toggle.btn-success {
+  color: #ffffff;
+  background-color: #449d44;
+  border-color: #398439;
+}
+.btn-success:active:hover,
+.btn-success.active:hover,
+.open > .dropdown-toggle.btn-success:hover,
+.btn-success:active:focus,
+.btn-success.active:focus,
+.open > .dropdown-toggle.btn-success:focus,
+.btn-success:active.focus,
+.btn-success.active.focus,
+.open > .dropdown-toggle.btn-success.focus {
+  color: #ffffff;
+  background-color: #398439;
+  border-color: #255625;
+}
+.btn-success:active,
+.btn-success.active,
+.open > .dropdown-toggle.btn-success {
+  background-image: none;
+}
+.btn-success.disabled:hover,
+.btn-success[disabled]:hover,
+fieldset[disabled] .btn-success:hover,
+.btn-success.disabled:focus,
+.btn-success[disabled]:focus,
+fieldset[disabled] .btn-success:focus,
+.btn-success.disabled.focus,
+.btn-success[disabled].focus,
+fieldset[disabled] .btn-success.focus {
+  background-color: #5cb85c;
+  border-color: #4cae4c;
+}
+.btn-success .badge {
+  color: #5cb85c;
+  background-color: #ffffff;
+}
+.btn-info {
+  color: #ffffff;
+  background-color: #5bc0de;
+  border-color: #46b8da;
+}
+.btn-info:focus,
+.btn-info.focus {
+  color: #ffffff;
+  background-color: #31b0d5;
+  border-color: #1b6d85;
+}
+.btn-info:hover {
+  color: #ffffff;
+  background-color: #31b0d5;
+  border-color: #269abc;
+}
+.btn-info:active,
+.btn-info.active,
+.open > .dropdown-toggle.btn-info {
+  color: #ffffff;
+  background-color: #31b0d5;
+  border-color: #269abc;
+}
+.btn-info:active:hover,
+.btn-info.active:hover,
+.open > .dropdown-toggle.btn-info:hover,
+.btn-info:active:focus,
+.btn-info.active:focus,
+.open > .dropdown-toggle.btn-info:focus,
+.btn-info:active.focus,
+.btn-info.active.focus,
+.open > .dropdown-toggle.btn-info.focus {
+  color: #ffffff;
+  background-color: #269abc;
+  border-color: #1b6d85;
+}
+.btn-info:active,
+.btn-info.active,
+.open > .dropdown-toggle.btn-info {
+  background-image: none;
+}
+.btn-info.disabled:hover,
+.btn-info[disabled]:hover,
+fieldset[disabled] .btn-info:hover,
+.btn-info.disabled:focus,
+.btn-info[disabled]:focus,
+fieldset[disabled] .btn-info:focus,
+.btn-info.disabled.focus,
+.btn-info[disabled].focus,
+fieldset[disabled] .btn-info.focus {
+  background-color: #5bc0de;
+  border-color: #46b8da;
+}
+.btn-info .badge {
+  color: #5bc0de;
+  background-color: #ffffff;
+}
+.btn-warning {
+  color: #ffffff;
+  background-color: #f0ad4e;
+  border-color: #eea236;
+}
+.btn-warning:focus,
+.btn-warning.focus {
+  color: #ffffff;
+  background-color: #ec971f;
+  border-color: #985f0d;
+}
+.btn-warning:hover {
+  color: #ffffff;
+  background-color: #ec971f;
+  border-color: #d58512;
+}
+.btn-warning:active,
+.btn-warning.active,
+.open > .dropdown-toggle.btn-warning {
+  color: #ffffff;
+  background-color: #ec971f;
+  border-color: #d58512;
+}
+.btn-warning:active:hover,
+.btn-warning.active:hover,
+.open > .dropdown-toggle.btn-warning:hover,
+.btn-warning:active:focus,
+.btn-warning.active:focus,
+.open > .dropdown-toggle.btn-warning:focus,
+.btn-warning:active.focus,
+.btn-warning.active.focus,
+.open > .dropdown-toggle.btn-warning.focus {
+  color: #ffffff;
+  background-color: #d58512;
+  border-color: #985f0d;
+}
+.btn-warning:active,
+.btn-warning.active,
+.open > .dropdown-toggle.btn-warning {
+  background-image: none;
+}
+.btn-warning.disabled:hover,
+.btn-warning[disabled]:hover,
+fieldset[disabled] .btn-warning:hover,
+.btn-warning.disabled:focus,
+.btn-warning[disabled]:focus,
+fieldset[disabled] .btn-warning:focus,
+.btn-warning.disabled.focus,
+.btn-warning[disabled].focus,
+fieldset[disabled] .btn-warning.focus {
+  background-color: #f0ad4e;
+  border-color: #eea236;
+}
+.btn-warning .badge {
+  color: #f0ad4e;
+  background-color: #ffffff;
+}
+.btn-danger {
+  color: #ffffff;
+  background-color: #d9534f;
+  border-color: #d43f3a;
+}
+.btn-danger:focus,
+.btn-danger.focus {
+  color: #ffffff;
+  background-color: #c9302c;
+  border-color: #761c19;
+}
+.btn-danger:hover {
+  color: #ffffff;
+  background-color: #c9302c;
+  border-color: #ac2925;
+}
+.btn-danger:active,
+.btn-danger.active,
+.open > .dropdown-toggle.btn-danger {
+  color: #ffffff;
+  background-color: #c9302c;
+  border-color: #ac2925;
+}
+.btn-danger:active:hover,
+.btn-danger.active:hover,
+.open > .dropdown-toggle.btn-danger:hover,
+.btn-danger:active:focus,
+.btn-danger.active:focus,
+.open > .dropdown-toggle.btn-danger:focus,
+.btn-danger:active.focus,
+.btn-danger.active.focus,
+.open > .dropdown-toggle.btn-danger.focus {
+  color: #ffffff;
+  background-color: #ac2925;
+  border-color: #761c19;
+}
+.btn-danger:active,
+.btn-danger.active,
+.open > .dropdown-toggle.btn-danger {
+  background-image: none;
+}
+.btn-danger.disabled:hover,
+.btn-danger[disabled]:hover,
+fieldset[disabled] .btn-danger:hover,
+.btn-danger.disabled:focus,
+.btn-danger[disabled]:focus,
+fieldset[disabled] .btn-danger:focus,
+.btn-danger.disabled.focus,
+.btn-danger[disabled].focus,
+fieldset[disabled] .btn-danger.focus {
+  background-color: #d9534f;
+  border-color: #d43f3a;
+}
+.btn-danger .badge {
+  color: #d9534f;
+  background-color: #ffffff;
+}
+.btn-link {
+  color: #337ab7;
+  font-weight: normal;
+  border-radius: 0;
+}
+.btn-link,
+.btn-link:active,
+.btn-link.active,
+.btn-link[disabled],
+fieldset[disabled] .btn-link {
+  background-color: transparent;
+  -webkit-box-shadow: none;
+  box-shadow: none;
+}
+.btn-link,
+.btn-link:hover,
+.btn-link:focus,
+.btn-link:active {
+  border-color: transparent;
+}
+.btn-link:hover,
+.btn-link:focus {
+  color: #23527c;
+  text-decoration: underline;
+  background-color: transparent;
+}
+.btn-link[disabled]:hover,
+fieldset[disabled] .btn-link:hover,
+.btn-link[disabled]:focus,
+fieldset[disabled] .btn-link:focus {
+  color: #777777;
+  text-decoration: none;
+}
+.btn-lg {
+  padding: 10px 16px;
+  font-size: 18px;
+  line-height: 1.3333333;
+  border-radius: 6px;
+}
+.btn-sm {
+  padding: 5px 10px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+.btn-xs {
+  padding: 1px 5px;
+  font-size: 12px;
+  line-height: 1.5;
+  border-radius: 3px;
+}
+.btn-block {
+  display: block;
+  width: 100%;
+}
+.btn-block + .btn-block {
+  margin-top: 5px;
+}
+input[type="submit"].btn-block,
+input[type="reset"].btn-block,
+input[type="button"].btn-block {
+  width: 100%;
+}
+.clearfix:before,
+.clearfix:after {
+  content: " ";
+  display: table;
+}
+.clearfix:after {
+  clear: both;
+}
+.center-block {
+  display: block;
+  margin-left: auto;
+  margin-right: auto;
+}
+.pull-right {
+  float: right !important;
+}
+.pull-left {
+  float: left !important;
+}
+.hide {
+  display: none !important;
+}
+.show {
+  display: block !important;
+}
+.invisible {
+  visibility: hidden;
+}
+.text-hide {
+  font: 0/0 a;
+  color: transparent;
+  text-shadow: none;
+  background-color: transparent;
+  border: 0;
+}
+.hidden {
+  display: none !important;
+}
+.affix {
+  position: fixed;
+}

+ 115 - 0
miaomiao/plugins/cordova-plugin-weibosdk/example_www/css/index.css

xqd
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+* {
+    -webkit-tap-highlight-color: rgba(0,0,0,0); /* make transparent link selection, adjust last value opacity 0 to 1.0 */
+}
+
+body {
+    -webkit-touch-callout: none;                /* prevent callout to copy image, etc when tap to hold */
+    -webkit-text-size-adjust: none;             /* prevent webkit from resizing text to fit */
+    -webkit-user-select: none;                  /* prevent copy paste, to allow, change 'none' to 'text' */
+    background-color:#E4E4E4;
+    background-image:linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-webkit-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-ms-linear-gradient(top, #A7A7A7 0%, #E4E4E4 51%);
+    background-image:-webkit-gradient(
+        linear,
+        left top,
+        left bottom,
+        color-stop(0, #A7A7A7),
+        color-stop(0.51, #E4E4E4)
+    );
+    background-attachment:fixed;
+    font-family:'HelveticaNeue-Light', 'HelveticaNeue', Helvetica, Arial, sans-serif;
+    font-size:12px;
+    height:100%;
+    margin:0px;
+    padding:0px;
+    text-transform:uppercase;
+    width:100%;
+}
+
+/* Portrait layout (default) */
+.app {
+    background:url(../img/logo.png) no-repeat center top; /* 170px x 200px */
+    position:absolute;             /* position in the center of the screen */
+    left:50%;
+    top:25%;
+    height:50px;                   /* text area height */
+    width:225px;                   /* text area width */
+    text-align:center;
+    padding:180px 0px 0px 0px;     /* image height is 200px (bottom 20px are overlapped with text) */
+    margin:-115px 0px 0px -112px;  /* offset vertical: half of image height and text area height */
+                                   /* offset horizontal: half of text area width */
+}
+
+/* Landscape layout (with min-width) */
+@media screen and (min-aspect-ratio: 1/1) and (min-width:400px) {
+    .app {
+        background-position:left center;
+        padding:75px 0px 75px 170px;  /* padding-top + padding-bottom + text area = image height */
+        margin:-90px 0px 0px -198px;  /* offset vertical: half of image height */
+                                      /* offset horizontal: half of image width and text area width */
+    }
+}
+
+h1 {
+    font-size:24px;
+    font-weight:normal;
+    margin:0px;
+    overflow:visible;
+    padding:0px;
+    text-align:center;
+}
+
+.event {
+    border-radius:4px;
+    -webkit-border-radius:4px;
+    color:#FFFFFF;
+    font-size:12px;
+    margin:0px 30px;
+    padding:2px 0px;
+}
+
+.event.listening {
+    background-color:#333333;
+    display:block;
+}
+
+.event.received {
+    background-color:#4B946A;
+    display:none;
+}
+
+@keyframes fade {
+    from { opacity: 1.0; }
+    50% { opacity: 0.4; }
+    to { opacity: 1.0; }
+}
+ 
+@-webkit-keyframes fade {
+    from { opacity: 1.0; }
+    50% { opacity: 0.4; }
+    to { opacity: 1.0; }
+}
+ 
+.blink {
+    animation:fade 3000ms infinite;
+    -webkit-animation:fade 3000ms infinite;
+}

BIN
miaomiao/plugins/cordova-plugin-weibosdk/example_www/img/logo.png


+ 31 - 0
miaomiao/plugins/cordova-plugin-weibosdk/example_www/index.html

xqd
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8"/>
+    <meta name="format-detection" content="telephone=no"/>
+    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=3, minimum-scale=1, width=device-width"/>
+    <link rel="stylesheet" type="text/css" href="css/index.css"/>
+    <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
+    <script type="text/javascript" src="cordova.js"></script>
+    <script type="text/javascript" src="js/index.js"></script>
+    <script type="text/javascript">
+     document.addEventListener("deviceready", function(){
+      alert('device ready now');
+      appintance = new app();
+     }, true); 
+</script>
+<title>Corodva Weibo Plugin Exmaple</title>
+</head>
+<body>
+    <div class="app">
+        <div id="deviceready">
+          <button type="button" class="btn btn-primary btn-block" onclick="appintance.checkClientInstalled()">检查客户端是否安装</button>
+          <button type="button" class="btn btn-primary btn-block" onclick="appintance.ssoLogin()">微博登录</button>
+          <button type="button" class="btn btn-primary btn-block" onclick="appintance.logout()">微博登出</button>
+          <button type="button" class="btn btn-primary btn-block" onclick="appintance.shareToWeibo()">网页分享</button>
+          <button type="button" class="btn btn-primary btn-block" onclick="appintance.shareImageToWeibo()">图片分享</button>
+          <button type="button" class="btn btn-primary btn-block" onclick="appintance.shareTextToWeibo()">文字分享</button>
+        </div>
+      </div>
+    </body>
+    </html>

+ 60 - 0
miaomiao/plugins/cordova-plugin-weibosdk/example_www/js/index.js

xqd
@@ -0,0 +1,60 @@
+var app = function () {
+  this.checkClientInstalled = function () {
+    WeiboSDK.checkClientInstalled(function () {
+      alert('client is installed');
+    }, function () {
+      alert('client is not installed');
+    });
+  };
+
+  this.ssoLogin = function () {
+    WeiboSDK.ssoLogin(function (args) {
+      alert('access token is ' + args.access_token);
+      alert('userId is ' + args.userId);
+      alert('expires_time is ' + new Date(parseInt(args.expires_time)) + ' TimeStamp is ' + args.expires_time);
+    }, function (failReason) {
+      alert(failReason);
+    });
+  };
+
+  this.shareToWeibo = function () {
+    var args = {};
+    args.url = 'https://cordova.apache.org/';
+    args.title = 'Apache Cordova';
+    args.description = 'This is a Cordova Plugin';
+    args.image = 'https://cordova.apache.org/static/img/pluggy.png';
+    WeiboSDK.shareToWeibo(function () {
+      alert('share success');
+    }, function (failReason) {
+      alert(failReason);
+    }, args);
+  };
+
+  this.shareImageToWeibo = function () {
+    var args = {};
+    args.image = 'https://cordova.apache.org/static/img/pluggy.png';
+    WeiboSDK.shareImageToWeibo(function () {
+      alert('share success');
+    }, function (failReason) {
+      alert(failReason);
+    }, args);
+  };
+
+  this.shareTextToWeibo = function () {
+    var args = {};
+    args.text = 'This is a Cordova Plugin';
+    WeiboSDK.shareTextToWeibo(function () {
+      alert('share success');
+    }, function (failReason) {
+      alert(failReason);
+    }, args);
+  };
+
+  this.logout = function () {
+    WeiboSDK.logout(function () {
+      alert('logout success');
+    }, function (failReason) {
+      alert(failReason);
+    });
+  }
+}

+ 104 - 0
miaomiao/plugins/cordova-plugin-weibosdk/package.json

xqd
@@ -0,0 +1,104 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "cordova-plugin-weibosdk",
+        "scope": null,
+        "escapedName": "cordova-plugin-weibosdk",
+        "name": "cordova-plugin-weibosdk",
+        "rawSpec": "",
+        "spec": "latest",
+        "type": "tag"
+      },
+      "D:\\my\\miao\\miaomiao\\node_modules"
+    ]
+  ],
+  "_from": "cordova-plugin-weibosdk@latest",
+  "_id": "cordova-plugin-weibosdk@0.6.0",
+  "_inCache": true,
+  "_location": "/cordova-plugin-weibosdk",
+  "_nodeVersion": "6.11.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/cordova-plugin-weibosdk-0.6.0.tgz_1501734562893_0.7814945403952152"
+  },
+  "_npmUser": {
+    "name": "vanpan",
+    "email": "fan543119@gmail.com"
+  },
+  "_npmVersion": "3.10.10",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "cordova-plugin-weibosdk",
+    "scope": null,
+    "escapedName": "cordova-plugin-weibosdk",
+    "name": "cordova-plugin-weibosdk",
+    "rawSpec": "",
+    "spec": "latest",
+    "type": "tag"
+  },
+  "_requiredBy": [
+    "#USER",
+    "/"
+  ],
+  "_resolved": "https://registry.npmjs.org/cordova-plugin-weibosdk/-/cordova-plugin-weibosdk-0.6.0.tgz",
+  "_shasum": "fd5f85fea174a23ae931017c2dc9725343b027e8",
+  "_shrinkwrap": null,
+  "_spec": "cordova-plugin-weibosdk",
+  "_where": "D:\\my\\miao\\miaomiao\\node_modules",
+  "author": {
+    "name": "https://github.com/iVanPan"
+  },
+  "bugs": {
+    "url": "https://github.com/iVanPan/cordova_weibo/issues"
+  },
+  "cordova": {
+    "id": "cordova-plugin-weibosdk",
+    "platforms": [
+      "android",
+      "ios"
+    ]
+  },
+  "dependencies": {},
+  "description": "codrova/phonegap wrapper for weibo sdk",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "shasum": "fd5f85fea174a23ae931017c2dc9725343b027e8",
+    "tarball": "https://registry.npmjs.org/cordova-plugin-weibosdk/-/cordova-plugin-weibosdk-0.6.0.tgz"
+  },
+  "gitHead": "94f39de4bccf2e305e515cbd544b7a7621276362",
+  "homepage": "https://github.com/iVanPan/cordova_weibo",
+  "keywords": [
+    "ecosystem:cordova",
+    "cordova-android",
+    "cordova-ios",
+    "cordova",
+    "phonegap",
+    "plugin",
+    "weibosdk",
+    "weibo",
+    "sina",
+    "login",
+    "share"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "vanpan",
+      "email": "fan543119@gmail.com"
+    }
+  ],
+  "name": "cordova-plugin-weibosdk",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/iVanPan/cordova_weibo.git"
+  },
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "version": "0.6.0"
+}

+ 126 - 0
miaomiao/plugins/cordova-plugin-weibosdk/plugin.xml

xqd
@@ -0,0 +1,126 @@
+<?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-weibosdk"
+  version="0.6.0">
+
+  <name>WeiboSDK</name>
+  <description>A Cordova wrapper around the Sina WeiboSDK for Android and iOS. Provides access to ssoLogin, WeiboShating etc</description>
+  <license>MIT</license>
+  <keywords>Cordova,Weibo</keywords>
+  <repo>https://github.com/iVanPan/cordova_weibo.git</repo>
+  <issue>https://github.com/iVanPan/cordova_weibo/issues</issue>
+
+  <preference name="WEIBO_APP_ID" />
+  <!--require cordova version -->
+  <engines>
+    <engine name="cordova" version=">=3.5.0" />
+    <engine name="cordova-android" version=">=4.0.0" />
+    <engine name="cordova-ios" version=">=4.0.0" />
+  </engines>
+
+  <!-- js module-->
+  <js-module src="www/weibo.js" name="WeiboSDK">
+    <clobbers target="WeiboSDK" />
+  </js-module>
+
+  <!-- ios -->
+  <platform name="ios">
+    <config-file target="config.xml" parent="/*">
+      <feature name="WeiboSDK">
+        <param name="ios-package" value="CDVWeiboSDK"/>
+      </feature>
+     <access origin="http://*.weibo.cn" minimum-tls-version='TLSv1.0' requires-forward-secrecy='false'/>
+     <access origin="http://*.sina.cn" minimum-tls-version='TLSv1.0' requires-forward-secrecy='false'/>
+     <access origin="http://*.sinaimg.cn" minimum-tls-version='TLSv1.0' requires-forward-secrecy='false'/>
+     <access origin="http://*.weibo.com" minimum-tls-version='TLSv1.0' requires-forward-secrecy='false'/>
+     <access origin="http://*.sinajs.cn" minimum-tls-version='TLSv1.0' requires-forward-secrecy='false'/>
+     <access origin="http://*.sina.com.cn" minimum-tls-version='TLSv1.0' requires-forward-secrecy='false'/>
+     <preference name="WEIBO_APP_ID" value="$WEIBO_APP_ID"/>
+   </config-file>
+   <!--set ios URLTypes for Weibo -->
+   <config-file platform="ios" target="*-Info.plist" parent="CFBundleURLTypes">
+    <array>
+      <dict>
+        <key>CFBundleTypeRole</key>
+        <string>Editor</string>
+        <key>CFBundleURLName</key>
+        <string>$PACKAGE_NAME</string>
+        <key>CFBundleURLSchemes</key>
+        <array>
+          <string>wb$WEIBO_APP_ID</string>
+        </array>
+      </dict>
+    </array>
+  </config-file>
+  <!--scheme query whitlist-->
+  <config-file platform="ios" target="*-Info.plist" parent="LSApplicationQueriesSchemes">
+      <array>
+		    <string>sinaweibohd</string>
+		    <string>sinaweibo</string>
+		    <string>weibosdk</string>
+		    <string>weibosdk2.5</string>
+      </array>
+  </config-file>
+  <header-file src="src/ios/CDVWeiboSDK.h"/>
+  <source-file src="src/ios/CDVWeiboSDK.m"/>
+  <!-- Weibo sdk version 3.2.0 https://github.com/sinaweibosdk/weibo_ios_sdk -->
+  <header-file src="src/ios/libWeiboSDK/WBHttpRequest.h" />
+  <header-file src="src/ios/libWeiboSDK/WBHttpRequest+WeiboToken.h" />
+  <header-file src="src/ios/libWeiboSDK/WeiboSDK.h" />
+  <header-file src="src/ios/libWeiboSDK/WeiboSDK+Statistics.h" />
+  <source-file src="src/ios/libWeiboSDK/libWeiboSDK.a" framework="true"  compiler-flags="-objc"/>
+  <resource-file src="src/ios/libWeiboSDK/WeiboSDK.bundle" />
+
+  <!--required frameworks for weibo sdk-->
+  <framework src="QuartzCore.framework" />
+  <framework src="ImageIO.framework" />
+  <framework src="SystemConfiguration.framework" />
+  <framework src="Security.framework" />
+  <framework src="CoreTelephony.framework" />
+  <framework src="CoreText.framework" />
+  <framework src="Foundation.framework" />
+  <framework src="CoreGraphics.framework" />
+  <framework src="libz.tbd" />
+  <framework src="libsqlite3.tbd" />
+  <info>
+    1.安装完这个插件,请用 Xcode 打开工程,查看 URL Types 里面 Weibo 的 URL Type 有没有,如果没有请手动添加。
+    
+    1.after installing this plugin,check the URL Types in your Xcode project.If you don't find URL Types for weibosdk,manually add it.
+  </info>
+</platform>
+<!-- android -->
+<platform name="android">
+  <config-file target="res/xml/config.xml" parent="/*">
+    <feature name="WeiboSDK" >
+      <param name="android-package" value="me.vanpan.weibosdk.WeiboSDKPlugin"/>
+    </feature>
+    <access origin="https://open.weibo.cn/*" />
+    <access origin="https://login.sina.com.cn/*" />
+    <access origin="https://passport.weibo.cn/*"/>
+    <access origin="http://*.sinaimg.cn/*"/>
+    <access origin="https://api.weibo.com/*"/>
+    <preference name="WEIBO_APP_ID" value="$WEIBO_APP_ID"/>
+  </config-file>
+  <!-- android  uses-permission for weibo sdk-->
+  <config-file target="AndroidManifest.xml" parent="/manifest">
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+  </config-file>
+
+  <source-file src="src/android/WeiboSDKPlugin.java" target-dir="src/me/vanpan/weibosdk" />
+  <!-- android weibo sdk version 4.0.0(2.0.6)  https://github.com/sinaweibosdk/weibo_android_sdk-->
+  <source-file src="src/android/libs/so/arm64-v8a/libweibosdkcore.so" target-dir="libs/arm64-v8a/"/>
+  <source-file src="src/android/libs/so/armeabi/libweibosdkcore.so" target-dir="libs/armeabi/"/>
+  <source-file src="src/android/libs/so/armeabi-v7a/libweibosdkcore.so" target-dir="libs/armeabi-v7a/"/>
+  <source-file src="src/android/libs/so/mips/libweibosdkcore.so" target-dir="libs/mips/"/>
+  <source-file src="src/android/libs/so/mips64/libweibosdkcore.so" target-dir="libs/mips64/"/>
+  <source-file src="src/android/libs/so/x86/libweibosdkcore.so" target-dir="libs/x86/"/>
+  <source-file src="src/android/libs/so/x86_64/libweibosdkcore.so" target-dir="libs/x86_64/"/>
+  <source-file src="src/android/libs/openDefault-2.0.6.aar" target-dir="libs/" />
+  <framework src="src/android/libs/WeiboSDKPlugin.gradle" custom="true" type="gradleReference" />
+</platform>
+</plugin>

+ 457 - 0
miaomiao/plugins/cordova-plugin-weibosdk/src/android/WeiboSDKPlugin.java

xqd
@@ -0,0 +1,457 @@
+package me.vanpan.weibosdk;
+
+import android.content.Intent;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.util.Base64;
+import android.webkit.URLUtil;
+
+import com.sina.weibo.sdk.WbSdk;
+import com.sina.weibo.sdk.WeiboAppManager;
+import com.sina.weibo.sdk.api.ImageObject;
+import com.sina.weibo.sdk.api.TextObject;
+import com.sina.weibo.sdk.api.WeiboMultiMessage;
+import com.sina.weibo.sdk.auth.AccessTokenKeeper;
+import com.sina.weibo.sdk.auth.AuthInfo;
+import com.sina.weibo.sdk.auth.Oauth2AccessToken;
+import com.sina.weibo.sdk.auth.WbAppInfo;
+import com.sina.weibo.sdk.auth.WbConnectErrorMessage;
+import com.sina.weibo.sdk.auth.sso.SsoHandler;
+import com.sina.weibo.sdk.share.WbShareCallback;
+import com.sina.weibo.sdk.share.WbShareHandler;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import org.apache.cordova.CallbackContext;
+import org.apache.cordova.CordovaArgs;
+import org.apache.cordova.CordovaPlugin;
+import org.apache.cordova.PluginResult;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+public class WeiboSDKPlugin extends CordovaPlugin implements WbShareCallback {
+
+    private static final String SCOPE = "email,direct_messages_read,direct_messages_write,"
+            + "friendships_groups_read,friendships_groups_write,statuses_to_me_read,"
+            + "follow_app_official_microblog," + "invitation_write";
+    private static final String WEBIO_APP_ID = "weibo_app_id";
+    private static final String WEBIO_REDIRECT_URL = "redirecturi";
+    private static final String DEFAULT_URL = "https://api.weibo.com/oauth2/default.html";
+    private static final String CANCEL_BY_USER = "cancel by user";
+    private static final String WEIBO_EXCEPTION = "weibo exception";
+    private static final String PARAM_ERROR = "param error";
+    private static final String ONLY_GET_CODE = "only get code";
+    private static final String SHARE_FAIL ="sharefail";
+    private static final String WEIBO_CLIENT_NOT_INSTALLED = "weibo client is not installed";
+    public static CallbackContext currentCallbackContext;
+    public static String APP_KEY;
+    public static WbShareHandler shareHandler = null;
+    private Oauth2AccessToken mAccessToken;
+    private String REDIRECT_URL;
+    private SsoHandler mSsoHandler;
+
+    @Override
+    protected void pluginInitialize() {
+        super.pluginInitialize();
+        APP_KEY = webView.getPreferences().getString(WEBIO_APP_ID, "");
+        REDIRECT_URL = webView.getPreferences().getString(WEBIO_REDIRECT_URL, DEFAULT_URL);
+        WbSdk.install(WeiboSDKPlugin.this.cordova.getActivity(),new AuthInfo(WeiboSDKPlugin.this.cordova.getActivity(), APP_KEY, REDIRECT_URL, SCOPE));
+    }
+
+    @Override
+    public boolean execute(String action, final CordovaArgs args,
+                           final CallbackContext callbackContext) throws JSONException {
+        if (action.equalsIgnoreCase("ssoLogin")) {
+            return ssoLogin(callbackContext);
+        } else if (action.equalsIgnoreCase("logout")) {
+            return logout(callbackContext);
+        } else if (action.equalsIgnoreCase("shareToWeibo")) {
+            return shareToWeibo(callbackContext, args);
+        } else if (action.equalsIgnoreCase("checkClientInstalled")) {
+            return checkClientInstalled(callbackContext);
+        } else if (action.equalsIgnoreCase("shareImageToWeibo")) {
+            return shareImageToWeibo(callbackContext,args);
+        } else if (action.equalsIgnoreCase("shareTextToWeibo")) {
+            return shareTextToWeibo(callbackContext,args);
+        }
+        return super.execute(action, args, callbackContext);
+    }
+
+    /**
+     * weibo sso 登录
+     *
+     * @param callbackContext
+     * @return
+     */
+    private boolean ssoLogin(CallbackContext callbackContext) {
+        currentCallbackContext = callbackContext;
+        mSsoHandler = new SsoHandler(WeiboSDKPlugin.this.cordova.getActivity());
+        Runnable runnable = new Runnable() {
+            public void run() {
+                if (mSsoHandler != null) {
+                    mSsoHandler.authorize(new SelfWbAuthListener());
+                }
+            }
+        };
+        this.cordova.setActivityResultCallback(this);
+        this.cordova.getActivity().runOnUiThread(runnable);
+        return true;
+    }
+
+    /**
+     * 检查微博客户端是否安装
+     *
+     * @param callbackContext
+     * @return
+     */
+    private boolean checkClientInstalled(CallbackContext callbackContext) {
+        WbAppInfo wbAppInfo = WeiboAppManager.getInstance(WeiboSDKPlugin.this.cordova.getActivity()).getWbAppInfo();
+        Boolean installed = (wbAppInfo != null && wbAppInfo.isLegal());
+        if (installed) {
+            callbackContext.success();
+        } else {
+            callbackContext.error(WEIBO_CLIENT_NOT_INSTALLED);
+        }
+        return true;
+    }
+
+    /**
+     * 微博登出
+     *
+     * @param callbackContext
+     * @return
+     */
+    private boolean logout(CallbackContext callbackContext) {
+        AccessTokenKeeper.clear(this.cordova.getActivity());
+        mAccessToken = new Oauth2AccessToken();
+        callbackContext.success();
+        return true;
+    }
+
+    /**
+     * 微博分享网页
+     *
+     * @param callbackContext
+     * @param args
+     * @return
+     */
+    private boolean shareToWeibo(final CallbackContext callbackContext,
+                                 final CordovaArgs args) {
+        currentCallbackContext = callbackContext;
+        if (shareHandler == null) {
+            shareHandler = new WbShareHandler(WeiboSDKPlugin.this.cordova.getActivity());
+        }
+        shareHandler.registerApp();
+        cordova.getThreadPool().execute(new Runnable() {
+
+            @Override
+            public void run() {
+                sendMultiMessage(callbackContext,args);
+            }
+        });
+        return true;
+    }
+
+    /**
+     * 微博图片分享
+     * @param callbackContext
+     * @param args
+     * @return
+     */
+    private boolean shareImageToWeibo(final CallbackContext callbackContext,
+        final CordovaArgs args) {
+        currentCallbackContext = callbackContext;
+        if (shareHandler == null) {
+            shareHandler = new WbShareHandler(WeiboSDKPlugin.this.cordova.getActivity());
+        }
+        shareHandler.registerApp();
+        cordova.getThreadPool().execute(new Runnable() {
+
+            @Override
+            public void run() {
+                sendImageMessage(callbackContext,args);
+            }
+        });
+        return true;
+    }
+
+    /**
+     * 分享文字到微博
+     * @param callbackContext
+     * @param args
+     * @return
+     */
+    private boolean shareTextToWeibo(final CallbackContext callbackContext,
+        final CordovaArgs args) {
+        currentCallbackContext = callbackContext;
+        if (shareHandler == null) {
+            shareHandler = new WbShareHandler(WeiboSDKPlugin.this.cordova.getActivity());
+        }
+        shareHandler.registerApp();
+        cordova.getThreadPool().execute(new Runnable() {
+
+            @Override
+            public void run() {
+                sendTextMessage(callbackContext,args);
+            }
+        });
+        return true;
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
+        super.onActivityResult(requestCode, resultCode, intent);
+        if (mSsoHandler != null) {
+            mSsoHandler.authorizeCallBack(requestCode, resultCode, intent);
+        }
+    }
+
+    /**
+     * 第三方应用发送请求消息到微博,唤起微博分享界面。
+     */
+    private void sendMultiMessage(final CallbackContext callbackContext, CordovaArgs args) {
+        // 1. 初始化微博的分享消息
+        WeiboMultiMessage weiboMessage = new WeiboMultiMessage();
+        final JSONObject data;
+        try {
+            data = args.getJSONObject(0);
+            String title = data.has("title")?  data.getString("title"): "";
+            String url = data.has("url")?  data.getString("url"): "";
+            String description = data.has("description")?  data.getString("description"): "";
+            String image = data.has("image")?  data.getString("image"): "";
+            Bitmap imageData = processImage(image);
+            //WebpageObject mediaObject = new WebpageObject();
+            //mediaObject.identify = Utility.generateGUID();
+            //mediaObject.title = title;
+            //mediaObject.description = description;
+            //mediaObject.actionUrl = url;
+            if (imageData != null) {
+                //注意:最终压缩过的缩略图大小不得超过 32kb。
+                ImageObject imageObject = new ImageObject();
+                imageObject.setImageObject(imageData);
+                weiboMessage.imageObject = imageObject;
+               // mediaObject.setThumbImage(imageData);
+            }
+           // weiboMessage.mediaObject = mediaObject;
+            TextObject textObject = new TextObject();
+            textObject.text = description + " " + url;
+            textObject.title = title;
+            weiboMessage.textObject = textObject;
+            shareHandler.shareMessage(weiboMessage, false);
+        } catch (JSONException e) {
+            WeiboSDKPlugin.this.webView.sendPluginResult(new PluginResult(
+                    PluginResult.Status.ERROR, PARAM_ERROR),
+                callbackContext.getCallbackId());
+        }
+    }
+
+    /**
+     * 组装图片分享消息
+     * @param callbackContext
+     * @param args
+     */
+    private void sendImageMessage(final CallbackContext callbackContext, CordovaArgs args) {
+        WeiboMultiMessage weiboMessage = new WeiboMultiMessage();
+        final JSONObject data;
+        try {
+            data = args.getJSONObject(0);
+            String image = data.has("image")?  data.getString("image"): "";
+            Bitmap imageData = processImage(image);
+            if (imageData != null) {
+                //注意:最终压缩过的缩略图大小不得超过 32kb。
+                ImageObject imageObject = new ImageObject();
+                imageObject.setImageObject(imageData);
+                weiboMessage.imageObject = imageObject;
+            }
+            shareHandler.shareMessage(weiboMessage, false);
+        } catch (JSONException e) {
+            WeiboSDKPlugin.this.webView.sendPluginResult(new PluginResult(
+                    PluginResult.Status.ERROR, PARAM_ERROR),
+                callbackContext.getCallbackId());
+        }
+    }
+
+    /**
+     * 组装微博文字分享消息
+     * @param callbackContext
+     * @param args
+     */
+    private void sendTextMessage(final CallbackContext callbackContext, CordovaArgs args) {
+        // 1. 初始化微博的分享消息
+        WeiboMultiMessage weiboMessage = new WeiboMultiMessage();
+        final JSONObject data;
+        try {
+            data = args.getJSONObject(0);
+            String text = data.has("text")?  data.getString("text"): "";
+            TextObject textObject = new TextObject();
+            textObject.text = text;
+            weiboMessage.textObject = textObject;
+            shareHandler.shareMessage(weiboMessage, false);
+        } catch (JSONException e) {
+            WeiboSDKPlugin.this.webView.sendPluginResult(new PluginResult(
+                    PluginResult.Status.ERROR, PARAM_ERROR),
+                callbackContext.getCallbackId());
+        }
+    }
+    /**
+     * 组装JSON
+     *
+     * @param access_token
+     * @param userId
+     * @param expires_time
+     * @return
+     */
+    private JSONObject makeJson(String access_token, String userId, long expires_time) {
+        String json = "{\"access_token\": \"" + access_token + "\", " +
+            " \"userId\": \"" + userId
+            + "\", " +
+            " \"expires_time\": \"" + String.valueOf(expires_time) + "\"" +
+            "}";
+        JSONObject jo = null;
+        try {
+            jo = new JSONObject(json);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+        return jo;
+    }
+    /**
+     * 处理图片
+     * @param image
+     * @return
+     */
+    private Bitmap processImage(String image) {
+        if(URLUtil.isHttpUrl(image) || URLUtil.isHttpsUrl(image)) {
+            return getBitmapFromURL(image);
+        } else if (isBase64(image)) {
+            return decodeBase64ToBitmap(image);
+        } else {
+            return getBitmapByPath(image);
+        }
+    }
+
+    /**
+     * 检查图片字符串是不是Base64
+     * @param image
+     * @return
+     */
+    private boolean isBase64(String image) {
+        try {
+            byte[] decodedString = Base64.decode(image, Base64.DEFAULT);
+            Bitmap bitmap = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
+            if (bitmap == null) {
+                return false;
+            }
+            return true;
+        } catch (Exception e) {
+            return false;
+        }
+    }
+
+    /**
+     * 将图片的 URL 转化为 Bitmap
+     * @param src
+     * @return
+     */
+    public static Bitmap getBitmapFromURL(String src) {
+        try {
+            URL url = new URL(src);
+            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+            connection.setDoInput(true);
+            connection.connect();
+            InputStream input = connection.getInputStream();
+            Bitmap bitmap = BitmapFactory.decodeStream(input);
+            return bitmap;
+        } catch (IOException e) {
+            return null;
+        }
+    }
+
+    /**
+     * 根据文件路径生成 Bitmap
+     * @param path
+     * @return
+     */
+    public static Bitmap getBitmapByPath(String path) {
+        if (path == null)
+            return null;
+        try {
+            Bitmap bitmap = BitmapFactory.decodeFile(path);
+            return bitmap;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return null;
+        } catch (Error e) {
+            e.printStackTrace();
+            return null;
+        }
+    }
+
+    /**
+     * 将Base64解码成Bitmap
+     */
+
+    private Bitmap decodeBase64ToBitmap(String Base64String) {
+        byte[] decode = Base64.decode(Base64String, Base64.DEFAULT);
+        Bitmap bitmap = BitmapFactory.decodeByteArray(decode, 0, decode.length);
+        return bitmap;
+    }
+
+    @Override public void onWbShareSuccess() {
+        WeiboSDKPlugin.currentCallbackContext.success();
+    }
+
+    @Override public void onWbShareCancel() {
+        WeiboSDKPlugin.currentCallbackContext.error(CANCEL_BY_USER);
+    }
+
+    @Override public void onWbShareFail() {
+        WeiboSDKPlugin.currentCallbackContext.error(SHARE_FAIL);
+    }
+
+    @Override
+    public void onNewIntent(Intent intent) {
+        super.onNewIntent(intent);
+        WeiboSDKPlugin.shareHandler.doResultIntent(intent,this);
+    }
+
+    private class SelfWbAuthListener implements com.sina.weibo.sdk.auth.WbAuthListener{
+        @Override
+        public void onSuccess(final Oauth2AccessToken token) {
+            mAccessToken = token;
+            if (mAccessToken.isSessionValid()) {
+                AccessTokenKeeper.writeAccessToken(
+                    WeiboSDKPlugin.this.cordova.getActivity(), mAccessToken);
+                JSONObject jo = makeJson(mAccessToken.getToken(),
+                    mAccessToken.getUid(),mAccessToken.getExpiresTime());
+                WeiboSDKPlugin.this.webView.sendPluginResult(new PluginResult(
+                    PluginResult.Status.OK, jo), currentCallbackContext.getCallbackId());
+            } else {
+                // 以下几种情况,您会收到 Code:
+                // 1. 当您未在平台上注册的应用程序的包名与签名时;
+                // 2. 当您注册的应用程序包名与签名不正确时;
+                // 3. 当您在平台上注册的包名和签名与您当前测试的应用的包名和签名不匹配时。
+                // String code = values.getString("code");
+                WeiboSDKPlugin.this.webView.sendPluginResult(new PluginResult(
+                        PluginResult.Status.ERROR, ONLY_GET_CODE),
+                    currentCallbackContext.getCallbackId());
+            }
+        }
+
+        @Override
+        public void cancel() {
+            WeiboSDKPlugin.this.webView.sendPluginResult(new PluginResult(
+                    PluginResult.Status.ERROR, CANCEL_BY_USER),
+                currentCallbackContext.getCallbackId());
+        }
+
+        @Override
+        public void onFailure(WbConnectErrorMessage errorMessage) {
+            WeiboSDKPlugin.this.webView.sendPluginResult(new PluginResult(
+                    PluginResult.Status.ERROR, WEIBO_EXCEPTION),
+                currentCallbackContext.getCallbackId());
+        }
+    }
+}

+ 10 - 0
miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/WeiboSDKPlugin.gradle

xqd
@@ -0,0 +1,10 @@
+
+repositories{
+    flatDir {
+        dirs 'libs'
+    }
+}
+
+dependencies {
+    compile(name: 'openDefault-2.0.6', ext: 'aar')
+}

BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/openDefault-2.0.6.aar


BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/arm64-v8a/libweibosdkcore.so


BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/armeabi-v7a/libweibosdkcore.so


BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/armeabi/libweibosdkcore.so


BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/mips/libweibosdkcore.so


BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/mips64/libweibosdkcore.so


BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/x86/libweibosdkcore.so


BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/android/libs/so/x86_64/libweibosdkcore.so


+ 22 - 0
miaomiao/plugins/cordova-plugin-weibosdk/src/ios/CDVWeiboSDK.h

xqd
@@ -0,0 +1,22 @@
+#import <Cordova/CDVPlugin.h>
+#import "WeiboSDK.h"
+
+@interface CDVWeiboSDK : CDVPlugin <WeiboSDKDelegate, WBHttpRequestDelegate>
+
+@property (nonatomic, copy) NSString *callbackId;
+@property (nonatomic, copy) NSString *redirectURI;
+@property (nonatomic, copy) NSString *weiboAppId;
+
+- (void)ssoLogin:(CDVInvokedUrlCommand *)command;
+
+- (void)logout:(CDVInvokedUrlCommand *)command;
+
+- (void)shareToWeibo:(CDVInvokedUrlCommand *)command;
+
+- (void)checkClientInstalled:(CDVInvokedUrlCommand *)command;
+
+- (void)shareImageToWeibo:(CDVInvokedUrlCommand *)command;
+
+- (void)shareTextToWeibo:(CDVInvokedUrlCommand *)command;
+
+@end

+ 314 - 0
miaomiao/plugins/cordova-plugin-weibosdk/src/ios/CDVWeiboSDK.m

xqd
@@ -0,0 +1,314 @@
+#import "CDVWeiboSDK.h"
+
+NSString *WEBIO_APP_ID = @"weibo_app_id";
+NSString *WEBIO_REDIRECT_URI = @"redirecturi";
+NSString *WEBIO_DEFUALT_REDIRECT_URI = @"https://api.weibo.com/oauth2/default.html";
+NSString *WEIBO_CANCEL_BY_USER = @"cancel by user";
+NSString *WEIBO_SHARE_INSDK_FAIL = @"share in sdk failed";
+NSString *WEIBO_SEND_FAIL = @"send failed";
+NSString *WEIBO_UNSPPORTTED = @"Weibo unspport";
+NSString *WEIBO_AUTH_ERROR = @"Weibo auth error";
+NSString *WEIBO_UNKNOW_ERROR = @"Weibo unknow error";
+NSString *WEIBO_TOKEN_EMPTY = @"Weibo token is empty";
+NSString *WEIBO_USER_CANCEL_INSTALL = @"user cancel install weibo";
+
+@implementation CDVWeiboSDK
+/**
+ *  插件初始化主要用于appkey的注册
+ */
+- (void)pluginInitialize {
+    NSString *weiboAppId = [[self.commandDelegate settings] objectForKey:WEBIO_APP_ID];
+    self.weiboAppId = weiboAppId;
+    [WeiboSDK registerApp:weiboAppId];
+    NSString *redirectURI = [[self.commandDelegate settings] objectForKey:WEBIO_REDIRECT_URI];
+    if (nil == redirectURI) {
+        self.redirectURI = WEBIO_DEFUALT_REDIRECT_URI;
+    } else {
+        self.redirectURI = redirectURI;
+    }
+}
+/**
+ *  检查微博官方客户端是否安装
+ *
+ *  @param command CDVInvokedUrlCommand
+ */
+- (void)checkClientInstalled:(CDVInvokedUrlCommand *)command {
+    if ([WeiboSDK isWeiboAppInstalled]) {
+        CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+        [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
+    } else {
+        CDVPluginResult *result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
+        [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
+    }
+}
+
+/**
+ *  微博单点登录
+ *
+ *  @param command CDVInvokedUrlCommand
+ */
+- (void)ssoLogin:(CDVInvokedUrlCommand *)command {
+    self.callbackId = command.callbackId;
+    WBAuthorizeRequest *request = [WBAuthorizeRequest request];
+    request.redirectURI = self.redirectURI;
+    request.scope = @"all";
+    request.userInfo = @{ @"SSO_From" : @"CDVWeiboSDK",
+                          @"Other_Info_1" : [NSNumber numberWithInt:123],
+                          @"Other_Info_2" : @[ @"obj1", @"obj2" ],
+                          @"Other_Info_3" : @{@"key1" : @"obj1", @"key2" : @"obj2"} };
+    [WeiboSDK sendRequest:request];
+}
+
+/**
+ *  微博登出
+ *
+ *  @param command CDVInvokedUrlCommand
+ */
+- (void)logout:(CDVInvokedUrlCommand *)command {
+    NSUserDefaults *saveDefaults = [NSUserDefaults standardUserDefaults];
+    NSString *token = [saveDefaults objectForKey:@"access_token"];
+    [saveDefaults removeObjectForKey:@"userId"];
+    [saveDefaults removeObjectForKey:@"access_token"];
+    [saveDefaults removeObjectForKey:@"expires_time"];
+    [saveDefaults synchronize];
+    if (token) {
+        [WeiboSDK logOutWithToken:token delegate:self withTag:nil];
+        self.callbackId = command.callbackId;
+    } else {
+        CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_TOKEN_EMPTY];
+        [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+    }
+}
+
+/**
+ *  分享网页到微博
+ *
+ *  @param command CDVInvokedUrlCommand
+ */
+ - (void)shareToWeibo:(CDVInvokedUrlCommand *)command {
+     self.callbackId = command.callbackId;
+     WBAuthorizeRequest *authRequest = [WBAuthorizeRequest request];
+     authRequest.redirectURI = self.redirectURI;
+     authRequest.scope = @"all";
+     NSDictionary *params = [command.arguments objectAtIndex:0];
+     WBMessageObject *message = [WBMessageObject message];
+     WBWebpageObject *webpage = [WBWebpageObject object];
+     webpage.objectID = [NSString stringWithFormat:@"%f", [[NSDate date] timeIntervalSince1970]];
+     webpage.title = [self check:@"title" in:params];
+     webpage.description = [NSString stringWithFormat:[self check:@"description" in:params], [[NSDate date] timeIntervalSince1970]];
+     webpage.webpageUrl = [self check:@"url" in:params];
+     NSString *image = [self check:@"image" in:params];
+     NSData *imageData = [self processImage:image];
+     webpage.thumbnailData = imageData;
+     message.mediaObject = webpage;
+     NSUserDefaults *saveDefaults = [NSUserDefaults standardUserDefaults];
+     NSString *token = [saveDefaults objectForKey:@"access_token"];
+     WBSendMessageToWeiboRequest *request = [WBSendMessageToWeiboRequest requestWithMessage:message authInfo:authRequest access_token:token];
+     request.userInfo = @{ @"ShareMessageFrom" : @"CDVWeiboSDK",
+                           @"Other_Info_1" : [NSNumber numberWithInt:123],
+                           @"Other_Info_2" : @[ @"obj1", @"obj2" ],
+                           @"Other_Info_3" : @{@"key1" : @"obj1", @"key2" : @"obj2"} };
+     [WeiboSDK sendRequest:request];
+ }
+/**
+ *  分享图片到微博
+ *
+ *  @param command CDVInvokedUrlCommand
+ */
+- (void)shareImageToWeibo:(CDVInvokedUrlCommand *)command {
+    self.callbackId = command.callbackId;
+    WBAuthorizeRequest *authRequest = [WBAuthorizeRequest request];
+    authRequest.redirectURI = self.redirectURI;
+    authRequest.scope = @"all";
+    NSDictionary *params = [command.arguments objectAtIndex:0];
+    WBMessageObject *message = [WBMessageObject message];
+    WBImageObject *imageObject = [WBImageObject object];
+    NSString *image = [self check:@"image" in:params];
+    NSData *imageData = [self processImage:image];
+    imageObject.imageData = imageData;
+    message.imageObject = imageObject;
+    NSUserDefaults *saveDefaults = [NSUserDefaults standardUserDefaults];
+    NSString *token = [saveDefaults objectForKey:@"access_token"];
+    WBSendMessageToWeiboRequest *request = [WBSendMessageToWeiboRequest requestWithMessage:message authInfo:authRequest access_token:token];
+    request.userInfo = @{ @"ShareMessageFrom" : @"CDVWeiboSDK",
+                          @"Other_Info_1" : [NSNumber numberWithInt:123],
+                          @"Other_Info_2" : @[ @"obj1", @"obj2" ],
+                          @"Other_Info_3" : @{@"key1" : @"obj1", @"key2" : @"obj2"} };
+    [WeiboSDK sendRequest:request];
+}
+/**
+ *  分享文字到微博
+ *
+ *  @param command CDVInvokedUrlCommand
+ */
+- (void)shareTextToWeibo:(CDVInvokedUrlCommand *)command {
+    self.callbackId = command.callbackId;
+    WBAuthorizeRequest *authRequest = [WBAuthorizeRequest request];
+    authRequest.redirectURI = self.redirectURI;
+    authRequest.scope = @"all";
+    NSDictionary *params = [command.arguments objectAtIndex:0];
+    WBMessageObject *message = [WBMessageObject message];
+    NSString *text = [self check:@"text" in:params];
+    message.text = text;
+    NSUserDefaults *saveDefaults = [NSUserDefaults standardUserDefaults];
+    NSString *token = [saveDefaults objectForKey:@"access_token"];
+    WBSendMessageToWeiboRequest *request = [WBSendMessageToWeiboRequest requestWithMessage:message authInfo:authRequest access_token:token];
+    request.userInfo = @{ @"ShareMessageFrom" : @"CDVWeiboSDK",
+                          @"Other_Info_1" : [NSNumber numberWithInt:123],
+                          @"Other_Info_2" : @[ @"obj1", @"obj2" ],
+                          @"Other_Info_3" : @{@"key1" : @"obj1", @"key2" : @"obj2"} };
+    [WeiboSDK sendRequest:request];
+}
+
+/**
+ *  处理URL
+ *
+ *  @param notification cordova传递的消息对象
+ */
+- (void)handleOpenURL:(NSNotification *)notification {
+    NSURL *url = [notification object];
+    if ([url isKindOfClass:[NSURL class]] && [url.absoluteString hasPrefix:[@"wb" stringByAppendingString:self.weiboAppId]]) {
+        [WeiboSDK handleOpenURL:url delegate:self];
+    }
+}
+
+#pragma mark - WeiboSDKDelegate
+- (void)didReceiveWeiboResponse:(WBBaseResponse *)response {
+    if ([response isKindOfClass:WBSendMessageToWeiboResponse.class]) {
+        if (response.statusCode == WeiboSDKResponseStatusCodeSuccess) {
+            WBSendMessageToWeiboResponse *sendMessageToWeiboResponse = (WBSendMessageToWeiboResponse *)response;
+            NSString *accessToken = [sendMessageToWeiboResponse.authResponse accessToken];
+            NSString *userId = [sendMessageToWeiboResponse.authResponse userID];
+            NSString *expirationTime = [NSString stringWithFormat:@"%f", [sendMessageToWeiboResponse.authResponse.expirationDate timeIntervalSince1970] * 1000];
+            if (accessToken && userId && expirationTime) {
+                NSUserDefaults *saveDefaults = [NSUserDefaults standardUserDefaults];
+                [saveDefaults setValue:accessToken forKey:@"access_token"];
+                [saveDefaults setValue:userId forKey:@"userId"];
+                [saveDefaults setValue:expirationTime forKey:@"expires_time"];
+                [saveDefaults synchronize];
+            }
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeUserCancel) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_CANCEL_BY_USER];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeSentFail) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_SEND_FAIL];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeShareInSDKFailed) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_SHARE_INSDK_FAIL];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeUnsupport) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_UNSPPORTTED];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeUnknown) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_UNKNOW_ERROR];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeAuthDeny) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_AUTH_ERROR];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeUserCancelInstall) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_USER_CANCEL_INSTALL];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        }
+    } else if ([response isKindOfClass:WBAuthorizeResponse.class]) {
+        if (response.statusCode == WeiboSDKResponseStatusCodeSuccess) {
+            NSMutableDictionary *Dic = [NSMutableDictionary dictionaryWithCapacity:2];
+            [Dic setObject:[(WBAuthorizeResponse *)response userID] forKey:@"userId"];
+            [Dic setObject:[(WBAuthorizeResponse *)response accessToken] forKey:@"access_token"];
+            [Dic setObject:[NSString stringWithFormat:@"%f", [(WBAuthorizeResponse *)response expirationDate].timeIntervalSince1970 * 1000] forKey:@"expires_time"];
+            NSUserDefaults *saveDefaults = [NSUserDefaults standardUserDefaults];
+            [saveDefaults setValue:[(WBAuthorizeResponse *)response userID] forKey:@"userId"];
+            [saveDefaults setValue:[(WBAuthorizeResponse *)response accessToken] forKey:@"access_token"];
+            [saveDefaults setValue:[NSString stringWithFormat:@"%f", [(WBAuthorizeResponse *)response expirationDate].timeIntervalSince1970 * 1000] forKey:@"expires_time"];
+            [saveDefaults synchronize];
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:Dic];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeUserCancel) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_CANCEL_BY_USER];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeSentFail) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_SEND_FAIL];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeShareInSDKFailed) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_SHARE_INSDK_FAIL];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeUnsupport) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_UNSPPORTTED];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeUnknown) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_UNKNOW_ERROR];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeAuthDeny) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_AUTH_ERROR];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        } else if (response.statusCode == WeiboSDKResponseStatusCodeUserCancelInstall) {
+            CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:WEIBO_USER_CANCEL_INSTALL];
+            [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+        }
+    }
+}
+
+- (void)didReceiveWeiboRequest:(WBBaseRequest *)request {
+}
+
+#pragma mark - WBHttpRequestDelegate
+
+- (void)request:(WBHttpRequest *)request didFinishLoadingWithResult:(NSString *)result {
+    CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+}
+
+- (void)request:(WBHttpRequest *)request didFailWithError:(NSError *)error {
+    CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
+    [self.commandDelegate sendPluginResult:pluginResult callbackId:self.callbackId];
+}
+/**
+ 图片处理
+
+ @param image 图片数据
+ @return 图片NSdata数据
+ */
+- (NSData *)processImage:(NSString *)image {
+    if ([self isBase64Data:image]) {
+        return [[NSData alloc] initWithBase64EncodedString:image options:0];
+    } else if ([image hasPrefix:@"http://"] || [image hasPrefix:@"https://"]) {
+        NSURL *url = [NSURL URLWithString:image];
+        return [NSData dataWithContentsOfURL:url];
+    } else {
+        return [NSData dataWithContentsOfFile:image];
+    }
+}
+
+/**
+ 检查图片是不是Base64
+
+ @param data 图片数据
+ @return 结果true or false
+ */
+- (BOOL)isBase64Data:(NSString *)data {
+    data = [[data componentsSeparatedByCharactersInSet:
+             [NSCharacterSet whitespaceAndNewlineCharacterSet]]
+            componentsJoinedByString:@""];
+    if ([data length] % 4 == 0) {
+        static NSCharacterSet *invertedBase64CharacterSet = nil;
+        if (invertedBase64CharacterSet == nil) {
+            invertedBase64CharacterSet = [[NSCharacterSet characterSetWithCharactersInString:@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="] invertedSet];
+        }
+        return [data rangeOfCharacterFromSet:invertedBase64CharacterSet options:NSLiteralSearch].location == NSNotFound;
+    }
+    return NO;
+}
+
+/**
+ 检查参数是否存在
+
+ @param param 要检查的参数
+ @param args 参数字典
+ @return 参数
+ */
+- (NSString *)check:(NSString *)param in:(NSDictionary *)args {
+    NSString *data = [args objectForKey:param];
+    return data?data:@"";
+}
+@end

+ 30 - 0
miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WBHttpRequest+WeiboToken.h

xqd
@@ -0,0 +1,30 @@
+//
+//  WBHttpRequest+WeiboToken.h
+//  WeiboSDK
+//
+//  Created by DannionQiu on 14/11/6.
+//  Copyright (c) 2014年 SINA iOS Team. All rights reserved.
+//
+
+#import "WBHttpRequest.h"
+
+@interface WBHttpRequest (WeiboToken)
+/*!
+ @method
+ 
+ @abstract
+ 使用RefreshToken去换取新的身份凭证AccessToken.
+ 
+ @discussion
+ 在SSO授权登录后,服务器会下发有效期为7天的refreshToken以及有效期为1天的AccessToken。
+ 当有效期为1天的AccessToken过期时,可以调用该接口带着refreshToken信息区换取新的AccessToken。
+ @param refreshToken        refreshToken
+ 
+ @param queue               指定发送请求的NSOperationQueue,如果这个参数为nil,则请求会发送在MainQueue( [NSOperationQueue mainQueue] )中。
+ 
+ @param handler             完成请求后会回调handler,处理完成请求后的逻辑。
+ */
++ (WBHttpRequest *)requestForRenewAccessTokenWithRefreshToken:(NSString*)refreshToken
+                                                        queue:(NSOperationQueue*)queue
+                                        withCompletionHandler:(WBRequestHandler)handler;
+@end

+ 184 - 0
miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WBHttpRequest.h

xqd
@@ -0,0 +1,184 @@
+//
+//  WBHttpRequest.h
+//  WeiboSDK
+//
+//  Created by DannionQiu on 14-9-18.
+//  Copyright (c) 2014年 SINA iOS Team. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+#pragma mark - WBHttpRequest and WBHttpRequestDelegate
+@class WBHttpRequest;
+
+/**
+ 接收并处理来自微博sdk对于网络请求接口的调用响应 以及logOutWithToken的请求
+ */
+@protocol WBHttpRequestDelegate <NSObject>
+
+/**
+ 收到一个来自微博Http请求的响应
+ 
+ @param response 具体的响应对象
+ */
+@optional
+- (void)request:(WBHttpRequest *)request didReceiveResponse:(NSURLResponse *)response;
+
+/**
+ 收到一个来自微博Http请求失败的响应
+ 
+ @param error 错误信息
+ */
+@optional
+- (void)request:(WBHttpRequest *)request didFailWithError:(NSError *)error;
+
+/**
+ 收到一个来自微博Http请求的网络返回
+ 
+ @param result 请求返回结果
+ */
+@optional
+- (void)request:(WBHttpRequest *)request didFinishLoadingWithResult:(NSString *)result;
+
+/**
+ 收到一个来自微博Http请求的网络返回
+ 
+ @param data 请求返回结果
+ */
+@optional
+- (void)request:(WBHttpRequest *)request didFinishLoadingWithDataResult:(NSData *)data;
+
+/**
+ 收到快速SSO授权的重定向
+ 
+ @param URI
+ */
+@optional
+- (void)request:(WBHttpRequest *)request didReciveRedirectResponseWithURI:(NSURL *)redirectUrl;
+
+@end
+
+
+/**
+ 微博封装Http请求的消息结构
+ 
+ */
+@interface WBHttpRequest : NSObject
+{
+    NSURLConnection                 *connection;
+    NSMutableData                   *responseData;
+}
+
+/**
+ 用户自定义请求地址URL
+ */
+@property (nonatomic, strong) NSString *url;
+
+/**
+ 用户自定义请求方式
+ 
+ 支持"GET" "POST"
+ */
+@property (nonatomic, strong) NSString *httpMethod;
+
+/**
+ 用户自定义请求参数字典
+ */
+@property (nonatomic, strong) NSDictionary *params;
+
+/**
+ WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
+ */
+@property (nonatomic, weak) id<WBHttpRequestDelegate> delegate;
+
+/**
+ 用户自定义TAG
+ 
+ 用于区分回调Request
+ */
+@property (nonatomic, strong) NSString* tag;
+
+/**
+ 统一HTTP请求接口
+ 调用此接口后,将发送一个HTTP网络请求
+ @param url 请求url地址
+ @param httpMethod  支持"GET" "POST"
+ @param params 向接口传递的参数结构
+ @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
+ @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回
+ */
++ (WBHttpRequest *)requestWithURL:(NSString *)url
+                       httpMethod:(NSString *)httpMethod
+                           params:(NSDictionary *)params
+                         delegate:(id<WBHttpRequestDelegate>)delegate
+                          withTag:(NSString *)tag;
+
+/**
+ 统一微博Open API HTTP请求接口
+ 调用此接口后,将发送一个HTTP网络请求(用于访问微博open api)
+ @param accessToken 应用获取到的accessToken,用于身份验证
+ @param url 请求url地址
+ @param httpMethod  支持"GET" "POST"
+ @param params 向接口传递的参数结构
+ @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
+ @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回
+ */
+
++ (WBHttpRequest *)requestWithAccessToken:(NSString *)accessToken
+                                      url:(NSString *)url
+                               httpMethod:(NSString *)httpMethod
+                                   params:(NSDictionary *)params
+                                 delegate:(id<WBHttpRequestDelegate>)delegate
+                                  withTag:(NSString *)tag;
+
+
+
+/**
+ 取消网络请求接口
+ 调用此接口后,将取消当前网络请求,建议同时[WBHttpRequest setDelegate:nil];
+ 注意:该方法只对使用delegate的request方法有效。无法取消任何使用block的request的网络请求接口。
+ */
+- (void)disconnect;
+
+#pragma mark - block extension
+
+typedef void (^WBRequestHandler)(WBHttpRequest *httpRequest,
+                                 id result,
+                                 NSError *error);
+
+/**
+ 统一微博Open API HTTP请求接口
+ 调用此接口后,将发送一个HTTP网络请求(用于访问微博open api)
+ @param url 请求url地址
+ @param httpMethod  支持"GET" "POST"
+ @param params 向接口传递的参数结构
+ @param queue 发起请求的NSOperationQueue对象,如queue为nil,则在主线程([NSOperationQueue mainQueue])发起请求。
+ @param handler 接口请求返回调用的block方法
+ */
++ (WBHttpRequest *)requestWithURL:(NSString *)url
+                       httpMethod:(NSString *)httpMethod
+                           params:(NSDictionary *)params
+                            queue:(NSOperationQueue*)queue
+            withCompletionHandler:(WBRequestHandler)handler;
+
+
+/**
+ 统一HTTP请求接口
+ 调用此接口后,将发送一个HTTP网络请求
+ @param url 请求url地址
+ @param httpMethod  支持"GET" "POST"
+ @param params 向接口传递的参数结构
+ @param queue 发起请求的NSOperationQueue对象,如queue为nil,则在主线程([NSOperationQueue mainQueue])发起请求。
+ @param handler 接口请求返回调用的block方法
+ */
+
++ (WBHttpRequest *)requestWithAccessToken:(NSString *)accessToken
+                                      url:(NSString *)url
+                               httpMethod:(NSString *)httpMethod
+                                   params:(NSDictionary *)params
+                                    queue:(NSOperationQueue*)queue
+                    withCompletionHandler:(WBRequestHandler)handler;
+
+
+@end

+ 89 - 0
miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK+Statistics.h

xqd
@@ -0,0 +1,89 @@
+//
+//  WeiboSDK+Statistics.h
+//  WeiboSDK
+//
+//  Created by DannionQiu on 15/4/13.
+//  Copyright (c) 2015年 SINA iOS Team. All rights reserved.
+//
+
+#import "WeiboSDK.h"
+
+@interface WeiboSDK(Statistics)
+
+/** 设置是否开启统计模式, 默认为NO.
+ @param value 为YES, SDK会开启统计功能,记录日志,并在合适的实际传上服务器。
+ @return void.
+ */
++ (void)setStatisticsEnabled:(BOOL)value;
+
+#pragma mark - Optional Configs Setting
+/** 设置是否打印SDK的log信息, 默认NO(不打印log).
+ @param value 设置为YES, WeiboSDK 会输出log信息可供调试参考. 除非特殊需要,否则发布产品时需改回NO.
+ @return void.
+ */
++ (void)setStatisticsLogEnabled:(BOOL)value;
+
+/** 设置版本信息.
+ @param version 版本号,为nil或@""时, 默认为Build号(CFBundleVersion)
+ @return void.
+ */
++ (void)setVersion:(NSString*)version;
+
+/** 设置渠道信息.
+ @param channelID 渠道名称, 为nil或@""时, 默认为@"AppStore"渠道
+ @return void.
+ */
++ (void)setChannelID:(NSString*)channelID;
+
+/** 设定日志上传的发送间隔
+ @param frequecy 单位为秒,最小30秒,最大8*60*60秒(8小时)。默认为180秒(3分钟)
+ @return void.
+ */
++ (void)setUploadFrequecy:(NSTimeInterval)frequecy;
+
+#pragma mark - Statistics Api
+/** 自动页面时长统计, 开始记录某个页面展示时长.
+ 使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。
+ 在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView:
+ @param pageName 统计的页面名称.
+ @return void.
+ */
++ (void)beginLogPageView:(NSString *)pageName;
+
+/** 自动页面时长统计, 结束记录某个页面展示时长.
+ 使用方法:必须配对调用beginLogPageView:和endLogPageView:两个函数来完成自动统计,若只调用某一个函数不会生成有效数据。
+ 在该页面展示时调用beginLogPageView:,当退出该页面时调用endLogPageView:
+ @param pageName 统计的页面名称.
+ @return void.
+ */
++ (void)endLogPageView:(NSString *)pageName;
+
+
+/** 自动事件时长统计, 开始记录某个事示时长.
+ 使用方法:调用event:函数来完成自动统计。
+ @param eventID 统计的事件标识符.
+ @warning eventID不能使用空格和特殊字符,且长度不能超过255个字符(否则将截取前255个字符)
+ */
++ (void)event:(NSString *)eventID;
+
+/** 自动事件时长统计, 开始记录某个事示时长.
+ 使用方法:调用event:函数来完成自动统计。
+ @param eventID 统计的事件标识符.
+ @param pageName 事件发生时所在页面.
+ @param userInfo 事件相关信息.
+ @return void.
+ 
+ @warning 每个event的userInfo不能超过10个
+ eventID、pageName、userInfo中key和value都不能使用空格和特殊字符,且长度不能超过255个字符(否则将截取前255个字符)
+ */
++ (void)event:(NSString *)eventID onPageView:(NSString*)pageName withUserInfo:(NSDictionary*)userInfo;
+
+/** 强制日志上传
+ 调用后,若距离上次成功上传日志时间不小于30秒,立刻上传日志。
+ */
++ (void)forceUploadRecords;
+
+
+
+
+@end

BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK.bundle/images/common_button_white@2x.png


BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK.bundle/images/common_button_white_highlighted@2x.png


BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK.bundle/images/empty_failed@2x.png


BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK.bundle/others/mfp.cer


+ 573 - 0
miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/WeiboSDK.h

xqd
@@ -0,0 +1,573 @@
+//
+//  WeiboSDKHeaders.h
+//  WeiboSDKDemo
+//
+//  Created by Wade Cheng on 4/3/13.
+//  Copyright (c) 2013 SINA iOS Team. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+#import "WBHttpRequest.h"
+#import "WBHttpRequest+WeiboToken.h"
+
+typedef NS_ENUM(NSInteger, WeiboSDKResponseStatusCode)
+{
+    WeiboSDKResponseStatusCodeSuccess               = 0,//成功
+    WeiboSDKResponseStatusCodeUserCancel            = -1,//用户取消发送
+    WeiboSDKResponseStatusCodeSentFail              = -2,//发送失败
+    WeiboSDKResponseStatusCodeAuthDeny              = -3,//授权失败
+    WeiboSDKResponseStatusCodeUserCancelInstall     = -4,//用户取消安装微博客户端
+    WeiboSDKResponseStatusCodePayFail               = -5,//支付失败
+    WeiboSDKResponseStatusCodeShareInSDKFailed      = -8,//分享失败 详情见response UserInfo
+    WeiboSDKResponseStatusCodeUnsupport             = -99,//不支持的请求
+    WeiboSDKResponseStatusCodeUnknown               = -100,
+};
+
+@protocol WeiboSDKDelegate;
+@protocol WBHttpRequestDelegate;
+@class WBBaseRequest;
+@class WBBaseResponse;
+@class WBMessageObject;
+@class WBImageObject;
+@class WBBaseMediaObject;
+@class WBHttpRequest;
+
+/**
+ 微博SDK接口类
+ */
+@interface WeiboSDK : NSObject
+
+/**
+ 检查用户是否安装了微博客户端程序
+ @return 已安装返回YES,未安装返回NO
+ */
++ (BOOL)isWeiboAppInstalled;
+
+/**
+ 检查用户是否可以通过微博客户端进行分享
+ @return 可以使用返回YES,不可以使用返回NO
+ */
++ (BOOL)isCanShareInWeiboAPP;
+
+/**
+ 检查用户是否可以使用微博客户端进行SSO授权
+ @return 可以使用返回YES,不可以使用返回NO
+ */
++ (BOOL)isCanSSOInWeiboApp;
+
+/**
+ 打开微博客户端程序
+ @return 成功打开返回YES,失败返回NO
+ */
++ (BOOL)openWeiboApp;
+
+
+/**
+ 获取微博客户端程序的itunes安装地址
+ @return 微博客户端程序的itunes安装地址
+ */
++ (NSString *)getWeiboAppInstallUrl;
+
+/**
+ 获取当前微博SDK的版本号
+ @return 当前微博SDK的版本号
+ */
++ (NSString *)getSDKVersion;
+
+
+extern NSString * const WeiboSDKGetAidSucessNotification;
+extern NSString * const WeiboSDKGetAidFailNotification;
+/**
+ 获取当前微博SDK的aid
+ 返回的aid值可能为 nil ,当值为 nil 时会尝试获取 aid 值。
+ 当获取成功( aid 值变为有效值)时,SDK会发出名为 WeiboSDKGetAidSucessNotification 的通知,通知中带有 aid 值。
+ 当获取失败时,SDK会发出名为 WeiboSDKGetAidFailNotification 的通知,通知中带有 NSError 对象。
+ @return aid 用于广告的与设备信息相关的标识符
+ */
++ (NSString *)getWeiboAid;
+
+
+/**
+ 向微博客户端程序注册第三方应用
+ @param appKey 微博开放平台第三方应用appKey
+ @return 注册成功返回YES,失败返回NO
+ */
++ (BOOL)registerApp:(NSString *)appKey;
+
+/**
+ 处理微博客户端程序通过URL启动第三方应用时传递的数据
+ 
+ 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用
+ @param url 启动第三方应用的URL
+ @param delegate WeiboSDKDelegate对象,用于接收微博触发的消息
+ @see WeiboSDKDelegate
+ */
++ (BOOL)handleOpenURL:(NSURL *)url delegate:(id<WeiboSDKDelegate>)delegate;
+
+/**
+ 发送请求给微博客户端程序,并切换到微博
+ 
+ 请求发送给微博客户端程序之后,微博客户端程序会进行相关的处理,处理完成之后一定会调用 [WeiboSDKDelegate didReceiveWeiboResponse:] 方法将处理结果返回给第三方应用
+ 
+ @param request 具体的发送请求
+ 
+ @see [WeiboSDKDelegate didReceiveWeiboResponse:]
+ @see WBBaseResponse
+ */
++ (BOOL)sendRequest:(WBBaseRequest *)request;
+
+/**
+ 收到微博客户端程序的请求后,发送对应的应答给微博客户端端程序,并切换到微博
+ 
+ 第三方应用收到微博的请求后,异步处理该请求,完成后必须调用该函数将应答返回给微博
+ 
+ @param response 具体的应答内容
+ @see WBBaseRequest
+ */
++ (BOOL)sendResponse:(WBBaseResponse *)response;
+
+/**
+ 设置WeiboSDK的调试模式
+ 
+ 当开启调试模式时,WeiboSDK会在控制台输出详细的日志信息,开发者可以据此调试自己的程序。默认为 NO
+ @param enabled 开启或关闭WeiboSDK的调试模式
+ */
++ (void)enableDebugMode:(BOOL)enabled;
+
+/**
+ 取消授权,登出接口
+ 调用此接口后,token将失效
+ @param token 第三方应用之前申请的Token
+ @param delegate WBHttpRequestDelegate对象,用于接收微博SDK对于发起的接口请求的请求的响应
+ @param tag 用户自定义TAG,将通过回调WBHttpRequest实例的tag属性返回
+ 
+ */
++ (void)logOutWithToken:(NSString *)token delegate:(id<WBHttpRequestDelegate>)delegate withTag:(NSString*)tag;
+
+/**
+ 呼起微博客户端或打开微博H5页面,SDK自动检测是否安装微博客户端,当调用SDK相关方法时:
+ 
+ 有的话呼起微博客户端定位到对应界面;
+ 没有的话打开 webView 加载相应的微博H5页面;
+ @param uid 用户id
+ @param mid 微博id
+ @param aid 文章id
+*/
+
+//连接到指定用户的微博个人主页,连接后可进行加关注等互动
++ (void)linkToUser:(NSString *)uid;
+
+//连接到指定的单条微博详情页,连接后可对这条微博进行转、评、赞等互动
++ (void)linkToSingleBlog:(NSString *)uid blogID:(NSString *)mid;
+
+//连接到指定的微博头条文章页
++ (void)linkToArticle:(NSString *)aid;
+
+//分享到微博
++ (void)shareToWeibo:(NSString *)content;
+
+//评论指定的微博
++ (void)commentToWeibo:(NSString *)mid;
+
+//连接到微博搜索内容流
++ (void)linkToSearch:(NSString *)keyword;
+
+//连接到我的微博消息流
++ (void)linkToTimeLine;
+
+//连接到我的微博个人主页
++ (void)linkToProfile;
+
+@end
+
+/**
+ 接收并处理来至微博客户端程序的事件消息
+ */
+@protocol WeiboSDKDelegate <NSObject>
+
+/**
+ 收到一个来自微博客户端程序的请求
+ 
+ 收到微博的请求后,第三方应用应该按照请求类型进行处理,处理完后必须通过 [WeiboSDK sendResponse:] 将结果回传给微博
+ @param request 具体的请求对象
+ */
+- (void)didReceiveWeiboRequest:(WBBaseRequest *)request;
+
+/**
+ 收到一个来自微博客户端程序的响应
+ 
+ 收到微博的响应后,第三方应用可以通过响应类型、响应的数据和 WBBaseResponse.userInfo 中的数据完成自己的功能
+ @param response 具体的响应对象
+ */
+- (void)didReceiveWeiboResponse:(WBBaseResponse *)response;
+
+@end
+
+
+#pragma mark - DataTransferObject and Base Request/Response
+
+/**
+ 微博客户端程序和第三方应用之间传输数据信息的基类
+ */
+@interface WBDataTransferObject : NSObject
+
+/**
+ 自定义信息字典,用于数据传输过程中存储相关的上下文环境数据
+ 
+ 第三方应用给微博客户端程序发送 request 时,可以在 userInfo 中存储请求相关的信息。
+ 
+ @warning userInfo中的数据必须是实现了 `NSCoding` 协议的对象,必须保证能序列化和反序列化
+ @warning 序列化后的数据不能大于10M
+ */
+@property (nonatomic, strong) NSDictionary *userInfo;
+
+
+/**
+ 发送该数据对象的SDK版本号
+ 
+ 如果数据对象是自己生成的,则sdkVersion为当前SDK的版本号;如果是接收到的数据对象,则sdkVersion为数据发送方SDK版本号
+ */
+@property (strong, nonatomic, readonly) NSString *sdkVersion;
+
+
+/**
+ 当用户没有安装微博客户端程序时是否提示用户打开微博安装页面
+ 
+ 如果设置为YES,当用户未安装微博时会弹出Alert询问用户是否要打开微博App的安装页面。默认为YES
+ */
+@property (nonatomic, assign) BOOL shouldOpenWeiboAppInstallPageIfNotInstalled;
+
+
+@end
+
+
+/**
+ 微博SDK所有请求类的基类
+ */
+@interface WBBaseRequest : WBDataTransferObject
+
+/**
+ 返回一个 WBBaseRequest 对象
+ 
+ @return 返回一个*自动释放的*WBBaseRequest对象
+ */
++ (id)request;
+
+@end
+
+
+/**
+ 微博SDK所有响应类的基类
+ */
+@interface WBBaseResponse : WBDataTransferObject
+
+/**
+ 对应的 request 中的自定义信息字典
+ 
+ 如果当前 response 是由微博客户端响应给第三方应用的,则 requestUserInfo 中会包含原 request.userInfo 中的所有数据
+ 
+ @see WBBaseRequest.userInfo
+ */
+@property (strong, nonatomic, readonly) NSDictionary *requestUserInfo;
+
+/**
+ 响应状态码
+ 
+ 第三方应用可以通过statusCode判断请求的处理结果
+ */
+@property (nonatomic, assign) WeiboSDKResponseStatusCode statusCode;
+
+/**
+ 返回一个 WBBaseResponse 对象
+ 
+ @return 返回一个*自动释放的*WBBaseResponse对象
+ */
++ (id)response;
+
+@end
+
+#pragma mark - Authorize Request/Response
+
+/**
+ 第三方应用向微博客户端请求认证的消息结构
+ 
+ 第三方应用向微博客户端申请认证时,需要调用 [WeiboSDK sendRequest:] 函数, 向微博客户端发送一个 WBAuthorizeRequest 的消息结构。
+ 微博客户端处理完后会向第三方应用发送一个结构为 WBAuthorizeResponse 的处理结果。
+ */
+@interface WBAuthorizeRequest : WBBaseRequest
+
+/**
+ 微博开放平台第三方应用授权回调页地址,默认为`http://`
+ 
+ 参考 http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E#.E5.AE.A2.E6.88.B7.E7.AB.AF.E9.BB.98.E8.AE.A4.E5.9B.9E.E8.B0.83.E9.A1.B5
+ 
+ @warning 必须保证和在微博开放平台应用管理界面配置的“授权回调页”地址一致,如未进行配置则默认为`http://`
+ @warning 不能为空,长度小于1K
+ */
+@property (nonatomic, strong) NSString *redirectURI;
+
+/**
+ 微博开放平台第三方应用scope,多个scrope用逗号分隔
+ 
+ 参考 http://open.weibo.com/wiki/%E6%8E%88%E6%9D%83%E6%9C%BA%E5%88%B6%E8%AF%B4%E6%98%8E#scope
+ 
+ @warning 长度小于1K
+ */
+@property (nonatomic, strong) NSString *scope;
+
+/**
+ 当用户没有安装微博客户端或微博客户端过低无法支持SSO的时候是否弹出SDK自带的Webview进行授权
+ 
+ 如果设置为YES,当用户没有安装微博客户端或微博客户端过低无法支持SSO的时候会自动弹出SDK自带的Webview进行授权。
+
+ 如果设置为NO,会根据 shouldOpenWeiboAppInstallPageIfNotInstalled 属性判断是否弹出安装/更新微博的对话框
+ 
+ 默认为YES
+ */
+@property (nonatomic, assign) BOOL shouldShowWebViewForAuthIfCannotSSO;
+
+@end
+
+
+/**
+ 微博客户端处理完第三方应用的认证申请后向第三方应用回送的处理结果
+ 
+ WBAuthorizeResponse 结构中仅包含常用的 userID 、accessToken 和 expirationDate 信息,其他的认证信息(比如部分应用可以获取的 refresh_token 信息)会统一存放到 userInfo 中
+ */
+@interface WBAuthorizeResponse : WBBaseResponse
+
+/**
+ 用户ID
+ */
+@property (nonatomic, strong) NSString *userID;
+
+/**
+ 认证口令
+ */
+@property (nonatomic, strong) NSString *accessToken;
+
+/**
+ 认证过期时间
+ */
+@property (nonatomic, strong) NSDate *expirationDate;
+
+/**
+ 当认证口令过期时用于换取认证口令的更新口令
+ */
+@property (nonatomic, strong) NSString *refreshToken;
+
+@end
+
+#pragma mark - ProvideMessageForWeibo Request/Response
+
+/**
+ 微博客户端向第三方程序请求提供内容的消息结构
+ */
+@interface WBProvideMessageForWeiboRequest : WBBaseRequest
+
+@end
+
+/**
+ 微博客户端向第三方应用请求提供内容,第三方应用向微博客户端返回的消息结构
+ */
+@interface WBProvideMessageForWeiboResponse : WBBaseResponse
+
+/**
+ 提供给微博客户端的消息
+ */
+@property (nonatomic, strong) WBMessageObject *message;
+
+/**
+ 返回一个 WBProvideMessageForWeiboResponse 对象
+ @param message 需要回送给微博客户端程序的消息对象
+ @return 返回一个*自动释放的*WBProvideMessageForWeiboResponse对象
+ */
++ (id)responseWithMessage:(WBMessageObject *)message;
+
+@end
+
+#pragma mark - SendMessageToWeibo Request/Response
+
+/**
+ 第三方应用发送消息至微博客户端程序的消息结构体
+ */
+@interface WBSendMessageToWeiboRequest : WBBaseRequest
+
+/**
+ 发送给微博客户端的消息
+ */
+@property (nonatomic, strong) WBMessageObject *message;
+
+/**
+ 返回一个 WBSendMessageToWeiboRequest 对象
+ 此方法生成对象被[WeiboSDK sendRequest:]会唤起微博客户端的发布器进行分享,如果未安装微博客户端或客户端版本太低
+ 会根据 shouldOpenWeiboAppInstallPageIfNotInstalled 属性判断是否弹出安装/更新微博的对话框
+ @param message 需要发送给微博客户端的消息对象
+ @return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象
+ */
++ (id)requestWithMessage:(WBMessageObject *)message;
+
+/**
+ 返回一个 WBSendMessageToWeiboRequest 对象
+ 
+ 当用户安装了可以支持微博客户端內分享的微博客户端时,会自动唤起微博并分享
+ 当用户没有安装微博客户端或微博客户端过低无法支持通过客户端內分享的时候会自动唤起SDK內微博发布器
+ 
+ @param message 需要发送给微博的消息对象
+ @param authRequest 授权相关信息,与access_token二者至少有一个不为空,当access_token为空并且需要弹出SDK內发布器时会通过此信息先进行授权后再分享
+ @param access_token 第三方应用之前申请的Token,当此值不为空并且无法通过客户端分享的时候,会使用此token进行分享。
+ @return 返回一个*自动释放的*WBSendMessageToWeiboRequest对象
+ */
++ (id)requestWithMessage:(WBMessageObject *)message
+                authInfo:(WBAuthorizeRequest *)authRequest
+            access_token:(NSString *)access_token;
+
+@end
+
+/**
+ WBSendMessageToWeiboResponse
+ */
+@interface WBSendMessageToWeiboResponse : WBBaseResponse
+
+/**
+ 可能在分享过程中用户进行了授权操作,当此值不为空时,为用户相应授权信息
+ */
+@property (nonatomic,strong) WBAuthorizeResponse *authResponse;
+@end
+
+
+
+#pragma mark - MessageObject / ImageObject
+
+/**
+ 微博客户端程序和第三方应用之间传递的消息结构
+ 
+ 一个消息结构由三部分组成:文字、图片和多媒体数据。三部分内容中至少有一项不为空,图片和多媒体数据不能共存。
+ */
+@interface WBMessageObject : NSObject
+
+/**
+ 消息的文本内容
+ 
+ @warning 长度小于2000个汉字
+ */
+@property (nonatomic, strong) NSString *text;
+
+/**
+ 消息的图片内容
+ 
+ @see WBImageObject
+ */
+@property (nonatomic, strong) WBImageObject *imageObject;
+
+/**
+ 消息的多媒体内容
+ 
+ @see WBBaseMediaObject
+ */
+@property (nonatomic, strong) WBBaseMediaObject *mediaObject;
+
+/**
+ 返回一个 WBMessageObject 对象
+ 
+ @return 返回一个*自动释放的*WBMessageObject对象
+ */
++ (id)message;
+
+@end
+
+/**
+ 消息中包含的图片数据对象
+ */
+@interface WBImageObject : NSObject
+
+/**
+ 图片真实数据内容
+ 
+ @warning 大小不能超过10M
+ */
+@property (nonatomic, strong) NSData *imageData;
+
+/**
+ 返回一个 WBImageObject 对象
+ 
+ @return 返回一个*自动释放的*WBImageObject对象
+ */
++ (id)object;
+
+/**
+ 返回一个 UIImage 对象
+ 
+ @return 返回一个*自动释放的*UIImage对象
+ */
+- (UIImage *)image;
+
+@end
+
+#pragma mark - Message Media Objects
+
+/**
+ 消息中包含的多媒体数据对象基类,该类后期会被废弃,在发布器不再显示为linkcard样式,只显示为普通网络连接
+ */
+@interface WBBaseMediaObject : NSObject
+
+/**
+ 对象唯一ID,用于唯一标识一个多媒体内容
+ 
+ 当第三方应用分享多媒体内容到微博时,应该将此参数设置为被分享的内容在自己的系统中的唯一标识
+ @warning 不能为空,长度小于255
+ */
+@property (nonatomic, strong) NSString *objectID;
+
+/**
+ 多媒体内容标题
+ @warning 不能为空且长度小于1k
+ */
+@property (nonatomic, strong) NSString *title;
+
+/**
+ 多媒体内容描述
+ @warning 长度小于1k
+ */
+@property (nonatomic, strong) NSString *description;
+
+/**
+ 多媒体内容缩略图
+ @warning 大小小于32k
+ */
+@property (nonatomic, strong) NSData *thumbnailData;
+
+/**
+ 点击多媒体内容之后呼起第三方应用特定页面的scheme
+ @warning 长度小于255
+ */
+@property (nonatomic, strong) NSString *scheme;
+
+/**
+ 返回一个 WBBaseMediaObject 对象
+ 
+ @return 返回一个*自动释放的*WBBaseMediaObject对象
+ */
++ (id)object;
+
+@end
+
+#pragma mark - Message WebPage Objects
+
+/**
+ 消息中包含的网页数据对象
+ */
+@interface WBWebpageObject : WBBaseMediaObject
+
+/**
+ 网页的url地址
+ 
+ @warning 不能为空且长度不能超过255
+ */
+@property (nonatomic, strong) NSString *webpageUrl;
+
+@end
+
+

BIN
miaomiao/plugins/cordova-plugin-weibosdk/src/ios/libWeiboSDK/libWeiboSDK.a


+ 30 - 0
miaomiao/plugins/cordova-plugin-weibosdk/www/weibo.js

xqd
@@ -0,0 +1,30 @@
+var cordova = require('cordova');
+module.exports = {
+	checkClientInstalled:function(successCallback, errorCallback){
+		cordova.exec(successCallback, errorCallback, "WeiboSDK", "checkClientInstalled", []);
+	},
+	ssoLogin:function(successCallback, errorCallback){
+		cordova.exec(successCallback, errorCallback, "WeiboSDK", "ssoLogin", []);
+	},
+	logout:function(successCallback, errorCallback){
+		cordova.exec(successCallback, errorCallback, "WeiboSDK", "logout", []);
+	},
+	shareToWeibo:function(successCallback, errorCallback, args){
+		if(args == undefined){
+			args = {};
+		}
+		cordova.exec(successCallback, errorCallback, "WeiboSDK", "shareToWeibo", [args]);
+	},
+	shareImageToWeibo:function(successCallback, errorCallback, args){
+		if(args == undefined){
+			args = {};
+		}
+		cordova.exec(successCallback, errorCallback, "WeiboSDK", "shareImageToWeibo", [args]);
+	},
+	shareTextToWeibo:function(successCallback, errorCallback, args){
+		if(args == undefined){
+			args = {};
+		}
+		cordova.exec(successCallback, errorCallback, "WeiboSDK", "shareTextToWeibo", [args]);
+	}
+};

+ 20 - 0
miaomiao/plugins/fetch.json

xqd
@@ -138,5 +138,25 @@
         },
         "is_top_level": true,
         "variables": {}
+    },
+    "cordova-plugin-offbye-alipay": {
+        "source": {
+            "type": "registry",
+            "id": "https://github.com/offbye/cordova-plugin-alipay.git"
+        },
+        "is_top_level": true,
+        "variables": {
+            "PARTNER_ID": "2088721135315822"
+        }
+    },
+    "cordova-plugin-weibosdk": {
+        "source": {
+            "type": "registry",
+            "id": "cordova-plugin-weibosdk"
+        },
+        "is_top_level": true,
+        "variables": {
+            "WEIBO_APP_ID": "YOUR_WEIBO_APPID"
+        }
     }
 }

+ 50 - 2
miaomiao/www/js/controllers/home.js

xqd
@@ -296,8 +296,56 @@
             $scope.toRecharge = function(){
                 $state.go("app.recharge")
             };
-            $scope.shareDream = function(){
-                $state.go("app.shareDream",{item:$scope.dream});
+            $scope.shareDream = function (type) {
+                if (type==1) {//微信
+                    Wechat.share({
+                        text: "微信分享",
+                        scene: Wechat.Scene.TIMELINE   // share to Timeline
+                    }, function () {
+                        alert("Success");
+                    }, function (reason) {
+                        alert("Failed: " + reason);
+                    });
+                    //Wechat.share({
+                    //    message: {
+                    //        title: "微信分享",
+                    //        description: "This is description.",
+                    //        thumb: "www/img/thumbnail.png",
+                    //        mediaTagName: "TEST-TAG-001",
+                    //        messageExt: "这是第三方带的测试字段",
+                    //        messageAction: "<action>dotalist</action>",
+                    //        media: "YOUR_MEDIA_OBJECT_HERE"
+                    //    },
+                    //    scene: Wechat.Scene.TIMELINE   // share to Timeline
+                    //}, function () {
+                    //    alert("Success");
+                    //}, function (reason) {
+                    //    alert("Failed: " + reason);
+                    //});
+                    //Wechat.share({
+                    //    message: {
+                    //        media: {
+                    //            type: Wechat.Type.WEBPAGE,
+                    //            webpageUrl: "http://tech.qq.com/zt2012/tmtdecode/252.htm"
+                    //        }
+                    //    },
+                    //    scene: Wechat.Scene.TIMELINE   // share to Timeline
+                    //}, function () {
+                    //    alert("Success");
+                    //}, function (reason) {
+                    //    alert("Failed: " + reason);
+                    //});
+                }
+                if (type == 2) {//微博  https://github.com/iVanPan/cordova_weibo/blob/master/README_ZH.md
+                    var args = {};
+                    args.text = '微博文字分享';
+                    WeiboSDK.shareTextToWeibo(function () {
+                        alert('share success');
+                    }, function (failReason) {
+                        alert(failReason);
+                    }, args);
+                }
+             //   $state.go("app.shareDream",{item:$scope.dream});
             };
 
         //实时排行

+ 55 - 3
miaomiao/www/js/controllers/my.js

xqd xqd
@@ -192,6 +192,7 @@
                 myService.myInfo().then(function(result){
                     $scope.vm = result.data.data;
                     $scope.vm.money = '';
+                    $scope.vm.payType = 1;
                 })
             });
             $scope.payExplain = function(){
@@ -200,11 +201,62 @@
             $scope.withdraw = function(){
                 $state.go("app.withdraw")
             };
+           
       //充值
       $scope.recharge = function(money){
-          myService.recharge(money).then(function(result){
-              msg.text("充值成功");
-            $state.go('app.my');
+          if (!$scope.vm.money) {
+              msg.text('请输入充值金额');
+              return;
+          }
+          myService.recharge(money).then(function (result) {
+              //todo:result需要返回支付宝或者微信的签名信息
+              var payInfo = result.data;
+              if ($scope.vm.payType == 1) { //支付宝
+                  cordova.plugins.AliPay.pay(payInfo, function success(e) {
+                      //e.resultStatus  状态代码  e.result  本次操作返回的结果数据 e.memo 提示信息
+                      //e.resultStatus  9000  订单支付成功 ;8000 正在处理中  调用function success
+                      //e.resultStatus  4000  订单支付失败 ;6001  用户中途取消 ;6002 网络连接出错  调用function error
+                      //当e.resultStatus为9000时,请去服务端验证支付结果
+                      $scope.clicksub = false;
+                      if (e.resultStatus == '9000') {
+                          alert(orderID);
+                          //支付成功
+                         // $state.go('app.my');
+                      } else {
+                          msg.error("支付失败");
+                          // msg.error("支付失败:" + JSON.stringify(e));
+                      }
+                  }, function error(e) {
+                      $scope.clicksub = false;
+                      // msg.error("支付失败:" + JSON.stringify(e));
+                      msg.error("支付失败");
+                  });
+              }
+              if ($scope.vm.payType == 2) { //微信
+                  var obj = JSON.parse(payInfo);
+                  var params = {
+                      partnerid: obj.partnerid, // merchant id
+                      prepayid: obj.prepayid, // prepay id
+                      noncestr: obj.noncestr, // nonce
+                      timestamp: obj.timestamp, // timestamp
+                      sign: obj.sign, // signed string
+                  };
+                  Wechat.sendPaymentRequest(params, function (r) {
+                      $scope.clicksub = false;
+                      courseService.orderStatus(orderID, $scope.paytype).then(function (result) {
+                          //  alert(result);
+                          //支付成功
+                        //  $state.go('app.my');
+                      }, function (erro) {
+                          msg.alert("支付反馈失败:" + JSON.stringify(erro));
+                      });
+                  }, function (reason) {
+                      $scope.clicksub = false;
+                      msg.alert("支付失败:" + JSON.stringify(reason));
+                  });
+              }
+             // msg.text("充值成功");
+            //   $state.go('app.my');
           });
       }
 

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

xqd
@@ -411,11 +411,11 @@
         </div>
     <div class="detail-like" ng-if="toshare">
         <div class="row" style="background: #CCCCCC;">
-            <div class="col" ng-click="shareDream()">
+            <div class="col" ng-click="shareDream(1)">
                 <img src="img/weixin.png" ><br>
                 微信
             </div>
-            <div class="col" ng-click="shareDream()">
+            <div class="col" ng-click="shareDream(2)">
                 <img src="img/weibo.png" ><br>
                 微博
             </div>

+ 2 - 2
miaomiao/www/templates/my/my-recharge.html

xqd
@@ -28,11 +28,11 @@
                选择支付方式
             </div>
             <ion-list class="re-radio">
-                <ion-radio ng-model="choice" ng-value="'A'">
+                <ion-radio ng-model="vm.payType" ng-value="1">
                     <img ng-src="img/icon_ Alipay.svg" />
                     <span>支付宝支付</span>
                 </ion-radio>
-                <ion-radio ng-model="choice" ng-value="'B'">
+                <ion-radio ng-model="vm.payType" ng-value="2">
                     <img ng-src="img/icon_ WeChat Pay.svg" />
                     <span>微信支付</span>
                 </ion-radio>

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels