Python程序设计之Django项目实战(1)

1.登录界面

在这里插入图片描述
在这里插入图片描述

2.代码分析

(1)py代码部分

①创建django程序命令(在命令行):django-admin startproject D
②在文件夹下创建第一个应用程序app01
③在app01下创建view,py

#登录
def login(request):
    ret = {
   "status": False, "error": {
   "user_error": "", "pwd_error": "", "login_error": ""},'message':None}
    user = request.POST['username']
    password = request.POST['password']
    yzm=request.POST["check_code"]
    error=""
    if yzm.upper()==request.session.get('valid_code').upper():
        try:
            result = User.objects.get(username=user, password=password)
            if not result:
                return HttpResponseRedirect('/registerView/')
            else:
                request.session['user'] = user
                return HttpResponseRedirect('/index1/')
        except Exception as e:
            # request.session["message"] = "账户不存在或者密码错误!"
            # return HttpResponseRedirect('/index/')
            error = "账户不存在或者密码错误!"
            return render(request, 'app01/login.html', {
   'message': error})
    else:
        error="验证码错误!"
        return render(request, 'app01/login.html', {
   'message': error})

④创建model.py

from django.db import models

# Create your models here.
class User(models.Model):
    username = models.CharField(max_length=50,unique=True)
    email = models.CharField(max_length=60)
    password = models.CharField(max_length=20)
    sex = models.CharField(max_length=50)
    statue = models.CharField(max_length=50)
    state = models.CharField(max_length=50)

    def __str__(self):
        print(self.username,end='\n')
        print(self.password,end='\n')
        print(self.email,end='\n')
        print(self.sex,end='\n')
        print(self.state,end='\n')
        print(self.statue,end='\n')

⑤创建myform.py

from django import forms
#from captcha.fields import CaptchaField

class User(forms.Form):
    username = forms.CharField(max_length=50)
    email = forms.CharField(max_length=60)
    password = forms.CharField(max_length=20)
    sex = forms.CharField(max_length=50)
    statue = forms.CharField(max_length=50)
    state = forms.CharField(max_length=50)

    """captcha=CaptchaField(
        label="验证码",
        required=True,
        error_messages={
            'required':'验证码不能为空'
        }
    )"""

⑥创建apps.py

from django.apps import AppConfig


class App01Config(AppConfig):
    name = 'app01'

⑦创建文件夹migrations,并创建initional.py(用于执行数据库的创建)

from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(max_length=50,unique=True)),
                ('email', models.CharField(max_length=60)),
                ('password', models.CharField(max_length=20)),
                ('sex', models.CharField(max_length=50)),
                ('statue', models.CharField(max_length=50)),
                ('state', models.CharField(max_length=50)),

            ],
        ),
    ]

⑧在创建项目D下的自动创建的文件夹下的setting.py


import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'k6sdscdlqs26w(-@x+dp@jeubose0(=l-^k^8-bnv0qzce-#1w'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ["192.168.8.148","127.0.0.1"]


# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'app01.apps.App01Config',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'login.urls'

TEMPLATES = [
    {
   
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')]
        ,
        'APP_DIRS': True,
        'OPTIONS': {
   
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'login.wsgi.application'


# Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
"""
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}"""
DATABASES = {
   
    'default': {
   
        'ENGINE': 'django.db.backends.mysql',
        'NAME':'db_django',
        #'NAME': os.path.join(BASE_DIR, './db_django/db_use'),
        'USER': 'root',
        'PASSWORD': 'root',
        'HOST': 'localhost',
        'PORT': '3306',
    }
}

# Password validation
# https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
   
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
   
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
   
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
   
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/

STATIC_URL = '/static/'
# 开发阶段放置项目自己的静态文件
STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'statics'),
)
# 执行collectstatic命令后会将项目中的静态文件收集到该目录下面来(所以不应该在该目录下面放置自己的一些静态文件,因为会覆盖掉)
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

⑨url.py


from django.contrib import admin
from django.urls import path,include
from app01 import views

urlpatterns = [
    #path('admin/', admin.site.urls),
    path('index/', views.index,name="login"),
    path('registerView/', views.registerView,name="register"),
    path('register/', views.register),
    path('login/', views.login),
    path('accounts/login/', views.logout,name="logout"),
    path('index1/', views.index1,name="home"),
    #path('captcha',include('captcha.urls')),
    # 获取验证码
    path('check_code/', views.check_code,name='check_code')

]

⑩wsgi.py


import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'login.settings')

application = get_wsgi_application()
(2)HTML代码部分

①创建静态文件夹static
②style.css


/* reset */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,dl,dt,dd,ol,nav ul,nav li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{
   margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline;}
article, aside, details, figcaption, figure,footer, header, hgroup, menu, nav, section {
   display: block;}
ol,ul{
   list-style:none;margin:0px;padding:0px;}
blockquote,q{
   quotes:none;}
blockquote:before,blockquote:after,q:before,q:after{
   content:'';content:none;}
table{
   border-collapse:collapse;border-spacing:0;}
/* start editing from here */
a{
   text-decoration:none;}
.txt-rt{
   text-align:right;}/* text align right */
.txt-lt{
   text-align:left;}/* text align left */
.txt-center{
   text-align:center;}/* text align center */
.float-rt{
   float:right;}/* float right */
.float-lt{
   float:left;}/* float left */
.clear{
   clear:both;}/* clear float */
.pos-relative{
   position:relative;}/* Position Relative */
.pos-absolute{
   position:absolute;}/* Position Absolute */
.vertical-base{
   	vertical-align:baseline;}/* vertical align baseline */
.vertical-top{
   	vertical-align:top;}/* vertical align top */
nav.vertical ul li{
   	display:block;}/* vertical menu */
nav.horizontal ul li{
   	display: inline-block;}/* horizontal menu */
img{
   max-width:100%;}
/*end reset*/
/****-----start-body----****/
.pc{
   
	background: url(../images/login_light.png);
	text-align: center;
	width: 100%;
}
.us{
   
	background: url(../images/login_user.png);
	text-align: center;
	width: 100%;
}
.ps{
   
	background: url(../images/login_password.png);
	text-align: center;
	width: 100%;
}
.yz{
   
	background: url(../images/login_yzm.png);
	text-align: center;
	width: 100%;
}
.bt{
   
	background: url(../images/login_btn.png);
	text-align: center;
	width: 50px;
	height: 40px;
}
.bt1{
   
	background: url(../images/login_btn.png);
	text-align: center;
	width: 70px;
	height: 40px;
}
.bt:hover,.bt1:hover{
   
	background: black;
	color: white;
}
.body{
   
	background: url("../images/bg.png");
	background-repeat: no-repeat;
	background-size: 100% 100%;
	background-attachment: fixed;
}


body{
   
	background:#eee;
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.main{
   
	background: url("../images/bg.jpg");
	background-repeat: no-repeat;
	background-size: 50% 100%;
	margin-left: 25%;

}

.header {
   
	background: url("../images/login_btn.png");
	background-repeat: no-repeat;
	background-size: 100%;
	text-align: center;

}

.header h1 {
   
	color:#eeeeee;
	font-weight:700;
	font-size:22px;
}

.main p{
   
	text-align: center;
	font-size:15px;
	font-weight:600;
	color:#383737;
	padding: 20px 30px;
	border-bottom: 1px solid #E7E0E0;
	margin-top: -13px;
}
.main h2,.main h3{
   
	text-align:left;
	font-size:17px;
	font-weight:600;
	margin:15px 3px;
	color:#3F3D3D;
}

.left-form,.right-form{
   
	float:left;
	margin:22px 28px;
	width:40%;
}
.left-form input[type=text],.left-form input[type=email],.left-form input[type=password] {
   
	float:left;
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	width:80%;
	padding: 0.7em 2em 0.7em 1em;
	border:none;
	color: #000;
	font-size:15px;
	float: left;
	outline: none;
}
.right-form{
   
	float:right;
}
form{
   
	padding-bottom: 2em;
}
.right-form li{
   
	display:block;
	color:#4D4949;
	border:1px solid #EBEBEB;
	border-radius: 0.3em;
	-webkit-border-radius:0.3em;
  	-moz-border-radius:0.3em;
 	 -o-border-radius:0.3em;
 	 margin-bottom: 10px;
}
.right-form input[type=text], input[type=password] {
   
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	width:90%;
	padding: 0.7em 1em 0.7em 1em;
	color:#000;
	font-size: 15px;
	border:none;
  	outline:none;

}
.left-form li{
   
	display:block;
	color:#4D4949;
	border:1px solid #EBEBEB;
	border-radius: 0.3em;
	-webkit-border-radius:0.3em;
  	-moz-border-radius:0.3em;
 	 -o-border-radius:0.3em;
 	 margin-bottom: 10px;
}
.icon
{
   
	height:28px;
	width:28px;
	background:url(../images/spirit.png)  no-repeat;
	display: block;
	float: right;
	margin: 7px 9px 9px 0px;
}
.ticker{
   
	background:url(../images/spirit.png)  no-repeat 0px 0px;
}
.into{
   
	background:url(../images/spirit.png)  no-repeat -31px 0px;
}

.left-form submit{
   
	float:left;
}
.right-form submit{
   
	float:right;
}
.main h4{
   
	float: left;
	font-size:13px;
	font-weight: 600;
	color:#363535;
}
.left-form input[type=submit]{
   
  padding:10px 19px;
  border-radius:0.3em;
 -webkit-border-radius:0.3em;
  -moz-border-radius:0.3em;
  -o-border-radius:0.3em;
   color:#4D4949;
  background:#F3F3F3;
  border:1px solid #EBEBEB;
  font-weight:bold;
  font-size:15px;
  outline:none;
  transition: all 0.5s ease-out;
  -webkit-transition: all 0.5s ease-out;
  -moz-transition: all 0.5s ease-out;
  -ms-transition: all 0.5s ease-out;
  -o-transition: all 0.5s ease-out;
  margin-top:15px;
  cursor: pointer;
}
.right-form input[type=submit]{
   
  float:left;
  padding:8px 19px;
  border-radius:0.3em;
  border:none;
  outline:none;
  -webkit-border-radius:0.3em;
  -moz-border-radius:0.3em;
  -o-border-radius:0.3em;
  font-weight:bold;
  font-size:15px;
  transition: all 0.5s ease-out;
  -webkit-transition: all 0.5s ease-out;
  -moz-transition: all 0.5s ease-out;
  -ms-transition: all 0.5s ease-out;
  -o-transition: all 0.5s ease-out;
  margin: 2em -9em;
  cursor: pointer;
}
 input[type=submit]:hover {
   
 background:#2E2D2D;
 color:#fff;

}
/*---start-check-box----*/
.uncheked{
   
	height:40px;
	width:28px;
	display:block;
	background:url(../images/check-icon.png) no-repeat;
}
.cheked{
   
	height:40px;
	width:28px;
	display:block;
	background:url(../images/check-icon.png) no-repeat 50% 50%;
}
.disabled{
   
	height:40px;
	width:28px;
	display:block;
	background:url(../images/check-icon.png) no-repeat 0% 100%;
}
.price-selection-tree input[type="checkbox"]{
   
	display:none;
}
.price-selection-tree input[type="checkbox"]+label{
   
	float:left;
	display: block;
	vertical-align:top;
	font-size:13px;
	font-weight:600;
	margin-top:-0.3em;
	height: 76px;
	cursor:pointer;
}
.checkbox-grid-left p{
   
	display:block;
}
.left-form > label {
   
	font-size:13px;
	float:left;
	vertical-align: super;
	margin-left:10px;
	color:#4C4A4A;
	margin-top:2px;
	font-weight: 600;
}
input[type=checkbox].css-checkbox10 + label i.css-label10 {
   
	float:left;
	height:40px;
	width:28px;
	display: inline-block;
	line-height:18px;
	background-repeat: no-repeat;
	background-position: 0 0px;
	cursor: pointer;
	background: url(../images/check-icon.png) no-repeat -0px -82px;
}
input[type=checkbox].css-checkbox10:checked + label i.css-label10 {
   
	background: url(../images/check-icon.png) no-repeat -0px -82px;
	height: 20px;
}
/*----*/
/**start-copy-right**/
.copy-right {
   
	text-align: center;
}
.copy-right p {
   
	color:#000;
	font-size:1em;
	margin-top:5em;
	font-weight:600;
}
.copy-right p a {
   
	font-size:1em;
	font-weight:600;
	color:#669A16;
	-webkit-transition: all 0.3s ease-out;
	-moz-transition: all 0.3s ease-out;
	-ms-transition: all 0.3s ease-out;
	-o-transition: all 0.3s ease-out;
	transition: all 0.3s ease-out;
}
.copy-right a:hover{
   
	color:#000;
}
/**end-copy-right**/
/*----start-responsive design-----*/
@media only screen and (max-width:1680px) and (min-width:1440px) {
   
	.main{
   
	width:70%;
	margin:6em auto 0;
	}
	.copy-right p {
   
		margin: 3.5em 0em;
	}
}
@media only screen and (max-width:1440px) and (min-width:1366px) {
   
	.main{
   
	width:80%;
	margin:6em auto 0;
	}
	.copy-right p {
   
	margin: 3.8em 0em;
	}
}
@media only screen and (max-width:1366px) and (min-width:1280px) {
   
	.main{
   
	width:82%;
	margin:6em auto 0;
	}
	.copy-right p {
   
	margin: 4em 0em;
	}
}
@media only screen and (max-width:1280px) and (min-width:1024px) {
   
	.main{
   
	width:89%;
	margin:5em auto 0;
	}
	.copy-right p {
   
	margin: 3.5em 0em;
	}
}
@media only screen and (max-width:1024px) and (min-width:768px) {
   
	.main{
   
	width:97%;
	margin:5em auto 0;
	}
	.left-form input[type=text], .left-form input[type=email], .left-form input[type=password] {
   
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	width: 78%;
	}
	.right-form input[type=text], input[type=password] {
   
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	width: 86%;
	}
	.copy-right p {
   
	margin: 3.5em 0em;
	}
}
@media only screen and (max-width:768px) and (min-width:640px) {
   
	.main{
   
	width:95%;
	margin:5em auto 0;
	}
	.left-form input[type=text], .left-form input[type=email], .left-form input[type=password] {
   
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	padding: 0.7em 1em 0.7em 1em;
	width: 70%;
	}
	.right-form input[type=text], input[type=password] {
   
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	padding: 0.7em 1em 0.7em 0em;
	width:89%;
	}
	.left-form{
   
	width:88%;
	text-align: center;
	}
	 .right-form {
   
	 	float:none;
	width:88%;
	text-align: center;
	}
	.left-form > label {
   
	margin-left:42px;
	margin-top: 13px;
	}
	.main h2,.main h3{
   
	text-align:center;
	}
	.left-form li{
   
	margin-left:32px;
	}
	.right-form li{
   
	margin-left:40px;
	}
	.left-form input[type=submit] {
   
	padding: 12px 12px;
	float: right;
	margin: 2px 0px;
	}
	.main h4 {
   
	float:left;
	margin: 7px 36px;
	}
	.main h3{
   
	margin-top:-2em;
	}
	.right-form input[type=submit] {
   
	float: right;
	padding: 8px 19px;
	margin:2px 3px;
	}
	.copy-right p {
   
	margin: 3.5em 0em;
	}
}	
@media only screen and (max-width:640px) and (min-width:480px) {
   
	.main{
   
	width:95%;
	margin:5em auto 0;
	}
	.left-form input[type=text], .left-form input[type=email], .left-form input[type=password] {
   
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	padding: 0.7em 1em 0.7em 1em;
	width: 70%;
	}
	.right-form input[type=text], input[type=password] {
   
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	padding: 0.7em 1em 0.7em 0em;
	width:89%;
	}
	.left-form{
   
	width:88%;
	text-align: center;
	}
	 .right-form {
   
	 	float:none;
	width:88%;
	text-align: center;
	}
	.left-form > label {
   
	margin-left:42px;
	margin-top: 13px;
	}
	.main h2,.main h3{
   
	text-align:center;
	}
	.left-form li{
   
	margin-left:13px;
	}
	.right-form li{
   
	margin-left:16px;
	}
	.left-form input[type=submit] {
   
	padding: 12px 12px;
	text-align:center;
	float: none;
	}
	.main h4 {
   
	float:left;
	margin: 7px 17px;
	}
	.right-form input[type=submit] {
   
	float: right;
	padding: 8px 19px;
	margin:2px 3px;
	}
	.copy-right p {
   
		margin: 3.5em 0em;
	}
}
@media only screen and (max-width:480px) and (min-width:320px) {
   
	.main{
   
	width:95%;
	margin:2em auto 0;
	}
	.main p{
   
	padding:16px 20px;
	}
	.left-form input[type=text], .left-form input[type=email], .left-form input[type=password] {
   
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	padding: 0.7em 1em 0.7em 1em;
	width: 70%;
	}
	.right-form input[type=text], input[type=password] {
   
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	padding: 0.7em 2em 0.7em 0em;
	width:89%;
	}
	.left-form, .right-form{
   
	width:83%;
	float:none;
	text-align: center;
	}
	.left-form > label {
   
	margin-left:10px;
	margin-top: 13px;
	}
	.main h2,.main h3{
   
	text-align:center;
	}
	.left-form li{
   
	margin-left:13px;
	}
	.right-form li{
   
	margin-left:16px;
	}
	.left-form input[type=submit] {
   
	padding: 12px 12px;
	text-align:center;
	margin:9px 0px;
	}
	.main h4 {
   
	float:left;
	margin: 7px 17px;
	}
	.right-form input[type=submit] {
   
	float: right;
	padding: 8px 19px;
	margin:2px 3px;
	}
	.copy-right p {
   
	margin: 3em 0em;
	}
}	
@media only screen and (max-width:320px) and (min-width:240px) {
   
	.main{
   
	width:96%;
	margin:2em auto 0;
	}
	.main p{
   
	padding:16px 17px;
	}
	.left-form input[type=text], .left-form input[type=email], .left-form input[type=password] {
   
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	padding: 0.4em 1em 0.4em 1em;
	width: 70%;
	}
	.right-form input[type=text], input[type=password] {
   
	font-family: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
	padding: 0.6em 0.9em 0.6em 0em;
	width:89%;
	}
	.left-form, .right-form{
   
	text-align: center;
	}
	.left-form > label {
   
	margin-left:10px;
	margin-top: 13px;
	}
	.main h2,.main h3{
   
	text-align:center;
	}
	.left-form li{
   
	margin-left:-6px;
	}
	.right-form li{
   
	margin-left:-5px;
	}
	.left-form input[type=submit] {
   
	padding: 12px 12px;
	text-align:center;
	margin:9px 0px;
	}
	.main h4 {
   
	float:left;
	margin: 7px 17px;
	}
	.right-form input[type=submit] {
   
	float: right;
	padding: 8px 19px;
	margin:2px 3px;
	}
	.copy-right p {
   
		margin:2.5em 0em;
	}
	.icon{
   
	margin: 7px 5px 9px 0px;
	}
}
/*----//end-responsive design-----*/

③jQuery,js

/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */
!function(e,t){
   "use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){
   if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){
   "use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={
   },o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={
   },m=function(e){
   return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){
   return null!=e&&e===e.window},c={
   type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){
   var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){
   return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){
   return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){
   var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}k.fn=k.prototype={
   jquery:f,constructor:k,length:0,toArray:function(){
   return s.call(this)},get:function(e){
   return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){
   var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){
   return k.each(this,e)},map:function(n){
   return this.pushStack(k.map(this,function(e,t){
   return n.call(e,t,e)}))},slice:function(){
   return this.pushStack(s.apply(this,arguments))},first:function(){
   return this.eq(0)},last:function(){
   return this.eq(-1)},eq:function(e){
   var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){
   return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},k.extend=k.fn.extend=function(){
   var e,t,n,r,i,o,a=arguments[0]||{
   },s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{
   },s++),"object"==typeof a||m(a)||(a={
   }),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(k.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||k.isPlainObject(n)?n:{
   },i=!1,a[t]=k.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},k.extend({
   expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){
   throw new Error(e)},noop:function(){
   },isPlainObject:function(e){
   var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){
   var t;for(t in e)return!1;return!0},globalEval:function(e,t){
   b(e,{
   nonce:t&&t.nonce})},each:function(e,t){
   var n,r=0;if(d(e)){
   for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){
   return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){
   var n=t||[];return null!=e&&(d(Object(e))?k.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){
   return null==t?-1:i.call(t,e,n)},merge:function(e,t){
   for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){
   for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){
   var r,i,o=0,a=[];if(d(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g.apply([],a)},guid:1,support:y}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=t[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){
   n["[object "+t+"]"]=t.toLowerCase()});var h=function(n){
   var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,k="sizzle"+1*new Date,m=n.document,S=0,r=0,p=ue(),x=ue(),N=ue(),A=ue(),D=function(e,t){
   return e===t&&(l=!0),0},j={
   }.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){
   for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",$=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",F=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={
   ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{
   ]+\{
   \s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{
   1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){
   var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){
   return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){
   T()},ae=be(function(e){
   return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{
   dir:"parentNode",next:"legend"});try{
   H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){
   H={
   apply:t.length?function(e,t){
   L.apply(e,O.call(t))}:function(e,t){
   var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){
   var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){
   if(11!==p&&(u=Z.exec(t)))if(i=u[1]){
   if(9===p){
   if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{
   if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){
   if(c=t,f=e,1===p&&U.test(t)){
   (s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{
   return H.apply(n,f.querySelectorAll(c)),n}catch(e){
   A(t,!0)}finally{
   s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){
   var r=[];return function e(t,n){
   return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){
   return e[k]=!0,e}function ce(e){
   var t=C.createElement("fieldset");try{
   return!!e(t)}catch(e){
   return!1}finally{
   t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){
   var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){
   var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){
   return function(e){
   return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){
   return function(e){
   var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){
   return function(e){
   return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){
   return le(function(o){
   return o=+o,le(function(e,t){
   var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){
   return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={
   },i=se.isXML=function(e){
   var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){
   var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){
   return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){
   return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){
   return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){
   var t=e.replace(te,ne);return function(e){
   return e.getAttribute("id")===t}},b.find.ID=function(e,t){
   if("undefined"!=typeof t.getElementById&&E){
   var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){
   var n=e.replace(te,ne);return function(e){
   var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){
   if("undefined"!=typeof t.getElementById&&E){
   var n,r,i,o=t.getElementById(e);if(o){
   if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){
   return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){
   var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){
   while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){
   if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){
   a.appendChild(e).innerHTML="<a id='"+k+"'></a><select id='"+k+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){
   e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){
   d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){
   var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){
   if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){
   if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){
   if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.uns
  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值