Selaa lähdekoodia

更新订单页面

tags/0.0.1
Weller 4 vuotta sitten
vanhempi
commit
e81a3506a7
3 muutettua tiedostoa jossa 29 lisäystä ja 7 poistoa
  1. +10
    -0
      lib/pages/orders_page/bloc/order_content_bloc.dart
  2. +2
    -2
      lib/pages/orders_page/order_content_page.dart
  3. +17
    -5
      lib/pages/orders_page/views/order_item_widget.dart

+ 10
- 0
lib/pages/orders_page/bloc/order_content_bloc.dart Näytä tiedosto

@@ -33,6 +33,16 @@ class OrderContentBloc extends BlocBase {
void _loadData(dynamic data) {
List list = data ?? [];

OrderModel model = OrderModel();
model.itemId = '6918577752399759376';
model.imgUrl =
'https://t7.baidu.com/it/u=3616242789,1098670747&fm=79&app=86&size=h300&n=0&g=4n&f=jpeg?sec=1603444938&t=04aeb23595ac79d419be19ab92bea668';
model.title = '乐町百褶半身裙秋冬女2019新款复古麻花半身裙甜美百褶半身裙';
model.price = '108';
model.commission = '0';
model.commissionRate = '9.2';
_orders.add(model);

_orders = list.map((item) {
return OrderModel.fromJson(Map<String, dynamic>.from(item));
}).toList();


+ 2
- 2
lib/pages/orders_page/order_content_page.dart Näytä tiedosto

@@ -63,9 +63,9 @@ class _OrderContentContainerState extends State<OrderContentContainer> {
);
}
return ListView.builder(
itemCount: 20,
itemCount: orders.length,
itemBuilder: (context, index) {
return OrderItemWidget();
return OrderItemWidget(orders[index]);
});
});
}


+ 17
- 5
lib/pages/orders_page/views/order_item_widget.dart Näytä tiedosto

@@ -1,6 +1,12 @@
import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/orders_page/models/order_model.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class OrderItemWidget extends StatelessWidget {
final OrderModel model;

const OrderItemWidget(this.model, {Key key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Container(
@@ -56,7 +62,13 @@ class OrderItemWidget extends StatelessWidget {
margin: EdgeInsets.only(right: 10),
width: 96,
height: 96,
color: Colors.black12,
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: CachedNetworkImage(
imageUrl: model.imgUrl ?? '',
fit: BoxFit.cover,
),
),
),
Expanded(
child: Column(
@@ -80,20 +92,20 @@ class OrderItemWidget extends StatelessWidget {
padding: EdgeInsets.only(left: 2, right: 2, top: 3, bottom: 3),
margin: EdgeInsets.only(right: 4),
child: Text(
'类型',
'淘宝',
style: TextStyle(
fontSize: 9,
height: 1,
color: Colors.purpleAccent,
color: Colors.white,
),
),
decoration: BoxDecoration(
color: Colors.amber, borderRadius: BorderRadius.circular(2.5)),
color: Colors.redAccent, borderRadius: BorderRadius.circular(2.5)),
),
));
list.add(
TextSpan(
text: '桶装水抽水器饮水机泵器动桶装水抽水器饮水机泵器动',
text: model.title,
style: TextStyle(
fontSize: 15,
color: Color(0xff333333),


Ladataan…
Peruuta
Tallenna