Browse Source

1.分享插件更新

tags/0.0.7+2
“yanghuaxuan” 3 years ago
parent
commit
fc993be67a
3 changed files with 35 additions and 20 deletions
  1. +28
    -16
      lib/util/wxpay_util.dart
  2. +2
    -2
      lib/zhiying_comm.dart
  3. +5
    -2
      pubspec.yaml

+ 28
- 16
lib/util/wxpay_util.dart View File

@@ -2,24 +2,36 @@ import 'package:zhiying_comm/zhiying_comm.dart';


////微信支付简单封装 ////微信支付简单封装
class WxPayUtil { class WxPayUtil {

////调用此方法 ////调用此方法
static Future<bool> toPay(Map<String, dynamic> params) async { static Future<bool> toPay(Map<String, dynamic> params) async {
var payInfo = SyPayInfo();
payInfo.appid = params['appid'];
payInfo.noncestr = params['noncestr'];
payInfo.package = params['package'];
payInfo.partnerid = params['partnerid'];
payInfo.sign = params['sign'];
payInfo.timestamp = params['timestamp'];
payInfo.prepayid = params['prepayid'];
print("发起微信支付");
SyPayResult result = await SyFlutterWechat.pay(payInfo);
print(params);
var result = await payWithWeChat(
appId: params['appid'].toString(),
partnerId: params['partnerid'].toString(),
prepayId: params['prepayid'].toString(),
packageValue: params['package'].toString(),
nonceStr: params['noncestr'].toString(),
timeStamp:int.tryParse(params['timestamp']),
sign: params['sign'],
);


if (result == SyPayResult.success) {
return true;
} else {
return false;
}
print(result);
return result;
// var payInfo = SyPayInfo();
// payInfo.appid = params['appid'];
// payInfo.noncestr = params['noncestr'];
// payInfo.package = params['package'];
// payInfo.partnerid = params['partnerid'];
// payInfo.sign = params['sign'];
// payInfo.timestamp = params['timestamp'];
// payInfo.prepayid = params['prepayid'];
// print("发起微信支付");
// SyPayResult result = await SyFlutterWechat.pay(payInfo);
//
// if (result == SyPayResult.success) {
// return true;
// } else {
// return false;
// }
} }
} }

+ 2
- 2
lib/zhiying_comm.dart View File

@@ -44,8 +44,8 @@ export 'util/event_util/login_success_event.dart';
export 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart'; export 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart';
export 'package:save_image/save_image.dart'; export 'package:save_image/save_image.dart';
export 'package:zhiying_comm/pages/login_page/login_style_util.dart'; export 'package:zhiying_comm/pages/login_page/login_style_util.dart';
export 'package:sy_flutter_wechat/sy_flutter_wechat.dart';
export 'package:zhiying_comm/util/wxpay_util.dart'; export 'package:zhiying_comm/util/wxpay_util.dart';
export 'package:zhiying_comm/util/encode_util.dart'; export 'package:zhiying_comm/util/encode_util.dart';
export 'package:path_provider/path_provider.dart'; export 'package:path_provider/path_provider.dart';

export 'package:dio/dio.dart';
export 'package:fluwx/fluwx.dart';

+ 5
- 2
pubspec.yaml View File

@@ -49,7 +49,10 @@ dependencies:
photo_view: ^0.10.3 photo_view: ^0.10.3
imei_plugin: 1.2.0 imei_plugin: 1.2.0
# mob 分享sdk # mob 分享sdk
sharesdk_plugin: ^1.2.9
sharesdk_plugin:
git:
url: 'http://192.168.0.138:3000/FnuoOS_ZhiYing/sharesdk_plugin.git'
ref: '0.0.1'
#秒验 #秒验
secverify: secverify:
#path: ../secverify #path: ../secverify
@@ -91,7 +94,7 @@ dependencies:
git: git:
url: 'http://192.168.0.138:3000/FnuoOS_ZhiYing/tobias.git' url: 'http://192.168.0.138:3000/FnuoOS_ZhiYing/tobias.git'
ref: '0.0.2' ref: '0.0.2'
sy_flutter_wechat: '0.2.2'
fluwx: '2.6.2'


event_bus: 1.1.1 event_bus: 1.1.1




Loading…
Cancel
Save