|
|
@@ -37,13 +37,15 @@ class _BindAlipayPageState extends State<BindAlipayPage> {
|
|
|
checkPaymentMethod((response, hasError) {
|
|
|
if (!hasError) {
|
|
|
PayWayBeanEntity entity =
|
|
|
- PayWayBeanEntity().fromJson(json.decode(response.toString()));
|
|
|
+ PayWayBeanEntity().fromJson(json.decode(response.toString()));
|
|
|
payWays = entity.data;
|
|
|
- showAlipay = payWays[payWays.indexWhere((element) => element.way==1)].withdraw;
|
|
|
- showWeChat = payWays[payWays.indexWhere((element) => element.way==2)].withdraw;
|
|
|
- setState(() {
|
|
|
-
|
|
|
- });
|
|
|
+ showAlipay =
|
|
|
+ payWays[payWays.indexWhere((element) => element.way == 1)]
|
|
|
+ .withdraw;
|
|
|
+ showWeChat =
|
|
|
+ payWays[payWays.indexWhere((element) => element.way == 2)]
|
|
|
+ .withdraw;
|
|
|
+ setState(() {});
|
|
|
}
|
|
|
}, (e) {});
|
|
|
});
|
|
|
@@ -98,209 +100,227 @@ class _BindAlipayPageState extends State<BindAlipayPage> {
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
- if(showAlipay)Container(
|
|
|
- height: 220,
|
|
|
- margin: EdgeInsets.fromLTRB(15, 60, 15, 0),
|
|
|
- width: double.infinity,
|
|
|
- child: ClipShadowPath(
|
|
|
- clipper: TicketClipPath2(),
|
|
|
- shadow: Shadow(blurRadius: 5, color: MyColors.c21333333),
|
|
|
- child: Scaffold(
|
|
|
- body: Stack(
|
|
|
- alignment: Alignment.bottomCenter,
|
|
|
- children: [
|
|
|
- Column(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- margin: EdgeInsets.only(top: 30),
|
|
|
- child: SvgPicture.asset(
|
|
|
- 'images/svg/支付宝.svg',
|
|
|
- height: 40,
|
|
|
- width: 40,
|
|
|
+ if (showAlipay)
|
|
|
+ Container(
|
|
|
+ height: 220,
|
|
|
+ margin: EdgeInsets.fromLTRB(15, 60, 15, 0),
|
|
|
+ width: double.infinity,
|
|
|
+ child: ClipShadowPath(
|
|
|
+ clipper: TicketClipPath2(),
|
|
|
+ shadow: Shadow(blurRadius: 5, color: MyColors.c21333333),
|
|
|
+ child: Scaffold(
|
|
|
+ body: Stack(
|
|
|
+ alignment: Alignment.bottomCenter,
|
|
|
+ children: [
|
|
|
+ Column(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(top: 30),
|
|
|
+ child: SvgPicture.asset(
|
|
|
+ 'images/svg/支付宝.svg',
|
|
|
+ height: 40,
|
|
|
+ width: 40,
|
|
|
+ ),
|
|
|
),
|
|
|
+ Container(
|
|
|
+ child: MyViews().myText(
|
|
|
+ MyCookie()
|
|
|
+ .userBean
|
|
|
+ .aliPayAccount
|
|
|
+ .isNotEmpty &&
|
|
|
+ MyCookie().userBean.aliPayName.isEmpty
|
|
|
+ ? '未绑定账号持有人真实姓名'
|
|
|
+ : '当前绑定支付宝账号',
|
|
|
+ MyCookie()
|
|
|
+ .userBean
|
|
|
+ .aliPayAccount
|
|
|
+ .isNotEmpty &&
|
|
|
+ MyCookie().userBean.aliPayName.isEmpty
|
|
|
+ ? MyColors.cFF4233
|
|
|
+ : MyColors.c333333,
|
|
|
+ 13),
|
|
|
+ margin: EdgeInsets.only(top: 11, bottom: 11),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(22.5),
|
|
|
+ color: MyColors.cFF4233),
|
|
|
+ height: 45,
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 22),
|
|
|
+ child: MyViews().myText(
|
|
|
+ MyCookie().userBean.aliPayAccount.isEmpty
|
|
|
+ ? '暂未绑定'
|
|
|
+ : MyCookie().userBean.aliPayAccount,
|
|
|
+ Colors.white,
|
|
|
+ 20),
|
|
|
+ alignment: Alignment.center,
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ child: CustomPaint(
|
|
|
+ painter: DashedPainter(),
|
|
|
+ size: Size(double.infinity, 1),
|
|
|
),
|
|
|
- Container(
|
|
|
- child: MyViews()
|
|
|
- .myText(MyCookie().userBean.aliPayAccount.isNotEmpty&&MyCookie().userBean.aliPayName.isEmpty?'未绑定账号持有人真实姓名':'当前绑定支付宝账号', MyCookie().userBean.aliPayAccount.isNotEmpty&&MyCookie().userBean.aliPayName.isEmpty?MyColors.cFF4233:MyColors.c333333, 13),
|
|
|
- margin: EdgeInsets.only(top: 11, bottom: 11),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- borderRadius: BorderRadius.circular(22.5),
|
|
|
- color: MyColors.cFF4233),
|
|
|
- height: 45,
|
|
|
- margin: EdgeInsets.symmetric(horizontal: 22),
|
|
|
- child: MyViews().myText(
|
|
|
- MyCookie().userBean.aliPayAccount.isEmpty
|
|
|
- ? '暂未绑定'
|
|
|
- : MyCookie().userBean.aliPayAccount,
|
|
|
- Colors.white,
|
|
|
- 20),
|
|
|
- alignment: Alignment.center,
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- Container(
|
|
|
- child: CustomPaint(
|
|
|
- painter: DashedPainter(),
|
|
|
- size: Size(double.infinity, 1),
|
|
|
+ margin:
|
|
|
+ EdgeInsets.only(bottom: 38, right: 10, left: 10),
|
|
|
),
|
|
|
- margin:
|
|
|
- EdgeInsets.only(bottom: 38, right: 10, left: 10),
|
|
|
- ),
|
|
|
- Positioned(
|
|
|
- bottom: 0,
|
|
|
- child: GestureDetector(
|
|
|
- onTap: () {
|
|
|
- MyTools().toPage(context, SetAlipayPage(), (then) {
|
|
|
- setState(() {});
|
|
|
- });
|
|
|
- },
|
|
|
- behavior: HitTestBehavior.translucent,
|
|
|
- child: Container(
|
|
|
- height: 39,
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- MyViews().myText(
|
|
|
- MyCookie().userBean.aliPayAccount.isEmpty
|
|
|
- ? '去绑定'
|
|
|
- : '修改绑定账号',
|
|
|
- MyColors.c999999,
|
|
|
- 11),
|
|
|
- Container(
|
|
|
- margin: EdgeInsets.only(left: 5),
|
|
|
- child: SvgPicture.asset(
|
|
|
- 'images/svg/箭头.svg',
|
|
|
- color: MyColors.c999999,
|
|
|
- height: 8,
|
|
|
- width: 8,
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ Positioned(
|
|
|
+ bottom: 0,
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ MyTools().toPage(context, SetAlipayPage(),
|
|
|
+ (then) {
|
|
|
+ setState(() {});
|
|
|
+ });
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ height: 39,
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ MyViews().myText(
|
|
|
+ MyCookie().userBean.aliPayAccount.isEmpty
|
|
|
+ ? '去绑定'
|
|
|
+ : '修改绑定账号',
|
|
|
+ MyColors.c999999,
|
|
|
+ 11),
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(left: 5),
|
|
|
+ child: SvgPicture.asset(
|
|
|
+ 'images/svg/箭头.svg',
|
|
|
+ color: MyColors.c999999,
|
|
|
+ height: 8,
|
|
|
+ width: 8,
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ ),
|
|
|
+ alignment: Alignment.center,
|
|
|
),
|
|
|
- alignment: Alignment.center,
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- if(showWeChat) Container(
|
|
|
- height: 220,
|
|
|
- margin: EdgeInsets.fromLTRB(15, 20, 15, 50),
|
|
|
- width: double.infinity,
|
|
|
- child: ClipShadowPath(
|
|
|
- clipper: TicketClipPath2(),
|
|
|
- shadow: Shadow(blurRadius: 5, color: MyColors.c21333333),
|
|
|
- child: Scaffold(
|
|
|
- body: Stack(
|
|
|
- alignment: Alignment.bottomCenter,
|
|
|
- children: [
|
|
|
- Column(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- margin: EdgeInsets.only(top: 30),
|
|
|
- child: SvgPicture.asset(
|
|
|
- 'images/svg/微信.svg',
|
|
|
- height: 40,
|
|
|
- width: 40,
|
|
|
+ if (showWeChat)
|
|
|
+ Container(
|
|
|
+ height: 220,
|
|
|
+ margin: EdgeInsets.fromLTRB(15, 20, 15, 50),
|
|
|
+ width: double.infinity,
|
|
|
+ child: ClipShadowPath(
|
|
|
+ clipper: TicketClipPath2(),
|
|
|
+ shadow: Shadow(blurRadius: 5, color: MyColors.c21333333),
|
|
|
+ child: Scaffold(
|
|
|
+ body: Stack(
|
|
|
+ alignment: Alignment.bottomCenter,
|
|
|
+ children: [
|
|
|
+ Column(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(top: 30),
|
|
|
+ child: SvgPicture.asset(
|
|
|
+ 'images/svg/微信.svg',
|
|
|
+ height: 40,
|
|
|
+ width: 40,
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- child: MyViews()
|
|
|
- .myText('当前绑定微信账号', MyColors.c333333, 13),
|
|
|
- margin: EdgeInsets.only(top: 11, bottom: 11),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- borderRadius: BorderRadius.circular(22.5),
|
|
|
- color: MyColors.cFF4233),
|
|
|
- height: 45,
|
|
|
- margin: EdgeInsets.symmetric(horizontal: 22),
|
|
|
- child: MyCookie().userBean.wxOpenid.isEmpty
|
|
|
- ? MyViews().myText('暂未绑定', Colors.white, 20)
|
|
|
- : Row(
|
|
|
- children: [
|
|
|
- Container(
|
|
|
- margin: EdgeInsets.only(right: 10),
|
|
|
- child: ClipRRect(
|
|
|
- borderRadius:
|
|
|
- BorderRadius.circular(14),
|
|
|
- child: MyViews().netImg(
|
|
|
- MyCookie().userBean.wxPicture,
|
|
|
- 28,
|
|
|
- 28),
|
|
|
+ Container(
|
|
|
+ child: MyViews()
|
|
|
+ .myText('当前绑定微信账号', MyColors.c333333, 13),
|
|
|
+ margin: EdgeInsets.only(top: 11, bottom: 11),
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ borderRadius: BorderRadius.circular(22.5),
|
|
|
+ color: MyColors.cFF4233),
|
|
|
+ height: 45,
|
|
|
+ margin: EdgeInsets.symmetric(horizontal: 22),
|
|
|
+ child: MyCookie().userBean.wxOpenid.isEmpty
|
|
|
+ ? MyViews().myText('暂未绑定', Colors.white, 20)
|
|
|
+ : Row(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(right: 10),
|
|
|
+ child: ClipRRect(
|
|
|
+ borderRadius:
|
|
|
+ BorderRadius.circular(14),
|
|
|
+ child: MyViews().netImg(
|
|
|
+ MyCookie().userBean.wxPicture,
|
|
|
+ 28,
|
|
|
+ 28),
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- MyViews().myText(
|
|
|
- MyCookie().userBean.wxName,
|
|
|
- Colors.white,
|
|
|
- 20)
|
|
|
- ],
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- ),
|
|
|
- alignment: Alignment.center,
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- Container(
|
|
|
- child: CustomPaint(
|
|
|
- painter: DashedPainter(),
|
|
|
- size: Size(double.infinity, 1),
|
|
|
+ MyViews().myText(
|
|
|
+ MyCookie().userBean.wxName,
|
|
|
+ Colors.white,
|
|
|
+ 20)
|
|
|
+ ],
|
|
|
+ mainAxisAlignment:
|
|
|
+ MainAxisAlignment.center,
|
|
|
+ ),
|
|
|
+ alignment: Alignment.center,
|
|
|
+ )
|
|
|
+ ],
|
|
|
),
|
|
|
- margin:
|
|
|
- EdgeInsets.only(bottom: 38, right: 10, left: 10),
|
|
|
- ),
|
|
|
- Positioned(
|
|
|
- bottom: 0,
|
|
|
- child: GestureDetector(
|
|
|
- onTap: () {
|
|
|
- EventBus().on('bindToWeChat', (arg) {
|
|
|
- showToast('绑定成功');
|
|
|
- setState(() {});
|
|
|
- EventBus().off('bindToWeChat');
|
|
|
- });
|
|
|
- sendWeChatAuth(
|
|
|
- scope: "snsapi_userinfo",
|
|
|
- state: "wechat_sdk_demo_test");
|
|
|
- },
|
|
|
- behavior: HitTestBehavior.translucent,
|
|
|
- child: Container(
|
|
|
- height: 39,
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- MyViews().myText(
|
|
|
- MyCookie().userBean.wxOpenid.isEmpty
|
|
|
- ? '去绑定'
|
|
|
- : '修改绑定账号',
|
|
|
- MyColors.c999999,
|
|
|
- 11),
|
|
|
- Container(
|
|
|
- margin: EdgeInsets.only(left: 5),
|
|
|
- child: SvgPicture.asset(
|
|
|
- 'images/svg/箭头.svg',
|
|
|
- color: MyColors.c999999,
|
|
|
- height: 8,
|
|
|
- width: 8,
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ Container(
|
|
|
+ child: CustomPaint(
|
|
|
+ painter: DashedPainter(),
|
|
|
+ size: Size(double.infinity, 1),
|
|
|
+ ),
|
|
|
+ margin:
|
|
|
+ EdgeInsets.only(bottom: 38, right: 10, left: 10),
|
|
|
+ ),
|
|
|
+ Positioned(
|
|
|
+ bottom: 0,
|
|
|
+ child: GestureDetector(
|
|
|
+ onTap: () {
|
|
|
+ EventBus().on('bindToWeChat', (arg) {
|
|
|
+ showToast('绑定成功');
|
|
|
+ setState(() {});
|
|
|
+ EventBus().off('bindToWeChat');
|
|
|
+ });
|
|
|
+ sendWeChatAuth(
|
|
|
+ scope: "snsapi_userinfo",
|
|
|
+ state: "wechat_sdk_demo_test");
|
|
|
+ },
|
|
|
+ behavior: HitTestBehavior.translucent,
|
|
|
+ child: Container(
|
|
|
+ height: 39,
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ MyViews().myText(
|
|
|
+ MyCookie().userBean.wxOpenid.isEmpty
|
|
|
+ ? '去绑定'
|
|
|
+ : '修改绑定账号',
|
|
|
+ MyColors.c999999,
|
|
|
+ 11),
|
|
|
+ Container(
|
|
|
+ margin: EdgeInsets.only(left: 5),
|
|
|
+ child: SvgPicture.asset(
|
|
|
+ 'images/svg/箭头.svg',
|
|
|
+ color: MyColors.c999999,
|
|
|
+ height: 8,
|
|
|
+ width: 8,
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ ),
|
|
|
+ alignment: Alignment.center,
|
|
|
),
|
|
|
- alignment: Alignment.center,
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- )
|
|
|
+ )
|
|
|
],
|
|
|
),
|
|
|
),
|