瀏覽代碼

1.分享插件更新

tags/0.0.7+2
“yanghuaxuan” 3 年之前
父節點
當前提交
fc993be67a
共有 3 個檔案被更改,包括 35 行新增20 行删除
  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 查看文件

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

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

////调用此方法
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 查看文件

@@ -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:save_image/save_image.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/encode_util.dart';
export 'package:path_provider/path_provider.dart';

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

+ 5
- 2
pubspec.yaml 查看文件

@@ -49,7 +49,10 @@ dependencies:
photo_view: ^0.10.3
imei_plugin: 1.2.0
# 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:
#path: ../secverify
@@ -91,7 +94,7 @@ dependencies:
git:
url: 'http://192.168.0.138:3000/FnuoOS_ZhiYing/tobias.git'
ref: '0.0.2'
sy_flutter_wechat: '0.2.2'
fluwx: '2.6.2'

event_bus: 1.1.1



Loading…
取消
儲存