From a469cd3bac67c4646d0d987645b70d4f11749a8f Mon Sep 17 00:00:00 2001 From: XiaoLFeng Date: Sat, 24 Jun 2023 21:00:57 +0800 Subject: [PATCH] =?UTF-8?q?make-friend.blade=E5=8F=8B=E9=93=BE=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/function/make-friend.blade.php | 151 ++++++++++++++++-- 1 file changed, 135 insertions(+), 16 deletions(-) diff --git a/resources/views/function/make-friend.blade.php b/resources/views/function/make-friend.blade.php index 4010ac6..8d80588 100644 --- a/resources/views/function/make-friend.blade.php +++ b/resources/views/function/make-friend.blade.php @@ -23,7 +23,7 @@ class="relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36.125rem] -translat
返回友链
-
+
@@ -102,7 +102,7 @@ class="relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36.125rem] -translat
@@ -126,12 +126,15 @@ class="relative left-[calc(50%-11rem)] aspect-[1155/678] w-[36.125rem] -translat
- + + @if(empty($blogSort[0])) + + @else + @foreach($blogSort as $blogValue) + + @endforeach + @endif
@@ -149,23 +152,35 @@ class="w-16 h-16 p-1 rounded-full ring-2 ring-gray-300 dark:ring-gray-500 me-2 s
- + + @if(empty($blogColor[0])) + + @else + @foreach($blogColor as $blogValue) + + @endforeach + @endif
+
+ +
+
+ +
+ +
+

- +
@@ -180,6 +195,38 @@ class="relative left-[calc(50%+3rem)] aspect-[1155/678] w-[36.125rem] -translate @include('modules.footer')
+ + + + @@ -203,6 +250,78 @@ class="relative left-[calc(50%+3rem)] aspect-[1155/678] w-[36.125rem] -translate }); }) + +function buttonSubmit() { + if ($('#remember').prop('checked')) { + ajax(); + } else { + Toast.toggle('请您确认知情友链申请要求',''); + } +} + +class Toast { + static toggle(data,icon) { + this.set(data,icon); + $('#toast').fadeIn(300); + setTimeout(function () { + $('#toast').fadeOut(300); + }, 3000); + } + static set(data,icon) { + $('#toast-icon').html(icon); + $('#toast-info').text(data); + } +} + +class Enum { + static userEmail = '用户邮箱'; + static userServerHost = '服务商'; + static userBlog = '博客名字'; + static userUrl = '博客地址'; + static userDescription = '博客描述'; + static userIcon = '图片地址'; + static checkRssJudge = 'RSS选项'; + static userRss = 'RSS地址'; + static userLocation = '所属位置'; + static userSelColor = '选择颜色'; + static userRemark = '留言备注'; +} + +function ajax() { + $.ajax({ + async: true, + method: "POST", + data: $('#FormData').serialize(), + url: '{{ route('api.link.custom.add') }}', + dataType: "json", + success: function (returnData) { + if (returnData.output === "Success") { + Toast.toggle('友链申请成功',''); + location.href = '{{ route('home') }}' + } else { + Toast('未知错误',''); + } + }, + error: function (returnData) { + Toast.set('其他错误',''); + if (returnData.responseJSON.output === 'DataFormatError') { + for (let key in Enum) { + if (returnData.responseJSON.data.errorSingle.info === key) { + Toast.toggle(Enum[key]+'错误,注意格式',''); + } + } + } else if (returnData.responseJSON.output === "AlreadyUser") { + $('#toast-interactive').fadeIn(300); + $('#edit-friend').attr('href',"{{ route('function.edit-search') }}?searchName="+$('#userBlog').val()+"&searchUrl="+$('#userUrl').val()); + setTimeout(function () { + $('#toast-interactive').fadeOut(300); + }, 10000); + } else { + Toast.toggle('未知错误',''); + } + } + }); +} {!! $webFooter !!}