亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Thinkphp自定義美化success和error提示跳轉(zhuǎn)頁(yè)面代碼實(shí)例

 更新時(shí)間:2021年03月05日 16:11:10   投稿:newname  
這篇文章主要介紹了Thinkphp自定義美化success和error提示跳轉(zhuǎn)頁(yè)面代碼實(shí)例,有需要的同學(xué)可以直接借鑒文中代碼,可以增加頁(yè)面的美觀和友好程度

先貼效果圖:

優(yōu)點(diǎn):圖標(biāo)是有動(dòng)畫效果的,不需要背景圖片。 

1、需要引用一個(gè)dialog.css,代碼如下: 

/* ===========================================
 @des:     dialog.less
 @author:   美奇軟件開發(fā)工作室
 @QQ:     15577969
 @贊助平臺(tái):  元寶支付(18pay.net)
 @time:    2021-01-10
 =============================================*/
 
@charset "utf-8";
.clearfix {
 *zoom: 1;
}
.clearfix:after {
 visibility: hidden;
 display: block;
 font-size: 0;
 content: " ";
 clear: both;
 height: 0;
}
* {
 margin: 0;
 padding: 0;
}
ul,
ol {
 list-style: none;
}
img {
 border: none;
}
input,
select,
textarea {
 outline: none;
 border: none;
 background: none;
}
textarea {
 resize: none;
}
a {
 text-decoration: none;
}
.body {
 font-family: 14px "Microsoft Yahei", "微軟雅黑", Arial, Tahoma;
}
.btn-container {
 width: 100%;
 display: flex;
 display: -webkit-flex;
 display: -moz-flex;
 justify-content: space-around;
 -webkit-justify-content: space-around;
 -moz-justify-content: space-around;
}
.btn-container input[type='button'] {
 width: 20%;
 padding: 0.357rem;
 color: #fff;
 border-radius: 3px;
 -webkit-radius: 3px;
 -moz-radius: 3px;
 background-color: #3B9DFF;
}
.btn-container input[type='button']:active {
 background-color: #1966b3;
}
/*重置盒模型 */
.boxContent * {
 box-sizing: content-box;
 -webkit-box-sizing: content-box;
 -moz-box-sizing: content-box;
}
/*animation start*/
#animationTipBox {
 width: 100%;
 height: auto;
 background-color: #fff;
 border-radius: 8px;
 -webkit-border-radius: 8px;
 -moz-border-radius: 8px;
 position: fixed;
 left: 50%;
 top: 30%;
 margin-left: -50%;
 margin-top: -75px;
 z-index: 1001;
 -webkit-animation: alertAnimation 0.3s ease-in-out 0s 1;
 -moz-animation: alertAnimation 0.3s ease-in-out 0s 1;
 animation: alertAnimation 0.3s ease-in-out 0s 1;
}
#animationTipBox * {
 box-sizing: content-box;
 -webkit-box-sizing: content-box;
 -moz-box-sizing: content-box;
}
#animationTipBox .icon {
 position: relative;
 width: 80px;
 height: 80px;
 border-radius: 50px;
 -webkit-border-radius: 50px;
 -moz-border-radius: 50px;
 border: 4px solid #66cc33;
 margin: 15px auto 5px auto;
}
#animationTipBox .icon_box {
 width: 80px;
 height: 80px;
 margin: 0 auto;
 text-align: center;
 position: relative;
}
#animationTipBox .lose .icon {
 border-color: #FF9090;
}
#animationTipBox .lose .icon_box {
 -webkit-animation: lose_Animation 0.5s ease 0s 1;
 -moz-animation: lose_Animation 0.5s ease 0s 1;
 animation: lose_Animation 0.5s ease 0s 1;
}
#animationTipBox .dec_txt {
 font-size: 16px;
 text-align: center;
 color: #666;
 line-height: 26px;
 height: 26px;
 padding: 5px 0 10px 0;
}
.tip .icon {
 width: 80px;
 height: 80px;
 background-color: #66cc33;
 border-radius: 100%;
 -webkit-border-radius: 100%;
 -moz-border-radius: 100%;
 color: #fff;
 font-size: 80px;
 text-align: center;
 line-height: 80px;
}
.success .line_short {
 width: 25px;
 height: 5px;
 position: absolute;
 left: 14px;
 top: 46px;
 border-radius: 4px;
 -webkit-border-radius: 4px;
 -moz-border-radius: 4px;
 background-color: #66cc33;
 transform: rotate(45deg);
 -webkit-transform: rotate(45deg);
 -moz-transform: rotate(45deg);
 -webkit-animation: success_short_Animation 0.65s ease 0s 1;
 -moz-animation: success_short_Animation 0.65s ease 0s 1;
 animation: success_short_Animation 0.65s ease 0s 1;
}
.success .line_long {
 width: 47px;
 height: 5px;
 position: absolute;
 right: 8px;
 top: 38px;
 border-radius: 4px;
 -webkit-border-radius: 4px;
 -moz-border-radius: 4px;
 background-color: #66cc33;
 transform: rotate(-45deg);
 -webkit-transform: rotate(-45deg);
 -moz-transform: rotate(-45deg);
 -webkit-animation: success_long_Animation 0.65s ease 0s 1;
 -moz-animation: success_long_Animation 0.65s ease 0s 1;
 animation: success_long_Animation 0.65s ease 0s 1;
}
.lose .line_left,
.lose .line_right {
 width: 47px;
 height: 5px;
 position: absolute;
 left: 17px;
 top: 37px;
 border-radius: 4px;
 -webkit-border-radius: 4px;
 -moz-border-radius: 4px;
 background-color: #FF9090;
 transform: rotate(45deg);
 -webkit-transform: rotate(45deg);
 -moz-transform: rotate(45deg);
}
.lose .line_right {
 right: 11px;
 top: 37px;
 transform: rotate(-45deg);
 -webkit-transform: rotate(-45deg);
 -moz-transform: rotate(-45deg);
}
/* 總體動(dòng)畫 函數(shù) */
/*all animate*/
@-webkit-keyframes alertAnimation {
 0% {
  -webkit-transform: scale(0.5);
 }
 45% {
  -webkit-transform: scale(1.25);
 }
 80% {
  -webkit-transform: scale(0.95);
 }
 100% {
  -webkit-transform: scale(1);
 }
}
@-moz-keyframes alertAnimation {
 0% {
  -webkit-transform: scale(0.5);
 }
 45% {
  -webkit-transform: scale(1.25);
 }
 80% {
  -webkit-transform: scale(0.95);
 }
 100% {
  -webkit-transform: scale(1);
 }
}
@-webkit-keyframes alertAnimation {
 0% {
  -webkit-transform: scale(0.5);
 }
 45% {
  -webkit-transform: scale(1.25);
 }
 80% {
  -webkit-transform: scale(0.95);
 }
 100% {
  -webkit-transform: scale(1);
 }
}
/*all animate*/
/*success short animate*/
@-webkit-keyframes success_short_Animation {
 0% {
  width: 0;
  left: 1px;
  top: 19px;
 }
 54% {
  width: 0;
  left: 1px;
  top: 19px;
 }
 70% {
  width: 50px;
  left: -4px;
  top: 37px;
 }
 84% {
  width: 17px;
  left: 21px;
  top: 48px;
 }
 100% {
  width: 25px;
  left: 14px;
  top: 45px;
 }
}
@-moz-keyframes success_short_Animation {
 0% {
  width: 0;
  left: 1px;
  top: 19px;
 }
 54% {
  width: 0;
  left: 1px;
  top: 19px;
 }
 70% {
  width: 50px;
  left: -4px;
  top: 37px;
 }
 84% {
  width: 17px;
  left: 21px;
  top: 48px;
 }
 100% {
  width: 25px;
  left: 14px;
  top: 45px;
 }
}
@-webkit-keyframes success_short_Animation {
 0% {
  width: 0;
  left: 1px;
  top: 19px;
 }
 54% {
  width: 0;
  left: 1px;
  top: 19px;
 }
 70% {
  width: 50px;
  left: -4px;
  top: 37px;
 }
 84% {
  width: 17px;
  left: 21px;
  top: 48px;
 }
 100% {
  width: 25px;
  left: 14px;
  top: 45px;
 }
}
/*success short animate*/
/*success long animate*/
@-webkit-keyframes success_long_Animation {
 0% {
  width: 0;
  right: 46px;
  top: 54px;
 }
 65% {
  width: 0;
  right: 46px;
  top: 54px;
 }
 84% {
  width: 55px;
  right: 0px;
  top: 35px;
 }
 100% {
  width: 47px;
  right: 8px;
  top: 38px;
 }
}
@-moz-keyframes success_long_Animation {
 0% {
  width: 0;
  right: 46px;
  top: 54px;
 }
 65% {
  width: 0;
  right: 46px;
  top: 54px;
 }
 84% {
  width: 55px;
  right: 0px;
  top: 35px;
 }
 100% {
  width: 47px;
  right: 8px;
  top: 38px;
 }
}
@-webkit-keyframes success_long_Animation {
 0% {
  width: 0;
  right: 46px;
  top: 54px;
 }
 65% {
  width: 0;
  right: 46px;
  top: 54px;
 }
 84% {
  width: 55px;
  right: 0px;
  top: 35px;
 }
 100% {
  width: 47px;
  right: 8px;
  top: 38px;
 }
}
/*success long animate*/
/*load_Animation*/
@-webkit-keyframes load_Animation {
 0% {
  -webkit-transform: scale(0.6);
  opacity: 0.2;
 }
 50% {
  -webkit-transform: scale(0.6);
  opacity: 0.5;
 }
 80% {
  -webkit-transform: scale(1.15);
  opacity: 0.8;
 }
 100% {
  -webkit-transform: scale(1);
  opacity: 1.0;
 }
}
@-moz-keyframes load_Animation {
 0% {
  -webkit-transform: scale(0.6);
  opacity: 0.2;
 }
 50% {
  -webkit-transform: scale(0.6);
  opacity: 0.5;
 }
 80% {
  -webkit-transform: scale(1.15);
  opacity: 0.8;
 }
 100% {
  -webkit-transform: scale(1);
  opacity: 1.0;
 }
}
@-webkit-keyframes load_Animation {
 0% {
  -webkit-transform: scale(0.6);
  opacity: 0.2;
 }
 50% {
  -webkit-transform: scale(0.6);
  opacity: 0.5;
 }
 80% {
  -webkit-transform: scale(1.15);
  opacity: 0.8;
 }
 100% {
  -webkit-transform: scale(1);
  opacity: 1.0;
 }
}
/*load_Animation*/
/*lose_Animation*/
@-webkit-keyframes lose_Animation {
 0% {
  -webkit-transform: scale(0.6);
  opacity: 0.2;
 }
 50% {
  -webkit-transform: scale(0.6);
  opacity: 0.5;
 }
 80% {
  -webkit-transform: scale(1.15);
  opacity: 0.8;
 }
 100% {
  -webkit-transform: scale(1);
  opacity: 1.0;
 }
}
@-moz-keyframes lose_Animation {
 0% {
  -webkit-transform: scale(0.6);
  opacity: 0.2;
 }
 50% {
  -webkit-transform: scale(0.6);
  opacity: 0.5;
 }
 80% {
  -webkit-transform: scale(1.15);
  opacity: 0.8;
 }
 100% {
  -webkit-transform: scale(1);
  opacity: 1.0;
 }
}
@-webkit-keyframes lose_Animation {
 0% {
  -webkit-transform: scale(0.6);
  opacity: 0.2;
 }
 50% {
  -webkit-transform: scale(0.6);
  opacity: 0.5;
 }
 80% {
  -webkit-transform: scale(1.15);
  opacity: 0.8;
 }
 100% {
  -webkit-transform: scale(1);
  opacity: 1.0;
 }
}
/*lose_Animation*/
.load {
 position: relative;
 width: 60px;
 height: 80px;
 border-radius: 50px;
 -webkit-border-radius: 50px;
 -moz-border-radius: 50px;
 border: 4px solid #fff;
 margin: 15px auto 5px auto;
 top: 10px;
}
.load .icon_box {
 margin: 10px auto;
 width: 60px;
 height: 60px;
}
.load .cirBox1,
.load .cirBox2,
.load .cirBox3 {
 width: 60px;
 height: 60px;
 position: absolute;
 left: 0;
 top: 0;
}
.load .cirBox1 > div,
.load .cirBox2 > div,
.load .cirBox3 > div {
 width: 10px;
 height: 10px;
 border-radius: 100%;
 -webkit-border-radius: 100%;
 -moz-border-radius: 100%;
 background-color: #ccc;
 position: absolute;
}
.load .cirBox1 {
 transform: rotate(30deg);
 -webkit-transform: rotate(30deg);
 -moz-transform: rotate(30deg);
}
.load .cirBox2 {
 transform: rotate(60deg);
 -webkit-transform: rotate(60deg);
 -moz-transform: rotate(60deg);
}
.load .cirBox3 {
 transform: rotate(90deg);
 -webkit-transform: rotate(90deg);
 -moz-transform: rotate(90deg);
}
.load .cir1 {
 left: 0;
 top: 0;
}
.load .cir2 {
 right: 0;
 top: 0;
}
.load .cir3 {
 right: 0;
 bottom: 0;
}
.load .cir4 {
 left: 0;
 bottom: 0;
}
.load .cir1,
.load .cir2,
.load .cir3,
.load .cir4 {
 -webkit-animation: cir_Animation 1.2s ease 0s infinite;
 -moz-animation: cir_Animation 1.2s ease 0s infinite;
 animation: cir_Animation 1.2s ease 0s infinite;
}
.cirBox1 .cir2 {
 -webkit-animation-delay: -1.1s;
 -moz-animation-delay: -1.1s;
 animation-delay: -1.1s;
}
.cirBox1 .cir3 {
 -webkit-animation-delay: -0.8s;
 -moz-animation-delay: -0.8s;
 animation-delay: -0.8s;
}
.cirBox1 .cir4 {
 -webkit-animation-delay: -0.5s;
 -moz-animation-delay: -0.5s;
 animation-delay: -0.5s;
}
.cirBox2 .cir2 {
 -webkit-animation-delay: -1s;
 -moz-animation-delay: -1s;
 animation-delay: -1s;
}
.cirBox2 .cir3 {
 -webkit-animation-delay: -0.7s;
 -moz-animation-delay: -0.7s;
 animation-delay: -0.7s;
}
.cirBox2 .cir4 {
 -webkit-animation-delay: -0.4s;
 -moz-animation-delay: -0.4s;
 animation-delay: -0.4s;
}
.cirBox3 .cir2 {
 -webkit-animation-delay: -0.9s;
 -moz-animation-delay: -0.9s;
 animation-delay: -0.9s;
}
.cirBox3 .cir3 {
 -webkit-animation-delay: -0.6s;
 -moz-animation-delay: -0.6s;
 animation-delay: -0.6s;
}
.cirBox3 .cir4 {
 -webkit-animation-delay: -0.3s;
 -moz-animation-delay: -0.3s;
 animation-delay: -0.3s;
}
@-webkit-keyframes cir_Animation {
 0%,
 80%,
 100% {
  -webkit-transform: scale(0.4);
 }
 40% {
  -webkit-transform: scale(1);
 }
}
@-moz-keyframes cir_Animation {
 0%,
 80%,
 100% {
  -webkit-transform: scale(0.4);
 }
 40% {
  -webkit-transform: scale(1);
 }
}
@-webkit-keyframes cir_Animation {
 0%,
 80%,
 100% {
  -webkit-transform: scale(0.4);
 }
 40% {
  -webkit-transform: scale(1);
 }
}
.mask {
 width: 100%;
 height: 100%;
 background-color: #000;
 opacity: .8;
 position: fixed;
 left: 0;
 top: 0;
 z-index: 1000;
}

2、修改application/config.php里,默認(rèn)跳轉(zhuǎn)頁(yè)面對(duì)應(yīng)的模板文件

// 視圖輸出字符串內(nèi)容替換
'view_replace_str'    => ['__STATIC__'=>'/static'],
// 默認(rèn)跳轉(zhuǎn)頁(yè)面對(duì)應(yīng)的模板文件
//'dispatch_success_tmpl' => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',
//'dispatch_error_tmpl'  => THINK_PATH . 'tpl' . DS . 'dispatch_jump.tpl',
'dispatch_success_tmpl' => THINK_PATH . 'tpl' . DS .'default_jump.tpl',
'dispatch_error_tmpl'  => THINK_PATH . 'tpl' . DS .'default_jump.tpl',

3、在thinkphp/tpl目錄下新建一個(gè)default_jump.tpl,代碼如下:

{__NOLAYOUT__}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
  <title>跳轉(zhuǎn)提示</title>
	<!--引入dialog.css樣式-->
  <link rel="stylesheet" href="__STATIC__/css/dialog.css" rel="external nofollow" >
  <style type="text/css">
		.system-message p{ text-align: center;}
		.system-message .jump{ padding-top: 10px}
		.system-message .jump a{ color: #333;}
		.system-message .jump-btn{margin-top: 40px}
		.system-message .jump-btn a{font-size: 16px;color: #fff;border-radius: 4px;background-color: #0d65a3;padding: 6px 16px;text-decoration: none;}
	</style>
</head>
<body>
  <div class="system-message">
		<div id='animationTipBox'>
    <?php switch ($code) {?>
      <?php case 1:?>
			<!--成功-->     
				<div class='success'>
				  <div class='icon'>
					  <div class='icon_box'>
						  <div class='line_short'></div>
						  <div class='line_long'></div>
					  </div>
				  </div>
					<div class='dec_txt'><?php echo(strip_tags($msg));?></div>					
				</div>
      <?php break;?>
      <?php case 0:?>
			<!--錯(cuò)誤-->
				<div class='lose'>
				  <div class='icon'>
					  <div class='icon_box'>
						  <div class='line_left'></div>
						  <div class='line_right'></div>
					  </div>
				  </div>
					<div class='dec_txt'><?php echo(strip_tags($msg));?></div>					
				</div>							
      <?php break;?>
    <?php } ?>
			<p class="jump">
				頁(yè)面自動(dòng)<a id="href" href="<?php echo($url);?>" rel="external nofollow" >跳轉(zhuǎn)</a> 等待時(shí)間: <b id="wait"><?php echo($wait);?></b>
			</p>
			<p class="jump-btn"><a id="href" href="<?php echo($url); ?>" rel="external nofollow" >點(diǎn)擊跳轉(zhuǎn)</a></p>
		</div>		
  </div>
  <script type="text/javascript">
    (function(){
      var wait = document.getElementById('wait'),
        href = document.getElementById('href').href;
      var interval = setInterval(function(){
        var time = --wait.innerHTML;
        if(time <= 0) {
          location.href = href;
          clearInterval(interval);
        };
      }, 1000);
    })();
  </script>
</body>
</html>

注意:dialog.css的路徑要根據(jù)你自己的網(wǎng)站來寫

到此這篇關(guān)于Thinkphp自定義美化success和error提示跳轉(zhuǎn)頁(yè)面代碼實(shí)例的文章就介紹到這了,更多相關(guān)Thinkphp自定義美化success和error提示跳轉(zhuǎn)頁(yè)面內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • PHP模板引擎Smarty內(nèi)建函數(shù)詳解

    PHP模板引擎Smarty內(nèi)建函數(shù)詳解

    這篇文章主要介紹了PHP模板引擎Smarty內(nèi)建函數(shù)用法,結(jié)合實(shí)例形式分析了smarty中常見的內(nèi)建函數(shù)功能,定義與使用方法,需要的朋友可以參考下
    2016-04-04
  • Laravel異常上下文解決方案分享

    Laravel異常上下文解決方案分享

    異常處理是編程中十分重要但也最容易被人忽視的語言特性,下面這篇文章主要給大家介紹了關(guān)于Laravel異常上下文解決方案的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2022-01-01
  • PHP中的empty、isset、isnull的區(qū)別與使用實(shí)例

    PHP中的empty、isset、isnull的區(qū)別與使用實(shí)例

    今天小編就為大家分享一篇關(guān)于PHP中的empty、isset、isnull的區(qū)別與使用實(shí)例,小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧
    2019-03-03
  • 深入探討:Nginx 502 Bad Gateway錯(cuò)誤的解決方法

    深入探討:Nginx 502 Bad Gateway錯(cuò)誤的解決方法

    本篇文章是對(duì)Nginx 502 Bad Gateway錯(cuò)誤的解決方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下
    2013-06-06
  • PHP中的日期時(shí)間處理利器實(shí)例(Carbon)

    PHP中的日期時(shí)間處理利器實(shí)例(Carbon)

    本篇文章主要介紹了PHP中的日期時(shí)間處理利器實(shí)例(Carbon),具有一定的參考價(jià)值,有興趣的可以了解一下
    2017-06-06
  • Laravel 4 初級(jí)教程之安裝及入門

    Laravel 4 初級(jí)教程之安裝及入門

    本文不推薦完全不懂PHP與MVC編程的人學(xué)習(xí)。本文不是 “一步一步跟我做” 教程。本文需要你付出一定的心智去解決一些或大或小的隱藏任務(wù),以達(dá)到真正理解 Laravel 運(yùn)行邏輯的目的。
    2014-10-10
  • Zend Studio 無法啟動(dòng)的問題解決方法

    Zend Studio 無法啟動(dòng)的問題解決方法

    今天 Zend Studio 突然無法啟動(dòng)了,Google 了一下,仍舊無解。
    2008-12-12
  • thinkPHP5框架導(dǎo)出Excel文件簡(jiǎn)單操作示例

    thinkPHP5框架導(dǎo)出Excel文件簡(jiǎn)單操作示例

    這篇文章主要介紹了thinkPHP5框架導(dǎo)出Excel文件簡(jiǎn)單操作,結(jié)合實(shí)例形式分析了thinkPHP5框架安裝及使用PHPExcel插件實(shí)現(xiàn)導(dǎo)出Excel格式文件的相關(guān)操作技巧,需要的朋友可以參考下
    2018-08-08
  • php對(duì)稱加密算法示例

    php對(duì)稱加密算法示例

    這篇文章主要介紹了php對(duì)稱加密算法示例,需要的朋友可以參考下
    2014-05-05
  • Laravel中表單size驗(yàn)證數(shù)字示例詳解

    Laravel中表單size驗(yàn)證數(shù)字示例詳解

    Laravel 的驗(yàn)證功能非常強(qiáng)大,基本上常見的需求都有對(duì)應(yīng)的驗(yàn)證規(guī)則,下面這篇文章主要給大家介紹了關(guān)于Laravel中表單size驗(yàn)證數(shù)字的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2018-07-07

最新評(píng)論