|
@@ -3,7 +3,7 @@
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
{{if .T.text_email}}
|
|
|
- <title>修改邮箱</title>
|
|
|
+ <title>更换邮箱</title>
|
|
|
{{else}}
|
|
|
<title>我的邮箱</title>
|
|
|
{{end}}
<meta name="Keywords" content="绑定邮箱"/>
<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxmyemail/css/reset.css?v={{Msg "seo" "version"}}">
<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxmyemail/css/common.css?v={{Msg "seo" "version"}}">
<link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxmyemail/css/mine.css?v={{Msg "seo" "version"}}"/>
|
|
@@ -12,7 +12,8 @@
|
|
|
{{include "/common/weixin.html"}}
|
|
|
<script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
|
|
|
</head>
|
|
|
- <body>
|
|
|
+ <body style="visibility:hidden">
|
|
|
+ <!--<body>-->
|
|
|
<style>
|
|
|
.code_true{
|
|
|
position: absolute;
|
|
@@ -27,34 +28,105 @@
|
|
|
.email_input,.code_input{
|
|
|
line-height: 20px !important;
|
|
|
}
|
|
|
+ body .loading_ {
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ position: fixed;
|
|
|
+ background: #382f3d;
|
|
|
+ z-index: 999999999990;
|
|
|
+ opacity: .7;
|
|
|
+ margin-top: 20px;
|
|
|
+ }
|
|
|
+ body .loading_ > p {
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ bottom: 0;
|
|
|
+ margin: auto;
|
|
|
+ height: 60px;
|
|
|
+ width: 60px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 60px;
|
|
|
+ font-size: 0.36rem;
|
|
|
+ color: rgba(44, 183, 202, 0.8);
|
|
|
+ }
|
|
|
+ body .loading_ p span {
|
|
|
+ position: absolute;
|
|
|
+ display: block;
|
|
|
+ height: 40px;
|
|
|
+ width: 40px;
|
|
|
+ margin: 10px;
|
|
|
+ border-radius: 50%;
|
|
|
+ -webkit-box-shadow: 0 2px 3px rgba(44, 183, 202, 0.8);
|
|
|
+ animation: loading_ ease 1s infinite;
|
|
|
+ left: 0;
|
|
|
+ top: 0;
|
|
|
+ }
|
|
|
+ @keyframes loading_ {
|
|
|
+ 0% {
|
|
|
+ transform: rotate(0deg); }
|
|
|
+ 100% {
|
|
|
+ transform: rotate(360deg); }
|
|
|
+ }
|
|
|
</style>
|
|
|
+ <!-- 加载数据-->
|
|
|
+ <div class="loading_">
|
|
|
+ <p><span></span></p>
|
|
|
+ </div>
|
|
|
<div class="bind_email">
<div class="input mgT26">
<input type="email" placeholder="输入邮箱" name="" id="" value="" class="email_input" />
<input type="text" placeholder="输入验证码" name="" id="" value="" class="code_input" />
<button class="sendcode" >获取验证码</button>
|
|
|
<button class="code_true"><i class="icon iconfont email_check_ok" style="display: inline;"></i></button>
|
|
|
- <!--<i class="icon iconfont email_check_ok" style="display: inline;color:#2cb7ca"></i>-->
</div>
<button type="button" disabled="disabled" class="common_btn btn" id="bindBtn">绑定</button>
<div class="toast" style="display: none;">
<div class="toast_content"></div>
</div>
</div>
<script src="{{Msg "seo" "cdn"}}/wxmyemail/js//zepto.js?v={{Msg "seo" "version"}}"></script>
<script src="{{Msg "seo" "cdn"}}/wxmyemail/js/public.js?v={{Msg "seo" "version"}}1"></script>
<script>
$(function(){
|
|
|
+ <!--<i class="icon iconfont email_check_ok" style="display: inline;color:#2cb7ca"></i>-->
</div>
<button type="button" disabled="disabled" class="common_btn btn" id="bindBtn">绑定</button>
<div class="toast" style="display: none;">
<div class="toast_content"></div>
</div>
</div>
<script src="{{Msg "seo" "cdn"}}/wxmyemail/js//zepto.js?v={{Msg "seo" "version"}}"></script>
<script src="{{Msg "seo" "cdn"}}/wxmyemail/js/public.js?v={{Msg "seo" "version"}}1"></script>
<script>
|
|
|
+ $(function () {
|
|
|
+ var isPageHide = false;
|
|
|
+ window.addEventListener('pageshow', function () {
|
|
|
+ if (isPageHide) {
|
|
|
+ location.reload();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ window.addEventListener('pagehide', function () {
|
|
|
+ isPageHide = true;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ var param = getParam('name');
|
|
|
+ var orderCode=getParam("orderCode");
|
|
|
+ function initpage(){
|
|
|
+ $(".loading_").hide();
|
|
|
+ if(sessionStorage.getItem("1-1")=="1"){
|
|
|
+ sessionStorage.removeItem("1-1")
|
|
|
+ if((param=="change")||(param=="unbind")){
|
|
|
+ window.location.replace("/front/wxMyOrder/myEmail");
|
|
|
+ }else{
|
|
|
+ location.reload();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $("body").css({"visibility":""});
|
|
|
+ }
|
|
|
+ }
$(function(){
|
|
|
+// var initflag = true;
|
|
|
+// $(window).bind("pageshow", function(event){
|
|
|
+// initflag = false;
|
|
|
+// if (initflag){
|
|
|
+// initpage();
|
|
|
+// }
|
|
|
+// });
|
|
|
+// if (initflag){
|
|
|
+// initflag = false;
|
|
|
+// initpage();
|
|
|
+// }
|
|
|
+ $("body").css({"visibility":""});
|
|
|
+ $(".loading_").hide();
|
|
|
initShare({{.T.signature}},{{.T.openid}},2,"jy_wxmyorder",{{.T.nickname}},{{.T.avatar}});
var emailVal,code;
|
|
|
var userId={{.T.userId}}
var reg = /^[a-zA-Z0-9]+([._-]*[a-zA-Z0-9]*)*@[a-zA-Z0-9]+.[a-zA-Z0-9{2,5}$]/;
|
|
|
//判断是否是更改邮箱;
|
|
|
- var param = getParam('name');
|
|
|
- var orderCode=getParam("orderCode");
|
|
|
if (param=="change"){
|
|
|
- $(".email_input").attr("placeholder",{{.T.text_email}})
|
|
|
+ $(".email_input").attr("placeholder","输入新邮箱");
|
|
|
$("#bindBtn").html("确定");
|
|
|
}else if(param == "unbind"){
|
|
|
sessionStorage.setItem("unbind_"+userId,"ok");
|
|
|
promptbox("解绑成功");
|
|
|
}
|
|
|
|
|
|
-// $(".email_input").bind('input propertychange',()=>{
|
|
|
-// if((sessionStorage.getItem("send_myemail_"+userId)!=null)&&(sessionStorage.getItem("send_myemail_"+userId)!="")){
|
|
|
-// if((sessionStorage.getItem("send_myemail_"+userId))!= $('.email_input').val()){
|
|
|
-// $('.sendcode').prop("disabled","disabled");
|
|
|
-// }else{
|
|
|
-// sessionStorage.removeItem("send_myemail_"+userId);
|
|
|
-// $('.sendcode').removeAttr("disabled");
|
|
|
-// }
|
|
|
-// }
|
|
|
-// })
|
|
|
-
|
|
|
//
$('.sendcode').on('click',function(){
|
|
|
var that =this;
emailVal = $('.email_input').val();
let isEmail = reg.test(emailVal);//正则验证邮箱号
if($.trim(emailVal) === ''){
|
|
|
promptbox('邮箱号不能为空');
}else if(isEmail === false){
promptbox('邮箱格式不正确');
}else{
|
|
@@ -82,57 +154,69 @@
|
|
|
});
|
|
|
}
})
|
|
|
|
|
|
- //验证码校验
|
|
|
- $('.code_input').bind('input propertychange',()=>{
|
|
|
- var verity=$(".code_input").val();
|
|
|
- var email=$(".email_input").val().replace(/\s*/g,"");
|
|
|
- if(verity.length==6){
|
|
|
- $.post("/subscribepay/orderListDetails/checkMailCodeVerify",{
|
|
|
- "email":email,
|
|
|
- "emailVerity":verity,
|
|
|
- },function(data){
|
|
|
- if(data.success){
|
|
|
- $(".sendcode").css("display","none");
|
|
|
- $(".code_true").show();
|
|
|
- $(".code_input").prop("readonly","true");
|
|
|
- $("#bindBtn").removeAttr("disabled");
|
|
|
- }else{
|
|
|
- $(".code_true").hide();
|
|
|
- $("#bindBtn").attr("disabled","disabled");
|
|
|
- promptbox("邮箱验证码错误");
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- }).on("blur",()=>{
|
|
|
- var code_input_len=$(".code_input").val().length
|
|
|
- if((code_input_len!=6)&&(code_input_len!=0)){
|
|
|
+ //验证码校验
|
|
|
+ $('.code_input').bind('input propertychange',()=>{
|
|
|
+ var verity=$(".code_input").val();
|
|
|
+ var email=$(".email_input").val().replace(/\s*/g,"");
|
|
|
+ if(verity.length==6){
|
|
|
+ $.post("/subscribepay/orderListDetails/checkMailCodeVerify",{
|
|
|
+ "email":email,
|
|
|
+ "emailVerity":verity,
|
|
|
+ },function(data){
|
|
|
+ if(data.success){
|
|
|
+ $(".sendcode").css("display","none");
|
|
|
+ $(".code_true").show();
|
|
|
+ $(".code_input").prop("readonly","true");
|
|
|
+ $(".email_input").prop("readonly",true);
|
|
|
+ $("#bindBtn").removeAttr("disabled");
|
|
|
+ }else{
|
|
|
$(".code_true").hide();
|
|
|
$("#bindBtn").attr("disabled","disabled");
|
|
|
promptbox("邮箱验证码错误");
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- //绑定
|
|
|
- $("#bindBtn").on("click",function(){
|
|
|
- $.post("/subscribepay/orderListDetails/emailOperation",{
|
|
|
- "operation":"binding",
|
|
|
- "email":$(".email_input").val()
|
|
|
- },function(data){
|
|
|
- if(data.success){
|
|
|
- if ($("#bindBtn").text()=="确定"){ //更改绑定
|
|
|
- sessionStorage.removeItem("send_myemail_"+{{.T.userId}});
|
|
|
- window.location.replace("/front/wxMyOrder/setSuccess?name=changeEmail");
|
|
|
- }else{
|
|
|
- sessionStorage.removeItem("send_myemail_"+{{.T.userId}});
|
|
|
- if((param="invoice")&&(orderCode!=null)){
|
|
|
- window.location.replace("/front/wxMyOrder/setSuccess?name=invoice&orderCode="+orderCode);
|
|
|
- }else{
|
|
|
- window.location.replace("/front/wxMyOrder/setSuccess?name=bindEmail");
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ }).on("blur",()=>{
|
|
|
+ var code_input_len=$(".code_input").val().length
|
|
|
+ if((code_input_len!=6)&&(code_input_len!=0)){
|
|
|
+ $(".code_true").hide();
|
|
|
+ $("#bindBtn").attr("disabled","disabled");
|
|
|
+ promptbox("邮箱验证码错误");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //绑定
|
|
|
+ $("#bindBtn").on("click",function(){
|
|
|
+ $.post("/subscribepay/orderListDetails/emailOperation",{
|
|
|
+ "operation":"binding",
|
|
|
+ "email":$(".email_input").val()
|
|
|
+ },function(data){
|
|
|
+ if(data.success){
|
|
|
+ if ($("#bindBtn").text()=="确定"){ //更改绑定
|
|
|
+ sessionStorage.removeItem("send_myemail_"+{{.T.userId}});
|
|
|
+ sessionStorage.setItem("1-1","1")
|
|
|
+ window.location.replace("/front/wxMyOrder/setSuccess?name=changeEmail");
|
|
|
+ $("body").css({"visibility":"hidden"});
|
|
|
+ $(".loading_").show();
|
|
|
+ //window.location.href="/front/wxMyOrder/setSuccess?name=changeEmail";
|
|
|
+ }else{
|
|
|
+ sessionStorage.removeItem("send_myemail_"+{{.T.userId}});
|
|
|
+ if((param="invoice")&&(orderCode!=null)){
|
|
|
+ $(".loading_").show();
|
|
|
+ $("body").css({"visibility":"hidden"});
|
|
|
+ window.location.replace("/front/wxMyOrder/setSuccess?name=invoice&orderCode="+orderCode);
|
|
|
+ //Window.location.href="/front/wxMyOrder/setSuccess?name=invoice&orderCode="+orderCode;
|
|
|
+ }else{
|
|
|
+ $("body").css({"visibility":"hidden"});
|
|
|
+ $(".loading_").show();
|
|
|
+ sessionStorage.setItem("1-1","1")
|
|
|
+ window.location.replace("/front/wxMyOrder/setSuccess?name=bindEmail");
|
|
|
+ //window.location.href="/front/wxMyOrder/setSuccess?name=bindEmail";
|
|
|
}
|
|
|
- })
|
|
|
- })
})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
})
|
|
|
|
|
|
//提示框
|
|
|
function promptbox(str){
|
|
@@ -141,7 +225,9 @@
|
|
|
setTimeout(() =>{
|
|
|
$('.toast').hide(400);
|
|
|
},1500)
|
|
|
- }
</script>
|
|
|
+ }
|
|
|
+
|
|
|
+
</script>
|
|
|
|
|
|
{{include "/common/baiducc.html"}}
</body>
|
|
|
</html>
|