作者 杨乐
1 个管道 的构建 通过 耗费 6 秒

提交

... ... @@ -214,9 +214,9 @@
margin-bottom: 4%;place-items: center;box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.2);">
<img src='img/portfolio/WX.png' style="margin-right: 8%;">
<div id='login-a-ewm'>
<a style="font-size: 1.1em;font-family: Helvetica;" >微信快速登录/注册</a>
<a style="font-size: 1.1em;font-family: Helvetica;">微信快速登录/注册</a>
</div>
</div>
<p style="padding-top: 1%;font-family: Helvetica;">新用户请直接填写手机号进行验证注册;或使用微信登录直接注册。</p>
<div class="btnLogin" style="display: flex;place-items: center;place-content: center;padding-top: 2%;">
... ... @@ -269,9 +269,10 @@
<!-- jQuery -->
<script type="text/javascript" src="js/jquery-2.1.1.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/layer/3.1.1/layer.js"></script>
<!-- Custom Theme JavaScript -->
<script src="js/agency.js"></script>
<!-- 微信转换二维码 -->
<script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
<!-- Plugin JavaScript -->
<script src="js/jquery.easing.min.js"></script>
... ...
... ... @@ -13,31 +13,38 @@ $(document).ready(function() {
newCodes = newCode.split("&");
var ncode = newCodes[0]
// console.log(ncode);
var url1 = '/login/loginCheck'
var header1 = {
"Content-Type": "application/x-www-form-urlencoded"
}
var params = { code: ncode }
//传回code值
ajax(url1, "POST", header1, params, function(res) {
//传回code值 微信登录
ajax('/login/loginCheck', "POST", header1, params, function(res) {
console.log(res);
// alert("登录成功!")
localStorage.setItem("token", res.data.token);
localStorage.setItem("userId", res.data.id);
if (res.data.status === 1) {
window.location.href = 'save.html'
} else if (res.data.Status1 === 2) {
window.location.href = 'participated.html'
} else {
window.location.href = 'index.html'
}
//绑定账号的用户授权
var url3 = '/login/loginCheck1'
var header2 = {
"Content-Type": "application/x-www-form-urlencoded",
"token": res.data.token
}
ajax(url3, "PUT", header2, params, function(res) {
// alert("登录成功!")
localStorage.setItem("token", res.data.token);
localStorage.setItem("userId", res.data.id);
//查看个人信息
ajax("/login/userInfo", "GET", header2, function(res) {}, function(res) {
console.log(res);
})
// if (res.data.status === 1) {
// window.location.href = 'save.html'
// } else if (res.data.Status1 === 2) {
// window.location.href = 'participated.html'
// } else {
// window.location.href = 'index.html'
// }
//绑定账号的用户授权
ajax('/login/loginCheck1', "PUT", header2, params, function(res) {
console.log(res);
}, function(res) {
console.log(res);
... ... @@ -75,14 +82,13 @@ $(document).ready(function() {
code = ""; //清除验证码。如果不清除,过时间后,输入收到的验证码依然有效
}
}, 1000);
var url2 = '/login/codeLogin'
var header1 = {
"Content-Type": "application/x-www-form-urlencoded"
}
var params1 = { phoneNumber: phone }
//获取验证码接口
ajax(url2, "GET", header1, params1, function(res) {
ajax('/login/codeLogin', "GET", header1, params1, function(res) {
console.log(res);
}, function(res) {})
});
... ... @@ -102,7 +108,6 @@ $(document).ready(function() {
} else if (inputCode.length === 0) {
alert("验证码不能为空!")
} else {
var url = "/login/loginRegistered"; // 接口
var header = {
"Content-Type": "application/json"
}
... ... @@ -110,7 +115,9 @@ $(document).ready(function() {
code: inputCode,
phoneNumber: inputNumber
})
ajax(url, "POST", header, params2, function(res) {
//手机号登录
ajax("/login/loginRegistered", "POST", header, params2, function(res) {
console.log(res);
localStorage.setItem("token", res.data.token);
localStorage.setItem("userId", res.data.user);
... ... @@ -126,7 +133,6 @@ $(document).ready(function() {
window.location.href = 'save.html'
} else if (res.data.Status1 === 2) {
window.location.href = 'participated.html'
// window.location.href = 'browseMore.html'
} else {
window.location.href = 'index.html'
}
... ... @@ -143,33 +149,15 @@ $(document).ready(function() {
//获取用户VIP信息判断是否是VIP
function setPersonal() {
// $.ajax({
// type: 'GET',
// url: 'http://192.168.1.241:9004/login/userInfo',
// headers: {
// "Content-Type": "application/json",
// "token": localStorage.getItem('token'),
// },
// success: function(res) {
// console.log(res);
// if (res.data.status1 == 1) {
// window.location.href = 'personalCenter.html'
// } else {
// window.location.href = 'personalCenter2.html'
// }
// }
// })
alert('请先登录!')
}
//跳转二维码登录
//请求授权地址,跳转二维码登录页
function setEWM() {
var url = '/login/loginInit'
var header = {
"Content-Type": "application/x-www-form-urlencoded"
}
ajax(url, "GET", header, function(res) {}, function(res) {
ajax("/login/loginInit", "GET", header, function(res) {}, function(res) {
console.log(res);
console.log(res.data);
window.location.href = res.data
})
// $('#phone-login').hide()
... ...
... ... @@ -87,6 +87,12 @@
height: 40px;
}
.per-huiyuan-img {
margin-right: 10px;
width: 40px;
height: 40px;
}
.per-weixin-bind {
display: flex;
justify-content: space-between;
... ... @@ -735,6 +741,10 @@
</div>
<button style="color: #70D09D;background-color: #323232;border: 1px solid #70D09D;border-radius: 10em;padding: 0.5% 5%;">续费</button>
</div>
<!-- 支付宝页面 -->
<div class="zhifubao_form" style="display: none;">
</div>
</div>
</div>
<div class='personalCenter-right-all'>
... ...
... ... @@ -31,12 +31,12 @@ $(document).ready(function() {
// $("#WXunbind").html(title)
// }
if (res.data.wname == null) {
$("#WXunbind").html("绑定")
$("#WXunbind").html("未绑")
} else {
$("#WXunbind").html("解绑")
}
if (res.data.phoneNumber == null) {
$("#Punbind").html("绑定")
$("#Punbind").html("未绑")
} else {
$("#Punbind").html("解绑")
}
... ... @@ -78,7 +78,6 @@ $(document).ready(function() {
var inputEmailAddress = $("#emailAddress").val();
console.log(inputEmailAddress);
var url1 = "/login/updateSysUser";
var header1 = {
"Content-Type": "application/json",
}
... ... @@ -93,7 +92,7 @@ $(document).ready(function() {
userName: inputUserName
})
// 调用公共ajax
ajax(url1, "PUT", header1, params, function(res) {
ajax("/login/updateSysUser", "PUT", header1, params, function(res) {
console.log(res);
alert('保存成功!')
location.reload();
... ... @@ -108,7 +107,6 @@ $(document).ready(function() {
// 调用公共ajax
ajax(url2, "DELETE", header, function(res) {
console.log(res);
}, function(res) {
console.log(res);
alert("解绑成功!")
... ... @@ -121,7 +119,6 @@ $(document).ready(function() {
// 调用公共ajax
ajax(url3, "DELETE", header, function(res) {
console.log(res);
}, function(res) {
console.log(res);
alert("解绑成功!")
... ... @@ -231,22 +228,51 @@ function payment() {
console.log(res);
console.log(res);
console.log(res.data);
$(".hide_box").fadeToggle();
$(".shang_box").fadeToggle();
console.log(paymentType);
var params1 = {
id: res.data,
type: screenType
id: res.data,
type: screenType
}
//支付类型paymentType : 1微信 2支付宝
if (paymentType == 1) {
$(".hide_box").fadeToggle();
$(".shang_box").fadeToggle();
//微信支付
ajax("/pay/createNative", "GET", header1, params1, function(res1) {
console.log(res1);
let title = `<img src="${res1.data.codeUrl}" alt="扫码支付" title="扫一扫" >`
$(".shang_payimg").html(title)
//订单号
console.log(res1.data.outTradeNo);
//计时器
var timeInterval = setInterval(function() {
ajax("/orderLog/test", "GET", header1, { id: res1.data.outTradeNo }, function(res2) {
console.log(res2.data);
if (res2.data == '2') {
clearInterval(timeInterval)
alert("支付成功!")
window.location.href = 'personalCenter2.html'
}
}, function(res) {})
}, 2000)
}, function(res) {})
} else if (paymentType == 2) {
// $(".hide_box").fadeToggle();
// $(".shang_box").fadeToggle();
//支付宝支付
ajax("/zfbPay/alipay", "GET", header1, params1, function(res) {
console.log(res);
$(".zhifubao_form").html(res)
}, function(res) {})
} else {
alert("请选择支付类型!")
}
//微信支付
ajax("/pay/createNative", "GET", header1, params1, function(res) {
console.log(res);
let title = `<img src="${res.data.codeUrl}" alt="扫码支付" title="扫一扫" >`
$(".shang_payimg").html(title)
}, function(res) {})
}, function(res) {})
}, function(res) {
console.log(res);
})
}
//获取用户VIP信息判断是否是VIP
function ifVIP() {
... ...
... ... @@ -12,12 +12,12 @@ $(document).ready(function() {
}, function(res) {
console.log(res);
if (res.data.wname == null) {
$("#WXunbind").html("绑定")
$("#WXunbind").html("未绑")
} else {
$("#WXunbind").html("解绑")
}
if (res.data.phoneNumber == null) {
$("#Punbind").html("绑定")
$("#Punbind").html("未绑")
} else {
$("#Punbind").html("解绑")
}
... ...
$(document).ready(function() {
var header = {
"Content-Type": "application/x-www-form-urlencoded",
"token": localStorage.getItem('token'),
}
ajax("/login/userInfo", "GET", header, params, function(res) {
console.log(res);
alert('保存成功!')
window.location.href = 'index.html'
}, function(res) {
console.log(res);
})
});
//获取用户VIP信息判断是否是VIP
function setPersonal() {
// $.ajax({
// type: 'GET',
// url: 'http://192.168.1.241:9004/login/userInfo',
// headers: {
// "Content-Type": "application/json",
// "token": localStorage.getItem('token'),
// },
// success: function(res) {
// console.log(res);
// if (res.data.status1 == 1) {
// window.location.href = 'personalCenter.html'
// } else {
// window.location.href = 'personalCenter2.html'
// }
// }
// })
alert('请完善个人信息!')
}
$(".btnSave").click(function() {
... ... @@ -58,7 +53,7 @@ $(".btnSave").click(function() {
} else if (/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(inputEmailAddress) == false) {
alert("邮箱格式不正确,请重新填写!")
} else {
var url = "/login/updateSysUser"; // 接口
var url = "/login/updateSysUser";
var header = {
"Content-Type": "application/json"
}
... ... @@ -80,31 +75,5 @@ $(".btnSave").click(function() {
}, function(res) {
console.log(res);
})
// $.ajax({
// type: "PUT",
// url: "http://192.168.1.241:9004/login/updateSysUser",
// // dataType: "jsonp",
// headers: {
// "Content-Type": "application/json"
// },
// data: JSON.stringify({
// emailAddress: inputEmailAddress,
// id: localStorage.getItem("userId"),
// img: null,
// phone: inputPhone,
// specialty: inputSpecialty,
// school: inputSchool,
// surname: inputSurname,
// userName: inputUserName
// }),
// success: function(msg) {
// alert('保存成功!')
// window.location.href = 'index.html'
// },
// error: function(res) {}
// });
}
})
\ No newline at end of file
... ...