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TB41gEB29/+vP5I+Dttc3i5
T1IHZBiLwZudCShy5ZCDTks195BXbgTQOKDtEQkuzUE4L9L1PkXsLBE3Zvy3S5VF
loXGPBP6iDJjR559QzakAn8dJVV6I+9J3ryoOdN4vyzo1puU8eFnmfsJ57NFk6sX
mf8kdYd0XYo=
-----END CERTIFICATE REQUEST-----
-----BEGIN CERTIFICATE-----
MIICATCCAWoCCQDstPb/4nzmRjANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJB
VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
cyBQdHkgTHRkMB4XDTE3MDUxMTA5MzEzN1oXDTE4MDUxMTA5MzEzN1owRTELMAkG
A1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
IFdpZGdpdHMgUHR5IEx0ZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwhtv
sXe9mSAuL6W9xG9FmOora9J9WTwkf5SNFBU9ekRMSN+QbPxlnMR1lMxBBsHlYHjM
0SEzpo+W2bd6XzGOV5DjeGypispzjS3jWpj2Admzbqnex5eLstTejS0zZeDXVocI
Iz8V4ErNuhRcm4HWlSjl0IUqlEi8X6ftm49TaIUCAwEAATANBgkqhkiG9w0BAQsF
AAOBgQAR4K4Ny36Tnc6jZM4pGRywgcMpjIdBuAhIxexadM1DL1jmUIE0spSK4S8S
60RC387DEa5u2x1NyB0wRaeF6bDgNhVJisglfMuu6QS262XHG4WhVmV5vm06c+ET
0RZv9TqrEjuvWXPHNFU7zvvFMFAj4Y7nxgB2zx9OrSKCCesB3g==
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQDCG2+xd72ZIC4vpb3Eb0WY6itr0n1ZPCR/lI0UFT16RExI35Bs
/GWcxHWUzEEGweVgeMzRITOmj5bZt3pfMY5XkON4bKmKynONLeNamPYB2bNuqd7H
l4uy1N6NLTNl4NdWhwgjPxXgSs26FFybgdaVKOXQhSqUSLxfp+2bj1NohQIDAQAB
AoGBAKWI5F4CccyupvS3cfidtErOGS2gmomJQs8SjqW732vv5uaW0gI/1SA2Ytf8
wM/Ud5soKfOHTxcSiWEumcuo5WvEmoNHXJfunVErnYG4Ph2FsiBihL2wPrGnq0E5
XZnX0ZNwcBw+dvfDXKiAq4QOrSyldtNuQuw3bZZ+5DOZkgSZAkEA/b69YTjNszX7
9KDiWtIeu5dw6mkzrdL3+M8DpQk1E7ndLKbKKdZMavd/OHkjbJoMriVy57TLz8HL
OtV6GnEo0wJBAMPVBcnlI8A78mEf4/m6SoazTPV1FQfZknC1rKIo1qSNtP/RcjoW
dnK9Ar4dnmuUvKXKoYKlCFcmERNeo7c80kcCQAYBUJwPaxbVrTvR3umFVYLdB6gU
i0uO1Z2G0LBEMoRf/rMC03//+VkCuHkOrN7yGmC4tCp1pekpzfR7fuNHUE8CQQCw
aAia4kreNCIW079tih7wUDwXMK0NMTT1SvKD8P3Jpc1SVL3tDacNnK4HzG6Uwptd
TbdIFJn6x1PCexJHUgapAkB7Jvoweu9Jja1arukVWHIKZbqM3Hmh1GjgkuxoKeZW
ZoaC/ASM0rsc9XHUaSuQjAlwDk/H47vgEuxXu2BklGrJ
-----END RSA PRIVATE KEY-----
/**
* Created by xaj on 2017/6/5.
* Used for the configuration of webserver
*/
var config = require('doohanpub').config;
var httpPort = config.get('httpPort');
var httpsPort = config.get('httpsPort');
var timeInterval = config.get('timeInterval');
module.exports = {
//To set the port of http or https server
ports: {
httpPort : process.env.WEBSERVER_CONFIG_HTTPPORT || httpPort,
httpsPort : process.env.WEBSERVER_CONFIG_HTTPSPORT || httpsPort
},
//To set the ssl options for https
ssl: {
//sslEnabled : process.env.WEBSERVER_CONFIG_SSL_ENABLED || true,
sslCert : process.env.WEBSERVER_CONFIG_SSL_CERT || './ca/3_.51gjj.com_bundle.crt',
sslKey : process.env.WEBSERVER_CONFIG_SSL_KEY || './ca/3_.51gjj.com.key'
},
//To set the timer for clean log
timer: {
timeInterval: timeInterval || '00 00 00 * * *'
}
};
{
"httpPort" : 10011,
"httpsPort" : 443,
"tj1": "http://tj1.51gjj.com",
"tj2": "http://tj2.51gjj.com",
"mongoUrl": "http://tv.51gjj.com",
"zhukeUrl": "http://tv.51gjj.com",
"hexinUrl": "http://td.51gjj.com",
"wlnUrl": "http://t.51gjj.com",
"sbService":"http://ts2.51gjj.com:4825",
"signService":"http://tj2.51gjj.com:5118",
"timeInterval" : "00 00 00 * * *",
"log4jsConfig" : {
"appenders": [
{
"type": "console"
},
{
"category": [ "sbH5","console" ],
"type": "dateFile",
"filename": "./logs/",
"alwaysIncludePattern": true,
"pattern": "sbH5-yyyyMMdd.log"
}
],
"replaceConsole": true,
"levels":
{
"console":"ALL"
}
},
"dbConfig":{
"connectionLimit" : 50,
"host": "rm-bp1272001633qc0x9.mysql.rds.aliyuncs.com",
"user": "hexin",
"password": "gYUHszn9#q",
"database": "node_gjj"
},
"host": "https://t.51gjj.com"
}
/**
* Created by xaj on 2017/6/9.
*/
This diff is collapsed.
/**
* Created by xaj on 2017/6/6.
*/
var schedule = require('node-schedule');
var fs = require('fs');
var path = require('path');
var moment = require('moment');
var basic = require('doohanpub').basic;
var process = require('child_process');
/*每分钟的第30秒触发: '30 * * * * *'
每小时的1分30秒触发 :'30 1 * * * *'
每天的凌晨1点1分30秒触发 :'30 1 1 * * *'
每月的1日1点1分30秒触发 :'30 1 1 1 * *'
2016年的1月1日1点1分30秒触发 :'30 1 1 1 1 2016'
每周1的1点1分30秒触发 :'30 1 1 * * 1'*/
function BeginCleanLogWork(timeInterval){
schedule.scheduleJob(timeInterval, cleanLogJob);
}
function BeginCleanPm2LogWork(){
schedule.scheduleJob('00 00 00 1 * *', cleanPm2LogJob);
}
function BeginCleanImgFileWork() {
schedule.scheduleJob('00 00 00 * * *', deleteOverDateImg);
}
function cleanLogJob() {
console.log('[cleanLogJob] BeginDayWork:' + new Date());
var dateMoment = moment(new Date()).subtract(3, 'days').format('YYYYMMDD')
let fileName = basic.getLocalIP('eth', 'IPv4') + '-sbH5-' + dateMoment + '.log';
let filePath = path.join('./logs/' + fileName);
console.log(fileName)
console.log(filePath)
if (fs.existsSync(filePath)) {
fs.unlink(filePath, function (err) {
if (err) {
console.error('[cleanLogJob] 清除3天前日志失败,原因:' + JSON.stringify(err));
}
else {
console.log('[cleanLogJob] 清除3天前日志成功,被清除日志:' + fileName);
}
})
}
else {
console.error('[cleanLogJob] 日志文件: %s 不存在', filePath);
}
}
function cleanPm2LogJob() {
process.exec('pm2 flush', function (error, stdout, stderr) {
if (error) {
console.log('[cleanPm2LogJob] exec error: ' + error);
}
else {
console.log(stdout);
console.log(stderr);
}
});
}
// BeginCleanLogWork();
function deleteOverDateImg() {
var filePath = path.resolve('./public/images');
//读取文件目录
fs.readdir(filePath, function (err, files) {
if (err) {
console.log(err);
return;
} else {
console.log('[deleteOverDateImg] images: ', files);
var reg = /^image+/;
var j = 0;
for (let i = 0; i < files.length; i++) {
if (reg.test(files[i])) {
j++;
let time = files[i].substring(6, 19);
if (time < new Date() - 60*60*1000) {
console.log('[deleteOverDateImg] delete image file: ', files[i]);
let imageFilePath = path.join('./public/images/' + files[i]);
console.log(imageFilePath);
fs.unlink(imageFilePath, function (err) {
if (err) {
console.error('[deleteOverDateImg] 清除一个小时前验证码图片文件失败,原因:' + JSON.stringify(err));
}
else {
console.log('[cleanLogJob] 清除一个小时前验证码图片文件成功,被清除文件:' + imageFilePath);
}
})
}
}
}
}
})
}
module.exports = {
"BeginCleanLogWork": BeginCleanLogWork,
"BeginCleanPm2LogWork": BeginCleanPm2LogWork,
"cleanLogJob": cleanLogJob,
"deleteOverDateImg": deleteOverDateImg,
"BeginCleanImgFileWork": BeginCleanImgFileWork
};
This diff is collapsed.
This diff is collapsed.
{
"name": "gongjijin",
"main": "gongjijin.js",
"version": "1.0.0",
"description": "jianbing gongjijin for h5",
"dependencies": {
"body-parser": "^1.17.2",
"cookie-parser": "^1.4.3",
"crypto": "0.0.3",
"express": "^4.15.3",
"express-ws": "^3.0.0",
"hbs": "^4.0.1",
"https": "^1.0.0",
"iconv-lite": "^0.4.17",
"moment": "^2.18.1",
"mysql": "^2.14.1",
"node-schedule": "^1.2.3",
"query-mobile-phone-area": "^1.0.6",
"request": "^2.81.0",
"request-promise": "^4.2.1"
}
}
{
"name" : "sbH5", // 应用名称
"script" : "./sbH5.js", // 实际启动脚本
"cwd" : "./" // 当前工作路径
// "watch": [ // 监控变化的目录,一旦变化,自动重启
// "bin",
// "routers"
// ],
// "ignore_watch" : [ // 从监控目录中排除
// "node_modules",
// "logs",
// "public"
// ],
// "watch_options": {
// "followSymlinks": false
// },
// "error_file" : "./logs/app-err.log", // 错误日志路径
// "out_file" : "./logs/app-out.log" // 普通日志路径
// "env": {
// "NODE_ENV": "production" // 环境参数,当前指定为生产环境
// }
}
This diff is collapsed.
This diff is collapsed.
a, article, aside, body, button, dd, details, div, dl, dt, figcaption, figure, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, img, input, li, menu, nav, ol, p, section, select, table, tbody, td, textarea, th, tr, ul {
-webkit-tap-highlight-color: transparent;
padding: 0;
margin: 0
}
h1, h2, h3, h4, h5 {
font-style: normal;
font-weight: 400
}
html {
font-size: 14px
}
body {
font-family: Arial, Helvetica, sans-serif;
-webkit-overflow-scrolling: touch;
background-color: #f5f5f5
}
:focus, a, button, div, img, input, textarea {
-webkit-tap-highlight-color: transparent;
tap-highlight-color: transparent
}
.header {
padding: 0.5rem;
height: 2rem;
background-color: #FFFFFF;
display: block;
text-align: center;
}
.header label {
display: inline-block;
width: 30%;
color: rgb(166, 166, 166);
text-align: center;
font-size: 1.5rem;
}
.header label.active {
font-weight: bold;
color: #c01016;
}
.sbbrief .tab-brief {
background-color: #FFFFFF;
padding: 1rem 0rem;
}
.sbbrief label {
display: inline-block;
font-size: 1.1rem;
}
.tab-brief {
margin: 0.5rem 0;
letter-spacing: 0.2px;
}
.tab-brief div {
padding-left: 1rem;
padding-bottom: 0.1rem;
padding-top: 0.1rem;
}
.swiper-container {
height: 11rem;
}
.sbbrief .lab {
width: 5rem;
color: #7f8c8d;
}
.sbdetail {
background-color: #FFFFFF;
margin-top: 0.5rem;
}
.sbdetail H5 {
padding: 1rem 1.5rem 1rem 1rem;
font-size: 1.1rem;
background-image: url(img/ico_arrow_down.png);
background-repeat: no-repeat;
background-size: 16px;
background-position: right center;
background-origin: content-box;
border: 0rem solid #f5f5f5;
border-bottom-width: 1px;
}
.sbdetail H5.open {
background-image: url(img/ico_arrow_up.png);
}
.sbdetail .detail-tab {
display: -moz-box;
display: -webkit-box;
display: box;
background:#fcfcfc no-repeat url(img/ico_arrow_right.png);
background-position: 95% 50%;
background-size:25px 25px;
}
.detail-tab div {
position: relative;
margin: 1rem 0 0 0;
width: 80%;
}
.detail-tab div p {
padding-bottom: 0.7rem;
width: 90%;
}
.detail-tab label {
display: block;
position: relative;
width: 12%;
height: 4rem;
margin: 1rem 1rem;
}
.medicaldetail .detail-tab {
display: -moz-box;
display: -webkit-box;
display: box;
background-color: #fcfcfc;
}
.endowmentdetail .detail-tab {
display: -moz-box;
display: -webkit-box;
display: box;
background-color: #fcfcfc;
}
.sbdetail .detail-tab:nth-child(even) {
background:#f5f5f5 no-repeat url(img/ico_arrow_right.png);
background-position: 95% 50%;
background-size:25px 25px;
}
.detail-tab:nth-child(even) {
background:#f5f5f5 ;
}
.sbdetail h5.open + ul {
display: block;
}
.sbdetail h5 + ul {
display: none;
}
.medicaldetail {
background-color: #FFFFFF;
margin-top: 0.5rem;
}
.medicaldetail H5 {
padding: 1rem 1.5rem 1rem 1rem;
font-size: 1.1rem;
background-image: url(img/ico_arrow_down.png);
background-repeat: no-repeat;
background-size: 16px;
background-position: right center;
background-origin: content-box;
border: 0rem solid #f5f5f5;
border-bottom-width: 1px;
}
.medicaldetail H5.open {
background-image: url(img/ico_arrow_up.png);
}
.medicaldetail h5.open + ul {
display: block;
}
.medicaldetail h5 + ul {
display: none;
}
.detail-tab p:first-child {
color: orange;
}
.loanbrief .tab-brief {
background-color: #FFFFFF;
padding: 1rem 0rem;
}
.loanbrief label {
display: inline-block;
font-size: 0.9rem;
}
.loanbrief .loanlab {
width: 6rem;
color: #7f8c8d;
}
.loandetail {
background-color: #FFFFFF;
margin-top: 0.5rem;
}
.loandetail H5 {
padding: 1rem 1.5rem 1rem 1rem;
font-size: 1.1rem;
background-image: url(img/ico_arrow_down.png);
background-repeat: no-repeat;
background-size: 16px;
background-position: right center;
background-origin: content-box;
border: 0rem solid #f5f5f5;
border-bottom-width: 1px;
}
.loandetail H5.open {
background-image: url(img/ico_arrow_up.png);
}
.loandetail h5.open + ul {
display: block;
}
.loandetail h5 + ul {
display: none;
}
.dialog-content {
width: 100%;
padding-left: 5%;
padding-right: 5%;
height: 79%;
text-align: center;
}
.dialog-content th {
font-size: 1rem;
font-weight: normal;
color: #7f8c8d;
}
.dialog-content td {
font-size: 1rem;
}
.dialog-title {
text-align: center;
padding: 4%;
font-size: 1.1rem;
}
.dialog-body.out{
opacity: 1;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
transition: all 0.5s;
z-index: 11;
}
.dialog-body {
opacity: 0;
position: fixed;
width: 85%;
height: 40%;
left: 7.5%;
top: 30%;
background-color: #FFFFFF;
-webkit-transition: all 0.5s;
-moz-transition: all 0.5s;
transition: all 0.5s;
z-index: -1;
}
.ui-overlay.out {
opacity: 1;
-webkit-transition: opacity 0.2s ease-in;
-moz-transition: opacity 0.2s ease-in;
-o-transition: opacity 0.2s ease-in;
transition: opacity 0.2s ease-in;
z-index: 1;
display: block;
}
.ui-overlay {
display: none;
background-color: rgba(0, 0, 0, 0.4);
width: 100%;
position: fixed;
top: 0;
bottom: 0;
z-index: -2;
-webkit-transition: opacity 0.2s ease-in;
-moz-transition: opacity 0.2s ease-in;
-o-transition: opacity 0.2s ease-in;
transition: opacity 0.2s ease-in;
opacity: 0;
}
.dialog-body img.left {
position: absolute;
left: -8%;
bottom: 41%;
width: 20px;
}
.dialog-body img.right {
position: absolute;
right: -8%;
bottom: 41%;
width: 20px;
}
.prompt {
display: block;
width: 190px;
min-height: 46px;
line-height: 46px;
text-align: center;
box-sizing: border-box;
padding: 12px;
background-color: rgba(0, 0, 0, 0.6);
color: white;
font-size: 14px;
position: fixed;
top: 22%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 10px;
z-index: 12;
}
.prompt * {
line-height: 22px;
display: inline-block;
width: 100%;
word-break: break-all;
vertical-align: middle;
}
.tab-nav label + label + .cursor {
width: 50%
}
.tab-lab{
-moz-box-flex: 1;
-webkit-box-flex: 1;
box-flex: 1;
display: block;
color: #a6a6a6;
font-size: 1.16666667rem;
text-align: center;
width: 1%;
position: relative;
}
.cursor::after {
content: '';
display: block;
background-color: #c01016;
height: 100%;
width: 15%;
margin: 0 auto;
}
.tab-nav .cursor {
height: 3px;
width: 100%;
display: block;
position: absolute;
bottom: 0;
left: 0;
transition: all .2s ease-in-out;
-moz-transition: all .2s ease-in-out;
-webkit-transition: all .2s ease-in-out;
}
.tab-nav {
height: 2.5rem;
line-height: 2.5rem;
display: -moz-box;
display: -webkit-box;
display: box;
width: 100%;
position: relative;
background-color: #fff;
border-bottom: 1px solid #ededed;
}
.tab-nav label.active {
color: #c01016;
}
.tab-nav label.active:nth-child(2) ~ .cursor {
transform: translateX(100%);
-webkit-transform: translateX(100%);
-moz-transform: translateX(100%);
}
.medical{
display: none;
}
.medicalpaytotal{
background-color: #FFFFFF;
}
.medicalpaytotal label{
margin-top: 0.5rem;
margin-bottom: 0.5rem;
display: inline-block;
font-size: 2rem;
width: 50%;
}
.medicalpaytotal p{
display: inline-block;
font-size: 1rem;
width: 50%;
}
.medicalpayinline{
padding: 5%;
}
.medshop{
display: none;
}
.endowmentdetail {
background-color: #FFFFFF;
margin-top: 0.5rem;
}
.endowmentdetail H5 {
padding: 1rem 1.5rem 1rem 1rem;
font-size: 1.1rem;
background-image: url(img/ico_arrow_down.png);
background-repeat: no-repeat;
background-size: 16px;
background-position: right center;
background-origin: content-box;
border: 0rem solid #f5f5f5;
border-bottom-width: 1px;
}
.endowmentdetail H5.open {
background-image: url(img/ico_arrow_up.png);
}
.endowmentdetail h5.open + ul {
display: block;
}
.endowmentdetail h5 + ul {
display: none;
}
.endowment{
display: none;
}
.endowmentpaytotal{
background-color: #FFFFFF;
}
.endowmentpaytotal label{
margin-top: 0.5rem;
margin-bottom: 0.5rem;
display: inline-block;
font-size: 2rem;
width: 50%;
}
.endowmentpaytotal p{
display: inline-block;
font-size: 1rem;
width: 50%;
}
.endowmentinline{
padding: 5%;
}
.endowmentpayinline{
padding: 5%;
}
\ No newline at end of file
This diff is collapsed.
.prompt {
display: block;
width: 190px;
min-height: 46px;
line-height: 46px;
text-align: center;
box-sizing: border-box;
padding: 12px;
background-color: rgba(0, 0, 0, 0.6);
color: white;
font-size: 16px;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 10px;
z-index: 12;
}
.prompt * {
line-height: 22px;
display: inline-block;
width: 100%;
word-break: break-all;
vertical-align: middle;
}
.toast {
position: fixed;
top: 40px;
max-width: 80%;
border-radius: 10px;
text-align: center;
color: white;
background-color: rgba(0, 0, 0, 0.75);
font-size: 0;
display: inline-block;
left: 50%;
-webkit-transform: translateX(-50%);
-moz-transform: translateX(-50%);
-ms-transform: translateX(-50%);
transform: translateX(-50%);
z-index: 100;
}
.toast > * {
display: inline-block;
vertical-align: middle;
}
.toast span {
font-size: 14px;
padding: 10px 10px;
display: block;
height: auto;
word-wrap: break-word;
}
.ui-overlay {
background-color: rgba(0, 0, 0, 0.4);
display: block;
width: 100%;
position: fixed;
top: 0;
bottom: 0;
display: none;
-webkit-transition: opacity 0.2s ease-in;
-moz-transition: opacity 0.2s ease-in;
-o-transition: opacity 0.2s ease-in;
transition: opacity 0.2s ease-in;
z-index: 10;
opacity: 0;
}
.ui-overlay.show {
display: block;
}
.ui-overlay.out {
opacity: 1;
}
@-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(-360deg);
}
}
.loading-anim {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10;
}
.loading-anim::before {
display: block;
background-color: rgba(0, 0, 0, 0.4);
content: '';
width: 9rem;
height: 9rem;
position: absolute;
top: 50%;
left: 50%;
margin: -4.5rem 0 0 -4.5rem;
border-radius: 10px;
}
.loading-anim::after {
display: block;
content: '';
width: 4.2rem;
height: 4.2rem;
position: absolute;
top: 50%;
left: 50%;
margin: -2.1rem 0 0 -2.1rem;
background-image: url(img/img_loading_white.png);
background-repeat: no-repeat;
background-size: 4.2rem;
background-position: 50%;
-webkit-animation-name: rotate;
-webkit-animation-duration: 1s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
}
.dialog {
position: fixed;
left: 25px;
right: 25px;
top: 50%;
display: none;
z-index: 11;
background-color: white;
border-radius: 4px;
-webkit-transform: scale(0.7) translateY(-71.4%);
-moz-transform: scale(0.7) translateY(-71.4%);
-ms-transform: scale(0.7) translateY(-71.4%);
transform: scale(0.7) translateY(-71.4%);
opacity: 0;
overflow: hidden;
-webkit-transition: all 0.2s;
-moz-transition: all 0.2s;
transition: all 0.2s;
box-shadow: -3px 3px 6px 4px rgba(0, 0, 0, 0.15);
}
.dialog.out {
-webkit-transform: scale(1) translateY(-50%);
-moz-transform: scale(1) translateY(-50%);
-ms-transform: scale(1) translateY(-50%);
transform: scale(1) translateY(-50%);
opacity: 1;
}
.dialog.show {
display: block;
}
.dialog .dialog-title {
height: 44px;
color: #888;
text-align: center;
font-size: 16px;
line-height: 44px;
border-bottom: 1px solid #efefef;
}
.dialog .dialog-wrapper {
background-color: transparent;
}
.dialog .dialog-wrapper .dialog-content {
overflow-y: auto;
padding: 10px;
color: #333;
line-height: 140%;
font-size: 13px;
box-sizing: border-box;
min-height: 32px;
max-height: 166px;
}
.dialog .dialog-wrapper .dialog-content h1 {
font-size: 16px;
color: #333333;
text-align: center;
line-height: 16px;
margin: 8px 0;
font-weight: normal;
}
.dialog .dialog-wrapper .dialog-content p {
font-size: 14px;
margin: 0;
color: #555;
line-height: 160%;
word-break: break-all;
}
.dialog .dialog-wrapper .dialog-content p a {
color: #439df8;
padding: 0 2px;
text-decoration: none;
}
.dialog .dialog-wrapper .dialog-content p a[href^=http] {
text-decoration: underline;
padding: 0 4px;
}
.dialog .dialog-wrapper .dialog-content p + p {
margin-top: 12px;
}
.dialog .dialog-wrapper .dialog-button-container {
font-size: 0;
width: 100%;
height: 44px;
line-height: 44px;
}
.dialog .dialog-wrapper .dialog-button {
height: 100%;
color: #439df8;
font-size: 16px;
text-align: center;
cursor: pointer;
display: inline-block;
position: relative;
padding: 0;
border: none;
outline: none;
width: 100%;
background-color: white;
box-sizing: border-box;
border-top: 1px solid #efefef;
}
.dialog .dialog-wrapper .dialog-button.d-2 {
width: 50%;
}
.dialog .dialog-wrapper .dialog-button.d-3 {
width: 33.33%;
}
.dialog .dialog-wrapper .dialog-button.cancel {
color: #a6a6a6;
background-color: #fff;
}
.dialog .dialog-wrapper .dialog-button.confirm {
border-top: none;
color: #fff;
background-color: #439df8;
}
.dialog .dialog-wrapper .dialog-button.confirm::before {
display: none !important;
}
.dialog .dialog-wrapper .dialog-button + .dialog-button::before {
content: '';
height: 100%;
display: block;
width: 1px;
position: absolute;
background-color: #f4f4f4;
left: 0;
top: 0;
}
This diff is collapsed.
![logo](media/logo_43.png)
# 社保H5接口文档
>查询本文档你将能了解到:
- 如何接入H5
- 如何拉取数据
- 常见问题及解决方案
[开始查看](#文档更新说明)
<footer>
<span>杭州煎饼网络技术有限公司 版权所有 &copy;2017 </span>
<span>由51公积金管家数据部门提供支持 </span>
</footer>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>社保H5接口文档</title>
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="vendor/themes/vue.css">
<style>
.markdown-section{
margin-left: 20px;
}
section.cover .cover-main>p a {
border-color: #42b983;
border: 1px solid var(--theme-color,#42b983);
border-radius: 2rem;
box-sizing: border-box;
color: #42b983;
color: var(--theme-color,#42b983);
display: inline-block;
font-size: 16.8px;
font-size: 1.05rem;
letter-spacing: 1.6px;
letter-spacing: .1rem;
margin-right: 16px;
margin-right: 1rem;
padding: .75em 32px;
padding: .75em 2rem;
text-decoration: none;
-webkit-transition: all .15s ease;
transition: all .15s ease
}
section.cover .cover-main>p a:last-child {
background-color: #42b983;
background-color: var(--theme-color,#42b983);
color: #fff;
margin-right: 0
}
section.cover .cover-main>p:last-child a:last-child:hover {
color: inherit;
opacity: .8
}
section.cover .cover-main>p:last-child a:hover {
color: inherit
}
section.cover footer{
}
</style>
</head>
<body>
<div id="app"></div>
</body>
<script>
window.$docsify = {
name: '社保H5接口文档',
themeColor: '#439df8',
coverpage: true,
maxLevel: 2,
externalLinkTarget: '_self',
auto2top: true,
plugins: [
function (hook) {
var footer = [
'<hr/>',
'<footer>',
'<span>杭州煎饼网络技术有限公司 版权所有 &copy;2017 </span>',
'<span> 由51公积金管家数据部门提供支持 </span>',
'</footer>'
].join('')
hook.afterEach(function (html) {
return html + footer
})
}
]
// or
// repo: 'https://github.com/QingWei-Li/docsify/'
}
</script>
<script src="vendor/docsify.js"></script>
<script src="vendor/themes/bash.js"></script>
<script src="vendor/themes/json_base.js"></script>
<script src="vendor/themes/zoom-img.js"></script>
</html>
This diff is collapsed.
(function(Prism) {
var insideString = {
variable: [
// Arithmetic Environment
{
pattern: /\$?\(\([\s\S]+?\)\)/,
inside: {
// If there is a $ sign at the beginning highlight $(( and )) as variable
variable: [{
pattern: /(^\$\(\([\s\S]+)\)\)/,
lookbehind: true
},
/^\$\(\(/,
],
number: /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee]-?\d+)?)\b/,
// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
operator: /--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,
// If there is no $ sign at the beginning highlight (( and )) as punctuation
punctuation: /\(\(?|\)\)?|,|;/
}
},
// Command Substitution
{
pattern: /\$\([^)]+\)|`[^`]+`/,
inside: {
variable: /^\$\(|^`|\)$|`$/
}
},
/\$(?:[a-z0-9_#\?\*!@]+|\{[^}]+\})/i
],
};
Prism.languages.bash = {
'shebang': {
pattern: /^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/,
alias: 'important'
},
'comment': {
pattern: /(^|[^"{\\])#.*/,
lookbehind: true
},
'string': [
//Support for Here-Documents https://en.wikipedia.org/wiki/Here_document
{
pattern: /((?:^|[^<])<<\s*)(?:"|')?(\w+?)(?:"|')?\s*\r?\n(?:[\s\S])*?\r?\n\2/g,
lookbehind: true,
greedy: true,
inside: insideString
},
{
pattern: /(["'])(?:\\\\|\\?[^\\])*?\1/g,
greedy: true,
inside: insideString
}
],
'variable': insideString.variable,
// Originally based on http://ss64.com/bash/
'function': {
pattern: /(^|\s|;|\||&)(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|npm|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|\s|;|\||&)/,
lookbehind: true
},
'keyword': {
pattern: /(^|\s|;|\||&)(?:let|:|\.|if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)(?=$|\s|;|\||&)/,
lookbehind: true
},
'boolean': {
pattern: /(^|\s|;|\||&)(?:true|false)(?=$|\s|;|\||&)/,
lookbehind: true
},
'operator': /&&?|\|\|?|==?|!=?|<<<?|>>|<=?|>=?|=~/,
'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];]/
};
var inside = insideString.variable[1].inside;
inside['function'] = Prism.languages.bash['function'];
inside.keyword = Prism.languages.bash.keyword;
inside.boolean = Prism.languages.bash.boolean;
inside.operator = Prism.languages.bash.operator;
inside.punctuation = Prism.languages.bash.punctuation;
})(Prism);
Prism.languages.json = {
'property': /"(?:\\.|[^\\"])*"(?=\s*:)/ig,
'string': /"(?!:)(?:\\.|[^\\"])*"(?!:)/g,
'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?)\b/g,
'punctuation': /[{}[\]);,]/g,
'operator': /:/g,
'boolean': /\b(true|false)\b/gi,
'null': /\bnull\b/gi
};
Prism.languages.jsonp = Prism.languages.json;
This diff is collapsed.
(function () {
'use strict';
/*
* medium-zoom v0.2.0
* Medium zoom on your images in vanilla JavaScript
* Copyright 2017 Francois Chalifour
* https://github.com/francoischalifour/medium-zoom
* MIT License
*/function __$styleInject(a,b){if('undefined'==typeof document){ return b; }a=a||'';var c=document.head||document.getElementsByTagName('head')[0],d=document.createElement('style');return d.type='text/css',c.appendChild(d),d.styleSheet?d.styleSheet.cssText=a:d.appendChild(document.createTextNode(a)),b}function createCommonjsModule(a,b){return b={exports:{}},a(b,b.exports),b.exports}var _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++){ for(var d in b=arguments[c],b){ Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]); } }return a}; var toConsumableArray=function(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++){ c[b]=a[b]; }return c}return Array.from(a)}; var mediumZoom_1=createCommonjsModule(function(a){var b=['IMG'],c=[27,81],d=function(a){return b.includes(a.tagName)},e=function(a){return a.naturalWidth!==a.width},f=function(a){return NodeList.prototype.isPrototypeOf(a)||HTMLCollection.prototype.isPrototypeOf(a)},g=function(a){return a&&1===a.nodeType};a.exports=function(a){var h=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=h.margin,j=void 0===i?0:i,k=h.background,l=void 0===k?'#fff':k,m=h.scrollOffset,n=void 0===m?48:m,o=h.metaClick,p=function(a){var b=a.getBoundingClientRect(),c=b.top,d=b.left,e=b.width,f=b.height,g=a.cloneNode(),h=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,i=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return g.removeAttribute('id'),g.style.position='absolute',g.style.top=c+h+'px',g.style.left=d+i+'px',g.style.width=e+'px',g.style.height=f+'px',g.style.transform='',g},q=function(){if(C.template){ if(C.template.dispatchEvent(new Event('show')),D=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,E=!0,C.zoomed=p(C.template),document.body.appendChild(B),document.body.appendChild(C.zoomed),requestAnimationFrame(function(){document.body.classList.add('medium-zoom--open');}),C.template.style.visibility='hidden',C.zoomed.classList.add('medium-zoom-image--open'),C.zoomed.addEventListener('click',r),C.zoomed.addEventListener('transitionend',u),C.template.getAttribute('data-zoom-target')){C.zoomedHd=C.zoomed.cloneNode(),C.zoomedHd.src=C.zoomed.getAttribute('data-zoom-target'),C.zoomedHd.onerror=function(){clearInterval(a),console.error('Unable to reach the zoom image target '+C.zoomedHd.src),C.zoomedHd=null,y();};var a=setInterval(function(){C.zoomedHd.naturalWidth&&(clearInterval(a),C.zoomedHd.classList.add('medium-zoom-image--open'),C.zoomedHd.addEventListener('click',r),document.body.appendChild(C.zoomedHd),y());},10);}else { y(); } }},r=function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,c=function(){E||!C.template||(C.template.dispatchEvent(new Event('hide')),E=!0,document.body.classList.remove('medium-zoom--open'),C.zoomed.style.transform='',C.zoomedHd&&(C.zoomedHd.style.transform='',C.zoomedHd.removeEventListener('click',a)),C.zoomed.removeEventListener('click',a),C.zoomed.addEventListener('transitionend',v));};0<b?setTimeout(c,b):c();},s=function(a){C.template?r():(C.template=a?a.target:A[0],q());},t=function(a){return(a.metaKey||a.ctrlKey)&&z.metaClick?window.open(a.target.getAttribute('data-original')||a.target.parentNode.href||a.target.src,'_blank'):void(a.preventDefault(),s(a))},u=function a(){E=!1,C.zoomed.removeEventListener('transitionend',a),C.template.dispatchEvent(new Event('shown'));},v=function a(){C.template&&(C.template.style.visibility='',document.body.removeChild(C.zoomed),C.zoomedHd&&document.body.removeChild(C.zoomedHd),document.body.removeChild(B),C.zoomed.classList.remove('medium-zoom-image--open'),E=!1,C.zoomed.removeEventListener('transitionend',a),C.template.dispatchEvent(new Event('hidden')),C.template=null,C.zoomed=null,C.zoomedHd=null);},w=function(){if(!E&&C.template){var a=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(D-a)>z.scrollOffset&&r(150);}},x=function(a){c.includes(a.keyCode||a.which)&&r();},y=function(){var a=Math.min;if(C.template){var b=window.innerWidth,c=window.innerHeight,d=b-2*z.margin,e=c-2*z.margin,f=C.zoomedHd||C.template,g=f.naturalWidth,h=void 0===g?d:g,i=f.naturalHeight,j=void 0===i?e:i,k=f.getBoundingClientRect(),l=k.top,m=k.left,n=k.width,o=k.height,p=a(h,d)/n,q=a(j,e)/o,r=a(p,q)||1,s=(-m+(d-n)/2+z.margin)/r,t=(-l+(e-o)/2+z.margin)/r,u='scale('+r+') translate3d('+s+'px, '+t+'px, 0)';C.zoomed.style.transform=u,C.zoomedHd&&(C.zoomedHd.style.transform=u);}},z={margin:j,background:l,scrollOffset:n,metaClick:void 0===o||o};a instanceof Object&&_extends(z,a);var A=function(a){try{return Array.isArray(a)?a.filter(d):f(a)?[].concat(toConsumableArray(a)).filter(d):g(a)?[a].filter(d):'string'==typeof a?[].concat(toConsumableArray(document.querySelectorAll(a))).filter(d):[].concat(toConsumableArray(document.querySelectorAll(b.map(function(a){return a.toLowerCase()}).join(',')))).filter(e)}catch(a){throw new TypeError('The provided selector is invalid.\nExpects a CSS selector, a Node element, a NodeList, an HTMLCollection or an array.\nSee: https://github.com/francoischalifour/medium-zoom')}}(a),B=function(a){var b=document.createElement('div');return b.classList.add('medium-zoom-overlay'),b.style.backgroundColor=a,b}(z.background),C={template:null,zoomed:null,zoomedHd:null},D=0,E=!1;return A.forEach(function(a){a.classList.add('medium-zoom-image'),a.addEventListener('click',t);}),B.addEventListener('click',r),document.addEventListener('scroll',w),document.addEventListener('keyup',x),window.addEventListener('resize',r),{show:s,hide:r,toggle:s,update:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return a.background&&(B.style.backgroundColor=a.background),_extends(z,a)},addEventListeners:function(a,b){A.forEach(function(c){c.addEventListener(a,b);});},detach:function(){var a=function a(){var b=new Event('detach');A.forEach(function(a){a.classList.remove('medium-zoom-image'),a.removeEventListener('click',t),a.dispatchEvent(b);}),A.splice(0,A.length),B.removeEventListener('click',r),document.removeEventListener('scroll',w),document.removeEventListener('keyup',x),window.removeEventListener('resize',r),C.zoomed&&C.zoomed.removeEventListener('transitionend',a);};C.zoomed?(r(),C.zoomed.addEventListener('transitionend',requestAnimationFrame(a))):a();},images:A,options:z}};});__$styleInject('.medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--open .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s}.medium-zoom-image--open{position:relative;z-index:1;cursor:pointer;cursor:zoom-out;will-change:transform}',void 0);var src=mediumZoom_1;
function install (hook) {
var zoom;
hook.doneEach(function (_) {
if (zoom) {
zoom.detach();
}
zoom = src('img:not(.emoji):not([data-no-zoom])');
});
}
$docsify.plugins = [].concat(install, $docsify.plugins);
}());
!> 特别提醒: <br> 1. 时间戳(timestamp): 采用北京时间, 时间戳误差60秒内有效。
# **1** 接入网址说明
## **1.1** 协议说明
> 只支持https
## **1.2** 域名说明
>| 名称 | 域名|
|:--------|---------:|
| H5| ```https://t.51gjj.com/```|
# **2** 打开H5页面
## **2.1** H5访问入口说明
!> 访问之前需要生成校验码,生成过程见[附录3.1](#_31-生成校验码规则)
<table>
<tr>
<td>DOMAIN</td>
<td colspan=4>H5域名</td>
</tr>
<tr>
<td>PATH</td>
<td colspan=4>/shebao</td>
</tr>
<tr>
<td>METHOD</td>
<td colspan=4>GET</td>
</tr>
<tr>
<td rowspan=12>GET参数</td>
<td>参数名</td>
<td>参数类型</td>
<td>参数描述</td>
<td>可空</td>
</tr>
<tr>
<td>timestamp</td>
<td>string</td>
<td>生成校验码时的时间戳(单位:ms)</td>
<td>NO</td>
</tr>
<tr>
<td>checkCode</td>
<td>string</td>
<td>校验码</td>
<td>NO</td>
</tr>
<tr>
<td>channel</td>
<td>string</td>
<td>gswechat(必填且写死)</td>
<td>NO</td>
</tr>
<tr>
<td>appKey</td>
<td>string</td>
<td>平台发放给开发者的标识开发者身份的标识符</td>
<td>NO</td>
</tr>
</table>
# **2** 附录
## **2.1** 生成校验码规则
校验码生成规则:
>- 1、获取当前时间戳```(T)```,精确到毫秒,```13```位。 (转换结果与 http://tool.chinaz.com/Tools/unixtime.aspx 转换的结果保持一致)
>- 2、从T中,获取倒数第二位值```(M)```(若倒数第二位为```0```,则取倒数第三位,若倒数第三位为```0```,则取倒数第四位......直到取到值不为```0```)和倒数第一位值```(N)```
>- 3、以```M*K```(```K```从```0```开始递增,```0,1,2```.....)为间隔,从```T```中取出相应下标对应的值```(A,B,C,D.....)```,```M*K```大于13时取数完成。
>- 4、用第3步的值分别与```N```相加,得到```A1,B1,C1,D1```
>- 5、拼接第4步得到的值,```A1B1C1D1``` 该值即为校验码​
示例:
>- 1、获取当前时间戳 ```1522396007568```
>- 2、取出```M=6,N=8```
>- 3、以```M*K```为间隔取出相应下标对应的值,```6*0=0,A=1;6*1=6,B=6;6*2=12,C=8;6*3=18```,大于```13```,取值结束
>- 4、分别与```N```相加,```A1=A+N=9;B1=B+N=14;C1=C+N=16```
>- 5、拼接值 ```A1B1C1 = 91416```
```"91416"```即为校验码
# **4** F&Q 常见问题解答
## **4.1** 界面相关问题
#### 1、接入流程是什么样子的?
> 查询流程,可点击放大查看
> ![flowchart](img/flowchart.png)
#### 2、页面及查询流程是什么样子的?
> 查询流程,可点击放大查看
> ![step1](img/flow.png)
> 结果页
![step1](img/show1.png) ![step1](img/show2.png)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>社保H5接口文档(工商银行专用)</title>
<meta name="description" content="Description">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="vendor/themes/vue.css">
<style>
.markdown-section{
margin-left: 20px;
}
.field-support {
background: content-box;
font-size: 15px;
border: 1px solid #ddd;
padding: 6px 20px;
}
</style>
</head>
<body>
<div id="app"></div>
</body>
<script>
window.$docsify = {
name: '社保H5接口文档(工商银行专用)',
repo: '',
themeColor: '#439df8',
maxLevel: 2,
externalLinkTarget: '_self',
auto2top: true
}
</script>
<script src="vendor/docsify.js"></script>
<script src="vendor/themes/bash.js"></script>
<script src="vendor/themes/json_base.js"></script>
<script src="vendor/themes/zoom-img.js"></script>
</html>
This diff is collapsed.
(function(Prism) {
var insideString = {
variable: [
// Arithmetic Environment
{
pattern: /\$?\(\([\s\S]+?\)\)/,
inside: {
// If there is a $ sign at the beginning highlight $(( and )) as variable
variable: [{
pattern: /(^\$\(\([\s\S]+)\)\)/,
lookbehind: true
},
/^\$\(\(/,
],
number: /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee]-?\d+)?)\b/,
// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
operator: /--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,
// If there is no $ sign at the beginning highlight (( and )) as punctuation
punctuation: /\(\(?|\)\)?|,|;/
}
},
// Command Substitution
{
pattern: /\$\([^)]+\)|`[^`]+`/,
inside: {
variable: /^\$\(|^`|\)$|`$/
}
},
/\$(?:[a-z0-9_#\?\*!@]+|\{[^}]+\})/i
],
};
Prism.languages.bash = {
'shebang': {
pattern: /^#!\s*\/bin\/bash|^#!\s*\/bin\/sh/,
alias: 'important'
},
'comment': {
pattern: /(^|[^"{\\])#.*/,
lookbehind: true
},
'string': [
//Support for Here-Documents https://en.wikipedia.org/wiki/Here_document
{
pattern: /((?:^|[^<])<<\s*)(?:"|')?(\w+?)(?:"|')?\s*\r?\n(?:[\s\S])*?\r?\n\2/g,
lookbehind: true,
greedy: true,
inside: insideString
},
{
pattern: /(["'])(?:\\\\|\\?[^\\])*?\1/g,
greedy: true,
inside: insideString
}
],
'variable': insideString.variable,
// Originally based on http://ss64.com/bash/
'function': {
pattern: /(^|\s|;|\||&)(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|npm|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|\s|;|\||&)/,
lookbehind: true
},
'keyword': {
pattern: /(^|\s|;|\||&)(?:let|:|\.|if|then|else|elif|fi|for|break|continue|while|in|case|function|select|do|done|until|echo|exit|return|set|declare)(?=$|\s|;|\||&)/,
lookbehind: true
},
'boolean': {
pattern: /(^|\s|;|\||&)(?:true|false)(?=$|\s|;|\||&)/,
lookbehind: true
},
'operator': /&&?|\|\|?|==?|!=?|<<<?|>>|<=?|>=?|=~/,
'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];]/
};
var inside = insideString.variable[1].inside;
inside['function'] = Prism.languages.bash['function'];
inside.keyword = Prism.languages.bash.keyword;
inside.boolean = Prism.languages.bash.boolean;
inside.operator = Prism.languages.bash.operator;
inside.punctuation = Prism.languages.bash.punctuation;
})(Prism);
Prism.languages.json = {
'property': /"(?:\\.|[^\\"])*"(?=\s*:)/ig,
'string': /"(?!:)(?:\\.|[^\\"])*"(?!:)/g,
'number': /\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?)\b/g,
'punctuation': /[{}[\]);,]/g,
'operator': /:/g,
'boolean': /\b(true|false)\b/gi,
'null': /\bnull\b/gi
};
Prism.languages.jsonp = Prism.languages.json;
This diff is collapsed.
(function () {
'use strict';
/*
* medium-zoom v0.2.0
* Medium zoom on your images in vanilla JavaScript
* Copyright 2017 Francois Chalifour
* https://github.com/francoischalifour/medium-zoom
* MIT License
*/function __$styleInject(a,b){if('undefined'==typeof document){ return b; }a=a||'';var c=document.head||document.getElementsByTagName('head')[0],d=document.createElement('style');return d.type='text/css',c.appendChild(d),d.styleSheet?d.styleSheet.cssText=a:d.appendChild(document.createTextNode(a)),b}function createCommonjsModule(a,b){return b={exports:{}},a(b,b.exports),b.exports}var _extends=Object.assign||function(a){for(var b,c=1;c<arguments.length;c++){ for(var d in b=arguments[c],b){ Object.prototype.hasOwnProperty.call(b,d)&&(a[d]=b[d]); } }return a}; var toConsumableArray=function(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++){ c[b]=a[b]; }return c}return Array.from(a)}; var mediumZoom_1=createCommonjsModule(function(a){var b=['IMG'],c=[27,81],d=function(a){return b.includes(a.tagName)},e=function(a){return a.naturalWidth!==a.width},f=function(a){return NodeList.prototype.isPrototypeOf(a)||HTMLCollection.prototype.isPrototypeOf(a)},g=function(a){return a&&1===a.nodeType};a.exports=function(a){var h=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=h.margin,j=void 0===i?0:i,k=h.background,l=void 0===k?'#fff':k,m=h.scrollOffset,n=void 0===m?48:m,o=h.metaClick,p=function(a){var b=a.getBoundingClientRect(),c=b.top,d=b.left,e=b.width,f=b.height,g=a.cloneNode(),h=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,i=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return g.removeAttribute('id'),g.style.position='absolute',g.style.top=c+h+'px',g.style.left=d+i+'px',g.style.width=e+'px',g.style.height=f+'px',g.style.transform='',g},q=function(){if(C.template){ if(C.template.dispatchEvent(new Event('show')),D=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,E=!0,C.zoomed=p(C.template),document.body.appendChild(B),document.body.appendChild(C.zoomed),requestAnimationFrame(function(){document.body.classList.add('medium-zoom--open');}),C.template.style.visibility='hidden',C.zoomed.classList.add('medium-zoom-image--open'),C.zoomed.addEventListener('click',r),C.zoomed.addEventListener('transitionend',u),C.template.getAttribute('data-zoom-target')){C.zoomedHd=C.zoomed.cloneNode(),C.zoomedHd.src=C.zoomed.getAttribute('data-zoom-target'),C.zoomedHd.onerror=function(){clearInterval(a),console.error('Unable to reach the zoom image target '+C.zoomedHd.src),C.zoomedHd=null,y();};var a=setInterval(function(){C.zoomedHd.naturalWidth&&(clearInterval(a),C.zoomedHd.classList.add('medium-zoom-image--open'),C.zoomedHd.addEventListener('click',r),document.body.appendChild(C.zoomedHd),y());},10);}else { y(); } }},r=function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,c=function(){E||!C.template||(C.template.dispatchEvent(new Event('hide')),E=!0,document.body.classList.remove('medium-zoom--open'),C.zoomed.style.transform='',C.zoomedHd&&(C.zoomedHd.style.transform='',C.zoomedHd.removeEventListener('click',a)),C.zoomed.removeEventListener('click',a),C.zoomed.addEventListener('transitionend',v));};0<b?setTimeout(c,b):c();},s=function(a){C.template?r():(C.template=a?a.target:A[0],q());},t=function(a){return(a.metaKey||a.ctrlKey)&&z.metaClick?window.open(a.target.getAttribute('data-original')||a.target.parentNode.href||a.target.src,'_blank'):void(a.preventDefault(),s(a))},u=function a(){E=!1,C.zoomed.removeEventListener('transitionend',a),C.template.dispatchEvent(new Event('shown'));},v=function a(){C.template&&(C.template.style.visibility='',document.body.removeChild(C.zoomed),C.zoomedHd&&document.body.removeChild(C.zoomedHd),document.body.removeChild(B),C.zoomed.classList.remove('medium-zoom-image--open'),E=!1,C.zoomed.removeEventListener('transitionend',a),C.template.dispatchEvent(new Event('hidden')),C.template=null,C.zoomed=null,C.zoomedHd=null);},w=function(){if(!E&&C.template){var a=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(D-a)>z.scrollOffset&&r(150);}},x=function(a){c.includes(a.keyCode||a.which)&&r();},y=function(){var a=Math.min;if(C.template){var b=window.innerWidth,c=window.innerHeight,d=b-2*z.margin,e=c-2*z.margin,f=C.zoomedHd||C.template,g=f.naturalWidth,h=void 0===g?d:g,i=f.naturalHeight,j=void 0===i?e:i,k=f.getBoundingClientRect(),l=k.top,m=k.left,n=k.width,o=k.height,p=a(h,d)/n,q=a(j,e)/o,r=a(p,q)||1,s=(-m+(d-n)/2+z.margin)/r,t=(-l+(e-o)/2+z.margin)/r,u='scale('+r+') translate3d('+s+'px, '+t+'px, 0)';C.zoomed.style.transform=u,C.zoomedHd&&(C.zoomedHd.style.transform=u);}},z={margin:j,background:l,scrollOffset:n,metaClick:void 0===o||o};a instanceof Object&&_extends(z,a);var A=function(a){try{return Array.isArray(a)?a.filter(d):f(a)?[].concat(toConsumableArray(a)).filter(d):g(a)?[a].filter(d):'string'==typeof a?[].concat(toConsumableArray(document.querySelectorAll(a))).filter(d):[].concat(toConsumableArray(document.querySelectorAll(b.map(function(a){return a.toLowerCase()}).join(',')))).filter(e)}catch(a){throw new TypeError('The provided selector is invalid.\nExpects a CSS selector, a Node element, a NodeList, an HTMLCollection or an array.\nSee: https://github.com/francoischalifour/medium-zoom')}}(a),B=function(a){var b=document.createElement('div');return b.classList.add('medium-zoom-overlay'),b.style.backgroundColor=a,b}(z.background),C={template:null,zoomed:null,zoomedHd:null},D=0,E=!1;return A.forEach(function(a){a.classList.add('medium-zoom-image'),a.addEventListener('click',t);}),B.addEventListener('click',r),document.addEventListener('scroll',w),document.addEventListener('keyup',x),window.addEventListener('resize',r),{show:s,hide:r,toggle:s,update:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return a.background&&(B.style.backgroundColor=a.background),_extends(z,a)},addEventListeners:function(a,b){A.forEach(function(c){c.addEventListener(a,b);});},detach:function(){var a=function a(){var b=new Event('detach');A.forEach(function(a){a.classList.remove('medium-zoom-image'),a.removeEventListener('click',t),a.dispatchEvent(b);}),A.splice(0,A.length),B.removeEventListener('click',r),document.removeEventListener('scroll',w),document.removeEventListener('keyup',x),window.removeEventListener('resize',r),C.zoomed&&C.zoomed.removeEventListener('transitionend',a);};C.zoomed?(r(),C.zoomed.addEventListener('transitionend',requestAnimationFrame(a))):a();},images:A,options:z}};});__$styleInject('.medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--open .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s}.medium-zoom-image--open{position:relative;z-index:1;cursor:pointer;cursor:zoom-out;will-change:transform}',void 0);var src=mediumZoom_1;
function install (hook) {
var zoom;
hook.doneEach(function (_) {
if (zoom) {
zoom.detach();
}
zoom = src('img:not(.emoji):not([data-no-zoom])');
});
}
$docsify.plugins = [].concat(install, $docsify.plugins);
}());
{
"env": {
"browser": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
"tab"
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
]
}
}
\ No newline at end of file
This diff is collapsed.
'use strict';
$.ajax = function(args) {
var request=new XMLHttpRequest();
var url = args.url;
var data = args.data || {};
request.onreadystatechange=function(){
if (request.readyState == 4) {
if(request.status == 200){
var dataType = null;
if ('dataType' in args) {
dataType = args.dataType;
}else{
if(/\bContent\-Type\s*:\s* ([^\n;]+)(?=\n|;)/i.test(request.getAllResponseHeaders())){
var contentType = RegExp.$1;
if(/^\s*application\/json\s*$/i.test(contentType) || /^\s*text\/json\s*$/i.test(contentType)){
dataType = 'json';
}else if(/^\s*text\/html\s*$/i.test(contentType) || /^\s*text\/plain\s*$/i.test(contentType)){
dataType = 'text';
}else{
dataType = 'text';
}
}
}
var data = null;
if(/^json$/i.test(dataType)){
data = JSON.parse(request.responseText);
}else {
data = request.responseText;
}
try{
if (typeof args.success == 'function') {
args.success(data);
}
} catch (e) {
}
}else{
if (typeof args.error == 'function') {
args.error(request.status);
}
}
}
}
if ('timeout' in args) {
request.timeout = args.timeout;
}
if ((args.type&&/^post$/gi.test(args.type))) {
request.open("POST",url,true);
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
var sp = '',content = '';
for(var prop in data){
content+= sp + prop + '=' + encodeURIComponent(data[prop]);
sp = '&';
}
request.send(content);
}else{
var sp = /\?/.test(url)?'&':'?';
for(var prop in data){
url+= sp + prop + '=' + encodeURIComponent(data[prop]);
sp = '&';
}
request.open("GET",url,true);
request.send();
}
}
function getURLParams( url ) {
var urlParts = url.split("?");
var result = {};
if( urlParts[1] ) {
var params = urlParts[1].split("&");
for ( var i = 0; i < params.length; ++i ) {
var item = params[i].split("=");
var key = decodeURIComponent(item[0]);
var val = decodeURIComponent(item[1]);
result[key] = val;
}
}
return result;
}
function serializeParams(data){
var serializedParams = '';
for (var pro in data) {
serializedParams += (serializedParams.length?'&':'') + pro + '='+encodeURIComponent(data[pro]);
}
return serializedParams;
}
function extendMethod (class_name,method_set) {
for (var method_name in method_set) {
class_name.prototype[method_name] = method_set[method_name];
}
}
function EventListener(){
}
extendMethod(EventListener,{
on : function(event,func) {
if (typeof event === 'string' && typeof func === 'function') {
var list = this['on'+event+'list'];
if (list instanceof Array) {
for (var i = 0; i < list.length; i++) {
if (list[i]===func) {
return this;
}
}
list.push(func);
}else{
this['on'+event+'list']=[func];
}
}
return this;
},
off : function(event,func){
var list = this['on'+event+'list'];
if (list instanceof Array) {
if (!func) {
list.length && list.splice(0,list.length);
}else{
for (var i = 0; i < list.length; i++) {
if (list[i]===func) {
list.splice(i,1);
break;
}
}
}
}
return this;
},
trigger : function(event){
var result = false, list = this['on'+event+'list'];
if (list instanceof Array) {
for(var i=0;i<list.length;i++){
var func = list[i];
if(typeof func != 'function'){
continue;
}
var args = Array.prototype.slice.call(arguments, 0);
args.shift();
result = result || func.apply(this,args);
}
}
return result;
}
});
function __(){
this.timer = 0;
this.queue = [];
this.complete = null;
}
__.prototype.then = function(cb,delay){
this.queue.push({callback:cb,delay:delay});
return this;
}
__.prototype.end = function(cb){
this.complete = cb;
return this;
}
__.prototype.abort = function(){
if(this.timer) {
clearTimeout(this.timer);
this.timer = 0;
}
return this;
}
__.prototype.commit = function(){
var self = this;
if (this.queue.length && !this.timer) {
var top = this.queue.shift();
if (typeof top.callback == 'function') {
if (typeof top.delay != 'number' || top.delay <=0) {
top.callback.apply(self);
this.commit();
}else{
this.timer = setTimeout(function(){
top.callback.apply(self);
self.timer = 0;
self.commit();
}, top.delay);
}
}else{
self.commit();
}
}else if(!this.queue.length && !this.timer){
if (typeof this.complete == 'function') {
this.complete.apply(this);
this.complete = null;
}
}
return this;
}
function then(cb,delay){
return (new __()).then(cb,delay);
}
$(function(){
document.body.addEventListener('touchstart', function(){});
});
\ No newline at end of file
$.setTool = function(c){
if(typeof window.toolFunClose =="undefined"){
window.toolFunClose=[];
}
for (var i = 0; i < window.toolFunClose.length; i++) {
window.toolFunClose[i].callback();
};
window.toolFunClose=[];
window.toolFunClose.push({callback:c})
}
$.extend($.fn,{
valMap:function(){
var data = {};
for (var i = 0; i < this.length; i++) {
var ele = $(this[i]);
var name = ele.attr('name');
if (name) {
data[name]=ele.val();
}
}
return data;
},
checkAll:function(strict){
for (var i = 0; i < this.length; i++) {
var errmsg = $(this[i]).checkVal(strict);
if (errmsg) {
return errmsg;
}
}
return null;
},
checkVal:function(strict){
var self = $(this),val = self.val(),errmsg = null,label = self.data('label');
if (self.hasClass('required')) {
if(/^\s*$/.test(val)){
return (label && (errmsg = '请先填写'+label))||(errmsg = '请填写完所有必填的内容'),errmsg;
}
}
if (self.hasClass('required-checked')&&self.is('[type=checkbox]')){
if(!self.is(':checked')){
return self.data('msg')||'请先勾选';
}
}
if (!!strict) {
if (self.hasClass('useIDCard')) {
if(!/^\d{14}(\d{3})?[\dXx]$/.test(val)){
return '身份证格式不对';
}
}
if (self.hasClass('userPhone')) {
if(!/^\d{11}$/.test(val)){
return '手机格式不正确';
}
}
if (self.hasClass("useEmail")) {
if (!/^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/.test(val)) {
return '邮箱格式不正确';
}
}
}
return errmsg;
},
inteSub:function(selector,doSubmit,doAbort,body){
var items = body?$(body).find(selector):$(selector);
var func = (function(items,button){
return function(){
for (var i = 0; i < items.length; i++) {
var r = $(items[i]);
if (r.hasClass('ignore')) {
continue;
}else if (r.is("[type=hidden]")) {
if (!r.parent().is(":visible")) {
continue;
}
}else if (r.is("[type=checkbox]")) {
if(!r.is(":visible") && !r.parent().is(":visible")){
continue;
}
}else if(!r.is(":visible")){
continue;
}
var errmsg = r.checkVal();
if (errmsg) {
button.addClass('disabled').attr("disabled","disabled");
return;
}
}
button.removeClass('disabled').removeAttr("disabled");
}
})(items,this);
items.off('input change propertychange').on('input change propertychange',func).eq(0).trigger('input');
this.off('click').on('click',function(){
var data = {};
for (var i = 0; i < items.length; i++) {
var r = $(items[i]);
if (r.hasClass('ignore')) {
continue;
}else if (r.is("[type=hidden]")) {
if (!r.parent().is(":visible")) {
continue;
}
}else if (r.is("[type=checkbox]")) {
if(!r.is(":visible") && !r.parent().is(":visible")){
continue;
}
}else if(!r.is(":visible")){
continue;
}
var errmsg = r.checkVal(true);
if (errmsg) {
typeof doAbort == 'function' && doAbort.call($(this),errmsg);
return;
}
var name = r.attr('name');
name && !/^\s*$/.test(r.val()) &&(data[name]=r.val());
}
typeof doSubmit == 'function' && doSubmit.call($(this),data);
});
},
lock:function(cd){
var self = $(this),text = self.html(),i = cd;
self.data('origin-text',text);
var call = function(){
if(i>0){
self.html(i+'秒');
self.attr("disabled","disabled");
} else {
self.html(self.data('origin-text'));
self.removeAttr("disabled");
self.data('timer',0);
clearInterval(timer);
}
i--;
}
var timer = setInterval(call,1000);
self.data('timer',timer);
call();
var id = self.attr('id');
if (window.localStorage && id) {
var cache = window.localStorage['lock_cd'];
if (cache) {
cache = JSON.parse(cache);
}else{
cache = {}
}
cache[id] = Math.round(new Date().getTime()/1000)+cd;
window.localStorage['lock_cd'] = JSON.stringify(cache);
}
},
unlock:function(){
var self = $(this);
self.html(self.data('origin-text'));
self.removeAttr("disabled");
var timer = self.data('timer');
timer && clearInterval(timer);
}
});
function getURLParams( url ) {
var urlParts = url.split("?");
var result = {};
if( urlParts[1] ) {
var params = urlParts[1].split("&");
for ( var i = 0; i < params.length; ++i ) {
var item = params[i].split("=");
var key = decodeURIComponent(item[0]);
var val = decodeURIComponent(item[1]);
result[key] = val;
}
}
return result;
}
function serializeParams(data){
var serializedParams = '';
for (var pro in data) {
serializedParams += (serializedParams.length?'&':'') + pro + '='+encodeURIComponent(data[pro]);
}
return serializedParams;
}
\ No newline at end of file
This diff is collapsed.
$.extend($.fn,{
valMap:function(){
var data = {};
for (var i = 0; i < this.length; i++) {
var ele = $(this[i]);
var name = ele.attr('name');
if (name) {
data[name]=ele.val();
}
}
return data;
},
checkAll:function(strict){
for (var i = 0; i < this.length; i++) {
var errmsg = $(this[i]).checkVal(strict);
if (errmsg) {
return errmsg;
}
}
return null;
},
checkVal:function(strict){
var self = $(this),val = self.val(),errmsg = null,label = self.data('label');
if (self.hasClass('required')) {
if(/^\s*$/.test(val)){
return (label && (errmsg = '请先填写'+label))||(errmsg = '请填写完所有必填的内容'),errmsg;
}
}
if (self.hasClass('required-checked')&&self.is('[type=checkbox]')){
if(!self.is(':checked')){
return self.data('msg')||'请先勾选';
}
}
if (!!strict) {
if (self.hasClass('useIDCard')) {
if(!/^\d{14}(\d{3})?[\dXx]$/.test(val)){
return '身份证格式不对';
}
}
if (self.hasClass('usePhone')) {
if(!/^1\d{10}$/.test(val)){
return '手机格式不正确';
}
}
if (self.hasClass("useEmail")) {
if (!/^(\w)+(\.\w+)*@(\w)+((\.\w+)+)$/.test(val)) {
return '邮箱格式不正确';
}
}
if (self.attr('data-equal')){
var target = $('[name='+self.attr('data-equal')+']');
if (target.val()!=self.val()) {
return label+'与'+target.data('label')+"不一致";
}
}
}
return errmsg;
},
inteSub:function(selector,doSubmit,doAbort,body){
var items = typeof selector == 'object'?selector:(body?$(body).find(selector):$(selector));
var func = (function(items,button){
return function(){
if (items.not("[type=checkbox]").length == 0) {
button.addClass('disabled').attr("disabled","disabled");
return;
}
for (var i = 0; i < items.length; i++) {
var r = $(items[i]);
if (r.is("[type=hidden]")) {
if (!r.parent().is(":visible")) {
continue;
}
}else if (r.is("[type=checkbox]")) {
if(!r.is(":visible") && !r.parent().is(":visible")){
continue;
}
}else if(!r.is(":visible")){
continue;
}
var errmsg = r.checkVal();
if (errmsg) {
button.addClass('disabled').attr("disabled","disabled");
return;
}
}
button.removeClass('disabled').removeAttr("disabled");
}
})(items,this);
items.off('input change').on('input change',func).eq(0).trigger('input').not("[type=checkbox]").length || this.addClass('disabled').attr("disabled","disabled");
this.off('click').on('click',function(){
var data = {};
for (var i = 0; i < items.length; i++) {
var r = $(items[i]);
if (r.is("[type=hidden]")) {
if (!r.parent().is(":visible")) {
continue;
}
}else if (r.is("[type=checkbox]")) {
if(!r.is(":visible") && !r.parent().is(":visible")){
continue;
}
}else if(!r.is(":visible")){
continue;
}
var errmsg = r.checkVal(true);
if (errmsg) {
typeof doAbort == 'function' && doAbort.call($(this),errmsg);
return;
}
var name = r.attr('name');
name && !/^\s*$/.test(r.val()) &&(data[name]=r.val());
}
typeof doSubmit == 'function' && doSubmit.call($(this),data);
});
},
lock:function(cd){
var self = $(this),text = self.html(),i = cd;
self.data('origin-text',text);
var call = function(){
if(i>0){
self.html(i+'秒');
self.attr("disabled","disabled");
} else {
self.html(self.data('origin-text'));
self.removeAttr("disabled");
self.data('timer',0);
clearInterval(timer);
self.trigger("clickready");
}
i--;
}
var timer = setInterval(call,1000);
self.data('timer',timer);
call();
var id = self.data('id');
if (window.localStorage && id) {
var cache = window.localStorage['lock_cd'];
if (cache) {
cache = JSON.parse(cache);
}else{
cache = {}
}
cache[id] = Math.round(new Date().getTime()/1000)+cd;
window.localStorage['lock_cd'] = JSON.stringify(cache);
}
},
unlock:function(){
var self = $(this);
self.html(self.data('origin-text'));
self.removeAttr("disabled");
var timer = self.data('timer');
timer && clearInterval(timer);
var id = self.data('id');
if (window.localStorage) {
var cache = window.localStorage['lock_cd'];
if (cache) {
cache = JSON.parse(cache);
}else{
cache = {}
}
delete cache[id];
window.localStorage['lock_cd'] = JSON.stringify(cache);
}
},
restoreLock:function(){
var self = $(this);
if (window.localStorage) {
var cache = window.localStorage['lock_cd'];
if (cache) {
cache = JSON.parse(cache);
}
var now = Math.round(new Date().getTime()/1000);
for (var id in cache) {
var cdt = cache[id];
if (cdt-now>0 ) {
(self.data('id')==id?self:self.find('[data-id='+id+"]")).lock(cdt-now);
}
}
}
}
,lockCD:function(){
var self = $(this);
var lock_id = self.data('id');
if (window.localStorage && lock_id) {
var cache = window.localStorage['lock_cd'];
if (cache) {
cache = JSON.parse(cache);
}
var now = Math.round(new Date().getTime()/1000);
if (lock_id in cache) {
var cdt = cache[lock_id];
if (cdt-now>0) {
return cdt-now;
}
}
}
return 0;
}
});
$(function(){
$(document).restoreLock();
});
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
'use strict';
function Scheduler(option){
option = option || {};
this.timeout = option.timeout || 60*2*1000;
this.duration = option.duration || 2000;
this.abort = false;
this.doing = false;
}
Scheduler.prototype._get_delay = function(){
var delay = typeof this.duration === 'function'?this.duration(this.start_time):this.duration;
delay = +delay;
return delay <=0 && (delay = 2000),delay;
}
Scheduler.prototype.update = function(){
var delay = this._get_delay() - (+new Date() - this.last_time);
if (this.abort || this.doing) {
return;
}
this.doing = true;
setTimeout(function(){
if (this.abort) {
return;
}
this.last_time = +new Date();
this.doing = false;
this.callback();
}.bind(this), delay);
}
Scheduler.prototype.begin = function(callback,success,failed){
this.start_time = +new Date();
this.last_time = this.start_time;
this.callback = callback;
this.success = success;
this.failed = failed;
this.abort = false;
this.callback();
this.timeout_timer = setTimeout(function(){
this.abort = true;
if (typeof this.failed == 'function') {
this.failed({code:1,TIMEOUT:1,CANCEL:2,UNKNOWN_ERROR:3});
}
delete this.timeout_timer;
}.bind(this), this.timeout);
return this;
}
Scheduler.prototype.cancel = function(){
this.abort = true;
if (this.timeout_timer) {
clearTimeout(this.timeout_timer);
delete this.timeout_timer;
}
if (typeof this.failed == 'function') {
this.failed({code:2,TIMEOUT:1,CANCEL:2,UNKNOWN_ERROR:3});
}
return this;
}
Scheduler.prototype.end = function(){
this.abort = true;
if (this.timeout_timer) {
clearTimeout(this.timeout_timer);
delete this.timeout_timer;
}
if (typeof this.success == 'function') {
this.success.apply(this,arguments);
}
return this;
}
\ No newline at end of file
$(document).ready(function () {
$.prompt = function (text, delay) {
if (delay === undefined || +delay <= 0) {
delay = 3000;
}
var prompt = $('#prompt'), timer = 0;
if (prompt.length === 0) {
prompt = $('<div>', {'class': 'prompt', id: 'prompt'}).append($('<span>')).appendTo($('body'));
}
prompt.find('span').html(text);
timer = prompt.data('timer');
timer && clearTimeout(timer);
prompt.show();
prompt.data("timer",setTimeout(function(){
prompt.detach().data("timer",0);
}, delay));
}
$(".sbdetail h5 ").off("click").on("click", function () {
var self = $(this);
if (self.hasClass("open")) {
self.removeClass("open");
} else {
self.addClass("open");
}
});
$(".sbdetail ul li ul li").off("click").on("click",function () {
var index = Number($(this).attr('data-id'));
$(".ui-overlay").addClass("out");
$(".dialog-body").eq(index).addClass("out");
})
$(".ui-overlay").off("click").on("click",function () {
$(".ui-overlay").removeClass("out");
$(".dialog-body").removeClass("out");
})
$(".right").off("click").on("click",function () {
var index = Number($(this).attr('data-id'));
console.log(index)
if (index+1 >= $(".sbdetail ul li ul li").length){
$.prompt('没有更多数据了');
}else{
$(".dialog-body").eq(index).removeClass("out");
$(".dialog-body").eq(index+1).addClass("out");
}
})
$(".left").off("click").on("click",function () {
var index = Number($(this).attr('data-id'));
if (index-1 < 0){
$.prompt('没有更多数据了');
}else{
$(".dialog-body").eq(index).removeClass("out");
$(".dialog-body").eq(index-1).addClass("out");
}
})
$(".medicaldetail h5 ").off("click").on("click", function () {
var self = $(this);
if (self.hasClass("open")) {
self.removeClass("open");
} else {
self.addClass("open");
}
});
$(".endowmentdetail h5 ").off("click").on("click", function () {
var self = $(this);
if (self.hasClass("open")) {
self.removeClass("open");
} else {
self.addClass("open");
}
});
$(".header label").off("click").on("click",function () {
var self = $(this);
if (self.hasClass("active")) {
} else {
$(".header label").removeClass('active');
self.addClass("active");
if (self.index() == 0){
$(".sbdata").css("display","block");
$(".medical").css("display","none");
$(".endowment").css("display","none");
}else if (self.index() == 1){
$(".sbdata").css("display","none");
$(".medical").css("display","block");
$(".endowment").css("display","none");
}else{
$(".sbdata").css("display","none");
$(".medical").css("display","none");
$(".endowment").css("display","block");
}
}
})
$(".endowment .tab-lab").off("click").on("click",function () {
var self = $(this);
if (self.hasClass("active")) {
}else{
$(".endowment .tab-lab").removeClass("active");
self.addClass("active");
if (self.index() == 0){
$(".end").css("display","block");
$(".endpay").css("display","none");
}else if (self.index() == 1){
$(".end").css("display","none");
$(".endpay").css("display","block");
}
}
})
$(".medical .tab-lab").off("click").on("click",function () {
var self = $(this);
if (self.hasClass("active")) {
}else{
$(".medical .tab-lab").removeClass("active");
self.addClass("active");
if (self.index() == 0){
$(".med").css("display","block");
$(".medshop").css("display","none");
}else if (self.index() == 1){
$(".med").css("display","none");
$(".medshop").css("display","block");
}
}
})
})
\ No newline at end of file
This diff is collapsed.
'use strict';
$.prompt = function (text, delay) {
if (delay === undefined || +delay <= 0) {
delay = 3000;
}
var prompt = $('#prompt'), timer = 0;
if (prompt.length === 0) {
prompt = $('<div>', {'class': 'prompt', id: 'prompt'}).append($('<span>')).appendTo($('body'));
}
prompt.find('span').html(text);
timer = prompt.data('timer');
timer && clearTimeout(timer);
prompt.show();
prompt.data("timer",setTimeout(function(){
prompt.detach().data("timer",0);
}, delay));
}
$.toast = function (text, delay) {
if (delay === undefined || +delay <= 0) {
delay = 3000;
}
var toast = $('#toast'), timer = 0;
if (toast.length === 0) {
toast = $('<div>', {'class': 'toast', id: 'toast'}).append($('<span>')).appendTo($('body'));
}
toast.find('span').html(text);
timer = toast.data('timer');
timer && clearTimeout(timer);
toast.show();
toast.data("timer",setTimeout(function(){
toast.detach().data("timer",0);
}, delay));
}
function Dialog(){
var title = null,content = null,style={},buttons = [{title:'确认'}];
if (arguments.length==1) {
var arg0 = arguments[0];
if (typeof arg0 == 'string') {
content = arguments[0];
}else if (typeof arg0 == 'object') {
'title' in arg0 && (title = arg0.title);
'content' in arg0 && (content = arg0.content);
'style' in arg0 && (style = arg0.style);
'buttons' in arg0 && (buttons = arg0.buttons);
if ('html' in arg0) {
content = arg0.html;
}else if('content' in arg0){
content = (function htmlEncode(str) {
var div = document.createElement("div");
div.appendChild(document.createTextNode(str));
return div.innerHTML;
})(arg0.content);
}
}
}else if(arguments.length>=2) {
title = arguments[0];
content = arguments[1];
}
var self = this;
this.context = $(['<div class="dialog">',
'<div class="dialog-title"></div>',
'<div class="dialog-wrapper">',
'<div class="dialog-content">',
'</div>',
'<div class="dialog-button-container">',
'</div>',
'</div>',
'</div>'].join(''));
this.context.find(".dialog-title")[!!title?'html':'detach'](title);
function getParam(a,b,c){
return b in a?a[b]:c;
}
for(var i=0; i<buttons.length;i++){
var a = buttons[i];
this.add(getParam(a,'title','missing'),getParam(a,'className'),getParam(a,'tap'))
}
this.content = this.context.find(".dialog-content");
if (!!content) {
this.content.append(content);
}else{
this.content.empty();
}
for(var key in style){
key = key.replace(/([A-Z])/g,'-$1').toLowerCase();
var ele = key == 'root'?this.context:this.context.find(".dialog-"+key);
var css = style[key];
if (typeof css == 'string') {
ele.addClass(css);
}else if(typeof css == 'object'){
ele.css(css);
}
}
this.loaded = false;
this.alert = false;
}
Dialog.prototype = new EventListener();
extendMethod(Dialog,{
dismiss:function(){
var self = this;
self.trigger('dimiss');
this.context.removeClass("out");
var overlay = $(".ui-overlay").removeClass("out");
setTimeout(function(){
overlay.removeClass('show');
self.context.removeClass("show");
self.trigger('hide');
self.context.detach();
}, 200);
},
addClass:function(className){
this.context.addClass(className);
return this;
},
attr:function(){
return this.context.attr.apply(this.context,Array.prototype.slice.call(arguments,0));
},
find:function(selector){
return this.content.find(selector);
},
$:function(selector){
return this.find(selector);
},
model:function(){
var self = this;
this.alert = arguments.length>0?!!arguments[0]:false;
this.loaded==false && this.trigger("load"),this.loaded=true;
var overlay = $(".ui-overlay");
overlay.length == 0 && (overlay = $("<div>",{'class':'ui-overlay'}).appendTo($('body')));
overlay.off("click").on("click",function(){
if(self.alert){
return;
}
self.dismiss();
});
overlay.addClass('show');
this.trigger('present');
this.context.appendTo($('body')).addClass('show');
setTimeout(function(){
self.context.addClass("out");
overlay.addClass('out');
self.trigger('show');
}, 10);
},
wrap: function(title,className,func){
return this.context.find('.dialog-button-container').empty(),this.add(title,className,func);
},
add:function(title,className,func){
var self = this;
var btns = self.context.find('.dialog-button');
btns.removeClass('d-'+btns.length);
return (btns = btns.add($('<button>',{'class':'dialog-button'+(className?' '+className:'')}).html(title).on('click',function(){
var i = $(this).index();
(typeof func == 'function' && func()) || self.trigger('click',i) || self.dismiss();
}))),this.context.find('.dialog-button-container').empty().append(btns.addClass('d-'+btns.length)),this;
}
});
\ No newline at end of file
'use strict';
$.prompt = function (text, delay) {
if (delay === undefined || +delay <= 0) {
delay = 3000;
}
var prompt = $('#prompt'), timer = 0;
if (prompt.length === 0) {
prompt = $('<div>', {'class': 'prompt', id: 'prompt'}).append($('<span>')).appendTo($('body'));
}
prompt.find('span').html(text);
timer = prompt.data('timer');
timer && clearTimeout(timer);
prompt.show();
prompt.data("timer",setTimeout(function(){
prompt.detach().data("timer",0);
}, delay));
}
$.toast = function (text, delay) {
if (delay === undefined || +delay <= 0) {
delay = 3000;
}
var toast = $('#toast'), timer = 0;
if (toast.length === 0) {
toast = $('<div>', {'class': 'toast', id: 'toast'}).append($('<span>')).appendTo($('body'));
}
toast.find('span').html(text);
timer = toast.data('timer');
timer && clearTimeout(timer);
toast.show();
toast.data("timer",setTimeout(function(){
toast.detach().data("timer",0);
}, delay));
}
function Dialog(){
var title = null,content = null,style={};
if (arguments.length==1) {
var arg0 = arguments[0];
if (typeof arg0 == 'string') {
content = arguments[0];
}else if (typeof arg0 == 'object') {
'title' in arg0 && (title = arg0.title);
'content' in arg0 && (content = arg0.content);
'style' in arg0 && (style = arg0.style);
if ('html' in arg0) {
content = arg0.html;
}else if('content' in arg0){
content = (function htmlEncode(str) {
var div = document.createElement("div");
div.appendChild(document.createTextNode(str));
return div.innerHTML;
})(arg0.content);
}
}
}else if(arguments.length>=2) {
title = arguments[0];
content = arguments[1];
}
this.context = $(['<div class="dialog">',
'<div class="dialog-title"></div>',
'<div class="dialog-wrapper">',
'<div class="dialog-content">',
'</div>',
'<div class="dialog-button-container">',
'</div>',
'</div>',
'</div>'].join(''));
this.context.find(".dialog-title")[!!title?'html':'detach'](title);
this.content = this.context.find(".dialog-content");
if (!!content) {
this.content.append(content);
}else{
this.content.empty();
}
for(var key in style){
key = key.replace(/([A-Z])/g,'-$1').toLowerCase();
var ele = key == 'root'?this.context:this.context.find(".dialog-"+key);
var css = style[key];
if (typeof css == 'string') {
ele.addClass(css);
}else if(typeof css == 'object'){
ele.css(css);
}
}
this.loaded = false;
this.alert = false;
}
function extendMethod(class_name, method_set) {
for (var method_name in method_set) {
class_name.prototype[method_name] = method_set[method_name];
}
}
function EventListener() {
}
extendMethod(EventListener, {
on: function (event, func) {
if (typeof event === 'string' && typeof func === 'function') {
var list = this['on' + event + 'list'];
if (list instanceof Array) {
for (var i = 0; i < list.length; i++) {
if (list[i] === func) {
return this;
}
}
list.push(func);
} else {
this['on' + event + 'list'] = [func];
}
}
return this;
},
off: function (event, func) {
var list = this['on' + event + 'list'];
if (list instanceof Array) {
if (!func) {
list.length && list.splice(0, list.length);
} else {
for (var i = 0; i < list.length; i++) {
if (list[i] === func) {
list.splice(i, 1);
break;
}
}
}
}
return this;
},
trigger: function (event) {
var result = false, list = this['on' + event + 'list'];
if (list instanceof Array) {
for (var i = 0; i < list.length; i++) {
var func = list[i];
if (typeof func != 'function') {
continue;
}
var args = Array.prototype.slice.call(arguments, 0);
args.shift();
result = result || func.apply(this, args);
}
}
return result;
}
});
Dialog.prototype = new EventListener();
extendMethod(Dialog,{
dismiss:function(){
var self = this;
self.trigger('dimiss');
this.context.removeClass("out");
var overlay = $(".ui-overlay").removeClass("out");
setTimeout(function(){
overlay.removeClass('show');
self.context.removeClass("show");
self.trigger('hide');
self.context.detach();
}, 200);
},
addClass:function(className){
this.context.addClass(className);
return this;
},
attr:function(){
return this.context.attr.apply(this.context,Array.prototype.slice.call(arguments,0));
},
find:function(selector){
return this.content.find(selector);
},
$:function(selector){
return this.find(selector);
},
model:function(){
var self = this;
this.alert = arguments.length>0?!!arguments[0]:false;
this.loaded==false && this.trigger("load"),this.loaded=true;
var overlay = $(".ui-overlay");
overlay.length == 0 && (overlay = $("<div>",{'class':'ui-overlay'}).appendTo($('body')));
overlay.off("click").on("click",function(){
if(self.alert){
return;
}
self.dismiss();
});
// overlay.addClass('show');
this.trigger('present');
this.context.appendTo($('body'));
setTimeout(function(){
// self.context.addClass("out");
// overlay.addClass('out');
self.trigger('show');
}, 10);
},
wrap: function(title,className,func){
return this.context.find('.dialog-button-container').empty(),this.add(title,className,func);
},
add:function(title,className,func){
var self = this;
var btns = self.context.find('.dialog-button');
btns.removeClass('d-'+btns.length);
return (btns = btns.add($('<button>',{'class':'dialog-button'+(className?' '+className:'')}).html(title).on('click',function(){
var i = $(this).index();
(typeof func == 'function' && func()) || self.trigger('click',i) || self.dismiss();
}))),this.context.find('.dialog-button-container').empty().append(btns.addClass('d-'+btns.length)),this;
}
});
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment