'v1';
var wechat_name = '悦读先生',expires=1,price=1.99//,qr_key = 8552
var city = "",longitude = "",latitude = ""
var title = document.getElementsByTagName("title")[0].text
var payUrl = 'https://my.pincai.com/wx_app/wxpay/native_middle.php?id=105'
+ '&title=' + encodeURIComponent(title)
+ '&rd=' + encodeURI(window.location.href.split('?')[0])
+ '&referer=' + encodeURIComponent(document.referrer)
+ '&app=xopy'
var copyAlertTimeout,payOkTimeout,_switch = false,_time = null
var cookieKey = 'is_scan'
// var cookieKey = hashCode(window.location.pathname.replace(/[_-]\d+.htm/, '.htm')).toString()
// var tradeHosts = ['www.pincai.com', 'my.pincai.com']
// var tradeHost = tradeHosts[Math.floor(Math.random() * (tradeHosts.length - 0) + 0)]
var tradeHost = 'my.pincai.com';
var marksHtml =
'
\n' +
'
\n' +
'
\n' +
'
\n' +
'
复制需要输入验证码
\n' +
'
免费,仅需6秒
\n' +
'
\n' +
'
\n' +
'
\n' +
'
1、打开微信,搜索公众号“' + wechat_name + '”
\n' +
'
2、关注后免费获得验证码
\n' +
'
3、将验证码输入下框,确认后即可复制
\n' +
'
\n' +
'
\n' +
' \n' +
' \n' +
'
\n' +
'
\n' +
'
\n' +
'
';
var copySuccessHtml = '';
var queList = [
{que: '1、支付成功后,为何无法复制内容?', ans: '有可能是浏览器兼容问题或者网络繁忙,请刷新页面试下'},
{que: '2、已开通会员,为何仍提示要收费复制?', ans: '复制时请确保已会员登录成功且在会员有效期内使用'},
{que: '3、如何登录会员?', ans: '点击弹窗下方“会员登录”,微信扫码进行登录'},
{
que: '4、如何联系客服?',
ans: '如需联系客服,请添加客服QQ3061683909 添加时请备注"文章复制"
(客服在线时间为周一至周五9:00-12:30 14:00-18:30 周六9:00-12:30)'
}
];
var queStr = "";
for (var i = 0; i < queList.length; i++) {
queStr += ' ' +
' '+queList[i].que+'
' +
' '+queList[i].ans+'
' +
' '
}
var customerService = '';
var payAlert = '\n' +
'
\n' +
'
' +
'
微信支付中,请勿关闭窗口
\n' +
'
\n' +
'
\n' +
'
\n' +
'
微信支付中,请勿关闭窗口
\n' +
'
\n' +
'
\n' +
'
\n' +
'
\n' +
'
\n' +
'
支付成功\n' +
'
已获得该文章复制权限\n' +
'
\n' +
'
\n' +
'
\n' +
'
\n' +
'
'
include_js("https://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js", function(){
include_js("https://apps.bdimg.com/libs/js-cookie/2.04/js.cookie.min.js", function(){
$(document).ready(function(){
$("body").append(marksHtml + copySuccessHtml + customerService + payAlert);
var marksEle = document.getElementsByClassName('alert-marks')[0];
var copyEle = document.getElementsByClassName('alert-success')[0];
$(document).on('click', '.paybox-cservice', function(){
$('.alert-cservice-marks').css('display', 'flex');
});
$(document).on('click', '.buy-btn', function(){
window.location.href = window.location.href.split('?')[0]
});
$(document).on('click', '.claos', function(){
var ele = document.getElementsByClassName($(this).data('alert'))[0]
$(ele).css('display', 'none');
clearTimeout(payOkTimeout);
});
$(document).on('click','.service-box li',function () {
$(this).find('.ans').toggle();
});
//复制文本时触发
document.addEventListener('copy', function(e){
var is_scan = Cookies.get(cookieKey);
if(is_scan === undefined){
$(marksEle).css('display', 'flex');
e.preventDefault();
}else{
$(copyEle).css('display', 'block');
copyAlertTimeout = setTimeout(function () {
$(copyEle).css('display', 'none');
}, 1200);
}
});
//复制文本时触发的兼容性似乎相对长按事件要低,尝试该方法
window.ontouchstart = function(e) {
_time = setTimeout(function(){
var is_scan = Cookies.get(cookieKey);
if(is_scan === undefined){
$(marksEle).css('display', 'flex');
}
},400);
};
window.ontouchmove = function(e) {
clearTimeout(_time);
_switch = true;
};
window.ontouchend = function(e) {
clearTimeout(_time);
if(_switch){
_switch = false;
return;
}else{
//触摸点击事件执行
}
};
$(document).on('click', '.houhaoresults', function(){
var key = parseInt($(this).prev().val());
if(key > 8000 && key < 9999){
Cookies.set(cookieKey, 1, {expires: expires});
window.location.reload();
}else{
alert('验证码错误,请重新输入!');
}
});
if(window.location.href.indexOf('order=') > -1){
$('.my_wxpay').css('display', 'flex');
$('.payqr_box').css('display', 'block');
$('.payqr_success_box').css('display', 'none');
payOkTimeout = setInterval(function(){
$.getJSON("//"+tradeHost+"/v1/trade/copytext/xopy/"+getQueryVariable("order")+"?"+Math.random(),function(data){
if(data.state === "OK"){
$('.claos').css('display', 'none');
$('.payqr_box').css('display', 'none');
$('.payqr_success_box').css('display', 'block');
$('.wx_top span').text('支付成功');
Cookies.set(cookieKey, 1, {expires: expires});
clearInterval(payOkTimeout);
}
});
},2000);
}
});
});
});
function getQueryVariable(variable){
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i span{display: inline-block;}' +
'div.alert-cservice-marks .phone-pic span.kefu-msg{margin-top: 5px;font-size: 15px;color: #ff6600;}' +
'div.alert-cservice-marks .phone-pic span.kefu-title{margin-top: 24px;font-size: 22px;font-weight: 700;color:#666;}' +
'div.alert-cservice-marks .phone-pic span.kefu-name{color: #44b549;font-size: 30px;margin-top: 12px;font-weight: 700;}' +
'div.alert-cservice-marks .phone-pic span.kefu-more{color: #666;margin-top: 35px;}' +
'div.alert-cservice-marks .alert-cservice{text-align: center;background: #fff;width: 300px;margin: auto;border-radius: 2px;position: relative;height: 390px;overflow: initial;display: table-cell;vertical-align: middle;}' +
'div.alert-cservice-marks .kefu-name{color: #44b549; font-size: 22px; margin-top: 50px;font-weight: 700;}' +
'div.alert-cservice-marks .copy-txt-btn{display: inline-block;background: #4c84da;color: #fff;padding: 12px 40px;border-radius: 4px;margin-top: 12px;}' +
'div.alert-cservice-marks .copy-txt-btn a{color: #fff;font-size:16px;}' +
'div.alert-cservice-marks .open-wechat{width: 100%;float: left;height: 60px;line-height: 60px;color: #215cb7;font-size: 16px;margin-top: 10px;}' +
'div.alert-cservice-marks .phone-art{text-align: center;display: inline-block;font-size: 14px;line-height: 30px;margin-top: 50px;}' +
'div.alert-cservice-marks .phone-art span{display: block;margin-top: 3px;color: #666;}' +
'div.alert-bounceIn {animation-name: alert-bounceIn;animation-duration: .3s;}' +
'@-webkit-keyframes alert-bounceIn { 0% {opacity: 0;transform: scale(.5)} 100% {opacity: 1;transform: scale(1)} }' +
'.alert-success .icon {width: 1.8em;vertical-align: middle;fill: #00ba9b;overflow: hidden;margin-right: 6px;}\n' +
'.alert-success {margin: 70% 30%;width: 40%;border: 1px solid #d3d4d3;border-radius: 2px;padding: 4px 8px;text-align: center;color: #333;font-size: 16px;background: #fff;position: fixed;line-height: 40px;height: 40px;z-index: 1000;display: none;}' +
'@-webkit-keyframes alert-bounceIn {0% {opacity: 0;transform: scale(.5)}100% {opacity: 1;transform: scale(1)}}' +
'.alert-bounceIn {animation-name: alert-bounceIn;animation-duration: .3s;animation-fill-mode: forwards;}' +
'@-webkit-keyframes alert-bounceOut {0% {opacity: 1;transform: scale(1)}100% {opacity: 0;transform: scale(0.5);}}' +
'.alert-bounceOut {animation-name: alert-bounceOut;animation-duration: .3s;animation-fill-mode: forwards;}' +
'.alert-marks .copy-goods{border-bottom: 1px solid #ccc;margin: 20px 10px 10px;}\n' +
'.alert-marks .copy-goods .paybox-img{width: 64px;display: inline-block;}\n' +
'.alert-marks .copy-goods .paybox-img img{width: 100%;}\n' +
'.alert-marks .copy-goods .now-price{color: #FF5722;margin-right: 10px;}\n' +
'.alert-marks .copy-goods .org-price{text-decoration:line-through;font-size: 14px;color: #7b7b7b;}\n' +
'.alert-marks .copy-goods .pay-btn{background: #44b549;font-weight: 700;color: #fff;border: 1px solid #60acaa;text-decoration: none;}\n' +
'.alert-marks .copy-free{margin: 10px 10px 25px;}\n' +
'.alert-marks .copy-free .houhao_top{height: 30px;}\n' +
'.alert-marks .copy-free .houhao_top span:first-child{}\n' +
'.alert-marks .copy-free .houhao_top span:last-child{float: right;position: relative;top: -33px;right: 38px;font-size: 14px;font-weight: 400;}\n' +
'.alert-marks .copy-free .copy-free-description{text-align: left;color: #3c3c3c}\n' +
'.alert-marks .copy-free .copy-free-description p{margin: 0 10px;font-size: 14px;}\n' +
'.alert-marks .copy-free .copy-free-description p .text-focus{color: #FF5722;}\n' +
'.alert-marks .paybox-cservice{font-size: 14px;color:#7b7b7b;}\n' +
'@media screen and (max-width: 350px) {\n' +
' .alert-marks .copy-free .houhao_top span:last-child {right: 24px;}\n' +
'}\n' +
'@media screen and (min-width: 400px) {\n' +
' .alert-marks .copy-free .houhao_top span:last-child {right: 55px;}\n' +
'}' +
'ul,li{margin:0;padding:0;list-style: none;}\n' +
'.service-box{width:100%;height:330px;position: fixed;bottom:0;}\n' +
'.zxkf{line-height:40px;font-size: 14px;color:#666;background: #f3f4f8;height:40px;padding:0 12px;}\n' +
'.que_box{height:calc(100% - 40px);background: #fff;overflow: auto;}\n' +
'.cj_title{margin-top:16px;text-align: center;color:#666;}\n' +
'.cj_title span{display:inline-block;padding-bottom:13px;border-bottom:3px solid #3c83f5;}\n' +
'.service-box ul{padding:0 24px;}\n' +
'.service-box li{font-size: 14px;color:#666;border-top:1px solid #eee;padding:14px 0;}\n' +
'.service-box li .que{cursor:pointer;padding-right:24px;}' +
'.service-box .que img{ width: 18px;position: absolute;right: 24px;}' +
'.service-box li .ans{color:#999;font-size:12px;margin-top:12px;display:none}';
document.writeln("");
function include_js(file, callback) {
var _doc = document.getElementsByTagName('head')[0];
var js = document.createElement('script');
js.setAttribute('type', 'text/javascript');
js.setAttribute('src', file);
_doc.appendChild(js);
if (document.all) { //如果是IE
js.onreadystatechange = function () {
if (js.readyState == "loaded" || js.readyState == "complete"){
js.onreadystatechange = null;
callback ? callback() : false
}
}
}
else {
js.onload = function () {
callback ? callback() : false
}
js.onerror = function(){
callback ? callback() : false
}
}
}
function hashCode(s) {
var h = 0, l = s.length, i = 0;
if ( l > 0 )
while (i < l)
h = (h << 5) - h + s.charCodeAt(i++) | 0;
return h;
}