久久久久av_欧美日韩一区二区在线_国产精品三区四区_日韩中字在线

返回列表 發帖
查看: 3546|回復: 4

求助大神 強制設定登錄需要設定昵稱才可操作

8

主題

33

回帖

92

積分

漸入佳境

貢獻
0 點
金幣
48 個
樓主
發表于 2019-7-9 16:39:21 | 只看樓主 |只看大圖 |倒序瀏覽 |閱讀模式

求助,如何在用戶登錄后論壇直接設定昵稱  若不設定昵稱  自動退出  

請問這些代碼應該要加入到哪里呢?
  1. <script src="template/XXX/image/js/nv.js" type="text/javascript"></script>              
  2. <div class="p_pop h_pop" id="mn_userapp_menu" style="display: none"></div><div id="mu" class="cl">
  3. </div>               
  4. </div>        
  5. </div>            <div class="index_tkbg hide">
  6.     <div class="index_tk">
  7.       <p class="tk_top">親愛的客戶</p>
  8.       <span class="tk_close">×</span>
  9.       <p class="tk_ts">創建論壇賬號,請先填寫昵稱(填寫后不能更改)</p>
  10.       <div class="tk_inp tk_mar"><input type="text" name="username" id="username" maxlength="15" /><span class="warn_tk"></span></div>
  11.       <div class="tk_inp"><button id="subname" class="disable">提交</button></div>
  12.     </div>
  13.    
  14. </div>
  15. <div class="login_tkbg hide">
  16.     <div class="index_tk">
  17.       <p class="tk_top">親愛的客戶</p>
  18.       <span class="tk_close">×</span>
  19.       <p class="tk_ts">請先登錄您的賬號</p>
  20.       <div class="tk_inp login_marg"><button id="login_bth">立即登錄</button> <button id="login_know">我知道了</button></div>
  21.     </div>
  22. </div>
  23. <div id="login_bbslink" class="hide">online</div>
  24.          <div id="login_bbsactive" class="hide">0</div>
  25. <script type="text/javascript">
復制代碼
加載的js:
  1. <script type="text/javascript">
復制代碼
除此之外還需要加入哪些修改呢?
回復

使用道具 舉報

8

主題

33

回帖

92

積分

漸入佳境

貢獻
0 點
金幣
48 個
沙發
 樓主| 發表于 2019-7-9 16:40:40 | 只看Ta

加載的js:
  1. <script type="text/javascript">
  2. var prj = {};
  3. //按鈕上幾個點的loading效果
  4. prj.loadingAnimation = function(container){
  5. var loading = '<ul class="clearfix loadingpoint"><li class="active"></li><li></li><li></li><li></li><li></li></ul>';
  6. var loadingpoint = jQuery(container).find('.loadingpoint');
  7. if(loadingpoint.length == 0){
  8. //需要先加入,再選擇        
  9. jQuery(container).append(loading);
  10. }
  11. var num = 0;
  12. var el = $('.loadingpoint li');
  13. setInterval(function () {
  14. num++;
  15. num %= jQuery(el).length;
  16. $(el[num]).addClass('active').siblings('li').removeClass();
  17. }, 500);
  18. }
  19. prj.btnloading = function (btn, loadingword) {
  20. var loadingword = typeof !loadingword ? '提交中' : loadingword;
  21. //復制一個副本
  22. var cloneBtn = btn.clone(true);

  23. /*
  24. 按鈕克隆,需要單例
  25. */
  26. btn.hide();
  27. btn.siblings('.btnloading').remove();
  28. cloneBtn.insertAfter(btn);
  29. cloneBtn.addClass('disable btnloading').html(loadingword);
  30. //loading效果
  31. prj.loadingAnimation(cloneBtn);

  32. //透明度為0的遮罩
  33. // this.newloading();
  34. }
  35. prj.singleWay = (function () {

  36. var fgs = {},
  37. kit = {
  38. resolve: function (key) {
  39. fgs[key] = false;
  40. }
  41. };

  42. return function (key, func) {
  43. if (fgs[key] === true) {
  44. return;
  45. } else {
  46. fgs[key] = true;
  47. func.call(kit, key);
  48. }
  49. }
  50. })();
  51. if(!String.prototype.trim){
  52. String.prototype.trim = function(){
  53. return this.replace(/^\s*|\s*&/g,"");
  54. }
  55. }

  56. jQuery(function(jQuery){
  57.     var active=jQuery('#login_bbsactive').text();                        //0:無論壇賬號  非0:有賬號
  58.     var urls=window.location.search;
  59.     var urlone=urls.split("?");
  60.     if(urlone !=""){
  61.     var urlstyle=urlone[1].split("=")
  62.     var scookie=jQuery.cookie('cookieispop');
  63.      if(scookie!=undefined && urlstyle[0]=='ispop'){
  64.         if (active!=0) {
  65.           jQuery('.index_tkbg').addClass('hide');
  66.         }else{
  67.           jQuery('.index_tkbg').removeClass('hide');
  68.         }
  69.      };
  70.     }
  71.     jQuery(document).on('blur','#username',function(){
  72.               var floag=0;
  73.               var  inp=document.getElementById('username');
  74.               var username=inp.value;
  75.         if (username.length<3) {
  76.                 jQuery('.warn_tk').text('賬號的長度為3-15位');
  77.                 return;
  78.         }else{
  79.                 for(var i=0;i<username.length;i++){
  80.           var reg=/^[a-z0-9A-Z\u4e00-\u9fa5]*$/;
  81.           if(reg.test(username[i])==false){
  82.             floag=1;
  83.             jQuery('.warn_tk').text('昵稱不能包含特殊字符');
  84.             return;
  85.           }
  86.         }
  87.               }
  88.     if (floag==0) {
  89.               var cookies = document.cookie.split(';');
  90.         var iscookie=';'
  91.         for(var i = 0;i<cookies.length;i++){
  92.               var name='cookieispop'+'=';
  93.               var ca=cookies[i].trim();
  94.               if (ca.indexOf(name)==0) {
  95.                 iscookie=ca.substring(name.length,ca.length)
  96.               };
  97.         };
  98.         var urls=window.location.search;
  99.           if(urls !=""){
  100.             var urlstyle=urls.split("=")
  101.             uels=urlstyle[1];
  102.         }
  103.         jQuery.ajax({
  104.             type: "POST",
  105.             url: "bbslink.php?mod=linkregister",
  106.             data: {
  107.                 'nickname':username,
  108.                 'ispop':uels,
  109.                 'cookieispop':iscookie,
  110.                 'step':1
  111.             },
  112.             success: function (res) {
  113.               var res=JSON.parse(res);
  114.                if(res.status==0){
  115.                 jQuery('.warn_tk').text("昵稱已存在");
  116.                 jQuery('#subname').attr('disabled',true)
  117.               }else if(res.status==-1){
  118.                 jQuery('.warn_tk').text("已存在對應論壇賬號");
  119.                 jQuery('#subname').attr('disabled',true)
  120.               }else if(res.status==-2){
  121.                 jQuery('.warn_tk').text("昵稱不符合規則");
  122.                 jQuery('#subname').attr('disabled',true)
  123.               }else if(res.status==-3){
  124.                 jQuery('.warn_tk').text("請求路徑非法");
  125.                 jQuery('#subname').attr('disabled',true)
  126.               }else if(res.status==-4){
  127.                  jQuery('.warn_tk').text("昵稱長度不符合");
  128.                  jQuery('#subname').attr('disabled',true)
  129.               }else{
  130.                 jQuery('.warn_tk').text("");
  131.                 jQuery('#subname').attr('disabled',false);
  132.                 jQuery('#subname').removeClass('disable');
  133.                 prj.singleWay('subname-key',function(key){
  134.                         var kit = this;
  135.                         jQuery(document).on('click','#subname',function(){
  136.                     var that = jQuery('#subname');
  137.                     if(that.hasClass('disable')){
  138.                             return;
  139.                     }
  140.                         jQuery.ajax({
  141.                     type: "POST",
  142.                     url: "bbslink.php?mod=linkregister",
  143.                     data: {
  144.                         'nickname':username,
  145.                         'ispop':uels,
  146.                         'cookieispop':iscookie,
  147.                         'step':2
  148.                     },
  149.                     success: function (res) {
  150.                        kit.resolve(key);
  151.                        location.href="forum.php"
  152.                        jQuery('#subname').attr('disabled',true);
  153.                     },
  154.                     error:function(){
  155.                       kit.resolve(key);        
  156.                       alert('網絡異常,請稍后重試')
  157.                     },
  158.                     beforeSend: function () {
  159. prj.btnloading(that, '');
  160. }
  161.                       })
  162.             });
  163.                 });
  164.               }
  165.             },
  166.             error:function(){
  167.               alert('網絡異常,請稍后重試')
  168.             }
  169.         })
  170.     };
  171.     });
  172.     jQuery('.tk_close').on('click',function(){
  173.                    jQuery('.index_tkbg').addClass('hide');
  174.                    jQuery('.login_tkbg').addClass('hide');
  175.     })
  176.           jQuery('#login_bth').on('click',function(){
  177.            if($('ls_username').value == '' || $('ls_password').value == '') {
  178. var urltwo=location.href
  179. var acurl=jQuery('#login_bbslink').text();
  180. if (acurl=='develop') {
  181. window.open('http://t.e03.com/index.htm?returncode='+urltwo+'');
  182. jQuery('.login_tkbg').addClass('hide');
  183. }else if(acurl=='online'){
  184.             window.location.+urltwo+'';
  185. }else{
  186.             window.location.+urltwo+'';
  187. }
  188. } else {
  189. }
  190.           });
  191.     jQuery('#login_know').on('click',function(){        
  192.                     jQuery('.login_tkbg').addClass('hide');
  193.           })
  194. });
  195. </script>
  196. <div id="wp" class="wp">
復制代碼
回復

使用道具 舉報

7

主題

61

回帖

88

積分

漸入佳境

貢獻
0 點
金幣
18 個
板凳
發表于 2019-7-10 13:09:03 | 只看Ta
我不會,但樓下會
回復

使用道具 舉報

8

主題

52

回帖

108

積分

漸入佳境

貢獻
0 點
金幣
44 個
地板
發表于 2019-7-10 14:34:22 | 只看Ta
小白路過幫你頂。。。
回復

使用道具 舉報

8

主題

33

回帖

92

積分

漸入佳境

貢獻
0 點
金幣
48 個
5#
 樓主| 發表于 2019-7-11 09:59:22 | 只看Ta
我不會,但樓下會
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

  • 關注公眾號
  • 有償服務微信
  • 有償服務QQ

手機版|小黑屋|Discuz! 官方交流社區 ( 皖ICP備16010102號 |皖公網安備34010302002376號 )|網站地圖|star

GMT+8, 2025-9-19 13:25 , Processed in 0.088899 second(s), 28 queries .

Powered by Discuz! W1.0 Licensed

Copyright © 2001-2025 Discuz! Team.

關燈 在本版發帖
有償服務QQ
有償服務微信
返回頂部
快速回復 返回頂部 返回列表