diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index 97626ba..15a15b2 100644
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -1,6 +1,4 @@
-
-
-
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 682e5c4..0a98a5e 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -10,14 +10,15 @@
+
diff --git a/app/build.gradle b/app/build.gradle
index 1e37422..bd22a56 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,5 +1,3 @@
-
-
apply plugin: 'com.android.application'
android {
signingConfigs {
@@ -17,7 +15,7 @@ android {
targetSdkVersion 28
versionCode 1
versionName "1.0"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.config
multiDexEnabled true
}
@@ -46,17 +44,18 @@ android {
dependencies {
implementation project(':flutter')
implementation fileTree(include: ['*.jar'], dir: 'libs')
- implementation 'com.android.support:multidex:1.0.3'
- implementation 'com.android.support:appcompat-v7:28.0.0'
- implementation 'com.android.support.constraint:constraint-layout:1.1.3'
- androidTestImplementation 'com.android.support.test:runner:1.0.2'
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ implementation 'androidx.multidex:multidex:2.0.0'
+ implementation 'androidx.appcompat:appcompat:1.0.0'
+ implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+ androidTestImplementation 'androidx.test:runner:1.1.0'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
//系统全局配置模块
implementation 'com.bristua.framework:appconfig:2.0.0-SNAPHOST'
implementation 'com.bristua.framework:component_manager:2.0.0-SNAPHOST'
//https模块
implementation 'com.bristua.framework:https:2.0.1-SNAPHOST'
//路由模块
+
implementation 'com.bristua.framework:brouter:2.0.0-SNAPHOST'
//配置通用api 能力
implementation 'com.bristua.framework:common_api:2.0.0-SNAPHOST'
@@ -64,23 +63,23 @@ dependencies {
implementation 'com.bristua.framework:sp_manager:1.0.4-SNAPHOST'
//全局APP Context
implementation 'com.bristua.framework:context:2.0.0-SNAPHOST'
- implementation 'com.ft.business.interceptor:response:1.1.2-SNAPHOST'
- implementation 'com.ft.business.component:user_login:6.1.1-SNAPHOST'
+ implementation 'com.ft.business.interceptor:response:1.2.2-SNAPHOST'
+ implementation 'com.ft.business.component:user_login:6.1.4-SNAPHOST'
implementation 'com.ft.business.component:invite:1.0.0-SNAPHOST'
implementation 'com.ft.business.component:user_pay:1.1.2-SNAPHOST'
implementation 'com.ft.business.component:enviroment:1.0.8-SNAPHOST'
- implementation 'com.ft.business.component:shop_cart:1.2.6-SNAPHOST'
- implementation 'com.ft.business.component:shop_sku:1.0.5-SNAPHOST'
- implementation 'com.ft.business.component:address:1.1.1-SNAPHOST'
- implementation 'com.ft.business.component:order:1.0.9-SNAPHOST'
- implementation 'com.ft.business.component:order_list:1.0.0-SNAPHOST'
+ implementation 'com.ft.business.component:shop_cart:1.4.6-SNAPHOST'
+ implementation 'com.ft.business.component:shop_sku:1.0.6-SNAPHOST'
+ implementation 'com.ft.business.component:address:1.1.4-SNAPHOST'
+ implementation 'com.ft.business.component:order:1.3.4-SNAPHOST'
+ implementation 'com.ft.business.component:order_list:1.0.3-SNAPHOST'
implementation 'com.ft.business.component:evaluate:1.0.1-SNAPHOST'
- implementation 'com.ft.business.component:collection:1.0.1-SNAPHOST'
- implementation 'com.ft.business.component:product:1.0.5-SNAPHOST'
- implementation 'com.ft.business.component:rebate:1.0.8-SNAPHOST'
+ implementation 'com.ft.business.component:collection:1.0.2-SNAPHOST'
+ implementation 'com.ft.business.component:product:1.1.1-SNAPHOST'
+ implementation 'com.ft.business.component:rebate:1.0.9-SNAPHOST'
implementation 'com.bristua.framework:logger:1.0.4-SNAPHOST'
implementation 'com.bristua.framework:ssl_cert:1.0.5-SNAPHOST'
- implementation 'com.ft.business.component:category:1.0.8-SNAPHOST'
+ implementation 'com.ft.business.component:category:1.0.9-SNAPHOST'
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:5.3.1'
annotationProcessor 'com.nd.sdp.android.serviceloader:service-loader-compiler-app:1.0.9'
implementation 'com.nd.sdp.android.serviceloader:service-loader:1.0.9'
diff --git a/app/src/androidTest/java/com/ym/flutter/ftshop/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/ym/flutter/ftshop/ExampleInstrumentedTest.java
index e2f2cf5..b72e564 100644
--- a/app/src/androidTest/java/com/ym/flutter/ftshop/ExampleInstrumentedTest.java
+++ b/app/src/androidTest/java/com/ym/flutter/ftshop/ExampleInstrumentedTest.java
@@ -1,8 +1,8 @@
package com.ym.flutter.ftshop;
import android.content.Context;
-import android.support.test.InstrumentationRegistry;
-import android.support.test.runner.AndroidJUnit4;
+import androidx.test.InstrumentationRegistry;
+import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 27eb3aa..e368dc0 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,20 +1,26 @@
-
-
+ android:theme="@style/AppTheme"
+ >
+
+
+
+
@@ -26,17 +32,15 @@
android:host="video"
android:scheme="flutterhost" />
-
-
-
+
-
-
+ android:theme="@android:style/Theme.Translucent.NoTitleBar" />
result.confirm())
+ .setCancelable(false)
+ .show();
+ return true;
+ }
+
+ @Override
+ public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
+ new AlertDialog.Builder(WebActivity.this)
+ .setTitle("JsConfirm")
+ .setMessage(message)
+ .setPositiveButton("OK", (dialog, which) -> result.confirm())
+ .setNegativeButton("Cancel", (dialog, which) -> result.cancel())
+ .setCancelable(false)
+ .show();
+// 返回布尔值:判断点击时确认还是取消
+// true表示点击了确认;false表示点击了取消;
+ return true;
+ }
+
+
+ });
+ webView.loadUrl(url);
+
+ }
+
+ @Override
+ protected void onDestroy() {
+ if (webView != null) {
+ webView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null);
+ webView.clearHistory();
+
+ ((ViewGroup) webView.getParent()).removeView(webView);
+ webView.destroy();
+ webView = null;
+ }
+ super.onDestroy();
+ }
+}
diff --git a/app/src/main/java/com/bristua/flutter/ftshop/app/AppVMachine.java b/app/src/main/java/com/bristua/flutter/ftshop/app/AppVMachine.java
index 7bd8967..edbc12b 100644
--- a/app/src/main/java/com/bristua/flutter/ftshop/app/AppVMachine.java
+++ b/app/src/main/java/com/bristua/flutter/ftshop/app/AppVMachine.java
@@ -1,9 +1,8 @@
package com.bristua.flutter.ftshop.app;
-import android.app.Application;
import android.content.Context;
import android.os.Handler;
-import android.support.annotation.Nullable;
+import androidx.annotation.Nullable;
import com.bristua.bristua.sp.ShareprefenseImpl;
import com.bristua.flutter.ftshop.R;
diff --git a/app/src/main/java/com/bristua/flutter/ftshop/exception/VMachineException.java b/app/src/main/java/com/bristua/flutter/ftshop/exception/VMachineException.java
index 3b358bd..775004d 100644
--- a/app/src/main/java/com/bristua/flutter/ftshop/exception/VMachineException.java
+++ b/app/src/main/java/com/bristua/flutter/ftshop/exception/VMachineException.java
@@ -1,6 +1,6 @@
package com.bristua.flutter.ftshop.exception;
-import android.support.annotation.Nullable;
+import androidx.annotation.Nullable;
/**
* 虚拟机异常
diff --git a/app/src/main/java/com/bristua/flutter/ftshop/plugin/PluginDelegate.java b/app/src/main/java/com/bristua/flutter/ftshop/plugin/PluginDelegate.java
index 81fc43c..031ba8e 100644
--- a/app/src/main/java/com/bristua/flutter/ftshop/plugin/PluginDelegate.java
+++ b/app/src/main/java/com/bristua/flutter/ftshop/plugin/PluginDelegate.java
@@ -1,18 +1,40 @@
package com.bristua.flutter.ftshop.plugin;
import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.net.Uri;
import android.text.TextUtils;
import android.widget.Toast;
+import com.bristua.flutter.ftshop.WebActivity;
import com.bristua.framework.define.IFlutterResult;
import com.bristua.framework.router.BRouter;
import org.json.JSONObject;
+import java.util.List;
+
import io.flutter.plugin.common.MethodCall;
public class PluginDelegate {
+ public static boolean isQQClientAvailable(Context context) {
+ final PackageManager packageManager = context.getPackageManager();
+ List pinfo = packageManager.getInstalledPackages(0);
+ if (pinfo != null) {
+ for (int i = 0; i < pinfo.size(); i++) {
+ String pn = pinfo.get(i).packageName;
+ if (pn.equals("com.tencent.mobileqq")) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+
public void call(Context context, MethodCall methodCall, String params, IFlutterResult result) throws Exception {
JSONObject jsonObject = null;
if (!TextUtils.isEmpty(params)) {
@@ -20,6 +42,27 @@ public void call(Context context, MethodCall methodCall, String params, IFlutter
}
switch (methodCall.method) {
+ case "openQQ":
+ if (jsonObject != null) {
+ String qq = jsonObject.optString("qq");
+ if (isQQClientAvailable(context)) {
+ final String qqUrl = "mqqwpa://im/chat?chat_type=wpa&uin=" + qq + "&version=1";
+ context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(qqUrl)));
+ } else {
+ Toast.makeText(context, "请安装QQ客户端", Toast.LENGTH_SHORT).show();
+ }
+ }
+ break;
+ case "webview":
+ if (jsonObject != null) {
+ String url = jsonObject.optString("url");
+ Intent intent = new Intent(context, WebActivity.class);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ intent.putExtra("url", url);
+ context.startActivity(intent);
+ }
+
+ break;
case "showShortToast":
if (jsonObject != null)
Toast.makeText(context, jsonObject.optString("message"), Toast.LENGTH_SHORT).show();
diff --git a/app/src/main/java/com/bristua/flutter/ftshop/plugin/PluginProvider.java b/app/src/main/java/com/bristua/flutter/ftshop/plugin/PluginProvider.java
index 45a7a99..acb534f 100644
--- a/app/src/main/java/com/bristua/flutter/ftshop/plugin/PluginProvider.java
+++ b/app/src/main/java/com/bristua/flutter/ftshop/plugin/PluginProvider.java
@@ -1,9 +1,7 @@
package com.bristua.flutter.ftshop.plugin;
import android.content.Context;
-import android.support.annotation.Nullable;
-import android.text.TextUtils;
-import android.util.Log;
+import androidx.annotation.Nullable;
import com.bristua.framework.define.IFlutterResult;
import com.bristua.framework.logger.Logger;
diff --git a/app/src/main/java/com/bristua/flutter/ftshop/wxapi/WXEntryActivity.java b/app/src/main/java/com/bristua/flutter/ftshop/wxapi/WXEntryActivity.java
index be51412..2802cef 100644
--- a/app/src/main/java/com/bristua/flutter/ftshop/wxapi/WXEntryActivity.java
+++ b/app/src/main/java/com/bristua/flutter/ftshop/wxapi/WXEntryActivity.java
@@ -10,8 +10,8 @@
import android.content.Intent;
import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.support.v7.app.AppCompatActivity;
+import androidx.annotation.Nullable;
+import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
import android.widget.Toast;
diff --git a/app/src/main/java/com/bristua/flutter/ftshop/wxapi/WXPayEntryActivity.java b/app/src/main/java/com/bristua/flutter/ftshop/wxapi/WXPayEntryActivity.java
index 4caaa8a..678fc81 100644
--- a/app/src/main/java/com/bristua/flutter/ftshop/wxapi/WXPayEntryActivity.java
+++ b/app/src/main/java/com/bristua/flutter/ftshop/wxapi/WXPayEntryActivity.java
@@ -52,9 +52,11 @@ public void onResp(BaseResp resp) {
break;
case BaseResp.ErrCode.ERR_COMM:// 支付失败
Log.e(TAG, "微信支付 ------ 支付失败");
+ PluginProvider.resultCallBack(403,"微信支付失败");
break;
case BaseResp.ErrCode.ERR_USER_CANCEL:// 支付取消
Log.e(TAG, "微信支付 ------ 支付取消");
+ PluginProvider.resultCallBack(406,"支付取消");
break;
}
finish();
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 70b5947..72bb3d6 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,5 +1,5 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_video.xml b/app/src/main/res/layout/activity_video.xml
index 638c062..93f277f 100644
--- a/app/src/main/res/layout/activity_video.xml
+++ b/app/src/main/res/layout/activity_video.xml
@@ -1,5 +1,5 @@
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_web.xml b/app/src/main/res/layout/activity_web.xml
new file mode 100644
index 0000000..df8dfe7
--- /dev/null
+++ b/app/src/main/res/layout/activity_web.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 49e3202..338443c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,9 +2,9 @@
buildscript {
repositories {
+ maven { url 'http://47.244.0.128:8081/nexus/content/groups/android-public/'}
google()
jcenter()
- maven { url 'http://47.244.0.128:8081/nexus/content/groups/android-public/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
@@ -16,9 +16,9 @@ buildscript {
allprojects {
repositories {
+ maven { url 'http://47.244.0.128:8081/nexus/content/groups/android-public/'}
google()
jcenter()
- maven { url 'http://47.244.0.128:8081/nexus/content/groups/android-public/'}
}
}
diff --git a/flutter_lib/.android/.gitignore b/flutter_lib/.android/.gitignore
new file mode 100644
index 0000000..9721358
--- /dev/null
+++ b/flutter_lib/.android/.gitignore
@@ -0,0 +1,56 @@
+.DS_Store
+.dart_tool/
+
+.packages
+.pub/
+
+.idea/
+.vagrant/
+.sconsign.dblite
+.svn/
+
+*.swp
+profile
+
+DerivedData/
+
+.generated/
+
+*.pbxuser
+*.mode1v3
+*.mode2v3
+*.perspectivev3
+
+!default.pbxuser
+!default.mode1v3
+!default.mode2v3
+!default.perspectivev3
+
+xcuserdata
+
+*.moved-aside
+
+*.pyc
+*sync/
+Icon?
+.tags*
+
+build/
+#.android/
+#.ios/
+.flutter-plugins
+
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+
diff --git a/flutter_lib/.android/Flutter/build.gradle b/flutter_lib/.android/Flutter/build.gradle
index 40fdf33..969e0ee 100644
--- a/flutter_lib/.android/Flutter/build.gradle
+++ b/flutter_lib/.android/Flutter/build.gradle
@@ -34,7 +34,7 @@ android {
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
}
@@ -44,6 +44,6 @@ flutter {
dependencies {
testImplementation 'junit:junit:4.12'
- implementation 'com.android.support:support-v13:27.1.1'
- implementation 'com.android.support:support-annotations:27.1.1'
+ implementation 'androidx.legacy:legacy-support-v13:1.0.0'
+ implementation 'androidx.annotation:annotation:1.0.0'
}
diff --git a/flutter_lib/.android/Flutter/src/main/java/io/flutter/facade/Flutter.java b/flutter_lib/.android/Flutter/src/main/java/io/flutter/facade/Flutter.java
index 54d717e..7bc97ef 100644
--- a/flutter_lib/.android/Flutter/src/main/java/io/flutter/facade/Flutter.java
+++ b/flutter_lib/.android/Flutter/src/main/java/io/flutter/facade/Flutter.java
@@ -1,12 +1,12 @@
package io.flutter.facade;
import android.app.Activity;
-import android.arch.lifecycle.Lifecycle;
-import android.arch.lifecycle.LifecycleObserver;
-import android.arch.lifecycle.OnLifecycleEvent;
+import androidx.lifecycle.Lifecycle;
+import androidx.lifecycle.LifecycleObserver;
+import androidx.lifecycle.OnLifecycleEvent;
import android.content.Context;
import android.os.Bundle;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
import io.flutter.plugin.common.BasicMessageChannel;
import io.flutter.plugin.common.StringCodec;
diff --git a/flutter_lib/.android/Flutter/src/main/java/io/flutter/facade/FlutterFragment.java b/flutter_lib/.android/Flutter/src/main/java/io/flutter/facade/FlutterFragment.java
index fdca660..998dfd5 100644
--- a/flutter_lib/.android/Flutter/src/main/java/io/flutter/facade/FlutterFragment.java
+++ b/flutter_lib/.android/Flutter/src/main/java/io/flutter/facade/FlutterFragment.java
@@ -2,8 +2,8 @@
import android.content.Context;
import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.v4.app.Fragment;
+import androidx.annotation.NonNull;
+import androidx.fragment.app.Fragment;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.ViewGroup;
diff --git a/flutter_lib/.android/Flutter/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java b/flutter_lib/.android/Flutter/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
index 0618751..815cf98 100644
--- a/flutter_lib/.android/Flutter/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
+++ b/flutter_lib/.android/Flutter/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
@@ -2,7 +2,9 @@
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugins.pathprovider.PathProviderPlugin;
-import io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin;
+import com.tekartik.sqflite.SqflitePlugin;
+import io.flutter.plugins.urllauncher.UrlLauncherPlugin;
+import io.flutter.plugins.webviewflutter.WebViewFlutterPlugin;
/**
* Generated file. Do not edit.
@@ -13,7 +15,9 @@ public static void registerWith(PluginRegistry registry) {
return;
}
PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin"));
- SharedPreferencesPlugin.registerWith(registry.registrarFor("io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin"));
+ SqflitePlugin.registerWith(registry.registrarFor("com.tekartik.sqflite.SqflitePlugin"));
+ UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin"));
+ WebViewFlutterPlugin.registerWith(registry.registrarFor("io.flutter.plugins.webviewflutter.WebViewFlutterPlugin"));
}
private static boolean alreadyRegisteredWith(PluginRegistry registry) {
diff --git a/flutter_lib/.android/build.gradle b/flutter_lib/.android/build.gradle
index 3dbab77..6cdcf39 100644
--- a/flutter_lib/.android/build.gradle
+++ b/flutter_lib/.android/build.gradle
@@ -7,7 +7,7 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.4.0'
+ classpath 'com.android.tools.build:gradle:3.2.1'
}
}
diff --git a/flutter_lib/.android/gradlew b/flutter_lib/.android/gradlew
old mode 100755
new mode 100644
diff --git a/flutter_lib/.android/local.properties b/flutter_lib/.android/local.properties
deleted file mode 100644
index b22e6da..0000000
--- a/flutter_lib/.android/local.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-sdk.dir=/Users/richsjeson/Library/Android/sdk
-flutter.sdk=/Users/richsjeson/compile/env/flutter_sdk
\ No newline at end of file
diff --git a/flutter_lib/.gitignore b/flutter_lib/.gitignore
index 7427217..9721358 100644
--- a/flutter_lib/.gitignore
+++ b/flutter_lib/.gitignore
@@ -39,3 +39,18 @@ build/
#.android/
#.ios/
.flutter-plugins
+
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+
diff --git a/flutter_lib/.ios/Flutter/FlutterPluginRegistrant/Classes/GeneratedPluginRegistrant.m b/flutter_lib/.ios/Flutter/FlutterPluginRegistrant/Classes/GeneratedPluginRegistrant.m
index 4adb0ff..bbe0d8a 100644
--- a/flutter_lib/.ios/Flutter/FlutterPluginRegistrant/Classes/GeneratedPluginRegistrant.m
+++ b/flutter_lib/.ios/Flutter/FlutterPluginRegistrant/Classes/GeneratedPluginRegistrant.m
@@ -4,13 +4,17 @@
#import "GeneratedPluginRegistrant.h"
#import
-#import
+#import
+#import
+#import
@implementation GeneratedPluginRegistrant
+ (void)registerWithRegistry:(NSObject*)registry {
[FLTPathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTPathProviderPlugin"]];
- [FLTSharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTSharedPreferencesPlugin"]];
+ [SqflitePlugin registerWithRegistrar:[registry registrarForPlugin:@"SqflitePlugin"]];
+ [FLTUrlLauncherPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTUrlLauncherPlugin"]];
+ [FLTWebViewFlutterPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTWebViewFlutterPlugin"]];
}
@end
diff --git a/flutter_lib/.ios/Flutter/FlutterPluginRegistrant/FlutterPluginRegistrant.podspec b/flutter_lib/.ios/Flutter/FlutterPluginRegistrant/FlutterPluginRegistrant.podspec
index c29a8de..0f426de 100644
--- a/flutter_lib/.ios/Flutter/FlutterPluginRegistrant/FlutterPluginRegistrant.podspec
+++ b/flutter_lib/.ios/Flutter/FlutterPluginRegistrant/FlutterPluginRegistrant.podspec
@@ -18,5 +18,7 @@ Depends on all your plugins, and provides a function to register them.
s.public_header_files = './Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'path_provider'
- s.dependency 'shared_preferences'
+ s.dependency 'sqflite'
+ s.dependency 'url_launcher'
+ s.dependency 'webview_flutter'
end
diff --git a/flutter_lib/.ios/Flutter/Generated.xcconfig b/flutter_lib/.ios/Flutter/Generated.xcconfig
index 013b6a6..b8eac05 100644
--- a/flutter_lib/.ios/Flutter/Generated.xcconfig
+++ b/flutter_lib/.ios/Flutter/Generated.xcconfig
@@ -1,6 +1,6 @@
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=C:\workspace\flutter
-FLUTTER_APPLICATION_PATH=C:\workspace\github\bristuaftshop\flutter_lib
+FLUTTER_APPLICATION_PATH=C:\workspace\github\flutter_shop\flutter_lib
FLUTTER_TARGET=lib/main.dart
FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build\ios
diff --git a/flutter_lib/images/btn_settings.png b/flutter_lib/images/btn_settings.png
new file mode 100644
index 0000000..e7a31ad
Binary files /dev/null and b/flutter_lib/images/btn_settings.png differ
diff --git a/flutter_lib/images/icon_bottom_navigation_active.png b/flutter_lib/images/icon_bottom_navigation_active.png
new file mode 100644
index 0000000..9e6cf08
Binary files /dev/null and b/flutter_lib/images/icon_bottom_navigation_active.png differ
diff --git a/flutter_lib/images/icon_bottom_navigation_car.png b/flutter_lib/images/icon_bottom_navigation_car.png
new file mode 100644
index 0000000..95b9e5c
Binary files /dev/null and b/flutter_lib/images/icon_bottom_navigation_car.png differ
diff --git a/flutter_lib/images/icon_bottom_navigation_home.png b/flutter_lib/images/icon_bottom_navigation_home.png
new file mode 100644
index 0000000..e2a1882
Binary files /dev/null and b/flutter_lib/images/icon_bottom_navigation_home.png differ
diff --git a/flutter_lib/images/icon_bottom_navigation_mine.png b/flutter_lib/images/icon_bottom_navigation_mine.png
new file mode 100644
index 0000000..be989dd
Binary files /dev/null and b/flutter_lib/images/icon_bottom_navigation_mine.png differ
diff --git a/flutter_lib/images/icon_collection.png b/flutter_lib/images/icon_collection.png
new file mode 100644
index 0000000..d35893e
Binary files /dev/null and b/flutter_lib/images/icon_collection.png differ
diff --git a/flutter_lib/images/icon_exit.png b/flutter_lib/images/icon_exit.png
new file mode 100644
index 0000000..8084d54
Binary files /dev/null and b/flutter_lib/images/icon_exit.png differ
diff --git a/flutter_lib/images/icon_inputnumber.png b/flutter_lib/images/icon_inputnumber.png
new file mode 100644
index 0000000..bcfabff
Binary files /dev/null and b/flutter_lib/images/icon_inputnumber.png differ
diff --git a/flutter_lib/images/icon_kehu.png b/flutter_lib/images/icon_kehu.png
new file mode 100644
index 0000000..b7f9d23
Binary files /dev/null and b/flutter_lib/images/icon_kehu.png differ
diff --git a/flutter_lib/images/icon_mine_bg.png b/flutter_lib/images/icon_mine_bg.png
new file mode 100644
index 0000000..46ece7d
Binary files /dev/null and b/flutter_lib/images/icon_mine_bg.png differ
diff --git a/flutter_lib/images/icon_ranking.png b/flutter_lib/images/icon_ranking.png
new file mode 100644
index 0000000..be2d205
Binary files /dev/null and b/flutter_lib/images/icon_ranking.png differ
diff --git a/flutter_lib/images/icon_setting.png b/flutter_lib/images/icon_setting.png
new file mode 100644
index 0000000..d471b4c
Binary files /dev/null and b/flutter_lib/images/icon_setting.png differ
diff --git a/flutter_lib/images/icon_shop_car.png b/flutter_lib/images/icon_shop_car.png
new file mode 100644
index 0000000..95b9e5c
Binary files /dev/null and b/flutter_lib/images/icon_shop_car.png differ
diff --git a/flutter_lib/images/icon_shoucang.png b/flutter_lib/images/icon_shoucang.png
new file mode 100644
index 0000000..f6c9dfa
Binary files /dev/null and b/flutter_lib/images/icon_shoucang.png differ
diff --git a/flutter_lib/images/icon_vip.png b/flutter_lib/images/icon_vip.png
new file mode 100644
index 0000000..fec474b
Binary files /dev/null and b/flutter_lib/images/icon_vip.png differ
diff --git a/flutter_lib/images/icon_vip_bg.png b/flutter_lib/images/icon_vip_bg.png
new file mode 100644
index 0000000..2bbd7b2
Binary files /dev/null and b/flutter_lib/images/icon_vip_bg.png differ
diff --git a/flutter_lib/images/icon_vip_crown.png b/flutter_lib/images/icon_vip_crown.png
new file mode 100644
index 0000000..5a70e1b
Binary files /dev/null and b/flutter_lib/images/icon_vip_crown.png differ
diff --git a/flutter_lib/images/net_error.png b/flutter_lib/images/net_error.png
new file mode 100644
index 0000000..892cc45
Binary files /dev/null and b/flutter_lib/images/net_error.png differ
diff --git a/flutter_lib/images/no_cart.png b/flutter_lib/images/no_cart.png
new file mode 100644
index 0000000..92c04f4
Binary files /dev/null and b/flutter_lib/images/no_cart.png differ
diff --git a/flutter_lib/images/no_msg.png b/flutter_lib/images/no_msg.png
new file mode 100644
index 0000000..2fcd916
Binary files /dev/null and b/flutter_lib/images/no_msg.png differ
diff --git a/flutter_lib/images/no_order.png b/flutter_lib/images/no_order.png
new file mode 100644
index 0000000..b0b0107
Binary files /dev/null and b/flutter_lib/images/no_order.png differ
diff --git a/flutter_lib/images/no_search_result.png b/flutter_lib/images/no_search_result.png
new file mode 100644
index 0000000..17c6d79
Binary files /dev/null and b/flutter_lib/images/no_search_result.png differ
diff --git a/flutter_lib/images/placeholder.png b/flutter_lib/images/placeholder.png
new file mode 100644
index 0000000..af99fc7
Binary files /dev/null and b/flutter_lib/images/placeholder.png differ
diff --git a/flutter_lib/images/user_icon.png b/flutter_lib/images/user_icon.png
old mode 100755
new mode 100644
diff --git a/flutter_lib/lib/bridge/account_bridge.dart b/flutter_lib/lib/bridge/account_bridge.dart
index 2821b2b..f225eae 100644
--- a/flutter_lib/lib/bridge/account_bridge.dart
+++ b/flutter_lib/lib/bridge/account_bridge.dart
@@ -101,4 +101,23 @@ class AccountBridge {
}
});
}
+
+
+ /*
+ * 绑定用户信息
+ */
+ static Future logout() {
+ return Bridge.dispenser({
+ "method": "logout",
+ "params": {
+ "action": component,
+ "arguments": {
+ "method": "logout",
+ "data": {
+ "token":"token"
+ },
+ }
+ }
+ });
+ }
}
diff --git a/flutter_lib/lib/bridge/address_bridge.dart b/flutter_lib/lib/bridge/address_bridge.dart
index 6fbd716..2c046d9 100644
--- a/flutter_lib/lib/bridge/address_bridge.dart
+++ b/flutter_lib/lib/bridge/address_bridge.dart
@@ -1,5 +1,8 @@
+import 'dart:convert';
+
import 'package:flutter_lib/bridge/common_bridge.dart';
import 'package:flutter_lib/model/Result.dart';
+import 'package:flutter_lib/model/address.dart';
class AddressBridge {
static const String component = "address";
@@ -13,18 +16,19 @@ class AddressBridge {
*/
static Future addAddress(String receivePhone, String receiveGoodsName,
String receiveAddressName, int status) {
+ Address adss = new Address();
+ adss.phone = receivePhone;
+ adss.name = receiveGoodsName;
+ adss.address = receiveAddressName;
+ adss.status = status;
+
return Bridge.dispenser({
"method": "address_add",
"params": {
"action": component,
"arguments": {
"method": "address_add",
- "data": {
- "receivePhone": receivePhone,
- "receiveGoodsName": receiveGoodsName,
- "receiveAddressName": receiveAddressName,
- "status": status
- },
+ "data": json.encode(adss),
}
}
});
diff --git a/flutter_lib/lib/bridge/cart_bridge.dart b/flutter_lib/lib/bridge/cart_bridge.dart
index 291de88..8a99642 100644
--- a/flutter_lib/lib/bridge/cart_bridge.dart
+++ b/flutter_lib/lib/bridge/cart_bridge.dart
@@ -86,7 +86,8 @@ class CartBridge {
*
*从购物车移除
*/
- static Future delSku(String productId,String skuId, int amount) async {
+ static Future delSku(
+ String productId, String skuId, int amount) async {
// return Result.fromJson(await getCart());
return Bridge.dispenser({
"method": "shop_cart_del",
@@ -94,7 +95,7 @@ class CartBridge {
"action": component,
"arguments": {
"method": "shop_cart_del",
- "data": {"productId":productId,"skuId": skuId, "distinct": amount}
+ "data": {"productId": productId, "skuId": skuId, "distinct": amount}
}
}
});
@@ -104,7 +105,8 @@ class CartBridge {
*
*从购物车数量添加
*/
- static Future addSkuAmount(String productId,String skuId, int amount) async {
+ static Future addSkuAmount(
+ String productId, String skuId, int amount) async {
// return Result.fromJson(await getCart());
return Bridge.dispenser({
"method": "shop_cart_addAmount",
@@ -112,7 +114,7 @@ class CartBridge {
"action": component,
"arguments": {
"method": "shop_cart_addAmount",
- "data": {"productId":productId,"skuId": skuId, "distinct": amount}
+ "data": {"productId": productId, "skuId": skuId, "distinct": amount}
}
}
});
@@ -131,7 +133,100 @@ class CartBridge {
"action": component,
"arguments": {
"method": "shop_cart_findCart",
- "data": {"productId":"xxx",}
+ "data": {
+ "productId": "xxx",
+ }
+ }
+ }
+ });
+ }
+
+ /*
+ *
+ *添加数据至下单列表
+ */
+ static Future addSkuOrder(
+ int productId,
+ String skuId,
+ int amount,
+ double price,
+ double freight,
+ String norms,
+ String name,
+ String url) async {
+// //todo "data": json.encode 待测试
+// String data = await getCart();
+// return Result.fromJson(data);
+ return Bridge.dispenser({
+ "method": "shop_cart_order_add",
+ "params": {
+ "action": component,
+ "arguments": {
+ "method": "shop_cart_order_add",
+ "data": json.encode({
+ "productId": productId,
+ "goodsId": skuId,
+ "amount": amount,
+ "price": price,
+ "freight": freight,
+ "norms": norms,
+ "name": name,
+ "img": url,
+ }),
+ },
+ }
+ });
+ }
+
+ /*
+ *
+ *获取购物车信息
+ */
+ static Future findOrderNow() async {
+// return Result.fromJson(await getCart());
+
+ return Bridge.dispenser({
+ "method": "shop_cart_order_find",
+ "params": {
+ "action": component,
+ "arguments": {
+ "method": "shop_cart_order_find",
+ "data": {
+ "productId": "xxx",
+ }
+ }
+ }
+ });
+ }
+
+ /*
+ *
+ *获取购物车信息
+ */
+ static Future syschrizonCart(String cardJson) async {
+ return Bridge.dispenser({
+ "method": "shop_cart_order_sys",
+ "params": {
+ "action": component,
+ "arguments": {"method": "shop_cart_order_sys", "data": cardJson}
+ }
+ });
+ }
+
+ /*
+ *
+ *获取购物车信息
+ */
+ static Future clearOrderNow() async {
+ return Bridge.dispenser({
+ "method": "shop_cart_order_clear",
+ "params": {
+ "action": component,
+ "arguments": {
+ "method": "shop_cart_order_clear",
+ "data": {
+ "productId": "xxx",
+ }
}
}
});
diff --git a/flutter_lib/lib/bridge/category_bridge.dart b/flutter_lib/lib/bridge/category_bridge.dart
index 7186949..9f69174 100644
--- a/flutter_lib/lib/bridge/category_bridge.dart
+++ b/flutter_lib/lib/bridge/category_bridge.dart
@@ -1,8 +1,6 @@
import 'dart:async' show Future;
-import 'dart:convert';
import 'package:flutter_lib/bridge/common_bridge.dart';
-import 'package:flutter_lib/logic/viewmodel/category_view_model.dart';
import 'package:flutter_lib/model/Result.dart';
class CategoryBridge {
@@ -12,13 +10,6 @@ class CategoryBridge {
*获取产品列表
*/
static Future getCategories() async {
-// String data = await CategoryViewModel.distest();
-// if (data != null) {
-// print("bridge result:" + data);
-// return Result.fromJson(data);
-// }
-// return Result.fromJson(json.encode({"code": -1, "msg": "无结果"}));
-// todo 接口通了后使用下面的方法替换上面的假数据
return Bridge.dispenser({
"method": "root",
"params": {
@@ -37,12 +28,6 @@ class CategoryBridge {
*获取产品列表
*/
static Future getSubCategories( categoryId) async {
-// String data = await CategoryViewModel.distest1();
-// if (data != null) {
-// print("bridge result:" + data);
-// return Result.fromJson(data);
-// }
-// return Result.fromJson(json.encode({"code": -1, "msg": "无结果"}));
return Bridge.dispenser({
"method": "sub",
"params": {
diff --git a/flutter_lib/lib/bridge/common_bridge.dart b/flutter_lib/lib/bridge/common_bridge.dart
index 4ac9b35..c3fab5f 100644
--- a/flutter_lib/lib/bridge/common_bridge.dart
+++ b/flutter_lib/lib/bridge/common_bridge.dart
@@ -1,5 +1,6 @@
import 'dart:convert';
+import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_lib/model/Result.dart';
@@ -7,19 +8,62 @@ class Bridge {
static const _bridgePlatform =
const MethodChannel("com.ym.framework.plugins/bridge");
+ static BuildContext context;
+
static Future dispenser(var dispenser) async {
String method = dispenser['method'];
var params = dispenser['params'];
print(method);
print(params);
- String data = await _bridgePlatform.invokeMethod(method, params);
- if (data != null) {
- print("bridge result:" + data);
- return Result.fromJson(data);
+ Result result;
+ try {
+ String data = await _bridgePlatform.invokeMethod(method, params);
+
+ if (data != null) {
+ print("bridge result:" + data);
+ result = Result.fromJson(data);
+ } else {
+ result = Result.fromJson(json.encode({"code": -1, "msg": "无结果"}));
+ }
+ } catch (e) {
+ result = Result.fromJson(json.encode({"code": -1, "msg": e.toString()}));
+ }
+ return result;
+ }
+
+ static webview(String url) {
+ if (url == null || url.isEmpty) {
+ return;
}
- return Result.fromJson(json.encode({"code": -1, "msg": "无结果"}));
+ url = "" + url;
+ url = url.replaceAll(" ", "");
+ dispenser({
+ "method": "webview",
+ "params": json.encode({
+ "url": url,
+ }),
+ });
}
+
+ static openQQ(String url) {
+ if (url == null || url.isEmpty) {
+ return;
+ }
+ url = "" + url;
+ url = url.replaceAll(" ", "");
+ dispenser({
+ "method": "openQQ",
+ "params": json.encode({
+ "qq": url,
+ }),
+ });
+ }
+
+
+
+
+
static showShortToast(String message) {
if (message == null || message.isEmpty) {
return;
diff --git a/flutter_lib/lib/bridge/order_bridge.dart b/flutter_lib/lib/bridge/order_bridge.dart
index df61b50..a20bf55 100644
--- a/flutter_lib/lib/bridge/order_bridge.dart
+++ b/flutter_lib/lib/bridge/order_bridge.dart
@@ -2,25 +2,38 @@ import 'dart:async' show Future;
import 'dart:convert';
import 'package:flutter_lib/bridge/common_bridge.dart';
+import 'package:flutter_lib/model/OrderComment.dart';
import 'package:flutter_lib/model/Result.dart';
class OrderBridge {
static const String component = "order";
+ /*
+ *
+ *vip下单
+ */
+ static Future orderVip(int chargeType) async {
+ return Bridge.dispenser({
+ "method": "order_vip",
+ "params": {
+ "action": component,
+ "arguments": {
+ "method": "order_vip",
+ "data": {
+ "chargeType": chargeType,
+ }
+ }
+ }
+ });
+ }
+
+
/*
*
*获取产品列表
*/
static Future submitOrder(
String userAddressId, bool freight, dynamic orderGoods) async {
-// String data = await CategoryViewModel.distest();
-// if (data != null) {
-// print("bridge result:" + data);
-// return Result.fromJson(data);
-// }
-// return Result.fromJson(json.encode({"code": -1, "msg": "无结果"}));
- print(orderGoods);
- print(json.encode(orderGoods));
return Bridge.dispenser({
"method": "order_submit",
"params": {
@@ -36,4 +49,65 @@ class OrderBridge {
}
});
}
+
+ static Future cancelOrder(String orderId) async {
+ return Bridge.dispenser({
+ "method": "order_cancel",
+ "params": {
+ "action": component,
+ "arguments": {
+ "method": "order_cancel",
+ "data": {
+ "orderId": orderId,
+ }
+ }
+ }
+ });
+ }
+
+
+ static Future confirmOrder(String orderId) async {
+ return Bridge.dispenser({
+ "method": "order_confirm",
+ "params": {
+ "action": component,
+ "arguments": {
+ "method": "order_confirm",
+ "data": {
+ "orderId": orderId,
+ }
+ }
+ }
+ });
+ }
+
+ static Future submitComment(OrderComment order) async {
+ return Bridge.dispenser({
+ "method": "order_comment",
+ "params": {
+ "action": component,
+ "arguments": {
+ "method": "order_comment",
+ "data": json.encode(order),
+ }
+ }
+ });
+ }
+
+ static Future orderDetail(String orderId) async {
+ return Bridge.dispenser({
+ "method": "order_detail",
+ "params": {
+ "action": component,
+ "arguments": {
+ "method": "order_detail",
+ "data": {
+ "orderId": orderId,
+ }
+ }
+ }
+ });
+ }
+
+
}
diff --git a/flutter_lib/lib/bridge/product_bridge.dart b/flutter_lib/lib/bridge/product_bridge.dart
index e409382..27ef8d1 100644
--- a/flutter_lib/lib/bridge/product_bridge.dart
+++ b/flutter_lib/lib/bridge/product_bridge.dart
@@ -1,5 +1,3 @@
-import 'dart:convert';
-
import 'package:flutter_lib/bridge/common_bridge.dart';
import 'package:flutter_lib/logic/viewmodel/product_view_model.dart';
import 'package:flutter_lib/model/Result.dart';
@@ -10,21 +8,14 @@ class ProductBridge {
*
*获取产品列表
*/
- static Future getProducts(int categoryId, bool orderBy) async {
-// String data = await distest();
-// if (data != null) {
-// print("bridge result:" + data);
-// return Result.fromJson(data);
-// }
-// return Result.fromJson(json.encode({"code": -1, "msg": "无结果"}));
- //todo 接口通了后使用下面的方法替换上面的假数据
+ static Future getProducts(int categoryId, int orderBy) async {
return Bridge.dispenser({
- "method": "findAll",
+ "method": "product_findAll",
"params": {
"action": component,
"arguments": {
- "method": "findAll",
- "data": {"categoryId": categoryId,"orderBy":orderBy}
+ "method": "product_findAll",
+ "data": {"categoryId": categoryId, "orderBy": orderBy}
}
}
});
@@ -39,42 +30,51 @@ class ProductBridge {
*
*获取产品列表
*/
- static Future queryProduct(String query, bool orderBy) async {
-// String data = await distest();
-// if (data != null) {
-// print("bridge result:" + data);
-// return Result.fromJson(data);
-// }
-// return Result.fromJson(json.encode({"code": -1, "msg": "无结果"}));
- //todo 接口通了后使用下面的方法替换上面的假数据
+ static Future queryProduct(
+ String query, int orderBy, int pageNo, int pageSize) async {
+ String searchQuery = (query == null ? "" : query);
return Bridge.dispenser({
- "method": "queryProduct",
+ "method": "product_search_list",
"params": {
"action": component,
"arguments": {
- "method": "queryProduct",
- "data": {"query": query,"orderBy":orderBy}
+ "method": "product_search_list",
+ "data": {
+ "keywold": searchQuery,
+ "pageNo": pageNo,
+ "pageSize": pageSize
+ }
}
}
});
}
static Future getProduct(int productId) async {
-// String data = await distest();
-// if (data != null) {
-// print("bridge result:" + data);
-// return Result.fromJson(data);
-// }
-
return Bridge.dispenser({
- "method": "detail",
+ "method": "product_detail",
"params": {
"action": component,
"arguments": {
- "method": "detail",
+ "method": "product_detail",
"data": {"productId": productId}
}
}
});
}
+
+ /*
+ * 获取feature模块
+ */
+ static Future getFeature(int pageNo, int pageSize) async {
+ return Bridge.dispenser({
+ "method": "product_search_list",
+ "params": {
+ "action": component,
+ "arguments": {
+ "method": "product_feature_search",
+ "data": {"pageNo": pageNo, "pageSize": pageSize}
+ }
+ }
+ });
+ }
}
diff --git a/flutter_lib/lib/logic/bloc/address_bloc.dart b/flutter_lib/lib/logic/bloc/address_bloc.dart
index 0088f7d..cafb364 100644
--- a/flutter_lib/lib/logic/bloc/address_bloc.dart
+++ b/flutter_lib/lib/logic/bloc/address_bloc.dart
@@ -1,9 +1,10 @@
import 'dart:async';
+import 'package:flutter/widgets.dart';
import 'package:flutter_lib/bridge/address_bridge.dart';
-import 'package:flutter_lib/bridge/common_bridge.dart';
import 'package:flutter_lib/model/address.dart';
import 'package:flutter_lib/model/addresslist.dart';
+import 'package:flutter_lib/utils/BristuaRouter.dart';
class AddressBloc {
final addressController = StreamController>();
@@ -14,13 +15,16 @@ class AddressBloc {
AddressBloc();
- getAddressList() {
+ getAddressList(BuildContext context) {
AddressBridge.findAddress(1, 2000).then((result) {
if (result.code == 200) {
AddressList categoryList = AddressList.fromJson(result.data);
addressController.add(categoryList.list);
} else {
- Bridge.showLongToast(result.msg == null ? "未返回错误信息" : result.msg);
+ print(result.msg == null ? "未返回错误信息" : result.msg);
+ if (result.code == 401) {
+ BristuaRouter.routerUserLogin(context);
+ }
addressController.add(List());
}
});
diff --git a/flutter_lib/lib/logic/bloc/cart_bloc.dart b/flutter_lib/lib/logic/bloc/cart_bloc.dart
index 29ffa01..22ae225 100644
--- a/flutter_lib/lib/logic/bloc/cart_bloc.dart
+++ b/flutter_lib/lib/logic/bloc/cart_bloc.dart
@@ -1,7 +1,6 @@
import 'dart:async';
import 'package:flutter_lib/bridge/cart_bridge.dart';
-import 'package:flutter_lib/bridge/common_bridge.dart';
import 'package:flutter_lib/model/Result.dart';
import 'package:flutter_lib/model/cart.dart';
@@ -23,7 +22,8 @@ class CartBloc {
Cart categoryList = Cart.fromJson(result.data);
cartController.add(categoryList);
} else {
- Bridge.showLongToast(result.msg);
+ cartController.add(null);
+ print(result.msg == null ? "未返回错误信息" : result.msg);
}
});
}
@@ -40,7 +40,36 @@ class CartBloc {
cartController.add(categoryList);
}
} else {
- Bridge.showLongToast(result.msg);
+ cartController.addError(result);
+ print(result.msg == null ? "未返回错误信息" : result.msg);
+ }
+ });
+ }
+
+ findOrderNow() {
+ Future future = CartBridge.findOrderNow();
+ future.then((result) {
+ if (result.code == 200) {
+ if (result.data != null && result.data is Map) {
+ Cart categoryList = Cart.fromJson(result.data);
+ cartController.add(categoryList);
+ } else {
+ Cart categoryList = new Cart(totalCounts: 0);
+ cartController.add(categoryList);
+ }
+ } else {
+ cartController.addError(result);
+ print(result.msg == null ? "未返回错误信息" : result.msg);
+ }
+ });
+ }
+
+ clearOrderNow() {
+ Future future = CartBridge.clearOrderNow();
+ future.then((result) {
+ if (result.code == 200) {
+ } else {
+ print(result.msg == null ? "未返回错误信息" : result.msg);
}
});
}
@@ -53,20 +82,20 @@ class CartBloc {
Cart categoryList = Cart.fromJson(result.data);
cartController.add(categoryList);
} else {
- Bridge.showLongToast(result.msg);
+ print(result.msg == null ? "未返回错误信息" : result.msg);
}
});
}
addSkuAmount(SkuWapper sku, int amount) {
Future future =
- CartBridge.delSku(sku.sku.productId, sku.goodsId, amount);
+ CartBridge.addSkuAmount(sku.sku.productId, sku.goodsId, amount);
future.then((result) {
if (result.code == 200) {
Cart categoryList = Cart.fromJson(result.data);
cartController.add(categoryList);
} else {
- Bridge.showLongToast(result.msg);
+ print(result.msg == null ? "未返回错误信息" : result.msg);
}
});
}
diff --git a/flutter_lib/lib/logic/bloc/category_bloc.dart b/flutter_lib/lib/logic/bloc/category_bloc.dart
index 9a6ca29..db7193a 100644
--- a/flutter_lib/lib/logic/bloc/category_bloc.dart
+++ b/flutter_lib/lib/logic/bloc/category_bloc.dart
@@ -34,11 +34,11 @@ class CategoryBloc {
categoryController.add(categoryViewModel.categorysItems);
print("getCategories add");
} else {
- Bridge.showLongToast(result.msg == null ? "未返回错误信息" : result.msg);
+ print(result.msg == null ? "未返回错误信息" : result.msg);
if (categoryController.isClosed || categoryController.isPaused) {
return;
}
- categoryController.add(List());
+ categoryController.addError(result);
}
});
}
@@ -51,11 +51,11 @@ class CategoryBloc {
subCategoryController.add(subCategoryList.list);
print("getSubCategories add");
} else {
- Bridge.showLongToast(result.msg == null ? "未返回错误信息" : result.msg);
+ print(result.msg == null ? "未返回错误信息" : result.msg);
if (subCategoryController.isClosed || subCategoryController.isPaused) {
return;
}
- subCategoryController.add(List());
+ subCategoryController.addError(result);
}
});
}
diff --git a/flutter_lib/lib/logic/bloc/home_bloc.dart b/flutter_lib/lib/logic/bloc/home_bloc.dart
new file mode 100644
index 0000000..fa2f46a
--- /dev/null
+++ b/flutter_lib/lib/logic/bloc/home_bloc.dart
@@ -0,0 +1,101 @@
+import 'dart:async';
+
+import 'package:flutter_lib/model/Banner.dart';
+import 'package:flutter_lib/model/HomeCategory.dart';
+import 'package:flutter_lib/model/Result.dart';
+import 'package:flutter_lib/model/promotion.dart';
+import 'package:flutter_lib/model/special.dart';
+import 'package:flutter_lib/utils/http.dart';
+
+class HomeBloc {
+ final tabController = StreamController>.broadcast();
+ final homeCategoryController =
+ StreamController>.broadcast();
+
+ Stream> get tabItems => tabController.stream;
+
+ Stream> get homeCategory => homeCategoryController.stream;
+
+ HomeBloc() {}
+
+ List v;
+ getImages() async {
+ if (v != null && v.isNotEmpty) {
+ tabController.add(v);
+ } else {
+ Result result = await Http.getBanner();
+ if (result != null && result.code == 0) {
+ dynamic data = result.data;
+ List l = data["list"];
+ List c = l.map((f) {
+ return DataListBean.fromJson(f);
+ }).toList();
+ print(data);
+ if (v == null || v.isEmpty) {
+ v = c;
+ }
+ tabController.add(v);
+ } else {
+ tabController.addError(result);
+ }
+ }
+ }
+
+ getHomeCategoryList() async {
+ Result result = await Http.getHomeCategoryList();
+ if (result != null && result.code == 0) {
+ dynamic data = result.data;
+ List l = data["list"];
+ List c = l.map((f) {
+ return HomeCategory.fromJson(f);
+ }).toList();
+ print(data);
+ homeCategoryController.add(c);
+ } else {
+ homeCategoryController.addError(result);
+ }
+ }
+
+ final promotionController = StreamController>.broadcast();
+ Stream> get promotions => promotionController.stream;
+
+ getPromotion() async {
+ Result result = await Http.getPromotion();
+ if (result != null && result.code == 0) {
+ dynamic data = result.data;
+ List l = data["list"];
+ List c = l.map((f) {
+ return Promotion.fromJson(f);
+ }).toList();
+ print(data);
+ promotionController.add(c);
+ } else {
+ promotionController.addError(result);
+ }
+ }
+
+ final specialController = StreamController>.broadcast();
+ Stream> get specials => specialController.stream;
+
+ getSpecial() async {
+ Result result = await Http.getSpecial();
+ if (result != null && result.code == 0) {
+ dynamic data = result.data;
+ List l = data["list"];
+ List c = l.map((f) {
+ return Special.fromJson(f);
+ }).toList();
+ print(data);
+ specialController.add(c);
+ } else {
+ specialController.addError(result);
+ }
+ }
+
+ getHomeAll() {
+ getImages();
+ getHomeCategoryList();
+ getPromotion();
+ getSpecial();
+ }
+}
diff --git a/flutter_lib/lib/logic/bloc/oder_list_bloc.dart b/flutter_lib/lib/logic/bloc/oder_list_bloc.dart
index 0f4735d..a7ed994 100644
--- a/flutter_lib/lib/logic/bloc/oder_list_bloc.dart
+++ b/flutter_lib/lib/logic/bloc/oder_list_bloc.dart
@@ -1,9 +1,12 @@
import 'dart:async';
-import 'package:flutter_lib/bridge/common_bridge.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_lib/bridge/order_bridge.dart';
import 'package:flutter_lib/bridge/order_list_bridge.dart';
import 'package:flutter_lib/model/orderListItem.dart';
+import 'package:flutter_lib/model/orderdetail.dart';
import 'package:flutter_lib/model/orderlist.dart';
+import 'package:flutter_lib/utils/BristuaRouter.dart';
class OrderListBloc {
final orderListController = StreamController>.broadcast();
@@ -12,19 +15,45 @@ class OrderListBloc {
return orderListController.stream;
}
+ final orderDetailController = StreamController.broadcast();
+ Stream get orderDetail {
+ return orderDetailController.stream;
+ }
OrderListBloc();
- getOrderListList(int type) {
+ getOrderListList(BuildContext context, int type) {
OrderListBridge.getOrderList(1, 50, type).then((result) {
if (result.code == 200) {
OrderList orderList = OrderList.fromJson(result.data);
orderListController.add(orderList.list);
} else {
- Bridge.showLongToast(result.msg == null ? "未返回错误信息" : result.msg);
- orderListController.add(List());
+ print(result.msg == null ? "未返回错误信息" : result.msg);
+ if (result.code == 401) {
+ //此处需要判断啊,不要认为很简单的
+ //Navigator.pushNamed(context, UIData.login);
+ //
+ BristuaRouter.routerUserLogin(context);
+ }
+ orderListController.addError(result);
}
});
}
+
+ getOrderDetail(String orderId) {
+ OrderBridge.orderDetail(orderId).then((result) {
+ if (result.code == 200) {
+ OrderDetail orderDetail = OrderDetail.fromJson(result.data);
+ orderDetailController.add(orderDetail);
+ } else {
+ print(result.msg == null ? "未返回错误信息" : result.msg);
+ orderDetailController.addError(result);
+ }
+ });
+ }
+
+ void close() {
+ orderListController?.close();
+ }
}
diff --git a/flutter_lib/lib/logic/bloc/product_bloc.dart b/flutter_lib/lib/logic/bloc/product_bloc.dart
index 67e35bf..693edd7 100644
--- a/flutter_lib/lib/logic/bloc/product_bloc.dart
+++ b/flutter_lib/lib/logic/bloc/product_bloc.dart
@@ -1,19 +1,17 @@
import 'dart:async';
-import 'package:flutter_lib/bridge/common_bridge.dart';
import 'package:flutter_lib/bridge/product_bridge.dart';
import 'package:flutter_lib/bridge/sku_bridge.dart';
import 'package:flutter_lib/logic/viewmodel/product_view_model.dart';
import 'package:flutter_lib/model/Result.dart';
import 'package:flutter_lib/model/productdetail.dart';
-
import 'package:flutter_lib/model/productitem.dart';
import 'package:flutter_lib/model/skuinfo.dart';
class ProductBloc {
final ProductViewModel productViewModel = ProductViewModel();
- final productController = StreamController>();
- final productDetaailController = StreamController();
+ final productController = StreamController>.broadcast();
+ final productDetailController = StreamController.broadcast();
final skuInfoController = StreamController.broadcast();
Stream> get productItems {
@@ -21,7 +19,7 @@ class ProductBloc {
}
Stream get productDetail {
- return productDetaailController.stream;
+ return productDetailController.stream;
}
Stream get skuInfo {
@@ -30,26 +28,44 @@ class ProductBloc {
ProductBloc();
- getProducts(int categoryId, bool orderByAes) {
+ getProducts(int categoryId, int orderByAes) {
+ productController.add(null);
ProductBridge.getProducts(categoryId, orderByAes).then((result) {
if (result.code == 200) {
ProductList productList = ProductList.fromJson(result.data);
productController.add(productList.list);
} else {
- Bridge.showLongToast(result.msg);
+ print(result.msg);
+ productController.add(List());
+ }
+ });
+ }
+
+ /*
+ * 获取精选列表的商品
+ */
+ getFeatures(int pageNo, int pageSize) {
+ ProductBridge.getFeature(pageNo, pageSize).then((result) {
+ if (result.code == 200) {
+ ProductList productList = ProductList.fromJson(result.data);
+ productController.add(productList.list);
+ } else {
+ print(result.msg);
+ productController.addError(result);
}
});
}
- queryProducts(String query, bool orderByAes) {
- ProductBridge.queryProduct(query, orderByAes).then((result) {
+ queryProducts(String query, int orderByAes) {
+ ProductBridge.queryProduct(query, orderByAes, 1, 1000).then((result) {
if (result.code == 200) {
productController.add(null);
ProductList productList = ProductList.fromJson(result.data);
productController.add(productList.list);
} else {
- Bridge.showLongToast(result.msg);
+ print(result.msg);
+ productController.addError(result);
}
});
}
@@ -59,12 +75,11 @@ class ProductBloc {
Result result = await ProductBridge.getProduct(productId);
if (result.code == 200) {
Productdetail productList = Productdetail.fromJson(result.data);
- productDetaailController.add(productList.list[0]);
+ productDetailController.add(productList.list[0]);
print("getProduct add");
-
} else {
- Bridge.showLongToast(result.msg);
- productDetaailController.add(null);
+ print(result.msg);
+ productDetailController.add(ProductDetail.N(""));
}
}
@@ -77,8 +92,8 @@ class ProductBloc {
skuInfoController.add(productList);
print("getProduct sku add");
} else {
- Bridge.showLongToast(result.msg);
- skuInfoController.add(null);
+ print(result.msg);
+ skuInfoController.addError(result);
}
});
}
diff --git a/flutter_lib/lib/logic/bloc/rebate_bloc.dart b/flutter_lib/lib/logic/bloc/rebate_bloc.dart
index 21ce39b..ac6235b 100644
--- a/flutter_lib/lib/logic/bloc/rebate_bloc.dart
+++ b/flutter_lib/lib/logic/bloc/rebate_bloc.dart
@@ -1,5 +1,5 @@
import 'dart:async';
-import 'package:flutter_lib/bridge/common_bridge.dart';
+
import 'package:flutter_lib/bridge/rebate_bridge.dart';
import 'package:flutter_lib/model/rebateList.dart';
@@ -17,7 +17,8 @@ class RebateBloc {
RebateList rebateList = RebateList.fromJson(result.data);
rebateStream.add(rebateList.list);
} else {
- Bridge.showLongToast(result.msg == null ? "未返回错误信息" : result.msg);
+ print(result.msg);
+ rebateStream.add(List());
}
});
}
diff --git a/flutter_lib/lib/logic/bloc/userinfo_bloc.dart b/flutter_lib/lib/logic/bloc/userinfo_bloc.dart
index d5e5b3f..cf79035 100644
--- a/flutter_lib/lib/logic/bloc/userinfo_bloc.dart
+++ b/flutter_lib/lib/logic/bloc/userinfo_bloc.dart
@@ -18,7 +18,8 @@ class UserInfoBloc {
Userinfo userinfo = Userinfo.fromJson(result.data);
userInfoStream.add(userinfo);
} else {
-// Bridge.showLongToast(result.msg == null ? "未返回错误信息" : result.msg);
+ print(result.msg);
+ userInfoStream.add(Userinfo());
}
});
}
diff --git a/flutter_lib/lib/logic/viewmodel/homeitem_view_model.dart b/flutter_lib/lib/logic/viewmodel/homeitem_view_model.dart
index b04d8cb..23ca8c2 100644
--- a/flutter_lib/lib/logic/viewmodel/homeitem_view_model.dart
+++ b/flutter_lib/lib/logic/viewmodel/homeitem_view_model.dart
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_lib/model/homeitem.dart';
-import 'package:flutter_lib/utils/uidata.dart';
import 'package:flutter_lib/model/userinfo.dart';
+import 'package:flutter_lib/utils/uidata.dart';
class HomeItemViewModel {
List rankList;
@@ -9,52 +9,55 @@ class HomeItemViewModel {
HomeItemViewModel({this.rankList});
getMenuItems(Userinfo userInfo) {
-
return rankList = [
+// HomeItem(
+// icon: "images/vip.png",
+// title: "成为VIP",
+// subTitle: "邀请返利不限量",
+// arrowIcon:Icons.arrow_forward_ios,
+// action: UIData.OrderDetailPage),
HomeItem(
- icon: "images/vip.png",
- title: "成为VIP",
- subTitle: "邀请返利不限量",
- arrowIcon:Icons.arrow_forward_ios,
- action: UIData.OrderDetailPage),
+ icon: "images/invite.png",
+ title: "邀请好友赢返利 ",
+ subTitle: "邀请好友赢返利 ",
+ arrowIcon: Icons.arrow_forward_ios,
+ action: UIData.IviteFriendsPage,
+ ),
HomeItem(
- icon: "images/invite.png",
- title: "邀请好友赢返利 ",
- subTitle: "邀请好友赢返利 ",
- arrowIcon:Icons.arrow_forward_ios,
- action: UIData.IviteFriendsPage,
- ),
- HomeItem(
- icon: "images/coin.png",
- title: "我的金币",
- subTitle: "累计"+(userInfo==null?"0":userInfo.balanceAmt)+"个",
- arrowIcon:Icons.arrow_forward_ios,),
+ icon: "images/coin.png",
+ title: "我的金币",
+ subTitle: "累计" +
+ (userInfo == null || userInfo.balanceAmt == null
+ ? "0"
+ : userInfo.balanceAmt) +
+ "个",
+ arrowIcon: Icons.arrow_forward_ios,
+ ),
HomeItem(
- icon: "images/invite_code.png",
+ icon: "images/invite_code.png",
title: "输入邀请码",
subTitle: "",
- arrowIcon:Icons.arrow_forward_ios,
+ arrowIcon: Icons.arrow_forward_ios,
action: UIData.InviteInputPage),
HomeItem(
- icon: "images/favor.png",
+ icon: "images/favor.png",
title: "我的收藏",
subTitle: "",
- arrowIcon:Icons.arrow_forward_ios,
+ arrowIcon: Icons.arrow_forward_ios,
action: UIData.MineCollectionPage),
HomeItem(
- icon: "images/setting.png",
+ icon: "images/setting.png",
title: "设置中心",
subTitle: "",
- arrowIcon:Icons.arrow_forward_ios),
+ arrowIcon: Icons.arrow_forward_ios),
HomeItem(
- icon: "images/logout.png",
+ icon: "images/logout.png",
title: "退出登录",
subTitle: "",
- arrowIcon:Icons.arrow_forward_ios),
-
+ arrowIcon: Icons.arrow_forward_ios),
];
}
}
diff --git a/flutter_lib/lib/logic/viewmodel/product_view_model.dart b/flutter_lib/lib/logic/viewmodel/product_view_model.dart
index bb163f7..14e135b 100644
--- a/flutter_lib/lib/logic/viewmodel/product_view_model.dart
+++ b/flutter_lib/lib/logic/viewmodel/product_view_model.dart
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_lib/bridge/product_bridge.dart';
import 'package:flutter_lib/model/Result.dart';
import 'package:flutter_lib/model/address.dart';
-import 'package:flutter_lib/model/orderDetail.dart';
+import 'package:flutter_lib/model/orderdetail.dart';
import 'package:flutter_lib/model/product.dart';
import 'dart:convert';
@@ -435,139 +435,139 @@ class ProductViewModel {
size: [37, 40, 41],
color: ["红色", "黑色", "蓝色"])
];
-
- List getOrderDetailList() {
- List orderList = new List();
- OrderDetail orderDetail = new OrderDetail();
- orderDetail.status = 2;
- orderDetail.express = "离开【太原中心】,下一站【广州中心】";
- Address address = new Address();
- address.name = "王大锤";
- address.phone = "12345678901";
- address.address = "四川省成都市金牛区西雅图";
- orderDetail.address = address;
- orderDetail.products = ProductViewModel().getOderDetailProducts();
- orderDetail.orderNumber = "2539129895";
- orderDetail.orderTime = "2018.12.22 09:32";
- orderDetail.payMode = "支付宝";
- orderDetail.productTotal = 195.00;
- orderDetail.freight = 12.00;
- orderDetail.payPrice = 165.00;
- orderList.add(orderDetail);
- OrderDetail orderDetail1 = new OrderDetail();
- orderDetail1.status = 1;
- orderDetail1.express = "离开【太原中心】,下一站【广州中心】";
- address = new Address();
- address.name = "王大锤";
- address.phone = "12345678901";
- address.address = "四川省成都市金牛区西雅图";
- orderDetail1.address = address;
- orderDetail1.products = [
- new Product(
- name: "大moss 露肩性感裹胸内衣打底韩版外穿针织黑色抹胸上衣女无肩带",
- image:
- "https://gd1.alicdn.com/imgextra/i1/173752284/O1CN01a8IsUi1Sk774g4TgD_!!173752284.jpg",
- price: "¥59.00",
- brand: "MAI PIÙ SENZA",
- description: "Awesome Heels",
- rating: 4.1,
- totalReviews: 22,
- size: [37, 40, 41],
- color: ["红色", "黑色", "蓝色"])
- ];
- orderDetail1.orderNumber = "2539129895";
- orderDetail1.orderTime = "2018.12.22 09:32";
- orderDetail1.payMode = "支付宝";
- orderDetail1.productTotal = 195.00;
- orderDetail1.freight = 12.00;
- orderDetail1.payPrice = 165.00;
- orderList.add(orderDetail1);
- OrderDetail orderDetail2 = new OrderDetail();
- orderDetail2.status = 0;
- orderDetail2.express = "离开【太原中心】,下一站【广州中心】";
- address = new Address();
- address.name = "王大锤";
- address.phone = "12345678901";
- address.address = "四川省成都市金牛区西雅图";
- orderDetail2.address = address;
- orderDetail2.products = [
- new Product(
- name: "大moss 露肩性感裹胸内衣打底韩版外穿针织黑色抹胸上衣女无肩带",
- image:
- "https://gd1.alicdn.com/imgextra/i1/173752284/O1CN01a8IsUi1Sk774g4TgD_!!173752284.jpg",
- price: "¥59.00",
- brand: "MAI PIÙ SENZA",
- description: "Awesome Heels",
- rating: 4.1,
- totalReviews: 22,
- size: [37, 40, 41],
- color: ["红色", "黑色", "蓝色"])
- ];
- orderDetail2.orderNumber = "2539129895";
- orderDetail2.orderTime = "2018.12.22 09:32";
- orderDetail2.payMode = "支付宝";
- orderDetail2.productTotal = 195.00;
- orderDetail2.freight = 12.00;
- orderDetail2.payPrice = 165.00;
- orderList.add(orderDetail2);
- OrderDetail orderDetail3 = new OrderDetail();
- orderDetail3.status = 3;
- orderDetail3.express = "离开【太原中心】,下一站【广州中心】";
- address = new Address();
- address.name = "王大锤";
- address.phone = "12345678901";
- address.address = "四川省成都市金牛区西雅图";
- orderDetail3.address = address;
- orderDetail3.products = [
- new Product(
- name: "性感女仆情趣内衣服小胸激情套装血滴子透视开档紧身夜店制服诱惑",
- image:
- "https://gd3.alicdn.com/imgextra/i3/2873137436/TB2R7juDeySBuNjy1zdXXXPxFXa_!!2873137436.jpg",
- price: "¥38.00",
- brand: "MAI PIÙ SENZA",
- description: "Awesome Heels",
- rating: 4.1,
- totalReviews: 22,
- size: [37, 40, 41],
- color: ["红色", "黑色", "蓝色"])
- ];
- orderDetail3.orderNumber = "2539129895";
- orderDetail3.orderTime = "2018.12.22 09:32";
- orderDetail3.payMode = "支付宝";
- orderDetail3.productTotal = 195.00;
- orderDetail3.freight = 12.00;
- orderDetail3.payPrice = 165.00;
- orderList.add(orderDetail3);
- OrderDetail orderDetail4 = new OrderDetail();
- orderDetail4.status = 4;
- orderDetail4.express = "离开【太原中心】,下一站【广州中心】";
- address = new Address();
- address.name = "王大锤";
- address.phone = "12345678901";
- address.address = "四川省成都市金牛区西雅图";
- orderDetail4.address = address;
- orderDetail4.products = [
- new Product(
- name: "jk学生制服女套装软妹服装内衣情趣水手服性感骚短可爱学生妹女装",
- image:
- "https://gd1.alicdn.com/imgextra/i4/842112630/TB2HDRvjb1YBuNjSszeXXablFXa_!!842112630.jpg",
- price: "¥89.00",
- brand: "MAI PIÙ SENZA",
- description: "Awesome Heels",
- rating: 4.1,
- totalReviews: 22,
- size: [37, 40, 41],
- color: ["红色", "黑色", "蓝色"])
- ];
- orderDetail4.orderNumber = "2539129895";
- orderDetail4.orderTime = "2018.12.22 09:32";
- orderDetail4.payMode = "支付宝";
- orderDetail4.productTotal = 195.00;
- orderDetail4.freight = 12.00;
- orderDetail4.payPrice = 165.00;
- orderList.add(orderDetail4);
- return orderList;
- }
+//
+// List getOrderDetailList() {
+// List orderList = new List();
+// OrderDetail orderDetail = new OrderDetail();
+// orderDetail.status = 2;
+// orderDetail.express = "离开【太原中心】,下一站【广州中心】";
+// Address address = new Address();
+// address.name = "王大锤";
+// address.phone = "12345678901";
+// address.address = "四川省成都市金牛区西雅图";
+// orderDetail.address = address;
+// orderDetail.products = ProductViewModel().getOderDetailProducts();
+// orderDetail.orderNumber = "2539129895";
+// orderDetail.orderTime = "2018.12.22 09:32";
+// orderDetail.payMode = "支付宝";
+// orderDetail.productTotal = 195.00;
+// orderDetail.freight = 12.00;
+// orderDetail.payPrice = 165.00;
+// orderList.add(orderDetail);
+// OrderDetail orderDetail1 = new OrderDetail();
+// orderDetail1.status = 1;
+// orderDetail1.express = "离开【太原中心】,下一站【广州中心】";
+// address = new Address();
+// address.name = "王大锤";
+// address.phone = "12345678901";
+// address.address = "四川省成都市金牛区西雅图";
+// orderDetail1.address = address;
+// orderDetail1.products = [
+// new Product(
+// name: "大moss 露肩性感裹胸内衣打底韩版外穿针织黑色抹胸上衣女无肩带",
+// image:
+// "https://gd1.alicdn.com/imgextra/i1/173752284/O1CN01a8IsUi1Sk774g4TgD_!!173752284.jpg",
+// price: "¥59.00",
+// brand: "MAI PIÙ SENZA",
+// description: "Awesome Heels",
+// rating: 4.1,
+// totalReviews: 22,
+// size: [37, 40, 41],
+// color: ["红色", "黑色", "蓝色"])
+// ];
+// orderDetail1.orderNumber = "2539129895";
+// orderDetail1.orderTime = "2018.12.22 09:32";
+// orderDetail1.payMode = "支付宝";
+// orderDetail1.productTotal = 195.00;
+// orderDetail1.freight = 12.00;
+// orderDetail1.payPrice = 165.00;
+// orderList.add(orderDetail1);
+// OrderDetail orderDetail2 = new OrderDetail();
+// orderDetail2.status = 0;
+// orderDetail2.express = "离开【太原中心】,下一站【广州中心】";
+// address = new Address();
+// address.name = "王大锤";
+// address.phone = "12345678901";
+// address.address = "四川省成都市金牛区西雅图";
+// orderDetail2.address = address;
+// orderDetail2.products = [
+// new Product(
+// name: "大moss 露肩性感裹胸内衣打底韩版外穿针织黑色抹胸上衣女无肩带",
+// image:
+// "https://gd1.alicdn.com/imgextra/i1/173752284/O1CN01a8IsUi1Sk774g4TgD_!!173752284.jpg",
+// price: "¥59.00",
+// brand: "MAI PIÙ SENZA",
+// description: "Awesome Heels",
+// rating: 4.1,
+// totalReviews: 22,
+// size: [37, 40, 41],
+// color: ["红色", "黑色", "蓝色"])
+// ];
+// orderDetail2.orderNumber = "2539129895";
+// orderDetail2.orderTime = "2018.12.22 09:32";
+// orderDetail2.payMode = "支付宝";
+// orderDetail2.productTotal = 195.00;
+// orderDetail2.freight = 12.00;
+// orderDetail2.payPrice = 165.00;
+// orderList.add(orderDetail2);
+// OrderDetail orderDetail3 = new OrderDetail();
+// orderDetail3.status = 3;
+// orderDetail3.express = "离开【太原中心】,下一站【广州中心】";
+// address = new Address();
+// address.name = "王大锤";
+// address.phone = "12345678901";
+// address.address = "四川省成都市金牛区西雅图";
+// orderDetail3.address = address;
+// orderDetail3.products = [
+// new Product(
+// name: "性感女仆情趣内衣服小胸激情套装血滴子透视开档紧身夜店制服诱惑",
+// image:
+// "https://gd3.alicdn.com/imgextra/i3/2873137436/TB2R7juDeySBuNjy1zdXXXPxFXa_!!2873137436.jpg",
+// price: "¥38.00",
+// brand: "MAI PIÙ SENZA",
+// description: "Awesome Heels",
+// rating: 4.1,
+// totalReviews: 22,
+// size: [37, 40, 41],
+// color: ["红色", "黑色", "蓝色"])
+// ];
+// orderDetail3.orderNumber = "2539129895";
+// orderDetail3.orderTime = "2018.12.22 09:32";
+// orderDetail3.payMode = "支付宝";
+// orderDetail3.productTotal = 195.00;
+// orderDetail3.freight = 12.00;
+// orderDetail3.payPrice = 165.00;
+// orderList.add(orderDetail3);
+// OrderDetail orderDetail4 = new OrderDetail();
+// orderDetail4.status = 4;
+// orderDetail4.express = "离开【太原中心】,下一站【广州中心】";
+// address = new Address();
+// address.name = "王大锤";
+// address.phone = "12345678901";
+// address.address = "四川省成都市金牛区西雅图";
+// orderDetail4.address = address;
+// orderDetail4.products = [
+// new Product(
+// name: "jk学生制服女套装软妹服装内衣情趣水手服性感骚短可爱学生妹女装",
+// image:
+// "https://gd1.alicdn.com/imgextra/i4/842112630/TB2HDRvjb1YBuNjSszeXXablFXa_!!842112630.jpg",
+// price: "¥89.00",
+// brand: "MAI PIÙ SENZA",
+// description: "Awesome Heels",
+// rating: 4.1,
+// totalReviews: 22,
+// size: [37, 40, 41],
+// color: ["红色", "黑色", "蓝色"])
+// ];
+// orderDetail4.orderNumber = "2539129895";
+// orderDetail4.orderTime = "2018.12.22 09:32";
+// orderDetail4.payMode = "支付宝";
+// orderDetail4.productTotal = 195.00;
+// orderDetail4.freight = 12.00;
+// orderDetail4.payPrice = 165.00;
+// orderList.add(orderDetail4);
+// return orderList;
+// }
getDiscountList() => [
new Product(
diff --git a/flutter_lib/lib/model/Banner.dart b/flutter_lib/lib/model/Banner.dart
new file mode 100644
index 0000000..691a023
--- /dev/null
+++ b/flutter_lib/lib/model/Banner.dart
@@ -0,0 +1,35 @@
+import 'package:flutter_lib/ui/widgets/banner/banner_evalutor.dart';
+
+class DataListBean implements BannerWithEval{
+ String indexImgUrlId;
+ int status;
+ String createTime;
+ String title;
+ int sortNum;
+ String indexImgUrl;
+
+ DataListBean({this.indexImgUrlId, this.status, this.createTime, this.title, this.sortNum, this.indexImgUrl});
+
+ DataListBean.fromJson(Map json) {
+ this.indexImgUrlId = json['indexImgUrlId'];
+ this.status = json['status'];
+ this.createTime = json['createTime'];
+ this.title = json['title'];
+ this.sortNum = json['sortNum'];
+ this.indexImgUrl = json['indexImgUrl'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['indexImgUrlId'] = this.indexImgUrlId;
+ data['status'] = this.status;
+ data['createTime'] = this.createTime;
+ data['title'] = this.title;
+ data['sortNum'] = this.sortNum;
+ data['indexImgUrl'] = this.indexImgUrl;
+ return data;
+ }
+
+ @override
+ get bannerUrl => indexImgUrl;
+}
diff --git a/flutter_lib/lib/model/HomeCategory.dart b/flutter_lib/lib/model/HomeCategory.dart
new file mode 100644
index 0000000..8dba774
--- /dev/null
+++ b/flutter_lib/lib/model/HomeCategory.dart
@@ -0,0 +1,27 @@
+
+import 'package:json_annotation/json_annotation.dart';
+//flutter packages pub run build_runner build
+part 'HomeCategory.g.dart';
+
+@JsonSerializable()
+class HomeCategory {
+ String categoryName;
+
+ String categoryImgUrl;
+
+ int sortNum;
+ String categoryId;
+
+ HomeCategory(
+ this.categoryName, this.categoryImgUrl, this.sortNum, this.categoryId);
+
+ ///
+ factory HomeCategory.fromJson(Map json) => _$HomeCategoryFromJson(json);
+
+ /// `toJson` is the convention for a class to declare support for serialization
+ /// to JSON. The implementation simply calls the private, generated
+ /// helper method `_$CategoryToJson`.
+ Map toJson() => _$HomeCategoryToJson(this);
+
+
+}
diff --git a/flutter_lib/lib/model/HomeCategory.g.dart b/flutter_lib/lib/model/HomeCategory.g.dart
new file mode 100644
index 0000000..d77b05d
--- /dev/null
+++ b/flutter_lib/lib/model/HomeCategory.g.dart
@@ -0,0 +1,23 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'HomeCategory.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+HomeCategory _$HomeCategoryFromJson(Map json) {
+ return HomeCategory(
+ json['categoryName'] as String,
+ json['categoryImgUrl'] as String,
+ json['sortNum'] as int,
+ json['categoryId'] as String);
+}
+
+Map _$HomeCategoryToJson(HomeCategory instance) =>
+ {
+ 'categoryName': instance.categoryName,
+ 'categoryImgUrl': instance.categoryImgUrl,
+ 'sortNum': instance.sortNum,
+ 'categoryId': instance.categoryId
+ };
diff --git a/flutter_lib/lib/model/OrderComment.dart b/flutter_lib/lib/model/OrderComment.dart
new file mode 100644
index 0000000..3d0ec5b
--- /dev/null
+++ b/flutter_lib/lib/model/OrderComment.dart
@@ -0,0 +1,45 @@
+import 'package:json_annotation/json_annotation.dart';
+part 'OrderComment.g.dart';
+//flutter packages pub run build_runner build
+@JsonSerializable()
+class OrderComment {
+ String orderId;
+
+ List goodsEvaluates;
+
+ OrderComment(this.orderId, this.goodsEvaluates);
+
+
+ /// A necessary factory constructor for creating a new Category instance
+ /// from a map. Pass the map to the generated `_$CategoryFromJson()` constructor.
+ /// The constructor is named after the source class, in this case Category.
+ ///
+ factory OrderComment.fromJson(Map json) => _$OrderCommentFromJson(json);
+
+ /// `toJson` is the convention for a class to declare support for serialization
+ /// to JSON. The implementation simply calls the private, generated
+ /// helper method `_$CategoryToJson`.
+ Map toJson() => _$OrderCommentToJson(this);
+
+
+}
+
+@JsonSerializable()
+class Goods {
+ String productId;
+ String content;
+ String level;
+
+ Goods(this.productId, this.content, this.level);
+
+ /// A necessary factory constructor for creating a new Category instance
+ /// from a map. Pass the map to the generated `_$CategoryFromJson()` constructor.
+ /// The constructor is named after the source class, in this case Category.
+ ///
+ factory Goods.fromJson(Map json) => _$GoodsFromJson(json);
+
+ /// `toJson` is the convention for a class to declare support for serialization
+ /// to JSON. The implementation simply calls the private, generated
+ /// helper method `_$CategoryToJson`.
+ Map toJson() => _$GoodsToJson(this);
+}
diff --git a/flutter_lib/lib/model/OrderComment.g.dart b/flutter_lib/lib/model/OrderComment.g.dart
new file mode 100644
index 0000000..6aa3834
--- /dev/null
+++ b/flutter_lib/lib/model/OrderComment.g.dart
@@ -0,0 +1,33 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'OrderComment.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+OrderComment _$OrderCommentFromJson(Map json) {
+ return OrderComment(
+ json['orderId'] as String,
+ (json['goodsEvaluates'] as List)
+ ?.map((e) =>
+ e == null ? null : Goods.fromJson(e as Map))
+ ?.toList());
+}
+
+Map _$OrderCommentToJson(OrderComment instance) =>
+ {
+ 'orderId': instance.orderId,
+ 'goodsEvaluates': instance.goodsEvaluates
+ };
+
+Goods _$GoodsFromJson(Map json) {
+ return Goods(json['productId'] as String, json['content'] as String,
+ json['level'] as String);
+}
+
+Map _$GoodsToJson(Goods instance) => {
+ 'productId': instance.productId,
+ 'content': instance.content,
+ 'level': instance.level
+ };
diff --git a/flutter_lib/lib/model/orderDetail.dart b/flutter_lib/lib/model/orderDetail.dart
deleted file mode 100644
index 09947f2..0000000
--- a/flutter_lib/lib/model/orderDetail.dart
+++ /dev/null
@@ -1,75 +0,0 @@
-import 'package:flutter_lib/model/address.dart';
-import 'package:flutter_lib/model/product.dart';
-
-class OrderDetail {
- int status; //状态 0已取消,1等待发货,2已发货,3已收货,4交易完成
- Address address; //收货地址
- String express; //最新一条物流信息
- List products; //商品信息
- String orderNumber; //订单编号
- String orderTime; //下单时间
- String payMode; //支付方式
- double productTotal; //商品合计(价格)
- double freight; //运费
- double payPrice; //实付款
-
- String getStatusName(){
- switch(status){
- case 0:
- return "已取消";
- case 1:
- return "等待发货";
- case 2:
- return "已发货";
- case 3:
- return "已收货";
- case 4:
- return "交易完成";
- }
- }
-
- String getListStatusName(){
- switch(status){
- case 0:
- return "已取消";
- case 1:
- return "待发货";
- case 2:
- return "已发货";
- case 3:
- return "待评价";
- case 4:
- return "待评价";
- }
- }
-
- String getStatusButtonName(){
- switch(status){
- case 0:
- return "已取消";
- case 1:
- return "取消订单";
- case 2:
- return "查看物流";
- case 3:
- return "申请售后";
- case 4:
- return "申请售后";
- }
- }
-
- String getListStatusButtonName(){
- switch(status){
- case 0:
- return "已取消";
- case 1:
- return "取消订单";
- case 2:
- return "查看物流";
- case 3:
- return "退换货";
- case 4:
- return "退换货";
- }
- }
-}
diff --git a/flutter_lib/lib/model/orderListItem.dart b/flutter_lib/lib/model/orderListItem.dart
index 445e63d..21c135d 100644
--- a/flutter_lib/lib/model/orderListItem.dart
+++ b/flutter_lib/lib/model/orderListItem.dart
@@ -6,7 +6,8 @@ part 'orderListItem.g.dart';
@JsonSerializable()
class OrderItem {
- int status; //1:待付款,2:待发货,3:待收货,4:待评价,0:全部
+// //1:待付款,2:待发货,3:待收货,4:待评价,0:全部
+ int status;
Address address; //收货地址
String express; //最新一条物流信息
@JsonKey(name: 'goodsList')
@@ -53,11 +54,14 @@ class Good {
String goodsId;
String goodsName;
String goodsPrice;
+ String goodsImgUrl;
+ String specMsg;
Good({
this.buyNum,
this.goodsId,
this.goodsName,
this.goodsPrice, //商品信息
+ this.specMsg,
});
factory Good.fromJson(Map json) =>
diff --git a/flutter_lib/lib/model/orderListItem.g.dart b/flutter_lib/lib/model/orderListItem.g.dart
index b8db51c..c687c2e 100644
--- a/flutter_lib/lib/model/orderListItem.g.dart
+++ b/flutter_lib/lib/model/orderListItem.g.dart
@@ -43,12 +43,16 @@ Good _$GoodFromJson(Map json) {
buyNum: json['buyNum'] as String,
goodsId: json['goodsId'] as String,
goodsName: json['goodsName'] as String,
- goodsPrice: json['goodsPrice'] as String);
+ goodsPrice: json['goodsPrice'] as String,
+ specMsg: json['specMsg'] as String)
+ ..goodsImgUrl = json['goodsImgUrl'] as String;
}
Map _$GoodToJson(Good instance) => {
'buyNum': instance.buyNum,
'goodsId': instance.goodsId,
'goodsName': instance.goodsName,
- 'goodsPrice': instance.goodsPrice
+ 'goodsPrice': instance.goodsPrice,
+ 'goodsImgUrl': instance.goodsImgUrl,
+ 'specMsg': instance.specMsg
};
diff --git a/flutter_lib/lib/model/orderdetail.dart b/flutter_lib/lib/model/orderdetail.dart
new file mode 100644
index 0000000..ea16983
--- /dev/null
+++ b/flutter_lib/lib/model/orderdetail.dart
@@ -0,0 +1,169 @@
+import 'package:flutter_lib/bridge/common_bridge.dart';
+import 'package:flutter_lib/bridge/order_bridge.dart';
+import 'package:flutter_lib/model/OrderComment.dart';
+import 'package:flutter_lib/model/Result.dart';
+import 'package:flutter_lib/model/address.dart';
+import 'package:flutter_lib/model/orderListItem.dart';
+import 'package:json_annotation/json_annotation.dart';
+
+part 'orderdetail.g.dart';
+
+//{createTime: 2019-04-30 16:46:33,
+// freight: 0,
+// goods: [{allGoodsPrice: 1,
+// buyNum: 1,
+// goodsId: 100,
+// goodsName: Hawt Like a Habanero Shirt (Men's),
+// goodsPrice: 1,
+// specMsg: SIZE:S}],
+// orderId: 1556642793767000,
+// orderPrice: 1,
+// payFee: 0, payType: 0,
+// receiveGoods: {
+// receiveAddressName: 上海,
+// receiveGoodsName: 一明,
+// receivePhone: 18612341234,
+// status: 0,
+// userAddressId:
+// 1556616203528004},
+// status: 0}
+
+//flutter packages pub run build_runner build
+@JsonSerializable()
+class OrderDetail {
+ String orderId; //订单编号
+ int status; //状态 1:待付款,2:待发货,3:待收货,4:待评价,5:完成,6:已取消
+ Address receiveGoods; //收货地址
+ String express; //最新一条物流信息
+
+ List goods; //商品信息
+ String createTime; //下单时间
+
+ String payType; //支付方式
+ String orderPrice; //订单金额
+ String freight; //运费
+ String payFee;
+
+
+ OrderDetail.O(this.orderId);
+
+ OrderDetail(
+ this.orderId,
+ this.status,
+ this.receiveGoods,
+ this.express,
+ this.goods,
+ this.createTime,
+ this.payType,
+ this.orderPrice,
+ this.freight,
+ this.payFee); //实付款
+
+ factory OrderDetail.fromJson(Map json) =>
+ _$OrderDetailFromJson(json);
+
+ /// `toJson` is the convention for a class to declare support for serialization
+ /// to JSON. The implementation simply calls the private, generated
+ /// helper method `_$CategoryToJson`.
+ Map toJson() => _$OrderDetailToJson(this);
+
+ String getStatusName() {
+ switch (status) {
+ case 0:
+ return "已取消";
+ case 1:
+ return "待付款";
+ case 2:
+ return "待发货";
+ case 3:
+ return "待收货";
+ case 4:
+ return "待评价";
+ default:
+ return "";
+ }
+ }
+// 1:待付款,2:待发货,3:待收货,4:待评价,0:全部
+ String getListStatusName() {
+ switch (status) {
+ case 0:
+ return "已取消";
+ case 1:
+ return "待付款";
+ case 2:
+ return "待发货";
+ case 3:
+ return "待收货";
+ case 4:
+ return "待评价";
+ default:
+ return "";
+ }
+ }
+
+ String getStatusButtonName() {
+ switch (status) {
+ case 0:
+ return "已取消";
+ case 1:
+ return "取消订单";
+ case 2:
+ return "查看物流";
+ case 3:
+ return "申请售后";
+ case 4:
+ return "申请售后";
+ default:
+ return "";
+ }
+ }
+
+ doWithOrder(){
+ switch (status) {
+ case 0:
+ Future future =
+ OrderBridge.cancelOrder(orderId);
+ future.then((r) {
+ if (r.code == 200) {
+ Bridge.showLongToast("取消成功");
+ } else {
+ Bridge.showLongToast(r.msg);
+ }
+ });
+ break;
+ case 2:
+
+ Bridge.webview("https://www.kuaidi100.com/chaxun?com=[]&nu=[]");
+ break;
+ case 3:
+ Bridge.webview("https://www.kuaidi100.com/chaxun?com=[]&nu=[]");
+ break;
+ case 4:
+ Bridge.webview("https://www.kuaidi100.com/chaxun?com=[]&nu=[]");
+ break;
+ default:
+ return "";
+ }
+ }
+}
+//
+//@JsonSerializable()
+//class Goods {
+// String goodsName;
+// String goodsPrice;
+// String buyNum;
+// String allGoodsPrice;
+// String goodsImgUrl;
+// String goodsId;
+// String specMsg;
+//
+// Goods(this.goodsName, this.goodsPrice, this.buyNum, this.allGoodsPrice,
+// this.goodsImgUrl, this.goodsId, this.specMsg);
+//
+// factory Goods.fromJson(Map json) => _$GoodsFromJson(json);
+//
+// /// `toJson` is the convention for a class to declare support for serialization
+// /// to JSON. The implementation simply calls the private, generated
+// /// helper method `_$CategoryToJson`.
+// Map toJson() => _$GoodsToJson(this);
+//}
diff --git a/flutter_lib/lib/model/orderdetail.g.dart b/flutter_lib/lib/model/orderdetail.g.dart
new file mode 100644
index 0000000..e05126f
--- /dev/null
+++ b/flutter_lib/lib/model/orderdetail.g.dart
@@ -0,0 +1,40 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'orderdetail.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+OrderDetail _$OrderDetailFromJson(Map json) {
+ return OrderDetail(
+ json['orderId'] as String,
+ json['status'] as int,
+ json['receiveGoods'] == null
+ ? null
+ : Address.fromJson(json['receiveGoods'] as Map),
+ json['express'] as String,
+ (json['goods'] as List)
+ ?.map((e) =>
+ e == null ? null : Good.fromJson(e as Map))
+ ?.toList(),
+ json['createTime'] as String,
+ json['payType'] as String,
+ json['orderPrice'] as String,
+ json['freight'] as String,
+ json['payFee'] as String);
+}
+
+Map _$OrderDetailToJson(OrderDetail instance) =>
+ {
+ 'orderId': instance.orderId,
+ 'status': instance.status,
+ 'receiveGoods': instance.receiveGoods,
+ 'express': instance.express,
+ 'goods': instance.goods,
+ 'createTime': instance.createTime,
+ 'payType': instance.payType,
+ 'orderPrice': instance.orderPrice,
+ 'freight': instance.freight,
+ 'payFee': instance.payFee
+ };
diff --git a/flutter_lib/lib/model/ordergoods.dart b/flutter_lib/lib/model/ordergoods.dart
index fad15d2..697709b 100644
--- a/flutter_lib/lib/model/ordergoods.dart
+++ b/flutter_lib/lib/model/ordergoods.dart
@@ -6,8 +6,11 @@ part 'ordergoods.g.dart';
class OrderGoods {
String goodsId;
String buyNum;
+ String productId;
- OrderGoods(this.goodsId, this.buyNum);
+
+
+ OrderGoods(this.goodsId, this.buyNum, this.productId);
factory OrderGoods.fromJson(Map json) => _$OrderGoodsFromJson(json);
diff --git a/flutter_lib/lib/model/ordergoods.g.dart b/flutter_lib/lib/model/ordergoods.g.dart
index b6a357e..8b0df65 100644
--- a/flutter_lib/lib/model/ordergoods.g.dart
+++ b/flutter_lib/lib/model/ordergoods.g.dart
@@ -7,8 +7,13 @@ part of 'ordergoods.dart';
// **************************************************************************
OrderGoods _$OrderGoodsFromJson(Map json) {
- return OrderGoods(json['goodsId'] as String, json['buyNum'] as String);
+ return OrderGoods(json['goodsId'] as String, json['buyNum'] as String,
+ json['productId'] as String);
}
Map _$OrderGoodsToJson(OrderGoods instance) =>
- {'goodsId': instance.goodsId, 'buyNum': instance.buyNum};
+ {
+ 'goodsId': instance.goodsId,
+ 'buyNum': instance.buyNum,
+ 'productId': instance.productId
+ };
diff --git a/flutter_lib/lib/model/productdetail.dart b/flutter_lib/lib/model/productdetail.dart
index 8c00984..c92c2af 100644
--- a/flutter_lib/lib/model/productdetail.dart
+++ b/flutter_lib/lib/model/productdetail.dart
@@ -1,59 +1,92 @@
class Productdetail {
- String totalCount;
+ String totalCount = "0";
List list;
Productdetail({this.totalCount, this.list});
- Productdetail.fromJson(Map json) {
+ Productdetail.fromJson(Map json) {
this.totalCount = json['totalCount'];
- this.list = (json['list'] as List)!=null?(json['list'] as List).map((i) => ProductDetail.fromJson(i)).toList():null;
+ this.list = (json['list'] as List) != null
+ ? (json['list'] as List).map((i) => ProductDetail.fromJson(i)).toList()
+ : null;
}
Map toJson() {
final Map data = new Map();
data['totalCount'] = this.totalCount;
- data['list'] = this.list != null?this.list.map((i) => i.toJson()).toList():null;
+ data['list'] =
+ this.list != null ? this.list.map((i) => i.toJson()).toList() : null;
return data;
}
-
}
class ProductDetail {
- String activeStartDate;
- String name;
- String detail;
- double salePrice;
- double retailPrice;
- int inventory;
- int id;
- List attributes;
- List medias;
-
- ProductDetail({this.activeStartDate, this.name, this.detail, this.salePrice, this.retailPrice, this.inventory, this.id, this.attributes, this.medias});
+ String activeStartDate = "";
+ String name = "";
+ double salePrice = 0;
+ double retailPrice = 0;
+ int inventory = 0;
+ String description;
+ String metaTitle;
+ int id = 0;
+ int skuId = 0;
+ List attributes = List();
+ List medias = List();
+
+ ProductDetail(
+ this.activeStartDate,
+ this.name,
+ this.salePrice,
+ this.retailPrice,
+ this.inventory,
+ this.id,
+ this.metaTitle,
+ this.skuId,
+ this.attributes,
+ this.medias);
+
+ ProductDetail.N(this.name);
ProductDetail.fromJson(Map json) {
this.activeStartDate = json['activeStartDate'];
this.name = json['name'];
- this.detail = json['detail'];
this.salePrice = json['salePrice'];
this.retailPrice = json['retailPrice'];
this.inventory = json['inventory'];
this.id = json['id'];
- this.attributes = (json['attributes'] as List)!=null?(json['attributes'] as List).map((i) => AttributesListBean.fromJson(i)).toList():null;
- this.medias = (json['medias'] as List)!=null?(json['medias'] as List).map((i) => MediasListBean.fromJson(i)).toList():null;
+ this.metaTitle = json['metaTitle'];
+ this.description = json['description'];
+
+ this.skuId = json['skuId'];
+ this.attributes = (json['attributes'] as List) != null
+ ? (json['attributes'] as List)
+ .map((i) => AttributesListBean.fromJson(i))
+ .toList()
+ : null;
+ this.medias = (json['medias'] as List) != null
+ ? (json['medias'] as List)
+ .map((i) => MediasListBean.fromJson(i))
+ .toList()
+ : null;
}
Map toJson() {
final Map data = new Map();
data['activeStartDate'] = this.activeStartDate;
data['name'] = this.name;
- data['detail'] = this.detail;
data['salePrice'] = this.salePrice;
data['retailPrice'] = this.retailPrice;
data['inventory'] = this.inventory;
data['id'] = this.id;
- data['attributes'] = this.attributes != null?this.attributes.map((i) => i.toJson()).toList():null;
- data['medias'] = this.medias != null?this.medias.map((i) => i.toJson()).toList():null;
+ data['metaTitle'] = this.metaTitle;
+ data['description'] = this.description;
+ data['skuId'] = this.skuId;
+ data['attributes'] = this.attributes != null
+ ? this.attributes.map((i) => i.toJson()).toList()
+ : null;
+ data['medias'] = this.medias != null
+ ? this.medias.map((i) => i.toJson()).toList()
+ : null;
return data;
}
}
@@ -66,7 +99,7 @@ class AttributesListBean {
AttributesListBean({this.value, this.option, this.valueId, this.optionId});
- AttributesListBean.fromJson(Map json) {
+ AttributesListBean.fromJson(Map json) {
this.value = json['value'];
this.option = json['option'];
this.valueId = json['valueId'];
@@ -90,7 +123,7 @@ class MediasListBean {
MediasListBean({this.name, this.url, this.id});
- MediasListBean.fromJson(Map json) {
+ MediasListBean.fromJson(Map json) {
this.name = json['name'];
this.url = json['url'];
this.id = json['id'];
diff --git a/flutter_lib/lib/model/promotion.dart b/flutter_lib/lib/model/promotion.dart
new file mode 100644
index 0000000..3581bd5
--- /dev/null
+++ b/flutter_lib/lib/model/promotion.dart
@@ -0,0 +1,26 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'promotion.g.dart';
+//flutter packages pub run build_runner build
+
+@JsonSerializable()
+class Promotion{
+ String promotionTitle;
+ String promotionDesc;
+ String productId;
+ String sellPrice;
+ String promotionPrice;
+ String imgUrl;
+
+ Promotion(this.promotionTitle, this.promotionDesc, this.productId,
+ this.sellPrice, this.promotionPrice, this.imgUrl);
+
+
+ factory Promotion.fromJson(Map json) => _$PromotionFromJson(json);
+
+ /// `toJson` is the convention for a class to declare support for serialization
+ /// to JSON. The implementation simply calls the private, generated
+ /// helper method `_$CategoryToJson`.
+ Map toJson() => _$PromotionToJson(this);
+
+}
\ No newline at end of file
diff --git a/flutter_lib/lib/model/promotion.g.dart b/flutter_lib/lib/model/promotion.g.dart
new file mode 100644
index 0000000..68cf65d
--- /dev/null
+++ b/flutter_lib/lib/model/promotion.g.dart
@@ -0,0 +1,26 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'promotion.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+Promotion _$PromotionFromJson(Map json) {
+ return Promotion(
+ json['promotionTitle'] as String,
+ json['promotionDesc'] as String,
+ json['productId'] as String,
+ json['sellPrice'] as String,
+ json['promotionPrice'] as String,
+ json['imgUrl'] as String);
+}
+
+Map _$PromotionToJson(Promotion instance) => {
+ 'promotionTitle': instance.promotionTitle,
+ 'promotionDesc': instance.promotionDesc,
+ 'productId': instance.productId,
+ 'sellPrice': instance.sellPrice,
+ 'promotionPrice': instance.promotionPrice,
+ 'imgUrl': instance.imgUrl
+ };
diff --git a/flutter_lib/lib/model/record.dart b/flutter_lib/lib/model/record.dart
new file mode 100644
index 0000000..430d91e
--- /dev/null
+++ b/flutter_lib/lib/model/record.dart
@@ -0,0 +1,11 @@
+class Record {
+ String name;
+ String status;
+ String time;
+
+ Record({
+ this.name,
+ this.status,
+ this.time,
+ });
+}
diff --git a/flutter_lib/lib/model/searchinfo.dart b/flutter_lib/lib/model/searchinfo.dart
new file mode 100644
index 0000000..ed8ac54
--- /dev/null
+++ b/flutter_lib/lib/model/searchinfo.dart
@@ -0,0 +1,25 @@
+class SearchInfo {
+ String keywold;
+ int pageNo;
+ int pageSzie;
+
+ SearchInfo(
+ this.keywold,
+ this.pageNo,
+ this.pageSzie,
+ );
+
+ SearchInfo.fromJson(Map json) {
+ this.keywold = json['keywold'];
+ this.pageNo = json['pageNo'];
+ this.pageSzie = json['pageSize'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['keywold'] = this.keywold;
+ data['pageNo'] = this.pageNo;
+ data['pageSzie'] = this.pageSzie;
+ return data;
+ }
+}
diff --git a/flutter_lib/lib/model/skuinfo.dart b/flutter_lib/lib/model/skuinfo.dart
index 008ef80..31893aa 100644
--- a/flutter_lib/lib/model/skuinfo.dart
+++ b/flutter_lib/lib/model/skuinfo.dart
@@ -12,6 +12,8 @@ class SkuInfo {
data['options'] = this.options != null?this.options.map((i) => i.toJson()).toList():null;
return data;
}
+
+
}
class OptionsListBean {
diff --git a/flutter_lib/lib/model/special.dart b/flutter_lib/lib/model/special.dart
new file mode 100644
index 0000000..fb954e3
--- /dev/null
+++ b/flutter_lib/lib/model/special.dart
@@ -0,0 +1,26 @@
+import 'package:json_annotation/json_annotation.dart';
+
+part 'special.g.dart';
+//flutter packages pub run build_runner build
+
+@JsonSerializable()
+class Special{
+ String titleName;//标题
+ String specialDesc;//描述
+ String productId;//商品ID
+ String imgUrl;
+
+ Special(this.titleName, this.specialDesc, this.productId,
+ this.imgUrl); //图片url
+
+
+
+
+ factory Special.fromJson(Map json) => _$SpecialFromJson(json);
+
+ /// `toJson` is the convention for a class to declare support for serialization
+ /// to JSON. The implementation simply calls the private, generated
+ /// helper method `_$CategoryToJson`.
+ Map toJson() => _$SpecialToJson(this);
+
+}
\ No newline at end of file
diff --git a/flutter_lib/lib/model/special.g.dart b/flutter_lib/lib/model/special.g.dart
new file mode 100644
index 0000000..1404724
--- /dev/null
+++ b/flutter_lib/lib/model/special.g.dart
@@ -0,0 +1,19 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'special.dart';
+
+// **************************************************************************
+// JsonSerializableGenerator
+// **************************************************************************
+
+Special _$SpecialFromJson(Map json) {
+ return Special(json['titleName'] as String, json['specialDesc'] as String,
+ json['productId'] as String, json['imgUrl'] as String);
+}
+
+Map _$SpecialToJson(Special instance) => {
+ 'titleName': instance.titleName,
+ 'specialDesc': instance.specialDesc,
+ 'productId': instance.productId,
+ 'imgUrl': instance.imgUrl
+ };
diff --git a/flutter_lib/lib/model/userinfo.dart b/flutter_lib/lib/model/userinfo.dart
index b6b08c3..bd826b4 100644
--- a/flutter_lib/lib/model/userinfo.dart
+++ b/flutter_lib/lib/model/userinfo.dart
@@ -1,6 +1,19 @@
class Userinfo {
+
+// balanceAmt:金币
+//// totalConsumeAmt:总的消费额
+//// userCode:邀请码
+//// phone:手机号
+//// inviteNum:我的会员个数
+//// userSex:性别,1:男,2:女
+//// userImgUrl:用户头像
+//// openId:微信openid
+//// nickName:昵称
+//// cityName:所在城市
+//// provinceName:所在省份
+
String balanceAmt;
- String totalConsumeAmt;
+ String totalConsume;
String phone;
String userCode;
String status;
@@ -18,11 +31,11 @@ class Userinfo {
String inviteNum;
- Userinfo({this.balanceAmt, this.totalConsumeAmt, this.phone, this.userCode, this.status, this.parentId, this.createTime, this.userLevel, this.userSex, this.userImgUrl, this.openId, this.nickName, this.cityName, this.countryName, this.provinceName, this.imgUrl, this.inviteNum});
+ Userinfo({this.balanceAmt, this.totalConsume, this.phone, this.userCode, this.status, this.parentId, this.createTime, this.userLevel, this.userSex, this.userImgUrl, this.openId, this.nickName, this.cityName, this.countryName, this.provinceName, this.imgUrl, this.inviteNum});
Userinfo.fromJson(Map json) {
this.balanceAmt = json['balanceAmt'];
- this.totalConsumeAmt = json['totalConsumeAmt'];
+ this.totalConsume = json['totalConsume'];
this.phone = json['phone'];
this.userCode = json['userCode'];
this.status = json['status'];
@@ -43,7 +56,7 @@ class Userinfo {
Map toJson() {
final Map data = new Map();
data['balanceAmt'] = this.balanceAmt;
- data['totalConsumeAmt'] = this.totalConsumeAmt;
+ data['totalConsume'] = this.totalConsume;
data['phone'] = this.phone;
data['userCode'] = this.userCode;
data['status'] = this.status;
diff --git a/flutter_lib/lib/myapp.dart b/flutter_lib/lib/myapp.dart
index 6787dc3..065b31d 100644
--- a/flutter_lib/lib/myapp.dart
+++ b/flutter_lib/lib/myapp.dart
@@ -1,7 +1,11 @@
import 'package:flutter/material.dart';
+import 'package:flutter_lib/bridge/common_bridge.dart';
+import 'package:flutter_lib/model/OrderComment.dart';
import 'package:flutter_lib/model/category.dart';
import 'package:flutter_lib/ui/page/account/login.dart';
+import 'package:flutter_lib/ui/page/account/mine_wallet.dart';
import 'package:flutter_lib/ui/page/account/register.dart';
+import 'package:flutter_lib/ui/page/account/vip_apply.dart';
import 'package:flutter_lib/ui/page/dashboard/dashboard.page.dart';
import 'package:flutter_lib/ui/page/dashboard/home_page.dart';
import 'package:flutter_lib/ui/page/dashboard/user_home_page.dart';
@@ -9,7 +13,6 @@ import 'package:flutter_lib/ui/page/invite/invite_friends.dart';
import 'package:flutter_lib/ui/page/invite/invite_input.dart';
import 'package:flutter_lib/ui/page/notfound/notfound_page.dart';
import 'package:flutter_lib/ui/page/order/all_shop_order_list.dart';
-import 'package:flutter_lib/ui/page/order/mine_order.dart';
import 'package:flutter_lib/ui/page/order/oder_comment.dart';
import 'package:flutter_lib/ui/page/order/order_comment_list.dart';
import 'package:flutter_lib/ui/page/order/order_detail.dart';
@@ -33,18 +36,7 @@ class MyApp extends StatelessWidget {
debugShowCheckedModeBanner: true,
showPerformanceOverlay: false,
home: DashboardPage(),
-// localizationsDelegates: [
-// const TranslationsDelegate(),
-// GlobalMaterialLocalizations.delegate,
-// GlobalWidgetsLocalizations.delegate,
-// ],
-// supportedLocales: [
-// const Locale("en", "US"),
-// const Locale("hi", "IN"),
-// ],
initialRoute: UIData.notFoundRoute,
-
- //routes
routes: {
UIData.ShopCartListPage: (BuildContext context) =>
ShopCartListPage(true),
@@ -54,12 +46,11 @@ class MyApp extends StatelessWidget {
UIData.notFoundRoute: (BuildContext context) => NotFoundPage(),
UIData.IviteFriendsPage: (BuildContext context) => InviteFriendsPage(),
UIData.InviteInputPage: (BuildContext context) => InviteInputPage(),
+ UIData.VipApplyPage: (BuildContext context) => VipApplyPage(),
+ UIData.MineWalletPage: (BuildContext context) => MineWalletPage(),
UIData.UserHomeListPage: (BuildContext context) => UserHomeListPage(),
- UIData.AllShopOrderPage: (BuildContext context) => AllShopOrderPage(),
UIData.MineCollectionPage: (BuildContext context) =>
MineCollectionPage(),
- UIData.OrderDetailPage: (BuildContext context) => OrderDetailPage(),
- UIData.OrderCommentPage: (BuildContext context) => OrderCommentPage(),
UIData.OrderCommentListPage: (BuildContext context) =>
OrderCommentListPage(),
UIData.Register: (BuildContext context) => RegisterPage()
@@ -94,24 +85,47 @@ class MyApp extends StatelessWidget {
);
}
break;
- case UIData.MineOrderPage:
+ case UIData.OrderCommentPage:
+ if (arguments is OrderComment) {
+ return new MaterialPageRoute(
+ settings: settings,
+ builder: (BuildContext context) => OrderCommentPage(arguments),
+ );
+ }
+ break;
+ case UIData.OrderDetailPage:
+ if (arguments is String) {
+ return new MaterialPageRoute(
+ settings: settings,
+ builder: (BuildContext context) => OrderDetailPage(arguments),
+ );
+ }
+ break;
+ case UIData.AllShopOrderPage:
if (arguments is int) {
return new MaterialPageRoute(
settings: settings,
- builder: (BuildContext context) => MineOrderPage(arguments),
+ builder: (BuildContext context) => AllShopOrderPage(arguments),
);
}
break;
}
},
- onUnknownRoute: (RouteSettings rs) => new MaterialPageRoute(
- builder: (context) => new NotFoundPage(
- appTitle: UIData.coming_soon,
-// icon: FontAwesomeIcons.solidSmile,
- title: UIData.coming_soon,
- message: "Under Development",
- iconColor: Colors.grey,
- )));
+ onUnknownRoute: (RouteSettings settings) {
+// final arguments = settings.arguments;
+// switch (settings.name) {
+// case UIData.ShopDetailPage:
+//
+// break;
+// }
+ new MaterialPageRoute(
+ builder: (context) => new NotFoundPage(
+ appTitle: UIData.coming_soon,
+ title: UIData.coming_soon,
+ message: "Under Development",
+ iconColor: Colors.grey,
+ ));
+ });
@override
Widget build(BuildContext context) {
diff --git a/flutter_lib/lib/logic/inherited/category_provider.dart b/flutter_lib/lib/ui/inherited/category_provider.dart
similarity index 89%
rename from flutter_lib/lib/logic/inherited/category_provider.dart
rename to flutter_lib/lib/ui/inherited/category_provider.dart
index 3e35f83..d59fde9 100644
--- a/flutter_lib/lib/logic/inherited/category_provider.dart
+++ b/flutter_lib/lib/ui/inherited/category_provider.dart
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_lib/logic/bloc/category_bloc.dart';
-import 'package:flutter_lib/logic/bloc/product_bloc.dart';
class CategoryProvider extends InheritedWidget {
final CategoryBloc categoryBloc;
diff --git a/flutter_lib/lib/ui/inherited/home_provider.dart b/flutter_lib/lib/ui/inherited/home_provider.dart
new file mode 100644
index 0000000..153f46d
--- /dev/null
+++ b/flutter_lib/lib/ui/inherited/home_provider.dart
@@ -0,0 +1,17 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_lib/logic/bloc/home_bloc.dart';
+import 'package:flutter_lib/logic/bloc/product_bloc.dart';
+
+class HomeBlocProvider extends InheritedWidget {
+ final HomeBloc bloc;
+ final Widget child;
+
+ HomeBlocProvider({this.bloc, this.child}) : super(child: child);
+
+ static HomeBlocProvider of(BuildContext context) =>
+ context.inheritFromWidgetOfExactType(HomeBlocProvider);
+
+ @override
+ bool updateShouldNotify(HomeBlocProvider oldWidget) =>
+ bloc != oldWidget.bloc;
+}
diff --git a/flutter_lib/lib/logic/inherited/product_provider.dart b/flutter_lib/lib/ui/inherited/product_provider.dart
similarity index 100%
rename from flutter_lib/lib/logic/inherited/product_provider.dart
rename to flutter_lib/lib/ui/inherited/product_provider.dart
diff --git a/flutter_lib/lib/ui/page/account/login.dart b/flutter_lib/lib/ui/page/account/login.dart
index 7564e7e..aef1610 100644
--- a/flutter_lib/lib/ui/page/account/login.dart
+++ b/flutter_lib/lib/ui/page/account/login.dart
@@ -4,13 +4,25 @@ import 'package:flutter_lib/bridge/account_bridge.dart';
import 'package:flutter_lib/bridge/common_bridge.dart';
import 'package:flutter_lib/model/Result.dart';
import 'package:flutter_lib/ui/page/account/register.dart';
+import 'package:flutter_lib/ui/widgets/countdown.dart';
class LoginPage extends StatefulWidget {
@override
LoginState createState() => LoginState();
}
-class LoginState extends State {
+class LoginState extends State with TickerProviderStateMixin {
+ TextEditingController smsCodeEditingController = new TextEditingController();
+ TextEditingController inviteCodeEditingController =
+ new TextEditingController();
+ Color _verifycodecolor = Color(0xFF999999);
+ Color _verifybordercolor = Color(0xFFEEEEEE);
+ var _verifyborderwidth = 1.0;
+
+ int time_cutdown = 60;
+ bool isGetingSms = false;
+ AnimationController _animationController;
+
var _scaffoldkey = new GlobalKey();
void showSnackBar(String message) {
@@ -18,6 +30,23 @@ class LoginState extends State {
_scaffoldkey.currentState.showSnackBar(snackBar);
}
+ @override
+ void initState() {
+ _animationController = new AnimationController(
+ duration: new Duration(seconds: time_cutdown),
+ vsync: this,
+ );
+ _animationController.addStatusListener((v) {
+ AnimationStatus a = v;
+ if (a == AnimationStatus.completed) {
+ setState(() {
+ isGetingSms = false;
+ });
+ }
+ });
+ super.initState();
+ }
+
@override
Widget build(BuildContext context) {
return new DefaultTabController(
@@ -152,12 +181,7 @@ class LoginState extends State {
);
}
- TextEditingController smsCodeEditingController = new TextEditingController();
- TextEditingController inviteCodeEditingController =
- new TextEditingController();
- Color _verifycodecolor = Color(0xFF999999);
- Color _verifybordercolor = Color(0xFFEEEEEE);
- var _verifyborderwidth = 1.0;
+
Container buildGetSms() {
return Container(
@@ -190,10 +214,19 @@ class LoginState extends State {
child: new Container(
width: 71.0,
height: 22.0,
- child: new Text(
- "获取验证码",
- style: TextStyle(color: _verifybordercolor, fontSize: 10),
- ),
+ child: isGetingSms
+ ? new Countdown(
+ color: Colors.white,
+ animation: new StepTween(
+ begin: time_cutdown,
+ end: 0,
+ ).animate(_animationController),
+ )
+ : new Text(
+ "获取验证码",
+ style: TextStyle(
+ color: _verifybordercolor, fontSize: 10),
+ ),
alignment: Alignment.center,
),
//圆角大小,与BoxDecoration保持一致,更美观
@@ -207,6 +240,10 @@ class LoginState extends State {
future.then((v) {
if (v.code == 200) {
Bridge.showShortToast("短信发送成功");
+ _animationController.forward(from: 0.0);
+ this.setState(() {
+ isGetingSms = true;
+ });
} else {
Bridge.showShortToast(v.msg);
}
diff --git a/flutter_lib/lib/ui/page/account/mine_wallet.dart b/flutter_lib/lib/ui/page/account/mine_wallet.dart
new file mode 100644
index 0000000..8b9f7b9
--- /dev/null
+++ b/flutter_lib/lib/ui/page/account/mine_wallet.dart
@@ -0,0 +1,171 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_lib/bridge/common_bridge.dart';
+import 'package:flutter_lib/bridge/invite_bridge.dart';
+import 'package:flutter_lib/model/Result.dart';
+import 'package:flutter_lib/model/record.dart';
+import 'package:flutter_lib/utils/uidata.dart';
+
+class MineWalletPage extends StatefulWidget {
+ MineWalletPage({Key key}) : super(key: key);
+
+ @override
+ MineWalletPageState createState() => new MineWalletPageState();
+}
+
+class MineWalletPageState extends State {
+ List list = new List();
+
+ @override
+ Widget build(BuildContext context) {
+ //测试数据
+ list.add(new Record(name: "某某交易", status: "已提现", time: "2019-01-01 12:35"));
+ list.add(new Record(name: "某某交易", status: "已提现", time: "2019-01-01 12:35"));
+ list.add(new Record(name: "某某交易", status: "已提现", time: "2019-01-01 12:35"));
+ list.add(new Record(name: "某某交易", status: "已提现", time: "2019-01-01 12:35"));
+ list.add(new Record(name: "某某交易", status: "已提现", time: "2019-01-01 12:35"));
+
+ return new Scaffold(
+ appBar: UIData.getCenterTitleAppBar("我的钱包", context),
+ body: Stack(
+ children: [
+ Container(
+ color: Color(0xFFF5F5F5),
+ ),
+ CustomScrollView(
+ slivers: [
+ SliverList(
+ delegate: SliverChildListDelegate(
+ [
+ buildHeader(),
+ Container(
+ height: 10.0,
+ ),
+ ],
+ ),
+ ),
+ SliverList(
+ delegate: SliverChildBuilderDelegate(
+ (context, index) => RecordItem(item: list[index]),
+ childCount: list.length,
+ ),
+ ),
+ ],
+ ),
+ ],
+ ));
+ }
+
+ Container buildHeader() {
+ return Container(
+ color: Colors.white,
+ width: double.infinity,
+ height: 269.0,
+ child: Stack(
+ children: [
+ Positioned(
+ top: 67.0,
+ left: 0.0,
+ right: 0.0,
+ child: Text(
+ "1356",
+ style: TextStyle(color: Color(0xFFFA4848), fontSize: 50.0),
+ textAlign: TextAlign.center,
+ ),
+ ),
+ Positioned(
+ top: 124.0,
+ left: 0.0,
+ right: 0.0,
+ child: Text(
+ "我的余额",
+ style: TextStyle(color: Color(0xFF666666), fontSize: 15.0),
+ textAlign: TextAlign.center,
+ ),
+ ),
+ Positioned(
+ top: 208.0,
+ left: 15.0,
+ right: 15.0,
+ child: InkWell(
+ child: Container(
+ alignment: Alignment.center,
+ height: 45.0,
+ child: Text(
+ "全部提现",
+ style: TextStyle(color: Colors.white, fontSize: 20.0),
+ ),
+ decoration: new BoxDecoration(
+ borderRadius: new BorderRadius.circular(8.0),
+ color: Color(0xFFFA4848))),
+ onTap: () {},
+ )),
+ ],
+ ),
+ );
+ }
+
+ _navigateToPerfectInfo(BuildContext context, String inviteCode) async {
+ Future future = InviteBridge.invitedParent(inviteCode);
+ future.then((result) {
+ if (result.code == 200) {
+ Navigator.pop(context, false);
+ } else {
+ Bridge.showLongToast(result.msg == null ? "未返回错误信息" : result.msg);
+ }
+ });
+ }
+}
+
+class RecordItem extends StatelessWidget {
+ final Record item;
+
+ RecordItem({Key key, @required this.item}) : super(key: key);
+
+ @override
+ Widget build(BuildContext context) {
+ return GestureDetector(
+ child: Column(
+ children: [
+ Container(
+ color: Colors.white,
+ padding: EdgeInsets.fromLTRB(15, 12, 15, 12),
+ child: Row(
+ children: [
+ Expanded(
+ child: Text(
+ item.name,
+ style: TextStyle(color: Color(0xFF353535), fontSize: 15.0),
+ ),
+ ),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.end,
+ children: [
+ Text(
+ item.status,
+ style:
+ TextStyle(color: Color(0xFF353535), fontSize: 12.0),
+ ),
+ Padding(
+ padding: EdgeInsets.fromLTRB(0, 3, 0, 0),
+ child: Text(
+ item.time,
+ style:
+ TextStyle(color: Color(0xFFCCCCCC), fontSize: 12.0),
+ ),
+ ),
+ ],
+ )
+ ],
+ ),
+ ),
+ Container(
+ width: double.infinity,
+ height: 1.0,
+ color: Color(0xFFEEEEEE),
+ )
+ ],
+ ),
+ onTap: () {},
+ );
+ }
+}
diff --git a/flutter_lib/lib/ui/page/account/register.dart b/flutter_lib/lib/ui/page/account/register.dart
index 5f87f0c..f89eed9 100644
--- a/flutter_lib/lib/ui/page/account/register.dart
+++ b/flutter_lib/lib/ui/page/account/register.dart
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_lib/bridge/account_bridge.dart';
import 'package:flutter_lib/bridge/common_bridge.dart';
import 'package:flutter_lib/model/Result.dart';
+import 'package:flutter_lib/ui/widgets/countdown.dart';
import 'package:flutter_lib/utils/uidata.dart';
class Register extends StatelessWidget {
@@ -28,7 +29,28 @@ class RegisterPage extends StatefulWidget {
RegisterState createState() => RegisterState();
}
-class RegisterState extends State {
+class RegisterState extends State with TickerProviderStateMixin {
+ int time_cutdown = 60;
+ bool isGetingSms = false;
+ AnimationController _animationController;
+
+ @override
+ void initState() {
+ _animationController = new AnimationController(
+ duration: new Duration(seconds: time_cutdown),
+ vsync: this,
+ );
+ _animationController.addStatusListener((v) {
+ AnimationStatus a = v;
+ if (a == AnimationStatus.completed) {
+ setState(() {
+ isGetingSms = false;
+ });
+ }
+ });
+ super.initState();
+ }
+
final TextEditingController _controller = new TextEditingController();
Color _registercolor = Color(0xFFFF7B7B);
Color _verifycodecolor = Color(0xFF999999);
@@ -52,7 +74,7 @@ class RegisterState extends State {
if (_registercolor.value != 0xFFFF7B7B) {
setState(() {
_registercolor = Color(0xFFFF7B7B);
- _verifycodecolor = Color(0xFF999999);
+ _verifycodecolor = UIData.ff666666;
_verifybordercolor = Color(0xFFEEEEEE);
_verifyborderwidth = 1.0;
});
@@ -260,10 +282,19 @@ class RegisterState extends State {
child: new Container(
width: 71.0,
height: 22.0,
- child: new Text(
- "获取验证码",
- style: TextStyle(color: _verifycodecolor, fontSize: 10),
- ),
+ child: isGetingSms
+ ? new Countdown(
+ color: UIData.ff353535,
+ animation: new StepTween(
+ begin: time_cutdown,
+ end: 0,
+ ).animate(_animationController),
+ )
+ : new Text(
+ "获取验证码",
+ style: TextStyle(
+ color: UIData.fff, fontSize: 10),
+ ),
alignment: Alignment.center,
),
//圆角大小,与BoxDecoration保持一致,更美观
@@ -277,6 +308,10 @@ class RegisterState extends State {
future.then((v) {
if (v.code == 200) {
Bridge.showShortToast("短信发送成功");
+ _animationController.forward(from: 0.0);
+ this.setState(() {
+ isGetingSms = true;
+ });
} else {
Bridge.showShortToast(v.msg);
}
diff --git a/flutter_lib/lib/ui/page/account/vip_apply.dart b/flutter_lib/lib/ui/page/account/vip_apply.dart
new file mode 100644
index 0000000..9da8c44
--- /dev/null
+++ b/flutter_lib/lib/ui/page/account/vip_apply.dart
@@ -0,0 +1,224 @@
+import 'package:flutter/material.dart';
+import 'package:flutter_lib/bridge/common_bridge.dart';
+import 'package:flutter_lib/bridge/invite_bridge.dart';
+import 'package:flutter_lib/bridge/order_bridge.dart';
+import 'package:flutter_lib/model/Result.dart';
+import 'package:flutter_lib/model/order_result.dart';
+import 'package:flutter_lib/ui/widgets/common_dialogs.dart';
+import 'package:flutter_lib/utils/BristuaRouter.dart';
+import 'package:flutter_lib/utils/uidata.dart';
+
+class VipApplyPage extends StatefulWidget {
+ VipApplyPage({Key key}) : super(key: key);
+
+ @override
+ VipApplyPageState createState() => new VipApplyPageState();
+}
+
+class VipApplyPageState extends State {
+ bool _isVip = false;
+
+ @override
+ Widget build(BuildContext context) {
+ return new Scaffold(
+ appBar:
+ UIData.getCenterTitleAppBar(!_isVip ? "申请VIP" : "我的VIP", context),
+ body: !_isVip ? buildApplyVipBody() : buildMineVipBody());
+ }
+
+ Stack buildApplyVipBody() {
+ return Stack(
+ children: [
+ Container(
+ color: Color(0xFFF5F5F5),
+ ),
+ Image.asset(
+ 'images/icon_vip_bg.png',
+ width: double.infinity,
+ height: 197.0,
+ fit: BoxFit.cover,
+ ),
+ Positioned(
+ top: 37.0,
+ left: 0.0,
+ right: 0.0,
+ child: Text(
+ "成为VIP",
+ style: TextStyle(color: Colors.white, fontSize: 24.0),
+ textAlign: TextAlign.center,
+ ),
+ ),
+ Positioned(
+ top: 75.0,
+ left: 0.0,
+ right: 0.0,
+ child: Text(
+ "立享好友消费返积分",
+ style: TextStyle(color: Colors.white, fontSize: 18.0),
+ textAlign: TextAlign.center,
+ ),
+ ),
+ Positioned(
+ top: 122.0,
+ left: 15.0,
+ right: 15.0,
+ child: Container(
+ alignment: Alignment.center,
+ width: 346.0,
+ height: 169.0,
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Image.asset(
+ 'images/icon_vip_crown.png',
+ width: 80.0,
+ height: 66.0,
+ ),
+ Padding(
+ padding: EdgeInsets.fromLTRB(0, 15, 0, 0),
+ child: RichText(
+ text: TextSpan(
+ text: '389.00',
+ style: TextStyle(color: Colors.white, fontSize: 30.0),
+ children: [
+ TextSpan(
+ text: ' 元/年',
+ style:
+ TextStyle(color: Colors.white, fontSize: 15.0),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ],
+ ),
+ decoration: new BoxDecoration(
+ borderRadius: new BorderRadius.circular(8.0),
+ gradient: LinearGradient(colors: [
+ Color(0xFFDABC86),
+ Color(0xFF937C54),
+ ], begin: FractionalOffset(1, 0), end: FractionalOffset(0, 1)),
+ )),
+ ),
+ Positioned(
+ top: 305.0,
+ left: 15.0,
+ right: 15.0,
+ child: InkWell(
+ child: Container(
+ alignment: Alignment.center,
+ height: 45.0,
+ child: Text(
+ "立即开通",
+ style: TextStyle(color: Colors.white, fontSize: 18.0),
+ ),
+ decoration: new BoxDecoration(
+ borderRadius: new BorderRadius.circular(8.0),
+ color: Color(0xFF9E8B69))),
+ onTap: () {
+ Future future = OrderBridge.orderVip(1);
+ future.then((result) {
+ if (result.code == 200) {
+ if (result.data == null) {
+ Bridge.showLongToast("订单号获取失败");
+ return;
+ }
+ showPayDialog(context, 389.00,
+ OrderResult.fromJson(result.data).orderId,"vip");
+ } else {
+ if (result.code == 401) {
+ BristuaRouter.routerUserLogin(context);
+ } else {
+ Bridge.showLongToast(result.msg);
+ }
+ }
+ });
+ },
+ )),
+ ],
+ );
+ }
+
+ Stack buildMineVipBody() {
+ return Stack(
+ children: [
+ Container(
+ color: Color(0xFFF5F5F5),
+ ),
+ Image.asset(
+ 'images/icon_vip_bg.png',
+ width: double.infinity,
+ height: 197.0,
+ fit: BoxFit.cover,
+ ),
+ Positioned(
+ top: 45.0,
+ left: 0.0,
+ right: 0.0,
+ child: Row(
+ children: [
+ Padding(
+ padding: EdgeInsets.fromLTRB(64, 0, 18, 0),
+ child: Image.asset(
+ 'images/icon_vip_crown.png',
+ width: 67.0,
+ height: 54.0,
+ ),
+ ),
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ Text(
+ "您已是VIP",
+ style: TextStyle(color: Colors.white, fontSize: 20.0),
+ ),
+ Padding(
+ padding: EdgeInsets.fromLTRB(0, 2, 0, 4),
+ child: Text(
+ "用户立享自己/好友消费返积分",
+ style: TextStyle(color: Colors.white, fontSize: 12.0),
+ ),
+ ),
+ Text(
+ "VIP有效期:2019.01.01-2019.12.31",
+ style: TextStyle(color: Color(0xFF948F85), fontSize: 12.0),
+ ),
+ ],
+ ),
+ ],
+ ),
+ ),
+ Positioned(
+ top: 130.0,
+ left: 15.0,
+ right: 15.0,
+ child: InkWell(
+ child: Container(
+ alignment: Alignment.center,
+ height: 45.0,
+ child: Text(
+ "立即体验特权",
+ style: TextStyle(color: Colors.white, fontSize: 18.0),
+ ),
+ decoration: new BoxDecoration(
+ borderRadius: new BorderRadius.circular(8.0),
+ color: Color(0xFF9E8B69))),
+ onTap: () {},
+ )),
+ ],
+ );
+ }
+
+ _navigateToPerfectInfo(BuildContext context, String inviteCode) async {
+ Future future = InviteBridge.invitedParent(inviteCode);
+ future.then((result) {
+ if (result.code == 200) {
+ Navigator.pop(context, false);
+ } else {
+ Bridge.showLongToast(result.msg == null ? "未返回错误信息" : result.msg);
+ }
+ });
+ }
+}
diff --git a/flutter_lib/lib/ui/page/address/address_list.dart b/flutter_lib/lib/ui/page/address/address_list.dart
index 490bc0b..c227165 100644
--- a/flutter_lib/lib/ui/page/address/address_list.dart
+++ b/flutter_lib/lib/ui/page/address/address_list.dart
@@ -43,7 +43,7 @@ class _AddressListState extends State {
}
Widget bodyData() {
- addressBloc.getAddressList();
+ addressBloc.getAddressList(context);
return StreamBuilder>(
stream: addressBloc.productItems,
builder: (context, snapshot) {
diff --git a/flutter_lib/lib/ui/page/dashboard/dashboard.page.dart b/flutter_lib/lib/ui/page/dashboard/dashboard.page.dart
index 8e5a40c..94af5d8 100644
--- a/flutter_lib/lib/ui/page/dashboard/dashboard.page.dart
+++ b/flutter_lib/lib/ui/page/dashboard/dashboard.page.dart
@@ -1,48 +1,24 @@
import 'dart:ui';
import 'package:flutter/material.dart';
-import 'package:flutter_lib/bridge/common_bridge.dart';
import 'package:flutter_lib/ui/page/dashboard/home_page.dart';
import 'package:flutter_lib/ui/page/dashboard/user_home_page.dart';
import 'package:flutter_lib/ui/page/shop/shop_cart_list.dart';
import 'package:flutter_lib/ui/page/shop/shop_category_list.dart';
-import 'package:flutter_lib/ui/widgets/banner/banner_evalutor.dart';
import 'package:flutter_lib/utils/uidata.dart';
-import 'package:flutter_test/flutter_test.dart';
class DashboardPage extends StatefulWidget {
@override
DashboardPageState createState() => DashboardPageState();
}
-class Model extends Object with BannerWithEval {
- final String imgUrl;
-
- Model({this.imgUrl});
-
- @override
- get bannerUrl => imgUrl;
-}
-
-class Choice {
- const Choice({this.title, this.icon});
- final String title;
- final IconData icon;
-}
-
-const List choices = const [
- const Choice(title: '热销精品', icon: Icons.directions_car),
- const Choice(title: '上新好货', icon: Icons.directions_bike),
- const Choice(title: '全部分类', icon: Icons.directions_boat),
- const Choice(title: '邀请返利', icon: Icons.directions_bus)
-];
-
class DashboardPageState extends State {
MyHomePage myHomePage = MyHomePage();
ShopCategoryListPage shopCategoryListPage =
ShopCategoryListPage(title: "全部分类", showBackBtn: false);
ShopCartListPage shopCartListPage = ShopCartListPage(false);
UserHomeListPage userHomeListPage = UserHomeListPage();
+
@override
void initState() {
super.initState();
@@ -67,36 +43,40 @@ class DashboardPageState extends State {
bottomNavigationBar: BottomNavigationBar(
items: [
BottomNavigationBarItem(
- icon: Icon(
- Icons.home,
- color: UIData.ff353535,
+ icon: Image.asset(
+ 'images/icon_bottom_navigation_home.png',
+ width: 22.0,
+ height: 22.0,
),
title: Text(
'首页',
style: TextStyle(color: UIData.ff353535, fontSize: 10),
)),
BottomNavigationBarItem(
- icon: Icon(
- Icons.category,
- color: UIData.ff353535,
+ icon: Image.asset(
+ 'images/icon_bottom_navigation_active.png',
+ width: 22.0,
+ height: 22.0,
),
title: Text(
'分类',
style: TextStyle(color: UIData.ff353535, fontSize: 10),
)),
BottomNavigationBarItem(
- icon: Icon(
- Icons.add_shopping_cart,
- color: UIData.ff353535,
+ icon: Image.asset(
+ 'images/icon_bottom_navigation_car.png',
+ width: 22.0,
+ height: 22.0,
),
title: Text(
'购物车',
style: TextStyle(color: UIData.ff353535, fontSize: 10),
)),
BottomNavigationBarItem(
- icon: Icon(
- Icons.person,
- color: UIData.ff353535,
+ icon: Image.asset(
+ 'images/icon_bottom_navigation_mine.png',
+ width: 22.0,
+ height: 22.0,
),
title: Text(
'我的',
diff --git a/flutter_lib/lib/ui/page/dashboard/home_page.dart b/flutter_lib/lib/ui/page/dashboard/home_page.dart
index 6c96425..8cfb759 100644
--- a/flutter_lib/lib/ui/page/dashboard/home_page.dart
+++ b/flutter_lib/lib/ui/page/dashboard/home_page.dart
@@ -1,29 +1,26 @@
-import 'package:flutter/material.dart';
import 'dart:ui';
-import 'package:flutter_lib/logic/viewmodel/product_view_model.dart';
-import 'package:flutter_lib/model/product.dart';
-
-import 'package:flutter_lib/ui/page/shop/search_shop_list.dart';
-import 'package:flutter_lib/utils/uidata.dart';
-import 'package:flutter_test/flutter_test.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_lib/logic/bloc/home_bloc.dart';
+import 'package:flutter_lib/logic/bloc/product_bloc.dart';
+import 'package:flutter_lib/model/Banner.dart';
+import 'package:flutter_lib/model/HomeCategory.dart';
+import 'package:flutter_lib/model/Result.dart';
+import 'package:flutter_lib/model/category.dart';
+import 'package:flutter_lib/model/productitem.dart';
+import 'package:flutter_lib/model/promotion.dart';
+import 'package:flutter_lib/model/special.dart';
+import 'package:flutter_lib/ui/inherited/home_provider.dart';
+import 'package:flutter_lib/ui/inherited/product_provider.dart';
import 'package:flutter_lib/ui/widgets/banner/banner_widget.dart';
-import 'package:flutter_lib/ui/widgets/banner/banner_evalutor.dart';
+import 'package:flutter_lib/ui/widgets/error_status_widget.dart';
+import 'package:flutter_lib/utils/uidata.dart';
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
-class Model extends Object with BannerWithEval {
- final String imgUrl;
-
- Model({this.imgUrl});
-
- @override
- get bannerUrl => imgUrl;
-}
-
class Choice {
const Choice({this.title, this.icon, this.action});
@@ -48,26 +45,9 @@ const List choices = const [
];
class _MyHomePageState extends State {
- final List data = [
- new Model(
- imgUrl:
- 'https://img1.360buyimg.com/da/jfs/t1/26933/21/15251/101018/5cae9e2fEb2d18145/ce92ccee53fc3e62.jpg'),
- new Model(
- imgUrl:
- 'https://img1.360buyimg.com/pop/jfs/t1/33615/26/2942/67787/5cb2db16E190d1438/f87d36b439a01bb4.jpg'),
- new Model(
- imgUrl:
- 'https://m.360buyimg.com/babel/jfs/t1/32943/39/11194/86395/5cb44a60Eacbc1baf/d15986655530b38a.jpg'),
- new Model(
- imgUrl:
- 'https://m.360buyimg.com/babel/jfs/t1/35770/34/1817/46457/5cb43c53E9c28780e/b05442df5d5ba2c3.jpg'),
- new Model(
- imgUrl:
- 'https://m.360buyimg.com/babel/jfs/t1/25888/33/15004/99699/5caca583E85bc0c4b/0144e355305c5946.jpg'),
- ];
+ ProductBloc productBloc = ProductBloc();
- final List discountList = ProductViewModel().getDiscountList();
- final List hotShopList = ProductViewModel().getProductTests();
+ HomeBloc homeBloc = HomeBloc();
@override
void initState() {
@@ -88,93 +68,150 @@ class _MyHomePageState extends State {
top: true,
child: buildCustomScrollView(),
);
-// return Scaffold(
-// body: Container(
-// child: buildCustomScrollView(),
-// ),
-//// floatingActionButton: FloatingActionButton(
-//// tooltip: 'Increment',
-//// child: Icon(Icons.add),
-//// onPressed: () {
-//// final navigator = Navigator.of(context);
-//// navigator.push(new MaterialPageRoute(
-//// builder: (context) => new SearchShopList()));
-//// },
-//// ),
-// // This trailing comma makes auto-formatting nicer for build methods.
-// );
}
CustomScrollView buildCustomScrollView() {
+ homeBloc.getPromotion();
+ homeBloc.getSpecial();
return CustomScrollView(slivers: [
SliverList(
delegate: SliverChildListDelegate(
[
buildHeader(),
- buildBanner(),
- buildType(),
- buildAdvertisement(
- "https://img20.360buyimg.com/mobilecms/s350x128_jfs/t8554/10/1668315357/28454/82af77f0/59be2c79Ne4502dcf.jpg!q90!cc_350x128.webp"),
- buildDiscount(),
- Container(
- height: 1.0,
- width: double.infinity,
- ),
],
),
),
- SliverGrid(
- gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
- crossAxisCount: 2,
- crossAxisSpacing: 1.0,
- mainAxisSpacing: 1.0,
- childAspectRatio: 1.88,
- ),
- delegate: SliverChildBuilderDelegate(
- (BuildContext context, int index) {
- return Container(
- color: Colors.white,
- child: buildDiscountItem(index, discountList[index]),
- );
- },
- childCount: discountList.length,
- ),
- ),
+ buildBanner(),
SliverList(
delegate: SliverChildListDelegate(
[
Container(
- height: 10.0,
- width: double.infinity,
- ),
- buildMustBay(
- "https://img11.360buyimg.com/mobilecms/s350x250_jfs/t1/23441/6/14922/36622/5cac1223Edaf540b0/7df256141224531d.jpg!q90!cc_350x250.webp",
- "https://img11.360buyimg.com/mobilecms/s350x250_jfs/t1/30730/6/10877/44332/5cb34d0cE9e0fcea6/9c3cde5807ab4186.jpg!q90!cc_350x250.webp"),
- buildActivity(),
- buildHotShop(),
+ child: Padding(padding: EdgeInsets.fromLTRB(0, 5, 0, 5)),
+ )
],
),
),
- SliverGrid(
- gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
- crossAxisCount: 2,
- crossAxisSpacing: 0.0,
- mainAxisSpacing: 0.0,
- childAspectRatio: 0.74,
- ),
- delegate: SliverChildBuilderDelegate(
- (BuildContext context, int index) {
- return Container(
- color: Color(0xFFF6F6F6),
- child: buildHotShopItem(index, hotShopList[index]),
+ buildType(),
+ StreamBuilder>(
+ stream: homeBloc.promotions,
+ builder: (context, snapshot) {
+ if (snapshot.hasData && snapshot.data.isNotEmpty) {
+ return SliverList(
+ delegate: SliverChildListDelegate(
+ [
+ buildDiscount(),
+ Container(
+ height: 1.0,
+ width: double.infinity,
+ ),
+ ],
+ ),
);
- },
- childCount: hotShopList.length,
- ),
+ } else {
+ return getNone();
+ }
+ },
),
+ StreamBuilder>(
+ stream: homeBloc.promotions,
+ builder: (context, snapshot) {
+ if (snapshot.hasData && snapshot.data.isNotEmpty) {
+ return SliverGrid(
+ gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+ crossAxisCount: 2,
+ crossAxisSpacing: 1.0,
+ mainAxisSpacing: 1.0,
+ childAspectRatio: 1.88,
+ ),
+ delegate: SliverChildBuilderDelegate(
+ (BuildContext context, int index) {
+ return Container(
+ color: Colors.white,
+ child: buildDiscountItem(index, snapshot.data[index]),
+ );
+ },
+ childCount: snapshot.data.length,
+ ),
+ );
+ } else {
+ return getNone();
+ }
+ },
+ ),
+ StreamBuilder>(
+ stream: homeBloc.specials,
+ builder: (context, snapshot) {
+ if (snapshot.hasData && snapshot.data.isNotEmpty) {
+ return SliverGrid(
+ gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+ crossAxisCount: 4,
+ crossAxisSpacing: 1.0,
+ mainAxisSpacing: 1.0,
+ childAspectRatio: 0.73,
+ ),
+ delegate: SliverChildBuilderDelegate(
+ (BuildContext context, int index) {
+ Special special = snapshot.data[index];
+ return Center(
+ child: GestureDetector(
+ onTap: () {
+ Navigator.pushNamed(context, UIData.ShopDetailPage,
+ arguments: special.productId);
+ },
+ child: buildActivityBottom(
+ index,
+ special.titleName == null ? "?" : special.titleName,
+ special.specialDesc == null
+ ? ""
+ : special.specialDesc,
+ special.imgUrl),
+ ),
+ );
+ },
+ childCount: snapshot.data.length,
+ ),
+ );
+ } else {
+ return getNone();
+ }
+ },
+ ),
+ StreamBuilder>(
+ stream: productBloc.productItems,
+ builder: (context, snapshot) {
+ if (snapshot.hasData) {
+ if (snapshot.data.isNotEmpty) {
+ return SliverList(
+ delegate: SliverChildListDelegate(
+ [
+ buildHotShop(),
+ ],
+ ),
+ );
+ } else {
+ return getNone();
+ }
+ } else {
+ return getNone();
+ }
+ }),
+ getFeatureGrid(),
]);
}
+ SliverList getNone() {
+ return SliverList(
+ delegate: SliverChildListDelegate(
+ [
+ Container(
+ height: 0,
+ width: 0,
+ )
+ ],
+ ),
+ );
+ }
+
DefaultTabController buildDefaultTabController() {
return DefaultTabController(
length: choices.length,
@@ -198,7 +235,7 @@ class _MyHomePageState extends State {
);
}
- Container buildHeader() {
+ buildHeader() {
return Container(
height: 44.0,
color: Colors.white,
@@ -232,6 +269,7 @@ class _MyHomePageState extends State {
alignment: Alignment.center,
height: 30.0,
decoration: BoxDecoration(
+ color: Colors.white,
border: Border.all(color: Color(0xFFF5F5F5), width: 15.0),
borderRadius:
new BorderRadius.all(new Radius.circular(15.0)),
@@ -281,68 +319,86 @@ class _MyHomePageState extends State {
);
}
- BannerWidget buildBanner() {
- return BannerWidget(
- data: data,
- curve: Curves.linear,
- onClick: (position, bannerWithEval) {
- print(position);
- });
+ Widget buildBanner() {
+ homeBloc.getImages();
+ return SliverList(
+ delegate: SliverChildListDelegate(
+ [
+ StreamBuilder>(
+ stream: homeBloc.tabItems,
+ builder: (context, snapshot) {
+ if (snapshot.hasError) {
+ Result result = snapshot.error;
+ return ErrorStatusWidget.order(
+ result.code, result.msg, "点击重试", () {
+ homeBloc.getHomeAll();
+ });
+ } else if (snapshot.hasData) {
+ if (snapshot.data.isNotEmpty) {
+ return BannerWidget(
+ data: snapshot.data,
+ curve: Curves.linear,
+ onClick: (position, bannerWithEval) {
+ print(position);
+ });
+ } else {
+ return ErrorStatusWidget.order(0, "暂无数据", "点击重试", () {
+ homeBloc.getHomeAll();
+ });
+ }
+ } else {
+ return Center(child: CircularProgressIndicator());
+ }
+ })
+ ],
+ ),
+ );
}
- Container buildType() {
- return Container(
- padding: EdgeInsets.fromLTRB(10.0, 15.0, 10.0, 4.0),
- color: Colors.white,
- child: Column(
- children: [
- Row(
- children: [
- Expanded(
- child: buildTypeChild(
- 0,
- "服饰",
- "images/shop_type_hat.png",
+ Widget buildType() {
+ homeBloc.getHomeCategoryList();
+ return HomeBlocProvider(
+ bloc: homeBloc,
+ child: StreamBuilder>(
+ stream: homeBloc.homeCategory,
+ builder: (context, snapshot) {
+ if (snapshot.hasError) {
+ print(snapshot.error);
+ return SliverList(
+ delegate: SliverChildListDelegate(
+ [
+ Container(
+ width: 0,
+ height: 0,
+ ),
+ ],
),
- ),
- Expanded(
- child: buildTypeChild(1, "鞋帽箱包", "images/shop_type_hat.png"),
- ),
- Expanded(
- child: buildTypeChild(2, "丽人", "images/shop_type_beauty.png"),
- ),
- Expanded(
- child:
- buildTypeChild(3, "家具家装", "images/shop_type_furniture.png"),
- ),
- Expanded(
- child: buildTypeChild(4, "生活服务", "images/shop_type_life.png"),
- ),
- ],
- ),
- Row(
- children: [
- Expanded(
- child: buildTypeChild(5, "数码", "images/shop_type_hat.png"),
- ),
- Expanded(
- child: buildTypeChild(6, "办公", "images/shop_type_office.png"),
- ),
- Expanded(
- child: buildTypeChild(7, "百货超市", "images/shop_type_store.png"),
- ),
- Expanded(
- child:
- buildTypeChild(8, "教育培训", "images/shop_type_education.png"),
- ),
- Expanded(
- child: buildTypeChild(
- 9, "分类", "images/shop_type_classification.png"),
- ),
- ],
- ),
- ],
- ),
+ );
+ } else if (snapshot.hasData) {
+ List list = snapshot.data;
+ return SliverGrid(
+ gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+ crossAxisCount: 5,
+ childAspectRatio: 0.9, //item长宽比
+ crossAxisSpacing: 5.0,
+ mainAxisSpacing: 5.0,
+ ),
+ delegate: SliverChildBuilderDelegate(
+ (BuildContext context, int index) {
+ HomeCategory item = list[index];
+
+ return Container(
+ child: buildTypeChild(int.parse(item.categoryId),
+ item.categoryName, item.categoryImgUrl),
+ );
+ },
+ childCount: list.length,
+ ),
+ );
+ } else {
+ return getNone();
+ }
+ }),
);
}
@@ -374,6 +430,7 @@ class _MyHomePageState extends State {
style: TextStyle(color: Colors.white, fontSize: 12),
),
decoration: new BoxDecoration(
+ color: Colors.white,
borderRadius: BorderRadius.only(
topRight: Radius.circular(15.0),
bottomRight: Radius.circular(15.0)),
@@ -385,22 +442,26 @@ class _MyHomePageState extends State {
Expanded(
child: Container(),
),
- Row(
- mainAxisAlignment: MainAxisAlignment.end,
- children: [
- Text(
- "更多",
- style: TextStyle(color: UIData.ff999999, fontSize: 12),
- ),
- Padding(
- child: Icon(
- Icons.arrow_forward_ios,
- color: UIData.ff999999,
- size: 9,
+ Container(
+ width: 0,
+ height: 0,
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ Text(
+ "更多",
+ style: TextStyle(color: UIData.ff999999, fontSize: 12),
),
- padding: EdgeInsets.fromLTRB(2, 0, 12, 0),
- ),
- ],
+ Padding(
+ child: Icon(
+ Icons.arrow_forward_ios,
+ color: UIData.ff999999,
+ size: 9,
+ ),
+ padding: EdgeInsets.fromLTRB(2, 0, 12, 0),
+ ),
+ ],
+ ),
),
],
),
@@ -409,56 +470,74 @@ class _MyHomePageState extends State {
);
}
- Container buildTypeChild(int type, String typeName, String typeImg) {
- return Container(
- child: InkWell(
+ Widget getFeatureGrid() {
+ productBloc.getFeatures(1, 10);
+ return ProductProvider(
+ productBloc: productBloc,
+ child: StreamBuilder>(
+ stream: productBloc.productItems,
+ builder: (context, snapshot) {
+ if (snapshot.hasData) {
+ if (snapshot.data.isNotEmpty) {
+ return getFeatursGrid(snapshot.data);
+ } else {
+ return ErrorStatusWidget.sliver(0, "暂无数据", "点击重试", () {
+ productBloc.getFeatures(1, 10);
+ });
+ }
+ } else if (snapshot.hasError) {
+ return getNone();
+ } else {
+ return getNone();
+ }
+ }),
+ );
+ }
+
+ SliverGrid getFeatursGrid(List items) {
+ return SliverGrid(
+ gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+ crossAxisCount: 2,
+ childAspectRatio: (0.7), //item长宽比
+ mainAxisSpacing: 5.0,
+ crossAxisSpacing: 5.0,
+ ),
+ delegate: SliverChildBuilderDelegate(
+ (BuildContext context, int index) {
+ return Padding(
+ padding: const EdgeInsets.all(2.0),
+ child: Container(
+ child: productGrid(items[index], index),
+ ),
+ );
+ },
+ childCount: items.length,
+ ),
+ );
+ }
+
+ Widget buildTypeChild(int type, String typeName, String typeImg) {
+ return InkWell(
child: Column(
children: [
- Image.asset(
- typeImg,
- width: 43.0,
- height: 43.0,
- ),
- Padding(
- padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 16.0),
- child: Text(
- typeName,
- style: TextStyle(color: Color(0xFF666666), fontSize: 11),
- ),
+ UIData.getImageWithWH(typeName, 56, 56),
+ Text(
+ typeName,
+ style: TextStyle(color: Color(0xFF666666), fontSize: 11),
),
],
),
//每一个类别点击事件
onTap: () {
- switch (type) {
- case 0:
- break;
- case 1:
- break;
- case 2:
- break;
- case 3:
- break;
- case 4:
- break;
- case 5:
- break;
- case 6:
- break;
- case 7:
- break;
- case 8:
- break;
- case 9:
- Navigator.pushNamed(context, UIData.ShopCategoryList,
- arguments: "全部分类");
- break;
- }
+ Category category = new Category();
+ category.id = type;
+ category.name = typeName;
+ Navigator.pushNamed(context, UIData.ShopListPage, arguments: category);
},
- ));
+ );
}
- Container buildDiscountItem(int index, Product product) {
+ Container buildDiscountItem(int index, Promotion product) {
return Container(
child: InkWell(
child: Row(
@@ -471,7 +550,9 @@ class _MyHomePageState extends State {
Padding(
padding: EdgeInsets.fromLTRB(12.0, 16.0, 0.0, 4.0),
child: Text(
- product.name,
+ product.promotionTitle == null
+ ? "拜托 名字都不取一个?"
+ : product.promotionTitle,
maxLines: 1,
style: TextStyle(color: Color(0xFF353535), fontSize: 13),
),
@@ -479,16 +560,53 @@ class _MyHomePageState extends State {
Padding(
padding: EdgeInsets.fromLTRB(12.0, 0.0, 0.0, 0.0),
child: Text(
- product.description,
+ product.promotionDesc == null
+ ? ""
+ : product.promotionDesc,
maxLines: 1,
style: TextStyle(color: Color(0xFF999999), fontSize: 11),
),
),
Padding(
padding: EdgeInsets.fromLTRB(12.0, 8.0, 0.0, 0.0),
- child: Text(
- product.price,
- style: TextStyle(color: Color(0xFFEF2F2F), fontSize: 15),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Expanded(
+ child: Center(
+ child: Text(
+ "¥" +
+ (product.promotionPrice == null
+ ? "?"
+ : product.promotionPrice),
+ style: TextStyle(
+ color: Color(0xFFEF2F2F), fontSize: 13),
+ ),
+ ),
+ ),
+ Padding(
+ padding: EdgeInsets.fromLTRB(0, 0.0, 12.0, 0.0),
+ child: Center(
+ child: RichText(
+ text: new TextSpan(
+ children: [
+ new TextSpan(
+ text: product.sellPrice == null
+ ? ""
+ : product.sellPrice,
+ style: TextStyle(
+ color: Color(0xFF999999),
+ fontSize: 11,
+ decoration: TextDecoration.lineThrough,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ )
+ ],
),
),
],
@@ -497,23 +615,17 @@ class _MyHomePageState extends State {
Padding(
padding: EdgeInsets.fromLTRB(3.0, 12.0, 6.0, 0.0),
child: UIData.getImageWithWHFit(
- product.image,
+ product.imgUrl,
BoxFit.cover,
75.0,
75.0,
),
),
-// index % 2 == 0
-// ? Container()
-// : Container(
-// width: 1.0,
-// color: Color(0xFFEEEEEE),
-// ),
],
),
onTap: () {
Navigator.pushNamed(context, UIData.ShopDetailPage,
- arguments: product.skuId);
+ arguments: product.productId);
},
),
);
@@ -557,78 +669,9 @@ class _MyHomePageState extends State {
padding: EdgeInsets.fromLTRB(2.0, 0.0, 0.0, 0.0),
child: UIData.getImageWithWHFit(
rightImage,
- BoxFit.cover,
- 166.0,
- 130.0,
- ),
- ),
- ],
- ),
- );
- }
-
- Container buildActivity() {
- return Container(
- color: Colors.white,
- height: 270.0,
- child: Column(
- children: [
- Expanded(
- child: Row(
- children: [
- Expanded(
- child: InkWell(
- child: buildActivityTopLeft(),
- //天天特价栏点击事件
- onTap: () {},
- ),
- ),
- Container(
- width: 1.0,
- color: Color(0xFFEEEEEE),
- ),
- Expanded(
- child: InkWell(
- child: buildActivityTopRight(),
- //品牌闪购点击事件
- onTap: () {},
- ),
- ),
- ],
- ),
- ),
- Expanded(
- child: Row(
- children: [
- Expanded(
- child: buildActivityBottom(0, "天猫Outlets", "大品牌79元购",
- "https://img11.360buyimg.com/mobilecms/s110x110_jfs/t1/22034/24/5708/134994/5c41416cE61e9ab02/358c89e09077ac5c.png!q90!cc_110x110.webp"),
- ),
- Container(
- width: 1.0,
- color: Color(0xFFEEEEEE),
- ),
- Expanded(
- child: buildActivityBottom(1, "量贩优选", "1分钱疯抢",
- "https://img11.360buyimg.com/mobilecms/s110x110_jfs/t1/14748/13/13064/114779/5c9dc90fEcd69f15a/9a3ae485e894bf66.jpg!q90!cc_110x110.webp"),
- ),
- Container(
- width: 1.0,
- color: Color(0xFFEEEEEE),
- ),
- Expanded(
- child: buildActivityBottom(2, "淘宝心选", "官方自营品牌",
- "https://img11.360buyimg.com/mobilecms/s110x110_jfs/t1/23443/5/10735/27836/5c88a96aE59ff0726/5f43bec36e308837.jpg!q90!cc_110x110.webp"),
- ),
- Container(
- width: 1.0,
- color: Color(0xFFEEEEEE),
- ),
- Expanded(
- child: buildActivityBottom(3, "聚名品", "轻奢限量抢",
- "https://img11.360buyimg.com/mobilecms/s110x110_jfs/t1/29836/32/1174/55982/5c0fbfe7E5d0a5db9/3226b9a61def3bb3.jpg!q90!cc_110x110.webp"),
- ),
- ],
+ BoxFit.cover,
+ 166.0,
+ 130.0,
),
),
],
@@ -636,113 +679,12 @@ class _MyHomePageState extends State {
);
}
- Column buildActivityTopLeft() {
- return Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Padding(
- padding: EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 4.0),
- child: Text(
- "天天特价",
- style: TextStyle(color: Color(0xFFFF3507), fontSize: 14),
- ),
- ),
- Padding(
- padding: EdgeInsets.fromLTRB(10.0, 0.0, 0.0, 4.0),
- child: Text(
- "9.9元包邮好货随心抢",
- style: TextStyle(color: Color(0xFF999999), fontSize: 11),
- ),
- ),
- Padding(
- padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
- child: Row(
- children: [
- UIData.getImageWithWHFit(
- "https://img13.360buyimg.com/mobilecms/s140x140_jfs/t1/5542/25/10695/184499/5bcc0adcE903a8a97/c43423eedf3039cf.jpg!q90.webp",
- BoxFit.cover,
- 70.0,
- 70.0,
- ),
- Expanded(
- child: Container(),
- ),
- UIData.getImageWithWHFit(
- "https://img12.360buyimg.com/mobilecms/s140x140_jfs/t28132/336/144040487/125605/531bc317/5be9427dN7a38cc7f.jpg!q90.webp",
- BoxFit.cover,
- 70.0,
- 70.0,
- ),
- ],
- ),
- ),
- Expanded(
- child: Container(),
- ),
- Container(
- height: 1.0,
- color: Color(0xFFEEEEEE),
- )
- ],
- );
- }
-
- Column buildActivityTopRight() {
- return Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Padding(
- padding: EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 4.0),
- child: Text(
- "品牌闪购",
- style: TextStyle(color: Color(0xFF333333), fontSize: 14),
- ),
- ),
- Padding(
- padding: EdgeInsets.fromLTRB(10.0, 0.0, 0.0, 4.0),
- child: Text(
- "每日签到 可抢5折卷",
- style: TextStyle(color: Color(0xFF999999), fontSize: 11),
- ),
- ),
- Padding(
- padding: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
- child: Row(
- children: [
- UIData.getImageWithWHFit(
- "https://img11.360buyimg.com/mobilecms/s140x140_jfs/t1/36973/38/1895/117319/5cb453e9E93fc31a1/6edd54fcfd32ce9c.png!q90.webp",
- BoxFit.cover,
- 70.0,
- 70.0,
- ),
- Expanded(
- child: Container(),
- ),
- UIData.getImageWithWHFit(
- "https://img11.360buyimg.com/mobilecms/s140x140_jfs/t1/9339/14/3383/296696/5bd69f43E5078db49/40af3283649c059e.jpg!q90.webp",
- BoxFit.cover,
- 70.0,
- 70.0,
- ),
- ],
- ),
- ),
- Expanded(
- child: Container(),
- ),
- Container(
- height: 1.0,
- color: Color(0xFFEEEEEE),
- )
- ],
- );
- }
-
InkWell buildActivityBottom(
int type, String title, String subTitle, String imageUrl) {
return InkWell(
child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.center,
children: [
Padding(
padding: EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 4.0),
@@ -762,101 +704,97 @@ class _MyHomePageState extends State {
alignment: Alignment.center,
child: UIData.getImageWithWHFit(
imageUrl,
- BoxFit.cover,
- 70.0,
- 70.0,
+ BoxFit.cover,
+ 70.0,
+ 70.0,
),
),
],
),
- onTap: () {
- switch (type) {
- case 0:
- break;
- case 1:
- break;
- case 2:
- break;
- case 3:
- break;
- }
- },
);
}
- Container buildHotShop() {
- return Container(
- color: Color(0xFFF6F6F6),
- alignment: Alignment.center,
- height: 62.0,
- child: Image.asset(
- "images/icon_home_hot_shop.png",
- height: 15.0,
+ Widget buildHotShop() {
+ return Center(
+ child: Container(
+ color: Color(0xFFF6F6F6),
+ alignment: Alignment.center,
+ child: Padding(
+ padding: const EdgeInsets.fromLTRB(0, 20, 0, 16),
+ child: Image.asset(
+ "images/icon_home_hot_shop.png",
+ height: 15.0,
+ ),
+ ),
),
);
}
- Container buildHotShopItem(int index, Product product) {
- return Container(
+ Widget productGrid(ProductItem product, int index) {
+ String imageUrl = "";
+ if (product.medias.length > 0) {
+ imageUrl = product.medias[0].toString();
+ }
+ return Padding(
padding: EdgeInsets.fromLTRB(
- index % 2 == 0 ? 4.0 : 0.0, 0.0, index % 2 == 0 ? 0.0 : 4.0, 0.0),
- child: InkWell(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- children: [
- Container(
- width: 170.0,
- height: 170.0,
- decoration: BoxDecoration(
- shape: BoxShape.rectangle,
- borderRadius: BorderRadius.only(
- topLeft: Radius.circular(5.0),
- topRight: Radius.circular(5.0)),
- image: DecorationImage(
- image: NetworkImage(product.image), fit: BoxFit.cover),
- ),
- ),
- Expanded(
- child: Container(
- width: 170.0,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Padding(
- padding: EdgeInsets.fromLTRB(14.0, 12.0, 12.0, 10.0),
- child: Text(
- product.name,
- maxLines: 1,
- style:
- TextStyle(color: Color(0xFF353535), fontSize: 12.0),
- ),
- ),
- Padding(
- padding: EdgeInsets.fromLTRB(14.0, 0.0, 0.0, 0.0),
- child: Text(
- product.price,
- style:
- TextStyle(color: Color(0xFFFA4848), fontSize: 16.0),
- ),
- ),
- ],
- ),
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.only(
- bottomLeft: Radius.circular(5.0),
- bottomRight: Radius.circular(5.0)),
+ index % 2 == 0 ? 5.0 : 0.0, 0.0, index % 2 == 0 ? 0.0 : 5.0, 0.0),
+ child: new GestureDetector(
+ child: new Card(
+ elevation: 5.0,
+ child: new Container(
+ child: new Stack(
+ children: [
+ Positioned(
+ top: 0,
+ left: 0,
+ right: 0,
+ child: UIData.getImage(
+ imageUrl,
+ ),
),
- ),
- ),
- Container(
- height: 6.0,
+ Positioned(
+ bottom: 0,
+ left: 0,
+ right: 0,
+ child: new Container(
+ width: 140,
+ color: Colors.white,
+ child: new Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ new Padding(
+ padding: EdgeInsets.fromLTRB(5, 0, 5, 4),
+ child: Container(
+ width: 140,
+ child: new Text(
+ product.name,
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ style: TextStyle(
+ fontSize: 12, color: UIData.ff353535),
+ ),
+ ),
+ ),
+ new Padding(
+ padding: EdgeInsets.fromLTRB(5, 4, 5, 4),
+ child: new Text(
+ "¥" + product.price.toString(),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: TextStyle(color: Colors.red, fontSize: 16),
+ ),
+ ),
+ ],
+ ),
+ )),
+ ],
),
- ],
+ ),
),
onTap: () {
Navigator.pushNamed(context, UIData.ShopDetailPage,
- arguments: product.skuId);
+ arguments: product.id.toString());
},
),
);
diff --git a/flutter_lib/lib/ui/page/dashboard/user_home_page.dart b/flutter_lib/lib/ui/page/dashboard/user_home_page.dart
index 62bb1ab..48a6133 100644
--- a/flutter_lib/lib/ui/page/dashboard/user_home_page.dart
+++ b/flutter_lib/lib/ui/page/dashboard/user_home_page.dart
@@ -1,6 +1,8 @@
import 'dart:ui';
import 'package:flutter/material.dart';
+import 'package:flutter_lib/bridge/account_bridge.dart';
+import 'package:flutter_lib/bridge/common_bridge.dart';
import 'package:flutter_lib/logic//bloc/userinfo_bloc.dart';
import 'package:flutter_lib/logic/viewmodel/homeitem_view_model.dart';
import 'package:flutter_lib/model/homeitem.dart';
@@ -25,103 +27,401 @@ class _UserHomeState extends State {
// statusBarColor: UIData.fffa4848, //or set color with: Color(0xFF0000FF)
// ));
//InfoBridge.wxInfo();
- return Scaffold(
- body: buildBody(),
- );
+// return Scaffold(
+// body: getContent(),
+// );
+ return getContent();
}
- Container buildBody() {
+ Container buildBody(Userinfo userInfo) {
return Container(
child: Stack(
+ alignment: Alignment.topCenter,
+ fit: StackFit.loose,
+ //子Widgets溢出的处理方式
+ overflow: Overflow.visible,
children: [
Positioned(
top: 0,
bottom: 0,
left: 0,
right: 0,
- child: new Scaffold(body: bodyData())),
+ child: new Scaffold(body: bodyData(userInfo))),
+ //充值成VIP
+ Positioned(
+ top: 152,
+ left: 10,
+ right: 10,
+ child: buildBannerVipHeader(userInfo),
+ )
],
),
);
}
/*
- * 创建头部布局
+ * 创建邀请成为vip
*/
- Widget buildHeader(Userinfo userInfo) {
- return Padding(
- padding: EdgeInsets.all(10),
- child: Container(
- child: Card(
- child: Column(
- children: [
- Row(
+ Widget buildBannerVipHeader(Userinfo userInfo) {
+ print("创建邀请成为vip");
+ return Container(
+ padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
+ child: Container(
+ child: GestureDetector(
+ onTap: () {
+ Navigator.pushNamed(context, UIData.VipApplyPage,
+ arguments: 0);
+ },
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ Expanded(
+ child: Row(children: