提交 5e74cffd authored 作者: 岳维路's avatar 岳维路

合并分支 'test' 到 'sim'

Test 查看合并请求 kiwitap/zijing-app!15
assets/images/2.0x/zijing_icon.png

22.5 KB | W: | H:

assets/images/2.0x/zijing_icon.png

13.8 KB | W: | H:

assets/images/2.0x/zijing_icon.png
assets/images/2.0x/zijing_icon.png
assets/images/2.0x/zijing_icon.png
assets/images/2.0x/zijing_icon.png
  • 2-up
  • Swipe
  • Onion skin
assets/images/3.0x/zijing_icon.png

44.1 KB | W: | H:

assets/images/3.0x/zijing_icon.png

26.6 KB | W: | H:

assets/images/3.0x/zijing_icon.png
assets/images/3.0x/zijing_icon.png
assets/images/3.0x/zijing_icon.png
assets/images/3.0x/zijing_icon.png
  • 2-up
  • Swipe
  • Onion skin
assets/images/zijing_icon.png

8.6 KB | W: | H:

assets/images/zijing_icon.png

7.4 KB | W: | H:

assets/images/zijing_icon.png
assets/images/zijing_icon.png
assets/images/zijing_icon.png
assets/images/zijing_icon.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -174,5 +174,32 @@ abstract class CommonAPI { ...@@ -174,5 +174,32 @@ abstract class CommonAPI {
return OssModel.fromJson(result.data); return OssModel.fromJson(result.data);
} }
static Future<String?> refreshToken() async {
Console.log('--------refreshToken----------------');
final result = await HttpService.to.post(
'/v1/members/login/getToken',
params: {
'access_token':StorageService.to.getString(kLocalAccessToken)
}
);
if (result.data is Map) {
final String token = result.data['token'];
final String accessToken = result.data['access_token'];
if(token.isEmpty && accessToken.isEmpty){
UserStore.to.logout();
return null;
}
await Future.wait([
UserStore.to.setToken(result.data['token']),
UserStore.to.setAccessToken(result.data['access_token']),
]);
return result.data['token'];
}
// 在这里执行刷新token的逻辑
// 如果刷新成功,返回新的token;如果刷新失败,返回null
return null;
}
} }
\ No newline at end of file
...@@ -8,6 +8,8 @@ import 'package:device_info_plus/device_info_plus.dart'; ...@@ -8,6 +8,8 @@ import 'package:device_info_plus/device_info_plus.dart';
import '../models/index.dart'; import '../models/index.dart';
import '../services/index.dart'; import '../services/index.dart';
import '../store/index.dart';
import '../utils/index.dart';
part 'account.dart'; part 'account.dart';
part 'mine.dart'; part 'mine.dart';
part 'course.dart'; part 'course.dart';
......
...@@ -357,6 +357,7 @@ class NoteModel { ...@@ -357,6 +357,7 @@ class NoteModel {
this.color, this.color,
this.chapterName, this.chapterName,
this.isMy, this.isMy,
this.isOpen,
}); });
NoteModel.fromJson(dynamic json) { NoteModel.fromJson(dynamic json) {
...@@ -372,10 +373,12 @@ class NoteModel { ...@@ -372,10 +373,12 @@ class NoteModel {
color = json['color']; color = json['color'];
chapterName = json['chapter_name']; chapterName = json['chapter_name'];
isMy = json['is_my']; isMy = json['is_my'];
isOpen = json['is_open'];
} }
num? notesId; num? notesId;
num? types; num? types;
num? isMy; num? isMy;
num? isOpen;
num? chapterId; num? chapterId;
String? content; String? content;
String? positioning; String? positioning;
...@@ -388,6 +391,7 @@ class NoteModel { ...@@ -388,6 +391,7 @@ class NoteModel {
num? notesId, num? notesId,
num? types, num? types,
num? isMy, num? isMy,
num? isOpen,
num? chapterId, num? chapterId,
String? content, String? content,
String? positioning, String? positioning,
...@@ -399,6 +403,7 @@ class NoteModel { ...@@ -399,6 +403,7 @@ class NoteModel {
notesId: notesId ?? this.notesId, notesId: notesId ?? this.notesId,
types: types ?? this.types, types: types ?? this.types,
isMy: isMy ?? this.isMy, isMy: isMy ?? this.isMy,
isOpen: isOpen ?? this.isOpen,
chapterId: chapterId ?? this.chapterId, chapterId: chapterId ?? this.chapterId,
content: content ?? this.content, content: content ?? this.content,
positioning: positioning ?? this.positioning, positioning: positioning ?? this.positioning,
...@@ -412,6 +417,7 @@ class NoteModel { ...@@ -412,6 +417,7 @@ class NoteModel {
map['notes_id'] = notesId; map['notes_id'] = notesId;
map['types'] = types; map['types'] = types;
map['is_my'] = isMy; map['is_my'] = isMy;
map['is_open'] = isOpen;
map['chapter_id'] = chapterId; map['chapter_id'] = chapterId;
map['content'] = content; map['content'] = content;
map['positioning'] = positioning; map['positioning'] = positioning;
......
...@@ -22,8 +22,11 @@ class _BaiKePageState extends State<BaiDictPage> { ...@@ -22,8 +22,11 @@ class _BaiKePageState extends State<BaiDictPage> {
), ),
body: InAppWebView( body: InAppWebView(
initialUrlRequest: URLRequest( initialUrlRequest: URLRequest(
// url: Uri.parse('https://hanyu.baidu.com/hanyu-page/zici/s?from=aladdin&query=${widget.keyword}&srcid=51368&wd=${widget.keyword}&ptype=zici'), url: WebUri.uri(Uri.parse('https://dict.baidu.com/s?wd=${widget.keyword}'))
url: WebUri.uri(Uri.parse('https://hanyu.baidu.com/hanyu-page/zici/s?from=aladdin&query=${widget.keyword}&srcid=51368&wd=${widget.keyword}&ptype=zici')) ),
initialSettings:InAppWebViewSettings(
// http的请求也不做限制
mixedContentMode:MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW
), ),
), ),
); );
......
...@@ -24,6 +24,10 @@ class _BaiKePageState extends State<BaiKePage> { ...@@ -24,6 +24,10 @@ class _BaiKePageState extends State<BaiKePage> {
// url: Uri.parse('https://baike.baidu.com/item/${widget.keyword}?fromModule=lemma_search-box'), // url: Uri.parse('https://baike.baidu.com/item/${widget.keyword}?fromModule=lemma_search-box'),
url: WebUri.uri(Uri.parse('https://baike.baidu.com/item/${widget.keyword}?fromModule=lemma_search-box')) url: WebUri.uri(Uri.parse('https://baike.baidu.com/item/${widget.keyword}?fromModule=lemma_search-box'))
), ),
initialSettings:InAppWebViewSettings(
// http的请求也不做限制
mixedContentMode:MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW
),
), ),
); );
} }
......
...@@ -20,12 +20,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -20,12 +20,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GetBuilder<BookDetailController>( return GetBuilder<BookDetailController>(
init:BookDetailController(widget.bookId), init:BookDetailController(widget.bookId),
builder: (controller)=> WillPopScope( builder: (controller)=> Scaffold(
onWillPop: () async {
context.pop(true);
return false;
},
child: Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
backgroundColor: const Color(0xFFAB1941).withOpacity(0.02), backgroundColor: const Color(0xFFAB1941).withOpacity(0.02),
title: const Text('详情',style: TextStyle(fontSize: 17),), title: const Text('详情',style: TextStyle(fontSize: 17),),
...@@ -108,10 +103,10 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -108,10 +103,10 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
); );
buy.add(model); buy.add(model);
final result = await context.pushNamed(Routes.bookPay,extra: buy); context.pushNamed(Routes.bookPay,extra: buy).then((value) {
if (result == true) {
controller.getBookDetails(); controller.getBookDetails();
} });
}else{ }else{
final PopBackModel? backModel = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterModel.id.toString(),'chapter_name':chapterModel.name.toString(),'note_id':'0'},extra: controller.bookDetails); final PopBackModel? backModel = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterModel.id.toString(),'chapter_name':chapterModel.name.toString(),'note_id':'0'},extra: controller.bookDetails);
if (backModel!.back == true){ if (backModel!.back == true){
...@@ -148,7 +143,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -148,7 +143,7 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
<style> <style>
*{ margin: 0px; padding: 5px; font-size:16px} *{ margin: 0px; padding: 5px; font-size:16px}
html{ font-size: 10px;} html{ font-size: 10px;}
body{ padding:0px} body{ padding:0px;color: #999}
body p{ font-size: 1.5rem; line-height:2.4rem;color: #999} body p{ font-size: 1.5rem; line-height:2.4rem;color: #999}
img,video,pre,code{ max-width:100%} img,video,pre,code{ max-width:100%}
pre{white-space: pre-wrap;word-wrap: break-word;word-break: break-all} pre{white-space: pre-wrap;word-wrap: break-word;word-break: break-all}
...@@ -240,10 +235,10 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -240,10 +235,10 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
); );
buy.add(model); buy.add(model);
final result = await context.pushNamed(Routes.bookPay,extra: buy); context.pushNamed(Routes.bookPay,extra: buy).then((value){
if (result == true) {
controller.getBookDetails(); controller.getBookDetails();
} });
} }
else{ else{
final String chapterId = await controller.getCurrentChapterId(); final String chapterId = await controller.getCurrentChapterId();
...@@ -290,7 +285,6 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -290,7 +285,6 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
), ),
), ),
), ),
),
); );
} }
......
...@@ -15,12 +15,7 @@ class _BookPayPageState extends State<BookPayPage> { ...@@ -15,12 +15,7 @@ class _BookPayPageState extends State<BookPayPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return GetBuilder<BookPayController>(
onWillPop: () async {
context.pop(true);
return false;
},
child: GetBuilder<BookPayController>(
init: BookPayController(buy: widget.buy,context: context), init: BookPayController(buy: widget.buy,context: context),
builder: (controller) => Stack( builder: (controller) => Stack(
children: [ children: [
...@@ -150,7 +145,6 @@ class _BookPayPageState extends State<BookPayPage> { ...@@ -150,7 +145,6 @@ class _BookPayPageState extends State<BookPayPage> {
):const SizedBox() ):const SizedBox()
], ],
) )
),
); );
} }
......
...@@ -52,10 +52,9 @@ class BuildCounter extends StatelessWidget { ...@@ -52,10 +52,9 @@ class BuildCounter extends StatelessWidget {
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
if (controller.num > 0){ if (controller.num > 0){
final result = await context.pushNamed(Routes.bookPay,extra: controller.buy); context.pushNamed(Routes.bookPay,extra: controller.buy).then((value){
if (result == true) {
controller.onRefresh(); controller.onRefresh();
} });
} }
}, },
child: Container( child: Container(
......
...@@ -115,7 +115,7 @@ class _ChangePwdPageState extends State<ChangePwdPage> { ...@@ -115,7 +115,7 @@ class _ChangePwdPageState extends State<ChangePwdPage> {
), ),
Container( Container(
margin: EdgeInsets.only(left: 5.w,top: 5.w), margin: EdgeInsets.only(left: 5.w,top: 5.w),
child: Text('密码必须是8-20个英文字母、数字或符号(除空格)',style: TextStyle(fontSize: 10.w,color: Colours.c9),), child: Text('密码必须是数字、字母、特殊符号两种及以上8-12位的组合',style: TextStyle(fontSize: 10.w,color: Colours.c9),),
), ),
Gaps.vGaps40, Gaps.vGaps40,
CustomGradientButton( CustomGradientButton(
......
...@@ -38,10 +38,9 @@ class _CoursePageState extends State<CoursePage> { ...@@ -38,10 +38,9 @@ class _CoursePageState extends State<CoursePage> {
), ),
GestureDetector( GestureDetector(
onTap: () async{ onTap: () async{
final result = await context.pushNamed(Routes.msgs); context.pushNamed(Routes.msgs).then((value){
if (result == true) {
controller.getNums(); controller.getNums();
} });
}, },
child: badges.Badge( child: badges.Badge(
position: badges.BadgePosition.topEnd(top: -5.w, end: 0), position: badges.BadgePosition.topEnd(top: -5.w, end: 0),
...@@ -112,10 +111,9 @@ class _CoursePageState extends State<CoursePage> { ...@@ -112,10 +111,9 @@ class _CoursePageState extends State<CoursePage> {
onTapContinue: () async{ onTapContinue: () async{
BookDetailModel bookDetails = await controller.getBookDetails(model.bookId.toString()); BookDetailModel bookDetails = await controller.getBookDetails(model.bookId.toString());
if(context.mounted){ if(context.mounted){
final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': bookDetails.bookId.toString(),'chapter_id': bookDetails.chapterId.toString(),'chapter_name':bookDetails.chapterName.toString()},extra:bookDetails); context.pushNamed(Routes.web,queryParameters: {'book_id': bookDetails.bookId.toString(),'chapter_id': bookDetails.chapterId.toString(),'chapter_name':bookDetails.chapterName.toString()},extra:bookDetails).then((value){
if (result == true){
controller.getNums(); controller.getNums();
} });
} }
}, },
), ),
......
...@@ -7,12 +7,7 @@ class CreditPointsPage extends StatelessWidget { ...@@ -7,12 +7,7 @@ class CreditPointsPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return GetBuilder<BookPayController>(
onWillPop: () async {
context.pop('111111');
return false;
},
child: GetBuilder<BookPayController>(
init: BookPayController(buy: [],context: context), init: BookPayController(buy: [],context: context),
builder:(controller)=> Scaffold( builder:(controller)=> Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
...@@ -148,7 +143,6 @@ class CreditPointsPage extends StatelessWidget { ...@@ -148,7 +143,6 @@ class CreditPointsPage extends StatelessWidget {
], ],
) )
), ),
),
); );
} }
} }
...@@ -89,7 +89,7 @@ class LoginController extends GetxController { ...@@ -89,7 +89,7 @@ class LoginController extends GetxController {
/// 测试账号 /// 测试账号
if (kDebugMode) { if (kDebugMode) {
phoneInput.text = '18810760819'; phoneInput.text = '18810760819';
passwordInput.text = '12345678'; passwordInput.text = '1234567m';
// phoneInput.text = '17311837355'; // phoneInput.text = '17311837355';
// passwordInput.text = '12345678'; // passwordInput.text = '12345678';
} }
......
...@@ -67,7 +67,7 @@ class _LoginPageState extends State<LoginPage> { ...@@ -67,7 +67,7 @@ class _LoginPageState extends State<LoginPage> {
SizedBox(height: 120.w,), SizedBox(height: 120.w,),
Container( Container(
width: 180.w, width: 180.w,
height: 50.w, height: 42.w,
// color: Colors.cyan, // color: Colors.cyan,
child: Image.asset( child: Image.asset(
'assets/images/zijing_icon.png', 'assets/images/zijing_icon.png',
......
...@@ -43,11 +43,9 @@ class _MinePageState extends State<MinePage> { ...@@ -43,11 +43,9 @@ class _MinePageState extends State<MinePage> {
), ),
GestureDetector( GestureDetector(
onTap: () async{ onTap: () async{
final result = await context.pushNamed(Routes.msgs); context.pushNamed(Routes.msgs).then((value) {
print('---------------------------------1111$result');
if (result == true){
controller.getNums(); controller.getNums();
} });
}, },
child: badges.Badge( child: badges.Badge(
position: badges.BadgePosition.topEnd(top: -5.w, end: 0), position: badges.BadgePosition.topEnd(top: -5.w, end: 0),
...@@ -78,20 +76,18 @@ class _MinePageState extends State<MinePage> { ...@@ -78,20 +76,18 @@ class _MinePageState extends State<MinePage> {
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 10.w), margin: EdgeInsets.symmetric(horizontal: 10.w),
child: BuildUser(userInfo:controller.userInfo,onTap: () async{ child: BuildUser(userInfo:controller.userInfo,onTap: () async{
final result = await context.pushNamed(Routes.userInfo,extra: controller.userInfo); context.pushNamed(Routes.userInfo,extra: controller.userInfo).then((value){
if (result == true){
controller.getInfo(); controller.getInfo();
} });
},), },),
), ),
Gaps.vGaps10, Gaps.vGaps10,
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 2.2.w), margin: EdgeInsets.symmetric(horizontal: 2.2.w),
child: BuildRead(items: controller.reads,onTap: (ReadModel model) async{ child: BuildRead(items: controller.reads,onTap: (ReadModel model) async{
final result = await context.pushNamed(model.link??''); context.pushNamed(model.link??'').then((value){
if (result == true){
controller.getInfo(); controller.getInfo();
} });
}), }),
), ),
controller.ads.isNotEmpty?Gaps.vGaps5:const SizedBox(), controller.ads.isNotEmpty?Gaps.vGaps5:const SizedBox(),
...@@ -106,12 +102,11 @@ class _MinePageState extends State<MinePage> { ...@@ -106,12 +102,11 @@ class _MinePageState extends State<MinePage> {
} , } ,
), ),
):const SizedBox(), ):const SizedBox(),
Gaps.vGaps15, controller.ads.isNotEmpty?Gaps.vGaps15:Gaps.vGaps5,
BuildAccount(items:controller.accounts,onTap: (ReadModel model) async{ BuildAccount(items:controller.accounts,onTap: (ReadModel model) async{
final result = await context.pushNamed(model.link??''); context.pushNamed(model.link??'').then((value){
if (result == true){
controller.getInfo(); controller.getInfo();
} });
},), },),
Gaps.vGaps10, Gaps.vGaps10,
Container( Container(
...@@ -134,10 +129,9 @@ class _MinePageState extends State<MinePage> { ...@@ -134,10 +129,9 @@ class _MinePageState extends State<MinePage> {
children: [ children: [
GestureDetector( GestureDetector(
onTap:() async { onTap:() async {
final result = await context.pushNamed(Routes.security,extra: controller.userInfo); context.pushNamed(Routes.security,extra: controller.userInfo).then((value){
if (result == true){
controller.getInfo(); controller.getInfo();
} });
}, child: _buildItem('账户安全') }, child: _buildItem('账户安全')
), ),
Container(color: Colours.cLine,margin: EdgeInsets.symmetric(horizontal: 15.w),height: 1.w,), Container(color: Colours.cLine,margin: EdgeInsets.symmetric(horizontal: 15.w),height: 1.w,),
......
...@@ -28,6 +28,8 @@ class BuildRead extends StatelessWidget { ...@@ -28,6 +28,8 @@ class BuildRead extends StatelessWidget {
// top: 10.w, // top: 10.w,
left: 0, left: 0,
right: 0, right: 0,
top: 0,
bottom: 0,
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 16.5.w,horizontal: 8), padding: EdgeInsets.symmetric(vertical: 16.5.w,horizontal: 8),
color: Colors.transparent, color: Colors.transparent,
...@@ -50,19 +52,13 @@ class BuildRead extends StatelessWidget { ...@@ -50,19 +52,13 @@ class BuildRead extends StatelessWidget {
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: (){ onTap: (){
if (model.link != null){
if (model.link != Routes.love){
context.pushNamed(model.link!);
}
else{
if (onTap !=null) onTap!(model); if (onTap !=null) onTap!(model);
}
}
}, },
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text(model.value,style: TextStyle(fontSize: 18.w,height: 1.6.w,fontWeight: Fonts.medium,color: Colours.c3),), Text(model.value,style: TextStyle(fontSize: 18.w,height: 1.5.w,fontWeight: Fonts.medium,color: Colours.c3),),
Text(model.name,style: TextStyle(fontSize: 13.w,height:1.6.w,color: Colours.c6)) Text(model.name,style: TextStyle(fontSize: 13.w,height:1.5.w,color: Colours.c6))
], ],
), ),
), ),
......
...@@ -468,9 +468,9 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -468,9 +468,9 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
else if(chatType == 1){ else if(chatType == 1){
if(contentInput.text.isEmpty && discussInputImages.isEmpty && discussInputAudios.isEmpty){ if(contentInput.text.isEmpty && discussInputImages.isEmpty && discussInputAudios.isEmpty){
Toast.show('笔记必须填写内容或选择图片或音频'); Toast.show('笔记必须填写内容或选择图片或音频');
}
return false; return false;
} }
}
// 有网情况下 先直传oss 获取到url // 有网情况下 先直传oss 获取到url
if (status){ if (status){
...@@ -852,7 +852,11 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -852,7 +852,11 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
return directory!.path; return directory!.path;
} }
/// 刷新token
Future<String?> refreshToken() async {
final result = await CommonAPI.refreshToken();
return result;
}
/// 获取目录信息 /// 获取目录信息
void _getChapters() async { void _getChapters() async {
chapters = await LibraryAPI.chapters(bookId: bookId); chapters = await LibraryAPI.chapters(bookId: bookId);
...@@ -991,6 +995,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -991,6 +995,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
// 当应用程序从后台切换到前台并变为活动状态时调用。这通常在用户从其他应用程序返回到你的应用程序时发生 // 当应用程序从后台切换到前台并变为活动状态时调用。这通常在用户从其他应用程序返回到你的应用程序时发生
void onResumed(){ void onResumed(){
Console.log('onResumed'); Console.log('onResumed');
webViewController.evaluateJavascript(source: 'activeState("1");');
// open // open
// 上报开始阅读时间 // 上报开始阅读时间
_addReadTime(type: 'open'); _addReadTime(type: 'open');
...@@ -999,12 +1004,14 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -999,12 +1004,14 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
void onPaused(){ void onPaused(){
// close // close
Console.log('onPaused'); Console.log('onPaused');
webViewController.evaluateJavascript(source: 'activeState("0");');
// 上报阅读结束时间 // 上报阅读结束时间
_addReadTime(type: 'close'); _addReadTime(type: 'close');
} }
// 当应用程序失去焦点但仍然可见时调用。通常,在用户切换到另一个应用程序或显示系统对话框时,应用程序可能会处于非活动状态,但仍然是可见的 // 当应用程序失去焦点但仍然可见时调用。通常,在用户切换到另一个应用程序或显示系统对话框时,应用程序可能会处于非活动状态,但仍然是可见的
void onInactive(){ void onInactive(){
Console.log('onInactive'); Console.log('onInactive');
webViewController.evaluateJavascript(source: 'activeState("0");');
// close // close
// 上报阅读结束时间 // 上报阅读结束时间
_addReadTime(type: 'close'); _addReadTime(type: 'close');
...@@ -1012,6 +1019,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -1012,6 +1019,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
// 当应用程序被挂起,可能是由于用户关闭应用程序或系统资源不足时调用。在这个状态下,应用程序的代码将不再运行,并且可能被系统终止 // 当应用程序被挂起,可能是由于用户关闭应用程序或系统资源不足时调用。在这个状态下,应用程序的代码将不再运行,并且可能被系统终止
void onDetached(){ void onDetached(){
Console.log('onDetached'); Console.log('onDetached');
webViewController.evaluateJavascript(source: 'activeState("0");');
// close // close
// 上报阅读结束时间 // 上报阅读结束时间
_addReadTime(type: 'close'); _addReadTime(type: 'close');
......
...@@ -78,6 +78,8 @@ class _ReadPageState extends State<ReadPage> { ...@@ -78,6 +78,8 @@ class _ReadPageState extends State<ReadPage> {
), ),
initialSettings:InAppWebViewSettings( initialSettings:InAppWebViewSettings(
clearCache:true, clearCache:true,
// http的请求也不做限制
mixedContentMode:MixedContentMode.MIXED_CONTENT_ALWAYS_ALLOW
), ),
// initialOptions: InAppWebViewGroupOptions( // initialOptions: InAppWebViewGroupOptions(
// crossPlatform: InAppWebViewOptions( // crossPlatform: InAppWebViewOptions(
...@@ -87,7 +89,8 @@ class _ReadPageState extends State<ReadPage> { ...@@ -87,7 +89,8 @@ class _ReadPageState extends State<ReadPage> {
contextMenu: ContextMenu( contextMenu: ContextMenu(
// options: ContextMenuOptions(hideDefaultSystemContextMenuItems: true), // options: ContextMenuOptions(hideDefaultSystemContextMenuItems: true),
settings: ContextMenuSettings( settings: ContextMenuSettings(
hideDefaultSystemContextMenuItems: true hideDefaultSystemContextMenuItems: true,
) )
), ),
onWebViewCreated: (InAppWebViewController controller){ onWebViewCreated: (InAppWebViewController controller){
...@@ -110,18 +113,18 @@ class _ReadPageState extends State<ReadPage> { ...@@ -110,18 +113,18 @@ class _ReadPageState extends State<ReadPage> {
Console.log('传给前端的参数--------------------------------$str'); Console.log('传给前端的参数--------------------------------$str');
controller.evaluateJavascript(source: 'callbackInFlutterComponent("$str");'); controller.evaluateJavascript(source: 'callbackInFlutterComponent("$str");');
// // 添加单击事件 // 添加单击事件
// controller.evaluateJavascript(source: ''' controller.evaluateJavascript(source: '''
// document.addEventListener('click', function() { document.addEventListener('click', function() {
// window.flutter_inappwebview.callHandler('onTap'); window.flutter_inappwebview.callHandler('onTap');
// }); });
// '''); ''');
//
// // 监听js单击回调 // 监听js单击回调
// controller.addJavaScriptHandler(handlerName: 'onTap', callback: (args){ controller.addJavaScriptHandler(handlerName: 'onTap', callback: (args){
// readController.setShow(readController.show); readController.setShow(readController.show);
//
// }); });
// 监听笔记回调 // 监听笔记回调
controller.addJavaScriptHandler(handlerName: 'noteCallBack', callback: (args){ controller.addJavaScriptHandler(handlerName: 'noteCallBack', callback: (args){
...@@ -140,7 +143,7 @@ class _ReadPageState extends State<ReadPage> { ...@@ -140,7 +143,7 @@ class _ReadPageState extends State<ReadPage> {
// 监听字典回调 // 监听字典回调
controller.addJavaScriptHandler(handlerName: 'dictCallBack', callback: (args){ controller.addJavaScriptHandler(handlerName: 'dictCallBack', callback: (args){
Console.log('监听百科回调------------------------------------------------$args'); Console.log('监听字典回调------------------------------------------------$args');
context.pushNamed(Routes.baiDict,queryParameters: {'keyword':args.first}); context.pushNamed(Routes.baiDict,queryParameters: {'keyword':args.first});
}); });
...@@ -206,10 +209,10 @@ class _ReadPageState extends State<ReadPage> { ...@@ -206,10 +209,10 @@ class _ReadPageState extends State<ReadPage> {
Console.log('监听 上一节 下一节------------------------------------------------$args'); Console.log('监听 上一节 下一节------------------------------------------------$args');
}); });
// 监听 双击回调 // // 监听 双击回调
controller.addJavaScriptHandler(handlerName: 'dbClickCallBack', callback: (args){ // controller.addJavaScriptHandler(handlerName: 'dbClickCallBack', callback: (args){
readController.setShow(readController.show); // readController.setShow(readController.show);
}); // });
// 阅读页内容中的 外部链接 // 阅读页内容中的 外部链接
controller.addJavaScriptHandler(handlerName: 'openLinkCallback', callback: (args){ controller.addJavaScriptHandler(handlerName: 'openLinkCallback', callback: (args){
...@@ -246,6 +249,16 @@ class _ReadPageState extends State<ReadPage> { ...@@ -246,6 +249,16 @@ class _ReadPageState extends State<ReadPage> {
context.pushNamed(Routes.scaleImage,queryParameters: params); context.pushNamed(Routes.scaleImage,queryParameters: params);
}); });
// 前端 token过去回调
controller.addJavaScriptHandler(handlerName: 'refreshTokenCallback', callback: (args) async {
final result = await readController.refreshToken();
Map<String, dynamic> param = {
'token': result,
};
String jsonStr = jsonEncode(param);
controller.evaluateJavascript(source: 'refreshTokenSuccess($jsonStr)');
});
/// 离线需要参数 /// 离线需要参数
// // // //
......
...@@ -198,8 +198,13 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> { ...@@ -198,8 +198,13 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> {
); );
widget.controller.addDiscussInputImages(assets!.path); widget.controller.addDiscussInputImages(assets!.path);
}, },
child: Image.asset('assets/images/read_add_img.png')), child: Container(
Gaps.hGaps10, // color: Colors.red,
width: 25,
height: 25,
child: Image.asset('assets/images/read_add_img.png',fit: BoxFit.contain,)),
),
Gaps.hGaps15,
widget.controller.chatType ==0?const SizedBox():GestureDetector( widget.controller.chatType ==0?const SizedBox():GestureDetector(
onTap: () async { onTap: () async {
if(widget.controller.startRecording){ if(widget.controller.startRecording){
...@@ -210,7 +215,12 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> { ...@@ -210,7 +215,12 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> {
} }
}, },
child: Image.asset(widget.controller.startRecording?'assets/images/stop.png':'assets/images/read_add_audio.png') child: Container(
// color: Colors.red,
width: 23,
height: 23,
child: Image.asset(widget.controller.startRecording?'assets/images/stop.png':'assets/images/read_add_audio.png',fit: BoxFit.contain,),
)
), ),
widget.controller.chatType ==0?const SizedBox():GestureDetector( widget.controller.chatType ==0?const SizedBox():GestureDetector(
onTap: (){ onTap: (){
...@@ -219,10 +229,13 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> { ...@@ -219,10 +229,13 @@ class _ReadInputDiscussState extends State<ReadInputDiscuss> {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Gaps.hGaps10, Gaps.hGaps15,
Image.asset(widget.controller.isPublic?'assets/images/pay_check.png':'assets/images/pay_uncheck.png'), SizedBox(
width: 15,
height: 15,
child: Image.asset(widget.controller.isPublic?'assets/images/pay_check.png':'assets/images/public.png',fit: BoxFit.contain,),),
SizedBox(width: 3.w,), SizedBox(width: 3.w,),
Text('公开',style: TextStyle(fontSize: 13.w,height: 1.3,color: Colours.c9),) Text('公开',style: TextStyle(fontSize: 15.w,height: 1.3,color: Colours.c9),)
], ],
), ),
) )
......
...@@ -144,7 +144,7 @@ class _ReadNotePageState extends State<ReadNotePage> { ...@@ -144,7 +144,7 @@ class _ReadNotePageState extends State<ReadNotePage> {
controller.delNotes(noteModel: model, bookId:widget.bookDetailModel.bookId.toString()); controller.delNotes(noteModel: model, bookId:widget.bookDetailModel.bookId.toString());
}, },
onTapEdit: (){ onTapEdit: (){
context.pushNamed(Routes.editNote,extra: model,queryParameters: {'book_id':widget.bookDetailModel.bookId}); context.pushNamed(Routes.editNote,extra: model,queryParameters: {'book_id':widget.bookDetailModel.bookId.toString()});
}, },
); );
} }
......
...@@ -68,7 +68,7 @@ class _ResetPwdPageState extends State<ResetPwdPage> { ...@@ -68,7 +68,7 @@ class _ResetPwdPageState extends State<ResetPwdPage> {
), ),
Container( Container(
margin: EdgeInsets.only(left: 5.w,top: 5.w), margin: EdgeInsets.only(left: 5.w,top: 5.w),
child: Text('密码必须是8-20个英文字母、数字或符号(除空格)',style: TextStyle(fontSize: 10.w,color: Colours.c9),), child: Text('密码必须是数字、字母、特殊符号两种及以上8-12位的组合',style: TextStyle(fontSize: 10.w,color: Colours.c9),),
), ),
Gaps.vGaps40, Gaps.vGaps40,
CustomGradientButton( CustomGradientButton(
......
...@@ -168,7 +168,7 @@ class _StudyReportPageState extends State<StudyReportPage> { ...@@ -168,7 +168,7 @@ class _StudyReportPageState extends State<StudyReportPage> {
RichText(text: TextSpan( RichText(text: TextSpan(
children: [ children: [
TextSpan(text: '测评总数',style: TextStyle(fontSize: 14.w,height: 1.5,color: Colours.c9),), TextSpan(text: '测评总数',style: TextStyle(fontSize: 14.w,height: 1.5,color: Colours.c9),),
WidgetSpan(child: SizedBox(width: 36.w),), WidgetSpan(child: SizedBox(width: 21.5.w),),
TextSpan(text:controller.model.questionAllNums !=null? controller.model.questionAllNums.toString():'' ,style: TextStyle(fontSize: 21.w,height: 1.5,color: Colours.c3,fontWeight: Fonts.medium)), TextSpan(text:controller.model.questionAllNums !=null? controller.model.questionAllNums.toString():'' ,style: TextStyle(fontSize: 21.w,height: 1.5,color: Colours.c3,fontWeight: Fonts.medium)),
TextSpan(text: '/条',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)), TextSpan(text: '/条',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)),
] ]
...@@ -180,7 +180,7 @@ class _StudyReportPageState extends State<StudyReportPage> { ...@@ -180,7 +180,7 @@ class _StudyReportPageState extends State<StudyReportPage> {
children: [ children: [
RichText(text: TextSpan( RichText(text: TextSpan(
children: [ children: [
TextSpan(text: '评论正确率',style: TextStyle(fontSize: 14.w,height: 1.5,color: Colours.c9),), TextSpan(text: '测评正确率',style: TextStyle(fontSize: 14.w,height: 1.5,color: Colours.c9),),
WidgetSpan(child: SizedBox(width: 8.w),), WidgetSpan(child: SizedBox(width: 8.w),),
TextSpan(text:controller.model.questionAccuracy!=null?controller.model.questionAccuracy.toString():'' ,style: TextStyle(fontSize: 21.w,height: 1.5,color: Colours.c3,fontWeight: Fonts.medium)), TextSpan(text:controller.model.questionAccuracy!=null?controller.model.questionAccuracy.toString():'' ,style: TextStyle(fontSize: 21.w,height: 1.5,color: Colours.c3,fontWeight: Fonts.medium)),
TextSpan(text: '%',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)), TextSpan(text: '%',style: TextStyle(fontSize: 13.w,height: 1.5,color: Colours.c3)),
......
...@@ -10,12 +10,7 @@ class UserCoinPage extends StatefulWidget { ...@@ -10,12 +10,7 @@ class UserCoinPage extends StatefulWidget {
class _UserCoinPageState extends State<UserCoinPage> { class _UserCoinPageState extends State<UserCoinPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return GetBuilder<UserCoinController>(
onWillPop: () async {
context.pop(true);
return false;
},
child: GetBuilder<UserCoinController>(
init: UserCoinController(), init: UserCoinController(),
builder: (controller) => Scaffold( builder: (controller) => Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
...@@ -77,7 +72,6 @@ class _UserCoinPageState extends State<UserCoinPage> { ...@@ -77,7 +72,6 @@ class _UserCoinPageState extends State<UserCoinPage> {
), ),
), ),
), ),
),
); );
} }
} }
...@@ -11,12 +11,7 @@ class UserCouponPage extends StatefulWidget { ...@@ -11,12 +11,7 @@ class UserCouponPage extends StatefulWidget {
class _UserCouponPageState extends State<UserCouponPage> { class _UserCouponPageState extends State<UserCouponPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return GetBuilder<UserCouponController>(
onWillPop: () async {
context.pop(true);
return false;
},
child: GetBuilder<UserCouponController>(
init: UserCouponController(), init: UserCouponController(),
builder:(controller) => Scaffold( builder:(controller) => Scaffold(
appBar: AppBar( appBar: AppBar(
...@@ -63,7 +58,6 @@ class _UserCouponPageState extends State<UserCouponPage> { ...@@ -63,7 +58,6 @@ class _UserCouponPageState extends State<UserCouponPage> {
), ),
), ),
), ),
),
); );
} }
} }
...@@ -26,6 +26,7 @@ class UserEditNoteController extends GetxController { ...@@ -26,6 +26,7 @@ class UserEditNoteController extends GetxController {
@override @override
void onInit() { void onInit() {
isPublic = model.isOpen ==1?true:false;
super.onInit(); super.onInit();
} }
...@@ -220,11 +221,17 @@ class UserEditNoteController extends GetxController { ...@@ -220,11 +221,17 @@ class UserEditNoteController extends GetxController {
'image':images 'image':images
}; };
String isOpen = '0';
if(isPublic){
isOpen = '1';
}
final result = MineAPI.editNotes( final result = MineAPI.editNotes(
content: model.content??'', content: model.content??'',
notesId: model.notesId.toString(), notesId: model.notesId.toString(),
bookId: bookId, bookId: bookId,
noteContent: jsonEncode(contentMap) noteContent: jsonEncode(contentMap),
isOpen: isOpen
); );
return result; return result;
} }
......
...@@ -20,12 +20,7 @@ class _UserGenderPageState extends State<UserGenderPage> { ...@@ -20,12 +20,7 @@ class _UserGenderPageState extends State<UserGenderPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return GetBuilder<UserGenderController>(
onWillPop: () async {
context.pop(true);
return false;
},
child: GetBuilder<UserGenderController>(
init: UserGenderController(widget.userInfo), init: UserGenderController(widget.userInfo),
builder: (controller) => Scaffold( builder: (controller) => Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
...@@ -213,7 +208,6 @@ class _UserGenderPageState extends State<UserGenderPage> { ...@@ -213,7 +208,6 @@ class _UserGenderPageState extends State<UserGenderPage> {
), ),
), ),
)) ))
),
); );
} }
......
...@@ -10,12 +10,7 @@ class UserLovePage extends StatefulWidget { ...@@ -10,12 +10,7 @@ class UserLovePage extends StatefulWidget {
class _UserLovePageState extends State<UserLovePage> { class _UserLovePageState extends State<UserLovePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return GetBuilder<UserLoveController>(
onWillPop: () async {
context.pop(true);
return false;
},
child: GetBuilder<UserLoveController>(
init: UserLoveController(), init: UserLoveController(),
builder:(controller) => Scaffold( builder:(controller) => Scaffold(
appBar: AppBar( appBar: AppBar(
...@@ -61,7 +56,6 @@ class _UserLovePageState extends State<UserLovePage> { ...@@ -61,7 +56,6 @@ class _UserLovePageState extends State<UserLovePage> {
), ),
), ),
), ),
),
); );
} }
} }
...@@ -7,12 +7,7 @@ class MsgPage extends StatelessWidget { ...@@ -7,12 +7,7 @@ class MsgPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return GetBuilder<MsgController>(
onWillPop: () async {
context.pop(true);
return false;
},
child: GetBuilder<MsgController>(
init: MsgController(), init: MsgController(),
builder:(controller) => Scaffold( builder:(controller) => Scaffold(
appBar: AppBar( appBar: AppBar(
...@@ -54,64 +49,45 @@ class MsgPage extends StatelessWidget { ...@@ -54,64 +49,45 @@ class MsgPage extends StatelessWidget {
if (orderInfo.status == 1){ if (orderInfo.status == 1){
// 书籍订单 // 书籍订单
if (orderInfo.types ==1){ if (orderInfo.types ==1){
final result = await context.pushNamed(Routes.orderAwaiting, context.pushNamed(Routes.orderAwaiting,
queryParameters: {'orderNum': model.urlId?.orderNum.toString()}); queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
if (result == true){
// controller.onRefresh();
}
} }
// 充值订单 // 充值订单
else { else {
final result = await context.pushNamed(Routes.orderCoinAwaiting, context.pushNamed(Routes.orderCoinAwaiting,
queryParameters: {'orderNum': model.urlId?.orderNum.toString()}); queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
if (result == true){
// controller.onRefresh();
}
} }
} }
// 已取消 // 已取消
else if (orderInfo.status ==2){ else if (orderInfo.status ==2){
if (orderInfo.types == 1){ if (orderInfo.types == 1){
final result = await context.pushNamed(Routes.orderCancel, context.pushNamed(Routes.orderCancel,
queryParameters: {'orderNum': model.urlId?.orderNum.toString()}); queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
if (result == true){
// controller.onRefresh();
}
} }
else { else {
final result = await context.pushNamed(Routes.orderCoinCancel, context.pushNamed(Routes.orderCoinCancel,
queryParameters: {'orderNum': model.urlId?.orderNum.toString()}); queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
if (result == true){
// controller.onRefresh();
}
} }
} }
// 已完成 // 已完成
else if (orderInfo.status ==3){ else if (orderInfo.status ==3){
if (orderInfo.types == 1){ if (orderInfo.types == 1){
final result = await context.pushNamed(Routes.orderCompleted, context.pushNamed(Routes.orderCompleted,
queryParameters: {'orderNum': model.urlId?.orderNum.toString()}); queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
if (result == true){
// controller.onRefresh();
}
} }
else { else {
final result = await context.pushNamed(Routes.orderCoinCompleted, context.pushNamed(Routes.orderCoinCompleted,
queryParameters: {'orderNum': model.urlId?.orderNum.toString()}); queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
if (result == true){
// controller.onRefresh();
}
} }
} }
// 已退款 // 已退款
else if (orderInfo.status == 4){ else if (orderInfo.status == 4){
if (orderInfo.types == 1){ if (orderInfo.types == 1){
final result = await context.pushNamed(Routes.orderRefunded, context.pushNamed(Routes.orderRefunded,
queryParameters: {'orderNum': model.urlId?.orderNum.toString()}); queryParameters: {'orderNum': model.urlId?.orderNum.toString()});
if (result == true){
// controller.onRefresh();
}
} }
} }
...@@ -120,13 +96,9 @@ class MsgPage extends StatelessWidget { ...@@ -120,13 +96,9 @@ class MsgPage extends StatelessWidget {
// 2 购买完成三天未评价(跳转订单列表--已完成) // 2 购买完成三天未评价(跳转订单列表--已完成)
final orderInfo = await controller.getOrderInfo(model.urlId?.orderNum??''); final orderInfo = await controller.getOrderInfo(model.urlId?.orderNum??'');
final result = await context.pushNamed(Routes.orderEvaluate,extra:orderInfo, context.pushNamed(Routes.orderEvaluate,extra:orderInfo,
queryParameters: {'orderNum':orderInfo.ordersnum}); queryParameters: {'orderNum':orderInfo.ordersnum});
// final result = await context.pushNamed(Routes.order);
// if (result == true){
// // controller.onRefresh();
// }
///TODO: ///TODO:
}else if (model.type == 3){ }else if (model.type == 3){
// 3 讨论有人回复的时候 (跳转我的讨论详情也) // 3 讨论有人回复的时候 (跳转我的讨论详情也)
...@@ -145,17 +117,11 @@ class MsgPage extends StatelessWidget { ...@@ -145,17 +117,11 @@ class MsgPage extends StatelessWidget {
} }
else if (model.type == 4){ else if (model.type == 4){
// 4 订单完成后有新的积分增加(跳转用户积分记录页) // 4 订单完成后有新的积分增加(跳转用户积分记录页)
final result = await context.pushNamed(Routes.point); context.pushNamed(Routes.point);
if (result == true){
// controller.onRefresh();
}
}else if (model.type == 5){ }else if (model.type == 5){
// 5后台直接发放给指定用户优惠券(跳转到用户优惠券页) // 5后台直接发放给指定用户优惠券(跳转到用户优惠券页)
final result = await context.pushNamed(Routes.coupon); context.pushNamed(Routes.coupon);
if (result == true){
// controller.onRefresh();
}
} }
}, },
...@@ -166,7 +132,6 @@ class MsgPage extends StatelessWidget { ...@@ -166,7 +132,6 @@ class MsgPage extends StatelessWidget {
), ),
), ),
), ),
),
); );
} }
......
...@@ -22,12 +22,7 @@ class _UserNotesDesPageState extends State<UserNotesDesPage> { ...@@ -22,12 +22,7 @@ class _UserNotesDesPageState extends State<UserNotesDesPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return Scaffold(
onWillPop: () async {
context.pop(true);
return false;
},
child: Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: true, centerTitle: true,
title: const Text('笔记详情'), title: const Text('笔记详情'),
...@@ -72,7 +67,6 @@ class _UserNotesDesPageState extends State<UserNotesDesPage> { ...@@ -72,7 +67,6 @@ class _UserNotesDesPageState extends State<UserNotesDesPage> {
], ],
) )
), ),
),
); );
} }
} }
...@@ -43,12 +43,7 @@ class _UserOrderState extends State<UserOrderPage> ...@@ -43,12 +43,7 @@ class _UserOrderState extends State<UserOrderPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return Scaffold(
onWillPop: () async {
context.pop(true);
return false;
},
child: Scaffold(
appBar: AppBar( appBar: AppBar(
title: Container( title: Container(
padding: EdgeInsets.only(right: 10.w), padding: EdgeInsets.only(right: 10.w),
...@@ -65,7 +60,6 @@ class _UserOrderState extends State<UserOrderPage> ...@@ -65,7 +60,6 @@ class _UserOrderState extends State<UserOrderPage>
titleSpacing: 0, titleSpacing: 0,
), ),
body: _buildBody(), body: _buildBody(),
),
); );
} }
......
...@@ -12,10 +12,10 @@ class BuiltAwaiting extends StatelessWidget { ...@@ -12,10 +12,10 @@ class BuiltAwaiting extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
onTap: () async { onTap: () async {
final result = await context.pushNamed(Routes.orderAwaiting, context.pushNamed(Routes.orderAwaiting,
queryParameters: {'orderNum': model.ordersnum}); queryParameters: {'orderNum': model.ordersnum}).then((value){
if (result == true) { controller.onRefresh();
controller.onRefresh(); } });
}, },
child: Container( child: Container(
margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 10.w), margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 10.w),
......
...@@ -18,25 +18,22 @@ class BuiltCoin extends StatelessWidget { ...@@ -18,25 +18,22 @@ class BuiltCoin extends StatelessWidget {
return GestureDetector( return GestureDetector(
onTap: () async { onTap: () async {
if(model.status == 1){ if(model.status == 1){
final result = await context.pushNamed(Routes.orderCoinAwaiting, context.pushNamed(Routes.orderCoinAwaiting,
queryParameters: {'orderNum': model.ordersnum}); queryParameters: {'orderNum': model.ordersnum}).then((value){
if(result==true){
controller.onRefresh(); controller.onRefresh();
} });
} }
else if(model.status == 2){ else if(model.status == 2){
final result = await context.pushNamed(Routes.orderCoinCancel, context.pushNamed(Routes.orderCoinCancel,
queryParameters: {'orderNum': model.ordersnum}); queryParameters: {'orderNum': model.ordersnum}).then((value){
if(result==true){
controller.onRefresh(); controller.onRefresh();
} });
} }
else if(model.status == 3){ else if(model.status == 3){
final result = await context.pushNamed(Routes.orderCoinCompleted, context.pushNamed(Routes.orderCoinCompleted,
queryParameters: {'orderNum': model.ordersnum}); queryParameters: {'orderNum': model.ordersnum}).then((value){
if(result==true){
controller.onRefresh(); controller.onRefresh();
} });
} }
}, },
child: Container( child: Container(
......
...@@ -15,10 +15,10 @@ class BuiltCompleted extends StatelessWidget { ...@@ -15,10 +15,10 @@ class BuiltCompleted extends StatelessWidget {
return GestureDetector( return GestureDetector(
onTap: () onTap: ()
async { async {
final result = await context.pushNamed(Routes.orderCompleted, context.pushNamed(Routes.orderCompleted,
queryParameters: {'orderNum': model.ordersnum}); queryParameters: {'orderNum': model.ordersnum}).then((value){
if (result == true) { controller.onRefresh();
controller.onRefresh(); } });
}, },
child: Container( child: Container(
margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 10.w), margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 10.w),
...@@ -165,14 +165,13 @@ class BuiltCompleted extends StatelessWidget { ...@@ -165,14 +165,13 @@ class BuiltCompleted extends StatelessWidget {
child: Center( child: Center(
child: GestureDetector( child: GestureDetector(
onTap: () async { onTap: () async {
final result = await context.pushNamed(Routes.orderEvaluate, context.pushNamed(Routes.orderEvaluate,
extra: OrderInfoModel(), extra: OrderInfoModel(),
queryParameters: { queryParameters: {
'orderNum': model.ordersnum 'orderNum': model.ordersnum
}); }).then((value){
if (result == true) {
controller.onRefresh(); controller.onRefresh();
} });
}, },
child: Text( child: Text(
judgeComments() == 1 ? '去评价' : "继续评价", judgeComments() == 1 ? '去评价' : "继续评价",
...@@ -307,14 +306,14 @@ class BuiltCompleted extends StatelessWidget { ...@@ -307,14 +306,14 @@ class BuiltCompleted extends StatelessWidget {
child: Center( child: Center(
child: GestureDetector( child: GestureDetector(
onTap: () async { onTap: () async {
final result = await context.pushNamed(Routes.orderEvaluate, context.pushNamed(Routes.orderEvaluate,
extra: OrderInfoModel(), extra: OrderInfoModel(),
queryParameters: { queryParameters: {
'orderNum': model.ordersnum 'orderNum': model.ordersnum
}); }).then((value){
if (result == true) {
controller.onRefresh(); controller.onRefresh();
} });
}, },
child: Text( child: Text(
judgeComments() == 1 ? '去评价' : "继续评价", judgeComments() == 1 ? '去评价' : "继续评价",
......
...@@ -21,12 +21,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -21,12 +21,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return FutureBuilder(
onWillPop: () async {
context.pop(true);
return false;
},
child: FutureBuilder(
future: myController.getOrderInfo(), future: myController.getOrderInfo(),
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
...@@ -37,12 +32,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -37,12 +32,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
), ),
); );
} else { } else {
return WillPopScope( return Scaffold(
onWillPop: () async {
context.pop(true);
return false;
},
child: Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: const Text('等待付款'), title: const Text('等待付款'),
actions: [], actions: [],
...@@ -309,11 +299,9 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -309,11 +299,9 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
), ),
], ],
), ),
),
); );
} }
}, },
),
); );
} }
} }
...@@ -12,12 +12,7 @@ class UserOrderCancelDetailPage extends StatefulWidget { ...@@ -12,12 +12,7 @@ class UserOrderCancelDetailPage extends StatefulWidget {
class _UserOrderRefundedState extends State<UserOrderCancelDetailPage> { class _UserOrderRefundedState extends State<UserOrderCancelDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return GetBuilder<UserOrderCancelDetailController>(
onWillPop: () async {
context.pop(true);
return false;
},
child: GetBuilder<UserOrderCancelDetailController>(
init: UserOrderCancelDetailController(widget.orderNum), init: UserOrderCancelDetailController(widget.orderNum),
builder: (controller) => Scaffold( builder: (controller) => Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
...@@ -238,7 +233,6 @@ class _UserOrderRefundedState extends State<UserOrderCancelDetailPage> { ...@@ -238,7 +233,6 @@ class _UserOrderRefundedState extends State<UserOrderCancelDetailPage> {
// ), // ),
// ) // )
],), ],),
)), ));
);
} }
} }
...@@ -23,12 +23,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -23,12 +23,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return FutureBuilder(
onWillPop: () async {
context.pop(true);
return false;
},
child: FutureBuilder(
future: myController.getOrderInfo(), future: myController.getOrderInfo(),
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
...@@ -39,12 +34,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -39,12 +34,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
), ),
); );
} else { } else {
return WillPopScope( return Scaffold(
onWillPop: () async {
context.pop(true);
return false;
},
child: Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: const Text('待支付'), title: const Text('待支付'),
actions: [], actions: [],
...@@ -318,11 +308,9 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -318,11 +308,9 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
), ),
], ],
), ),
),
); );
} }
}, },
),
); );
} }
} }
...@@ -23,12 +23,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCancelPage> { ...@@ -23,12 +23,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCancelPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return FutureBuilder(
onWillPop: () async {
context.pop(true);
return false;
},
child: FutureBuilder(
future: myController.getOrderInfo(), future: myController.getOrderInfo(),
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
...@@ -39,12 +34,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCancelPage> { ...@@ -39,12 +34,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCancelPage> {
), ),
); );
} else { } else {
return WillPopScope( return Scaffold(
onWillPop: () async {
context.pop(true);
return false;
},
child: Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: const Text('已取消'), title: const Text('已取消'),
actions: [], actions: [],
...@@ -183,11 +173,9 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCancelPage> { ...@@ -183,11 +173,9 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCancelPage> {
), ),
], ],
), ),
),
); );
} }
}, },
),
); );
} }
} }
...@@ -23,12 +23,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCompletedPage> { ...@@ -23,12 +23,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCompletedPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return FutureBuilder(
onWillPop: () async {
context.pop(true);
return false;
},
child: FutureBuilder(
future: myController.getOrderInfo(), future: myController.getOrderInfo(),
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) { if (snapshot.connectionState == ConnectionState.waiting) {
...@@ -39,12 +34,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCompletedPage> { ...@@ -39,12 +34,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCompletedPage> {
), ),
); );
} else { } else {
return WillPopScope( return Scaffold(
onWillPop: () async {
context.pop(true);
return false;
},
child: Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: const Text('已完成'), title: const Text('已完成'),
actions: [], actions: [],
...@@ -183,11 +173,9 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCompletedPage> { ...@@ -183,11 +173,9 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCompletedPage> {
), ),
], ],
), ),
),
); );
} }
}, },
),
); );
} }
} }
...@@ -19,12 +19,7 @@ class _UserOrderCompletedState extends State<UserOrderCompletedPage> { ...@@ -19,12 +19,7 @@ class _UserOrderCompletedState extends State<UserOrderCompletedPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return GetBuilder<UserOrderCompletedController>(
onWillPop: () async {
context.pop(true);
return false;
},
child: GetBuilder<UserOrderCompletedController>(
init: UserOrderCompletedController(widget.orderNum), init: UserOrderCompletedController(widget.orderNum),
builder: (controller) => Scaffold( builder: (controller) => Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
...@@ -224,9 +219,9 @@ class _UserOrderCompletedState extends State<UserOrderCompletedPage> { ...@@ -224,9 +219,9 @@ class _UserOrderCompletedState extends State<UserOrderCompletedPage> {
child: GestureDetector( child: GestureDetector(
onTap: () async { onTap: () async {
final result = await context.pushNamed(Routes.orderEvaluate,extra:controller.model, final result = await context.pushNamed(Routes.orderEvaluate,extra:controller.model,
queryParameters: {'orderNum':controller.model.ordersnum}); queryParameters: {'orderNum':controller.model.ordersnum}).then((value){
if (result == true) { controller.getOrderInfo();
controller.getOrderInfo(); } });
}, },
child: Text(controller.judgeComments() ==1?'去评价':"继续评价", child: Text(controller.judgeComments() ==1?'去评价':"继续评价",
style: TextStyle( style: TextStyle(
...@@ -244,7 +239,6 @@ class _UserOrderCompletedState extends State<UserOrderCompletedPage> { ...@@ -244,7 +239,6 @@ class _UserOrderCompletedState extends State<UserOrderCompletedPage> {
], ],
), ),
), ),
))), )));
);
} }
} }
...@@ -29,12 +29,7 @@ class _UserOrderEvaluatePageState extends State<UserOrderEvaluatePage> with Auto ...@@ -29,12 +29,7 @@ class _UserOrderEvaluatePageState extends State<UserOrderEvaluatePage> with Auto
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// super.build(context); // super.build(context);
return WillPopScope( return GetBuilder<UserOrderEvaluateController>(
onWillPop: () async {
context.pop(true);
return false;
},
child:GetBuilder<UserOrderEvaluateController>(
init: UserOrderEvaluateController(widget.orderNum), init: UserOrderEvaluateController(widget.orderNum),
builder: (controller) => Scaffold( builder: (controller) => Scaffold(
appBar: AppBar( appBar: AppBar(
...@@ -95,7 +90,7 @@ class _UserOrderEvaluatePageState extends State<UserOrderEvaluatePage> with Auto ...@@ -95,7 +90,7 @@ class _UserOrderEvaluatePageState extends State<UserOrderEvaluatePage> with Auto
], ],
), ),
), ),
),),); ),);
} }
Widget listItem(BookListModel bookListModel,int index,UserOrderEvaluateController myController) { Widget listItem(BookListModel bookListModel,int index,UserOrderEvaluateController myController) {
......
...@@ -12,12 +12,7 @@ class UserOrderRefundedPage extends StatefulWidget { ...@@ -12,12 +12,7 @@ class UserOrderRefundedPage extends StatefulWidget {
class _UserOrderRefundedState extends State<UserOrderRefundedPage> { class _UserOrderRefundedState extends State<UserOrderRefundedPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return GetBuilder<UserOrderCRefundedController>(
onWillPop: () async {
context.pop(true);
return false;
},
child: GetBuilder<UserOrderCRefundedController>(
init: UserOrderCRefundedController(widget.orderNum), init: UserOrderCRefundedController(widget.orderNum),
builder: (controller) => Scaffold( builder: (controller) => Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
...@@ -238,7 +233,6 @@ class _UserOrderRefundedState extends State<UserOrderRefundedPage> { ...@@ -238,7 +233,6 @@ class _UserOrderRefundedState extends State<UserOrderRefundedPage> {
), ),
) )
],), ],),
)), ));
);
} }
} }
...@@ -10,12 +10,7 @@ class UserPointPage extends StatefulWidget { ...@@ -10,12 +10,7 @@ class UserPointPage extends StatefulWidget {
class _UserPointPageState extends State<UserPointPage> { class _UserPointPageState extends State<UserPointPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return GetBuilder<UserPointController>(
onWillPop: () async {
context.pop(true);
return false;
},
child: GetBuilder<UserPointController>(
init: UserPointController(), init: UserPointController(),
builder: (controller) => Scaffold( builder: (controller) => Scaffold(
appBar: AppBar( appBar: AppBar(
...@@ -59,7 +54,6 @@ class _UserPointPageState extends State<UserPointPage> { ...@@ -59,7 +54,6 @@ class _UserPointPageState extends State<UserPointPage> {
), ),
), ),
), ),
),
); );
} }
} }
...@@ -12,12 +12,7 @@ class UserSecurityPage extends StatefulWidget { ...@@ -12,12 +12,7 @@ class UserSecurityPage extends StatefulWidget {
class _UserSecurityPageState extends State<UserSecurityPage> { class _UserSecurityPageState extends State<UserSecurityPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return WillPopScope( return Scaffold(
onWillPop: () async {
context.pop(true);
return false;
},
child: Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: true, centerTitle: true,
title: const Text('账号安全'), title: const Text('账号安全'),
...@@ -185,7 +180,6 @@ class _UserSecurityPageState extends State<UserSecurityPage> { ...@@ -185,7 +180,6 @@ class _UserSecurityPageState extends State<UserSecurityPage> {
) )
], ],
), ),
),
); );
} }
......
...@@ -25,7 +25,7 @@ const String kReadBook = '$kServerUrl/html/app/read.html'; ...@@ -25,7 +25,7 @@ const String kReadBook = '$kServerUrl/html/app/read.html';
// 答题页 // 答题页
const String kAnswer = '$kServerUrl/html/app/evaluating.html'; const String kAnswer = '$kServerUrl/html/app/evaluating.html';
// 答题结果页 // 答题结果页
const String kAnswerResult = '$kServerUrl/html/app/evaluating_result.html'; const String kAnswerResult = 'http://150.158.138.40:9200/evaluating_result.html';
// 画廊 扩展阅读 // 画廊 扩展阅读
const String kReadInfo = '$kServerUrl/html/app/read_info.html'; const String kReadInfo = '$kServerUrl/html/app/read_info.html';
......
...@@ -91,14 +91,12 @@ class ValidatorTool { ...@@ -91,14 +91,12 @@ class ValidatorTool {
// 密码 // 密码
static bool isValidPassword(String value) { static bool isValidPassword(String value) {
RegExp passwordPattern = RegExp(r'^[A-Za-z0-9!@#\$%^&*()_+{}\[\]:;<>,.?~\\/-]{8,12}$'); RegExp passwordPattern = RegExp(r'^(?:(?=.*[a-zA-Z])(?=.*[\d])(?=.*[~@#%$*_\-+=;:,.?])|(?=.*[a-zA-Z])(?=.*[\d])|(?=.*[\d])(?=.*[~@#%$*_\-+=;:,.?])|(?=.*[a-zA-Z])(?=.*[~@#%$*_\-+=;:,.?]))[\w~@#%$*_\-+=;:,.?]{8,12}$');
// RegExp passwordPattern = RegExp(r'^(?=.*[A-Za-z])(?=.*\d)(?=.*[~@#%$*()_+{}\[\]:;<>,.?\\/-])[A-Za-z0-9~@#%$*()_+{}\[\]:;<>,.?\\/-]{8,12}$'); // 密码必须是数字、字母、特殊符号两种及以上8-12位的组合
// RegExp passwordPattern = RegExp(r'^\d{6}$');
return passwordPattern.hasMatch(value); return passwordPattern.hasMatch(value);
} }
static bool isValidCode(String value) { static bool isValidCode(String value) {
// RegExp passwordPattern = RegExp(r'^[A-Za-z0-9!@#\$%^&*()_+{}\[\]:;<>,.?~\\/-]{8,12}$');
RegExp passwordPattern = RegExp(r'^\d{6}$'); RegExp passwordPattern = RegExp(r'^\d{6}$');
return passwordPattern.hasMatch(value); return passwordPattern.hasMatch(value);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论