Browse Source

1.提现增加支宝版定提示

tags/0.0.7+1
“yanghuaxuan” 4 years ago
parent
commit
015dfc2db6
4 changed files with 60 additions and 88 deletions
  1. +3
    -3
      example/android/app/build.gradle
  2. +3
    -3
      example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java
  3. +1
    -1
      example/pubspec.yaml
  4. +53
    -81
      lib/pages/withdraw_page/withdraw_page.dart

+ 3
- 3
example/android/app/build.gradle View File

@@ -108,14 +108,14 @@ android {
} }




// // 应用信息配置
// 应用信息配置
// productFlavors { // productFlavors {
// // 智夜生活 // // 智夜生活
// zhiying { // zhiying {
// applicationId "cn.zhios.zhiying" // applicationId "cn.zhios.zhiying"
// versionCode 48
// versionCode 50
// dimension "app" // dimension "app"
// versionName '1.3.6'
// versionName '1.3.10'
// // 签名信息 // // 签名信息
// signingConfig signingConfigs.zhiying // signingConfig signingConfigs.zhiying
// } // }


+ 3
- 3
example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java View File

@@ -154,9 +154,9 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN
@Override @Override
public Map getSetting() { public Map getSetting() {
Map map = new HashMap(); Map map = new HashMap();
//map.put("domain", "http://inapi.izhyin.cn/"); //"http://120.76.175.204:8989");
map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn68703914
map.put("master_id", "68703914");
map.put("domain", "http://inapi.izhyin.cn/"); //"http://120.76.175.204:8989");
// map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn68703914
map.put("master_id", "123456");
map.put("secret_key", "123456"); map.put("secret_key", "123456");
// map.put("token", "123465"); // map.put("token", "123465");
return map; return map;


+ 1
- 1
example/pubspec.yaml View File

@@ -40,7 +40,7 @@ dev_dependencies:
zhiying_moments: zhiying_moments:
#path: ../zhiying_moments #path: ../zhiying_moments
git: git:
ref: 0.1.8
ref: 0.2.0
url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_moments.git url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_moments.git
#会员升级 #会员升级
zhiying_member_upgrade: zhiying_member_upgrade:


+ 53
- 81
lib/pages/withdraw_page/withdraw_page.dart View File

@@ -2,6 +2,7 @@ import 'package:event_bus/event_bus.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:zhiying_base_widget/dialog/tip_dialog/tip_dialog.dart';
import 'package:zhiying_base_widget/pages/bil_detail_page/bil_detail_page.dart'; import 'package:zhiying_base_widget/pages/bil_detail_page/bil_detail_page.dart';
import 'package:zhiying_base_widget/pages/withdraw_page/bloc/withdraw_bloc.dart'; import 'package:zhiying_base_widget/pages/withdraw_page/bloc/withdraw_bloc.dart';
import 'package:zhiying_base_widget/pages/withdraw_page/models/withdraw_model.dart'; import 'package:zhiying_base_widget/pages/withdraw_page/models/withdraw_model.dart';
@@ -71,8 +72,6 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
super.initState(); super.initState();
} }




reload() { reload() {
_bloc.loadData(widget.data['skip_identifier']); _bloc.loadData(widget.data['skip_identifier']);
_bloc.loadWithdrawData(); _bloc.loadWithdrawData();
@@ -117,14 +116,15 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
return AppBar( return AppBar(
elevation: 1, elevation: 1,
brightness: Brightness.light, brightness: Brightness.light,
backgroundColor: HexColor.fromHex(model?.appBarBgColor??""),
backgroundColor: HexColor.fromHex(model?.appBarBgColor ?? ""),
leading: Navigator.canPop(context) leading: Navigator.canPop(context)
? GestureDetector( ? GestureDetector(
child: Container( child: Container(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
child: Icon( child: Icon(
Icons.arrow_back_ios, Icons.arrow_back_ios,
size: 20,
size: 18,
color: HexColor.fromHex(model?.appBarNameColor??""),
), ),
), ),
onTap: () { onTap: () {
@@ -137,27 +137,24 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
centerTitle: true, centerTitle: true,
title: Text( title: Text(
model.appBarName, model.appBarName,
style: TextStyle(
fontSize: 17,
color: HexColor.fromHex(model.appBarNameColor),
fontWeight: FontWeight.w600
),
style: TextStyle(fontSize: 17, color: HexColor.fromHex(model.appBarNameColor), fontWeight: FontWeight.w600),
), ),
actions:<Widget>[ GestureDetector(
child: Center(
child: Padding(
padding: EdgeInsets.only(right: 16),
child: Text(
model.appBarRightText,
style: TextStyle(fontSize: 13, color: HexColor.fromHex(model?.appBarNameColor??"")),
actions: <Widget>[
GestureDetector(
child: Center(
child: Padding(
padding: EdgeInsets.only(right: 16),
child: Text(
model.appBarRightText,
style: TextStyle(fontSize: 13, color: HexColor.fromHex(model?.appBarNameColor ?? "")),
),
), ),
), ),
),
onTap: () {
RouterUtil.route(
model.detailSkipModel, model.detailSkipModel.toJson(), context);
},
)],
onTap: () {
RouterUtil.route(model.detailSkipModel, model.detailSkipModel.toJson(), context);
},
)
],
); );
} }


@@ -166,8 +163,7 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
return Container( return Container(
width: double.infinity, width: double.infinity,
height: 97, height: 97,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10)),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
Container( Container(
@@ -206,24 +202,12 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {


Widget _createVerify(WithdrawModel model) { Widget _createVerify(WithdrawModel model) {
var data = _bloc.withdrawDataModel; var data = _bloc.withdrawDataModel;
var param = {
'status': _bloc.aliPayModel,
Constants.SkipIdentifierName: model.gotoAliPay.skipIdentifier,
'data': _bloc.aliPayModel
};
var param = {'status': _bloc.aliPayModel, Constants.SkipIdentifierName: model.gotoAliPay.skipIdentifier, 'data': _bloc.aliPayModel};
return GestureDetector( return GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
Logger.debug('绑定支付宝'); Logger.debug('绑定支付宝');
RouterUtil.route(
model.gotoAliPay,
{
'status': _bloc.aliPayModel,
Constants.SkipIdentifierName: model.gotoAliPay.skipIdentifier,
'data': param
},
context)
.then((value) {
RouterUtil.route(model.gotoAliPay, {'status': _bloc.aliPayModel, Constants.SkipIdentifierName: model.gotoAliPay.skipIdentifier, 'data': param}, context).then((value) {
reload(); reload();
}); });
}, },
@@ -232,28 +216,20 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
CachedNetworkImage( CachedNetworkImage(
imageUrl: (data?.alipayUserName == null ||
data?.alipayUserName.length == 0)
? model.unbindAlipayImg
: model.bindAlipayImg,
imageUrl: (data?.alipayUserName == null || data?.alipayUserName.length == 0) ? model.unbindAlipayImg : model.bindAlipayImg,
height: 23, height: 23,
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 8, right: 8), padding: const EdgeInsets.only(left: 8, right: 8),
child: Text( child: Text(
(data?.alipayUserName == null ||
data?.alipayUserName.length == 0)
? model.unbindAlipayText
: data.alipayUserName,
(data?.alipayUserName == null || data?.alipayUserName.length == 0) ? model.unbindAlipayText : data.alipayUserName,
style: TextStyle(fontSize: 11, color: Color(0xff999999)), style: TextStyle(fontSize: 11, color: Color(0xff999999)),
), ),
), ),
), ),
Text( Text(
(data?.alipayUserName == null || data?.alipayUserName.length == 0)
? model.unbindAlipayGotoText
: model.bindAlipayGotoText,
(data?.alipayUserName == null || data?.alipayUserName.length == 0) ? model.unbindAlipayGotoText : model.bindAlipayGotoText,
style: TextStyle(fontSize: 11, color: Color(0xff999999)), style: TextStyle(fontSize: 11, color: Color(0xff999999)),
), ),
Icon( Icon(
@@ -268,8 +244,7 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
} }


Widget _createPrice(WithdrawModel model) { Widget _createPrice(WithdrawModel model) {
if (_controller.text.length == 0 &&
model.cashOutDashbordItems[_currentIndex].name != "自定义") {
if (_controller.text.length == 0 && model.cashOutDashbordItems[_currentIndex].name != "自定义") {
_controller.text = model.cashOutDashbordItems[0].value; _controller.text = model.cashOutDashbordItems[0].value;
} }
return GridView.builder( return GridView.builder(
@@ -293,17 +268,11 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: index == _currentIndex
? HexColor.fromHex(
model.cashOutDashbordItemsSelectedBgColor ?? '')
: HexColor.fromHex(
model.cashOutDashbordItemsUnselectedBgColor ?? ''),
color:
index == _currentIndex ? HexColor.fromHex(model.cashOutDashbordItemsSelectedBgColor ?? '') : HexColor.fromHex(model.cashOutDashbordItemsUnselectedBgColor ?? ''),
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(5),
border: Border.all( border: Border.all(
color: index == _currentIndex
? HexColor.fromHex(
model.cashOutDashbordItemsSelectedColor ?? '')
: HexColor.fromHex('#d2d2d2'),
color: index == _currentIndex ? HexColor.fromHex(model.cashOutDashbordItemsSelectedColor ?? '') : HexColor.fromHex('#d2d2d2'),
), ),
), ),
child: Center( child: Center(
@@ -311,11 +280,8 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
item.name, item.name,
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: index == _currentIndex
? HexColor.fromHex(
model.cashOutDashbordItemsSelectedColor ?? '')
: HexColor.fromHex(
model.cashOutDashbordItemsUnselectedColor ?? ''),
color:
index == _currentIndex ? HexColor.fromHex(model.cashOutDashbordItemsSelectedColor ?? '') : HexColor.fromHex(model.cashOutDashbordItemsUnselectedColor ?? ''),
), ),
), ),
), ),
@@ -365,8 +331,7 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
onChanged: (value) { onChanged: (value) {
_checkSubmit(value); _checkSubmit(value);
}, },
placeholderStyle:
TextStyle(fontSize: 26, color: Colors.grey[400]),
placeholderStyle: TextStyle(fontSize: 26, color: Colors.grey[400]),
), ),
), ),
Container( Container(
@@ -397,12 +362,8 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
// } // }
try { try {
var currentWithdraw = num.tryParse(_controller.text); var currentWithdraw = num.tryParse(_controller.text);
var finValue = num.tryParse(_bloc.withdrawDataModel.finValue);
if (currentWithdraw != null &&
currentWithdraw != 0 &&
finValue != null &&
finValue != 0 &&
currentWithdraw <= finValue) {
var finValue = num.tryParse(_bloc.withdrawDataModel?.finValue??"0");
if (currentWithdraw != null && currentWithdraw != 0 && finValue != null && finValue != 0 && currentWithdraw <= finValue) {
_submitable = true; _submitable = true;
} else { } else {
_submitable = false; _submitable = false;
@@ -413,18 +374,32 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
} }


return GestureDetector( return GestureDetector(
onTap: () {
onTap: () async {

///提现 ///提现
if (_submitable) { if (_submitable) {
if (_bloc?.withdrawDataModel != null && _bloc?.withdrawDataModel?.isBindAlipay == "0") {
var result = await showDialog(
context: context,
child: TipDialog(
content: "请绑定支付宝",
btnText: "前往绑定支付宝",
));
if (result != null && result) {
var param = {'status': _bloc.aliPayModel, Constants.SkipIdentifierName: model.gotoAliPay.skipIdentifier, 'data': _bloc.aliPayModel};
RouterUtil.route(model.gotoAliPay, {'status': _bloc.aliPayModel, Constants.SkipIdentifierName: model.gotoAliPay.skipIdentifier, 'data': param}, context).then((value) {
reload();
});
}
return;
}
_bloc.submitApply(context, _controller.text); _bloc.submitApply(context, _controller.text);
} }
}, },
child: Container( child: Container(
height: 50, height: 50,
decoration: BoxDecoration( decoration: BoxDecoration(
color: _submitable
? HexColor.fromHex(model.cashOutBtnTextAvailableBgColor ?? '')
: HexColor.fromHex(model.cashOutBtnTextUnavailableBgColor ?? ''),
color: _submitable ? HexColor.fromHex(model.cashOutBtnTextAvailableBgColor ?? '') : HexColor.fromHex(model.cashOutBtnTextUnavailableBgColor ?? ''),
borderRadius: BorderRadius.circular(7.5), borderRadius: BorderRadius.circular(7.5),
), ),
child: Center( child: Center(
@@ -432,10 +407,7 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
model.cashOutBtnText ?? '', model.cashOutBtnText ?? '',
style: TextStyle( style: TextStyle(
fontSize: 15, fontSize: 15,
color: _submitable
? HexColor.fromHex(model.cashOutBtnTextAvailableColor ?? '')
: HexColor.fromHex(
model.cashOutBtnTextUnavailableColor ?? ''),
color: _submitable ? HexColor.fromHex(model.cashOutBtnTextAvailableColor ?? '') : HexColor.fromHex(model.cashOutBtnTextUnavailableColor ?? ''),
), ),
), ),
), ),


Loading…
Cancel
Save