Commit 354ac7e64b6a9d4ae13f9e117567712c02229d42

Authored by 吴启风
1 parent a8f96625

feat:隐藏视频跟读入口、底部草坪图片优化;修改密码增加返回图标;语音问答题录音权限未授权导致录音失败

assets/images/bottom_grass.png

342 KB | W: | H:

317 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
lib/common/dialogs/customer_dialog.dart
1 1 import 'package:flutter/material.dart';
2 2 import 'package:flutter_screenutil/flutter_screenutil.dart';
3   -import 'package:wow_english/route/route.dart';
4 3  
5 4 class CustomerTwoActionDialog extends Dialog {
6 5 const CustomerTwoActionDialog(
... ...
lib/pages/home/widgets/home_tab_header_widget.dart
... ... @@ -83,13 +83,13 @@ class HomeTabHeaderWidget extends StatelessWidget {
83 83 textAlign: TextAlign.left,
84 84 style: const TextStyle(color: Colors.white, fontSize: 30.0),
85 85 )),
86   - IconButton(
87   - onPressed: () {
88   - if (actionTap != null) {
89   - actionTap!(HeaderActionType.video);
90   - }
91   - },
92   - icon: Image.asset('video'.assetPng)),
  86 + // IconButton(
  87 + // onPressed: () {
  88 + // if (actionTap != null) {
  89 + // actionTap!(HeaderActionType.video);
  90 + // }
  91 + // },
  92 + // icon: Image.asset('video'.assetPng)),
93 93 IconButton(
94 94 onPressed: () {
95 95 if (actionTap != null) {
... ...
lib/pages/lessons/widgets/lesson_item_widget.dart
... ... @@ -3,7 +3,6 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
3 3 import 'package:wow_english/common/extension/string_extension.dart';
4 4 import 'package:wow_english/common/widgets/ow_image_widget.dart';
5 5 import 'package:wow_english/models/course_module_entity.dart';
6   -import 'package:wow_english/utils/color_util.dart';
7 6  
8 7 import '../../home/courese_module_model.dart';
9 8  
... ...
lib/pages/login/forgetpwd/forget_password_home_page.dart
... ... @@ -53,115 +53,133 @@ class _ForgetPasswordHomePageView extends StatelessWidget {
53 53 body: Container(
54 54 color: Colors.white,
55 55 child: SafeArea(
56   - child: SingleChildScrollView(
57   - child: Padding(
58   - padding: EdgeInsets.only(left: 49.w, right: 10.w),
59   - child: Column(
60   - children: [
61   - 34.verticalSpace,
62   - Row(
63   - children: [
64   - Image.asset(
65   - 'wow_logo'.assetPng,
66   - height: 49.w,
67   - width: 83.5.h,
68   - ),
69   - 12.5.horizontalSpace,
70   - Text(
71   - '修改密码\n请输入您的手机号和验证码吧',
72   - style: TextStyle(fontSize: 16.sp, color: const Color(0xFF666666)),
73   - )
74   - ],
75   - ),
76   - Row(
77   - crossAxisAlignment: CrossAxisAlignment.start,
78   - children: [
79   - Expanded(
80   - child: Column(
81   - children: [
82   - 44.5.verticalSpace,
83   - Row(
84   - children: [
85   - Image.asset(
86   - 'phone'.assetPng,
87   - height: 45.h,
88   - width: 35.w,
89   - ),
90   - 15.horizontalSpace,
91   - Expanded(
92   - child: TextFieldCustomerWidget(
93   - height: 50.h,
94   - hitText: '请输入当前手机号',
95   - textInputType: TextInputType.phone,
96   - bgImageName: 'Input_layer_up',
97   - onChangeValue: (String value) {
98   - bloc.add(PhoneNumChangeEvent());
99   - },
100   - controller: bloc.phoneNumController,
101   - ))
102   - ],
103   - ),
104   - 11.5.verticalSpace,
105   - Row(
106   - mainAxisAlignment: MainAxisAlignment.spaceBetween,
107   - children: [
108   - Image.asset(
109   - 'lock'.assetPng,
110   - height: 34.h,
111   - width: 31.w,
112   - ),
113   - 18.5.horizontalSpace,
114   - Expanded(
115   - child: TextFieldCustomerWidget(
116   - hitText: '请输入验证码',
117   - bgImageName: 'Input_layer_down',
118   - onChangeValue: (String value) {
119   - bloc.add(CheckCodeChangeEvent());
120   - },
121   - textInputType: TextInputType.emailAddress,
122   - controller: bloc.checkNumController,
123   - )),
124   - 16.5.horizontalSpace,
125   - TimerWidget(
126   - pageType: 1,
127   - canSendSms: bloc.canSendSms,
128   - sendSmsEvent: () => bloc.add(SendSmsCodeEvent()),
129   - )
130   - ],
131   - )
132   - ],
133   - )),
134   - 2.verticalSpace,
135   - Image.asset(
136   - 'steven_bride'.assetPng,
137   - height: 173.h,
138   - width: 157.w,
139   - )
140   - ],
  56 + child: Stack(
  57 + children: [
  58 + SingleChildScrollView(
  59 + child: Padding(
  60 + padding: EdgeInsets.only(left: 49.w, right: 10.w),
  61 + child: Column(
  62 + children: [
  63 + 34.verticalSpace,
  64 + Row(
  65 + children: [
  66 + Image.asset(
  67 + 'wow_logo'.assetPng,
  68 + height: 49.w,
  69 + width: 83.5.h,
  70 + ),
  71 + 12.5.horizontalSpace,
  72 + Text(
  73 + '修改密码\n请输入您的手机号和验证码吧',
  74 + style: TextStyle(fontSize: 16.sp, color: const Color(0xFF666666)),
  75 + )
  76 + ],
  77 + ),
  78 + Row(
  79 + crossAxisAlignment: CrossAxisAlignment.start,
  80 + children: [
  81 + Expanded(
  82 + child: Column(
  83 + children: [
  84 + 44.5.verticalSpace,
  85 + Row(
  86 + children: [
  87 + Image.asset(
  88 + 'phone'.assetPng,
  89 + height: 45.h,
  90 + width: 35.w,
  91 + ),
  92 + 15.horizontalSpace,
  93 + Expanded(
  94 + child: TextFieldCustomerWidget(
  95 + height: 50.h,
  96 + hitText: '请输入当前手机号',
  97 + textInputType: TextInputType.phone,
  98 + bgImageName: 'Input_layer_up',
  99 + onChangeValue: (String value) {
  100 + bloc.add(PhoneNumChangeEvent());
  101 + },
  102 + controller: bloc.phoneNumController,
  103 + ))
  104 + ],
  105 + ),
  106 + 11.5.verticalSpace,
  107 + Row(
  108 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  109 + children: [
  110 + Image.asset(
  111 + 'lock'.assetPng,
  112 + height: 34.h,
  113 + width: 31.w,
  114 + ),
  115 + 18.5.horizontalSpace,
  116 + Expanded(
  117 + child: TextFieldCustomerWidget(
  118 + hitText: '请输入验证码',
  119 + bgImageName: 'Input_layer_down',
  120 + onChangeValue: (String value) {
  121 + bloc.add(CheckCodeChangeEvent());
  122 + },
  123 + textInputType: TextInputType.emailAddress,
  124 + controller: bloc.checkNumController,
  125 + )),
  126 + 16.5.horizontalSpace,
  127 + TimerWidget(
  128 + pageType: 1,
  129 + canSendSms: bloc.canSendSms,
  130 + sendSmsEvent: () => bloc.add(SendSmsCodeEvent()),
  131 + )
  132 + ],
  133 + )
  134 + ],
  135 + )),
  136 + 2.verticalSpace,
  137 + Image.asset(
  138 + 'steven_bride'.assetPng,
  139 + height: 173.h,
  140 + width: 157.w,
  141 + )
  142 + ],
  143 + ),
  144 + GestureDetector(
  145 + onTap: () {
  146 + if (bloc.canSetPwd) {
  147 + bloc.add(SetPassWordEvent());
  148 + }
  149 + },
  150 + child: Container(
  151 + decoration: BoxDecoration(
  152 + image: DecorationImage(
  153 + image: AssetImage(bloc.canSetPwd ? 'login_enter'.assetPng : 'login_enter_dis'.assetPng),
  154 + fit: BoxFit.fill),
  155 + ),
  156 + padding: EdgeInsets.symmetric(horizontal: 28.w, vertical: 14.h),
  157 + child: Text(
  158 + '确定',
  159 + style: TextStyle(fontSize: 16.sp, color: Colors.white),
  160 + ),
  161 + ),
  162 + )
  163 + ],
  164 + ),
141 165 ),
142   - GestureDetector(
143   - onTap: () {
144   - if (bloc.canSetPwd) {
145   - bloc.add(SetPassWordEvent());
146   - }
  166 + ),
  167 + Container(
  168 + padding: EdgeInsets.only(top: 16.h),
  169 + alignment: Alignment.topLeft,
  170 + child: IconButton(
  171 + onPressed: () {
  172 + Navigator.pop(context);
147 173 },
148   - child: Container(
149   - decoration: BoxDecoration(
150   - image: DecorationImage(
151   - image: AssetImage(bloc.canSetPwd ? 'login_enter'.assetPng : 'login_enter_dis'.assetPng),
152   - fit: BoxFit.fill),
153   - ),
154   - padding: EdgeInsets.symmetric(horizontal: 28.w, vertical: 14.h),
155   - child: Text(
156   - '确定',
157   - style: TextStyle(fontSize: 16.sp, color: Colors.white),
158   - ),
159   - ),
160   - )
161   - ],
162   - ),
163   - ),
164   - ),
  174 + icon: Image.asset(
  175 + 'back_around'.assetPng,
  176 + width: 40.w,
  177 + height: 40.h,
  178 + )
  179 + ),
  180 + ),
  181 + ]
  182 + )
165 183 ),
166 184 ),
167 185 );
... ...
lib/pages/login/setpwd/bloc/set_pwd_bloc.dart
1   -import 'package:common_utils/common_utils.dart';
2 1 import 'package:flutter/cupertino.dart';
3 2 import 'package:flutter_bloc/flutter_bloc.dart';
4 3 import 'package:wow_english/common/request/dao/user_dao.dart';
... ...
lib/pages/practice/bloc/topic_picture_bloc.dart
... ... @@ -4,12 +4,15 @@ import 'package:flutter/foundation.dart';
4 4 import 'package:flutter/services.dart';
5 5 import 'package:flutter_bloc/flutter_bloc.dart';
6 6 import 'package:flutter_easyloading/flutter_easyloading.dart';
  7 +import 'package:permission_handler/permission_handler.dart';
7 8 import 'package:wow_english/common/request/dao/listen_dao.dart';
8 9 import 'package:wow_english/common/request/exception.dart';
9 10 import 'package:wow_english/models/course_process_entity.dart';
10 11 import 'package:wow_english/utils/loading.dart';
11 12 import 'package:wow_english/utils/toast_util.dart';
12 13  
  14 +import '../../../common/permission/permissionRequestPage.dart';
  15 +
13 16 part 'topic_picture_event.dart';
14 17 part 'topic_picture_state.dart';
15 18  
... ... @@ -56,7 +59,9 @@ class TopicPictureBloc extends Bloc<TopicPictureEvent, TopicPictureState> {
56 59  
57 60 late AudioPlayer audioPlayer;
58 61  
59   - TopicPictureBloc(this.pageController, this.courseLessonId) : super(TopicPictureInitial()) {
  62 + final BuildContext context;
  63 +
  64 + TopicPictureBloc(this.context, this.pageController, this.courseLessonId) : super(TopicPictureInitial()) {
60 65 on<CurrentPageIndexChangeEvent>(_pageControllerChange);
61 66 on<VoicePlayStateChangeEvent>(_voicePlayStateChange);
62 67 on<XSVoiceResultEvent>(_voiceXsResult);
... ... @@ -183,12 +188,24 @@ class TopicPictureBloc extends Bloc&lt;TopicPictureEvent, TopicPictureState&gt; {
183 188 ///先声测试
184 189 void _voiceXsTest(XSVoiceTestEvent event,Emitter<TopicPictureState> emitter) async {
185 190 await audioPlayer.stop();
186   - methodChannel.invokeMethod(
187   - 'startVoice',
188   - {'word':event.testWord,'type':event.type,'userId':event.userId.toString()}
  191 + // 调用封装好的权限检查和请求方法
  192 + bool result = await permissionCheckAndRequest(
  193 + context,
  194 + Permission.microphone,
  195 + "录音"
189 196 );
190   - _isVoicing = true;
191   - emitter(XSVoiceTestState());
  197 + if (result) {
  198 + methodChannel.invokeMethod(
  199 + 'startVoice',
  200 + {
  201 + 'word': event.testWord,
  202 + 'type': event.type,
  203 + 'userId': event.userId.toString()
  204 + }
  205 + );
  206 + _isVoicing = true;
  207 + emitter(XSVoiceTestState());
  208 + }
192 209 }
193 210  
194 211 ///终止评测
... ...
lib/pages/practice/topic_picture_page.dart
... ... @@ -21,6 +21,7 @@ class TopicPicturePage extends StatelessWidget {
21 21 Widget build(BuildContext context) {
22 22 return BlocProvider(
23 23 create: (context) => TopicPictureBloc(
  24 + context,
24 25 PageController(),
25 26 courseLessonId??'',
26 27 )
... ...
lib/pages/reading/bloc/reading_bloc.dart
... ... @@ -338,7 +338,7 @@ class ReadingPageBloc extends Bloc&lt;ReadingPageEvent, ReadingPageState&gt; {
338 338 nextPage();
339 339 }
340 340  
341   - Log.d("_onAudioPlayComplete _isOriginAudioPlaying=${_isOriginAudioPlaying} _voicePlayState=$_voicePlayState recordUrl=${currentPageData()?.recordUrl?.isNotEmpty}");
  341 + Log.d("_onAudioPlayComplete _isOriginAudioPlaying=$_isOriginAudioPlaying _voicePlayState=$_voicePlayState recordUrl=${currentPageData()?.recordUrl?.isNotEmpty}");
342 342 if (_isOriginAudioPlaying && _voicePlayState == VoicePlayState.completed && currentPageData()?.recordUrl?.isNotEmpty != true) {
343 343 ///如果刚刚完成原音播放&&录音为空,则开始录音
344 344 startRecord(currentPageData()?.word ?? '');
... ...
lib/pages/shop/exchane/bloc/exchange_lesson_bloc.dart
1 1 import 'package:flutter/cupertino.dart';
2 2 import 'package:flutter_bloc/flutter_bloc.dart';
3   -import 'package:wow_english/common/request/exception.dart';
4 3 import 'package:wow_english/utils/loading.dart';
5   -import 'package:wow_english/utils/toast_util.dart';
6 4  
7 5 import '../../../../common/request/dao/request_dao.dart';
8 6  
... ...
lib/pages/shop/home/bloc/shop_home_bloc.dart
1   -import 'dart:async';
2 1  
3 2 import 'package:bloc/bloc.dart';
4 3 import 'package:meta/meta.dart';
... ...
lib/pages/tab/blocs/tab_bloc.dart
1   -import 'dart:async';
2 1  
3 2 import 'package:bloc/bloc.dart';
4 3 import 'package:meta/meta.dart';
... ...