Browse Source

Merge branch 'master' into dev

master
w-R 3 years ago
parent
commit
f4ced26d64
  1. 1
      android/app/build.gradle
  2. 10
      ios/Podfile.lock
  3. 48
      ios/Runner.xcodeproj/project.pbxproj
  4. 2
      ios/UniMPSDK/Resources/PandoraApi.bundle/all.js
  5. BIN
      ios/UniMPSDK/Resources/PandoraApi.bundle/beep-beep.caf
  6. 353
      ios/UniMPSDK/Resources/PandoraApi.bundle/feature.plist
  7. BIN
      ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/en.lproj/Localizable.strings
  8. BIN
      ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hans.lproj/Localizable.strings
  9. BIN
      ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hant.lproj/Localizable.strings
  10. BIN
      ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/en.lproj/Localizable.strings
  11. BIN
      ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hans.lproj/Localizable.strings
  12. BIN
      ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hant.lproj/Localizable.strings
  13. BIN
      ios/UniMPSDK/Resources/PandoraApi.bundle/iconfont.ttf
  14. 2
      lib/home/activity_list_page.dart
  15. 27
      lib/home/home_page.dart
  16. 3
      lib/home/home_view/brand_view.dart
  17. 4
      lib/home/home_view/home_banner.dart
  18. 2
      lib/home/home_view/hot_article.dart
  19. 4
      lib/home/huixiang_view/huixiang_banner.dart
  20. 4
      lib/home/points_mall_view/points_mall_banner.dart
  21. 583
      lib/integral/integral_page.dart
  22. 236
      lib/integral/intergra_view/in_for_points.dart
  23. 202
      lib/integral/intergra_view/integral_task.dart
  24. 132
      lib/integral/intergra_view/integral_vip.dart
  25. 17
      lib/main.dart
  26. 1
      lib/mine/mine_page.dart
  27. 5
      lib/mine/mine_vip_level_page.dart
  28. 19
      lib/mine/mine_wallet_page.dart
  29. 6
      lib/mine/recharge_page.dart
  30. 17
      lib/order/order_detail_page.dart
  31. 1006
      lib/union/store_details_page.dart
  32. 2
      lib/union/union_details_page.dart
  33. 2
      lib/union/union_page.dart
  34. 10
      lib/view_widget/comment_menu.dart
  35. 4
      lib/view_widget/hot_item.dart
  36. 340
      lib/view_widget/mine_vip_view.dart
  37. 318
      lib/web/web_page.dart
  38. 422
      lib/web/web_view/comment_list.dart
  39. 178
      lib/web/web_view/input_comment.dart
  40. 170
      lib/web/web_view/web_content.dart
  41. 100
      lib/web/web_view/web_header.dart
  42. 7
      pubspec.lock
  43. 2
      pubspec.yaml

1
android/app/build.gradle

@ -36,7 +36,6 @@ MobSDK {
ShareSDK {
// platform configuration information
devInfo {
Wechat {
id 4

10
ios/Podfile.lock

@ -7,7 +7,6 @@ PODS:
- BaiduMapKit/Utils (6.2.0):
- BaiduMapKit/Base
- BMKLocationKit (2.0.0)
- Bugly (2.5.90)
- Flutter (1.0.0)
- flutter_baidu_mapapi_base (2.0.0):
- BaiduMapKit/Utils (= 6.2.0)
@ -27,9 +26,6 @@ PODS:
- flutter_bmflocation (1.0.3):
- BMKLocationKit
- Flutter
- flutter_bugly (0.0.1):
- Bugly
- Flutter
- fluwx (0.0.1):
- Flutter
- WechatOpenSDK (= 1.8.7.1)
@ -108,7 +104,6 @@ DEPENDENCIES:
- flutter_baidu_mapapi_search (from `.symlinks/plugins/flutter_baidu_mapapi_search/ios`)
- flutter_baidu_mapapi_utils (from `.symlinks/plugins/flutter_baidu_mapapi_utils/ios`)
- flutter_bmflocation (from `.symlinks/plugins/flutter_bmflocation/ios`)
- flutter_bugly (from `.symlinks/plugins/flutter_bugly/ios`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`)
@ -129,7 +124,6 @@ SPEC REPOS:
trunk:
- BaiduMapKit
- BMKLocationKit
- Bugly
- FMDB
- mob_sharesdk
- MOBFoundation
@ -151,8 +145,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_baidu_mapapi_utils/ios"
flutter_bmflocation:
:path: ".symlinks/plugins/flutter_bmflocation/ios"
flutter_bugly:
:path: ".symlinks/plugins/flutter_bugly/ios"
fluwx:
:path: ".symlinks/plugins/fluwx/ios"
image_cropper:
@ -185,14 +177,12 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
BaiduMapKit: 907c6d9b74f66c3ff4741fc4b568ae0b339917f8
BMKLocationKit: 097814ef672b1e57e86e6c1968d7892fb78002bf
Bugly: 88bc32c0acc6fef7b74d610f0319ee7560d6b9fe
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
flutter_baidu_mapapi_base: 90fddba11ec4435406a7211d6ee905b4311c31db
flutter_baidu_mapapi_map: 771bf00671832b1fcddb17733518cd631529df16
flutter_baidu_mapapi_search: 4cffaa74e739a4114595c4f82f790e1783bb612d
flutter_baidu_mapapi_utils: a5bd582b91ecd35be1bc45558b38f49d5684f70a
flutter_bmflocation: 12f1ba91bae4b16d78d4f475023e0254ed351f1c
flutter_bugly: c9800f4d5bc5bdc27ffdde3417a26ba44266e0c3
fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb

48
ios/Runner.xcodeproj/project.pbxproj

@ -47,6 +47,13 @@
6EE8F376269581FB00237A5E /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F375269581FB00237A5E /* AddressBook.framework */; };
6EE8F3782695820600237A5E /* libiconv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 6EE8F3772695820600237A5E /* libiconv.tbd */; };
6EE8F37F269582C200237A5E /* UniappPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 6EE8F37E269582C200237A5E /* UniappPlugin.m */; };
89319A6F26E237A5001EFBD7 /* __uniappes6.js in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6826E237A5001EFBD7 /* __uniappes6.js */; };
89319A7026E237A5001EFBD7 /* uni-jsframework.js in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6926E237A5001EFBD7 /* uni-jsframework.js */; };
89319A7126E237A5001EFBD7 /* PandoraApi.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6A26E237A5001EFBD7 /* PandoraApi.bundle */; };
89319A7226E237A5001EFBD7 /* unincomponents.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6B26E237A5001EFBD7 /* unincomponents.ttf */; };
89319A7326E237A5001EFBD7 /* userPosition@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6C26E237A5001EFBD7 /* userPosition@2x.png */; };
89319A7426E237A5001EFBD7 /* weex-polyfill.js in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6D26E237A5001EFBD7 /* weex-polyfill.js */; };
89319A7526E237A5001EFBD7 /* weexUniJs.js in Resources */ = {isa = PBXBuildFile; fileRef = 89319A6E26E237A5001EFBD7 /* weexUniJs.js */; };
899C4C3C26A5179900B44087 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 899C4C3E26A5179900B44087 /* InfoPlist.strings */; };
89A6269F26A7F6D30004A8F0 /* liblibPayment.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89A6269E26A7F6D30004A8F0 /* liblibPayment.a */; };
89A626A126A7F6E30004A8F0 /* libwxpay.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 89A626A026A7F6E30004A8F0 /* libwxpay.a */; };
@ -214,6 +221,13 @@
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = "<group>"; };
81880E8F5E90EA6E5E0D57EB /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
89319A6826E237A5001EFBD7 /* __uniappes6.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = __uniappes6.js; sourceTree = "<group>"; };
89319A6926E237A5001EFBD7 /* uni-jsframework.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "uni-jsframework.js"; sourceTree = "<group>"; };
89319A6A26E237A5001EFBD7 /* PandoraApi.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = PandoraApi.bundle; sourceTree = "<group>"; };
89319A6B26E237A5001EFBD7 /* unincomponents.ttf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = unincomponents.ttf; sourceTree = "<group>"; };
89319A6C26E237A5001EFBD7 /* userPosition@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "userPosition@2x.png"; sourceTree = "<group>"; };
89319A6D26E237A5001EFBD7 /* weex-polyfill.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "weex-polyfill.js"; sourceTree = "<group>"; };
89319A6E26E237A5001EFBD7 /* weexUniJs.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = weexUniJs.js; sourceTree = "<group>"; };
89847A4826A14482008C8077 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = "<group>"; };
899C4C3826A5171500B44087 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
899C4C3926A5171500B44087 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
@ -393,6 +407,7 @@
6EE8F2E52695815A00237A5E /* Resources */ = {
isa = PBXGroup;
children = (
89319A6726E237A5001EFBD7 /* Resources */,
89AEFA8226A684D700DD2817 /* userPosition@2x.png */,
6EE8F2E62695815A00237A5E /* __uniappes6.js */,
6EE8F2E72695815A00237A5E /* uni-jsframework.js */,
@ -524,6 +539,20 @@
path = Libs;
sourceTree = "<group>";
};
89319A6726E237A5001EFBD7 /* Resources */ = {
isa = PBXGroup;
children = (
89319A6826E237A5001EFBD7 /* __uniappes6.js */,
89319A6926E237A5001EFBD7 /* uni-jsframework.js */,
89319A6A26E237A5001EFBD7 /* PandoraApi.bundle */,
89319A6B26E237A5001EFBD7 /* unincomponents.ttf */,
89319A6C26E237A5001EFBD7 /* userPosition@2x.png */,
89319A6D26E237A5001EFBD7 /* weex-polyfill.js */,
89319A6E26E237A5001EFBD7 /* weexUniJs.js */,
);
name = Resources;
sourceTree = "<group>";
};
89A626A826A7FFF30004A8F0 /* wx */ = {
isa = PBXGroup;
children = (
@ -678,18 +707,25 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
89319A6F26E237A5001EFBD7 /* __uniappes6.js in Resources */,
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
89319A7526E237A5001EFBD7 /* weexUniJs.js in Resources */,
6EE8F3452695816000237A5E /* __uniappes6.js in Resources */,
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
6EE8F3472695816000237A5E /* PandoraApi.bundle in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
89319A7126E237A5001EFBD7 /* PandoraApi.bundle in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
6EE8F3482695816000237A5E /* unincomponents.ttf in Resources */,
6EE8F34A2695816000237A5E /* weexUniJs.js in Resources */,
6EE8F3492695816000237A5E /* weex-polyfill.js in Resources */,
89AEFA8426A684D800DD2817 /* userPosition@2x.png in Resources */,
899C4C3C26A5179900B44087 /* InfoPlist.strings in Resources */,
89319A7326E237A5001EFBD7 /* userPosition@2x.png in Resources */,
6EE8F3462695816000237A5E /* uni-jsframework.js in Resources */,
89319A7226E237A5001EFBD7 /* unincomponents.ttf in Resources */,
89319A7426E237A5001EFBD7 /* weex-polyfill.js in Resources */,
89319A7026E237A5001EFBD7 /* uni-jsframework.js in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -874,7 +910,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 36;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@ -924,7 +960,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 1.0.36;
MARKETING_VERSION = 1.0.38;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"$(inherited)",
@ -1110,7 +1146,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 36;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@ -1160,7 +1196,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 1.0.36;
MARKETING_VERSION = 1.0.38;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"$(inherited)",
@ -1239,7 +1275,7 @@
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 36;
CURRENT_PROJECT_VERSION = 38;
DEVELOPMENT_TEAM = YF3Q8DVP52;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
@ -1289,7 +1325,7 @@
"$(PROJECT_DIR)/baidu",
"$(PROJECT_DIR)/Runner/baidu",
);
MARKETING_VERSION = 1.0.36;
MARKETING_VERSION = 1.0.38;
ONLY_ACTIVE_ARCH = NO;
OTHER_LDFLAGS = (
"$(inherited)",

2
ios/UniMPSDK/Resources/PandoraApi.bundle/all.js

File diff suppressed because one or more lines are too long

BIN
ios/UniMPSDK/Resources/PandoraApi.bundle/beep-beep.caf

Binary file not shown.

353
ios/UniMPSDK/Resources/PandoraApi.bundle/feature.plist

@ -2,31 +2,52 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Accelerometer</key>
<key>Bluetooth</key>
<dict>
<key>class</key>
<string>PGAccelerometer</string>
<string>libBlueTooth</string>
</dict>
<key>Geolocation</key>
<dict>
<key>class</key>
<string>PGGeolocation</string>
<key>global</key>
<false/>
</dict>
<key>Ad</key>
<key>Orientation</key>
<dict>
<key>class</key>
<string>FeatureUniAd</string>
<string>PGOrientation</string>
<key>global</key>
<false/>
</dict>
<key>Maps</key>
<dict>
<key>class</key>
<string>PGMap</string>
<key>global</key>
<true/>
<key>server</key>
<dict>
<key>class</key>
<string>PGBaiduKeyVerify</string>
<key>identifier</key>
<string>com.baidu.keyverify</string>
</dict>
</dict>
<key>Audio</key>
<key>Device</key>
<dict>
<key>class</key>
<string>PGAudio</string>
<string>PGDeviceStatus</string>
<key>global</key>
<false/>
</dict>
<key>Bluetooth</key>
<key>File</key>
<dict>
<key>class</key>
<string>libBlueTooth</string>
<string>PGFile</string>
<key>global</key>
<false/>
</dict>
<key>Cache</key>
<dict>
@ -35,287 +56,271 @@
<key>global</key>
<false/>
</dict>
<key>Camera</key>
<key>Zip</key>
<dict>
<key>class</key>
<string>PGCamera</string>
<string>PGZip</string>
<key>global</key>
<true/>
<false/>
</dict>
<key>Console</key>
<key>Runtime</key>
<dict>
<key>class</key>
<string>PGLog</string>
<string>PGRuntime</string>
<key>global</key>
<true/>
<false/>
</dict>
<key>Contacts</key>
<key>Audio</key>
<dict>
<key>class</key>
<string>PGContacts</string>
<string>PGAudio</string>
<key>global</key>
<false/>
</dict>
<key>Device</key>
<key>Accelerometer</key>
<dict>
<key>class</key>
<string>PGDeviceStatus</string>
<string>PGAccelerometer</string>
<key>global</key>
<false/>
</dict>
<key>Downloader</key>
<key>Push</key>
<dict>
<key>class</key>
<string>PGDownload</string>
<key>server</key>
<dict>
<key>class</key>
<string>PGPushServer</string>
<key>identifier</key>
<string>com.pushserver</string>
</dict>
<key>baseclass</key>
<string>PGPush</string>
<key>global</key>
<true/>
<key>autostart</key>
<true/>
</dict>
<key>File</key>
<key>barcode</key>
<dict>
<key>class</key>
<string>PGFile</string>
<string>PGBarcode</string>
<key>global</key>
<false/>
<true/>
</dict>
<key>Gallery</key>
<key>XMLHttpRequest</key>
<dict>
<key>class</key>
<string>PGGallery</string>
<string>PGXHR</string>
<key>global</key>
<true/>
<false/>
</dict>
<key>Geolocation</key>
<key>UI</key>
<dict>
<key>class</key>
<string>PGGeolocation</string>
<string>PGUI</string>
<key>global</key>
<false/>
<key>extend</key>
<dict>
<key>Navigator</key>
<string>PG_Navigate</string>
<key>WebNavigator</key>
<string>PGWebNavi</string>
</dict>
</dict>
<key>Invocation</key>
<key>Contacts</key>
<dict>
<key>class</key>
<string>PGInvocation</string>
<string>PGContacts</string>
<key>global</key>
<false/>
</dict>
<key>LivePusher</key>
<key>Proximity</key>
<dict>
<key>class</key>
<string>PGLivePush</string>
<string>PGProximity</string>
<key>global</key>
<true/>
<false/>
</dict>
<key>Maps</key>
<key>Invocation</key>
<dict>
<key>class</key>
<string>PGMap</string>
<string>PGInvocation</string>
<key>global</key>
<true/>
<false/>
</dict>
<key>Statistic</key>
<dict>
<key>server</key>
<dict>
<key>class</key>
<string>PGBaiduKeyVerify</string>
<string>PGUmengStartUp</string>
<key>identifier</key>
<string>com.baidu.keyverify</string>
<string>com.umeng.startup</string>
</dict>
</dict>
<key>Media</key>
<dict>
<key>class</key>
<string>PGMediaVideo</string>
<string>PGStatistic</string>
<key>global</key>
<true/>
<key>autostart</key>
<false/>
</dict>
<key>Messaging</key>
<key>Camera</key>
<dict>
<key>class</key>
<string>PGMessaging</string>
<string>PGCamera</string>
<key>global</key>
<true/>
</dict>
<key>NativeObj</key>
<key>Console</key>
<dict>
<key>autostart</key>
<false/>
<key>class</key>
<string>PGNativeObj</string>
<string>PGLog</string>
<key>global</key>
<true/>
</dict>
<key>NativeUI</key>
<key>Storage</key>
<dict>
<key>class</key>
<string>PGNativeUI</string>
<string>PGNStorage</string>
<key>autostart</key>
<true/>
<key>global</key>
<false/>
<true/>
</dict>
<key>Navigator</key>
<key>Gallery</key>
<dict>
<key>class</key>
<string>PGNavigator</string>
<string>PGGallery</string>
<key>global</key>
<false/>
<true/>
</dict>
<key>Notification</key>
<key>Downloader</key>
<dict>
<key>autostart</key>
<true/>
<key>class</key>
<string>PGNotification</string>
<string>PGDownload</string>
<key>global</key>
<true/>
</dict>
<key>OAuth</key>
<key>Messaging</key>
<dict>
<key>class</key>
<string>PGOauthManager</string>
<key>extend</key>
<dict>
<key>apple</key>
<string>PGAppleOauth</string>
<key>qihoo</key>
<string>PGQHOauth</string>
<key>qq</key>
<string>PGQQOauth</string>
<key>univerify</key>
<string>PGUniVerify</string>
<key>weibo</key>
<string>PGSinaWBOauth</string>
<key>weixin</key>
<string>PGWXOauth</string>
<key>xiaomi</key>
<string>PGMiOauth</string>
</dict>
<string>PGMessaging</string>
<key>global</key>
<true/>
</dict>
<key>Orientation</key>
<key>Uploader</key>
<dict>
<key>class</key>
<string>PGOrientation</string>
<string>PGUpload</string>
<key>global</key>
<false/>
<true/>
</dict>
<key>Payment</key>
<dict>
<key>class</key>
<string>PGPlatbyManager</string>
<key>extend</key>
<dict>
<key>alix</key>
<string>PGAlixPay</string>
<key>appleiap</key>
<string>PGPlatbyIAP</string>
<key>weixin</key>
<string>PGWXPay</string>
</dict>
<key>global</key>
<true/>
<key>extend</key>
<dict/>
</dict>
<key>Proximity</key>
<dict>
<key>class</key>
<string>PGProximity</string>
<key>global</key>
<false/>
</dict>
<key>Push</key>
<key>Speech</key>
<dict>
<key>autostart</key>
<true/>
<key>baseclass</key>
<string>PGPush</string>
<key>class</key>
<string>PGPushActualize</string>
<string>PGSpeech</string>
<key>global</key>
<true/>
<key>server</key>
<key>extend</key>
<dict>
<key>class</key>
<string>PGPushServerAct</string>
<key>identifier</key>
<string>com.pushserver</string>
<key>baidu</key>
<string>PGBaiduSpeech</string>
<key>ifly</key>
<string>PGIFLYSpeech</string>
</dict>
</dict>
<key>Runtime</key>
<key>OAuth</key>
<dict>
<key>class</key>
<string>PGRuntime</string>
<key>extend</key>
<dict>
<key>weibo</key>
<string>PGSinaWBOauth</string>
<key>xiaomi</key>
<string>PGMiOauth</string>
<key>qq</key>
<string>PGQQOauth</string>
<key>qihoo</key>
<string>PGQHOauth</string>
<key>weixin</key>
<string>PGWXOauth</string>
<key>apple</key>
<string>PGAppleOauth</string>
<key>univerify</key>
<string>PGUniVerify</string>
</dict>
<key>global</key>
<false/>
<true/>
<key>class</key>
<string>PGOauthManager</string>
</dict>
<key>Share</key>
<dict>
<key>argument</key>
<string>weixin</string>
<key>autostart</key>
<true/>
<key>class</key>
<string>PGShareManager</string>
<key>global</key>
<true/>
<key>autostart</key>
<true/>
<key>argument</key>
<string>weixin</string>
<key>extend</key>
<dict>
<key>qq</key>
<string>PGTencentQQShare</string>
<key>sinaweibo</key>
<string>PGSinaShare</string>
<key>tencentweibo</key>
<string>PGQQShare</string>
<key>sinaweibo</key>
<string>PGSinaShare</string>
<key>weixin</key>
<string>PGWXShare</string>
</dict>
<key>global</key>
<true/>
</dict>
<key>ShortVideo</key>
<key>NativeObj</key>
<dict>
<key>class</key>
<string>PluginShortVideo</string>
<key>global</key>
<string>PGNativeObj</string>
<key>autostart</key>
<false/>
<key>global</key>
<true/>
</dict>
<key>Speech</key>
<key>NativeUI</key>
<dict>
<key>class</key>
<string>PGSpeech</string>
<key>extend</key>
<dict>
<key>baidu</key>
<string>PGBaiduSpeech</string>
<key>ifly</key>
<string>PGIFLYSpeech</string>
</dict>
<string>PGNativeUI</string>
<key>global</key>
<true/>
<false/>
</dict>
<key>Sqlite</key>
<key>Navigator</key>
<dict>
<key>class</key>
<string>libSqlite</string>
<string>PGNavigator</string>
<key>global</key>
<false/>
</dict>
<key>Statistic</key>
<key>Notification</key>
<dict>
<key>autostart</key>
<false/>
<key>class</key>
<string>PGStatistic</string>
<string>PGNotification</string>
<key>global</key>
<true/>
<key>server</key>
<dict>
<key>class</key>
<string>PGUmengStartUp</string>
<key>identifier</key>
<string>com.umeng.startup</string>
</dict>
</dict>
<key>Storage</key>
<dict>
<key>autostart</key>
<true/>
</dict>
<key>fingerprint</key>
<dict>
<key>class</key>
<string>PGNStorage</string>
<string>Fingerprint</string>
<key>global</key>
<true/>
</dict>
@ -326,66 +331,52 @@
<key>global</key>
<false/>
</dict>
<key>UI</key>
<key>VideoPlayer</key>
<dict>
<key>class</key>
<string>PGUI</string>
<key>extend</key>
<dict>
<key>Navigator</key>
<string>PG_Navigate</string>
<key>WebNavigator</key>
<string>PGWebNavi</string>
</dict>
<string>PGVideo</string>
<key>global</key>
<false/>
<true/>
</dict>
<key>Uploader</key>
<key>Media</key>
<dict>
<key>class</key>
<string>PGUpload</string>
<string>PGMediaVideo</string>
<key>global</key>
<true/>
</dict>
<key>VideoPlayer</key>
<key>LivePusher</key>
<dict>
<key>class</key>
<string>PGVideo</string>
<string>PGLivePush</string>
<key>global</key>
<true/>
</dict>
<key>XMLHttpRequest</key>
<key>Ad</key>
<dict>
<key>class</key>
<string>PGXHR</string>
<string>FeatureUniAd</string>
<key>global</key>
<false/>
<true/>
</dict>
<key>Zip</key>
<key>ShortVideo</key>
<dict>
<key>class</key>
<string>PGZip</string>
<string>PluginShortVideo</string>
<key>global</key>
<false/>
</dict>
<key>barcode</key>
<dict>
<key>class</key>
<string>PGBarcode</string>
<key>global</key>
<true/>
</dict>
<key>fingerprint</key>
<key>iBeacon</key>
<dict>
<key>class</key>
<string>Fingerprint</string>
<string>PGBeacon</string>
<key>global</key>
<true/>
<false/>
</dict>
<key>iBeacon</key>
<key>Sqlite</key>
<dict>
<key>class</key>
<string>PGBeacon</string>
<string>libSqlite</string>
<key>global</key>
<false/>
</dict>

BIN
ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/en.lproj/Localizable.strings

Binary file not shown.

BIN
ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hans.lproj/Localizable.strings

Binary file not shown.

BIN
ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/developers/zh-Hant.lproj/Localizable.strings

Binary file not shown.

BIN
ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/en.lproj/Localizable.strings

Binary file not shown.

BIN
ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hans.lproj/Localizable.strings

Binary file not shown.

BIN
ios/UniMPSDK/Resources/PandoraApi.bundle/i18n/users/zh-Hant.lproj/Localizable.strings

Binary file not shown.

BIN
ios/UniMPSDK/Resources/PandoraApi.bundle/iconfont.ttf

Binary file not shown.

2
lib/home/activity_list_page.dart

@ -91,7 +91,7 @@ class _ActivityListPage extends State<ActivityListPage>
return InkWell(
onTap: () {
Navigator.of(context).pushNamed(
'/router/store_detail_page',
'/router/web_page',
arguments: {"activityId": activityList[position].id});
},
child: FrameSeparateWidget(

27
lib/home/home_page.dart

@ -77,17 +77,6 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
apiService = ApiService(Dio(),
context: context, token: value.getString('token'), showLoading: false);
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"model": {"type": "HOME_PAGE"},
}).catchError((onError) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
bannerData.clear();
bannerData.addAll(baseData.data.records);
if (bannerData.length > 0) controller.move(0, animation: false);
}
BaseData brand = await apiService.queryHomeBrand().catchError((onError) {
refreshController.refreshFailed();
});
@ -101,7 +90,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
BaseData<PageInfo<Article>> article = await apiService.queryArticle({
"pageNum": 1,
"pageSize": 2,
"pageSize": 3,
"searchKey": "",
"state": 1,
"type": 2
@ -119,18 +108,28 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
"pageNum": 1,
"pageSize": 10,
"state": 1
}).catchError((onError) {
refreshController.refreshFailed();
});
if (goodsData != null && goodsData.isSuccess) {
gooods.clear();
gooods.addAll(goodsData.data.list);
}
// SmartDialog.dismiss();
EasyLoading.dismiss();
BaseData<PageInfo<BannerData>> baseData = await apiService.queryBanner({
"model": {"type": "HOME_PAGE"},
}).catchError((onError) {
refreshController.refreshFailed();
});
if (baseData != null && baseData.isSuccess) {
bannerData.clear();
bannerData.addAll(baseData.data.records);
refreshController.refreshCompleted();
if (bannerData.length > 0) controller.move(0, animation: false);
} else {
refreshController.refreshFailed();
}
EasyLoading.dismiss();
}
@override

3
lib/home/home_view/brand_view.dart

@ -36,7 +36,6 @@ class _BrandView extends State<BrandView> {
);
}
brands() {
return Container(
height: 90.h,
@ -48,8 +47,6 @@ class _BrandView extends State<BrandView> {
loop: true,
itemBuilder: (context, position) {
return Container(
// height: 60.h,
// width: 120.w,
margin: EdgeInsets.symmetric(horizontal: 3.w, vertical: 15.h),
decoration: BoxDecoration(
color: Colors.white,

4
lib/home/home_view/home_banner.dart

@ -78,13 +78,13 @@ class _HomeBanner extends State<HomeBanner> {
break;
case 2:
Navigator.of(context)
.pushNamed('/router/store_detail_page', arguments: {
.pushNamed('/router/web_page', arguments: {
"activityId": bannerData.content,
});
break;
case 3:
Navigator.of(context)
.pushNamed('/router/store_detail_page', arguments: {
.pushNamed('/router/web_page', arguments: {
"articleId": bannerData.content,
});
break;

2
lib/home/home_view/hot_article.dart

@ -46,7 +46,7 @@ class _HotArticle extends State<HotArticle> {
itemCount: widget.articles != null
? ((widget.articles.length > 3) ? 3 : widget.articles.length)
: 0,
physics: BouncingScrollPhysics(),
physics: NeverScrollableScrollPhysics(),
scrollDirection: Axis.vertical,
padding: EdgeInsets.symmetric(vertical: 12.h),
itemBuilder: (context, position) {

4
lib/home/huixiang_view/huixiang_banner.dart

@ -70,13 +70,13 @@ class _HuiXiangBanner extends State<HuiXiangBanner> {
break;
case 2:
Navigator.of(context)
.pushNamed('/router/store_detail_page', arguments: {
.pushNamed('/router/web_page', arguments: {
"activityId": bannerData.content,
});
break;
case 3:
Navigator.of(context)
.pushNamed('/router/store_detail_page', arguments: {
.pushNamed('/router/web_page', arguments: {
"articleId": bannerData.content,
});
break;

4
lib/home/points_mall_view/points_mall_banner.dart

@ -76,13 +76,13 @@ class _PointMallBanner extends State<PointMallBanner> {
break;
case 2:
Navigator.of(context)
.pushNamed('/router/store_detail_page', arguments: {
.pushNamed('/router/web_page', arguments: {
"activityId": bannerData.content,
});
break;
case 3:
Navigator.of(context)
.pushNamed('/router/store_detail_page', arguments: {
.pushNamed('/router/web_page', arguments: {
"articleId": bannerData.content,
});
break;

583
lib/integral/integral_page.dart

@ -3,22 +3,20 @@ import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/integral/intergra_view/in_for_points.dart';
import 'package:huixiang/integral/intergra_view/integral_vip.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/rank.dart';
import 'package:huixiang/retrofit/data/sign_info.dart';
import 'package:huixiang/retrofit/data/task.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/round_button.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:huixiang/view_widget/sign_in_widget.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'intergra_view/integral_task.dart';
class IntegralPage extends StatefulWidget {
@override
@ -31,48 +29,44 @@ class _IntegralPage extends State<IntegralPage> {
ApiService apiService;
SignInfo signInfo;
UserInfo userinfo;
UserInfo userInfo;
List<Rank> ranks = [];
int rankLevel = 1;
@override
void initState() {
super.initState();
SharedPreferences.getInstance().then((value) {
apiService = ApiService(Dio(),
context: context,
token: value.getString("token"),
showLoading: false);
userinfo = UserInfo.fromJson(jsonDecode(value.getString("user")));
EasyLoading.show(status: S.of(context).zhengzaijiazai);
querySignInfo();
});
}
querySignInfo() async {
BaseData<SignInfo> baseData = await apiService.signInInfo();
EasyLoading.show(status: S.of(context).zhengzaijiazai);
SharedPreferences value = await SharedPreferences.getInstance();
apiService = ApiService(
Dio(),
context: context,
token: value.getString("token"),
showLoading: false,
);
userInfo = UserInfo.fromJson(jsonDecode(value.getString("user")));
BaseData<List<Rank>> rankData = await apiService.rankList();
BaseData<List<Rank>> rankData =
await apiService.rankList().catchError((onError) {});
if (rankData != null && rankData.isSuccess) {
ranks.clear();
ranks.addAll(rankData.data);
}
if (userinfo != null &&
userinfo.memberRankVo != null &&
if (userInfo != null &&
userInfo.memberRankVo != null &&
ranks != null &&
ranks.length > 0) {
rankLevel = (ranks
.indexWhere((element) => element.id == userinfo.memberRankVo.id) +
.indexWhere((element) => element.id == userInfo.memberRankVo.id) +
1);
}
// SmartDialog.dismiss(closeType: 3);
EasyLoading.dismiss();
BaseData<SignInfo> baseData =
await apiService.signInInfo().catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
signInfo = baseData.data;
setState(() {});
}
EasyLoading.dismiss();
}
@override
@ -103,417 +97,46 @@ class _IntegralPage extends State<IntegralPage> {
),
),
),
body: SingleChildScrollView(
child: Container(
child: Stack(
children: [
Positioned(
child: Container(
height: 122.h,
color: Color(0xFF3A405A),
),
top: 0,
left: 0,
right: 0,
),
Column(
children: [
integralAndVip(),
inForPoints(),
integralTask(),
],
),
],
),
),
),
);
}
Widget integralTask() {
return Container(
width: MediaQuery.of(context).size.width - 32,
height: 300.h,
margin: EdgeInsets.all(16),
padding: EdgeInsets.fromLTRB(10.w, 20.h, 10.w, 20.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 10.w),
child: Text(
S.of(context).zuorenwudejifen,
style: TextStyle(
color: Color(0xFF353535),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
body: Container(
child: Stack(
children: [
Positioned(
child: Container(
height: 122.h,
color: Color(0xFF3A405A),
),
top: 0,
left: 0,
right: 0,
),
),
Expanded(
child: Container(
child: Swiper(
loop: false,
physics: BouncingScrollPhysics(),
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.black,
color: Colors.black.withAlpha(76),
),
),
itemBuilder: (context, position) {
return taskPage(position);
},
itemCount: (signInfo != null &&
signInfo.taskList != null &&
signInfo.taskList.length > 0)
? (signInfo.taskList.length < 3
? 1
: (signInfo.taskList.length ~/ 3 +
(signInfo.taskList.length % 3 > 0 ? 1 : 0)))
: 1),
),
flex: 1,
)
],
),
);
}
Widget taskPage(position) {
if (signInfo == null || signInfo.taskList == null) return Container();
return Container(
margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 16.h),
child: Column(
children: [
tashItem(signInfo.taskList[position * 3 + 0]),
if (signInfo.taskList.length > (position * 3 + 1))
tashItem(signInfo.taskList[position * 3 + 1]),
if (signInfo.taskList.length > (position * 3 + 2))
tashItem(signInfo.taskList[position * 3 + 2]),
],
),
);
}
taskImg(String taskType) {
switch (taskType) {
case "bill_type_point_login":
return "assets/image/icon_integral_share.png";
break;
case "bill_type_point_order":
return "assets/image/icon_integral_order.png";
break;
case "bill_type_point_signin":
return "assets/image/icon_integral_sign.png";
break;
}
return "assets/image/icon_integral_share.png";
}
SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: FutureBuilder(
future: querySignInfo(),
builder: (context, snap) {
return Column(
children: [
/// VIP等级显示
IntegralVip(rankLevel, signInfo, userInfo),
Widget tashItem(Task task) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
alignment: Alignment.center,
child: Row(
children: [
Image.asset(
taskImg(task.type),
width: 24.w,
height: 24.h,
),
SizedBox(
width: 21.w,
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
task.name,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
SizedBox(
height: 7.h,
),
Row(
children: [
Text(
"+${double.tryParse(task.rewardValue).toInt()}",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
SizedBox(
width: 20.w,
),
Text(
S.of(context).wancheng_(
"${task.complateNum ?? task.conplateNum}/${task.limitDay}"),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
],
)
],
),
),
RoundButton(
text: task.limitDay == (task.complateNum ?? task.conplateNum)
? S.of(context).yiwancheng
: S.of(context).quwancheng,
textColor: Colors.white,
backgroup: task.limitDay == (task.complateNum ?? task.conplateNum)
? Color(0xFFA0A0A0)
: Color(0xFF32A060),
radius: 12.w,
fontSize: 14.sp,
fontWeight: FontWeight.bold,
padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 12.w),
),
],
),
);
}
///
InForPoints(signInfo, _signIn),
Widget signInItem(position) {
if (position == 6) {
return Container(
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xFFF0F0F2),
borderRadius: BorderRadius.circular(4),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"0${position + 1}",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
Container(
alignment: Alignment.center,
height: 30.h,
child: Text(
S.of(context).shenmijifendali,
style: TextStyle(
color: Color(0xFF727272),
fontWeight: FontWeight.bold,
fontSize: 10.sp,
),
),
),
Text(
"",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),
flex: 1,
),
Container(
alignment: Alignment.center,
child: Image.asset(
"assets/image/icon_gold_blessing.png",
width: 59.w,
height: 59.h,
),
),
],
),
);
} else {
return Container(
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: (signInfo != null &&
signInfo.signInList != null &&
signInfo.signInList.length > position)
? Color(0xFF32A060)
: Color(0xFFF0F0F2),
borderRadius: BorderRadius.circular(4),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"0${position + 1}",
style: TextStyle(
color: (signInfo != null &&
signInfo.signInList != null &&
signInfo.signInList.length > position)
? Colors.white
: Color(0xFF353535),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
Container(
alignment: Alignment.center,
child: Image.asset(
"assets/image/icon_gold_coin.png",
width: 30.w,
height: 30.h,
),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(
top: 2.h,
),
child: Text(
(signInfo != null &&
signInfo.rewardList != null &&
signInfo.rewardList.length > position)
? "+${signInfo.rewardList[position]}"
: "+10",
style: TextStyle(
color: (signInfo != null &&
signInfo.signInList != null &&
signInfo.signInList.length > position)
? Colors.white
: Color(0xFF727272),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
///
IntegralTask(signInfo),
],
);
},
),
),
],
),
);
}
}
///
Widget inForPoints() {
return Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h),
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 20.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).qiandaolingjifen,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 10.h,
),
Text(
S.of(context).lianxuqiandaolingqushuangbeijifen,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 11.sp,
color: Color(0xFF727272),
),
),
SizedBox(
height: 32.h,
),
StaggeredGridView.countBuilder(
crossAxisCount: 4,
shrinkWrap: true,
itemCount: 7,
mainAxisSpacing: 8,
crossAxisSpacing: 18,
padding: EdgeInsets.only(bottom: 32),
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return signInItem(position);
},
staggeredTileBuilder: (position) {
return StaggeredTile.count(position == 6 ? 2 : 1, 1.28);
},
),
InkWell(
onTap: signIn,
child: Container(
alignment: Alignment.center,
child: RoundButton(
width: 106.w,
height: 34.h,
text: (signInfo != null && signInfo.todayHasSignin)
? S.of(context).yiqiandao
: S.of(context).lijiqiandao,
textColor: Colors.white,
backgroup: (signInfo != null && signInfo.todayHasSignin)
? Colors.grey
: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h),
radius: 4.w,
),
),
),
],
),
);
}
///
signIn() async {
_signIn() async {
if ((signInfo != null && signInfo.todayHasSignin)) {
SmartDialog.showToast("今日已签到了", alignment: Alignment.center);
return;
@ -521,7 +144,7 @@ class _IntegralPage extends State<IntegralPage> {
EasyLoading.show(status: S.of(context).zhengzaijiazai);
BaseData baseData = await apiService.signIn();
if (baseData != null && baseData.isSuccess) {
querySignInfo();
setState(() {});
SmartDialog.show(
widget: SignInWidget("${signInfo.signInList.length + 1}",
"${signInfo.rewardList[signInfo.signInList.length]}"));
@ -529,108 +152,4 @@ class _IntegralPage extends State<IntegralPage> {
EasyLoading.dismiss();
}
}
//VIP等级显示
Widget integralAndVip() {
return Container(
padding: EdgeInsets.only(top: 16.h, bottom: 16.h),
color: Color(0xFF3A405A),
child: Row(
children: [
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
signInfo != null ? "${signInfo.point}" : "0",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 21.sp,
color: Colors.white,
),
),
SizedBox(
height: 6.h,
),
Text(
S.of(context).wodejifenzhi,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFF2F2F2),
),
)
],
),
),
Container(
width: 2.w,
height: 32.h,
color: Color(0xFFFFFFFF),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") != null &&
value.getString("token") != "") {
Navigator.of(context)
.pushNamed('/router/mine_vip_level_page', arguments: {
"rankLevel": rankLevel,
"createTime":
(userinfo != null) ? "${userinfo.createTime}" : "",
"points": (userinfo != null)
? int.tryParse(userinfo.points)
: 0,
});
}
});
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
(signInfo != null && signInfo.rank != null)
? "${signInfo.rank.rankName.replaceAll("会员", "")}"
: "",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 21.sp,
color: Colors.white,
),
),
SizedBox(
height: 6.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).wodehuiyuandengji,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFF2F2F2),
),
),
Icon(
Icons.keyboard_arrow_right,
color: Colors.white,
size: 15,
),
],
),
],
),
),
),
],
),
);
}
}

236
lib/integral/intergra_view/in_for_points.dart

@ -0,0 +1,236 @@
import 'package:flutter/material.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/sign_info.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart';
class InForPoints extends StatefulWidget {
final SignInfo signInfo;
final Function signIn;
InForPoints(this.signInfo, this.signIn);
@override
State<StatefulWidget> createState() {
return _InForPoints();
}
}
class _InForPoints extends State<InForPoints> {
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h),
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 20.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).qiandaolingjifen,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
color: Color(0xFF353535),
),
),
SizedBox(
height: 10.h,
),
Text(
S.of(context).lianxuqiandaolingqushuangbeijifen,
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 11.sp,
color: Color(0xFF727272),
),
),
SizedBox(
height: 32.h,
),
StaggeredGridView.countBuilder(
crossAxisCount: 4,
shrinkWrap: true,
itemCount: 7,
mainAxisSpacing: 8,
crossAxisSpacing: 18,
padding: EdgeInsets.only(bottom: 32),
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return signInItem(position);
},
staggeredTileBuilder: (position) {
return StaggeredTile.count(position == 6 ? 2 : 1, 1.28);
},
),
InkWell(
onTap: widget.signIn,
child: Container(
alignment: Alignment.center,
child: RoundButton(
width: 106.w,
height: 34.h,
text: (widget.signInfo != null && widget.signInfo.todayHasSignin)
? S.of(context).yiqiandao
: S.of(context).lijiqiandao,
textColor: Colors.white,
backgroup: (widget.signInfo != null && widget.signInfo.todayHasSignin)
? Colors.grey
: Color(0xFF32A060),
fontSize: 16.sp,
fontWeight: MyFontWeight.regular,
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 6.h),
radius: 4.w,
),
),
),
],
),
);
}
Widget signInItem(position) {
if (position == 6) {
return Container(
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Color(0xFFF0F0F2),
borderRadius: BorderRadius.circular(4),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"0${position + 1}",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
Container(
alignment: Alignment.center,
height: 30.h,
child: Text(
S.of(context).shenmijifendali,
style: TextStyle(
color: Color(0xFF727272),
fontWeight: FontWeight.bold,
fontSize: 10.sp,
),
),
),
Text(
"",
style: TextStyle(
color: Color(0xFF353535),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
],
),
flex: 1,
),
Container(
alignment: Alignment.center,
child: Image.asset(
"assets/image/icon_gold_blessing.png",
width: 59.w,
height: 59.h,
),
),
],
),
);
} else {
return Container(
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: (widget.signInfo != null &&
widget.signInfo.signInList != null &&
widget.signInfo.signInList.length > position)
? Color(0xFF32A060)
: Color(0xFFF0F0F2),
borderRadius: BorderRadius.circular(4),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"0${position + 1}",
style: TextStyle(
color: (widget.signInfo != null &&
widget.signInfo.signInList != null &&
widget.signInfo.signInList.length > position)
? Colors.white
: Color(0xFF353535),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
Container(
alignment: Alignment.center,
child: Image.asset(
"assets/image/icon_gold_coin.png",
width: 30.w,
height: 30.h,
),
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.only(
top: 2.h,
),
child: Text(
(widget.signInfo != null &&
widget.signInfo.rewardList != null &&
widget.signInfo.rewardList.length > position)
? "+${widget.signInfo.rewardList[position]}"
: "+10",
style: TextStyle(
color: (widget.signInfo != null &&
widget.signInfo.signInList != null &&
widget.signInfo.signInList.length > position)
? Colors.white
: Color(0xFF727272),
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
),
),
),
],
),
);
}
}
}

202
lib/integral/intergra_view/integral_task.dart

@ -0,0 +1,202 @@
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/sign_info.dart';
import 'package:huixiang/retrofit/data/task.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart';
class IntegralTask extends StatefulWidget {
final SignInfo signInfo;
IntegralTask(this.signInfo);
@override
State<StatefulWidget> createState() {
return _IntegralTask();
}
}
class _IntegralTask extends State<IntegralTask> {
@override
Widget build(BuildContext context) {
return Container(
width: MediaQuery.of(context).size.width - 32,
height: 300.h,
margin: EdgeInsets.all(16),
padding: EdgeInsets.symmetric(
horizontal: 10.w,
vertical: 20.h,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
margin: EdgeInsets.only(left: 10.w),
child: Text(
S.of(context).zuorenwudejifen,
style: TextStyle(
color: Color(0xFF353535),
fontWeight: MyFontWeight.medium,
fontSize: 16.sp,
),
),
),
Expanded(
child: Container(
child: Swiper(
loop: false,
physics: BouncingScrollPhysics(),
pagination: SwiperPagination(
alignment: Alignment.bottomCenter,
builder: DotSwiperPaginationBuilder(
size: 8,
activeSize: 8,
space: 5,
activeColor: Colors.black,
color: Colors.black.withAlpha(76),
),
),
itemBuilder: (context, position) {
return taskPage(position);
},
itemCount: (widget.signInfo != null &&
widget.signInfo.taskList != null &&
widget.signInfo.taskList.length > 0)
? (widget.signInfo.taskList.length < 3
? 1
: (widget.signInfo.taskList.length ~/ 3 +
(widget.signInfo.taskList.length % 3 > 0
? 1
: 0)))
: 1),
),
flex: 1,
)
],
),
);
}
Widget taskPage(position) {
if (widget.signInfo == null || widget.signInfo.taskList == null)
return Container();
return Container(
margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 16.h),
child: Column(
children: [
tashItem(widget.signInfo.taskList[position * 3 + 0]),
if (widget.signInfo.taskList.length > (position * 3 + 1))
tashItem(widget.signInfo.taskList[position * 3 + 1]),
if (widget.signInfo.taskList.length > (position * 3 + 2))
tashItem(widget.signInfo.taskList[position * 3 + 2]),
],
),
);
}
taskImg(String taskType) {
switch (taskType) {
case "bill_type_point_login":
return "assets/image/icon_integral_share.png";
break;
case "bill_type_point_order":
return "assets/image/icon_integral_order.png";
break;
case "bill_type_point_signin":
return "assets/image/icon_integral_sign.png";
break;
}
return "assets/image/icon_integral_share.png";
}
Widget tashItem(Task task) {
return Container(
margin: EdgeInsets.only(top: 8.h, bottom: 8.h),
alignment: Alignment.center,
child: Row(
children: [
Image.asset(
taskImg(task.type),
width: 24.w,
height: 24.h,
),
SizedBox(
width: 21.w,
),
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
task.name,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF353535),
),
),
SizedBox(
height: 7.h,
),
Row(
children: [
Text(
"+${double.tryParse(task.rewardValue).toInt()}",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
SizedBox(
width: 20.w,
),
Text(
S.of(context).wancheng_(
"${task.complateNum ?? task.conplateNum}/${task.limitDay}"),
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFF727272),
),
),
],
),
],
),
),
RoundButton(
text: task.limitDay == (task.complateNum ?? task.conplateNum)
? S.of(context).yiwancheng
: S.of(context).quwancheng,
textColor: Colors.white,
backgroup: task.limitDay == (task.complateNum ?? task.conplateNum)
? Color(0xFFA0A0A0)
: Color(0xFF32A060),
radius: 12.w,
fontSize: 14.sp,
fontWeight: FontWeight.bold,
padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 12.w),
),
],
),
);
}
}

132
lib/integral/intergra_view/integral_vip.dart

@ -0,0 +1,132 @@
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/sign_info.dart';
import 'package:huixiang/retrofit/data/user_info.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class IntegralVip extends StatefulWidget {
final SignInfo signInfo;
final UserInfo userinfo;
final rankLevel;
IntegralVip(this.rankLevel, this.signInfo, this.userinfo);
@override
State<StatefulWidget> createState() {
return _IntegralVip();
}
}
class _IntegralVip extends State<IntegralVip> {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.symmetric(vertical: 16.h),
child: Row(
children: [
Expanded(
flex: 1,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
widget.signInfo != null ? "${widget.signInfo.point}" : "0",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 21.sp,
color: Colors.white,
),
),
SizedBox(
height: 6.h,
),
Text(
S.of(context).wodejifenzhi,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFF2F2F2),
),
)
],
),
),
Container(
width: 2.w,
height: 32.h,
color: Color(0xFFFFFFFF),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") != null &&
value.getString("token") != "") {
Navigator.of(context)
.pushNamed('/router/mine_vip_level_page', arguments: {
"rankLevel": widget.rankLevel,
"createTime":
(widget.userinfo != null) ? "${widget.userinfo.createTime}" : "",
"points": (widget.userinfo != null)
? int.tryParse(widget.userinfo.points)
: 0,
});
}
});
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
(widget.signInfo != null && widget.signInfo.rank != null)
? "${widget.signInfo.rank.rankName.replaceAll("会员", "")}"
: "",
style: TextStyle(
fontWeight: MyFontWeight.medium,
fontSize: 21.sp,
color: Colors.white,
),
),
SizedBox(
height: 6.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).wodehuiyuandengji,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Color(0xFFF2F2F2),
),
),
Icon(
Icons.keyboard_arrow_right,
color: Colors.white,
size: 15,
),
],
),
],
),
),
),
],
),
);
}
}

17
lib/main.dart

@ -6,7 +6,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart';
import 'package:flutter_bugly/flutter_bugly.dart';
// import 'package:flutter_bugly/flutter_bugly.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/address/address_map_page.dart';
@ -51,7 +51,7 @@ import 'package:huixiang/setting/setting_page.dart';
import 'package:huixiang/setting/treaty_page.dart';
import 'package:huixiang/union/location_map_page.dart';
import 'package:huixiang/union/store_details_page.dart';
import 'package:huixiang/web/web_page.dart';
import 'package:huixiang/union/union_details_page.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -87,12 +87,11 @@ void main() async {
}
initSdk();
bool isFirst = sharedPreferences.getBool("isFirst");
print("isFirst:$isFirst");
FlutterBugly.postCatchedException((){
runApp(MyApp(locale, isFirst));
});
FlutterBugly.init(androidAppId: "204f207673",iOSAppId: "8bb92ba0f6");
runApp(MyApp(locale, isFirst));
// FlutterBugly.postCatchedException((){
// });
// FlutterBugly.init(androidAppId: "204f207673",iOSAppId: "8bb92ba0f6");
}
XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();
@ -242,8 +241,8 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
'/router/treaty_page': (context, {arguments}) => TreatyPage(),
'/router/union_detail_page': (context, {arguments}) =>
UnionDetailsPage(arguments: arguments),
'/router/store_detail_page': (context, {arguments}) =>
StoreDetailsPage(arguments: arguments),
'/router/web_page': (context, {arguments}) =>
WebPage(arguments: arguments),
'/router/integral_store_page': (context, {arguments}) =>
IntegralStoreDetailsPage(
arguments: arguments,

1
lib/mine/mine_page.dart

@ -154,6 +154,7 @@ class _MinePage extends State<MinePage> with AutomaticKeepAliveClientMixin {
/// VIP等级信息
MineVipView(
tag: "vip",
ranks: ranks,
userInfo: userInfo,
rank: (userInfo != null)

5
lib/mine/mine_vip_level_page.dart

@ -6,6 +6,7 @@ import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/rank.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/view_widget/mine_vip_view.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
@ -26,7 +27,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
ApiService apiService;
List<Rank> ranks = [];
SwiperController controller = SwiperController();
final SwiperController controller = SwiperController();
@override
void initState() {
@ -67,7 +68,7 @@ class _MineVipLevelPage extends State<MineVipLevelPage> {
child: Column(
children: [
Container(
height: 224.h,
height: (MediaQuery.of(context).size.width) / 1.78 * AppUtils.textScale(context),
child: Swiper(
viewportFraction: 0.95,
loop: false,

19
lib/mine/mine_wallet_page.dart

@ -166,25 +166,6 @@ class _MineWalletPage extends State<MineWalletPage> {
SizedBox(
height: 16.h,
),
// Row(
// children: [
// Container(
// width: 3,
// height: 15,
// color: Color(0xFF20662A),
// ),
// SizedBox(
// width: 3,
// ),
// Text(
// "09/2021",
// style: TextStyle(
// color: Color(0xFF353535),
// fontSize: 14,
// ),
// ),
// ],
// ),
Container(
margin: EdgeInsets.only(top: 14.h),
child: ListView.builder(

6
lib/mine/recharge_page.dart

@ -207,6 +207,12 @@ class _RechargePage extends State<RechargePage> {
}
int amount = int.tryParse(money);
if (checkIndex == 1) {
if (amount < 10) {
SmartDialog.showToast(S.of(context).chongzhizuixiaojine(10), alignment: Alignment.center);
return;
}
if (!(await Min.isInitialize())) {
// app的充值支付使用同一个WXPayEntryActivity回调
// getPackage空指针

17
lib/order/order_detail_page.dart

@ -178,16 +178,13 @@ class _OrderDetailPage extends State<OrderDetailPage> {
child:*/
Stack(
children: [
Container(
color: Color(0xFF3A405A),
child:Positioned(
top: 0,
left: 0,
right: 0,
child: Container(
height: 36.h,
color: Color(0xFF3A405A),
),
Positioned(
top: 0,
left: 0,
right: 0,
child: Container(
height: 36.h,
color: Color(0xFF3A405A),
),
),
SingleChildScrollView(

1006
lib/union/store_details_page.dart

File diff suppressed because it is too large Load Diff

2
lib/union/union_details_page.dart

@ -773,7 +773,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
widget.arguments["source"] == activitys[position].id) {
Navigator.of(context).pop();
} else {
Navigator.of(context).pushNamed('/router/store_detail_page',
Navigator.of(context).pushNamed('/router/web_page',
arguments: {
"activityId": activitys[position].id,
"source": widget.arguments["id"]

2
lib/union/union_page.dart

@ -517,7 +517,7 @@ class _UnionPage extends State<UnionPage>
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(top: 1.h, left: 2, right: 2),
padding: EdgeInsets.only(top: 3.h, left: 2, right: 2),
child: Image.asset(
"assets/image/icon_union_location_black.png",
width: 14,

10
lib/view_widget/comment_menu.dart

@ -34,10 +34,11 @@ class _CommentMenu extends State<CommentMenu> {
children: [
InkWell(
onTap: () {
Navigator.of(context).pop();
widget.clickType("huifu");
},
child: Container(
width: MediaQuery.of(context).size.width,
alignment: Alignment.center,
padding: EdgeInsets.all(20.h),
child: Text(
S.of(context).huifu,
@ -56,10 +57,11 @@ class _CommentMenu extends State<CommentMenu> {
if (widget.isSelf)
InkWell(
onTap: () {
Navigator.of(context).pop();
widget.clickType("shanchu");
},
child: Container(
width: MediaQuery.of(context).size.width,
alignment: Alignment.center,
padding: EdgeInsets.all(20.h),
child: Text(
S.of(context).shanchu,
@ -78,9 +80,11 @@ class _CommentMenu extends State<CommentMenu> {
),
InkWell(
onTap: () {
Navigator.of(context).pop();
widget.clickType("quxiao");
},
child: Container(
width: MediaQuery.of(context).size.width,
alignment: Alignment.center,
padding: EdgeInsets.all(20.h),
child: Text(
S.of(context).quxiao,

4
lib/view_widget/hot_item.dart

@ -33,7 +33,7 @@ class _HotArticleItem extends State<HotArticleItem> {
}
click() async {
await Navigator.of(context).pushNamed('/router/store_detail_page',
await Navigator.of(context).pushNamed('/router/web_page',
arguments: {"articleId": widget.article.id});
widget.article.viewers = (widget.article.viewers + 1);
setState(() {});
@ -236,7 +236,7 @@ class _HotArticleItem extends State<HotArticleItem> {
),
flex: 1,
),
if (widget.isHot != null && widget.isHot)
// if (widget.isHot != null && widget.isHot)
IconText(
widget.article != null
? (widget.article.createTime.split(" ")[0])

340
lib/view_widget/mine_vip_view.dart

@ -21,7 +21,7 @@ class MineVipView extends StatelessWidget {
MineVipView({
this.vipLevel = 1,
this.ranks,
this.tag = "",
this.tag,
this.userInfo,
this.padding = 16,
this.curLevel = 1,
@ -46,8 +46,8 @@ class MineVipView extends StatelessWidget {
userInfo.memberRankVo != null &&
ranks != null &&
ranks.length > 0) {
curLevel = (ranks.indexWhere(
(element) => element.id == userInfo.memberRankVo.id) +
curLevel = (ranks
.indexWhere((element) => element.id == userInfo.memberRankVo.id) +
1);
vipLevel = curLevel;
}
@ -113,190 +113,202 @@ class MineVipView extends StatelessWidget {
break;
}
}
return GestureDetector(
onTap: () {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context)
.pushNamed('/router/mine_vip_level_page', arguments: {
"rankLevel": curLevel,
"createTime": (userInfo != null) ? "${userInfo.createTime}" : "",
"points": (userInfo != null) ? int.tryParse(userInfo.points) : 0,
});
});
},
child: Hero(
tag: tag,
child: Container(
margin: EdgeInsets.fromLTRB(padding.w, 16.h, padding.w, 8.h),
width: MediaQuery.of(context).size.width - 32.w,
height: 200.h,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: linearColor,
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
Widget widget = Container(
margin: EdgeInsets.fromLTRB(padding.w, 16.h, padding.w, 8.h),
width: MediaQuery.of(context).size.width - 32.w,
height: (MediaQuery.of(context).size.width - 32.w) /
1.78 *
AppUtils.textScale(context),
decoration: BoxDecoration(
gradient: LinearGradient(
colors: linearColor,
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
child: Column(
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
height: 95.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Container(
padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
decoration: BoxDecoration(
color: levelColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomRight: Radius.circular(8),
),
),
child: Text(
topLeft,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.white,
),
),
),
Container(
margin: EdgeInsets.only(left: 13.w),
child: Text(
levelText,
style: TextStyle(
color: textColor,
fontWeight: FontWeight.bold,
fontSize: 23.sp,
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(right: 11.w, bottom: 9.h),
child: Image.asset(
"assets/image/icon_mine_huixiang_logo.png",
width: 86.w,
height: 86.h,
fit: BoxFit.contain,
),
),
],
),
Container(
margin: EdgeInsets.only(left: 13.w, right: 12.w, bottom: 12.h),
height: 86.w,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Expanded(
child: Text(
rank > rankMax
? S.of(context).dangqiandengji
: "${S.of(context).jifen_(rankMax - rank)} ${S.of(context).daoxiayidengji}",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
fontWeight: FontWeight.w400,
fontSize: 14.sp,
),
),
flex: 1,
Container(
padding: EdgeInsets.fromLTRB(9.w, 4.h, 8.w, 4.h),
decoration: BoxDecoration(
color: levelColor,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
bottomRight: Radius.circular(8),
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "$rank",
style: TextStyle(
fontSize: 26.sp,
fontWeight: FontWeight.bold,
color: textColor,
),
),
if (rank <= rankMax)
TextSpan(
// string
text: rankMax > 0 ? "/$rankMax" : "/0",
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: textColor,
),
),
],
),
),
child: Text(
topLeft,
style: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Colors.white,
),
],
),
),
Container(
margin: EdgeInsets.only(top: 12.h, bottom: 12.h),
height: 8.h,
child: ClipRRect(
borderRadius: BorderRadius.circular(6.5),
child: LinearProgressIndicator(
value: rankMax > 0 ? rank / rankMax : 0,
backgroundColor: Colors.white,
color: levelColor,
margin: EdgeInsets.only(left: 13.w),
child: Text(
levelText,
style: TextStyle(
color: textColor,
fontWeight: FontWeight.bold,
fontSize: 23.sp,
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).kaitongriqi(
(createTime != null && createTime != "")
? createTime.split(" ")[0]
: "$createTime"),
],
),
),
Container(
margin: EdgeInsets.only(right: 11.w, bottom: 9.h),
child: Image.asset(
"assets/image/icon_mine_huixiang_logo.png",
width: 86.w,
height: 86.w,
fit: BoxFit.contain,
),
),
],
),
Expanded(
child: Container(
margin: EdgeInsets.only(
left: 13.w,
right: 12.w,
bottom: 12.h,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: TextBaseline.alphabetic,
children: [
Expanded(
child: Text(
rank > rankMax
? S.of(context).dangqiandengji
: "${S.of(context).jifen_(rankMax - rank)} ${S.of(context).daoxiayidengji}",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
fontWeight: FontWeight.w400,
fontSize: 12.sp,
fontSize: 14.sp,
),
),
Icon(
Icons.qr_code,
size: 24,
color: Colors.white,
flex: 1,
),
Text.rich(
TextSpan(
children: [
TextSpan(
text: "$rank",
style: TextStyle(
fontSize: 26.sp,
fontWeight: FontWeight.bold,
color: textColor,
),
),
if (rank <= rankMax)
TextSpan(
text: rankMax > 0 ? "/$rankMax" : "/0",
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.w400,
color: textColor,
),
),
],
),
],
),
],
),
Container(
height: 8.h,
child: ClipRRect(
borderRadius: BorderRadius.circular(6.5),
child: LinearProgressIndicator(
value: rankMax > 0 ? rank / rankMax : 0,
backgroundColor: Colors.white,
color: levelColor,
),
),
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
S.of(context).kaitongriqi(
(createTime != null && createTime != "")
? createTime.split(" ")[0]
: "$createTime"),
style: TextStyle(
color: textColor,
fontWeight: FontWeight.w400,
fontSize: 12.sp,
),
),
Icon(
Icons.qr_code,
size: 24,
color: Colors.white,
),
],
),
],
),
],
),
flex: 1,
),
),
],
),
);
return GestureDetector(
onTap: () {
if (userInfo != null) {
SharedPreferences.getInstance().then((value) {
if (value.getString("token") == null ||
value.getString("token") == "") {
LoginTipsDialog().show(context);
return;
}
Navigator.of(context)
.pushNamed('/router/mine_vip_level_page', arguments: {
"rankLevel": curLevel,
"createTime": (userInfo != null) ? "${userInfo.createTime}" : "",
"points": (userInfo != null) ? int.tryParse(userInfo.points) : 0,
});
});
}
},
child: (tag == null || tag == "")
? widget
: Hero(tag: tag, child: widget),
);
}
}

318
lib/web/web_page.dart

@ -0,0 +1,318 @@
import 'dart:io';
import 'dart:ui';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:huixiang/view_widget/share_dialog.dart';
import 'package:huixiang/view_widget/tips_dialog.dart';
import 'package:huixiang/web/web_view/comment_list.dart';
import 'package:huixiang/web/web_view/input_comment.dart';
import 'package:huixiang/web/web_view/web_content.dart';
import 'package:huixiang/web/web_view/web_header.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:sharesdk_plugin/sharesdk_defines.dart';
import 'package:sharesdk_plugin/sharesdk_interface.dart';
import 'package:sharesdk_plugin/sharesdk_map.dart';
import 'package:webview_flutter/webview_flutter.dart';
import 'package:flutter/cupertino.dart';
class WebPage extends StatefulWidget {
final Map<String, dynamic> arguments;
///
WebPage({this.arguments});
@override
State<StatefulWidget> createState() {
return _WebPage();
}
}
class _WebPage extends State<WebPage> with WidgetsBindingObserver {
ApiService apiService;
int commentTotal = 0;
String hintText = S.current.liuxianinjingcaidepinglunba;
var commentFocus = FocusNode();
String parenId = "0";
Activity activity;
Article article;
final GlobalKey commentKey = GlobalKey();
final GlobalKey inputKey = GlobalKey();
final ScrollController scrollController = ScrollController();
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
if (Platform.isAndroid) WebView.platform = SurfaceAndroidWebView();
queryHtml();
}
bool isKeyBoardShow = false;
@override
void didChangeMetrics() {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode());
setState(() {
hintText = S.current.liuxianinjingcaidepinglunba;
isKeyBoardShow = false;
});
}
} else {
setState(() {
isKeyBoardShow = true;
});
}
});
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
super.dispose();
}
queryHtml() async {
SharedPreferences value = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(Dio(), context: context, token: value.getString("token"));
if (widget.arguments["activityId"] != null) {
BaseData<Activity> baseData = await apiService.activityInfo(widget.arguments["activityId"]).catchError((onError){});
if (baseData != null && baseData.isSuccess) {
activity = baseData.data;
setState(() {});
}
}
if (widget.arguments["articleId"] != null) {
BaseData<Article> baseData = await apiService.informationInfo(widget.arguments["articleId"]).catchError((onError){});
if (baseData != null && baseData.isSuccess) {
article = baseData.data;
setState(() {});
}
}
}
//
_queryMemberComment(String content) async {
BaseData baseData = await apiService.memberComment({
"content": content,
"parentId": parenId,
"relationalId":
widget.arguments["activityId"] ?? widget.arguments["articleId"],
"relationalType": 1
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
_toComment();
}
}
share() async {
SSDKMap params = SSDKMap()
..setGeneral(
activity != null
? activity.mainTitle
: article != null
? article.mainTitle
: "",
activity != null
? activity.viceTitle
: article != null
? article.viceTitle
: "",
[
activity != null
? activity.coverImg
: article != null
? article.coverImg
: "",
],
activity != null
? activity.coverImg
: article != null
? article.coverImg
: "",
"", buildShareUrl(), "", "", "", "",
SSDKContentTypes.webpage,
);
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return ShareDialog((platform) {
if (platform == ShareSDKPlatforms.line) {
params.map["type"] = SSDKContentTypes.text.value;
params.map["text"] =
"${activity != null ? activity.viceTitle : article != null ? article.viceTitle : ""} ${buildShareUrl()}";
}
SharesdkPlugin.share(platform, params,
(state, userData, contentEntity, error) {
print("share!$state");
});
});
});
}
String buildShareUrl() {
return "https://hx.lotus-wallet.com/index.html?id=${widget.arguments["activityId"] ?? widget.arguments["articleId"]}&type=${activity != null ? "activity" : article != null ? "article" : ""}";
}
///
_queryInformationLikes() async {
BaseData baseData = await apiService.informationLikes(
widget.arguments["activityId"] ?? widget.arguments["articleId"]);
if (baseData != null && baseData.isSuccess) {
if (article != null) {
if (article.liked) {
article.likes -= 1;
} else {
article.likes += 1;
}
article.liked = !article.liked;
} else if (activity != null) {
if (activity.liked) {
activity.likes -= 1;
} else {
activity.likes += 1;
}
activity.liked = !activity.liked;
}
} else {
SmartDialog.showToast(baseData.msg, alignment: Alignment.center);
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: MyAppBar(
action: Container(
margin: EdgeInsets.only(right: 10),
child: GestureDetector(
onTap: () {
share();
},
child: Icon(
Icons.share,
size: 24,
color: Colors.black,
),
),
),
background: Color(0xFFF7F7F7),
leadingColor: Colors.black,
title: activity != null
? activity.mainTitle
: article != null
? article.mainTitle
: "",
titleSize: 18.sp,
titleColor: Colors.black,
),
body: Container(
child: Column(
children: [
Expanded(
child: GestureDetector(
onTap: () {
commentFocus.unfocus();
hintText = S.of(context).liuxianinjingcaidepinglunba;
inputKey.currentState.setState(() {});;
parenId = "0";
},
child: SingleChildScrollView(
controller: scrollController,
physics: BouncingScrollPhysics(),
child: Column(
children: [
///
WebHeader(widget.arguments, activity, article),
///
WebContent(activity, article),
///
CommentList(
commentKey,
widget.arguments,
activity,
article,
isKeyBoardShow,
_reply,
_delCommentTips,
),
],
),
),
),
flex: 1,
),
///
InputComment(
inputKey,
hintText,
activity,
article,
isKeyBoardShow,
commentFocus,
_toComment,
_queryMemberComment,
_queryInformationLikes,
),
],
),
),
);
}
_delCommentTips() {
SmartDialog.show(widget: Tips(() {
delComment();
}));
}
delComment() async {
BaseData baseData = await apiService.delComment(
widget.arguments["activityId"] ?? widget.arguments["articleId"]);
if (baseData != null && baseData.isSuccess) {
commentKey.currentState.setState(() {});
}
}
_reply(memberComment) {
FocusScope.of(context).requestFocus(commentFocus);
parenId = memberComment.id;
hintText = S.of(context).huifu_("${memberComment.username}");
}
_toComment() {
if (commentKey.currentContext == null) return;
RenderBox firstRenderBox = commentKey.currentContext.findRenderObject();
Offset first = firstRenderBox.localToGlobal(Offset.zero);
scrollController.animateTo(
first.dy +
scrollController.offset -
(kToolbarHeight + MediaQuery.of(context).padding.top),
duration: Duration(milliseconds: 1000),
curve: Curves.easeIn);
}
}

422
lib/web/web_view/comment_list.dart

@ -0,0 +1,422 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/member_comment_list.dart';
import 'package:huixiang/retrofit/data/page.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/view_widget/comment_menu.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:like_button/like_button.dart';
import 'package:shared_preferences/shared_preferences.dart';
class CommentList extends StatefulWidget {
final Map arguments;
final Activity activity;
final Article article;
final bool isKeyBoardShow;
final Function reply;
final Function delCommentTips;
CommentList(
Key key,
this.arguments,
this.activity,
this.article,
this.isKeyBoardShow,
this.reply,
this.delCommentTips,
) : super(key: key);
@override
State<StatefulWidget> createState() {
return _CommentList();
}
}
class _CommentList extends State<CommentList> {
int commentTotal = 0;
List<MemberCommentList> memberList = [];
ApiService apiService;
//
queryCommentLike(String id) async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
String token = sharedPreferences.getString("token");
if (token == null || token == "") {
LoginTipsDialog().show(context);
return;
}
BaseData baseData =
await apiService.commentLike(id).catchError((onError) {});
if (baseData != null && baseData.isSuccess) {
memberList.forEach((element) {
if (element.id == id) {
if (element.liked) {
element.likes -= 1;
element.liked = false;
} else {
element.likes += 1;
element.liked = true;
}
}
});
}
}
@override
void initState() {
super.initState();
queryMemberCommentList();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.all(16),
child: Row(
children: [
Text(
S.of(context).pinglun_(commentTotal.toString()),
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0xff1A1A1A),
),
),
SizedBox(
width: 16.w,
),
Text(
S.of(context).xihuan_(
"${widget.article?.likes ?? widget.activity?.likes ?? "0"}"),
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0xff1A1A1A),
),
),
],
),
),
if (memberList != null && memberList.length > 0)
ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: memberList != null ? memberList.length : 0,
scrollDirection: Axis.vertical,
itemBuilder: (context, position) {
return Material(
color: Colors.white,
child: InkWell(
onTap: () {
showPressMenu(memberList[position].createUser,
memberList[position]);
},
child: commentItem(
memberList[position], position, memberList.length),
),
);
},
),
if (memberList != null && memberList.length > 0)
Container(
height: 63.h,
decoration: BoxDecoration(
color: Color(0xFFF2F2F2),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
),
],
),
alignment: Alignment.center,
child: Text(
S.of(context).yixiansquanbupinglun,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff353535),
),
),
),
if (memberList == null || memberList.length == 0)
Container(
width: double.infinity,
height: 80.h,
alignment: Alignment.center,
child: Text(
S.of(context).zanwupinglun,
style: TextStyle(
fontSize: 14.sp,
fontWeight: FontWeight.bold,
color: Color(0xFFA0A0A0),
),
),
),
],
),
),
SizedBox(
height: 12.h,
),
],
);
}
//
queryMemberCommentList() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (apiService == null)
apiService = ApiService(Dio(),
context: context, token: sharedPreferences.getString("token"));
BaseData<PageInfo<MemberCommentList>> baseData =
await apiService.memberCommentList({
"pageNum": 1,
"pageSize": 100,
"relationalId":
widget.arguments["activityId"] ?? widget.arguments["articleId"],
"relationalType": 1,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
commentTotal = baseData.data.size;
memberList = baseData.data.list;
setState(() {});
}
}
showPressMenu(String userId, memberComment) {
if (widget.isKeyBoardShow) {
FocusScope.of(context).requestFocus(FocusNode());
return;
}
SharedPreferences.getInstance().then((value) {
// showModalBottomSheet(
// context: context,
// backgroundColor: Colors.transparent,
// builder: (context) {
// return CommentMenu(
// (type) {
// print("click: $type");
// if (type == "huifu") {
// widget.reply(memberComment);
// } else if (type == "shanchu") {
// widget.delCommentTips();
// }
// },
// isSelf: userId == value.getString("userId"),
// );
// },
// );
SmartDialog.show(
widget: CommentMenu((type) {
SmartDialog.dismiss();
if (type == "huifu") {
widget.reply(memberComment);
} else if (type == "shanchu") {
widget.delCommentTips();
}
},
isSelf: userId == value.getString("userId"),
),
alignmentTemp: Alignment.bottomCenter,
isUseAnimationTemp: true,
animationDurationTemp: Duration(milliseconds: 300),
);
});
}
Widget commentItem(MemberCommentList memberList, int index, int max) {
return Container(
padding: EdgeInsets.symmetric(vertical: 8.w),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 16.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
MImage(
memberList.userAvatarUrl ?? "",
fit: BoxFit.cover,
isCircle: true,
width: 40,
height: 40,
fadeSrc: "assets/image/default_user.png",
errorSrc: "assets/image/default_user.png",
),
SizedBox(
width: 12.w,
),
Expanded(
child: Container(
height: 60.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: memberList.username,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Colors.black,
),
),
],
),
textDirection: TextDirection.ltr,
),
Text(
memberList.createTime,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xff808080),
),
),
],
),
),
flex: 1,
),
Container(
alignment: Alignment.topRight,
child: LikeButton(
padding: EdgeInsets.all(10),
circleSize: 16,
circleColor: CircleColor(
start: Color(0xff00ddff),
end: Color(0xff0099cc),
),
bubblesColor: BubblesColor(
dotPrimaryColor: Color(0xff33b5e5),
dotSecondaryColor: Color(0xff0099cc),
),
bubblesSize: 15,
likeBuilder: (bool isLiked) {
return isLiked
? Image.asset(
"assets/image/icon_like.png",
width: 16,
height: 16,
)
: Image.asset(
"assets/image/icon_like_h.png",
width: 16,
height: 16,
);
},
isLiked: memberList.liked ?? false,
onTap: (isLiked) async {
await queryCommentLike(memberList.id);
return (memberList == null || memberList.liked == null)
? false
: memberList.liked;
},
likeCount: memberList.likes,
countBuilder: (int count, bool isLiked, String text) {
return Text(
text,
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 12.sp,
),
);
},
),
),
],
),
),
Container(
padding: EdgeInsets.only(
left: 68,
right: 16,
top: 16.h,
bottom: 16.h,
),
child: Align(
alignment: Alignment.centerLeft,
child: Text(
memberList.content,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xff1A1A1A),
),
),
),
),
SizedBox(
height: 12.h,
),
if (memberList.parentContent != null)
Container(
margin: EdgeInsets.only(left: 68.w, right: 16.w),
decoration: BoxDecoration(
color: Color(0xffF2F2F2),
borderRadius: BorderRadius.circular(2.0),
),
child: Padding(
padding: EdgeInsets.only(left: 4.w, top: 4.h, bottom: 4.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${memberList.parentUserName}:" ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xff808080),
),
),
Expanded(
flex: 1,
child: Text(
memberList.parentContent ?? "",
style: TextStyle(
fontSize: 12.sp,
color: Color(0xff808080),
),
),
),
],
),
),
),
],
),
);
}
}

178
lib/web/web_view/input_comment.dart

@ -0,0 +1,178 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:like_button/like_button.dart';
class InputComment extends StatefulWidget {
final String hintText;
final Activity activity;
final Article article;
final bool isKeyBoardShow;
final FocusNode commentFocus;
final Function toComment;
final Function(String text) queryMemberComment;
final Function() queryInformationLikes;
InputComment(
Key key,
this.hintText,
this.activity,
this.article,
this.isKeyBoardShow,
this.commentFocus,
this.toComment,
this.queryMemberComment,
this.queryInformationLikes,
) : super(key: key);
@override
State<StatefulWidget> createState() {
return _InputComment();
}
}
class _InputComment extends State<InputComment> {
var commentTextController = TextEditingController();
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(12),
offset: Offset(0, 2),
blurRadius: 14,
spreadRadius: 0,
),
],
borderRadius: BorderRadius.vertical(
top: Radius.circular(8),
),
),
child: Row(
children: [
Expanded(
flex: 1,
child: Container(
decoration: BoxDecoration(
color: Color(0xffF2F2F2),
borderRadius: BorderRadius.circular(2.0),
),
child: Column(
children: [
Container(
margin: EdgeInsets.symmetric(horizontal: 4.w),
alignment: Alignment.topLeft,
child: TextField(
maxLines: 8,
minLines: 1,
focusNode: widget.commentFocus,
controller: commentTextController,
decoration: InputDecoration(
border: InputBorder.none,
hintText: widget.hintText,
hintStyle: TextStyle(
fontSize: 14.sp,
color: Color(0xFF868686),
),
),
),
),
],
),
),
),
if (widget.isKeyBoardShow)
GestureDetector(
onTap: () {
var commentText = commentTextController.text;
if (commentText == "") {
return;
}
widget.queryMemberComment(commentText);
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w),
child: Text(
S.of(context).fasong,
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0XFF1A1A1A),
),
),
),
),
if (!widget.isKeyBoardShow)
InkWell(
onTap: widget.toComment,
child: Container(
padding: EdgeInsets.only(left: 20.w, right: 10.w),
child: Image.asset(
"assets/image/icon_comment.png",
width: 24,
height: 24,
),
),
),
if (!widget.isKeyBoardShow)
LikeButton(
padding: EdgeInsets.all(10),
size: 24,
circleSize: 24,
circleColor: CircleColor(
start: Color(0xff00ddff),
end: Color(0xff0099cc),
),
bubblesColor: BubblesColor(
dotPrimaryColor: Color(0xff33b5e5),
dotSecondaryColor: Color(0xff0099cc),
),
bubblesSize: 24,
likeBuilder: (bool isLiked) {
return isLiked
? Image.asset(
"assets/image/icon_like.png",
width: 24,
height: 24,
)
: Image.asset(
"assets/image/icon_like_h.png",
width: 24,
height: 24,
);
},
isLiked: (widget.activity != null
? widget.activity.liked
: widget.article != null
? widget.article.liked
: false),
onTap: (isLiked) async {
await widget.queryInformationLikes();
return (widget.activity != null
? widget.activity.liked
: widget.article != null
? widget.article.liked
: false);
},
countBuilder: (int count, bool isLiked, String text) {
return Text(
text,
style: TextStyle(
color: Color(0xFF1A1A1A),
fontSize: 12.sp,
),
);
},
),
],
),
);
}
}

170
lib/web/web_view/web_content.dart

@ -0,0 +1,170 @@
import 'package:chewie/chewie.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_html/image_render.dart';
import 'package:chewie/src/chewie_progress_colors.dart' as chewie;
import 'package:flutter/material.dart';
import 'package:flutter_html/src/replaced_element.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:video_player/video_player.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class WebContent extends StatefulWidget {
final Activity activity;
final Article article;
WebContent(this.activity, this.article);
@override
State<StatefulWidget> createState() {
return _WebContent();
}
}
class _WebContent extends State<WebContent> {
@override
Widget build(BuildContext context) {
return Html(
data: widget.activity != null
? widget.activity.content
: widget.article != null
? widget.article.content
: "",
customImageRenders: {
base64DataUriMatcher(): base64ImageRender(),
assetUriMatcher(): assetImageRender(),
networkSourceMatcher(extension: "svg"):
svgNetworkImageRender(),
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
customRender: {
"video":
(context, parsedChild, attributes, element) {
var src = attributes['src'];
return videoWidget(
double.tryParse(attributes['width'] ?? ""),
double.tryParse(
element.attributes['height'] ?? ""),
(src != null &&
src != "" &&
src.endsWith(".mp4"))
? src
: element
.children.first.attributes["src"],
element.attributes["sandbox"]);
},
"iframe":
(context, parsedChild, attributes, element) {
var src = attributes['src'];
return videoWidget(
double.tryParse(attributes['width'] ?? ""),
double.tryParse(
element.attributes['height'] ?? ""),
(src != null &&
src != "" &&
src.endsWith(".mp4"))
? src
: element
.children.first.attributes["src"],
element.attributes["sandbox"]);
},
"audio":
(context, parsedChild, attributes, element) {
final sources = <String>[
if (element.attributes['src'] != null)
element.attributes['src'],
];
if (sources == null ||
sources.isEmpty ||
sources.first == null) {
return EmptyContentElement();
}
return audioWidget(
attributes['controls'] != null,
attributes['loop'] != null,
attributes['autoplay'] != null,
sources,
context.style.width ?? 300.w,
);
},
},
);
}
VideoPlayerController videoPlayerController;
ChewieController chewieAudioController;
Chewie chewies;
Widget videoWidget(double width, double height, src, sandboxMode) {
print("src : $src");
return Container(
width: MediaQuery.of(context).size.width,
height: (MediaQuery.of(context).size.width) / (width / height),
child: chewies = Chewie(
controller: chewieAudioController = ChewieController(
videoPlayerController: videoPlayerController =
VideoPlayerController.network(
src,
),
aspectRatio: width / height,
//
autoPlay: false,
//
looping: false,
//
//
materialProgressColors: chewie.ChewieProgressColors(
playedColor: Colors.white,
handleColor: Colors.white,
backgroundColor: Colors.grey,
bufferedColor: Colors.transparent,
),
autoInitialize: true,
),
),
);
}
Widget audioWidget(showControls, loop, autoplay, src, width) {
return Container(
width: width,
child: chewies = Chewie(
controller: chewieAudioController = ChewieController(
videoPlayerController: VideoPlayerController.network(
src.first ?? "",
),
autoPlay: autoplay,
looping: loop,
showControls: showControls,
autoInitialize: true,
),
),
);
}
@override
void dispose() {
if (chewieAudioController != null) {
chewieAudioController.pause();
chewieAudioController.dispose();
chewieAudioController = null;
}
if (videoPlayerController != null) {
videoPlayerController.pause();
videoPlayerController.dispose();
}
super.dispose();
}
}

100
lib/web/web_view/web_header.dart

@ -0,0 +1,100 @@
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class WebHeader extends StatefulWidget {
final Map arguments;
final Activity activity;
final Article article;
WebHeader(this.arguments, this.activity, this.article);
@override
State<StatefulWidget> createState() {
return _WebHeader();
}
}
class _WebHeader extends State<WebHeader> {
@override
Widget build(BuildContext context) {
return Column(
children: [
Container(
color: Color(0xFFF7F7F7),
padding: EdgeInsets.all(12),
alignment: Alignment.centerLeft,
child: Text(
widget.activity != null
? widget.activity.mainTitle
: widget.article != null
? widget.article.mainTitle
: "",
style: TextStyle(
fontSize: 16.sp,
fontWeight: FontWeight.bold,
color: Color(0xFF353535),
),
),
),
Container(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
InkWell(
child: Text(
"${widget.activity != null ? (widget.activity.storeName ?? "") : (widget.article != null && widget.article.author != null) ? (widget.article.author.name ?? "") : ""}",
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: 14.sp,
color: Colors.blue,
),
),
onTap: () {
if (widget.activity != null) {
if (widget.arguments["source"] != null &&
widget.arguments["source"] ==
widget.activity.storeId) {
Navigator.of(context).pop();
} else {
Navigator.of(context).pushNamed(
'/router/union_detail_page',
arguments: {
"id": widget.activity.storeId,
"source":
widget.arguments["activityId"]
});
}
}
},
),
SizedBox(
width: 10.w,
),
Text(
widget.activity != null
? widget.activity.createTime
: widget.article != null
? widget.article.createTime
: "",
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: 12.sp,
color: Colors.grey,
),
),
],
),
),
],
);
}
}

7
pubspec.lock

@ -321,13 +321,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.4"
flutter_bugly:
dependency: "direct main"
description:
name: flutter_bugly
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.3"
flutter_cache_manager:
dependency: transitive
description:

2
pubspec.yaml

@ -92,7 +92,7 @@ dependencies:
rive: ^0.6.8
flare_flutter: ^3.0.2
flutter_bugly: ^0.3.3
# flutter_bugly: ^0.3.3
dev_dependencies:
flutter_test:

Loading…
Cancel
Save