add
This commit is contained in:
@@ -14,11 +14,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("IMTest")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("IMTest")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
<<<<<<< HEAD
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f7772a9c5a6c1a00fd55a667dd7644fe3debe9d7")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+eb8455e141ea496a2134ad7c7d9b759b6029dd75")]
|
|
||||||
=======
|
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f7223dc5904286fdf8e117b56c37f58dc431d68b")]
|
|
||||||
>>>>>>> eb8455e141ea496a2134ad7c7d9b759b6029dd75
|
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("IMTest")]
|
[assembly: System.Reflection.AssemblyProductAttribute("IMTest")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("IMTest")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("IMTest")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@@ -1,5 +1 @@
|
|||||||
<<<<<<< HEAD
|
c6e01bb72d85599aa024524b725bc3ddb7e3c1cc42c37b8b46561df20748cbf5
|
||||||
546570633bb9288fc2957cbb29a807a45f3e48ba127ec13bc3956d28f5e6ed5b
|
|
||||||
=======
|
|
||||||
3c0a5335719f892c65744a9df7eae9fd7b12de9067131f5c9f4cb65f2b27b8d4
|
|
||||||
>>>>>>> eb8455e141ea496a2134ad7c7d9b759b6029dd75
|
|
||||||
|
|||||||
Binary file not shown.
+15
@@ -0,0 +1,15 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Rider ignored files
|
||||||
|
/modules.xml
|
||||||
|
/projectSettingsUpdater.xml
|
||||||
|
/.idea.IM_API.iml
|
||||||
|
/contentModel.xml
|
||||||
|
# Ignored default folder with query files
|
||||||
|
/queries/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="UserContentModel">
|
||||||
|
<attachedFolders />
|
||||||
|
<explicitIncludes />
|
||||||
|
<explicitExcludes />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
+1
-1
@@ -15,7 +15,7 @@ namespace IM_API.Application.EventHandlers.GroupInviteActionUpdateHandler
|
|||||||
public async Task Consume(ConsumeContext<GroupInviteActionUpdateEvent> context)
|
public async Task Consume(ConsumeContext<GroupInviteActionUpdateEvent> context)
|
||||||
{
|
{
|
||||||
var @event = context.Message;
|
var @event = context.Message;
|
||||||
if(@event.Action == Models.GroupRequestState.Passed)
|
if(@event.Action == Models.GroupRequestState.TargetPassed)
|
||||||
{
|
{
|
||||||
await _groupService.MakeGroupRequestAsync(@event.UserId, @event.InviteUserId,@event.GroupId);
|
await _groupService.MakeGroupRequestAsync(@event.UserId, @event.InviteUserId,@event.GroupId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||||
|
<s:Boolean x:Key="/Default/Environment/Hierarchy/Build/BuildTool/RecentDotNetCliExePaths/=_002Fhome_002Fnanxun_002Fdotnet_002Fdotnet/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:String x:Key="/Default/Environment/Hierarchy/Build/BuildTool/DotNetCliExePath/@EntryValue">/home/nanxun/dotnet/dotnet</s:String>
|
||||||
|
<s:String x:Key="/Default/Environment/Hierarchy/Build/BuildTool/CustomBuildToolPath/@EntryValue">/home/nanxun/dotnet/sdk/10.0.201/MSBuild.dll</s:String></wpf:ResourceDictionary>
|
||||||
@@ -21,6 +21,10 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 对方拒绝
|
/// 对方拒绝
|
||||||
/// </summary>
|
/// </summary>
|
||||||
TargetDeclined = 4
|
TargetDeclined = 4,
|
||||||
|
/// <summary>
|
||||||
|
/// 对方同意
|
||||||
|
/// </summary>
|
||||||
|
TargetPassed = 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ namespace IM_API.Services
|
|||||||
var inviteInfo = await _context.GroupRequests
|
var inviteInfo = await _context.GroupRequests
|
||||||
.FirstOrDefaultAsync(x => x.UserId == userid && x.StateEnum == GroupRequestState.TargetPending)
|
.FirstOrDefaultAsync(x => x.UserId == userid && x.StateEnum == GroupRequestState.TargetPending)
|
||||||
?? throw new BaseException(CodeDefine.INVALID_ACTION);
|
?? throw new BaseException(CodeDefine.INVALID_ACTION);
|
||||||
if (!(dto.Action == GroupRequestState.TargetPending ||
|
if (!(dto.Action == GroupRequestState.TargetPassed ||
|
||||||
dto.Action == GroupRequestState.TargetDeclined))
|
dto.Action == GroupRequestState.TargetDeclined))
|
||||||
return;
|
return;
|
||||||
inviteInfo.StateEnum = dto.Action;
|
inviteInfo.StateEnum = dto.Action;
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ pluginManagement {
|
|||||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
// 👇 添加这一行,用于下载 Flutter 插件相关的依赖
|
||||||
|
maven { url = uri("https://storage.flutter-io.cn/download.flutter.io") }
|
||||||
|
|
||||||
maven { url = uri("https://maven.aliyun.com/repository/google") }
|
maven { url = uri("https://maven.aliyun.com/repository/google") }
|
||||||
maven { url = uri("https://maven.aliyun.com/repository/public") }
|
maven { url = uri("https://maven.aliyun.com/repository/public") }
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
@@ -21,6 +24,9 @@ pluginManagement {
|
|||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
||||||
repositories {
|
repositories {
|
||||||
|
// 👇 添加这一行,这是解决你报错的核心!强制项目从这里下载 Flutter 引擎
|
||||||
|
maven { url = uri("https://storage.flutter-io.cn/download.flutter.io") }
|
||||||
|
|
||||||
maven { url = uri("https://maven.aliyun.com/repository/google") }
|
maven { url = uri("https://maven.aliyun.com/repository/google") }
|
||||||
maven { url = uri("https://maven.aliyun.com/repository/public") }
|
maven { url = uri("https://maven.aliyun.com/repository/public") }
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
@@ -31,8 +37,10 @@ dependencyResolutionManagement {
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||||
id("com.android.application") version "8.1.1" apply false
|
// 👇 升级到 8.2.1 修复 Java 21 兼容性 bug
|
||||||
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
|
id("com.android.application") version "8.2.1" apply false
|
||||||
|
// 👇 顺便把 Kotlin 版本也稍微升一下,避免后续出现旧版本警告
|
||||||
|
id("org.jetbrains.kotlin.android") version "1.9.22" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
include(":app")
|
include(":app")
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
|
class AuthInterceptor extends Interceptor{
|
||||||
|
@override
|
||||||
|
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
|
||||||
|
// TODO: implement onRequest
|
||||||
|
super.onRequest(options, handler);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import 'package:app/core/network/auth_interceptor.dart';
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
|
||||||
|
class Request {
|
||||||
|
static final Request _instance = Request._internal();
|
||||||
|
factory Request() => _instance;
|
||||||
|
|
||||||
|
late Dio dio;
|
||||||
|
|
||||||
|
Request._internal(){
|
||||||
|
BaseOptions options = BaseOptions(
|
||||||
|
baseUrl: "",
|
||||||
|
responseType: ResponseType.json,
|
||||||
|
contentType: 'application/json; charset=utf-8',
|
||||||
|
);
|
||||||
|
dio = Dio(options);
|
||||||
|
dio.interceptors.addAll([
|
||||||
|
AuthInterceptor()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import 'package:app/features/auth/pages/login_page.dart';
|
import 'package:app/features/auth/pages/login_page.dart';
|
||||||
|
import 'package:app/features/auth/pages/register_page.dart';
|
||||||
import 'package:app/features/home/pages/index_page.dart';
|
import 'package:app/features/home/pages/index_page.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
@@ -10,6 +11,7 @@ final appRouter = GoRouter(
|
|||||||
initialLocation: '/auth/login',
|
initialLocation: '/auth/login',
|
||||||
routes: [
|
routes: [
|
||||||
GoRoute(path: '/auth/login', builder: (context, state) => const LoginPage()),
|
GoRoute(path: '/auth/login', builder: (context, state) => const LoginPage()),
|
||||||
|
GoRoute(path: '/auth/register', builder: (context, state) => const RegisterPage()),
|
||||||
ShellRoute(
|
ShellRoute(
|
||||||
builder: (context, state, child) {
|
builder: (context, state, child) {
|
||||||
return MainPage(child: child);
|
return MainPage(child: child);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:app/core/constants/app_colors.dart';
|
import 'package:app/core/constants/app_colors.dart';
|
||||||
import 'package:app/features/auth/pages/login_page.dart';
|
import 'package:app/features/auth/pages/login_page.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:app/core/router/app_router.dart';
|
||||||
|
|
||||||
class LoginPageState extends State<LoginPage> {
|
class LoginPageState extends State<LoginPage> {
|
||||||
@override
|
@override
|
||||||
@@ -11,10 +12,10 @@ class LoginPageState extends State<LoginPage> {
|
|||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
actions: [
|
actions: [
|
||||||
TextButton(
|
// TextButton(
|
||||||
onPressed: () {},
|
// onPressed: () {},
|
||||||
child: const Text("找回密码", style: TextStyle(color: Colors.grey)),
|
// child: const Text("找回密码", style: TextStyle(color: Colors.grey)),
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
@@ -24,23 +25,9 @@ class LoginPageState extends State<LoginPage> {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
// 1. 品牌Logo/头像区域
|
|
||||||
Container(
|
|
||||||
width: 100,
|
|
||||||
height: 100,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColors.primaryColor.withOpacity(0.1),
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
),
|
|
||||||
child: const Icon(
|
|
||||||
Icons.person_rounded,
|
|
||||||
size: 60,
|
|
||||||
color: AppColors.primaryColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 24),
|
const SizedBox(height: 24),
|
||||||
const Text(
|
const Text(
|
||||||
"登录您的聊天账号",
|
"登陆账号",
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24,
|
fontSize: 24,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@@ -109,7 +96,9 @@ class LoginPageState extends State<LoginPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {},
|
onPressed: () {
|
||||||
|
appRouter.push("/auth/register");
|
||||||
|
},
|
||||||
child: const Text(
|
child: const Text(
|
||||||
"注册账号",
|
"注册账号",
|
||||||
style: TextStyle(color: Color(0xFF576B95)),
|
style: TextStyle(color: Color(0xFF576B95)),
|
||||||
@@ -126,6 +115,13 @@ class LoginPageState extends State<LoginPage> {
|
|||||||
style: TextStyle(color: Color(0xFF576B95)),
|
style: TextStyle(color: Color(0xFF576B95)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {},
|
||||||
|
child: const Text(
|
||||||
|
"找回密码",
|
||||||
|
style: TextStyle(color: Color(0xFF576B95)),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,156 @@
|
|||||||
|
import 'package:app/features/auth/pages/register_page.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../core/constants/app_colors.dart';
|
||||||
|
|
||||||
|
class RegisterPageState extends State<RegisterPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// TODO: implement build
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
appBar: AppBar(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
elevation: 0,
|
||||||
|
actions: [
|
||||||
|
// TextButton(
|
||||||
|
// onPressed: () {},
|
||||||
|
// child: const Text("找回密码", style: TextStyle(color: Colors.grey)),
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 40),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
const SizedBox(height: 24),
|
||||||
|
const Text(
|
||||||
|
"注册账号",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.black87,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 60),
|
||||||
|
|
||||||
|
// 2. 账号输入框 (极简下划线风格)
|
||||||
|
TextField(
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: "用户名",
|
||||||
|
labelStyle: const TextStyle(color: Colors.grey, fontSize: 14),
|
||||||
|
floatingLabelStyle: const TextStyle(color: AppColors.primaryColor),
|
||||||
|
enabledBorder: UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.grey.shade300),
|
||||||
|
),
|
||||||
|
focusedBorder: const UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: AppColors.primaryColor, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 25),
|
||||||
|
|
||||||
|
// 3. 密码输入框
|
||||||
|
TextField(
|
||||||
|
obscureText: true,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: "请输入密码",
|
||||||
|
labelStyle: const TextStyle(color: Colors.grey, fontSize: 14),
|
||||||
|
floatingLabelStyle: const TextStyle(color: AppColors.primaryColor),
|
||||||
|
enabledBorder: UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: Colors.grey.shade300),
|
||||||
|
),
|
||||||
|
focusedBorder: const UnderlineInputBorder(
|
||||||
|
borderSide: BorderSide(color: AppColors.primaryColor, width: 2),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 60),
|
||||||
|
|
||||||
|
// 4. 登录按钮 (圆润大按钮)
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 50,
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () {},
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: AppColors.primaryColor,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
elevation: 0,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: const Text(
|
||||||
|
"注 册",
|
||||||
|
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
|
||||||
|
// 5. 注册/切换登录方式
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {},
|
||||||
|
child: const Text(
|
||||||
|
"已有账号?点我登录",
|
||||||
|
style: TextStyle(color: Color(0xFF576B95)),
|
||||||
|
), // 经典的链接蓝
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
child: VerticalDivider(color: Colors.grey),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {},
|
||||||
|
child: const Text(
|
||||||
|
"找回密码",
|
||||||
|
style: TextStyle(color: Color(0xFF576B95)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
const SizedBox(height: 80),
|
||||||
|
// 6. 底部协议 (社交App必有)
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Checkbox(
|
||||||
|
value: true,
|
||||||
|
activeColor: AppColors.primaryColor,
|
||||||
|
onChanged: (v) {},
|
||||||
|
),
|
||||||
|
const Text(
|
||||||
|
"我已阅读并同意",
|
||||||
|
style: TextStyle(color: Colors.grey, fontSize: 12),
|
||||||
|
),
|
||||||
|
const Text(
|
||||||
|
"《用户协议》",
|
||||||
|
style: TextStyle(color: Color(0xFF576B95), fontSize: 12),
|
||||||
|
),
|
||||||
|
const Text(
|
||||||
|
"与",
|
||||||
|
style: TextStyle(color: Colors.grey, fontSize: 12),
|
||||||
|
),
|
||||||
|
const Text(
|
||||||
|
"《隐私政策》",
|
||||||
|
style: TextStyle(color: Color(0xFF576B95), fontSize: 12),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import 'package:app/features/auth/bloc/register_page_state.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
||||||
|
class RegisterPage extends StatefulWidget {
|
||||||
|
const RegisterPage({super.key});
|
||||||
|
@override
|
||||||
|
State<StatefulWidget> createState() {
|
||||||
|
// TODO: implement createState
|
||||||
|
return RegisterPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+78
-30
@@ -5,16 +5,16 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: async
|
name: async
|
||||||
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
|
sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.13.0"
|
version: "2.13.1"
|
||||||
boolean_selector:
|
boolean_selector:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: boolean_selector
|
name: boolean_selector
|
||||||
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
|
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.2"
|
version: "2.1.2"
|
||||||
characters:
|
characters:
|
||||||
@@ -22,7 +22,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: characters
|
name: characters
|
||||||
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
|
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.1"
|
version: "1.4.1"
|
||||||
clock:
|
clock:
|
||||||
@@ -30,7 +30,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: clock
|
name: clock
|
||||||
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.2"
|
version: "1.1.2"
|
||||||
collection:
|
collection:
|
||||||
@@ -38,23 +38,39 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.19.1"
|
version: "1.19.1"
|
||||||
cupertino_icons:
|
cupertino_icons:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: cupertino_icons
|
name: cupertino_icons
|
||||||
sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6
|
sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.8"
|
version: "1.0.9"
|
||||||
|
dio:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: dio
|
||||||
|
sha256: aff32c08f92787a557dd5c0145ac91536481831a01b4648136373cddb0e64f8c
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "5.9.2"
|
||||||
|
dio_web_adapter:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: dio_web_adapter
|
||||||
|
sha256: "2f9e64323a7c3c7ef69567d5c800424a11f8337b8b228bad02524c9fb3c1f340"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.2"
|
||||||
fake_async:
|
fake_async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: fake_async
|
name: fake_async
|
||||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.3"
|
version: "1.3.3"
|
||||||
flutter:
|
flutter:
|
||||||
@@ -67,7 +83,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: flutter_lints
|
name: flutter_lints
|
||||||
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
|
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.0"
|
version: "6.0.0"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
@@ -85,15 +101,23 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: go_router
|
name: go_router
|
||||||
sha256: "7974313e217a7771557add6ff2238acb63f635317c35fa590d348fb238f00896"
|
sha256: "7974313e217a7771557add6ff2238acb63f635317c35fa590d348fb238f00896"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "17.1.0"
|
version: "17.1.0"
|
||||||
|
http_parser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http_parser
|
||||||
|
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "4.1.2"
|
||||||
leak_tracker:
|
leak_tracker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker
|
name: leak_tracker
|
||||||
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
|
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "11.0.2"
|
version: "11.0.2"
|
||||||
leak_tracker_flutter_testing:
|
leak_tracker_flutter_testing:
|
||||||
@@ -101,7 +125,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: leak_tracker_flutter_testing
|
name: leak_tracker_flutter_testing
|
||||||
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
|
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.10"
|
version: "3.0.10"
|
||||||
leak_tracker_testing:
|
leak_tracker_testing:
|
||||||
@@ -109,7 +133,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: leak_tracker_testing
|
name: leak_tracker_testing
|
||||||
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
|
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.2"
|
version: "3.0.2"
|
||||||
lints:
|
lints:
|
||||||
@@ -117,7 +141,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: lints
|
name: lints
|
||||||
sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df"
|
sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.0"
|
version: "6.1.0"
|
||||||
logging:
|
logging:
|
||||||
@@ -125,7 +149,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: logging
|
name: logging
|
||||||
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
|
sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.0"
|
version: "1.3.0"
|
||||||
matcher:
|
matcher:
|
||||||
@@ -133,7 +157,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
|
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.18"
|
version: "0.12.18"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
@@ -141,7 +165,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
|
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.13.0"
|
version: "0.13.0"
|
||||||
meta:
|
meta:
|
||||||
@@ -149,15 +173,23 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
|
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.17.0"
|
version: "1.17.0"
|
||||||
|
mime:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: mime
|
||||||
|
sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.0"
|
||||||
path:
|
path:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path
|
name: path
|
||||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.1"
|
version: "1.9.1"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
@@ -170,7 +202,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: source_span
|
name: source_span
|
||||||
sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab"
|
sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.10.2"
|
version: "1.10.2"
|
||||||
stack_trace:
|
stack_trace:
|
||||||
@@ -178,7 +210,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: stack_trace
|
name: stack_trace
|
||||||
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.12.1"
|
version: "1.12.1"
|
||||||
stream_channel:
|
stream_channel:
|
||||||
@@ -186,7 +218,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: stream_channel
|
name: stream_channel
|
||||||
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.4"
|
version: "2.1.4"
|
||||||
string_scanner:
|
string_scanner:
|
||||||
@@ -194,7 +226,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: string_scanner
|
name: string_scanner
|
||||||
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
|
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.4.1"
|
version: "1.4.1"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
@@ -202,7 +234,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: term_glyph
|
name: term_glyph
|
||||||
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
|
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.2"
|
version: "1.2.2"
|
||||||
test_api:
|
test_api:
|
||||||
@@ -210,15 +242,23 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: "19a78f63e83d3a61f00826d09bc2f60e191bf3504183c001262be6ac75589fb8"
|
sha256: "19a78f63e83d3a61f00826d09bc2f60e191bf3504183c001262be6ac75589fb8"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.8"
|
version: "0.7.8"
|
||||||
|
typed_data:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: typed_data
|
||||||
|
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "1.4.0"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vector_math
|
name: vector_math
|
||||||
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
|
sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.0"
|
version: "2.2.0"
|
||||||
vm_service:
|
vm_service:
|
||||||
@@ -226,9 +266,17 @@ packages:
|
|||||||
description:
|
description:
|
||||||
name: vm_service
|
name: vm_service
|
||||||
sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60"
|
sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.flutter-io.cn"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "15.0.2"
|
version: "15.0.2"
|
||||||
|
web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: web
|
||||||
|
sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"
|
||||||
|
url: "https://pub.flutter-io.cn"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.1"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.10.4 <4.0.0"
|
dart: ">=3.10.4 <4.0.0"
|
||||||
flutter: ">=3.35.0"
|
flutter: ">=3.35.0"
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ dependencies:
|
|||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.8
|
cupertino_icons: ^1.0.8
|
||||||
go_router: ^17.0.1
|
go_router: ^17.0.1
|
||||||
|
dio: ^5.9.2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|||||||
Vendored
+1
@@ -11,6 +11,7 @@
|
|||||||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite.cmd"
|
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite.cmd"
|
||||||
},
|
},
|
||||||
"runtimeArgs": ["--sourcemap"],
|
"runtimeArgs": ["--sourcemap"],
|
||||||
|
"console": "integratedTerminal",
|
||||||
"env": {
|
"env": {
|
||||||
"REMOTE_DEBUGGING_PORT": "9222"
|
"REMOTE_DEBUGGING_PORT": "9222"
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
},
|
},
|
||||||
"[javascript]": {
|
"[javascript]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||||
},
|
},
|
||||||
"[json]": {
|
"[json]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ export default defineConfig({
|
|||||||
main: {},
|
main: {},
|
||||||
preload: {},
|
preload: {},
|
||||||
renderer: {
|
renderer: {
|
||||||
|
server: {
|
||||||
|
host: true
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': resolve('src/renderer/src')
|
'@': resolve('src/renderer/src')
|
||||||
|
|||||||
@@ -0,0 +1,252 @@
|
|||||||
|
<template>
|
||||||
|
<div class="v-ui-dropdown" ref="dropdownRef">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="v-ui-dropdown-toggle"
|
||||||
|
:class="{ 'is-open': isOpen }"
|
||||||
|
@click.stop="toggleDropdown"
|
||||||
|
role="button"
|
||||||
|
aria-haspopup="listbox"
|
||||||
|
:aria-expanded="isOpen"
|
||||||
|
:disabled="disable"
|
||||||
|
>
|
||||||
|
<span class="v-ui-selected-text">{{ selectedLabel }}</span>
|
||||||
|
<span class="v-ui-arrow-icon" :class="{ 'v-ui-arrow-up': isOpen }">
|
||||||
|
<svg viewBox="0 0 1024 1024" width="1em" height="1em">
|
||||||
|
<path d="M831.872 340.864L512 652.672 192.128 340.864a31.936 31.936 0 0 0-45.248 0 32 32 0 0 0 0 45.248l342.144 333.76a31.936 31.936 0 0 0 45.248 0l342.144-333.76a32 32 0 0 0-45.248-45.248z" fill="currentColor"></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<transition name="v-ui-dropdown-grow">
|
||||||
|
<ul
|
||||||
|
v-show="isOpen"
|
||||||
|
class="v-ui-dropdown-menu"
|
||||||
|
role="listbox"
|
||||||
|
:aria-activedescendant="modelValue"
|
||||||
|
>
|
||||||
|
<li
|
||||||
|
v-for="option in options"
|
||||||
|
:key="option.value"
|
||||||
|
class="v-ui-dropdown-item"
|
||||||
|
:class="{ 'is-selected': option.value === modelValue }"
|
||||||
|
@click.stop="selectOption(option)"
|
||||||
|
role="option"
|
||||||
|
:aria-selected="option.value === modelValue"
|
||||||
|
>
|
||||||
|
<span class="v-ui-item-label">{{ option.label }}</span>
|
||||||
|
<span v-if="option.value === modelValue" class="v-ui-check-icon">
|
||||||
|
<svg viewBox="0 0 1024 1024" width="1em" height="1em">
|
||||||
|
<path d="M358.4 716.8l-204.8-204.8-51.2 51.2 256 256 512-512-51.2-51.2-460.8 460.8z" fill="currentColor"></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</transition>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed, onMounted, onUnmounted } from 'vue'
|
||||||
|
|
||||||
|
// 定义 Props (逻辑未变)
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
// 期望格式: [{ label: '选项一', value: 1 }, { label: '选项二', value: 2 }]
|
||||||
|
},
|
||||||
|
placeholder: {
|
||||||
|
type: String,
|
||||||
|
default: '请选择...'
|
||||||
|
},
|
||||||
|
disable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 定义 Emits (支持 v-model, 逻辑未变)
|
||||||
|
const emit = defineEmits(['update:modelValue', 'change'])
|
||||||
|
|
||||||
|
const isOpen = ref(false)
|
||||||
|
const dropdownRef = ref(null)
|
||||||
|
|
||||||
|
// 计算当前选中的文本 (逻辑未变)
|
||||||
|
const selectedLabel = computed(() => {
|
||||||
|
const selected = props.options.find(opt => opt.value === props.modelValue)
|
||||||
|
return selected ? selected.label : props.placeholder
|
||||||
|
})
|
||||||
|
|
||||||
|
// 切换下拉菜单状态 (逻辑未变)
|
||||||
|
const toggleDropdown = () => {
|
||||||
|
isOpen.value = !isOpen.value
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选中选项 (逻辑未变)
|
||||||
|
const selectOption = (option) => {
|
||||||
|
emit('update:modelValue', option.value)
|
||||||
|
emit('change', option)
|
||||||
|
isOpen.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点击组件外部区域关闭菜单 (逻辑未变)
|
||||||
|
const handleClickOutside = (event) => {
|
||||||
|
if (dropdownRef.value && !dropdownRef.value.contains(event.target)) {
|
||||||
|
isOpen.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 挂载和卸载全局点击事件监听 (逻辑未变)
|
||||||
|
onMounted(() => {
|
||||||
|
document.addEventListener('click', handleClickOutside)
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
document.removeEventListener('click', handleClickOutside)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* 使用加强型前缀和特异性选择器防止污染 */
|
||||||
|
.v-ui-dropdown {
|
||||||
|
position: relative; /* 强制相对定位 */
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||||
|
font-size: 14px;
|
||||||
|
display: inline-block; /* 防止父容器布局冲突 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 针对 ul 和 li 进行强制 reset,防止全局样式干扰 */
|
||||||
|
.v-ui-dropdown ul {
|
||||||
|
list-style: none;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.v-ui-dropdown li {
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 触发按钮:白底、靛蓝色边框的现代 Filled 风格 */
|
||||||
|
.v-ui-dropdown-toggle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px 16px;
|
||||||
|
background-color: #007aff; /* 强制微灰底色,与纯白背景区分 */
|
||||||
|
border: 1px solid #e4e4e7; /* 浅灰边框,避免融合 */
|
||||||
|
border-radius: 12px;
|
||||||
|
color: #000000; /* 极深灰 */
|
||||||
|
font-weight: 500;
|
||||||
|
cursor: pointer;
|
||||||
|
user-select: none;
|
||||||
|
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
|
||||||
|
box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-ui-dropdown-toggle:hover {
|
||||||
|
background-color: #cacaff;
|
||||||
|
border-color: #d1d5db;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 展开状态下 */
|
||||||
|
.v-ui-dropdown-toggle.is-open {
|
||||||
|
background-color: #cacaff;
|
||||||
|
border-color: #4f46e5; /* 靛蓝色主色 */
|
||||||
|
box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15); /* Focus 环 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-ui-selected-text {
|
||||||
|
flex: 1;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
margin-right: 10px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-ui-arrow-icon {
|
||||||
|
display: flex;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #000000;
|
||||||
|
transition: transform 0.3s ease, color 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-ui-arrow-up {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
color: #4f46e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 下拉菜单:纯白底色,强化悬浮阴影 */
|
||||||
|
.v-ui-dropdown .v-ui-dropdown-menu {
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 8px;
|
||||||
|
padding: 6px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border: 1px solid #e4e4e7;
|
||||||
|
border-radius: 12px;
|
||||||
|
/* 强阴影是白色背景上脱颖而出的秘诀 */
|
||||||
|
box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.12), 0 4px 12px -4px rgba(0, 0, 0, 0.08);
|
||||||
|
z-index: 1000; /* 确保在最上层 */
|
||||||
|
max-height: 240px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 菜单项样式 */
|
||||||
|
.v-ui-dropdown-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px 12px;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: #18181b;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
margin-bottom: 2px; /* Item 呼吸感 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-ui-dropdown-item:hover {
|
||||||
|
background-color: #f4f4f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 选中项的样式 */
|
||||||
|
.v-ui-dropdown-item.is-selected {
|
||||||
|
background-color: #eef2ff; /* 极淡的靛蓝色 */
|
||||||
|
color: #4f46e5;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-ui-item-label {
|
||||||
|
flex: 1;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-ui-check-icon {
|
||||||
|
display: flex;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #4f46e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 过渡动画 */
|
||||||
|
.v-ui-dropdown-grow-enter-active,
|
||||||
|
.v-ui-dropdown-grow-leave-active {
|
||||||
|
transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.2, 0, 0, 1);
|
||||||
|
transform-origin: top center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.v-ui-dropdown-grow-enter-from,
|
||||||
|
.v-ui-dropdown-grow-leave-to {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scaleY(0.95) translateY(-8px);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -4,6 +4,7 @@ import { friendService } from '../../services/friend';
|
|||||||
import { groupService } from '@/services/group';
|
import { groupService } from '@/services/group';
|
||||||
import { SYSTEM_BASE_STATUS } from '@/constants/systemBaseStatus';
|
import { SYSTEM_BASE_STATUS } from '@/constants/systemBaseStatus';
|
||||||
import { useMessage } from '../messages/useAlert';
|
import { useMessage } from '../messages/useAlert';
|
||||||
|
import AsyncImage from '../AsyncImage.vue';
|
||||||
|
|
||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
|
|
||||||
@@ -62,7 +63,7 @@ onMounted(async () =>{
|
|||||||
|
|
||||||
<div class="list">
|
<div class="list">
|
||||||
<div v-for="f in friends" :key="f.friendId" @click="toggle(f.friendId)" class="item">
|
<div v-for="f in friends" :key="f.friendId" @click="toggle(f.friendId)" class="item">
|
||||||
<img :src="f.userInfo.avatar" class="avatar" />
|
<AsyncImage :raw-url="f.userInfo.avatar" class="avatar" />
|
||||||
<span class="name">{{ f.remarkName }}</span>
|
<span class="name">{{ f.remarkName }}</span>
|
||||||
<input type="checkbox" :checked="selected.has(f.friendId)" />
|
<input type="checkbox" :checked="selected.has(f.friendId)" />
|
||||||
</div>
|
</div>
|
||||||
@@ -111,7 +112,7 @@ main { padding: 12px; }
|
|||||||
}
|
}
|
||||||
.item:hover { background: #f5f5f5; }
|
.item:hover { background: #f5f5f5; }
|
||||||
|
|
||||||
.avatar { width: 32px; height: 32px; border-radius: 4px; margin-right: 10px; }
|
:deep(.avatar) { width: 32px; height: 32px; border-radius: 4px; margin-right: 10px; }
|
||||||
.name { flex: 1; font-size: 14px; }
|
.name { flex: 1; font-size: 14px; }
|
||||||
|
|
||||||
footer { padding: 12px; }
|
footer { padding: 12px; }
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
class="member-item"
|
class="member-item"
|
||||||
>
|
>
|
||||||
<div class="member-avatar-box">
|
<div class="member-avatar-box">
|
||||||
<img :src="member.avatar" class="member-img" />
|
<async-image :raw-url="member.avatar" class="member-img"/>
|
||||||
<span v-if="member.role === GROUP_MEMBER_ROLE.ADMIN || member.role === GROUP_MEMBER_ROLE.MASTER" class="role-badge"></span>
|
<span v-if="member.role === GROUP_MEMBER_ROLE.ADMIN || member.role === GROUP_MEMBER_ROLE.MASTER" class="role-badge"></span>
|
||||||
</div>
|
</div>
|
||||||
<span class="member-nick">{{ member.nickname }}</span>
|
<span class="member-nick">{{ member.nickname }}</span>
|
||||||
@@ -85,6 +85,7 @@ import { SYSTEM_BASE_STATUS } from '../../constants/systemBaseStatus';
|
|||||||
import { useMessage } from './useAlert';
|
import { useMessage } from './useAlert';
|
||||||
import { getFileHash } from '../../utils/uploadTools';
|
import { getFileHash } from '../../utils/uploadTools';
|
||||||
import CreateGroup from '../groups/CreateGroup.vue';
|
import CreateGroup from '../groups/CreateGroup.vue';
|
||||||
|
import AsyncImage from '../AsyncImage.vue';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
chatType: {
|
chatType: {
|
||||||
@@ -339,7 +340,7 @@ onMounted(async () => {
|
|||||||
height: 48px;
|
height: 48px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.member-img {
|
:deep(.member-img) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
|
|||||||
@@ -18,7 +18,12 @@ export const GROUP_REQUEST_STATUS = Object.freeze({
|
|||||||
TARGET_PENDING: 'TargetPending',
|
TARGET_PENDING: 'TargetPending',
|
||||||
/** 对方拒绝 */
|
/** 对方拒绝 */
|
||||||
TARGET_DECLINED: 'TargetDeclined'
|
TARGET_DECLINED: 'TargetDeclined'
|
||||||
});
|
})
|
||||||
|
|
||||||
|
export const GROUP_REQUEST_ACTION = Object.freeze({
|
||||||
|
ACCEPT: 'Accept',
|
||||||
|
REJECT: 'Reject'
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
export const getGroupRequestStatusTxt = (status) => {
|
export const getGroupRequestStatusTxt = (status) => {
|
||||||
@@ -36,4 +41,5 @@ export const getGroupRequestStatusTxt = (status) => {
|
|||||||
default:
|
default:
|
||||||
return '未知状态';
|
return '未知状态';
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,23 @@ import { MESSAGE_TYPE } from "../constants/MessageType";
|
|||||||
|
|
||||||
export const messageHandler = (msg) => {
|
export const messageHandler = (msg) => {
|
||||||
const conversationStore = useConversationStore();
|
const conversationStore = useConversationStore();
|
||||||
const conversation = conversationStore.conversations.find(x =>
|
const conversation = conversationStore.conversations.find(x => {
|
||||||
((x.targetId == msg.senderId || x.targetId == msg.receiverId) && msg.chatType == MESSAGE_TYPE.PRIVATE) ||
|
// 1. 如果是私聊:目标 ID 必须是对方(可能是发送者,也可能是接收者)
|
||||||
(x.targetId == msg.receiverId && msg.chatType == MESSAGE_TYPE.GROUP)
|
if (msg.chatType === MESSAGE_TYPE.PRIVATE) {
|
||||||
);
|
return x.chatType === MESSAGE_TYPE.PRIVATE &&
|
||||||
|
(x.targetId === msg.senderId || x.targetId === msg.receiverId);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 如果是群聊:目标 ID 必须是群 ID(即消息的 receiverId)
|
||||||
|
if (msg.chatType === MESSAGE_TYPE.GROUP) {
|
||||||
|
return x.chatType === MESSAGE_TYPE.GROUP &&
|
||||||
|
x.targetId === msg.receiverId;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!conversation) return; // 容错处理:如果没找到会话,不执行后续逻辑
|
||||||
conversation.lastMessage = msg.content;
|
conversation.lastMessage = msg.content;
|
||||||
if (conversation.targetId == msg.receiverId) {
|
if (conversation.targetId == msg.receiverId) {
|
||||||
conversation.unreadCount = 0;
|
conversation.unreadCount = 0;
|
||||||
|
|||||||
@@ -42,5 +42,21 @@ export const groupService = {
|
|||||||
* 获取群聊通知
|
* 获取群聊通知
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
getGroupNotification: () => request.get('/Group/GetGroupNotification')
|
getGroupNotification: () => request.get('/Group/GetGroupNotification'),
|
||||||
|
/**
|
||||||
|
* 处理入群邀请
|
||||||
|
* @param {*} inviteId
|
||||||
|
* @param {*} action
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
handleGroupInvite: (inviteId, action) =>
|
||||||
|
request.post('/Group/HandleGroupInvite', { inviteId: inviteId, action: action }),
|
||||||
|
/**
|
||||||
|
* 处理入群请求
|
||||||
|
* @param {*} requestId
|
||||||
|
* @param {*} action
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
handleGroupRequest: (requestId, action) =>
|
||||||
|
request.post('/Group/HandleGroupRequest', { requestId: requestId, action: action })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ export const useChatStore = defineStore('chat', {
|
|||||||
this.isEnded = false;
|
this.isEnded = false;
|
||||||
//先从浏览器缓存加载一部分消息列表
|
//先从浏览器缓存加载一部分消息列表
|
||||||
const localHistory = await messagesDb.getLatestMessages(sessionId, this.pageSize);
|
const localHistory = await messagesDb.getLatestMessages(sessionId, this.pageSize);
|
||||||
console.log(localHistory)
|
|
||||||
if (localHistory.length > 0) {
|
if (localHistory.length > 0) {
|
||||||
this.messages = localHistory;
|
this.messages = localHistory;
|
||||||
this.maxSequenceId = this.messages.reduce((max, m) =>
|
this.maxSequenceId = this.messages.reduce((max, m) =>
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ export const generateSessionId = (id1, id2, isGroup = false) => {
|
|||||||
if (isGroup) {
|
if (isGroup) {
|
||||||
return `g:${id2}`;
|
return `g:${id2}`;
|
||||||
}
|
}
|
||||||
return [String(id1), String(id2)].sort().join('_');
|
return 'p:' + [String(id1), String(id2)].sort().join('_');
|
||||||
};
|
};
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<AsyncImage raw-url="http://192.168.5.116:7070/uploads/files/IM/2026/03/2/e6c407f60c68.jpg" :type="FILE_TYPE.Image"/>
|
<!-- <AsyncImage raw-url="http://192.168.5.116:7070/uploads/files/IM/2026/03/2/e6c407f60c68.jpg" :type="FILE_TYPE.Image"/> -->
|
||||||
|
<Dropdown :options="[{label:'测试1',value:'测试1'},{label:'测试2',value:'测试2'}]" placeholder="测试下拉框"/>
|
||||||
<button @click="test">click</button>
|
<button @click="test">click</button>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -9,6 +10,7 @@ import { ref } from 'vue';
|
|||||||
import { useCacheStore } from '../stores/cache';
|
import { useCacheStore } from '../stores/cache';
|
||||||
import { FILE_TYPE } from '../constants/fileTypeDefine';
|
import { FILE_TYPE } from '../constants/fileTypeDefine';
|
||||||
import AsyncImage from '../components/AsyncImage.vue';
|
import AsyncImage from '../components/AsyncImage.vue';
|
||||||
|
import Dropdown from '../components/Dropdown.vue';
|
||||||
|
|
||||||
|
|
||||||
const url = ref('')
|
const url = ref('')
|
||||||
|
|||||||
@@ -9,30 +9,25 @@
|
|||||||
<div v-for="item in groupRequest" :key="item.requestId" class="minimal-item">
|
<div v-for="item in groupRequest" :key="item.requestId" class="minimal-item">
|
||||||
|
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<img
|
<img :src="avatarHandle(item)" :class="[
|
||||||
:src="avatarHandle(item)"
|
'avatar',
|
||||||
:class="[
|
item.type === GROUP_REQUEST_STATUS.IS_GROUP ||
|
||||||
'avatar',
|
|
||||||
item.type === GROUP_REQUEST_STATUS.IS_GROUP ||
|
|
||||||
item.type === GROUP_REQUEST_STATUS.IS_USER
|
item.type === GROUP_REQUEST_STATUS.IS_USER
|
||||||
? 'is-group'
|
? 'is-group'
|
||||||
: 'is-user'
|
: 'is-user'
|
||||||
]"
|
]" />
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="title-row">
|
<div class="title-row">
|
||||||
<span class="name">{{ item.name }}</span>
|
<span class="name">{{ item.name }}</span>
|
||||||
<span
|
<span :class="[
|
||||||
:class="[
|
'type-tag',
|
||||||
'type-tag',
|
item.type === GROUP_REQUEST_TYPE.INVITE ||
|
||||||
item.type === GROUP_REQUEST_TYPE.INVITE ||
|
|
||||||
item.type === GROUP_REQUEST_TYPE.IS_USER
|
item.type === GROUP_REQUEST_TYPE.IS_USER
|
||||||
? 'tag-orange'
|
? 'tag-orange'
|
||||||
: 'tag-green'
|
: 'tag-green'
|
||||||
]"
|
]">
|
||||||
>
|
|
||||||
{{ getTypeText(item.type) }}
|
{{ getTypeText(item.type) }}
|
||||||
</span>
|
</span>
|
||||||
<span class="date">14:20</span>
|
<span class="date">14:20</span>
|
||||||
@@ -42,25 +37,23 @@
|
|||||||
<span class="label">目标群聊:</span>
|
<span class="label">目标群聊:</span>
|
||||||
<span class="group-name">{{ item.groupName }}</span>
|
<span class="group-name">{{ item.groupName }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="[GROUP_REQUEST_TYPE.INVITE, GROUP_REQUEST_TYPE.INVITED].includes(item.type)"
|
||||||
v-if="[GROUP_REQUEST_TYPE.INVITE, GROUP_REQUEST_TYPE.INVITED].includes(item.type)"
|
class="group-info">
|
||||||
class="group-info"
|
|
||||||
>
|
|
||||||
<span class="label">目标用户:</span>
|
<span class="label">目标用户:</span>
|
||||||
<span class="group-name">{{
|
<span class="group-name">{{
|
||||||
myInfo.id === item.userId ? item.inviteUserNickname : item.nickName
|
myInfo.id === item.userId ? item.inviteUserNickname : item.nickName
|
||||||
}}</span>
|
}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="sub-text">入群描述:{{ item.description }}</p>
|
<p class="sub-text">入群描述:{{ item.description }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div v-if="[GROUP_REQUEST_TYPE.INVITED, GROUP_REQUEST_TYPE.IS_GROUP].includes(item.type)" class="actions">
|
||||||
v-if="![GROUP_REQUEST_TYPE.INVITE, GROUP_REQUEST_TYPE.IS_USER].includes(item.type)"
|
|
||||||
class="actions"
|
|
||||||
>
|
|
||||||
<button class="btn-text btn-reject">忽略</button>
|
<button class="btn-text btn-reject">忽略</button>
|
||||||
<button class="btn-text btn-accept">去处理</button>
|
<Dropdown :disable="handleDropDownDisable" class="handleDropDown" v-model="handleValue" :options="[
|
||||||
|
{ label: '同意', value: GROUP_REQUEST_ACTION.ACCEPT },
|
||||||
|
{ label: '拒绝', value: GROUP_REQUEST_ACTION.REJECT }
|
||||||
|
]" placeholder="处理" @change="groupRequestHandler(item, handleValue)" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions" v-else>
|
<div class="actions" v-else>
|
||||||
@@ -78,18 +71,26 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, computed } from 'vue';
|
import { onMounted, computed, ref, watch } from 'vue';
|
||||||
import WindowControls from '../../components/WindowControls.vue';
|
import WindowControls from '../../components/WindowControls.vue';
|
||||||
import { useGroupRequestStore } from '../../stores/groupRequest';
|
import { useGroupRequestStore } from '../../stores/groupRequest';
|
||||||
import { useAuthStore } from '../../stores/auth';
|
import { useAuthStore } from '../../stores/auth';
|
||||||
import { GROUP_REQUEST_TYPE, getTypeText } from '../../constants/groupRequestTypeDefine';
|
import { GROUP_REQUEST_TYPE, getTypeText } from '../../constants/groupRequestTypeDefine';
|
||||||
import { GROUP_REQUEST_STATUS, getGroupRequestStatusTxt } from '../../constants/GroupDefine';
|
import { GROUP_REQUEST_ACTION, GROUP_REQUEST_STATUS, getGroupRequestStatusTxt } from '../../constants/GroupDefine';
|
||||||
|
import Dropdown from '../../components/Dropdown.vue';
|
||||||
|
import { groupService } from '../../services/group';
|
||||||
|
import { useMessage } from '../../components/messages/useAlert';
|
||||||
|
import { SYSTEM_BASE_STATUS } from '../../constants/systemBaseStatus';
|
||||||
|
|
||||||
const groupRequestStore = useGroupRequestStore()
|
const groupRequestStore = useGroupRequestStore()
|
||||||
const myInfo = useAuthStore().userInfo
|
const myInfo = useAuthStore().userInfo
|
||||||
|
const handleValue = ref(null)
|
||||||
|
const handleDropDownDisable = ref(false)
|
||||||
|
const message = useMessage()
|
||||||
|
|
||||||
|
|
||||||
const groupRequest = computed(() => {
|
const groupRequest = computed(() => {
|
||||||
if(!groupRequestStore.groupRequest){
|
if (!groupRequestStore.groupRequest) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return groupRequestStore.groupRequest.map((item) => {
|
return groupRequestStore.groupRequest.map((item) => {
|
||||||
@@ -109,7 +110,7 @@ const getGroupRequestStatusClass = (status) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const avatarHandle = (request) => {
|
const avatarHandle = (request) => {
|
||||||
switch(request.type){
|
switch (request.type) {
|
||||||
case GROUP_REQUEST_STATUS.IS_GROUP:
|
case GROUP_REQUEST_STATUS.IS_GROUP:
|
||||||
case GROUP_REQUEST_STATUS.IS_USER:
|
case GROUP_REQUEST_STATUS.IS_USER:
|
||||||
return request.groupAvatar;
|
return request.groupAvatar;
|
||||||
@@ -154,6 +155,31 @@ const getRequestType = (request) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//入群请求处理
|
||||||
|
const groupRequestHandler = async (request, action) => {
|
||||||
|
if (!request || !request.type) return
|
||||||
|
let requestAction = GROUP_REQUEST_STATUS.PASSED
|
||||||
|
let result = null
|
||||||
|
switch (request.type) {
|
||||||
|
case GROUP_REQUEST_TYPE.INVITED:
|
||||||
|
requestAction = action == GROUP_REQUEST_ACTION.ACCEPT ? GROUP_REQUEST_STATUS.TARGET_PENDING : GROUP_REQUEST_STATUS.TARGET_DECLINED;
|
||||||
|
result = await groupService.handleGroupInvite(request.id ,requestAction)
|
||||||
|
break
|
||||||
|
case GROUP_REQUEST_TYPE.IS_GROUP:
|
||||||
|
requestAction = action == GROUP_REQUEST_ACTION.ACCEPT ? GROUP_REQUEST_STATUS.PASSED : GROUP_REQUEST_STATUS.DECLINED;
|
||||||
|
result = await groupService.handleGroupRequest(request.id, requestAction)
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(result.code == SYSTEM_BASE_STATUS.SUCCESS){
|
||||||
|
message.success('操作成功')
|
||||||
|
}else{
|
||||||
|
message.error(result.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await groupRequestStore.loadGroupRequest()
|
await groupRequestStore.loadGroupRequest()
|
||||||
console.log(groupRequestStore.groupRequest)
|
console.log(groupRequestStore.groupRequest)
|
||||||
@@ -390,4 +416,6 @@ onMounted(async () => {
|
|||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.handleDropDown {}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -68,13 +68,12 @@ const currentContact = ref(null)
|
|||||||
function handleGoToChat() {
|
function handleGoToChat() {
|
||||||
if (currentContact.value) {
|
if (currentContact.value) {
|
||||||
const cid = conversationStore.conversations.find(x => x.targetId == currentContact.value.userInfo.id).id;
|
const cid = conversationStore.conversations.find(x => x.targetId == currentContact.value.userInfo.id).id;
|
||||||
console.log(cid)
|
|
||||||
router.push(`/messages/chat/${cid}`);
|
router.push(`/messages/chat/${cid}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeRouteUpdate(() => {
|
onBeforeRouteUpdate((to, from) => {
|
||||||
currentContact.value = contactStore.contacts.find(x => x.id == props.id);
|
currentContact.value = contactStore.contacts.find(x => x.id == to.params.id);
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
currentContact.value = contactStore.contacts.find(x => x.id == props.id);
|
currentContact.value = contactStore.contacts.find(x => x.id == props.id);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ onMounted(async () => {
|
|||||||
if(authStore.token){
|
if(authStore.token){
|
||||||
signalRStore.initSignalR();
|
signalRStore.initSignalR();
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Reference in New Issue
Block a user