Commit e001842b by txy

'转移目录'

parent 11eca3cc
alert('1231');
\ No newline at end of file
.DS_Store
node_modules/
dist/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
package-lock.json
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
/node_modules/
/dist/
\ No newline at end of file
.cpt-toast {
position: fixed;
left: 50%;
top: 50%;
text-align: center;
animation-duration: 0.3s;
max-width: 300px;
line-height: 20px;
display: inline-block;
vertical-align: middle;
*vertical-align: auto;
*zoom: 1;
*display: inline;
-moz-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
-webkit-transition: all 0.3s ease;
transition: all 0.3s ease;
transform: translate(-50%, -50%);
transform: translate3d(-50%, -50%, 0);
font-family: '微软雅黑','Microsoft Yahei';
-moz-user-select: -moz-none;
-ms-user-select: none;
-webkit-user-select: none;
user-select: none;
word-wrap: break-word;
}
.global-block {
display: block;
}
.global-none {
display: none;
}
\ No newline at end of file
/* eslint-disable */
(function (d, c) {
let e = d.documentElement
let b = 'orientationchange' in window ? 'orientationchange' : 'resize'
let a = function () {
let f = e.clientWidth
if (!f) {
return
}
if (f > 750) {
f = 750
}
e.style.fontSize = 100 * (f / 750) + 'px'
}
if (!d.addEventListener) {
return
}
c.addEventListener(b, a, false)
d.addEventListener('DOMContentLoaded', a, false)
a()
})(document, window)
function createUuid() {
var tags = document.body.getElementsByTagName('*');
var mydate = new Date()
for(var i=0;i<tags.length;i++) {
var uuid = "act"+mydate.getDay()+ mydate.getHours()+ mydate.getMinutes()+mydate.getSeconds()+mydate.getMilliseconds()+ Math.round(Math.random() * 10000);
tags[i].setAttribute('id',uuid)
}
}
\ No newline at end of file
(function(global) {
const DEBUG = false;
var debug = DEBUG ? console.log.bind(console) : function(){};
if (typeof module === 'object' && typeof module.exports === 'object') {
require('./lib/htmlparser.js');
}
function q(v) {
return '"' + v + '"';
}
function removeDOCTYPE(html) {
return html
.replace(/<\?xml.*\?>\n/, '')
.replace(/<!doctype.*\>\n/, '')
.replace(/<!DOCTYPE.*\>\n/, '');
}
global.html2json = function html2json(html) {
html = removeDOCTYPE(html);
var bufArray = [];
var results = {
node: 'root',
child: [],
};
HTMLParser(html, {
start: function(tag, attrs, unary) {
debug(tag, attrs, unary);
// node for this element
var node = {
node: 'element',
tag: tag,
};
if (attrs.length !== 0) {
node.attr = attrs.reduce(function(pre, attr) {
var name = attr.name;
var value = attr.value;
// has multi attibutes
// make it array of attribute
if (value.match(/ /)) {
value = value.split(' ');
}
// if attr already exists
// merge it
if (pre[name]) {
if (Array.isArray(pre[name])) {
// already array, push to last
pre[name].push(value);
} else {
// single value, make it array
pre[name] = [pre[name], value];
}
} else {
// not exist, put it
pre[name] = value;
}
return pre;
}, {});
}
if (unary) {
// if this tag dosen't have end tag
// like <img src="hoge.png"/>
// add to parents
var parent = bufArray[0] || results;
if (parent.child === undefined) {
parent.child = [];
}
parent.child.push(node);
} else {
bufArray.unshift(node);
}
},
end: function(tag) {
debug(tag);
// merge into parent tag
var node = bufArray.shift();
if (node.tag !== tag) console.error('invalid state: mismatch end tag');
if (bufArray.length === 0) {
results.child.push(node);
} else {
var parent = bufArray[0];
if (parent.child === undefined) {
parent.child = [];
}
parent.child.push(node);
}
},
chars: function(text) {
debug(text);
var node = {
node: 'text',
text: text,
};
if (bufArray.length === 0) {
results.child.push(node);
} else {
var parent = bufArray[0];
if (parent.child === undefined) {
parent.child = [];
}
parent.child.push(node);
}
},
comment: function(text) {
debug(text);
var node = {
node: 'comment',
text: text,
};
var parent = bufArray[0];
if (parent.child === undefined) {
parent.child = [];
}
parent.child.push(node);
},
});
return results;
};
global.json2html = function json2html(json) {
// Empty Elements - HTML 4.01
var empty = ['area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'embed'];
var child = '';
if (json.child) {
child = json.child.map(function(c) {
return json2html(c);
}).join('');
}
var attr = '';
if (json.attr) {
attr = Object.keys(json.attr).map(function(key) {
var value = json.attr[key];
if (Array.isArray(value)) value = value.join(' ');
return key + '=' + q(value);
}).join(' ');
if (attr !== '') attr = ' ' + attr;
}
if (json.node === 'element') {
var tag = json.tag;
if (empty.indexOf(tag) > -1) {
// empty element
return '<' + json.tag + attr + '/>';
}
// non empty element
var open = '<' + json.tag + attr + '>';
var close = '</' + json.tag + '>';
return open + child + close;
}
if (json.node === 'text') {
return json.text;
}
if (json.node === 'comment') {
return '<!--' + json.text + '-->';
}
if (json.node === 'root') {
return child;
}
};
})(this);
var shareModal = {
"node": "root",
"child": [
{
"node": "element",
"tag": "div",
"attr": {
"id": "html-template-8"
},
"child": [
{
"node": "element",
"tag": "div",
"attr": {
"id": "act21517577081586",
"class": "c-modal-wrap-share"
},
"child": [
{
"node": "element",
"tag": "div",
"attr": {
"class": "mshe-mask"
}
},
{
"node": "text",
"text": " "
},
{
"node": "element",
"tag": "div",
"attr": {
"id": "act3173255109731",
"c_desc": "",
"c_type": "dialog",
"c_typename": "dialog_solicitVote",
"c_onesrc": "http://qnfile.icareyou.net/2b342fcc8252423f92273d2b94491ca11561539019096.jpg",
"c_twosrc": "http://qnfile.icareyou.net/b0ea5f2fe87d4dbfa7602f952e58d5f81561617900597.jpg",
"class": "share-modal"
},
"child": [
{
"node": "element",
"tag": "div",
"attr": {
"class": "share-arrow"
},
"child": [
{
"node": "element",
"tag": "img",
"attr": {
"src": "http://qnfile.icareyou.net/2b342fcc8252423f92273d2b94491ca11561539019096.jpg"
}
}
]
},
{
"node": "text",
"text": " "
},
{
"node": "element",
"tag": "div",
"attr": {
"class": "share-pic"
},
"child": [
{
"node": "element",
"tag": "img",
"attr": {
"src": "http://qnfile.icareyou.net/b0ea5f2fe87d4dbfa7602f952e58d5f81561617900597.jpg",
"class": "share-pic"
}
}
]
},
{
"node": "text",
"text": " "
},
{
"node": "element",
"tag": "div",
"attr": {
"class": "modal-close"
},
"child": [
{
"node": "element",
"tag": "img",
"attr": {
"src": "http://qnfile.icareyou.net/ddae57885c424abdb13d37c78038c6a01561343787282.jpg"
}
}
]
}
]
}
]
}
]
}
]
}
\ No newline at end of file
function removeAttr() {
var list = document.querySelectorAll('[c_remove]');
list.forEach(function(item){
const key = item.getAttribute('c_remove');
const removeArray = key.split(' ')
removeArray.forEach(function(ele){
item.removeAttribute(ele)
})
})
}
\ No newline at end of file
'use strict';
(function($,window){
//动态加载animate
var loadStyles = function(url) {
var hasSameStyle = false;
var links = $('link');
for(var i = 0;i<links.length;i++){
if(links.eq(i).attr('href') == url){
hasSameStyle = true;
return
}
}
if(!hasSameStyle){
var link = document.createElement("link");
link.type = "text/css";
link.rel = "stylesheet";
link.href = url;
document.getElementsByTagName("head")[0].appendChild(link);
}
}
loadStyles('css/animate.css');
//显示提示信息 toast
$.fn.toast = function(options){
var $this = $(this);
var _this = this;
return this.each(function(){
$(this).css({
position:'relative'
});
var top = ''; //bottom的位置
var translateInfo = ''; //居中和不居中时的tarnslate
var box = ''; //消息元素
var defaults = {
position: "absolute", //不是body的话就absolute
animateIn: "fadeIn", //进入的动画
animateOut: "fadeOut", //结束的动画
padding: "10px 20px", //padding
background: "rgba(7,17,27,0.66)", //背景色
borderRadius: "6px", //圆角
duration: 3000, //定时器时间
animateDuration: 500, //执行动画时间
fontSize: 14, //字体大小
content: "这是一个提示信息", //提示内容
color: "#fff", //文字颜色
top: "80%", //bottom底部的位置 具体的数值 或者center 垂直居中
zIndex: 1000001, //层级
isCenter: true, //是否垂直水平居中显示
closePrev: true, //在打开下一个toast的时候立即关闭上一个toast
}
var opt = $.extend(defaults,options||{});
var t = '';
// setTimeout(function(){
// box.addClass('show');
// },10);
top = opt.isCenter===true? '50%':opt.top;
defaults.isLowerIe9 = function(){
return (!window.FormData);
}
// translateY(-50%)
// translateInfo = opt.isCenter===true? 'translate3d(-50%,0,0)':'translate3d(-50%,-50%,0)';
defaults.createMessage = function(){
if(opt.closePrev){
$('.cpt-toast').remove();
}
box = $("<span class='animated "+opt.animateIn+" cpt-toast'></span>").css({
"position":opt.position,
"padding":opt.padding,
"background":opt.background,
"font-size":opt.fontSize,
"-webkit-border-radius":opt.borderRadius,
"-moz-border-radius":opt.borderRadius,
"border-radius":opt.borderRadius,
"color":opt.color,
"top":top,
"z-index":opt.zIndex,
"-webkit-transform":'translate3d(-50%,-50%,0)',
"-moz-transform":'translate3d(-50%,-50%,0)',
"transform":'translate3d(-50%,-50%,0)',
'-webkit-animation-duration':opt.animateDuration/1000+'s',
'-moz-animation-duration':opt.animateDuration/1000+'s',
'animation-duration':opt.animateDuration/1000+'s',
}).html(opt.content).appendTo($this);
defaults.colseMessage();
}
defaults.colseMessage = function(){
var isLowerIe9 = defaults.isLowerIe9();
if(!isLowerIe9){
t = setTimeout(function(){
box.removeClass(opt.animateIn).addClass(opt.animateOut).on('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend',function(){
box.remove();
});
},opt.duration);
}else{
t = setTimeout(function(){
box.remove();
},opt.duration);
}
}
defaults.createMessage();
})
};
})(jQuery,window);
var showMessage = function(content,duration,isCenter,animateIn,animateOut){
var animateIn = animateIn || 'fadeIn';
var animateOut = animateOut || 'fadeOut';
var content = content || '这是一个提示信息';
var duration = duration || '3000';
var isCenter = isCenter || false;
$('body').toast({
position:'fixed',
animateIn:animateIn,
animateOut:animateOut,
content:content,
duration:duration,
isCenter:isCenter,
});
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "activity",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "http-server -p 8090 -d -o"
},
"author": "",
"license": "ISC",
"devDependencies": {
"http-server": "^0.11.1"
}
}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<title>宝贝,因“喂”爱你</title>
<link rel="stylesheet" href="css/activity.css">
<link rel="stylesheet" href="css/toast.css">
<script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
<script type="text/javascript" src="js/html2Json.js"></script>
<script type="text/javascript" src="js/pageJson/userJson.js"></script>
<script type="text/javascript" src="js/modalJson/shareModal.js"></script>
<script type="text/javascript" src="js/modalJson/voteModal.js"></script>
<script type="text/javascript" src="js/autoFontsize.min.js"></script>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script type="text/javascript">
wx.config({
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
appId: '${appId!}', // 必填,公众号的唯一标识
timestamp:'${timestamp!}', // 必填,生成签名的时间戳
nonceStr: '${noncestr!}', // 必填,生成签名的随机串
signature: '${signature!}',// 必填,签名,见附录1
jsApiList: ['onMenuShareTimeline','onMenuShareAppMessage','startRecord','stopRecord','onVoiceRecordEnd','playVoice','pauseVoice','stopVoice','onVoicePlayEnd'
,'uploadVoice','downloadVoice','chooseImage','previewImage','uploadImage','downloadImage','translateVoice','openLocation'
,'getLocation','hideOptionMenu','showOptionMenu','hideMenuItems','showMenuItems','scanQRCode','chooseWXPay','addCard','chooseCard','openCard'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
});
</script>
</head>
<body>
</body>
</html>
<script type="text/javascript">
// 公共变量
var xtoken = "123123";
var activityCode = "hdtbsztest1";
var pageNumber = "1";
var baseUrl = "http://space-api.check.icaremgt.com";
$('body').prepend(json2html(userObj));
$('body').prepend(json2html(shareModal));
$('body').prepend(json2html(voteModal));
$('#html-template-4').addClass('global-none')
$('#html-template-8').addClass('global-none')
$(function(){
btnBindClick();// 绑定点击事件
userCountDown(10,$('#act31142119991744 span')); //倒计时
userTabInfo();
wxpermission();
});
// 微信鉴权
function wxpermission() {
wx.ready(function(){
var shareData = {
title: "",
imgUrl: "",
desc: "",
link: ""
}
/**
*分享给朋友
*/
wx.onMenuShareAppMessage({
title: shareData.title, // 分享标题
desc: shareData.desc, // 分享描述
link: shareData.link, // 分享链接
imgUrl: shareData.imgUrl, // 分享图标
type: 'link', // 分享类型,music、video或link,不填默认为link
dataUrl: '', // 如果type是music或video,则要提供数据链接,默认为空
success: function () {
// 用户确认分享后执行的回调函数
},
cancel: function () {
// 用户取消分享后执行的回调函数
}
});
/**
*分享到朋友圈
*/
wx.onMenuShareTimeline({
title: shareData.title, // 分享标题
desc: shareData.desc, // 分享描述
link: shareData.link, // 分享链接
imgUrl: shareData.imgUrl, // 分享图标
success: function () {
},
cancel: function () {
// 用户取消分享后执行的回调函数
}
});
});
}
// 元素点击事件绑定
function btnBindClick() {
// 返回首页
$("#act3110143885264").off("click").on("click",function(){
window.location.href = '/index.html'
});
// 拉票
$('#act31119351441050').off("click").on("click",function(){
$('#html-template-8').removeClass('global-none')
});
// 分享弹框关闭
$(document).on('click','#html-template-8 .modal-close',function(){
$('#html-template-8').addClass('global-none')
});
// 投票
$('#act31119414834381').off("click").on("click",function(){
$('#html-template-4').removeClass('global-none')
});
// 我要拉票
$('#act2172989331265').off("click").on("click",function(){
$('#html-template-8').removeClass('global-none')
});
// 继续投票
$('#act21728433893489').off("click").on("click",function(){
});
// 投票弹框关闭
$(document).on('click','#html-template-4 .modal-close',function(){
$('#html-template-4').addClass('global-none')
});
// 排行榜
$("#act41612547506702").off('click').on("click", function(){
window.location.href = '/index.html'
});
// 选手主页
$("#act4161336684689").off("click").on("click", function(){
window.location.href = '/user.html'
});
// 活动秘籍
$("#act41613113951133").off("click").on("click", function(){
$('#html-template-8').removeClass('global-none')
});
}
// 倒计时
function userCountDown(times,ids){
var timer=null;
var self = this
var times = times
  timer=setInterval(function(){
    var day=0,
      hour=0,
      minute=0,
      second=0;//时间默认值
    if(times > 0){
      day = Math.floor(times / (60 * 60 * 24));
      hour = Math.floor(times / (60 * 60)) - (day * 24);
      minute = Math.floor(times / 60) - (day * 24 * 60) - (hour * 60);
      second = Math.floor(times) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
    }
    if (day <= 9) day = '0' + day;
    if (hour <= 9) hour = '0' + hour;
    if (minute <= 9) minute = '0' + minute;
    if (second <= 9) second = '0' + second;
ids.html((day != 00 ? day + "天" : '')+hour+"时"+minute+"分"+second+"秒")
    times--;
if(times<0){
    clearInterval(timer);
ids.parent().addClass('global-none')
  }
  },1000);
}
function userTabInfo() {
var userInfoObj = {
userImg: 'http://qnfile.icareyou.net/e1e347fa1d3a4eb79839e40c6ba312531560307520219.jpg',
userName: '小米',
userNo: '2939393',
userRank: '29',
userVoteNum: '200',
userState: '拉票宣言',
showImg: 'http://qnfile.icareyou.net/e1e347fa1d3a4eb79839e40c6ba312531560307520219.jpg'
}
$('#act3932189955 .user-info .inner-pic').attr('src',userInfoObj.userImg);
var innerInfo = $('#act3932189955 .user-info .inner-info')
innerInfo.find('.userName span').text(userInfoObj.userName)
innerInfo.find('.userNo span').text(userInfoObj.userNo)
innerInfo.find('.userRank span').text(userInfoObj.userRank)
innerInfo.find('.userVoteNum span').text(userInfoObj.userVoteNum)
$('#act3932189955 .userState').val(userInfoObj.userState)
$('#act3932189955 .user-info .inner-pic').attr('src',userInfoObj.userImg);
$('#act3932189955 .show-pic').attr('src',userInfoObj.showImg);
}
// 页面跳转
function transPage(_pageNumber,_activityCode, _token, _urlParam){
var url = ''
if(typeof _urlParam !=='undefined' && _urlParam !== ''){
url = baseUrl + "/ACTIVITY/view/"+ _activityCode +"/" + _pageNumber + '?' + _urlParam;
}else {
url = baseUrl + "/ACTIVITY/view/"+ _activityCode +"/" + _pageNumber;
}
var _form = document.createElement('form');
_form.action = url;
_form.method = "post";
_form.style.display = "none";
var inputToken = document.createElement('input');
inputToken.value = _token;
inputToken.name = 'x-token';
_form.appendChild(inputToken);
document.body.appendChild(_form);
_form.submit();
}
</script>
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