Browse Source

添加订单页面,添加授权控件

tags/0.0.1
Weller 4 years ago
parent
commit
e31353bb92
14 changed files with 595 additions and 9 deletions
  1. +61
    -1
      .dart_tool/package_config.json
  2. +5
    -3
      example/android/app/src/main/AndroidManifest.xml
  3. +1
    -1
      example/ios/Podfile
  4. +89
    -1
      example/ios/Podfile.lock
  5. +107
    -0
      lib/pages/orders_page/orders_page.dart
  6. +122
    -0
      lib/pages/orders_page/views/order_item_widget.dart
  7. +23
    -0
      lib/pages/orders_page/views/order_serch_widget.dart
  8. +59
    -0
      lib/pages/orders_page/views/order_tabbar_widget.dart
  9. +7
    -3
      lib/register.dart
  10. +65
    -0
      lib/widgets/home/home_auth/home_auth.dart
  11. +21
    -0
      lib/widgets/home/home_auth/home_auth_creater.dart
  12. +26
    -0
      lib/widgets/home/home_auth/home_auth_delegate.dart
  13. +1
    -0
      lib/widgets/home/home_goods/home_goods_header.dart
  14. +8
    -0
      lib/widgets/others/overlay/taobao_auth_overlay.dart

+ 61
- 1
.dart_tool/package_config.json View File

@@ -205,6 +205,12 @@
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "flutter_alibc",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_alibc-0.0.15",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "flutter_bloc",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/flutter_bloc-4.0.1",
@@ -343,6 +349,12 @@
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "jdsdk",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/jdsdk-0.0.1",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "js",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/js-0.6.2",
@@ -463,6 +475,12 @@
"packageUri": "lib/",
"languageVersion": "1.24"
},
{
"name": "platform_detect",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/platform_detect-1.4.0",
"packageUri": "lib/",
"languageVersion": "2.4"
},
{
"name": "plugin_platform_interface",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/plugin_platform_interface-1.0.2",
@@ -655,6 +673,42 @@
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "url_launcher",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher-5.6.0",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "url_launcher_linux",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_linux-0.0.1+1",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "url_launcher_macos",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_macos-0.0.1+8",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "url_launcher_platform_interface",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_platform_interface-1.0.8",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "url_launcher_web",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_web-0.1.3+2",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "url_launcher_windows",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/url_launcher_windows-0.0.1+1",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "uuid",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/uuid-2.2.2",
@@ -679,6 +733,12 @@
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "webview_flutter",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/webview_flutter-0.3.22+1",
"packageUri": "lib/",
"languageVersion": "2.7"
},
{
"name": "xdg_directories",
"rootUri": "file:///Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/xdg_directories-0.1.0",
@@ -710,7 +770,7 @@
"languageVersion": "2.1"
}
],
"generated": "2020-09-17T12:08:09.612292Z",
"generated": "2020-09-19T06:19:07.938950Z",
"generator": "pub",
"generatorVersion": "2.7.2"
}

+ 5
- 3
example/android/app/src/main/AndroidManifest.xml View File

@@ -1,4 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="cn.zhios.zhiying_base_widget_example">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
@@ -8,7 +9,8 @@
<application
android:name="io.flutter.app.FlutterApplication"
android:label="zhiying_base_widget_example"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
tools:replace="android:label">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
@@ -17,8 +19,8 @@
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.


+ 1
- 1
example/ios/Podfile View File

@@ -1,6 +1,6 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
source 'http://repo.baichuan-ios.taobao.com/baichuanSDK/AliBCSpecs.git'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'



+ 89
- 1
example/ios/Podfile.lock View File

@@ -1,7 +1,22 @@
PODS:
- AliAuthSDK (1.1.0.41-bc)
- AlibcTradeSDK (4.0.1.6)
- AliLinkPartnerSDK (4.0.0.24)
- BCUserTrack (5.2.0.18-appkeys):
- UTDID
- device_info (0.0.1):
- Flutter
- Flutter (1.0.0)
- flutter_alibc (0.0.1):
- AliAuthSDK (= 1.1.0.41-bc)
- AlibcTradeSDK (= 4.0.1.6)
- AliLinkPartnerSDK (= 4.0.0.24)
- BCUserTrack (= 5.2.0.18-appkeys)
- Flutter
- mtopSDK (= 3.0.0.3-BC)
- securityGuard (= 5.4.191)
- UTDID (= 1.1.0.16)
- WindVane (= 8.5.0.46-bc11)
- flutter_native_image (0.0.1):
- Flutter
- flutter_plugin_android_lifecycle (0.0.1):
@@ -16,6 +31,9 @@ PODS:
- TOCropViewController (~> 2.5.2)
- image_picker (0.0.1):
- Flutter
- jdsdk (0.0.1):
- Flutter
- mtopSDK (3.0.0.3-BC)
- package_info (0.0.1):
- Flutter
- path_provider (0.0.1):
@@ -24,6 +42,7 @@ PODS:
- Flutter
- path_provider_macos (0.0.1):
- Flutter
- securityGuard (5.4.191)
- shared_preferences (0.0.1):
- Flutter
- shared_preferences_linux (0.0.1):
@@ -36,6 +55,26 @@ PODS:
- Flutter
- FMDB (~> 2.7.2)
- TOCropViewController (2.5.3)
- url_launcher (0.0.1):
- Flutter
- url_launcher_linux (0.0.1):
- Flutter
- url_launcher_macos (0.0.1):
- Flutter
- url_launcher_web (0.0.1):
- Flutter
- url_launcher_windows (0.0.1):
- Flutter
- UTDID (1.1.0.16)
- webview_flutter (0.0.1):
- Flutter
- WindVane (8.5.0.46-bc11):
- WindVane/Basic (= 8.5.0.46-bc11)
- WindVane/Core (= 8.5.0.46-bc11)
- WindVane/WindVane (= 8.5.0.46-bc11)
- WindVane/Basic (8.5.0.46-bc11)
- WindVane/Core (8.5.0.46-bc11)
- WindVane/WindVane (8.5.0.46-bc11)
- zhiying_base_widget (0.0.1):
- Flutter
- zhiying_comm (0.0.1):
@@ -44,11 +83,13 @@ PODS:
DEPENDENCIES:
- device_info (from `.symlinks/plugins/device_info/ios`)
- Flutter (from `Flutter`)
- flutter_alibc (from `.symlinks/plugins/flutter_alibc/ios`)
- flutter_native_image (from `.symlinks/plugins/flutter_native_image/ios`)
- flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- image_cropper (from `.symlinks/plugins/image_cropper/ios`)
- image_picker (from `.symlinks/plugins/image_picker/ios`)
- jdsdk (from `.symlinks/plugins/jdsdk/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`)
@@ -58,10 +99,25 @@ DEPENDENCIES:
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
- url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`)
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
- zhiying_base_widget (from `.symlinks/plugins/zhiying_base_widget/ios`)
- zhiying_comm (from `.symlinks/plugins/zhiying_comm/ios`)

SPEC REPOS:
http://repo.baichuan-ios.taobao.com/baichuanSDK/AliBCSpecs.git:
- AliAuthSDK
- AlibcTradeSDK
- AliLinkPartnerSDK
- BCUserTrack
- mtopSDK
- securityGuard
- UTDID
- WindVane
trunk:
- FMDB
- TOCropViewController
@@ -71,6 +127,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/device_info/ios"
Flutter:
:path: Flutter
flutter_alibc:
:path: ".symlinks/plugins/flutter_alibc/ios"
flutter_native_image:
:path: ".symlinks/plugins/flutter_native_image/ios"
flutter_plugin_android_lifecycle:
@@ -81,6 +139,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/image_cropper/ios"
image_picker:
:path: ".symlinks/plugins/image_picker/ios"
jdsdk:
:path: ".symlinks/plugins/jdsdk/ios"
package_info:
:path: ".symlinks/plugins/package_info/ios"
path_provider:
@@ -99,33 +159,61 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/shared_preferences_web/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher:
:path: ".symlinks/plugins/url_launcher/ios"
url_launcher_linux:
:path: ".symlinks/plugins/url_launcher_linux/ios"
url_launcher_macos:
:path: ".symlinks/plugins/url_launcher_macos/ios"
url_launcher_web:
:path: ".symlinks/plugins/url_launcher_web/ios"
url_launcher_windows:
:path: ".symlinks/plugins/url_launcher_windows/ios"
webview_flutter:
:path: ".symlinks/plugins/webview_flutter/ios"
zhiying_base_widget:
:path: ".symlinks/plugins/zhiying_base_widget/ios"
zhiying_comm:
:path: ".symlinks/plugins/zhiying_comm/ios"

SPEC CHECKSUMS:
AliAuthSDK: 7018e8f3c8be3382e60f69d3b517c7de34c351e0
AlibcTradeSDK: 9a3e7af6cd648dd1f85684e82694c213fe48dad2
AliLinkPartnerSDK: c5778cdfdcee7bfe342238d39a77766184d36a46
BCUserTrack: 49251c6fb7c65cbbc221a492bbd3f3e142f1fb0f
device_info: d7d233b645a32c40dfdc212de5cf646ca482f175
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_alibc: 0e2a29e7c1de759672d87a260051240d209964b9
flutter_native_image: 9c0b7451838484458e5b0fae007b86a4c2d4bdfe
flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35
fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
image_cropper: 3c16d7651730ffe85897f5a1c4e2547e6b54989a
image_picker: 9c3312491f862b28d21ecd8fdf0ee14e601b3f09
jdsdk: 2ca38c7e3a2dfb0f3641425f8fd1e8d20357693f
mtopSDK: d6fdf81730342a69be920b576541c7bb81a683d5
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4
path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0
securityGuard: 9c04c44a3b663f36e15064042abfc107fa07133c
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
TOCropViewController: 20a14b6a7a098308bf369e7c8d700dc983a974e6
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
UTDID: c28855683c5ea2e77e597cb14609328f7d470d6e
webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96
WindVane: 56e096abae757397ccd3accb66a959f3ffcbf949
zhiying_base_widget: 00868c0d2723a3a425c18b27204fbc67e3f7e59d
zhiying_comm: 0daef4a480f4f4dbea3e11b615f3264aafea924b

PODFILE CHECKSUM: 3dbe063e9c90a5d7c9e4e76e70a821b9e2c1d271
PODFILE CHECKSUM: 9d32dfabb033b26968c1f3c861e00bd0fcc5665d

COCOAPODS: 1.9.3

+ 107
- 0
lib/pages/orders_page/orders_page.dart View File

@@ -0,0 +1,107 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/orders_page/views/order_item_widget.dart';
import 'package:zhiying_base_widget/pages/orders_page/views/order_serch_widget.dart';
import 'package:zhiying_base_widget/pages/orders_page/views/order_tabbar_widget.dart';

// 订单页面
class OrdersPage extends StatefulWidget {
final Map<String, dynamic> data;

const OrdersPage(
this.data, {
Key key,
}) : super(key: key);

@override
_OrdersPageState createState() => _OrdersPageState();
}

class _OrdersPageState extends State<OrdersPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xfff9f9f9),
appBar: _createNav(),
body: SafeArea(
child: _OrdersContainer(),
),
);
}

// 导航栏
Widget _createNav() {
return CupertinoNavigationBar(
border: Border(
bottom: BorderSide(
width: 0.0, // One physical pixel.
style: BorderStyle.none,
),
),
backgroundColor: Colors.white,
leading: Navigator.canPop(context)
? GestureDetector(
child: Container(
padding: EdgeInsets.zero,
child: Icon(
Icons.arrow_back_ios,
size: 20,
),
),
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
},
)
: Container(),
middle: Text(
'我的订单',
style: TextStyle(
fontSize: 15,
color: Color(0xff333333),
),
),
);
}
}

class _OrdersContainer extends StatefulWidget {
@override
_OrdersContainerState createState() => _OrdersContainerState();
}

class _OrdersContainerState extends State<_OrdersContainer>
with TickerProviderStateMixin {
TabController _tabController;

@override
void initState() {
_tabController = TabController(length: 6, vsync: this);
super.initState();
}

@override
Widget build(BuildContext context) {
return Column(
children: <Widget>[
OrderSearchWidget(),
OrderTabbarWidget(_tabController, [
'全部',
'已付款',
'已结算',
'已失效',
'全部',
'已付款',
]),
Expanded(
child: ListView.builder(
itemCount: 20,
itemBuilder: (context, index) {
return OrderItemWidget();
}),
)
],
);
}
}

+ 122
- 0
lib/pages/orders_page/views/order_item_widget.dart View File

@@ -0,0 +1,122 @@
import 'package:flutter/material.dart';

class OrderItemWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 4, bottom: 4),
padding: EdgeInsets.all(10),
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(7.5), color: Colors.white),
child: Column(
children: <Widget>[
_createHeader(),
_createCenter(),
],
),
);
}

Widget _createHeader() {
return Padding(
padding: const EdgeInsets.only(bottom: 8),
child: Row(
children: <Widget>[
Expanded(
child: Text(
'粉丝订单:Mickey',
maxLines: 1,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Color(0xff333333),
),
),
),
Text(
'待结算',
maxLines: 1,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.bold,
color: Color(0xff999999),
),
),
],
),
);
}

Widget _createCenter() {
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(right: 10),
width: 96,
height: 96,
color: Colors.black12,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
_createTitle(),
_creteText('订单编号:15487945211587'),
_creteText('下单时间:2020-06-18 17:11:15'),
_creteText('完成时间:2020-06-18 17:11:15'),
],
),
)
],
);
}

Widget _createTitle() {
List<InlineSpan> list = List();
list.add(WidgetSpan(
child: Container(
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,
),
),
decoration: BoxDecoration(
color: Colors.amber, borderRadius: BorderRadius.circular(2.5)),
),
));
list.add(
TextSpan(
text: '桶装水抽水器饮水机泵器动桶装水抽水器饮水机泵器动',
style: TextStyle(
fontSize: 15,
color: Color(0xff333333),
fontWeight: FontWeight.bold),
),
);
return RichText(
maxLines: 1,
overflow: TextOverflow.ellipsis,
text: TextSpan(children: list),
);
}

Widget _creteText(String text) {
return Padding(
padding: EdgeInsets.only(top: 4),
child: Text(
text,
style: TextStyle(
fontSize: 10,
color: Color(0xff999999),
),
),
);
}
}

+ 23
- 0
lib/pages/orders_page/views/order_serch_widget.dart View File

@@ -0,0 +1,23 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class OrderSearchWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
height: 40,
padding: EdgeInsets.only(left: 12.5, right: 12.5, top: 4, bottom: 4),
color: Colors.white,
child: CupertinoTextField(
textAlign: TextAlign.center,
textInputAction: TextInputAction.search,
padding: EdgeInsets.only(left: 12, right: 12),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16), color: Color(0xfff9f9f9)),
placeholder: '搜索商品标题/粉丝姓名/订单号',
placeholderStyle: TextStyle(color: Color(0xff999999), fontSize: 14),
),
);
}
}

+ 59
- 0
lib/pages/orders_page/views/order_tabbar_widget.dart View File

@@ -0,0 +1,59 @@
import 'package:flutter/material.dart';

class OrderTabbarWidget extends StatelessWidget {
final TabController controller;
final List<String> titles;

const OrderTabbarWidget(
this.controller,
this.titles, {
Key key,
}) : super(key: key);

@override
Widget build(BuildContext context) {
return Container(
width: double.infinity,
height: 40,
color: Colors.white,
child: Row(
children: <Widget>[
Expanded(
child: TabBar(
controller: controller,
isScrollable: true,
indicatorSize: TabBarIndicatorSize.label,
tabs: titles
.map((title) => OrderTabbarItemWidget(title: title))
.toList(),
),
),
Container(
width: 40,
height: 40,
child: Icon(
Icons.filter_4,
size: 14,
),
)
],
));
}
}

class OrderTabbarItemWidget extends StatelessWidget {
final String title;

const OrderTabbarItemWidget({Key key, this.title}) : super(key: key);

@override
Widget build(BuildContext context) {
return Container(
height: 26,
child: Text(
title,
style: TextStyle(color: Color(0xFFFF4242)),
),
);
}
}

+ 7
- 3
lib/register.dart View File

@@ -1,8 +1,10 @@
import 'package:zhiying_base_widget/pages/home_page/home_page.dart';
import 'package:zhiying_base_widget/pages/main_page/main_page.dart';
import 'package:zhiying_base_widget/pages/mine_detail_page/mine_detail_page.dart';
import 'package:zhiying_base_widget/pages/orders_page/orders_page.dart';
import 'package:zhiying_base_widget/pages/setting_page/setting_page.dart';
import 'package:zhiying_base_widget/pages/wallet_page/wallet_page.dart';
import 'package:zhiying_base_widget/widgets/home/home_auth/home_auth_creater.dart';
import 'package:zhiying_base_widget/widgets/home/home_banner/home_banner_creater.dart';
import 'package:zhiying_base_widget/widgets/home/home_banner/home_banner_widget.dart';
import 'package:zhiying_base_widget/widgets/home/home_goods/home_goods_creater.dart';
@@ -14,7 +16,6 @@ import 'package:zhiying_base_widget/widgets/mine/mine_nav/mine_nav_creater.dart'
import 'package:zhiying_base_widget/widgets/mine/mine_quick_entry/mine_quick_entry.dart';
import 'package:zhiying_base_widget/widgets/others/normal_nav/normal_nav_creater.dart';
import 'package:zhiying_base_widget/widgets/wallet/wallet_data/wallet_data.dart';
import 'package:zhiying_base_widget/widgets/wallet/wallet_detail/wallet_detail.dart';
import 'package:zhiying_base_widget/widgets/wallet/wallet_income/wallet_income.dart';
import 'package:zhiying_comm/util/defalut_widget_creater.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
@@ -42,6 +43,7 @@ class BaseWidgetRegister {
PageFactory.regist(
'pub.flutter.profile_settings', (model) => MineDetailPage());
PageFactory.regist('pub.flutter.settings', (model) => SettingPage(model));
PageFactory.regist('pub.flutter.my_orders', (model) => OrdersPage(model));
}

// 注册控件
@@ -65,6 +67,7 @@ class BaseWidgetRegister {
// /// 不可以滚动banner
WidgetFactory.regist('index_banner_one', HomeBannerCreater());
WidgetFactory.regist('index_banner_two', HomeBannerCreater());
WidgetFactory.regist('index_taobao_auth_tip', HomeAuthCreater());

// ==================== 个人中心
WidgetFactory.regist('profile_appbar', MineNavCreater());
@@ -84,8 +87,9 @@ class BaseWidgetRegister {
// ==================== 钱包
WidgetFactory.regist(
'wallet_data', DefaultWidgetCreater((model) => WalletData()));
WidgetFactory.regist(
'wallet_detail', DefaultWidgetCreater((model) => WalletDetail()));
// WidgetFactory.regist(
// 'wallet_detail', DefaultWidgetCreater((model) => WalletDetail()));
WidgetFactory.regist('wallet_detail', HomeAuthCreater());

WidgetFactory.regist(
'wallet_income', DefaultWidgetCreater((model) => WalletIncome()));


+ 65
- 0
lib/widgets/home/home_auth/home_auth.dart View File

@@ -0,0 +1,65 @@
import 'package:flutter/material.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class HomeAuth extends StatelessWidget {
final Map<String, dynamic> data;

const HomeAuth(this.data, {Key key}) : super(key: key);

@override
Widget build(BuildContext context) {
return Container(
height: 34,
width: double.infinity,
margin: EdgeInsets.only(left: 12, right: 12, top: 4, bottom: 4),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(17),
boxShadow: [
BoxShadow(
offset: Offset(2, 1), //x,y轴
color: Color(0x4d767676), //投影颜色
blurRadius: 5 //投影距离
)
]),
child: Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(left: 10, right: 8),
width: 20,
height: 20,
color: Colors.redAccent,
),
Expanded(
child: Text(
'一键授权淘宝权限,让购物更轻松',
maxLines: 1,
style: TextStyle(fontSize: 12, fontWeight: FontWeight.bold),
),
),
GestureDetector(
child: Container(
padding: EdgeInsets.only(left: 12, right: 12, top: 3, bottom: 3),
margin: EdgeInsets.only(left: 8, right: 8),
decoration: BoxDecoration(
color: Colors.redAccent,
borderRadius: BorderRadius.circular(20)),
child: Text(
'点击授权',
style: TextStyle(fontSize: 12, color: Colors.white),
),
),
onTap: () async {
bool isAuth = await TaobaoAuth.isAuth();
if (!isAuth) {
TaobaoAuth.auth(context);
} else {
Logger.debug('您已经授权过了');
}
},
),
],
),
);
}
}

+ 21
- 0
lib/widgets/home/home_auth/home_auth_creater.dart View File

@@ -0,0 +1,21 @@
import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/widgets/home/home_auth/home_auth_delegate.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class HomeAuthCreater extends WidgetCreater {
@override
List<Widget> createWidgets(Map<String, dynamic> model) {
return [
SliverPersistentHeader(
pinned: true,
floating: false,
delegate: HomeAuthDelegate(model),
),
];
}

@override
bool isSliverChild() {
return true;
}
}

+ 26
- 0
lib/widgets/home/home_auth/home_auth_delegate.dart View File

@@ -0,0 +1,26 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/widgets/home/home_auth/home_auth.dart';

class HomeAuthDelegate extends SliverPersistentHeaderDelegate {
final Map<String, dynamic> data;

HomeAuthDelegate(this.data);

@override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
print('${shrinkOffset.toString()} ${overlapsContent.toString()}');
return HomeAuth(data);
}

@override
double get maxExtent => 40;

@override
double get minExtent => 40;

@override
bool shouldRebuild(SliverPersistentHeaderDelegate oldDelegate) =>
false; // 如果内容需要更新,设置为true
}

+ 1
- 0
lib/widgets/home/home_goods/home_goods_header.dart View File

@@ -16,6 +16,7 @@ class HomeGoodsHeaderDelegate extends SliverPersistentHeaderDelegate {
@override
Widget build(
BuildContext context, double shrinkOffset, bool overlapsContent) {
print('${shrinkOffset.toString()} ${overlapsContent.toString()}');
return child;
}



+ 8
- 0
lib/widgets/others/overlay/taobao_auth_overlay.dart View File

@@ -0,0 +1,8 @@
import 'package:flutter/material.dart';

class TaobaoAuthOverlay extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
}
}

Loading…
Cancel
Save