newHost
王亚玲 2 years ago
commit d373d9e528

@ -1,3 +1,4 @@
import 'package:aku_new_community/ui/market/widget/goods_%20tag_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -67,8 +68,7 @@ class CollectionListCard extends StatelessWidget {
),
),
5.hb,
// _getIcon(2),
//_getIcon(model.kind??0),
GoodsTagWidget(type: model.kind??0),
Spacer(),
20.hb,
RichText(
@ -188,48 +188,4 @@ class CollectionListCard extends StatelessWidget {
return count + '';
}
Widget _getIcon(int type) {
if (type == 1) {
return Container(
width: 86.w,
height: 26.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.w),
),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFEC5329), Color(0xFFF58123)],
),
),
child: Text(
'京东自营',
style: TextStyle(fontSize: 18.sp, color: kForeGroundColor),
),
);
} else if (type == 2) {
return Container(
alignment: Alignment.center,
width: 86.w,
height: 30.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.w),
),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFF59B1C), Color(0xFFF5AF16)],
),
),
child: Text(
'京东POP',
style: TextStyle(fontSize: 18.sp, color: kForeGroundColor),
),
);
} else
return SizedBox();
}
}

@ -0,0 +1,12 @@
enum GoodTag {
jdSelfSupport(1, '京东自营'),
jdPop(2, '京东POP');
final typeNum;
final typeStr;
static GoodTag getValue(int value) =>
GoodTag.values.firstWhere((element) => element.typeNum == value);
const GoodTag(this.typeNum, this.typeStr);
}

@ -1,3 +1,4 @@
import 'package:aku_new_community/ui/market/widget/goods_%20tag_widget.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
@ -83,15 +84,15 @@ class MarketHomeGoodsCard extends StatelessWidget {
style: TextStyle(fontSize: 28.sp, color: ktextPrimary),
),
),
// Padding(
// padding: EdgeInsets.only(
// left: 16.w,
// right: 16.w,
// top: 10.w,
// ),
// child: Container(
// child: _getIcon(1),
// )),
Padding(
padding: EdgeInsets.only(
left: 16.w,
right: 16.w,
top: 10.w,
),
child: Container(
child: GoodsTagWidget(type: item.kind??0),
)),
10.hb,
Padding(
padding: EdgeInsets.symmetric(
@ -187,48 +188,4 @@ class MarketHomeGoodsCard extends StatelessWidget {
return count + '';
}
Widget _getIcon(int type) {
if (type == 1) {
return Container(
width: 86.w,
height: 26.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.w),
),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFEC5329), Color(0xFFF58123)],
),
),
child: Text(
'京东自营',
style: TextStyle(fontSize: 18.sp, color: kForeGroundColor),
),
);
} else if (type == 2) {
return Container(
alignment: Alignment.center,
width: 86.w,
height: 30.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.w),
),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFF59B1C), Color(0xFFF5AF16)],
),
),
child: Text(
'京东POP',
style: TextStyle(fontSize: 18.sp, color: kForeGroundColor),
),
);
} else
return SizedBox();
}
}

@ -515,18 +515,24 @@ class _MarketPageState extends State<MarketPage>
children: [
'积分商城'.richText.size(28.sp).italic.bold.black.make(),
8.wb,
Text(
'限时兑换',
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic,
foreground: Paint()
..shader = ui.Gradient.linear(
Offset(150, 690), Offset(150, 695), [
Color(0xFFF94B4B),
Color(0xFFF7B86F),
])),
ShaderMask(
shaderCallback: (bounds) {
return LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.red,
Colors.yellow,
]).createShader(bounds);
},
child: Text(
'限时兑换',
style: TextStyle(
fontSize: 24.sp,
color: Colors.white,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic),
),
),
Spacer(),
GestureDetector(

@ -1,5 +1,6 @@
import 'dart:async';
import 'package:aku_new_community/ui/market/widget/goods_%20tag_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -348,7 +349,7 @@ class _GoodDetailPageState extends State<GoodDetailPage> {
overflow: TextOverflow.ellipsis,
),
),
// _getIcon(_goodDetail!.kind),
GoodsTagWidget(type: _goodDetail!.kind),
Spacer(),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
@ -558,52 +559,6 @@ class _GoodDetailPageState extends State<GoodDetailPage> {
return url.substring(2);
}
Widget _getIcon(int type) {
if (type == 1) {
return Container(
margin: EdgeInsets.only(left: 15.w),
width: 86.w,
height: 26.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.w),
),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFEC5329), Color(0xFFF58123)],
),
),
child: Text(
'京东自营',
style: TextStyle(fontSize: 18.sp, color: kForeGroundColor),
),
);
} else if (type == 2) {
return Container(
alignment: Alignment.center,
width: 86.w,
height: 30.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.w),
),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFF59B1C), Color(0xFFF5AF16)],
),
),
child: Text(
'京东POP',
style: TextStyle(fontSize: 18.sp, color: kForeGroundColor),
),
);
} else
return SizedBox();
}
_bottomButton() {
return Container(
width: double.infinity,

@ -1,3 +1,4 @@
import 'package:aku_new_community/ui/market/widget/goods_%20tag_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -76,8 +77,7 @@ class GoodsListCardState extends State<GoodsListCard> {
),
),
5.hb,
// _getIcon(2),
//_getIcon(model.kind??0),
GoodsTagWidget(type: widget.model.kind??0),
Spacer(),
20.hb,
RichText(
@ -195,48 +195,4 @@ class GoodsListCardState extends State<GoodsListCard> {
return count + '';
}
Widget _getIcon(int type) {
if (type == 1) {
return Container(
width: 86.w,
height: 26.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.w),
),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFEC5329), Color(0xFFF58123)],
),
),
child: Text(
'京东自营',
style: TextStyle(fontSize: 18.sp, color: kForeGroundColor),
),
);
} else if (type == 2) {
return Container(
alignment: Alignment.center,
width: 86.w,
height: 30.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.w),
),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFF59B1C), Color(0xFFF5AF16)],
),
),
child: Text(
'京东POP',
style: TextStyle(fontSize: 18.sp, color: kForeGroundColor),
),
);
} else
return SizedBox();
}
}

@ -1,3 +1,4 @@
import 'package:aku_new_community/ui/market/widget/goods_%20tag_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -91,15 +92,15 @@ class _SearchGoodsCardState extends State<SearchGoodsCard> {
style: TextStyle(fontSize: 28.sp, color: ktextPrimary),
),
),
// Padding(
// padding: EdgeInsets.only(
// left: 16.w,
// right: 16.w,
// top: 10.w,
// ),
// child: Container(
// child: _getIcon(widget.item.kind ?? 0),
// )),
Padding(
padding: EdgeInsets.only(
left: 16.w,
right: 16.w,
top: 10.w,
),
child: Container(
child: GoodsTagWidget(type: widget.item.kind ?? 0),
)),
10.hb,
Padding(
padding: EdgeInsets.symmetric(

@ -0,0 +1,60 @@
import 'package:aku_new_community/utils/headers.dart';
import 'package:flutter/cupertino.dart';
import '../../../base/base_style.dart';
class GoodsTagWidget extends StatelessWidget {
final int type;
const GoodsTagWidget({Key? key, required this.type}) : super(key: key);
@override
Widget build(BuildContext context) {
return _getIcon(type);
}
Widget _getIcon(int type) {
if (type == 1) {
return Container(
width: 86.w,
height: 26.w,
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.w),
),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFEC5329), Color(0xFFF58123)],
),
),
child: Text(
'京东自营',
style: TextStyle(fontSize: 18.sp, color: kForeGroundColor),
),
);
} else if (type == 2) {
return Container(
alignment: Alignment.center,
width: 86.w,
height: 30.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.w),
),
gradient: LinearGradient(
begin: FractionalOffset.centerLeft,
end: FractionalOffset.centerRight,
colors: <Color>[Color(0xFFF59B1C), Color(0xFFF5AF16)],
),
),
child: Text(
'京东POP',
style: TextStyle(fontSize: 18.sp, color: kForeGroundColor),
),
);
} else
return SizedBox();
}
}
Loading…
Cancel
Save