Browse Source

充值, 權限。。

null_safety
fmk 4 years ago
parent
commit
b6a321e1ca
  1. 2
      android/app/build.gradle
  2. BIN
      android/app/libs/wechat-sdk-android-without-mta-6.6.5.aar
  3. 9
      android/app/src/main/AndroidManifest.xml
  4. 2
      android/app/src/main/assets/data/dcloud_control.xml
  5. 63
      android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt
  6. 2
      android/build.gradle
  7. BIN
      assets/image/2x/icon_permission_storage.png
  8. BIN
      assets/image/3x/icon_permission_storage.png
  9. BIN
      assets/image/icon_permission_storage.png
  10. 10
      ios/Podfile.lock
  11. 4
      ios/Runner/Info.plist
  12. 6
      lib/generated/intl/messages_en.dart
  13. 6
      lib/generated/intl/messages_zh_CN.dart
  14. 6
      lib/generated/intl/messages_zh_TW.dart
  15. 32
      lib/generated/l10n.dart
  16. 33
      lib/home/activity_list_page.dart
  17. 4
      lib/home/home_page.dart
  18. 5
      lib/l10n/intl_en.arb
  19. 5
      lib/l10n/intl_zh_CN.arb
  20. 5
      lib/l10n/intl_zh_TW.arb
  21. 89
      lib/mine/mine_wallet_page.dart
  22. 159
      lib/mine/recharge_page.dart
  23. 5
      lib/retrofit/data/banner.dart
  24. 65
      lib/retrofit/data/wx_pay.dart
  25. 13
      lib/retrofit/retrofit_api.dart
  26. 4
      lib/retrofit/retrofit_api.g.dart
  27. 177
      lib/setting/permission_setting_page.dart
  28. 100
      lib/setting/setting_page.dart
  29. 2
      lib/union/union_details_page.dart
  30. 15
      lib/union/union_page.dart
  31. 9
      lib/view_widget/item_input_widget.dart
  32. 300
      pubspec.lock
  33. 4
      pubspec.yaml

2
android/app/build.gradle

@ -98,6 +98,8 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 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 fileTree(include: ['*.aar'], dir: 'libs')
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.appcompat:appcompat:1.2.0'

BIN
android/app/libs/wechat-sdk-android-without-mta-6.6.5.aar

Binary file not shown.

9
android/app/src/main/AndroidManifest.xml

@ -60,12 +60,19 @@
</intent-filter> </intent-filter>
</activity> </activity>
<meta-data android:name="WX_APPID" android:value="wx3b269e795ed23e5f" /> <meta-data android:name="WX_APPID" android:value="wx3b269e795ed23e5f" />
<meta-data android:name="weChatAppId" android:value="wx3b269e795ed23e5f" />
<meta-data android:name="WX_SECRET" android:value="c7e6d17959743ca40602acb402292e2b"/> <meta-data android:name="WX_SECRET" android:value="c7e6d17959743ca40602acb402292e2b"/>
<activity <activity
android:name="com.zsw.huixiang.wxapi.WXPayEntryActivity" android:name="com.zsw.huixiang.wxapi.WXPayEntryActivity"
android:exported="true" android:exported="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar" android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:launchMode="singleTop" /> android:launchMode="singleTop" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="sdksample" />
</intent-filter>
</activity>
<activity <activity
android:name="com.yalantis.ucrop.UCropActivity" android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"

2
android/app/src/main/assets/data/dcloud_control.xml

@ -1,4 +1,4 @@
<hbuilder version="1.9.9.80110" debug="false" syncDebug ="true"> <hbuilder version="1.9.9.80110" debug="false" syncDebug ="false">
<apps> <apps>
<app appid="__UNI__ACD00DA" appver="1.0"/> <app appid="__UNI__ACD00DA" appver="1.0"/>
<app appid="__UNI__E60E056" appver="1.0"/> <app appid="__UNI__E60E056" appver="1.0"/>

63
android/app/src/main/kotlin/com/zsw/huixiang/wxapi/WXPayEntryActivity.kt

@ -1,7 +1,12 @@
package com.zsw.huixiang.wxapi package com.zsw.huixiang.wxapi
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Bundle import android.os.Bundle
import android.util.Log 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.BaseReq
import com.tencent.mm.opensdk.modelbase.BaseResp import com.tencent.mm.opensdk.modelbase.BaseResp
import io.dcloud.feature.payment.weixin.AbsWXPayCallbackActivity import io.dcloud.feature.payment.weixin.AbsWXPayCallbackActivity
@ -9,21 +14,73 @@ import io.dcloud.feature.payment.weixin.AbsWXPayCallbackActivity
class WXPayEntryActivity : AbsWXPayCallbackActivity() { class WXPayEntryActivity : AbsWXPayCallbackActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) 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") 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) super.onReq(req)
FluwxRequestHandler.onReq(req, this)
Log.e("WXPayEntryActivity", "req: $req") Log.e("WXPayEntryActivity", "req: $req")
} }
override fun onResp(resp: BaseResp?) { override fun onResp(resp: BaseResp) {
FluwxResponseHandler.handleResponse(resp)
super.onResp(resp) super.onResp(resp)
Log.e("WXPayEntryActivity", "resp: $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"
} }

2
android/build.gradle

@ -1,5 +1,5 @@
buildscript { buildscript {
ext.kotlin_version = '1.3.50' ext.kotlin_version = '1.4.10'
repositories { repositories {
maven { maven {
url 'https://maven.aliyun.com/repository/google' url 'https://maven.aliyun.com/repository/google'

BIN
assets/image/2x/icon_permission_storage.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

BIN
assets/image/3x/icon_permission_storage.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
assets/image/icon_permission_storage.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

10
ios/Podfile.lock

@ -11,6 +11,9 @@ PODS:
- AMapLocation (2.6.8): - AMapLocation (2.6.8):
- AMapFoundation (~> 1.6.4) - AMapFoundation (~> 1.6.4)
- Flutter (1.0.0) - Flutter (1.0.0)
- fluwx (0.0.1):
- Flutter
- WechatOpenSDK (= 1.8.7.1)
- FMDB (2.7.5): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5) - FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
@ -39,11 +42,13 @@ PODS:
- Flutter - Flutter
- webview_flutter (0.0.1): - webview_flutter (0.0.1):
- Flutter - Flutter
- WechatOpenSDK (1.8.7.1)
DEPENDENCIES: DEPENDENCIES:
- amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`) - amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`)
- amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`) - amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`)
- Flutter (from `Flutter`) - Flutter (from `Flutter`)
- fluwx (from `.symlinks/plugins/fluwx/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`) - image_picker (from `.symlinks/plugins/image_picker/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`) - package_info (from `.symlinks/plugins/package_info/ios`)
@ -63,6 +68,7 @@ SPEC REPOS:
- AMapLocation - AMapLocation
- FMDB - FMDB
- TOCropViewController - TOCropViewController
- WechatOpenSDK
EXTERNAL SOURCES: EXTERNAL SOURCES:
amap_flutter_location: amap_flutter_location:
@ -71,6 +77,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/amap_flutter_map/ios" :path: ".symlinks/plugins/amap_flutter_map/ios"
Flutter: Flutter:
:path: Flutter :path: Flutter
fluwx:
:path: ".symlinks/plugins/fluwx/ios"
image_cropper: image_cropper:
:path: ".symlinks/plugins/image_cropper/ios" :path: ".symlinks/plugins/image_cropper/ios"
image_picker: image_picker:
@ -101,6 +109,7 @@ SPEC CHECKSUMS:
AMapFoundation: c7da72b42a713f1429c88af1858d623dde88934b AMapFoundation: c7da72b42a713f1429c88af1858d623dde88934b
AMapLocation: dad27669c4ca68e395ce7532ff614b7d4d45f7b7 AMapLocation: dad27669c4ca68e395ce7532ff614b7d4d45f7b7
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
fluwx: 07a55ed66bf3a4961e836a2a411b02dcada32902
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb image_cropper: f1668dd8d2cad2d357955caad15a40547856edcb
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09 image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
@ -114,6 +123,7 @@ SPEC CHECKSUMS:
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
wakelock: bfc7955c418d0db797614075aabbc58a39ab5107 wakelock: bfc7955c418d0db797614075aabbc58a39ab5107
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
WechatOpenSDK: 6a4d1436c15b3b5fe2a0bd383f3046010186da44
PODFILE CHECKSUM: 3dec887221b0cf3fccf2bbd3f50f36c0ad0bcbeb PODFILE CHECKSUM: 3dec887221b0cf3fccf2bbd3f50f36c0ad0bcbeb

4
ios/Runner/Info.plist

@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleURLSchemes</key>
<array>
<string>wx3b269e795ed23e5f</string>
</array>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>

6
lib/generated/intl/messages_en.dart

@ -104,6 +104,8 @@ class MessageLookup extends MessageLookupByLibrary {
"chuangjianshijian" : m2, "chuangjianshijian" : m2,
"chuangshirendegushi" : MessageLookupByLibrary.simpleMessage("创始人的故事"), "chuangshirendegushi" : MessageLookupByLibrary.simpleMessage("创始人的故事"),
"code_error" : MessageLookupByLibrary.simpleMessage("验证码输入错误"), "code_error" : MessageLookupByLibrary.simpleMessage("验证码输入错误"),
"cunchu" : MessageLookupByLibrary.simpleMessage("存储"),
"cunchutishixinxi" : MessageLookupByLibrary.simpleMessage("为了获得照片使用、缓存等功能,推荐您在使用期间打开存储权限"),
"daifukuan" : MessageLookupByLibrary.simpleMessage("待付款"), "daifukuan" : MessageLookupByLibrary.simpleMessage("待付款"),
"daipeisong" : MessageLookupByLibrary.simpleMessage("待配送"), "daipeisong" : MessageLookupByLibrary.simpleMessage("待配送"),
"daiqucan" : MessageLookupByLibrary.simpleMessage("待取餐"), "daiqucan" : MessageLookupByLibrary.simpleMessage("待取餐"),
@ -139,7 +141,6 @@ class MessageLookup extends MessageLookupByLibrary {
"duihuanlishi" : MessageLookupByLibrary.simpleMessage("兑换历史"), "duihuanlishi" : MessageLookupByLibrary.simpleMessage("兑换历史"),
"duihuanshangpinxiangqing" : MessageLookupByLibrary.simpleMessage("兑换商品详情"), "duihuanshangpinxiangqing" : MessageLookupByLibrary.simpleMessage("兑换商品详情"),
"duihuanxinxi" : MessageLookupByLibrary.simpleMessage("兑换信息"), "duihuanxinxi" : MessageLookupByLibrary.simpleMessage("兑换信息"),
"faceidtishixinxi" : MessageLookupByLibrary.simpleMessage("为了更好的保护账户安全支付更便捷,推荐您在使用期间让我们使用Face ID"),
"fanhuiduihuanlishi" : MessageLookupByLibrary.simpleMessage("返回兑换历史"), "fanhuiduihuanlishi" : MessageLookupByLibrary.simpleMessage("返回兑换历史"),
"fankui" : MessageLookupByLibrary.simpleMessage("反馈"), "fankui" : MessageLookupByLibrary.simpleMessage("反馈"),
"fantizhongwen" : MessageLookupByLibrary.simpleMessage("繁体中文"), "fantizhongwen" : MessageLookupByLibrary.simpleMessage("繁体中文"),
@ -267,7 +268,7 @@ class MessageLookup extends MessageLookupByLibrary {
"qianwanghuixiangmendianduihuanhexiao" : MessageLookupByLibrary.simpleMessage("前往一心回乡旗下任意门店对工作人员出示商品兑换码,核实无误后,可领取对应商品"), "qianwanghuixiangmendianduihuanhexiao" : MessageLookupByLibrary.simpleMessage("前往一心回乡旗下任意门店对工作人员出示商品兑换码,核实无误后,可领取对应商品"),
"qinglihuancun" : MessageLookupByLibrary.simpleMessage("清理缓存"), "qinglihuancun" : MessageLookupByLibrary.simpleMessage("清理缓存"),
"qingshurubeizhuyaoqiu" : MessageLookupByLibrary.simpleMessage("请输入备注要求"), "qingshurubeizhuyaoqiu" : MessageLookupByLibrary.simpleMessage("请输入备注要求"),
"qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("输入充值金额(元)"), "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("输入充值金额"),
"qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("请输入手机号"), "qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("请输入手机号"),
"qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("请输入验证码"),
"qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("请输入支付密码"), "qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("请输入支付密码"),
@ -405,6 +406,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yishiming" : MessageLookupByLibrary.simpleMessage("已实名"), "yishiming" : MessageLookupByLibrary.simpleMessage("已实名"),
"yishixiao" : MessageLookupByLibrary.simpleMessage("已失效"), "yishixiao" : MessageLookupByLibrary.simpleMessage("已失效"),
"yishiyong" : MessageLookupByLibrary.simpleMessage("已使用"), "yishiyong" : MessageLookupByLibrary.simpleMessage("已使用"),
"yishouquan" : MessageLookupByLibrary.simpleMessage("已授权"),
"yisongda" : MessageLookupByLibrary.simpleMessage("已送达"), "yisongda" : MessageLookupByLibrary.simpleMessage("已送达"),
"yituikuan" : MessageLookupByLibrary.simpleMessage("已退款"), "yituikuan" : MessageLookupByLibrary.simpleMessage("已退款"),
"yiwancheng" : MessageLookupByLibrary.simpleMessage(" 已完成 "), "yiwancheng" : MessageLookupByLibrary.simpleMessage(" 已完成 "),

6
lib/generated/intl/messages_zh_CN.dart

@ -104,6 +104,8 @@ class MessageLookup extends MessageLookupByLibrary {
"chuangjianshijian" : m2, "chuangjianshijian" : m2,
"chuangshirendegushi" : MessageLookupByLibrary.simpleMessage("创始人的故事"), "chuangshirendegushi" : MessageLookupByLibrary.simpleMessage("创始人的故事"),
"code_error" : MessageLookupByLibrary.simpleMessage("验证码输入错误"), "code_error" : MessageLookupByLibrary.simpleMessage("验证码输入错误"),
"cunchu" : MessageLookupByLibrary.simpleMessage("存储"),
"cunchutishixinxi" : MessageLookupByLibrary.simpleMessage("为了获得照片使用、缓存等功能,推荐您在使用期间打开存储权限"),
"daifukuan" : MessageLookupByLibrary.simpleMessage("待付款"), "daifukuan" : MessageLookupByLibrary.simpleMessage("待付款"),
"daipeisong" : MessageLookupByLibrary.simpleMessage("待配送"), "daipeisong" : MessageLookupByLibrary.simpleMessage("待配送"),
"daiqucan" : MessageLookupByLibrary.simpleMessage("待取餐"), "daiqucan" : MessageLookupByLibrary.simpleMessage("待取餐"),
@ -139,7 +141,6 @@ class MessageLookup extends MessageLookupByLibrary {
"duihuanlishi" : MessageLookupByLibrary.simpleMessage("兑换历史"), "duihuanlishi" : MessageLookupByLibrary.simpleMessage("兑换历史"),
"duihuanshangpinxiangqing" : MessageLookupByLibrary.simpleMessage("兑换商品详情"), "duihuanshangpinxiangqing" : MessageLookupByLibrary.simpleMessage("兑换商品详情"),
"duihuanxinxi" : MessageLookupByLibrary.simpleMessage("兑换信息"), "duihuanxinxi" : MessageLookupByLibrary.simpleMessage("兑换信息"),
"faceidtishixinxi" : MessageLookupByLibrary.simpleMessage("为了更好的保护账户安全支付更便捷,推荐您在使用期间让我们使用Face ID"),
"fanhuiduihuanlishi" : MessageLookupByLibrary.simpleMessage("返回兑换历史"), "fanhuiduihuanlishi" : MessageLookupByLibrary.simpleMessage("返回兑换历史"),
"fankui" : MessageLookupByLibrary.simpleMessage("反馈"), "fankui" : MessageLookupByLibrary.simpleMessage("反馈"),
"fantizhongwen" : MessageLookupByLibrary.simpleMessage("繁体中文"), "fantizhongwen" : MessageLookupByLibrary.simpleMessage("繁体中文"),
@ -266,7 +267,7 @@ class MessageLookup extends MessageLookupByLibrary {
"qianwanghuixiangmendianduihuanhexiao" : MessageLookupByLibrary.simpleMessage("前往一心回乡旗下任意门店对工作人员出示商品兑换码,核实无误后,可领取对应商品"), "qianwanghuixiangmendianduihuanhexiao" : MessageLookupByLibrary.simpleMessage("前往一心回乡旗下任意门店对工作人员出示商品兑换码,核实无误后,可领取对应商品"),
"qinglihuancun" : MessageLookupByLibrary.simpleMessage("清理缓存"), "qinglihuancun" : MessageLookupByLibrary.simpleMessage("清理缓存"),
"qingshurubeizhuyaoqiu" : MessageLookupByLibrary.simpleMessage("请输入备注要求"), "qingshurubeizhuyaoqiu" : MessageLookupByLibrary.simpleMessage("请输入备注要求"),
"qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("输入充值金额(元)"), "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("输入充值金额"),
"qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("请输入手机号"), "qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("请输入手机号"),
"qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("请输入验证码"), "qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("请输入验证码"),
"qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("请输入支付密码"), "qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("请输入支付密码"),
@ -404,6 +405,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yishiming" : MessageLookupByLibrary.simpleMessage("已实名"), "yishiming" : MessageLookupByLibrary.simpleMessage("已实名"),
"yishixiao" : MessageLookupByLibrary.simpleMessage("已失效"), "yishixiao" : MessageLookupByLibrary.simpleMessage("已失效"),
"yishiyong" : MessageLookupByLibrary.simpleMessage("已使用"), "yishiyong" : MessageLookupByLibrary.simpleMessage("已使用"),
"yishouquan" : MessageLookupByLibrary.simpleMessage("已授权"),
"yisongda" : MessageLookupByLibrary.simpleMessage("已送达"), "yisongda" : MessageLookupByLibrary.simpleMessage("已送达"),
"yituikuan" : MessageLookupByLibrary.simpleMessage("已退款"), "yituikuan" : MessageLookupByLibrary.simpleMessage("已退款"),
"yiwancheng" : MessageLookupByLibrary.simpleMessage(" 已完成 "), "yiwancheng" : MessageLookupByLibrary.simpleMessage(" 已完成 "),

6
lib/generated/intl/messages_zh_TW.dart

@ -104,6 +104,8 @@ class MessageLookup extends MessageLookupByLibrary {
"chuangjianshijian" : m2, "chuangjianshijian" : m2,
"chuangshirendegushi" : MessageLookupByLibrary.simpleMessage("創始人的故事"), "chuangshirendegushi" : MessageLookupByLibrary.simpleMessage("創始人的故事"),
"code_error" : MessageLookupByLibrary.simpleMessage("驗證碼輸入錯誤"), "code_error" : MessageLookupByLibrary.simpleMessage("驗證碼輸入錯誤"),
"cunchu" : MessageLookupByLibrary.simpleMessage("存儲"),
"cunchutishixinxi" : MessageLookupByLibrary.simpleMessage("為了獲得照片使用、緩存等功能,推薦您使用期間打開存儲權限"),
"daifukuan" : MessageLookupByLibrary.simpleMessage("待付款"), "daifukuan" : MessageLookupByLibrary.simpleMessage("待付款"),
"daipeisong" : MessageLookupByLibrary.simpleMessage("待配送"), "daipeisong" : MessageLookupByLibrary.simpleMessage("待配送"),
"daiqucan" : MessageLookupByLibrary.simpleMessage("待取餐"), "daiqucan" : MessageLookupByLibrary.simpleMessage("待取餐"),
@ -139,7 +141,6 @@ class MessageLookup extends MessageLookupByLibrary {
"duihuanlishi" : MessageLookupByLibrary.simpleMessage("兌換歷史"), "duihuanlishi" : MessageLookupByLibrary.simpleMessage("兌換歷史"),
"duihuanshangpinxiangqing" : MessageLookupByLibrary.simpleMessage("兑换商品详情"), "duihuanshangpinxiangqing" : MessageLookupByLibrary.simpleMessage("兑换商品详情"),
"duihuanxinxi" : MessageLookupByLibrary.simpleMessage("兑换信息"), "duihuanxinxi" : MessageLookupByLibrary.simpleMessage("兑换信息"),
"faceidtishixinxi" : MessageLookupByLibrary.simpleMessage("為了更好的保護帳戶安全支付更便捷,推薦您在使用期間讓我們使用Face ID "),
"fanhuiduihuanlishi" : MessageLookupByLibrary.simpleMessage("返回兌換歷史"), "fanhuiduihuanlishi" : MessageLookupByLibrary.simpleMessage("返回兌換歷史"),
"fankui" : MessageLookupByLibrary.simpleMessage("反饋"), "fankui" : MessageLookupByLibrary.simpleMessage("反饋"),
"fantizhongwen" : MessageLookupByLibrary.simpleMessage("繁体中文"), "fantizhongwen" : MessageLookupByLibrary.simpleMessage("繁体中文"),
@ -266,7 +267,7 @@ class MessageLookup extends MessageLookupByLibrary {
"qianwanghuixiangmendianduihuanhexiao" : MessageLookupByLibrary.simpleMessage("前往一心回乡旗下任意门店对工作人员出示商品兑换码,核实无误后,可领取对应商品"), "qianwanghuixiangmendianduihuanhexiao" : MessageLookupByLibrary.simpleMessage("前往一心回乡旗下任意门店对工作人员出示商品兑换码,核实无误后,可领取对应商品"),
"qinglihuancun" : MessageLookupByLibrary.simpleMessage("清理緩存"), "qinglihuancun" : MessageLookupByLibrary.simpleMessage("清理緩存"),
"qingshurubeizhuyaoqiu" : MessageLookupByLibrary.simpleMessage("請輸入備注要求"), "qingshurubeizhuyaoqiu" : MessageLookupByLibrary.simpleMessage("請輸入備注要求"),
"qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("輸入充值金額(元)"), "qingshuruchongzhijine" : MessageLookupByLibrary.simpleMessage("輸入充值金額"),
"qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("請輸入手機號碼"), "qingshurushoujihao" : MessageLookupByLibrary.simpleMessage("請輸入手機號碼"),
"qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"), "qingshuruyanzhengma" : MessageLookupByLibrary.simpleMessage("請輸入驗證碼"),
"qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("請輸入支付密碼"), "qingshuruzhifumima" : MessageLookupByLibrary.simpleMessage("請輸入支付密碼"),
@ -404,6 +405,7 @@ class MessageLookup extends MessageLookupByLibrary {
"yishiming" : MessageLookupByLibrary.simpleMessage("已实名"), "yishiming" : MessageLookupByLibrary.simpleMessage("已实名"),
"yishixiao" : MessageLookupByLibrary.simpleMessage("已失效"), "yishixiao" : MessageLookupByLibrary.simpleMessage("已失效"),
"yishiyong" : MessageLookupByLibrary.simpleMessage("已使用"), "yishiyong" : MessageLookupByLibrary.simpleMessage("已使用"),
"yishouquan" : MessageLookupByLibrary.simpleMessage("已授權"),
"yisongda" : MessageLookupByLibrary.simpleMessage("已送達"), "yisongda" : MessageLookupByLibrary.simpleMessage("已送達"),
"yituikuan" : MessageLookupByLibrary.simpleMessage("已退款"), "yituikuan" : MessageLookupByLibrary.simpleMessage("已退款"),
"yiwancheng" : MessageLookupByLibrary.simpleMessage(" 已完成 "), "yiwancheng" : MessageLookupByLibrary.simpleMessage(" 已完成 "),

32
lib/generated/l10n.dart

@ -1165,11 +1165,21 @@ class S {
); );
} }
/// `便使使Face ID` /// `使使`
String get faceidtishixinxi { String get cunchutishixinxi {
return Intl.message( return Intl.message(
'为了更好的保护账户安全支付更便捷,推荐您在使用期间让我们使用Face ID', '为了获得照片使用、缓存等功能,推荐您在使用期间打开存储权限',
name: 'faceidtishixinxi', name: 'cunchutishixinxi',
desc: '',
args: [],
);
}
/// ``
String get cunchu {
return Intl.message(
'存储',
name: 'cunchu',
desc: '', desc: '',
args: [], args: [],
); );
@ -2195,10 +2205,10 @@ class S {
); );
} }
/// `()` /// ``
String get qingshuruchongzhijine { String get qingshuruchongzhijine {
return Intl.message( return Intl.message(
'输入充值金额(元)', '输入充值金额',
name: 'qingshuruchongzhijine', name: 'qingshuruchongzhijine',
desc: '', desc: '',
args: [], args: [],
@ -3705,6 +3715,16 @@ class S {
); );
} }
/// ``
String get yishouquan {
return Intl.message(
'已授权',
name: 'yishouquan',
desc: '',
args: [],
);
}
/// `使` /// `使`
String get privacy_policy4 { String get privacy_policy4 {
return Intl.message( return Intl.message(

33
lib/home/activity_list_page.dart

@ -1,7 +1,6 @@
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/main.dart'; import 'package:huixiang/main.dart';
import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/base_data.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/classic_header.dart';
import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/custom_image.dart';
import 'package:huixiang/view_widget/my_footer.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:pull_to_refresh/pull_to_refresh.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -30,7 +31,8 @@ class _ActivityListPage extends State<ActivityListPage>
void initState() { void initState() {
super.initState(); super.initState();
SharedPreferences.getInstance().then((value) => { SharedPreferences.getInstance().then((value) => {
apiService = ApiService(Dio(), context: context, token: value.getString('token')), apiService = ApiService(Dio(),
context: context, token: value.getString('token')),
queryActivity(), queryActivity(),
}); });
@ -74,6 +76,7 @@ class _ActivityListPage extends State<ActivityListPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return Container( return Container(
child: SizeCacheWidget(
child: SmartRefresher( child: SmartRefresher(
controller: _refreshController, controller: _refreshController,
enablePullDown: true, enablePullDown: true,
@ -88,6 +91,7 @@ class _ActivityListPage extends State<ActivityListPage>
onRefresh: queryActivity, onRefresh: queryActivity,
child: ListView.builder( child: ListView.builder(
itemCount: activityList == null ? 0 : activityList.length, itemCount: activityList == null ? 0 : activityList.length,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return InkWell( return InkWell(
onTap: () { onTap: () {
@ -100,11 +104,33 @@ class _ActivityListPage extends State<ActivityListPage>
"author": activityList[position].storeName "author": activityList[position].storeName
}); });
}, },
child: FrameSeparateWidget(
child: activityItem(activityList[position]), 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<ActivityListPage>
fadeSrc: "assets/image/default_2_1.png", fadeSrc: "assets/image/default_2_1.png",
), ),
Container( 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( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

4
lib/home/home_page.dart

@ -158,8 +158,9 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
header: MyHeader(), header: MyHeader(),
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
onRefresh: queryHome, onRefresh: queryHome,
child: ListView( child: SingleChildScrollView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
child: Column(
children: [ children: [
banner(), banner(),
ItemTitle( ItemTitle(
@ -220,6 +221,7 @@ class _HomePage extends State<HomePage> with AutomaticKeepAliveClientMixin {
], ],
), ),
), ),
),
); );
} }

5
lib/l10n/intl_en.arb

@ -112,7 +112,8 @@
"weizhitishixinxi": "为了向您推荐附近的门店信息,推荐您在使用HISAPP时让我们使用位置信息", "weizhitishixinxi": "为了向您推荐附近的门店信息,推荐您在使用HISAPP时让我们使用位置信息",
"tongzhitishixinxi": "为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收", "tongzhitishixinxi": "为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收",
"xiangjitishixinxi": "为了您可以在使用过程中进行分享,希望您使用HISAPP时让我们使用相机功能", "xiangjitishixinxi": "为了您可以在使用过程中进行分享,希望您使用HISAPP时让我们使用相机功能",
"faceidtishixinxi": "为了更好的保护账户安全支付更便捷,推荐您在使用期间让我们使用Face ID", "cunchutishixinxi": "为了获得照片使用、缓存等功能,推荐您在使用期间打开存储权限",
"cunchu": "存储",
"wodejifenzhi": "我的积分值", "wodejifenzhi": "我的积分值",
"mingxi": "明细", "mingxi": "明细",
"qiandaolingjifen": "签到领积分", "qiandaolingjifen": "签到领积分",
@ -383,6 +384,8 @@
"qudenglu": "去登录", "qudenglu": "去登录",
"weidenglu": "未登录", "weidenglu": "未登录",
"youkedenglu": "游客登录", "youkedenglu": "游客登录",
"yishouquan": "已授权",
"qingshuruchongzhijine": "请输入充值金额",

5
lib/l10n/intl_zh_CN.arb

@ -112,7 +112,8 @@
"weizhitishixinxi": "为了向您推荐附近的门店信息,推荐您在使用HISAPP时让我们使用位置信息", "weizhitishixinxi": "为了向您推荐附近的门店信息,推荐您在使用HISAPP时让我们使用位置信息",
"tongzhitishixinxi": "为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收", "tongzhitishixinxi": "为了您可以及时收到我们的活动信息,推荐您在使用HISAPP时打开通知的接收",
"xiangjitishixinxi": "为了您可以在使用过程中进行分享,希望您使用HISAPP时让我们使用相机功能", "xiangjitishixinxi": "为了您可以在使用过程中进行分享,希望您使用HISAPP时让我们使用相机功能",
"faceidtishixinxi": "为了更好的保护账户安全支付更便捷,推荐您在使用期间让我们使用Face ID", "cunchutishixinxi": "为了获得照片使用、缓存等功能,推荐您在使用期间打开存储权限",
"cunchu": "存储",
"wodejifenzhi": "我的积分值", "wodejifenzhi": "我的积分值",
"mingxi": "明细", "mingxi": "明细",
"qiandaolingjifen": "签到领积分", "qiandaolingjifen": "签到领积分",
@ -384,6 +385,8 @@
"qudenglu": "去登录", "qudenglu": "去登录",
"weidenglu": "未登录", "weidenglu": "未登录",
"youkedenglu": "游客登录", "youkedenglu": "游客登录",
"yishouquan": "已授权",
"qingshuruchongzhijine": "请输入充值金额",

5
lib/l10n/intl_zh_TW.arb

@ -115,7 +115,8 @@
"weizhitishixinxi": "為了向您推薦附近的門店資訊,推薦您在使用HISAPP時讓我們使用位置資訊", "weizhitishixinxi": "為了向您推薦附近的門店資訊,推薦您在使用HISAPP時讓我們使用位置資訊",
"tongzhitishixinxi": "為了您可以及時收到我們的活動資訊,推薦您在使用HISAPP時打開通知的接收 ", "tongzhitishixinxi": "為了您可以及時收到我們的活動資訊,推薦您在使用HISAPP時打開通知的接收 ",
"xiangjitishixinxi": "為了您可以在使用過程中進行分享,希望您使用HISAPP時讓我們使用相機功能 ", "xiangjitishixinxi": "為了您可以在使用過程中進行分享,希望您使用HISAPP時讓我們使用相機功能 ",
"faceidtishixinxi": "為了更好的保護帳戶安全支付更便捷,推薦您在使用期間讓我們使用Face ID ", "cunchutishixinxi": "為了獲得照片使用、緩存等功能,推薦您使用期間打開存儲權限",
"cunchu": "存儲",
"wodejifenzhi": "我的積分值", "wodejifenzhi": "我的積分值",
"wodehuiyuandengji": "我的會員等級", "wodehuiyuandengji": "我的會員等級",
"mingxi": "明細", "mingxi": "明細",
@ -376,6 +377,8 @@
"qudenglu": "去登錄", "qudenglu": "去登錄",
"weidenglu": "未登錄", "weidenglu": "未登錄",
"youkedenglu": "遊客登錄", "youkedenglu": "遊客登錄",
"yishouquan": "已授權",
"qingshuruchongzhijine": "請輸入充值金額",
"privacy_policy4": "并使用本機號碼登錄" "privacy_policy4": "并使用本機號碼登錄"

89
lib/mine/mine_wallet_page.dart

@ -42,7 +42,7 @@ class _MineWalletPage extends State<MineWalletPage> {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
userInfo = userInfo =
UserInfo.fromJson(jsonDecode(sharedPreferences.getString('user'))); UserInfo.fromJson(jsonDecode(sharedPreferences.getString('user')));
mBalance = double.tryParse(userInfo.money).toInt(); mBalance = double.tryParse(userInfo.money);
if (mounted) setState(() {}); if (mounted) setState(() {});
String token = sharedPreferences.getString("token"); String token = sharedPreferences.getString("token");
@ -59,9 +59,8 @@ class _MineWalletPage extends State<MineWalletPage> {
BaseData baseData = await apiService.queryInfo(); BaseData baseData = await apiService.queryInfo();
if (baseData != null && baseData.isSuccess) { if (baseData != null && baseData.isSuccess) {
userInfo = UserInfo.fromJson(baseData.data); userInfo = UserInfo.fromJson(baseData.data);
mBalance = double.tryParse(userInfo.money).toInt(); mBalance = double.tryParse(userInfo.money);
if (mounted) if (mounted) setState(() {});
setState(() {});
} }
} }
@ -211,11 +210,11 @@ class _MineWalletPage extends State<MineWalletPage> {
// ], // ],
// ), // ),
Container( Container(
margin: EdgeInsets.only(top: 14), margin: EdgeInsets.only(top: 14.h),
child: ListView.builder( child: ListView.builder(
itemCount: userBills != null ? userBills.length : 0, itemCount: userBills != null ? userBills.length : 0,
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.only(bottom: 20), padding: EdgeInsets.only(bottom: 20.h),
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, position) { itemBuilder: (context, position) {
return historyItem(userBills[position], position); return historyItem(userBills[position], position);
@ -228,23 +227,23 @@ class _MineWalletPage extends State<MineWalletPage> {
Widget historyItem(UserBill userBill, position) { Widget historyItem(UserBill userBill, position) {
return Container( return Container(
margin: EdgeInsets.only(top: 10, bottom: 10), margin: EdgeInsets.only(top: 10.h, bottom: 10.h),
child: Row( child: Row(
children: [ children: [
Image.asset( Image.asset(
userBill.pm == 0 userBill.pm == 0
? "assets/image/icon_wallet_withdrawal.png" ? "assets/image/icon_wallet_withdrawal.png"
: "assets/image/icon_wallet_recharge.png", : "assets/image/icon_wallet_recharge.png",
width: 34, width: 34.w,
height: 34, height: 34.h,
), ),
SizedBox( SizedBox(
width: 12, width: 12.w,
), ),
Expanded( Expanded(
flex: 1, flex: 1,
child: Container( child: Container(
height: 34, height: 34.h,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -253,7 +252,7 @@ class _MineWalletPage extends State<MineWalletPage> {
userBill.name, userBill.name,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 12, fontSize: 12.sp,
), ),
), ),
Text( Text(
@ -277,7 +276,8 @@ class _MineWalletPage extends State<MineWalletPage> {
? "-${userBill.number}" ? "-${userBill.number}"
: "+${userBill.number}", : "+${userBill.number}",
style: TextStyle( style: TextStyle(
color: Colors.black, color: Color(0xFF20662A),
fontWeight: FontWeight.bold,
fontSize: 12.sp, fontSize: 12.sp,
), ),
), ),
@ -299,8 +299,8 @@ class _MineWalletPage extends State<MineWalletPage> {
Widget balance() { Widget balance() {
return Container( return Container(
width: double.infinity, width: double.infinity,
margin: EdgeInsets.fromLTRB(16, 16, 16, 8), margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 8.h),
padding: EdgeInsets.fromLTRB(24, 24, 24, 24), padding: EdgeInsets.fromLTRB(24.w, 24.h, 24.w, 24.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8)), borderRadius: BorderRadius.all(Radius.circular(8)),
@ -309,8 +309,10 @@ class _MineWalletPage extends State<MineWalletPage> {
color: Colors.black.withAlpha(12), color: Colors.black.withAlpha(12),
offset: Offset(0, 3), offset: Offset(0, 3),
blurRadius: 14, blurRadius: 14,
spreadRadius: 0) spreadRadius: 0,
]), )
],
),
child: Column( child: Column(
children: [ children: [
Text( Text(
@ -318,24 +320,32 @@ class _MineWalletPage extends State<MineWalletPage> {
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Color(0xFF353535), color: Color(0xFF353535),
fontSize: 16), fontSize: 16.sp,
),
),
SizedBox(
height: 16.h,
), ),
Text( Text(
"$mBalance", "$mBalance",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.w500,
color: Color(0xFF353535), color: Color(0xFF353535),
fontSize: 60), fontSize: 50.sp,
),
),
SizedBox(
height: 4.h,
), ),
Text( Text(
S.of(context).keyongyue, S.of(context).keyongyue,
style: TextStyle( style: TextStyle(
color: Color(0xFF20662A), color: Color(0xFF20662A),
fontSize: 16, fontSize: 16.sp,
), ),
), ),
SizedBox( SizedBox(
height: 24, height: 24.h,
), ),
InkWell( InkWell(
onTap: () { onTap: () {
@ -350,8 +360,8 @@ class _MineWalletPage extends State<MineWalletPage> {
textColor: Colors.white, textColor: Colors.white,
radius: 15, radius: 15,
backgroup: Color(0xFF20662A), backgroup: Color(0xFF20662A),
fontSize: 12, fontSize: 12.sp,
padding: EdgeInsets.fromLTRB(12, 4, 12, 4), padding: EdgeInsets.fromLTRB(12.w, 4.h, 12.w, 4.h),
), ),
), ),
], ],
@ -368,17 +378,18 @@ class _MineWalletPage extends State<MineWalletPage> {
Navigator.of(context).pushNamed('/router/recharge_page'); Navigator.of(context).pushNamed('/router/recharge_page');
}, },
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(16, 16, 16, 16), margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
padding: EdgeInsets.fromLTRB(0, 7, 0, 7), padding: EdgeInsets.fromLTRB(0, 7.h, 0, 7.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8)), borderRadius: BorderRadius.circular(8),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(12), color: Colors.black.withAlpha(12),
offset: Offset(0, 3), offset: Offset(0, 3),
blurRadius: 14, blurRadius: 14,
spreadRadius: 0) spreadRadius: 0,
)
]), ]),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -386,15 +397,16 @@ class _MineWalletPage extends State<MineWalletPage> {
children: [ children: [
Image.asset( Image.asset(
"assets/image/icon_wallet_recharge.png", "assets/image/icon_wallet_recharge.png",
width: 40, width: 40.w,
height: 40, height: 40.h,
), ),
Text( Text(
S.of(context).chongzhi, S.of(context).chongzhi,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16.sp,
color: Colors.black), color: Colors.black,
),
) )
], ],
), ),
@ -404,8 +416,8 @@ class _MineWalletPage extends State<MineWalletPage> {
), ),
Expanded( Expanded(
child: Container( child: Container(
margin: EdgeInsets.fromLTRB(16, 16, 16, 16), margin: EdgeInsets.fromLTRB(16.w, 16.h, 16.w, 16.h),
padding: EdgeInsets.fromLTRB(0, 7, 0, 7), padding: EdgeInsets.fromLTRB(0, 7.h, 0, 7.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8)), borderRadius: BorderRadius.all(Radius.circular(8)),
@ -422,15 +434,16 @@ class _MineWalletPage extends State<MineWalletPage> {
children: [ children: [
Image.asset( Image.asset(
"assets/image/icon_wallet_withdrawal.png", "assets/image/icon_wallet_withdrawal.png",
width: 40, width: 40.w,
height: 40, height: 40.w,
), ),
Text( Text(
S.of(context).tixian, S.of(context).tixian,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 16, fontSize: 16.sp,
color: Colors.black), color: Colors.black,
),
) )
], ],
), ),

159
lib/mine/recharge_page.dart

@ -1,11 +1,19 @@
import 'package:dio/dio.dart';
import 'package:flutter/material.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/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:huixiang/view_widget/item_input_widget.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/round_button.dart'; import 'package:huixiang/view_widget/round_button.dart';
import 'package:shared_preferences/shared_preferences.dart';
class RechargePage extends StatefulWidget { class RechargePage extends StatefulWidget {
@override @override
State<StatefulWidget> createState() { State<StatefulWidget> createState() {
return _RechargePage(); return _RechargePage();
@ -13,10 +21,22 @@ class RechargePage extends StatefulWidget {
} }
class _RechargePage extends State<RechargePage> { class _RechargePage extends State<RechargePage> {
TextEditingController controller; ApiService apiService;
TextEditingController controller = TextEditingController();
Color color = Colors.black; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -26,7 +46,7 @@ class _RechargePage extends State<RechargePage> {
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
fontSize: 18, fontSize: 18.sp,
), ),
), ),
centerTitle: false, centerTitle: false,
@ -38,7 +58,7 @@ class _RechargePage extends State<RechargePage> {
}, },
child: Container( child: Container(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10.w),
padding: EdgeInsets.all(6), padding: EdgeInsets.all(6),
child: Icon( child: Icon(
Icons.arrow_back_ios, Icons.arrow_back_ios,
@ -48,7 +68,7 @@ class _RechargePage extends State<RechargePage> {
), ),
), ),
titleSpacing: 2, titleSpacing: 2,
leadingWidth: 56, leadingWidth: 56.w,
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -67,9 +87,13 @@ class _RechargePage extends State<RechargePage> {
errorTextColor: Color(0xFF32A060), errorTextColor: Color(0xFF32A060),
radius: 8, radius: 8,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold, fontSize: 30.sp, color: color), fontWeight: FontWeight.bold,
inputLimit: 16, fontSize: 30.sp,
color: color,
),
inputLimit: 12,
textInputType: TextInputType.number, textInputType: TextInputType.number,
textInputFormatter: FilteringTextInputFormatter.digitsOnly,
onChanged: (value) { onChanged: (value) {
if (value != null && if (value != null &&
value != "" && value != "" &&
@ -83,10 +107,18 @@ class _RechargePage extends State<RechargePage> {
), ),
Container( Container(
width: double.infinity, width: double.infinity,
margin: margin: EdgeInsets.only(
EdgeInsets.only(left: 20, right: 20, top: 12, bottom: 4), left: 20.w,
padding: right: 20.w,
EdgeInsets.only(left: 20, right: 16, top: 20, bottom: 20), top: 12.h,
bottom: 4.h,
),
padding: EdgeInsets.only(
left: 20.w,
right: 16.w,
top: 20.h,
bottom: 20.h,
),
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -105,17 +137,23 @@ class _RechargePage extends State<RechargePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only(bottom: 16), padding: EdgeInsets.only(bottom: 16.h),
child: Text( child: Text(
S.of(context).zhifufangshi, S.of(context).zhifufangshi,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16.sp,
color: color, color: color,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
), ),
Row( GestureDetector(
onTap: () {
setState(() {
checkIndex = 0;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -123,18 +161,27 @@ class _RechargePage extends State<RechargePage> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Padding( child: Padding(
padding: EdgeInsets.only(left: 8, bottom: 20), padding: EdgeInsets.only(left: 8.w, bottom: 20.h),
child: Text(S.of(context).zhifubao, child: Text(
S.of(context).zhifubao,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
)), ),
),
), ),
), ),
checkView(0), checkView(0),
], ],
), ),
Row( ),
GestureDetector(
onTap: () {
setState(() {
checkIndex = 1;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -142,63 +189,99 @@ class _RechargePage extends State<RechargePage> {
Expanded( Expanded(
flex: 1, flex: 1,
child: Padding( child: Padding(
padding: EdgeInsets.only(left: 8), padding: EdgeInsets.only(left: 8.w),
child: Text(S.of(context).weixinzhifu, child: Text(S.of(context).weixinzhifu,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14.sp,
color: Color(0xff353535), color: Color(0xff353535),
)), )),
), ),
), ),
checkView(1), checkView(1),
], ],
) ),
),
], ],
), ),
), ),
Container( InkWell(
margin: EdgeInsets.only(left: 20, right: 20, top: 26), onTap: () {
recharge();
},
child: Container(
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 26.h),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
RoundButton( RoundButton(
width: double.infinity, width: double.infinity,
height: 46, height: 46.h,
text:S.of(context).querenchongzhi, text: S.of(context).querenchongzhi,
textColor: Colors.white, textColor: Colors.white,
fontSize: 14, fontSize: 14.sp,
backgroup: Color(0xff32A060), backgroup: Color(0xff32A060),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
], ],
), ),
), ),
),
], ],
), ),
), ),
), ),
); );
} }
var checkIndex = 0; var checkIndex = 0;
Widget checkView(var index) { Widget checkView(var index) {
return GestureDetector( return Container(
onTap: () { padding: EdgeInsets.only(right: 16.w),
setState(() {
checkIndex = index;
});
},
child: Container(
padding: EdgeInsets.only(right: 16),
alignment: Alignment.center, alignment: Alignment.center,
child: Image.asset( child: Image.asset(
checkIndex != index checkIndex != index
? "assets/image/icon_radio_unselected.png" ? "assets/image/icon_radio_unselected.png"
: "assets/image/icon_radio_selected.png", : "assets/image/icon_radio_selected.png",
width: 15, width: 15.w,
height: 15, 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}");
});
}
}
}
} }

5
lib/retrofit/data/banner.dart

@ -2,6 +2,7 @@
class BannerData { class BannerData {
String content; String content;
String createTime; String createTime;
String contentType;
String createUser; String createUser;
String id; String id;
String imgUrl; String imgUrl;
@ -12,11 +13,12 @@ class BannerData {
String updateTime; String updateTime;
String updateUser; 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<String, dynamic> json) => BannerData( factory BannerData.fromJson(Map<String, dynamic> json) => BannerData(
content: json['content'] as String, content: json['content'] as String,
createTime: json['createTime'] as String, createTime: json['createTime'] as String,
contentType: json['contentType'] as String,
createUser: json['createUser'] as String, createUser: json['createUser'] as String,
id: json['id'] as String, id: json['id'] as String,
imgUrl: json['imgUrl'] as String, imgUrl: json['imgUrl'] as String,
@ -31,6 +33,7 @@ class BannerData {
Map<String, dynamic> toJson() => <String, dynamic>{ Map<String, dynamic> toJson() => <String, dynamic>{
'content': this.content, 'content': this.content,
'createTime': this.createTime, 'createTime': this.createTime,
'contentType': this.contentType,
'createUser': this.createUser, 'createUser': this.createUser,
'id': this.id, 'id': this.id,
'imgUrl': this.imgUrl, 'imgUrl': this.imgUrl,

65
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<String, dynamic> toJson() {
var map = <String, dynamic>{};
map["appId"] = _appId;
map["nonceStr"] = _nonceStr;
map["packageValue"] = _packageValue;
map["partnerId"] = _partnerId;
map["prepayId"] = _prepayId;
map["sign"] = _sign;
map["timeStamp"] = _timeStamp;
return map;
}
}

13
lib/retrofit/retrofit_api.dart

@ -7,9 +7,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.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/retrofit/data/base_data.dart';
import 'package:huixiang/view_widget/loading_view.dart';
import 'package:huixiang/view_widget/login_tips.dart'; import 'package:huixiang/view_widget/login_tips.dart';
import 'package:retrofit/retrofit.dart'; import 'package:retrofit/retrofit.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -17,8 +15,8 @@ import 'package:shared_preferences/shared_preferences.dart';
part 'retrofit_api.g.dart'; part 'retrofit_api.g.dart';
const base_url = "http://platform.test.api.lotus-wallet.com/app/"; const base_url = "http://platform.test.api.lotus-wallet.com/app/";
const baseUrl = "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://192.168.10.236:8766/app/";
// const baseUrl = "http://192.168.10.129:8766/app/"; // const baseUrl = "http://192.168.10.129:8766/app/";
@RestApi(baseUrl: baseUrl) @RestApi(baseUrl: baseUrl)
@ -28,9 +26,12 @@ abstract class ApiService {
{String baseUrl, {String baseUrl,
BuildContext context, BuildContext context,
String token, String token,
bool showLoading = true}) { bool showLoading = true, bool pay = false}) {
Map<String, dynamic> headers = Map<String, dynamic> headers =
(token == null || token == "") ? {} : {'token': "Bearer $token"}; (token == null || token == "") ? {} : {'token': "Bearer $token"};
if (pay) {
headers["Environment"] = "app";
}
dio.options = BaseOptions( dio.options = BaseOptions(
connectTimeout: 60000, connectTimeout: 60000,
receiveTimeout: 60000, receiveTimeout: 60000,
@ -165,7 +166,7 @@ abstract class ApiService {
Future<BaseData> signIn(); Future<BaseData> signIn();
/// ///
@POST("/member/recharge") @POST("/wallet/recharge")
Future<BaseData> recharge(@Body() Map<String, dynamic> param); Future<BaseData> recharge(@Body() Map<String, dynamic> param);
/// ///

4
lib/retrofit/retrofit_api.g.dart

@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
class _ApiService implements ApiService { class _ApiService implements ApiService {
_ApiService(this._dio, {this.baseUrl}) { _ApiService(this._dio, {this.baseUrl}) {
ArgumentError.checkNotNull(_dio, '_dio'); ArgumentError.checkNotNull(_dio, '_dio');
baseUrl ??= 'http://platform.test.api.lotus-wallet.com/app/'; baseUrl ??= 'http://192.168.10.236:8766/app/';
} }
final Dio _dio; final Dio _dio;
@ -221,7 +221,7 @@ class _ApiService implements ApiService {
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{}; final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{}); _data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>('/member/recharge', final _result = await _dio.request<Map<String, dynamic>>('/wallet/recharge',
queryParameters: queryParameters, queryParameters: queryParameters,
options: RequestOptions( options: RequestOptions(
method: 'POST', method: 'POST',

177
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:flutter/material.dart';
import 'package:huixiang/generated/l10n.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 { class PermissionSettingPage extends StatefulWidget {
@override @override
@ -9,6 +17,50 @@ class PermissionSettingPage extends StatefulWidget {
} }
class _PermissionSettingPage extends State<PermissionSettingPage> { class _PermissionSettingPage extends State<PermissionSettingPage> {
@override
void initState() {
super.initState();
queryPermission();
}
List<String> title = [
S.current.dingwei,
S.current.tongzhi,
S.current.xiangji,
S.current.cunchu,
];
List<String> 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<String> contents = [
S.current.weizhitishixinxi,
S.current.tongzhitishixinxi,
S.current.xiangjitishixinxi,
S.current.cunchutishixinxi,
];
Map<Permission, bool> permissionSwitch = {};
List<Permission> 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -29,7 +81,7 @@ class _PermissionSettingPage extends State<PermissionSettingPage> {
}, },
child: Container( child: Container(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10.w),
padding: EdgeInsets.all(6), padding: EdgeInsets.all(6),
child: Icon( child: Icon(
Icons.arrow_back_ios, Icons.arrow_back_ios,
@ -38,53 +90,88 @@ class _PermissionSettingPage extends State<PermissionSettingPage> {
), ),
), ),
), ),
titleSpacing: 2, titleSpacing: 2.w,
leadingWidth: 56, leadingWidth: 56.w,
), ),
body: Container( body: Container(
child: ListView.builder( child: ListView.builder(
itemCount: 4, itemCount: permissions.length,
itemBuilder: (context, position) { itemBuilder: (context, position) {
return buildPermissionItem( return InkWell(
title[position], icons[position], contents[position]); onTap: () {
openPermission(permissions[position]);
},
child: buildPermissionItem(title[position], icons[position],
contents[position], permissions[position]),
);
}), }),
), ),
); );
} }
List<String> title = [ openPermission(Permission permission) async {
S.current.dingwei, if ((permissionSwitch.containsKey(permission) &&
S.current.tongzhi, permissionSwitch[permission])) {
S.current.xiangji, openAppSettings();
"Face ID", return;
]; }
List<String> icons = [ if(await permission.isPermanentlyDenied) {
"assets/image/icon_permission_location.png", requestDialog();
"assets/image/icon_permission_notices.png", } else if (await permission.isUndetermined) {
"assets/image/icon_permission_camera.png", await permission.request();
"assets/image/icon_permission_face_id.png", queryPermission();
]; } else {
List<String> contents = [ if (Platform.isIOS) {
S.current.weizhitishixinxi, //
S.current.tongzhitishixinxi, requestDialog();
S.current.xiangjitishixinxi, } else {
S.current.faceidtishixinxi, 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( return Container(
margin: EdgeInsets.fromLTRB(16, 8, 16, 8), margin: EdgeInsets.fromLTRB(16.w, 8.h, 16.w, 8.h),
padding: EdgeInsets.fromLTRB(20, 16, 20, 16), padding: EdgeInsets.fromLTRB(20.w, 16.h, 20.w, 16.h),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(8)), borderRadius: BorderRadius.circular(8),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withAlpha(12), color: Colors.black.withAlpha(12),
offset: Offset(0, 3), offset: Offset(0, 3),
blurRadius: 14, blurRadius: 14,
spreadRadius: 0) spreadRadius: 0,
]), )
],
),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -98,7 +185,7 @@ class _PermissionSettingPage extends State<PermissionSettingPage> {
title, title,
style: TextStyle( style: TextStyle(
color: Colors.black, color: Colors.black,
fontSize: 16, fontSize: 16.sp,
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
SizedBox( SizedBox(
@ -106,13 +193,13 @@ class _PermissionSettingPage extends State<PermissionSettingPage> {
), ),
Image.asset( Image.asset(
icon, icon,
width: 22, width: 22.w,
height: 22, height: 22.h,
) )
], ],
), ),
SizedBox( SizedBox(
height: 8, height: 8.h,
), ),
Text( Text(
content, content,
@ -120,30 +207,18 @@ class _PermissionSettingPage extends State<PermissionSettingPage> {
maxLines: 2, maxLines: 2,
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontSize: 12, fontSize: 12.sp,
), ),
), ),
], ],
), ),
), ),
SizedBox( SizedBox(
width: 32, width: 32.w,
), ),
Row( CupertinoSwitch(
children: [ value: (permissionSwitch.containsKey(permission) &&
Text( permissionSwitch[permission]),
S.of(context).weikaiqi,
style: TextStyle(
color: Color(0xFF32A060),
fontSize: 12,
),
),
Icon(
Icons.keyboard_arrow_right,
size: 16,
color: Color(0xFF32A060),
)
],
), ),
], ],
), ),

100
lib/setting/setting_page.dart

@ -146,8 +146,7 @@ class _SettingPage extends State<SettingPage> {
: S.of(context).fantizhongwen), : S.of(context).fantizhongwen),
), ),
GestureDetector( GestureDetector(
child: child: settingSingleItem(S.of(context).quanxian),
settingItem(S.of(context).quanxian, S.of(context).weikaiqi),
onTap: () { onTap: () {
Navigator.of(context).pushNamed('/router/permission_setting'); Navigator.of(context).pushNamed('/router/permission_setting');
}, },
@ -346,101 +345,4 @@ class _SettingPage extends State<SettingPage> {
); );
} }
List<String> title = [
S.current.dingwei,
S.current.tongzhi,
S.current.xiangji,
"Face ID",
];
List<String> 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<String> 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),
)
],
),
],
),
);
}
} }

2
lib/union/union_details_page.dart

@ -956,7 +956,7 @@ class _UnionDetailsPage extends State<UnionDetailsPage> {
"tenantCode": storeInfo.tenantCode, "tenantCode": storeInfo.tenantCode,
if (latitude != null && longitude != null) if (latitude != null && longitude != null)
"position": "$latitude,$longitude", "position": "$latitude,$longitude",
"baseURL": "https://pos-test.api.lotus-wallet.com/app/", "baseURL": "http://192.168.10.236:8765/app/",
"uid": userId, "uid": userId,
"userInfo": { "userInfo": {
"nickname": nickname, "nickname": nickname,

15
lib/union/union_page.dart

@ -70,9 +70,12 @@ class _UnionPage extends State<UnionPage>
WidgetsBinding.instance.removeObserver(this); WidgetsBinding.instance.removeObserver(this);
aMapFlutterLocation.stopLocation(); aMapFlutterLocation.stopLocation();
aMapFlutterLocation.destroy(); aMapFlutterLocation.destroy();
refreshController.dispose();
} }
bool iskeyboardShow = false; bool isKeyBoardShow = false;
@override @override
void didChangeMetrics() { void didChangeMetrics() {
@ -81,13 +84,13 @@ class _UnionPage extends State<UnionPage>
setState(() { setState(() {
print("object: ${MediaQuery.of(context).viewInsets.bottom}"); print("object: ${MediaQuery.of(context).viewInsets.bottom}");
if (MediaQuery.of(context).viewInsets.bottom == 0) { if (MediaQuery.of(context).viewInsets.bottom == 0) {
if (iskeyboardShow) { if (isKeyBoardShow) {
iskeyboardShow = false; isKeyBoardShow = false;
// //
FocusScope.of(context).requestFocus(FocusNode()); FocusScope.of(context).requestFocus(FocusNode());
} }
} else { } else {
iskeyboardShow = true; isKeyBoardShow = true;
} }
}); });
}); });
@ -231,6 +234,7 @@ class _UnionPage extends State<UnionPage>
.toList(); .toList();
buildMarker(); buildMarker();
refreshController.refreshCompleted(); refreshController.refreshCompleted();
if(mounted)
setState(() {}); setState(() {});
} else { } else {
refreshController.refreshFailed(); refreshController.refreshFailed();
@ -261,6 +265,7 @@ class _UnionPage extends State<UnionPage>
icon: bitmapDescriptor, icon: bitmapDescriptor,
infoWindowEnable: true, infoWindowEnable: true,
))); )));
if(mounted)
setState(() {}); setState(() {});
} }
@ -354,7 +359,7 @@ class _UnionPage extends State<UnionPage>
MediaQuery.of(context).padding.top, MediaQuery.of(context).padding.top,
child: SmartRefresher( child: SmartRefresher(
controller: refreshController, controller: refreshController,
enablePullUp: true, enablePullUp: false,
enablePullDown: true, enablePullDown: true,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
header: MyHeader(), header: MyHeader(),

9
lib/view_widget/item_input_widget.dart

@ -30,6 +30,7 @@ class ItemInputWidget extends StatelessWidget {
final double radius; final double radius;
final EdgeInsets padding; final EdgeInsets padding;
final TextInputType textInputType; final TextInputType textInputType;
final TextInputFormatter textInputFormatter;
ItemInputWidget( ItemInputWidget(
this.title, { this.title, {
@ -51,6 +52,7 @@ class ItemInputWidget extends StatelessWidget {
const EdgeInsets.only(left: 20, right: 21, top: 16, bottom: 4), const EdgeInsets.only(left: 20, right: 21, top: 16, bottom: 4),
this.btnText, this.btnText,
this.inputType = 0, this.inputType = 0,
this.textInputFormatter,
this.isShowBtn = false, this.isShowBtn = false,
}); });
@ -142,7 +144,8 @@ class ItemInputWidget extends StatelessWidget {
contentPadding: EdgeInsets.only( contentPadding: EdgeInsets.only(
top: 12, top: 12,
bottom: 12, bottom: 12,
left: inputType == 1 ? 22 : 0), left: inputType == 1 ? 22 : 0,
),
hintStyle: TextStyle( hintStyle: TextStyle(
fontSize: 10, fontSize: 10,
color: Color(0xFFA29E9E), color: Color(0xFFA29E9E),
@ -150,10 +153,12 @@ class ItemInputWidget extends StatelessWidget {
), ),
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
inputFormatters: [ inputFormatters: [
LengthLimitingTextInputFormatter(inputLimit) LengthLimitingTextInputFormatter(inputLimit),
textInputFormatter
], ],
cursorColor: Colors.grey, cursorColor: Colors.grey,
maxLines: 1, maxLines: 1,
minLines: 1,
), ),
), ),
], ],

300
pubspec.lock

File diff suppressed because it is too large Load Diff

4
pubspec.yaml

@ -26,7 +26,9 @@ dependencies:
sdk: flutter sdk: flutter
flutter_localizations: flutter_localizations:
sdk: flutter sdk: flutter
# fluwx: ^3.5.0 fluwx: ^3.5.0
keframe: ^2.0.2 #滑动组件卡顿优化
barcode_widget: ^2.0.1 barcode_widget: ^2.0.1
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2

Loading…
Cancel
Save