Browse Source

no message

ios
ZHR007 3 months ago
parent
commit
1ccc4f4162
7 changed files with 112 additions and 32 deletions
  1. 22
      lib/controller/setting/spread_controller.dart
  2. 31
      lib/model/mine/chat_static_data.dart
  3. 2
      lib/network/api_urls.dart
  4. 4
      lib/network/user_api.dart
  5. 32
      lib/network/user_api.g.dart
  6. 40
      lib/pages/setting/match_spread_page.dart
  7. 13
      lib/pages/setting/setting_page.dart

22
lib/controller/setting/spread_controller.dart

@ -163,13 +163,21 @@ class SpreadController extends GetxController with WidgetsBindingObserver {
});
if (response.data.isSuccess && response.data.data != null) {
final data = response.data.data;
fluwx.open(target: MiniProgram(
username: 'gh_9ea8d46add6f',
path: "pages/index/index?amount=${roseList[activePay.value].unitSellingPrice}&paymentOrderId=${data!.paymentOrderId}&url=match-fee",
miniProgramType: WXMiniProgramType.preview
));
countdownSeconds.value = 3;
SmartDialog.showToast('开始支付');
if(data!.freeSettlement!){
SmartDialog.showToast('加入成功');
GlobalData().userData!.matchmakerFlag = true;
GlobalData().userData!.matchmakerType = roseList[activePay.value].subCategory;
Get.back(result: 1);
} else {
fluwx.open(target: MiniProgram(
username: 'gh_9ea8d46add6f',
path: "pages/index/index?amount=${roseList[activePay.value].unitSellingPrice}&paymentOrderId=${data!.paymentOrderId}&url=match-fee",
miniProgramType: WXMiniProgramType.preview
));
countdownSeconds.value = 3;
SmartDialog.showToast('开始支付');
}
} else {
//
SmartDialog.showToast(response.data.message ?? '网络异常');

31
lib/model/mine/chat_static_data.dart

@ -0,0 +1,31 @@
//
class ChatStaticData {
final String id;
final int liveDurationMins;
final int todayCrossMicCount;
ChatStaticData({required this.id, required this.liveDurationMins, required this.todayCrossMicCount});
// JSON映射创建实例
factory ChatStaticData.fromJson(Map<String, dynamic> json) {
return ChatStaticData(
id: json['id'] ?? '',
liveDurationMins: json['liveDurationMins'] ?? 0,
todayCrossMicCount: json['todayCrossMicCount'] ?? 0,
);
}
// JSON映射
Map<String, dynamic> toJson() {
return {
'id': id,
'liveDurationMins': liveDurationMins,
'todayCrossMicCount': todayCrossMicCount,
};
}
@override
String toString() {
return 'LoginData(id: $id, liveDurationMins: $liveDurationMins)';
}
}

2
lib/network/api_urls.dart

@ -100,4 +100,6 @@ class ApiUrls {
static const String auditMatchmakerResult =
'dating-agency-uec/user/need-audit/matchmaker-audit';
static const String getChatVideoStatics =
'dating-agency-chat-audio/user/get/own-user-management';
}

4
lib/network/user_api.dart

@ -21,6 +21,7 @@ import 'package:retrofit/retrofit.dart';
import 'package:dio/dio.dart';
import '../model/mine/authentication_data.dart';
import '../model/mine/chat_static_data.dart';
import '../model/mine/submit_order_data.dart';
part 'user_api.g.dart';
@ -200,4 +201,7 @@ abstract class UserApi {
}
);
@GET(ApiUrls.getHxUserToken)
Future<HttpResponse<BaseResponse<ChatStaticData>>> getChatStaticsInfo();
}

32
lib/network/user_api.g.dart

@ -1234,6 +1234,38 @@ class _UserApi implements UserApi {
return httpResponse;
}
@override
Future<HttpResponse<BaseResponse<ChatStaticData>>>
getChatStaticsInfo() async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
const Map<String, dynamic>? _data = null;
final _options = _setStreamType<HttpResponse<BaseResponse<ChatStaticData>>>(
Options(method: 'GET', headers: _headers, extra: _extra)
.compose(
_dio.options,
'dating-agency-chat-audio/user/get/hx/user/token',
queryParameters: queryParameters,
data: _data,
)
.copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)),
);
final _result = await _dio.fetch<Map<String, dynamic>>(_options);
late BaseResponse<ChatStaticData> _value;
try {
_value = BaseResponse<ChatStaticData>.fromJson(
_result.data!,
(json) => ChatStaticData.fromJson(json as Map<String, dynamic>),
);
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
}
final httpResponse = HttpResponse(_value, _result);
return httpResponse;
}
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
if (T != dynamic &&
!(requestOptions.responseType == ResponseType.bytes ||

40
lib/pages/setting/match_spread_page.dart

@ -153,9 +153,10 @@ class _PayItemState extends State<PayItem> {
border: widget.active == widget.index ? Border.all(width: 1, color: const Color(0xFF7562F9)) : Border.all(width: 1, color: const Color(0xFFEEEEEE))
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const SizedBox(height: 32),
SizedBox(height: 40.h),
Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end,
@ -183,22 +184,27 @@ class _PayItemState extends State<PayItem> {
],
),
TDText("${widget.item.unitOriginalPrice}", isTextThrough: true, style: TextStyle(color: Color(0xFFCCCCCC)),),
const SizedBox(height: 18),
Spacer(),
SizedBox(
height: 24,
child: widget.item.validityPeriodDays != null ? Text(
"有效期:${widget.item.validityPeriodDays}",
style: TextStyle(
fontSize: 14.w,
color: Color(0xFF333333),
fontWeight: FontWeight.bold
),
) : Text('+${widget.item.liveDurationHours ?? '10'}小时视频相亲',
style: TextStyle(
fontSize: 12.w,
color: Color(0xFF999999),
fontWeight: FontWeight.bold
),
height: 36.h,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
widget.item.validityPeriodDays != null ? Text(
"有效期:${widget.item.validityPeriodDays}",
style: TextStyle(
fontSize: 14.w,
color: Color(0xFF333333),
fontWeight: FontWeight.bold
),
) : Text('+${widget.item.liveDurationHours ?? '10'}小时视频相亲',
style: TextStyle(
fontSize: 12.w,
color: Color(0xFF999999),
fontWeight: FontWeight.bold
),
)
],
),
),
],

13
lib/pages/setting/setting_page.dart

@ -29,7 +29,6 @@ class SettingPage extends StatelessWidget {
cells: [
TDCell(
arrow: false,
height: 60.h,
title: '允许中间邀请弹窗',
rightIconWidget: TDSwitch(isOn: false,trackOnColor: const Color.fromRGBO(117, 98, 249, 1),onChanged: (bool e) {
return false;
@ -37,7 +36,6 @@ class SettingPage extends StatelessWidget {
),
TDCell(
arrow: false,
height: 60.h,
title: '后台播放',
rightIconWidget: TDSwitch(
isOn: true,
@ -49,7 +47,6 @@ class SettingPage extends StatelessWidget {
),
TDCell(
arrow: false,
height: 60.h,
title: '语音/视频通话提示音',
rightIconWidget: TDSwitch(isOn: false,trackOnColor: const Color.fromRGBO(117, 98, 249, 1),onChanged: (bool e) {
@ -62,10 +59,10 @@ class SettingPage extends StatelessWidget {
TDCellGroup(
theme: TDCellGroupTheme.cardTheme,
cells: [
TDCell(arrow: true, height: 60.h, title: '安全中心', onClick: (cell) {
TDCell(arrow: true, title: '安全中心', onClick: (cell) {
print('安全中心');
}),
TDCell(arrow: true, height: 60.h, title: '黑名单', onClick: (cell) {
TDCell(arrow: true, title: '黑名单', onClick: (cell) {
Get.to(() => BlacklistPage());
}),
],
@ -74,11 +71,11 @@ class SettingPage extends StatelessWidget {
TDCellGroup(
theme: TDCellGroupTheme.cardTheme,
cells: [
TDCell(arrow: true, height: 60.h, title: '系统权限管理'),
TDCell(arrow: true, height: 60.h, title: '消息通知', onClick: (cell) {
TDCell(arrow: true, title: '系统权限管理'),
TDCell(arrow: true, title: '消息通知', onClick: (cell) {
Get.to(() => NoticePage());
}),
TDCell(arrow: true, height: 60.h, title: '检查更新', onClick: (cell) {
TDCell(arrow: true, title: '检查更新', onClick: (cell) {
// _showUpdateDialog();
controller.checkVersion();
},

Loading…
Cancel
Save