Showing
29 changed files
with
440 additions
and
315 deletions
android/app/agconnect-services.json
deleted
100644 → 0
| 1 | -{ | ||
| 2 | - "client":{ | ||
| 3 | - "cp_id":"260086000252264275", | ||
| 4 | - "product_id":"9105385871708598142", | ||
| 5 | - "client_id":"326681575729136832", | ||
| 6 | - "client_secret":"A8D20078A192C1BD87C6B3EB5B597EF654901AE981E64701D66131A4E56A3AE9", | ||
| 7 | - "app_id":"101934783", | ||
| 8 | - "package_name":"com.naji.one_key", | ||
| 9 | - "api_key":"CV6kBSEh4lAr9VF9v+geTdQebNtGEGQ4HcgN1igodItOCuGghaF1do+cxeVplpcEpe3pf3nwbkChLzCvkxtHvQOaPkTs" | ||
| 10 | - }, | ||
| 11 | - "configuration_version":"1.0" | ||
| 12 | -} |
| @@ -13,12 +13,12 @@ if (flutterRoot == null) { | @@ -13,12 +13,12 @@ if (flutterRoot == null) { | ||
| 13 | 13 | ||
| 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') |
| 15 | if (flutterVersionCode == null) { | 15 | if (flutterVersionCode == null) { |
| 16 | - flutterVersionCode = '1' | 16 | + flutterVersionCode = '7' |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') |
| 20 | if (flutterVersionName == null) { | 20 | if (flutterVersionName == null) { |
| 21 | - flutterVersionName = '1.0' | 21 | + flutterVersionName = '1.0.7' |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | apply plugin: 'com.android.application' | 24 | apply plugin: 'com.android.application' |
| @@ -53,28 +53,13 @@ android { | @@ -53,28 +53,13 @@ android { | ||
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | manifestPlaceholders = [ | 55 | manifestPlaceholders = [ |
| 56 | - JPUSH_PKGNAME : applicationId, | ||
| 57 | - JPUSH_APPKEY : "27ceb79c44af41ad99202f7a", // NOTE: JPush 上注册的包名对应的 Appkey. | ||
| 58 | - JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可. | ||
| 59 | - HUAWEI_APPID:"101934783",//华为平台注册的appid | ||
| 60 | - XIAOMI_APPKEY : "MI-5811835841457", // 小米平台注册的appkey | ||
| 61 | - XIAOMI_APPID : "MI-2882303761518358457", // 小米平台注册的appid | ||
| 62 | - OPPO_APPKEY : "OP-94d77d10e7bb4c60bcf18a84c8ca8bdd", // OPPO平台注册的appkey | ||
| 63 | - OPPO_APPID : "OP-30260281", // OPPO平台注册的appid | ||
| 64 | - OPPO_APPSECRET: "OP-9b7e372f93794593953f93f118619570",//OPPO平台注册的appsecret | ||
| 65 | -// VIVO_APPKEY : "5811835841457", // VIVO平台注册的appkey | ||
| 66 | -// VIVO_APPID : "2882303761518358457", // VIVO平台注册的appid | 56 | + XG_ACCESS_ID : '1500012875', |
| 57 | + XG_ACCESS_KEY : 'AVR2GJERH0HC', | ||
| 58 | + HW_APPID : '102832405', | ||
| 59 | + VIVO_APPID: "103886384", | ||
| 60 | + VIVO_APPKEY:"5a04e5c3485c0b19a2911c95dcaff5d2", | ||
| 61 | + PACKAGE_NAME : "com.naji.one_key",// 小米通道 | ||
| 67 | ] | 62 | ] |
| 68 | - | ||
| 69 | -// manifestPlaceholders = [ | ||
| 70 | -// XG_ACCESS_ID : '2100332241', | ||
| 71 | -// XG_ACCESS_KEY : 'A51T8RX1HS1W', | ||
| 72 | -// XG_ACCESS_SCHEME: 'fake_push',// 非官方参数,可自定义,统一打开方式为 intent | ||
| 73 | -// HW_APPID : '100728875', | ||
| 74 | -// XIAOMI_APPID : '2882303761517989384', | ||
| 75 | -// XIAOMI_APPKEY : '5141798993384', | ||
| 76 | -// PACKAGE_NAME : "${applicationId}",// 小米通道 | ||
| 77 | -// ] | ||
| 78 | } | 63 | } |
| 79 | 64 | ||
| 80 | signingConfigs { | 65 | signingConfigs { |
| @@ -115,17 +100,8 @@ dependencies { | @@ -115,17 +100,8 @@ dependencies { | ||
| 115 | testImplementation 'junit:junit:4.12' | 100 | testImplementation 'junit:junit:4.12' |
| 116 | androidTestImplementation 'androidx.test:runner:1.1.1' | 101 | androidTestImplementation 'androidx.test:runner:1.1.1' |
| 117 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' | 102 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' |
| 118 | - | ||
| 119 | - //华为推送 | ||
| 120 | - implementation 'cn.jiguang.sdk.plugin:huawei:3.5.8' | ||
| 121 | - implementation 'com.huawei.hms:push:3.0.3.301' | ||
| 122 | - | ||
| 123 | - //小米推送 | ||
| 124 | - implementation 'cn.jiguang.sdk.plugin:xiaomi:3.5.8' | ||
| 125 | - | ||
| 126 | - //OPPO推送 | ||
| 127 | - implementation 'cn.jiguang.sdk.plugin:oppo:3.5.8' | ||
| 128 | -// | ||
| 129 | -// //vivo推送 | ||
| 130 | -// implementation 'cn.jiguang.sdk.plugin:vivo:3.5.8' | 103 | + implementation 'com.tencent.tpns:huawei:1.2.0.3-release'// 华为推送 |
| 104 | + implementation 'com.tencent.tpns:xiaomi:1.2.0.3-release' // 小米推送 | ||
| 105 | + implementation 'com.tencent.tpns:oppo:1.2.0.3-release' // OPPO 推送 | ||
| 106 | + implementation 'com.tencent.tpns:vivo:1.2.0.3-release' // vivo 推送 | ||
| 131 | } | 107 | } |
| 1 | -<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 2 | - package="com.naji.one_key"> | ||
| 3 | - <!-- Flutter needs it to communicate with the running application | ||
| 4 | - to allow setting breakpoints, to provide hot reload, etc. | ||
| 5 | - --> | ||
| 6 | - <uses-permission android:name="android.permission.INTERNET"/> | ||
| 7 | -</manifest> |
| @@ -32,13 +32,6 @@ | @@ -32,13 +32,6 @@ | ||
| 32 | </intent-filter> | 32 | </intent-filter> |
| 33 | </activity> | 33 | </activity> |
| 34 | 34 | ||
| 35 | - <service | ||
| 36 | - android:name="cn.jpush.android.service.PluginHuaweiPlatformsService" | ||
| 37 | - android:exported="false"> | ||
| 38 | - <intent-filter> | ||
| 39 | - <action android:name="com.huawei.push.action.MESSAGING_EVENT" /> | ||
| 40 | - </intent-filter> | ||
| 41 | - </service> | ||
| 42 | <!-- Don't delete the meta-data below. | 35 | <!-- Don't delete the meta-data below. |
| 43 | This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> | 36 | This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> |
| 44 | <meta-data | 37 | <meta-data |
android/app/src/main/res/raw/tts_all.mp3
0 → 100644
No preview for this file type
android/app/src/main/res/raw/tts_cancel.mp3
0 → 100644
No preview for this file type
android/app/tpns-configs.json
0 → 100644
assets/mine_radio_nor.png
0 → 100644
932 Bytes
assets/mine_radio_sel.png
0 → 100644
2.1 KB
ios/Podfile
100644 → 100755
| 1 | # Uncomment this line to define a global platform for your project | 1 | # Uncomment this line to define a global platform for your project |
| 2 | - source 'https://github.com/CocoaPods/Specs.git' | ||
| 3 | - platform :ios, '8.0' | 2 | +# source 'https://github.com/CocoaPods/Specs.git' |
| 3 | + platform :ios, '9.0' | ||
| 4 | 4 | ||
| 5 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. | 5 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. |
| 6 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' | 6 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' |
| 1 | PODS: | 1 | PODS: |
| 2 | - audioplayers (0.0.1): | 2 | - audioplayers (0.0.1): |
| 3 | - Flutter | 3 | - Flutter |
| 4 | + - Bugly (2.5.71) | ||
| 4 | - connectivity (0.0.1): | 5 | - connectivity (0.0.1): |
| 5 | - Flutter | 6 | - Flutter |
| 6 | - Reachability | 7 | - Reachability |
| 8 | + - connectivity_for_web (0.1.0): | ||
| 9 | + - Flutter | ||
| 7 | - connectivity_macos (0.0.1): | 10 | - connectivity_macos (0.0.1): |
| 8 | - Flutter | 11 | - Flutter |
| 9 | - contacts_service (0.2.2): | 12 | - contacts_service (0.2.2): |
| @@ -11,33 +14,36 @@ PODS: | @@ -11,33 +14,36 @@ PODS: | ||
| 11 | - device_info (0.0.1): | 14 | - device_info (0.0.1): |
| 12 | - Flutter | 15 | - Flutter |
| 13 | - Flutter (1.0.0) | 16 | - Flutter (1.0.0) |
| 17 | + - flutter_bugly (0.0.1): | ||
| 18 | + - Bugly | ||
| 19 | + - Flutter | ||
| 14 | - flutter_statusbarcolor (0.0.1): | 20 | - flutter_statusbarcolor (0.0.1): |
| 15 | - Flutter | 21 | - Flutter |
| 16 | - fluttertoast (0.0.2): | 22 | - fluttertoast (0.0.2): |
| 17 | - Flutter | 23 | - Flutter |
| 18 | - fluwx (0.0.1): | 24 | - fluwx (0.0.1): |
| 19 | - Flutter | 25 | - Flutter |
| 20 | - - WechatOpenSDK (= 1.8.6.2) | 26 | + - WechatOpenSDK (= 1.8.7.1) |
| 21 | - FMDB (2.7.5): | 27 | - FMDB (2.7.5): |
| 22 | - FMDB/standard (= 2.7.5) | 28 | - FMDB/standard (= 2.7.5) |
| 23 | - FMDB/standard (2.7.5) | 29 | - FMDB/standard (2.7.5) |
| 24 | - install_plugin (0.0.1): | 30 | - install_plugin (0.0.1): |
| 25 | - Flutter | 31 | - Flutter |
| 26 | - - JCore (2.2.5) | ||
| 27 | - - JPush (3.3.2): | ||
| 28 | - - JCore (< 3.0.0, >= 2.0.0) | ||
| 29 | - - jpush_flutter (0.0.2): | 32 | + - package_info (0.0.1): |
| 30 | - Flutter | 33 | - Flutter |
| 31 | - - JPush | ||
| 32 | - path_provider (0.0.1): | 34 | - path_provider (0.0.1): |
| 33 | - Flutter | 35 | - Flutter |
| 36 | + - path_provider_linux (0.0.1): | ||
| 37 | + - Flutter | ||
| 34 | - path_provider_macos (0.0.1): | 38 | - path_provider_macos (0.0.1): |
| 35 | - Flutter | 39 | - Flutter |
| 36 | - - permission_handler (4.4.0): | 40 | + - "permission_handler (4.4.0+hotfix.4)": |
| 37 | - Flutter | 41 | - Flutter |
| 38 | - Reachability (3.2) | 42 | - Reachability (3.2) |
| 39 | - shared_preferences (0.0.1): | 43 | - shared_preferences (0.0.1): |
| 40 | - Flutter | 44 | - Flutter |
| 45 | + - shared_preferences_linux (0.0.1): | ||
| 46 | + - Flutter | ||
| 41 | - shared_preferences_macos (0.0.1): | 47 | - shared_preferences_macos (0.0.1): |
| 42 | - Flutter | 48 | - Flutter |
| 43 | - shared_preferences_web (0.0.1): | 49 | - shared_preferences_web (0.0.1): |
| @@ -45,50 +51,58 @@ PODS: | @@ -45,50 +51,58 @@ PODS: | ||
| 45 | - sqflite (0.0.1): | 51 | - sqflite (0.0.1): |
| 46 | - Flutter | 52 | - Flutter |
| 47 | - FMDB (~> 2.7.2) | 53 | - FMDB (~> 2.7.2) |
| 54 | + - TPNS-iOS (1.2.7.2) | ||
| 55 | + - tpns_flutter_plugin (1.0.4): | ||
| 56 | + - Flutter | ||
| 57 | + - TPNS-iOS (= 1.2.7.2) | ||
| 48 | - url_launcher (0.0.1): | 58 | - url_launcher (0.0.1): |
| 49 | - Flutter | 59 | - Flutter |
| 60 | + - url_launcher_linux (0.0.1): | ||
| 61 | + - Flutter | ||
| 50 | - url_launcher_macos (0.0.1): | 62 | - url_launcher_macos (0.0.1): |
| 51 | - Flutter | 63 | - Flutter |
| 52 | - url_launcher_web (0.0.1): | 64 | - url_launcher_web (0.0.1): |
| 53 | - Flutter | 65 | - Flutter |
| 54 | -<<<<<<< HEAD | ||
| 55 | - - WechatOpenSDK (1.8.6.2) | ||
| 56 | -======= | ||
| 57 | - webview_flutter (0.0.1): | 66 | - webview_flutter (0.0.1): |
| 58 | - Flutter | 67 | - Flutter |
| 59 | - WechatOpenSDK (1.8.7.1) | 68 | - WechatOpenSDK (1.8.7.1) |
| 60 | ->>>>>>> dev | ||
| 61 | 69 | ||
| 62 | DEPENDENCIES: | 70 | DEPENDENCIES: |
| 63 | - audioplayers (from `.symlinks/plugins/audioplayers/ios`) | 71 | - audioplayers (from `.symlinks/plugins/audioplayers/ios`) |
| 64 | - connectivity (from `.symlinks/plugins/connectivity/ios`) | 72 | - connectivity (from `.symlinks/plugins/connectivity/ios`) |
| 73 | + - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) | ||
| 65 | - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) | 74 | - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) |
| 66 | - contacts_service (from `.symlinks/plugins/contacts_service/ios`) | 75 | - contacts_service (from `.symlinks/plugins/contacts_service/ios`) |
| 67 | - device_info (from `.symlinks/plugins/device_info/ios`) | 76 | - device_info (from `.symlinks/plugins/device_info/ios`) |
| 68 | - Flutter (from `Flutter`) | 77 | - Flutter (from `Flutter`) |
| 78 | + - flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`) | ||
| 69 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) | 79 | - flutter_statusbarcolor (from `.symlinks/plugins/flutter_statusbarcolor/ios`) |
| 70 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) | 80 | - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) |
| 71 | - fluwx (from `.symlinks/plugins/fluwx/ios`) | 81 | - fluwx (from `.symlinks/plugins/fluwx/ios`) |
| 72 | - install_plugin (from `.symlinks/plugins/install_plugin/ios`) | 82 | - install_plugin (from `.symlinks/plugins/install_plugin/ios`) |
| 73 | - - jpush_flutter (from `.symlinks/plugins/jpush_flutter/ios`) | 83 | + - package_info (from `.symlinks/plugins/package_info/ios`) |
| 74 | - path_provider (from `.symlinks/plugins/path_provider/ios`) | 84 | - path_provider (from `.symlinks/plugins/path_provider/ios`) |
| 85 | + - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) | ||
| 75 | - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`) | 86 | - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`) |
| 76 | - permission_handler (from `.symlinks/plugins/permission_handler/ios`) | 87 | - permission_handler (from `.symlinks/plugins/permission_handler/ios`) |
| 77 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) | 88 | - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) |
| 89 | + - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) | ||
| 78 | - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) | 90 | - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) |
| 79 | - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) | 91 | - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) |
| 80 | - sqflite (from `.symlinks/plugins/sqflite/ios`) | 92 | - sqflite (from `.symlinks/plugins/sqflite/ios`) |
| 93 | + - tpns_flutter_plugin (from `.symlinks/plugins/tpns_flutter_plugin/ios`) | ||
| 81 | - url_launcher (from `.symlinks/plugins/url_launcher/ios`) | 94 | - url_launcher (from `.symlinks/plugins/url_launcher/ios`) |
| 95 | + - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`) | ||
| 82 | - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) | 96 | - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) |
| 83 | - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) | 97 | - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) |
| 84 | - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) | 98 | - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) |
| 85 | 99 | ||
| 86 | SPEC REPOS: | 100 | SPEC REPOS: |
| 87 | - https://github.com/CocoaPods/Specs.git: | 101 | + trunk: |
| 102 | + - Bugly | ||
| 88 | - FMDB | 103 | - FMDB |
| 89 | - - JCore | ||
| 90 | - - JPush | ||
| 91 | - Reachability | 104 | - Reachability |
| 105 | + - TPNS-iOS | ||
| 92 | - WechatOpenSDK | 106 | - WechatOpenSDK |
| 93 | 107 | ||
| 94 | EXTERNAL SOURCES: | 108 | EXTERNAL SOURCES: |
| @@ -96,6 +110,8 @@ EXTERNAL SOURCES: | @@ -96,6 +110,8 @@ EXTERNAL SOURCES: | ||
| 96 | :path: ".symlinks/plugins/audioplayers/ios" | 110 | :path: ".symlinks/plugins/audioplayers/ios" |
| 97 | connectivity: | 111 | connectivity: |
| 98 | :path: ".symlinks/plugins/connectivity/ios" | 112 | :path: ".symlinks/plugins/connectivity/ios" |
| 113 | + connectivity_for_web: | ||
| 114 | + :path: ".symlinks/plugins/connectivity_for_web/ios" | ||
| 99 | connectivity_macos: | 115 | connectivity_macos: |
| 100 | :path: ".symlinks/plugins/connectivity_macos/ios" | 116 | :path: ".symlinks/plugins/connectivity_macos/ios" |
| 101 | contacts_service: | 117 | contacts_service: |
| @@ -104,6 +120,8 @@ EXTERNAL SOURCES: | @@ -104,6 +120,8 @@ EXTERNAL SOURCES: | ||
| 104 | :path: ".symlinks/plugins/device_info/ios" | 120 | :path: ".symlinks/plugins/device_info/ios" |
| 105 | Flutter: | 121 | Flutter: |
| 106 | :path: Flutter | 122 | :path: Flutter |
| 123 | + flutter_bugly: | ||
| 124 | + :path: ".symlinks/plugins/flutter_bugly/ios" | ||
| 107 | flutter_statusbarcolor: | 125 | flutter_statusbarcolor: |
| 108 | :path: ".symlinks/plugins/flutter_statusbarcolor/ios" | 126 | :path: ".symlinks/plugins/flutter_statusbarcolor/ios" |
| 109 | fluttertoast: | 127 | fluttertoast: |
| @@ -112,24 +130,32 @@ EXTERNAL SOURCES: | @@ -112,24 +130,32 @@ EXTERNAL SOURCES: | ||
| 112 | :path: ".symlinks/plugins/fluwx/ios" | 130 | :path: ".symlinks/plugins/fluwx/ios" |
| 113 | install_plugin: | 131 | install_plugin: |
| 114 | :path: ".symlinks/plugins/install_plugin/ios" | 132 | :path: ".symlinks/plugins/install_plugin/ios" |
| 115 | - jpush_flutter: | ||
| 116 | - :path: ".symlinks/plugins/jpush_flutter/ios" | 133 | + package_info: |
| 134 | + :path: ".symlinks/plugins/package_info/ios" | ||
| 117 | path_provider: | 135 | path_provider: |
| 118 | :path: ".symlinks/plugins/path_provider/ios" | 136 | :path: ".symlinks/plugins/path_provider/ios" |
| 137 | + path_provider_linux: | ||
| 138 | + :path: ".symlinks/plugins/path_provider_linux/ios" | ||
| 119 | path_provider_macos: | 139 | path_provider_macos: |
| 120 | :path: ".symlinks/plugins/path_provider_macos/ios" | 140 | :path: ".symlinks/plugins/path_provider_macos/ios" |
| 121 | permission_handler: | 141 | permission_handler: |
| 122 | :path: ".symlinks/plugins/permission_handler/ios" | 142 | :path: ".symlinks/plugins/permission_handler/ios" |
| 123 | shared_preferences: | 143 | shared_preferences: |
| 124 | :path: ".symlinks/plugins/shared_preferences/ios" | 144 | :path: ".symlinks/plugins/shared_preferences/ios" |
| 145 | + shared_preferences_linux: | ||
| 146 | + :path: ".symlinks/plugins/shared_preferences_linux/ios" | ||
| 125 | shared_preferences_macos: | 147 | shared_preferences_macos: |
| 126 | :path: ".symlinks/plugins/shared_preferences_macos/ios" | 148 | :path: ".symlinks/plugins/shared_preferences_macos/ios" |
| 127 | shared_preferences_web: | 149 | shared_preferences_web: |
| 128 | :path: ".symlinks/plugins/shared_preferences_web/ios" | 150 | :path: ".symlinks/plugins/shared_preferences_web/ios" |
| 129 | sqflite: | 151 | sqflite: |
| 130 | :path: ".symlinks/plugins/sqflite/ios" | 152 | :path: ".symlinks/plugins/sqflite/ios" |
| 153 | + tpns_flutter_plugin: | ||
| 154 | + :path: ".symlinks/plugins/tpns_flutter_plugin/ios" | ||
| 131 | url_launcher: | 155 | url_launcher: |
| 132 | :path: ".symlinks/plugins/url_launcher/ios" | 156 | :path: ".symlinks/plugins/url_launcher/ios" |
| 157 | + url_launcher_linux: | ||
| 158 | + :path: ".symlinks/plugins/url_launcher_linux/ios" | ||
| 133 | url_launcher_macos: | 159 | url_launcher_macos: |
| 134 | :path: ".symlinks/plugins/url_launcher_macos/ios" | 160 | :path: ".symlinks/plugins/url_launcher_macos/ios" |
| 135 | url_launcher_web: | 161 | url_launcher_web: |
| @@ -139,37 +165,39 @@ EXTERNAL SOURCES: | @@ -139,37 +165,39 @@ EXTERNAL SOURCES: | ||
| 139 | 165 | ||
| 140 | SPEC CHECKSUMS: | 166 | SPEC CHECKSUMS: |
| 141 | audioplayers: 84f968cea3f2deab00ec4f8ff53358b3c0b3992c | 167 | audioplayers: 84f968cea3f2deab00ec4f8ff53358b3c0b3992c |
| 142 | - connectivity: 6e94255659cc86dcbef1d452ad3e0491bb1b3e75 | 168 | + Bugly: fd066c75c4a0eca1440f9b6a84bd37d51bfc85ac |
| 169 | + connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 | ||
| 170 | + connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b | ||
| 143 | connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 | 171 | connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 |
| 144 | contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca | 172 | contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca |
| 145 | device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 | 173 | device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 |
| 146 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec | 174 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec |
| 175 | + flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3 | ||
| 147 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 | 176 | flutter_statusbarcolor: 8afb1071ed8c58be929f1e32b36c629771fd2259 |
| 148 | fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b | 177 | fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b |
| 149 | - fluwx: 03e098a7284c556d7b197e0b82984eb0b25183af | 178 | + fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902 |
| 150 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a | 179 | FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a |
| 151 | install_plugin: a13e7ddd2bab0c701b48cd359c26d0394125b6fb | 180 | install_plugin: a13e7ddd2bab0c701b48cd359c26d0394125b6fb |
| 152 | - JCore: d75c0306dc99875d323d23e5a063b3a3ef22335a | ||
| 153 | - JPush: 9468c84a3809dc3ac2fc1c89c6d1d6c858a91bf5 | ||
| 154 | - jpush_flutter: 69133df35eaf9135e540549b154d992c44f8ee44 | ||
| 155 | - path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d | 181 | + package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 |
| 182 | + path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c | ||
| 183 | + path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 | ||
| 156 | path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 | 184 | path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 |
| 157 | - permission_handler: f615215121f43c1640d2b8500d4ad749512828a8 | 185 | + permission_handler: 8278954f2382902f63f00dd8828769c0bd6d511b |
| 158 | Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 | 186 | Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 |
| 159 | - shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01 | 187 | + shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d |
| 188 | + shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 | ||
| 160 | shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 | 189 | shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 |
| 161 | shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 | 190 | shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 |
| 162 | sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0 | 191 | sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0 |
| 163 | - url_launcher: a1c0cc845906122c4784c542523d8cacbded5626 | 192 | + TPNS-iOS: 9b35473a4a0d07f2c2730ea1e66c6749c2b98095 |
| 193 | + tpns_flutter_plugin: 8dbbee157aab91a878f64d056c1383726a6c5c4d | ||
| 194 | + url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef | ||
| 195 | + url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 | ||
| 164 | url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 | 196 | url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 |
| 165 | url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c | 197 | url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c |
| 166 | -<<<<<<< HEAD | ||
| 167 | - WechatOpenSDK: 8b3ba4239193d1112205c139c94e21934e8f369a | ||
| 168 | -======= | ||
| 169 | webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 | 198 | webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 |
| 170 | WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 | 199 | WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 |
| 171 | ->>>>>>> dev | ||
| 172 | 200 | ||
| 173 | -PODFILE CHECKSUM: a5c9f5cbedb217afa5108d75ed888500ab689803 | 201 | +PODFILE CHECKSUM: 6d186dc4668603071619657511aa873d9a684d13 |
| 174 | 202 | ||
| 175 | COCOAPODS: 1.9.1 | 203 | COCOAPODS: 1.9.1 |
| @@ -84,5 +84,9 @@ | @@ -84,5 +84,9 @@ | ||
| 84 | <false/> | 84 | <false/> |
| 85 | <key>io.flutter.embedded_views_preview</key> | 85 | <key>io.flutter.embedded_views_preview</key> |
| 86 | <true/> | 86 | <true/> |
| 87 | + <key>XG_ACCESS_ID</key> | ||
| 88 | + <string>${1600012876}</string> | ||
| 89 | + <key>XG_ACCESS_KEY</key> | ||
| 90 | + <string>${INUIMFK21WGH}</string> | ||
| 87 | </dict> | 91 | </dict> |
| 88 | </plist> | 92 | </plist> |
| @@ -11,6 +11,7 @@ import 'package:one_key/provider/message_dialog_model.dart'; | @@ -11,6 +11,7 @@ import 'package:one_key/provider/message_dialog_model.dart'; | ||
| 11 | import 'package:intl/date_symbol_data_local.dart'; | 11 | import 'package:intl/date_symbol_data_local.dart'; |
| 12 | import 'package:one_key/utils/utils.dart'; | 12 | import 'package:one_key/utils/utils.dart'; |
| 13 | import 'package:provider/provider.dart'; | 13 | import 'package:provider/provider.dart'; |
| 14 | +import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; | ||
| 14 | 15 | ||
| 15 | import 'app.dart'; | 16 | import 'app.dart'; |
| 16 | import 'net/dio_util.dart'; | 17 | import 'net/dio_util.dart'; |
| @@ -79,6 +80,7 @@ class MyAppState extends State<MyApp>{ | @@ -79,6 +80,7 @@ class MyAppState extends State<MyApp>{ | ||
| 79 | LogUtil.v("is installed $result"); | 80 | LogUtil.v("is installed $result"); |
| 80 | } | 81 | } |
| 81 | 82 | ||
| 83 | +//初始化dio | ||
| 82 | initDio() { | 84 | initDio() { |
| 83 | DioUtil.openDebug(); | 85 | DioUtil.openDebug(); |
| 84 | Options options = DioUtil.getDefOptions(); | 86 | Options options = DioUtil.getDefOptions(); |
| 1 | import 'dart:async'; | 1 | import 'dart:async'; |
| 2 | -import 'dart:convert'; | ||
| 3 | - | ||
| 4 | -//import 'package:fake_push/fake_push.dart' as fake; | ||
| 5 | import 'package:flutter/cupertino.dart'; | 2 | import 'package:flutter/cupertino.dart'; |
| 6 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
| 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 8 | -import 'package:jpush_flutter/jpush_flutter.dart'; | ||
| 9 | -import 'package:one_key/models/message.dart'; | ||
| 10 | import 'package:one_key/pages/message/message_page.dart'; | 5 | import 'package:one_key/pages/message/message_page.dart'; |
| 11 | import 'package:one_key/pages/my/my_page.dart'; | 6 | import 'package:one_key/pages/my/my_page.dart'; |
| 12 | import 'package:one_key/pages/notebook/notebook_page.dart'; | 7 | import 'package:one_key/pages/notebook/notebook_page.dart'; |
| @@ -19,11 +14,10 @@ import 'package:one_key/provider/update_model.dart'; | @@ -19,11 +14,10 @@ import 'package:one_key/provider/update_model.dart'; | ||
| 19 | import 'package:one_key/provider/user_model.dart'; | 14 | import 'package:one_key/provider/user_model.dart'; |
| 20 | import 'package:one_key/res/colors.dart'; | 15 | import 'package:one_key/res/colors.dart'; |
| 21 | import 'package:one_key/utils/log_util.dart'; | 16 | import 'package:one_key/utils/log_util.dart'; |
| 22 | -import 'package:one_key/utils/navigator_util.dart'; | ||
| 23 | import 'package:one_key/utils/utils.dart'; | 17 | import 'package:one_key/utils/utils.dart'; |
| 24 | import 'package:provider/provider.dart'; | 18 | import 'package:provider/provider.dart'; |
| 25 | -import 'package:flutter/services.dart'; | ||
| 26 | import 'package:shared_preferences/shared_preferences.dart'; | 19 | import 'package:shared_preferences/shared_preferences.dart'; |
| 20 | +import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; | ||
| 27 | 21 | ||
| 28 | class HomePage extends StatefulWidget{ | 22 | class HomePage extends StatefulWidget{ |
| 29 | 23 | ||
| @@ -40,22 +34,14 @@ class HomePage extends StatefulWidget{ | @@ -40,22 +34,14 @@ class HomePage extends StatefulWidget{ | ||
| 40 | 34 | ||
| 41 | class HomePageState extends State<HomePage>{ | 35 | class HomePageState extends State<HomePage>{ |
| 42 | 36 | ||
| 43 | -// 信鸽推送 | ||
| 44 | -// fake.Push _push = fake.Push(); | ||
| 45 | -// StreamSubscription<String> _receiveDeviceToken; | ||
| 46 | -// StreamSubscription<fake.Message> _receiveMessage; | ||
| 47 | -// StreamSubscription<fake.Message> _receiveNotification; | ||
| 48 | -// StreamSubscription<String> _launchNotification; | ||
| 49 | -// StreamSubscription<String> _resumeNotification; | ||
| 50 | - | ||
| 51 | -// 极光推送 | ||
| 52 | - final JPush jpush = new JPush(); | ||
| 53 | 37 | ||
| 54 | List<Widget> pages = List<Widget>(); | 38 | List<Widget> pages = List<Widget>(); |
| 55 | int _currIndex = 1; | 39 | int _currIndex = 1; |
| 56 | Color _activeColor = MyColours.color_2bb5b7; | 40 | Color _activeColor = MyColours.color_2bb5b7; |
| 57 | Color _defaultColor = MyColours.color_bfbfbf; | 41 | Color _defaultColor = MyColours.color_bfbfbf; |
| 58 | 42 | ||
| 43 | + Timer timer; | ||
| 44 | + | ||
| 59 | @override | 45 | @override |
| 60 | void initState() { | 46 | void initState() { |
| 61 | // TODO: implement initState | 47 | // TODO: implement initState |
| @@ -75,155 +61,91 @@ class HomePageState extends State<HomePage>{ | @@ -75,155 +61,91 @@ class HomePageState extends State<HomePage>{ | ||
| 75 | create: (_)=>MyModel(), | 61 | create: (_)=>MyModel(), |
| 76 | child: MyPage(), | 62 | child: MyPage(), |
| 77 | )); | 63 | )); |
| 78 | - initJPush(); | ||
| 79 | -// initXinge(); | ||
| 80 | WidgetsBinding.instance.addPostFrameCallback((_){ | 64 | WidgetsBinding.instance.addPostFrameCallback((_){ |
| 81 | if(widget.initialIndex==0)return; | 65 | if(widget.initialIndex==0)return; |
| 82 | - ContactModel.getInstance().uploadLocalContact(context); | ||
| 83 | -// getUntreatedMessage(); | ||
| 84 | -// UpdateModel updateModel=new UpdateModel(); | ||
| 85 | -// updateModel.checkUpdate(context); | ||
| 86 | - }); | ||
| 87 | - } | ||
| 88 | - | ||
| 89 | - | ||
| 90 | - Future<void> initJPush() async { | ||
| 91 | - try { | ||
| 92 | - jpush.addEventHandler( | ||
| 93 | - onReceiveNotification: (Map<String, dynamic> message) async { | ||
| 94 | - LogUtil.v("flutter onReceiveNotification: $message"); | ||
| 95 | - Map<String,dynamic> messageMap=(json.decode(message["extras"]["cn.jpush.android.EXTRA"]) as Map<String,dynamic>)["extras"]; | ||
| 96 | - Provider.of<MessageDialogModel>(context,listen: false).addMessage(context,Message.fromJson(messageMap)); | ||
| 97 | - }, onOpenNotification: (Map<String, dynamic> message) async { | ||
| 98 | - LogUtil.v("flutter onOpenNotification: $message"); | ||
| 99 | - NavigatorUtil.goHomePage(context,initialIndex: 0); | ||
| 100 | - }, onReceiveMessage: (Map<String, dynamic> message) async { | ||
| 101 | - LogUtil.v("flutter onReceiveMessage: $message"); | ||
| 102 | - }, onReceiveNotificationAuthorization: | ||
| 103 | - (Map<String, dynamic> message) async { | ||
| 104 | - LogUtil.v("flutter onReceiveNotificationAuthorization: $message"); | 66 | + ContactModel.getInstance().uploadLocalContact(context); |
| 67 | + timer=Timer.periodic(Duration(minutes: 3), (_){ | ||
| 68 | + getUntreatedMessage(); | ||
| 105 | }); | 69 | }); |
| 106 | - } on PlatformException {} | ||
| 107 | - | ||
| 108 | - jpush.setup( | ||
| 109 | - appKey: "27ceb79c44af41ad99202f7a", //你自己应用的 AppKey | ||
| 110 | - channel: "theChannel", | ||
| 111 | - production: false, | ||
| 112 | - debug: true, | ||
| 113 | - ); | ||
| 114 | - | ||
| 115 | - jpush.applyPushAuthority( | ||
| 116 | - new NotificationSettingsIOS(sound: true, alert: true, badge: false)); | ||
| 117 | - | ||
| 118 | - // Platform messages may fail, so we use a try/catch PlatformException. | ||
| 119 | - jpush.getRegistrationID().then((rid) { | ||
| 120 | - LogUtil.v("flutter get registration id : $rid"); | ||
| 121 | - userTokenInit(rid); | ||
| 122 | - }); | ||
| 123 | - jpush.isNotificationEnabled().then((bool value) { | ||
| 124 | - if (!value) { | ||
| 125 | - //没有打开通知 | ||
| 126 | - jpush.openSettingsForNotification(); | ||
| 127 | - } | 70 | + UpdateModel updateModel=new UpdateModel(); |
| 71 | + updateModel.checkUpdate(context); | ||
| 128 | }); | 72 | }); |
| 73 | + initPlatformState(); | ||
| 129 | } | 74 | } |
| 130 | 75 | ||
| 131 | //初始化信鸽推送 | 76 | //初始化信鸽推送 |
| 132 | - void initXinge(){ | ||
| 133 | -// _receiveDeviceToken = | ||
| 134 | -// _push.receiveDeviceToken().listen(_handleReceiveDeviceToken); | ||
| 135 | -// _receiveMessage = _push.receiveMessage().listen(_handleReceiveMessage); | ||
| 136 | -// _receiveNotification = | ||
| 137 | -// _push.receiveNotification().listen(_handleReceiveNotification); | ||
| 138 | -// _launchNotification = | ||
| 139 | -// _push.launchNotification().listen(_handleLaunchNotification); | ||
| 140 | -// _resumeNotification = | ||
| 141 | -// _push.resumeNotification().listen(_handleResumeNotification); | ||
| 142 | -// | ||
| 143 | -// _push.startWork(enableDebug: !_isReleaseMode()); | ||
| 144 | -// | ||
| 145 | -// // 第二次打开应用再调用 | ||
| 146 | -// SharedPreferences.getInstance().then((SharedPreferences sharedPref) { | ||
| 147 | -// if (sharedPref.getBool('firstStart') ?? true) { | ||
| 148 | -// sharedPref.setBool('firstStart', false); | ||
| 149 | -// } else { | ||
| 150 | -// _push.areNotificationsEnabled().then((bool isEnabled) { | ||
| 151 | -// if (!isEnabled) { | ||
| 152 | -// showCupertinoDialog( | ||
| 153 | -// context: context, | ||
| 154 | -// builder: (BuildContext context) { | ||
| 155 | -// return CupertinoAlertDialog( | ||
| 156 | -// title: const Text('提示'), | ||
| 157 | -// content: const Text('开启通知权限可收到更多优质内容'), | ||
| 158 | -// actions: <Widget>[ | ||
| 159 | -// CupertinoDialogAction( | ||
| 160 | -// child: const Text('取消'), | ||
| 161 | -// onPressed: () { | ||
| 162 | -// Navigator.of(context).pop(); | ||
| 163 | -// }, | ||
| 164 | -// ), | ||
| 165 | -// CupertinoDialogAction( | ||
| 166 | -// child: const Text('设置'), | ||
| 167 | -// onPressed: () { | ||
| 168 | -// _push.openNotificationsSettings(); | ||
| 169 | -// Navigator.of(context).pop(); | ||
| 170 | -// }, | ||
| 171 | -// ), | ||
| 172 | -// ], | ||
| 173 | -// ); | ||
| 174 | -// }, | ||
| 175 | -// ); | ||
| 176 | -// } | ||
| 177 | -// }); | ||
| 178 | -// } | ||
| 179 | -// }); | ||
| 180 | - } | 77 | + Future<void> initPlatformState() async { |
| 78 | + // If the widget was removed from the tree while the asynchronous platform | ||
| 79 | + // message was in flight, we want to discard the reply rather than calling | ||
| 80 | + // setState to update our non-existent appearance. | ||
| 81 | + if (!mounted) return; | ||
| 181 | 82 | ||
| 182 | - bool _isReleaseMode() { | ||
| 183 | - return const bool.fromEnvironment('dart.vm.product'); | ||
| 184 | - } | 83 | + /// 开启DEBUG |
| 84 | + XgFlutterPlugin().setEnableDebug(true); | ||
| 185 | 85 | ||
| 186 | - void _handleReceiveDeviceToken(String deviceToken) async { | ||
| 187 | -// String token=await _push.getDeviceToken(); | ||
| 188 | -// print('receiveDeviceToken: $deviceToken - $token'); | ||
| 189 | -// userTokenInit2(token); | ||
| 190 | - } | 86 | + /// 添加回调事件 |
| 87 | + XgFlutterPlugin().addEventHandler( | ||
| 88 | + onRegisteredDeviceToken: (String msg) async { | ||
| 89 | + print("flutter onRegisteredDeviceToken: $msg"); | ||
| 90 | + }, | ||
| 91 | + onRegisteredDone: (String msg) async { | ||
| 92 | + print("flutter onRegisteredDone: $msg"); | ||
| 93 | + LogUtil.v("注册成功"); | ||
| 94 | + userTokenInit(msg); | ||
| 95 | + }, | ||
| 96 | + unRegistered: (String msg) async { | ||
| 97 | + print("flutter unRegistered: $msg"); | ||
| 98 | + }, | ||
| 99 | + onReceiveNotificationResponse: (Map<String, dynamic> msg) async { | ||
| 100 | + LogUtil.v("flutter onReceiveNotificationResponse $msg"); | ||
| 101 | + }, | ||
| 102 | + onReceiveMessage: (Map<String, dynamic> msg) async { | ||
| 103 | + print("flutter onReceiveMessage $msg"); | ||
| 104 | + }, | ||
| 105 | + xgPushDidSetBadge: (String msg) async { | ||
| 106 | + print("flutter xgPushDidSetBadge: $msg"); | ||
| 191 | 107 | ||
| 192 | -// void _handleReceiveMessage(fake.Message message) { | ||
| 193 | -// print( | ||
| 194 | -// 'receiveMessage: ${message.title} - ${message.content} - ${message.customContent}'); | ||
| 195 | -// } | ||
| 196 | -// | ||
| 197 | -// void _handleReceiveNotification(fake.Message notification) { | ||
| 198 | -// print( | ||
| 199 | -// 'receiveNotification: ${notification.title} - ${notification.content} - ${notification.customContent}'); | ||
| 200 | -// | ||
| 201 | -// } | ||
| 202 | -// | ||
| 203 | -// void _handleLaunchNotification(String customContent) { | ||
| 204 | -// print('launchNotification: $customContent'); | ||
| 205 | -// | ||
| 206 | -// } | ||
| 207 | -// | ||
| 208 | -// void _handleResumeNotification(String customContent) { | ||
| 209 | -// print('resumeNotification: $customContent'); | ||
| 210 | -// | ||
| 211 | -// } | 108 | + /// 在此可设置应用角标 |
| 109 | + /// XgFlutterPlugin().setAppBadge(0);; | ||
| 110 | + }, | ||
| 111 | + xgPushDidBindWithIdentifier: (String msg) async { | ||
| 112 | + print("flutter xgPushDidBindWithIdentifier: $msg"); | ||
| 113 | + }, | ||
| 114 | + xgPushDidUnbindWithIdentifier: (String msg) async { | ||
| 115 | + print("flutter xgPushDidUnbindWithIdentifier: $msg"); | ||
| 116 | + }, | ||
| 117 | + xgPushDidUpdatedBindedIdentifier: (String msg) async { | ||
| 118 | + print("flutter xgPushDidUpdatedBindedIdentifier: $msg"); | ||
| 119 | + }, | ||
| 120 | + xgPushDidClearAllIdentifiers: (String msg) async { | ||
| 121 | + print("flutter xgPushDidClearAllIdentifiers: $msg"); | ||
| 122 | + }, | ||
| 123 | + xgPushClickAction: (Map<String, dynamic> msg) async { | ||
| 124 | + print("flutter xgPushClickAction $msg"); | ||
| 125 | + }, | ||
| 126 | + ); | ||
| 212 | 127 | ||
| 213 | - //初始化推送token | ||
| 214 | - userTokenInit(String registrationId){ | ||
| 215 | - UserModel userModel=Provider.of<UserModel>(context,listen: false); | ||
| 216 | - userModel.registrationId=registrationId; | ||
| 217 | - Map<String,String> params={ | ||
| 218 | - "sid":userModel.user.sellerid, | ||
| 219 | - "account":userModel.user.account, | ||
| 220 | - "registrationId":registrationId | ||
| 221 | - }; | ||
| 222 | - userModel.userTokenInit(context, params); | 128 | + /// 如果您的应用非广州集群则需要在startXG之前调用此函数 |
| 129 | + /// 香港:tpns.hk.tencent.com | ||
| 130 | + /// 新加坡:tpns.sgp.tencent.com | ||
| 131 | + /// 上海:tpns.sh.tencent.com | ||
| 132 | + // XgFlutterPlugin().configureClusterDomainName("tpns.hk.tencent.com"); | ||
| 133 | + | ||
| 134 | + /// 设置OPPO AppKey 和 AppSecret | ||
| 135 | + XgFlutterPlugin().getXgAndroidApi().enableOppoNotification(); | ||
| 136 | + XgFlutterPlugin().getXgAndroidApi().setOppoPushAppId(appId:"30260281"); | ||
| 137 | + XgFlutterPlugin().getXgAndroidApi().setOppoPushAppKey(appKey: "9b7e372f93794593953f93f118619570"); | ||
| 138 | + // 设置小米 AppID 和 AppKey。 | ||
| 139 | + XgFlutterPlugin().getXgAndroidApi().setMiPushAppId(appId:"2882303761518639456"); | ||
| 140 | + XgFlutterPlugin().getXgAndroidApi().setMiPushAppKey(appKey: "5231863961456"); | ||
| 141 | + XgFlutterPlugin().getXgAndroidApi().enableOtherPush(); | ||
| 142 | + /// 启动TPNS服务 | ||
| 143 | + XgFlutterPlugin().startXg("1600012876", "INUIMFK21WGH"); | ||
| 223 | } | 144 | } |
| 224 | 145 | ||
| 146 | + | ||
| 225 | //初始化推送token | 147 | //初始化推送token |
| 226 | - userTokenInit2(String token){ | 148 | + userTokenInit(String token){ |
| 227 | UserModel userModel=Provider.of<UserModel>(context,listen: false); | 149 | UserModel userModel=Provider.of<UserModel>(context,listen: false); |
| 228 | userModel.token=token; | 150 | userModel.token=token; |
| 229 | Map<String,String> params={ | 151 | Map<String,String> params={ |
| @@ -332,22 +254,11 @@ class HomePageState extends State<HomePage>{ | @@ -332,22 +254,11 @@ class HomePageState extends State<HomePage>{ | ||
| 332 | @override | 254 | @override |
| 333 | void dispose() { | 255 | void dispose() { |
| 334 | // TODO: implement dispose | 256 | // TODO: implement dispose |
| 335 | -// if (_receiveDeviceToken != null) { | ||
| 336 | -// _receiveDeviceToken.cancel(); | ||
| 337 | -// } | ||
| 338 | -// if (_receiveMessage != null) { | ||
| 339 | -// _receiveMessage.cancel(); | ||
| 340 | -// } | ||
| 341 | -// if (_receiveNotification != null) { | ||
| 342 | -// _receiveNotification.cancel(); | ||
| 343 | -// } | ||
| 344 | -// if (_launchNotification != null) { | ||
| 345 | -// _launchNotification.cancel(); | ||
| 346 | -// } | ||
| 347 | -// if (_resumeNotification != null) { | ||
| 348 | -// _resumeNotification.cancel(); | ||
| 349 | -// } | ||
| 350 | super.dispose(); | 257 | super.dispose(); |
| 351 | LogUtil.v("home_dispose"); | 258 | LogUtil.v("home_dispose"); |
| 259 | + if(timer!=null){ | ||
| 260 | + timer.cancel(); | ||
| 261 | + } | ||
| 262 | + XgFlutterPlugin().stopXg(); | ||
| 352 | } | 263 | } |
| 353 | } | 264 | } |
| @@ -33,6 +33,8 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver{ | @@ -33,6 +33,8 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver{ | ||
| 33 | 33 | ||
| 34 | String errorText="";//错误提示 | 34 | String errorText="";//错误提示 |
| 35 | 35 | ||
| 36 | + bool _check = true; | ||
| 37 | + | ||
| 36 | @override | 38 | @override |
| 37 | void initState(){ | 39 | void initState(){ |
| 38 | // TODO: implement initState | 40 | // TODO: implement initState |
| @@ -279,7 +281,66 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver{ | @@ -279,7 +281,66 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver{ | ||
| 279 | ), | 281 | ), |
| 280 | ); | 282 | ); |
| 281 | }, | 283 | }, |
| 282 | - ) | 284 | + ), |
| 285 | + VEmptyView(20), | ||
| 286 | + Row( | ||
| 287 | + // mainAxisSize: MainAxisSize.min, | ||
| 288 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 289 | + children: <Widget>[ | ||
| 290 | + InkWell( | ||
| 291 | + onTap: () { | ||
| 292 | + setState(() { | ||
| 293 | + _check = !_check; | ||
| 294 | + }); | ||
| 295 | + }, | ||
| 296 | + child: Container( | ||
| 297 | + // color: Colors.red, | ||
| 298 | + // height: ScreenUtil().setWidth(34), | ||
| 299 | + padding: EdgeInsets.only( | ||
| 300 | + left: ScreenUtil().setWidth(102), | ||
| 301 | + top: ScreenUtil().setWidth(10), | ||
| 302 | + bottom: ScreenUtil().setWidth(10)), | ||
| 303 | + child: Center( | ||
| 304 | + child: Image.asset( | ||
| 305 | + _check | ||
| 306 | + ? "assets/mine_radio_sel.png" | ||
| 307 | + : "assets/mine_radio_nor.png", | ||
| 308 | + width: ScreenUtil().setWidth(42), | ||
| 309 | + height: ScreenUtil().setWidth(42)), | ||
| 310 | + ))), | ||
| 311 | + HEmptyView(6), | ||
| 312 | + Text( | ||
| 313 | + '已阅读并同意', | ||
| 314 | + style: TextStyle( | ||
| 315 | + fontSize: ScreenUtil().setSp(24), | ||
| 316 | + color: MyColours.color_353535), | ||
| 317 | + ), | ||
| 318 | + InkWell( | ||
| 319 | + onTap: () { | ||
| 320 | + NavigatorUtil.goWebPage(context, '软件服务协议', "xy"); | ||
| 321 | + }, | ||
| 322 | + child: Text( | ||
| 323 | + '《软件服务协议》', | ||
| 324 | + style: TextStyle( | ||
| 325 | + fontSize: ScreenUtil().setSp(24), | ||
| 326 | + color: MyColours.color_2bb5b7), | ||
| 327 | + ), | ||
| 328 | + ), | ||
| 329 | + Text('及', | ||
| 330 | + style: TextStyle( | ||
| 331 | + fontSize: ScreenUtil().setSp(24), | ||
| 332 | + color: MyColours.color_353535)), | ||
| 333 | + InkWell( | ||
| 334 | + onTap: () { | ||
| 335 | + NavigatorUtil.goWebPage(context, '隐私政策', "zc"); | ||
| 336 | + }, | ||
| 337 | + child: Text('《隐私政策》', | ||
| 338 | + style: TextStyle( | ||
| 339 | + fontSize: ScreenUtil().setSp(24), | ||
| 340 | + color: MyColours.color_2bb5b7)), | ||
| 341 | + ) | ||
| 342 | + ], | ||
| 343 | + ), | ||
| 283 | ], | 344 | ], |
| 284 | ), | 345 | ), |
| 285 | ), | 346 | ), |
lib/pages/login/web_page.dart
0 → 100644
| 1 | +import 'dart:async'; | ||
| 2 | + | ||
| 3 | +import 'package:flutter/material.dart'; | ||
| 4 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 5 | +import 'package:webview_flutter/webview_flutter.dart'; | ||
| 6 | + | ||
| 7 | +class WebPage extends StatelessWidget { | ||
| 8 | + final String title; | ||
| 9 | + final String url; | ||
| 10 | + | ||
| 11 | + const WebPage({Key key, this.title, this.url}) : super(key: key); | ||
| 12 | + @override | ||
| 13 | + Widget build(BuildContext context) { | ||
| 14 | + final Completer<WebViewController> _controller = | ||
| 15 | + Completer<WebViewController>(); | ||
| 16 | + return Scaffold( | ||
| 17 | + appBar: SystemAppBar(title), | ||
| 18 | + body: WebView( | ||
| 19 | + initialUrl: "http://colorcun.com/privacy1.html", | ||
| 20 | + javascriptMode: JavascriptMode.unrestricted, | ||
| 21 | + onWebViewCreated: (WebViewController webViewController) { | ||
| 22 | + // Loading.showLoading(context); | ||
| 23 | + _controller.complete(webViewController); | ||
| 24 | + }, | ||
| 25 | + javascriptChannels: <JavascriptChannel>[ | ||
| 26 | + _toasterJavascriptChannel(context), | ||
| 27 | + ].toSet(), | ||
| 28 | + navigationDelegate: (NavigationRequest request) { | ||
| 29 | + if (request.url.startsWith('https://www.youtube.com/')) { | ||
| 30 | + return NavigationDecision.prevent; | ||
| 31 | + } | ||
| 32 | + return NavigationDecision.navigate; | ||
| 33 | + }, | ||
| 34 | + onPageStarted: (String url) { | ||
| 35 | + | ||
| 36 | + }, | ||
| 37 | + onPageFinished: (String url) { | ||
| 38 | + // Loading.hideLoading(context); | ||
| 39 | + }, | ||
| 40 | + gestureNavigationEnabled: true, | ||
| 41 | + ), | ||
| 42 | + ); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + JavascriptChannel _toasterJavascriptChannel(BuildContext context) { | ||
| 46 | + return JavascriptChannel( | ||
| 47 | + name: 'Toaster', | ||
| 48 | + onMessageReceived: (JavascriptMessage message) { | ||
| 49 | + Scaffold.of(context).showSnackBar( | ||
| 50 | + SnackBar(content: Text(message.message)), | ||
| 51 | + ); | ||
| 52 | + }); | ||
| 53 | + } | ||
| 54 | +} |
| @@ -30,6 +30,7 @@ class MessageDialogItem extends StatelessWidget { | @@ -30,6 +30,7 @@ class MessageDialogItem extends StatelessWidget { | ||
| 30 | child: Stack( | 30 | child: Stack( |
| 31 | children: <Widget>[ | 31 | children: <Widget>[ |
| 32 | Container( | 32 | Container( |
| 33 | + height: ScreenUtil().setWidth(280), | ||
| 33 | margin: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(39),vertical: ScreenUtil().setWidth(12)), | 34 | margin: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(39),vertical: ScreenUtil().setWidth(12)), |
| 34 | padding: EdgeInsets.fromLTRB( | 35 | padding: EdgeInsets.fromLTRB( |
| 35 | ScreenUtil().setWidth(12), | 36 | ScreenUtil().setWidth(12), |
| @@ -63,26 +64,39 @@ class MessageDialogItem extends StatelessWidget { | @@ -63,26 +64,39 @@ class MessageDialogItem extends StatelessWidget { | ||
| 63 | ], | 64 | ], |
| 64 | ), | 65 | ), |
| 65 | VEmptyView(20), | 66 | VEmptyView(20), |
| 67 | + message.message_type=="11"? | ||
| 66 | Text( | 68 | Text( |
| 67 | - "包间需求:${message.room_demand}", | 69 | + "${message.ddateStr}的${message.rnameStr}取消了预订", |
| 68 | style: TextStyle( | 70 | style: TextStyle( |
| 69 | color: textColor, | 71 | color: textColor, |
| 70 | fontSize: ScreenUtil().setSp(28)), | 72 | fontSize: ScreenUtil().setSp(28)), |
| 71 | - ), | ||
| 72 | - VEmptyView(10), | ||
| 73 | - Text( | ||
| 74 | - "就餐时间:${message.ddateStr}", | ||
| 75 | - style: TextStyle( | ||
| 76 | - color: textColor, | ||
| 77 | - fontSize: ScreenUtil().setSp(28)), | ||
| 78 | - ), | ||
| 79 | - VEmptyView(10), | ||
| 80 | - Text( | ||
| 81 | - "预订人:${message.rnameStr}", | ||
| 82 | - style: TextStyle( | ||
| 83 | - color: textColor, | ||
| 84 | - fontSize: ScreenUtil().setSp(28)), | ||
| 85 | - ), | 73 | + ): |
| 74 | + Column( | ||
| 75 | + mainAxisSize: MainAxisSize.min, | ||
| 76 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 77 | + children: <Widget>[ | ||
| 78 | + Text( | ||
| 79 | + "包间需求:${message.room_demand}", | ||
| 80 | + style: TextStyle( | ||
| 81 | + color: textColor, | ||
| 82 | + fontSize: ScreenUtil().setSp(28)), | ||
| 83 | + ), | ||
| 84 | + VEmptyView(10), | ||
| 85 | + Text( | ||
| 86 | + "就餐时间:${message.ddateStr}", | ||
| 87 | + style: TextStyle( | ||
| 88 | + color: textColor, | ||
| 89 | + fontSize: ScreenUtil().setSp(28)), | ||
| 90 | + ), | ||
| 91 | + VEmptyView(10), | ||
| 92 | + Text( | ||
| 93 | + "预订人:${message.rnameStr}", | ||
| 94 | + style: TextStyle( | ||
| 95 | + color: textColor, | ||
| 96 | + fontSize: ScreenUtil().setSp(28)), | ||
| 97 | + ), | ||
| 98 | + ], | ||
| 99 | + ) | ||
| 86 | ], | 100 | ], |
| 87 | ), | 101 | ), |
| 88 | ), | 102 | ), |
| @@ -95,11 +109,15 @@ class MessageDialogItem extends StatelessWidget { | @@ -95,11 +109,15 @@ class MessageDialogItem extends StatelessWidget { | ||
| 95 | width: 160, | 109 | width: 160, |
| 96 | height: 48, | 110 | height: 48, |
| 97 | fontSize: 28, | 111 | fontSize: 28, |
| 98 | - content: "立即处理", | 112 | + content: message.message_type=="10"?"立即处理":"立即查看", |
| 99 | state: 1, | 113 | state: 1, |
| 100 | onPress: () { | 114 | onPress: () { |
| 101 | messageDialogModel.removeMessage(message.id); | 115 | messageDialogModel.removeMessage(message.id); |
| 102 | - NavigatorUtil.goHandleOnlinePage(context,message.rid.toString(),message.id,replace: messageDialogModel.messages.isEmpty); | 116 | + if(message.message_type=="10"){ |
| 117 | + NavigatorUtil.goHandleOnlinePage(context,message.rid.toString(),message.id,replace: messageDialogModel.messages.isEmpty); | ||
| 118 | + }else{ | ||
| 119 | + NavigatorUtil.goNotebookDetailPage(context,message.rid); | ||
| 120 | + } | ||
| 103 | }, | 121 | }, |
| 104 | ), | 122 | ), |
| 105 | ), | 123 | ), |
| @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; | @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; | ||
| 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 3 | import 'package:one_key/models/notebook.dart'; | 3 | import 'package:one_key/models/notebook.dart'; |
| 4 | import 'package:one_key/provider/SmsModel.dart'; | 4 | import 'package:one_key/provider/SmsModel.dart'; |
| 5 | +import 'package:one_key/provider/contact_model.dart'; | ||
| 5 | import 'package:one_key/provider/user_model.dart'; | 6 | import 'package:one_key/provider/user_model.dart'; |
| 6 | import 'package:one_key/res/colors.dart'; | 7 | import 'package:one_key/res/colors.dart'; |
| 7 | import 'package:one_key/utils/utils.dart'; | 8 | import 'package:one_key/utils/utils.dart'; |
| @@ -40,6 +41,7 @@ class SmsPageState extends State<SmsPage>{ | @@ -40,6 +41,7 @@ class SmsPageState extends State<SmsPage>{ | ||
| 40 | userModel=Provider.of<UserModel>(context,listen: false); | 41 | userModel=Provider.of<UserModel>(context,listen: false); |
| 41 | WidgetsBinding.instance.addPostFrameCallback((_){ | 42 | WidgetsBinding.instance.addPostFrameCallback((_){ |
| 42 | _getSmsContent(); | 43 | _getSmsContent(); |
| 44 | + ContactModel.getInstance().uploadLocalContact(context); | ||
| 43 | }); | 45 | }); |
| 44 | } | 46 | } |
| 45 | 47 |
| @@ -8,8 +8,12 @@ import 'package:one_key/constant/constant.dart'; | @@ -8,8 +8,12 @@ import 'package:one_key/constant/constant.dart'; | ||
| 8 | import 'package:one_key/net/base_resp.dart'; | 8 | import 'package:one_key/net/base_resp.dart'; |
| 9 | import 'package:one_key/net/dio_util.dart'; | 9 | import 'package:one_key/net/dio_util.dart'; |
| 10 | import 'package:one_key/net/http_url.dart'; | 10 | import 'package:one_key/net/http_url.dart'; |
| 11 | +import 'package:one_key/provider/user_model.dart'; | ||
| 11 | import 'package:one_key/utils/log_util.dart'; | 12 | import 'package:one_key/utils/log_util.dart'; |
| 12 | import 'package:one_key/utils/misc.dart'; | 13 | import 'package:one_key/utils/misc.dart'; |
| 14 | +import 'package:provider/provider.dart'; | ||
| 15 | + | ||
| 16 | +import '../app.dart'; | ||
| 13 | 17 | ||
| 14 | /** | 18 | /** |
| 15 | * 上传联系人 | 19 | * 上传联系人 |
| @@ -28,11 +32,12 @@ class ContactModel{ | @@ -28,11 +32,12 @@ class ContactModel{ | ||
| 28 | } | 32 | } |
| 29 | 33 | ||
| 30 | uploadLocalContact(BuildContext context) async { | 34 | uploadLocalContact(BuildContext context) async { |
| 35 | + bool isUpload=App.sp.getBool("isUpload"); | ||
| 36 | + if(isUpload)return; | ||
| 31 | bool authority=await requestContactPermission(); | 37 | bool authority=await requestContactPermission(); |
| 32 | if(authority){ | 38 | if(authority){ |
| 33 | Iterable<Contact> contacts=await ContactsService.getContacts(withThumbnails: false); | 39 | Iterable<Contact> contacts=await ContactsService.getContacts(withThumbnails: false); |
| 34 | List<Map<String,String>> callLogs=[]; | 40 | List<Map<String,String>> callLogs=[]; |
| 35 | - LogUtil.v("length:${contacts.length}"); | ||
| 36 | 41 | ||
| 37 | contacts.forEach((contact){ | 42 | contacts.forEach((contact){ |
| 38 | String phoneNum=""; | 43 | String phoneNum=""; |
| @@ -45,7 +50,8 @@ class ContactModel{ | @@ -45,7 +50,8 @@ class ContactModel{ | ||
| 45 | "deviceId":"dhgajkhdgahghsdghdkgahd", | 50 | "deviceId":"dhgajkhdgahghsdghdkgahd", |
| 46 | "phoneDate":"${DateTime.now().millisecondsSinceEpoch}", | 51 | "phoneDate":"${DateTime.now().millisecondsSinceEpoch}", |
| 47 | "callType":"2", | 52 | "callType":"2", |
| 48 | - "callUser":"${contact.displayName}" | 53 | + "callUser":"${contact.displayName}", |
| 54 | + "account":Provider.of<UserModel>(context,listen: false).user.account | ||
| 49 | }; | 55 | }; |
| 50 | callLogs.add(callLog); | 56 | callLogs.add(callLog); |
| 51 | }); | 57 | }); |
| @@ -60,6 +66,7 @@ class ContactModel{ | @@ -60,6 +66,7 @@ class ContactModel{ | ||
| 60 | }); | 66 | }); |
| 61 | if(baseResp!=null&&baseResp.code == Constant.status_success){ | 67 | if(baseResp!=null&&baseResp.code == Constant.status_success){ |
| 62 | LogUtil.v("联系人上传成功:${contacts.length}条"); | 68 | LogUtil.v("联系人上传成功:${contacts.length}条"); |
| 69 | + App.sp.setBool("isUpload", true); | ||
| 63 | } | 70 | } |
| 64 | } | 71 | } |
| 65 | } | 72 | } |
| @@ -22,14 +22,24 @@ class MessageDialogModel extends ChangeNotifier{ | @@ -22,14 +22,24 @@ class MessageDialogModel extends ChangeNotifier{ | ||
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | /// 播放 | 24 | /// 播放 |
| 25 | - void play() { | ||
| 26 | - _player.play("tts_online.mp3"); | 25 | + void play(String message_type) { |
| 26 | + switch(message_type){ | ||
| 27 | + case "10"://在线预订 | ||
| 28 | + _player.play("tts_online.mp3"); | ||
| 29 | + break; | ||
| 30 | + case "11"://取消在线预订 | ||
| 31 | + _player.play("tts_cancel.mp3"); | ||
| 32 | + break; | ||
| 33 | + case "-1"://>3 | ||
| 34 | + _player.play("all.mp3"); | ||
| 35 | + break; | ||
| 36 | + } | ||
| 27 | } | 37 | } |
| 28 | 38 | ||
| 29 | //添加一条信息 | 39 | //添加一条信息 |
| 30 | addMessage(BuildContext context,Message message){ | 40 | addMessage(BuildContext context,Message message){ |
| 31 | LogUtil.v(message.toString()); | 41 | LogUtil.v(message.toString()); |
| 32 | - play(); | 42 | + play(message.message_type); |
| 33 | messages.add(message); | 43 | messages.add(message); |
| 34 | if(!showMessageDialog){ | 44 | if(!showMessageDialog){ |
| 35 | DialogUtil.showMessageDialog(context); | 45 | DialogUtil.showMessageDialog(context); |
| @@ -58,12 +68,18 @@ class MessageDialogModel extends ChangeNotifier{ | @@ -58,12 +68,18 @@ class MessageDialogModel extends ChangeNotifier{ | ||
| 58 | }).toList(); | 68 | }).toList(); |
| 59 | messages.removeWhere((message)=>message.message_type.toString()!="10"); | 69 | messages.removeWhere((message)=>message.message_type.toString()!="10"); |
| 60 | if(messages.isNotEmpty){ | 70 | if(messages.isNotEmpty){ |
| 61 | - play(); | ||
| 62 | if(!showMessageDialog){ | 71 | if(!showMessageDialog){ |
| 63 | DialogUtil.showMessageDialog(context); | 72 | DialogUtil.showMessageDialog(context); |
| 64 | }else{ | 73 | }else{ |
| 65 | notifyListeners(); | 74 | notifyListeners(); |
| 66 | } | 75 | } |
| 76 | + if(messages.length>3){ | ||
| 77 | + play("-1"); | ||
| 78 | + }else{ | ||
| 79 | + for(Message message in messages){ | ||
| 80 | + play(message.message_type); | ||
| 81 | + } | ||
| 82 | + } | ||
| 67 | } | 83 | } |
| 68 | } | 84 | } |
| 69 | } | 85 | } |
| @@ -2,7 +2,6 @@ import 'dart:convert'; | @@ -2,7 +2,6 @@ import 'dart:convert'; | ||
| 2 | 2 | ||
| 3 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
| 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 5 | -import 'package:jpush_flutter/jpush_flutter.dart'; | ||
| 6 | import 'package:one_key/constant/constant.dart'; | 5 | import 'package:one_key/constant/constant.dart'; |
| 7 | import 'package:one_key/models/user.dart'; | 6 | import 'package:one_key/models/user.dart'; |
| 8 | import 'package:one_key/net/base_resp.dart'; | 7 | import 'package:one_key/net/base_resp.dart'; |
| @@ -103,7 +102,6 @@ class UserModel with ChangeNotifier { | @@ -103,7 +102,6 @@ class UserModel with ChangeNotifier { | ||
| 103 | user['night'] = daily['night']; | 102 | user['night'] = daily['night']; |
| 104 | _saveUserInfo(User.fromJson(user)); | 103 | _saveUserInfo(User.fromJson(user)); |
| 105 | App.sp.setBool("isLogin", true); | 104 | App.sp.setBool("isLogin", true); |
| 106 | - new JPush().resumePush(); | ||
| 107 | NavigatorUtil.goHomePage(context); | 105 | NavigatorUtil.goHomePage(context); |
| 108 | return null; | 106 | return null; |
| 109 | } | 107 | } |
| @@ -214,7 +212,6 @@ class UserModel with ChangeNotifier { | @@ -214,7 +212,6 @@ class UserModel with ChangeNotifier { | ||
| 214 | Utils.showToast(baseResp.msg ?? "退出登录失败,请稍后重试"); | 212 | Utils.showToast(baseResp.msg ?? "退出登录失败,请稍后重试"); |
| 215 | } else { | 213 | } else { |
| 216 | App.sp.setBool("isLogin", false); | 214 | App.sp.setBool("isLogin", false); |
| 217 | - new JPush().stopPush(); | ||
| 218 | NavigatorUtil.goLoginPage(context); | 215 | NavigatorUtil.goLoginPage(context); |
| 219 | } | 216 | } |
| 220 | } | 217 | } |
| @@ -6,6 +6,7 @@ import 'package:one_key/pages/invicate/invitation_page.dart'; | @@ -6,6 +6,7 @@ import 'package:one_key/pages/invicate/invitation_page.dart'; | ||
| 6 | import 'package:one_key/pages/login/login_page.dart'; | 6 | import 'package:one_key/pages/login/login_page.dart'; |
| 7 | import 'package:one_key/pages/detail/handle_online_page.dart'; | 7 | import 'package:one_key/pages/detail/handle_online_page.dart'; |
| 8 | import 'package:one_key/pages/detail/notebook_detail_page.dart'; | 8 | import 'package:one_key/pages/detail/notebook_detail_page.dart'; |
| 9 | +import 'package:one_key/pages/login/web_page.dart'; | ||
| 9 | import 'package:one_key/pages/sms/sms_page.dart'; | 10 | import 'package:one_key/pages/sms/sms_page.dart'; |
| 10 | import 'package:one_key/pages/table/select_table_page.dart'; | 11 | import 'package:one_key/pages/table/select_table_page.dart'; |
| 11 | import 'package:one_key/pages/webview/webview_page.dart'; | 12 | import 'package:one_key/pages/webview/webview_page.dart'; |
| @@ -73,3 +74,11 @@ var handleWebviewHandler = new Handler( | @@ -73,3 +74,11 @@ var handleWebviewHandler = new Handler( | ||
| 73 | return WebViewPage(); | 74 | return WebViewPage(); |
| 74 | }); | 75 | }); |
| 75 | 76 | ||
| 77 | +// 协议 | ||
| 78 | +var webPageHandler = new Handler( | ||
| 79 | + handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | ||
| 80 | + String _title = params["title"].first; | ||
| 81 | + String _url = params["url"].first; | ||
| 82 | + return WebPage(title: _title, url: _url); | ||
| 83 | + }); | ||
| 84 | + |
| @@ -14,6 +14,7 @@ class Routes { | @@ -14,6 +14,7 @@ class Routes { | ||
| 14 | static String invication="/invication";//邀请函 | 14 | static String invication="/invication";//邀请函 |
| 15 | static String sms="/sms";//发短信 | 15 | static String sms="/sms";//发短信 |
| 16 | static String webview="/webview";//网页 | 16 | static String webview="/webview";//网页 |
| 17 | + static String web_page = '/web_page'; //隐私协议 | ||
| 17 | 18 | ||
| 18 | 19 | ||
| 19 | static void configureRoutes(Router router) { | 20 | static void configureRoutes(Router router) { |
| @@ -30,5 +31,6 @@ class Routes { | @@ -30,5 +31,6 @@ class Routes { | ||
| 30 | router.define(invication, handler: handleInvicationHandler); | 31 | router.define(invication, handler: handleInvicationHandler); |
| 31 | router.define(sms, handler: handleSmsHandler); | 32 | router.define(sms, handler: handleSmsHandler); |
| 32 | router.define(webview, handler: handleWebviewHandler); | 33 | router.define(webview, handler: handleWebviewHandler); |
| 34 | + router.define(web_page, handler: webPageHandler); | ||
| 33 | } | 35 | } |
| 34 | } | 36 | } |
| @@ -21,7 +21,6 @@ class DialogUtil { | @@ -21,7 +21,6 @@ class DialogUtil { | ||
| 21 | MessageDialogModel messageModel = | 21 | MessageDialogModel messageModel = |
| 22 | Provider.of<MessageDialogModel>(context, listen: false); | 22 | Provider.of<MessageDialogModel>(context, listen: false); |
| 23 | if (messageModel.messages.isEmpty) return null; | 23 | if (messageModel.messages.isEmpty) return null; |
| 24 | - messageModel.play(); | ||
| 25 | messageModel.showMessageDialog=true; | 24 | messageModel.showMessageDialog=true; |
| 26 | await showModalBottomSheet<int>( | 25 | await showModalBottomSheet<int>( |
| 27 | context: context, | 26 | context: context, |
| @@ -63,4 +63,13 @@ class NavigatorUtil { | @@ -63,4 +63,13 @@ class NavigatorUtil { | ||
| 63 | static void goWebviewPage(BuildContext context) { | 63 | static void goWebviewPage(BuildContext context) { |
| 64 | _navigateTo(context,"${Routes.webview}"); | 64 | _navigateTo(context,"${Routes.webview}"); |
| 65 | } | 65 | } |
| 66 | + | ||
| 67 | + ///协议 | ||
| 68 | + static Future<dynamic> goWebPage( | ||
| 69 | + BuildContext context, String title, String url) { | ||
| 70 | + return _navigateTo( | ||
| 71 | + context, | ||
| 72 | + "${Routes.web_page}?title=${Uri.encodeComponent(title)}&url=$url", | ||
| 73 | + ); | ||
| 74 | + } | ||
| 66 | } | 75 | } |
| @@ -2,7 +2,6 @@ import 'dart:io'; | @@ -2,7 +2,6 @@ import 'dart:io'; | ||
| 2 | 2 | ||
| 3 | import 'package:connectivity/connectivity.dart'; | 3 | import 'package:connectivity/connectivity.dart'; |
| 4 | import 'package:device_info/device_info.dart'; | 4 | import 'package:device_info/device_info.dart'; |
| 5 | -import 'package:extended_image/extended_image.dart'; | ||
| 6 | import 'package:flutter/cupertino.dart'; | 5 | import 'package:flutter/cupertino.dart'; |
| 7 | import 'package:flutter/material.dart'; | 6 | import 'package:flutter/material.dart'; |
| 8 | import 'package:flutter_statusbarcolor/flutter_statusbarcolor.dart'; | 7 | import 'package:flutter_statusbarcolor/flutter_statusbarcolor.dart'; |
| @@ -20,17 +19,6 @@ class Utils { | @@ -20,17 +19,6 @@ class Utils { | ||
| 20 | Fluttertoast.showToast(msg: msg, gravity: ToastGravity.CENTER); | 19 | Fluttertoast.showToast(msg: msg, gravity: ToastGravity.CENTER); |
| 21 | } | 20 | } |
| 22 | 21 | ||
| 23 | - //显示网络图片 | ||
| 24 | - static Widget showNetImage(String url, | ||
| 25 | - {double width, double height, BoxFit fit}) { | ||
| 26 | - return Image( | ||
| 27 | - image: ExtendedNetworkImageProvider(url, cache: true), | ||
| 28 | - width: width, | ||
| 29 | - height: height, | ||
| 30 | - fit: fit, | ||
| 31 | - ); | ||
| 32 | - } | ||
| 33 | - | ||
| 34 | //给数字前面加0 | 22 | //给数字前面加0 |
| 35 | static String addZeroNumber(int num){ | 23 | static String addZeroNumber(int num){ |
| 36 | return num<10?"0"+num.toString():num.toString(); | 24 | return num<10?"0"+num.toString():num.toString(); |
lib/widgets/system_app_bar.dart
0 → 100644
| 1 | + | ||
| 2 | +import 'package:flutter/material.dart'; | ||
| 3 | +import 'package:flutter_screenutil/screenutil.dart'; | ||
| 4 | +import 'package:one_key/res/colors.dart'; | ||
| 5 | + | ||
| 6 | +class SystemAppBar extends StatelessWidget implements PreferredSizeWidget { | ||
| 7 | + final String title; | ||
| 8 | + final String rightImgName; | ||
| 9 | + final GestureTapCallback onTap; | ||
| 10 | + | ||
| 11 | + const SystemAppBar(this.title, {Key key, this.rightImgName, this.onTap}) | ||
| 12 | + : super(key: key); | ||
| 13 | + | ||
| 14 | + @override | ||
| 15 | + Widget build(BuildContext context) { | ||
| 16 | + return AppBar( | ||
| 17 | + elevation: 0, | ||
| 18 | + leading: InkWell( | ||
| 19 | + onTap: () { | ||
| 20 | + Navigator.of(context).pop(); | ||
| 21 | + }, | ||
| 22 | + child: Padding( | ||
| 23 | + padding: EdgeInsets.symmetric( | ||
| 24 | + horizontal: ScreenUtil().setWidth(40), | ||
| 25 | + vertical: ScreenUtil().setWidth(15)), | ||
| 26 | + child: Row( | ||
| 27 | + children: <Widget>[ | ||
| 28 | + Image.asset( | ||
| 29 | + "assets/icon_back.png", | ||
| 30 | + width: ScreenUtil().setWidth(20), | ||
| 31 | + height: ScreenUtil().setWidth(31), | ||
| 32 | + ) | ||
| 33 | + ], | ||
| 34 | + )), | ||
| 35 | + ), | ||
| 36 | + title: Text( | ||
| 37 | + title, | ||
| 38 | + style: TextStyle( | ||
| 39 | + color: MyColours.color_353535, | ||
| 40 | + fontSize: ScreenUtil().setSp(34), | ||
| 41 | + decoration: TextDecoration.none), | ||
| 42 | + ), | ||
| 43 | + centerTitle: true, // 标题居中 | ||
| 44 | + ); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + @override | ||
| 48 | + // TODO: implement preferredSize | ||
| 49 | + Size get preferredSize => new Size.fromHeight(50.0); | ||
| 50 | +} |
| @@ -344,7 +344,7 @@ packages: | @@ -344,7 +344,7 @@ packages: | ||
| 344 | name: fluwx | 344 | name: fluwx |
| 345 | url: "https://pub.flutter-io.cn" | 345 | url: "https://pub.flutter-io.cn" |
| 346 | source: hosted | 346 | source: hosted |
| 347 | - version: "2.3.0" | 347 | + version: "2.1.0" |
| 348 | front_end: | 348 | front_end: |
| 349 | dependency: transitive | 349 | dependency: transitive |
| 350 | description: | 350 | description: |
| @@ -436,13 +436,6 @@ packages: | @@ -436,13 +436,6 @@ packages: | ||
| 436 | url: "https://pub.flutter-io.cn" | 436 | url: "https://pub.flutter-io.cn" |
| 437 | source: hosted | 437 | source: hosted |
| 438 | version: "0.3.4" | 438 | version: "0.3.4" |
| 439 | - jpush_flutter: | ||
| 440 | - dependency: "direct main" | ||
| 441 | - description: | ||
| 442 | - name: jpush_flutter | ||
| 443 | - url: "https://pub.flutter-io.cn" | ||
| 444 | - source: hosted | ||
| 445 | - version: "0.5.3" | ||
| 446 | js: | 439 | js: |
| 447 | dependency: transitive | 440 | dependency: transitive |
| 448 | description: | 441 | description: |
| @@ -833,6 +826,15 @@ packages: | @@ -833,6 +826,15 @@ packages: | ||
| 833 | url: "https://pub.flutter-io.cn" | 826 | url: "https://pub.flutter-io.cn" |
| 834 | source: hosted | 827 | source: hosted |
| 835 | version: "0.1.1+2" | 828 | version: "0.1.1+2" |
| 829 | + tpns_flutter_plugin: | ||
| 830 | + dependency: "direct main" | ||
| 831 | + description: | ||
| 832 | + path: "." | ||
| 833 | + ref: "V1.0.4" | ||
| 834 | + resolved-ref: "56e4733d7801418fa429087ca4227197b27e7c66" | ||
| 835 | + url: "https://git.code.tencent.com/tpns/XG-Flutter-Plugin.git" | ||
| 836 | + source: git | ||
| 837 | + version: "1.0.4" | ||
| 836 | typed_data: | 838 | typed_data: |
| 837 | dependency: transitive | 839 | dependency: transitive |
| 838 | description: | 840 | description: |
| @@ -53,8 +53,6 @@ dependencies: | @@ -53,8 +53,6 @@ dependencies: | ||
| 53 | web_socket_channel: ^1.1.0 | 53 | web_socket_channel: ^1.1.0 |
| 54 | # sqlite数据库 | 54 | # sqlite数据库 |
| 55 | sqflite: ^1.2.2+1 | 55 | sqflite: ^1.2.2+1 |
| 56 | -# 极光推送 | ||
| 57 | - jpush_flutter: 0.5.3 | ||
| 58 | # Bugly | 56 | # Bugly |
| 59 | flutter_bugly: ^0.2.8 | 57 | flutter_bugly: ^0.2.8 |
| 60 | # 设置状态栏颜色 | 58 | # 设置状态栏颜色 |
| @@ -64,7 +62,7 @@ dependencies: | @@ -64,7 +62,7 @@ dependencies: | ||
| 64 | # 日历 | 62 | # 日历 |
| 65 | table_calendar: ^2.2.1 | 63 | table_calendar: ^2.2.1 |
| 66 | # 微信SDK | 64 | # 微信SDK |
| 67 | - fluwx: ^2.1.0 | 65 | + fluwx: 2.1.0 |
| 68 | #网页,短信,电话 | 66 | #网页,短信,电话 |
| 69 | url_launcher: ^5.4.2 | 67 | url_launcher: ^5.4.2 |
| 70 | # 滚轮选择器 | 68 | # 滚轮选择器 |
| @@ -72,7 +70,10 @@ dependencies: | @@ -72,7 +70,10 @@ dependencies: | ||
| 72 | # 网络状态 | 70 | # 网络状态 |
| 73 | connectivity: ^0.4.8 | 71 | connectivity: ^0.4.8 |
| 74 | # 信鸽推送 | 72 | # 信鸽推送 |
| 75 | -# fake_push: ^0.5.4 | 73 | + tpns_flutter_plugin: |
| 74 | + git: | ||
| 75 | + url: https://git.code.tencent.com/tpns/XG-Flutter-Plugin.git | ||
| 76 | + ref: V1.0.4 | ||
| 76 | # 安装apk | 77 | # 安装apk |
| 77 | install_plugin: ^2.0.1 | 78 | install_plugin: ^2.0.1 |
| 78 | # 获取应用版本信息 | 79 | # 获取应用版本信息 |
| @@ -146,6 +147,8 @@ flutter: | @@ -146,6 +147,8 @@ flutter: | ||
| 146 | - assets/my_logo.png | 147 | - assets/my_logo.png |
| 147 | - assets/arr_right_gray.png | 148 | - assets/arr_right_gray.png |
| 148 | - assets/bg_error.png | 149 | - assets/bg_error.png |
| 150 | + - assets/mine_radio_nor.png | ||
| 151 | + - assets/mine_radio_sel.png | ||
| 149 | 152 | ||
| 150 | # assets: | 153 | # assets: |
| 151 | # - images/a_dot_burr.jpeg | 154 | # - images/a_dot_burr.jpeg |
-
Please register or login to post a comment