diff --git a/android/app/build.gradle b/android/app/build.gradle index 3f4e7beb..0981cf9f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,6 +98,8 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.6.5' + implementation fileTree(include: ['*.aar'], dir: 'libs') implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.appcompat:appcompat:1.2.0' diff --git a/android/app/libs/wechat-sdk-android-without-mta-6.6.5.aar b/android/app/libs/wechat-sdk-android-without-mta-6.6.5.aar deleted file mode 100644 index 43719c13..00000000 Binary files a/android/app/libs/wechat-sdk-android-without-mta-6.6.5.aar and /dev/null differ diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 1fcdf9a2..b4781f76 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -60,12 +60,19 @@ + + android:launchMode="singleTop" > + + + + + + + diff --git a/android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt b/android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt index 0c183201..3a0174fc 100644 --- a/android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt +++ b/android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt @@ -1,29 +1,86 @@ package com.zsw.huixiang.wxapi +import android.content.Intent +import android.content.pm.PackageManager import android.os.Bundle import android.util.Log +import com.jarvan.fluwx.handlers.FluwxRequestHandler +import com.jarvan.fluwx.handlers.FluwxResponseHandler +import com.jarvan.fluwx.handlers.WXAPiHandler import com.tencent.mm.opensdk.modelbase.BaseReq import com.tencent.mm.opensdk.modelbase.BaseResp import io.dcloud.feature.payment.weixin.AbsWXPayCallbackActivity class WXPayEntryActivity : AbsWXPayCallbackActivity() { - - + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + try { + if (!WXAPiHandler.wxApiRegistered) { + var appInfo = packageManager.getApplicationInfo(packageName, PackageManager.GET_META_DATA) + val wechatAppId = appInfo.metaData.getString("weChatAppId") + if (wechatAppId != null ){ + WXAPiHandler.setupWxApi(wechatAppId, this) + WXAPiHandler.setCoolBool(true) + io.flutter.Log.d("fluwx", "weChatAppId:$wechatAppId") + }else { + io.flutter.Log.e("fluwx", "can't load meta-data weChatAppId") + } + } + WXAPiHandler.wxApi?.handleIntent(intent, this) + } catch (e: Exception) { + e.printStackTrace() + startSpecifiedActivity(defaultFlutterActivityAction()) + finish() + } Log.e("WXPayEntryActivity", "onCreate") } - override fun onReq(req: BaseReq?) { + override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + + setIntent(intent) + + try { + WXAPiHandler.wxApi?.handleIntent(intent, this) + } catch (e: Exception) { + e.printStackTrace() + startSpecifiedActivity(defaultFlutterActivityAction()) + finish() + } + } + + override fun onReq(req: BaseReq) { super.onReq(req) + FluwxRequestHandler.onReq(req, this) Log.e("WXPayEntryActivity", "req: $req") } - override fun onResp(resp: BaseResp?) { + override fun onResp(resp: BaseResp) { + FluwxResponseHandler.handleResponse(resp) super.onResp(resp) Log.e("WXPayEntryActivity", "resp: $resp") } + + + private fun startSpecifiedActivity(action: String, bundle: Bundle? = null, bundleKey: String? = null) { + Intent(action).run { + bundleKey?.let { + putExtra(bundleKey, bundle) + } + addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT) + packageManager?.let { + resolveActivity(packageManager)?.also { + startActivity(this) + finish() + } + } + } + } + + private fun defaultFlutterActivityAction(): String = "$packageName.FlutterActivity" + } \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index bbf553e6..0490457c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.3.50' + ext.kotlin_version = '1.4.10' repositories { maven { url 'https://maven.aliyun.com/repository/google' diff --git a/assets/image/2x/icon_permission_storage.png b/assets/image/2x/icon_permission_storage.png new file mode 100644 index 00000000..0791f431 Binary files /dev/null and b/assets/image/2x/icon_permission_storage.png differ diff --git a/assets/image/3x/icon_permission_storage.png b/assets/image/3x/icon_permission_storage.png new file mode 100644 index 00000000..61efb027 Binary files /dev/null and b/assets/image/3x/icon_permission_storage.png differ diff --git a/assets/image/icon_permission_storage.png b/assets/image/icon_permission_storage.png new file mode 100644 index 00000000..44d1f544 Binary files /dev/null and b/assets/image/icon_permission_storage.png differ diff --git a/ios/Podfile.lock b/ios/Podfile.lock index c568140b..eef3b171 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -11,6 +11,9 @@ PODS: - AMapLocation (2.6.8): - AMapFoundation (~> 1.6.4) - Flutter (1.0.0) + - fluwx (0.0.1): + - Flutter + - WechatOpenSDK (= 1.8.7.1) - FMDB (2.7.5): - FMDB/standard (= 2.7.5) - FMDB/standard (2.7.5) @@ -39,11 +42,13 @@ PODS: - Flutter - webview_flutter (0.0.1): - Flutter + - WechatOpenSDK (1.8.7.1) DEPENDENCIES: - amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`) - amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`) - Flutter (from `Flutter`) + - fluwx (from `.symlinks/plugins/fluwx/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`) - package_info (from `.symlinks/plugins/package_info/ios`) @@ -63,6 +68,7 @@ SPEC REPOS: - AMapLocation - FMDB - TOCropViewController + - WechatOpenSDK EXTERNAL SOURCES: amap_flutter_location: @@ -71,6 +77,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/amap_flutter_map/ios" Flutter: :path: Flutter + fluwx: + :path: ".symlinks/plugins/fluwx/ios" image_cropper: :path: ".symlinks/plugins/image_cropper/ios" image_picker: @@ -101,6 +109,7 @@ SPEC CHECKSUMS: AMapFoundation: c7da72b42a713f1429c88af1858d623dde88934b AMapLocation: dad27669c4ca68e395ce7532ff614b7d4d45f7b7 Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c + fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902 FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 @@ -114,6 +123,7 @@ SPEC CHECKSUMS: video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e wakelock: bfc7955c418d0db797614075aabbc58a39ab5107 webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 + WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44 PODFILE CHECKSUM: 3dec887221b0cf3fccf2bbd3f50f36c0ad0bcbeb diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 7adc16ef..7215222f 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -2,6 +2,10 @@ + CFBundleURLSchemes + + wx3b269e795ed23e5f + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index d91146cb..a8bb0b32 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -104,6 +104,8 @@ class MessageLookup extends MessageLookupByLibrary { "chuangjianshijian" : m2, "chuangshirendegushi" : MessageLookupByLibrary.simpleMessage("创始人的故事"), "code_error" : MessageLookupByLibrary.simpleMessage("验证码输入错误"), + "cunchu" : MessageLookupByLibrary.simpleMessage("存储"), + "cunchutishixinxi" : MessageLookupByLibrary.simpleMessage("为了获得照片使用、缓存等功能,推荐您在使用期间打开存储权限"), "daifukuan" : MessageLookupByLibrary.simpleMessage("待付款"), "daipeisong" : MessageLookupByLibrary.simpleMessage("待配送"), "daiqucan" : MessageLookupByLibrary.simpleMessage("待取餐"), @@ -139,7 +141,6 @@ class MessageLookup extends MessageLookupByLibrary { "duihuanlishi" : MessageLookupByLibrary.simpleMessage("兑换历史"), "duihuanshangpinxiangqing" : MessageLookupByLibrary.simpleMessage("兑换商品详情"), "duihuanxinxi" : MessageLookupByLibrary.simpleMessage("兑换信息"), - "faceidtishixinxi" : MessageLookupByLibrary.simpleMessage("为了更好的保护账户安全支付更便捷,推荐您在使用期间让我们使用Face ID"), "fanhuiduihuanlishi" : MessageLookupByLibrary.simpleMessage("返回兑换历史"), "fankui" : MessageLookupByLibrary.simpleMessage("反馈"), "fantizhongwen" : MessageLookupByLibrary.simpleMessage("繁体中文"), @@ -267,7 +268,7 @@ class MessageLookup extends MessageLookupByLibrary { "qianwanghuixiangmendianduihuanhexiao" : MessageLookupByLibrary.simpleMessage("前往一心回乡旗下任意门店对工作人员出示商品兑换码,核实无误后,可领取对应商品"), "qinglihuancun" : MessageLookupByLibrary.simpleMessage("清理缓存"), "qingshurubeizhuyaoqiu" : MessageLookupByLibrary.simpleMessage("请输入备注要求"), - "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("输入充值金额(元)"), + "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("请输入充值金额"), "qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("请输入手机号"), "qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("请输入支付密码"), @@ -405,6 +406,7 @@ class MessageLookup extends MessageLookupByLibrary { "yishiming" : MessageLookupByLibrary.simpleMessage("已实名"), "yishixiao" : MessageLookupByLibrary.simpleMessage("已失效"), "yishiyong" : MessageLookupByLibrary.simpleMessage("已使用"), + "yishouquan" : MessageLookupByLibrary.simpleMessage("已授权"), "yisongda" : MessageLookupByLibrary.simpleMessage("已送达"), "yituikuan" : MessageLookupByLibrary.simpleMessage("已退款"), "yiwancheng" : MessageLookupByLibrary.simpleMessage(" 已完成 "), diff --git a/lib/generated/intl/messages_zh_CN.dart b/lib/generated/intl/messages_zh_CN.dart index 24a85387..d514940a 100644 --- a/lib/generated/intl/messages_zh_CN.dart +++ b/lib/generated/intl/messages_zh_CN.dart @@ -104,6 +104,8 @@ class MessageLookup extends MessageLookupByLibrary { "chuangjianshijian" : m2, "chuangshirendegushi" : MessageLookupByLibrary.simpleMessage("创始人的故事"), "code_error" : MessageLookupByLibrary.simpleMessage("验证码输入错误"), + "cunchu" : MessageLookupByLibrary.simpleMessage("存储"), + "cunchutishixinxi" : MessageLookupByLibrary.simpleMessage("为了获得照片使用、缓存等功能,推荐您在使用期间打开存储权限"), "daifukuan" : MessageLookupByLibrary.simpleMessage("待付款"), "daipeisong" : MessageLookupByLibrary.simpleMessage("待配送"), "daiqucan" : MessageLookupByLibrary.simpleMessage("待取餐"), @@ -139,7 +141,6 @@ class MessageLookup extends MessageLookupByLibrary { "duihuanlishi" : MessageLookupByLibrary.simpleMessage("兑换历史"), "duihuanshangpinxiangqing" : MessageLookupByLibrary.simpleMessage("兑换商品详情"), "duihuanxinxi" : MessageLookupByLibrary.simpleMessage("兑换信息"), - "faceidtishixinxi" : MessageLookupByLibrary.simpleMessage("为了更好的保护账户安全支付更便捷,推荐您在使用期间让我们使用Face ID"), "fanhuiduihuanlishi" : MessageLookupByLibrary.simpleMessage("返回兑换历史"), "fankui" : MessageLookupByLibrary.simpleMessage("反馈"), "fantizhongwen" : MessageLookupByLibrary.simpleMessage("繁体中文"), @@ -266,7 +267,7 @@ class MessageLookup extends MessageLookupByLibrary { "qianwanghuixiangmendianduihuanhexiao" : MessageLookupByLibrary.simpleMessage("前往一心回乡旗下任意门店对工作人员出示商品兑换码,核实无误后,可领取对应商品"), "qinglihuancun" : MessageLookupByLibrary.simpleMessage("清理缓存"), "qingshurubeizhuyaoqiu" : MessageLookupByLibrary.simpleMessage("请输入备注要求"), - "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("输入充值金额(元)"), + "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("请输入充值金额"), "qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("请输入手机号"), "qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("请输入支付密码"), @@ -404,6 +405,7 @@ class MessageLookup extends MessageLookupByLibrary { "yishiming" : MessageLookupByLibrary.simpleMessage("已实名"), "yishixiao" : MessageLookupByLibrary.simpleMessage("已失效"), "yishiyong" : MessageLookupByLibrary.simpleMessage("已使用"), + "yishouquan" : MessageLookupByLibrary.simpleMessage("已授权"), "yisongda" : MessageLookupByLibrary.simpleMessage("已送达"), "yituikuan" : MessageLookupByLibrary.simpleMessage("已退款"), "yiwancheng" : MessageLookupByLibrary.simpleMessage(" 已完成 "), diff --git a/lib/generated/intl/messages_zh_TW.dart b/lib/generated/intl/messages_zh_TW.dart index 8f66d586..7163f24d 100644 --- a/lib/generated/intl/messages_zh_TW.dart +++ b/lib/generated/intl/messages_zh_TW.dart @@ -104,6 +104,8 @@ class MessageLookup extends MessageLookupByLibrary { "chuangjianshijian" : m2, "chuangshirendegushi" : MessageLookupByLibrary.simpleMessage("創始人的故事"), "code_error" : MessageLookupByLibrary.simpleMessage("驗證碼輸入錯誤"), + "cunchu" : MessageLookupByLibrary.simpleMessage("存儲"), + "cunchutishixinxi" : MessageLookupByLibrary.simpleMessage("為了獲得照片使用、緩存等功能,推薦您使用期間打開存儲權限"), "daifukuan" : MessageLookupByLibrary.simpleMessage("待付款"), "daipeisong" : MessageLookupByLibrary.simpleMessage("待配送"), "daiqucan" : MessageLookupByLibrary.simpleMessage("待取餐"), @@ -139,7 +141,6 @@ class MessageLookup extends MessageLookupByLibrary { "duihuanlishi" : MessageLookupByLibrary.simpleMessage("兌換歷史"), "duihuanshangpinxiangqing" : MessageLookupByLibrary.simpleMessage("兑换商品详情"), "duihuanxinxi" : MessageLookupByLibrary.simpleMessage("兑换信息"), - "faceidtishixinxi" : MessageLookupByLibrary.simpleMessage("為了更好的保護帳戶安全支付更便捷,推薦您在使用期間讓我們使用Face ID "), "fanhuiduihuanlishi" : MessageLookupByLibrary.simpleMessage("返回兌換歷史"), "fankui" : MessageLookupByLibrary.simpleMessage("反饋"), "fantizhongwen" : MessageLookupByLibrary.simpleMessage("繁体中文"), @@ -266,7 +267,7 @@ class MessageLookup extends MessageLookupByLibrary { "qianwanghuixiangmendianduihuanhexiao" : MessageLookupByLibrary.simpleMessage("前往一心回乡旗下任意门店对工作人员出示商品兑换码,核实无误后,可领取对应商品"), "qinglihuancun" : MessageLookupByLibrary.simpleMessage("清理緩存"), "qingshurubeizhuyaoqiu" : MessageLookupByLibrary.simpleMessage("請輸入備注要求"), - "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("輸入充值金額(元)"), + "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("請輸入充值金額"), "qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("請輸入手機號碼"), "qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), "qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("請輸入支付密碼"), @@ -404,6 +405,7 @@ class MessageLookup extends MessageLookupByLibrary { "yishiming" : MessageLookupByLibrary.simpleMessage("已实名"), "yishixiao" : MessageLookupByLibrary.simpleMessage("已失效"), "yishiyong" : MessageLookupByLibrary.simpleMessage("已使用"), + "yishouquan" : MessageLookupByLibrary.simpleMessage("已授權"), "yisongda" : MessageLookupByLibrary.simpleMessage("已送達"), "yituikuan" : MessageLookupByLibrary.simpleMessage("已退款"), "yiwancheng" : MessageLookupByLibrary.simpleMessage(" 已完成 "), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 56bc1274..1b6865e2 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -1165,11 +1165,21 @@ class S { ); } - /// `为了更好的保护账户安全支付更便捷,推荐您在使用期间让我们使用Face ID` - String get faceidtishixinxi { + /// `为了获得照片使用、缓存等功能,推荐您在使用期间打开存储权限` + String get cunchutishixinxi { return Intl.message( - '为了更好的保护账户安全支付更便捷,推荐您在使用期间让我们使用Face ID', - name: 'faceidtishixinxi', + '为了获得照片使用、缓存等功能,推荐您在使用期间打开存储权限', + name: 'cunchutishixinxi', + desc: '', + args: [], + ); + } + + /// `存储` + String get cunchu { + return Intl.message( + '存储', + name: 'cunchu', desc: '', args: [], ); @@ -2195,10 +2205,10 @@ class S { ); } - /// `输入充值金额(元)` + /// `请输入充值金额` String get qingshuruchongzhijine { return Intl.message( - '输入充值金额(元)', + '请输入充值金额', name: 'qingshuruchongzhijine', desc: '', args: [], @@ -3705,6 +3715,16 @@ class S { ); } + /// `已授权` + String get yishouquan { + return Intl.message( + '已授权', + name: 'yishouquan', + desc: '', + args: [], + ); + } + /// `并使用本机号码登录` String get privacy_policy4 { return Intl.message( diff --git a/lib/home/activity_list_page.dart b/lib/home/activity_list_page.dart index 5615e50d..35a204c2 100644 --- a/lib/home/activity_list_page.dart +++ b/lib/home/activity_list_page.dart @@ -1,7 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/main.dart'; import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; @@ -11,6 +10,8 @@ import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_footer.dart'; +import 'package:keframe/frame_separate_widget.dart'; +import 'package:keframe/size_cache_widget.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -30,7 +31,8 @@ class _ActivityListPage extends State void initState() { super.initState(); SharedPreferences.getInstance().then((value) => { - apiService = ApiService(Dio(), context: context, token: value.getString('token')), + apiService = ApiService(Dio(), + context: context, token: value.getString('token')), queryActivity(), }); @@ -74,36 +76,60 @@ class _ActivityListPage extends State Widget build(BuildContext context) { super.build(context); return Container( - child: SmartRefresher( - controller: _refreshController, - enablePullDown: true, - enablePullUp: false, - header: MyHeader(), - physics: BouncingScrollPhysics(), - footer: CustomFooter( - builder: (context, mode) { - return MyFooter(mode); - }, - ), - onRefresh: queryActivity, - child: ListView.builder( - itemCount: activityList == null ? 0 : activityList.length, - itemBuilder: (context, position) { - return InkWell( - onTap: () { - Navigator.of(context) - .pushNamed('/router/store_detail_page', arguments: { - "html": activityList[position].content, - "title": activityList[position].mainTitle, - "time": activityList[position].createTime, - "storeId": activityList[position].storeId, - "author": activityList[position].storeName - }); + child: SizeCacheWidget( + child: SmartRefresher( + controller: _refreshController, + enablePullDown: true, + enablePullUp: false, + header: MyHeader(), + physics: BouncingScrollPhysics(), + footer: CustomFooter( + builder: (context, mode) { + return MyFooter(mode); }, - child: activityItem(activityList[position]), - ); - }, - ), + ), + onRefresh: queryActivity, + child: ListView.builder( + itemCount: activityList == null ? 0 : activityList.length, + physics: NeverScrollableScrollPhysics(), + itemBuilder: (context, position) { + return InkWell( + onTap: () { + Navigator.of(context) + .pushNamed('/router/store_detail_page', arguments: { + "html": activityList[position].content, + "title": activityList[position].mainTitle, + "time": activityList[position].createTime, + "storeId": activityList[position].storeId, + "author": activityList[position].storeName + }); + }, + child: FrameSeparateWidget( + child: activityItem(activityList[position]), + placeHolder: AspectRatio( + aspectRatio: 1.34, + child: Container( + margin: EdgeInsets.only( + left: 16.w, right: 16.w, top: 8.h, bottom: 8.h), + decoration: BoxDecoration( + color: Colors.white, + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + borderRadius: BorderRadius.circular(8), + ), + ), + ), + ), + ); + }, + ), + ), ), ); } @@ -139,7 +165,8 @@ class _ActivityListPage extends State fadeSrc: "assets/image/default_2_1.png", ), Container( - padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 8.h, bottom: 12.h), + padding: EdgeInsets.only( + left: 16.w, right: 16.w, top: 8.h, bottom: 12.h), child: Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 6509e50b..9741cae9 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -158,66 +158,68 @@ class _HomePage extends State with AutomaticKeepAliveClientMixin { header: MyHeader(), physics: BouncingScrollPhysics(), onRefresh: queryHome, - child: ListView( + child: SingleChildScrollView( physics: NeverScrollableScrollPhysics(), - children: [ - banner(), - ItemTitle( - text: S.of(context).jinrihuiyuanrenwu, - imgPath: "assets/image/icon_today_task.png", - moreText: S.of(context).renwuzhongxin, - onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString('token') == null) { - loginTips(); - } else { - Navigator.of(context).pushNamed('/router/integral_page'); - } - }); - }, - ), - InkWell( - onTap: () { - SharedPreferences.getInstance().then((value) { - if (value.getString('token') == null) { - loginTips(); - } else { - Navigator.of(context).pushNamed('/router/integral_page'); - } - }); - }, - child: signIn(), - ), - ItemTitle( - text: S.of(context).remenwenzhangshipin, - imgPath: "assets/image/icon_today_video.png", - moreText: S.of(context).chakangengduo, - onTap: () { - Navigator.of(context).pushNamed('/router/hot_article_page'); - }, - ), - hotList(), - ItemTitle( - text: S.of(context).chuangshirendegushi, - imgPath: "assets/image/icon_founder.png", - ), - GestureDetector( - onTap: () { - Navigator.of(context).pushNamed('/router/founder_story_page'); - }, - child: founderStore(), - ), - ItemTitle( - text: S.of(context).pinpaijieshao, - imgPath: "assets/image/icon_brand_introduction.png", - ), - brands(), - ItemTitle( - text: S.of(context).jifenshangcheng, - imgPath: "assets/image/icon_points_mall.png", - ), - integralStore(), - ], + child: Column( + children: [ + banner(), + ItemTitle( + text: S.of(context).jinrihuiyuanrenwu, + imgPath: "assets/image/icon_today_task.png", + moreText: S.of(context).renwuzhongxin, + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString('token') == null) { + loginTips(); + } else { + Navigator.of(context).pushNamed('/router/integral_page'); + } + }); + }, + ), + InkWell( + onTap: () { + SharedPreferences.getInstance().then((value) { + if (value.getString('token') == null) { + loginTips(); + } else { + Navigator.of(context).pushNamed('/router/integral_page'); + } + }); + }, + child: signIn(), + ), + ItemTitle( + text: S.of(context).remenwenzhangshipin, + imgPath: "assets/image/icon_today_video.png", + moreText: S.of(context).chakangengduo, + onTap: () { + Navigator.of(context).pushNamed('/router/hot_article_page'); + }, + ), + hotList(), + ItemTitle( + text: S.of(context).chuangshirendegushi, + imgPath: "assets/image/icon_founder.png", + ), + GestureDetector( + onTap: () { + Navigator.of(context).pushNamed('/router/founder_story_page'); + }, + child: founderStore(), + ), + ItemTitle( + text: S.of(context).pinpaijieshao, + imgPath: "assets/image/icon_brand_introduction.png", + ), + brands(), + ItemTitle( + text: S.of(context).jifenshangcheng, + imgPath: "assets/image/icon_points_mall.png", + ), + integralStore(), + ], + ), ), ), ); diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index bbfd2f47..9c8378ad 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -112,7 +112,8 @@ "weizhitishixinxi": "为了向您推荐附近的门店信息,推荐您在使用HISAPP时让我们使用位置信息", "tongzhitishixinxi": "为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收", "xiangjitishixinxi": "为了您可以在使用过程中进行分享,希望您使用HISAPP时让我们使用相机功能", - "faceidtishixinxi": "为了更好的保护账户安全支付更便捷,推荐您在使用期间让我们使用Face ID", + "cunchutishixinxi": "为了获得照片使用、缓存等功能,推荐您在使用期间打开存储权限", + "cunchu": "存储", "wodejifenzhi": "我的积分值", "mingxi": "明细", "qiandaolingjifen": "签到领积分", @@ -383,6 +384,8 @@ "qudenglu": "去登录", "weidenglu": "未登录", "youkedenglu": "游客登录", + "yishouquan": "已授权", + "qingshuruchongzhijine": "请输入充值金额", diff --git a/lib/l10n/intl_zh_CN.arb b/lib/l10n/intl_zh_CN.arb index 1762a863..225e9147 100644 --- a/lib/l10n/intl_zh_CN.arb +++ b/lib/l10n/intl_zh_CN.arb @@ -112,7 +112,8 @@ "weizhitishixinxi": "为了向您推荐附近的门店信息,推荐您在使用HISAPP时让我们使用位置信息", "tongzhitishixinxi": "为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收", "xiangjitishixinxi": "为了您可以在使用过程中进行分享,希望您使用HISAPP时让我们使用相机功能", - "faceidtishixinxi": "为了更好的保护账户安全支付更便捷,推荐您在使用期间让我们使用Face ID", + "cunchutishixinxi": "为了获得照片使用、缓存等功能,推荐您在使用期间打开存储权限", + "cunchu": "存储", "wodejifenzhi": "我的积分值", "mingxi": "明细", "qiandaolingjifen": "签到领积分", @@ -384,6 +385,8 @@ "qudenglu": "去登录", "weidenglu": "未登录", "youkedenglu": "游客登录", + "yishouquan": "已授权", + "qingshuruchongzhijine": "请输入充值金额", diff --git a/lib/l10n/intl_zh_TW.arb b/lib/l10n/intl_zh_TW.arb index c1c245d8..7edba753 100644 --- a/lib/l10n/intl_zh_TW.arb +++ b/lib/l10n/intl_zh_TW.arb @@ -115,7 +115,8 @@ "weizhitishixinxi": "為了向您推薦附近的門店資訊,推薦您在使用HISAPP時讓我們使用位置資訊", "tongzhitishixinxi": "為了您可以及時收到我們的活動資訊,推薦您在使用HISAPP時打開通知的接收 ", "xiangjitishixinxi": "為了您可以在使用過程中進行分享,希望您使用HISAPP時讓我們使用相機功能 ", - "faceidtishixinxi": "為了更好的保護帳戶安全支付更便捷,推薦您在使用期間讓我們使用Face ID ", + "cunchutishixinxi": "為了獲得照片使用、緩存等功能,推薦您使用期間打開存儲權限", + "cunchu": "存儲", "wodejifenzhi": "我的積分值", "wodehuiyuandengji": "我的會員等級", "mingxi": "明細", @@ -376,6 +377,8 @@ "qudenglu": "去登錄", "weidenglu": "未登錄", "youkedenglu": "遊客登錄", + "yishouquan": "已授權", + "qingshuruchongzhijine": "請輸入充值金額", "privacy_policy4": "并使用本機號碼登錄" diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 74ea50a0..4cc11ea5 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -42,7 +42,7 @@ class _MineWalletPage extends State { SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); userInfo = UserInfo.fromJson(jsonDecode(sharedPreferences.getString('user'))); - mBalance = double.tryParse(userInfo.money).toInt(); + mBalance = double.tryParse(userInfo.money); if (mounted) setState(() {}); String token = sharedPreferences.getString("token"); @@ -59,9 +59,8 @@ class _MineWalletPage extends State { BaseData baseData = await apiService.queryInfo(); if (baseData != null && baseData.isSuccess) { userInfo = UserInfo.fromJson(baseData.data); - mBalance = double.tryParse(userInfo.money).toInt(); - if (mounted) - setState(() {}); + mBalance = double.tryParse(userInfo.money); + if (mounted) setState(() {}); } } @@ -211,11 +210,11 @@ class _MineWalletPage extends State { // ], // ), Container( - margin: EdgeInsets.only(top: 14), + margin: EdgeInsets.only(top: 14.h), child: ListView.builder( itemCount: userBills != null ? userBills.length : 0, shrinkWrap: true, - padding: EdgeInsets.only(bottom: 20), + padding: EdgeInsets.only(bottom: 20.h), physics: NeverScrollableScrollPhysics(), itemBuilder: (context, position) { return historyItem(userBills[position], position); @@ -228,23 +227,23 @@ class _MineWalletPage extends State { Widget historyItem(UserBill userBill, position) { return Container( - margin: EdgeInsets.only(top: 10, bottom: 10), + margin: EdgeInsets.only(top: 10.h, bottom: 10.h), child: Row( children: [ Image.asset( userBill.pm == 0 ? "assets/image/icon_wallet_withdrawal.png" : "assets/image/icon_wallet_recharge.png", - width: 34, - height: 34, + width: 34.w, + height: 34.h, ), SizedBox( - width: 12, + width: 12.w, ), Expanded( flex: 1, child: Container( - height: 34, + height: 34.h, child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.start, @@ -253,7 +252,7 @@ class _MineWalletPage extends State { userBill.name, style: TextStyle( color: Colors.black, - fontSize: 12, + fontSize: 12.sp, ), ), Text( @@ -277,7 +276,8 @@ class _MineWalletPage extends State { ? "-${userBill.number}" : "+${userBill.number}", style: TextStyle( - color: Colors.black, + color: Color(0xFF20662A), + fontWeight: FontWeight.bold, fontSize: 12.sp, ), ), @@ -299,43 +299,53 @@ class _MineWalletPage extends State { Widget balance() { return Container( width: double.infinity, - margin: EdgeInsets.fromLTRB(16, 16, 16, 8), - padding: EdgeInsets.fromLTRB(24, 24, 24, 24), + margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 8.h), + padding: EdgeInsets.fromLTRB(24.w, 24.h, 24.w, 24.h), decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0) - ]), + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(8)), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), child: Column( children: [ Text( S.of(context).zhanghuyue, style: TextStyle( - fontWeight: FontWeight.bold, - color: Color(0xFF353535), - fontSize: 16), + fontWeight: FontWeight.bold, + color: Color(0xFF353535), + fontSize: 16.sp, + ), + ), + SizedBox( + height: 16.h, ), Text( "$mBalance", style: TextStyle( - fontWeight: FontWeight.bold, - color: Color(0xFF353535), - fontSize: 60), + fontWeight: FontWeight.w500, + color: Color(0xFF353535), + fontSize: 50.sp, + ), + ), + SizedBox( + height: 4.h, ), Text( S.of(context).keyongyue, style: TextStyle( color: Color(0xFF20662A), - fontSize: 16, + fontSize: 16.sp, ), ), SizedBox( - height: 24, + height: 24.h, ), InkWell( onTap: () { @@ -350,8 +360,8 @@ class _MineWalletPage extends State { textColor: Colors.white, radius: 15, backgroup: Color(0xFF20662A), - fontSize: 12, - padding: EdgeInsets.fromLTRB(12, 4, 12, 4), + fontSize: 12.sp, + padding: EdgeInsets.fromLTRB(12.w, 4.h, 12.w, 4.h), ), ), ], @@ -368,17 +378,18 @@ class _MineWalletPage extends State { Navigator.of(context).pushNamed('/router/recharge_page'); }, child: Container( - margin: EdgeInsets.fromLTRB(16, 16, 16, 16), - padding: EdgeInsets.fromLTRB(0, 7, 0, 7), + margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + padding: EdgeInsets.fromLTRB(0, 7.h, 0, 7.h), decoration: BoxDecoration( color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8)), + borderRadius: BorderRadius.circular(8), boxShadow: [ BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0) + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) ]), child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -386,15 +397,16 @@ class _MineWalletPage extends State { children: [ Image.asset( "assets/image/icon_wallet_recharge.png", - width: 40, - height: 40, + width: 40.w, + height: 40.h, ), Text( S.of(context).chongzhi, style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: Colors.black), + fontWeight: FontWeight.bold, + fontSize: 16.sp, + color: Colors.black, + ), ) ], ), @@ -404,8 +416,8 @@ class _MineWalletPage extends State { ), Expanded( child: Container( - margin: EdgeInsets.fromLTRB(16, 16, 16, 16), - padding: EdgeInsets.fromLTRB(0, 7, 0, 7), + margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h), + padding: EdgeInsets.fromLTRB(0, 7.h, 0, 7.h), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(8)), @@ -422,15 +434,16 @@ class _MineWalletPage extends State { children: [ Image.asset( "assets/image/icon_wallet_withdrawal.png", - width: 40, - height: 40, + width: 40.w, + height: 40.w, ), Text( S.of(context).tixian, style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - color: Colors.black), + fontWeight: FontWeight.bold, + fontSize: 16.sp, + color: Colors.black, + ), ) ], ), diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index 7b3e3ae3..a905346b 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -1,11 +1,19 @@ +import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:fluwx/fluwx.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:huixiang/retrofit/data/base_data.dart'; +import 'package:huixiang/retrofit/data/wx_pay.dart'; +import 'package:huixiang/retrofit/retrofit_api.dart'; +import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/item_input_widget.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/round_button.dart'; +import 'package:shared_preferences/shared_preferences.dart'; class RechargePage extends StatefulWidget { - @override State createState() { return _RechargePage(); @@ -13,10 +21,22 @@ class RechargePage extends StatefulWidget { } class _RechargePage extends State { - TextEditingController controller; + ApiService apiService; + + TextEditingController controller = TextEditingController(); Color color = Colors.black; + @override + void initState() { + super.initState(); + + SharedPreferences.getInstance().then((value) { + apiService = ApiService(Dio(), + context: context, token: value.getString("token"), pay: true); + }); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -26,7 +46,7 @@ class _RechargePage extends State { style: TextStyle( color: Colors.black, fontWeight: FontWeight.bold, - fontSize: 18, + fontSize: 18.sp, ), ), centerTitle: false, @@ -38,7 +58,7 @@ class _RechargePage extends State { }, child: Container( alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), + margin: EdgeInsets.only(left: 10.w), padding: EdgeInsets.all(6), child: Icon( Icons.arrow_back_ios, @@ -48,7 +68,7 @@ class _RechargePage extends State { ), ), titleSpacing: 2, - leadingWidth: 56, + leadingWidth: 56.w, ), body: SingleChildScrollView( physics: BouncingScrollPhysics(), @@ -67,9 +87,13 @@ class _RechargePage extends State { errorTextColor: Color(0xFF32A060), radius: 8, style: TextStyle( - fontWeight: FontWeight.bold, fontSize: 30.sp, color: color), - inputLimit: 16, + fontWeight: FontWeight.bold, + fontSize: 30.sp, + color: color, + ), + inputLimit: 12, textInputType: TextInputType.number, + textInputFormatter: FilteringTextInputFormatter.digitsOnly, onChanged: (value) { if (value != null && value != "" && @@ -83,10 +107,18 @@ class _RechargePage extends State { ), Container( width: double.infinity, - margin: - EdgeInsets.only(left: 20, right: 20, top: 12, bottom: 4), - padding: - EdgeInsets.only(left: 20, right: 16, top: 20, bottom: 20), + margin: EdgeInsets.only( + left: 20.w, + right: 20.w, + top: 12.h, + bottom: 4.h, + ), + padding: EdgeInsets.only( + left: 20.w, + right: 16.w, + top: 20.h, + bottom: 20.h, + ), decoration: BoxDecoration( boxShadow: [ BoxShadow( @@ -105,73 +137,94 @@ class _RechargePage extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only(bottom: 16), + padding: EdgeInsets.only(bottom: 16.h), child: Text( S.of(context).zhifufangshi, style: TextStyle( - fontSize: 16, + fontSize: 16.sp, color: color, fontWeight: FontWeight.bold, ), ), ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset("assets/image/icon_alipay.png"), - Expanded( - flex: 1, - child: Padding( - padding: EdgeInsets.only(left: 8, bottom: 20), - child: Text(S.of(context).zhifubao, + GestureDetector( + onTap: () { + setState(() { + checkIndex = 0; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset("assets/image/icon_alipay.png"), + Expanded( + flex: 1, + child: Padding( + padding: EdgeInsets.only(left: 8.w, bottom: 20.h), + child: Text( + S.of(context).zhifubao, style: TextStyle( - fontSize: 14, + fontSize: 14.sp, color: Color(0xff353535), - )), + ), + ), + ), ), - ), - checkView(0), - ], + checkView(0), + ], + ), ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset("assets/image/icon_we_chat.png"), - Expanded( - flex: 1, - child: Padding( - padding: EdgeInsets.only(left: 8), - child: Text(S.of(context).weixinzhifu, - style: TextStyle( - fontSize: 14, - color: Color(0xff353535), - )), + GestureDetector( + onTap: () { + setState(() { + checkIndex = 1; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset("assets/image/icon_we_chat.png"), + Expanded( + flex: 1, + child: Padding( + padding: EdgeInsets.only(left: 8.w), + child: Text(S.of(context).weixinzhifu, + style: TextStyle( + fontSize: 14.sp, + color: Color(0xff353535), + )), + ), ), - ), - checkView(1), - ], - ) + checkView(1), + ], + ), + ), ], ), ), - Container( - margin: EdgeInsets.only(left: 20, right: 20, top: 26), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - RoundButton( - width: double.infinity, - height: 46, - text:S.of(context).querenchongzhi, - textColor: Colors.white, - fontSize: 14, - backgroup: Color(0xff32A060), - fontWeight: FontWeight.bold, - ), - ], + InkWell( + onTap: () { + recharge(); + }, + child: Container( + margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 26.h), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + RoundButton( + width: double.infinity, + height: 46.h, + text: S.of(context).querenchongzhi, + textColor: Colors.white, + fontSize: 14.sp, + backgroup: Color(0xff32A060), + fontWeight: FontWeight.bold, + ), + ], + ), ), ), ], @@ -180,25 +233,55 @@ class _RechargePage extends State { ), ); } + var checkIndex = 0; Widget checkView(var index) { - return GestureDetector( - onTap: () { - setState(() { - checkIndex = index; - }); - }, - child: Container( - padding: EdgeInsets.only(right: 16), - alignment: Alignment.center, - child: Image.asset( - checkIndex != index - ? "assets/image/icon_radio_unselected.png" - : "assets/image/icon_radio_selected.png", - width: 15, - height: 15, - )), + return Container( + padding: EdgeInsets.only(right: 16.w), + alignment: Alignment.center, + child: Image.asset( + checkIndex != index + ? "assets/image/icon_radio_unselected.png" + : "assets/image/icon_radio_selected.png", + width: 15.w, + height: 15.h, + ), ); } + + recharge() async { + String money = controller.text; + if (money == null || money == "") { + SmartDialog.showToast(S.of(context).qingshuruchongzhijine); + return; + } + int amount = int.tryParse(money); + if (checkIndex == 1) { + if (!(await Min.isInitialize())) { + // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + // 故而在此初始化一下 + await Min.initialize(); + } + + BaseData baseData = + await apiService.recharge({"amount": amount, "rechargeType": 2}); + if (baseData != null && baseData.isSuccess) { + WxPay wxPay = WxPay.fromJson(baseData.data); + await registerWxApi(appId: wxPay.appId, doOnAndroid: true, universalLink: "https://hx.lotus-wallet.com/app/"); + payWithWeChat( + appId: wxPay.appId, + partnerId: wxPay.partnerId, + prepayId: wxPay.prepayId, + packageValue: wxPay.packageValue, + nonceStr: wxPay.nonceStr, + timeStamp: int.tryParse(wxPay.timeStamp), + sign: wxPay.sign); + weChatResponseEventHandler.listen((event) async { + print("payCallback: ${event.errCode}"); + }); + } + } + } } diff --git a/lib/retrofit/data/banner.dart b/lib/retrofit/data/banner.dart index acada831..fbde6463 100644 --- a/lib/retrofit/data/banner.dart +++ b/lib/retrofit/data/banner.dart @@ -2,6 +2,7 @@ class BannerData { String content; String createTime; + String contentType; String createUser; String id; String imgUrl; @@ -12,11 +13,12 @@ class BannerData { String updateTime; String updateUser; - BannerData({this.content, this.createTime, this.createUser, this.id, this.imgUrl, this.isDelete, this.storeId, this.tenantCode, this.type, this.updateTime, this.updateUser}); + BannerData({this.content, this.createTime, this.contentType, this.createUser, this.id, this.imgUrl, this.isDelete, this.storeId, this.tenantCode, this.type, this.updateTime, this.updateUser}); factory BannerData.fromJson(Map json) => BannerData( content: json['content'] as String, createTime: json['createTime'] as String, + contentType: json['contentType'] as String, createUser: json['createUser'] as String, id: json['id'] as String, imgUrl: json['imgUrl'] as String, @@ -31,6 +33,7 @@ class BannerData { Map toJson() => { 'content': this.content, 'createTime': this.createTime, + 'contentType': this.contentType, 'createUser': this.createUser, 'id': this.id, 'imgUrl': this.imgUrl, diff --git a/lib/retrofit/data/wx_pay.dart b/lib/retrofit/data/wx_pay.dart new file mode 100644 index 00000000..17017d8a --- /dev/null +++ b/lib/retrofit/data/wx_pay.dart @@ -0,0 +1,65 @@ +/// appId : "" +/// nonceStr : "" +/// packageValue : "" +/// partnerId : "" +/// prepayId : "" +/// sign : "" +/// timeStamp : "" + +class WxPay { + String _appId; + String _nonceStr; + String _packageValue; + String _partnerId; + String _prepayId; + String _sign; + String _timeStamp; + + String get appId => _appId; + String get nonceStr => _nonceStr; + String get packageValue => _packageValue; + String get partnerId => _partnerId; + String get prepayId => _prepayId; + String get sign => _sign; + String get timeStamp => _timeStamp; + + WxPay({ + String appId, + String nonceStr, + String packageValue, + String partnerId, + String prepayId, + String sign, + String timeStamp}){ + _appId = appId; + _nonceStr = nonceStr; + _packageValue = packageValue; + _partnerId = partnerId; + _prepayId = prepayId; + _sign = sign; + _timeStamp = timeStamp; +} + + WxPay.fromJson(dynamic json) { + _appId = json["appId"]; + _nonceStr = json["nonceStr"]; + _packageValue = json["packageValue"]; + _partnerId = json["partnerId"]; + _prepayId = json["prepayId"]; + _sign = json["sign"]; + _timeStamp = json["timeStamp"]; + } + + Map toJson() { + var map = {}; + map["appId"] = _appId; + map["nonceStr"] = _nonceStr; + map["packageValue"] = _packageValue; + map["partnerId"] = _partnerId; + map["prepayId"] = _prepayId; + map["sign"] = _sign; + map["timeStamp"] = _timeStamp; + return map; + } + +} \ No newline at end of file diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 672a3c6b..2e2c6963 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -7,9 +7,7 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:huixiang/login/login_page.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; -import 'package:huixiang/view_widget/loading_view.dart'; import 'package:huixiang/view_widget/login_tips.dart'; import 'package:retrofit/retrofit.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -17,8 +15,8 @@ import 'package:shared_preferences/shared_preferences.dart'; part 'retrofit_api.g.dart'; const base_url = "http://platform.test.api.lotus-wallet.com/app/"; -const baseUrl = "http://platform.test.api.lotus-wallet.com/app/"; -// const baseUrl = "http://192.168.10.236:8766/app/"; +// const baseUrl = "http://platform.test.api.lotus-wallet.com/app/"; +const baseUrl = "http://192.168.10.236:8766/app/"; // const baseUrl = "http://192.168.10.129:8766/app/"; @RestApi(baseUrl: baseUrl) @@ -28,9 +26,12 @@ abstract class ApiService { {String baseUrl, BuildContext context, String token, - bool showLoading = true}) { + bool showLoading = true, bool pay = false}) { Map headers = (token == null || token == "") ? {} : {'token': "Bearer $token"}; + if (pay) { + headers["Environment"] = "app"; + } dio.options = BaseOptions( connectTimeout: 60000, receiveTimeout: 60000, @@ -165,7 +166,7 @@ abstract class ApiService { Future signIn(); ///会员充值 - @POST("/member/recharge") + @POST("/wallet/recharge") Future recharge(@Body() Map param); ///领取优惠券 diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 9584b822..38a0d24a 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://platform.test.api.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.236:8766/app/'; } final Dio _dio; @@ -221,7 +221,7 @@ class _ApiService implements ApiService { final queryParameters = {}; final _data = {}; _data.addAll(param ?? {}); - final _result = await _dio.request>('/member/recharge', + final _result = await _dio.request>('/wallet/recharge', queryParameters: queryParameters, options: RequestOptions( method: 'POST', diff --git a/lib/setting/permission_setting_page.dart b/lib/setting/permission_setting_page.dart index d9ca96da..1fbeb301 100644 --- a/lib/setting/permission_setting_page.dart +++ b/lib/setting/permission_setting_page.dart @@ -1,5 +1,13 @@ +import 'dart:io'; + +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:huixiang/view_widget/request_permission.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:permission_handler/permission_handler.dart'; +import 'package:permission_handler/permission_handler.dart'; class PermissionSettingPage extends StatefulWidget { @override @@ -9,6 +17,50 @@ class PermissionSettingPage extends StatefulWidget { } class _PermissionSettingPage extends State { + @override + void initState() { + super.initState(); + + queryPermission(); + } + + List title = [ + S.current.dingwei, + S.current.tongzhi, + S.current.xiangji, + S.current.cunchu, + ]; + List icons = [ + "assets/image/icon_permission_location.png", + "assets/image/icon_permission_notices.png", + "assets/image/icon_permission_camera.png", + "assets/image/icon_permission_storage.png", + ]; + List contents = [ + S.current.weizhitishixinxi, + S.current.tongzhitishixinxi, + S.current.xiangjitishixinxi, + S.current.cunchutishixinxi, + ]; + + Map permissionSwitch = {}; + + List permissions = [ + Permission.location, + Permission.notification, + Permission.camera, + Permission.storage, + ]; + + queryPermission() async { + await permissions.forEach((element) async { + if (await element.isGranted) { + permissionSwitch[element] = true; + } + }); + setState(() {}); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -29,7 +81,7 @@ class _PermissionSettingPage extends State { }, child: Container( alignment: Alignment.centerRight, - margin: EdgeInsets.only(left: 10), + margin: EdgeInsets.only(left: 10.w), padding: EdgeInsets.all(6), child: Icon( Icons.arrow_back_ios, @@ -38,53 +90,88 @@ class _PermissionSettingPage extends State { ), ), ), - titleSpacing: 2, - leadingWidth: 56, + titleSpacing: 2.w, + leadingWidth: 56.w, ), body: Container( child: ListView.builder( - itemCount: 4, + itemCount: permissions.length, itemBuilder: (context, position) { - return buildPermissionItem( - title[position], icons[position], contents[position]); + return InkWell( + onTap: () { + openPermission(permissions[position]); + }, + child: buildPermissionItem(title[position], icons[position], + contents[position], permissions[position]), + ); }), ), ); } - List title = [ - S.current.dingwei, - S.current.tongzhi, - S.current.xiangji, - "Face ID", - ]; - List icons = [ - "assets/image/icon_permission_location.png", - "assets/image/icon_permission_notices.png", - "assets/image/icon_permission_camera.png", - "assets/image/icon_permission_face_id.png", - ]; - List contents = [ - S.current.weizhitishixinxi, - S.current.tongzhitishixinxi, - S.current.xiangjitishixinxi, - S.current.faceidtishixinxi, - ]; + openPermission(Permission permission) async { + if ((permissionSwitch.containsKey(permission) && + permissionSwitch[permission])) { + openAppSettings(); + return; + } + if(await permission.isPermanentlyDenied) { + requestDialog(); + } else if (await permission.isUndetermined) { + await permission.request(); + queryPermission(); + } else { + if (Platform.isIOS) { + //去设置中心 + requestDialog(); + } else { + if (permission == Permission.notification) { + requestDialog(); + } else { + await permission.request(); + queryPermission(); + } + } + } + } - Widget buildPermissionItem(title, icon, content) { + requestDialog() { + showCupertinoDialog( + context: context, + builder: (context) { + return RequestPermission( + "assets/image/icon_permission_location_bg.png", + S.of(context).nindingweiquanxianweiyunxu, + S.of(context).weilexiangnintuijianfujindemendianxinxi, + S.of(context).kaiqiquanxian, + (result) async { + if (result) { + await openAppSettings(); + queryPermission(); + } + }, + heightRatioWithWidth: 0.84, + ); + }); + } + + Widget buildPermissionItem( + title, icon, content, Permission permission) { return Container( - margin: EdgeInsets.fromLTRB(16, 8, 16, 8), - padding: EdgeInsets.fromLTRB(20, 16, 20, 16), + margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h), + padding: EdgeInsets.fromLTRB(20.w, 16.h, 20.w, 16.h), decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0) - ]), + color: Colors.white, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black.withAlpha(12), + offset: Offset(0, 3), + blurRadius: 14, + spreadRadius: 0, + ) + ], + ), child: Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, @@ -98,7 +185,7 @@ class _PermissionSettingPage extends State { title, style: TextStyle( color: Colors.black, - fontSize: 16, + fontSize: 16.sp, fontWeight: FontWeight.bold), ), SizedBox( @@ -106,13 +193,13 @@ class _PermissionSettingPage extends State { ), Image.asset( icon, - width: 22, - height: 22, + width: 22.w, + height: 22.h, ) ], ), SizedBox( - height: 8, + height: 8.h, ), Text( content, @@ -120,30 +207,18 @@ class _PermissionSettingPage extends State { maxLines: 2, style: TextStyle( color: Color(0xFF353535), - fontSize: 12, + fontSize: 12.sp, ), ), ], ), ), SizedBox( - width: 32, + width: 32.w, ), - Row( - children: [ - Text( - S.of(context).weikaiqi, - style: TextStyle( - color: Color(0xFF32A060), - fontSize: 12, - ), - ), - Icon( - Icons.keyboard_arrow_right, - size: 16, - color: Color(0xFF32A060), - ) - ], + CupertinoSwitch( + value: (permissionSwitch.containsKey(permission) && + permissionSwitch[permission]), ), ], ), diff --git a/lib/setting/setting_page.dart b/lib/setting/setting_page.dart index b3b5ece4..5f5dd950 100644 --- a/lib/setting/setting_page.dart +++ b/lib/setting/setting_page.dart @@ -146,8 +146,7 @@ class _SettingPage extends State { : S.of(context).fantizhongwen), ), GestureDetector( - child: - settingItem(S.of(context).quanxian, S.of(context).weikaiqi), + child: settingSingleItem(S.of(context).quanxian), onTap: () { Navigator.of(context).pushNamed('/router/permission_setting'); }, @@ -346,101 +345,4 @@ class _SettingPage extends State { ); } - List title = [ - S.current.dingwei, - S.current.tongzhi, - S.current.xiangji, - "Face ID", - ]; - List icons = [ - "assets/image/icon_permission_location.png", - "assets/image/icon_permission_notices.png", - "assets/image/icon_permission_camera.png", - "assets/image/icon_permission_face_id.png", - ]; - List contents = [ - S.current.weizhitishixinxi, - S.current.tongzhitishixinxi, - S.current.xiangjitishixinxi, - S.current.faceidtishixinxi, - ]; - - Widget buildPermissionItem(title, icon, content) { - return Container( - margin: EdgeInsets.fromLTRB(16, 8, 16, 8), - padding: EdgeInsets.fromLTRB(20, 16, 20, 16), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(8)), - boxShadow: [ - BoxShadow( - color: Colors.black.withAlpha(12), - offset: Offset(0, 3), - blurRadius: 14, - spreadRadius: 0) - ]), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded( - child: Column( - children: [ - Row( - children: [ - Text( - title, - style: TextStyle( - color: Colors.black, - fontSize: 16, - fontWeight: FontWeight.bold), - ), - SizedBox( - width: 8, - ), - Image.asset( - icon, - width: 22, - height: 22, - ) - ], - ), - SizedBox( - height: 8, - ), - Text( - content, - overflow: TextOverflow.ellipsis, - maxLines: 2, - style: TextStyle( - color: Color(0xFF353535), - fontSize: 12, - ), - ), - ], - ), - ), - SizedBox( - width: 32, - ), - Row( - children: [ - Text( - S.of(context).weikaiqi, - style: TextStyle( - color: Color(0xFF32A060), - fontSize: 12, - ), - ), - Icon( - Icons.keyboard_arrow_right, - size: 16, - color: Color(0xFF32A060), - ) - ], - ), - ], - ), - ); - } } diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index 2f6dccf5..4d3958ba 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -956,7 +956,7 @@ class _UnionDetailsPage extends State { "tenantCode": storeInfo.tenantCode, if (latitude != null && longitude != null) "position": "$latitude,$longitude", - "baseURL": "https://pos-test.api.lotus-wallet.com/app/", + "baseURL": "http://192.168.10.236:8765/app/", "uid": userId, "userInfo": { "nickname": nickname, diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index c30a762b..322bdebc 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -70,9 +70,12 @@ class _UnionPage extends State WidgetsBinding.instance.removeObserver(this); aMapFlutterLocation.stopLocation(); aMapFlutterLocation.destroy(); + + refreshController.dispose(); + } - bool iskeyboardShow = false; + bool isKeyBoardShow = false; @override void didChangeMetrics() { @@ -81,13 +84,13 @@ class _UnionPage extends State setState(() { print("object: ${MediaQuery.of(context).viewInsets.bottom}"); if (MediaQuery.of(context).viewInsets.bottom == 0) { - if (iskeyboardShow) { - iskeyboardShow = false; + if (isKeyBoardShow) { + isKeyBoardShow = false; //关闭键盘 软键盘关闭了, 清除输入控件的焦点, 否则重新进入页面会导致软键盘再弹出问题 FocusScope.of(context).requestFocus(FocusNode()); } } else { - iskeyboardShow = true; + isKeyBoardShow = true; } }); }); @@ -231,7 +234,8 @@ class _UnionPage extends State .toList(); buildMarker(); refreshController.refreshCompleted(); - setState(() {}); + if(mounted) + setState(() {}); } else { refreshController.refreshFailed(); } @@ -261,7 +265,8 @@ class _UnionPage extends State icon: bitmapDescriptor, infoWindowEnable: true, ))); - setState(() {}); + if(mounted) + setState(() {}); } List markers = []; @@ -354,7 +359,7 @@ class _UnionPage extends State MediaQuery.of(context).padding.top, child: SmartRefresher( controller: refreshController, - enablePullUp: true, + enablePullUp: false, enablePullDown: true, physics: BouncingScrollPhysics(), header: MyHeader(), diff --git a/lib/view_widget/item_input_widget.dart b/lib/view_widget/item_input_widget.dart index c01114c1..17ae803d 100644 --- a/lib/view_widget/item_input_widget.dart +++ b/lib/view_widget/item_input_widget.dart @@ -30,6 +30,7 @@ class ItemInputWidget extends StatelessWidget { final double radius; final EdgeInsets padding; final TextInputType textInputType; + final TextInputFormatter textInputFormatter; ItemInputWidget( this.title, { @@ -51,6 +52,7 @@ class ItemInputWidget extends StatelessWidget { const EdgeInsets.only(left: 20, right: 21, top: 16, bottom: 4), this.btnText, this.inputType = 0, + this.textInputFormatter, this.isShowBtn = false, }); @@ -140,9 +142,10 @@ class ItemInputWidget extends StatelessWidget { enabledBorder: inputBorder, hintText: hintText, contentPadding: EdgeInsets.only( - top: 12, - bottom: 12, - left: inputType == 1 ? 22 : 0), + top: 12, + bottom: 12, + left: inputType == 1 ? 22 : 0, + ), hintStyle: TextStyle( fontSize: 10, color: Color(0xFFA29E9E), @@ -150,10 +153,12 @@ class ItemInputWidget extends StatelessWidget { ), textInputAction: TextInputAction.next, inputFormatters: [ - LengthLimitingTextInputFormatter(inputLimit) + LengthLimitingTextInputFormatter(inputLimit), + textInputFormatter ], cursorColor: Colors.grey, maxLines: 1, + minLines: 1, ), ), ], diff --git a/pubspec.lock b/pubspec.lock index 686d4ff2..12200878 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,294 +5,294 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "14.0.0" amap_flutter_base: dependency: transitive description: name: amap_flutter_base - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" amap_flutter_location: dependency: "direct main" description: name: amap_flutter_location - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" amap_flutter_map: dependency: "direct main" description: name: amap_flutter_map - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.41.2" android_intent_plus: dependency: "direct main" description: name: android_intent_plus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" args: dependency: transitive description: name: args - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.2.0" async: dependency: transitive description: name: async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.5.0" + version: "2.6.1" barcode: dependency: transitive description: name: barcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" barcode_widget: dependency: "direct main" description: name: barcode_widget - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" bubble_tab_indicator: dependency: "direct main" description: name: bubble_tab_indicator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.6" build: dependency: transitive description: name: build - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.6.2" build_config: dependency: transitive description: name: build_config - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.6" build_daemon: dependency: transitive description: name: build_daemon - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.10" build_resolvers: dependency: transitive description: name: build_resolvers - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.5.3" build_runner: dependency: "direct dev" description: name: build_runner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.11.5" build_runner_core: dependency: transitive description: name: build_runner_core - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.1.10" built_collection: dependency: transitive description: name: built_collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.3.2" built_value: dependency: transitive description: name: built_value - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "7.1.0" cached_network_image: dependency: "direct main" description: name: cached_network_image - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" characters: dependency: transitive description: name: characters - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.4" chewie: dependency: "direct main" description: name: chewie - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.12.2" chewie_audio: dependency: transitive description: name: chewie_audio - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.2" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.3.3" clock: dependency: transitive description: name: clock - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" code_builder: dependency: transitive description: name: code_builder - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.7.0" collection: dependency: transitive description: name: collection - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.15.0" convert: dependency: transitive description: name: convert - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.5" css_colors: dependency: transitive description: name: css_colors - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.1" csslib: dependency: transitive description: name: csslib - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.16.2" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.12" dio: dependency: "direct main" description: name: dio - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.10" event_bus: dependency: "direct main" description: name: event_bus - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.2" file: dependency: transitive description: name: file - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "6.1.2" fixnum: dependency: transitive description: name: fixnum - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.10.11" flutter: @@ -304,21 +304,21 @@ packages: dependency: transitive description: name: flutter_cache_manager - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.3" flutter_html: dependency: "direct main" description: name: flutter_html - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" flutter_layout_grid: dependency: transitive description: name: flutter_layout_grid - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.10.5" flutter_localizations: @@ -330,49 +330,49 @@ packages: dependency: transitive description: name: flutter_page_indicator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.0.3" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.11" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.0.0+2" flutter_smart_dialog: dependency: "direct main" description: name: flutter_smart_dialog - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.6" flutter_staggered_grid_view: dependency: "direct main" description: name: flutter_staggered_grid_view - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.4.0" flutter_svg: dependency: transitive description: name: flutter_svg - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.20.0-nullsafety.3" flutter_swiper: dependency: "direct main" description: name: flutter_swiper - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.6" flutter_test: @@ -385,396 +385,410 @@ packages: description: flutter source: sdk version: "0.0.0" + fluwx: + dependency: "direct main" + description: + name: fluwx + url: "https://pub.dartlang.org" + source: hosted + version: "3.5.0" glob: dependency: transitive description: name: glob - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" graphs: dependency: transitive description: name: graphs - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.0" html: dependency: transitive description: name: html - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.14.0+4" http: dependency: transitive description: name: http - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.12.2" http_multi_server: dependency: transitive description: name: http_multi_server - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.4" image_cropper: dependency: "direct main" description: name: image_cropper - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.4.1" image_picker: dependency: transitive description: name: image_picker - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.7+22" image_picker_gallery_camera: dependency: "direct main" description: name: image_picker_gallery_camera - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.6" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.6" import_js_library: dependency: transitive description: name: import_js_library - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.2" intl: dependency: "direct main" description: name: intl - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.17.0" io: dependency: transitive description: name: io - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.3.5" js: dependency: transitive description: name: js - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.3" json_annotation: dependency: "direct main" description: name: json_annotation - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.1" json_serializable: dependency: "direct dev" description: name: json_serializable - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.5.1" + keframe: + dependency: "direct main" + description: + name: keframe + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" logger: dependency: "direct main" description: name: logger - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" logging: dependency: transitive description: name: logging - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.12.10" meta: dependency: transitive description: name: meta - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" mime: dependency: transitive description: name: mime - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" package_config: dependency: transitive description: name: package_config - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.9.3" package_info: dependency: "direct main" description: name: package_info - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" path: dependency: transitive description: name: path - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.5.1" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.1" path_provider: dependency: "direct main" description: name: path_provider - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" path_provider_linux: dependency: transitive description: name: path_provider_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" path_provider_windows: dependency: transitive description: name: path_provider_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.1" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.11.1" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.1.0+2" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.2" petitparser: dependency: transitive description: name: petitparser - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.1.0" photo_view: dependency: "direct main" description: name: photo_view - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.11.1" platform: dependency: transitive description: name: platform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.0.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" pool: dependency: transitive description: name: pool - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.5.0" process: dependency: transitive description: name: process - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "4.2.1" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.8" pull_to_refresh: dependency: "direct main" description: name: pull_to_refresh - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" qr: dependency: transitive description: name: qr - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" quiver: dependency: transitive description: name: quiver - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.5" retrofit: dependency: "direct main" description: name: retrofit - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.4+1" retrofit_generator: dependency: "direct dev" description: name: retrofit_generator - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.4.1+3" rxdart: dependency: "direct main" description: name: rxdart - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.26.0" share: dependency: "direct main" description: name: share - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.6.4+5" shared_preferences: dependency: "direct main" description: name: shared_preferences - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.6" shared_preferences_linux: dependency: transitive description: name: shared_preferences_linux - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shared_preferences_macos: dependency: transitive description: name: shared_preferences_macos - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shared_preferences_platform_interface: dependency: transitive description: name: shared_preferences_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shared_preferences_web: dependency: transitive description: name: shared_preferences_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shared_preferences_windows: dependency: transitive description: name: shared_preferences_windows - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.0.0" shelf: dependency: transitive description: name: shelf - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.7.9" shelf_web_socket: dependency: transitive description: name: shelf_web_socket - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.4+1" sky_engine: @@ -786,212 +800,212 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.9.10+3" source_span: dependency: transitive description: name: source_span - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.8.1" sqflite: dependency: transitive description: name: sqflite - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.2+4" sqflite_common: dependency: transitive description: name: sqflite_common - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3+3" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.10.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.1.0" synchronized: dependency: transitive description: name: synchronized - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0+2" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "0.2.19" + version: "0.3.0" timing: dependency: transitive description: name: timing - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.1+3" transformer_page_view: dependency: transitive description: name: transformer_page_view - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.6" tuple: dependency: transitive description: name: tuple - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.3" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.3.0" uuid: dependency: transitive description: name: uuid - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.2" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.1.0" video_player: dependency: "direct main" description: name: video_player - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.1" video_player_platform_interface: dependency: transitive description: name: video_player_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "2.2.0" video_player_web: dependency: transitive description: name: video_player_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.4+1" wakelock: dependency: transitive description: name: wakelock - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.1+1" wakelock_platform_interface: dependency: transitive description: name: wakelock_platform_interface - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.0+1" wakelock_web: dependency: transitive description: name: wakelock_web - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.1.0+3" watcher: dependency: transitive description: name: watcher - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.0" web_socket_channel: dependency: transitive description: name: web_socket_channel - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.2.0" webview_flutter: dependency: transitive description: name: webview_flutter - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "1.0.7" win32: dependency: transitive description: name: win32 - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.2.5" xdg_directories: dependency: transitive description: name: xdg_directories - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "0.2.0" xml: dependency: transitive description: name: xml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "5.1.2" yaml: dependency: transitive description: name: yaml - url: "https://pub.flutter-io.cn" + url: "https://pub.dartlang.org" source: hosted version: "3.1.0" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.13.0 <3.0.0" flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 3a26bd7a..7b796edd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,7 +26,9 @@ dependencies: sdk: flutter flutter_localizations: sdk: flutter -# fluwx: ^3.5.0 + fluwx: ^3.5.0 + + keframe: ^2.0.2 #滑动组件卡顿优化 barcode_widget: ^2.0.1 cupertino_icons: ^1.0.2