Ver a proveniência

更新商品分享样式

tags/0.0.1
Weller há 4 anos
ascendente
cometimento
cb6daf8275
3 ficheiros alterados com 121 adições e 83 eliminações
  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 Ver ficheiro

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


+ 108
- 83
lib/pages/goods_share_page/widgets/goods_share_edit.dart Ver ficheiro

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

class GoodsShareEdit extends StatelessWidget {
@@ -5,11 +6,19 @@ class GoodsShareEdit extends StatelessWidget {
final VoidCallback onEditorClick;
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,
{Key key, this.onEditorClick, this.onCopyClick})
{Key key,
this.onEditorClick,
this.onCopyClick,
this.imgCheck,
this.imgCheckSelected,
this.imgEdit,
this.imgCopy})
: super(key: key);

@override
@@ -23,7 +32,8 @@ class GoodsShareEdit extends StatelessWidget {
child: Column(
children: <Widget>[
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(
message,
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 {
final String title;
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);

@override
@@ -118,20 +142,21 @@ class GoodsShareCheckButton extends StatelessWidget {
return UnconstrainedBox(
child: Row(
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(
title,
style: TextStyle(
fontSize: 11,
color: isSelected ? Colors.redAccent : Color(0xff333333)),
color: isSelected ? Color(0xffff4242) : Color(0xff333333)),
),
],
),


+ 11
- 0
lib/widgets/public/custom_button/custom_bottom.dart Ver ficheiro

@@ -31,6 +31,17 @@ class CustomButton extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
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(
style.name,
style: TextStyle(


Carregando…
Cancelar
Guardar