Commit 697c3b31c5381e107a04939f3fda389532e6f348

Authored by “gaiyaguang”
2 parents d5f31213 972ba380

合并

{
"agcgw":{
"backurl":"connect-drcn.dbankcloud.cn",
"url":"connect-drcn.hispace.hicloud.com"
},
"client":{
"cp_id":"260086000252264275",
"product_id":"9105385871708598142",
"client_id":"326681575729136832",
"client_secret":"A8D20078A192C1BD87C6B3EB5B597EF654901AE981E64701D66131A4E56A3AE9",
"app_id":"101934783",
"cp_id":"890086000102028635",
"product_id":"736430079244628022",
"client_id":"447630859449664704",
"client_secret":"C7F0060C796F3C59EC7928525D6B09D66139F06EDA5C3C6B772583D34A946BBB",
"app_id":"102832405",
"package_name":"com.naji.one_key",
"api_key":"CV6kBSEh4lAr9VF9v+geTdQebNtGEGQ4HcgN1igodItOCuGghaF1do+cxeVplpcEpe3pf3nwbkChLzCvkxtHvQOaPkTs"
"api_key":"CgB6e3x9K3RbzJwcAdFaQxGHXy+cqz0hCk6o/By+YxTV++JZtUgxAHKZNq4t1vOpQFjD/FSlkuuPdEiHm5dQ7Cd0"
},
"service":{
"analytics":{
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"resource_id":"p1",
"channel_id":""
},
"cloudstorage":{
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn"
},
"ml":{
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
}
},
"region":"CN",
"configuration_version":"1.0"
}
\ No newline at end of file
... ...
... ... @@ -13,12 +13,12 @@ if (flutterRoot == null) {
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
flutterVersionCode = '7'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
flutterVersionName = '1.0.7'
}
apply plugin: 'com.android.application'
... ... @@ -43,8 +43,8 @@ android {
applicationId "com.naji.one_key"
minSdkVersion 21
targetSdkVersion 28
versionCode 7
versionName "1.0.7"
versionCode 111
versionName "1.1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
... ... @@ -53,28 +53,13 @@ android {
}
manifestPlaceholders = [
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "27ceb79c44af41ad99202f7a", // NOTE: JPush 上注册的包名对应的 Appkey.
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
HUAWEI_APPID:"101934783",//华为平台注册的appid
XIAOMI_APPKEY : "MI-5811835841457", // 小米平台注册的appkey
XIAOMI_APPID : "MI-2882303761518358457", // 小米平台注册的appid
OPPO_APPKEY : "OP-94d77d10e7bb4c60bcf18a84c8ca8bdd", // OPPO平台注册的appkey
OPPO_APPID : "OP-30260281", // OPPO平台注册的appid
OPPO_APPSECRET: "OP-9b7e372f93794593953f93f118619570",//OPPO平台注册的appsecret
// VIVO_APPKEY : "5811835841457", // VIVO平台注册的appkey
// VIVO_APPID : "2882303761518358457", // VIVO平台注册的appid
XG_ACCESS_ID : '1500012875',
XG_ACCESS_KEY : 'AVR2GJERH0HC',
HW_APPID : '102832405',
VIVO_APPID: "103886384",
VIVO_APPKEY:"5a04e5c3485c0b19a2911c95dcaff5d2",
PACKAGE_NAME : "com.naji.one_key",// 小米通道
]
// manifestPlaceholders = [
// XG_ACCESS_ID : '2100332241',
// XG_ACCESS_KEY : 'A51T8RX1HS1W',
// XG_ACCESS_SCHEME: 'fake_push',// 非官方参数,可自定义,统一打开方式为 intent
// HW_APPID : '100728875',
// XIAOMI_APPID : '2882303761517989384',
// XIAOMI_APPKEY : '5141798993384',
// PACKAGE_NAME : "${applicationId}",// 小米通道
// ]
}
signingConfigs {
... ... @@ -115,17 +100,8 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
//华为推送
implementation 'cn.jiguang.sdk.plugin:huawei:3.5.8'
implementation 'com.huawei.hms:push:3.0.3.301'
//小米推送
implementation 'cn.jiguang.sdk.plugin:xiaomi:3.5.8'
//OPPO推送
implementation 'cn.jiguang.sdk.plugin:oppo:3.5.8'
//
// //vivo推送
// implementation 'cn.jiguang.sdk.plugin:vivo:3.5.8'
implementation 'com.tencent.tpns:huawei:1.2.0.3-release'// 华为推送
implementation 'com.tencent.tpns:xiaomi:1.2.0.3-release' // 小米推送
implementation 'com.tencent.tpns:oppo:1.2.0.3-release' // OPPO 推送
implementation 'com.tencent.tpns:vivo:1.2.0.3-release' // vivo 推送
}
... ...
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.naji.one_key">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
... ... @@ -39,13 +39,6 @@
</intent-filter>
</activity>
<service
android:name="cn.jpush.android.service.PluginHuaweiPlatformsService"
android:exported="false">
<intent-filter>
<action android:name="com.huawei.push.action.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
... ...
No preview for this file type
No preview for this file type
{
"tpns": {
"access_id": "1500012875",
"access_key": "AVR2GJERH0HC"
},
"com.naji.one_key": {
"channel": {
"enable": true
}
},
"debug": false,
"version": "1.2.0.3"
}
\ No newline at end of file
... ...
No preview for this file type
No preview for this file type
7babc7873f8d177769b987ba4c6c2911
\ No newline at end of file
531384610a6c9ce5834584b7a30c7a32
\ No newline at end of file
... ...
# Uncomment this line to define a global platform for your project
# source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
# platform :ios, '9.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
... ... @@ -11,81 +10,32 @@ project 'Runner', {
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
generated_key_values
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
# Flutter Pod
copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.
generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];
unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
end
# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
# Plugin Pods
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
flutter_additional_ios_build_settings(target)
end
end
... ...
... ... @@ -5,10 +5,6 @@ PODS:
- connectivity (0.0.1):
- Flutter
- Reachability
- connectivity_for_web (0.1.0):
- Flutter
- connectivity_macos (0.0.1):
- Flutter
- contacts_service (0.2.2):
- Flutter
- device_info (0.0.1):
... ... @@ -29,41 +25,23 @@ PODS:
- FMDB/standard (2.7.5)
- install_plugin (0.0.1):
- Flutter
- JCore (2.3.4)
- JPush (3.3.6):
- JCore (< 3.0.0, >= 2.0.0)
- jpush_flutter (0.0.2):
- Flutter
- JPush
- package_info (0.0.1):
- Flutter
- path_provider (0.0.1):
- Flutter
- path_provider_linux (0.0.1):
- Flutter
- path_provider_macos (0.0.1):
- Flutter
- "permission_handler (4.4.0+hotfix.4)":
- Flutter
- Reachability (3.2)
- shared_preferences (0.0.1):
- Flutter
- shared_preferences_linux (0.0.1):
- Flutter
- shared_preferences_macos (0.0.1):
- Flutter
- shared_preferences_web (0.0.1):
- Flutter
- sqflite (0.0.1):
- Flutter
- FMDB (~> 2.7.2)
- url_launcher (0.0.1):
- TPNS-iOS (1.2.7.2)
- tpns_flutter_plugin (1.0.4):
- Flutter
- url_launcher_linux (0.0.1):
- Flutter
- url_launcher_macos (0.0.1):
- Flutter
- url_launcher_web (0.0.1):
- TPNS-iOS (= 1.2.7.2)
- url_launcher (0.0.1):
- Flutter
- webview_flutter (0.0.1):
- Flutter
... ... @@ -72,8 +50,6 @@ PODS:
DEPENDENCIES:
- audioplayers (from `.symlinks/plugins/audioplayers/ios`)
- connectivity (from `.symlinks/plugins/connectivity/ios`)
- connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`)
- connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`)
- contacts_service (from `.symlinks/plugins/contacts_service/ios`)
- device_info (from `.symlinks/plugins/device_info/ios`)
- Flutter (from `Flutter`)
... ... @@ -82,30 +58,21 @@ DEPENDENCIES:
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- install_plugin (from `.symlinks/plugins/install_plugin/ios`)
- jpush_flutter (from `.symlinks/plugins/jpush_flutter/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
- path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`)
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- tpns_flutter_plugin (from `.symlinks/plugins/tpns_flutter_plugin/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
SPEC REPOS:
trunk:
- Bugly
- FMDB
- JCore
- JPush
- Reachability
- TPNS-iOS
- WechatOpenSDK
EXTERNAL SOURCES:
... ... @@ -113,10 +80,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/audioplayers/ios"
connectivity:
:path: ".symlinks/plugins/connectivity/ios"
connectivity_for_web:
:path: ".symlinks/plugins/connectivity_for_web/ios"
connectivity_macos:
:path: ".symlinks/plugins/connectivity_macos/ios"
contacts_service:
:path: ".symlinks/plugins/contacts_service/ios"
device_info:
... ... @@ -133,36 +96,20 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/fluwx/ios"
install_plugin:
:path: ".symlinks/plugins/install_plugin/ios"
jpush_flutter:
:path: ".symlinks/plugins/jpush_flutter/ios"
package_info:
:path: ".symlinks/plugins/package_info/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
path_provider_linux:
:path: ".symlinks/plugins/path_provider_linux/ios"
path_provider_macos:
:path: ".symlinks/plugins/path_provider_macos/ios"
permission_handler:
:path: ".symlinks/plugins/permission_handler/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
shared_preferences_linux:
:path: ".symlinks/plugins/shared_preferences_linux/ios"
shared_preferences_macos:
:path: ".symlinks/plugins/shared_preferences_macos/ios"
shared_preferences_web:
:path: ".symlinks/plugins/shared_preferences_web/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
tpns_flutter_plugin:
:path: ".symlinks/plugins/tpns_flutter_plugin/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
url_launcher_linux:
:path: ".symlinks/plugins/url_launcher_linux/ios"
url_launcher_macos:
:path: ".symlinks/plugins/url_launcher_macos/ios"
url_launcher_web:
:path: ".symlinks/plugins/url_launcher_web/ios"
webview_flutter:
:path: ".symlinks/plugins/webview_flutter/ios"
... ... @@ -170,8 +117,6 @@ SPEC CHECKSUMS:
audioplayers: 84f968cea3f2deab00ec4f8ff53358b3c0b3992c
Bugly: fd066c75c4a0eca1440f9b6a84bd37d51bfc85ac
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191
contacts_service: 849e1f84281804c8bfbec1b4c3eedcb23c5d3eca
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
... ... @@ -181,27 +126,18 @@ SPEC CHECKSUMS:
fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
install_plugin: a13e7ddd2bab0c701b48cd359c26d0394125b6fb
JCore: 8aa29dc57ba3730dd9fe7544ce1a4e1cbe221135
JPush: a401b946dcc76b37335422487201bc1ecc8dd296
jpush_flutter: 69133df35eaf9135e540549b154d992c44f8ee44
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
permission_handler: 8278954f2382902f63f00dd8828769c0bd6d511b
Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
TPNS-iOS: 9b35473a4a0d07f2c2730ea1e66c6749c2b98095
tpns_flutter_plugin: 8dbbee157aab91a878f64d056c1383726a6c5c4d
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44
PODFILE CHECKSUM: 6d186dc4668603071619657511aa873d9a684d13
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
COCOAPODS: 1.9.3
COCOAPODS: 1.9.1
... ...
... ... @@ -245,9 +245,42 @@
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/FMDB/FMDB.framework",
"${PODS_ROOT}/../Flutter/Flutter.framework",
"${BUILT_PRODUCTS_DIR}/Reachability/Reachability.framework",
"${BUILT_PRODUCTS_DIR}/audioplayers/audioplayers.framework",
"${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework",
"${BUILT_PRODUCTS_DIR}/contacts_service/contacts_service.framework",
"${BUILT_PRODUCTS_DIR}/device_info/device_info.framework",
"${BUILT_PRODUCTS_DIR}/flutter_statusbarcolor/flutter_statusbarcolor.framework",
"${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework",
"${BUILT_PRODUCTS_DIR}/install_plugin/install_plugin.framework",
"${BUILT_PRODUCTS_DIR}/package_info/package_info.framework",
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
"${BUILT_PRODUCTS_DIR}/shared_preferences/shared_preferences.framework",
"${BUILT_PRODUCTS_DIR}/sqflite/sqflite.framework",
"${BUILT_PRODUCTS_DIR}/url_launcher/url_launcher.framework",
"${BUILT_PRODUCTS_DIR}/webview_flutter/webview_flutter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FMDB.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Reachability.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/audioplayers.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/contacts_service.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_statusbarcolor.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/install_plugin.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/shared_preferences.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/sqflite.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/url_launcher.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/webview_flutter.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
... ... @@ -528,7 +561,7 @@
MARKETING_VERSION = 1.0.8;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = "一键订";
PROVISIONING_PROFILE_SPECIFIER = wdn_yjd;
PROVISIONING_PROFILE_SPECIFIER = "Push Development Profile";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
... ...
... ... @@ -84,5 +84,9 @@
<false/>
<key>io.flutter.embedded_views_preview</key>
<true/>
<key>XG_ACCESS_ID</key>
<string>1600012876</string>
<key>XG_ACCESS_KEY</key>
<string>INUIMFK21WGH</string>
</dict>
</plist>
... ...
... ... @@ -10,6 +10,7 @@ import 'package:one_key/provider/message_dialog_model.dart';
import 'package:intl/date_symbol_data_local.dart';
import 'package:one_key/utils/utils.dart';
import 'package:provider/provider.dart';
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
import 'app.dart';
import 'net/dio_util.dart';
... ... @@ -83,6 +84,7 @@ class MyAppState extends State<MyApp> {
LogUtil.v("is installed $result");
}
//初始化dio
initDio() {
DioUtil.openDebug();
Options options = DioUtil.getDefOptions();
... ...
import 'dart:async';
import 'dart:convert';
//import 'package:fake_push/fake_push.dart' as fake;
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:one_key/models/message.dart';
import 'package:one_key/pages/message/message_page.dart';
import 'package:one_key/pages/my/my_page.dart';
import 'package:one_key/pages/notebook/notebook_page.dart';
... ... @@ -19,11 +15,10 @@ import 'package:one_key/provider/update_model.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/log_util.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:provider/provider.dart';
import 'package:flutter/services.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
class HomePage extends StatefulWidget{
... ... @@ -40,22 +35,14 @@ class HomePage extends StatefulWidget{
class HomePageState extends State<HomePage>{
// 信鸽推送
// fake.Push _push = fake.Push();
// StreamSubscription<String> _receiveDeviceToken;
// StreamSubscription<fake.Message> _receiveMessage;
// StreamSubscription<fake.Message> _receiveNotification;
// StreamSubscription<String> _launchNotification;
// StreamSubscription<String> _resumeNotification;
// 极光推送
final JPush jpush = new JPush();
List<Widget> pages = List<Widget>();
int _currIndex = 1;
Color _activeColor = MyColours.color_2bb5b7;
Color _defaultColor = MyColours.color_bfbfbf;
Timer timer;
@override
void initState() {
// TODO: implement initState
... ... @@ -75,155 +62,92 @@ class HomePageState extends State<HomePage>{
create: (_)=>MyModel(),
child: MyPage(),
));
initJPush();
// initXinge();
WidgetsBinding.instance.addPostFrameCallback((_){
if(widget.initialIndex==0)return;
ContactModel.getInstance().uploadLocalContact(context);
// getUntreatedMessage();
// UpdateModel updateModel=new UpdateModel();
// updateModel.checkUpdate(context);
});
}
Future<void> initJPush() async {
try {
jpush.addEventHandler(
onReceiveNotification: (Map<String, dynamic> message) async {
LogUtil.v("flutter onReceiveNotification: $message");
Map<String,dynamic> messageMap=(json.decode(message["extras"]["cn.jpush.android.EXTRA"]) as Map<String,dynamic>)["extras"];
Provider.of<MessageDialogModel>(context,listen: false).addMessage(context,Message.fromJson(messageMap));
}, onOpenNotification: (Map<String, dynamic> message) async {
LogUtil.v("flutter onOpenNotification: $message");
NavigatorUtil.goHomePage(context,initialIndex: 0);
}, onReceiveMessage: (Map<String, dynamic> message) async {
LogUtil.v("flutter onReceiveMessage: $message");
}, onReceiveNotificationAuthorization:
(Map<String, dynamic> message) async {
LogUtil.v("flutter onReceiveNotificationAuthorization: $message");
getUntreatedMessage();
timer=Timer.periodic(Duration(minutes: 3), (_){
getUntreatedMessage();
});
} on PlatformException {}
jpush.setup(
appKey: "27ceb79c44af41ad99202f7a", //你自己应用的 AppKey
channel: "theChannel",
production: false,
debug: true,
);
jpush.applyPushAuthority(
new NotificationSettingsIOS(sound: true, alert: true, badge: false));
// Platform messages may fail, so we use a try/catch PlatformException.
jpush.getRegistrationID().then((rid) {
LogUtil.v("flutter get registration id : $rid");
userTokenInit(rid);
});
jpush.isNotificationEnabled().then((bool value) {
if (!value) {
//没有打开通知
jpush.openSettingsForNotification();
}
UpdateModel updateModel=new UpdateModel();
updateModel.checkUpdate(context);
});
initPlatformState();
}
//初始化信鸽推送
void initXinge(){
// _receiveDeviceToken =
// _push.receiveDeviceToken().listen(_handleReceiveDeviceToken);
// _receiveMessage = _push.receiveMessage().listen(_handleReceiveMessage);
// _receiveNotification =
// _push.receiveNotification().listen(_handleReceiveNotification);
// _launchNotification =
// _push.launchNotification().listen(_handleLaunchNotification);
// _resumeNotification =
// _push.resumeNotification().listen(_handleResumeNotification);
//
// _push.startWork(enableDebug: !_isReleaseMode());
//
// // 第二次打开应用再调用
// SharedPreferences.getInstance().then((SharedPreferences sharedPref) {
// if (sharedPref.getBool('firstStart') ?? true) {
// sharedPref.setBool('firstStart', false);
// } else {
// _push.areNotificationsEnabled().then((bool isEnabled) {
// if (!isEnabled) {
// showCupertinoDialog(
// context: context,
// builder: (BuildContext context) {
// return CupertinoAlertDialog(
// title: const Text('提示'),
// content: const Text('开启通知权限可收到更多优质内容'),
// actions: <Widget>[
// CupertinoDialogAction(
// child: const Text('取消'),
// onPressed: () {
// Navigator.of(context).pop();
// },
// ),
// CupertinoDialogAction(
// child: const Text('设置'),
// onPressed: () {
// _push.openNotificationsSettings();
// Navigator.of(context).pop();
// },
// ),
// ],
// );
// },
// );
// }
// });
// }
// });
}
Future<void> initPlatformState() async {
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted) return;
bool _isReleaseMode() {
return const bool.fromEnvironment('dart.vm.product');
}
/// 开启DEBUG
XgFlutterPlugin().setEnableDebug(true);
void _handleReceiveDeviceToken(String deviceToken) async {
// String token=await _push.getDeviceToken();
// print('receiveDeviceToken: $deviceToken - $token');
// userTokenInit2(token);
}
/// 添加回调事件
XgFlutterPlugin().addEventHandler(
onRegisteredDeviceToken: (String msg) async {
print("flutter onRegisteredDeviceToken: $msg");
},
onRegisteredDone: (String msg) async {
print("flutter onRegisteredDone: $msg");
LogUtil.v("注册成功");
userTokenInit(msg);
},
unRegistered: (String msg) async {
print("flutter unRegistered: $msg");
},
onReceiveNotificationResponse: (Map<String, dynamic> msg) async {
LogUtil.v("flutter onReceiveNotificationResponse $msg");
},
onReceiveMessage: (Map<String, dynamic> msg) async {
print("flutter onReceiveMessage $msg");
},
xgPushDidSetBadge: (String msg) async {
print("flutter xgPushDidSetBadge: $msg");
// void _handleReceiveMessage(fake.Message message) {
// print(
// 'receiveMessage: ${message.title} - ${message.content} - ${message.customContent}');
// }
//
// void _handleReceiveNotification(fake.Message notification) {
// print(
// 'receiveNotification: ${notification.title} - ${notification.content} - ${notification.customContent}');
//
// }
//
// void _handleLaunchNotification(String customContent) {
// print('launchNotification: $customContent');
//
// }
//
// void _handleResumeNotification(String customContent) {
// print('resumeNotification: $customContent');
//
// }
/// 在此可设置应用角标
/// XgFlutterPlugin().setAppBadge(0);;
},
xgPushDidBindWithIdentifier: (String msg) async {
print("flutter xgPushDidBindWithIdentifier: $msg");
},
xgPushDidUnbindWithIdentifier: (String msg) async {
print("flutter xgPushDidUnbindWithIdentifier: $msg");
},
xgPushDidUpdatedBindedIdentifier: (String msg) async {
print("flutter xgPushDidUpdatedBindedIdentifier: $msg");
},
xgPushDidClearAllIdentifiers: (String msg) async {
print("flutter xgPushDidClearAllIdentifiers: $msg");
},
xgPushClickAction: (Map<String, dynamic> msg) async {
print("flutter xgPushClickAction $msg");
},
);
//初始化推送token
userTokenInit(String registrationId){
UserModel userModel=Provider.of<UserModel>(context,listen: false);
userModel.registrationId=registrationId;
Map<String,String> params={
"sid":userModel.user.sellerid,
"account":userModel.user.account,
"registrationId":registrationId
};
userModel.userTokenInit(context, params);
/// 如果您的应用非广州集群则需要在startXG之前调用此函数
/// 香港:tpns.hk.tencent.com
/// 新加坡:tpns.sgp.tencent.com
/// 上海:tpns.sh.tencent.com
// XgFlutterPlugin().configureClusterDomainName("tpns.hk.tencent.com");
/// 设置OPPO AppKey 和 AppSecret
XgFlutterPlugin().getXgAndroidApi().enableOppoNotification();
XgFlutterPlugin().getXgAndroidApi().setOppoPushAppId(appId:"30260281");
XgFlutterPlugin().getXgAndroidApi().setOppoPushAppKey(appKey: "9b7e372f93794593953f93f118619570");
// 设置小米 AppID 和 AppKey。
XgFlutterPlugin().getXgAndroidApi().setMiPushAppId(appId:"2882303761518639456");
XgFlutterPlugin().getXgAndroidApi().setMiPushAppKey(appKey: "5231863961456");
XgFlutterPlugin().getXgAndroidApi().enableOtherPush();
/// 启动TPNS服务
XgFlutterPlugin().startXg("1600012876", "INUIMFK21WGH");
}
//初始化推送token
userTokenInit2(String token){
userTokenInit(String token){
UserModel userModel=Provider.of<UserModel>(context,listen: false);
userModel.token=token;
Map<String,String> params={
... ... @@ -239,8 +163,8 @@ class HomePageState extends State<HomePage>{
UserModel userModel=Provider.of<UserModel>(context,listen: false);
Map<String,String> params={
"sid":userModel.user.sellerid,
"type_id":"10",
"status":"0",
"type_id":"10",//10 在线预订
"status":"0",//未处理
"offset":"0",
"limit":"100",
};
... ... @@ -332,22 +256,11 @@ class HomePageState extends State<HomePage>{
@override
void dispose() {
// TODO: implement dispose
// if (_receiveDeviceToken != null) {
// _receiveDeviceToken.cancel();
// }
// if (_receiveMessage != null) {
// _receiveMessage.cancel();
// }
// if (_receiveNotification != null) {
// _receiveNotification.cancel();
// }
// if (_launchNotification != null) {
// _launchNotification.cancel();
// }
// if (_resumeNotification != null) {
// _resumeNotification.cancel();
// }
super.dispose();
LogUtil.v("home_dispose");
if(timer!=null){
timer.cancel();
}
XgFlutterPlugin().stopXg();
}
}
... ...
... ... @@ -33,6 +33,8 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver{
String errorText="";//错误提示
bool _check = true;
@override
void initState(){
// TODO: implement initState
... ... @@ -279,7 +281,66 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver{
),
);
},
)
),
VEmptyView(20),
Row(
// mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
InkWell(
onTap: () {
setState(() {
_check = !_check;
});
},
child: Container(
// color: Colors.red,
// height: ScreenUtil().setWidth(34),
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(102),
top: ScreenUtil().setWidth(10),
bottom: ScreenUtil().setWidth(10)),
child: Center(
child: Image.asset(
_check
? "assets/mine_radio_sel.png"
: "assets/mine_radio_nor.png",
width: ScreenUtil().setWidth(42),
height: ScreenUtil().setWidth(42)),
))),
HEmptyView(6),
Text(
'已阅读并同意',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535),
),
InkWell(
onTap: () {
NavigatorUtil.goWebPage(context, '软件服务协议', "xy");
},
child: Text(
'《软件服务协议》',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_2bb5b7),
),
),
Text('及',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_353535)),
InkWell(
onTap: () {
NavigatorUtil.goWebPage(context, '隐私政策', "zc");
},
child: Text('《隐私政策》',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_2bb5b7)),
)
],
),
],
),
),
... ...
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:webview_flutter/webview_flutter.dart';
class WebPage extends StatelessWidget {
final String title;
final String url;
const WebPage({Key key, this.title, this.url}) : super(key: key);
@override
Widget build(BuildContext context) {
final Completer<WebViewController> _controller =
Completer<WebViewController>();
return Scaffold(
appBar: SystemAppBar(title),
body: WebView(
initialUrl: "http://colorcun.com/privacy1.html",
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
// Loading.showLoading(context);
_controller.complete(webViewController);
},
javascriptChannels: <JavascriptChannel>[
_toasterJavascriptChannel(context),
].toSet(),
navigationDelegate: (NavigationRequest request) {
if (request.url.startsWith('https://www.youtube.com/')) {
return NavigationDecision.prevent;
}
return NavigationDecision.navigate;
},
onPageStarted: (String url) {
},
onPageFinished: (String url) {
// Loading.hideLoading(context);
},
gestureNavigationEnabled: true,
),
);
}
JavascriptChannel _toasterJavascriptChannel(BuildContext context) {
return JavascriptChannel(
name: 'Toaster',
onMessageReceived: (JavascriptMessage message) {
Scaffold.of(context).showSnackBar(
SnackBar(content: Text(message.message)),
);
});
}
}
... ...
... ... @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/message.dart';
import 'package:one_key/provider/message_dialog_model.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/widgets/common_button.dart';
... ... @@ -30,6 +31,7 @@ class MessageDialogItem extends StatelessWidget {
child: Stack(
children: <Widget>[
Container(
height: ScreenUtil().setWidth(280),
margin: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(39),vertical: ScreenUtil().setWidth(12)),
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(12),
... ... @@ -63,26 +65,39 @@ class MessageDialogItem extends StatelessWidget {
],
),
VEmptyView(20),
message.message_type=="11"?
Text(
"包间需求:${message.room_demand}",
"${message.ddateStr}的${message.rnameStr}取消了预订",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
VEmptyView(10),
Text(
"就餐时间:${message.ddateStr}",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
VEmptyView(10),
Text(
"预订人:${message.rnameStr}",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
):
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"包间需求:${message.room_demand}",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
VEmptyView(10),
Text(
"就餐时间:${message.ddateStr}",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
VEmptyView(10),
Text(
"预订人:${message.rnameStr}",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
],
)
],
),
),
... ... @@ -95,11 +110,21 @@ class MessageDialogItem extends StatelessWidget {
width: 160,
height: 48,
fontSize: 28,
content: "立即处理",
content: message.message_type=="10"?"立即处理":"立即查看",
state: 1,
onPress: () {
messageDialogModel.removeMessage(message.id);
NavigatorUtil.goHandleOnlinePage(context,message.rid.toString(),message.id,replace: messageDialogModel.messages.isEmpty);
if(message.message_type=="10"){
NavigatorUtil.goHandleOnlinePage(context,message.rid.toString(),message.id,replace: messageDialogModel.messages.isEmpty?true:false);
}else{
NavigatorUtil.goNotebookDetailPage(context,message.rid.toString(),replace: messageDialogModel.messages.isEmpty?true:false);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
"id": message.id,
"status": "is_handle"
};
messageDialogModel.setMessageStatus(context,params);
}
},
),
),
... ...
... ... @@ -2,7 +2,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/message.dart';
import 'package:one_key/provider/message_dialog_model.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/widgets/common_button.dart';
import 'package:one_key/widgets/h_empty_view.dart';
... ... @@ -30,6 +32,7 @@ class MessageItem extends StatelessWidget {
child: Stack(
children: <Widget>[
Container(
height: ScreenUtil().setWidth(280),
margin: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(39),vertical: ScreenUtil().setWidth(12)),
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(12),
... ... @@ -63,26 +66,39 @@ class MessageItem extends StatelessWidget {
],
),
VEmptyView(20),
message.message_type=="11"?
Text(
"包间需求:${message.room_demand}",
"${message.ddateStr}的${message.rnameStr}取消了预订",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
VEmptyView(10),
Text(
"就餐时间:${message.ddateStr}",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
VEmptyView(10),
Text(
"预订人:${message.rnameStr}",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
):
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"包间需求:${message.room_demand}",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
VEmptyView(10),
Text(
"就餐时间:${message.ddateStr}",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
VEmptyView(10),
Text(
"预订人:${message.rnameStr}",
style: TextStyle(
color: textColor,
fontSize: ScreenUtil().setSp(28)),
),
],
)
],
),
),
... ... @@ -95,11 +111,22 @@ class MessageItem extends StatelessWidget {
width: 160,
height: 48,
fontSize: 28,
content: "立即处理",
content:message.message_type=="10"?"立即处理":"立即查看",
state: 1,
onPress: () {
messageDialogModel.removeMessage(message.id);
NavigatorUtil.goHandleOnlinePage(context,message.rid.toString(),message.id);
if(message.message_type=="10"){
NavigatorUtil.goHandleOnlinePage(context,message.rid.toString(),message.id);
}else{
NavigatorUtil.goNotebookDetailPage(context,message.rid.toString());
bus.emit("remove_untreated_message", message.id);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
"id": message.id,
"status": "is_handle"
};
messageDialogModel.setMessageStatus(context,params);
}
},
),
),
... ...
... ... @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/notebook.dart';
import 'package:one_key/provider/SmsModel.dart';
import 'package:one_key/provider/contact_model.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/utils.dart';
... ... @@ -40,6 +41,7 @@ class SmsPageState extends State<SmsPage>{
userModel=Provider.of<UserModel>(context,listen: false);
WidgetsBinding.instance.addPostFrameCallback((_){
_getSmsContent();
ContactModel.getInstance().uploadLocalContact(context);
});
}
... ...
... ... @@ -8,8 +8,12 @@ import 'package:one_key/constant/constant.dart';
import 'package:one_key/net/base_resp.dart';
import 'package:one_key/net/dio_util.dart';
import 'package:one_key/net/http_url.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/utils/log_util.dart';
import 'package:one_key/utils/misc.dart';
import 'package:provider/provider.dart';
import '../app.dart';
/**
* 上传联系人
... ... @@ -28,11 +32,12 @@ class ContactModel{
}
uploadLocalContact(BuildContext context) async {
bool isUpload=App.sp.getBool("isUpload")??false;
if(isUpload)return;
bool authority=await requestContactPermission();
if(authority){
Iterable<Contact> contacts=await ContactsService.getContacts(withThumbnails: false);
List<Map<String,String>> callLogs=[];
LogUtil.v("length:${contacts.length}");
contacts.forEach((contact){
String phoneNum="";
... ... @@ -45,7 +50,8 @@ class ContactModel{
"deviceId":"dhgajkhdgahghsdghdkgahd",
"phoneDate":"${DateTime.now().millisecondsSinceEpoch}",
"callType":"2",
"callUser":"${contact.displayName}"
"callUser":"${contact.displayName}",
"account":Provider.of<UserModel>(context,listen: false).user.account
};
callLogs.add(callLog);
});
... ... @@ -60,6 +66,7 @@ class ContactModel{
});
if(baseResp!=null&&baseResp.code == Constant.status_success){
LogUtil.v("联系人上传成功:${contacts.length}条");
App.sp.setBool("isUpload", true);
}
}
}
... ...
... ... @@ -8,6 +8,7 @@ import 'package:one_key/net/http_url.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:audioplayers/audio_cache.dart';
import 'package:one_key/utils/log_util.dart';
import 'package:one_key/utils/utils.dart';
class MessageDialogModel extends ChangeNotifier{
... ... @@ -22,14 +23,24 @@ class MessageDialogModel extends ChangeNotifier{
}
/// 播放
void play() {
_player.play("tts_online.mp3");
void play(String message_type) {
switch(message_type){
case "10"://在线预订
_player.play("tts_online.mp3");
break;
case "11"://取消在线预订
_player.play("tts_cancel.mp3");
break;
case "-1"://>3
_player.play("tts_all.mp3");
break;
}
}
//添加一条信息
addMessage(BuildContext context,Message message){
LogUtil.v(message.toString());
play();
play(message.message_type);
messages.add(message);
if(!showMessageDialog){
DialogUtil.showMessageDialog(context);
... ... @@ -47,7 +58,7 @@ class MessageDialogModel extends ChangeNotifier{
//获取未处理在线预订消息
getUntreatedMsg(BuildContext context,Map<String,String> params) async {
BaseResp<List> baseResp = await DioUtil()
.request<List>(context, Method.get, HttpUrl.get_message_list,
.request<List>(context, Method.get, HttpUrl.get_message_list,showLoading: false,
data: params)
.catchError((error) {
print(error.toString());
... ... @@ -56,15 +67,45 @@ class MessageDialogModel extends ChangeNotifier{
messages=baseResp.data.map<Message>((value){
return Message.fromJson(value);
}).toList();
messages.removeWhere((message)=>message.message_type.toString()!="10");
messages.removeWhere((message){
if(message.message_type.toString()=="10"){
if(message.status=="4"){
return true;
}
return false;
}else if(message.message_type.toString()=="11"){
return false;
}
return true;
});
if(messages.isNotEmpty){
play();
if(!showMessageDialog){
DialogUtil.showMessageDialog(context);
}else{
notifyListeners();
}
if(messages.length>1){
play("-1");
}else{
for(Message message in messages){
play(message.message_type);
}
}
}
}
}
//设置消息状态
setMessageStatus(BuildContext context, Map<String, String> params) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.set_message_status,
data: params, showLoading: false)
.catchError((error) {
print(error.toString());
});
if (baseResp.code == Constant.status_success) {
} else {
Utils.showToast(baseResp.msg);
}
}
}
\ No newline at end of file
... ...
... ... @@ -5,6 +5,7 @@ import 'package:one_key/net/base_resp.dart';
import 'package:one_key/net/dio_util.dart';
import 'package:one_key/net/http_url.dart';
import 'package:one_key/utils/log_util.dart';
import 'package:one_key/utils/utils.dart';
class MessageModel extends ChangeNotifier{
... ... @@ -30,7 +31,17 @@ class MessageModel extends ChangeNotifier{
untreatedMsgs=baseResp.data.map<Message>((value){
return Message.fromJson(value);
}).toList();
untreatedMsgs.removeWhere((message)=>message.message_type.toString()!="10");
untreatedMsgs.removeWhere((message){
if(message.message_type.toString()=="10"){
if(message.status=="4"){
return true;
}
return false;
}else if(message.message_type.toString()=="11"){
return false;
}
return true;
});
notifyListeners();
}
}
... ... @@ -57,7 +68,12 @@ class MessageModel extends ChangeNotifier{
return Message.fromJson(value);
}).toList());
}
treatedMsgs.removeWhere((message)=>message.message_type.toString()!="10");
treatedMsgs.removeWhere((message){
if(message.message_type.toString()=="10"||message.message_type.toString()=="11"){
return false;
}
return true;
});
notifyListeners();
}
}
... ...
... ... @@ -2,7 +2,6 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:jpush_flutter/jpush_flutter.dart';
import 'package:one_key/constant/constant.dart';
import 'package:one_key/models/user.dart';
import 'package:one_key/net/base_resp.dart';
... ... @@ -103,7 +102,6 @@ class UserModel with ChangeNotifier {
user['night'] = daily['night'];
_saveUserInfo(User.fromJson(user));
App.sp.setBool("isLogin", true);
new JPush().resumePush();
NavigatorUtil.goHomePage(context);
return null;
}
... ... @@ -214,7 +212,6 @@ class UserModel with ChangeNotifier {
Utils.showToast(baseResp.msg ?? "退出登录失败,请稍后重试");
} else {
App.sp.setBool("isLogin", false);
new JPush().stopPush();
NavigatorUtil.goLoginPage(context);
}
}
... ...
... ... @@ -11,6 +11,7 @@ import 'package:one_key/pages/invicate/invitation_page.dart';
import 'package:one_key/pages/login/login_page.dart';
import 'package:one_key/pages/detail/handle_online_page.dart';
import 'package:one_key/pages/detail/notebook_detail_page.dart';
import 'package:one_key/pages/login/web_page.dart';
import 'package:one_key/pages/sms/sms_page.dart';
import 'package:one_key/pages/table/select_table_page.dart';
import 'package:one_key/pages/webview/webview_page.dart';
... ... @@ -97,6 +98,14 @@ var handleWebviewHandler = new Handler(
return WebViewPage();
});
// 协议
var webPageHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
String _title = params["title"].first;
String _url = params["url"].first;
return WebPage(title: _title, url: _url);
});
// 跳转到变更预订
var handleChangeDetailHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
... ...
... ... @@ -14,6 +14,7 @@ class Routes {
static String invication="/invication";//邀请函
static String sms="/sms";//发短信
static String webview="/webview";//网页
static String web_page = '/web_page'; //隐私协议
static String change_detail="/change_detail";//变更预订
... ... @@ -31,6 +32,7 @@ class Routes {
router.define(invication, handler: handleInvicationHandler);
router.define(sms, handler: handleSmsHandler);
router.define(webview, handler: handleWebviewHandler);
router.define(web_page, handler: webPageHandler);
router.define(change_detail, handler: handleChangeDetailHandler);
}
}
... ...
... ... @@ -21,7 +21,6 @@ class DialogUtil {
MessageDialogModel messageModel =
Provider.of<MessageDialogModel>(context, listen: false);
if (messageModel.messages.isEmpty) return null;
messageModel.play();
messageModel.showMessageDialog=true;
await showModalBottomSheet<int>(
context: context,
... ...
... ... @@ -77,6 +77,17 @@ class NavigatorUtil {
_navigateTo(context, "${Routes.webview}");
}
///协议
static Future<dynamic> goWebPage(
BuildContext context, String title, String url) {
return _navigateTo(
context,
"${Routes.web_page}?title=${Uri.encodeComponent(title)}&url=$url",
);
}
/// 变更预订
static void goNoteBookChangePage(
BuildContext context, NotebookDetail detailEntity, String rid,
... ... @@ -85,4 +96,12 @@ class NavigatorUtil {
"${Routes.change_detail}?detail=${FluroConvertUtils.object2string(detailEntity)}&rid=$rid",
replace: replace);
}
// /// 变更预订
// static void goNoteBookChangePage(
// BuildContext context, NotebookDetail detailEntity, String rid,
// {replace = false}) {
// _navigateTo(context,
// "${Routes.change_detail}?detail=${FluroConvertUtils.object2string(detailEntity)}&rid=$rid",
// replace: replace);
// }
}
... ...
... ... @@ -2,7 +2,6 @@ import 'dart:io';
import 'package:connectivity/connectivity.dart';
import 'package:device_info/device_info.dart';
import 'package:extended_image/extended_image.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_statusbarcolor/flutter_statusbarcolor.dart';
... ... @@ -20,17 +19,6 @@ class Utils {
Fluttertoast.showToast(msg: msg, gravity: ToastGravity.CENTER);
}
//显示网络图片
static Widget showNetImage(String url,
{double width, double height, BoxFit fit}) {
return Image(
image: ExtendedNetworkImageProvider(url, cache: true),
width: width,
height: height,
fit: fit,
);
}
//给数字前面加0
static String addZeroNumber(int num) {
return num < 10 ? "0" + num.toString() : num.toString();
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/res/colors.dart';
class SystemAppBar extends StatelessWidget implements PreferredSizeWidget {
final String title;
final String rightImgName;
final GestureTapCallback onTap;
const SystemAppBar(this.title, {Key key, this.rightImgName, this.onTap})
: super(key: key);
@override
Widget build(BuildContext context) {
return AppBar(
elevation: 0,
leading: InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(15)),
child: Row(
children: <Widget>[
Image.asset(
"assets/icon_back.png",
width: ScreenUtil().setWidth(20),
height: ScreenUtil().setWidth(31),
)
],
)),
),
title: Text(
title,
style: TextStyle(
color: MyColours.color_353535,
fontSize: ScreenUtil().setSp(34),
decoration: TextDecoration.none),
),
centerTitle: true, // 标题居中
);
}
@override
// TODO: implement preferredSize
Size get preferredSize => new Size.fromHeight(50.0);
}
... ...
... ... @@ -98,7 +98,7 @@ packages:
name: cached_network_image
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.3.1"
version: "2.3.2+1"
characters:
dependency: transitive
description:
... ... @@ -253,20 +253,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.17"
extended_image:
dependency: "direct main"
description:
name: extended_image
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.1.1"
extended_image_library:
dependency: transitive
description:
name: extended_image_library
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.0"
fake_async:
dependency: transitive
description:
... ... @@ -320,7 +306,7 @@ packages:
name: flutter_cache_manager
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.1"
version: "1.4.2"
flutter_easyrefresh:
dependency: "direct main"
description:
... ... @@ -415,13 +401,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.12.2"
http_client_helper:
dependency: transitive
description:
name: http_client_helper
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.1"
http_multi_server:
dependency: transitive
description:
... ... @@ -457,13 +436,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.4"
jpush_flutter:
dependency: "direct main"
description:
name: jpush_flutter
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.5.3"
js:
dependency: transitive
description:
... ... @@ -554,7 +526,7 @@ packages:
name: octo_image
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.2.1"
version: "0.3.0"
package_config:
dependency: transitive
description:
... ... @@ -861,6 +833,15 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.1+2"
tpns_flutter_plugin:
dependency: "direct main"
description:
path: "."
ref: "V1.0.4"
resolved-ref: "56e4733d7801418fa429087ca4227197b27e7c66"
url: "https://git.code.tencent.com/tpns/XG-Flutter-Plugin.git"
source: git
version: "1.0.4"
typed_data:
dependency: transitive
description:
... ... @@ -874,7 +855,7 @@ packages:
name: url_launcher
url: "https://pub.flutter-io.cn"
source: hosted
version: "5.5.3"
version: "5.6.0"
url_launcher_linux:
dependency: transitive
description:
... ... @@ -903,6 +884,13 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.1.3+2"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.0.1+1"
uuid:
dependency: transitive
description:
... ... @@ -953,5 +941,5 @@ packages:
source: hosted
version: "2.2.1"
sdks:
dart: ">=2.9.0-14.0.dev <3.0.0"
dart: ">=2.9.0 <3.0.0"
flutter: ">=1.20.0 <2.0.0"
... ...
... ... @@ -41,8 +41,8 @@ dependencies:
permission_handler: ^4.4.0
# 文件系统访问
path_provider: ^1.6.5
# 官方image组件扩展,支持多种图片效果展示
extended_image: ^1.1.1
## 官方image组件扩展,支持多种图片效果展示
# extended_image: ^1.1.1
# 任意位置访问navigator
get_it: ^3.0.1
# 刷新加载
... ... @@ -53,8 +53,6 @@ dependencies:
web_socket_channel: ^1.1.0
# sqlite数据库
sqflite: ^1.2.2+1
# 极光推送
jpush_flutter: 0.5.3
# Bugly
flutter_bugly: ^0.2.8
# 设置状态栏颜色
... ... @@ -72,7 +70,10 @@ dependencies:
# 网络状态
connectivity: ^0.4.8
# 信鸽推送
# fake_push: ^0.5.4
tpns_flutter_plugin:
git:
url: https://git.code.tencent.com/tpns/XG-Flutter-Plugin.git
ref: V1.0.4
# 安装apk
install_plugin: ^2.0.1
# 获取应用版本信息
... ... @@ -110,7 +111,7 @@ flutter:
# To add assets to your application, add an assets section, like this:
assets:
- assets/
# - assets/tts_online.mp3
- assets/tts_online.mp3
# - assets/icon_sellercode.png
# - assets/icon_account.png
# - assets/icon_pwd.png
... ... @@ -148,6 +149,48 @@ flutter:
# - assets/my_logo.png
# - assets/arr_right_gray.png
# - assets/bg_error.png
- assets/tts_online.mp3
- assets/tts_cancel.mp3
- assets/tts_all.mp3
- assets/icon_sellercode.png
- assets/icon_account.png
- assets/icon_pwd.png
- assets/icon_pwd_show.png
- assets/icon_pwd_hide.png
- assets/icon_pwd_hide.png
- assets/message_default.png
- assets/message_selected.png
- assets/notebook_default.png
- assets/notebook_selected.png
- assets/my_default.png
- assets/my_selected.png
- assets/icon_close.png
- assets/logo.png
- assets/icon_back.png
- assets/icon_selected.png
- assets/statu_booked.png
- assets/statu_canceled.png
- assets/statu_eating.png
- assets/statu_finished.png
- assets/statu_reached.png
- assets/statu_refuse.png
- assets/status_undeal.png
- assets/icon_wechat.png
- assets/icon_sms.png
- assets/icon_phone.png
- assets/bg_invication.png
- assets/invication_line_left.png
- assets/invication_line_right.png
- assets/img_ydap.png
- assets/invication_map.png
- assets/invication_arrow_right.png
- assets/invication_back.png
- assets/icon_exist.png
- assets/my_logo.png
- assets/arr_right_gray.png
- assets/bg_error.png
- assets/mine_radio_nor.png
- assets/mine_radio_sel.png
# assets:
# - images/a_dot_burr.jpeg
... ...