完成邮件配置模块
This commit is contained in:
		
							parent
							
								
									68ab7e257b
								
							
						
					
					
						commit
						e7d5aa1971
					
				
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -1,5 +1,5 @@ | ||||
| /.idea | ||||
| /.vscode | ||||
| /vendor | ||||
| /runtime/* | ||||
| runtime | ||||
| *.log | ||||
|  | ||||
| @ -14,7 +14,8 @@ use app\admin\model\AdminUserGroup; | ||||
| use app\admin\model\AdminConfig; | ||||
| use app\admin\model\ZIconfont; | ||||
| use app\admin\model\MailConfig; | ||||
| use \PHPMailer\PHPMailer\PHPMailer; | ||||
| use PHPMailer\PHPMailer\PHPMailer; | ||||
| use PHPMailer\PHPMailer\Exception; | ||||
| 
 | ||||
| class YunzerController extends Base | ||||
| { | ||||
|  | ||||
| @ -31,14 +31,14 @@ | ||||
|     <div class="layui-form-item"> | ||||
|         <label class="layui-form-label">发件人名称</label> | ||||
|         <div class="layui-input-block"> | ||||
|             <input type="text" name="smtp_name" value="学创网络" placeholder="请输入发件人名称" class="layui-input"> | ||||
|             <input type="text" name="smtp_name" value="" placeholder="请输入发件人名称" class="layui-input"> | ||||
|         </div> | ||||
|     </div> | ||||
|      | ||||
|     <div class="layui-form-item"> | ||||
|         <div class="layui-input-block"> | ||||
|             <button class="layui-btn" lay-submit lay-filter="saveMailConfig">保存配置</button> | ||||
|             <button class="layui-btn layui-btn-primary" lay-filter="testMailConfig">测试发送</button> | ||||
|             <button type="button" class="layui-btn layui-btn-primary" lay-submit lay-filter="testMailConfig">测试发送</button> | ||||
|         </div> | ||||
|     </div> | ||||
| </div> | ||||
| @ -50,14 +50,14 @@ layui.use(['form', 'layer'], function(){ | ||||
|      | ||||
|     // 加载配置
 | ||||
|     $.get('/admin/yunzer/getMailConfig', function(res){ | ||||
|         if(res.code === 1){ | ||||
|         if(res.code === 0){ | ||||
|             form.val('mailConfigForm', res.data); | ||||
|         } | ||||
|     }); | ||||
|      | ||||
|     // 保存配置
 | ||||
|     form.on('submit(saveMailConfig)', function(data){ | ||||
|         $.post('/admin/yunzer/saveMailConfig', data.field, function(res){ | ||||
|         $.post('/admin/yunzer/mailconfig', data.field, function(res){ | ||||
|             if(res.code === 1){ | ||||
|                 layer.msg('保存成功'); | ||||
|             }else{ | ||||
|  | ||||
| @ -1,5 +1,5 @@ | ||||
| <div style="display: flex;flex-direction: column;"> | ||||
| <div class="topbar-one"> | ||||
|     <div class="topbar-one"> | ||||
|         <div class="container"> | ||||
|             <div style="width: 70%;"> | ||||
|                 <ul class="list-unstyled topbar-one__info"> | ||||
| @ -14,8 +14,6 @@ | ||||
|                 </ul> | ||||
|             </div> | ||||
|             <div class="topbar-one__social" style="width: 30%;"> | ||||
|                 <a href="/index/user/login" class="mr-10"><i class="layui-icon layui-icon-username"></i> 登录</a> | ||||
|                 <a href="/index/user/register" class="mr-10"><i class="layui-icon layui-icon-user"></i> 注册</a> | ||||
|                 <a href="javascript:;" class="qrcode-trigger"><i class="layui-icon layui-icon-qrcode"></i> 公众号</a> | ||||
|                 <div class="qrcode-popup" | ||||
|                     style="display:none;position:absolute;right:54px;top:32px;background:#fff;padding:10px;box-shadow:0 0 10px rgba(0,0,0,0.1); z-index: 1000;"> | ||||
| @ -40,10 +38,12 @@ | ||||
|             </div> | ||||
|             <div class="main-menu__right"> | ||||
|                 <div class="layui-inline"> | ||||
|                     <!-- 根据登录状态显示不同的内容 --> | ||||
|                     <?php if ($isLoggedIn): ?>
 | ||||
|                         <div class="layui-inline" style="position: relative;"> | ||||
|                             <img src="__IMAGES__/avatar.webp" class="layui-circle" | ||||
|                             style="width: 40px; height: 40px; cursor: pointer;" id="userAvatarMain"> | ||||
|                         <div class="user-dropdown" id="userDropdownMain"> | ||||
|                                 style="width: 40px; height: 40px; cursor: pointer;" id="userAvatarSticky"> | ||||
|                             <div class="user-dropdown" id="userDropdownSticky"> | ||||
|                                 <ul> | ||||
|                                     <li> | ||||
|                                         <a href="/index/user/profile"><i | ||||
| @ -60,6 +60,12 @@ | ||||
|                                 </ul> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     <?php else: ?>
 | ||||
|                         <div class="layui-inline"> | ||||
|                             <a href="/index/user/login" class="layui-btn layui-btn-normal">登录</a> | ||||
|                             <a href="/index/user/register" class="layui-btn layui-btn-primary">注册</a> | ||||
|                         </div> | ||||
|                     <?php endif; ?>
 | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
| @ -83,6 +89,8 @@ | ||||
|         <div class="sticky-nav__right"> | ||||
|             <div class="main-menu__right"> | ||||
|                 <div class="layui-inline"> | ||||
|                     <!-- 根据登录状态显示不同的内容 --> | ||||
|                     <?php if ($isLoggedIn): ?>
 | ||||
|                         <div class="layui-inline" style="position: relative;"> | ||||
|                             <img src="__IMAGES__/avatar.webp" class="layui-circle" | ||||
|                                 style="width: 40px; height: 40px; cursor: pointer;" id="userAvatarSticky"> | ||||
| @ -103,6 +111,12 @@ | ||||
|                                 </ul> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     <?php else: ?>
 | ||||
|                         <div class="layui-inline"> | ||||
|                             <a href="/index/user/login" class="layui-btn layui-btn-normal">登录</a> | ||||
|                             <a href="/index/user/register" class="layui-btn layui-btn-primary">注册</a> | ||||
|                         </div> | ||||
|                     <?php endif; ?>
 | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|  | ||||
| @ -1,3 +1,8 @@ | ||||
| <?php | ||||
| // 获取当前登录状态
 | ||||
| $isLoggedIn = session('user_id') ? true : false; | ||||
| ?>
 | ||||
| 
 | ||||
| <div style="display: flex;flex-direction: column;"> | ||||
|     <div class="topbar-one"> | ||||
|         <div class="container"> | ||||
| @ -14,8 +19,6 @@ | ||||
|                 </ul> | ||||
|             </div> | ||||
|             <div class="topbar-one__social" style="width: 30%;"> | ||||
|                 <a href="/index/user/login" class="mr-10"><i class="layui-icon layui-icon-username"></i> 登录</a> | ||||
|                 <a href="/index/user/register" class="mr-10"><i class="layui-icon layui-icon-user"></i> 注册</a> | ||||
|                 <a href="javascript:;" class="qrcode-trigger"><i class="layui-icon layui-icon-qrcode"></i> 公众号</a> | ||||
|                 <div class="qrcode-popup" | ||||
|                     style="display:none;position:absolute;right:54px;top:32px;background:#fff;padding:10px;box-shadow:0 0 10px rgba(0,0,0,0.1); z-index: 1000;"> | ||||
| @ -40,6 +43,8 @@ | ||||
|             </div> | ||||
|             <div class="main-menu__right"> | ||||
|                 <div class="layui-inline"> | ||||
|                     <!-- 根据登录状态显示不同的内容 --> | ||||
|                     <?php if ($isLoggedIn): ?>
 | ||||
|                         <div class="layui-inline" style="position: relative;"> | ||||
|                             <img src="__IMAGES__/avatar.webp" class="layui-circle" | ||||
|                                 style="width: 40px; height: 40px; cursor: pointer;" id="userAvatarMain"> | ||||
| @ -60,6 +65,12 @@ | ||||
|                                 </ul> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     <?php else: ?>
 | ||||
|                         <div class="layui-inline"> | ||||
|                             <a href="/index/user/login" class="layui-btn layui-btn-normal">登录</a> | ||||
|                             <a href="/index/user/register" class="layui-btn layui-btn-primary">注册</a> | ||||
|                         </div> | ||||
|                     <?php endif; ?>
 | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
| @ -90,6 +101,8 @@ | ||||
|         <div class="sticky-nav__right"> | ||||
|             <div class="main-menu__right"> | ||||
|                 <div class="layui-inline"> | ||||
|                     <!-- 根据登录状态显示不同的内容 --> | ||||
|                     <?php if ($isLoggedIn): ?>
 | ||||
|                         <div class="layui-inline" style="position: relative;"> | ||||
|                             <img src="__IMAGES__/avatar.webp" class="layui-circle" | ||||
|                                 style="width: 40px; height: 40px; cursor: pointer;" id="userAvatarSticky"> | ||||
| @ -110,6 +123,12 @@ | ||||
|                                 </ul> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     <?php else: ?>
 | ||||
|                         <div class="layui-inline"> | ||||
|                             <a href="/index/user/login" class="layui-btn layui-btn-normal">登录</a> | ||||
|                             <a href="/index/user/register" class="layui-btn layui-btn-primary">注册</a> | ||||
|                         </div> | ||||
|                     <?php endif; ?>
 | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|  | ||||
							
								
								
									
										4
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								composer.lock
									
									
									
										generated
									
									
									
								
							| @ -2093,12 +2093,12 @@ | ||||
|     ], | ||||
|     "aliases": [], | ||||
|     "minimum-stability": "stable", | ||||
|     "stability-flags": {}, | ||||
|     "stability-flags": [], | ||||
|     "prefer-stable": false, | ||||
|     "prefer-lowest": false, | ||||
|     "platform": { | ||||
|         "php": ">=7.2.5" | ||||
|     }, | ||||
|     "platform-dev": {}, | ||||
|     "platform-dev": [], | ||||
|     "plugin-api-version": "2.6.0" | ||||
| } | ||||
|  | ||||
| @ -6,11 +6,11 @@ body { | ||||
| 
 | ||||
| a { | ||||
|   text-decoration: none !important; | ||||
|   color: var(--bs-white) !important; | ||||
|   color: var(--bs-white); | ||||
| } | ||||
| 
 | ||||
| a:hover { | ||||
|   color: var(--bs-orange) !important; | ||||
|   color: var(--bs-orange); | ||||
| } | ||||
| 
 | ||||
| .fas { | ||||
| @ -211,12 +211,20 @@ pre code { | ||||
|   position: relative; | ||||
| } | ||||
| 
 | ||||
| .main-menu .container a { | ||||
| .main-menu .container .main-menu__right .layui-btn-primary:hover,.sticky-nav .container .main-menu__right .layui-btn-primary:hover { | ||||
|   color: #3492ed; | ||||
| } | ||||
| 
 | ||||
| .main-menu .container .main-menu__nav a { | ||||
|   color: #3492ed !important; | ||||
| } | ||||
| 
 | ||||
| .main-menu .container .main-menu__nav a:hover { | ||||
|   color: #fff !important; | ||||
| } | ||||
| 
 | ||||
| .main-menu .container a:hover { | ||||
|   color: var(--bs-white) !important; | ||||
|   color: var(--bs-white); | ||||
| } | ||||
| 
 | ||||
| #userDropdownMain a:hover { | ||||
| @ -318,6 +326,7 @@ pre code { | ||||
| 
 | ||||
| /* 轮播动画 */ | ||||
| @keyframes slide { | ||||
| 
 | ||||
|   0%, | ||||
|   33% { | ||||
|     transform: translateX(0); | ||||
| @ -556,13 +565,15 @@ pre code { | ||||
|   -webkit-line-clamp: 2; | ||||
|   -webkit-box-orient: vertical; | ||||
| } | ||||
| 
 | ||||
| .layui-layer-btn .layui-layer-btn1 { | ||||
|   background: #fff; | ||||
|   color: #212529 !important; | ||||
|   border: 1px solid #212529; | ||||
| } | ||||
| 
 | ||||
| .program-content img,.game-content img { | ||||
| .program-content img, | ||||
| .game-content img { | ||||
|   width: 100%; | ||||
|   margin: 20px auto; | ||||
| } | ||||
| @ -1108,7 +1108,7 @@ a cite { | ||||
| 	height: 100%; | ||||
| 	line-height: 60px; | ||||
| 	text-align: center; | ||||
| 	color: #16baaa; | ||||
| 	color: #1e9fff; | ||||
| 	font-size: 16px; | ||||
| 	box-shadow: 0 1px 2px 0 rgb(0 0 0 / 15%) | ||||
| } | ||||
| @ -2298,7 +2298,7 @@ a cite { | ||||
| } | ||||
| 
 | ||||
| .layui-bg-green { | ||||
| 	background-color: #16baaa !important; | ||||
| 	background-color: #1e9fff !important; | ||||
| 	color: #fff !important | ||||
| } | ||||
| 
 | ||||
| @ -2371,8 +2371,8 @@ a cite { | ||||
| .layui-border-green { | ||||
| 	border-width: 1px; | ||||
| 	border-style: solid; | ||||
| 	border-color: #16baaa !important; | ||||
| 	color: #16baaa !important | ||||
| 	border-color: #1e9fff !important; | ||||
| 	color: #1e9fff !important | ||||
| } | ||||
| 
 | ||||
| .layui-border-cyan { | ||||
| @ -2578,7 +2578,7 @@ hr.layui-border-red { | ||||
| } | ||||
| 
 | ||||
| .layui-font-green { | ||||
| 	color: #16baaa !important | ||||
| 	color: #1e9fff !important | ||||
| } | ||||
| 
 | ||||
| .layui-font-cyan { | ||||
| @ -2608,7 +2608,7 @@ hr.layui-border-red { | ||||
| 	line-height: 38px; | ||||
| 	border: 1px solid transparent; | ||||
| 	padding: 0 18px; | ||||
| 	background-color: #16baaa; | ||||
| 	background-color: #1e9fff; | ||||
| 	color: #fff; | ||||
| 	white-space: nowrap; | ||||
| 	text-align: center; | ||||
| @ -2668,7 +2668,7 @@ hr.layui-border-red { | ||||
| } | ||||
| 
 | ||||
| .layui-btn-primary:hover { | ||||
| 	border-color: #16baaa; | ||||
| 	border-color: #1e9fff; | ||||
| 	color: #333 | ||||
| } | ||||
| 
 | ||||
| @ -2742,7 +2742,7 @@ hr.layui-border-red { | ||||
| 
 | ||||
| .layui-btn-group .layui-btn-primary:hover { | ||||
| 	border-color: #d2d2d2; | ||||
| 	color: #16baaa | ||||
| 	color: #1e9fff | ||||
| } | ||||
| 
 | ||||
| .layui-btn-group .layui-btn:first-child { | ||||
| @ -3747,7 +3747,7 @@ hr.layui-border-red { | ||||
| } | ||||
| 
 | ||||
| .layui-laypage a:hover { | ||||
| 	color: #16baaa | ||||
| 	color: #1e9fff | ||||
| } | ||||
| 
 | ||||
| .layui-laypage em { | ||||
| @ -3775,7 +3775,7 @@ hr.layui-border-red { | ||||
| 	padding: 1px; | ||||
| 	width: 100%; | ||||
| 	height: 100%; | ||||
| 	background-color: #16baaa | ||||
| 	background-color: #1e9fff | ||||
| } | ||||
| 
 | ||||
| .layui-laypage-em { | ||||
| @ -3841,7 +3841,7 @@ hr.layui-border-red { | ||||
| 
 | ||||
| .layui-laypage input:focus, | ||||
| .layui-laypage select:focus { | ||||
| 	border-color: #16baaa !important | ||||
| 	border-color: #1e9fff !important | ||||
| } | ||||
| 
 | ||||
| .layui-laypage button { | ||||
| @ -4708,11 +4708,11 @@ body .layui-table-tips .layui-layer-content { | ||||
| 
 | ||||
| .layui-upload-drag .layui-icon { | ||||
| 	font-size: 50px; | ||||
| 	color: #16baaa | ||||
| 	color: #1e9fff | ||||
| } | ||||
| 
 | ||||
| .layui-upload-drag[lay-over] { | ||||
| 	border-color: #16baaa | ||||
| 	border-color: #1e9fff | ||||
| } | ||||
| 
 | ||||
| .layui-upload-form { | ||||
| @ -5063,7 +5063,7 @@ body .layui-table-tips .layui-layer-content { | ||||
| 
 | ||||
| .layui-tabs-header .layui-this, | ||||
| .layui-tabs-header li:hover { | ||||
| 	color: #16baaa | ||||
| 	color: #1e9fff | ||||
| } | ||||
| 
 | ||||
| .layui-tabs-header .layui-this:after { | ||||
| @ -5074,7 +5074,7 @@ body .layui-table-tips .layui-layer-content { | ||||
| 	z-index: 1; | ||||
| 	width: 100%; | ||||
| 	height: 100%; | ||||
| 	border-bottom: 3px solid #16baaa; | ||||
| 	border-bottom: 3px solid #1e9fff; | ||||
| 	box-sizing: border-box; | ||||
| 	pointer-events: none | ||||
| } | ||||
| @ -5367,7 +5367,7 @@ body .layui-table-tips .layui-layer-content { | ||||
| .layui-nav-tree .layui-this, | ||||
| .layui-nav-tree .layui-this>a, | ||||
| .layui-nav-tree .layui-this>a:hover { | ||||
| 	background-color: #16baaa; | ||||
| 	background-color: #1e9fff; | ||||
| 	color: #fff | ||||
| } | ||||
| 
 | ||||
| @ -5382,7 +5382,7 @@ body .layui-table-tips .layui-layer-content { | ||||
| } | ||||
| 
 | ||||
| .layui-nav-tree .layui-nav-bar { | ||||
| 	background-color: #16baaa | ||||
| 	background-color: #1e9fff | ||||
| } | ||||
| 
 | ||||
| .layui-nav-tree .layui-nav-child { | ||||
| @ -5638,7 +5638,7 @@ body .layui-table-tips .layui-layer-content { | ||||
| } | ||||
| 
 | ||||
| .layui-tab-brief>.layui-tab-title .layui-this { | ||||
| 	color: #16baaa | ||||
| 	color: #1e9fff | ||||
| } | ||||
| 
 | ||||
| .layui-tab-brief>.layui-tab-more li.layui-this:after, | ||||
| @ -6665,7 +6665,7 @@ body .layui-util-face .layui-layer-content { | ||||
| } | ||||
| 
 | ||||
| .layui-slider-input-btn i:hover { | ||||
| 	color: #16baaa | ||||
| 	color: #1e9fff | ||||
| } | ||||
| 
 | ||||
| .layui-slider-vertical { | ||||
| @ -8022,7 +8022,7 @@ html #layuicss-laydate { | ||||
| 
 | ||||
| .laydate-theme-molv .layui-laydate-header { | ||||
| 	border: none; | ||||
| 	background-color: #16baaa | ||||
| 	background-color: #1e9fff | ||||
| } | ||||
| 
 | ||||
| .laydate-theme-molv .layui-laydate-header i, | ||||
| @ -8047,7 +8047,7 @@ html #layuicss-laydate { | ||||
| 
 | ||||
| .laydate-theme-molv .layui-this, | ||||
| .laydate-theme-molv .layui-this>div { | ||||
| 	background-color: #16baaa !important | ||||
| 	background-color: #1e9fff !important | ||||
| } | ||||
| 
 | ||||
| .laydate-theme-molv .layui-laydate-footer { | ||||
| @ -8064,7 +8064,7 @@ html #layuicss-laydate { | ||||
| .layui-laydate-linkage.laydate-theme-grid .laydate-selected, | ||||
| .layui-laydate-linkage.laydate-theme-grid .laydate-selected:hover { | ||||
| 	background-color: #f2f2f2 !important; | ||||
| 	color: #16baaa !important | ||||
| 	color: #1e9fff !important | ||||
| } | ||||
| 
 | ||||
| .layui-laydate-linkage.laydate-theme-grid .laydate-selected.laydate-day-next, | ||||
|  | ||||
| @ -1,4 +1,4 @@ | ||||
| <?php /*a:4:{s:49:"E:\Demo\PHP\yunzer\app\index\view\index\index.php";i:1746890051;s:54:"E:\Demo\PHP\yunzer\app\index\view\component\header.php";i:1747416219;s:52:"E:\Demo\PHP\yunzer\app\index\view\component\main.php";i:1747748380;s:54:"E:\Demo\PHP\yunzer\app\index\view\component\footer.php";i:1747649140;}*/ ?>
 | ||||
| <?php /*a:4:{s:49:"E:\Demo\PHP\yunzer\app\index\view\index\index.php";i:1746890051;s:54:"E:\Demo\PHP\yunzer\app\index\view\component\header.php";i:1748266393;s:52:"E:\Demo\PHP\yunzer\app\index\view\component\main.php";i:1747748380;s:54:"E:\Demo\PHP\yunzer\app\index\view\component\footer.php";i:1747649140;}*/ ?>
 | ||||
| <!DOCTYPE html> | ||||
| <html> | ||||
| 
 | ||||
| @ -16,7 +16,12 @@ | ||||
| </head> | ||||
| 
 | ||||
| <body> | ||||
|     <div style="display: flex;flex-direction: column;"> | ||||
|     <?php | ||||
| // 获取当前登录状态
 | ||||
| $isLoggedIn = session('user_id') ? true : false; | ||||
| ?>
 | ||||
| 
 | ||||
| <div style="display: flex;flex-direction: column;"> | ||||
|     <div class="topbar-one"> | ||||
|         <div class="container"> | ||||
|             <div style="width: 70%;"> | ||||
| @ -32,8 +37,6 @@ | ||||
|                 </ul> | ||||
|             </div> | ||||
|             <div class="topbar-one__social" style="width: 30%;"> | ||||
|                 <a href="/index/user/login" class="mr-10"><i class="layui-icon layui-icon-username"></i> 登录</a> | ||||
|                 <a href="/index/user/register" class="mr-10"><i class="layui-icon layui-icon-user"></i> 注册</a> | ||||
|                 <a href="javascript:;" class="qrcode-trigger"><i class="layui-icon layui-icon-qrcode"></i> 公众号</a> | ||||
|                 <div class="qrcode-popup" | ||||
|                     style="display:none;position:absolute;right:54px;top:32px;background:#fff;padding:10px;box-shadow:0 0 10px rgba(0,0,0,0.1); z-index: 1000;"> | ||||
| @ -58,6 +61,8 @@ | ||||
|             </div> | ||||
|             <div class="main-menu__right"> | ||||
|                 <div class="layui-inline"> | ||||
|                     <!-- 根据登录状态显示不同的内容 --> | ||||
|                     <?php if ($isLoggedIn): ?>
 | ||||
|                         <div class="layui-inline" style="position: relative;"> | ||||
|                             <img src="/static/images/avatar.webp" class="layui-circle" | ||||
|                                 style="width: 40px; height: 40px; cursor: pointer;" id="userAvatarMain"> | ||||
| @ -78,6 +83,12 @@ | ||||
|                                 </ul> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     <?php else: ?>
 | ||||
|                         <div class="layui-inline"> | ||||
|                             <a href="/index/user/login" class="layui-btn layui-btn-normal">登录</a> | ||||
|                             <a href="/index/user/register" class="layui-btn layui-btn-primary">注册</a> | ||||
|                         </div> | ||||
|                     <?php endif; ?>
 | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
| @ -108,6 +119,8 @@ | ||||
|         <div class="sticky-nav__right"> | ||||
|             <div class="main-menu__right"> | ||||
|                 <div class="layui-inline"> | ||||
|                     <!-- 根据登录状态显示不同的内容 --> | ||||
|                     <?php if ($isLoggedIn): ?>
 | ||||
|                         <div class="layui-inline" style="position: relative;"> | ||||
|                             <img src="/static/images/avatar.webp" class="layui-circle" | ||||
|                                 style="width: 40px; height: 40px; cursor: pointer;" id="userAvatarSticky"> | ||||
| @ -128,6 +141,12 @@ | ||||
|                                 </ul> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     <?php else: ?>
 | ||||
|                         <div class="layui-inline"> | ||||
|                             <a href="/index/user/login" class="layui-btn layui-btn-normal">登录</a> | ||||
|                             <a href="/index/user/register" class="layui-btn layui-btn-primary">注册</a> | ||||
|                         </div> | ||||
|                     <?php endif; ?>
 | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|  | ||||
| @ -1,4 +1,4 @@ | ||||
| <?php /*a:5:{s:49:"E:\Demo\PHP\yunzer\app\index\view\game\detail.php";i:1747757578;s:52:"E:\Demo\PHP\yunzer\app\index\view\component\head.php";i:1747649140;s:61:"E:\Demo\PHP\yunzer\app\index\view\component\header-simple.php";i:1747754938;s:54:"E:\Demo\PHP\yunzer\app\index\view\component\footer.php";i:1747649140;s:52:"E:\Demo\PHP\yunzer\app\index\view\component\foot.php";i:1746808046;}*/ ?>
 | ||||
| <?php /*a:5:{s:49:"E:\Demo\PHP\yunzer\app\index\view\game\detail.php";i:1748261449;s:52:"E:\Demo\PHP\yunzer\app\index\view\component\head.php";i:1747649140;s:61:"E:\Demo\PHP\yunzer\app\index\view\component\header-simple.php";i:1748261449;s:54:"E:\Demo\PHP\yunzer\app\index\view\component\footer.php";i:1747649140;s:52:"E:\Demo\PHP\yunzer\app\index\view\component\foot.php";i:1746808046;}*/ ?>
 | ||||
| <!DOCTYPE html> | ||||
| <html> | ||||
| 
 | ||||
| @ -48,7 +48,7 @@ | ||||
|     <div class="main-menu"> | ||||
|         <div class="container"> | ||||
|             <div class="main-menu__logo"> | ||||
|                 <a href="index.html"><img src="/static/images/logo1.png" width="186" alt="Logo"></a> | ||||
|                 <a href="/index.html"><img src="/static/images/logo1.png" width="186" alt="Logo"></a> | ||||
|             </div> | ||||
|             <div class="main-menu__nav"> | ||||
|                 <ul class="main-menu__list"> | ||||
| @ -90,7 +90,7 @@ | ||||
| <div class="sticky-nav" style="display: none;"> | ||||
|     <div class="container"> | ||||
|         <div class="sticky-nav__logo"> | ||||
|             <a href="index.html"><img src="/static/images/logo1.png" width="150" alt="Logo"></a> | ||||
|             <a href="/index.html"><img src="/static/images/logo1.png" width="150" alt="Logo"></a> | ||||
|         </div> | ||||
|         <div class="sticky-nav__menu"> | ||||
|             <ul> | ||||
| @ -446,6 +446,11 @@ | ||||
|     }); | ||||
| </script> | ||||
| <div class="main"> | ||||
|     <div class="main-top"> | ||||
|         <div class="main-top-main"> | ||||
|             <div class="main-title"> | ||||
|                 <?php echo $game['title']; ?>
 | ||||
|             </div> | ||||
|             <div class="location"> | ||||
|                 <div class="container"> | ||||
|                     <div class="location-item"> | ||||
| @ -455,23 +460,63 @@ | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
| 
 | ||||
|     <div class="detail-main"> | ||||
|         <div class="detail-top"> | ||||
|             <div class="detail-top-card"> | ||||
|                 <div class="detail-top-card-left"> | ||||
|                     <div class="article-cover"> | ||||
|                         <img src="<?php echo $game['icon'] ?: '/static/images/default-game.png'; ?>"> | ||||
|                         <!-- <img src="https://www.yunzer.cn/storage/uploads/20250523/b75a51fa606fd3a18261a6ea283d35fe.jpg" alt=""> --> | ||||
|                     </div> | ||||
|                 </div> | ||||
|                 <div class="detail-top-card-right"> | ||||
|                     <div class="detail-top-card-right-top"> | ||||
|                         <div class="collect-btn"> | ||||
|                             <button class="btn btn-primary" id="collectBtn" data-game-id="<?php echo $game['id']; ?>"> | ||||
|                                 <i class="fa-solid fa-heart"></i> 收藏 | ||||
|                             </button> | ||||
|                         </div> | ||||
|                         <div class="report-btn"> | ||||
|                             <button class="btn btn-primary" id="reportBtn" style="margin-left: 20px;"> | ||||
|                                 <i class="fa-solid fa-flag"></i> 举报 | ||||
|                             </button> | ||||
|                         </div> | ||||
|                     </div> | ||||
|                     <div class="detail-top-card-right-middle"> | ||||
|                         <div class="game-info"> | ||||
|                             <div class="title">Free</div> | ||||
|                             <div class="infos"> | ||||
|                                 <div class="infoitem"><span>更新时间:</span><?php echo date('Y-m-d', $game['create_time']); ?></div>
 | ||||
|                                 <div class="infoitem"><span>所属分类:</span><?php echo $cateName; ?></div>
 | ||||
|                                 <div class="infoitem"><span>程序编号:</span><?php echo $game['number']; ?></div>
 | ||||
|                                 <div class="infoitem"><span>查看:</span><?php echo $game['views']; ?></div>
 | ||||
|                                 <div class="infoitem"><span>下载:</span><?php echo $game['downloads']; ?></div>
 | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     </div> | ||||
|                     <div class="detail-top-card-right-bottom"> | ||||
|                         <div class="game-actions1"> | ||||
|                             <div style="display: flex;gap: 30px;}"> | ||||
|                                 <button id="downloadBtn" class="btn btn-primary"> | ||||
|                                     <i class="fa-solid fa-download"></i> 立即下载 | ||||
|                                 </button> | ||||
|                                 <button id="codeBtn" class="codebtn"> | ||||
|                                     <i class="fa-solid fa-download"></i> 分享码:<?php echo $game['code']; ?>
 | ||||
|                                 </button> | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     </div> | ||||
|                 </div> | ||||
|             </div> | ||||
|         </div> | ||||
|         <div class="detail-middle"> | ||||
|             <div class="detial-middle-left"> | ||||
|                 <div class="game-detail"> | ||||
|                     <div class="game-info"> | ||||
|             <div class="game-header"> | ||||
|                 <h1 class="game-title"><?php echo $game['title']; ?></h1>
 | ||||
|                 <div class="game-meta"> | ||||
|                     <span class="game-category"><?php echo $cateName; ?></span>
 | ||||
|                     <span class="game-views"><i class="fa-solid fa-eye"></i> <?php echo $game['views']; ?> </span>
 | ||||
|                     <span class="game-downloads"><i class="fa-solid fa-download"></i> <span | ||||
|                             id="gameDownloads"><?php echo $game['downloads']; ?></span> </span>
 | ||||
|                 </div> | ||||
|             </div> | ||||
|                         <div class="game-content"> | ||||
|                 <div class="game-cover"> | ||||
|                     <img src="<?php echo $game['icon'] ?: '/static/images/default-game.png'; ?>" | ||||
|                         alt="<?php echo $game['title']; ?>"> | ||||
|                 </div> | ||||
|                             <div class="game-desc"> | ||||
|                                 <?php echo $game['content']; ?>
 | ||||
|                             </div> | ||||
| @ -488,6 +533,15 @@ | ||||
|                         </div> | ||||
|                     </div> | ||||
| 
 | ||||
|                     <div class="disclaimers"> | ||||
|                         <div class="disclaimer-item"> | ||||
|                             <div class="disclaimer-title">免责声明:</div> | ||||
|                             <div class="disclaimer-content"> | ||||
|                                 <?php echo $config['disclaimers'] ?>
 | ||||
|                             </div> | ||||
|                         </div> | ||||
|                     </div> | ||||
| 
 | ||||
|                     <div class="game-navigation"> | ||||
|                         <div class="prev-game" id="prevGame"> | ||||
|                         </div> | ||||
| @ -516,6 +570,13 @@ | ||||
|                         </div> | ||||
|                     <?php endif; ?>
 | ||||
|                 </div> | ||||
|             </div> | ||||
|             <div class="detial-middle-right"> | ||||
| 
 | ||||
|             </div> | ||||
|         </div> | ||||
|     </div> | ||||
| 
 | ||||
| </div> | ||||
| 
 | ||||
| <!-- 返回顶部按钮 --> | ||||
| @ -582,7 +643,7 @@ | ||||
| 
 | ||||
| <script> | ||||
|     // 页面加载完成后执行
 | ||||
|     document.addEventListener('DOMContentLoaded', function () { | ||||
|     document.addEventListener('DOMContentLoaded', function() { | ||||
|         // 获取游戏ID
 | ||||
|         const gameId = new URLSearchParams(window.location.search).get('id'); | ||||
|         if (!gameId) { | ||||
| @ -634,19 +695,26 @@ | ||||
|         // 下载功能
 | ||||
|         const downloadBtn = document.getElementById('downloadBtn'); | ||||
|         if (downloadBtn) { | ||||
|             downloadBtn.addEventListener('click', function () { | ||||
|             downloadBtn.addEventListener('click', function() { | ||||
|                 fetch('/index/game/downloadurl?id=' + gameId, { | ||||
|                         method: 'GET', | ||||
|                         headers: { | ||||
|                             'X-Requested-With': 'XMLHttpRequest' | ||||
|                         } | ||||
|                     }) | ||||
|                     .then(response => response.json()) | ||||
|                     .then(response => { | ||||
|                         if (!response.ok) { | ||||
|                             throw new Error('网络响应失败'); | ||||
|                         } | ||||
|                         return response.json(); | ||||
|                     }) | ||||
|                     .then(data => { | ||||
|                         if (data.code === 1) { | ||||
|                             const downloadsElement = document.getElementById('gameDownloads'); | ||||
|                             if (downloadsElement) { | ||||
|                                 let downloads = parseInt(downloadsElement.textContent); | ||||
|                                 downloadsElement.textContent = downloads + 1; | ||||
|                             } | ||||
| 
 | ||||
|                             // 直接使用返回的URL
 | ||||
|                             if (data.data && data.data.url) { | ||||
| @ -698,7 +766,7 @@ | ||||
|         const goToTop = document.getElementById('goToTop'); | ||||
| 
 | ||||
|         // 监听滚动事件
 | ||||
|         window.addEventListener('scroll', function () { | ||||
|         window.addEventListener('scroll', function() { | ||||
|             if (window.pageYOffset > 300) { | ||||
|                 goToTop.classList.add('show'); | ||||
|             } else { | ||||
| @ -707,7 +775,7 @@ | ||||
|         }); | ||||
| 
 | ||||
|         // 点击返回顶部
 | ||||
|         goToTop.addEventListener('click', function () { | ||||
|         goToTop.addEventListener('click', function() { | ||||
|             window.scrollTo({ | ||||
|                 top: 0, | ||||
|                 behavior: 'smooth' | ||||
| @ -741,14 +809,137 @@ | ||||
| </script> | ||||
| 
 | ||||
| <style> | ||||
|     .location { | ||||
|     .main-top { | ||||
|         width: 100%; | ||||
|         height: 400px; | ||||
|         background-color: #0081ff;
 | ||||
|         /* background: url('/static/images/top-bg.jpg') no-repeat center center; */ | ||||
|         position: relative; | ||||
|     } | ||||
| 
 | ||||
|     .main-top-card { | ||||
|         max-width: 1400px; | ||||
|         margin: 0 auto; | ||||
|         margin-top: 30px; | ||||
|         border-radius: 8px; | ||||
|         background-color: #fff;
 | ||||
|         height: 300px; | ||||
|     } | ||||
| 
 | ||||
|     .main-top-main { | ||||
|         max-width: 1400px; | ||||
|         margin: 0 auto; | ||||
|         padding-top: 50px; | ||||
|         display: flex; | ||||
|         justify-content: space-between; | ||||
|         position: absolute; | ||||
|         top: 0; | ||||
|         left: 50%; | ||||
|         transform: translateX(-50%); | ||||
|         width: 100%; | ||||
|         z-index: 1; | ||||
|     } | ||||
| 
 | ||||
|     .main-top-main .main-title { | ||||
|         font-size: 30px; | ||||
|         font-weight: 700; | ||||
|         max-width: 1000px; | ||||
|         color: #fff;
 | ||||
|     } | ||||
| 
 | ||||
|     .detail-top { | ||||
|         max-width: 1400px; | ||||
|         /* height: 300px; */ | ||||
|         margin: 30px auto; | ||||
|         position: relative; | ||||
|         background-color: #fff;
 | ||||
|         border-radius: 8px; | ||||
|         box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); | ||||
|         display: flex; | ||||
|     } | ||||
| 
 | ||||
|     .detail-top-card { | ||||
|         width: 100%; | ||||
|         display: flex; | ||||
|         justify-content: space-between; | ||||
|         align-items: center; | ||||
|         padding: 20px; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     .detail-top-card img { | ||||
|         width: 400px; | ||||
|         height: auto; | ||||
|         border-radius: 8px; | ||||
|         overflow: hidden; | ||||
|     } | ||||
| 
 | ||||
|     .detail-top-card-right { | ||||
|         /* height: 230px; */ | ||||
|         display: flex; | ||||
|         width: 100%; | ||||
|         margin-left: 20px; | ||||
|         flex-direction: column; | ||||
|     } | ||||
| 
 | ||||
|     .detail-top-card-right-top { | ||||
|         display: flex; | ||||
|         justify-content: flex-end; | ||||
|         align-items: center; | ||||
|     } | ||||
| 
 | ||||
|     .detail-top-card-right-middle {} | ||||
| 
 | ||||
|     .detail-top-card-right-middle .game-info { | ||||
|         display: flex; | ||||
|         flex-direction: column; | ||||
|         justify-content: space-between; | ||||
|         height: 100%; | ||||
|     } | ||||
| 
 | ||||
|     .detail-top-card-right-middle .game-info .title { | ||||
|         font-size: 40px; | ||||
|         font-weight: 700; | ||||
|         color: #42d697;
 | ||||
|         margin-bottom: 15px; | ||||
|     } | ||||
| 
 | ||||
|     .detail-top-card-right-middle .game-info .infos { | ||||
|         display: flex; | ||||
|     } | ||||
| 
 | ||||
|     .detail-top-card-right-middle .game-info .infos .infoitem { | ||||
|         margin-right: 60px; | ||||
|     } | ||||
| 
 | ||||
|     .detail-top-card-right-middle .game-info .infos .infoitem span { | ||||
|         color: #7d879c;
 | ||||
|     } | ||||
| 
 | ||||
|     .detail-middle { | ||||
|         max-width: 1400px; | ||||
|         margin: 0 auto; | ||||
|     } | ||||
| 
 | ||||
|     .detail-main { | ||||
|         position: relative; | ||||
|         top: -200px; | ||||
|         left: 0; | ||||
|         width: 100%; | ||||
|         z-index: 2; | ||||
|     } | ||||
| 
 | ||||
|     .location { | ||||
|         color: #fff;
 | ||||
|         display: flex; | ||||
|         align-items: center; | ||||
|     } | ||||
| 
 | ||||
|     .location a { | ||||
|         color: #fff !important;
 | ||||
|     } | ||||
| 
 | ||||
|     .game-detail { | ||||
|         max-width: 1000px; | ||||
|         margin: 30px auto; | ||||
|         padding: 50px; | ||||
|         background: #fff;
 | ||||
|         box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1); | ||||
| @ -834,6 +1025,11 @@ | ||||
|         border-bottom: 1px solid #eee;
 | ||||
|     } | ||||
| 
 | ||||
|     .game-actions1 { | ||||
|         display: flex; | ||||
|         margin: 20px 0; | ||||
|     } | ||||
| 
 | ||||
|     .game-navigation { | ||||
|         display: flex; | ||||
|         justify-content: space-between; | ||||
| @ -860,7 +1056,7 @@ | ||||
|     .btn { | ||||
|         /* background: #f57005; */ | ||||
|         color: #fff;
 | ||||
|         padding: 15px 30px; | ||||
|         padding: 5px 15px; | ||||
|         border-radius: 8px; | ||||
|         cursor: pointer; | ||||
|         transition: all 0.3s ease; | ||||
| @ -871,8 +1067,8 @@ | ||||
|         transform: translateY(-2px); | ||||
|     } | ||||
| 
 | ||||
|     .codebtn{ | ||||
|         color:#0d6efd;
 | ||||
|     .codebtn { | ||||
|         color: #0d6efd;
 | ||||
|         padding: 15px 30px; | ||||
|         border-radius: 8px; | ||||
|         border: 1px solid #0d6efd;
 | ||||
| @ -889,7 +1085,7 @@ | ||||
|         margin: 40px 0; | ||||
|     } | ||||
| 
 | ||||
|     .related-games h3{ | ||||
|     .related-games h3 { | ||||
|         font-size: 20px; | ||||
|         font-weight: 600; | ||||
|         margin-bottom: 20px; | ||||
| @ -988,8 +1184,26 @@ | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     .location-item a { | ||||
|         color: #000 !important;
 | ||||
|     .disclaimers { | ||||
|         color: #b1b1b1;
 | ||||
|         width: 80%; | ||||
|         margin: 20px auto; | ||||
|         margin-bottom: 60px; | ||||
|     } | ||||
| 
 | ||||
|     .disclaimer-title { | ||||
|         font-size: 16px; | ||||
|         font-weight: 600; | ||||
|         margin-bottom: 10px; | ||||
|     } | ||||
| 
 | ||||
|     .disclaimer-content { | ||||
|         font-size: 14px; | ||||
|         line-height: 1.6; | ||||
|     } | ||||
| 
 | ||||
|     .disclaimer-content p { | ||||
|         margin-bottom: 0; | ||||
|     } | ||||
| </style> | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 云泽网
						云泽网