136 lines
3.5 KiB
Dart
136 lines
3.5 KiB
Dart
/*
|
|
* @Author: zhangdongxue zhangdongxue@uz.cn
|
|
* @Date: 2022-05-26 13:16:03
|
|
* @LastEditors: zhangdongxue zhangdongxue@uz.cn
|
|
* @LastEditTime: 2022-05-26 17:06:33
|
|
* @FilePath: /gl_dao/lib/pages/store/store.dart
|
|
* @Description: 商城首页
|
|
*/
|
|
import 'package:flutter/material.dart';
|
|
// import '../auth/auth.dart';
|
|
|
|
import '../../https/auth_api.dart';
|
|
|
|
class StorePages extends StatefulWidget {
|
|
const StorePages({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<StorePages> createState() => _StorePagesState();
|
|
}
|
|
|
|
class _StorePagesState extends State<StorePages> {
|
|
@override
|
|
void initState() {
|
|
HttpApi().apiPost(
|
|
'user/auth/sms',
|
|
body: {
|
|
'mobileNo': '18245180131',
|
|
'code': '0000',
|
|
},
|
|
);
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
shadowColor: Colors.white.withOpacity(0),
|
|
backgroundColor: Colors.red.withOpacity(.9),
|
|
leadingWidth: 0,
|
|
leading: IconButton(
|
|
tooltip: 'hello',
|
|
icon: const Icon(
|
|
Icons.location_on_outlined,
|
|
size: 20,
|
|
),
|
|
onPressed: () {
|
|
print('menu Pressed');
|
|
},
|
|
),
|
|
title: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
GestureDetector(
|
|
onTap: selectCity,
|
|
child: const Text(
|
|
'全国',
|
|
style: TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 15,
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(width: 14),
|
|
Expanded(
|
|
flex: 1,
|
|
child: GestureDetector(
|
|
onTap: search,
|
|
child: Container(
|
|
padding: const EdgeInsets.only(left: 16),
|
|
decoration: const BoxDecoration(
|
|
borderRadius: BorderRadius.all(
|
|
Radius.circular(36.0),
|
|
),
|
|
color: Colors.white,
|
|
),
|
|
height: 34,
|
|
child: Row(
|
|
children: [
|
|
Image.asset(
|
|
'assets/images/search.png',
|
|
width: 16.0,
|
|
),
|
|
const SizedBox(width: 6),
|
|
const Text(
|
|
'请搜索商家或商品',
|
|
style: TextStyle(
|
|
color: Colors.grey,
|
|
fontSize: 14,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
centerTitle: true, // 是否居中显示
|
|
actions: <Widget>[
|
|
IconButton(
|
|
icon: const Icon(Icons.add),
|
|
tooltip: "more_horiz",
|
|
onPressed: () {
|
|
print('点击了加号');
|
|
},
|
|
)
|
|
],
|
|
),
|
|
body: Column(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
// 按钮前面加上icon
|
|
ElevatedButton.icon(
|
|
onPressed: () {},
|
|
icon: Icon(Icons.search),
|
|
label: Text('图标按钮'),
|
|
),
|
|
],
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
selectCity() {
|
|
print('selectCity');
|
|
}
|
|
|
|
search() {
|
|
print('search');
|
|
}
|
|
}
|