|
@@ -1,15 +1,16 @@
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
-import '../styles/colors.dart';
|
|
|
|
|
-import '../net/HttpManager.dart';
|
|
|
|
|
-import '../net/Result.dart';
|
|
|
|
|
-import '../styles/totast.dart';
|
|
|
|
|
import 'package:flutter_redux/flutter_redux.dart';
|
|
import 'package:flutter_redux/flutter_redux.dart';
|
|
|
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
+import 'package:fluwx/fluwx.dart' as fluwx;
|
|
|
import '../redux/AppState.dart';
|
|
import '../redux/AppState.dart';
|
|
|
import '../model/ProductInfo.dart';
|
|
import '../model/ProductInfo.dart';
|
|
|
import '../widget/Dialog.dart';
|
|
import '../widget/Dialog.dart';
|
|
|
import '../redux/UserRedux.dart';
|
|
import '../redux/UserRedux.dart';
|
|
|
import '../model/UserInfo.dart';
|
|
import '../model/UserInfo.dart';
|
|
|
|
|
+import '../styles/colors.dart';
|
|
|
|
|
+import '../net/HttpManager.dart';
|
|
|
|
|
+import '../net/Result.dart';
|
|
|
|
|
+import '../styles/totast.dart';
|
|
|
import 'ChoosePay.dart';
|
|
import 'ChoosePay.dart';
|
|
|
|
|
|
|
|
class ShoppingMall extends StatefulWidget {
|
|
class ShoppingMall extends StatefulWidget {
|
|
@@ -32,7 +33,7 @@ class ShoppingMallState extends State<ShoppingMall> {
|
|
|
child: TabBar(
|
|
child: TabBar(
|
|
|
tabs: myTabs,
|
|
tabs: myTabs,
|
|
|
indicatorColor: Theme.of(context).primaryColor,
|
|
indicatorColor: Theme.of(context).primaryColor,
|
|
|
- labelColor:Theme.of(context).primaryColor,
|
|
|
|
|
|
|
+ labelColor: Theme.of(context).primaryColor,
|
|
|
unselectedLabelColor: Colors.white,
|
|
unselectedLabelColor: Colors.white,
|
|
|
indicatorSize: TabBarIndicatorSize.label,
|
|
indicatorSize: TabBarIndicatorSize.label,
|
|
|
),
|
|
),
|
|
@@ -63,12 +64,10 @@ class RechargeState extends State<Recharge> {
|
|
|
Result res = await HttpManager.get('userInfo/getUserInfo');
|
|
Result res = await HttpManager.get('userInfo/getUserInfo');
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
print(res.data);
|
|
print(res.data);
|
|
|
- StoreProvider.of<AppState>(context)
|
|
|
|
|
- .dispatch(UpdateUserAction(UserInfo.fromJson(res.data)));
|
|
|
|
|
|
|
+ StoreProvider.of<AppState>(context).dispatch(UpdateUserAction(UserInfo.fromJson(res.data)));
|
|
|
} else {}
|
|
} else {}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
List moneyList = [100, 300, 500, 1000, 2000, 5000];
|
|
List moneyList = [100, 300, 500, 1000, 2000, 5000];
|
|
|
List vipList = [
|
|
List vipList = [
|
|
|
{'name': 'VIP1', 'value': 100},
|
|
{'name': 'VIP1', 'value': 100},
|
|
@@ -84,8 +83,7 @@ class RechargeState extends State<Recharge> {
|
|
|
|
|
|
|
|
Future<void> getInfoList() async {
|
|
Future<void> getInfoList() async {
|
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
|
- final Result res = await HttpManager.get('productInfo/all',
|
|
|
|
|
- data: {'typeFlag': widget.type});
|
|
|
|
|
|
|
+ final Result res = await HttpManager.get('productInfo/all', data: {'typeFlag': widget.type});
|
|
|
Toast.hide();
|
|
Toast.hide();
|
|
|
if (res.success) {
|
|
if (res.success) {
|
|
|
for (var item in res.data) {
|
|
for (var item in res.data) {
|
|
@@ -115,6 +113,7 @@ class RechargeState extends State<Recharge> {
|
|
|
@override
|
|
@override
|
|
|
void initState() {
|
|
void initState() {
|
|
|
super.initState();
|
|
super.initState();
|
|
|
|
|
+ fluwx.register(appId: "wx62f8a9c1d3d70245");
|
|
|
getInfoList();
|
|
getInfoList();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -135,20 +134,18 @@ class RechargeState extends State<Recharge> {
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
Expanded(
|
|
Expanded(
|
|
|
flex: 1,
|
|
flex: 1,
|
|
|
- child: ShoopingBtn('images/icon_haoli.png', '更多好礼',
|
|
|
|
|
- onTapHomeMenu: () {
|
|
|
|
|
- showDialog(2);
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+ child: ShoopingBtn('images/icon_haoli.png', '更多好礼', onTapHomeMenu: () {
|
|
|
|
|
+ showDialog(2);
|
|
|
|
|
+ }),
|
|
|
),
|
|
),
|
|
|
Container(
|
|
Container(
|
|
|
width: 15,
|
|
width: 15,
|
|
|
),
|
|
),
|
|
|
Expanded(
|
|
Expanded(
|
|
|
flex: 1,
|
|
flex: 1,
|
|
|
- child: ShoopingBtn('images/icon_shangwu.png', '商务合作',
|
|
|
|
|
- onTapHomeMenu: () {
|
|
|
|
|
- showDialog(3);
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+ child: ShoopingBtn('images/icon_shangwu.png', '商务合作', onTapHomeMenu: () {
|
|
|
|
|
+ showDialog(3);
|
|
|
|
|
+ }),
|
|
|
),
|
|
),
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
@@ -165,9 +162,7 @@ class RechargeState extends State<Recharge> {
|
|
|
child: FlatButton(
|
|
child: FlatButton(
|
|
|
color: Color(0xFF222335),
|
|
color: Color(0xFF222335),
|
|
|
padding: EdgeInsets.all(0),
|
|
padding: EdgeInsets.all(0),
|
|
|
- shape: Border.all(
|
|
|
|
|
- color: isChoose ? Theme.of(context).primaryColor : Colors.transparent,
|
|
|
|
|
- width: 1),
|
|
|
|
|
|
|
+ shape: Border.all(color: isChoose ? Theme.of(context).primaryColor : Colors.transparent, width: 1),
|
|
|
disabledColor: Color(0xFF222335),
|
|
disabledColor: Color(0xFF222335),
|
|
|
child: Container(
|
|
child: Container(
|
|
|
child: Stack(
|
|
child: Stack(
|
|
@@ -177,20 +172,13 @@ class RechargeState extends State<Recharge> {
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
Text(productInfoList[index - 1].productName,
|
|
Text(productInfoList[index - 1].productName,
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: Color(0xFFFFFFFF),
|
|
|
|
|
- fontWeight: FontWeight.w500,
|
|
|
|
|
- fontSize: 15)),
|
|
|
|
|
|
|
+ style: TextStyle(color: Color(0xFFFFFFFF), fontWeight: FontWeight.w500, fontSize: 15)),
|
|
|
Container(
|
|
Container(
|
|
|
width: 10,
|
|
width: 10,
|
|
|
),
|
|
),
|
|
|
Text(
|
|
Text(
|
|
|
- '¥' +
|
|
|
|
|
- productInfoList[index - 1].money.toString(),
|
|
|
|
|
- style: TextStyle(
|
|
|
|
|
- color: Color(0xFF727785),
|
|
|
|
|
- fontWeight: FontWeight.w400,
|
|
|
|
|
- fontSize: 14),
|
|
|
|
|
|
|
+ '¥' + productInfoList[index - 1].money.toString(),
|
|
|
|
|
+ style: TextStyle(color: Color(0xFF727785), fontWeight: FontWeight.w400, fontSize: 14),
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
@@ -198,9 +186,7 @@ class RechargeState extends State<Recharge> {
|
|
|
Positioned(
|
|
Positioned(
|
|
|
right: 0,
|
|
right: 0,
|
|
|
bottom: 0,
|
|
bottom: 0,
|
|
|
- child: isChoose
|
|
|
|
|
- ? Image.asset('images/icon_xuanzhong.png')
|
|
|
|
|
- : Container(),
|
|
|
|
|
|
|
+ child: isChoose ? Image.asset('images/icon_xuanzhong.png') : Container(),
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
@@ -225,7 +211,8 @@ class RechargeState extends State<Recharge> {
|
|
|
textColor: Colors.white,
|
|
textColor: Colors.white,
|
|
|
child: Text('立即充值'),
|
|
child: Text('立即充值'),
|
|
|
onPressed: () async {
|
|
onPressed: () async {
|
|
|
- Navigator.push(context, CupertinoPageRoute(builder: (context) => ChoosePay(widget.type,chooseProduct)));
|
|
|
|
|
|
|
+ fluwx.launchMiniProgram(username: "gh_a6a98cd9b3cd");
|
|
|
|
|
+ // Navigator.push(context, CupertinoPageRoute(builder: (context) => ChoosePay(widget.type, chooseProduct)));
|
|
|
// Toast.show(context, '加载中', -1, 'loading');
|
|
// Toast.show(context, '加载中', -1, 'loading');
|
|
|
// final Result res = await HttpManager.post('productInfo/buy', data: {
|
|
// final Result res = await HttpManager.post('productInfo/buy', data: {
|
|
|
// 'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
|
|
// 'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
|
|
@@ -264,11 +251,7 @@ class ShoopingBtn extends StatelessWidget {
|
|
|
return Container(
|
|
return Container(
|
|
|
height: 70,
|
|
height: 70,
|
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
|
|
- begin: Alignment.topCenter,
|
|
|
|
|
- end: Alignment.bottomCenter,
|
|
|
|
|
- stops: [0.0, 0.5],
|
|
|
|
|
- colors: [Color(0xFF464B6A), Color(0xFF35395E)])),
|
|
|
|
|
|
|
+ gradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, stops: [0.0, 0.5], colors: [Color(0xFF464B6A), Color(0xFF35395E)])),
|
|
|
child: Material(
|
|
child: Material(
|
|
|
color: Colors.transparent,
|
|
color: Colors.transparent,
|
|
|
child: InkWell(
|
|
child: InkWell(
|