久久久久av_欧美日韩一区二区在线_国产精品三区四区_日韩中字在线
Discuz! 官方交流社區
標題:
求助大神 強制設定登錄需要設定昵稱才可操作
[打印本頁]
作者:
樂虎國際
時間:
2019-7-9 16:39
標題:
求助大神 強制設定登錄需要設定昵稱才可操作
(, 下載次數: 18)
上傳
點擊文件名下載附件
求助,如何在用戶登錄后論壇直接設定昵稱 若不設定昵稱 自動退出
請問這些代碼應該要加入到哪里呢?
<script src="template/XXX/image/js/nv.js" type="text/javascript"></script>
<div class="p_pop h_pop" id="mn_userapp_menu" style="display: none"></div><div id="mu" class="cl">
</div>
</div>
</div> <div class="index_tkbg hide">
<div class="index_tk">
<p class="tk_top">親愛的客戶</p>
<span class="tk_close">×</span>
<p class="tk_ts">創建論壇賬號,請先填寫昵稱(填寫后不能更改)</p>
<div class="tk_inp tk_mar"><input type="text" name="username" id="username" maxlength="15" /><span class="warn_tk"></span></div>
<div class="tk_inp"><button id="subname" class="disable">提交</button></div>
</div>
</div>
<div class="login_tkbg hide">
<div class="index_tk">
<p class="tk_top">親愛的客戶</p>
<span class="tk_close">×</span>
<p class="tk_ts">請先登錄您的賬號</p>
<div class="tk_inp login_marg"><button id="login_bth">立即登錄</button> <button id="login_know">我知道了</button></div>
</div>
</div>
<div id="login_bbslink" class="hide">online</div>
<div id="login_bbsactive" class="hide">0</div>
<script type="text/javascript">
復制代碼
加載的js:
<script type="text/javascript">
復制代碼
除此之外還需要加入哪些修改呢?
作者:
樂虎國際
時間:
2019-7-9 16:40
加載的js:
<script type="text/javascript">
var prj = {};
//按鈕上幾個點的loading效果
prj.loadingAnimation = function(container){
var loading = '<ul class="clearfix loadingpoint"><li class="active"></li><li></li><li></li><li></li><li></li></ul>';
var loadingpoint = jQuery(container).find('.loadingpoint');
if(loadingpoint.length == 0){
//需要先加入,再選擇
jQuery(container).append(loading);
}
var num = 0;
var el = $('.loadingpoint li');
setInterval(function () {
num++;
num %= jQuery(el).length;
$(el[num]).addClass('active').siblings('li').removeClass();
}, 500);
}
prj.btnloading = function (btn, loadingword) {
var loadingword = typeof !loadingword ? '提交中' : loadingword;
//復制一個副本
var cloneBtn = btn.clone(true);
/*
按鈕克隆,需要單例
*/
btn.hide();
btn.siblings('.btnloading').remove();
cloneBtn.insertAfter(btn);
cloneBtn.addClass('disable btnloading').html(loadingword);
//loading效果
prj.loadingAnimation(cloneBtn);
//透明度為0的遮罩
// this.newloading();
}
prj.singleWay = (function () {
var fgs = {},
kit = {
resolve: function (key) {
fgs[key] = false;
}
};
return function (key, func) {
if (fgs[key] === true) {
return;
} else {
fgs[key] = true;
func.call(kit, key);
}
}
})();
if(!String.prototype.trim){
String.prototype.trim = function(){
return this.replace(/^\s*|\s*&/g,"");
}
}
jQuery(function(jQuery){
var active=jQuery('#login_bbsactive').text(); //0:無論壇賬號 非0:有賬號
var urls=window.location.search;
var urlone=urls.split("?");
if(urlone !=""){
var urlstyle=urlone[1].split("=")
var scookie=jQuery.cookie('cookieispop');
if(scookie!=undefined && urlstyle[0]=='ispop'){
if (active!=0) {
jQuery('.index_tkbg').addClass('hide');
}else{
jQuery('.index_tkbg').removeClass('hide');
}
};
}
jQuery(document).on('blur','#username',function(){
var floag=0;
var inp=document.getElementById('username');
var username=inp.value;
if (username.length<3) {
jQuery('.warn_tk').text('賬號的長度為3-15位');
return;
}else{
for(var i=0;i<username.length;i++){
var reg=/^[a-z0-9A-Z\u4e00-\u9fa5]*$/;
if(reg.test(username[i])==false){
floag=1;
jQuery('.warn_tk').text('昵稱不能包含特殊字符');
return;
}
}
}
if (floag==0) {
var cookies = document.cookie.split(';');
var iscookie=';'
for(var i = 0;i<cookies.length;i++){
var name='cookieispop'+'=';
var ca=cookies[i].trim();
if (ca.indexOf(name)==0) {
iscookie=ca.substring(name.length,ca.length)
};
};
var urls=window.location.search;
if(urls !=""){
var urlstyle=urls.split("=")
uels=urlstyle[1];
}
jQuery.ajax({
type: "POST",
url: "bbslink.php?mod=linkregister",
data: {
'nickname':username,
'ispop':uels,
'cookieispop':iscookie,
'step':1
},
success: function (res) {
var res=JSON.parse(res);
if(res.status==0){
jQuery('.warn_tk').text("昵稱已存在");
jQuery('#subname').attr('disabled',true)
}else if(res.status==-1){
jQuery('.warn_tk').text("已存在對應論壇賬號");
jQuery('#subname').attr('disabled',true)
}else if(res.status==-2){
jQuery('.warn_tk').text("昵稱不符合規則");
jQuery('#subname').attr('disabled',true)
}else if(res.status==-3){
jQuery('.warn_tk').text("請求路徑非法");
jQuery('#subname').attr('disabled',true)
}else if(res.status==-4){
jQuery('.warn_tk').text("昵稱長度不符合");
jQuery('#subname').attr('disabled',true)
}else{
jQuery('.warn_tk').text("");
jQuery('#subname').attr('disabled',false);
jQuery('#subname').removeClass('disable');
prj.singleWay('subname-key',function(key){
var kit = this;
jQuery(document).on('click','#subname',function(){
var that = jQuery('#subname');
if(that.hasClass('disable')){
return;
}
jQuery.ajax({
type: "POST",
url: "bbslink.php?mod=linkregister",
data: {
'nickname':username,
'ispop':uels,
'cookieispop':iscookie,
'step':2
},
success: function (res) {
kit.resolve(key);
location.href="forum.php"
jQuery('#subname').attr('disabled',true);
},
error:function(){
kit.resolve(key);
alert('網絡異常,請稍后重試')
},
beforeSend: function () {
prj.btnloading(that, '');
}
})
});
});
}
},
error:function(){
alert('網絡異常,請稍后重試')
}
})
};
});
jQuery('.tk_close').on('click',function(){
jQuery('.index_tkbg').addClass('hide');
jQuery('.login_tkbg').addClass('hide');
})
jQuery('#login_bth').on('click',function(){
if($('ls_username').value == '' || $('ls_password').value == '') {
var urltwo=location.href
var acurl=jQuery('#login_bbslink').text();
if (acurl=='develop') {
window.open('http://t.e03.com/index.htm?returncode='+urltwo+'');
jQuery('.login_tkbg').addClass('hide');
}else if(acurl=='online'){
window.location.+urltwo+'';
}else{
window.location.+urltwo+'';
}
} else {
}
});
jQuery('#login_know').on('click',function(){
jQuery('.login_tkbg').addClass('hide');
})
});
</script>
<div id="wp" class="wp">
復制代碼
作者:
yeah
時間:
2019-7-10 13:09
我不會,但樓下會
作者:
琴對誰彈
時間:
2019-7-10 14:34
小白路過幫你頂。。。
作者:
樂虎國際
時間:
2019-7-11 09:59
我不會,但樓下會
歡迎光臨 Discuz! 官方交流社區 (http://www.9999xn.com/)
Powered by Discuz! W1.0