王子贤 2 months ago
parent
commit
8526a9c798
6 changed files with 42 additions and 595 deletions
  1. 12
      lib/controller/mine/edit_info_controller.dart
  2. 31
      lib/controller/mine/matchmaker_update_controller.dart
  3. 3
      lib/controller/setting/spread_controller.dart
  4. 321
      lib/pages/mine/matchmaker_update_page.dart
  5. 163
      lib/pages/mine/mine_page.dart
  6. 107
      lib/pages/mine/signature_page.dart

12
lib/controller/mine/edit_info_controller.dart

@ -607,11 +607,10 @@ class EditInfoController extends GetxController {
savaDescribeInfo() async { savaDescribeInfo() async {
try{ try{
final originImg = userData.value!.photoList!.map((e) => e.photoUrl).toSet();
final result = imgList
.where((e) => !originImg.contains(e))
.toList();
if(message.value.isEmpty){
SmartDialog.showToast("请输入交友心声");
return;
}
final imgPayload = { final imgPayload = {
'miId': userData.value?.id ?? 0, 'miId': userData.value?.id ?? 0,
'authenticationCode': '7', 'authenticationCode': '7',
@ -624,15 +623,12 @@ class EditInfoController extends GetxController {
realDescribe.value = message.value; realDescribe.value = message.value;
getInfo(); getInfo();
SmartDialog.showToast("交友心声已提交审核"); SmartDialog.showToast("交友心声已提交审核");
Get.back(); Get.back();
} else{ } else{
SmartDialog.showToast(imgAuditResp.data.message); SmartDialog.showToast(imgAuditResp.data.message);
return; return;
} }
} catch(e){ } catch(e){
print('相册提交审核失败: $e');
SmartDialog.showToast('交友心声提交审核失败,请重试'); SmartDialog.showToast('交友心声提交审核失败,请重试');
return; return;

31
lib/controller/mine/matchmaker_update_controller.dart

@ -1,31 +0,0 @@
import 'package:get/get.dart';
class MatchmakerUpdateController extends GetxController {
final sum = 0.obs;
final select = 0.obs;
final deal = [
{"title": "实习红娘", "price": "0", "revenue": [
"礼物收益范围15%-30%,嘉宾消费的分成3%;",
"每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;",
"红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;",
"新徒弟首月收益的10%(平台奖励)",
]},
{"title": "在线红娘", "price": "99", "revenue": [
"礼物收益范围30%-40%,嘉宾消费的分成6%;",
"每天前5人连麦的礼物收益30%,第6-10人连麦的礼物收益35%,第11人以上连麦的礼物收益40%;",
"红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;",
"新徒弟首月收益的10%(平台奖励)",
]},
{"title": "签约红娘", "price": "399", "revenue": [
"礼物收益固定40%,邀请嘉宾,嘉宾消费的分成10%",
"红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;",
"新徒弟首月收益的10%(平台奖励)",
]},
].obs;
changeActive(int i){
select.value = i;
}
}

3
lib/controller/setting/spread_controller.dart

@ -65,7 +65,8 @@ class SpreadController extends GetxController with WidgetsBindingObserver {
]; ];
} else if(roseList[activePay.value].subCategory == 88802){ } else if(roseList[activePay.value].subCategory == 88802){
revenue.value = [ revenue.value = [
{'icon': '1', 'desc': '礼物收益固定40%,邀请嘉宾,嘉宾消费的分成10%'},
{'icon': '1', 'desc': '礼物收益范围15%-30%,嘉宾消费的分成3%;'},
{'icon': '2', 'desc': '每天前5人连麦的礼物收益15%,第6-10人连麦的礼物收益20%,第11-15人连麦的礼物收益25%,第16人以上连麦的礼物收益30%;'},
{'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'}, {'icon': '3', 'desc': '红娘推荐的嘉宾成为红娘,赚取入驻费的20%分成;'},
{'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'}, {'icon': '4', 'desc': '新徒弟首月收益的10%(平台奖励)'},
]; ];

321
lib/pages/mine/matchmaker_update_page.dart

@ -1,321 +0,0 @@
import 'package:dating_touchme_app/components/page_appbar.dart';
import 'package:dating_touchme_app/controller/mine/matchmaker_update_controller.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class MatchmakerUpdatePage extends StatelessWidget {
const MatchmakerUpdatePage({super.key});
@override
Widget build(BuildContext context) {
return GetX<MatchmakerUpdateController>(
init: MatchmakerUpdateController(),
builder: (controller){
return Stack(
children: [
Positioned(
child: Container(
width: 375.w,
height: 812.h,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color.fromRGBO(172, 89, 255, 1), // 100%
Color.fromRGBO(117, 98, 249, 1), // 64.87%
Color.fromRGBO(117, 98, 249, 1), // 43.03%
Color.fromRGBO(255, 255, 255, 1), // 0%
],
stops: [
0.0,
0.2303,
0.4487,
0.6,
],
),
),
),
),
Scaffold(
backgroundColor: Colors.transparent,
appBar: PageAppbar(title: "升级红娘", backgroundColor: Colors.transparent, color: Colors.white,),
body: SingleChildScrollView(
child: Container(
padding: EdgeInsets.symmetric(
vertical: 20.w,
horizontal: 12.w
),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(
vertical: 20.w,
horizontal: 12.w
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(18.w)),
),
child: Column(
children: [
Row(
children: [
Text(
"趣恋恋,让婚恋服务更高效",
style: TextStyle(
fontSize: 16.w,
fontWeight: FontWeight.w500
),
)
],
),
SizedBox(height: 15.w,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
...controller.deal.asMap().entries.map((entry){
return SelectItem(
item: entry.value,
index: entry.key,
active: controller.select.value,
changeActive: controller.changeActive,
);
}),
],
),
SizedBox(height: 30.w,),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
"新红娘入驻权益",
style: TextStyle(
fontSize: 22.w,
color: const Color.fromRGBO(48, 48, 48, 1),
fontWeight: FontWeight.w500
),
),
SizedBox(width: 10.w,),
Image.asset(
Assets.imagesLimitTime,
width: 30.w,
height: 16.w,
)
],
),
SizedBox(height: 15.w,),
...(controller.deal[controller.select.value]["revenue"] as List).asMap().entries.map((entry){
return RevenueItem(
index: controller.select.value == 2 && entry.key >= 1 ? entry.key + 1 : entry.key,
title: entry.value,
);
})
],
),
),
Container(
width: 325.w,
height: 45.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(45.w)),
gradient: LinearGradient(
begin: Alignment.centerLeft, // 0%
end: Alignment.centerRight, // 100%
colors: [
Color.fromRGBO(131, 89, 255, 1), //
Color.fromRGBO(77, 127, 231, 1), //
Color.fromRGBO(61, 138, 224, 1), //
],
stops: [0.0, 0.7753, 1.0], // CSS 0%77.53%100%
),
),
child: Center(
child: Text(
"确认",
style: TextStyle(
fontSize: 18.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
)
],
),
),
),
)
],
);
},
);
}
}
class SelectItem extends StatefulWidget {
final Map item;
final int index;
final int active;
final Function(int) changeActive;
const SelectItem({super.key, required this.item, required this.index, required this.active, required this.changeActive});
@override
State<SelectItem> createState() => _SelectItemState();
}
class _SelectItemState extends State<SelectItem> {
@override
Widget build(BuildContext context) {
return Stack(
children: [
Container(
width: 103.w,
height: 109.w,
padding: EdgeInsets.only(
top: 32.w,
bottom: 9.w
),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(17.w)),
border: Border.all(width: 1, color: widget.active == widget.index ? const Color.fromRGBO(117, 98, 249, 1) : const Color.fromRGBO(222, 222, 222, 1)),
gradient: widget.active == widget.index ? LinearGradient(
begin: Alignment.centerLeft, // 90deg
end: Alignment.centerRight,
colors: [
Color.fromRGBO(232, 199, 255, 0.2), // 0%
Color.fromRGBO(194, 195, 255, 0.2), // 100%
],
stops: [
0.0,
1.0,
],
) : null,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"年费",
style: TextStyle(
fontSize: 11.w,
fontWeight: FontWeight.w700
),
),
RichText(
text: TextSpan(
style: TextStyle(
color: const Color.fromRGBO(248, 85, 66, 1),
fontWeight: FontWeight.w700
),
children: [
TextSpan(
text: "",
style: TextStyle(
fontSize: 11.w
)
),
TextSpan(
text: "${widget.item["price"]}",
style: TextStyle(
fontSize: 21.w
)
)
]
),
),
Text(
"+10小时视频相亲",
style: TextStyle(
color: Color.fromRGBO(144, 144, 144, widget.index == 0 ? 1 : 0),
fontSize: 9.w
),
)
],
),
),
Positioned(
top: 0,
left: 0,
child: Container(
width: 63.w,
height: 16.w,
decoration: BoxDecoration(
color: widget.active == widget.index ? const Color.fromRGBO(117, 98, 249, 1) : const Color.fromRGBO(191, 191, 191, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.w),
bottomRight: Radius.circular(16.w),
)
),
child: Center(
child: Text(
"${widget.item["title"]}",
style: TextStyle(
fontSize: 9.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
),
),
),
)
],
).onTap((){
widget.changeActive(widget.index);
});
}
}
class RevenueItem extends StatefulWidget {
final int index;
final String title;
const RevenueItem({super.key, required this.index, required this.title});
@override
State<RevenueItem> createState() => _RevenueItemState();
}
class _RevenueItemState extends State<RevenueItem> {
final matchmakerIcons = {
0: Assets.imagesMatchmakerIcon1,
1: Assets.imagesMatchmakerIcon2,
2: Assets.imagesMatchmakerIcon3,
3: Assets.imagesMatchmakerIcon4,
};
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(17.w),
margin: EdgeInsets.only(bottom: 4.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(18.w)),
color: const Color.fromRGBO(117, 98, 249, .1)
),
child: Row(
children: [
Image.asset(
matchmakerIcons[widget.index]!,
width: 26.w,
height: 26.w,
),
SizedBox(width: 14.w,),
Expanded(
child: Text(
widget.title,
style: TextStyle(
fontSize: 11.w,
fontWeight: FontWeight.w500
),
),
)
],
),
);
}
}

163
lib/pages/mine/mine_page.dart

@ -409,18 +409,11 @@ class _MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin{
); );
} }
@override @override
// TODO: implement wantKeepAlive // TODO: implement wantKeepAlive
bool get wantKeepAlive => true; bool get wantKeepAlive => true;
} }
class InfoItem extends StatefulWidget { class InfoItem extends StatefulWidget {
final Map item; final Map item;
final Function getUserCount; final Function getUserCount;
@ -491,160 +484,4 @@ class _InfoItemState extends State<InfoItem> {
}) })
); );
} }
}
class BlockItem extends StatefulWidget {
final Map item;
final bool showWaring;
final Function path;
const BlockItem({super.key, required this.item, this.showWaring = false, required this.path});
@override
State<BlockItem> createState() => _BlockItemState();
}
class _BlockItemState extends State<BlockItem> {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: (){
// context.pushNamed(widget.path);
if(widget.path() == 'MatchSpreadPage'){
} else if(widget.path() != null){
Get.to(widget.path)?.then((e){
setState(() {
});
});
} else {
SmartDialog.showToast('功能暂未开放');
}
// RouteGuardService.to.toWithAuth(widget.path, null);
},
child: Container(
height: 48.w,
padding: EdgeInsets.only(left: 16.w),
decoration: BoxDecoration(
color: Colors.white
),
child: Container(
padding: EdgeInsets.only(right: 16.w),
decoration: BoxDecoration(
border: widget.item["title"] != "红娘等级" ? Border(
bottom: BorderSide(width: 1, color: const Color.fromRGBO(238, 238, 238, 1))
) : null
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Image.asset(
widget.item["icon"],
height: 22.w,
width: 22.w,
),
SizedBox(width: 16.w,),
Text(
widget.item["title"],
style: TextStyle(
fontSize: 14.w,
color: Colors.black,
fontWeight: FontWeight.w500
),
)
],
),
Row(
children: [
if(widget.showWaring) Container(
width: 5.w,
height: 5.w,
margin: EdgeInsets.only(right: 4.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(5.w)),
color: const Color.fromRGBO(255, 87, 51, 1)
),
),
if(widget.item["title"] == "认证中心") Text(
widget.item["subTitle"],
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(166, 166, 166, 1)
),
),
SizedBox(width: 10.w,),
Image.asset(
Assets.imagesArrow,
width: 4.w,
)
],
)
],
),
),
),
);
}
}
class SettingItem extends StatefulWidget {
final Map item;
final Function path;
const SettingItem({super.key, required this.item, required this.path});
@override
State<SettingItem> createState() => _SettingItemState();
}
class _SettingItemState extends State<SettingItem> {
@override
Widget build(BuildContext context) {
return InkWell(
onTap: (){
if(widget.path() == null){
SmartDialog.showToast('功能暂未开放');
return;
}
// context.pushNamed(widget.path);
Get.to(widget.path);
// RouteGuardService.to.toWithAuth(widget.path, null);
},
child: Container(
height: 48.w,
padding: EdgeInsets.symmetric(horizontal: 16.w),
color: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Image.asset(
widget.item["icon"],
width: 24.w,
height: 24.w,
),
SizedBox(width: 14.w,),
Text(
widget.item["title"],
style: TextStyle(
fontSize: 14.w,
fontWeight: FontWeight.w500,
color: Colors.black
),
)
],
),
Image.asset(
Assets.imagesArrow,
width: 4.w,
height: 8.w,
)
],
),
),
);
}
} }

107
lib/pages/mine/signature_page.dart

@ -1,14 +1,12 @@
import 'package:dating_touchme_app/components/page_appbar.dart'; import 'package:dating_touchme_app/components/page_appbar.dart';
import 'package:dating_touchme_app/controller/mine/edit_info_controller.dart'; import 'package:dating_touchme_app/controller/mine/edit_info_controller.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart';
class SignaturePage extends StatelessWidget { class SignaturePage extends StatelessWidget {
const SignaturePage({super.key}); const SignaturePage({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GetX<EditInfoController>( return GetX<EditInfoController>(
@ -16,75 +14,42 @@ class SignaturePage extends StatelessWidget {
builder: (controller) { builder: (controller) {
return Scaffold( return Scaffold(
appBar: PageAppbar(title: "交友心声",), appBar: PageAppbar(title: "交友心声",),
body: Container(
padding: EdgeInsets.all(17.w),
child: TextField(
controller: controller.messageController.value,
maxLength: 50, //
minLines: 5, //
maxLines: 5, //
style: TextStyle(
fontSize: ScreenUtil().setWidth(13),
height: 1
),
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(
vertical: 0,
horizontal: 0
),
hintText: "请输入交友心声",
border: const OutlineInputBorder(
borderSide: BorderSide.none, // //
),
// focusedBorder enabledBorder
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(8.0)),
),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide.none,
borderRadius: BorderRadius.all(Radius.circular(8.0)),
),
),
onChanged: (value){
controller.message.value = value;
print(value);
},
),
),
bottomNavigationBar: Container(
margin: EdgeInsets.only(bottom: 30.w),
child: Container(
width: 350.w,
height: 45.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(45.w)),
gradient: LinearGradient(
begin: Alignment.centerLeft, // 90deg:
end: Alignment.centerRight,
colors: [
Color.fromRGBO(131, 89, 255, 1), //
Color.fromRGBO(77, 127, 231, 1), //
Color.fromRGBO(61, 138, 224, 1), //
],
stops: [0.0, 0.7753, 1.0], // 0%77.53%100%
),
),
child: Center(
child: Text(
"保存",
style: TextStyle(
fontSize: 18.w,
color: Colors.white,
fontWeight: FontWeight.w500
body: Column(
children: [
TDTextarea(
controller: controller.messageController.value,
hintText: '请输入交友心声',
maxLines: 5,
minLines: 5,
maxLength: 80,
indicator: true,
layout: TDTextareaLayout.vertical,
bordered: true,
onChanged: (value) {
controller.message.value = value;
},
), ),
),
),
).onTap(() async {
controller.savaDescribeInfo();
}),
),
const SizedBox(height: 48),
TDButton(
text: '保存',
width: MediaQuery.of(context).size.width - 50,
size: TDButtonSize.large,
type: TDButtonType.fill,
shape: TDButtonShape.round,
style: TDButtonStyle(
textColor: Colors.white,
backgroundColor: Color(0xFF7562F9),
),
activeStyle: TDButtonStyle(
textColor: Colors.white,
backgroundColor: Color(0xC37562F9),
),
onTap: (){
controller.savaDescribeInfo();
},
),
],
),
); );
}, },
); );

Loading…
Cancel
Save