feat(apps): establish shared mobile design system
This commit is contained in:
@@ -22,9 +22,17 @@ class OrdersPage extends StatelessWidget {
|
||||
final action = await showModalBottomSheet<String>(
|
||||
context: context,
|
||||
builder: (context) => SafeArea(
|
||||
top: false,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 4, 20, 12),
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text('订单操作', style: Theme.of(context).textTheme.titleLarge),
|
||||
),
|
||||
),
|
||||
if (record.status == 16 || record.status == 18) ...[
|
||||
ListTile(
|
||||
title: const Text('支付宝支付'),
|
||||
@@ -75,12 +83,8 @@ class OrdersPage extends StatelessWidget {
|
||||
identity: record.identity,
|
||||
requestNo: const Uuid().v7(),
|
||||
channel: action,
|
||||
payType: kIsWeb
|
||||
? (action == 'alipay' ? 'wap' : 'jsapi')
|
||||
: 'app',
|
||||
openid: kIsWeb && action == 'wechat'
|
||||
? Uri.base.queryParameters['openid'] ?? ''
|
||||
: '',
|
||||
payType: kIsWeb ? (action == 'alipay' ? 'wap' : 'jsapi') : 'app',
|
||||
openid: kIsWeb && action == 'wechat' ? Uri.base.queryParameters['openid'] ?? '' : '',
|
||||
);
|
||||
await _launcher.launch(payment);
|
||||
if (context.mounted) {
|
||||
@@ -126,47 +130,53 @@ class OrdersPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => DefaultTabController(
|
||||
length: 4,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('我的订单'),
|
||||
bottom: const TabBar(
|
||||
tabs: [
|
||||
Tab(text: '商城'),
|
||||
Tab(text: '供气'),
|
||||
Tab(text: '退款'),
|
||||
Tab(text: '工单'),
|
||||
],
|
||||
),
|
||||
),
|
||||
body: TabBarView(
|
||||
children: [
|
||||
RecordListPage(
|
||||
title: '商城订单',
|
||||
eyebrow: '交易',
|
||||
viewModel: RecordListViewModel(repository.shopOrders),
|
||||
onRecordTap: (record) =>
|
||||
_openActions(context, record, 'shop'),
|
||||
),
|
||||
RecordListPage(
|
||||
title: '供气订单',
|
||||
eyebrow: '履约',
|
||||
viewModel: RecordListViewModel(repository.gasOrders),
|
||||
onRecordTap: (record) =>
|
||||
_openActions(context, record, 'gas'),
|
||||
),
|
||||
RecordListPage(
|
||||
title: '退款记录',
|
||||
eyebrow: '资金',
|
||||
viewModel: RecordListViewModel(repository.refunds),
|
||||
),
|
||||
RecordListPage(
|
||||
title: '服务工单',
|
||||
eyebrow: '服务',
|
||||
viewModel: RecordListViewModel(repository.tickets),
|
||||
),
|
||||
],
|
||||
),
|
||||
length: 4,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('我的订单'),
|
||||
bottom: const TabBar(
|
||||
tabs: [
|
||||
Tab(text: '商城'),
|
||||
Tab(text: '供气'),
|
||||
Tab(text: '退款'),
|
||||
Tab(text: '工单'),
|
||||
],
|
||||
),
|
||||
);
|
||||
),
|
||||
body: TabBarView(
|
||||
children: [
|
||||
RecordListPage(
|
||||
title: '商城订单',
|
||||
eyebrow: '交易',
|
||||
description: '查看商城订单并处理待支付或退款事项',
|
||||
embedded: true,
|
||||
viewModel: RecordListViewModel(repository.shopOrders),
|
||||
onRecordTap: (record) => _openActions(context, record, 'shop'),
|
||||
),
|
||||
RecordListPage(
|
||||
title: '供气订单',
|
||||
eyebrow: '履约',
|
||||
description: '查看供气订单与当前履约状态',
|
||||
embedded: true,
|
||||
viewModel: RecordListViewModel(repository.gasOrders),
|
||||
onRecordTap: (record) => _openActions(context, record, 'gas'),
|
||||
),
|
||||
RecordListPage(
|
||||
title: '退款记录',
|
||||
eyebrow: '资金',
|
||||
description: '退款结果以服务端审核和资金流水为准',
|
||||
embedded: true,
|
||||
viewModel: RecordListViewModel(repository.refunds),
|
||||
),
|
||||
RecordListPage(
|
||||
title: '服务工单',
|
||||
eyebrow: '服务',
|
||||
description: '查看维修、安装与其他服务工单',
|
||||
embedded: true,
|
||||
viewModel: RecordListViewModel(repository.tickets),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user