Commit 142d8307f3759f1fbde7a3d818c08583e3fd2251

Authored by wdn127929
1 parent 50197839

微调整样式画图细节展示UI

... ... @@ -90,6 +90,9 @@ class _MiniprogramSettingPageState extends State<MiniprogramSettingPage> {
if (success) {
marketingCenterProvider.pageStateSettingMini = PageState.Success;
miniType = marketingCenterProvider.dzSellerConfModel!.liteStyle ?? '2-3';
if (miniType == '1' || miniType == '2' || miniType == '3') {
miniType = '2-3';
}
tilteContentC.text = marketingCenterProvider
.dzSellerConfModel!.liteStyleTitle ??
"您预订的${Provider.of<UserModel>(context, listen: false).user!.sellername},已经安排,点击查看详情";
... ... @@ -380,7 +383,7 @@ class _MiniprogramSettingPageState extends State<MiniprogramSettingPage> {
? '中午'
: '';
if (hour != '') {
if (hour != '' && section != '') {
section = section + ' ';
}
... ... @@ -445,6 +448,7 @@ class _MiniprogramSettingPageState extends State<MiniprogramSettingPage> {
Container(
width: w(10),
height: w(34),
alignment: Alignment.center,
child: Text(
week,
textAlign:
... ... @@ -453,6 +457,7 @@ class _MiniprogramSettingPageState extends State<MiniprogramSettingPage> {
overflow:
TextOverflow.ellipsis,
style: TextStyle(
height: 1,
// writingMode: TextWritingMode.verticalLr,
color: MyColours
.color_FFEFC5,
... ... @@ -464,32 +469,27 @@ class _MiniprogramSettingPageState extends State<MiniprogramSettingPage> {
)),
VEmptyView(14),
Container(
child: Container(
// constraints: BoxConstraints(
// maxWidth: w(300)),
decoration: BoxDecoration(
color: MyColours
.color_66FFEFC5,
borderRadius:
BorderRadius.circular(
r(3))),
padding: EdgeInsets.symmetric(
horizontal: w(4),
vertical: w(3)),
// height: h(26),
child: Text(
time,
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
color: MyColours
.color_FFEFC5,
fontWeight:
FontWeight.bold,
fontSize: font(10)),
))),
// constraints: BoxConstraints(
// maxWidth: w(300)),
decoration: BoxDecoration(
color: MyColours.color_66FFEFC5,
borderRadius:
BorderRadius.circular(
r(3))),
padding: EdgeInsets.symmetric(
horizontal: w(4),
vertical: w(3)),
// height: h(26),
child: Text(
time,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_FFEFC5,
fontWeight: FontWeight.bold,
fontSize: font(10)),
)),
],
),
],
... ... @@ -603,8 +603,8 @@ class _MiniprogramSettingPageState extends State<MiniprogramSettingPage> {
VEmptyView(8),
Container(
alignment: Alignment.center,
width: w(60),
height: w(13),
width: w(56),
// height: w(13),
// constraints: BoxConstraints(
// maxWidth: w(300)),
decoration: BoxDecoration(
... ... @@ -614,10 +614,10 @@ class _MiniprogramSettingPageState extends State<MiniprogramSettingPage> {
BorderRadius
.circular(
r(3))),
// padding:
// EdgeInsets.symmetric(
// horizontal: w(4),
// vertical: w(3)),
padding:
EdgeInsets.symmetric(
// horizontal: w(1),
vertical: w(3)),
// height: h(26),
child: Text(
time,
... ...
... ... @@ -8,6 +8,10 @@ double h(num height) {
return ScreenUtil().setWidth(height * 2);
}
double h2(num height) {
return ScreenUtil().setHeight(height * 2);
}
double r(num radius) {
return ScreenUtil().radius(radius * 2);
}
... ...
... ... @@ -2507,6 +2507,7 @@ class Utils {
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
height: 1,
maxLines: 1,
ellipsis: '3',
fontSize: 24));
... ... @@ -2517,7 +2518,7 @@ class Utils {
// 设置文本的宽度约束
ParagraphConstraints pc2 = ui.ParagraphConstraints(width: 500);
ui.Paragraph paragraph2 = pb2.build()..layout(pc2);
canvas.drawParagraph(paragraph2, Offset(0, 12));
canvas.drawParagraph(paragraph2, Offset(0, 14));
canvas.drawRect(Rect.fromLTWH(0, 348, 500, 52), paint);
... ... @@ -2526,6 +2527,7 @@ class Utils {
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
height: 1,
fontSize: 24));
pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 24));
pb.addText(time);
... ... @@ -2533,7 +2535,7 @@ class Utils {
// 设置文本的宽度约束
ParagraphConstraints pc = ui.ParagraphConstraints(width: 500);
ui.Paragraph paragraph = pb.build()..layout(pc);
canvas.drawParagraph(paragraph, Offset(0, 360));
canvas.drawParagraph(paragraph, Offset(0, 362));
// 绘制文字
// ui.ParagraphBuilder pb3 = ui.ParagraphBuilder(ui.ParagraphStyle(
... ... @@ -2607,6 +2609,7 @@ class Utils {
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
maxLines: 2,
height: 1,
fontStyle: FontStyle.normal,
fontSize: 24));
pb2.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 24));
... ... @@ -2622,6 +2625,7 @@ class Utils {
ui.ParagraphBuilder pb3 = ui.ParagraphBuilder(ui.ParagraphStyle(
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
height: 1,
fontStyle: FontStyle.normal,
fontSize: 48));
pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 48));
... ... @@ -2637,6 +2641,7 @@ class Utils {
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
height: 1,
fontSize: 24));
pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 24));
pb.addText(time);
... ... @@ -2644,7 +2649,7 @@ class Utils {
// 设置文本的宽度约束
ParagraphConstraints pc = ui.ParagraphConstraints(width: 500);
ui.Paragraph paragraph = pb.build()..layout(pc);
canvas.drawParagraph(paragraph, Offset(0, 270));
canvas.drawParagraph(paragraph, Offset(0, 265));
//下面的代码是生成图片的关键代码,以上绘制文字和圆圈的代码可以忽略不计
var picture =
... ... @@ -2681,7 +2686,7 @@ class Utils {
? _getDsoltStrShow(dsolt, isCan: false)
: '';
if (hour != '') {
if (hour != '' && section != '') {
section = section + ' ';
}
... ... @@ -2724,6 +2729,7 @@ class Utils {
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
height: 1,
fontSize: 48));
pb3.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 48));
pb3.addText(month);
... ... @@ -2746,11 +2752,11 @@ class Utils {
// 设置文本的宽度约束
ParagraphConstraints pc4 = ui.ParagraphConstraints(width: 30);
ui.Paragraph paragraph4 = pb4.build()..layout(pc4);
canvas.drawParagraph(paragraph4, Offset(430, 264));
canvas.drawParagraph(paragraph4, Offset(430, 250));
Rect rect = subType1 == '1'
? Rect.fromLTWH(315, 317, 140, 38)
: Rect.fromLTWH(387, 317, 67, 36);
? Rect.fromLTWH(315, 310, 140, 38)
: Rect.fromLTWH(386, 310, 67, 37);
paint.color = MyColours.color_66FFEFC5;
RRect rRect = RRect.fromRectAndRadius(rect, Radius.circular(6));
canvas.drawRRect(rRect, paint);
... ... @@ -2760,14 +2766,15 @@ class Utils {
ui.ParagraphBuilder pb = ui.ParagraphBuilder(ui.ParagraphStyle(
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
height: 1,
fontStyle: FontStyle.normal,
fontSize: 24));
pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 24));
pb.addText(time);
// 设置文本的宽度约束
double width = subType1 == '1' ? 200 : 100;
Offset offset = subType1 == '1' ? Offset(285, 320) : Offset(370, 320);
double width = subType1 == '1' ? 200 : 114;
Offset offset = subType1 == '1' ? Offset(285, 320) : Offset(360, 318);
ParagraphConstraints pc = ui.ParagraphConstraints(width: width);
ui.Paragraph paragraph = pb.build()..layout(pc);
canvas.drawParagraph(paragraph, offset);
... ... @@ -2849,6 +2856,7 @@ class Utils {
// 绘制文字
ui.ParagraphBuilder pb3 = ui.ParagraphBuilder(ui.ParagraphStyle(
textAlign: TextAlign.center,
height: 1,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
fontSize: 20));
... ... @@ -2863,7 +2871,7 @@ class Utils {
// 绘制文字
ui.ParagraphBuilder pb4 = ui.ParagraphBuilder(ui.ParagraphStyle(
textAlign: TextAlign.center,
// height: 1,
height: 1,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
fontSize: 20));
... ... @@ -2875,16 +2883,18 @@ class Utils {
ui.Paragraph paragraph4 = pb4.build()..layout(pc4);
canvas.drawParagraph(paragraph4, Offset(420, 320));
Rect rect = Rect.fromLTWH(350, 351, 118, 30);
Rect rect = Rect.fromLTWH(350, 348, 118, 30);
paint.color = MyColours.color_66FFEFC5;
RRect rRect = RRect.fromRectAndRadius(rect, Radius.circular(6));
canvas.drawRRect(rRect, paint);
paint.color = MyColours.color_99000000;
// 绘制文字
ui.ParagraphBuilder pb = ui.ParagraphBuilder(ui.ParagraphStyle(
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
height: 1,
fontStyle: FontStyle.normal,
fontSize: 20));
pb.pushStyle(ui.TextStyle(color: MyColours.color_FFEFC5, fontSize: 20));
... ... @@ -3198,6 +3208,9 @@ class Utils {
if (liteStyle != '0') {
//画图
// 4种情况的图分别画出来
if (liteStyle == '1' || liteStyle == '2' || liteStyle == '3') {
liteStyle = '2-3';
}
List<String> subType = liteStyle!.split('-');
String subType0 = subType[0]; //几号模版
if (subType0 == '1') {
... ...