@@ -23,9 +23,15 @@ if (flutterVersionName == null) { | |||||
flutterVersionName = '1.0' | flutterVersionName = '1.0' | ||||
} | } | ||||
// 获取当前时间(年月日) | |||||
def releaseTime() { | |||||
return new Date().format("YYYYMMdd", TimeZone.getTimeZone("UTC")) | |||||
} | |||||
apply plugin: 'com.android.application' | apply plugin: 'com.android.application' | ||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" | ||||
android { | android { | ||||
compileSdkVersion 28 | compileSdkVersion 28 | ||||
@@ -33,23 +39,116 @@ android { | |||||
disable 'InvalidPackage' | disable 'InvalidPackage' | ||||
} | } | ||||
// 默认配置 | |||||
defaultConfig { | defaultConfig { | ||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). | |||||
applicationId "cn.zhios.zhiying_base_widget_example" | |||||
minSdkVersion 19 | |||||
applicationId "cn.zhios.zhiying" | |||||
minSdkVersion 21 | |||||
targetSdkVersion 28 | targetSdkVersion 28 | ||||
versionCode flutterVersionCode.toInteger() | |||||
versionName flutterVersionName | |||||
versionCode 1 | |||||
versionName "1.0" | |||||
aaptOptions.cruncherEnabled = false | |||||
aaptOptions.useNewCruncher = false | |||||
multiDexEnabled true | |||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||||
ndk { | |||||
//选择要添加的对应cpu类型的.so库。 | |||||
abiFilters 'armeabi', 'armeabi-v7a', 'x86','x86_64', 'mips', 'mips64', 'arm64-v8a' | |||||
} | |||||
} | } | ||||
buildTypes { | buildTypes { | ||||
debug { | |||||
buildConfigField "boolean", "LOG_DEBUG", "true" | |||||
minifyEnabled false | |||||
zipAlignEnabled true | |||||
shrinkResources false | |||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |||||
} | |||||
release { | release { | ||||
// TODO: Add your own signing config for the release build. | |||||
// Signing with the debug keys for now, so `flutter run --release` works. | |||||
signingConfig signingConfigs.debug | |||||
buildConfigField "boolean", "LOG_DEBUG", "false" | |||||
minifyEnabled false | |||||
shrinkResources false | |||||
zipAlignEnabled true | |||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | |||||
} | } | ||||
} | } | ||||
dexOptions { | |||||
//最大堆内存 | |||||
javaMaxHeapSize "4g"//4g | |||||
//使用增量模式构建 | |||||
incremental true | |||||
//是否支持大工程模式 | |||||
jumboMode = true | |||||
//预编译 | |||||
preDexLibraries = false | |||||
//线程数 | |||||
threadCount = 8 | |||||
} | |||||
// | |||||
// // 签名配置 | |||||
// signingConfigs { | |||||
// // 智夜生活 | |||||
// zhiying { | |||||
// storeFile file('zhiying.jks') | |||||
// storePassword 'zhioscom' | |||||
// keyAlias 'zysh' | |||||
// keyPassword 'zhioscom' | |||||
// v1SigningEnabled true | |||||
// v2SigningEnabled true | |||||
// } | |||||
// | |||||
// } | |||||
// | |||||
// flavorDimensions "app" | |||||
// | |||||
// | |||||
// // 应用信息配置 | |||||
// productFlavors { | |||||
// // 智夜生活 | |||||
// zhiying { | |||||
// applicationId "cn.zhios.zhiying" | |||||
// versionCode 1 | |||||
// dimension "app" | |||||
// versionName '1.0.0' | |||||
// // 签名信息 | |||||
// 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 -> | |||||
def requested = details.requested | |||||
if (requested.group == 'com.android.support') { | |||||
if (!requested.name.startsWith("multidex")) { | |||||
details.useVersion '28.0.3' | |||||
} | |||||
} | |||||
resolutionStrategy.force 'com.android.support:support-v4:28.0.0' | |||||
} | |||||
} | |||||
} | } | ||||
flutter { | flutter { | ||||
@@ -10,6 +10,7 @@ | |||||
android:name="io.flutter.app.FlutterApplication" | android:name="io.flutter.app.FlutterApplication" | ||||
android:label="zhiying_base_widget_example" | android:label="zhiying_base_widget_example" | ||||
android:icon="@mipmap/ic_launcher" | android:icon="@mipmap/ic_launcher" | ||||
android:usesCleartextTraffic="true" | |||||
tools:replace="android:label"> | tools:replace="android:label"> | ||||
<activity | <activity | ||||
android:name=".MainActivity" | android:name=".MainActivity" | ||||
@@ -38,7 +38,7 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN | |||||
@Override | @Override | ||||
public Map getSetting() { | public Map getSetting() { | ||||
Map map = new HashMap(); | Map map = new HashMap(); | ||||
map.put("domain", "http://192.168.0.113:5000"); //"http://120.76.175.204:8989"); | |||||
map.put("domain", "http://inapi.izhyin.cn"); //"http://120.76.175.204:8989"); | |||||
map.put("master_id", "123456"); | map.put("master_id", "123456"); | ||||
map.put("secret_key", "123456"); | map.put("secret_key", "123456"); | ||||
// map.put("token", "123465"); | // map.put("token", "123465"); | ||||
@@ -37,8 +37,9 @@ class _MyAppState extends State<MyApp> { | |||||
super.initState(); | super.initState(); | ||||
print('初始化~~~~'); | print('初始化~~~~'); | ||||
BaseWidgetRegister.init(); | BaseWidgetRegister.init(); | ||||
print('初始化百川'); | |||||
FlutterAlibc.initAlibc(version: "", appName: "").then((result) { | FlutterAlibc.initAlibc(version: "", appName: "").then((result) { | ||||
Logger.debug('${result.errorCode} ${result.errorMessage}'); | |||||
print("白川"+'${result.errorCode} ${result.errorMessage}'); | |||||
}); | }); | ||||
} | } | ||||
@@ -5,6 +5,7 @@ import 'package:flutter/cupertino.dart'; | |||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
import 'package:flutter/services.dart'; | import 'package:flutter/services.dart'; | ||||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/Intellect_search_set_model.dart'; | import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/Intellect_search_set_model.dart'; | ||||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/intellect_dialog_data_model.dart'; | |||||
import 'package:zhiying_base_widget/utils/contants.dart'; | import 'package:zhiying_base_widget/utils/contants.dart'; | ||||
import 'package:zhiying_comm/util/shared_prefe_util.dart'; | import 'package:zhiying_comm/util/shared_prefe_util.dart'; | ||||
@@ -15,13 +16,22 @@ import 'package:string_validator/string_validator.dart'; | |||||
class IntellectCreate { | class IntellectCreate { | ||||
static IntellectSearchSetModel _setModel; | static IntellectSearchSetModel _setModel; | ||||
static bool isRequest = false; | |||||
///判断规则 | ///判断规则 | ||||
static checkAndCreate(AppLifecycleState state, BuildContext context) async { | static checkAndCreate(AppLifecycleState state, BuildContext context) async { | ||||
if (state == AppLifecycleState.resumed && | |||||
!Constants.isShowIntellectDialog) { | |||||
if (state == AppLifecycleState.resumed && !isRequest) { | |||||
isRequest = true; | |||||
_requestSetData(context); | _requestSetData(context); | ||||
} | } | ||||
// Timer(Duration(milliseconds: 500), () async { | |||||
// if (!Constants.isShowIntellectDialog) { | |||||
// Constants.isShowIntellectDialog = true; | |||||
// await showDialog( | |||||
// context: context, child: IntellectSearchGoodsDialog()); | |||||
// Constants.isShowIntellectDialog = false; | |||||
// } | |||||
// }); | |||||
} | } | ||||
///请求设置参数 | ///请求设置参数 | ||||
@@ -30,31 +40,36 @@ class IntellectCreate { | |||||
var param = {"webId": ""}; | var param = {"webId": ""}; | ||||
//请求参数 | //请求参数 | ||||
NetUtil.request('/api/v1/cfg/app_clipboard', params: param, | |||||
await NetUtil.request('/api/v1/cfg/clipboard_base', params: param, | |||||
onSuccess: (data) async { | onSuccess: (data) async { | ||||
print("设置参数" + data.toString()); | print("设置参数" + data.toString()); | ||||
///检查是否已缓存过设置信息 | ///检查是否已缓存过设置信息 | ||||
String result = await SharedPreferencesUtil.getStringValue( | String result = await SharedPreferencesUtil.getStringValue( | ||||
Constants.spIsCacheSetModel); | Constants.spIsCacheSetModel); | ||||
_setModel = IntellectSearchSetModel.fromJson(data); | |||||
_setModel = IntellectSearchSetModel.fromJson( | |||||
json.decode(data['clipboard_base'])); | |||||
if (result.isEmpty) { | if (result.isEmpty) { | ||||
validate(context, _setModel); | validate(context, _setModel); | ||||
} | } | ||||
SharedPreferencesUtil.setNetCacheResult( | SharedPreferencesUtil.setNetCacheResult( | ||||
Constants.spIsCacheSetModel, json.encode(data)); | |||||
Constants.spIsCacheSetModel, data['clipboard_base']); | |||||
}); | }); | ||||
isRequest = false; | |||||
///拿缓存数据 | ///拿缓存数据 | ||||
var cacheData = await SharedPreferencesUtil.getNetCacheResult( | var cacheData = await SharedPreferencesUtil.getNetCacheResult( | ||||
Constants.spIsCacheSetModel); | Constants.spIsCacheSetModel); | ||||
///如果存在缓存直接进入验证阶段 | ///如果存在缓存直接进入验证阶段 | ||||
if (cacheData.isNotEmpty) { | |||||
if (cacheData != null) { | |||||
_setModel = IntellectSearchSetModel.fromJson(cacheData); | _setModel = IntellectSearchSetModel.fromJson(cacheData); | ||||
validate(context, _setModel); | validate(context, _setModel); | ||||
} | } | ||||
} else { | } else { | ||||
validate(context, _setModel); | validate(context, _setModel); | ||||
isRequest = false; | |||||
} | } | ||||
} | } | ||||
@@ -65,46 +80,73 @@ class IntellectCreate { | |||||
///请求数据打开弹窗 | ///请求数据打开弹窗 | ||||
static requestDialog(BuildContext context, String content) async { | static requestDialog(BuildContext context, String content) async { | ||||
Constants.isShowIntellectDialog = true; | |||||
await showDialog(context: context, child: IntellectSearchGoodsDialog()); | |||||
Constants.isShowIntellectDialog = false; | |||||
content = | |||||
"6緮置内容 Http:/T¢ZKkjceixTjW¢转移至ta0寶【URBANISTA/爱班Stockholm斯德哥尔摩 真无线蓝牙运动耳机半入耳式】"; | |||||
var params = {"content": content}; | |||||
NetUtil.request("/api/v1/clipboard/parse", | |||||
params: params, method: NetMethod.POST, onSuccess: (data) async { | |||||
isRequest = false; | |||||
if (data == null || data.toString().length == 0) { | |||||
if (!Constants.isShowIntellectDialog) { | |||||
Constants.isShowIntellectDialog = true; | |||||
await showDialog( | |||||
context: context, child: IntellectSearchNoGoodsDialog()); | |||||
Constants.isShowIntellectDialog = false; | |||||
} | |||||
} else { | |||||
IntellectDialogDataModel model = | |||||
IntellectDialogDataModel.fromJson(data); | |||||
if (!Constants.isShowIntellectDialog) { | |||||
Constants.isShowIntellectDialog = true; | |||||
await showDialog( | |||||
context: context, | |||||
child: IntellectSearchGoodsDialog( | |||||
model: model, | |||||
)); | |||||
Constants.isShowIntellectDialog = false; | |||||
} | |||||
} | |||||
}); | |||||
} | } | ||||
///检查字段是否被监听 | ///检查字段是否被监听 | ||||
static void validate( | static void validate( | ||||
BuildContext context, IntellectSearchSetModel setModel) async { | BuildContext context, IntellectSearchSetModel setModel) async { | ||||
ClipboardData data = await Clipboard.getData(Clipboard.kTextPlain); | ClipboardData data = await Clipboard.getData(Clipboard.kTextPlain); | ||||
String content = data.text; | |||||
//是否监听 | |||||
if (setModel.state != "1") { | |||||
return; | |||||
} | |||||
///长度大小限制 | |||||
if (setModel.keywordLimitState == "1" && | |||||
(int.tryParse(setModel.keywordLimitMin) < content.length) || | |||||
(int.tryParse(setModel.keywordLimitMax) > content.length)) { | |||||
return; | |||||
} | |||||
//是否纯数字 | |||||
if (setModel.keywordNum == "1" && isNumeric(content)) { | |||||
return; | |||||
} | |||||
///是否纯字母 | |||||
if (setModel.keywordAlpha == "1" && isAlpha(content)) { | |||||
return; | |||||
} | |||||
///是否仅包含数字和字母 | |||||
if (setModel.keywordAlphanum == "1" && isAlphanumeric(content)) { | |||||
return; | |||||
} | |||||
String content = data?.text ?? ""; | |||||
// //是否监听 | |||||
// if (setModel.isListen != "1") { | |||||
// return; | |||||
// } | |||||
// | |||||
// if(content==null||content.length==0){ | |||||
// return; | |||||
// } | |||||
// ///长度大小限制 | |||||
// if (setModel.isKeyLength == "1" && | |||||
// (int.tryParse(setModel.keyLengthMin) > content.length) || | |||||
// (int.tryParse(setModel.keyLengthMax) < content.length)) { | |||||
// return; | |||||
// } | |||||
// | |||||
// //是否纯数字 | |||||
// if (setModel.isNumber == "1" && isNumeric(content)) { | |||||
// return; | |||||
// } | |||||
// | |||||
// ///是否纯字母 | |||||
// if (setModel.isLetter == "1" && isAlpha(content)) { | |||||
// return; | |||||
// } | |||||
// | |||||
// ///是否仅包含数字和字母 | |||||
// if (setModel.isNumAndLet == "1" && isAlphanumeric(content)) { | |||||
// return; | |||||
// } | |||||
///是否包含某个排除词 | ///是否包含某个排除词 | ||||
if (setModel.exclude.length > 0) { | |||||
for (var item in setModel.exclude) { | |||||
if (setModel.banWords != null && setModel.banWords.length > 0) { | |||||
for (var item in setModel.banWords) { | |||||
if (contains(content, item)) { | if (contains(content, item)) { | ||||
return; | return; | ||||
} | } | ||||
@@ -1,10 +1,24 @@ | |||||
import 'dart:convert'; | |||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
import 'package:flutter/services.dart'; | |||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/has_goods_dialog_style_model.dart'; | |||||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/intellect_dialog_data_model.dart'; | |||||
import 'package:zhiying_base_widget/widgets/home/home_quick_entry/cached_network_image_util.dart'; | import 'package:zhiying_base_widget/widgets/home/home_quick_entry/cached_network_image_util.dart'; | ||||
import 'package:cached_network_image/cached_network_image.dart'; | import 'package:cached_network_image/cached_network_image.dart'; | ||||
import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/model/wallet_detail_model.dart'; | |||||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||||
import 'package:provider/provider.dart'; | |||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'package:flutter_alibc/flutter_alibc.dart'; | |||||
import 'package:flutter_alibc/alibc_model.dart'; | |||||
class IntellectSearchGoodsDialog extends StatefulWidget { | class IntellectSearchGoodsDialog extends StatefulWidget { | ||||
final IntellectDialogDataModel model; | |||||
const IntellectSearchGoodsDialog({Key key, this.model}) : super(key: key); | |||||
@override | @override | ||||
_IntellectSearchGoodsDialogState createState() => | _IntellectSearchGoodsDialogState createState() => | ||||
_IntellectSearchGoodsDialogState(); | _IntellectSearchGoodsDialogState(); | ||||
@@ -12,8 +26,19 @@ class IntellectSearchGoodsDialog extends StatefulWidget { | |||||
class _IntellectSearchGoodsDialogState | class _IntellectSearchGoodsDialogState | ||||
extends State<IntellectSearchGoodsDialog> { | extends State<IntellectSearchGoodsDialog> { | ||||
HasGoodsDialogStyleModel _styleModel; | |||||
UserInfoModel _userInfo; | |||||
@override | |||||
void initState() { | |||||
//Clipboard.setData(ClipboardData(text: "")); | |||||
requestStyle(); | |||||
super.initState(); | |||||
} | |||||
@override | @override | ||||
Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
_userInfo = Provider.of<UserInfoNotifier>(context).userInfo; | |||||
return Scaffold( | return Scaffold( | ||||
backgroundColor: Colors.transparent, | backgroundColor: Colors.transparent, | ||||
body: InkWell( | body: InkWell( | ||||
@@ -35,7 +60,8 @@ class _IntellectSearchGoodsDialogState | |||||
right: 30.w, | right: 30.w, | ||||
bottom: 48.h), | bottom: 48.h), | ||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
color: Colors.white, | |||||
color: | |||||
HexColor.fromHex(_styleModel?.bgColor ?? "#FFFFFF"), | |||||
borderRadius: BorderRadius.circular(16)), | borderRadius: BorderRadius.circular(16)), | ||||
width: double.infinity, | width: double.infinity, | ||||
child: Column( | child: Column( | ||||
@@ -46,11 +72,11 @@ class _IntellectSearchGoodsDialogState | |||||
height: 76.h, | height: 76.h, | ||||
child: Center( | child: Center( | ||||
child: Container( | child: Container( | ||||
color: Colors.red, | |||||
height: 76.h, | height: 76.h, | ||||
width: 216.w, | width: 216.w, | ||||
child: CachedNetworkImage( | child: CachedNetworkImage( | ||||
imageUrl: "", | |||||
imageUrl: _styleModel?.titleImg ?? "", | |||||
fit: BoxFit.fill, | |||||
), | ), | ||||
)), | )), | ||||
), | ), | ||||
@@ -68,9 +94,14 @@ class _IntellectSearchGoodsDialogState | |||||
crossAxisAlignment: CrossAxisAlignment.start, | crossAxisAlignment: CrossAxisAlignment.start, | ||||
children: <Widget>[ | children: <Widget>[ | ||||
Container( | Container( | ||||
color: Colors.red, | |||||
width: 160.w, | width: 160.w, | ||||
height: 160.w, | height: 160.w, | ||||
decoration: BoxDecoration( | |||||
borderRadius: BorderRadius.circular(6), | |||||
image: DecorationImage( | |||||
image: | |||||
CachedNetworkImageProvider(widget.model?.thumbnail ?? ""), | |||||
fit: BoxFit.fill)), | |||||
), | ), | ||||
SizedBox( | SizedBox( | ||||
width: 19.w, | width: 19.w, | ||||
@@ -84,7 +115,7 @@ class _IntellectSearchGoodsDialogState | |||||
Column( | Column( | ||||
children: <Widget>[ | children: <Widget>[ | ||||
Text( | Text( | ||||
"2020新款春款波点连衣裙新短发dfasdfas短发时代发发呆发顺丰的打算萨阿啊", | |||||
widget.model?.title ?? "", | |||||
maxLines: 2, | maxLines: 2, | ||||
overflow: TextOverflow.ellipsis, | overflow: TextOverflow.ellipsis, | ||||
style: TextStyle(color: Colors.black, fontSize: 24.sp), | style: TextStyle(color: Colors.black, fontSize: 24.sp), | ||||
@@ -105,21 +136,30 @@ class _IntellectSearchGoodsDialogState | |||||
Container( | Container( | ||||
width: 30.w, | width: 30.w, | ||||
height: 30.w, | height: 30.w, | ||||
decoration: BoxDecoration(color: Colors.white), | |||||
decoration: BoxDecoration( | |||||
color: HexColor.fromHex(_styleModel | |||||
?.moduleList?.coupon?.bgColor ?? | |||||
"")), | |||||
child: Center( | child: Center( | ||||
child: Text( | child: Text( | ||||
"券", | |||||
_styleModel?.moduleList?.coupon?.content ?? | |||||
"", | |||||
style: TextStyle( | style: TextStyle( | ||||
color: Colors.red, fontSize: 20.sp), | |||||
color: HexColor.fromHex(_styleModel | |||||
?.moduleList?.coupon?.fontColor ?? | |||||
""), | |||||
fontSize: 20.sp), | |||||
), | ), | ||||
), | ), | ||||
), | ), | ||||
Padding( | Padding( | ||||
padding: const EdgeInsets.only(left: 4, right: 4), | padding: const EdgeInsets.only(left: 4, right: 4), | ||||
child: Text( | child: Text( | ||||
"¥100", | |||||
"¥" + (widget.model?.couponPrice ?? ""), | |||||
style: TextStyle( | style: TextStyle( | ||||
color: Colors.white, fontSize: 20.sp), | |||||
color: HexColor.fromHex(_styleModel | |||||
?.moduleList?.couponPrice?.fontColor), | |||||
fontSize: 20.sp), | |||||
), | ), | ||||
) | ) | ||||
], | ], | ||||
@@ -130,7 +170,8 @@ class _IntellectSearchGoodsDialogState | |||||
), | ), | ||||
Container( | Container( | ||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
color: HexColor.fromHex("#FFFFF6C1"), | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.commission?.bgColor), | |||||
borderRadius: BorderRadius.circular(2)), | borderRadius: BorderRadius.circular(2)), | ||||
padding: EdgeInsets.all(2), | padding: EdgeInsets.all(2), | ||||
child: Row( | child: Row( | ||||
@@ -144,9 +185,17 @@ class _IntellectSearchGoodsDialogState | |||||
padding: | padding: | ||||
const EdgeInsets.only(left: 4, right: 4), | const EdgeInsets.only(left: 4, right: 4), | ||||
child: Text( | child: Text( | ||||
"预计返", | |||||
(_styleModel?.moduleList?.commission | |||||
?.content ?? | |||||
"") + | |||||
" ¥" + | |||||
(widget.model?.commission ?? ""), | |||||
style: TextStyle( | style: TextStyle( | ||||
color: Colors.deepOrangeAccent, | |||||
color: HexColor.fromHex(_styleModel | |||||
?.moduleList | |||||
?.commission | |||||
?.fontColor ?? | |||||
""), | |||||
fontSize: 20.sp), | fontSize: 20.sp), | ||||
), | ), | ||||
), | ), | ||||
@@ -167,8 +216,12 @@ class _IntellectSearchGoodsDialogState | |||||
Padding( | Padding( | ||||
padding: const EdgeInsets.only(bottom: 2), | padding: const EdgeInsets.only(bottom: 2), | ||||
child: Text( | child: Text( | ||||
"券后", | |||||
style: TextStyle(fontSize: 20.sp, color: Colors.red), | |||||
_styleModel?.moduleList?.couponAfter?.content ?? "", | |||||
style: TextStyle( | |||||
fontSize: 20.sp, | |||||
color: HexColor.fromHex(_styleModel | |||||
?.moduleList?.couponAfterPrice?.fontColor ?? | |||||
"")), | |||||
), | ), | ||||
), | ), | ||||
Padding( | Padding( | ||||
@@ -176,14 +229,19 @@ class _IntellectSearchGoodsDialogState | |||||
const EdgeInsets.only(bottom: 2, left: 4, right: 4), | const EdgeInsets.only(bottom: 2, left: 4, right: 4), | ||||
child: Text( | child: Text( | ||||
"¥", | "¥", | ||||
style: TextStyle(fontSize: 20.sp, color: Colors.red), | |||||
style: TextStyle( | |||||
fontSize: 20.sp, | |||||
color: HexColor.fromHex(_styleModel | |||||
?.moduleList?.couponAfterPrice?.fontColor ?? | |||||
"")), | |||||
), | ), | ||||
), | ), | ||||
Text( | Text( | ||||
"999", | |||||
widget?.model?.price ?? "", | |||||
style: TextStyle( | style: TextStyle( | ||||
fontSize: 32.sp, | fontSize: 32.sp, | ||||
color: Colors.red, | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.couponAfterPrice?.fontColor), | |||||
), | ), | ||||
) | ) | ||||
], | ], | ||||
@@ -201,46 +259,108 @@ class _IntellectSearchGoodsDialogState | |||||
SizedBox( | SizedBox( | ||||
height: 24, | height: 24, | ||||
), | ), | ||||
Row( | |||||
children: <Widget>[ | |||||
Expanded( | |||||
child: Container( | |||||
margin: EdgeInsets.only(left: 20.w, right: 20.w), | |||||
decoration: BoxDecoration( | |||||
color: Colors.red, borderRadius: BorderRadius.circular(50)), | |||||
child: Center( | |||||
child: Padding( | |||||
padding: const EdgeInsets.all(12.0), | |||||
child: Text( | |||||
"合法化 ", | |||||
style: TextStyle(color: Colors.white, fontSize: 24.sp), | |||||
), | |||||
)), | |||||
)) | |||||
], | |||||
InkWell( | |||||
child: Row( | |||||
children: <Widget>[ | |||||
Expanded( | |||||
child: Container( | |||||
margin: EdgeInsets.only(left: 20.w, right: 20.w), | |||||
decoration: BoxDecoration( | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.saveBtn?.bgColor ?? ""), | |||||
borderRadius: BorderRadius.circular(50)), | |||||
child: Center( | |||||
child: Padding( | |||||
padding: const EdgeInsets.all(12.0), | |||||
child: Text( | |||||
(_styleModel?.moduleList?.saveBtn?.content ?? "") + | |||||
" ¥" + | |||||
(double.tryParse(widget?.model?.couponPrice ?? '0') + | |||||
double.tryParse( | |||||
widget?.model?.commission ?? '0')) | |||||
.toString() | |||||
.toString(), | |||||
style: TextStyle( | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.saveBtn?.fontColor), | |||||
fontSize: 24.sp), | |||||
), | |||||
)), | |||||
)) | |||||
], | |||||
), | |||||
onTap: () { | |||||
openUrl(); | |||||
}, | |||||
), | ), | ||||
SizedBox( | SizedBox( | ||||
height: 16, | height: 16, | ||||
), | ), | ||||
Row( | |||||
children: <Widget>[ | |||||
Expanded( | |||||
child: Container( | |||||
margin: EdgeInsets.only(left: 20.w, right: 20.w), | |||||
decoration: BoxDecoration( | |||||
color: Colors.red, borderRadius: BorderRadius.circular(50)), | |||||
child: Center( | |||||
child: Padding( | |||||
padding: const EdgeInsets.all(12.0), | |||||
child: Text( | |||||
"合法化 ", | |||||
style: TextStyle(color: Colors.white, fontSize: 24.sp), | |||||
), | |||||
)), | |||||
)) | |||||
], | |||||
InkWell( | |||||
child: Row( | |||||
children: <Widget>[ | |||||
Expanded( | |||||
child: Container( | |||||
margin: EdgeInsets.only(left: 20.w, right: 20.w), | |||||
decoration: BoxDecoration( | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.viewGoodsBtn?.bgColor ?? ""), | |||||
borderRadius: BorderRadius.circular(50)), | |||||
child: Center( | |||||
child: Padding( | |||||
padding: const EdgeInsets.all(12.0), | |||||
child: Text( | |||||
_styleModel?.moduleList?.viewGoodsBtn?.content ?? "", | |||||
style: TextStyle( | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.viewGoodsBtn?.fontColor ?? | |||||
""), | |||||
fontSize: 24.sp), | |||||
), | |||||
)), | |||||
)) | |||||
], | |||||
), | |||||
onTap: () { | |||||
openGoodsDetails(); | |||||
}, | |||||
) | ) | ||||
], | ], | ||||
); | ); | ||||
} | } | ||||
void requestStyle() { | |||||
NetUtil.request("/api/v1/cfg/clipboard_identified", onSuccess: (data) { | |||||
_styleModel = HasGoodsDialogStyleModel.fromJson( | |||||
json.decode(data['clipboard_identified'])); | |||||
setState(() {}); | |||||
}); | |||||
} | |||||
void openUrl() async { | |||||
///跳转购买 | |||||
if (_userInfo?.token == null || _userInfo.token == '') { | |||||
print('need login...'); | |||||
RouterUtil.goLogin(context); | |||||
return; | |||||
} else { | |||||
if (widget?.model?.provider == 'taobao') { | |||||
TradeResult result = | |||||
await FlutterAlibc.openByUrl(url: widget?.model?.couponUrl); | |||||
Logger.debug('${result.errorCode} ${result.errorMessage} '); | |||||
} else { | |||||
RouterUtil.openWebview(widget?.model?.couponUrl, context); | |||||
} | |||||
} | |||||
} | |||||
///打开详情 | |||||
void openGoodsDetails() { | |||||
String provider = widget.model.provider; | |||||
String goodId = widget.model.itemId; | |||||
RouterUtil.route(SkipModel(skipIdentifier: "goods_details"), | |||||
{"provider": provider, "good_id": goodId}, context).then((data){ | |||||
Navigator.pop(context); | |||||
}); | |||||
} | |||||
} | } |
@@ -1,11 +1,19 @@ | |||||
import 'dart:convert'; | |||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
import 'package:flutter/services.dart'; | import 'package:flutter/services.dart'; | ||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; | import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/intellect_dialog_data_model.dart'; | |||||
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/no_goods_dialog_style_model.dart'; | |||||
import 'package:zhiying_base_widget/widgets/home/home_quick_entry/cached_network_image_util.dart'; | import 'package:zhiying_base_widget/widgets/home/home_quick_entry/cached_network_image_util.dart'; | ||||
import 'package:cached_network_image/cached_network_image.dart'; | import 'package:cached_network_image/cached_network_image.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
class IntellectSearchNoGoodsDialog extends StatefulWidget { | class IntellectSearchNoGoodsDialog extends StatefulWidget { | ||||
final IntellectDialogDataModel model; | |||||
const IntellectSearchNoGoodsDialog({Key key, this.model}) : super(key: key); | |||||
@override | @override | ||||
_IntellectSearchNoGoodsDialogState createState() => | _IntellectSearchNoGoodsDialogState createState() => | ||||
_IntellectSearchNoGoodsDialogState(); | _IntellectSearchNoGoodsDialogState(); | ||||
@@ -15,10 +23,13 @@ class _IntellectSearchNoGoodsDialogState | |||||
extends State<IntellectSearchNoGoodsDialog> { | extends State<IntellectSearchNoGoodsDialog> { | ||||
TextEditingController _textEditingController; | TextEditingController _textEditingController; | ||||
NoGoodsDialogStyleModel _styleModel; | |||||
@override | @override | ||||
void initState() { | void initState() { | ||||
_textEditingController = TextEditingController(); | _textEditingController = TextEditingController(); | ||||
_getClipBoardData(); | _getClipBoardData(); | ||||
super.initState(); | super.initState(); | ||||
} | } | ||||
@@ -26,47 +37,62 @@ class _IntellectSearchNoGoodsDialogState | |||||
_getClipBoardData() async { | _getClipBoardData() async { | ||||
ClipboardData data = await Clipboard.getData(Clipboard.kTextPlain); | ClipboardData data = await Clipboard.getData(Clipboard.kTextPlain); | ||||
_textEditingController.text = data.text; | _textEditingController.text = data.text; | ||||
requestStyle(); | |||||
setState(() {}); | setState(() {}); | ||||
} | } | ||||
void requestStyle() { | |||||
NetUtil.request("/api/v1/cfg/clipboard_unidentified", onSuccess: (data) { | |||||
_styleModel = NoGoodsDialogStyleModel.fromJson( | |||||
json.decode(data['clipboard_unidentified'])); | |||||
setState(() {}); | |||||
}); | |||||
} | |||||
@override | @override | ||||
Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
return Scaffold( | return Scaffold( | ||||
backgroundColor: Colors.transparent, | |||||
body: Column( | |||||
mainAxisAlignment: MainAxisAlignment.center, | |||||
children: <Widget>[ | |||||
Stack( | |||||
backgroundColor: Colors.transparent, | |||||
body: InkWell( | |||||
onTap: () { | |||||
Navigator.of(context).pop(); | |||||
}, | |||||
child: Column( | |||||
mainAxisAlignment: MainAxisAlignment.center, | |||||
children: <Widget>[ | children: <Widget>[ | ||||
Container( | |||||
margin: EdgeInsets.only(top: 38.h, left: 92.w, right: 92.w), | |||||
padding: EdgeInsets.only( | |||||
top: (38 + 15).h, left: 30.w, right: 30.w, bottom: 48.h), | |||||
decoration: BoxDecoration( | |||||
color: Colors.white, | |||||
borderRadius: BorderRadius.circular(16)), | |||||
width: double.infinity, | |||||
child: Column( | |||||
children: <Widget>[_buildTopItem(), _buildBottomItem()], | |||||
), | |||||
), | |||||
Container( | |||||
height: 76.h, | |||||
child: Center( | |||||
child: Container( | |||||
color: Colors.red, | |||||
height: 76.h, | |||||
width: 216.w, | |||||
child: CachedNetworkImage( | |||||
imageUrl: "", | |||||
Stack( | |||||
children: <Widget>[ | |||||
Container( | |||||
margin: EdgeInsets.only(top: 38.h, left: 92.w, right: 92.w), | |||||
padding: EdgeInsets.only( | |||||
top: (38 + 15).h, | |||||
left: 30.w, | |||||
right: 30.w, | |||||
bottom: 48.h), | |||||
decoration: BoxDecoration( | |||||
color: HexColor.fromHex(_styleModel?.bgColor ?? ""), | |||||
borderRadius: BorderRadius.circular(16)), | |||||
width: double.infinity, | |||||
child: Column( | |||||
children: <Widget>[_buildTopItem(), _buildBottomItem()], | |||||
), | |||||
), | ), | ||||
)), | |||||
), | |||||
Container( | |||||
height: 76.h, | |||||
child: Center( | |||||
child: Container( | |||||
height: 76.h, | |||||
width: 216.w, | |||||
child: CachedNetworkImage( | |||||
imageUrl: _styleModel?.titleImg ?? "", | |||||
), | |||||
)), | |||||
), | |||||
], | |||||
) | |||||
], | ], | ||||
) | |||||
], | |||||
), | |||||
); | |||||
), | |||||
)); | |||||
} | } | ||||
_buildTopItem() { | _buildTopItem() { | ||||
@@ -75,22 +101,30 @@ class _IntellectSearchNoGoodsDialogState | |||||
child: Column( | child: Column( | ||||
children: <Widget>[ | children: <Widget>[ | ||||
Text( | Text( | ||||
"猜你要搜索以下商品", | |||||
style: TextStyle(color: Colors.red, fontSize: 30.sp), | |||||
_styleModel?.moduleList?.title?.content ?? "", | |||||
style: TextStyle( | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.title?.textColor ?? ""), | |||||
fontSize: 30.sp), | |||||
), | ), | ||||
Container( | Container( | ||||
margin: EdgeInsets.only(top: 12), | margin: EdgeInsets.only(top: 12), | ||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
color: Colors.deepOrangeAccent, | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.content?.bgColor ?? ""), | |||||
borderRadius: BorderRadius.circular(10)), | borderRadius: BorderRadius.circular(10)), | ||||
child: TextField( | child: TextField( | ||||
controller: _textEditingController, | controller: _textEditingController, | ||||
textAlign: TextAlign.start, | textAlign: TextAlign.start, | ||||
style: TextStyle( | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.content?.textColor ?? ''), | |||||
fontSize: 22.sp), | |||||
decoration: InputDecoration( | decoration: InputDecoration( | ||||
contentPadding: EdgeInsets.only(left: 10, top: 10, bottom: 4), | contentPadding: EdgeInsets.only(left: 10, top: 10, bottom: 4), | ||||
border: InputBorder.none, | border: InputBorder.none, | ||||
), | ), | ||||
maxLines: 5, | |||||
maxLines: 8, | |||||
), | ), | ||||
) | ) | ||||
], | ], | ||||
@@ -109,13 +143,18 @@ class _IntellectSearchNoGoodsDialogState | |||||
Expanded( | Expanded( | ||||
child: Container( | child: Container( | ||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
color: Colors.red, borderRadius: BorderRadius.circular(50)), | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.btn?.bgColor ?? ""), | |||||
borderRadius: BorderRadius.circular(50)), | |||||
child: Center( | child: Center( | ||||
child: Padding( | child: Padding( | ||||
padding: const EdgeInsets.all(12.0), | padding: const EdgeInsets.all(12.0), | ||||
child: Text( | child: Text( | ||||
"立即搜索 ", | |||||
style: TextStyle(color: Colors.white, fontSize: 24.sp), | |||||
_styleModel?.moduleList?.btn?.content ?? "", | |||||
style: TextStyle( | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.btn?.textColor), | |||||
fontSize: 24.sp), | |||||
), | ), | ||||
)), | )), | ||||
)) | )) | ||||
@@ -130,13 +169,20 @@ class _IntellectSearchNoGoodsDialogState | |||||
Container( | Container( | ||||
height: 1, | height: 1, | ||||
width: 137.w, | width: 137.w, | ||||
color: Colors.deepOrange, | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.segment?.textColor ?? ""), | |||||
), | |||||
Text( | |||||
_styleModel?.moduleList?.segment?.content ?? "", | |||||
style: TextStyle( | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.segment?.textColor ?? "")), | |||||
), | ), | ||||
Text("搜索平台"), | |||||
Container( | Container( | ||||
height: 1, | height: 1, | ||||
width: 137.w, | width: 137.w, | ||||
color: Colors.deepOrange, | |||||
color: HexColor.fromHex( | |||||
_styleModel?.moduleList?.segment?.textColor ?? ""), | |||||
), | ), | ||||
], | ], | ||||
), | ), | ||||
@@ -148,7 +194,7 @@ class _IntellectSearchNoGoodsDialogState | |||||
child: ListView.builder( | child: ListView.builder( | ||||
scrollDirection: Axis.horizontal, | scrollDirection: Axis.horizontal, | ||||
shrinkWrap: true, | shrinkWrap: true, | ||||
itemCount: 10, | |||||
itemCount: _styleModel?.iconList?.length ?? 0, | |||||
itemBuilder: _buildBottomListItem), | itemBuilder: _buildBottomListItem), | ||||
) | ) | ||||
], | ], | ||||
@@ -156,28 +202,34 @@ class _IntellectSearchNoGoodsDialogState | |||||
} | } | ||||
Widget _buildBottomListItem(BuildContext context, int index) { | Widget _buildBottomListItem(BuildContext context, int index) { | ||||
var item = _styleModel.iconList[index]; | |||||
return Container( | return Container( | ||||
margin: EdgeInsets.only(left: 11,right: 11), | |||||
child: Column( | |||||
children: <Widget>[ | |||||
Container( | |||||
color: Colors.deepOrange, | |||||
child: Image.network( | |||||
"", | |||||
width: 60.w, | |||||
height: 60.w, | |||||
fit: BoxFit.fill, | |||||
), | |||||
), | |||||
SizedBox( | |||||
height: 2, | |||||
margin: EdgeInsets.only(left: 11, right: 11), | |||||
child: InkWell( | |||||
child: Column( | |||||
children: <Widget>[ | |||||
Container( | |||||
color: Colors.deepOrange, | |||||
child: Image.network( | |||||
"", | |||||
width: 60.w, | |||||
height: 60.w, | |||||
fit: BoxFit.fill, | |||||
), | |||||
), | |||||
SizedBox( | |||||
height: 2, | |||||
), | |||||
Text( | |||||
item.title ?? "", | |||||
style: TextStyle( | |||||
fontSize: 22.sp, | |||||
color: HexColor.fromHex(item.textColor ?? "")), | |||||
) | |||||
], | |||||
), | ), | ||||
Text( | |||||
"淘宝", | |||||
style: TextStyle(fontSize: 22.sp), | |||||
) | |||||
], | |||||
), | |||||
); | |||||
onTap: () {}, | |||||
)); | |||||
} | } | ||||
} | } |
@@ -1,50 +1,78 @@ | |||||
///智能粘贴板设置参数 | ///智能粘贴板设置参数 | ||||
///杨华轩 | ///杨华轩 | ||||
class IntellectSearchSetModel { | class IntellectSearchSetModel { | ||||
List<String> exclude; | |||||
String keywordAlpha; | |||||
String keywordAlphanum; | |||||
String keywordLimitMax; | |||||
String keywordLimitMin; | |||||
String keywordLimitState; | |||||
String keywordNum; | |||||
List<String> pvd; | |||||
String state; | |||||
String isListen; | |||||
String isShiftUrl; | |||||
List<String> platform; | |||||
String isKeyLength; | |||||
String keyLengthMin; | |||||
String keyLengthMax; | |||||
String isNumber; | |||||
String numberMin; | |||||
String numberMax; | |||||
String isLetter; | |||||
String letterMin; | |||||
String letterMax; | |||||
String isNumAndLet; | |||||
String numAndLetMin; | |||||
String numAndLetMax; | |||||
List<String> banWords; | |||||
IntellectSearchSetModel( | IntellectSearchSetModel( | ||||
{this.exclude, | |||||
this.keywordAlpha, | |||||
this.keywordAlphanum, | |||||
this.keywordLimitMax, | |||||
this.keywordLimitMin, | |||||
this.keywordLimitState, | |||||
this.keywordNum, | |||||
this.pvd, | |||||
this.state}); | |||||
{this.isListen, | |||||
this.isShiftUrl, | |||||
this.platform, | |||||
this.isKeyLength, | |||||
this.keyLengthMin, | |||||
this.keyLengthMax, | |||||
this.isNumber, | |||||
this.numberMin, | |||||
this.numberMax, | |||||
this.isLetter, | |||||
this.letterMin, | |||||
this.letterMax, | |||||
this.isNumAndLet, | |||||
this.numAndLetMin, | |||||
this.numAndLetMax, | |||||
this.banWords}); | |||||
IntellectSearchSetModel.fromJson(Map<String, dynamic> json) { | IntellectSearchSetModel.fromJson(Map<String, dynamic> json) { | ||||
exclude = json['exclude'].cast<String>(); | |||||
keywordAlpha = json['keyword_alpha'].toString(); | |||||
keywordAlphanum = json['keyword_alphanum'].toString(); | |||||
keywordLimitMax = json['keyword_limit_max'].toString(); | |||||
keywordLimitMin = json['keyword_limit_min'].toString(); | |||||
keywordLimitState = json['keyword_limit_state'].toString(); | |||||
keywordNum = json['keyword_num'].toString(); | |||||
pvd = json['pvd'].cast<String>(); | |||||
state = json['state'].toString(); | |||||
isListen = json['isListen']; | |||||
isShiftUrl = json['isShiftUrl']; | |||||
platform = json['platform'].cast<String>(); | |||||
isKeyLength = json['isKeyLength']; | |||||
keyLengthMin = json['keyLengthMin']; | |||||
keyLengthMax = json['keyLengthMax']; | |||||
isNumber = json['isNumber']; | |||||
numberMin = json['numberMin']; | |||||
numberMax = json['numberMax']; | |||||
isLetter = json['isLetter']; | |||||
letterMin = json['letterMin']; | |||||
letterMax = json['letterMax']; | |||||
isNumAndLet = json['isNumAndLet']; | |||||
numAndLetMin = json['numAndLetMin']; | |||||
numAndLetMax = json['numAndLetMax']; | |||||
banWords = json['banWords'].cast<String>(); | |||||
} | } | ||||
Map<String, dynamic> toJson() { | Map<String, dynamic> toJson() { | ||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | final Map<String, dynamic> data = new Map<String, dynamic>(); | ||||
data['exclude'] = this.exclude; | |||||
data['keyword_alpha'] = this.keywordAlpha; | |||||
data['keyword_alphanum'] = this.keywordAlphanum; | |||||
data['keyword_limit_max'] = this.keywordLimitMax; | |||||
data['keyword_limit_min'] = this.keywordLimitMin; | |||||
data['keyword_limit_state'] = this.keywordLimitState; | |||||
data['keyword_num'] = this.keywordNum; | |||||
data['pvd'] = this.pvd; | |||||
data['state'] = this.state; | |||||
data['isListen'] = this.isListen; | |||||
data['isShiftUrl'] = this.isShiftUrl; | |||||
data['platform'] = this.platform; | |||||
data['isKeyLength'] = this.isKeyLength; | |||||
data['keyLengthMin'] = this.keyLengthMin; | |||||
data['keyLengthMax'] = this.keyLengthMax; | |||||
data['isNumber'] = this.isNumber; | |||||
data['numberMin'] = this.numberMin; | |||||
data['numberMax'] = this.numberMax; | |||||
data['isLetter'] = this.isLetter; | |||||
data['letterMin'] = this.letterMin; | |||||
data['letterMax'] = this.letterMax; | |||||
data['isNumAndLet'] = this.isNumAndLet; | |||||
data['numAndLetMin'] = this.numAndLetMin; | |||||
data['numAndLetMax'] = this.numAndLetMax; | |||||
data['banWords'] = this.banWords; | |||||
return data; | return data; | ||||
} | } | ||||
} | } |
@@ -0,0 +1,167 @@ | |||||
///有商品弹窗model | |||||
class HasGoodsDialogStyleModel { | |||||
String titleImg; | |||||
String bgColor; | |||||
ModuleList moduleList; | |||||
HasGoodsDialogStyleModel({this.titleImg, this.bgColor, this.moduleList}); | |||||
HasGoodsDialogStyleModel.fromJson(Map<String, dynamic> json) { | |||||
titleImg = json['title_img']; | |||||
bgColor = json['bg_color']; | |||||
moduleList = json['module_list'] != null | |||||
? new ModuleList.fromJson(json['module_list']) | |||||
: null; | |||||
} | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
data['title_img'] = this.titleImg; | |||||
data['bg_color'] = this.bgColor; | |||||
if (this.moduleList != null) { | |||||
data['module_list'] = this.moduleList.toJson(); | |||||
} | |||||
return data; | |||||
} | |||||
} | |||||
class ModuleList { | |||||
Coupon coupon; | |||||
Coupon commission; | |||||
Coupon shopTitle; | |||||
Coupon couponPrice; | |||||
Coupon couponAfter; | |||||
Coupon couponAfterPrice; | |||||
SaveBtn saveBtn; | |||||
SaveBtn viewGoodsBtn; | |||||
ModuleList( | |||||
{this.coupon, | |||||
this.commission, | |||||
this.shopTitle, | |||||
this.couponPrice, | |||||
this.couponAfter, | |||||
this.couponAfterPrice, | |||||
this.saveBtn, | |||||
this.viewGoodsBtn}); | |||||
ModuleList.fromJson(Map<String, dynamic> json) { | |||||
coupon = | |||||
json['coupon'] != null ? new Coupon.fromJson(json['coupon']) : null; | |||||
commission = json['commission'] != null | |||||
? new Coupon.fromJson(json['commission']) | |||||
: null; | |||||
shopTitle = json['shop_title'] != null | |||||
? new Coupon.fromJson(json['shop_title']) | |||||
: null; | |||||
couponPrice = json['coupon_price'] != null | |||||
? new Coupon.fromJson(json['coupon_price']) | |||||
: null; | |||||
couponAfter = json['coupon_after'] != null | |||||
? new Coupon.fromJson(json['coupon_after']) | |||||
: null; | |||||
couponAfterPrice = json['coupon_after_price'] != null | |||||
? new Coupon.fromJson(json['coupon_after_price']) | |||||
: null; | |||||
saveBtn = json['save_btn'] != null | |||||
? new SaveBtn.fromJson(json['save_btn']) | |||||
: null; | |||||
viewGoodsBtn = json['view_goods_btn'] != null | |||||
? new SaveBtn.fromJson(json['view_goods_btn']) | |||||
: null; | |||||
} | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
if (this.coupon != null) { | |||||
data['coupon'] = this.coupon.toJson(); | |||||
} | |||||
if (this.commission != null) { | |||||
data['commission'] = this.commission.toJson(); | |||||
} | |||||
if (this.shopTitle != null) { | |||||
data['shop_title'] = this.shopTitle.toJson(); | |||||
} | |||||
if (this.couponPrice != null) { | |||||
data['coupon_price'] = this.couponPrice.toJson(); | |||||
} | |||||
if (this.couponAfter != null) { | |||||
data['coupon_after'] = this.couponAfter.toJson(); | |||||
} | |||||
if (this.couponAfterPrice != null) { | |||||
data['coupon_after_price'] = this.couponAfterPrice.toJson(); | |||||
} | |||||
if (this.saveBtn != null) { | |||||
data['save_btn'] = this.saveBtn.toJson(); | |||||
} | |||||
if (this.viewGoodsBtn != null) { | |||||
data['view_goods_btn'] = this.viewGoodsBtn.toJson(); | |||||
} | |||||
return data; | |||||
} | |||||
} | |||||
class Coupon { | |||||
String name; | |||||
String content; | |||||
String bgColor; | |||||
String bgImg; | |||||
String fontColor; | |||||
Coupon({this.name, this.content, this.bgColor, this.bgImg, this.fontColor}); | |||||
Coupon.fromJson(Map<String, dynamic> json) { | |||||
name = json['name']; | |||||
content = json['content']; | |||||
bgColor = json['bg_color']; | |||||
bgImg = json['bg_img']; | |||||
fontColor = json['font_color']; | |||||
} | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
data['name'] = this.name; | |||||
data['content'] = this.content; | |||||
data['bg_color'] = this.bgColor; | |||||
data['bg_img'] = this.bgImg; | |||||
data['font_color'] = this.fontColor; | |||||
return data; | |||||
} | |||||
} | |||||
class SaveBtn { | |||||
String name; | |||||
String content; | |||||
String type; | |||||
String bgColor; | |||||
String bgImg; | |||||
String fontColor; | |||||
SaveBtn( | |||||
{this.name, | |||||
this.content, | |||||
this.type, | |||||
this.bgColor, | |||||
this.bgImg, | |||||
this.fontColor}); | |||||
SaveBtn.fromJson(Map<String, dynamic> json) { | |||||
name = json['name']; | |||||
content = json['content']; | |||||
type = json['type']; | |||||
bgColor = json['bg_color']; | |||||
bgImg = json['bg_img']; | |||||
fontColor = json['font_color']; | |||||
} | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
data['name'] = this.name; | |||||
data['content'] = this.content; | |||||
data['type'] = this.type; | |||||
data['bg_color'] = this.bgColor; | |||||
data['bg_img'] = this.bgImg; | |||||
data['font_color'] = this.fontColor; | |||||
return data; | |||||
} | |||||
} |
@@ -0,0 +1,52 @@ | |||||
class IntellectDialogDataModel { | |||||
String itemId; | |||||
String title; | |||||
String price; | |||||
String priceOriginal; | |||||
String commission; | |||||
String commissionRate; | |||||
String thumbnail; | |||||
String provider; | |||||
String couponUrl; | |||||
String couponPrice; | |||||
IntellectDialogDataModel( | |||||
{this.itemId, | |||||
this.title, | |||||
this.price, | |||||
this.priceOriginal, | |||||
this.commission, | |||||
this.commissionRate, | |||||
this.thumbnail, | |||||
this.provider, | |||||
this.couponUrl, | |||||
this.couponPrice}); | |||||
IntellectDialogDataModel.fromJson(Map<String, dynamic> json) { | |||||
itemId = json['item_id'].toString(); | |||||
title = json['title'].toString(); | |||||
price = json['price'].toString(); | |||||
priceOriginal = json['price_original'].toString(); | |||||
commission = json['commission'].toString(); | |||||
commissionRate = json['commission_rate'].toString(); | |||||
thumbnail = json['thumbnail'].toString(); | |||||
provider = json['provider'].toString(); | |||||
couponUrl = json['coupon_url'].toString(); | |||||
couponPrice = json['coupon_price'].toString(); | |||||
} | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
data['item_id'] = this.itemId; | |||||
data['title'] = this.title; | |||||
data['price'] = this.price; | |||||
data['price_original'] = this.priceOriginal; | |||||
data['commission'] = this.commission; | |||||
data['commission_rate'] = this.commissionRate; | |||||
data['thumbnail'] = this.thumbnail; | |||||
data['provider'] = this.provider; | |||||
data['coupon_url'] = this.couponUrl; | |||||
data['coupon_price'] = this.couponPrice; | |||||
return data; | |||||
} | |||||
} |
@@ -0,0 +1,174 @@ | |||||
class NoGoodsDialogStyleModel { | |||||
String titleImg; | |||||
String bgColor; | |||||
List<IconList> iconList; | |||||
ModuleList moduleList; | |||||
NoGoodsDialogStyleModel( | |||||
{this.titleImg, this.bgColor, this.iconList, this.moduleList}); | |||||
NoGoodsDialogStyleModel.fromJson(Map<String, dynamic> json) { | |||||
titleImg = json['title_img']; | |||||
bgColor = json['bg_color']; | |||||
if (json['icon_list'] != null) { | |||||
iconList = new List<IconList>(); | |||||
json['icon_list'].forEach((v) { | |||||
iconList.add(new IconList.fromJson(v)); | |||||
}); | |||||
} | |||||
moduleList = json['module_list'] != null | |||||
? new ModuleList.fromJson(json['module_list']) | |||||
: null; | |||||
} | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
data['title_img'] = this.titleImg; | |||||
data['bg_color'] = this.bgColor; | |||||
if (this.iconList != null) { | |||||
data['icon_list'] = this.iconList.map((v) => v.toJson()).toList(); | |||||
} | |||||
if (this.moduleList != null) { | |||||
data['module_list'] = this.moduleList.toJson(); | |||||
} | |||||
return data; | |||||
} | |||||
} | |||||
class IconList { | |||||
String image; | |||||
String title; | |||||
String textColor; | |||||
IconList({this.image, this.title, this.textColor}); | |||||
IconList.fromJson(Map<String, dynamic> json) { | |||||
image = json['image']; | |||||
title = json['title']; | |||||
textColor = json['text_color']; | |||||
} | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
data['image'] = this.image; | |||||
data['title'] = this.title; | |||||
data['text_color'] = this.textColor; | |||||
return data; | |||||
} | |||||
} | |||||
class ModuleList { | |||||
Title title; | |||||
Title segment; | |||||
Content content; | |||||
Btn btn; | |||||
ModuleList({this.title, this.segment, this.content, this.btn}); | |||||
ModuleList.fromJson(Map<String, dynamic> json) { | |||||
title = json['title'] != null ? new Title.fromJson(json['title']) : null; | |||||
segment = | |||||
json['segment'] != null ? new Title.fromJson(json['segment']) : null; | |||||
content = | |||||
json['content'] != null ? new Content.fromJson(json['content']) : null; | |||||
btn = json['btn'] != null ? new Btn.fromJson(json['btn']) : null; | |||||
} | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
if (this.title != null) { | |||||
data['title'] = this.title.toJson(); | |||||
} | |||||
if (this.segment != null) { | |||||
data['segment'] = this.segment.toJson(); | |||||
} | |||||
if (this.content != null) { | |||||
data['content'] = this.content.toJson(); | |||||
} | |||||
if (this.btn != null) { | |||||
data['btn'] = this.btn.toJson(); | |||||
} | |||||
return data; | |||||
} | |||||
} | |||||
class Title { | |||||
String name; | |||||
String content; | |||||
String textColor; | |||||
Title({this.name, this.content, this.textColor}); | |||||
Title.fromJson(Map<String, dynamic> json) { | |||||
name = json['name']; | |||||
content = json['content']; | |||||
textColor = json['text_color']; | |||||
} | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
data['name'] = this.name; | |||||
data['content'] = this.content; | |||||
data['text_color'] = this.textColor; | |||||
return data; | |||||
} | |||||
} | |||||
class Content { | |||||
String name; | |||||
String textColor; | |||||
String bgColor; | |||||
Content({this.name, this.textColor, this.bgColor}); | |||||
Content.fromJson(Map<String, dynamic> json) { | |||||
name = json['name']; | |||||
textColor = json['text_color']; | |||||
bgColor = json['bg_color']; | |||||
} | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
data['name'] = this.name; | |||||
data['text_color'] = this.textColor; | |||||
data['bg_color'] = this.bgColor; | |||||
return data; | |||||
} | |||||
} | |||||
class Btn { | |||||
String name; | |||||
String content; | |||||
String type; | |||||
String textColor; | |||||
String bgColor; | |||||
String bgImage; | |||||
Btn( | |||||
{this.name, | |||||
this.content, | |||||
this.type, | |||||
this.textColor, | |||||
this.bgColor, | |||||
this.bgImage}); | |||||
Btn.fromJson(Map<String, dynamic> json) { | |||||
name = json['name']; | |||||
content = json['content']; | |||||
type = json['type']; | |||||
textColor = json['text_color']; | |||||
bgColor = json['bg_color']; | |||||
bgImage = json['bg_image']; | |||||
} | |||||
Map<String, dynamic> toJson() { | |||||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||||
data['name'] = this.name; | |||||
data['content'] = this.content; | |||||
data['type'] = this.type; | |||||
data['text_color'] = this.textColor; | |||||
data['bg_color'] = this.bgColor; | |||||
data['bg_image'] = this.bgImage; | |||||
return data; | |||||
} | |||||
} |
@@ -13,6 +13,8 @@ import 'package:zhiying_base_widget/widgets/others/mine_header_bg_widget.dart'; | |||||
import 'package:zhiying_comm/zhiying_comm.dart'; | import 'package:zhiying_comm/zhiying_comm.dart'; | ||||
import 'package:zhiying_comm/util/base_bloc.dart'; | import 'package:zhiying_comm/util/base_bloc.dart'; | ||||
import 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart'; | import 'package:zhiying_comm/util/custom_sliver_persistent_header_delegate.dart'; | ||||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||||
import 'package:flutter_alibc/flutter_alibc.dart'; | |||||
class BilDetailPage extends StatefulWidget { | class BilDetailPage extends StatefulWidget { | ||||
final Map<String, dynamic> data; | final Map<String, dynamic> data; | ||||
@@ -59,12 +61,13 @@ class _BilDetailPageContainerState extends State<BilDetailPageContainer> { | |||||
@override | @override | ||||
void initState() { | void initState() { | ||||
_bloc = BlocProvider.of<BilDetailPageBloc>(context); | _bloc = BlocProvider.of<BilDetailPageBloc>(context); | ||||
// showDate=DateFormat(DateFormat.YEAR_MONTH).parse(DateTime.now()); | |||||
showDate = DateFormat('yyyy-MM').format(DateTime.now()); | |||||
super.initState(); | super.initState(); | ||||
} | } | ||||
@override | @override | ||||
Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
return StreamBuilder( | return StreamBuilder( | ||||
builder: (context, sny) { | builder: (context, sny) { | ||||
return Scaffold( | return Scaffold( | ||||
@@ -75,9 +78,7 @@ class _BilDetailPageContainerState extends State<BilDetailPageContainer> { | |||||
body: Container( | body: Container( | ||||
child: ListView( | child: ListView( | ||||
shrinkWrap: true, | shrinkWrap: true, | ||||
children: <Widget>[ | |||||
_buildType(), | |||||
], | |||||
children: <Widget>[_buildType(), _buildBottomItem()], | |||||
), | ), | ||||
), | ), | ||||
); | ); | ||||
@@ -90,13 +91,13 @@ class _BilDetailPageContainerState extends State<BilDetailPageContainer> { | |||||
children: <Widget>[ | children: <Widget>[ | ||||
SizedBox(width: 12.5), | SizedBox(width: 12.5), | ||||
InkWell( | InkWell( | ||||
onTap: (){ | |||||
onTap: () { | |||||
///显示日期选择弹窗 | ///显示日期选择弹窗 | ||||
_selectDate(); | _selectDate(); | ||||
}, | }, | ||||
child: Padding( | child: Padding( | ||||
padding: const EdgeInsets.only(top: 8,bottom: 8), | |||||
child: Text("2020-08"), | |||||
padding: const EdgeInsets.only(top: 8, bottom: 8), | |||||
child: Text(showDate ?? ""), | |||||
), | ), | ||||
), | ), | ||||
Icon(Icons.arrow_drop_down), | Icon(Icons.arrow_drop_down), | ||||
@@ -108,9 +109,9 @@ class _BilDetailPageContainerState extends State<BilDetailPageContainer> { | |||||
shrinkWrap: true, | shrinkWrap: true, | ||||
itemCount: 3, | itemCount: 3, | ||||
itemBuilder: (context, index) { | itemBuilder: (context, index) { | ||||
return Container( | |||||
return InkWell(child: Container( | |||||
margin: | margin: | ||||
EdgeInsets.only(top: 10, left: 8, right: 8, bottom: 10), | |||||
EdgeInsets.only(top: 10, left: 8, right: 8, bottom: 10), | |||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
color: Colors.grey[200], | color: Colors.grey[200], | ||||
borderRadius: BorderRadius.circular(50)), | borderRadius: BorderRadius.circular(50)), | ||||
@@ -118,18 +119,148 @@ class _BilDetailPageContainerState extends State<BilDetailPageContainer> { | |||||
padding: const EdgeInsets.only(left: 16, right: 16), | padding: const EdgeInsets.only(left: 16, right: 16), | ||||
child: Center( | child: Center( | ||||
child: Text( | child: Text( | ||||
"推广", | |||||
style: TextStyle(color: Colors.grey), | |||||
)), | |||||
"推广", | |||||
style: TextStyle(color: Colors.grey), | |||||
)), | |||||
), | ), | ||||
); | |||||
),onTap: () async { | |||||
print("ok"); | |||||
await FlutterAlibc.loginTaoBao(); | |||||
},); | |||||
}), | }), | ||||
)) | )) | ||||
], | ], | ||||
); | ); | ||||
} | } | ||||
void _selectDate() { | |||||
showDialog(context: context, builder: (context)=>SelectDateYMDialog()); | |||||
void _selectDate() async { | |||||
showDialog(context: context, builder: (context) => SelectDateYMDialog()); | |||||
} | |||||
_buildBottomItem() { | |||||
return ListView.builder( | |||||
shrinkWrap: true, itemCount: 10, itemBuilder: _buildItem); | |||||
} | |||||
Widget _buildItem(BuildContext context, int index) { | |||||
return Container( | |||||
margin: EdgeInsets.only(left: 12.5, right: 12.5, bottom: 4, top: 4), | |||||
padding: | |||||
EdgeInsets.only(left: 25.w, right: 25.w, top: 20.h, bottom: 20.h), | |||||
child: Column( | |||||
children: <Widget>[ | |||||
Row( | |||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |||||
children: <Widget>[ | |||||
Row( | |||||
children: <Widget>[ | |||||
Container( | |||||
decoration: BoxDecoration( | |||||
borderRadius: BorderRadius.circular(4), | |||||
color: Colors.red[100], | |||||
border: Border.all(color: Colors.red)), | |||||
child: Padding( | |||||
padding: const EdgeInsets.only( | |||||
left: 4, right: 4, top: 2, bottom: 2), | |||||
child: Center( | |||||
child: Text( | |||||
"自购", | |||||
style: TextStyle(color: Colors.red, fontSize: 20.sp), | |||||
), | |||||
), | |||||
), | |||||
), | |||||
Container( | |||||
width: 443.w, | |||||
margin: EdgeInsets.only(left: 15.w), | |||||
child: Text( | |||||
"Segway Ninebot mini Pro智能代的卅饭店发生的范德萨地方撒发生", | |||||
maxLines: 1, | |||||
overflow: TextOverflow.ellipsis, | |||||
style: TextStyle(fontSize: 28.sp), | |||||
)) | |||||
], | |||||
), | |||||
Row( | |||||
children: <Widget>[ | |||||
Text( | |||||
"+", | |||||
style: TextStyle(color: Colors.red), | |||||
), | |||||
Text( | |||||
"¥8.00", | |||||
style: TextStyle(color: Colors.red, fontSize: 30.sp), | |||||
) | |||||
], | |||||
) | |||||
], | |||||
), | |||||
SizedBox( | |||||
height: 4, | |||||
), | |||||
Row( | |||||
children: <Widget>[ | |||||
Text( | |||||
"订单编号:", | |||||
style: TextStyle( | |||||
color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), | |||||
), | |||||
Text( | |||||
"1233333333", | |||||
style: TextStyle( | |||||
color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), | |||||
), | |||||
SizedBox( | |||||
width: 28.w, | |||||
), | |||||
Container( | |||||
decoration: BoxDecoration( | |||||
borderRadius: BorderRadius.circular(4), | |||||
color: HexColor.fromHex("#FFF5F5F5"), | |||||
border: Border.all(color: HexColor.fromHex("#FFD6D6D6"))), | |||||
child: Padding( | |||||
padding: | |||||
EdgeInsets.only(left: 16, right: 16, top: 1, bottom: 1), | |||||
child: Text( | |||||
"复制", | |||||
style: TextStyle( | |||||
color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), | |||||
), | |||||
), | |||||
) | |||||
], | |||||
), | |||||
Row( | |||||
children: <Widget>[ | |||||
Text( | |||||
"订单编号:", | |||||
style: TextStyle( | |||||
color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), | |||||
), | |||||
Text( | |||||
"1233333333", | |||||
style: TextStyle( | |||||
color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), | |||||
), | |||||
], | |||||
), | |||||
Row( | |||||
children: <Widget>[ | |||||
Text( | |||||
"订单编号:", | |||||
style: TextStyle( | |||||
color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), | |||||
), | |||||
Text( | |||||
"1233333333", | |||||
style: TextStyle( | |||||
color: HexColor.fromHex("#FF999999"), fontSize: 22.sp), | |||||
), | |||||
], | |||||
) | |||||
], | |||||
), | |||||
); | |||||
} | } | ||||
} | } |
@@ -70,7 +70,7 @@ class _MainPageContainerState extends State<_MainPageContainer> | |||||
@override | @override | ||||
void didChangeAppLifecycleState(AppLifecycleState state) async { | void didChangeAppLifecycleState(AppLifecycleState state) async { | ||||
///智能粘贴板 | ///智能粘贴板 | ||||
// IntellectCreate.checkAndCreate(state, context); | |||||
IntellectCreate.checkAndCreate(state, context); | |||||
super.didChangeAppLifecycleState(state); | super.didChangeAppLifecycleState(state); | ||||
} | } | ||||
@@ -102,7 +102,7 @@ class _MainPageContainerState extends State<_MainPageContainer> | |||||
} | } | ||||
}); | }); | ||||
///监听app生命周期变化 | ///监听app生命周期变化 | ||||
// WidgetsBinding.instance.addObserver(this); | |||||
WidgetsBinding.instance.addObserver(this); | |||||
IntellectCreate.checkAndCreateFirst(context); | IntellectCreate.checkAndCreateFirst(context); | ||||
super.initState(); | super.initState(); | ||||
} | } | ||||
@@ -1,4 +1,5 @@ | |||||
import 'package:sharesdk_plugin/sharesdk_plugin.dart'; | |||||
import 'package:sharesdk_plugin/sharesdk_interface.dart'; | |||||
import 'package:sharesdk_plugin/sharesdk_register.dart'; | |||||
import 'package:zhiying_base_widget/pages/bil_detail_page/bil_detail_page.dart'; | import 'package:zhiying_base_widget/pages/bil_detail_page/bil_detail_page.dart'; | ||||
import 'package:zhiying_base_widget/pages/favorite_page/favorite_page.dart'; | import 'package:zhiying_base_widget/pages/favorite_page/favorite_page.dart'; | ||||
import 'package:flutter/cupertino.dart'; | import 'package:flutter/cupertino.dart'; | ||||
@@ -68,7 +69,6 @@ import 'widgets/search/tabbar/search_tab_widget.dart'; | |||||
import 'widgets/search_result/goods_list/search_result_goods_list_widget.dart'; | import 'widgets/search_result/goods_list/search_result_goods_list_widget.dart'; | ||||
import 'widgets/search_result/search_input/search_result_input.dart'; | import 'widgets/search_result/search_input/search_result_input.dart'; | ||||
class BaseWidgetRegister { | class BaseWidgetRegister { | ||||
/// 初始化方法 | /// 初始化方法 | ||||
static void init() { | static void init() { | ||||
@@ -101,12 +101,13 @@ class BaseWidgetRegister { | |||||
PageFactory.regist('pub.flutter.index', (model) => MainPage(model)); | PageFactory.regist('pub.flutter.index', (model) => MainPage(model)); | ||||
PageFactory.regist('pub.flutter.profile', (model) => MainPage(model)); | PageFactory.regist('pub.flutter.profile', (model) => MainPage(model)); | ||||
PageFactory.regist( | PageFactory.regist( | ||||
'pub.flutter.my_wallet', (model) => BilDetailPage(model)); | |||||
'pub.flutter.my_wallet', (model) => WalletPage(data: model)); | |||||
PageFactory.regist('goods_details', (model) => GoodsDetailsPage(model)); | PageFactory.regist('goods_details', (model) => GoodsDetailsPage(model)); | ||||
PageFactory.regist('search', (model) => SearchPage(model)); | PageFactory.regist('search', (model) => SearchPage(model)); | ||||
PageFactory.regist('search_item_page', (model) => SearchItemPage(model)); | PageFactory.regist('search_item_page', (model) => SearchItemPage(model)); | ||||
PageFactory.regist('search_result', (model) => SearchResultPage(model)); | PageFactory.regist('search_result', (model) => SearchResultPage(model)); | ||||
PageFactory.regist('search_result_item', (model) => SearchResultItemPage(model)); | |||||
PageFactory.regist( | |||||
'search_result_item', (model) => SearchResultItemPage(model)); | |||||
// PageFactory.regist('search_think_page', (model) => SearchThinkPage(model)); | // PageFactory.regist('search_think_page', (model) => SearchThinkPage(model)); | ||||
// PageFactory.regist('login', (model) => LoginPage(model)); | // PageFactory.regist('login', (model) => LoginPage(model)); | ||||
// PageFactory.regist('login_quick', (model) => LoginQuickPage(model)); | // PageFactory.regist('login_quick', (model) => LoginQuickPage(model)); | ||||
@@ -155,10 +156,12 @@ class BaseWidgetRegister { | |||||
WidgetFactory.regist('index_recommend_list', GoodsListCreater()); | WidgetFactory.regist('index_recommend_list', GoodsListCreater()); | ||||
/// 首页快速入口 | /// 首页快速入口 | ||||
WidgetFactory.regist('multi_nav', DefaultWidgetCreater((model) => HomeQuickEntry(model))); | |||||
WidgetFactory.regist( | |||||
'multi_nav', DefaultWidgetCreater((model) => HomeQuickEntry(model))); | |||||
/// 滚动公告 | /// 滚动公告 | ||||
WidgetFactory.regist('index_placard', DefaultWidgetCreater((model) => HomeNoticeWidget(model))); | |||||
WidgetFactory.regist('index_placard', | |||||
DefaultWidgetCreater((model) => HomeNoticeWidget(model))); | |||||
/// 不可以滚动banner | /// 不可以滚动banner | ||||
WidgetFactory.regist('index_banner_one', HomeBannerCreater()); | WidgetFactory.regist('index_banner_one', HomeBannerCreater()); | ||||
@@ -169,81 +172,113 @@ class BaseWidgetRegister { | |||||
// 搜索标题 | // 搜索标题 | ||||
// WidgetFactory.regist('search_index_app_bar', DefaultWidgetCreater((model) => SearchAppbarWidget(model))); | // WidgetFactory.regist('search_index_app_bar', DefaultWidgetCreater((model) => SearchAppbarWidget(model))); | ||||
// 搜索输入框 | // 搜索输入框 | ||||
WidgetFactory.regist('search_index_input', DefaultWidgetCreater((model) => SearchInputWidget(model))); | |||||
WidgetFactory.regist('search_index_input', | |||||
DefaultWidgetCreater((model) => SearchInputWidget(model))); | |||||
// // 搜索tabBar | // // 搜索tabBar | ||||
WidgetFactory.regist('search_index_icon_list', SearcchTabCreater()); | WidgetFactory.regist('search_index_icon_list', SearcchTabCreater()); | ||||
// WidgetFactory.regist('search_index_icon_list', DefaultWidgetCreater((model) => SearchTabWidget(model))); | // WidgetFactory.regist('search_index_icon_list', DefaultWidgetCreater((model) => SearchTabWidget(model))); | ||||
// // 热门搜索标签 | // // 热门搜索标签 | ||||
WidgetFactory.regist('search_index_host_keyword', DefaultWidgetCreater((model) => SearchHotTagWidget(model))); | |||||
WidgetFactory.regist('search_index_host_keyword', | |||||
DefaultWidgetCreater((model) => SearchHotTagWidget(model))); | |||||
// // 历史搜索标签 | // // 历史搜索标签 | ||||
WidgetFactory.regist('search_index_history', DefaultWidgetCreater((model) => SearchHistoryTagWidget(model))); | |||||
WidgetFactory.regist('search_index_history', | |||||
DefaultWidgetCreater((model) => SearchHistoryTagWidget(model))); | |||||
/// ==================== 搜索结果页面 ==================== /// | /// ==================== 搜索结果页面 ==================== /// | ||||
// 输入框 | // 输入框 | ||||
WidgetFactory.regist('search_result_input', DefaultWidgetCreater((model) => SearchResultInputWidget(model))); | |||||
WidgetFactory.regist('search_result_input', | |||||
DefaultWidgetCreater((model) => SearchResultInputWidget(model))); | |||||
// tabbar | // tabbar | ||||
WidgetFactory.regist('search_result_icon_list', SearchResultTabCreater()); | WidgetFactory.regist('search_result_icon_list', SearchResultTabCreater()); | ||||
// 搜索结果页筛选widget 淘宝 | // 搜索结果页筛选widget 淘宝 | ||||
WidgetFactory.regist('search_result_taobao_sort', DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
WidgetFactory.regist('search_result_taobao_sort', | |||||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
// 搜索结果的商品列表 淘宝 | // 搜索结果的商品列表 淘宝 | ||||
WidgetFactory.regist('search_result_taobao_item', DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
WidgetFactory.regist('search_result_taobao_item', | |||||
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
// 搜索结果页筛选widget 京东 | // 搜索结果页筛选widget 京东 | ||||
WidgetFactory.regist('search_result_jd_sort', DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
WidgetFactory.regist('search_result_jd_sort', | |||||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
// 搜索结果的商品列表 京东 | // 搜索结果的商品列表 京东 | ||||
WidgetFactory.regist('search_result_jd_item', DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
WidgetFactory.regist('search_result_jd_item', | |||||
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
// 搜索结果页筛选widget 苏宁 | // 搜索结果页筛选widget 苏宁 | ||||
WidgetFactory.regist('search_result_suning_sort', DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
WidgetFactory.regist('search_result_suning_sort', | |||||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
// 搜索结果的商品列表 苏宁 | // 搜索结果的商品列表 苏宁 | ||||
WidgetFactory.regist('search_result_suning_item', DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
WidgetFactory.regist('search_result_suning_item', | |||||
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
// 搜索结果页筛选widget 拼多多 | // 搜索结果页筛选widget 拼多多 | ||||
WidgetFactory.regist('search_result_pdd_sort', DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
WidgetFactory.regist('search_result_pdd_sort', | |||||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
// 搜索结果的商品列表 拼多多 | // 搜索结果的商品列表 拼多多 | ||||
WidgetFactory.regist('search_result_pdd_item', DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
WidgetFactory.regist('search_result_pdd_item', | |||||
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
// 搜索结果页筛选widget 唯品会 | // 搜索结果页筛选widget 唯品会 | ||||
WidgetFactory.regist('search_result_vip', DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
WidgetFactory.regist('search_result_vip', | |||||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
// 搜索结果的商品列表 唯品会 | // 搜索结果的商品列表 唯品会 | ||||
WidgetFactory.regist('search_result_vip_item', DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
WidgetFactory.regist('search_result_vip_item', | |||||
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
// 搜索结果页筛选widget 考拉 | // 搜索结果页筛选widget 考拉 | ||||
WidgetFactory.regist('search_result_kaola', DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
WidgetFactory.regist('search_result_kaola', | |||||
DefaultWidgetCreater((model) => SearchResultSortWidget(model))); | |||||
// 搜索结果的商品列表 考拉 | // 搜索结果的商品列表 考拉 | ||||
WidgetFactory.regist('search_result_kaola_item', DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
WidgetFactory.regist('search_result_kaola_item', | |||||
DefaultWidgetCreater((model) => SearchResultGoodsListWidget(model))); | |||||
/// ==================== 商品详情 ==================== /// | /// ==================== 商品详情 ==================== /// | ||||
// 商品详情轮播图 | // 商品详情轮播图 | ||||
WidgetFactory.regist('product_detail_carousel', DefaultWidgetCreater((model) => GoodsDetailsSlideBannerWidget(model))); | |||||
WidgetFactory.regist('product_detail_carousel', | |||||
DefaultWidgetCreater((model) => GoodsDetailsSlideBannerWidget(model))); | |||||
// 商品详情下载APP提示 | // 商品详情下载APP提示 | ||||
WidgetFactory.regist('product_detail_download_tips', DefaultWidgetCreater((model) => UpgradeTipWidget(model))); | |||||
WidgetFactory.regist('product_detail_download_tips', | |||||
DefaultWidgetCreater((model) => UpgradeTipWidget(model))); | |||||
// 商品详情价格显示 | // 商品详情价格显示 | ||||
WidgetFactory.regist('product_detail_price', DefaultWidgetCreater((model) => GoodsDetailsPriceWidget(model))); | |||||
WidgetFactory.regist('product_detail_price', | |||||
DefaultWidgetCreater((model) => GoodsDetailsPriceWidget(model))); | |||||
// 商品详情标题 | // 商品详情标题 | ||||
WidgetFactory.regist('product_detail_title', DefaultWidgetCreater((model) => GoodsDetailsTitleWidget(model))); | |||||
WidgetFactory.regist('product_detail_title', | |||||
DefaultWidgetCreater((model) => GoodsDetailsTitleWidget(model))); | |||||
// 商品详情优惠劵 | // 商品详情优惠劵 | ||||
WidgetFactory.regist('product_detail_coupon', DefaultWidgetCreater((model) => CounponWidget(model))); | |||||
WidgetFactory.regist('product_detail_coupon', | |||||
DefaultWidgetCreater((model) => CounponWidget(model))); | |||||
// 商品详情店铺 | // 商品详情店铺 | ||||
WidgetFactory.regist('product_detail_shop', DefaultWidgetCreater((model) => StoreWidget(model))); | |||||
WidgetFactory.regist('product_detail_shop', | |||||
DefaultWidgetCreater((model) => StoreWidget(model))); | |||||
// 商品详情宝贝评价 | // 商品详情宝贝评价 | ||||
WidgetFactory.regist('product_detail_comment', DefaultWidgetCreater((model) => GoodsDetailsEvaluateWidget(model))); | |||||
WidgetFactory.regist('product_detail_comment', | |||||
DefaultWidgetCreater((model) => GoodsDetailsEvaluateWidget(model))); | |||||
// 商品详情图片 | // 商品详情图片 | ||||
WidgetFactory.regist('product_detail_img_list', DefaultWidgetCreater((model) => GoodsDetailsImgWidget(model))); | |||||
WidgetFactory.regist('product_detail_img_list', | |||||
DefaultWidgetCreater((model) => GoodsDetailsImgWidget(model))); | |||||
// 商品详情底部推荐列表 | // 商品详情底部推荐列表 | ||||
WidgetFactory.regist('product_detail_bottom_rec', GoodsDetailCommendCreater()); | |||||
WidgetFactory.regist( | |||||
'product_detail_bottom_rec', GoodsDetailCommendCreater()); | |||||
// 商品详情底部 | // 商品详情底部 | ||||
WidgetFactory.regist('product_detail_bottom', DefaultWidgetCreater((model) => GoodsDetailsFooterWidget(model))); | |||||
WidgetFactory.regist('product_detail_bottom', | |||||
DefaultWidgetCreater((model) => GoodsDetailsFooterWidget(model))); | |||||
// ==================== 个人中心 | // ==================== 个人中心 | ||||
WidgetFactory.regist('profile_appbar', MineNavCreater()); | WidgetFactory.regist('profile_appbar', MineNavCreater()); | ||||
WidgetFactory.regist('profile_background', DefaultWidgetCreater((model) => MineNavBg(model))); | |||||
WidgetFactory.regist('profile_header', DefaultWidgetCreater((model) => MineHeader(model))); | |||||
WidgetFactory.regist('profile_earning', DefaultWidgetCreater((model) => MineData(model))); | |||||
WidgetFactory.regist('profile_functions', DefaultWidgetCreater((model) => MineQuickEntry(model))); | |||||
WidgetFactory.regist('profile_my_functions', DefaultWidgetCreater((model) => MineQuickEntry(model))); | |||||
WidgetFactory.regist('profile_carousel', DefaultWidgetCreater((model) => HomeBannerWidget(model))); | |||||
WidgetFactory.regist('profile_background', | |||||
DefaultWidgetCreater((model) => MineNavBg(model))); | |||||
WidgetFactory.regist( | |||||
'profile_header', DefaultWidgetCreater((model) => MineHeader(model))); | |||||
WidgetFactory.regist( | |||||
'profile_earning', DefaultWidgetCreater((model) => MineData(model))); | |||||
WidgetFactory.regist('profile_functions', | |||||
DefaultWidgetCreater((model) => MineQuickEntry(model))); | |||||
WidgetFactory.regist('profile_my_functions', | |||||
DefaultWidgetCreater((model) => MineQuickEntry(model))); | |||||
WidgetFactory.regist('profile_carousel', | |||||
DefaultWidgetCreater((model) => HomeBannerWidget(model))); | |||||
// ==================== 钱包 | // ==================== 钱包 | ||||
WidgetFactory.regist( | WidgetFactory.regist( | ||||
@@ -187,7 +187,7 @@ class _ShareAlertContentState extends State<_ShareAlertContent> { | |||||
], | ], | ||||
), | ), | ||||
), | ), | ||||
onTap: () { | |||||
onTap: () async { | |||||
//检查是否有存储权限 | //检查是否有存储权限 | ||||
var status = await Permission.storage.status; | var status = await Permission.storage.status; | ||||
if (!status.isGranted) { | if (!status.isGranted) { | ||||
@@ -31,15 +31,15 @@ dependencies: | |||||
flutter_native_image: ^0.0.5 | flutter_native_image: ^0.0.5 | ||||
#字符检测 | #字符检测 | ||||
string_validator: 0.1.4 | string_validator: 0.1.4 | ||||
intl: 0.15.7 | |||||
permission_handler: | permission_handler: | ||||
git: | git: | ||||
ref: 0.0.1 | ref: 0.0.1 | ||||
url: http://192.168.0.138:3000/FnuoOS_Flutter_Components/permission_handler.git | url: http://192.168.0.138:3000/FnuoOS_Flutter_Components/permission_handler.git | ||||
zhiying_comm: | zhiying_comm: | ||||
path: ../zhiying_comm | path: ../zhiying_comm | ||||
intl: 0.16.0 | |||||
dev_dependencies: | dev_dependencies: | ||||
flutter_test: | flutter_test: | ||||