浏览代码

添加京东sdk

tags/0.0.2+3^0
Weller 4 年前
父节点
当前提交
02ed18a98c
共有 5 个文件被更改,包括 37 次插入10 次删除
  1. +7
    -1
      .dart_tool/package_config.json
  2. +4
    -0
      example/ios/Runner.xcodeproj/project.pbxproj
  3. +3
    -1
      example/ios/Runner/Info.plist
  4. +1
    -0
      example/ios/Runner/项目资源/智莺生活/config/JDSDK.bundle/safe.jpg
  5. +22
    -8
      example/lib/main.dart

+ 7
- 1
.dart_tool/package_config.json 查看文件

@@ -367,6 +367,12 @@
"packageUri": "lib/",
"languageVersion": "2.4"
},
{
"name": "photo_view",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/photo_view-0.10.2",
"packageUri": "lib/",
"languageVersion": "2.6"
},
{
"name": "platform",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/platform-2.2.1",
@@ -638,7 +644,7 @@
"languageVersion": "2.8"
}
],
"generated": "2020-11-11T02:35:44.319396Z",
"generated": "2020-11-14T05:34:27.631373Z",
"generator": "pub",
"generatorVersion": "2.8.2"
}

+ 4
- 0
example/ios/Runner.xcodeproj/project.pbxproj 查看文件

@@ -14,6 +14,7 @@
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
9F04BF68255F882600C4594E /* JDSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 9F04BF67255F882600C4594E /* JDSDK.bundle */; };
9FFCE301251ADE0600F4F353 /* yw_1222_baichuan.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9FFCE2F7251ADE0600F4F353 /* yw_1222_baichuan.jpg */; };
9FFCE303251ADE0600F4F353 /* 1.png in Resources */ = {isa = PBXBuildFile; fileRef = 9FFCE2FB251ADE0600F4F353 /* 1.png */; };
9FFCE304251ADE0600F4F353 /* 2.png in Resources */ = {isa = PBXBuildFile; fileRef = 9FFCE2FC251ADE0600F4F353 /* 2.png */; };
@@ -51,6 +52,7 @@
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9F04BF67255F882600C4594E /* JDSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = JDSDK.bundle; sourceTree = "<group>"; };
9F2FEDAD2520C194002374CF /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
9FFCE2F7251ADE0600F4F353 /* yw_1222_baichuan.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = yw_1222_baichuan.jpg; sourceTree = "<group>"; };
9FFCE2FB251ADE0600F4F353 /* 1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = 1.png; sourceTree = "<group>"; };
@@ -159,6 +161,7 @@
9FFCE2F5251ADE0600F4F353 /* config */ = {
isa = PBXGroup;
children = (
9F04BF67255F882600C4594E /* JDSDK.bundle */,
9FFCE2F7251ADE0600F4F353 /* yw_1222_baichuan.jpg */,
);
path = config;
@@ -258,6 +261,7 @@
9FFCE305251ADE0600F4F353 /* 3.png in Resources */,
9FFCE307251ADE0600F4F353 /* 智莺生活.xcassets in Resources */,
9FFCE304251ADE0600F4F353 /* 2.png in Resources */,
9F04BF68255F882600C4594E /* JDSDK.bundle in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;


+ 3
- 1
example/ios/Runner/Info.plist 查看文件

@@ -95,7 +95,7 @@
<string>JD</string>
<key>CFBundleURLSchemes</key>
<array>
<string>sdkback</string>
<string>sdkbackf17dcdf22df3bd440fac4c3cbcc76bff</string>
</array>
</dict>
</array>
@@ -167,6 +167,8 @@
<string>alitrip</string>
<string>fleamarket</string>
<string>youku</string>
<string>suning</string>
<string>kaola</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>


+ 1
- 0
example/ios/Runner/项目资源/智莺生活/config/JDSDK.bundle/safe.jpg 查看文件

@@ -0,0 +1 @@
Y÷æúÂñõçV¥’Þûj

+ 22
- 8
example/lib/main.dart 查看文件

@@ -1,15 +1,17 @@
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_alibc/flutter_alibc.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:jdsdk/jdsdk.dart';
import 'package:provider/provider.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:zhiying_base_widget/pages/home_page/home_page.dart';
import 'package:zhiying_base_widget/pages/launch_page/launch_page.dart';
import 'package:zhiying_base_widget/register.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:zhiying_comm/util/update/app_update_util.dart';
import 'package:jdsdk/jdsdk.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

import 'util/localizations_delegate.dart';

@@ -32,7 +34,8 @@ class _MyAppState extends State<MyApp> {
return Center(
child: Text(
"走神了~\n${error.exceptionAsString()}",
style: Theme.of(context).textTheme.title.copyWith(color: Colors.redAccent),
style:
Theme.of(context).textTheme.title.copyWith(color: Colors.redAccent),
),
);
}
@@ -47,7 +50,16 @@ class _MyAppState extends State<MyApp> {
print("白川" + '${result.errorCode} ${result.errorMessage}');
});
print('初始化京东~');
Jdsdk.init(appKey: 'c0abbe1f201464ee139d613591a1be02', appSecret: 'a0eeac7105bf4c7cb573972aa03ed95c');
if (Platform.isIOS) {
Jdsdk.init(
appKey: 'f17dcdf22df3bd440fac4c3cbcc76bff',
appSecret: 'a60bea3315794ae9bb9b7ea749be8506');
} else if (Platform.isAndroid) {
Jdsdk.init(
appKey: 'c0abbe1f201464ee139d613591a1be02',
appSecret: 'a0eeac7105bf4c7cb573972aa03ed95c');
}

// app更新插件
AppUpdateUtil.initXUpdate();
}
@@ -72,14 +84,16 @@ class _MyAppState extends State<MyApp> {
const Locale('en'),
const Locale('zh'),
],
localeResolutionCallback: (Locale locale, Iterable<Locale> supportedLocales) {
localeResolutionCallback:
(Locale locale, Iterable<Locale> supportedLocales) {
print("change language ${locale.toString()}");
return locale;
},
home: GestureDetector(
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
if (!currentFocus.hasPrimaryFocus &&
currentFocus.focusedChild != null) {
FocusManager.instance.primaryFocus.unfocus();
}
},


正在加载...
取消
保存