瀏覽代碼

更新商品分享样式

tags/0.0.1
Weller 4 年之前
父節點
當前提交
cb6daf8275
共有 3 個文件被更改,包括 121 次插入83 次删除
  1. +2
    -0
      lib/pages/goods_share_page/goods_share_image/goods_share_image.dart
  2. +108
    -83
      lib/pages/goods_share_page/widgets/goods_share_edit.dart
  3. +11
    -0
      lib/widgets/public/custom_button/custom_bottom.dart

+ 2
- 0
lib/pages/goods_share_page/goods_share_image/goods_share_image.dart 查看文件

@@ -57,6 +57,8 @@ class _GoodsShareImageState extends State<GoodsShareImage> {
imgCheckSelected: _style.cssList.chooseImage, imgCheckSelected: _style.cssList.chooseImage,
child: GoodsShareEdit( child: GoodsShareEdit(
_content, _content,
imgCheck: _style.cssList.unChooseImage,
imgCheckSelected: _style.cssList.chooseImage,
onCopyClick: () { onCopyClick: () {
Clipboard.setData(ClipboardData(text: _content)); Clipboard.setData(ClipboardData(text: _content));
Fluttertoast.showToast(msg: '文案已复制'); Fluttertoast.showToast(msg: '文案已复制');


+ 108
- 83
lib/pages/goods_share_page/widgets/goods_share_edit.dart 查看文件

@@ -1,3 +1,4 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';


class GoodsShareEdit extends StatelessWidget { class GoodsShareEdit extends StatelessWidget {
@@ -5,11 +6,19 @@ class GoodsShareEdit extends StatelessWidget {
final VoidCallback onEditorClick; final VoidCallback onEditorClick;
final VoidCallback onCopyClick; final VoidCallback onCopyClick;


// final String imgCheck;
// final String imgCheckSelected;
final String imgCheck;
final String imgCheckSelected;
final String imgEdit;
final String imgCopy;


const GoodsShareEdit(this.message, const GoodsShareEdit(this.message,
{Key key, this.onEditorClick, this.onCopyClick})
{Key key,
this.onEditorClick,
this.onCopyClick,
this.imgCheck,
this.imgCheckSelected,
this.imgEdit,
this.imgCopy})
: super(key: key); : super(key: key);


@override @override
@@ -23,7 +32,8 @@ class GoodsShareEdit extends StatelessWidget {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: const EdgeInsets.only(left: 16, top: 10, right: 16),
padding:
const EdgeInsets.only(left: 16, top: 10, right: 16, bottom: 10),
child: Text( child: Text(
message, message,
style: TextStyle( style: TextStyle(
@@ -32,74 +42,82 @@ class GoodsShareEdit extends StatelessWidget {
), ),
), ),
), ),
Container(
padding:
const EdgeInsets.only(left: 16, top: 6, bottom: 6, right: 16),
width: double.infinity,
child: Wrap(
spacing: 10,
runSpacing: 6,
children: <Widget>[
GoodsShareCheckButton(
'标题',
isSelected: true,
),
GoodsShareCheckButton(
'收益',
isSelected: false,
),
GoodsShareCheckButton(
'邀请码',
isSelected: true,
),
GoodsShareCheckButton(
'链接',
isSelected: true,
),
],
),
),
Container(
width: double.infinity,
height: 0.5,
color: Color(0xffececec),
),
Container(
height: 44,
child: Row(
children: <Widget>[
Expanded(
child: GestureDetector(
child: Container(
color: Colors.transparent,
child: GoodsShareCheckButton(
'编辑模版',
isSelected: true,
),
),
onTap: onEditorClick,
),
),
Container(
width: 0.5,
height: 20,
color: Color(0xffececec),
),
Expanded(
child: GestureDetector(
child: Container(
color: Colors.transparent,
child: GoodsShareCheckButton(
'复制文案',
isSelected: false,
),
),
onTap: onCopyClick,
),
),
],
),
)
// Container(
// padding:
// const EdgeInsets.only(left: 16, top: 6, bottom: 6, right: 16),
// width: double.infinity,
// child: Wrap(
// spacing: 10,
// runSpacing: 6,
// children: <Widget>[
// GoodsShareCheckButton(
// '标题',
// imgIcon: this.imgCheck,
// imgIconSelected: this.imgCheckSelected,
// isSelected: false,
// ),
// GoodsShareCheckButton(
// '收益',
// imgIcon: this.imgCheck,
// imgIconSelected: this.imgCheckSelected,
// isSelected: false,
// ),
// GoodsShareCheckButton(
// '邀请码',
// imgIcon: this.imgCheck,
// imgIconSelected: this.imgCheckSelected,
// isSelected: false,
// ),
// GoodsShareCheckButton(
// '链接',
// imgIcon: this.imgCheck,
// imgIconSelected: this.imgCheckSelected,
// isSelected: false,
// ),
// ],
// ),
// ),
// Container(
// width: double.infinity,
// height: 0.5,
// color: Color(0xffececec),
// ),
// Container(
// height: 44,
// child: Row(
// children: <Widget>[
// Expanded(
// child: GestureDetector(
// child: Container(
// color: Colors.transparent,
// child: GoodsShareCheckButton(
// '编辑模版',
// isSelected: true,
// ),
// ),
// onTap: onEditorClick,
// ),
// ),
// Container(
// width: 0.5,
// height: 20,
// color: Color(0xffececec),
// ),
// Expanded(
// child: GestureDetector(
// child: Container(
// color: Colors.transparent,
// child: GoodsShareCheckButton(
// '复制文案',
// isSelected: false,
// ),
// ),
// onTap: onCopyClick,
// ),
// ),
// ],
// ),
// )
], ],
), ),
); );
@@ -109,8 +127,14 @@ class GoodsShareEdit extends StatelessWidget {
class GoodsShareCheckButton extends StatelessWidget { class GoodsShareCheckButton extends StatelessWidget {
final String title; final String title;
final bool isSelected; final bool isSelected;
final String imgIcon;
final String imgIconSelected;


const GoodsShareCheckButton(this.title, {Key key, this.isSelected = true})
const GoodsShareCheckButton(this.title,
{Key key,
this.isSelected = true,
this.imgIcon = '',
this.imgIconSelected = ''})
: super(key: key); : super(key: key);


@override @override
@@ -118,20 +142,21 @@ class GoodsShareCheckButton extends StatelessWidget {
return UnconstrainedBox( return UnconstrainedBox(
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Container(
width: 16,
height: 16,
margin: EdgeInsets.only(right: 6),
decoration: BoxDecoration(
color: isSelected ? Colors.redAccent : Colors.black12,
borderRadius: BorderRadius.circular(8),
),
),
imgIcon == null || imgIcon == ''
? Container()
: Container(
width: 16,
height: 16,
margin: EdgeInsets.only(right: 6),
child: CachedNetworkImage(
imageUrl: isSelected ? imgIconSelected : imgIcon,
),
),
Text( Text(
title, title,
style: TextStyle( style: TextStyle(
fontSize: 11, fontSize: 11,
color: isSelected ? Colors.redAccent : Color(0xff333333)),
color: isSelected ? Color(0xffff4242) : Color(0xff333333)),
), ),
], ],
), ),


+ 11
- 0
lib/widgets/public/custom_button/custom_bottom.dart 查看文件

@@ -31,6 +31,17 @@ class CustomButton extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
style.smallIcon == null || style.smallIcon == ''
? Container()
: Container(
width: 14,
height: 14,
margin: EdgeInsets.only(right: 4),
child: CachedNetworkImage(
imageUrl: style.smallIcon,
fit: BoxFit.cover,
),
),
Text( Text(
style.name, style.name,
style: TextStyle( style: TextStyle(


Loading…
取消
儲存