Browse Source

店铺增加店铺详情跳转;

增加详情文本页面
new_revision_app
wurong 2 years ago
parent
commit
fa275d8456
  1. 4
      lib/home/welfare_page.dart
  2. 3
      lib/main.dart
  3. 170
      lib/order/write_off_page.dart
  4. 49
      lib/store/store_html.dart
  5. 90
      lib/store/store_view/store_info.dart

4
lib/home/welfare_page.dart

@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -627,7 +629,7 @@ class _WelfarePage extends State<WelfarePage> {
'/router/write_off_page',
arguments: {
"couponId": cop.id,
"coupon": cop.toJson()
"coupon": jsonEncode(cop.toJson()),
});
} else {
showStoreSelector(cop.storeList);

3
lib/main.dart

@ -66,6 +66,7 @@ import 'package:huixiang/store/shopping/shopping_home/group_page_details.dart';
import 'package:huixiang/store/shopping/shopping_home/search_page.dart';
import 'package:huixiang/store/shopping/shopping_mall_home.dart';
import 'package:huixiang/setting/user_service_page.dart';
import 'package:huixiang/store/store_html.dart';
import 'package:huixiang/store/store_order.dart';
import 'package:huixiang/settlement/settlement.dart';
import 'package:huixiang/store/store_view/product_meals_sku.dart';
@ -426,4 +427,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
VipPayCode(),
'/router/system_notice': (context, {arguments}) =>
SystemNotice(),
'/router/store_html': (context, {arguments}) =>
StoreHtml(arguments:arguments),
};

170
lib/order/write_off_page.dart

@ -104,14 +104,16 @@ class _WriteOffPage extends State<WriteOffPage> {
children: [
Container(
alignment: Alignment.topCenter,
height: 530.h,
// height: 530.h,
height:470.h,
child: Stack(
alignment: Alignment.topCenter,
children: [
Image.asset(
"assets/image/write_off_bg.webp",
width: MediaQuery.of(context).size.width * 0.912,
height: 540.h,
// height: 540.h,
height: 480.h,
fit: BoxFit.fill,
),
LayoutBuilder(builder: (context, constraints) {
@ -163,47 +165,47 @@ class _WriteOffPage extends State<WriteOffPage> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
coupon != null
? "${coupon["memberCouponId"].substring(0, 4)} "
"${coupon["memberCouponId"].substring(4, 8)} "
"${coupon["memberCouponId"].substring(8, 12)} "
"${coupon["memberCouponId"].substring(12, 16)} "
"${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}"
: "",
style: TextStyle(
fontSize: 14.sp,
wordSpacing: coupon == null
? 10
: (MediaQuery.of(context).size.width -
64.w) /
(((coupon["memberCouponId"].length) * 4)),
letterSpacing: coupon == null
? 8
: (MediaQuery.of(context).size.width -
64.w) /
(((coupon["memberCouponId"].length) * 4)),
fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535),
),
),
SizedBox(
height: 15.h,
),
BarcodeWidget(
barcode: Barcode.code128(useCode128C: true),
data: coupon != null ? coupon["memberCouponId"] : "",
height: 72.h,
color: Colors.black,
drawText: false,
),
// Text(
// coupon != null
// ? "${coupon["memberCouponId"].substring(0, 4)} "
// "${coupon["memberCouponId"].substring(4, 8)} "
// "${coupon["memberCouponId"].substring(8, 12)} "
// "${coupon["memberCouponId"].substring(12, 16)} "
// "${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}"
// : "",
// style: TextStyle(
// fontSize: 14.sp,
// wordSpacing: coupon == null
// ? 10
// : (MediaQuery.of(context).size.width -
// 64.w) /
// (((coupon["memberCouponId"].length) * 4)),
// letterSpacing: coupon == null
// ? 8
// : (MediaQuery.of(context).size.width -
// 64.w) /
// (((coupon["memberCouponId"].length) * 4)),
// fontWeight: MyFontWeight.semi_bold,
// color: Color(0xFF353535),
// ),
// ),
// SizedBox(
// height: 15.h,
// ),
// BarcodeWidget(
// barcode: Barcode.code128(useCode128C: true),
// data: coupon != null ? coupon["memberCouponId"] : "",
// height: 72.h,
// color: Colors.black,
// drawText: false,
// ),
SizedBox(
height: 16.h,
),
Expanded(child: QrImage(
data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}",
version: QrVersions.auto,
size: 200.w,
size: 250.w,
gapless: true,
),),
SizedBox(
@ -485,54 +487,54 @@ class _WriteOffPage extends State<WriteOffPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: 3.w,
height: 15.h,
margin:
EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3),
color: Color(0xFF20662A),
),
),
Text(
S.of(context).shiyongtiaojian,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.sp,
color: Color(0xFF353535),
),
),
],
),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Container(
// width: 3.w,
// height: 15.h,
// margin:
// EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(3),
// color: Color(0xFF20662A),
// ),
// ),
// Text(
// S.of(context).shiyongtiaojian,
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 14.sp,
// color: Color(0xFF353535),
// ),
// ),
// ],
// ),
// SizedBox(height:12.h,),
// Row(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// SizedBox(
// width: 11.w,
// ),
// Expanded(
// child: Text(
// S
// .of(context)
// .qianwanghuixiangmendianduihuanhexiao,
// style: TextStyle(
// textBaseline: TextBaseline.alphabetic,
// fontSize: 14.sp,
// height: 1.5.h,
// color: Color(0xFF353535)),
// ),
// flex: 1,
// ),
// ],
// ),
SizedBox(height:12.h,),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: 11.w,
),
Expanded(
child: Text(
S
.of(context)
.qianwanghuixiangmendianduihuanhexiao,
style: TextStyle(
textBaseline: TextBaseline.alphabetic,
fontSize: 14.sp,
height: 1.5.h,
color: Color(0xFF353535)),
),
flex: 1,
),
],
),
SizedBox(height:16.h,),
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,

49
lib/store/store_html.dart

@ -0,0 +1,49 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
class StoreHtml extends StatefulWidget {
final Map<String, dynamic> arguments;
StoreHtml({this.arguments});
@override
State<StatefulWidget> createState() {
return _StoreHtml();
}
}
class _StoreHtml extends State<StoreHtml> with WidgetsBindingObserver {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: MyAppBar(
title:"店铺详情",
titleColor: Colors.black,
background: Color(0xFFFFFFFF),
leadingColor: Colors.black,
),
body: Container(
margin: EdgeInsets.only(left:11.w,right: 10.w),
child:Html(
data:widget.arguments["remark"] ?? "",
customImageRenders: {
networkSourceMatcher(): networkImageRender(
loadingWidget: () {
return Container();
},
),
},
),),
);
}
}

90
lib/store/store_view/store_info.dart

@ -25,12 +25,12 @@ class _StoreInfoView extends State<StoreInfoView> {
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(
// left: 16.w,
// right: 16.w,
// top: 5.h,
// bottom: 6.h,
),
height: MediaQuery.of(context).size.width >= 650 ? 180.h :166.h,
// left: 16.w,
// right: 16.w,
// top: 5.h,
// bottom: 6.h,
),
height: MediaQuery.of(context).size.width >= 650 ? 180.h : 166.h,
padding: EdgeInsets.all(12.w),
decoration: BoxDecoration(
color: Colors.white,
@ -54,19 +54,56 @@ class _StoreInfoView extends State<StoreInfoView> {
Expanded(
child: Column(
children: [
Container(
alignment: Alignment.centerLeft,
child: Text(
widget.storeInfo != null
? (widget.storeInfo.storeName ?? "")
: "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 18.sp,
color: Colors.black,
fontWeight: MyFontWeight.medium,
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child: Container(
alignment: Alignment.centerLeft,
child: Text(
widget.storeInfo != null
? (widget.storeInfo.storeName ?? "")
: "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 18.sp,
color: Colors.black,
fontWeight: MyFontWeight.medium,
),
),
)),
// GestureDetector(
// behavior: HitTestBehavior.opaque,
// onTap: (){
// Navigator.of(context).pushNamed('/router/store_html',arguments: {"remark":widget.storeInfo.remark});
// },
// child: Container(
// padding: EdgeInsets.symmetric(horizontal:8.w,vertical:3.h),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(2),
// border: Border.all(
// color:Color(0xFFEDEDED),
// )
// ),
// child: Row(
// children: [
// Text(
// "店铺详情",
// style: TextStyle(
// fontWeight: MyFontWeight.regular,
// fontSize: 12.sp,
// color: Color(0xFF4C4C4C),
// ),
// ),
// Image.asset(
// "assets/image/icon_right_z.webp",
// height:12.h,
// width:12.w,
// )
// ],
// ),
// ),
// )
],
),
Row(
children: [
@ -94,10 +131,10 @@ class _StoreInfoView extends State<StoreInfoView> {
S.of(context).yingyeshijian(widget.storeInfo == null
? ""
: (widget.storeInfo.openStartTime == null &&
widget.storeInfo.openEndTime == null)
? S.of(context).quantian
: "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} "
"- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"),
widget.storeInfo.openEndTime == null)
? S.of(context).quantian
: "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} "
"- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"),
style: TextStyle(
color: Color(0xFF353535),
fontWeight: MyFontWeight.regular,
@ -128,10 +165,8 @@ class _StoreInfoView extends State<StoreInfoView> {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child:Text(
"${S.of(context).dizhi}:${widget.storeInfo != null
? widget.storeInfo.address
: ""}",
child: Text(
"${S.of(context).dizhi}:${widget.storeInfo != null ? widget.storeInfo.address : ""}",
maxLines: 2,
textAlign: TextAlign.justify,
style: TextStyle(
@ -187,7 +222,6 @@ class _StoreInfoView extends State<StoreInfoView> {
);
}
showCallMobile() {
showCupertinoModalPopup(
context: context,

Loading…
Cancel
Save