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/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -67,8 +68,7 @@ class CollectionListCard extends StatelessWidget {
), ),
), ),
5.hb, 5.hb,
// _getIcon(2), GoodsTagWidget(type: model.kind??0),
//_getIcon(model.kind??0),
Spacer(), Spacer(),
20.hb, 20.hb,
RichText( RichText(
@ -188,48 +188,4 @@ class CollectionListCard extends StatelessWidget {
return count + ''; 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:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -83,15 +84,15 @@ class MarketHomeGoodsCard extends StatelessWidget {
style: TextStyle(fontSize: 28.sp, color: ktextPrimary), style: TextStyle(fontSize: 28.sp, color: ktextPrimary),
), ),
), ),
// Padding( Padding(
// padding: EdgeInsets.only( padding: EdgeInsets.only(
// left: 16.w, left: 16.w,
// right: 16.w, right: 16.w,
// top: 10.w, top: 10.w,
// ), ),
// child: Container( child: Container(
// child: _getIcon(1), child: GoodsTagWidget(type: item.kind??0),
// )), )),
10.hb, 10.hb,
Padding( Padding(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
@ -187,48 +188,4 @@ class MarketHomeGoodsCard extends StatelessWidget {
return count + ''; 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: [ children: [
'积分商城'.richText.size(28.sp).italic.bold.black.make(), '积分商城'.richText.size(28.sp).italic.bold.black.make(),
8.wb, 8.wb,
Text( ShaderMask(
'限时兑换', shaderCallback: (bounds) {
style: TextStyle( return LinearGradient(
fontSize: 24.sp, begin: Alignment.topCenter,
fontWeight: FontWeight.bold, end: Alignment.bottomCenter,
fontStyle: FontStyle.italic, colors: [
foreground: Paint() Colors.red,
..shader = ui.Gradient.linear( Colors.yellow,
Offset(150, 690), Offset(150, 695), [ ]).createShader(bounds);
Color(0xFFF94B4B), },
Color(0xFFF7B86F), child: Text(
])), '限时兑换',
style: TextStyle(
fontSize: 24.sp,
color: Colors.white,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.italic),
),
), ),
Spacer(), Spacer(),
GestureDetector( GestureDetector(

@ -1,5 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:aku_new_community/ui/market/widget/goods_%20tag_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -348,7 +349,7 @@ class _GoodDetailPageState extends State<GoodDetailPage> {
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
), ),
// _getIcon(_goodDetail!.kind), GoodsTagWidget(type: _goodDetail!.kind),
Spacer(), Spacer(),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -558,52 +559,6 @@ class _GoodDetailPageState extends State<GoodDetailPage> {
return url.substring(2); 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() { _bottomButton() {
return Container( return Container(
width: double.infinity, 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/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -76,8 +77,7 @@ class GoodsListCardState extends State<GoodsListCard> {
), ),
), ),
5.hb, 5.hb,
// _getIcon(2), GoodsTagWidget(type: widget.model.kind??0),
//_getIcon(model.kind??0),
Spacer(), Spacer(),
20.hb, 20.hb,
RichText( RichText(
@ -195,48 +195,4 @@ class GoodsListCardState extends State<GoodsListCard> {
return count + ''; 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/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -91,15 +92,15 @@ class _SearchGoodsCardState extends State<SearchGoodsCard> {
style: TextStyle(fontSize: 28.sp, color: ktextPrimary), style: TextStyle(fontSize: 28.sp, color: ktextPrimary),
), ),
), ),
// Padding( Padding(
// padding: EdgeInsets.only( padding: EdgeInsets.only(
// left: 16.w, left: 16.w,
// right: 16.w, right: 16.w,
// top: 10.w, top: 10.w,
// ), ),
// child: Container( child: Container(
// child: _getIcon(widget.item.kind ?? 0), child: GoodsTagWidget(type: widget.item.kind ?? 0),
// )), )),
10.hb, 10.hb,
Padding( Padding(
padding: EdgeInsets.symmetric( 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