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