123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- mui.ready(function() {
-
- var bdPhone = document.getElementById("bdPhone");
- var bdEmail = document.getElementById("bdEmail");
- var changePass = document.getElementById("changepass");
- var phoneName = document.getElementById("phonename");
- var emailName = document.getElementById("emailname");
- var verified = document.getElementById("verified");
- var phoneCookie = "";
- var emailCookie = "";
- mui.plusReady(function() {
-
- isAuthentication();
-
- lookup();
-
-
- window.addEventListener('securityPage',function(event){
- phoneName = event.detail.id;
- ifPhoneAmdEmail(phoneCookie)
- })
-
-
-
- bdEmail.addEventListener('tap', function() {
- mui.openWindow({
- url: '../html/bindmail.html',
- id: '../html/bindmail.html',
- show: {
- aniShow: "slide-in-right"
- }
- });
- })
- bdPhone.addEventListener('tap', function() {
- mui.openWindow({
- url: '../html/bindphone.html',
- id: '../html/bindphone.html',
- show: {
- aniShow: "slide-in-right"
- }
- });
- })
- changePass.addEventListener('tap', function() {
- mui.openWindow({
- url: '../html/changepass.html',
- id: '../html/changepass.html',
- show: {
- aniShow: "slide-in-right"
- }
- });
- })
- function ifPhoneAmdEmail(){
-
- if(phoneCookie != "" && phoneCookie != null && phoneCookie != "null") {
-
- phoneName.innerText = (phoneCookie);
- } else {
- phoneName.innerText = ("请绑定手机号");
- }
-
-
- if(emailCookie != "" && emailCookie != null && emailCookie != "null") {
- emailName.innerText = (emailCookie);
- } else {
- emailName.innerText = ("请绑定邮箱");
- }
- }
- function isAuthentication() {
- var userId = plus.storage.getItem('userid');
- mui.ajax(baseUrl + "/ajax/professor/editBaseInfo/" + userId, {
- dataType: 'json',
- type: 'GET',
- timeout: 10000,
- async: false,
- success: function(data) {
- var $info = data.data || {}
- if(data.success && data.data) {
- if($info.authentication){
- verified.innerText="已认证";
- }else{
- verified.innerText="为认证";
- }
- }
- },
- error: function() {
- plus.nativeUI.toast("服务器链接超时", toastStyle);
- return;
- }
- });
- }
-
- function lookup() {
- var userId = plus.storage.getItem('userid');
- mui.ajax(baseUrl + "/ajax/qaUser" , {
- data:{
- id:userId
- },
- dataType: 'json',
- type: 'GET',
- timeout: 10000,
- async: false,
- success: function(data) {
- var $info = data.data || {}
- if(data.success && $info) {
- emailCookie = $info.email;
- phoneCookie = $info.mobilePhone;
- ifPhoneAmdEmail(phoneCookie,emailCookie)
- }
- },
- error: function() {
- plus.nativeUI.toast("服务器链接超时", toastStyle);
- return;
- }
- });
- }
- })
- });
|