同步数据
This commit is contained in:
170
lib/ad/ad.dart
170
lib/ad/ad.dart
@@ -1,170 +0,0 @@
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
typedef AdCallback = void Function(String id);
|
||||
typedef AdErrorCallback = void Function(String id, int code, String message);
|
||||
|
||||
/// API for showing various types of advertisements
|
||||
class AdSdk {
|
||||
static int _channelId = 0;
|
||||
static MethodChannel _methodChannel =
|
||||
new MethodChannel("flutter_adsjm_plugin/method");
|
||||
|
||||
/// set user id on login and logout
|
||||
// static void setUserId(String userId) {
|
||||
// _methodChannel.invokeMethod("setUserId", {"userId": userId});
|
||||
// }
|
||||
|
||||
/// show reward video ad
|
||||
static void showRewardVideoAd(String adId,
|
||||
{AdCallback onSjmAdTradeId,
|
||||
AdCallback onSjmAdLoaded,
|
||||
AdCallback onSjmAdShow,
|
||||
AdCallback onSjmAdReward,
|
||||
AdCallback onSjmAdClick,
|
||||
AdCallback onSjmAdVideoComplete,
|
||||
AdCallback onSjmAdClose,
|
||||
AdErrorCallback onSjmAdError}) {
|
||||
EventChannel eventChannel =
|
||||
EventChannel("flutter_adsjm_plugin/event_rewardVideo");
|
||||
eventChannel.receiveBroadcastStream().listen((event) {
|
||||
switch (event["event"]) {
|
||||
case "onSjmAdTradeId":
|
||||
onSjmAdTradeId?.call(event["id"]);
|
||||
break;
|
||||
case "onSjmAdLoaded":
|
||||
onSjmAdLoaded?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdShow":
|
||||
onSjmAdShow?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdReward":
|
||||
onSjmAdReward?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdClick":
|
||||
onSjmAdClick?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdVideoComplete":
|
||||
onSjmAdVideoComplete?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdClose":
|
||||
onSjmAdClose?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdError":
|
||||
onSjmAdError?.call(event["id"], event["code"], event["message"]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
_methodChannel.invokeMethod(
|
||||
"showRewardVideoAd", {"_channelId": "rewardVideo", "adId": adId});
|
||||
}
|
||||
|
||||
/// show interstitial ad
|
||||
static void loadInterstitalAd(String adId,
|
||||
{AdCallback onSjmAdLoaded,
|
||||
AdCallback onSjmAdShow,
|
||||
AdCallback onSjmAdClicked,
|
||||
AdCallback onSjmAdClosed,
|
||||
AdErrorCallback onSjmAdError}) {
|
||||
EventChannel eventChannel =
|
||||
EventChannel("flutter_adsjm_plugin/event_interstital");
|
||||
eventChannel.receiveBroadcastStream().listen((event) {
|
||||
switch (event["event"]) {
|
||||
case "onSjmAdLoaded":
|
||||
onSjmAdLoaded?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdShow":
|
||||
onSjmAdShow?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdClicked":
|
||||
onSjmAdClicked?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdClosed":
|
||||
onSjmAdClosed?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdError":
|
||||
onSjmAdError?.call(event["id"], event["code"], event["message"]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
_methodChannel.invokeMethod(
|
||||
"loadInterstitalAd", {"_channelId": "interstital", "adId": adId});
|
||||
}
|
||||
|
||||
static void loadH5contentAd(
|
||||
String adId, String userId, String username, String userhead,
|
||||
{AdCallback onIntegralNotEnough,
|
||||
AdCallback onIntegralExpend,
|
||||
AdCallback onFinishTasks,
|
||||
AdCallback onGameExit,
|
||||
AdCallback onSjmAdRewardFinish,
|
||||
AdCallback onSjmAdReward,
|
||||
AdCallback onSjmAdLoaded,
|
||||
AdCallback onSjmAdTradeId,
|
||||
AdCallback onSjmAdClick,
|
||||
AdCallback onSjmUserBehavior,
|
||||
AdErrorCallback onSjmAdError}) {
|
||||
EventChannel eventChannel =
|
||||
EventChannel("flutter_adsjm_plugin/event_h5content");
|
||||
eventChannel.receiveBroadcastStream().listen((event) {
|
||||
switch (event["event"]) {
|
||||
case "onIntegralNotEnough":
|
||||
onIntegralNotEnough?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onIntegralExpend":
|
||||
onIntegralExpend?.call(event["id"]);
|
||||
break;
|
||||
case "onFinishTasks":
|
||||
onFinishTasks?.call(event["id"]);
|
||||
break;
|
||||
case "onGameExit":
|
||||
onGameExit?.call(event["id"]);
|
||||
break;
|
||||
case "onSjmAdRewardFinish":
|
||||
onSjmAdRewardFinish?.call(event["id"]);
|
||||
break;
|
||||
case "onSjmAdClick":
|
||||
onSjmAdClick?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdReward":
|
||||
onSjmAdReward?.call(event["id"]);
|
||||
break;
|
||||
case "onSjmAdLoaded":
|
||||
onSjmAdLoaded?.call(event["id"]);
|
||||
break;
|
||||
case "onSjmAdTradeId":
|
||||
onSjmAdTradeId?.call(event["id"]);
|
||||
break;
|
||||
case "onSjmUserBehavior":
|
||||
onSjmUserBehavior?.call(event["id"]);
|
||||
break;
|
||||
case "onSjmAdError":
|
||||
onSjmAdError?.call(event["id"], event["code"], event["message"]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
_methodChannel.invokeMethod("loadH5contentAd", {
|
||||
"_channelId": "h5content",
|
||||
"adId": adId,
|
||||
"userId": userId,
|
||||
"username": username,
|
||||
"userhead": userhead
|
||||
});
|
||||
}
|
||||
|
||||
static void loadVideocontentAd(String adId) {
|
||||
_methodChannel.invokeMethod(
|
||||
"loadVideocontentAd", {"_channelId": "videocontent", "adId": adId});
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'ad.dart';
|
||||
|
||||
/// Widget for banner ad
|
||||
class BannerAdView extends StatelessWidget {
|
||||
final String adId;
|
||||
final double width;
|
||||
final double height;
|
||||
final AdCallback onSjmAdLoaded;
|
||||
final AdCallback onSjmAdShow;
|
||||
final AdCallback onSjmAdClicked;
|
||||
final AdCallback onSjmAdClosed;
|
||||
final AdErrorCallback onSjmAdError;
|
||||
|
||||
BannerAdView(
|
||||
{Key key,
|
||||
this.adId,
|
||||
this.width,
|
||||
this.height,
|
||||
this.onSjmAdLoaded,
|
||||
this.onSjmAdShow,
|
||||
this.onSjmAdClicked,
|
||||
this.onSjmAdClosed,
|
||||
this.onSjmAdError})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget banner;
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
banner = AndroidView(
|
||||
viewType: 'flutter_adsjm_plugin/banner',
|
||||
creationParams: {
|
||||
"adId": adId,
|
||||
"width": width,
|
||||
"height": height,
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
onPlatformViewCreated: _onPlatformViewCreated,
|
||||
);
|
||||
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
|
||||
banner = UiKitView(
|
||||
viewType: 'flutter_adsjm_plugin/banner',
|
||||
creationParams: {
|
||||
"adId": adId,
|
||||
"width": width,
|
||||
"height": height,
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
onPlatformViewCreated: _onPlatformViewCreated,
|
||||
);
|
||||
} else {
|
||||
banner = Text("Not supported");
|
||||
}
|
||||
|
||||
return Container(
|
||||
width: width,
|
||||
height: height,
|
||||
child: banner,
|
||||
);
|
||||
}
|
||||
|
||||
void _onPlatformViewCreated(int id) {
|
||||
EventChannel eventChannel = EventChannel("flutter_adsjm_plugin/banner_event_$id");
|
||||
eventChannel.receiveBroadcastStream().listen((event) {
|
||||
switch (event["event"]) {
|
||||
case "onSjmAdLoaded":
|
||||
onSjmAdLoaded?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdShow":
|
||||
onSjmAdShow?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdClicked":
|
||||
onSjmAdClicked?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdClosed":
|
||||
onSjmAdClosed?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdError":
|
||||
onSjmAdError?.call(event["id"], event["code"], event["message"]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'ad.dart';
|
||||
|
||||
/// Widget for banner ad
|
||||
class NativeExpressAdView extends StatelessWidget {
|
||||
final String adId;
|
||||
final double width;
|
||||
final double height;
|
||||
final AdCallback onSjmAdLoaded;
|
||||
final AdCallback onSjmAdShow;
|
||||
final AdCallback onSjmAdClicked;
|
||||
final AdCallback onSjmAdClosed;
|
||||
final AdErrorCallback onSjmAdError;
|
||||
|
||||
NativeExpressAdView(
|
||||
{Key key,
|
||||
this.adId,
|
||||
this.width,
|
||||
this.height,
|
||||
this.onSjmAdLoaded,
|
||||
this.onSjmAdShow,
|
||||
this.onSjmAdClicked,
|
||||
this.onSjmAdClosed,
|
||||
this.onSjmAdError})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget banner;
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
banner = AndroidView(
|
||||
viewType: 'flutter_adsjm_plugin/native_express',
|
||||
creationParams: {
|
||||
"adId": adId,
|
||||
"width": width,
|
||||
"height": height,
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
onPlatformViewCreated: _onPlatformViewCreated,
|
||||
);
|
||||
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
|
||||
banner = UiKitView(
|
||||
viewType: 'flutter_adsjm_plugin/native_express',
|
||||
creationParams: {
|
||||
"adId": adId,
|
||||
"width": width,
|
||||
"height": height,
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
onPlatformViewCreated: _onPlatformViewCreated,
|
||||
);
|
||||
} else {
|
||||
banner = Text("Not supported");
|
||||
}
|
||||
|
||||
return Container(
|
||||
width: width,
|
||||
height: height,
|
||||
child: banner,
|
||||
);
|
||||
}
|
||||
|
||||
void _onPlatformViewCreated(int id) {
|
||||
EventChannel eventChannel = EventChannel("flutter_adsjm_plugin/native_express_event_$id");
|
||||
eventChannel.receiveBroadcastStream().listen((event) {
|
||||
switch (event["event"]) {
|
||||
case "onSjmAdLoaded":
|
||||
onSjmAdLoaded?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdShow":
|
||||
onSjmAdShow?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdClicked":
|
||||
onSjmAdClicked?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdClosed":
|
||||
onSjmAdClosed?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdError":
|
||||
onSjmAdError?.call(event["id"], event["code"], event["message"]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import 'ad.dart';
|
||||
|
||||
/// Widget for splash ad
|
||||
class SplashAdView extends StatelessWidget {
|
||||
final String adId;
|
||||
final double width;
|
||||
final double height;
|
||||
final AdCallback onSjmAdLoaded;
|
||||
final AdCallback onSjmAdShow;
|
||||
final AdCallback onSjmAdClicked;
|
||||
final AdCallback onSjmAdClosed;
|
||||
final AdErrorCallback onSjmAdError;
|
||||
|
||||
SplashAdView(
|
||||
{Key key,
|
||||
this.adId,
|
||||
this.width,
|
||||
this.height,
|
||||
this.onSjmAdLoaded,
|
||||
this.onSjmAdShow,
|
||||
this.onSjmAdClicked,
|
||||
this.onSjmAdClosed,
|
||||
this.onSjmAdError})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget splash;
|
||||
if (defaultTargetPlatform == TargetPlatform.android) {
|
||||
splash = AndroidView(
|
||||
viewType: 'flutter_adsjm_plugin/splash',
|
||||
creationParams: {
|
||||
"adId": adId,
|
||||
"width": width,
|
||||
"height": height,
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
onPlatformViewCreated: _onPlatformViewCreated,
|
||||
);
|
||||
} else if (defaultTargetPlatform == TargetPlatform.iOS) {
|
||||
splash = UiKitView(
|
||||
viewType: 'flutter_adsjm_plugin/splash',
|
||||
creationParams: {
|
||||
"adId": adId,
|
||||
"width": width,
|
||||
"height": height,
|
||||
},
|
||||
creationParamsCodec: const StandardMessageCodec(),
|
||||
onPlatformViewCreated: _onPlatformViewCreated,
|
||||
);
|
||||
} else {
|
||||
splash = Text("Not supported");
|
||||
}
|
||||
|
||||
return Container(
|
||||
width: width,
|
||||
height: height,
|
||||
child: splash,
|
||||
);
|
||||
}
|
||||
|
||||
void _onPlatformViewCreated(int id) {
|
||||
EventChannel eventChannel =
|
||||
EventChannel("flutter_adsjm_plugin/splash_event_$id");
|
||||
eventChannel.receiveBroadcastStream().listen((event) {
|
||||
switch (event["event"]) {
|
||||
case "onSjmAdLoaded":
|
||||
onSjmAdLoaded?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdShow":
|
||||
onSjmAdShow?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdClicked":
|
||||
onSjmAdClicked?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdClosed":
|
||||
onSjmAdClosed?.call(event["id"]);
|
||||
break;
|
||||
|
||||
case "onSjmAdError":
|
||||
onSjmAdError?.call(event["id"], event["code"], event["message"]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'config.dart';
|
||||
|
||||
class HttpApi {
|
||||
static HttpApi? instance;
|
||||
|
||||
HttpApi() {
|
||||
print('回家啊哈哈');
|
||||
// print('回家啊哈哈');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
/*
|
||||
* @Author: Aimee~
|
||||
* @Date: 2022-05-26 13:16:03
|
||||
* @LastEditTime: 2022-05-31 09:47:51
|
||||
* @LastEditors: Aimee
|
||||
* @Description:
|
||||
* @FilePath: /gl_dao/lib/main.dart
|
||||
*/
|
||||
import 'package:flutter/material.dart';
|
||||
import 'pages/tabs/tabs.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
// import 'pages/auth/auth.dart';
|
||||
void main() {
|
||||
@@ -12,7 +21,7 @@ class MyApp extends StatelessWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
return GetMaterialApp(
|
||||
theme: ThemeData(
|
||||
brightness: Brightness.light,
|
||||
),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* @Author: zhangdongxue zhangdongxue@uz.cn
|
||||
* @Date: 2022-05-26 13:16:03
|
||||
* @LastEditors: zhangdongxue zhangdongxue@uz.cn
|
||||
* @LastEditTime: 2022-05-30 16:21:27
|
||||
* @LastEditors: Aimee
|
||||
* @LastEditTime: 2022-06-01 14:34:57
|
||||
* @FilePath: /gl_dao/lib/main_color.dart
|
||||
* @Description: 封装色值
|
||||
*/
|
||||
@@ -14,6 +14,11 @@ const tMainColor = Color(0xfffdbb03);
|
||||
const tMainRedColor = Color(0xffc70909);
|
||||
|
||||
const tMainBg = Color(0xfff9f9f9);
|
||||
const tVipBg = Color(0xff23232f);
|
||||
const tVip1 = Color(0xff303145);
|
||||
const tVip2 = Color(0xff44495e);
|
||||
const tVip3 = Color(0xffe9b87a);
|
||||
const tVip4 = Color(0xfff8d9ad);
|
||||
|
||||
const tTextColor = Color(0xff333333);
|
||||
const tTextColor333 = Color(0xff333333);
|
||||
|
||||
184
lib/pages/address/adds_add/adds_add_page.dart
Normal file
184
lib/pages/address/adds_add/adds_add_page.dart
Normal file
@@ -0,0 +1,184 @@
|
||||
/*
|
||||
* @Author: Aimee~
|
||||
* @Date: 2022-06-01 11:11:40
|
||||
* @LastEditTime: 2022-06-02 17:51:22
|
||||
* @LastEditors: Aimee
|
||||
* @FilePath: /gl_dao/lib/pages/address/adds_add/adds_add_page.dart
|
||||
* @Description: 新增地址
|
||||
*/
|
||||
// import 'package:address_picker/address_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_pickers/address_picker/locations_data.dart';
|
||||
import 'package:flutter_pickers/pickers.dart';
|
||||
import '../../../main_color.dart';
|
||||
|
||||
class AddressAddPage extends StatefulWidget {
|
||||
const AddressAddPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AddressAddPage> createState() => _AddressAddPageState();
|
||||
}
|
||||
|
||||
class _AddressAddPageState extends State<AddressAddPage> {
|
||||
String initProvince = '', initCity = '', initTown = '';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: appBar(),
|
||||
body: Container(
|
||||
padding: const EdgeInsets.fromLTRB(16, 30, 16, 30),
|
||||
child: ListView(
|
||||
children: [
|
||||
const TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "收货人姓名",
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
icon: Text(
|
||||
'收 货 人:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
const TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "收货人联系电话",
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
icon: Text(
|
||||
'联系电话:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
GestureDetector(
|
||||
onTap: _chooseArea,
|
||||
child: TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: initProvince.isEmpty
|
||||
? "请选择省市区"
|
||||
: "$initProvince - $initCity - $initTown",
|
||||
border: const OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
enabled: false,
|
||||
focusedBorder: const OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
icon: const Text(
|
||||
'省 市 区:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
const TextField(
|
||||
maxLength: 120,
|
||||
maxLines: 3,
|
||||
decoration: InputDecoration(
|
||||
hintText: "请输入详细地址",
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
icon: Text(
|
||||
'详细地址:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _chooseArea() async {
|
||||
Pickers.showAddressPicker(
|
||||
context,
|
||||
initProvince: initProvince,
|
||||
initCity: initCity,
|
||||
initTown: initTown,
|
||||
onConfirm: (p, c, t) {
|
||||
setState(() {
|
||||
initProvince = p;
|
||||
initCity = c;
|
||||
initTown = t!;
|
||||
});
|
||||
|
||||
/// 根据城市名 查询城市code(有先后顺序)
|
||||
print(
|
||||
Address.getCityCodeByName(
|
||||
provinceName: p,
|
||||
cityName: c,
|
||||
townName: t,
|
||||
),
|
||||
);
|
||||
|
||||
/// 根据城市code 查询城市名称
|
||||
print(
|
||||
Address.getCityNameByCode(
|
||||
provinceCode: "510000",
|
||||
cityCode: "510100",
|
||||
townCode: "510104",
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义顶部导航
|
||||
PreferredSizeWidget appBar() {
|
||||
return AppBar(
|
||||
backgroundColor: tMainRedColor,
|
||||
title: const Text(
|
||||
'新增收货地址',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {},
|
||||
child: const Text(
|
||||
'保存',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
140
lib/pages/address/adds_edit/adds_edit_page.dart
Normal file
140
lib/pages/address/adds_edit/adds_edit_page.dart
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* @Author: Aimee~
|
||||
* @Date: 2022-06-01 11:12:08
|
||||
* @LastEditTime: 2022-06-02 15:31:38
|
||||
* @LastEditors: Aimee
|
||||
* @FilePath: /gl_dao/lib/pages/address/adds_edit/adds_edit_page.dart
|
||||
* @Description: 编辑地址
|
||||
*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../main_color.dart';
|
||||
|
||||
class AddressEditPage extends StatefulWidget {
|
||||
const AddressEditPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AddressEditPage> createState() => _AddressEditPageState();
|
||||
}
|
||||
|
||||
class _AddressEditPageState extends State<AddressEditPage> {
|
||||
int sex = 1; //年龄 1男2女
|
||||
bool placeTop = true; // 是否置顶
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: appBar(),
|
||||
body: Container(
|
||||
padding: const EdgeInsets.fromLTRB(16, 30, 16, 30),
|
||||
child: ListView(
|
||||
children: [
|
||||
const TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "收货人姓名",
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
icon: Text(
|
||||
'收 货 人:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
const TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "收货人联系电话",
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
icon: Text(
|
||||
'联系电话:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
const TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "请选择省市区",
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
icon: Text(
|
||||
'省 市 区:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
const TextField(
|
||||
decoration: InputDecoration(
|
||||
hintText: "请输入详细地址",
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
icon: Text(
|
||||
'详细地址:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const Divider(),
|
||||
const SizedBox(height: 30),
|
||||
SizedBox(
|
||||
width: 400,
|
||||
height: 56,
|
||||
child: ElevatedButton(
|
||||
style: ButtonStyle(
|
||||
backgroundColor: MaterialStateProperty.all(tMainRedColor)),
|
||||
onPressed: () {},
|
||||
child: const Text(
|
||||
'确认修改',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义顶部导航
|
||||
PreferredSizeWidget appBar() {
|
||||
return AppBar(
|
||||
backgroundColor: tMainRedColor,
|
||||
title: const Text(
|
||||
'修改收货地址',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
157
lib/pages/address/adds_list/adds_list_page.dart
Normal file
157
lib/pages/address/adds_list/adds_list_page.dart
Normal file
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* @Author: Aimee~
|
||||
* @Date: 2022-06-01 11:10:43
|
||||
* @LastEditTime: 2022-06-02 17:23:56
|
||||
* @LastEditors: Aimee
|
||||
* @FilePath: /gl_dao/lib/pages/address/adds_list/adds_list_page.dart
|
||||
* @Description: 地址管理列表
|
||||
*/
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../main_color.dart';
|
||||
import '../../vip/vip.dart';
|
||||
import '../adds_add/adds_add_page.dart';
|
||||
import '../adds_edit/adds_edit_page.dart';
|
||||
|
||||
class AddressListPage extends StatefulWidget {
|
||||
const AddressListPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AddressListPage> createState() => _AddressListPageState();
|
||||
}
|
||||
|
||||
class _AddressListPageState extends State<AddressListPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: appBar(),
|
||||
body: const SlidableAutoCloseBehavior(
|
||||
child: ChooseAddressContainer(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义顶部导航
|
||||
PreferredSizeWidget appBar() {
|
||||
return AppBar(
|
||||
backgroundColor: tMainRedColor,
|
||||
title: const Text(
|
||||
'地址管理',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.add,
|
||||
size: 30,
|
||||
),
|
||||
tooltip: '新增地址',
|
||||
onPressed: () {
|
||||
Get.to(const AddressAddPage());
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ChooseAddressContainer extends StatelessWidget {
|
||||
const ChooseAddressContainer({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final List addAressList = [1, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2];
|
||||
return Container(
|
||||
color: const Color(0xFFF7F7F7),
|
||||
margin: const EdgeInsets.only(top: 10),
|
||||
child: ListView.builder(
|
||||
itemCount: addAressList.length,
|
||||
itemBuilder: (context, index) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
// MyNavigator.pop(data: addAressList[index]);
|
||||
Get.back();
|
||||
},
|
||||
child: _buildItem(context));
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
/// 每一项
|
||||
Widget _buildItem(BuildContext context) {
|
||||
TextStyle nameText = const TextStyle(
|
||||
color: Color(0xFF121212),
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
);
|
||||
TextStyle addressText = const TextStyle(
|
||||
color: tTextColor666,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w400,
|
||||
);
|
||||
return Slidable(
|
||||
endActionPane: ActionPane(
|
||||
motion: const ScrollMotion(),
|
||||
extentRatio: 0.5,
|
||||
children: [
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context) {
|
||||
// controller.removeGoods(item);
|
||||
Get.to(const VipPages());
|
||||
},
|
||||
backgroundColor: Colors.red,
|
||||
foregroundColor: Colors.white,
|
||||
icon: Icons.delete_outline,
|
||||
label: '删除',
|
||||
),
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context) {
|
||||
Get.to(const AddressEditPage());
|
||||
},
|
||||
backgroundColor: Colors.blue,
|
||||
foregroundColor: Colors.white,
|
||||
icon: Icons.edit,
|
||||
label: '编辑',
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding:
|
||||
const EdgeInsets.only(top: 10, bottom: 15, left: 15, right: 15),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Text('张晓峰', style: nameText),
|
||||
const SizedBox(width: 10),
|
||||
Text('18888888888', style: nameText),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
width: MediaQuery.of(context).size.width - 30,
|
||||
child: Text(
|
||||
'重庆 重庆市 渝北区 新天地中心21-6号地重庆 重庆市 渝北区地址重庆 重庆市',
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: addressText,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// MyDivider()
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,14 @@
|
||||
/*
|
||||
* @Author: Aimee~
|
||||
* @Date: 2022-05-26 13:16:03
|
||||
* @LastEditTime: 2022-05-31 13:59:17
|
||||
* @LastEditors: Aimee
|
||||
* @FilePath: /gl_dao/lib/pages/auth/role.dart
|
||||
* @Description:
|
||||
*/
|
||||
import 'package:flutter/material.dart';
|
||||
import '../store/store.dart';
|
||||
|
||||
import '../store/index/index_page.dart';
|
||||
|
||||
class RolePages extends StatefulWidget {
|
||||
const RolePages({Key? key}) : super(key: key);
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BuyPages extends StatefulWidget {
|
||||
const BuyPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<BuyPages> createState() => _BuyPagesState();
|
||||
}
|
||||
|
||||
class _BuyPagesState extends State<BuyPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('下单购买');
|
||||
}
|
||||
}
|
||||
430
lib/pages/store/buy/buy.dart
Normal file
430
lib/pages/store/buy/buy.dart
Normal file
@@ -0,0 +1,430 @@
|
||||
/*
|
||||
* @Author: Aimee~
|
||||
* @Date: 2022-05-26 13:16:03
|
||||
* @LastEditTime: 2022-06-01 13:01:25
|
||||
* @LastEditors: Aimee
|
||||
* @FilePath: /gl_dao/lib/pages/store/buy/buy.dart
|
||||
* @Description: 订单确认页面
|
||||
*/
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../main_color.dart';
|
||||
import '../../address/adds_list/adds_list_page.dart';
|
||||
|
||||
class BuyPages extends StatefulWidget {
|
||||
const BuyPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<BuyPages> createState() => _BuyPagesState();
|
||||
}
|
||||
|
||||
class _BuyPagesState extends State<BuyPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: appBar(),
|
||||
body: Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 60),
|
||||
child: ListView(
|
||||
children: [
|
||||
// 地址
|
||||
selectAddress(),
|
||||
// 分割线 - 供应商购买信息
|
||||
Container(
|
||||
height: 16,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
color: tMainBg,
|
||||
),
|
||||
purchaseInfo(),
|
||||
Container(
|
||||
height: 16,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
color: tMainBg,
|
||||
),
|
||||
purchaseInfo(),
|
||||
],
|
||||
),
|
||||
),
|
||||
buttomButton(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义底部提交按钮
|
||||
Widget buttomButton() {
|
||||
return Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
color: Colors.white,
|
||||
child: SafeArea(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(left: 20),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
),
|
||||
),
|
||||
),
|
||||
width: double.infinity,
|
||||
height: 59,
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
const Text(
|
||||
'1999',
|
||||
style: TextStyle(
|
||||
fontSize: 26,
|
||||
color: tMainRedColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: const Text(
|
||||
' DT积分',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: tMainRedColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(top: 1),
|
||||
padding: const EdgeInsets.fromLTRB(26, 10, 26, 10),
|
||||
height: 60,
|
||||
alignment: Alignment.center,
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [tMainRedColor, tMainRedColor],
|
||||
),
|
||||
),
|
||||
child: const Text(
|
||||
'提交订单',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义购买信息
|
||||
Widget purchaseInfo() {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width - 32,
|
||||
margin: const EdgeInsets.only(
|
||||
top: 16,
|
||||
left: 16,
|
||||
right: 16,
|
||||
bottom: 0,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
height: 16,
|
||||
width: 4,
|
||||
color: tMainRedColor.withOpacity(0.5),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
const Text(
|
||||
'供应商名称',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: tTextColor333,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 84,
|
||||
margin: const EdgeInsets.only(top: 10),
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: const BoxDecoration(
|
||||
color: tMainBg,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(2),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
for (var i = 0; i < 10; i++)
|
||||
if (i < 4)
|
||||
Container(
|
||||
margin: const EdgeInsets.only(right: 10),
|
||||
decoration: const BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
offset: Offset(0.0, 2.0), //阴影xy轴偏移量
|
||||
blurRadius: 2.0, //阴影模糊程度
|
||||
spreadRadius: 2.0 //阴影扩散程度
|
||||
)
|
||||
],
|
||||
),
|
||||
child: AspectRatio(
|
||||
aspectRatio: 1.0 / 1.0, // 宽高比
|
||||
child: ClipRRect(
|
||||
child: Image.network(
|
||||
'https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(left: 4),
|
||||
child: Column(
|
||||
children: const [
|
||||
Text(
|
||||
'...',
|
||||
style: TextStyle(
|
||||
color: tMainRedColor,
|
||||
fontSize: 28,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 6),
|
||||
Text(
|
||||
'共4件',
|
||||
style: TextStyle(
|
||||
color: tTextColor333,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 16.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: const [
|
||||
Text(
|
||||
'支付方式:',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: tTextColor666,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
Text(
|
||||
'DT积分',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: tTextColor333,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: const [
|
||||
Text(
|
||||
'总价:',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: tTextColor666,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 4),
|
||||
Text(
|
||||
'1500',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: tMainRedColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 16,
|
||||
bottom: 16,
|
||||
),
|
||||
child: TextField(
|
||||
cursorColor: Colors.black,
|
||||
maxLength: 150, // 文字最长
|
||||
maxLines: 3, // 最多显示三行
|
||||
decoration: InputDecoration(
|
||||
hintText: "请输入备注信息", // 提示语的表单
|
||||
hintStyle: const TextStyle(
|
||||
fontSize: 14,
|
||||
),
|
||||
filled: true,
|
||||
fillColor: tMainBg,
|
||||
border: const OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(4.0),
|
||||
),
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.grey.withOpacity(0.3),
|
||||
width: 1,
|
||||
style: BorderStyle.solid,
|
||||
),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(
|
||||
color: Colors.grey.withOpacity(0.3),
|
||||
width: 1,
|
||||
style: BorderStyle.solid,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义地址组件
|
||||
Widget selectAddress() {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width - 32,
|
||||
margin: const EdgeInsets.only(
|
||||
top: 16,
|
||||
left: 16,
|
||||
right: 16,
|
||||
bottom: 10,
|
||||
),
|
||||
padding: const EdgeInsets.only(top: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: const [
|
||||
Text(
|
||||
'张三丰',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: tTextColor333,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
Text(
|
||||
'18823456789',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: tTextColor333,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10),
|
||||
Icon(
|
||||
Icons.edit_location_alt_outlined,
|
||||
color: tMainRedColor,
|
||||
size: 17,
|
||||
)
|
||||
],
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 12,
|
||||
bottom: 8,
|
||||
),
|
||||
child: const Divider(height: 1),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width - 140,
|
||||
child: const Text(
|
||||
'张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰张三丰',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: tTextColor666,
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.to(const AddressListPage());
|
||||
},
|
||||
child: Row(
|
||||
children: const [
|
||||
Text(
|
||||
'切换地址',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: tTextColor333,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
Icons.chevron_right,
|
||||
color: tTextColor333,
|
||||
size: 24,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义顶部导航
|
||||
PreferredSizeWidget appBar() {
|
||||
return AppBar(
|
||||
backgroundColor: tMainRedColor,
|
||||
title: const Text(
|
||||
'确认订单',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StoreDetailsPages extends StatefulWidget {
|
||||
const StoreDetailsPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StoreDetailsPages> createState() => _StoreDetailsPagesState();
|
||||
}
|
||||
|
||||
class _StoreDetailsPagesState extends State<StoreDetailsPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('详情');
|
||||
}
|
||||
}
|
||||
506
lib/pages/store/details/details_page.dart
Normal file
506
lib/pages/store/details/details_page.dart
Normal file
@@ -0,0 +1,506 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:gl_dao/main_color.dart';
|
||||
import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart';
|
||||
|
||||
import '../buy/buy.dart';
|
||||
|
||||
class StoreDetailsPages extends StatefulWidget {
|
||||
const StoreDetailsPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StoreDetailsPages> createState() => _StoreDetailsPagesState();
|
||||
}
|
||||
|
||||
class _StoreDetailsPagesState extends State<StoreDetailsPages>
|
||||
with TickerProviderStateMixin {
|
||||
// 声明滚动事件
|
||||
final ScrollController scrollController = ScrollController();
|
||||
// 顶部自定义导航透明度
|
||||
double topBarOpacity = 0.0;
|
||||
|
||||
List<Map> imgList = [
|
||||
{
|
||||
"title": '1名创优品',
|
||||
"url":
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b",
|
||||
},
|
||||
{
|
||||
"title": '1耐克',
|
||||
"url":
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b",
|
||||
},
|
||||
{
|
||||
"title": '1百草味',
|
||||
"url":
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b",
|
||||
},
|
||||
{
|
||||
"title": '1MLB',
|
||||
"url":
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b",
|
||||
},
|
||||
];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
// 页面滚动触发改变顶部自定义导航样式透明度
|
||||
scrollController.addListener(() {
|
||||
if (scrollController.offset >= 128) {
|
||||
if (topBarOpacity != 1.0) {
|
||||
setState(() {
|
||||
topBarOpacity = 1.0;
|
||||
});
|
||||
}
|
||||
} else if (scrollController.offset <= 128 &&
|
||||
scrollController.offset >= 0) {
|
||||
if (topBarOpacity != scrollController.offset / 128) {
|
||||
setState(() {
|
||||
topBarOpacity = scrollController.offset / 128;
|
||||
});
|
||||
}
|
||||
} else if (scrollController.offset <= 0) {
|
||||
if (topBarOpacity != 0.0) {
|
||||
setState(() {
|
||||
topBarOpacity = 0.0;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: tMainBg,
|
||||
body: Stack(
|
||||
children: [
|
||||
ListView(
|
||||
controller: scrollController,
|
||||
padding: const EdgeInsets.all(0),
|
||||
children: [
|
||||
// 轮播图
|
||||
mySwiperWidget(),
|
||||
// 标题,价格,月销量
|
||||
titleWidget(),
|
||||
// 规格 服务 作者
|
||||
sizeWidget(),
|
||||
// 商品详情
|
||||
detailWidget(),
|
||||
],
|
||||
),
|
||||
|
||||
// 顶部导航
|
||||
navWidget(),
|
||||
// 底部按钮
|
||||
bottomWidget(),
|
||||
// demo(0.9),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义商品详情
|
||||
Widget detailWidget() {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.fromLTRB(0, 16, 0, 0),
|
||||
child: Column(
|
||||
children: imgList.map((item) {
|
||||
return Image.network(
|
||||
item['url'],
|
||||
fit: BoxFit.cover,
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义规格、服务、作者
|
||||
Widget sizeWidget() {
|
||||
return Container(
|
||||
margin: const EdgeInsets.fromLTRB(16, 10, 16, 0),
|
||||
padding: const EdgeInsets.fromLTRB(16, 16, 16, 6),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10),
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
offset: Offset(0.0, 15.0), //阴影xy轴偏移量
|
||||
blurRadius: 15.0, //阴影模糊程度
|
||||
spreadRadius: 1.0, //阴影扩散程度
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.fromLTRB(0, 6, 0, 6),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: const [
|
||||
Text(
|
||||
'规格',
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
width: 250,
|
||||
alignment: Alignment.centerRight,
|
||||
child: const Text(
|
||||
'1m * 1m',
|
||||
style: TextStyle(
|
||||
color: tTextColor333,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.fromLTRB(0, 6, 0, 6),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: const [
|
||||
Text(
|
||||
'服务',
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
width: 250,
|
||||
alignment: Alignment.centerRight,
|
||||
child: const Text(
|
||||
'书画藏品',
|
||||
style: TextStyle(
|
||||
color: tTextColor333,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.fromLTRB(0, 6, 0, 6),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: const [
|
||||
Text(
|
||||
'作者',
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
width: 250,
|
||||
alignment: Alignment.centerRight,
|
||||
child: const Text(
|
||||
' - ',
|
||||
style: TextStyle(
|
||||
color: tTextColor333,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义标题和销量价格
|
||||
Widget titleWidget() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 24,
|
||||
left: 15,
|
||||
right: 16,
|
||||
bottom: 6,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
'书画虎年大吉(1米*1米)',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: tTextColor333,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
strutStyle: StrutStyle(
|
||||
forceStrutHeight: true,
|
||||
height: 1,
|
||||
leading: 0.3, //行距(0.5即行高的一半)
|
||||
),
|
||||
maxLines: 2,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: const [
|
||||
Text(
|
||||
'1999',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
color: tMainRedColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 2),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(bottom: 2),
|
||||
child: Text(
|
||||
'DT积分',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: tMainRedColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Text(
|
||||
'月销量10',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: tTextColor999,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 顶部轮播图
|
||||
Widget mySwiperWidget() {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 390,
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
color: Colors.white,
|
||||
),
|
||||
child: Swiper(
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
//每次循环遍历时,将i赋值给index imgList[index]['title'],
|
||||
return SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 390,
|
||||
child: ClipRRect(
|
||||
child: Image.network(
|
||||
imgList[index]['url'],
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
itemCount: imgList.length,
|
||||
autoplay: false,
|
||||
pagination: SwiperPagination(
|
||||
builder: DotSwiperPaginationBuilder(
|
||||
size: 6,
|
||||
color: tTextColor999.withOpacity(.4),
|
||||
activeSize: 6,
|
||||
activeColor: tMainRedColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义顶部导航
|
||||
Widget navWidget() {
|
||||
return Positioned(
|
||||
top: 0,
|
||||
left: 0,
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: 90,
|
||||
color: tMainRedColor.withOpacity(topBarOpacity),
|
||||
padding: const EdgeInsets.only(
|
||||
top: 40,
|
||||
left: 15,
|
||||
right: 15,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: back,
|
||||
child: Icon(
|
||||
Icons.arrow_back_ios,
|
||||
size: 22,
|
||||
color: topBarOpacity > 0 ? Colors.white : Colors.white,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: GestureDetector(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'商品详情',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
color: topBarOpacity > 0 ? Colors.white : Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: share,
|
||||
child: Icon(
|
||||
Icons.share,
|
||||
size: 22,
|
||||
color: topBarOpacity > 0 ? Colors.white : Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义底部按钮
|
||||
Widget bottomWidget() {
|
||||
return Positioned(
|
||||
bottom: 0,
|
||||
child: SafeArea(
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(
|
||||
left: 16,
|
||||
right: 16,
|
||||
),
|
||||
width: MediaQuery.of(context).size.width - 32,
|
||||
height: 50,
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: (MediaQuery.of(context).size.width - 32) / 2,
|
||||
alignment: Alignment.center,
|
||||
child: const Text(
|
||||
'加入购物车',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: tTextColor666,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(8),
|
||||
topLeft: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.to(const BuyPages());
|
||||
},
|
||||
child: Container(
|
||||
width: (MediaQuery.of(context).size.width - 32) / 2,
|
||||
alignment: Alignment.center,
|
||||
child: const Text(
|
||||
'立即购买',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
// color: tMainRedColor,
|
||||
gradient: LinearGradient(
|
||||
colors: [tMainRedColor, tMainRedColor],
|
||||
),
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomRight: Radius.circular(8),
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 返回按钮
|
||||
back() {
|
||||
Get.back();
|
||||
}
|
||||
|
||||
// 分享
|
||||
share() {
|
||||
// ignore: avoid_print
|
||||
print('分享');
|
||||
}
|
||||
|
||||
Widget demo(double opci) {
|
||||
return ListView(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 750,
|
||||
child: Opacity(
|
||||
opacity: opci,
|
||||
child: Image.asset(
|
||||
'assets/images/detail.png',
|
||||
width: 750,
|
||||
fit: BoxFit.cover,
|
||||
alignment: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* @Author: zhangdongxue zhangdongxue@uz.cn
|
||||
* @Date: 2022-05-27 15:10:21
|
||||
* @LastEditors: zhangdongxue zhangdongxue@uz.cn
|
||||
* @LastEditTime: 2022-05-27 15:51:10
|
||||
* @FilePath: /gl_dao/lib/pages/store/widget/offline_bussiness.dart
|
||||
* @LastEditors: Aimee
|
||||
* @LastEditTime: 2022-05-31 13:52:22
|
||||
* @FilePath: /gl_dao/lib/pages/store/index/components/offline_bussiness.dart
|
||||
* @Description: 线下商家首页展示样式
|
||||
*/
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../main_color.dart';
|
||||
import '../../../../main_color.dart';
|
||||
|
||||
class OfflineBussinessWidget extends StatefulWidget {
|
||||
const OfflineBussinessWidget({Key? key}) : super(key: key);
|
||||
@@ -97,7 +97,7 @@ class _OfflineBussinessWidgetState extends State<OfflineBussinessWidget> {
|
||||
SizedBox(
|
||||
child: ClipOval(
|
||||
child: Image.network(
|
||||
'http://img5.mtime.cn/mg/2021/08/24/141454.81651527_285X160X4.jpg',
|
||||
'https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b',
|
||||
width: 54,
|
||||
height: 54,
|
||||
fit: BoxFit.cover,
|
||||
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* @Author: zhangdongxue zhangdongxue@uz.cn
|
||||
* @Date: 2022-05-27 15:24:22
|
||||
* @LastEditors: zhangdongxue zhangdongxue@uz.cn
|
||||
* @LastEditTime: 2022-05-27 15:29:11
|
||||
* @FilePath: /gl_dao/lib/pages/store/widget/offline_title.dart
|
||||
* @LastEditors: Aimee
|
||||
* @LastEditTime: 2022-05-31 13:51:19
|
||||
* @FilePath: /gl_dao/lib/pages/store/index/components/offline_title.dart
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../main_color.dart';
|
||||
import '../../../../main_color.dart';
|
||||
|
||||
class OfflineTitleWidget extends StatelessWidget {
|
||||
final String title;
|
||||
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* @Author: zhangdongxue zhangdongxue@uz.cn
|
||||
* @Author: Aimee
|
||||
* @Date: 2022-05-26 13:16:03
|
||||
* @LastEditors: zhangdongxue zhangdongxue@uz.cn
|
||||
* @LastEditTime: 2022-05-30 16:20:26
|
||||
* @FilePath: /gl_dao/lib/pages/store/store.dart
|
||||
* @LastEditors: Aimee
|
||||
* @LastEditTime: 2022-05-31 14:49:55
|
||||
* @FilePath: /gl_dao/lib/pages/store/index/index_page.dart
|
||||
* @Description: 商城首页
|
||||
* // width: MediaQuery.of(context).size.width,
|
||||
* // height: MediaQuery.of(context).size.height,
|
||||
*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:gl_dao/main_color.dart';
|
||||
import 'package:flutter_swiper_null_safety/flutter_swiper_null_safety.dart';
|
||||
import 'package:gl_dao/pages/store/widget/offline_title.dart';
|
||||
import '../details/details_page.dart';
|
||||
|
||||
import 'widget/offline_bussiness.dart';
|
||||
import './components/offline_bussiness.dart';
|
||||
import './components/offline_title.dart';
|
||||
|
||||
class StorePages extends StatefulWidget {
|
||||
const StorePages({Key? key}) : super(key: key);
|
||||
@@ -209,97 +209,105 @@ class _StorePagesState extends State<StorePages> with TickerProviderStateMixin {
|
||||
// 把自定义商品列表组件
|
||||
List<Widget> _goodWidget() {
|
||||
return categoryList.map((val) {
|
||||
return Card(
|
||||
// margin: const EdgeInsets.all(10.0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
shadowColor: Colors.black12,
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 2 - 25,
|
||||
child: Column(
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: 9.0 / 9.2,
|
||||
child: ClipRRect(
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(8),
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
child: Image.network(
|
||||
'https://www.itying.com/images/flutter/2.png',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10,
|
||||
right: 6,
|
||||
top: 6,
|
||||
bottom: 6,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 38,
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
val["id"] == 1
|
||||
? '雄风 - 人呀年瞎猜书迷功能与成语人呀年瞎猜书迷功能与成语人呀年瞎猜书迷功能与成语人呀年瞎猜书迷功能与成语'
|
||||
: '富贵花开',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
color: tTextColor333,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
strutStyle: const StrutStyle(
|
||||
forceStrutHeight: true,
|
||||
height: 1,
|
||||
leading: 0.3, //行距(0.5即行高的一半)
|
||||
),
|
||||
maxLines: 2,
|
||||
),
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
// ignore: avoid_print
|
||||
print(val["id"]);
|
||||
Get.to(const StoreDetailsPages());
|
||||
},
|
||||
child: Card(
|
||||
// margin: const EdgeInsets.all(10.0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
shadowColor: Colors.black12,
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width / 2 - 25,
|
||||
child: Column(
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: 9.0 / 9.2,
|
||||
child: ClipRRect(
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(8),
|
||||
topRight: Radius.circular(8),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: const [
|
||||
Text(
|
||||
'1999',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: tMainRedColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 2),
|
||||
Text(
|
||||
'DT积分',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: tMainRedColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Text(
|
||||
'月销量10',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: tTextColor666,
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
child: Image.network(
|
||||
'https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
const SizedBox(height: 4),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10,
|
||||
right: 6,
|
||||
top: 6,
|
||||
bottom: 6,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 38,
|
||||
width: double.infinity,
|
||||
child: Text(
|
||||
val["id"] == 1 || val["id"] == 2 || val["id"] == 4
|
||||
? '雄风 - 人呀年瞎猜书迷功能与成语人呀年瞎猜书迷功能与成语人呀年瞎猜书迷功能与成语人呀年瞎猜书迷功能与成语'
|
||||
: '富贵花开',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
color: tTextColor333,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
strutStyle: const StrutStyle(
|
||||
forceStrutHeight: true,
|
||||
height: 1,
|
||||
leading: 0.3, //行距(0.5即行高的一半)
|
||||
),
|
||||
maxLines: 2,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: const [
|
||||
Text(
|
||||
'1999',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
color: tMainRedColor,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 2),
|
||||
Text(
|
||||
'DT积分',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: tMainRedColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Text(
|
||||
'月销量10',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: tTextColor666,
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -359,44 +367,44 @@ class _StorePagesState extends State<StorePages> with TickerProviderStateMixin {
|
||||
{
|
||||
"title": '1名创优品',
|
||||
"url":
|
||||
"http://img5.mtime.cn/mg/2021/08/24/141454.81651527_285X160X4.jpg",
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b",
|
||||
},
|
||||
{
|
||||
"title": '1耐克',
|
||||
"url":
|
||||
"http://img5.mtime.cn/mg/2021/08/24/134535.67957178_285X160X4.jpg"
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b"
|
||||
},
|
||||
{
|
||||
"title": '1百草味',
|
||||
"url":
|
||||
"http://img5.mtime.cn/mg/2021/08/24/112722.60735295_285X160X4.jpg"
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b"
|
||||
},
|
||||
{
|
||||
"title": '1MLB',
|
||||
"url":
|
||||
"http://img5.mtime.cn/mg/2021/08/24/110937.63038065_285X160X4.jpg"
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b"
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
"title": '名创优品',
|
||||
"url":
|
||||
"http://img5.mtime.cn/mg/2021/08/24/141454.81651527_285X160X4.jpg",
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b",
|
||||
},
|
||||
{
|
||||
"title": '耐克',
|
||||
"url":
|
||||
"http://img5.mtime.cn/mg/2021/08/24/134535.67957178_285X160X4.jpg"
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b"
|
||||
},
|
||||
{
|
||||
"title": '百草味',
|
||||
"url":
|
||||
"http://img5.mtime.cn/mg/2021/08/24/112722.60735295_285X160X4.jpg"
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b"
|
||||
},
|
||||
{
|
||||
"title": 'MLB',
|
||||
"url":
|
||||
"http://img5.mtime.cn/mg/2021/08/24/110937.63038065_285X160X4.jpg"
|
||||
"https://pics4.baidu.com/feed/a686c9177f3e6709d8176cf9c0a30a3af8dc5508.jpeg?token=b8f66e0570589dabfd098cd47d88927b"
|
||||
},
|
||||
]
|
||||
];
|
||||
157
lib/pages/store/index_copy_1.dart
Normal file
157
lib/pages/store/index_copy_1.dart
Normal file
@@ -0,0 +1,157 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StorePages1 extends StatefulWidget {
|
||||
const StorePages1({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_StorePages1State createState() => _StorePages1State();
|
||||
}
|
||||
|
||||
class _StorePages1State extends State<StorePages1>
|
||||
with TickerProviderStateMixin {
|
||||
late TabController _tabController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_tabController = TabController(
|
||||
length: 3,
|
||||
vsync: this,
|
||||
);
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: SafeArea(
|
||||
child: NestedScrollView(
|
||||
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
|
||||
return [
|
||||
SliverToBoxAdapter(
|
||||
child: Column(
|
||||
children: [
|
||||
Image.network(
|
||||
"https://images.pexels.com/photos/396547/pexels-photo-396547.jpeg?auto=compress&cs=tinysrgb&h=350",
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
SliverPersistentHeader(
|
||||
delegate: _SliverAppBarDelegate(
|
||||
TabBar(
|
||||
controller: _tabController,
|
||||
tabs: const [
|
||||
Tab(text: "Tab 1"),
|
||||
Tab(text: "Tab 2"),
|
||||
Tab(text: "Tab 3"),
|
||||
],
|
||||
),
|
||||
),
|
||||
pinned: true,
|
||||
),
|
||||
];
|
||||
},
|
||||
body: TabBarView(
|
||||
controller: _tabController,
|
||||
children: [
|
||||
ListView(
|
||||
children: const [
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
Text('asdfasjkdfahsdjkl'),
|
||||
],
|
||||
),
|
||||
const Center(
|
||||
child: Text('Tab 2'),
|
||||
),
|
||||
const Center(
|
||||
child: Text('Tab 3'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
|
||||
_SliverAppBarDelegate(this._tabBar);
|
||||
|
||||
final TabBar _tabBar;
|
||||
|
||||
@override
|
||||
double get minExtent => _tabBar.preferredSize.height;
|
||||
@override
|
||||
double get maxExtent => _tabBar.preferredSize.height;
|
||||
|
||||
@override
|
||||
Widget build(
|
||||
BuildContext context, double shrinkOffset, bool overlapsContent) {
|
||||
return Container(
|
||||
color: Colors.red,
|
||||
child: _tabBar,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRebuild(_SliverAppBarDelegate oldDelegate) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StoreListPages extends StatefulWidget {
|
||||
const StoreListPages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StoreListPages> createState() => _StoreListPagesState();
|
||||
}
|
||||
|
||||
class _StoreListPagesState extends State<StoreListPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('商品列表');
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
/*
|
||||
* @Author: zhangdongxue zhangdongxue@uz.cn
|
||||
* @Date: 2022-05-26 13:16:03
|
||||
* @LastEditors: zhangdongxue zhangdongxue@uz.cn
|
||||
* @LastEditTime: 2022-05-26 17:06:33
|
||||
* @FilePath: /gl_dao/lib/pages/store/store.dart
|
||||
* @Description: 商城首页
|
||||
*/
|
||||
import 'package:flutter/material.dart';
|
||||
// import '../auth/auth.dart';
|
||||
|
||||
import '../../https/auth_api.dart';
|
||||
|
||||
class StorePages extends StatefulWidget {
|
||||
const StorePages({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<StorePages> createState() => _StorePagesState();
|
||||
}
|
||||
|
||||
class _StorePagesState extends State<StorePages> {
|
||||
@override
|
||||
// void initState() {
|
||||
// HttpApi().apiPost(
|
||||
// 'user/auth/sms',
|
||||
// body: {
|
||||
// 'mobileNo': '18245180131',
|
||||
// 'code': '0000',
|
||||
// },
|
||||
// );
|
||||
// super.initState();
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
shadowColor: Colors.white.withOpacity(0),
|
||||
backgroundColor: Colors.red.withOpacity(.9),
|
||||
leadingWidth: 0,
|
||||
leading: IconButton(
|
||||
tooltip: 'hello',
|
||||
icon: const Icon(
|
||||
Icons.location_on_outlined,
|
||||
size: 20,
|
||||
),
|
||||
onPressed: () {
|
||||
print('menu Pressed');
|
||||
},
|
||||
),
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: selectCity,
|
||||
child: const Text(
|
||||
'全国',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: GestureDetector(
|
||||
onTap: search,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(left: 16),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(36.0),
|
||||
),
|
||||
color: Colors.white,
|
||||
),
|
||||
height: 34,
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/search.png',
|
||||
width: 16.0,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
const Text(
|
||||
'请搜索商家或商品',
|
||||
style: TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
centerTitle: true, // 是否居中显示
|
||||
actions: <Widget>[
|
||||
IconButton(
|
||||
icon: const Icon(Icons.add),
|
||||
tooltip: "more_horiz",
|
||||
onPressed: () {
|
||||
print('点击了加号');
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
// 按钮前面加上icon
|
||||
ElevatedButton.icon(
|
||||
onPressed: () {},
|
||||
icon: Icon(Icons.search),
|
||||
label: Text('图标按钮'),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
selectCity() {
|
||||
print('selectCity');
|
||||
}
|
||||
|
||||
search() {
|
||||
print('search');
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
/*
|
||||
* @Author: zhangdongxue zhangdongxue@uz.cn
|
||||
* @Date: 2022-05-26 13:16:03
|
||||
* @LastEditors: zhangdongxue zhangdongxue@uz.cn
|
||||
* @LastEditTime: 2022-05-27 18:04:21
|
||||
* @LastEditors: Aimee
|
||||
* @LastEditTime: 2022-05-31 13:57:44
|
||||
* @FilePath: /gl_dao/lib/pages/tabs/tabs.dart
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
* @Description: 路由
|
||||
* */
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../main_color.dart';
|
||||
|
||||
import '../store/store.dart';
|
||||
import '../store/index/index_page.dart';
|
||||
import '../dtx/dtx.dart';
|
||||
import '../user/user.dart';
|
||||
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
/*
|
||||
* @Author: Aimee~
|
||||
* @Date: 2022-05-26 13:16:03
|
||||
* @LastEditTime: 2022-06-01 17:58:47
|
||||
* @LastEditors: Aimee
|
||||
* @FilePath: /gl_dao/lib/pages/vip/vip.dart
|
||||
* @Description: 共力者开通及升级页面
|
||||
*/
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../main_color.dart';
|
||||
|
||||
class VipPages extends StatefulWidget {
|
||||
const VipPages({Key? key}) : super(key: key);
|
||||
@@ -10,6 +22,586 @@ class VipPages extends StatefulWidget {
|
||||
class _VipPagesState extends State<VipPages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Text('会员');
|
||||
return Scaffold(
|
||||
backgroundColor: tVipBg,
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.only(bottom: 70),
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.all(0),
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 144,
|
||||
left: 16,
|
||||
right: 16,
|
||||
bottom: 16,
|
||||
),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
alignment: Alignment.topRight,
|
||||
image: AssetImage('assets/images/vip_bg.png'),
|
||||
fit: BoxFit.contain,
|
||||
repeat: ImageRepeat.noRepeat,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// 用户当前身份
|
||||
userRole(),
|
||||
// 会员卡片
|
||||
vipInfo(),
|
||||
// 自定义特权介绍
|
||||
vipIndruce(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomBtn(),
|
||||
// demo(0.5),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义特权介绍
|
||||
Widget vipIndruce() {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(
|
||||
top: 30,
|
||||
),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
color: tVip4.withOpacity(0.4),
|
||||
),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10)),
|
||||
),
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 36,
|
||||
bottom: 20,
|
||||
left: 30,
|
||||
right: 30,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Row(
|
||||
children: const [
|
||||
Icon(
|
||||
Icons.fiber_manual_record,
|
||||
size: 4,
|
||||
color: Colors.white,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
'权益说明权益说明权益说明权益说明',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Row(
|
||||
children: const [
|
||||
Icon(
|
||||
Icons.fiber_manual_record,
|
||||
size: 4,
|
||||
color: Colors.white,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
'权益说明权益说明权益说明权益说明',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Row(
|
||||
children: const [
|
||||
Icon(
|
||||
Icons.fiber_manual_record,
|
||||
size: 4,
|
||||
color: Colors.white,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
'权益说明权益说明权益说明权益说明',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Row(
|
||||
children: const [
|
||||
Icon(
|
||||
Icons.fiber_manual_record,
|
||||
size: 4,
|
||||
color: Colors.white,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
'权益说明权益说明权益说明权益说明',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16),
|
||||
child: Row(
|
||||
children: const [
|
||||
Icon(
|
||||
Icons.fiber_manual_record,
|
||||
size: 4,
|
||||
color: Colors.white,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
'权益说明权益说明权益说明权益说明',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: Get.width / 2 - 75,
|
||||
top: -20,
|
||||
child: Container(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: tVipBg,
|
||||
alignment: Alignment.center,
|
||||
child: const Text(
|
||||
'权益说明',
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: tVip4,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义会员卡片
|
||||
Widget vipInfo() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.only(left: 22, right: 22, top: 10, bottom: 10),
|
||||
height: 210,
|
||||
margin: const EdgeInsets.only(top: 36),
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(10)),
|
||||
gradient: LinearGradient(
|
||||
colors: [tVip1, tVip2],
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 10),
|
||||
Row(
|
||||
children: [
|
||||
ShaderMask(
|
||||
shaderCallback: (Rect bounds) {
|
||||
return const LinearGradient(
|
||||
colors: <Color>[tVip4, tVip3],
|
||||
tileMode: TileMode.mirror,
|
||||
).createShader(bounds);
|
||||
},
|
||||
blendMode: BlendMode.srcATop,
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'V6',
|
||||
style: TextStyle(
|
||||
fontSize: 38,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: tVip4,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 12,
|
||||
right: 20,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'还差100023点升级到会员',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Container(
|
||||
// padding: const EdgeInsets.only(top: 10),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(10),
|
||||
),
|
||||
),
|
||||
height: 6,
|
||||
child: const LinearProgressIndicator(
|
||||
value: 5 / 10,
|
||||
color: tVip4,
|
||||
backgroundColor: tVip1,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'12222/33333',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.5),
|
||||
fontSize: 10,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 6,
|
||||
bottom: 6,
|
||||
left: 10,
|
||||
right: 10,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(50),
|
||||
),
|
||||
gradient: LinearGradient(
|
||||
colors: [tVip3, tVip4],
|
||||
),
|
||||
),
|
||||
child: const Text(
|
||||
'立即升级',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: tVip2,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 20,
|
||||
bottom: 10,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
'VIP会员开通后',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.7),
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'可获得如下奖励',
|
||||
style: TextStyle(
|
||||
color: tVip4.withOpacity(0.7),
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 4,
|
||||
right: 4,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/vip_item_1.png',
|
||||
width: 50,
|
||||
height: 50,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
'共力值增长',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/vip_item_2.png',
|
||||
width: 50,
|
||||
height: 50,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
'加入部落权',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/vip_item_3.png',
|
||||
width: 50,
|
||||
height: 50,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
'家庭会员权',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/vip_item_4.png',
|
||||
width: 50,
|
||||
height: 50,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
const Text(
|
||||
'角色升级权',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义用户当前身份
|
||||
Widget userRole() {
|
||||
return Row(
|
||||
children: [
|
||||
const CircleAvatar(
|
||||
backgroundImage: NetworkImage(
|
||||
"https://www.itying.com/images/flutter/1.png",
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
const Text(
|
||||
'BAOTU',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 12,
|
||||
right: 8,
|
||||
),
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomRight: Radius.circular(10),
|
||||
),
|
||||
color: tVip4,
|
||||
),
|
||||
child: const Text(
|
||||
'共力者',
|
||||
style: TextStyle(
|
||||
color: Color.fromARGB(255, 89, 47, 14),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 11,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: -10,
|
||||
top: -2,
|
||||
child: Image.asset(
|
||||
'assets/images/vip_role.png',
|
||||
fit: BoxFit.cover,
|
||||
width: 22,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'开通后即',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.7),
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
' 永久会员',
|
||||
style: TextStyle(
|
||||
color: tVip4.withOpacity(0.7),
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
' 身份',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.7),
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
// 自定义底部按钮
|
||||
Widget bottomBtn() {
|
||||
return Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
child: Container(
|
||||
height: 100,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: const BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [tVip1, tVip2],
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width * 0.7,
|
||||
height: 46,
|
||||
alignment: Alignment.center,
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(50),
|
||||
),
|
||||
gradient: LinearGradient(
|
||||
colors: [tVip3, tVip4],
|
||||
),
|
||||
),
|
||||
child: const Text(
|
||||
'立即购买',
|
||||
style: TextStyle(fontSize: 20),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget demo(double opci) {
|
||||
return ListView(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
child: Opacity(
|
||||
opacity: opci,
|
||||
child: Image.asset(
|
||||
'assets/images/5fbf2512c344f.jpg',
|
||||
width: MediaQuery.of(context).size.width,
|
||||
fit: BoxFit.cover,
|
||||
alignment: Alignment.bottomCenter,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user