Parcourir la source

1.修复搜索的一些bug

2.增加第三方活动模块
tags/0.0.7+3
“yanghuaxuan” il y a 3 ans
Parent
révision
4d2083e338
20 fichiers modifiés avec 285 ajouts et 93 suppressions
  1. +29
    -29
      example/android/app/build.gradle
  2. +14
    -1
      example/android/app/src/main/AndroidManifest.xml
  3. +3
    -2
      example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java
  4. +82
    -17
      example/ios/Podfile.lock
  5. +0
    -3
      example/ios/Runner.xcodeproj/project.pbxproj
  6. +2
    -0
      example/lib/main.dart
  7. +2
    -0
      example/pubspec.yaml
  8. +6
    -0
      lib/pages/search_think_page/bloc/search_think_event.dart
  9. +14
    -7
      lib/pages/webview/base_webview.dart
  10. +4
    -0
      lib/register.dart
  11. +17
    -3
      lib/widgets/search/history_tag/search_history_tag.dart
  12. +32
    -5
      lib/widgets/search/hot_tag/search_hot_tag_widget.dart
  13. +7
    -0
      lib/widgets/search/input/model/SearchTabBarEvent.dart
  14. +11
    -3
      lib/widgets/search/input/search_input_widget.dart
  15. +2
    -0
      lib/widgets/search/tabbar/search_tab_widget.dart
  16. +41
    -22
      lib/widgets/search_result/search_input/search_result_input.dart
  17. +8
    -0
      lib/widgets/search_result/tarbar/model/search_btn_event.dart
  18. +6
    -0
      lib/widgets/search_result/tarbar/search_result_tab_widget.dart
  19. +2
    -1
      lib/zhiying_base_widget.dart
  20. +3
    -0
      pubspec.yaml

+ 29
- 29
example/android/app/build.gradle Voir le fichier

@@ -53,8 +53,8 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
//选择要添加的对应cpu类型的.so库。
abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a'
//abiFilters 'armeabi-v7a','x86_64'
//abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a'
abiFilters 'armeabi-v7a','x86_64'
}
}

@@ -109,33 +109,33 @@ android {


// 应用信息配置
// productFlavors {
// // 智夜生活
// zhiying {
// applicationId "cn.zhios.zhiying"
// versionCode 50
// dimension "app"
// versionName '1.3.10'
// // 签名信息
// signingConfig signingConfigs.zhiying
// }
// }
//
// // 打包脚本
// android.applicationVariants.all { variant ->
// if (variant.buildType.name != "debug") {
// variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk")
// }
//
// variant.outputs.all { output ->
// def outputFile = output.outputFile
// if (outputFile != null && outputFile.name.endsWith('.apk')) {
// //这里修改apk文件名
// def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk"
// outputFileName = fileName
// }
// }
// }
productFlavors {
// 智夜生活
zhiying {
applicationId "cn.zhios.zhiying"
versionCode 52
dimension "app"
versionName '1.3.12'
// 签名信息
signingConfig signingConfigs.zhiying
}
}
// 打包脚本
android.applicationVariants.all { variant ->
if (variant.buildType.name != "debug") {
variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk")
}
variant.outputs.all { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
//这里修改apk文件名
def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk"
outputFileName = fileName
}
}
}

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->


+ 14
- 1
example/android/app/src/main/AndroidManifest.xml Voir le fichier

@@ -26,6 +26,16 @@

<uses-permission android:name="android.permission.INTERNET" />

<!-- 定位-->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
<uses-permission android:name="android.permission.ACCESS_LOCATION" />


<!--&lt;!&ndash; &lt;!&ndash; Permissions options for the `ignoreBatteryOptimizations` group &ndash;&gt;&ndash;&gt;-->
<!-- <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />-->

@@ -36,7 +46,8 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:usesCleartextTraffic="true"
tools:replace="android:name, android:allowBackup">
android:authorities="${applicationId}.fileprovider"
tools:replace="android:name, android:allowBackup,android:authorities">

<activity
android:name=".MainActivity"
@@ -73,8 +84,10 @@
android:name="androidx.core.content.FileProvider"
android:authorities="com.zhiying.demo.fileprovider"
android:exported="false"
tools:replace="android:authorities"
android:grantUriPermissions="true">
<meta-data
tools:replace="android:resource"
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/zhiying_file_path" />
</provider>


+ 3
- 2
example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java Voir le fichier

@@ -154,8 +154,9 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN
@Override
public Map getSetting() {
Map map = new HashMap();
map.put("domain", "http://inapi.izhyin.cn/"); //"http://120.76.175.204:8989");
// map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn68703914
map.put("domain", "http://inapi.izhyin.cn/");//"http://120.76.175.204:8989");
// map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689
//map.put("domain", "http://192.168.0.88:5000/");
map.put("master_id", "123456");
map.put("secret_key", "123456");
// map.put("token", "123465");


+ 82
- 17
example/ios/Podfile.lock Voir le fichier

@@ -4,8 +4,6 @@ PODS:
- AliAuthSDK (1.1.0.41-bc)
- AlibcTradeSDK (4.0.1.6)
- AliLinkPartnerSDK (4.0.0.24)
- AlipaySDK_No_UTDID_SUN (15.2.0):
- UTDID
- BCUserTrack (5.2.0.18-appkeys):
- UTDID
- connectivity (0.0.1):
@@ -32,10 +30,17 @@ PODS:
- Flutter
- flutter_plugin_android_lifecycle (0.0.1):
- Flutter
- flutter_user_agent (1.2.2):
- Flutter
- flutter_webview_plugin (0.0.1):
- Flutter
- flutter_xupdate (0.0.1):
- Flutter
- fluttertoast (0.0.2):
- Flutter
- fluwx (0.0.1):
- Flutter
- WechatOpenSDK (= 1.8.7.1)
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
@@ -95,7 +100,7 @@ PODS:
- mob_sharesdk/ShareSDKPlatforms/WatermelonVideo (4.3.16):
- mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKPlatforms/WeChat (4.3.16):
- mob_sharesdk/ShareSDKPlatforms/WeChat_Lite (4.3.16):
- mob_sharesdk/ShareSDK
- MOBFoundation (>= 3.2.9)
- mob_sharesdk/ShareSDKRestoreScene (4.3.16):
@@ -116,6 +121,8 @@ PODS:
- mobsms (0.0.1):
- Flutter
- mob_smssdk
- more_picture_share (0.0.1):
- Flutter
- mtopSDK (3.0.0.3-BC)
- package_info (0.0.1):
- Flutter
@@ -162,14 +169,13 @@ PODS:
- mob_sharesdk/ShareSDKPlatforms/SnapChat
- mob_sharesdk/ShareSDKPlatforms/Twitter
- mob_sharesdk/ShareSDKPlatforms/WatermelonVideo
- mob_sharesdk/ShareSDKPlatforms/WeChat
- mob_sharesdk/ShareSDKPlatforms/WeChat_Lite
- mob_sharesdk/ShareSDKRestoreScene
- mob_sharesdk/ShareSDKUI
- sqflite (0.0.1):
- Flutter
- FMDB (~> 2.7.2)
- tobias (0.0.1):
- AlipaySDK_No_UTDID_SUN (~> 15.2.0)
- Flutter
- TOCropViewController (2.5.5)
- url_launcher (0.0.1):
@@ -183,8 +189,13 @@ PODS:
- url_launcher_windows (0.0.1):
- Flutter
- UTDID (1.1.0.16)
- video_player (0.0.1):
- Flutter
- video_player_web (0.0.1):
- Flutter
- webview_flutter (0.0.1):
- Flutter
- WechatOpenSDK (1.8.7.1)
- WindVane (8.5.0.46-bc11):
- WindVane/Basic (= 8.5.0.46-bc11)
- WindVane/Core (= 8.5.0.46-bc11)
@@ -194,14 +205,20 @@ PODS:
- WindVane/WindVane (8.5.0.46-bc11)
- zhiying_base_widget (0.0.1):
- Flutter
- mob_sharesdk
- mob_sharesdk/ShareSDKExtension
- mob_sharesdk/ShareSDKPlatforms/QQ
- mob_sharesdk/ShareSDKPlatforms/SinaWeibo
- mob_sharesdk/ShareSDKPlatforms/WeChat
- mob_sharesdk/ShareSDKUI
- zhiying_business_college (0.0.1):
- Flutter
- zhiying_comm (0.0.1):
- Flutter
- zhiying_equity_card (0.0.1):
- Flutter
- zhiying_member_upgrade (0.0.1):
- Flutter
- zhiying_new_user_free (0.0.1):
- Flutter
- zhiying_official (0.0.1):
- Flutter
- zhiying_wechat_teacher (0.0.1):
- Flutter

DEPENDENCIES:
- ali_auth_wbq (from `.symlinks/plugins/ali_auth_wbq/ios`)
@@ -213,8 +230,11 @@ DEPENDENCIES:
- flutter_alibc (from `.symlinks/plugins/flutter_alibc/ios`)
- flutter_native_image (from `.symlinks/plugins/flutter_native_image/ios`)
- flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`)
- flutter_user_agent (from `.symlinks/plugins/flutter_user_agent/ios`)
- flutter_webview_plugin (from `.symlinks/plugins/flutter_webview_plugin/ios`)
- flutter_xupdate (from `.symlinks/plugins/flutter_xupdate/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`)
- imei_plugin (from `.symlinks/plugins/imei_plugin/ios`)
@@ -222,6 +242,7 @@ DEPENDENCIES:
- moblink (from `.symlinks/plugins/moblink/ios`)
- mobpush_plugin (from `.symlinks/plugins/mobpush_plugin/ios`)
- mobsms (from `.symlinks/plugins/mobsms/ios`)
- more_picture_share (from `.symlinks/plugins/more_picture_share/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`)
@@ -244,9 +265,17 @@ DEPENDENCIES:
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
- video_player (from `.symlinks/plugins/video_player/ios`)
- video_player_web (from `.symlinks/plugins/video_player_web/ios`)
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
- zhiying_base_widget (from `.symlinks/plugins/zhiying_base_widget/ios`)
- zhiying_business_college (from `.symlinks/plugins/zhiying_business_college/ios`)
- zhiying_comm (from `.symlinks/plugins/zhiying_comm/ios`)
- zhiying_equity_card (from `.symlinks/plugins/zhiying_equity_card/ios`)
- zhiying_member_upgrade (from `.symlinks/plugins/zhiying_member_upgrade/ios`)
- zhiying_new_user_free (from `.symlinks/plugins/zhiying_new_user_free/ios`)
- zhiying_official (from `.symlinks/plugins/zhiying_official/ios`)
- zhiying_wechat_teacher (from `.symlinks/plugins/zhiying_wechat_teacher/ios`)

SPEC REPOS:
http://repo.baichuan-ios.taobao.com/baichuanSDK/AliBCSpecs.git:
@@ -258,8 +287,7 @@ SPEC REPOS:
- securityGuard
- UTDID
- WindVane
https://github.com/CocoaPods/Specs:
- AlipaySDK_No_UTDID_SUN
https://github.com/CocoaPods/Specs.git:
- FMDB
- mob_linksdk_pro
- mob_pushsdk
@@ -269,6 +297,7 @@ SPEC REPOS:
- MOBFoundation
- Reachability
- TOCropViewController
- WechatOpenSDK

EXTERNAL SOURCES:
ali_auth_wbq:
@@ -289,10 +318,16 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_native_image/ios"
flutter_plugin_android_lifecycle:
:path: ".symlinks/plugins/flutter_plugin_android_lifecycle/ios"
flutter_user_agent:
:path: ".symlinks/plugins/flutter_user_agent/ios"
flutter_webview_plugin:
:path: ".symlinks/plugins/flutter_webview_plugin/ios"
flutter_xupdate:
:path: ".symlinks/plugins/flutter_xupdate/ios"
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
fluwx:
:path: ".symlinks/plugins/fluwx/ios"
image_cropper:
:path: ".symlinks/plugins/image_cropper/ios"
image_picker:
@@ -307,6 +342,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/mobpush_plugin/ios"
mobsms:
:path: ".symlinks/plugins/mobsms/ios"
more_picture_share:
:path: ".symlinks/plugins/more_picture_share/ios"
package_info:
:path: ".symlinks/plugins/package_info/ios"
path_provider:
@@ -351,19 +388,34 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_web/ios"
url_launcher_windows:
:path: ".symlinks/plugins/url_launcher_windows/ios"
video_player:
:path: ".symlinks/plugins/video_player/ios"
video_player_web:
:path: ".symlinks/plugins/video_player_web/ios"
webview_flutter:
:path: ".symlinks/plugins/webview_flutter/ios"
zhiying_base_widget:
:path: ".symlinks/plugins/zhiying_base_widget/ios"
zhiying_business_college:
:path: ".symlinks/plugins/zhiying_business_college/ios"
zhiying_comm:
:path: ".symlinks/plugins/zhiying_comm/ios"
zhiying_equity_card:
:path: ".symlinks/plugins/zhiying_equity_card/ios"
zhiying_member_upgrade:
:path: ".symlinks/plugins/zhiying_member_upgrade/ios"
zhiying_new_user_free:
:path: ".symlinks/plugins/zhiying_new_user_free/ios"
zhiying_official:
:path: ".symlinks/plugins/zhiying_official/ios"
zhiying_wechat_teacher:
:path: ".symlinks/plugins/zhiying_wechat_teacher/ios"

SPEC CHECKSUMS:
ali_auth_wbq: 83e881b20722051dccc9117062f674d736509468
AliAuthSDK: 7018e8f3c8be3382e60f69d3b517c7de34c351e0
AlibcTradeSDK: 9a3e7af6cd648dd1f85684e82694c213fe48dad2
AliLinkPartnerSDK: c5778cdfdcee7bfe342238d39a77766184d36a46
AlipaySDK_No_UTDID_SUN: ac3f953a08c8ac8eaade23e338862208b885c344
BCUserTrack: 49251c6fb7c65cbbc221a492bbd3f3e142f1fb0f
connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467
connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b
@@ -373,8 +425,11 @@ SPEC CHECKSUMS:
flutter_alibc: 0e2a29e7c1de759672d87a260051240d209964b9
flutter_native_image: 9c0b7451838484458e5b0fae007b86a4c2d4bdfe
flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35
flutter_user_agent: 27c45d034dc31b80948d29998cea52cd3a7bf936
flutter_webview_plugin: ed9e8a6a96baf0c867e90e1bce2673913eeac694
flutter_xupdate: bdb588f0fe4f6c5e45436b8b0de08d505a50c04e
fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b
fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_cropper: 3c16d7651730ffe85897f5a1c4e2547e6b54989a
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
@@ -389,6 +444,7 @@ SPEC CHECKSUMS:
moblink: 3480a191e86c33f4e84af0cb5d2cc5627e78bf65
mobpush_plugin: 7b5a56692c538bc06e0386916cf7b21f77c1eb09
mobsms: 141956ad151a39a69a47a2ddf2e186405346c4ef
more_picture_share: f5b68ae17896e80168b24a0bc894395a104af0c5
mtopSDK: d6fdf81730342a69be920b576541c7bb81a683d5
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
@@ -406,9 +462,9 @@ SPEC CHECKSUMS:
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae
sharesdk_plugin: de8d8b87c50d60017472c5da425db1acd2911e0a
sharesdk_plugin: 455844465fc821a8ead9a9851ac928fa877cb379
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
tobias: 46e3fae88556c31a512721b97fc509a015174ebf
tobias: da6d872837de666e33393e7647aa6bc4ccb370b1
TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
@@ -416,10 +472,19 @@ SPEC CHECKSUMS:
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
UTDID: c28855683c5ea2e77e597cb14609328f7d470d6e
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44
WindVane: 56e096abae757397ccd3accb66a959f3ffcbf949
zhiying_base_widget: 064547d1dfe4a5832487f275cd4775d6da8f260c
zhiying_base_widget: 00868c0d2723a3a425c18b27204fbc67e3f7e59d
zhiying_business_college: dc3ba7fb32aad4db421aa94dbbc1ef712e7d00cd
zhiying_comm: 0daef4a480f4f4dbea3e11b615f3264aafea924b
zhiying_equity_card: 1afe5c3c8e5317dcebf55159b4087cd0d57e49ff
zhiying_member_upgrade: 1207671575ad01ed3336c604e235843a98fa1a0c
zhiying_new_user_free: 1640f83c12643475f03fabffcba13f498e555243
zhiying_official: 058e85b2792fbc6925b68f9c51f482a21e7400ee
zhiying_wechat_teacher: f93967511de28d14943cd69ba3f02fac0a5fcb00

PODFILE CHECKSUM: b66ec2c625af7ee344f37aae8918540c4b58b5ef



+ 0
- 3
example/ios/Runner.xcodeproj/project.pbxproj Voir le fichier

@@ -392,7 +392,6 @@
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@@ -476,7 +475,6 @@
};
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
@@ -532,7 +530,6 @@
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;


+ 2
- 0
example/lib/main.dart Voir le fichier

@@ -21,6 +21,7 @@ import 'package:zhiying_wechat_teacher/register.dart';
import 'package:zhiying_moments/register.dart';
import 'package:zhiying_member_upgrade/register.dart';
import 'package:zhiying_equity_card/zhiying_equity_card.dart';
import 'package:zhiying_official/register.dart';

void main() {
FlutterError.onError = (FlutterErrorDetails details) {
@@ -67,6 +68,7 @@ class _MyAppState extends State<MyApp> {
FriendCircleRegister.init();
MemberUpgradeRegister.init();
EquityCardRegister.init();
OfficialRegister.init();
print('初始化百川');
FlutterAlibc.initAlibc(version: "", appName: "").then((result) {
print("白川" + '${result.errorCode} ${result.errorMessage}');


+ 2
- 0
example/pubspec.yaml Voir le fichier

@@ -30,6 +30,8 @@ dev_dependencies:
path: ../../zhiying_business_college
zhiying_equity_card:
path: ../../zhiying_equity_card
zhiying_official:
path: ../../zhiying_official
#微信导师
zhiying_wechat_teacher:
#path: ../zhiying_wechat_teacher


+ 6
- 0
lib/pages/search_think_page/bloc/search_think_event.dart Voir le fichier

@@ -26,6 +26,12 @@ class SearchThinkChangeTypeEvent extends SearchThinkEvent{

/// 显示原本视图
class SearchThinkShowBaseViewEvent extends SearchThinkEvent{

///选中搜索的类型
final String type;

SearchThinkShowBaseViewEvent({this.type});

@override
List<Object> get props => [];
}

+ 14
- 7
lib/pages/webview/base_webview.dart Voir le fichier

@@ -3,6 +3,7 @@ import 'dart:io';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_user_agent/flutter_user_agent.dart';
import 'package:zhiying_base_widget/pages/launch_page/launch_page.dart';
import 'package:zhiying_comm/util/log/let_log.dart';
import 'package:zhiying_comm/util/empty_util.dart';
@@ -45,7 +46,7 @@ class _BaseWebviewState extends State<BaseWebview> {
loadData() {
print("加载数据");
progress = 0.0;
if(timer?.isActive??false){
if (timer?.isActive ?? false) {
timer?.cancel();
}
timer = Timer.periodic(Duration(milliseconds: 10), (timer) {
@@ -77,27 +78,33 @@ class _BaseWebviewState extends State<BaseWebview> {

@override
Widget build(BuildContext context) {
print("设备:"+FlutterUserAgent.webViewUserAgent);
return Scaffold(
appBar: _createNav(),
backgroundColor: Colors.white,
body: Stack(
children: <Widget>[
WebView(
initialMediaPlaybackPolicy: AutoMediaPlaybackPolicy.always_allow,
initialUrl: _url,
userAgent: FlutterUserAgent.userAgent,
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_webViewController = webViewController;
loadData();
},

navigationDelegate: (NavigationRequest request) async {

print("重定向" + request.url);
// 解决Android的拼多多webview 转发的问题
if (Platform.isAndroid) {
String url = request?.url?.toString();
if (!EmptyUtil.isEmpty(url) && !url.startsWith('https://') && !url.startsWith('http://')) {
Logger.log('navigation url = $url');
// if(await canLaunch(url)){
// await launch(url);
// }
if (await canLaunch(url)) {
await launch(url);
}
return NavigationDecision.prevent;
}
}
@@ -107,14 +114,14 @@ class _BaseWebviewState extends State<BaseWebview> {
print('Page started loading: $url');
},
onPageFinished: (String url) {
if(progress<0.8){
if (progress < 0.8) {
progress = 0.8;
}
setState(() {});
//setState(() {});
print('Page finished loading: $url');
_webViewController.getTitle().then((title) {
_title = title;
setState(() {});
// setState(() {});
});
},
gestureNavigationEnabled: true,


+ 4
- 0
lib/register.dart Voir le fichier

@@ -1,5 +1,6 @@
import 'dart:io';

import 'package:flutter_user_agent/flutter_user_agent.dart';
import 'package:jdsdk/jdsdk.dart';
import 'package:sharesdk_plugin/sharesdk_interface.dart';
import 'package:sharesdk_plugin/sharesdk_register.dart';
@@ -159,6 +160,9 @@ class BaseWidgetRegister {
// // 考拉
// NetUtil.post('/api/v1/rec/kaola?page=1', method: NetMethod.GET, cache: true, showToast: false);
LoginStyleUtil.fetchNetPageData();

FlutterUserAgent.init(force: true);

return null;
});



+ 17
- 3
lib/widgets/search/history_tag/search_history_tag.dart Voir le fichier

@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:convert';

import 'package:flutter/cupertino.dart';
@@ -7,6 +8,7 @@ import 'package:zhiying_base_widget/pages/search_page/notifier/search_tag_notifi
import 'package:zhiying_base_widget/pages/search_result_page/search_result_page.dart';
import 'package:zhiying_base_widget/pages/search_think_page/model/search_think_model.dart';
import 'package:zhiying_base_widget/widgets/search/history_tag/model/search_history_model.dart';
import 'package:zhiying_base_widget/widgets/search/input/model/SearchTabBarEvent.dart';
import 'package:zhiying_base_widget/widgets/search/widget/text_tag_widget.dart';
import 'package:zhiying_base_widget/widgets/search/widget/title_widget.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
@@ -39,15 +41,18 @@ class _SearchHistoryTagWidgetState extends State<SearchHistoryTagWidget> {
/// 最大存储条数
static final int MAX_COUNT = 10;

String type;

StreamSubscription subscription;

/// 点击历史标签
void _historyTagClick(String tag) {
if (!EmptyUtil.isEmpty(tag)) {
SearchThinkModel model = SearchThinkModel();
model.type = (Provider.of<SearchTagNotifier>(context, listen: false)?.getType()) ?? GlobalConfig.PROVIDER_TB;
model.type = type ?? GlobalConfig.PROVIDER_TB;
model.keywords = tag ?? '';
Provider.of<SearchTagNotifier>(context, listen: false).addTag(tag);
Navigator.push(
context, CupertinoPageRoute(builder: (_) => SearchResultPage(model.toJson()..['tag'] = 'search_page')));
Navigator.push(context, CupertinoPageRoute(builder: (_) => SearchResultPage(model.toJson()..['tag'] = 'search_page')));
// Navigator.push(
// context, CupertinoPageRoute(builder: (_) => SearchResultPage({'keywords': tag ?? '', 'tag': 'search_page'})));
}
@@ -96,6 +101,9 @@ class _SearchHistoryTagWidgetState extends State<SearchHistoryTagWidget> {

@override
void initState() {
subscription = EventUtil.instance.on<SearchTabBarEvent>().listen((event) {
type = event.type;
});
_initHistoryTag();
super.initState();
}
@@ -111,6 +119,12 @@ class _SearchHistoryTagWidgetState extends State<SearchHistoryTagWidget> {
super.didChangeDependencies();
}

@override
void dispose() {
subscription?.cancel();
super.dispose();
}

@override
Widget build(BuildContext context) {
return Container(


+ 32
- 5
lib/widgets/search/hot_tag/search_hot_tag_widget.dart Voir le fichier

@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:convert';

import 'package:flutter/cupertino.dart';
@@ -6,6 +7,7 @@ import 'package:zhiying_base_widget/pages/search_page/notifier/search_tag_notifi
import 'package:zhiying_base_widget/pages/search_result_page/search_result_page.dart';
import 'package:zhiying_base_widget/pages/search_think_page/model/search_think_model.dart';
import 'package:zhiying_base_widget/widgets/search/hot_tag/model/search_hot_tag_model.dart';
import 'package:zhiying_base_widget/widgets/search/input/model/SearchTabBarEvent.dart';
import 'package:zhiying_base_widget/widgets/search/widget/text_tag_widget.dart';
import 'package:zhiying_base_widget/widgets/search/widget/title_widget.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
@@ -14,7 +16,8 @@ import 'package:provider/provider.dart';
///
/// 搜索页面,热门搜索的标签
///
class SearchHotTagWidget extends StatelessWidget {

class SearchHotTagWidget extends StatefulWidget {
final Map<String, dynamic> data;
SearchHotTagModel model;

@@ -26,18 +29,42 @@ class SearchHotTagWidget extends StatelessWidget {
}
}

@override
_SearchHotTagWidgetState createState() => _SearchHotTagWidgetState();
}

class _SearchHotTagWidgetState extends State<SearchHotTagWidget> {
Map<String, dynamic> data;
SearchHotTagModel model;
String type;
StreamSubscription subscription;

@override
void initState() {
data = widget?.data;
model = widget?.model;
subscription = EventUtil.instance.on<SearchTabBarEvent>().listen((event) {
type = event.type;
});
super.initState();
}

@override
void dispose() {
subscription?.cancel();
super.dispose();
}

/// 点击事件
void _tagOnClick(BuildContext context, SearchHostTagItemModel model) async {
print('${model?.keyword}');
if (!EmptyUtil.isEmpty(model?.keyword)) {

Provider.of<SearchTagNotifier>(context, listen: false).addTag(model.keyword);

SearchThinkModel searchThinkModel = SearchThinkModel();
searchThinkModel.type = (Provider.of<SearchTagNotifier>(context, listen: false)?.getType()) ?? GlobalConfig.PROVIDER_TB;
searchThinkModel.type = type ?? GlobalConfig.PROVIDER_TB;
searchThinkModel.keywords = model?.keyword ?? '';
Navigator.push(
context, CupertinoPageRoute(builder: (_) => SearchResultPage(searchThinkModel.toJson()..['tag'] = 'search_page')));
Navigator.push(context, CupertinoPageRoute(builder: (_) => SearchResultPage(searchThinkModel.toJson()..['tag'] = 'search_page')));
// Navigator.push(context, CupertinoPageRoute(builder: (_) => SearchResultPage({'keywords': model?.keyword ?? '', 'tag': 'search_page'})));
}
}


+ 7
- 0
lib/widgets/search/input/model/SearchTabBarEvent.dart Voir le fichier

@@ -0,0 +1,7 @@

///用于搜索第一页的tabbar事件
class SearchTabBarEvent{
final String type;

SearchTabBarEvent(this.type);
}

+ 11
- 3
lib/widgets/search/input/search_input_widget.dart Voir le fichier

@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:convert';
import 'dart:ui';

@@ -12,6 +13,7 @@ import 'package:zhiying_base_widget/pages/search_result_page/search_result_page.
import 'package:zhiying_base_widget/pages/search_think_page/bloc/search_think_bloc.dart';
import 'package:zhiying_base_widget/pages/search_think_page/model/search_think_model.dart';
import 'package:zhiying_base_widget/pages/search_think_page/search_think_page.dart';
import 'package:zhiying_base_widget/widgets/search/input/model/SearchTabBarEvent.dart';
import 'package:zhiying_base_widget/widgets/search/input/model/search_input_model.dart';
import 'package:zhiying_base_widget/widgets/search/input/search_input_sk.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
@@ -38,6 +40,8 @@ class SearchInputWidget extends StatefulWidget {
class _SearchInputWidgetState extends State<SearchInputWidget> {
FocusNode _focusNode;
TextEditingController _editingController;
String type;
StreamSubscription subscription;

/// 点击搜索按钮
void _onSearchButtomClick() async {
@@ -48,10 +52,10 @@ class _SearchInputWidgetState extends State<SearchInputWidget> {
Provider.of<SearchTagNotifier>(context, listen: false).addTag(content);
RouterUtil.hideKeyboard(context);
SearchThinkModel searchThinkModel = SearchThinkModel();
searchThinkModel.type = (Provider.of<SearchTagNotifier>(context, listen: false)?.getType()) ?? GlobalConfig.PROVIDER_TB;

searchThinkModel.type = type ?? GlobalConfig.PROVIDER_TB;
searchThinkModel.keywords = content ?? '';
Navigator.push(
context, CupertinoPageRoute(builder: (_) => SearchResultPage(searchThinkModel.toJson()..['tag'] = 'search_page')));
Navigator.push(context, CupertinoPageRoute(builder: (_) => SearchResultPage(searchThinkModel.toJson()..['tag'] = 'search_page')));

// Navigator.push(context, CupertinoPageRoute(builder: (_) => SearchResultPage({'keywords': content, 'tag': 'search_page'})));
} else {
@@ -89,6 +93,9 @@ class _SearchInputWidgetState extends State<SearchInputWidget> {
void initState() {
_focusNode = FocusNode();
_editingController = TextEditingController();
subscription = EventUtil.instance.on<SearchTabBarEvent>().listen((event) {
type = event.type;
});
super.initState();
}

@@ -97,6 +104,7 @@ class _SearchInputWidgetState extends State<SearchInputWidget> {
_focusNode?.unfocus();
_focusNode?.dispose();
_editingController?.dispose();
subscription?.cancel();
super.dispose();
}



+ 2
- 0
lib/widgets/search/tabbar/search_tab_widget.dart Voir le fichier

@@ -10,6 +10,7 @@ import 'package:zhiying_base_widget/pages/search_result_page/search_result_page.
import 'package:zhiying_base_widget/pages/search_think_page/bloc/search_think_bloc.dart';
import 'package:zhiying_base_widget/pages/search_think_page/model/search_think_model.dart';
import 'package:zhiying_base_widget/widgets/home/home_quick_entry/cached_network_image_util.dart';
import 'package:zhiying_base_widget/widgets/search/input/model/SearchTabBarEvent.dart';
import 'package:zhiying_base_widget/widgets/search/tabbar/search_tab_sk.dart';
import 'package:zhiying_base_widget/widgets/search/widget/my_tab.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -63,6 +64,7 @@ class _SearchTabWidgetState extends State<SearchTabWidget> {
try {
_type = widget.model.search_icon_list[_tabController.index].type;
Provider.of<SearchTagNotifier>(context, listen: false).setType(_type);
EventUtil.instance.fire(SearchTabBarEvent(_type));
} catch (e, s) {
Logger.error(e, s);
}


+ 41
- 22
lib/widgets/search_result/search_input/search_result_input.dart Voir le fichier

@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:convert';

import 'package:flutter/cupertino.dart';
@@ -7,6 +8,7 @@ import 'package:zhiying_base_widget/pages/search_result_page/search_result_page.
import 'package:zhiying_base_widget/pages/search_think_page/bloc/search_think_bloc.dart';
import 'package:provider/provider.dart';
import 'package:zhiying_base_widget/widgets/search_result/search_input/model/search_result_input_model.dart';
import 'package:zhiying_base_widget/widgets/search_result/tarbar/model/search_btn_event.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
import 'dart:ui';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -35,6 +37,12 @@ class _SearchResultInputWidgetState extends State<SearchResultInputWidget> {
FocusNode _focusNode;
bool _canSearchTag = true;

StreamSubscription subscription;

String lastText;

String _type;

/// 返回事件
void _openPop() {
Navigator.maybePop(context);
@@ -44,57 +52,68 @@ class _SearchResultInputWidgetState extends State<SearchResultInputWidget> {
void _onSearchButtomClick() {
print('搜索商品');
RouterUtil.hideKeyboard(context);

/// 搜索
if(!_canSearchTag){
if (!_canSearchTag) {
BlocProvider.of<SearchThinkBloc>(context).add(SearchThinkShowBaseViewEvent());
}
if(_canSearchTag){
_onSearchInputSubmit();
}
}

/// 搜索事件
void _onSearchInputSubmit(){

void _onSearchInputSubmit() {
String text = _textEditingController?.text?.toString()?.trim();
if(!EmptyUtil.isEmpty(text)) {
Provider.of<SearchTagNotifier>(context, listen: false).addTag(text);
RouterUtil.hideKeyboard(context);
// TODO ❌ 如果使用咸鱼,则这里需要改成 push
Navigator.pushReplacement(context, CupertinoPageRoute(
builder: (_) => SearchResultPage({'keywords':text}),
builder: (_) => SearchResultPage({'keywords':text,'type':_type}),
//SearchResultPage(model.toJson()..['tag'] = 'search_page')
));
}
}

/// 输入变化
void _onChanged(String text){
void _onChanged(String text) {
Logger.log('onChanged input text = $text');
if(!EmptyUtil.isEmpty(text)){
if (!EmptyUtil.isEmpty(text)) {
BlocProvider.of<SearchThinkBloc>(context).add(SearchThinkKeyWrodsChangeEvent(text));
}else{
} else {
BlocProvider.of<SearchThinkBloc>(context).add(SearchThinkShowBaseViewEvent());
}
}


@override
void initState() {
_textEditingController = TextEditingController(text: widget?.model?.keywords ?? '');
_focusNode = FocusNode()..addListener(() {
bool hasFocus = _focusNode?.hasFocus ?? false;
Logger.log('onInputClick input onTap = $hasFocus');
if(hasFocus){
lastText = _textEditingController.text;
if(widget?.data.containsKey('type')){
_type=widget?.data['type'];
}

_focusNode = FocusNode()
..addListener(() {
bool hasFocus = _focusNode?.hasFocus ?? false;
Logger.log('onInputClick input onTap = $hasFocus');
if (hasFocus) {
String text = _textEditingController?.text?.toString()?.trim();
if(!EmptyUtil.isEmpty(text)){
if (!EmptyUtil.isEmpty(text)) {
BlocProvider.of<SearchThinkBloc>(context).add(SearchThinkKeyWrodsChangeEvent(text));
}
setState(() {
_canSearchTag = false;
});
}else{
} else {
setState(() {
_canSearchTag =true;
_canSearchTag = true;
});
}
}
});
subscription = EventUtil.instance.on<SearchBtnEvent>().listen((event) {
_type=event.type;
});
super.initState();
}
@@ -104,10 +123,10 @@ class _SearchResultInputWidgetState extends State<SearchResultInputWidget> {
_focusNode?.unfocus();
_focusNode?.dispose();
_textEditingController?.dispose();
subscription?.cancel();
super.dispose();
}


@override
Widget build(BuildContext context) {
return Container(
@@ -143,7 +162,6 @@ class _SearchResultInputWidgetState extends State<SearchResultInputWidget> {
Icons.arrow_back_ios,
size: 22,
color: HexColor.fromHex('#000000'),

),
onPressed: () => _openPop(),
);
@@ -151,9 +169,10 @@ class _SearchResultInputWidgetState extends State<SearchResultInputWidget> {

/// 搜索按钮
Widget _createSubmitButtomWidget(SearchResultInputModel model) {

return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: ()=> _onSearchButtomClick(),
onTap: () => _onSearchButtomClick(),
child: Container(
alignment: Alignment.center,
padding: const EdgeInsets.only(
@@ -163,7 +182,8 @@ class _SearchResultInputWidgetState extends State<SearchResultInputWidget> {
),
child: Text(
_canSearchTag ? model?.search_button ?? '搜索' : '取消',
style: TextStyle(fontSize: 14, color: HexColor.fromHex(_canSearchTag ?model?.search_button_color : '#999999'), fontWeight: _canSearchTag? FontWeight.bold : FontWeight.normal),
style: TextStyle(
fontSize: 14, color: HexColor.fromHex(_canSearchTag ? model?.search_button_color : '#999999'), fontWeight: _canSearchTag ? FontWeight.bold : FontWeight.normal),
),
),
);
@@ -196,7 +216,7 @@ class _SearchResultInputWidgetState extends State<SearchResultInputWidget> {
contentPadding: EdgeInsets.zero,
// contentPadding: const EdgeInsets.only(left: 0, right: 0,top: 0 ,bottom: 12),
// focusColor: Colors.transparent,
fillColor: Colors.transparent,
fillColor: Colors.transparent,
border: InputBorder.none,
focusedBorder: InputBorder.none,
focusedErrorBorder: InputBorder.none,
@@ -210,5 +230,4 @@ class _SearchResultInputWidgetState extends State<SearchResultInputWidget> {
),
);
}

}

+ 8
- 0
lib/widgets/search_result/tarbar/model/search_btn_event.dart Voir le fichier

@@ -0,0 +1,8 @@


///点击tabBar时的类型传递
class SearchBtnEvent{
final String type;

SearchBtnEvent(this.type);
}

+ 6
- 0
lib/widgets/search_result/tarbar/search_result_tab_widget.dart Voir le fichier

@@ -1,5 +1,6 @@
import 'dart:convert';

import 'package:event_bus/event_bus.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:cached_network_image/cached_network_image.dart';
@@ -14,6 +15,7 @@ import 'package:zhiying_base_widget/widgets/search/tabbar/search_tab_sk.dart';
import 'package:zhiying_base_widget/widgets/search/widget/my_tab.dart';
import 'package:provider/provider.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:zhiying_base_widget/widgets/search_result/tarbar/model/search_btn_event.dart';

import 'package:zhiying_comm/zhiying_comm.dart';

@@ -66,6 +68,9 @@ class _SearchResultTabWidgetState extends State<SearchResultTabWidget> {
}
}
}catch(_){}
Future.delayed(Duration(milliseconds: 10),(){
EventUtil.instance.fire(SearchBtnEvent(_type));
});
_tabController = TabController(length: length, vsync: ScrollableState(), initialIndex: initIndex)
..addListener(() {
try{
@@ -75,6 +80,7 @@ class _SearchResultTabWidgetState extends State<SearchResultTabWidget> {
}catch(e, s){
Logger.error(e, s);
}
EventUtil.instance.fire(SearchBtnEvent(_type));
});




+ 2
- 1
lib/zhiying_base_widget.dart Voir le fichier

@@ -4,4 +4,5 @@ export 'dialog/loading/loading.dart';
export 'package:flutter_swiper/flutter_swiper.dart';
export 'package:zhiying_base_widget/pages/main_page/model/background_model.dart';
export 'package:zhiying_base_widget/pages/custom_page/bloc/background_bloc.dart';
export 'package:pull_to_refresh/pull_to_refresh.dart';
export 'package:pull_to_refresh/pull_to_refresh.dart';
export 'package:flutter_user_agent/flutter_user_agent.dart';

+ 3
- 0
pubspec.yaml Voir le fichier

@@ -50,11 +50,14 @@ dependencies:
intl: 0.16.1

loading_indicator: ^1.2.0
#webView
flutter_webview_plugin: 0.3.11

mobpush_plugin:
plugin_platform_interface: ^1.0.1
permission_handler_platform_interface: ^2.0.1

flutter_user_agent: ^1.2.2


dev_dependencies:


Chargement…
Annuler
Enregistrer