|
@@ -10,6 +10,21 @@ if(localStorage.getItem('uid')) {
|
|
|
$('.login').hide();
|
|
|
$('.jurisdiction').show();
|
|
|
}
|
|
|
+$('#phoneNum').keydown((event) => {
|
|
|
+ const phoneNum = $('#phoneNum').val().replace(/\s/ig,'');
|
|
|
+ if (event.keyCode === 13 && proving(phoneNum) && flag) {
|
|
|
+
|
|
|
+ $.get(`${process.env.BASE_API}sharedWhiteBoard/wx/user/sendMag`, {
|
|
|
+ phoneNum
|
|
|
+ }, function (res) {
|
|
|
+ if(res.code == 200) {
|
|
|
+ code = res.data;
|
|
|
+ $('#phoneCode').focus()
|
|
|
+ time();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+})
|
|
|
$('#sendCode').click(function () {
|
|
|
const phoneNum = $('#phoneNum').val().replace(/\s/ig,'');
|
|
|
if(proving(phoneNum) && flag) {
|
|
@@ -24,6 +39,34 @@ $('#sendCode').click(function () {
|
|
|
});
|
|
|
}
|
|
|
})
|
|
|
+$('#phoneCode').keydown((event) => {
|
|
|
+ const mobile = $('#phoneNum').val().replace(/\s/ig,'');
|
|
|
+ const sign = $('#phoneCode').val().replace(/\s/ig,'');
|
|
|
+ if (event.keyCode === 13 && proving(mobile)) {
|
|
|
+ $.ajax({
|
|
|
+ url:`${process.env.BASE_API}sharedWhiteBoard/wx/user/loginByPhone`,
|
|
|
+ type: 'POST',
|
|
|
+ data: JSON.stringify({
|
|
|
+ mobile,
|
|
|
+ sign
|
|
|
+ }),
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: "json",
|
|
|
+ success: function (res) {
|
|
|
+ console.log(res)
|
|
|
+ if(res.code == 200) {
|
|
|
+ console.log(res.data.id)
|
|
|
+ localStorage.setItem('uid', res.data.id);
|
|
|
+ $('.login').hide();
|
|
|
+ $('.jurisdiction').show();
|
|
|
+ }else if (res.code == 600) {
|
|
|
+ console.log(res.message);
|
|
|
+ alert(res.message)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+})
|
|
|
$('#login').click(function () {
|
|
|
const mobile = $('#phoneNum').val().replace(/\s/ig,'');
|
|
|
const sign = $('#phoneCode').val().replace(/\s/ig,'');
|
|
@@ -56,6 +99,48 @@ $('#login').click(function () {
|
|
|
|
|
|
|
|
|
})
|
|
|
+$('#title').keydown((event) => {
|
|
|
+ const title = $('#title').val().replace(/\s/ig,'');
|
|
|
+ if (event.keyCode === 13 && title) {
|
|
|
+ $('.auth-code').focus();
|
|
|
+ }
|
|
|
+})
|
|
|
+$('.auth-code').keydown((event) => {
|
|
|
+ const title = $('#title').val().replace(/\s/ig,'');
|
|
|
+ const code = $('.auth-code').val().replace(/\s/ig,'');
|
|
|
+ const uid = window.localStorage.getItem('uid');
|
|
|
+ if (event.keyCode === 13) {
|
|
|
+ if(!title) {
|
|
|
+ alert('请输入分会场名称')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(!code) {
|
|
|
+ alert('请输入授权码')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ url:`${process.env.BASE_API}sharedWhiteBoard/shareJoin`,
|
|
|
+ type: 'POST',
|
|
|
+ data: JSON.stringify({
|
|
|
+ uid,
|
|
|
+ title,
|
|
|
+ code
|
|
|
+ }),
|
|
|
+ contentType: "application/json",
|
|
|
+ dataType: "json",
|
|
|
+ success: function (res) {
|
|
|
+ if(res.code == 200) {
|
|
|
+ const shareTask = JSON.stringify(res.data);
|
|
|
+ window.sessionStorage.setItem('dataList', shareTask);
|
|
|
+ window.location.href="./index.html"
|
|
|
+ }else if (res.code == 600) {
|
|
|
+ console.log(res.message)
|
|
|
+ alert(res.message)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
$('#ok').click(function () {
|
|
|
const title = $('#title').val().replace(/\s/ig,'');
|