Browse Source

Merge branch 'master' into dev

# Conflicts:
#	lib/generated/l10n.dart
#	lib/l10n/intl_zh_CN.arb
#	lib/l10n/intl_zh_Hans_CN.arb
master
w-R 3 years ago
parent
commit
23dbec1fa7
  1. 2
      lib/l10n/intl_en.arb
  2. 2
      lib/l10n/intl_zh_Hant_CN.arb
  3. 2
      lib/l10n/intl_zh_TW.arb
  4. 9
      lib/qr/qr_code_scan.dart
  5. 37
      lib/retrofit/data/base_data.g.dart
  6. 41
      lib/retrofit/data/page.g.dart
  7. 112
      lib/retrofit/min_api.dart
  8. 8
      lib/retrofit/retrofit_api.dart
  9. 1208
      lib/retrofit/retrofit_api.g.dart
  10. 345
      lib/store/store_order.dart
  11. 1
      lib/store/store_view/settlement.dart
  12. 168
      lib/store/store_view/store_activity.dart
  13. 85
      lib/store/store_view/store_header.dart
  14. 398
      lib/store/store_view/store_order_list.dart
  15. 4
      lib/web/web_page.dart
  16. 25
      lib/web/web_view/comment_list.dart
  17. 6
      lib/web/web_view/web_content.dart
  18. 23
      lib/web/web_view/web_header.dart

2
lib/l10n/intl_en.arb

@ -519,6 +519,8 @@
"diandan": "点单",
"pingtaiyue": "平台余额",
"dianpuyue": "店铺余额",
"tuiguangma": "推广码",
"wodegongju": "我的工具",
"dingdanjiesuan": "订单结算",
"daodianziqu": "到店自取",
"waimaipeisong": "外卖配送",

2
lib/l10n/intl_zh_Hant_CN.arb

@ -514,6 +514,8 @@
"diandan": "點單",
"pingtaiyue": "平臺餘額",
"dianpuyue": "店鋪餘額",
"tuiguangma": "推廣碼",
"wodegongju": "我的工具",
"dingdanjiesuan": "訂單結算",
"daodianziqu": "到店自取",
"waimaipeisong": "外賣配送",

2
lib/l10n/intl_zh_TW.arb

@ -513,6 +513,8 @@
"diandan": "點單",
"pingtaiyue": "平臺餘額",
"dianpuyue": "店鋪餘額",
"tuiguangma": "推廣碼",
"wodegongju": "我的工具",
"dingdanjiesuan": "訂單結算",
"daodianziqu": "到店自取",
"waimaipeisong": "外賣配送",

9
lib/qr/qr_code_scan.dart

@ -122,14 +122,14 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
}
}
startCameraResult(String data, List<Offset> offset) async {
void _startCameraResult(String data, List<Offset> offset) {
showData(data);
this.viewController.stopCamera();
}
Future onScan(QrReaderViewController viewController) async {
this.viewController = viewController;
await this.viewController.startCamera(startCameraResult);
await this.viewController.startCamera(_startCameraResult);
}
showData(String data) {
@ -140,9 +140,10 @@ class _QrCodeScanPage extends State<QrCodeScanPage> {
),
onDismiss: () {
Future.delayed(Duration(seconds: 1), () {
this.viewController.startCamera(startCameraResult);
});
this.viewController.startCamera(_startCameraResult);
});
},
);
}
@override

37
lib/retrofit/data/base_data.g.dart

@ -1,37 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'base_data.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BaseData<T> _$BaseDataFromJson<T>(
Map<String, dynamic> json,
T Function(Object json) fromJsonT,
) {
return BaseData<T>()
..code = json['code'] as int
..data = fromJsonT(json['data'])
..extra = json['extra']
..isError = json['isError'] as bool
..isSuccess = json['isSuccess'] as bool
..msg = json['msg'] as String
..path = json['path'] as String
..timestamp = json['timestamp'] as String;
}
Map<String, dynamic> _$BaseDataToJson<T>(
BaseData<T> instance,
Object Function(T value) toJsonT,
) =>
<String, dynamic>{
'code': instance.code,
'data': toJsonT(instance.data),
'extra': instance.extra,
'isError': instance.isError,
'isSuccess': instance.isSuccess,
'msg': instance.msg,
'path': instance.path,
'timestamp': instance.timestamp,
};

41
lib/retrofit/data/page.g.dart

@ -1,41 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'page.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PageInfo<D> _$PageInfoFromJson<D>(
Map<String, dynamic> json,
D Function(Object json) fromJsonD,
) {
return PageInfo<D>()
..pageNum = json['pageNum'] as int
..current = json['current']
..pageSize = json['pageSize'] as int
..size = json['size']
..pages = json['pages']
..hasPreviousPage = json['hasPreviousPage'] as bool
..hasNextPage = json['hasNextPage'] as bool
..total = json['total'] as String
..list = (json['list'] as List)?.map(fromJsonD)?.toList()
..records = (json['records'] as List)?.map(fromJsonD)?.toList();
}
Map<String, dynamic> _$PageInfoToJson<D>(
PageInfo<D> instance,
Object Function(D value) toJsonD,
) =>
<String, dynamic>{
'pageNum': instance.pageNum,
'current': instance.current,
'pageSize': instance.pageSize,
'size': instance.size,
'pages': instance.pages,
'hasPreviousPage': instance.hasPreviousPage,
'hasNextPage': instance.hasNextPage,
'total': instance.total,
'list': instance.list?.map(toJsonD)?.toList(),
'records': instance.records?.map(toJsonD)?.toList(),
};

112
lib/retrofit/min_api.dart

@ -0,0 +1,112 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/login_tips_dialog.dart';
import 'package:retrofit/retrofit.dart';
part 'min_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "http://192.168.10.236:8766/app/"; ///
// const baseUrl = "http://192.168.10.236:8766/app/"; ///
// const base_url = "http://192.168.10.37:8766/app/";
// const baseUrl = "http://192.168.10.37:8766/app/";
///
@RestApi(baseUrl: baseUrl)
abstract class MinApiService {
factory MinApiService(Dio dio, {
String baseUrl,
BuildContext context,
String token,
bool showLoading = true,
bool pay = false,
}) {
Map<String, dynamic> headers =
(token == null || token == "") ? {} : {'token': "Bearer $token"};
if (pay) {
headers["Environment"] = "app";
}
dio.options = BaseOptions(
connectTimeout: 60000,
receiveTimeout: 60000,
headers: headers,
responseType: ResponseType.json,
);
dio.interceptors.add(
InterceptorsWrapper(onRequest: (RequestOptions options) {
debugPrint("\n======================= Min_请求数据 =======================");
debugPrint("method = ${options.method.toString()}");
debugPrint("url = ${options.uri.toString()}");
debugPrint("headers = ${options.headers}");
if (showLoading && !EasyLoading.isShow) {
//loading
EasyLoading.show(status: S.of(context).zhengzaijiazai);
}
if (options.data is FormData) {
debugPrint("params data = FormData");
} else {
debugPrint("params data = ${jsonEncode(options.data)}");
}
debugPrint("params queryParameters = ${options.queryParameters}");
}, onResponse: (Response response) {
debugPrint("\n======================= Min_响应数据开始 =======================");
if (showLoading && EasyLoading.isShow) {
EasyLoading.dismiss();
}
debugPrint("code = ${response.statusCode}");
p(jsonEncode(response.data));
Map map = response.data;
if (map["code"] != 0) {
EasyLoading.dismiss();
}
if (map["code"] == 40005 || map["code"] == 40001) {
if (!LoginTipsDialog().isShow) {
print("show: ${LoginTipsDialog().isShow}");
LoginTipsDialog().show(context);
}
} else if (map["code"] != 0 && response.request.baseUrl == baseUrl) {
///poi服务请求不需要toast
SmartDialog.showToast(map["msg"], alignment: Alignment.center);
}
debugPrint("======================= Min_响应数据结束 =======================\n");
}, onError: (DioError e) {
if (EasyLoading.isShow) {
EasyLoading.dismiss();
}
debugPrint("\n======================= Min_错误响应数据 =======================");
debugPrint("type = ${e.type}");
debugPrint("message = ${e.message}");
debugPrint("\n");
}),
);
if (kReleaseMode) {
baseUrl = base_url;
}
return _MinApiService(dio, baseUrl: baseUrl);
}
static void p(String msg) {
//String的length是字符数量不是字节数量所以为了防止中文字符过多
// 4*1024MAX字节打印长度改为1000字符数
int maxStrLength = 900;
//1000
while (msg.length > maxStrLength) {
debugPrint(msg.substring(0, maxStrLength));
msg = msg.substring(maxStrLength);
}
//
print(msg);
}
}

8
lib/retrofit/retrofit_api.dart

@ -37,12 +37,8 @@ import 'data/wx_pay.dart';
part 'retrofit_api.g.dart';
const base_url = "https://pos.platform.lotus-wallet.com/app/";
///
const baseUrl = "https://pos.platform.lotus-wallet.com/app/";
///
const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///
const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///
// const base_url = "http://192.168.10.236:8766/app/"; ///
// const baseUrl = "http://192.168.10.236:8766/app/"; ///

1208
lib/retrofit/retrofit_api.g.dart

File diff suppressed because it is too large Load Diff

345
lib/store/store_order.dart

@ -8,8 +8,9 @@ import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';
import 'package:huixiang/store/store_view/store_activity.dart';
import 'package:huixiang/store/store_view/store_info.dart';
import 'package:huixiang/store/store_view/store_order_page.dart';
import 'package:huixiang/store/store_view/store_order_list.dart';
import 'package:huixiang/union/union_view/union_coupon.dart';
import 'package:huixiang/union/union_view/vip.dart';
import 'package:huixiang/utils/font_weight.dart';
@ -38,11 +39,29 @@ class _StoreOrderPage extends State<StoreOrderPage>
ApiService apiService;
StoreInfo storeInfo;
RefreshController refreshController;
List<Widget> _widgetOptions;
@override
void initState() {
super.initState();
if (tabcontroller == null)
tabcontroller = TabController(
length: 2,
vsync: this,
);
_widgetOptions = [
StoreOrderListPage(
widget.arguments, widget.activitys, storeInfo, controller),
///,
StoreActivity(
widget.arguments,
widget.activitys,
),
];
queryStoreInfo();
}
@ -76,7 +95,11 @@ class _StoreOrderPage extends State<StoreOrderPage>
Widget build(BuildContext context) {
return Stack(
children: [
Expanded(
Positioned(
left: 0,
right: 0,
top: 0,
bottom: 54.h,
child: DefaultTabController(
length: 2,
child: SmartRefresher(
@ -92,15 +115,16 @@ class _StoreOrderPage extends State<StoreOrderPage>
child: NestedScrollView(
controller: controller,
dragStartBehavior: DragStartBehavior.start,
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return [
SliverOverlapAbsorber(
handle: NestedScrollView.sliverOverlapAbsorberHandleFor(context),
sliver: SliverAppBar(
title: Text(
widget.storeInfo != null
? widget.storeInfo.storeName
: "",
storeInfo != null
? storeInfo.storeName
: '',
style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
@ -114,6 +138,11 @@ class _StoreOrderPage extends State<StoreOrderPage>
floating: false,
snap: false,
pinned: true,
stretch: false,
onStretchTrigger: () {
return Future.sync((){});
},
stretchTriggerOffset: 100,
leading: GestureDetector(
onTap: () {
Navigator.of(context).pop();
@ -130,6 +159,23 @@ class _StoreOrderPage extends State<StoreOrderPage>
),
),
flexibleSpace: FlexibleSpaceBar(
// title: Container(
// margin: EdgeInsets.only(bottom: 40),
// child: Text(
// 'Expanded Title',
// style: TextStyle(
// color: Colors.black,
// fontWeight: FontWeight.bold,
// fontSize: 18.sp,
// ),
// ),
// ),
collapseMode: CollapseMode.pin,
stretchModes: [
StretchMode.zoomBackground,
StretchMode.fadeTitle,
StretchMode.blurBackground,
],
background: Stack(
children: [
Positioned(
@ -186,7 +232,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
),
],
),
collapseMode: CollapseMode.pin,
),
backgroundColor: Color(0xFFFAFAFA),
centerTitle: false,
@ -200,10 +245,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
padding: EdgeInsets.symmetric(horizontal: 10.w),
width: MediaQuery.of(context).size.width,
child: TabBar(
controller: tabcontroller = TabController(
length: 2,
vsync: this,
),
controller: tabcontroller,
automaticIndicatorColorAdjustment: true,
isScrollable: true,
indicatorWeight: 1,
@ -234,13 +276,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
},
body: TabBarView(
physics: BouncingScrollPhysics(),
children: [
StoreOrderListPage(widget.arguments, widget.activitys, storeInfo, controller),
Container(
color: Colors.black,
width: MediaQuery.of(context).size.width,
),
],
children: _widgetOptions,
controller: tabcontroller,
),
),
@ -291,6 +327,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
radius: 0,
fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
),
@ -303,7 +340,7 @@ class _StoreOrderPage extends State<StoreOrderPage>
InkWell(
onTap: () {
setState(() {
// showShoppingCart();
showShoppingCart();
});
},
child: Image.asset(
@ -325,7 +362,6 @@ class _StoreOrderPage extends State<StoreOrderPage>
backgroup: Color(0xFF32A060),
fontSize: 12.sp,
radius: 100,
// padding: EdgeInsets.symmetric(vertical: 5.h),
),
)
],
@ -337,6 +373,275 @@ class _StoreOrderPage extends State<StoreOrderPage>
);
}
///
showShoppingCart() {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return StatefulBuilder(builder: (context1, state) {
return Container(
alignment: Alignment.topCenter,
width: double.infinity,
height: MediaQuery.of(context).size.height / 2,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
bottom: 8,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"已选商品",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
InkWell(
onTap: () {},
child: Image.asset(
"assets/image/delete.png",
width: 22,
height: 22,
),
),
],
),
),
Expanded(
child: Container(
padding: EdgeInsets.only(
top: 8,
left: 16,
right: 16,
),
child: ListView.builder(
itemCount: 2,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return shoppGoodsItem();
},
),
),
),
Stack(
alignment: Alignment.bottomLeft,
children: [
Container(
height: 54.h,
decoration: BoxDecoration(
color: Color(0xFFFAFAFA),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(8),
offset: Offset(0, -1),
blurRadius: 3,
spreadRadius: 0,
),
],
),
child: Row(
children: [
Spacer(),
Text(
S.of(context).heji,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
Text(
"¥19.00",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
),
Spacer(),
RoundButton(
width: 103.w,
height: 54.h,
text: S.current.jiesuan,
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
radius: 0,
fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
)
],
),
),
Stack(
children: [
InkWell(
onTap: () {
Navigator.of(context).pop();
},
child: Image.asset(
"assets/image/shopp.png",
width: 88,
height: 88,
),
),
Positioned(
right: 15,
top: 14,
child: RoundButton(
width: 17,
height: 17,
text: "1",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
fontSize: 12.sp,
radius: 100,
),
),
],
),
],
),
],
),
);
});
},
);
}
Widget shoppGoodsItem() {
return Container(
padding: EdgeInsets.only(bottom: 10),
child: Row(
children: [
Image.asset(
"assets/image/default_1.png",
width: 60,
height: 60,
fit: BoxFit.cover,
),
SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"手工啵啵奶茶",
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(height: 2),
Row(
children: [
Text(
"无香精",
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize: 11.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(width: 10),
Text(
"无香精",
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize: 11.sp,
fontWeight: MyFontWeight.regular,
),
)
],
),
SizedBox(height: 6),
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
"会员价",
style: TextStyle(
color: Color(0xFFFF7A1A),
fontSize: 13.sp,
fontWeight: MyFontWeight.medium,
),
),
Text(
"¥19.00",
style: TextStyle(
color: Color(0xFFFF7A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
)
],
),
],
),
Spacer(),
InkWell(
onTap: () {},
child: Image.asset(
"assets/image/reduce.png",
width: 22,
height: 22,
),
),
Padding(
padding: EdgeInsets.only(left: 8, right: 8),
child: Text(
"1",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
InkWell(
onTap: () {},
child: Image.asset(
"assets/image/add.png",
width: 22,
height: 22,
),
),
],
),
],
),
flex: 1,
),
],
),
);
}
// @override
// bool get wantKeepAlive => true;
}

1
lib/store/store_view/settlement.dart

@ -3,7 +3,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/order/order_view/order_commodity.dart';
import 'package:huixiang/order/order_view/order_info.dart';
import 'package:huixiang/retrofit/data/base_data.dart';
import 'package:huixiang/retrofit/data/order_info.dart';
import 'package:huixiang/retrofit/retrofit_api.dart';

168
lib/store/store_view/store_activity.dart

@ -0,0 +1,168 @@
import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/custom_image.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/no_data_view.dart';
class StoreActivity extends StatefulWidget {
final Map<String, dynamic> arguments;
final List<Activity> activitys;
StoreActivity(this.arguments, this.activitys);
@override
State<StatefulWidget> createState() {
return _StoreActivity();
}
}
class _StoreActivity extends State<StoreActivity> {
@override
Widget build(BuildContext context) {
return (widget.activitys == null || widget.activitys.length == 0)
? NoDataView(
isShowBtn: false,
text: "还没有活动~",
fontSize: 16.sp,
margin: EdgeInsets.only(top: 180.h),
)
: Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
color: Colors.white,
child: Swiper(
viewportFraction: 0.95,
loop: false,
itemBuilder: (context, position) {
return InkWell(
onTap: () {
if (widget.arguments["source"] != null &&
widget.arguments["source"] ==
widget.activitys[position].id) {
Navigator.of(context).pop();
} else {
Navigator.of(context).pushNamed('/router/web_page',
arguments: {
"activityId": widget.activitys[position].id,
"source": widget.arguments["id"]
});
}
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 5.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Color(0x0D000000),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
),
],
),
child: Stack(
children: [
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
MImage(
(widget.activitys != null &&
widget.activitys.length > position)
? widget.activitys[position].coverImg
: "",
aspectRatio: 2.2,
radius: BorderRadius.vertical(
top: Radius.circular(8),
),
fit: BoxFit.cover,
errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png",
),
Container(
padding: EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
(widget.activitys != null &&
widget.activitys.length >
position)
? widget.activitys[position].storeName
: "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF000000),
),
),
SizedBox(
height: 4.h,
),
Text(
(widget.activitys != null &&
widget.activitys.length >
position)
? widget.activitys[position].mainTitle
: "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF727272),
),
),
],
),
),
],
),
),
Positioned(
top: 0,
right: 0,
child: Container(
padding: EdgeInsets.symmetric(
vertical: 4.h,
horizontal: 8.w,
),
decoration: BoxDecoration(
color: Colors.black.withAlpha(76),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Text(
(widget.activitys != null &&
widget.activitys.length > position)
? widget.activitys[position].startTime
.split(" ")[0]
: "",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp,
color: Color(0xD9FFFFFF),
),
),
),
),
],
),
),
);
},
itemCount:
(widget.activitys != null && widget.activitys.length > 0)
? widget.activitys.length
: 0,
),
);
}
}

85
lib/store/store_view/store_header.dart

@ -0,0 +1,85 @@
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/store_info.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/store/store_view/store_info.dart';
import 'package:huixiang/union/union_view/union_coupon.dart';
import 'package:huixiang/union/union_view/vip.dart';
class StoreHeader extends SliverPersistentHeaderDelegate {
final StoreInfo storeInfo;
final double minHeight;
StoreHeader(this.storeInfo, this.minHeight);
@override
Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
print("overlapsContent: $overlapsContent");
return Stack(
children: [
Positioned(
child: Column(
children: [
Image.asset(
"assets/image/share_image_bg.png",
fit: BoxFit.cover,
width: MediaQuery.of(context).size.width,
height: 180.h,
),
Expanded(
child: Container(
color: Colors.transparent,
),
flex: 1,
),
],
),
top: 0,
bottom: 0,
left: 0,
right: 0,
),
Positioned(
child: Container(
child: Column(
children: [
///
StoreInfoView(storeInfo),
///
if (storeInfo != null && storeInfo.couponVOList != null)
UnionCoupon(
storeInfo,
(a) {},
coupon: true,
),
SizedBox(
height: 8,
),
///VIP信息
Vip(storeInfo, () {}, false),
],
),
),
top: 110.h,
bottom: 0,
left: 0,
right: 0,
),
],
);
} //
@override
double get maxExtent => (storeInfo != null && storeInfo.couponVOList != null)
? 425.h
: 365.h; //
@override
double get minExtent => kToolbarHeight + minHeight; //
@override
bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) => false;
}

398
lib/store/store_view/store_order_page.dart → lib/store/store_view/store_order_list.dart

@ -66,6 +66,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
height: MediaQuery.of(context).size.height,
child: ListView.builder(
itemCount: 28,
padding: EdgeInsets.only(top: 25, bottom: 50),
controller: widget.controller,
itemBuilder: (context, position) {
return orderItem(position);
@ -130,8 +131,6 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
color: Colors.white,
padding: EdgeInsets.only(right: 16.w, bottom: 10, top: 10),
child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceAround,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 12.w),
Image.asset(
@ -198,7 +197,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
fontSize: 11.sp,
fontWeight: MyFontWeight.medium,
),
)
),
],
),
Row(
@ -219,7 +218,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
fontSize: 10.sp,
fontWeight: MyFontWeight.regular,
),
)
),
],
),
],
@ -228,9 +227,7 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
true
? GestureDetector(
onTap: () {
setState(() {
showStoreSelector();
});
},
child: RoundButton(
width: 49.w,
@ -282,137 +279,6 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
);
}
///
Widget starGoodsItem() {
return Container(
child: Swiper(
viewportFraction: 0.95,
loop: false,
itemBuilder: (context, position) {
return InkWell(
onTap: () {
if (widget.arguments["source"] != null &&
widget.arguments["source"] == widget.activitys[position].id) {
Navigator.of(context).pop();
} else {
Navigator.of(context).pushNamed('/router/web_page', arguments: {
"activityId": widget.activitys[position].id,
"source": widget.arguments["id"]
});
}
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 5.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
boxShadow: [
BoxShadow(
color: Color(0x0D000000),
offset: Offset(0, 3),
blurRadius: 14,
spreadRadius: 0,
)
],
),
child: Stack(
children: [
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
MImage(
(widget.activitys != null &&
widget.activitys.length > position)
? widget.activitys[position].coverImg
: "",
aspectRatio: 2.2,
radius: BorderRadius.vertical(
top: Radius.circular(8),
),
fit: BoxFit.cover,
errorSrc: "assets/image/default_2_1.png",
fadeSrc: "assets/image/default_2_1.png",
),
Container(
padding: EdgeInsets.all(8),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
(widget.activitys != null &&
widget.activitys.length > position)
? widget.activitys[position].storeName
: "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF000000),
),
),
SizedBox(
height: 4.h,
),
Text(
(widget.activitys != null &&
widget.activitys.length > position)
? widget.activitys[position].mainTitle
: "",
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF727272),
),
),
],
),
),
],
),
),
Positioned(
top: 0,
right: 0,
child: Container(
padding: EdgeInsets.symmetric(
vertical: 4.h,
horizontal: 8.w,
),
decoration: BoxDecoration(
color: Colors.black.withAlpha(76),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(8),
topRight: Radius.circular(8),
),
),
child: Text(
(widget.activitys != null &&
widget.activitys.length > position)
? widget.activitys[position].startTime.split(" ")[0]
: "",
style: TextStyle(
fontWeight: MyFontWeight.semi_bold,
fontSize: 12.sp,
color: Color(0xD9FFFFFF),
),
),
),
),
],
),
),
);
},
itemCount: (widget.activitys != null && widget.activitys.length > 0)
? widget.activitys.length
: 0,
),
);
}
///
showStoreSelector() {
showModalBottomSheet(
@ -666,262 +532,4 @@ class _StoreOrderListPage extends State<StoreOrderListPage> {
);
}
///
showShoppingCart() {
showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return StatefulBuilder(builder: (context1, state) {
return Container(
alignment: Alignment.topCenter,
width: double.infinity,
decoration: BoxDecoration(
color: Color(0xFFFAFAFA),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(8), topRight: Radius.circular(8)),
),
child: Stack(
children: [
Container(
padding: EdgeInsets.only(top: 16, left: 16, right: 16),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"已选商品",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
InkWell(
onTap: () {},
child: Image.asset(
"assets/image/delete.png",
width: 22,
height: 22,
),
),
],
),
SizedBox(height: 24.h),
Expanded(
child: Container(
child: ListView.builder(
itemCount: 10,
shrinkWrap: true,
// physics:NeverScrollableScrollPhysics(),
itemBuilder: (context, position) {
return shoppGoodsItem();
}),
),
)
],
),
),
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Stack(
alignment: Alignment.bottomLeft,
children: [
Container(
height: 54.h,
color: Color(0xFFFAFAFA),
child: Row(
// mainAxisAlignment: MainAxisAlignment.end,
// crossAxisAlignment: CrossAxisAlignment.end,
children: [
Spacer(),
Text(
S.of(context).heji,
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: Colors.black,
),
),
Text(
"¥19.00",
style: TextStyle(
fontSize: 20.sp,
fontWeight: MyFontWeight.medium,
color: Color(0xFF32A060),
),
),
Spacer(),
RoundButton(
width: 103.w,
height: 54.h,
text: S.current.jiesuan,
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
fontSize: 16.sp,
padding: EdgeInsets.symmetric(vertical: 5.h),
)
],
),
),
Stack(
children: [
InkWell(
onTap: () {
setState(() {
Navigator.of(context).pop();
});
},
child: Image.asset(
"assets/image/shop.png",
width: 88,
height: 88,
),
),
Positioned(
right: 15,
top: 14,
child: RoundButton(
width: 17,
height: 17,
text: "1",
textColor: Colors.white,
fontWeight: MyFontWeight.regular,
backgroup: Color(0xFF32A060),
fontSize: 12.sp,
radius: 100,
// padding: EdgeInsets.symmetric(vertical: 5.h),
),
)
],
),
],
),
)
],
),
);
});
},
);
}
Widget shoppGoodsItem() {
return Container(
padding: EdgeInsets.only(bottom: 10),
child: Row(
children: [
Image.asset(
"assets/image/default_1.png",
width: 60,
height: 60,
fit: BoxFit.cover,
),
SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"手工啵啵奶茶",
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
fontWeight: MyFontWeight.medium,
),
),
SizedBox(height: 2),
Row(
children: [
Text(
"无香精",
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize: 11.sp,
fontWeight: MyFontWeight.regular,
),
),
SizedBox(width: 10),
Text(
"无香精",
style: TextStyle(
color: Color(0xFF4C4C4C),
fontSize: 11.sp,
fontWeight: MyFontWeight.regular,
),
)
],
),
SizedBox(height: 6),
Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
"会员价",
style: TextStyle(
color: Color(0xFFFF7A1A),
fontSize: 13.sp,
fontWeight: MyFontWeight.medium,
),
),
Text(
"¥19.00",
style: TextStyle(
color: Color(0xFFFF7A1A),
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
)
],
),
],
),
Spacer(),
InkWell(
onTap: () {},
child: Image.asset(
"assets/image/reduce.png",
width: 22,
height: 22,
),
),
Padding(
padding: EdgeInsets.only(left: 8, right: 8),
child: Text(
"1",
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,
),
),
),
InkWell(
onTap: () {},
child: Image.asset(
"assets/image/add.png",
width: 22,
height: 22,
),
),
],
),
],
),
)
],
),
);
}
}

4
lib/web/web_page.dart

@ -219,7 +219,7 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
),
),
),
background: Color(0xFFF7F7F7),
background: Color(0xFFFFFFFFF),
leadingColor: Colors.black,
title: activity != null
? activity.mainTitle
@ -262,7 +262,7 @@ class _WebPage extends State<WebPage> with WidgetsBindingObserver {
isKeyBoardShow,
_reply,
_delCommentTips,
12
12.sp
),
],
),

25
lib/web/web_view/comment_list.dart

@ -25,16 +25,9 @@ class CommentList extends StatefulWidget {
final Function delCommentTips;
final double fontSize;
CommentList(
Key key,
this.arguments,
this.activity,
this.article,
this.isKeyBoardShow,
this.reply,
this.delCommentTips,
this.fontSize
) : super(key: key);
CommentList(Key key, this.arguments, this.activity, this.article,
this.isKeyBoardShow, this.reply, this.delCommentTips, this.fontSize)
: super(key: key);
@override
State<StatefulWidget> createState() {
@ -171,10 +164,8 @@ class _CommentList extends State<CommentList> {
if (memberList == null || memberList.length == 0)
Container(
width: double.infinity,
height: MediaQuery.of(context).size.height -
kToolbarHeight -
MediaQuery.of(context).padding.top -
160.h,
height: MediaQuery.of(context).size.height - kToolbarHeight
- MediaQuery.of(context).padding.top - 160.h,
alignment: Alignment.topCenter,
color: Color(0xFFF2F2F2),
padding: EdgeInsets.only(top: 22.h),
@ -216,10 +207,12 @@ class _CommentList extends State<CommentList> {
token: sharedPreferences.getString("token"),
showLoading: false,
);
BaseData<PageInfo<MemberCommentList>> baseData = await apiService.memberCommentList({
BaseData<PageInfo<MemberCommentList>> baseData =
await apiService.memberCommentList({
"pageNum": 1,
"pageSize": 100,
"relationalId": widget.arguments["activityId"] ?? widget.arguments["articleId"],
"relationalId":
widget.arguments["activityId"] ?? widget.arguments["articleId"],
"relationalType": 1,
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {

6
lib/web/web_view/web_content.dart

@ -7,6 +7,7 @@ import 'package:flutter_html/image_render.dart';
import 'package:chewie/src/chewie_progress_colors.dart' as chewie;
import 'package:flutter/material.dart';
import 'package:flutter_html/src/replaced_element.dart';
import 'package:flutter_html/style.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:video_player/video_player.dart';
@ -38,6 +39,11 @@ class _WebContent extends State<WebContent> {
: widget.article != null
? widget.article.content
: "",
style: {
"html": Style(
backgroundColor: Colors.white
)
},
customImageRenders: {
base64DataUriMatcher(): base64ImageRender(),
assetUriMatcher(): assetImageRender(),

23
lib/web/web_view/web_header.dart

@ -1,11 +1,9 @@
import 'package:flutter/material.dart';
import 'package:huixiang/retrofit/data/activity.dart';
import 'package:huixiang/retrofit/data/article.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class WebHeader extends StatefulWidget {
final Map arguments;
final Activity activity;
final Article article;
@ -17,7 +15,6 @@ class WebHeader extends StatefulWidget {
State<StatefulWidget> createState() {
return _WebHeader();
}
}
class _WebHeader extends State<WebHeader> {
@ -26,7 +23,7 @@ class _WebHeader extends State<WebHeader> {
return Column(
children: [
Container(
color: Color(0xFFF7F7F7),
color: Colors.white,
padding: EdgeInsets.all(12),
alignment: Alignment.centerLeft,
child: Text(
@ -43,12 +40,15 @@ class _WebHeader extends State<WebHeader> {
),
),
Container(
color: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Row(
children: [
InkWell(
child: Text(
"${widget.activity != null ? (widget.activity.storeName ?? "") : (widget.article != null && widget.article.author != null) ? (widget.article.author.name ?? "") : ""}",
"${widget.activity != null ? (widget.activity.storeName ?? "")
: (widget.article != null && widget.article.author != null)
? (widget.article.author.name ?? "") : ""}",
style: TextStyle(
fontWeight: FontWeight.normal,
fontSize: widget.fontSize - 2,
@ -58,17 +58,16 @@ class _WebHeader extends State<WebHeader> {
onTap: () {
if (widget.activity != null) {
if (widget.arguments["source"] != null &&
widget.arguments["source"] ==
widget.activity.storeId) {
widget.arguments["source"] == widget.activity.storeId) {
Navigator.of(context).pop();
} else {
Navigator.of(context).pushNamed(
'/router/union_detail_page',
arguments: {
"id": widget.activity.storeId,
"source":
widget.arguments["activityId"]
});
"source": widget.arguments["activityId"]
},
);
}
}
},
@ -94,8 +93,4 @@ class _WebHeader extends State<WebHeader> {
],
);
}
}

Loading…
Cancel
Save