index.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. function HL(){
  2. var info=$('#NewsKind_K').val();
  3. if(info==3){
  4. var name=$('#HSK').val();
  5. window.open("http://help.smartcost.com.cn/hc/search/results/?type=kb&keyword="+name);
  6. }else{
  7. $('#NewsKind_KFORM').attr("action", '/searchNews').submit();
  8. }
  9. }
  10. function HL2(){
  11. var info=$('#NewsKind_K2').val();
  12. if(info==3){
  13. var name=$('#HSK2').val();
  14. window.open("http://help.smartcost.com.cn/hc/search/results/?type=kb&keyword="+name);
  15. }else{
  16. $('#NewsKind_KFORM2').submit();
  17. }
  18. }
  19. function changeProduct(ty){
  20. var info=$('#info');
  21. var down=$('#down');
  22. var edition=$('#edition');
  23. var animation=$('#animation');
  24. var a=$('#a');
  25. var b=$('#b');
  26. var c=$('#c');
  27. var d=$('#d');
  28. if(ty=="info"){
  29. info.show();
  30. down.hide();
  31. edition.hide();
  32. animation.hide();
  33. a.attr('class','now');
  34. b.attr('class','');
  35. c.attr('class','');
  36. d.attr('class','');
  37. }else if(ty=="down"){
  38. down.show();
  39. info.hide();
  40. edition.hide();
  41. animation.hide();
  42. b.attr('class','now');
  43. a.attr('class','');
  44. c.attr('class','');
  45. d.attr('class','');
  46. }else if(ty=="edition"){
  47. edition.show();
  48. info.hide();
  49. down.hide();
  50. animation.hide();
  51. c.attr('class','now');
  52. a.attr('class','');
  53. b.attr('class','');
  54. d.attr('class','');
  55. }else if(ty=="animation"){
  56. animation.show();
  57. info.hide();
  58. edition.hide();
  59. down.hide();
  60. d.attr('class','now');
  61. a.attr('class','');
  62. c.attr('class','');
  63. b.attr('class','');
  64. }
  65. }
  66. function getDownMessage(did,title,pid){
  67. var list=$('.selectList');
  68. if(did==""||did==0){
  69. //list.hide();
  70. easyDialog.open({
  71. container : {
  72. header : '未找到该软件的版本信息',
  73. content :'未找到该软件的版本信息!'
  74. },
  75. autoClose : 300
  76. });
  77. return false;
  78. }
  79. var url="/ajaxSoftDown";
  80. $.ajax({
  81. url:url,
  82. type: "post",
  83. cache: false,
  84. dataType: "json",
  85. data: {
  86. did:did,
  87. pid:pid
  88. },
  89. global: true,
  90. success: function(data){
  91. //list.hide();
  92. $('.cl').removeClass('now');
  93. $('#'+pid).addClass('now');
  94. $('#stitle').html(title);
  95. var arr=new Array();
  96. var sstr="";
  97. for(var i=0; i<data.dot.length; i++){
  98. if(data.dot[i].key_number!=""){
  99. sstr='<li><a href="javascript:getDownUrl(\''+data.dot[i].down_url+'\',\''+data.dot[i].title+'\')">'+data.dot[i].title+'&nbsp;【'+data.dot[i].key_number+'】</a></li>';
  100. }else{
  101. sstr='<li><a href="javascript:getDownUrl(\''+data.dot[i].down_url+'\',\''+data.dot[i].title+'\')">'+data.dot[i].title+'&nbsp;</a></li>';
  102. }
  103. arr.push(sstr);
  104. }
  105. var html=arr.join("");
  106. $("#ctitle").html('请选择软件版本');
  107. $('.downLink').hide(200);
  108. $('#sle').show();
  109. $("#downUrl").html(html);
  110. $("#sle").show();
  111. $("#kt").html(data.info);
  112. },
  113. error:function(err){
  114. alert('请输入正确的参数');
  115. }
  116. });
  117. }
  118. function getDownUrl(url,title){
  119. var a = url.split("{b}");
  120. var sstr="下载地址:";
  121. var arr=new Array();
  122. arr.push(sstr);
  123. for(var i=0; i<a.length; i++){
  124. s=i+1;
  125. if(s==1){
  126. sstr='<a target="blank" href="'+a[i]+'">推荐下载</a>';
  127. arr.push(sstr);
  128. }else{
  129. sstr='<a target="blank" href="'+a[i]+'">普通下载</a>';
  130. arr.push(sstr);
  131. }
  132. }
  133. var html=arr.join("");
  134. $('#sdown').html(html);
  135. $('#ctitle').html(title);
  136. $('.downLink').hide();
  137. $('.downLink').show(200);
  138. //$('.secList').hide();
  139. }
  140. function getNewsPage(){
  141. var v=$("#newsP").find("option:selected").val();
  142. var a = v.split(":");
  143. window.location.href="/news/"+a[0]+"/"+"/"+a[1];
  144. }