Quellcode durchsuchen

fuck android环境

Ben vor 7 Jahren
Ursprung
Commit
21c1fccf21
48 geänderte Dateien mit 1182 neuen und 2364 gelöschten Zeilen
  1. 0 55
      miaomiao/plugins/cordova-plugin-offbye-alipay/README.md
  2. 0 93
      miaomiao/plugins/cordova-plugin-offbye-alipay/package.json
  3. 0 76
      miaomiao/plugins/cordova-plugin-offbye-alipay/plugin.xml
  4. 0 109
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/AliPay.java
  5. 0 1
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/PayResult.java
  6. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/android/libs/alipaySdk-20160825.jar
  7. 0 11
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/AlipayPlugin.h
  8. 0 83
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/AlipayPlugin.m
  9. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/bar@2x.png
  10. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/refresh@2x.png
  11. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/refresh_click@2x.png
  12. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/shutdown@2x.png
  13. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.bundle/shutdown_click@2x.png
  14. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/AlipaySDK
  15. 0 33
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Headers/APayAuthInfo.h
  16. 0 177
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Headers/AlipaySDK.h
  17. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/Info.plist
  18. BIN
      miaomiao/plugins/cordova-plugin-offbye-alipay/src/ios/lib/AlipaySDK.framework/en.lproj/InfoPlist.strings
  19. 0 9
      miaomiao/plugins/cordova-plugin-offbye-alipay/www/AliPay.js
  20. 14 102
      miaomiao/plugins/cordova-plugin-whitelist/package.json
  21. 0 0
      miaomiao/plugins/jpush-phonegap-plugin/example/css/index.css
  22. 0 0
      miaomiao/plugins/jpush-phonegap-plugin/example/css/jquery.mobile-1.1.1.css
  23. 276 276
      miaomiao/plugins/jpush-phonegap-plugin/example/css/mobiscroll.core-2.0.1.css
  24. 47 47
      miaomiao/plugins/jpush-phonegap-plugin/example/css/mobiscroll.jqm-2.0.1.css
  25. 0 0
      miaomiao/plugins/jpush-phonegap-plugin/example/js/jquery.js
  26. 0 0
      miaomiao/plugins/jpush-phonegap-plugin/example/js/jquery.mobile-1.1.1.js
  27. 16 16
      miaomiao/plugins/jpush-phonegap-plugin/src/ios/Plugins/AppDelegate+JPush.h
  28. 156 156
      miaomiao/plugins/jpush-phonegap-plugin/src/ios/Plugins/AppDelegate+JPush.m
  29. 94 94
      miaomiao/plugins/jpush-phonegap-plugin/src/ios/Plugins/JPushPlugin.h
  30. 365 365
      miaomiao/plugins/jpush-phonegap-plugin/src/ios/Plugins/JPushPlugin.m
  31. 0 0
      miaomiao/plugins/jpush-phonegap-plugin/src/ios/lib/jpush-ios-3.0.6.a
  32. 1 1
      miaomiao/www/chcp.json
  33. 4 4
      miaomiao/www/chcp.manifest
  34. 1 1
      miaomiao/www/css/style.css
  35. 4 4
      miaomiao/www/js/app.js
  36. 4 4
      miaomiao/www/js/config/router.js
  37. 10 10
      miaomiao/www/js/controllers/account.js
  38. 3 3
      miaomiao/www/js/controllers/add.js
  39. 64 492
      miaomiao/www/js/controllers/home.js
  40. 10 128
      miaomiao/www/js/controllers/my.js
  41. 6 0
      miaomiao/www/js/services/homeservice.js
  42. 1 0
      miaomiao/www/js/services/jpushservice.js
  43. 20 9
      miaomiao/www/templates/home/dream-detail.html
  44. 0 1
      miaomiao/www/templates/my/withdraw.html
  45. 20 2
      server/app/Http/Controllers/Api/V1/AuthController.php
  46. 56 1
      server/app/Http/Controllers/Api/V1/InteractionController.php
  47. 6 1
      server/app/Models/CommentInfoModel.php
  48. 4 0
      server/routes/api.php

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

xqd
@@ -1,55 +0,0 @@
-## 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) 建议商户依赖异步通知
-				 */
-
-```

Datei-Diff unterdrückt, da er zu groß ist
+ 0 - 93
miaomiao/plugins/cordova-plugin-offbye-alipay/package.json


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

xqd
@@ -1,76 +0,0 @@
-<?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>

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

xqd
@@ -1,109 +0,0 @@
-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;
-		}
-	}
-
-}

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

xqd
@@ -1 +0,0 @@
-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


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

xqd
@@ -1,11 +0,0 @@
-#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

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

xqd
@@ -1,83 +0,0 @@
-#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


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

xqd
@@ -1,33 +0,0 @@
-//
-//  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

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

xqd
@@ -1,177 +0,0 @@
-//
-//  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


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

xqd
@@ -1,9 +0,0 @@
-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]);
-		}
-};

+ 14 - 102
miaomiao/plugins/cordova-plugin-whitelist/package.json

xqd xqd
@@ -1,70 +1,22 @@
 {
-  "_args": [
-    [
-      {
-        "raw": "cordova-plugin-whitelist@1.3.2",
-        "scope": null,
-        "escapedName": "cordova-plugin-whitelist",
-        "name": "cordova-plugin-whitelist",
-        "rawSpec": "1.3.2",
-        "spec": "1.3.2",
-        "type": "version"
-      },
-      "D:\\my\\miao\\miaomiao\\node_modules"
-    ]
-  ],
-  "_from": "cordova-plugin-whitelist@1.3.2",
-  "_id": "cordova-plugin-whitelist@1.3.2",
-  "_inCache": true,
-  "_location": "/cordova-plugin-whitelist",
-  "_nodeVersion": "6.6.0",
-  "_npmOperationalInternal": {
-    "host": "packages-18-east.internal.npmjs.com",
-    "tmp": "tmp/cordova-plugin-whitelist-1.3.2.tgz_1488934526149_0.2759723379276693"
-  },
-  "_npmUser": {
-    "name": "stevegill",
-    "email": "stevengill97@gmail.com"
-  },
-  "_npmVersion": "4.1.1",
-  "_phantomChildren": {},
-  "_requested": {
-    "raw": "cordova-plugin-whitelist@1.3.2",
-    "scope": null,
-    "escapedName": "cordova-plugin-whitelist",
-    "name": "cordova-plugin-whitelist",
-    "rawSpec": "1.3.2",
-    "spec": "1.3.2",
-    "type": "version"
-  },
-  "_requiredBy": [
-    "#USER",
-    "/"
-  ],
-  "_resolved": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.2.tgz",
-  "_shasum": "5b6335feb9f5301f3c013b9096cb8885bdbd5076",
-  "_shrinkwrap": null,
-  "_spec": "cordova-plugin-whitelist@1.3.2",
-  "_where": "D:\\my\\miao\\miaomiao\\node_modules",
-  "author": {
-    "name": "Apache Software Foundation"
-  },
-  "bugs": {
-    "url": "https://github.com/apache/cordova-plugin-whitelist/issues"
-  },
+  "name": "cordova-plugin-whitelist",
+  "version": "1.3.2",
+  "description": "Cordova Whitelist Plugin",
   "cordova": {
     "platforms": [
       "android"
     ]
   },
-  "dependencies": {},
-  "description": "Cordova Whitelist Plugin",
-  "devDependencies": {},
-  "directories": {},
-  "dist": {
-    "shasum": "5b6335feb9f5301f3c013b9096cb8885bdbd5076",
-    "tarball": "https://registry.npmjs.org/cordova-plugin-whitelist/-/cordova-plugin-whitelist-1.3.2.tgz"
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/apache/cordova-plugin-whitelist"
   },
+  "keywords": [
+    "cordova",
+    "whitelist",
+    "ecosystem:cordova",
+    "cordova-android"
+  ],
   "engines": {
     "cordovaDependencies": {
       "0.0.0": {
@@ -75,46 +27,6 @@
       }
     }
   },
-  "homepage": "https://github.com/apache/cordova-plugin-whitelist#readme",
-  "keywords": [
-    "cordova",
-    "whitelist",
-    "ecosystem:cordova",
-    "cordova-android"
-  ],
-  "license": "Apache-2.0",
-  "maintainers": [
-    {
-      "name": "bowserj",
-      "email": "bowserj@apache.org"
-    },
-    {
-      "name": "csantanapr",
-      "email": "csantana23@gmail.com"
-    },
-    {
-      "name": "filmaj",
-      "email": "maj.fil@gmail.com"
-    },
-    {
-      "name": "purplecabbage",
-      "email": "purplecabbage@gmail.com"
-    },
-    {
-      "name": "shazron",
-      "email": "shazron@gmail.com"
-    },
-    {
-      "name": "stevegill",
-      "email": "stevengill97@gmail.com"
-    }
-  ],
-  "name": "cordova-plugin-whitelist",
-  "optionalDependencies": {},
-  "readme": "ERROR: No README data found!",
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/apache/cordova-plugin-whitelist.git"
-  },
-  "version": "1.3.2"
+  "author": "Apache Software Foundation",
+  "license": "Apache-2.0"
 }

+ 0 - 0
miaomiao/plugins/jpush-phonegap-plugin/example/css/index.css


+ 0 - 0
miaomiao/plugins/jpush-phonegap-plugin/example/css/jquery.mobile-1.1.1.css


+ 276 - 276
miaomiao/plugins/jpush-phonegap-plugin/example/css/mobiscroll.core-2.0.1.css

xqd
@@ -1,276 +1,276 @@
-/* Datewheel overlay */
-.dw {
-    min-width:170px;
-    padding: 0 10px;
-    position: absolute;
-    top: 5%;
-    left: 0;
-    z-index: 1001;
-    color: #000;
-    font-family: arial, verdana, sans-serif;
-    font-size: 12px;
-    text-shadow: none;
-}
-.dwi {
-    position: static;
-    margin: 5px;
-    display: inline-block;
-}
-.dwwr {
-    zoom: 1;
-}
-/* Datewheel overlay background */
-.dwo {
-    width: 100%;
-    background: #000;
-    position: absolute;
-    top: 0;
-    left: 0;
-    z-index: 1000;
-    opacity: .7;
-    filter:Alpha(Opacity=70);
-}
-/* Datewheel wheel container wrapper */
-.dwc {
-    float: left;
-    margin: 0 2px 5px 2px;
-    padding-top: 30px;
-}
-.dwcc {
-    clear: both;
-}
-/* Datewheel label */
-.dwl {
-    /*margin: 0 2px;*/
-    text-align: center;
-    line-height: 30px;
-    height: 30px;
-    white-space: nowrap;
-    position: absolute;
-    top: -30px;
-    width: 100%;
-}
-/* Datewheel value */
-.dwv {
-    padding: 10px 0;
-    border-bottom: 1px solid #000;
-}
-/* Datewheel wheel container */
-.dwrc {
-    -webkit-border-radius: 3px;
-    -moz-border-radius: 3px;
-    border-radius: 3px;
-}
-.dwwc {
-    margin: 0;
-    padding: 0 2px;
-    position: relative;
-    background: #000;
-    zoom:1;
-}
-/* Datewheel wheels */
-.dwwl {
-    margin: 4px 2px;
-    position: relative;
-    background: #888;
-    background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000),color-stop(0.35, #333),color-stop(0.50, #888),color-stop(0.65, #333),color-stop(1, #000));
-    background: -moz-linear-gradient(#000 0%,#333 35%, #888 50%,#333 65%,#000 100%);
-    background: -ms-linear-gradient(#000 0%,#333 35%, #888 50%,#333 65%,#000 100%);
-    background: -o-linear-gradient(#000 0%,#333 35%, #888 50%,#333 65%,#000 100%);
-}
-.dww {
-    margin: 0 2px;
-    overflow: hidden;
-    position: relative;
-    /*top: -30px;*/
-}
-.dwsc .dww {
-    color: #fff;
-    background: #444;
-    background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000),color-stop(0.45, #444),color-stop(0.55, #444),color-stop(1, #000));
-    background: -moz-linear-gradient(#000 0%,#444 45%, #444 55%, #000 100%);
-    background: -ms-linear-gradient(#000 0%,#444 45%, #444 55%, #000 100%);
-    background: -o-linear-gradient(#000 0%,#444 45%, #444 55%, #000 100%);
-}
-.dww ul {
-    list-style: none;
-    margin: 0;
-    padding: 0;
-    /*display: block;
-    width: 100%;*/
-    position: relative;
-    z-index: 2;
-}
-.dww li {
-    list-style: none;
-    margin: 0;
-    padding: 0 5px;
-    display: block;
-    text-align: center;
-    line-height: 40px;
-    font-size: 26px;
-    white-space: nowrap;
-    text-shadow: 0 1px 1px #000;
-    opacity: .3;
-    filter: Alpha(Opacity=30);
-}
-/* Valid entry */
-.dww li.dw-v {
-    opacity: 1;
-    filter: Alpha(Opacity=100);
-}
-/* Hidden entry */
-.dww li.dw-h {
-    visibility: hidden;
-}
-/* Wheel +/- buttons */
-.dwwb {
-    position: absolute;
-    z-index: 4;
-    left: 0;
-    cursor: pointer;
-    width: 100%;
-    height: 40px;
-    text-align: center;
-}
-.dwwbp {
-    top: 0;
-    -webkit-border-radius: 3px 3px 0 0;
-    -moz-border-radius: 3px 3px 0 0;
-    border-radius: 3px 3px 0 0;
-    font-size: 40px;
-}
-.dwwbm {
-    bottom: 0;
-    -webkit-border-radius: 0 0 3px 3px;
-    -moz-border-radius: 0 0 3px 3px;
-    border-radius: 0 0 3px 3px;
-    font-size: 32px;
-    font-weight: bold;
-}
-.dwpm .dwwc {
-    background: transparent;
-}
-.dwpm .dww {
-    margin: -1px;
-}
-.dwpm .dww li {
-    text-shadow: none;
-}
-.dwpm .dwwol {
-    display: none;
-}
-/* Datewheel wheel overlay */
-.dwwo {
-    position: absolute;
-    z-index: 3;
-    top: 0;
-    left: 0;
-    width: 100%;
-    height: 100%;
-    background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000),color-stop(0.52, rgba(44,44,44,0)),color-stop(0.48, rgba(44,44,44,0)),color-stop(1, #000));
-    background: -moz-linear-gradient(#000 0%,rgba(44,44,44,0) 52%, rgba(44,44,44,0) 48%, #000 100%);
-    background: -ms-linear-gradient(#000 0%,rgba(44,44,44,0) 52%, rgba(44,44,44,0) 48%, #000 100%);
-    background: -o-linear-gradient(#000 0%,rgba(44,44,44,0) 52%, rgba(44,44,44,0) 48%, #000 100%);
-}
-/* Background line */
-.dwwol {
-    position: absolute;
-    z-index: 1;
-    top: 50%;
-    left: 0;
-    width: 100%;
-    height: 0;
-    margin-top: -1px;
-    border-top: 1px solid #333;
-    border-bottom: 1px solid #555;
-}
-/* Datewheel button */
-.dwbg .dwb {
-    display: block;
-    height: 40px;
-    line-height: 40px;
-    padding: 0 15px;
-    margin: 0 2px;
-    font-size: 14px;
-    font-weight: bold;
-    text-decoration: none;
-    text-shadow:0 -1px 1px #000;
-    border-radius: 5px;
-    -moz-border-radius: 5px;
-    -webkit-border-radius:5px;
-    box-shadow:0 1px 3px rgba(0,0,0,0.5);
-    -moz-box-shadow:0 1px 3px rgba(0,0,0,0.5);
-    -webkit-box-shadow:0 1px 3px rgba(0,0,0,0.5);
-    color: #fff;
-    background:#000;
-    background:-webkit-gradient(linear,left bottom,left top,color-stop(0.5, #000),color-stop(0.5, #6e6e6e));
-    background:-moz-linear-gradient(#6e6e6e 50%,#000 50%);
-    background:-ms-linear-gradient(#6e6e6e 50%,#000 50%);
-    background:-o-linear-gradient(#6e6e6e 50%,#000 50%);
-}
-/* Datewheel button container */
-.dwbc {
-    /*margin-top: 5px;*/
-    padding: 5px 0;
-    text-align: center;
-    clear: both;
-}
-/* Datewheel button wrapper */
-.dwbw {
-    display: inline-block;
-    width: 50%;
-}
-/* Hidden label */
-.dwhl {
-    padding-top: 10px;
-}
-.dwhl .dwl {
-    display: none;
-}
-/* Backgrounds */
-.dwbg {
-    background: #fff;
-    border-radius: 3px;
-    -webkit-border-radius: 3px;
-    -moz-border-radius: 3px;
-}
-.dwbg .dwpm .dww {
-    color: #000;
-    background: #fff;
-    border: 1px solid #AAA;
-}
-.dwbg .dwwb {
-    background: #ccc;
-    color: #888;
-    text-shadow: 0 -1px 1px #333;
-    box-shadow: 0 0 5px #333;
-    -webkit-box-shadow: 0 0 5px #333;
-    -moz-box-shadow: 0 0 5px #333;
-}
-.dwbg .dwwbp {
-    background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #bdbdbd),color-stop(1, #f7f7f7));
-    background: -moz-linear-gradient(#f7f7f7,#bdbdbd);
-    background: -ms-linear-gradient(#f7f7f7,#bdbdbd);
-    background: -o-linear-gradient(#f7f7f7,#bdbdbd);
-}
-.dwbg .dwwbm {
-    background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #f7f7f7),color-stop(1, #bdbdbd));
-    background: -moz-linear-gradient(#bdbdbd,#f7f7f7);
-    background: -ms-linear-gradient(#bdbdbd,#f7f7f7);
-    background: -o-linear-gradient(#bdbdbd,#f7f7f7);
-}
-.dwbg .dwb-a {
-    background:#3c7500;
-    background:-webkit-gradient(linear,left bottom,left top,color-stop(0.5, #3c7500),color-stop(0.5, #94c840));
-    background:-moz-linear-gradient(#94c840 50%,#3c7500 50%);
-    background:-ms-linear-gradient(#94c840 50%,#3c7500 50%);
-    background:-o-linear-gradient(#94c840 50%,#3c7500 50%);
-}
-.dwbg .dwwl .dwb-a {
-    background:#3c7500;
-    background:-webkit-gradient(linear,left bottom,left top,color-stop(0, #3c7500),color-stop(1, #94c840));
-    background:-moz-linear-gradient(#94c840,#3c7500);
-    background:-ms-linear-gradient(#94c840,#3c7500);
-    background:-o-linear-gradient(#94c840,#3c7500);
-}
+/* Datewheel overlay */
+.dw {
+    min-width:170px;
+    padding: 0 10px;
+    position: absolute;
+    top: 5%;
+    left: 0;
+    z-index: 1001;
+    color: #000;
+    font-family: arial, verdana, sans-serif;
+    font-size: 12px;
+    text-shadow: none;
+}
+.dwi {
+    position: static;
+    margin: 5px;
+    display: inline-block;
+}
+.dwwr {
+    zoom: 1;
+}
+/* Datewheel overlay background */
+.dwo {
+    width: 100%;
+    background: #000;
+    position: absolute;
+    top: 0;
+    left: 0;
+    z-index: 1000;
+    opacity: .7;
+    filter:Alpha(Opacity=70);
+}
+/* Datewheel wheel container wrapper */
+.dwc {
+    float: left;
+    margin: 0 2px 5px 2px;
+    padding-top: 30px;
+}
+.dwcc {
+    clear: both;
+}
+/* Datewheel label */
+.dwl {
+    /*margin: 0 2px;*/
+    text-align: center;
+    line-height: 30px;
+    height: 30px;
+    white-space: nowrap;
+    position: absolute;
+    top: -30px;
+    width: 100%;
+}
+/* Datewheel value */
+.dwv {
+    padding: 10px 0;
+    border-bottom: 1px solid #000;
+}
+/* Datewheel wheel container */
+.dwrc {
+    -webkit-border-radius: 3px;
+    -moz-border-radius: 3px;
+    border-radius: 3px;
+}
+.dwwc {
+    margin: 0;
+    padding: 0 2px;
+    position: relative;
+    background: #000;
+    zoom:1;
+}
+/* Datewheel wheels */
+.dwwl {
+    margin: 4px 2px;
+    position: relative;
+    background: #888;
+    background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000),color-stop(0.35, #333),color-stop(0.50, #888),color-stop(0.65, #333),color-stop(1, #000));
+    background: -moz-linear-gradient(#000 0%,#333 35%, #888 50%,#333 65%,#000 100%);
+    background: -ms-linear-gradient(#000 0%,#333 35%, #888 50%,#333 65%,#000 100%);
+    background: -o-linear-gradient(#000 0%,#333 35%, #888 50%,#333 65%,#000 100%);
+}
+.dww {
+    margin: 0 2px;
+    overflow: hidden;
+    position: relative;
+    /*top: -30px;*/
+}
+.dwsc .dww {
+    color: #fff;
+    background: #444;
+    background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000),color-stop(0.45, #444),color-stop(0.55, #444),color-stop(1, #000));
+    background: -moz-linear-gradient(#000 0%,#444 45%, #444 55%, #000 100%);
+    background: -ms-linear-gradient(#000 0%,#444 45%, #444 55%, #000 100%);
+    background: -o-linear-gradient(#000 0%,#444 45%, #444 55%, #000 100%);
+}
+.dww ul {
+    list-style: none;
+    margin: 0;
+    padding: 0;
+    /*display: block;
+    width: 100%;*/
+    position: relative;
+    z-index: 2;
+}
+.dww li {
+    list-style: none;
+    margin: 0;
+    padding: 0 5px;
+    display: block;
+    text-align: center;
+    line-height: 40px;
+    font-size: 26px;
+    white-space: nowrap;
+    text-shadow: 0 1px 1px #000;
+    opacity: .3;
+    filter: Alpha(Opacity=30);
+}
+/* Valid entry */
+.dww li.dw-v {
+    opacity: 1;
+    filter: Alpha(Opacity=100);
+}
+/* Hidden entry */
+.dww li.dw-h {
+    visibility: hidden;
+}
+/* Wheel +/- buttons */
+.dwwb {
+    position: absolute;
+    z-index: 4;
+    left: 0;
+    cursor: pointer;
+    width: 100%;
+    height: 40px;
+    text-align: center;
+}
+.dwwbp {
+    top: 0;
+    -webkit-border-radius: 3px 3px 0 0;
+    -moz-border-radius: 3px 3px 0 0;
+    border-radius: 3px 3px 0 0;
+    font-size: 40px;
+}
+.dwwbm {
+    bottom: 0;
+    -webkit-border-radius: 0 0 3px 3px;
+    -moz-border-radius: 0 0 3px 3px;
+    border-radius: 0 0 3px 3px;
+    font-size: 32px;
+    font-weight: bold;
+}
+.dwpm .dwwc {
+    background: transparent;
+}
+.dwpm .dww {
+    margin: -1px;
+}
+.dwpm .dww li {
+    text-shadow: none;
+}
+.dwpm .dwwol {
+    display: none;
+}
+/* Datewheel wheel overlay */
+.dwwo {
+    position: absolute;
+    z-index: 3;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #000),color-stop(0.52, rgba(44,44,44,0)),color-stop(0.48, rgba(44,44,44,0)),color-stop(1, #000));
+    background: -moz-linear-gradient(#000 0%,rgba(44,44,44,0) 52%, rgba(44,44,44,0) 48%, #000 100%);
+    background: -ms-linear-gradient(#000 0%,rgba(44,44,44,0) 52%, rgba(44,44,44,0) 48%, #000 100%);
+    background: -o-linear-gradient(#000 0%,rgba(44,44,44,0) 52%, rgba(44,44,44,0) 48%, #000 100%);
+}
+/* Background line */
+.dwwol {
+    position: absolute;
+    z-index: 1;
+    top: 50%;
+    left: 0;
+    width: 100%;
+    height: 0;
+    margin-top: -1px;
+    border-top: 1px solid #333;
+    border-bottom: 1px solid #555;
+}
+/* Datewheel button */
+.dwbg .dwb {
+    display: block;
+    height: 40px;
+    line-height: 40px;
+    padding: 0 15px;
+    margin: 0 2px;
+    font-size: 14px;
+    font-weight: bold;
+    text-decoration: none;
+    text-shadow:0 -1px 1px #000;
+    border-radius: 5px;
+    -moz-border-radius: 5px;
+    -webkit-border-radius:5px;
+    box-shadow:0 1px 3px rgba(0,0,0,0.5);
+    -moz-box-shadow:0 1px 3px rgba(0,0,0,0.5);
+    -webkit-box-shadow:0 1px 3px rgba(0,0,0,0.5);
+    color: #fff;
+    background:#000;
+    background:-webkit-gradient(linear,left bottom,left top,color-stop(0.5, #000),color-stop(0.5, #6e6e6e));
+    background:-moz-linear-gradient(#6e6e6e 50%,#000 50%);
+    background:-ms-linear-gradient(#6e6e6e 50%,#000 50%);
+    background:-o-linear-gradient(#6e6e6e 50%,#000 50%);
+}
+/* Datewheel button container */
+.dwbc {
+    /*margin-top: 5px;*/
+    padding: 5px 0;
+    text-align: center;
+    clear: both;
+}
+/* Datewheel button wrapper */
+.dwbw {
+    display: inline-block;
+    width: 50%;
+}
+/* Hidden label */
+.dwhl {
+    padding-top: 10px;
+}
+.dwhl .dwl {
+    display: none;
+}
+/* Backgrounds */
+.dwbg {
+    background: #fff;
+    border-radius: 3px;
+    -webkit-border-radius: 3px;
+    -moz-border-radius: 3px;
+}
+.dwbg .dwpm .dww {
+    color: #000;
+    background: #fff;
+    border: 1px solid #AAA;
+}
+.dwbg .dwwb {
+    background: #ccc;
+    color: #888;
+    text-shadow: 0 -1px 1px #333;
+    box-shadow: 0 0 5px #333;
+    -webkit-box-shadow: 0 0 5px #333;
+    -moz-box-shadow: 0 0 5px #333;
+}
+.dwbg .dwwbp {
+    background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #bdbdbd),color-stop(1, #f7f7f7));
+    background: -moz-linear-gradient(#f7f7f7,#bdbdbd);
+    background: -ms-linear-gradient(#f7f7f7,#bdbdbd);
+    background: -o-linear-gradient(#f7f7f7,#bdbdbd);
+}
+.dwbg .dwwbm {
+    background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #f7f7f7),color-stop(1, #bdbdbd));
+    background: -moz-linear-gradient(#bdbdbd,#f7f7f7);
+    background: -ms-linear-gradient(#bdbdbd,#f7f7f7);
+    background: -o-linear-gradient(#bdbdbd,#f7f7f7);
+}
+.dwbg .dwb-a {
+    background:#3c7500;
+    background:-webkit-gradient(linear,left bottom,left top,color-stop(0.5, #3c7500),color-stop(0.5, #94c840));
+    background:-moz-linear-gradient(#94c840 50%,#3c7500 50%);
+    background:-ms-linear-gradient(#94c840 50%,#3c7500 50%);
+    background:-o-linear-gradient(#94c840 50%,#3c7500 50%);
+}
+.dwbg .dwwl .dwb-a {
+    background:#3c7500;
+    background:-webkit-gradient(linear,left bottom,left top,color-stop(0, #3c7500),color-stop(1, #94c840));
+    background:-moz-linear-gradient(#94c840,#3c7500);
+    background:-ms-linear-gradient(#94c840,#3c7500);
+    background:-o-linear-gradient(#94c840,#3c7500);
+}

+ 47 - 47
miaomiao/plugins/jpush-phonegap-plugin/example/css/mobiscroll.jqm-2.0.1.css

xqd
@@ -1,47 +1,47 @@
-/* jQuery Mobile Theme */
-.jqm .dwo {
-    background: none;
-}
-.jqm .dw {
-    padding: 6px;
-    z-index: 1003;
-}
-.jqm .dwv {
-    position: static;
-    width: auto;
-    padding: .7em 15px .7em 15px;
-    border: 0;
-}
-.jqm .dwwr {
-    border: 0;
-}
-.jqm .dwpm .dwwo {
-    background: none;
-}
-.jqm .dwc {
-    margin: 0;
-    padding: 30px 5px 5px 5px;
- }
-.jqm .dwhl {
-    padding: 5px;
-}
-.jqm .dwwb {
-    margin: 0;
-    border: 0;
-}
-.jqm .dwwb span {
-    padding: 0;
-}
-.jqm .dwwbp .ui-btn-inner {
-    -webkit-border-radius: 3px 3px 0 0;
-    -moz-border-radius: 3px 3px 0 0;
-    border-radius: 3px 3px 0 0;
-}
-.jqm .dwwbm .ui-btn-inner {
-    -webkit-border-radius: 0 0 3px 3px;
-    -moz-border-radius: 0 0 3px 3px;
-    border-radius: 0 0 3px 3px;
-}
-.jqm .dwwbp span {
-    font-weight: normal;
-}
+/* jQuery Mobile Theme */
+.jqm .dwo {
+    background: none;
+}
+.jqm .dw {
+    padding: 6px;
+    z-index: 1003;
+}
+.jqm .dwv {
+    position: static;
+    width: auto;
+    padding: .7em 15px .7em 15px;
+    border: 0;
+}
+.jqm .dwwr {
+    border: 0;
+}
+.jqm .dwpm .dwwo {
+    background: none;
+}
+.jqm .dwc {
+    margin: 0;
+    padding: 30px 5px 5px 5px;
+ }
+.jqm .dwhl {
+    padding: 5px;
+}
+.jqm .dwwb {
+    margin: 0;
+    border: 0;
+}
+.jqm .dwwb span {
+    padding: 0;
+}
+.jqm .dwwbp .ui-btn-inner {
+    -webkit-border-radius: 3px 3px 0 0;
+    -moz-border-radius: 3px 3px 0 0;
+    border-radius: 3px 3px 0 0;
+}
+.jqm .dwwbm .ui-btn-inner {
+    -webkit-border-radius: 0 0 3px 3px;
+    -moz-border-radius: 0 0 3px 3px;
+    border-radius: 0 0 3px 3px;
+}
+.jqm .dwwbp span {
+    font-weight: normal;
+}

+ 0 - 0
miaomiao/plugins/jpush-phonegap-plugin/example/js/jquery.js


+ 0 - 0
miaomiao/plugins/jpush-phonegap-plugin/example/js/jquery.mobile-1.1.1.js


+ 16 - 16
miaomiao/plugins/jpush-phonegap-plugin/src/ios/Plugins/AppDelegate+JPush.h

xqd
@@ -1,16 +1,16 @@
-//
-//  AppDelegate+JPush.h
-//  delegateExtention
-//
-//  Created by 张庆贺 on 15/8/3.
-//  Copyright (c) 2015年 JPush. All rights reserved.
-//
-
-#import "AppDelegate.h"
-#import <UserNotifications/UserNotifications.h>
-#import "JPUSHService.h"
-
-@interface AppDelegate (JPush) <JPUSHRegisterDelegate>
--(void)registerForRemoteNotification;
--(void)startJPushSDK;
-@end
+//
+//  AppDelegate+JPush.h
+//  delegateExtention
+//
+//  Created by 张庆贺 on 15/8/3.
+//  Copyright (c) 2015年 JPush. All rights reserved.
+//
+
+#import "AppDelegate.h"
+#import <UserNotifications/UserNotifications.h>
+#import "JPUSHService.h"
+
+@interface AppDelegate (JPush) <JPUSHRegisterDelegate>
+-(void)registerForRemoteNotification;
+-(void)startJPushSDK;
+@end

+ 156 - 156
miaomiao/plugins/jpush-phonegap-plugin/src/ios/Plugins/AppDelegate+JPush.m

xqd
@@ -1,156 +1,156 @@
-//
-//  AppDelegate+JPush.m
-//  delegateExtention
-//
-//  Created by 张庆贺 on 15/8/3.
-//  Copyright (c) 2015年 JPush. All rights reserved.
-//
-
-#import "AppDelegate+JPush.h"
-#import "JPushPlugin.h"
-#import <objc/runtime.h>
-#import <AdSupport/AdSupport.h>
-#import <UserNotifications/UserNotifications.h>
-#import "JPushDefine.h"
-
-@implementation AppDelegate (JPush)
-
-+(void)load{
-    Method origin1;
-    Method swizzle1;
-    origin1  = class_getInstanceMethod([self class],@selector(init));
-    swizzle1 = class_getInstanceMethod([self class], @selector(init_plus));
-    method_exchangeImplementations(origin1, swizzle1);
-}
-
--(instancetype)init_plus{
-    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidLaunch:) name:UIApplicationDidFinishLaunchingNotification object:nil];
-    return [self init_plus];
-}
-
--(void)fireOpenNotification:(NSTimer*)timer{
-    if (SharedJPushPlugin) {
-        [JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[timer.userInfo toJsonString]];
-        [timer invalidate];
-    }
-}
-
-NSDictionary *_launchOptions;
--(void)applicationDidLaunch:(NSNotification *)notification{
-
-
-    if (notification) {
-        if (notification.userInfo) {
-            NSDictionary *userInfo1 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
-            if (userInfo1.count > 0) {
-                [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:userInfo1 repeats:YES];
-            }
-
-            NSDictionary *userInfo2 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey];
-            if (userInfo2.count > 0) {
-                [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:userInfo2 repeats:YES];
-            }
-        }
-        [JPUSHService setDebugMode];
-
-        NSString *plistPath = [[NSBundle mainBundle] pathForResource:JPushConfig_FileName ofType:@"plist"];
-        NSMutableDictionary *plistData = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
-        NSNumber *delay       = [plistData valueForKey:JPushConfig_Delay];
-
-        _launchOptions = notification.userInfo;
-
-        if (![delay boolValue]) {
-            [self startJPushSDK];
-        }
-    }
-}
-
--(void)startJPushSDK{
-    [self registerForRemoteNotification];
-    [JPushPlugin setupJPushSDK:_launchOptions];
-}
-
--(void)registerForRemoteNotification{
-    if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) {
-#ifdef NSFoundationVersionNumber_iOS_9_x_Max
-        JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
-        entity.types = UNAuthorizationOptionAlert|UNAuthorizationOptionBadge|UNAuthorizationOptionSound;
-        [JPUSHService registerForRemoteNotificationConfig:entity delegate:self];
-#endif
-    }else if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
-        //可以添加自定义categories
-        [JPUSHService registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge |
-                                                          UIUserNotificationTypeSound |
-                                                          UIUserNotificationTypeAlert)
-                                              categories:nil];
-    } else if([[UIDevice currentDevice].systemVersion floatValue] < 8.0){
-        //categories 必须为nil
-        [JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
-                                                          UIRemoteNotificationTypeSound |
-                                                          UIRemoteNotificationTypeAlert)
-                                              categories:nil];
-    }
-}
-
-- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
-    [JPUSHService registerDeviceToken:deviceToken];
-}
-
--(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
-    [JPUSHService handleRemoteNotification:userInfo];
-
-    [JPushPlugin fireDocumentEvent:JPushDocumentEvent_ReceiveNotification jsString:[userInfo toJsonString]];
-}
-
--(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{
-    [JPUSHService handleRemoteNotification:userInfo];
-    NSString *eventName;
-    switch ([UIApplication sharedApplication].applicationState) {
-        case UIApplicationStateInactive:
-            eventName = JPushDocumentEvent_OpenNotification;
-            break;
-        case UIApplicationStateActive:
-            eventName = JPushDocumentEvent_ReceiveNotification;
-            break;
-        case UIApplicationStateBackground:
-            eventName = JPushDocumentEvent_BackgroundNotification;
-            break;
-        default:
-            break;
-    }
-    [JPushPlugin fireDocumentEvent:eventName jsString:[userInfo toJsonString]];
-    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(30 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
-      completionHandler(UIBackgroundFetchResultNewData);
-    });
-}
-
--(void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler{
-    NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:notification.request.content.userInfo];
-    [JPushPlugin fireDocumentEvent:JPushDocumentEvent_ReceiveNotification jsString:[userInfo toJsonString]];
-    completionHandler(UNNotificationPresentationOptionBadge|UNNotificationPresentationOptionSound|UNNotificationPresentationOptionAlert);
-}
-
--(void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler{
-    NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:response.notification.request.content.userInfo];
-    @try {
-        [userInfo setValue:[response valueForKey:@"userText"] forKey:@"userText"];
-    } @catch (NSException *exception) { }
-    [userInfo setValue:response.actionIdentifier forKey:@"actionIdentifier"];
-    [JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[userInfo toJsonString]];
-    completionHandler();
-}
-
-- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
-    [[NSNotificationCenter defaultCenter] postNotificationName:JPushDocumentEvent_ReceiveLocalNotification object:notification.userInfo];
-}
-
-- (void)applicationWillEnterForeground:(UIApplication *)application {
-    //  [application setApplicationIconBadgeNumber:0];
-    //  [application cancelAllLocalNotifications];
-}
-
-- (void)applicationDidEnterBackground:(UIApplication *)application {
-    //  [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
-}
-
-@end
+//
+//  AppDelegate+JPush.m
+//  delegateExtention
+//
+//  Created by 张庆贺 on 15/8/3.
+//  Copyright (c) 2015年 JPush. All rights reserved.
+//
+
+#import "AppDelegate+JPush.h"
+#import "JPushPlugin.h"
+#import <objc/runtime.h>
+#import <AdSupport/AdSupport.h>
+#import <UserNotifications/UserNotifications.h>
+#import "JPushDefine.h"
+
+@implementation AppDelegate (JPush)
+
++(void)load{
+    Method origin1;
+    Method swizzle1;
+    origin1  = class_getInstanceMethod([self class],@selector(init));
+    swizzle1 = class_getInstanceMethod([self class], @selector(init_plus));
+    method_exchangeImplementations(origin1, swizzle1);
+}
+
+-(instancetype)init_plus{
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidLaunch:) name:UIApplicationDidFinishLaunchingNotification object:nil];
+    return [self init_plus];
+}
+
+-(void)fireOpenNotification:(NSTimer*)timer{
+    if (SharedJPushPlugin) {
+        [JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[timer.userInfo toJsonString]];
+        [timer invalidate];
+    }
+}
+
+NSDictionary *_launchOptions;
+-(void)applicationDidLaunch:(NSNotification *)notification{
+
+
+    if (notification) {
+        if (notification.userInfo) {
+            NSDictionary *userInfo1 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
+            if (userInfo1.count > 0) {
+                [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:userInfo1 repeats:YES];
+            }
+
+            NSDictionary *userInfo2 = [notification.userInfo valueForKey:UIApplicationLaunchOptionsLocalNotificationKey];
+            if (userInfo2.count > 0) {
+                [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(fireOpenNotification:) userInfo:userInfo2 repeats:YES];
+            }
+        }
+        [JPUSHService setDebugMode];
+
+        NSString *plistPath = [[NSBundle mainBundle] pathForResource:JPushConfig_FileName ofType:@"plist"];
+        NSMutableDictionary *plistData = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
+        NSNumber *delay       = [plistData valueForKey:JPushConfig_Delay];
+
+        _launchOptions = notification.userInfo;
+
+        if (![delay boolValue]) {
+            [self startJPushSDK];
+        }
+    }
+}
+
+-(void)startJPushSDK{
+    [self registerForRemoteNotification];
+    [JPushPlugin setupJPushSDK:_launchOptions];
+}
+
+-(void)registerForRemoteNotification{
+    if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) {
+#ifdef NSFoundationVersionNumber_iOS_9_x_Max
+        JPUSHRegisterEntity * entity = [[JPUSHRegisterEntity alloc] init];
+        entity.types = UNAuthorizationOptionAlert|UNAuthorizationOptionBadge|UNAuthorizationOptionSound;
+        [JPUSHService registerForRemoteNotificationConfig:entity delegate:self];
+#endif
+    }else if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
+        //可以添加自定义categories
+        [JPUSHService registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge |
+                                                          UIUserNotificationTypeSound |
+                                                          UIUserNotificationTypeAlert)
+                                              categories:nil];
+    } else if([[UIDevice currentDevice].systemVersion floatValue] < 8.0){
+        //categories 必须为nil
+        [JPUSHService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
+                                                          UIRemoteNotificationTypeSound |
+                                                          UIRemoteNotificationTypeAlert)
+                                              categories:nil];
+    }
+}
+
+- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
+    [JPUSHService registerDeviceToken:deviceToken];
+}
+
+-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo{
+    [JPUSHService handleRemoteNotification:userInfo];
+
+    [JPushPlugin fireDocumentEvent:JPushDocumentEvent_ReceiveNotification jsString:[userInfo toJsonString]];
+}
+
+-(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler{
+    [JPUSHService handleRemoteNotification:userInfo];
+    NSString *eventName;
+    switch ([UIApplication sharedApplication].applicationState) {
+        case UIApplicationStateInactive:
+            eventName = JPushDocumentEvent_OpenNotification;
+            break;
+        case UIApplicationStateActive:
+            eventName = JPushDocumentEvent_ReceiveNotification;
+            break;
+        case UIApplicationStateBackground:
+            eventName = JPushDocumentEvent_BackgroundNotification;
+            break;
+        default:
+            break;
+    }
+    [JPushPlugin fireDocumentEvent:eventName jsString:[userInfo toJsonString]];
+    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(30 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
+      completionHandler(UIBackgroundFetchResultNewData);
+    });
+}
+
+-(void)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(NSInteger))completionHandler{
+    NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:notification.request.content.userInfo];
+    [JPushPlugin fireDocumentEvent:JPushDocumentEvent_ReceiveNotification jsString:[userInfo toJsonString]];
+    completionHandler(UNNotificationPresentationOptionBadge|UNNotificationPresentationOptionSound|UNNotificationPresentationOptionAlert);
+}
+
+-(void)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)())completionHandler{
+    NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:response.notification.request.content.userInfo];
+    @try {
+        [userInfo setValue:[response valueForKey:@"userText"] forKey:@"userText"];
+    } @catch (NSException *exception) { }
+    [userInfo setValue:response.actionIdentifier forKey:@"actionIdentifier"];
+    [JPushPlugin fireDocumentEvent:JPushDocumentEvent_OpenNotification jsString:[userInfo toJsonString]];
+    completionHandler();
+}
+
+- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
+    [[NSNotificationCenter defaultCenter] postNotificationName:JPushDocumentEvent_ReceiveLocalNotification object:notification.userInfo];
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application {
+    //  [application setApplicationIconBadgeNumber:0];
+    //  [application cancelAllLocalNotifications];
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application {
+    //  [[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
+}
+
+@end

+ 94 - 94
miaomiao/plugins/jpush-phonegap-plugin/src/ios/Plugins/JPushPlugin.h

xqd
@@ -1,94 +1,94 @@
-//
-//  PushTalkPlugin.h
-//  PushTalk
-//
-//  Created by zhangqinghe on 13-12-13.
-//
-//
-
-#import <Cordova/CDV.h>
-
-@interface JPushPlugin : CDVPlugin{
-
-}
-
-//注册通知服务并启动 SDK
--(void)startJPushSDK:(CDVInvokedUrlCommand*)command;
-
-//以下为js中可调用接口
-//设置标签、别名
--(void)setTagsWithAlias:(CDVInvokedUrlCommand*)command;
--(void)setTags:(CDVInvokedUrlCommand*)command;
--(void)setAlias:(CDVInvokedUrlCommand*)command;
-
-//获取 RegistrationID
--(void)getRegistrationID:(CDVInvokedUrlCommand*)command;
-
-//页面统计
--(void)startLogPageView:(CDVInvokedUrlCommand*)command;
--(void)stopLogPageView:(CDVInvokedUrlCommand*)command;
--(void)beginLogPageView:(CDVInvokedUrlCommand*)command;
-
-//设置角标到服务器,服务器下一次发消息时,会设置成这个值
-//本接口不会改变应用本地的角标值.
--(void)setBadge:(CDVInvokedUrlCommand*)command;
-//相当于 [setBadge:0]
--(void)resetBadge:(CDVInvokedUrlCommand*)command;
-
-//应用本地的角标值设置/获取
--(void)setApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command;
--(void)getApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command;
-
-//停止与恢复推送
--(void)stopPush:(CDVInvokedUrlCommand*)command;
--(void)resumePush:(CDVInvokedUrlCommand*)command;
--(void)isPushStopped:(CDVInvokedUrlCommand*)command;
-
-//开关日志
--(void)setDebugModeFromIos:(CDVInvokedUrlCommand*)command;
--(void)setLogOFF:(CDVInvokedUrlCommand*)command;
--(void)crashLogON:(CDVInvokedUrlCommand*)command;
-
-//本地推送
--(void)setLocalNotification:(CDVInvokedUrlCommand*)command;
--(void)deleteLocalNotificationWithIdentifierKey:(CDVInvokedUrlCommand*)command;
--(void)clearAllLocalNotifications:(CDVInvokedUrlCommand*)command;
-
-//地理位置上报 [latitude,longitude]
--(void)setLocation:(CDVInvokedUrlCommand*)command;
-
-//检查用户的推送设置情况
--(void)getUserNotificationSettings:(CDVInvokedUrlCommand*)command;
-
-//ios 10 APIs
--(void)addDismissActions:(CDVInvokedUrlCommand*)command;
--(void)addNotificationActions:(CDVInvokedUrlCommand*)command;
-
-/*
- *  以下为js中可监听到的事件
- *  jpush.openNotification      点击推送消息启动或唤醒app
- *  jpush.setTagsWithAlias      设置标签、别名完成
- *  jpush.receiveMessage        收到自定义消息
- *  jpush.receiveNotification   前台收到推送
- *  jpush.backgroundNotification 后台收到推送
- */
-
-# pragma mark - private
-
-+(void)fireDocumentEvent:(NSString*)eventName jsString:(NSString*)jsString;
-
-+(void)setupJPushSDK:(NSDictionary*)userInfo;
-
-@end
-
-JPushPlugin *SharedJPushPlugin;
-
-@interface NSDictionary (JPush)
--(NSString*)toJsonString;
-@end
-
-@interface NSString (JPush)
--(NSDictionary*)toDictionary;
-@end
-
-
+//
+//  PushTalkPlugin.h
+//  PushTalk
+//
+//  Created by zhangqinghe on 13-12-13.
+//
+//
+
+#import <Cordova/CDV.h>
+
+@interface JPushPlugin : CDVPlugin{
+
+}
+
+//注册通知服务并启动 SDK
+-(void)startJPushSDK:(CDVInvokedUrlCommand*)command;
+
+//以下为js中可调用接口
+//设置标签、别名
+-(void)setTagsWithAlias:(CDVInvokedUrlCommand*)command;
+-(void)setTags:(CDVInvokedUrlCommand*)command;
+-(void)setAlias:(CDVInvokedUrlCommand*)command;
+
+//获取 RegistrationID
+-(void)getRegistrationID:(CDVInvokedUrlCommand*)command;
+
+//页面统计
+-(void)startLogPageView:(CDVInvokedUrlCommand*)command;
+-(void)stopLogPageView:(CDVInvokedUrlCommand*)command;
+-(void)beginLogPageView:(CDVInvokedUrlCommand*)command;
+
+//设置角标到服务器,服务器下一次发消息时,会设置成这个值
+//本接口不会改变应用本地的角标值.
+-(void)setBadge:(CDVInvokedUrlCommand*)command;
+//相当于 [setBadge:0]
+-(void)resetBadge:(CDVInvokedUrlCommand*)command;
+
+//应用本地的角标值设置/获取
+-(void)setApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command;
+-(void)getApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command;
+
+//停止与恢复推送
+-(void)stopPush:(CDVInvokedUrlCommand*)command;
+-(void)resumePush:(CDVInvokedUrlCommand*)command;
+-(void)isPushStopped:(CDVInvokedUrlCommand*)command;
+
+//开关日志
+-(void)setDebugModeFromIos:(CDVInvokedUrlCommand*)command;
+-(void)setLogOFF:(CDVInvokedUrlCommand*)command;
+-(void)crashLogON:(CDVInvokedUrlCommand*)command;
+
+//本地推送
+-(void)setLocalNotification:(CDVInvokedUrlCommand*)command;
+-(void)deleteLocalNotificationWithIdentifierKey:(CDVInvokedUrlCommand*)command;
+-(void)clearAllLocalNotifications:(CDVInvokedUrlCommand*)command;
+
+//地理位置上报 [latitude,longitude]
+-(void)setLocation:(CDVInvokedUrlCommand*)command;
+
+//检查用户的推送设置情况
+-(void)getUserNotificationSettings:(CDVInvokedUrlCommand*)command;
+
+//ios 10 APIs
+-(void)addDismissActions:(CDVInvokedUrlCommand*)command;
+-(void)addNotificationActions:(CDVInvokedUrlCommand*)command;
+
+/*
+ *  以下为js中可监听到的事件
+ *  jpush.openNotification      点击推送消息启动或唤醒app
+ *  jpush.setTagsWithAlias      设置标签、别名完成
+ *  jpush.receiveMessage        收到自定义消息
+ *  jpush.receiveNotification   前台收到推送
+ *  jpush.backgroundNotification 后台收到推送
+ */
+
+# pragma mark - private
+
++(void)fireDocumentEvent:(NSString*)eventName jsString:(NSString*)jsString;
+
++(void)setupJPushSDK:(NSDictionary*)userInfo;
+
+@end
+
+JPushPlugin *SharedJPushPlugin;
+
+@interface NSDictionary (JPush)
+-(NSString*)toJsonString;
+@end
+
+@interface NSString (JPush)
+-(NSDictionary*)toDictionary;
+@end
+
+

+ 365 - 365
miaomiao/plugins/jpush-phonegap-plugin/src/ios/Plugins/JPushPlugin.m

xqd
@@ -1,365 +1,365 @@
-
-//
-//  PushTalkPlugin.m
-//  PushTalk
-//
-//  Created by zhangqinghe on 13-12-13.
-//
-//
-
-#import "JPushPlugin.h"
-#import "JPUSHService.h"
-#import <UIKit/UIKit.h>
-#import <AdSupport/AdSupport.h>
-#import <UserNotifications/UserNotifications.h>
-#import "AppDelegate+JPush.h"
-#import "JPushDefine.h"
-
-@implementation NSDictionary (JPush)
--(NSString*)toJsonString{
-    NSError  *error;
-    NSData   *data       = [NSJSONSerialization dataWithJSONObject:self options:0 error:&error];
-    NSString *jsonString = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
-    return jsonString;
-}
-@end
-
-@implementation NSString (JPush)
--(NSDictionary*)toDictionary{
-    NSError      *error;
-    NSData       *jsonData = [self dataUsingEncoding:NSUTF8StringEncoding];
-    NSDictionary *dict     = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error];
-    return dict;
-}
-@end
-
-@interface JPushPlugin()
-
-@end
-
-@implementation JPushPlugin
-
--(void)startJPushSDK:(CDVInvokedUrlCommand*)command{
-    [(AppDelegate*)[UIApplication sharedApplication].delegate startJPushSDK];
-}
-
-#pragma mark- 外部接口
--(void)stopPush:(CDVInvokedUrlCommand*)command{
-    [[UIApplication sharedApplication]unregisterForRemoteNotifications];
-}
-
--(void)resumePush:(CDVInvokedUrlCommand*)command{
-    [(AppDelegate*)[UIApplication sharedApplication].delegate registerForRemoteNotification];
-}
-
--(void)isPushStopped:(CDVInvokedUrlCommand*)command{
-    NSNumber *result = [[UIApplication sharedApplication] isRegisteredForRemoteNotifications] ? @(0) : @(1);
-    [self handleResultWithValue:result command:command];
-}
-
--(void)initial:(CDVInvokedUrlCommand*)command{
-    //do nithng,because Cordova plugin use lazy load mode.
-}
-
-#ifdef __CORDOVA_4_0_0
-
-- (void)pluginInitialize {
-    NSLog(@"### pluginInitialize ");
-    [self initPlugin];
-}
-
-#else
-
-- (CDVPlugin*)initWithWebView:(UIWebView*)theWebView{
-    NSLog(@"### initWithWebView ");
-    if (self=[super initWithWebView:theWebView]) {
-    }
-    [self initPlugin];
-    return self;
-}
-
-#endif
-
--(void)initPlugin{
-    if (!SharedJPushPlugin) {
-        SharedJPushPlugin = self;
-    }
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(networkDidReceiveMessage:)
-                                                 name:kJPFNetworkDidReceiveMessageNotification
-                                               object:nil];
-}
-
-+(void)fireDocumentEvent:(NSString*)eventName jsString:(NSString*)jsString{
-    dispatch_async(dispatch_get_main_queue(), ^{
-        [SharedJPushPlugin.commandDelegate evalJs:[NSString stringWithFormat:@"cordova.fireDocumentEvent('jpush.%@',%@)", eventName, jsString]];
-    });
-}
-
--(void)setTagsWithAlias:(CDVInvokedUrlCommand*)command{
-    NSString *alias = [command argumentAtIndex:0];
-    NSArray  *tags  = [command argumentAtIndex:1];
-
-    [JPUSHService setTags:[NSSet setWithArray:tags]
-                    alias:alias
-    fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
-        CDVPluginResult *result;
-        if (iResCode == 0) {
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
-        } else {
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
-        }
-        [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-    }];
-}
-
--(void)setTags:(CDVInvokedUrlCommand*)command{
-    NSArray *tags = command.arguments;
-    [JPUSHService setTags:[NSSet setWithArray:tags]
-                    alias:nil
-    fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
-        CDVPluginResult *result;
-        if (iResCode == 0) {
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
-        } else {
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
-        }
-        [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-    }];
-}
-
--(void)setAlias:(CDVInvokedUrlCommand*)command{
-    NSString *alias = [command argumentAtIndex:0];
-    [JPUSHService setTags:nil
-                    alias:alias
-    fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
-        CDVPluginResult *result;
-        if (iResCode == 0) {
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
-        } else {
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
-        }
-        [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-    }];
-}
-
--(void)getRegistrationID:(CDVInvokedUrlCommand*)command{
-    NSString* registrationID = [JPUSHService registrationID];
-    [self handleResultWithValue:registrationID command:command];
-}
-
--(void)startLogPageView:(CDVInvokedUrlCommand*)command{
-    NSString * pageName = [command argumentAtIndex:0];
-    [JPUSHService startLogPageView:pageName];
-}
-
--(void)stopLogPageView:(CDVInvokedUrlCommand*)command{
-    NSString * pageName = [command argumentAtIndex:0];
-    [JPUSHService stopLogPageView:pageName];
-}
-
--(void)beginLogPageView:(CDVInvokedUrlCommand*)command{
-    NSString *pageName = [command argumentAtIndex:0];
-    NSNumber *duration = [command argumentAtIndex:1];
-    [JPUSHService beginLogPageView:pageName duration:duration.intValue];
-}
-
--(void)setBadge:(CDVInvokedUrlCommand*)command{
-    NSNumber *badge = [command argumentAtIndex:0];
-    [JPUSHService setBadge:badge.intValue];
-}
-
--(void)resetBadge:(CDVInvokedUrlCommand*)command{
-    [JPUSHService resetBadge];
-}
-
--(void)setApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command{
-    NSNumber *badge = [command argumentAtIndex:0];
-    [UIApplication sharedApplication].applicationIconBadgeNumber = badge.intValue;
-}
-
--(void)getApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command {
-    NSInteger num = [UIApplication sharedApplication].applicationIconBadgeNumber;
-    NSNumber *number = [NSNumber numberWithInteger:num];
-    [self handleResultWithValue:number command:command];
-}
-
--(void)setDebugModeFromIos:(CDVInvokedUrlCommand*)command{
-    [JPUSHService setDebugMode];
-}
-
--(void)setLogOFF:(CDVInvokedUrlCommand*)command{
-    [JPUSHService setLogOFF];
-}
-
--(void)crashLogON:(CDVInvokedUrlCommand*)command{
-    [JPUSHService crashLogON];
-}
-
--(void)setLocalNotification:(CDVInvokedUrlCommand*)command{
-    NSLog(@"ios 10 after please use UNNotificationRequest to set local notification, see apple doc to learn more");
-
-    NSDate       *date  = [NSDate dateWithTimeIntervalSinceNow:[[command argumentAtIndex:0] intValue]];
-    NSString     *alert = [command argumentAtIndex:1];
-    NSNumber     *badge = [command argumentAtIndex:2];
-    NSString     *idKey = [command argumentAtIndex:3];
-    NSDictionary *dict  = [command argumentAtIndex:4];
-    [JPUSHService setLocalNotification:date alertBody:alert badge:badge.intValue alertAction:nil identifierKey:idKey userInfo:dict soundName:nil];
-}
-
--(void)deleteLocalNotificationWithIdentifierKey:(CDVInvokedUrlCommand*)command{
-    NSString *identifier = [command argumentAtIndex:0];
-    JPushNotificationIdentifier *jpid = [JPushNotificationIdentifier new];
-    jpid.identifiers = @[identifier];
-    [JPUSHService removeNotification:jpid];
-}
-
--(void)clearAllLocalNotifications:(CDVInvokedUrlCommand*)command{
-    [JPUSHService removeNotification:nil];
-}
-
--(void)setLocation:(CDVInvokedUrlCommand*)command{
-    NSNumber *latitude  = [command argumentAtIndex:0];
-    NSNumber *longitude = [command argumentAtIndex:1];
-    [JPUSHService setLatitude:latitude.doubleValue longitude:longitude.doubleValue];
-}
-
--(void)getUserNotificationSettings:(CDVInvokedUrlCommand*)command{
-    if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) {
-        UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
-        WEAK_SELF(weakSelf);
-        [center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
-            NSMutableDictionary *dict = [NSMutableDictionary dictionary];
-            dict[@"authorizationStatus"]       = @(settings.authorizationStatus);
-            dict[@"soundSetting"]              = @(settings.soundSetting);
-            dict[@"badgeSetting"]              = @(settings.badgeSetting);
-            dict[@"alertSetting"]              = @(settings.alertSetting);
-            dict[@"notificationCenterSetting"] = @(settings.notificationCenterSetting);
-            dict[@"lockScreenSetting"]         = @(settings.lockScreenSetting);
-            dict[@"carPlaySetting"]            = @(settings.carPlaySetting);
-            dict[@"alertStyle"]                = @(settings.alertStyle);
-            [weakSelf handleResultWithValue:dict command:command];
-        }];
-    }else if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
-        UIUserNotificationSettings *settings = [[UIApplication sharedApplication] currentUserNotificationSettings];
-        UIUserNotificationType type = settings.types;
-        NSNumber *number = [NSNumber numberWithInteger:type];
-        [self handleResultWithValue:number command:command];
-    }else{
-        UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
-        NSNumber *number = [NSNumber numberWithInteger:type];
-        [self handleResultWithValue:number command:command];
-    }
-}
-
-#pragma mark - ios 10 APIs
-
--(void)addDismissActions:(CDVInvokedUrlCommand*)command{
-    [self addActions:command dismiss:YES];
-}
-
--(void)addNotificationActions:(CDVInvokedUrlCommand*)command{
-    [self addActions:command dismiss:NO];
-}
-
--(void)addActions:(CDVInvokedUrlCommand*)command dismiss:(BOOL)dimiss{
-    NSArray *actionsData     = [command argumentAtIndex:0];
-    NSString *categoryId     = [command argumentAtIndex:1];
-    NSMutableArray *actions  = [NSMutableArray array];
-    for (NSDictionary *dict in actionsData) {
-        NSString *title      = dict[@"title"];
-        NSString *identifier = dict[@"identifier"];
-        NSString *option     = dict[@"option"];
-        NSString *type       = dict[@"type"];
-        if ([type isEqualToString:@"textInput"]) {
-            NSString *textInputButtonTitle = dict[@"textInputButtonTitle"];
-            NSString *textInputPlaceholder = dict[@"textInputPlaceholder"];
-            UNTextInputNotificationAction *inputAction = [UNTextInputNotificationAction actionWithIdentifier:identifier title:title options:option.integerValue textInputButtonTitle:textInputButtonTitle textInputPlaceholder:textInputPlaceholder];
-            [actions addObject:inputAction];
-        } else {
-            UNNotificationAction *action = [UNNotificationAction actionWithIdentifier:title title:title options:option.integerValue];
-            [actions addObject:action];
-        }
-    }
-    UNNotificationCategory *category;
-    if (dimiss) {
-        category = [UNNotificationCategory categoryWithIdentifier:categoryId
-                                                          actions:actions
-                                                intentIdentifiers:@[]
-                                                          options:UNNotificationCategoryOptionCustomDismissAction];
-    } else {
-        category = [UNNotificationCategory categoryWithIdentifier:categoryId
-                                                          actions:actions
-                                                intentIdentifiers:@[]
-                                                          options:UNNotificationCategoryOptionNone];
-    }
-    [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObject:category]];
-}
-
-#pragma mark - 内部方法
-
-+(void)setupJPushSDK:(NSDictionary*)userInfo{
-    NSString *plistPath = [[NSBundle mainBundle] pathForResource:JPushConfig_FileName ofType:@"plist"];
-    if (plistPath == nil) {
-        NSLog(@"error: PushConfig.plist not found");
-        assert(0);
-    }
-
-    NSMutableDictionary *plistData = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
-    NSString *appkey       = [plistData valueForKey:JPushConfig_Appkey];
-    NSString *channel      = [plistData valueForKey:JPushConfig_Channel];
-    NSNumber *isProduction = [plistData valueForKey:JPushConfig_IsProduction];
-    NSNumber *isIDFA       = [plistData valueForKey:JPushConfig_IsIDFA];
-
-    NSString *advertisingId = nil;
-    if(isIDFA.boolValue) {
-        advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
-    }
-    [JPUSHService setupWithOption:userInfo
-                           appKey:appkey
-                          channel:channel
-                 apsForProduction:[isProduction boolValue]
-            advertisingIdentifier:advertisingId];
-}
-
-#pragma mark 将参数返回给js
--(void)handleResultWithValue:(id)value command:(CDVInvokedUrlCommand*)command {
-    CDVPluginResult *result = nil;
-    CDVCommandStatus status = CDVCommandStatus_OK;
-
-    if ([value isKindOfClass:[NSString class]]) {
-        value = [value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
-    } else if ([value isKindOfClass:[NSNull class]]) {
-        value = nil;
-    }
-
-    if ([value isKindOfClass:[NSObject class]]) {
-        result = [CDVPluginResult resultWithStatus:status messageAsString:value];//NSObject 类型都可以
-    } else {
-        NSLog(@"Cordova callback block returned unrecognized type: %@", NSStringFromClass([value class]));
-        result = nil;
-    }
-
-    if (!result) {
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
-    }
-    [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-}
-
-#pragma mark 设置标签及别名回调
--(void)tagsWithAliasCallback:(int)resultCode tags:(NSSet *)tags alias:(NSString *)alias {
-    if (resultCode == 0) {  // Success
-
-    } else {
-
-    }
-}
-
-- (void)networkDidReceiveMessage:(NSNotification *)notification {
-    if (notification && notification.userInfo) {
-        [JPushPlugin fireDocumentEvent:JPushDocumentEvent_ReceiveMessage
-                              jsString:[notification.userInfo toJsonString]];
-    }
-}
-
-@end
+
+//
+//  PushTalkPlugin.m
+//  PushTalk
+//
+//  Created by zhangqinghe on 13-12-13.
+//
+//
+
+#import "JPushPlugin.h"
+#import "JPUSHService.h"
+#import <UIKit/UIKit.h>
+#import <AdSupport/AdSupport.h>
+#import <UserNotifications/UserNotifications.h>
+#import "AppDelegate+JPush.h"
+#import "JPushDefine.h"
+
+@implementation NSDictionary (JPush)
+-(NSString*)toJsonString{
+    NSError  *error;
+    NSData   *data       = [NSJSONSerialization dataWithJSONObject:self options:0 error:&error];
+    NSString *jsonString = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
+    return jsonString;
+}
+@end
+
+@implementation NSString (JPush)
+-(NSDictionary*)toDictionary{
+    NSError      *error;
+    NSData       *jsonData = [self dataUsingEncoding:NSUTF8StringEncoding];
+    NSDictionary *dict     = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:&error];
+    return dict;
+}
+@end
+
+@interface JPushPlugin()
+
+@end
+
+@implementation JPushPlugin
+
+-(void)startJPushSDK:(CDVInvokedUrlCommand*)command{
+    [(AppDelegate*)[UIApplication sharedApplication].delegate startJPushSDK];
+}
+
+#pragma mark- 外部接口
+-(void)stopPush:(CDVInvokedUrlCommand*)command{
+    [[UIApplication sharedApplication]unregisterForRemoteNotifications];
+}
+
+-(void)resumePush:(CDVInvokedUrlCommand*)command{
+    [(AppDelegate*)[UIApplication sharedApplication].delegate registerForRemoteNotification];
+}
+
+-(void)isPushStopped:(CDVInvokedUrlCommand*)command{
+    NSNumber *result = [[UIApplication sharedApplication] isRegisteredForRemoteNotifications] ? @(0) : @(1);
+    [self handleResultWithValue:result command:command];
+}
+
+-(void)initial:(CDVInvokedUrlCommand*)command{
+    //do nithng,because Cordova plugin use lazy load mode.
+}
+
+#ifdef __CORDOVA_4_0_0
+
+- (void)pluginInitialize {
+    NSLog(@"### pluginInitialize ");
+    [self initPlugin];
+}
+
+#else
+
+- (CDVPlugin*)initWithWebView:(UIWebView*)theWebView{
+    NSLog(@"### initWithWebView ");
+    if (self=[super initWithWebView:theWebView]) {
+    }
+    [self initPlugin];
+    return self;
+}
+
+#endif
+
+-(void)initPlugin{
+    if (!SharedJPushPlugin) {
+        SharedJPushPlugin = self;
+    }
+    [[NSNotificationCenter defaultCenter] addObserver:self
+                                             selector:@selector(networkDidReceiveMessage:)
+                                                 name:kJPFNetworkDidReceiveMessageNotification
+                                               object:nil];
+}
+
++(void)fireDocumentEvent:(NSString*)eventName jsString:(NSString*)jsString{
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [SharedJPushPlugin.commandDelegate evalJs:[NSString stringWithFormat:@"cordova.fireDocumentEvent('jpush.%@',%@)", eventName, jsString]];
+    });
+}
+
+-(void)setTagsWithAlias:(CDVInvokedUrlCommand*)command{
+    NSString *alias = [command argumentAtIndex:0];
+    NSArray  *tags  = [command argumentAtIndex:1];
+
+    [JPUSHService setTags:[NSSet setWithArray:tags]
+                    alias:alias
+    fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
+        CDVPluginResult *result;
+        if (iResCode == 0) {
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
+        } else {
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
+        }
+        [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
+    }];
+}
+
+-(void)setTags:(CDVInvokedUrlCommand*)command{
+    NSArray *tags = command.arguments;
+    [JPUSHService setTags:[NSSet setWithArray:tags]
+                    alias:nil
+    fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
+        CDVPluginResult *result;
+        if (iResCode == 0) {
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
+        } else {
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
+        }
+        [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
+    }];
+}
+
+-(void)setAlias:(CDVInvokedUrlCommand*)command{
+    NSString *alias = [command argumentAtIndex:0];
+    [JPUSHService setTags:nil
+                    alias:alias
+    fetchCompletionHandle:^(int iResCode, NSSet *iTags, NSString *iAlias) {
+        CDVPluginResult *result;
+        if (iResCode == 0) {
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nil];
+        } else {
+            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString:nil];
+        }
+        [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
+    }];
+}
+
+-(void)getRegistrationID:(CDVInvokedUrlCommand*)command{
+    NSString* registrationID = [JPUSHService registrationID];
+    [self handleResultWithValue:registrationID command:command];
+}
+
+-(void)startLogPageView:(CDVInvokedUrlCommand*)command{
+    NSString * pageName = [command argumentAtIndex:0];
+    [JPUSHService startLogPageView:pageName];
+}
+
+-(void)stopLogPageView:(CDVInvokedUrlCommand*)command{
+    NSString * pageName = [command argumentAtIndex:0];
+    [JPUSHService stopLogPageView:pageName];
+}
+
+-(void)beginLogPageView:(CDVInvokedUrlCommand*)command{
+    NSString *pageName = [command argumentAtIndex:0];
+    NSNumber *duration = [command argumentAtIndex:1];
+    [JPUSHService beginLogPageView:pageName duration:duration.intValue];
+}
+
+-(void)setBadge:(CDVInvokedUrlCommand*)command{
+    NSNumber *badge = [command argumentAtIndex:0];
+    [JPUSHService setBadge:badge.intValue];
+}
+
+-(void)resetBadge:(CDVInvokedUrlCommand*)command{
+    [JPUSHService resetBadge];
+}
+
+-(void)setApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command{
+    NSNumber *badge = [command argumentAtIndex:0];
+    [UIApplication sharedApplication].applicationIconBadgeNumber = badge.intValue;
+}
+
+-(void)getApplicationIconBadgeNumber:(CDVInvokedUrlCommand*)command {
+    NSInteger num = [UIApplication sharedApplication].applicationIconBadgeNumber;
+    NSNumber *number = [NSNumber numberWithInteger:num];
+    [self handleResultWithValue:number command:command];
+}
+
+-(void)setDebugModeFromIos:(CDVInvokedUrlCommand*)command{
+    [JPUSHService setDebugMode];
+}
+
+-(void)setLogOFF:(CDVInvokedUrlCommand*)command{
+    [JPUSHService setLogOFF];
+}
+
+-(void)crashLogON:(CDVInvokedUrlCommand*)command{
+    [JPUSHService crashLogON];
+}
+
+-(void)setLocalNotification:(CDVInvokedUrlCommand*)command{
+    NSLog(@"ios 10 after please use UNNotificationRequest to set local notification, see apple doc to learn more");
+
+    NSDate       *date  = [NSDate dateWithTimeIntervalSinceNow:[[command argumentAtIndex:0] intValue]];
+    NSString     *alert = [command argumentAtIndex:1];
+    NSNumber     *badge = [command argumentAtIndex:2];
+    NSString     *idKey = [command argumentAtIndex:3];
+    NSDictionary *dict  = [command argumentAtIndex:4];
+    [JPUSHService setLocalNotification:date alertBody:alert badge:badge.intValue alertAction:nil identifierKey:idKey userInfo:dict soundName:nil];
+}
+
+-(void)deleteLocalNotificationWithIdentifierKey:(CDVInvokedUrlCommand*)command{
+    NSString *identifier = [command argumentAtIndex:0];
+    JPushNotificationIdentifier *jpid = [JPushNotificationIdentifier new];
+    jpid.identifiers = @[identifier];
+    [JPUSHService removeNotification:jpid];
+}
+
+-(void)clearAllLocalNotifications:(CDVInvokedUrlCommand*)command{
+    [JPUSHService removeNotification:nil];
+}
+
+-(void)setLocation:(CDVInvokedUrlCommand*)command{
+    NSNumber *latitude  = [command argumentAtIndex:0];
+    NSNumber *longitude = [command argumentAtIndex:1];
+    [JPUSHService setLatitude:latitude.doubleValue longitude:longitude.doubleValue];
+}
+
+-(void)getUserNotificationSettings:(CDVInvokedUrlCommand*)command{
+    if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) {
+        UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
+        WEAK_SELF(weakSelf);
+        [center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
+            NSMutableDictionary *dict = [NSMutableDictionary dictionary];
+            dict[@"authorizationStatus"]       = @(settings.authorizationStatus);
+            dict[@"soundSetting"]              = @(settings.soundSetting);
+            dict[@"badgeSetting"]              = @(settings.badgeSetting);
+            dict[@"alertSetting"]              = @(settings.alertSetting);
+            dict[@"notificationCenterSetting"] = @(settings.notificationCenterSetting);
+            dict[@"lockScreenSetting"]         = @(settings.lockScreenSetting);
+            dict[@"carPlaySetting"]            = @(settings.carPlaySetting);
+            dict[@"alertStyle"]                = @(settings.alertStyle);
+            [weakSelf handleResultWithValue:dict command:command];
+        }];
+    }else if ([[UIDevice currentDevice].systemVersion floatValue] >= 8.0) {
+        UIUserNotificationSettings *settings = [[UIApplication sharedApplication] currentUserNotificationSettings];
+        UIUserNotificationType type = settings.types;
+        NSNumber *number = [NSNumber numberWithInteger:type];
+        [self handleResultWithValue:number command:command];
+    }else{
+        UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
+        NSNumber *number = [NSNumber numberWithInteger:type];
+        [self handleResultWithValue:number command:command];
+    }
+}
+
+#pragma mark - ios 10 APIs
+
+-(void)addDismissActions:(CDVInvokedUrlCommand*)command{
+    [self addActions:command dismiss:YES];
+}
+
+-(void)addNotificationActions:(CDVInvokedUrlCommand*)command{
+    [self addActions:command dismiss:NO];
+}
+
+-(void)addActions:(CDVInvokedUrlCommand*)command dismiss:(BOOL)dimiss{
+    NSArray *actionsData     = [command argumentAtIndex:0];
+    NSString *categoryId     = [command argumentAtIndex:1];
+    NSMutableArray *actions  = [NSMutableArray array];
+    for (NSDictionary *dict in actionsData) {
+        NSString *title      = dict[@"title"];
+        NSString *identifier = dict[@"identifier"];
+        NSString *option     = dict[@"option"];
+        NSString *type       = dict[@"type"];
+        if ([type isEqualToString:@"textInput"]) {
+            NSString *textInputButtonTitle = dict[@"textInputButtonTitle"];
+            NSString *textInputPlaceholder = dict[@"textInputPlaceholder"];
+            UNTextInputNotificationAction *inputAction = [UNTextInputNotificationAction actionWithIdentifier:identifier title:title options:option.integerValue textInputButtonTitle:textInputButtonTitle textInputPlaceholder:textInputPlaceholder];
+            [actions addObject:inputAction];
+        } else {
+            UNNotificationAction *action = [UNNotificationAction actionWithIdentifier:title title:title options:option.integerValue];
+            [actions addObject:action];
+        }
+    }
+    UNNotificationCategory *category;
+    if (dimiss) {
+        category = [UNNotificationCategory categoryWithIdentifier:categoryId
+                                                          actions:actions
+                                                intentIdentifiers:@[]
+                                                          options:UNNotificationCategoryOptionCustomDismissAction];
+    } else {
+        category = [UNNotificationCategory categoryWithIdentifier:categoryId
+                                                          actions:actions
+                                                intentIdentifiers:@[]
+                                                          options:UNNotificationCategoryOptionNone];
+    }
+    [[UNUserNotificationCenter currentNotificationCenter] setNotificationCategories:[NSSet setWithObject:category]];
+}
+
+#pragma mark - 内部方法
+
++(void)setupJPushSDK:(NSDictionary*)userInfo{
+    NSString *plistPath = [[NSBundle mainBundle] pathForResource:JPushConfig_FileName ofType:@"plist"];
+    if (plistPath == nil) {
+        NSLog(@"error: PushConfig.plist not found");
+        assert(0);
+    }
+
+    NSMutableDictionary *plistData = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath];
+    NSString *appkey       = [plistData valueForKey:JPushConfig_Appkey];
+    NSString *channel      = [plistData valueForKey:JPushConfig_Channel];
+    NSNumber *isProduction = [plistData valueForKey:JPushConfig_IsProduction];
+    NSNumber *isIDFA       = [plistData valueForKey:JPushConfig_IsIDFA];
+
+    NSString *advertisingId = nil;
+    if(isIDFA.boolValue) {
+        advertisingId = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
+    }
+    [JPUSHService setupWithOption:userInfo
+                           appKey:appkey
+                          channel:channel
+                 apsForProduction:[isProduction boolValue]
+            advertisingIdentifier:advertisingId];
+}
+
+#pragma mark 将参数返回给js
+-(void)handleResultWithValue:(id)value command:(CDVInvokedUrlCommand*)command {
+    CDVPluginResult *result = nil;
+    CDVCommandStatus status = CDVCommandStatus_OK;
+
+    if ([value isKindOfClass:[NSString class]]) {
+        value = [value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+    } else if ([value isKindOfClass:[NSNull class]]) {
+        value = nil;
+    }
+
+    if ([value isKindOfClass:[NSObject class]]) {
+        result = [CDVPluginResult resultWithStatus:status messageAsString:value];//NSObject 类型都可以
+    } else {
+        NSLog(@"Cordova callback block returned unrecognized type: %@", NSStringFromClass([value class]));
+        result = nil;
+    }
+
+    if (!result) {
+        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
+    }
+    [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
+}
+
+#pragma mark 设置标签及别名回调
+-(void)tagsWithAliasCallback:(int)resultCode tags:(NSSet *)tags alias:(NSString *)alias {
+    if (resultCode == 0) {  // Success
+
+    } else {
+
+    }
+}
+
+- (void)networkDidReceiveMessage:(NSNotification *)notification {
+    if (notification && notification.userInfo) {
+        [JPushPlugin fireDocumentEvent:JPushDocumentEvent_ReceiveMessage
+                              jsString:[notification.userInfo toJsonString]];
+    }
+}
+
+@end

+ 0 - 0
miaomiao/plugins/jpush-phonegap-plugin/src/ios/lib/jpush-ios-3.0.6.a


+ 1 - 1
miaomiao/www/chcp.json

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

+ 4 - 4
miaomiao/www/chcp.manifest

xqd xqd xqd
@@ -409,11 +409,11 @@
   },
   {
     "file": "js/controllers/home.js",
-    "hash": "90f41e48d3ec9312dfc00a05afe9017a"
+    "hash": "ea81f908ccba442716454ee3edbe1aae"
   },
   {
     "file": "js/controllers/my.js",
-    "hash": "6b56a0483f7ad0b333cfceb23b214db9"
+    "hash": "f30b10fcb778c85095e8ad27294d60bd"
   },
   {
     "file": "js/controllers/tabs.js",
@@ -441,7 +441,7 @@
   },
   {
     "file": "js/services/homeservice.js",
-    "hash": "1303298da28869b2122062b64263e4fe"
+    "hash": "7cc80dc57709c4e8fc2d5a99502bfe07"
   },
   {
     "file": "js/services/httpinterceptor.js",
@@ -761,7 +761,7 @@
   },
   {
     "file": "templates/home/dream-detail.html",
-    "hash": "e4f9d639926508aa46c2a9844f8c15e5"
+    "hash": "a2f58837798e61eadd85e24b78537359"
   },
   {
     "file": "templates/home/index.html",

+ 1 - 1
miaomiao/www/css/style.css

xqd
@@ -554,7 +554,7 @@ a:visited,a:link{
 
     .hdcontent .utitle {
         position:relative;
-        top:-28px;
+        top: -28px;
     }
     .hdcontent .kz{
         float: right;

+ 4 - 4
miaomiao/www/js/app.js

xqd xqd
@@ -50,10 +50,10 @@
                   StatusBar.styleLightContent();
                }
                var receiveNotification = function (event) {
-                   alert("receiveMessageIniOSCallback是" + +JSON.stringify(event));
+                   // alert("receiveMessageIniOSCallback是" + +JSON.stringify(event));
                };
                var setTagsWithAliasCallback = function (event) {
-                   window.alert('result code:' + event.resultCode + ' tags:' + event.tags + ' alias:' + event.alias);
+                   // window.alert('result code:' + event.resultCode + ' tags:' + event.tags + ' alias:' + event.alias);
                };
                if (window.cordova) {
                    jpushService.init({
@@ -67,11 +67,11 @@
                            if (registrationID.length == 0) {
                                var t1 = window.setTimeout(getRegistrationID, 1000);
                            } else {
-                               alert("RegistrationID是" + registrationID);
+                               // alert("RegistrationID是" + registrationID);
                                localStorage.setItem('jpush', registrationID);
                            }
                        } catch (exception) {
-                           alert("onGetRegistrationID err:" + JSON.stringify(exception));
+                           // alert("onGetRegistrationID err:" + JSON.stringify(exception));
                        }
                    };
                    var getRegistrationID = function () {

+ 4 - 4
miaomiao/www/js/config/router.js

xqd xqd
@@ -29,17 +29,17 @@
                 }
             })
             .state('app.my_dreamdetail', {
-                url: '/my/dreamdetail',
+                url: '/my/dreamdetail?id=',
                 params:{id:null},
                 views: {
                     'app-my': {
                         templateUrl: 'templates/home/dream-detail.html',
-                        controller: 'myDreamDetailCtrl'
+                        controller: 'dreamDetailCtrl'
                     }
                 }
             })
             .state('app.home_dreamdetail', {
-                url: '/home/dreamdetail',
+                url: '/home/dreamdetail?id=',
                 params:{id:null},
                 views: {
                     'app-home': {
@@ -70,7 +70,7 @@
                 views: {
                     'app-my': {
                         templateUrl: 'templates/home/userDetail.html',
-                        controller: 'attention_DetailCtrl'
+                        controller: 'userDetailCtrl'
                     }
                 }
             })

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

xqd xqd xqd
@@ -3,15 +3,15 @@
         function ($scope,userService,$ionicNavBarDelegate, storage, $state, msg, $http, util) {
              //$ionicNavBarDelegate.showBackButton(false);
             $scope.wechat_login = function(){
-                //var scope = "snsapi_userinfo", state = "_" + (+new Date());
-                //Wechat.auth(scope, state, function (response) {
-                //     alert("response:"+JSON.stringify(response));
-                //     var response={code:1231};
+                var scope = "snsapi_userinfo", state = "_" + (+new Date());
+                // Wechat.auth(scope, state, function (response) {
+                //     // alert("response:"+JSON.stringify(response));
+                //     // var response={code:1231};
                 //    if(response.code){
                 //        msg.loading('登录中...');
                 //        userService.wechat_login(response.code).then(function(result){
                 //            msg.hide();
-                //             alert("wechat_login success: " + JSON.stringify(result));
+                //             // alert("wechat_login success: " + JSON.stringify(result));
                 //            if(result.data.data){
                 //                storage.setObject('user', result.data.data.user);
                 //                storage.set('token', result.data.data.token);
@@ -22,15 +22,15 @@
                 //                $state.go("loginAccount",{wechat:response.code})
                 //            }
                 //        },function(error){
-                //             alert("loginbywx Failed: " + JSON.stringify(error));
+                //             console.log("loginbywx Failed: " + JSON.stringify(error));
                 //            $state.go("loginAccount",{wechat:$scope.wecaht});
                 //        });
                 //    }
-                //}, function (error) {
+                // }, function (error) {
                 //    console.log("Failed: " + JSON.stringify(error));
-                //})  
+                // })  
                 $state.go("loginAccount",{wechat:1231});
-                }
+            }
     }]);
     app.controller('loginCtrl', ["$scope", "userService","$stateParams","$ionicNavBarDelegate", "storage", "$state", "msg", "$http", "util","$timeout",
         function ($scope, userService,$stateParams,$ionicNavBarDelegate, storage, $state, msg, $http, util, $timeout) {
@@ -75,7 +75,7 @@
                 }, function (error) {
                     $scope.vm.waitSeconds = "获取验证码";
                     wait(0);
-                    alert(JSON.stringify(error));
+                    // alert(JSON.stringify(error));
                     // msg.error(error.data.message);
                 });
             };

+ 3 - 3
miaomiao/www/js/controllers/add.js

xqd xqd
@@ -41,8 +41,8 @@
             };
             $scope.add = function () {
                 var data = {
-                    pics: ["https://www.ba/idu.com/img/bd_logo1.png"],
-                    //pics: $scope.imgs,
+                    // pics: ["https://www.ba/idu.com/img/bd_logo1.png"],
+                    pics: $scope.imgs,
                     video: $scope.video.server,
                     name: $scope.vm.name,
                     about: $scope.vm.about,
@@ -59,7 +59,7 @@
                 });
             };
             $scope.$on('$ionicView.beforeEnter', function () {
-                $scope.imgs=['http://q8.9026.com/attachment/e4459544b0fe0818ad79e35e0b0acaf8'];
+                $scope.imgs=[];
                 $scope.video = {};
                 $scope.vm={
                     name:'',

+ 64 - 492
miaomiao/www/js/controllers/home.js

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -1,6 +1,6 @@
 (function (app) {
     app.controller('homeCtrl', ["$scope", "$ionicTabsDelegate", "$http", 'config', "$state", "msg", "$ionicPopover", "homeService", "$ionicPopup", "$timeout", "$ionicSideMenuDelegate"
-        , function ($scope, $ionicTabsDelegate, $http, config, $state, msg, $ionicPopover, homeService, $ionicPopup, $timeout, $ionicSideMenuDelegate) {
+        , function ($scope,$ionicTabsDelegate, $http, config, $state, msg, $ionicPopover, homeService, $ionicPopup, $timeout, $ionicSideMenuDelegate) {
         $scope.$on('$ionicView.beforeEnter', function () {
             $ionicTabsDelegate.showBar(true);
             $scope.load(true);
@@ -172,8 +172,8 @@
         });
     }]);
 
-    app.controller('dreamDetailCtrl', ["$scope","$ionicHistory","$timeout", "$state", "WechatService","$ionicModal","storage","msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams","$ionicBackdrop", "$timeout", "$ionicScrollDelegate", "$interval"
-        , function ($scope, $ionicHistory,$timeout,$state,WechatService,$ionicModal, storage , msg, common, config, homeService, $ionicTabsDelegate, $stateParams,$ionicBackdrop, $timeout, $ionicScrollDelegate, $interval) {
+    app.controller('dreamDetailCtrl', ["$scope","$location","$ionicHistory","$timeout", "$state", "WechatService","$ionicModal","storage","msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams","$ionicBackdrop", "$timeout", "$ionicScrollDelegate", "$interval"
+        , function ($scope,$location, $ionicHistory,$timeout,$state,WechatService,$ionicModal, storage , msg, common, config, homeService, $ionicTabsDelegate, $stateParams,$ionicBackdrop, $timeout, $ionicScrollDelegate, $interval) {
             var id = $stateParams.id;
             var top3user = '';
             $scope.chosedIndex = 0;
@@ -307,9 +307,12 @@
                     });*/
                     Wechat.share({
                         message: {
-                            title:"瞄瞄",
+                            /*title:"瞄瞄",
                             description:"HELLO,这是我的梦想,快来围观吧!",
-                            thumb:"img/icon_cat_h.png",
+                            thumb:"img/icon_cat_h.png",*/
+                            title: $scope.dream.name,
+                            description: $scope.dream.about,
+                            thumb: "http://q8.9026.com/attachment//base/img/share/icon_cat_h.png",
                             media: {
                                 type: Wechat.Type.WEBPAGE,
                                 webpageUrl: "q8.9026.com//admin/share/view?id=" + id
@@ -325,9 +328,12 @@
                 if(type==1){
                     Wechat.share({
                         message: {
-                            title:"瞄瞄",
-                            description:"HELLO,这是我的梦想,快来围观吧!",
-                            thumb:"img/icon_cat_h.png",
+                            /*title:"瞄瞄",
+                             description:"HELLO,这是我的梦想,快来围观吧!",
+                             thumb:"img/icon_cat_h.png",*/
+                            title: $scope.dream.name,
+                            description: $scope.dream.about,
+                            thumb: "http://q8.9026.com/attachment//base/img/share/icon_cat_h.png",
                             media: {
                                 type: Wechat.Type.WEBPAGE,
                                 webpageUrl: "q8.9026.com//admin/share/view?id=" + id
@@ -469,7 +475,18 @@
                 $scope.dream.interactions[index].showmore = true;
             }
         }
-        $scope.replay = function ($event, name, index,currentindex) {
+            $scope.replay = function ($event, name, index) {
+                $event.stopPropagation();
+                    $scope.input.focus = true;
+                    $scope.input.show = true;
+                    angular.forEach($scope.dream.interactions, function (item) {
+                        item.show = false;
+                    })
+                    $scope.dream.interactions[index].show = true;
+                    $scope.input.placeholder = "评论" + name+":";
+                    $scope.vm.title='';
+                }
+        $scope.replayOther = function ($event, name, index,currentindex) {
             $event.stopPropagation();
             if($scope.dream.interactions[index].comments[currentindex].user_id!=$scope.user.id){
                 $scope.input.focus = true;
@@ -482,7 +499,17 @@
                 $scope.vm.title='';
             }
             else {
-                msg.confirm("评论","是否删除评论");
+                msg.confirm("评论","是否删除评论").then(function(result){
+                    if(result==true)
+                    {
+                        homeService.deleteComment($scope.dream.interactions[index].comments[currentindex].id).then(function(result){
+                            msg.text("删除成功");
+                            $scope.load(id);
+                        },function(error){
+                            msg.error(error.data.message);
+                        })
+                    }
+                });
             }
 
         };
@@ -686,441 +713,17 @@
             $scope.modal.remove();
           });
             $scope.toMessage = function(){
-                $state.go("app.message");
-            }
-        }]);
-    app.controller('myDreamDetailCtrl', ["$scope", "$state", "$ionicModal","storage","msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
-        , function ($scope, $state,$ionicModal, storage , msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $timeout, $ionicScrollDelegate, $interval) {
-            var id = $stateParams.id;
-            var top3user = '';
-            $scope.chosedIndex = 0;
-            $scope.clickAvatar = function(index){
-                $scope.chosedIndex = index;
-                homeService.myInfo().then(function(result){
-                    $scope.user = result.data.data;
-                });
-            };
-            // id=5;
-            $scope.$on('$ionicView.beforeEnter', function () {
-                $ionicTabsDelegate.showBar(false);
-                $scope.load(id);
-                $scope.thisUser = storage.getObject('user');
-                homeService.myInfo().then(function(result){
-                    $scope.user = result.data.data;
-                });
-                homeService.messageInfo().then(function(result){
-                    $scope.infos = result.data.data;
-                    if($scope.infos.letter.is_read==0 && $scope.infos.reply.is_read==0 && $scope.infos.systemInfo.is_read==0){
-                        $scope.showMessage=0;
-                    }
-                    else {
-                        $scope.showMessage=1;
-                    }
-                },function(error){
-
-                });
-            });
-            $scope.$on('$ionicView.leave', function () {
-                if($scope.multi.promise)$interval.cancel($scope.multi.promise);
-                if($scope.leftTimer)$interval.cancel($scope.leftTimer);
-            });
-            $scope.toSort = function(){
-                //$scope.type = 3;
-                $scope.changeType(3)
-            };
-
-            $scope.load = function (id) {
-                msg.loading();
-                homeService.dreamDetail(id).then(function (result) {
-                    msg.hide();
-                    console.log(result);
-                    $scope.showCode  = function(codeName){
-                        $scope.url = codeName;
-                        $scope.code = true;
-                    };
-                    $scope.hideCode = function(){
-                        $scope.code = false;
-                    };
-                    $scope.dream = result.data.data;
-                    if($scope.timer=='已结束'|| 100*$scope.dream.get_coin/$scope.dream.coin>=100){
-                        $scope.codeBtn = true;
-                    }
-                    if($scope.dream.video){
-                        $scope.dream.vpic = config.server+'upload/vpic/'+$scope.dream.video+'.jpg';
-                        $scope.dream.video = config.imgServer+$scope.dream.video;
-                    }
-                    var reg = new RegExp("\n", "g");
-                    $scope.dream.about = $scope.dream.about.replace(reg, "<br/>");
-                    var end_time = new Date($scope.dream.end_time.replace(/-/g, "/"));
-                    var date = new Date();
-                    var inter = (end_time.getTime() - date.getTime()) / 1000;
-                    leftTimer(inter);
-                    $scope.multi.a =  $scope.dream.a;
-                    $scope.multi.b = new Date($scope.dream.created_at.replace(/-/g, "/"));
-                    $scope.multi.c  = $scope.dream.c;
-                    $scope.multi.promise =  $scope.dream.a;
-                    var newtop3user = '' ;
-                    angular.forEach($scope.dream.top3user, function(user) {
-                        newtop3user= newtop3user +user.id+","
-                    });
-                    if(top3user!=''&&newtop3user!=top3user){
-                        //测试动画切换
-                        $timeout(function() {
-                            $scope.sort.slide1 = 'list-grow-animation';
-                            $scope.sort.slide2 = 'slide-in-both-ways';
-                            $scope.sort.slide3 = 'bounce-animation';
-                        }, 50);
-                    }
-                    top3user = newtop3user;
-                    if($scope.dream.top3user[0])$scope.sort.first = $scope.dream.top3user[0].avatar;
-                    if($scope.dream.top3user[1])$scope.sort.second = $scope.dream.top3user[1].avatar;
-                    if($scope.dream.top3user[2])$scope.sort.third = $scope.dream.top3user[2].avatar;
-                    $scope.calcmultiplier();
-                }, function (error) {
-                    msg.hide();
-                });
-            };
-
-            $scope.openSupport = function () {
-                msg.alert("支持乘数说明","支持乘数支持乘数支持乘数支持乘数");
-            };
-            $scope.multi = {
-                a: '',
-                b: '',
-                c: '',
-                result: 1,
-                promise:null
-            };
-            $scope.type = 1;//tab切换
-            $scope.tosupport = false;
-            $scope.support = function ($event) {
-                $event.stopPropagation();
-                $scope.tosupport = true;
-                $scope.vm.coin = 0;
-                $scope.index = 0;
-            };
-            $scope.cancelSupport = function () {
-                $scope.tosupport = false;
-                $scope.toshare = false;
-                $scope.input.show = false;
-
-            };
-            $scope.toshare = false;
-            $scope.toRecharge = function(){
-                $state.go("app.recharge")
-            };
-            $scope.share = function (type,$event) {
-                $scope.toshare = true;
-                if (type==0) {//分享给朋友
-                    /* Wechat.share({
-                     text: "分享的文字",
-                     scene: Wechat.Scene.SESSION    // share to 好友
-                     }, function () {
-                     alert("Success");
-                     }, function (reason) {
-                     alert("Failed: " + reason);
-                     });*/
-                    Wechat.share({
-                        message: {
-                            title:"瞄瞄",
-                            description:"HELLO,这是我的梦想,快来围观吧!",
-                            thumb:"img/icon_cat_h.png",
-                            media: {
-                                type: Wechat.Type.WEBPAGE,
-                                webpageUrl: "q8.9026.com//admin/share/view?id=" + id
-                            }
-                        },
-                        scene: Wechat.Scene.SESSION
-                    }, function () {
-                        alert("Success");
-                    }, function (reason) {
-                        alert("Failed: " + reason);
-                    });
+                //var dreamdetailUrl = $location.path();
+                if($location.path()=="/app/home/dreamdetail"){
+                    $state.go("app.message");
                 }
-                if(type==1){
-                    Wechat.share({
-                        message: {
-                            title:"瞄瞄",
-                            description:"HELLO,这是我的梦想,快来围观吧!",
-                            thumb:"img/icon_cat_h.png",
-                            media: {
-                                type: Wechat.Type.WEBPAGE,
-                                webpageUrl: "q8.9026.com//admin/share/view?id=" + id
-                            }
-                        },
-                        scene: Wechat.Scene.TIMELINE
-                    }, function () {
-                        alert("Success");
-                    }, function (reason) {
-                        alert("Failed: " + reason);
-                    });
-                }
-                //   $state.go("app.shareDream",{item:$scope.dream});
-            };
-            //实时排行
-            $scope.sort = {
-                slide: ''
-            };
-            $scope.changeType = function (type) {
-                $ionicScrollDelegate.scrollTop(true);
-                $scope.type = type;
-            };
-            $scope.index = 0;
-
-            $scope.vm = {
-                coin:"",
-                title:""
-            };
-            $scope.timer = '';
-            var leftTimer = function (countDown) {
-                if (isNaN(countDown)) {
-                    $scope.timer = '已结束';
-                    return;
-                }
-                var day=parseInt(countDown/(24*60*60));
-                var h=parseInt(countDown/(60*60)%24);
-                var m=parseInt(countDown/60%60);
-                var s=parseInt(countDown%60);
-                //$scope.timer=(h<10?'0'+h:h)+'时'+(m<10?'0'+m:m)+'分'+(s<10?'0'+s:s)+'秒';
-                if(day>0) $scope.timer = day+'天';
-                if(day<0 && h>0) $scope.timer = h+'小时';
-                if(day<0 && h<0 && m>0) $scope.timer = m+'分钟';
-                if(day<0 && h<0 && m<0) $scope.timer = '已结束';
-                /* if($scope.leftTimer)$interval.cancel($scope.leftTimer);
-                 $scope.leftTimer = $interval(function () {
-                 if (countDown >= 1) leftTimer(countDown - 1);
-                 },1000);*/
-                /*if(countDown<=0){
-                 $scope.timer='结束';
-                 }*/
-            };
-            $scope.changeIndex = function (index) {
-                $scope.index = index;
-                $scope.vm.coin = index*10;
-            };
-            $scope.vidEnded = function () {
-                alert('播放完毕');
-            };
-            //实时计算支持乘数
-            $scope.calcmultiplier = function () {
-                $scope.multi.promise = $interval(function () {
-
-                    var date = new Date();
-                    var inter = date.getTime() - $scope.multi.b.getTime();
-                    var minutes = Math.floor(inter / (60 * 1000));
-                    var number = $scope.multi.a * minutes + $scope.multi.c;//js浮点运算会失真,根据muti.a的可能值范围,比如乘以100再除以100
-                    if (number<=1) {
-                        number = 1;
-                    }
-                    //$scope.multi.result = Math.round(number * 100) / 100;
-                    $scope.multi.result = Math.round(number * 100 / 100);
-                },1000);
-                //  点击支持取消   $interval.cancel($scope.multi.promise); 获取数据后重新开始执行
-            };
-            $scope.supportDream = function (data) {
-                if(!$scope.vm.coin){
-                    msg.error("请选择梦想币数量!");
-                    return ;
+                else {
+                    $state.go("app.my_message");
                 }
-                var data = {
-                    id:id,
-                    coin:$scope.vm.coin
-                };
-                homeService.supportDream(data).then(function(result){
-                    $scope.tosupport = false;
-                    $scope.load(id);
-                    homeService.myInfo().then(function(result){
-                        $scope.user = result.data.data;
-                    });
-                    $interval.cancel($scope.multi.promise);
-                    msg.text("发送成功");
-                })
-            };
-
-            $scope.collectionDream = function(is_collection){
-                homeService.collectionDream(id,is_collection).then(function(result){
-                    $scope.dream.is_collection=result.data.data;
-                })
-            };
-
-            $scope.add = function(is_collection){
-                var data = {
-                    id:id,
-                    title:$scope.vm.title,
-                    pics:$scope.imgs,
-                    video:$scope.video.server
-                };
-                homeService.add_interaction(data).then(function(){
-                    $scope.load(id);
-                    $scope.closeModal();
-                })
-            };
-
-            $scope.showAbout = true;
-            $scope.hideAbout = false;
-            $scope.showText = function(){
-                $scope.aboutStyle = {
-                    "white-space" : "normal"
-                };
-                $scope.showAbout = false;
-                $scope.hideAbout = true;
-            };
-            $scope.hideText = function(){
-                $scope.aboutStyle = {
-                    "white-space" : "nowrap"
-                };
-                $scope.showAbout = true;
-                $scope.hideAbout = false;
-            };
-            $scope.input = {
-                placeholder: '评论',
-                focus: false,
-                show:false
-            };
-            $scope.replay = function ($event, name) {
-                $event.stopPropagation();
-                $scope.input.focus = true;
-                $scope.input.show = true;
-                $scope.input.placeholder = "评论" + name+":";
-                $scope.vm.title='';
-            };
-
-            $scope.submitComment = function (index) {
-                var interaction = $scope.dream.interactions[index];
-                var iid = interaction.id;
-                //  $scope.dream.interactions[index].comments.push($scope.vm.comment);
-                $scope.input.focus = true;
-                if ($scope.vm.comment && $scope.vm.comment == '' || !iid) return;
-                var data = {
-                    id:iid,
-                    content:$scope.vm.comment
-                };
-                console.log($scope.vm.comment+" "+iid);
-                homeService.add_comment(data).then(function(){
-                    $scope.vm.comment = '' ;
-                    $scope.load(id);
-                    $scope.closeModal();
-                })
-            };
-            $scope.bigImage = false;
-            $scope.showBigImage = function ($event,imageName) {
-                $event.stopPropagation();
-                $scope.url = imageName;
-                $scope.bigImage = true;
-            };
-            $scope.hideBigImage = function(){
-                $scope.bigImage = false;
-            };
-            $ionicModal.fromTemplateUrl('qrCode.html', {
-                scope: $scope,
-                animation: 'slide-in-up'
-            }).then(function(modal) {
-                $scope.qrCodemodal = modal;
-            });
-            $ionicModal.fromTemplateUrl('commentPic.html', {
-                scope: $scope,
-                animation: 'slide-in-up'
-            }).then(function(modal) {
-                $scope.CommentPicmodal = modal;
-            });
-
-            $scope.openCode = function() {
-                $scope.qrCodemodal.show();
-            };
-            $scope.closeCode = function() {
-                $scope.qrCodemodal.hide();
-            };
-            $ionicModal.fromTemplateUrl('commentPic.html', {
-                scope: $scope,
-                animation: 'slide-in-up'
-            }).then(function(modal) {
-                $scope.CommentPicmodal = modal;
-            });
-            $scope.openCommentPic = function(pic) {
-                $scope.CommentPicmodal.show();
-                $scope.commentPicUrl = pic;
-            };
-            $scope.closeCommentPic = function() {
-                $scope.CommentPicmodal.hide();
-            };
-            $scope.addpict = function () {
-                common.chooseImage().then(function (img) {
-                    common.uploadFiles(img,1).then(function (result) {
-                        var response = JSON.parse(result.response);
-                        var file = response.data.file;
-                        $scope.imgs.push(config.imgServer+file);
-                        console.log(JSON.stringify(config.imgServer+file));
-                    }, function (error) {
-                        msg.error('图片上传失败');
-                    });
-                }, function (error) {
-                    console.log('图片选择失败');
-                });
-            };
-            $scope.deletefile = function (file) {
-                var index = $scope.imgs.indexOf(file);
-                $scope.imgs.splice(index, 1);
-                common.deletefile(file).then(function () {
-                })
-            };
-            $scope.addvideo = function () {
-                common.chooseVideo().then(function (file) {
-                    common.uploadFiles(file, 2).then(function (result) {
-                        var response = JSON.parse(result.response);
-                        $scope.video.server = response.data.file;
-                        var file = config.imgServer+response.data.file;
-                        console.log("file:"+file);
-                        $scope.video.isOK = true;
-                        $scope.video.file = file;
-                        $scope.video.vpic = config.server+'upload/vpic/'+response.data.file+'.jpg';
-                        console.log("vpic:"+$scope.video.vpic);
-                    }, function (error) {
-                        msg.error('视频上传失败');
-                    });
-                }, function (erro) {
-                    console.log('选择视频失败');
-                });
-            };
-            $ionicModal.fromTemplateUrl('recharge-modal.html', {
-                scope: $scope,
-                animation: 'slide-in-up'
-            }).then(function(modal) {
-                $scope.rechagemodal = modal;
-            });
-
-            $scope.openRechargeModal = function() {
-                $scope.rechagemodal.show();
-                $scope.vm.money = '';
-            };
-            $scope.closeRechargeModal = function() {
-                $scope.rechagemodal.hide();
-            };
-
-            $ionicModal.fromTemplateUrl('interaction-modal.html', {
-                scope: $scope,
-                animation: 'slide-in-up'
-            }).then(function(modal) {
-                $scope.modal = modal;
-            });
-            $scope.openModal = function() {
-                $scope.modal.show();
-                $scope.vm.title = '';
-                $scope.imgs = [];
-                $scope.video = {};
-            };
-            $scope.closeModal = function() {
-                $scope.modal.hide();
-            };
-            //当我们用到模型时,清除它!
-            $scope.$on('$destroy', function() {
-                $scope.modal.remove();
-            });
-            $scope.toMessage = function(){
-                $state.go("app.my_message");
             }
         }]);
-    app.controller('userDetailCtrl', ["$scope", "$state", "$ionicModal","storage","msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
-        , function ($scope, $state,$ionicModal, storage , msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $timeout, $ionicScrollDelegate, $interval) {
+    app.controller('userDetailCtrl', ["$scope","$location", "$state", "$ionicModal","storage","msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
+        , function ($scope,$location, $state,$ionicModal, storage , msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $timeout, $ionicScrollDelegate, $interval) {
             var id = $stateParams.id;
             $scope.items = $stateParams.items;
                 $scope.$on('$ionicView.beforeEnter', function () {
@@ -1163,61 +766,18 @@
             $scope.toRecharge = function(){
                 $state.go("app.recharge")
             };
-            $scope.share = function (type,$event) {
-                $scope.toshare = true;
-                if (type==0) {//分享给朋友
-                    /* Wechat.share({
-                     text: "分享的文字",
-                     scene: Wechat.Scene.SESSION    // share to 好友
-                     }, function () {
-                     alert("Success");
-                     }, function (reason) {
-                     alert("Failed: " + reason);
-                     });*/
-                    Wechat.share({
-                        message: {
-                            title:"瞄瞄",
-                            description:"HELLO,这是我的个人资料,快来围观吧!",
-                            thumb:"img/icon_cat_h.png",
-                            media: {
-                                type: Wechat.Type.WEBPAGE,
-                                webpageUrl: "q8.9026.com//admin/share/view?id=" + id
-                            }
-                        },
-                        scene: Wechat.Scene.SESSION
-                    }, function () {
-                        alert("Success");
-                    }, function (reason) {
-                        alert("Failed: " + reason);
-                    });
-                }
-                if(type==1){
-                    Wechat.share({
-                        message: {
-                            title:"瞄瞄",
-                            description:"HELLO,这是我的个人资料,快来围观吧!",
-                            thumb:"img/icon_cat_h.png",
-                            media: {
-                                type: Wechat.Type.WEBPAGE,
-                                webpageUrl: "q8.9026.com//admin/share/view?id=" + id
-                            }
-                        },
-                        scene: Wechat.Scene.TIMELINE
-                    }, function () {
-                        alert("Success");
-                    }, function (reason) {
-                        alert("Failed: " + reason);
-                    });
-                }
-                //   $state.go("app.shareDream",{item:$scope.dream});
-            };
             $scope.toDetail = function (dream_id) {
                 if($scope.items.near_dream==null){
                     msg.alert("当前梦想","该用户没有当前梦想");
                 }
                 if($scope.items.near_dream!=null){
                     var dream_id = $scope.items.near_dream.id;
-                    $state.go('app.home_dreamdetail',{id:dream_id});
+                    if($location.path()=="/app/home/userDetail"){
+                        $state.go('app.home_dreamdetail',{id:dream_id});
+                    }
+                    else {
+                        $state.go('app.my_dreamdetail',{id:dream_id});
+                    }
                 }
             };
             $scope.toOldDream = function(){
@@ -1225,7 +785,12 @@
                     msg.alert("曾经的梦想","该用户没有曾经的梦想");
                 }
                 if($scope.items.dreams.length>1){
-                    $state.go("app.oldDream",{user_id:$scope.items.user.id});
+                    if($location.path()=="/app/home/userDetail"){
+                        $state.go('app.oldDream',{user_id:$scope.items.user.id});
+                    }
+                    else {
+                        $state.go('app.myOldDream',{user_id:$scope.items.user.id});
+                    }
                 }
             };
             $scope.toSupportDream = function(){
@@ -1233,7 +798,14 @@
                     msg.alert("支持的梦想","该用户没有支持的梦想");
                 }
                 if($scope.items.sup_dreams.length!=0){
-                    $state.go("app.supportDream",{user_id:$scope.items.user.id});
+                    if($scope.items.dreams.length>1){
+                        if($location.path()=="/app/home/userDetail"){
+                            $state.go('app.supportDream',{user_id:$scope.items.user.id});
+                        }
+                        else {
+                            $state.go('app.mySupportDream',{user_id:$scope.items.user.id});
+                        }
+                    }
                 }
             };
             $scope.collectionDream = function(is_collection){

+ 10 - 128
miaomiao/www/js/controllers/my.js

xqd xqd xqd xqd
@@ -121,6 +121,11 @@
                 myService.showAccount().then(function(result){
                     $scope.accountId = result.data.data;
                     var items = result.data.data;
+                    if(items.length==0){
+                        msg.text("请先添加账户");
+                        $state.go("app.my_account_add");
+                        return 
+                    }
                     $scope.pays=[];
                     angular.forEach(items,function(item){
                         if(item.bank_name!=null) {
@@ -134,7 +139,8 @@
                             value=item.type;
                         }
                         $scope.pays.push({id:item.id,value:value});
-                    })
+                    });
+                    $scope.vm.pay = $scope.pays[0]
                 },function(error){
                     msg.error(error.data.message)
                 })
@@ -263,130 +269,6 @@
 
         }]);
 
-    app.controller('attention_DetailCtrl', ["$scope", "$state", "$ionicModal","storage","msg", "common", "config", "homeService", "$ionicTabsDelegate", "$stateParams", "$ionicModal", "$timeout", "$ionicScrollDelegate", "$interval"
-        , function ($scope, $state,$ionicModal, storage , msg, common, config, homeService, $ionicTabsDelegate, $stateParams, $ionicModal, $timeout, $ionicScrollDelegate, $interval) {
-            var id = $stateParams.id;
-            $scope.items = $stateParams.items;
-            $scope.$on('$ionicView.beforeEnter', function () {
-                $ionicTabsDelegate.showBar(false);
-            });
-            $scope.attentionUser = function(is_care){
-                homeService.attentionUser(id,is_care).then(function(result){
-                    $scope.items.is_care=result.data.data;
-                })
-            };
-            $scope.next = function (type) {
-                //type:1 前一个,type:2 后一个
-                if($scope.items.imgs.length>0){
-                    if(type==1)
-                    {
-                        var temp=  $scope.items.imgs.splice(0,1);
-                        $scope.items.imgs.push(temp[0]);
-                    }
-                    if (type==2){
-                        var temp= $scope.items.imgs.splice($scope.items.imgs.length-1,1);
-                        $scope.items.imgs.unshift(temp[0]);
-                    }
-                }
-            };
-            $scope.bigImage = false;
-            $scope.showBigImage  = function(imageName){
-                $scope.url = imageName;
-                $scope.bigImage = true;
-            };
-            $scope.hideBigImage = function(){
-                $scope.bigImage = false;
-            };
-            $scope.cancelSupport = function () {
-                $scope.tosupport = false;
-                $scope.toshare = false;
-
-            };
-            $scope.toshare = false;
-            $scope.toshare = false;
-            $scope.toRecharge = function(){
-                $state.go("app.recharge")
-            };
-            $scope.share = function (type,$event) {
-                $scope.toshare = true;
-                if (type==0) {//分享给朋友
-                    /* Wechat.share({
-                     text: "分享的文字",
-                     scene: Wechat.Scene.SESSION    // share to 好友
-                     }, function () {
-                     alert("Success");
-                     }, function (reason) {
-                     alert("Failed: " + reason);
-                     });*/
-                    Wechat.share({
-                        message: {
-                            title:"瞄瞄",
-                            description:"HELLO,这是我的个人资料,快来围观吧!",
-                            thumb:"img/icon_cat_h.png",
-                            media: {
-                                type: Wechat.Type.WEBPAGE,
-                                webpageUrl: "q8.9026.com//admin/share/view?id=" + id
-                            }
-                        },
-                        scene: Wechat.Scene.SESSION
-                    }, function () {
-                        alert("Success");
-                    }, function (reason) {
-                        alert("Failed: " + reason);
-                    });
-                }
-                if(type==1){
-                    Wechat.share({
-                        message: {
-                            title:"瞄瞄",
-                            description:"HELLO,这是我的个人资料,快来围观吧!",
-                            thumb:"img/icon_cat_h.png",
-                            media: {
-                                type: Wechat.Type.WEBPAGE,
-                                webpageUrl: "q8.9026.com//admin/share/view?id=" + id
-                            }
-                        },
-                        scene: Wechat.Scene.TIMELINE
-                    }, function () {
-                        alert("Success");
-                    }, function (reason) {
-                        alert("Failed: " + reason);
-                    });
-                }
-                //   $state.go("app.shareDream",{item:$scope.dream});
-            };
-            $scope.toDetail = function (dream_id) {
-                if($scope.items.near_dream==null){
-                    msg.alert("当前梦想","该用户没有当前梦想");
-                }
-                if($scope.items.near_dream!=null){
-                    var dream_id = $scope.items.near_dream.id;
-                    $state.go('app.my_dreamdetail',{id:dream_id});
-                }
-            };
-            $scope.toOldDream = function(){
-                if($scope.items.dreams.length<2){
-                    msg.alert("曾经的梦想","该用户没有曾经的梦想");
-                }
-                if($scope.items.dreams.length>1){
-                    $state.go("app.myOldDream",{user_id:$scope.items.user.id});
-                }
-            };
-            $scope.toSupportDream = function(){
-                if($scope.items.sup_dreams.length==0){
-                    msg.alert("支持的梦想","该用户没有支持的梦想");
-                }
-                if($scope.items.sup_dreams.length!=0){
-                    $state.go("app.mySupportDream",{user_id:$scope.items.user.id});
-                }
-            };
-            $scope.collectionDream = function(is_collection){
-                homeService.collectionDream(id,is_collection).then(function(result){
-                    $scope.user.is_collection=result.data.data;
-                })
-            };
-        }]);
-
     app.controller('mySupportDreamCtrl', ["$scope","homeService", "$stateParams","$state", "msg"
         , function ($scope,homeService,$stateParams, $state, msg) {
             var user_id = $stateParams.user_id;
@@ -463,9 +345,9 @@
         myService.testcharge(number,2).then(function (result) {
              msg.text("充值成功");
              $scope.vm.coin = parseInt($scope.vm.coin) + parseInt(number);
-            $timeout(function(){
-                $ionicHistory.goBack();
-            },500)
+            // $timeout(function(){
+            //     $ionicHistory.goBack();
+            // },500)
         });
       }
       //充值

+ 6 - 0
miaomiao/www/js/services/homeservice.js

xqd
@@ -113,6 +113,12 @@
                     method:"post",
                     data: { number:number,goods:1,type:type}
                 })
+            },
+            deleteComment:function(id){
+                return $http({
+                    url:config.server + "api/comment/delete?id=" + id,
+                    method:"get"
+                })
             }
         };
     }]);

+ 1 - 0
miaomiao/www/js/services/jpushservice.js

xqd
@@ -5,6 +5,7 @@
         //var jpushapi=$window.plugins.jPushPlugin;
         //启动极光推送
         var _init = function (config) {
+            $window.plugins.jPushPlugin.startJPushSDK()
             $window.plugins.jPushPlugin.init();
             // //设置tag和Alias触发事件处理
             // document.addEventListener('jpush.setTagsWithAlias',config.stac,false);

+ 20 - 9
miaomiao/www/templates/home/dream-detail.html

xqd xqd
@@ -158,8 +158,7 @@
                         </a>
                     </div>
                     <div class="item" style="border-bottom:15px solid #F2F2F2;" ng-click="add_comment()" ng-repeat="interaction in dream.interactions">
-                        <div>
-                        <!--<div ng-click="replay($event,dream.user.nickname,$index)">-->
+                        <div ng-click="replay($event,dream.user.nickname,$index)">
                             <img class="head" ng-src="{{dream.user.avatar | avator}}" />
                             <span class="utitle">{{dream.user.nickname}}</span>
                             <!--<span class="utitle kz">{{dream.end_time | lastDate}}</span>-->
@@ -179,14 +178,26 @@
                                 <video ng-src="{{video.file | trustUrl}}" ng-show="video.isOK" poster="{{video.vpic}}" height="72px" width="72px" controls="controls"></video>
                             </div>
                         </div>
-                        <div class="list" style="margin-left:50px">
-                            <div class="item" ng-repeat="c in interaction.comments" ng-click="replay($event,c.user_nickname,$parent.$parent.$index,$index)" ng-if="interaction.showmore||$index<4">
-                                <img class="head" ng-src="{{c.user_avatar | avator}}" />
-                                <span>{{c.content}}</span>                                
-                                <span class="utitle">{{c.user_nickname}}</span>
-                                <span class="utitle kz">{{c.updated_at}}</span>
+                        <div class="list">
+                            <div class="item" ng-repeat="c in interaction.comments" ng-click="replayOther($event,c.user_nickname,$parent.$parent.$index,$index)" ng-if="interaction.showmore||$index<4">
+                                <div class="row">
+                                    <div class="col-20" style="text-align: right">
+                                        <img class="head" ng-src="{{c.user_avatar | avator}}" />
+                                    </div>
+                                    <div class="col-80" style="border-bottom: 1px solid #E6E6E6">
+                                        <span style="margin-top: 10px; display: inline-block">{{c.user_nickname}}</span>
+                                        <span class="utitle kz">{{c.updated_at}}</span>
+                                        <p style="white-space:normal; color: #666666">{{c.content}}</p>
+                                    </div>
+                                </div>
+
+
+                            </div>
+                            <div class="row">
+                                <div class="col-offset-20 col-80">
+                                    <p ng-click="showmore($index)" ng-if="interaction.comments.length>4" style="color: #00C3DA; margin-top: 10px; margin-bottom: 10px"> {{interaction.showmore?"关闭更多":"查看更多评论"}}</p>
+                                </div>
                             </div>
-                            <p ng-click="showmore($index)" ng-if="interaction.comments.length>4" style="color: #00C3DA"> {{interaction.showmore?"关闭更多":"查看更多"}}</p>
                         </div>
                         <!--<p ng-click="replay($event,dream.user.nickname,$index)" style="margin: 10px 0 0 50px; color: #00C3DA">评论</p>-->
                         <div class="item item-input" ng-if="input.show&&interaction.show">

+ 0 - 1
miaomiao/www/templates/my/withdraw.html

xqd
@@ -6,7 +6,6 @@
                  提现到
              </span>
                 <select name="pay" ng-model="vm.pay" ng-options="pay.value for pay in pays track by pay.id" >
-                    <option value="" selected hidden></option>
                 </select>
             </label>
             <label class="item item-input ">

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

xqd xqd xqd
@@ -88,6 +88,15 @@ class AuthController extends Controller
             return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
         $phone = $request->phone;
         $wechat = $request->wechat;
+
+        $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wxc5181c0d406023e6&secret=c349515d0079ccbc71f4a4f191c1621e&code=".$wechat."&grant_type=authorization_code";
+        $res = file_get_contents($url);     //file_get_contents获取指定路由返回的数据
+        \Log::info($res);
+        $arr = json_decode($res, true);
+        $openid='';
+        if(!$arr['errcode'])$openid = $arr['openid'];
+        \Log::info('openid: ' . $openid);
+
         $jpush = $request->jpush;
         $key = $this->keySmsCode . $phone;
         $code = Cache::store('file')->get($key);
@@ -97,7 +106,7 @@ class AuthController extends Controller
         if (empty($user)) {
             $user = UserInfoModel::create([
                 'phone'=>$phone,
-                'wechat'=>$wechat,
+                'wechat'=>$openid,
                 'jpush'=>$jpush,
                 'password'=>bcrypt(123456)
             ]);
@@ -170,7 +179,16 @@ class AuthController extends Controller
 
         if ($validator->fails())
             return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
-        $user = UserInfoModel::where('wechat',$request->wechat)->first();
+
+
+        $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wxc5181c0d406023e6&secret=c349515d0079ccbc71f4a4f191c1621e&code=".$request->wechat."&grant_type=authorization_code";
+        $res = file_get_contents($url);     //file_get_contents获取指定路由返回的数据
+        \Log::info($res);
+        $arr = json_decode($res, true);
+        $openid='';
+        if(!$arr['errcode'])$openid = $arr['openid'];
+        \Log::info('openid: ' . $openid);
+        if($openid!='')$user = UserInfoModel::where('wechat',$openid)->first();
         if (empty($user)) {
 //            return $this->error(ErrorCode::LOGIN_FAILED);
         }else{

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

xqd xqd xqd
@@ -123,9 +123,11 @@ class InteractionController extends Controller
 
         $user = $this->getUser();
         $user_id = $user->id;
+        $user_avatar = $user->avatar;
+        $user_nickname = $user->nickname;
         $interaction_id = $request->id;
         $content = $request->content;
-        $data = compact('user_id','interaction_id','content');
+        $data = compact('user_id','user_avatar','user_nickname','interaction_id','content');
         $ok = CommentInfoModel::create($data);
         if ($ok) {
             return $this->api('');
@@ -180,7 +182,11 @@ class InteractionController extends Controller
 
         $user = $this->getUser();
         $data['to_user_id'] = $user->id;
+        $data['to_user_avatar'] = $user->avatar;
+        $data['to_user_nickname'] = $user->nickname;
         $data['user_id'] =CommentInfoModel::find($request->id)->user_id;
+        $data['user_avatar'] =CommentInfoModel::find($request->id)->user_avatar;
+        $data['user_nickname'] =CommentInfoModel::find($request->id)->user_nickname;
         $data['interaction_id'] = $request->interaction_id;
         $data['content'] = $request->content;
 
@@ -195,4 +201,53 @@ class InteractionController extends Controller
             return $this->error(ErrorCode::OPERATION_FAILED);
         }
     }
+
+    /**
+     * @api {get} /api/comment/delete 删除评论
+     * @apiDescription 删除评论
+     * @apiGroup Interaction
+     * @apiParam {int} id       评论ID
+     * @apiPermission Passport
+     * @apiVersion 0.1.0
+     * @apiSuccessExample {json} Success-Response:
+     * {
+     *  "status": true,
+     *   "status_code": 0,
+     *   "message": "",
+     *   "data": ""
+     *}
+     * HTTP/1.1 200 OK
+     * @apiErrorExample {json} Error-Response:
+     * {
+     *   "status": false,
+     *   "status_code": 700,
+     *   "message": "操作失败",
+     *  "data": null
+     *}
+     * HTTP/1.1 400 Bad Request
+     */
+    public function delete(Request $request)
+    {
+        $validator = \Validator::make($request->all(),
+            [
+                'id'  => 'required',
+            ],
+            [
+                'id.required'  => '评论ID不存在',
+            ]
+        );
+
+        if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
+
+        $user = $this->getUser();
+
+
+        $ok =  CommentInfoModel::where('user_id',$user->id)->where('id',$request->id)->delete();
+
+        if ($ok) {
+            return $this->api('');
+        }else{
+            return $this->error(ErrorCode::OPERATION_FAILED);
+        }
+    }
 }

+ 6 - 1
server/app/Models/CommentInfoModel.php

xqd
@@ -10,11 +10,16 @@ class CommentInfoModel extends Model
     protected $fillable = [
         'interaction_id',
         'user_id',
+        'user_avatar',
+        'user_nickname',
+        'to_user_id',
+        'to_user_avatar',
+        'to_user_nickname',
         'level',
         'content',
         'is_read',
     ];
-    protected $hidden = ['dream_id','created_at','deleted_at','id'];
+    protected $hidden = ['dream_id','created_at','deleted_at'];
 
 
     public function CommentUser()

+ 4 - 0
server/routes/api.php

xqd
@@ -264,6 +264,10 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'as' => 'interaction.reply',
         'uses' => 'InteractionController@reply',
     ]);
+    $api->get('/comment/delete', [  //删除评论
+        'as' => 'interaction.delete',
+        'uses' => 'InteractionController@delete',
+    ]);
 
     //支付宝支付回调
     $api->post('pay/alipay/notify', [

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.