暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. $(document).ready(function() {
  2. let subscriptionData = localStorage.getItem("subscription-data") ? JSON.parse(localStorage.getItem("subscription-data")) : null;
  3. data.cores = subscriptionData.blockDetails.cores;
  4. data.ram = subscriptionData.blockDetails.ram;
  5. data.storage = subscriptionData.blockDetails.storage;
  6. data.transfer = subscriptionData.blockDetails.transfer;
  7. blockValue = subscriptionData.currentBlock;
  8. subscriptionType = subscriptionData.subscriptionType;
  9. data.totalCost = subscriptionData.totalCost
  10. toggleSwitch = subscriptionData.toggleSwitch
  11. console.log(toggleSwitch)
  12. changeHtmlData();
  13. $("#auth-block-input").change(function(){
  14. let blockInp=$(this).val();
  15. if(blockInp==0 || blockInp >= 100) return;
  16. blockValue = blockInp;
  17. data.cores=4*blockInp;
  18. data.ram =4*blockInp;
  19. data.storage =512*blockInp;
  20. data.transfer = 8*blockInp;
  21. changeHtmlData();
  22. })
  23. });
  24. // toggleswitch
  25. // $('#order-summary-toggle-switch').change(function() {
  26. console.log('change event')
  27. console.log($('#order-summary-toggle-switch'))
  28. $('#order-summary-toggle-switch').change(function() {
  29. blockValue = $("#auth-block-input").val();
  30. if(blockValue == 0) return;
  31. if(this.checked) {
  32. subscriptionType = "yearly";
  33. }else{
  34. subscriptionType = "monthly";
  35. }
  36. changeTotalCost();
  37. });
  38. $(".status-check.nav-pills .nav-link").click(function() {
  39. // $(".status-check.nav-pills .nav-link").find('input[type=radio]').prop('checked',false);
  40. $(".status-check.nav-pills .nav-link.active").find('input[type=radio]').prop('checked',true);
  41. });
  42. $(".status-label").click(function() {
  43. // $(".status-label").find('input[type=radio]').prop('checked',false);
  44. // $(".status-label").find('input[type=radio]').prop('checked',true);
  45. });
  46. // change total-cost-order-summery
  47. function changeTotalCost() {
  48. blockValue = $("#auth-block-input").val();
  49. if(blockValue == 0) return;
  50. if(!totalCost[blockValue]) return;
  51. $("#subscription-cost").html(totalCost[blockValue].total[subscriptionType]);
  52. changeServerPricing(blockValue);
  53. }
  54. // new-input-changes
  55. function changeHtmlData() {
  56. $("#auth-block-input").val(blockValue);
  57. $("#data-cores").html(data.cores);
  58. $("#data-ram").html(data.ram);
  59. $("#data-storage").html(data.storage);
  60. $("#data-transfer").html(data.transfer);
  61. $("#data-subscription-type").html(subscriptionType);
  62. $("#subscription-cost").html(totalCost[blockValue].total[subscriptionType]);
  63. // toggle-switch
  64. if (toggleSwitch == true){
  65. $('#order-summary-toggle-switch').prop('checked',true);
  66. }
  67. }