提交 16f5aadf authored 作者: 王鹏飞's avatar 王鹏飞

chore: 修复编译错误 + 清理 Android 多余权限 + 更新协议版本号

- AndroidManifest.xml: 移除 flutter_sound_core 声明的 BLUETOOTH 和无效的 CAPTURE_AUDIO_OUTPUT 权限 - pay_coupon/view.dart: 移除 _PayCouponPageState 中错误的 super.build(context)(该类未混入 AutomaticKeepAliveClientMixin) - book_shop/controller.dart: 删除多余的 } - user_discuss/controller.dart, user_notes/controller.dart: 补上缺失的类结束 } - constants.dart: 用户协议和隐私政策版本号更新
上级 be4dd0b4
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<!-- INTERNET 权限在开发过程中是必需的。具体来说,Flutter 需要它与正在运行的应用程序进行通信,以允许设置断点、提供热重载等功能--> <!-- INTERNET 权限在开发过程中是必需的。具体来说,Flutter 需要它与正在运行的应用程序进行通信,以允许设置断点、提供热重载等功能-->
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.RECORD_AUDIO" />
<!-- 移除 flutter_sound_core 声明的多余权限 -->
<uses-permission android:name="android.permission.BLUETOOTH" tools:node="remove" />
<uses-permission android:name="Manifest.permission.CAPTURE_AUDIO_OUTPUT" tools:node="remove" />
<!-- 加入tts服务--> <!-- 加入tts服务-->
<queries> <queries>
<intent> <intent>
......
...@@ -173,5 +173,4 @@ class BookshopController extends GetxController { ...@@ -173,5 +173,4 @@ class BookshopController extends GetxController {
refreshController.finishLoad(IndicatorResult.fail); refreshController.finishLoad(IndicatorResult.fail);
} }
} }
}
} }
part of pay_coupon; part of pay_coupon;
class PayCouponPage extends StatefulWidget { class PayCouponPage extends StatefulWidget {
final BookPayController payController; final BookPayController payController;
const PayCouponPage({ const PayCouponPage({Key? key, required this.payController})
Key? key, : super(key: key);
required this.payController
}) : super(key: key);
@override @override
State<PayCouponPage> createState() => _PayCouponPageState(); State<PayCouponPage> createState() => _PayCouponPageState();
} }
class _PayCouponPageState extends State<PayCouponPage> with SingleTickerProviderStateMixin{ class _PayCouponPageState extends State<PayCouponPage>
with SingleTickerProviderStateMixin {
List <Widget> tabs= []; List<Widget> tabs = [];
late TabController tabController; late TabController tabController;
@override @override
void initState() { void initState() {
tabs = [ tabs = [
Tab(text: '可用(${widget.payController.couponNumModel.availableNum})',), Tab(
Tab(text: '不可用(${widget.payController.couponNumModel.unavailableNum})',), text: '可用(${widget.payController.couponNumModel.availableNum})',
),
Tab(
text: '不可用(${widget.payController.couponNumModel.unavailableNum})',
),
]; ];
tabController = TabController(length:tabs.length, vsync: this); tabController = TabController(length: tabs.length, vsync: this);
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context);
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
centerTitle: true, centerTitle: true,
title: const Text('选择优惠券'), title: const Text('选择优惠券'),
), ),
body: Column( body: Column(
children: [ children: [
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: const Color(0xFFC7C7C7).withValues(alpha: 0.3), color: const Color(0xFFC7C7C7).withValues(alpha: 0.3),
spreadRadius: 2.w, spreadRadius: 2.w,
blurRadius: 5.w, blurRadius: 5.w,
offset: Offset(3.w, 0), // offset: Offset(3.w, 0), //
), ),
], ],
), ),
child: TabBar( child: TabBar(
labelColor: Colours.c3, labelColor: Colours.c3,
labelStyle: TextStyle(fontSize: 15.w,height: 1.4,fontWeight: Fonts.medium), labelStyle: TextStyle(
unselectedLabelColor: Colours.c9, fontSize: 15.w, height: 1.4, fontWeight: Fonts.medium),
unselectedLabelStyle: TextStyle(fontSize: 15.w,height: 1.4), unselectedLabelColor: Colours.c9,
indicatorSize: TabBarIndicatorSize.label, unselectedLabelStyle: TextStyle(fontSize: 15.w, height: 1.4),
indicatorColor: AppTheme.primary, indicatorSize: TabBarIndicatorSize.label,
tabs:tabs, indicatorColor: AppTheme.primary,
physics: const NeverScrollableScrollPhysics(), tabs: tabs,
controller: tabController, physics: const NeverScrollableScrollPhysics(),
controller: tabController,
),
), ),
), Expanded(
child: TabBarView(
Expanded(
child: TabBarView(
controller: tabController, controller: tabController,
children: List.generate(tabs.length, (index){ children: List.generate(tabs.length, (index) {
return CouponPage(tag:'${1-index}',payController: widget.payController,); return CouponPage(
}) tag: '${1 - index}',
), payController: widget.payController,
), );
], })),
), ),
); ],
),
);
} }
} }
class CouponPage extends StatefulWidget { class CouponPage extends StatefulWidget {
final String tag; final String tag;
final BookPayController payController; final BookPayController payController;
const CouponPage({ const CouponPage({Key? key, required this.tag, required this.payController})
Key? key, : super(key: key);
required this.tag,
required this.payController
}) : super(key: key);
@override @override
State<CouponPage> createState() => _CouponPageState(); State<CouponPage> createState() => _CouponPageState();
} }
class _CouponPageState extends State<CouponPage> with AutomaticKeepAliveClientMixin{ class _CouponPageState extends State<CouponPage>
with AutomaticKeepAliveClientMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); super.build(context);
return GetBuilder<PayCouponController>( return GetBuilder<PayCouponController>(
tag: widget.tag, tag: widget.tag,
init: PayCouponController(widget.tag,widget.payController), init: PayCouponController(widget.tag, widget.payController),
builder: (controller) =>CustomPullScrollView( builder: (controller) => CustomPullScrollView(
controller: controller.refreshController, controller: controller.refreshController,
onRefresh: controller.onRefresh, onRefresh: controller.onRefresh,
onLoading: controller.onLoading, onLoading: controller.onLoading,
child: ListView.builder( child: ListView.builder(
itemBuilder: (BuildContext context, int index){ itemBuilder: (BuildContext context, int index) {
CouponModel model = controller.coupons[index]; CouponModel model = controller.coupons[index];
return BuildItem(model:model,useTap: (){ return BuildItem(
Console.log('选择优惠券--------------------------------${model.couponRecId}'); model: model,
widget.payController.setUseCoupon(model); useTap: () {
context.pop(); Console.log(
},); '选择优惠券--------------------------------${model.couponRecId}');
widget.payController.setUseCoupon(model);
context.pop();
},
);
}, },
itemCount: controller.coupons.length, itemCount: controller.coupons.length,
), ),
...@@ -120,8 +122,3 @@ class _CouponPageState extends State<CouponPage> with AutomaticKeepAliveClientMi ...@@ -120,8 +122,3 @@ class _CouponPageState extends State<CouponPage> with AutomaticKeepAliveClientMi
@override @override
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
} }
...@@ -63,4 +63,4 @@ class UserDiscussController extends GetxController { ...@@ -63,4 +63,4 @@ class UserDiscussController extends GetxController {
refreshController.finishLoad(IndicatorResult.fail); refreshController.finishLoad(IndicatorResult.fail);
} }
} }
}
...@@ -65,4 +65,4 @@ class UserNoteController extends GetxController { ...@@ -65,4 +65,4 @@ class UserNoteController extends GetxController {
refreshController.finishLoad(IndicatorResult.fail); refreshController.finishLoad(IndicatorResult.fail);
} }
} }
}
...@@ -14,9 +14,10 @@ const String kSearchHistory = 'search_history'; ...@@ -14,9 +14,10 @@ const String kSearchHistory = 'search_history';
const String kFailOrder = 'failOrder'; const String kFailOrder = 'failOrder';
const String kNoteTable = 'members_book_notes'; const String kNoteTable = 'members_book_notes';
const String kReadTable = 'read_history'; const String kReadTable = 'read_history';
const String kUserAgreement = '$kHtmlBaseServer/agreement/ser_agreement.html?v=1'; const String kUserAgreement =
'$kHtmlBaseServer/agreement/ser_agreement.html?v=2';
const String kUserPriAgreement = const String kUserPriAgreement =
'$kHtmlBaseServer/agreement/pri_agreement.html?v=1'; '$kHtmlBaseServer/agreement/pri_agreement.html?v=2';
const String kUserRechargeAgreement = const String kUserRechargeAgreement =
'$kHtmlBaseServer/agreement/rec_agreement.html?v=1'; '$kHtmlBaseServer/agreement/rec_agreement.html?v=1';
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论