邀请活动
This commit is contained in:
parent
a3f8db991d
commit
ddd50a65dc
@ -32,7 +32,8 @@
|
||||
"pleaseEnterContent": "يرجى إدخال المحتوى",
|
||||
"profilePhoto": "صورة الملف الشخصي",
|
||||
"noHistoricalRecordsAvailable": "لا توجد سجلات تاريخية متاحة.",
|
||||
"inviteNewUsersToEarnCoins": "ادعُ مستخدمين جدد لكسب العملات",
|
||||
"inviteNewUsersToEarnCoins": "ادعُ مستخدمين جدد لكسب العملات",
|
||||
"inviteActivity": "نشاط الدعوة",
|
||||
"crateMyRoom": "أنشئ غرفتك الخاصة.",
|
||||
"casualInteraction": "التفاعل العفوي",
|
||||
"haveGamePlayingTips": "لديك لعبة جارية، يرجى الخروج من اللعبة الحالية أولاً، هل أنت متأكد من الخروج؟",
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
"aboutMe": "আমার সম্পর্কে",
|
||||
"noHistoricalRecordsAvailable": "কোনও ঐতিহাসিক রেকর্ড পাওয়া যায়নি।",
|
||||
"inviteNewUsersToEarnCoins": "নতুন ব্যবহারকারীকে আমন্ত্রণ করুন কয়েন উপার্জনের জন্য",
|
||||
"inviteActivity": "আমন্ত্রণ কার্যক্রম",
|
||||
"crateMyRoom": "নিজের রুম তৈরি করুন।",
|
||||
"myRoom": "আমার রুম",
|
||||
"recent": "সাম্প্রতিক",
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
"myRoom": "My room",
|
||||
"noHistoricalRecordsAvailable": "No historical records available.",
|
||||
"inviteNewUsersToEarnCoins": "Invite new users to earn coins",
|
||||
"inviteActivity": "Invite Activity",
|
||||
"crateMyRoom": "CREATE YOUR OWN ROOM.",
|
||||
"casualInteraction": "Casual Interaction",
|
||||
"haveGamePlayingTips": "You have a game in progress. Please exit the current game. Are you sure you want to exit?",
|
||||
|
||||
@ -30,7 +30,8 @@
|
||||
"background": "Arka Plan",
|
||||
"roomPassword": "Oda Şifresi",
|
||||
"noHistoricalRecordsAvailable": "Geçmiş kayıt bulunamadı.",
|
||||
"inviteNewUsersToEarnCoins": "Yeni kullanıcıları davet ederek coin kazanın",
|
||||
"inviteNewUsersToEarnCoins": "Yeni kullanıcıları davet ederek coin kazanın",
|
||||
"inviteActivity": "Davet Etkinliği",
|
||||
"crateMyRoom": "KENDİ ODANIZI OLUŞTURUN.",
|
||||
"event": "Etkinlik",
|
||||
"clearCacheSuccessfully": "Önbellek başarıyla temizlendi",
|
||||
|
||||
@ -73,6 +73,11 @@ class SCAppLocalizations {
|
||||
String get inviteNewUsersToEarnCoins =>
|
||||
translate('inviteNewUsersToEarnCoins');
|
||||
|
||||
String get inviteActivity {
|
||||
final value = translate('inviteActivity');
|
||||
return value == 'inviteActivity' ? 'Invite Activity' : value;
|
||||
}
|
||||
|
||||
String get avoidBeingKicked => translate('avoidBeingKicked');
|
||||
|
||||
String get vipEntranceEffect => translate('vipEntranceEffect');
|
||||
@ -239,20 +244,20 @@ class SCAppLocalizations {
|
||||
|
||||
String get operationFail => translate('operationFail');
|
||||
|
||||
String get enterRoomFailedRetry {
|
||||
final value = translate('enterRoomFailedRetry');
|
||||
return value == 'enterRoomFailedRetry'
|
||||
? 'Failed to enter the room. Please try again.'
|
||||
: value;
|
||||
}
|
||||
|
||||
String get voiceConnectionFailedRetry {
|
||||
final value = translate('voiceConnectionFailedRetry');
|
||||
return value == 'voiceConnectionFailedRetry'
|
||||
? 'Voice connection failed. Please try again.'
|
||||
: value;
|
||||
}
|
||||
|
||||
String get enterRoomFailedRetry {
|
||||
final value = translate('enterRoomFailedRetry');
|
||||
return value == 'enterRoomFailedRetry'
|
||||
? 'Failed to enter the room. Please try again.'
|
||||
: value;
|
||||
}
|
||||
|
||||
String get voiceConnectionFailedRetry {
|
||||
final value = translate('voiceConnectionFailedRetry');
|
||||
return value == 'voiceConnectionFailedRetry'
|
||||
? 'Voice connection failed. Please try again.'
|
||||
: value;
|
||||
}
|
||||
|
||||
String get forMoreRewardsPleaseCheckTheTaskCenter =>
|
||||
translate('forMoreRewardsPleaseCheckTheTaskCenter');
|
||||
|
||||
|
||||
@ -7,7 +7,6 @@ import 'package:yumi/app_localizations.dart';
|
||||
import 'package:yumi/modules/index/main_route.dart';
|
||||
import 'package:yumi/modules/store/store_route.dart';
|
||||
import 'package:yumi/modules/user/settings/settings_route.dart';
|
||||
import 'package:yumi/modules/user/vip/vip_route.dart';
|
||||
import 'package:yumi/modules/wallet/wallet_route.dart';
|
||||
import 'package:yumi/services/auth/user_profile_manager.dart';
|
||||
import 'package:yumi/shared/business_logic/models/res/sc_user_counter_res.dart';
|
||||
@ -25,6 +24,9 @@ class MePage2 extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MePage2State extends State<MePage2> {
|
||||
static const String _inviteActivityUrl =
|
||||
'https://h5.haiyihy.com/app-invite/index.html';
|
||||
|
||||
Map<String, SCUserCounterRes> _counterMap = {};
|
||||
|
||||
@override
|
||||
@ -62,6 +64,28 @@ class _MePage2State extends State<MePage2> {
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
void _openInviteActivity() {
|
||||
final inviteActivityUrl = _appendToken(_inviteActivityUrl);
|
||||
if (inviteActivityUrl.isEmpty) return;
|
||||
|
||||
SCNavigatorUtils.push(
|
||||
context,
|
||||
"${SCMainRoute.webViewPage}?url=${Uri.encodeComponent(inviteActivityUrl)}&showTitle=false",
|
||||
);
|
||||
}
|
||||
|
||||
String _appendToken(String url) {
|
||||
final token = AccountStorage().getToken();
|
||||
if (token.isEmpty) return url;
|
||||
|
||||
final uri = Uri.tryParse(url);
|
||||
if (uri == null) return url;
|
||||
|
||||
final queryParameters = Map<String, String>.from(uri.queryParameters);
|
||||
queryParameters['token'] = token;
|
||||
return uri.replace(queryParameters: queryParameters).toString();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
@ -80,7 +104,7 @@ class _MePage2State extends State<MePage2> {
|
||||
SizedBox(height: 12.w),
|
||||
_buildEntryRow(),
|
||||
SizedBox(height: 12.w),
|
||||
_buildWalletVipRow(),
|
||||
_buildWalletCard(),
|
||||
SizedBox(height: 12.w),
|
||||
_buildMenuCard2(),
|
||||
SizedBox(height: 12.w),
|
||||
@ -228,21 +252,12 @@ class _MePage2State extends State<MePage2> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildWalletVipRow() {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(child: _buildVipEntryCard()),
|
||||
SizedBox(width: 10.w),
|
||||
Expanded(child: _buildWalletCard()),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildWalletCard() {
|
||||
return SCDebounceWidget(
|
||||
onTap: () => SCNavigatorUtils.push(context, WalletRoute.recharge),
|
||||
child: Container(
|
||||
height: 68.w,
|
||||
width: double.infinity,
|
||||
height: 90.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
image: const DecorationImage(
|
||||
@ -250,53 +265,44 @@ class _MePage2State extends State<MePage2> {
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 5.w),
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.w),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
SCAppLocalizations.of(context)!.wallet,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
fontSize: 24.sp,
|
||||
fontWeight: FontWeight.w800,
|
||||
fontStyle: FontStyle.italic,
|
||||
color: Colors.white,
|
||||
height: 1,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 2.w),
|
||||
SizedBox(height: 4.w),
|
||||
Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'sc_images/general/sc_icon_wallet_coin.png',
|
||||
width: 18.w,
|
||||
height: 18.w,
|
||||
'sc_images/general/sc_icon_jb.png',
|
||||
width: 28.w,
|
||||
height: 28.w,
|
||||
),
|
||||
SizedBox(width: 4.w),
|
||||
Expanded(
|
||||
child: Consumer<SocialChatUserProfileManager>(
|
||||
builder: (context, ref, child) {
|
||||
return Text(
|
||||
':${_balanceText(ref.myBalance)}',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontStyle: FontStyle.italic,
|
||||
height: 1,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(width: 6.w),
|
||||
Consumer<SocialChatUserProfileManager>(
|
||||
builder: (context, ref, child) {
|
||||
return Text(
|
||||
':${_balanceText(ref.myBalance)}',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 24.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -305,8 +311,8 @@ class _MePage2State extends State<MePage2> {
|
||||
),
|
||||
Image.asset(
|
||||
'sc_images/index/sc_icon_wallet_icon.png',
|
||||
width: 40.w,
|
||||
height: 40.w,
|
||||
width: 68.w,
|
||||
height: 68.w,
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -314,103 +320,6 @@ class _MePage2State extends State<MePage2> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildVipEntryCard() {
|
||||
return SCDebounceWidget(
|
||||
onTap: () => SCNavigatorUtils.push(context, VipRoute.detail),
|
||||
child: Container(
|
||||
height: 68.w,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.w),
|
||||
border: Border.all(color: const Color(0xFFFFD37A), width: 1.w),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage('sc_images/vip/sc_vip_entry_bg.png'),
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.18),
|
||||
blurRadius: 10.w,
|
||||
offset: Offset(0, 4.w),
|
||||
),
|
||||
],
|
||||
),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Stack(
|
||||
children: [
|
||||
PositionedDirectional(
|
||||
top: 12.w,
|
||||
start: 14.w,
|
||||
child: Text(
|
||||
'VIP',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontFamily: 'Source Han Sans SC',
|
||||
fontSize: 16.sp,
|
||||
fontWeight: FontWeight.w700,
|
||||
height: 1,
|
||||
),
|
||||
),
|
||||
),
|
||||
PositionedDirectional(
|
||||
start: 13.w,
|
||||
bottom: 10.w,
|
||||
child: _buildVipLevelMark(5),
|
||||
),
|
||||
PositionedDirectional(
|
||||
end: 2.w,
|
||||
top: 8.w,
|
||||
child: Image.asset(
|
||||
'sc_images/vip/sc_vip_badge_5.png',
|
||||
width: 52.w,
|
||||
height: 52.w,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildVipLevelMark(int level) {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
'sc_images/vip/sc_vip_letter_v.png',
|
||||
width: 18.1.w,
|
||||
height: 15.3.w,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
Image.asset(
|
||||
'sc_images/vip/sc_vip_letter_i.png',
|
||||
width: 8.3.w,
|
||||
height: 15.3.w,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
Image.asset(
|
||||
'sc_images/vip/sc_vip_letter_p.png',
|
||||
width: 18.1.w,
|
||||
height: 15.3.w,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
SizedBox(width: 3.w),
|
||||
_buildVipLevelNumber(level),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildVipLevelNumber(int level) {
|
||||
return Image.asset(
|
||||
'sc_images/vip/sc_vip_number_${level}_filled.png',
|
||||
height: 15.247.w,
|
||||
fit: BoxFit.fill,
|
||||
color: const Color(0xFFFFD155),
|
||||
colorBlendMode: BlendMode.srcIn,
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMenuCard2() {
|
||||
final userProfile = context.watch<SocialChatUserProfileManager>();
|
||||
final items = <_MenuRowData>[];
|
||||
@ -446,6 +355,14 @@ class _MePage2State extends State<MePage2> {
|
||||
),
|
||||
);
|
||||
}
|
||||
items.add(
|
||||
_MenuRowData(
|
||||
title: SCAppLocalizations.of(context)!.inviteActivity,
|
||||
assetIcon: 'sc_images/index/sc_icon_invite_activity.png',
|
||||
iconSize: 20,
|
||||
onTap: _openInviteActivity,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// 2. BD 相关(非管理员时)
|
||||
@ -534,11 +451,17 @@ class _MePage2State extends State<MePage2> {
|
||||
height: 46.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
item.assetIcon!,
|
||||
SizedBox(
|
||||
width: 24.w,
|
||||
height: 24.w,
|
||||
color: Colors.white,
|
||||
child: Center(
|
||||
child: Image.asset(
|
||||
item.assetIcon!,
|
||||
width: item.iconSize.w,
|
||||
height: item.iconSize.w,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(width: 12.w),
|
||||
@ -688,9 +611,11 @@ class _MenuRowData {
|
||||
required this.title,
|
||||
required this.onTap,
|
||||
this.assetIcon,
|
||||
this.iconSize = 24,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final String? assetIcon;
|
||||
final double iconSize;
|
||||
final VoidCallback onTap;
|
||||
}
|
||||
|
||||
@ -37,6 +37,7 @@ class _RoomMenuDialogState extends State<RoomMenuDialog> {
|
||||
static const int _menuSound = 4;
|
||||
static const int _menuReport = 5;
|
||||
static const int _menuBackground = 6;
|
||||
static bool get _showBackgroundFeature => false;
|
||||
|
||||
List<RoomMenu> items1 = [];
|
||||
List<RoomMenu> items2 = [];
|
||||
@ -119,7 +120,8 @@ class _RoomMenuDialogState extends State<RoomMenuDialog> {
|
||||
: "sc_icon_mic_open.png",
|
||||
),
|
||||
);
|
||||
if (Provider.of<RtcProvider>(context, listen: false).isFz()) {
|
||||
if (_showBackgroundFeature &&
|
||||
Provider.of<RtcProvider>(context, listen: false).isFz()) {
|
||||
items2.add(
|
||||
RoomMenu(
|
||||
_menuBackground,
|
||||
|
||||
BIN
sc_images/index/sc_icon_invite_activity.png
Normal file
BIN
sc_images/index/sc_icon_invite_activity.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 398 B |
Loading…
x
Reference in New Issue
Block a user