Browse Source

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

tags/0.0.7+1
“yanghuaxuan” 3 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 {
// // 智夜生活
// zhiying {
// applicationId "cn.zhios.zhiying"
// versionCode 48
// versionCode 50
// dimension "app"
// versionName '1.3.6'
// versionName '1.3.10'
// // 签名信息
// 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
public Map getSetting() {
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("token", "123465");
return map;


+ 1
- 1
example/pubspec.yaml View File

@@ -40,7 +40,7 @@ dev_dependencies:
zhiying_moments:
#path: ../zhiying_moments
git:
ref: 0.1.8
ref: 0.2.0
url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_moments.git
#会员升级
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/material.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/withdraw_page/bloc/withdraw_bloc.dart';
import 'package:zhiying_base_widget/pages/withdraw_page/models/withdraw_model.dart';
@@ -71,8 +72,6 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
super.initState();
}



reload() {
_bloc.loadData(widget.data['skip_identifier']);
_bloc.loadWithdrawData();
@@ -117,14 +116,15 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
return AppBar(
elevation: 1,
brightness: Brightness.light,
backgroundColor: HexColor.fromHex(model?.appBarBgColor??""),
backgroundColor: HexColor.fromHex(model?.appBarBgColor ?? ""),
leading: Navigator.canPop(context)
? GestureDetector(
child: Container(
padding: EdgeInsets.zero,
child: Icon(
Icons.arrow_back_ios,
size: 20,
size: 18,
color: HexColor.fromHex(model?.appBarNameColor??""),
),
),
onTap: () {
@@ -137,27 +137,24 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
centerTitle: true,
title: Text(
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(
width: double.infinity,
height: 97,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10)),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: Stack(
children: <Widget>[
Container(
@@ -206,24 +202,12 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {

Widget _createVerify(WithdrawModel model) {
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(
behavior: HitTestBehavior.opaque,
onTap: () {
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();
});
},
@@ -232,28 +216,20 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
child: Row(
children: <Widget>[
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,
),
Expanded(
child: Padding(
padding: const EdgeInsets.only(left: 8, right: 8),
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)),
),
),
),
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)),
),
Icon(
@@ -268,8 +244,7 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
}

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;
}
return GridView.builder(
@@ -293,17 +268,11 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
},
child: Container(
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),
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(
@@ -311,11 +280,8 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
item.name,
style: TextStyle(
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) {
_checkSubmit(value);
},
placeholderStyle:
TextStyle(fontSize: 26, color: Colors.grey[400]),
placeholderStyle: TextStyle(fontSize: 26, color: Colors.grey[400]),
),
),
Container(
@@ -397,12 +362,8 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
// }
try {
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;
} else {
_submitable = false;
@@ -413,18 +374,32 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
}

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

///提现
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);
}
},
child: Container(
height: 50,
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),
),
child: Center(
@@ -432,10 +407,7 @@ class _WithdrawContainerState extends State<_WithdrawContainer> {
model.cashOutBtnText ?? '',
style: TextStyle(
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