document.writeln('');
document.writeln('
');
document.writeln('');
document.writeln('

');
document.writeln('

');
document.writeln('
');
document.writeln('');
document.writeln('

');
document.writeln('
');
document.writeln('');
document.writeln('

');
document.writeln('
');
document.writeln('');
document.writeln('');
document.writeln('');
document.writeln('

');
document.writeln('

');
document.writeln('

');
document.writeln('
');
document.writeln('
');
document.writeln(' ');
document.writeln('
');
document.writeln('
');
document.writeln('');
document.writeln('

');
document.writeln('

');
document.writeln('
8
');
document.writeln('

');
document.writeln('

');
document.writeln('
');
document.writeln('');
document.writeln('');
document.writeln('
');
document.writeln('
');
document.writeln('');
document.writeln('');
var isShowLeftFloatIcon = false;
var isNoDiscountShareFlag = 1;
function changeSharePopShow() {
var productTopWidth = parseInt(window.innerWidth);
var productTopHeight = window.innerHeight;
productTopWidth = parseInt(productTopWidth);
var popImgWidth = productTopWidth * 0.96;
$(".centered-image").css("width", `${popImgWidth}px`)
var popImgHeight = Number($(".centered-image").css("height").replace("px", ""));
var popImgMarginTop = (productTopHeight - popImgHeight) / 2;
$(".centered-image").css("margin-top", `${popImgMarginTop}px`)
var popImgMarginLeft = (productTopWidth - popImgWidth) / 2;
var icon_close_width = productTopWidth * 0.08;
$(".icon_close").css("width", `${icon_close_width}px`);
var icon_close_height = Number($(".icon_close").css("height").replace("px", ""));
var icon_close_left = popImgWidth - icon_close_width / 2;
var icon_close_top = popImgMarginTop - icon_close_height / 2;
$(".centered-image").css("margin-left", `${popImgMarginLeft}px`)
$(".icon_close").css("margin-left", `${icon_close_left}px`);
$(".icon_close").css("top", `${icon_close_top}px`);
}
$(".icon_close").click(function (event) {
event.stopPropagation();
$('#overlay').fadeOut();
});
$("#html_img_SharePopShow").click(function () {
$('#overlay').fadeOut();
var shareUrl = "";
if (typeof InternalVar_goodsUrl != 'undefined')
shareUrl = InternalVar_goodsUrl.replace("https://www.6688.com/shop/Goods/Products.aspx", "https://m.6688.com/shop/Goods/GoodsDetail.aspx") + "&isApp=" + InternalVar_isApp;
else
shareUrl = window.location.href;
$.cookie('sharedUrlCookes', shareUrl, {path: '/',expires: 1});
window.location = 'https://m.6688.com/shop/MobileUI/mine/lotteryForShareLinkCreate.htm';
});
$("#html_div_share_float_right").click(function () {
$('#overlay').fadeIn();
changeSharePopShow();
});
$("#html_div_share_float_right_close").click(function () {
$("#html_div_share_float_right").hide();
$("#html_div_share_float_right_close").hide();
});
if (isShowLeftFloatIcon) {
$("#html_div_share_float_right").show();
$("#html_div_share_float_right_close").show();
} else {
$("#html_div_share_float_right").hide();
$("#html_div_share_float_right_close").hide();
}
//=================================================================
var InternalVar_AjaxUrl_UserInfo = GloabVar_Front_AjaxUrl + "CustomerInfo.aspx?";
var InternalVar_requestID = "";
var InternalVar_passport = "";
var InternalVar_isLogin = false;
var IntervalObj_CheckLogin;
$("input,#btn_validCode").attr('data-role', 'none');
$("#btn_validCode").css('text-shadow', 'none');
$("#btn_validCode").css('font-weight', 'normal');
$(document).ready(function () {
var isShareLinkClient = $.cookie('isShareLinkClient');
if (isShareLinkClient == "true") {
IntervalObj = setInterval("CheckValidCodeStatus()", 1000);
CheckLogin();
IntervalObj_CheckLogin = setInterval("CheckLoginInTime()", 500);
}
$("#btn_validCode").click(function () {
if ($("#btn_validCode").attr("disabled") == "true" || $("#btn_validCode").attr("disabled") == "disabled") return;
//检查手机
if (!CheckObjIsNull("#tb_cellPhone", "手机号")) return;
if (!isWeiXinMiniPgm()) {
$.getScript("https://ssl.captcha.qq.com/TCaptcha.js", function () {
InternalVar_passport = $.trim($("#tb_cellPhone").val());
if (isWeiXinMiniPgm()) {
SetValidCodeByMiniPrg();
} else {
SetValidCodeByWeb();
}
});
}
});
$("#html_img_login").click(function () {
//检查手机
if (!CheckObjIsNull("#tb_cellPhone", "手机号")) return;
//检查验证码
if (!CheckObjIsNull("#tb_validCode", "短信验证码")) return;
var _passport = $("#tb_cellPhone").val();
var _validCode = $("#tb_validCode").val();
var ajaxUrl = InternalVar_AjaxUrl_UserInfo + "t=" + Math.random() + "&ActType=LoginOrRegist&passport=" + _passport + "&validCodeStr=" + _validCode;
var rtn = "";
$.when(CallAjax(ajaxUrl, true)).done(function (data) {
rtn = data;
if ("1" == rtn) {
clearInterval(IntervalObj_CheckLogin);
InternalVar_isLogin = true;
CheckShareRewords();
}
else {
ShowMsg(rtn.replace("err:", ""));
return;
}
});
});
$(".login_icon_close").click(function () {
$('.loginPop').fadeOut();
});
$(".shareReward_icon_pointer").click(function () {
$('.shareRewardPage').fadeOut();
$('#overlay').fadeIn();
changeSharePopShow();
});
$(".shareReward_icon_IGot").click(function () {
$('.shareRewardPage').fadeOut();
});
});
//******************************验证码相关 begin*********************************************
function GetSmsValidCode(token, randStr) {
var ajaxUrl = InternalVar_AjaxUrl_UserInfo + "t=" + Math.random() + "&ActType=SendSmsCheckByValidCodeSlide&needRegist=none&token=" + token + "&randStr=" + randStr + "&mobileNum=" + InternalVar_passport + "&requestID=" + InternalVar_requestID;
$.when(CallAjax(ajaxUrl, true)).done(function (data) {
if ("" == data) {
ShowMsg("验证码已经发送。");
SendSMSValidCode();
}
else {
ShowMsg(data);
return;
}
});
}
function GetValidCodeStatusByMiniPrg() {
ajaxUrl = InternalVar_AjaxUrl_UserInfo + "t=" + Math.random() + "&ActType=GetValidCodeStatusByMiniPrg&requestID=" + InternalVar_requestID;
$.when(CallAjax(ajaxUrl, true)).done(function (data) {
//HideLoading();
if ("0" == data) return;
clearInterval(InternalVar_Interval_GetValidCode);
if ("Close" == data) return;
if ("" == data) {
GetSmsValidCode("", "");
} else {
ShowMsg(data);
}
});
}
function SetValidCodeByMiniPrg() {
ajaxUrl = InternalVar_AjaxUrl_UserInfo + "t=" + Math.random() + "&ActType=GetSlideValidByMiniPrg&passport=" + escape(InternalVar_passport);
$.when(CallAjax(ajaxUrl)).done(function (data) {
HideLoading();
InternalVar_requestID = data;
var path = '/pages/slideValidCode/validCodePage?requestID=' + InternalVar_requestID;
//wx.miniProgram.navigateTo({ url: path });
//InternalVar_Interval_GetValidCode = setInterval(GetValidCodeStatusByMiniPrg, 500);
GetSmsValidCode("", "");
//clearInterval()
});
}
function SetValidCodeByWeb() {
var captcha1 = new TencentCaptcha('2021710244', function (res) {
if (res.ret === 1) {
ShowMsg("验证失败,请重新验证");
}
if (res.ret === 0) {
GetSmsValidCode(res.ticket, res.randstr);
}
});
captcha1.show();
}
function SendSMSValidCode() {
var ajaxUrl = InternalVar_AjaxUrl_UserInfo + "t=" + Math.random() + "&ActType=GetSessionTime";
var rtn = "";
$.when(CallAjax(ajaxUrl, true)).done(function (data) {
rtn = data;
var secs = parseInt(rtn);
if (secs > 0) {
$("#tb_cellPhone").attr("disabled", "true");
IntervalObj = setInterval("CheckValidCodeStatus()", 1000)
}
});
}
function CheckValidCodeStatus() {
var ajaxUrl = InternalVar_AjaxUrl_UserInfo + "t=" + Math.random() + "&ActType=GetSessionTime";
var rtn = "";
$.when(CallAjax(ajaxUrl, true)).done(function (data) {
rtn = data;
var secs = parseInt(rtn);
if (secs > 0) {
$("#btn_validCode").attr("disabled", "true");
$("#btn_validCode").html(secs);
$("#tb_cellPhone").attr("disabled", "true");
ajaxUrl = InternalVar_AjaxUrl_UserInfo + "t=" + Math.random() + "&ActType=GetSessionMobile";
$.when(CallAjax(ajaxUrl, true)).done(function (data) {
rtn = data;
$("#tb_cellPhone").val(rtn);
});
}
else {
$("#btn_validCode").removeAttr("disabled");
$("#btn_validCode").html("获取验证码");
$("#tb_cellPhone").removeAttr("disabled");
clearInterval(IntervalObj);
}
});
}
//******************************验证码相关 end*********************************************
//检查是否填写
function CheckObjIsNull(obj, msg) {
if ($.isEmptyObject($(obj).val()) || "" == $.trim($(obj).val())) {
ShowMsg("请您填写" + msg);
return false
}
return true;
}
function GetLeftSecs() {
var date = new Date();
var m1 = date.getTime();
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
var m0 = date.getTime();
var m = 60 * 60 * 24 - (m1 - m0) / 1000;
return m;
}
function SetCookiesForValid() {
var cookieName = "ShareGetMoneyLogin";
var secs = GetLeftSecs();
$.cookie(cookieName, "1", { path: '/', expires: secs });
}
function ShowMsg(msg) {
ShowMsgNew(msg);
}
function CheckLogin() {
GetPassportFromLocalStorage(function () {
var ajaxUrl = InternalVar_AjaxUrl_UserInfo + "t=" + Math.random() + "&ActType=IsloginNew";
$.when(CallAjax(ajaxUrl)).done(function (data) {
HideLoading();
var _passport = data;
var securityPassport = "";
if ("" != data) {
_passport = data.split('|')[1];
securityPassport = data.split('|')[0];
}
SaveLogin2LocalStorage(securityPassport);
if (_passport) {
InternalVar_isLogin = true;
}
else {
InternalVar_isLogin = false;
}
CheckIsLogin()
});
}, SetLoginInfo)
}
function SetLoginInfo(_passport) {
if (_passport) {
InternalVar_isLogin = true;
InternalVar_passport = _passport;
} else { InternalVar_isLogin = false; }
}
function CheckIsLogin() {
if (!InternalVar_isLogin) {
$('.loginPop').fadeIn();
showLoginPop();
}
}
function CheckShareRewords() {
ajaxUrl = InternalVar_AjaxUrl_UserInfo + "t=" + Math.random() + "&ActType=CheckSharedRewards";
//alert("========开始检测获取奖励===========");
$.when(CallAjax(ajaxUrl, true)).done(function (data) {
if (data.indexOf("suc") > -1) {
var rewardMoney = data.replace("suc:", "");
$("#html_div_rewardMoney").html(rewardMoney);
$('.loginPop').fadeOut();
$('.shareRewardPage').fadeIn();
showShareRewardPop();
} else {
$('.loginPop').fadeOut();
if (data.indexOf("多谢您已领奖。") > -1) {
ShowNoticeBox($(".shareRewardTip_notShareForSelf"));
}
if (data.indexOf("欢迎回来。") > -1) {
ShowNoticeBox($(".shareRewardTip_repeatGetReward"));
}
//ShowMsg(data.replace("err:", ""));
}
});
}
function ShowNoticeBox(shareContentNoticeObj) {
var productTopWidth = parseInt(window.innerWidth);
var productTopHeight = parseInt(window.innerHeight);
var noticeWidth = productTopWidth * 0.85;
$(shareContentNoticeObj).css("top", `0px`)
$(shareContentNoticeObj).css("width", `${noticeWidth}px`)
var noticeHeight = Number($(shareContentNoticeObj).css("height").replace("px", ""));
var noticeMarginTop = (productTopHeight - noticeHeight) / 2;
$(shareContentNoticeObj).css("margin-top", `${noticeMarginTop}px`)
var noticeMarginLeft = (productTopWidth - noticeWidth) / 2;
$(shareContentNoticeObj).css("margin-left", `${noticeMarginLeft}px`)
$(shareContentNoticeObj).click(function () {
$(shareContentNoticeObj).hide();
});
console.log(`noticeWidth:${noticeWidth}`);
console.log(`noticeHeight:${noticeHeight}`);
console.log(`noticeMarginTop:${noticeMarginTop}`);
console.log(`noticeMarginLeft:${noticeMarginLeft}`);
$(shareContentNoticeObj).show();
}
function showLoginPop() {
var bgObj = ".login_bg";
var iconClostObj = ".login_icon_close";
var iconLoginBtnObj = ".login_icon_loginBtn";
var input_cellPhone_loginObj = "#tb_cellPhone";
var input_validCode_loginObj = "#tb_validCode";
var iconLogingetValidCodeObj = ".login_icon_getValidCode";
var productTopWidth = parseInt(window.innerWidth);
var productTopHeight = window.innerHeight;
productTopWidth = parseInt(productTopWidth);
var popImgWidth = productTopWidth * 0.96;
$(bgObj).css("width", `${popImgWidth}px`)
var popImgHeight = Number($(bgObj).css("height").replace("px", ""));
var popImgMarginTop = (productTopHeight - popImgHeight) / 2;
$(bgObj).css("margin-top", `${popImgMarginTop}px`)
var popImgMarginLeft = (productTopWidth - popImgWidth) / 2;
var icon_close_width = productTopWidth * 0.08;
$(iconClostObj).css("width", `${icon_close_width}px`);
var icon_close_height = Number($(iconClostObj).css("height").replace("px", ""));
var icon_close_left = popImgWidth - icon_close_width / 2;
var icon_close_top = popImgMarginTop - icon_close_height / 2;
$(bgObj).css("margin-left", `${popImgMarginLeft}px`)
$(iconClostObj).css("margin-left", `${icon_close_left}px`);
$(iconClostObj).css("top", `${icon_close_top}px`);
$(iconLoginBtnObj).css("width", `${productTopWidth * 0.97}px`);
$(iconLoginBtnObj).css("margin-top", `-${popImgHeight * 0.55}px`);
$(iconLoginBtnObj).css("margin-left", `${productTopWidth * 0.01}px`);
$(input_cellPhone_loginObj).css("width", `${productTopWidth * 0.71}px`)
$(input_cellPhone_loginObj).css("height", `${popImgHeight * 0.09}px`)
$(input_cellPhone_loginObj).css("border-radius", `${productTopWidth * 0.025}px`)
$(input_cellPhone_loginObj).css("margin-top", `-${popImgHeight * 0.69}px`);
$(input_cellPhone_loginObj).css("margin-left", `${productTopWidth * 0.14}px`);
$(input_validCode_loginObj).css("width", `${productTopWidth * 0.71}px`)
$(input_validCode_loginObj).css("height", `${popImgHeight * 0.09}px`)
$(input_validCode_loginObj).css("border-radius", `${productTopWidth * 0.025}px`)
$(input_validCode_loginObj).css("margin-top", `-${popImgHeight * 0.57}px`);
$(input_validCode_loginObj).css("margin-left", `${productTopWidth * 0.14}px`);
$(input_validCode_loginObj + "," + input_cellPhone_loginObj).css("font-size", `${productTopWidth * 0.05}px`);
var iconLogingetValidCodeHeight = popImgHeight * 0.085;
$(iconLogingetValidCodeObj).css("width", `${productTopWidth * 0.28}px`);
$(iconLogingetValidCodeObj + " a").css("font-size", `${productTopWidth * 0.045}px`)
$(iconLogingetValidCodeObj).css("height", `${iconLogingetValidCodeHeight}px`)
$(iconLogingetValidCodeObj).css("line-height", `${iconLogingetValidCodeHeight}px`)
$(iconLogingetValidCodeObj).css("margin-top", `-${popImgHeight * 0.563}px`);
$(iconLogingetValidCodeObj).css("margin-left", `${productTopWidth * 0.58}px`);
if (isiOS()) {
$(input_cellPhone_loginObj).css("margin-top", `-${popImgHeight * 0.7}px`);
$(iconLogingetValidCodeObj).css("margin-top", `-${popImgHeight * 0.555}px`);
$(iconLogingetValidCodeObj).css("margin-left", `${productTopWidth * 0.61}px`);
}
}
function CheckLoginInTime() {
if (InternalVar_isLogin) {
clearInterval(IntervalObj_CheckLogin);
CheckShareRewords();
}
}
function showShareRewardPop() {
var bgObj = ".shareRewardPage_bg";
var iconClostObj = ".shareRewardPage .shareReward_icon_close";
var rewardMoneyObj = "#html_div_rewardMoney";
var pointerObj = ".shareReward_icon_pointer";
var IGotObj = ".shareReward_icon_IGot";
//
var productTopWidth = parseInt(window.innerWidth);
var productTopHeight = window.innerHeight;
productTopWidth = parseInt(productTopWidth);
var popImgWidth = productTopWidth * 0.96;
$(bgObj).css("width", `${popImgWidth}px`)
var popImgHeight = Number($(bgObj).css("height").replace("px", ""));
var popImgMarginTop = (productTopHeight - popImgHeight) / 2;
$(bgObj).css("margin-top", `${popImgMarginTop}px`)
var popImgMarginLeft = (productTopWidth - popImgWidth) / 2;
var icon_close_width = productTopWidth * 0.08;
$(iconClostObj).css("width", `${icon_close_width}px`);
var icon_close_height = Number($(iconClostObj).css("height").replace("px", ""));
var icon_close_left = popImgWidth - icon_close_width / 2;
var icon_close_top = popImgMarginTop - icon_close_height / 2;
$(bgObj).css("margin-left", `${popImgMarginLeft}px`)
$(iconClostObj).css("margin-left", `${icon_close_left}px`);
$(iconClostObj).css("top", `${icon_close_top}px`);
$(rewardMoneyObj).css("margin-left", `${productTopWidth * 0.51}px`);
$(rewardMoneyObj).css("margin-top", `-${popImgHeight * 0.715}px`);
$(rewardMoneyObj).css("font-size", `${productTopWidth * 0.06}px`);
$(pointerObj).css("margin-left", `${productTopWidth * 0.8}px`);
$(pointerObj).css("margin-top", `-${popImgHeight * 0.27}px`);
$(pointerObj).css("width", `${productTopWidth * 0.04}px`);
$(IGotObj).css("margin-left", `${productTopWidth * 0.393}px`);
$(IGotObj).css("margin-top", `-${popImgHeight * 0.15}px`);
$(IGotObj).css("width", `${productTopWidth * 0.21}px`);
if (isNoDiscountShareFlag == 1) {
$(rewardMoneyObj).css("margin-left", `${productTopWidth * 0.51}px`);
$(rewardMoneyObj).css("margin-top", `-${popImgHeight * 0.66}px`);
$(rewardMoneyObj).css("font-size", `${productTopWidth * 0.06}px`);
$(pointerObj).css("margin-left", `${productTopWidth * 0.85}px`);
$(pointerObj).css("margin-top", `-${popImgHeight * 0.33}px`);
$(pointerObj).css("width", `${productTopWidth * 0.04}px`);
$(IGotObj).css("margin-top", `-${popImgHeight * 0.17}px`);
}
}