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:dio/dio.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -627,7 +629,7 @@ class _WelfarePage extends State<WelfarePage> {
'/router/write_off_page', '/router/write_off_page',
arguments: { arguments: {
"couponId": cop.id, "couponId": cop.id,
"coupon": cop.toJson() "coupon": jsonEncode(cop.toJson()),
}); });
} else { } else {
showStoreSelector(cop.storeList); 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_home/search_page.dart';
import 'package:huixiang/store/shopping/shopping_mall_home.dart'; import 'package:huixiang/store/shopping/shopping_mall_home.dart';
import 'package:huixiang/setting/user_service_page.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/store/store_order.dart';
import 'package:huixiang/settlement/settlement.dart'; import 'package:huixiang/settlement/settlement.dart';
import 'package:huixiang/store/store_view/product_meals_sku.dart'; import 'package:huixiang/store/store_view/product_meals_sku.dart';
@ -426,4 +427,6 @@ Map<String, WidgetBuilder> routers = <String, WidgetBuilder>{
VipPayCode(), VipPayCode(),
'/router/system_notice': (context, {arguments}) => '/router/system_notice': (context, {arguments}) =>
SystemNotice(), 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: [ children: [
Container( Container(
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
height: 530.h, // height: 530.h,
height:470.h,
child: Stack( child: Stack(
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
children: [ children: [
Image.asset( Image.asset(
"assets/image/write_off_bg.webp", "assets/image/write_off_bg.webp",
width: MediaQuery.of(context).size.width * 0.912, width: MediaQuery.of(context).size.width * 0.912,
height: 540.h, // height: 540.h,
height: 480.h,
fit: BoxFit.fill, fit: BoxFit.fill,
), ),
LayoutBuilder(builder: (context, constraints) { LayoutBuilder(builder: (context, constraints) {
@ -163,47 +165,47 @@ class _WriteOffPage extends State<WriteOffPage> {
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( // Text(
coupon != null // coupon != null
? "${coupon["memberCouponId"].substring(0, 4)} " // ? "${coupon["memberCouponId"].substring(0, 4)} "
"${coupon["memberCouponId"].substring(4, 8)} " // "${coupon["memberCouponId"].substring(4, 8)} "
"${coupon["memberCouponId"].substring(8, 12)} " // "${coupon["memberCouponId"].substring(8, 12)} "
"${coupon["memberCouponId"].substring(12, 16)} " // "${coupon["memberCouponId"].substring(12, 16)} "
"${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}" // "${coupon["memberCouponId"].substring(16, coupon["memberCouponId"].length)}"
: "", // : "",
style: TextStyle( // style: TextStyle(
fontSize: 14.sp, // fontSize: 14.sp,
wordSpacing: coupon == null // wordSpacing: coupon == null
? 10 // ? 10
: (MediaQuery.of(context).size.width - // : (MediaQuery.of(context).size.width -
64.w) / // 64.w) /
(((coupon["memberCouponId"].length) * 4)), // (((coupon["memberCouponId"].length) * 4)),
letterSpacing: coupon == null // letterSpacing: coupon == null
? 8 // ? 8
: (MediaQuery.of(context).size.width - // : (MediaQuery.of(context).size.width -
64.w) / // 64.w) /
(((coupon["memberCouponId"].length) * 4)), // (((coupon["memberCouponId"].length) * 4)),
fontWeight: MyFontWeight.semi_bold, // fontWeight: MyFontWeight.semi_bold,
color: Color(0xFF353535), // color: Color(0xFF353535),
), // ),
), // ),
SizedBox( // SizedBox(
height: 15.h, // height: 15.h,
), // ),
BarcodeWidget( // BarcodeWidget(
barcode: Barcode.code128(useCode128C: true), // barcode: Barcode.code128(useCode128C: true),
data: coupon != null ? coupon["memberCouponId"] : "", // data: coupon != null ? coupon["memberCouponId"] : "",
height: 72.h, // height: 72.h,
color: Colors.black, // color: Colors.black,
drawText: false, // drawText: false,
), // ),
SizedBox( SizedBox(
height: 16.h, height: 16.h,
), ),
Expanded(child: QrImage( Expanded(child: QrImage(
data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}", data: "{\"type\":\"wiped\",\"memberCouponId\":\"${coupon["memberCouponId"]}\"}",
version: QrVersions.auto, version: QrVersions.auto,
size: 200.w, size: 250.w,
gapless: true, gapless: true,
),), ),),
SizedBox( SizedBox(
@ -485,54 +487,54 @@ class _WriteOffPage extends State<WriteOffPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Row( // Row(
mainAxisAlignment: MainAxisAlignment.start, // mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, // crossAxisAlignment: CrossAxisAlignment.center,
children: [ // children: [
Container( // Container(
width: 3.w, // width: 3.w,
height: 15.h, // height: 15.h,
margin: // margin:
EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h), // EdgeInsets.fromLTRB(4.w, 7.h, 4.w, 7.h),
decoration: BoxDecoration( // decoration: BoxDecoration(
borderRadius: BorderRadius.circular(3), // borderRadius: BorderRadius.circular(3),
color: Color(0xFF20662A), // color: Color(0xFF20662A),
), // ),
), // ),
Text( // Text(
S.of(context).shiyongtiaojian, // S.of(context).shiyongtiaojian,
style: TextStyle( // style: TextStyle(
fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
fontSize: 14.sp, // fontSize: 14.sp,
color: Color(0xFF353535), // 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,), 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( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, 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) { Widget build(BuildContext context) {
return Container( return Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(
// left: 16.w, // left: 16.w,
// right: 16.w, // right: 16.w,
// top: 5.h, // top: 5.h,
// bottom: 6.h, // bottom: 6.h,
), ),
height: MediaQuery.of(context).size.width >= 650 ? 180.h :166.h, height: MediaQuery.of(context).size.width >= 650 ? 180.h : 166.h,
padding: EdgeInsets.all(12.w), padding: EdgeInsets.all(12.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -54,19 +54,56 @@ class _StoreInfoView extends State<StoreInfoView> {
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Container( Row(
alignment: Alignment.centerLeft, crossAxisAlignment: CrossAxisAlignment.center,
child: Text( children: [
widget.storeInfo != null Expanded(child: Container(
? (widget.storeInfo.storeName ?? "") alignment: Alignment.centerLeft,
: "", child: Text(
overflow: TextOverflow.ellipsis, widget.storeInfo != null
style: TextStyle( ? (widget.storeInfo.storeName ?? "")
fontSize: 18.sp, : "",
color: Colors.black, overflow: TextOverflow.ellipsis,
fontWeight: MyFontWeight.medium, 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( Row(
children: [ children: [
@ -94,10 +131,10 @@ class _StoreInfoView extends State<StoreInfoView> {
S.of(context).yingyeshijian(widget.storeInfo == null S.of(context).yingyeshijian(widget.storeInfo == null
? "" ? ""
: (widget.storeInfo.openStartTime == null && : (widget.storeInfo.openStartTime == null &&
widget.storeInfo.openEndTime == null) widget.storeInfo.openEndTime == null)
? S.of(context).quantian ? S.of(context).quantian
: "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} " : "${widget.storeInfo.openStartTime.substring(0, widget.storeInfo.openStartTime.lastIndexOf(":"))} "
"- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"), "- ${widget.storeInfo.openEndTime.substring(0, widget.storeInfo.openEndTime.lastIndexOf(":"))}"),
style: TextStyle( style: TextStyle(
color: Color(0xFF353535), color: Color(0xFF353535),
fontWeight: MyFontWeight.regular, fontWeight: MyFontWeight.regular,
@ -128,10 +165,8 @@ class _StoreInfoView extends State<StoreInfoView> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child:Text( child: Text(
"${S.of(context).dizhi}:${widget.storeInfo != null "${S.of(context).dizhi}:${widget.storeInfo != null ? widget.storeInfo.address : ""}",
? widget.storeInfo.address
: ""}",
maxLines: 2, maxLines: 2,
textAlign: TextAlign.justify, textAlign: TextAlign.justify,
style: TextStyle( style: TextStyle(
@ -187,7 +222,6 @@ class _StoreInfoView extends State<StoreInfoView> {
); );
} }
showCallMobile() { showCallMobile() {
showCupertinoModalPopup( showCupertinoModalPopup(
context: context, context: context,

Loading…
Cancel
Save