132 lines
4.2 KiB
Dart
132 lines
4.2 KiB
Dart
/*
|
|
* @Author: Aimee~
|
|
* @Date: 2022-06-06 17:33:14
|
|
* @LastEditTime: 2022-06-07 15:36:43
|
|
* @LastEditors: Aimee
|
|
* @FilePath: /gl_dao/lib/pages/store/cart/widget/goods_item.dart
|
|
* @Description: 购物车内的商品列表信息
|
|
*/
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:gl_dao/main_color.dart';
|
|
|
|
import '../../../components/dot_number.dart';
|
|
|
|
// import '../../../routes/mall_routes.dart';
|
|
|
|
class GoodsItem extends StatelessWidget {
|
|
final Map it;
|
|
const GoodsItem(this.it, {Key? key}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 8),
|
|
child: GestureDetector(
|
|
onTap: () {
|
|
// ignore: avoid_print
|
|
print('商品信息');
|
|
// Get.toNamed(MallRoutes.goods, arguments: {
|
|
// 'goodsId': 1,
|
|
// });
|
|
},
|
|
onLongPress: () {
|
|
Get.snackbar('提示', '长按了商品');
|
|
},
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
Radio(
|
|
toggleable: true,
|
|
value: false,
|
|
groupValue: 'G',
|
|
onChanged: (e) {},
|
|
),
|
|
ClipRRect(
|
|
borderRadius: BorderRadius.circular(4),
|
|
child: Image.asset(
|
|
'assets/images/detail.png',
|
|
width: 120,
|
|
height: 120 * 0.618,
|
|
fit: BoxFit.cover,
|
|
),
|
|
),
|
|
const SizedBox(
|
|
width: 8,
|
|
),
|
|
Expanded(
|
|
child: SizedBox(
|
|
height: 120 * 0.618,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
const Text(
|
|
'商品名称商品名称商品名称商品名称商品名称',
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w400,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
maxLines: 1,
|
|
),
|
|
const Text(
|
|
'型号描述',
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
overflow: TextOverflow.ellipsis,
|
|
color: Colors.black87,
|
|
),
|
|
maxLines: 1,
|
|
),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Row(
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
children: const [
|
|
// DotNumber(
|
|
// 123.22,
|
|
// dotLength: 2,
|
|
// // prefix: '¥',
|
|
// size: 16,
|
|
// color: tMainRedColor,
|
|
// ),
|
|
Text(
|
|
'123.22',
|
|
style: TextStyle(
|
|
fontSize: 17,
|
|
color: tMainRedColor,
|
|
),
|
|
),
|
|
SizedBox(width: 2),
|
|
Text(
|
|
'DT积分',
|
|
style: TextStyle(
|
|
fontSize: 10,
|
|
color: tMainRedColor,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Text(
|
|
'数量 x ${it["qty"]}',
|
|
style: const TextStyle(
|
|
color: Colors.grey,
|
|
fontSize: 13,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|