common.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. class Common{
  2. constructor() {
  3. }
  4. //跳转
  5. navTo(url){
  6. uni.navigateTo({
  7. url:url
  8. })
  9. }
  10. goback(url){
  11. var page = getCurrentPages();
  12. console.log(page);
  13. console.log(url);
  14. let windpowerstationName = uni.getStorageSync('windpowerstationName');
  15. page[page.length-1].$vm.address = windpowerstationName;
  16. // if(windpowerstationName=="宁夏新能源公司"){
  17. // if(page[page.length-1].route=="components/weatherProphethomepage/WeatherProphethomepage"){
  18. // page[page.length-1].$vm.FDC="MHS_FDC";
  19. // }else{
  20. // page[page.length-1].$vm.FDC="0";
  21. // }
  22. // }
  23. // if(windpowerstationName=="麻黄山风电场"){
  24. // page[page.length-1].$vm.FDC="MHS_FDC";
  25. // }
  26. // if(windpowerstationName=="牛首山风电场"){
  27. // page[page.length-1].$vm.FDC="NSS_FDC";
  28. // }
  29. // if(windpowerstationName=="石板泉风电场"){
  30. // page[page.length-1].$vm.FDC="SBQ_FDC";
  31. // }
  32. // if(windpowerstationName=="青山风电场"){
  33. // page[page.length-1].$vm.FDC="QS_FDC";
  34. // }
  35. // if(windpowerstationName=="香山风电场"){
  36. // page[page.length-1].$vm.FDC="XS_FDC";
  37. // }
  38. //首页
  39. if(page[page.length-1].route=="pages/index/Index"){
  40. page[page.length-1].target_comprehensive_indicators();
  41. page[page.length-1].target_windSpeed_power();
  42. page[page.length-1].index_windturbine_status();
  43. page[page.length-1].index_electricQuantity();
  44. page[page.length-1].index_target_basic_indicators();
  45. }
  46. if(page[page.length-1].route=="components/weatherProphethomepage/WeatherProphethomepage"){
  47. page[page.length-1].getWeatherDataToday();
  48. page[page.length-1].getWeatherData7();
  49. page[page.length-1].getWeatherData();
  50. page[page.length-1].getWeatherData40();
  51. if(windpowerstationName=="宁夏新能源公司"){
  52. page[page.length-1].$vm.windStationName="麻黄山";
  53. }
  54. if(windpowerstationName=="麻黄山风电场"){
  55. page[page.length-1].$vm.windStationName="麻黄山";
  56. }
  57. if(windpowerstationName=="牛首山风电场"){
  58. page[page.length-1].$vm.windStationName="牛首山";
  59. }
  60. if(windpowerstationName=="石板泉风电场"){
  61. page[page.length-1].$vm.windStationName="石板泉";
  62. }
  63. if(windpowerstationName=="青山风电场"){
  64. page[page.length-1].$vm.windStationName="青山";
  65. }
  66. if(windpowerstationName=="香山风电场"){
  67. page[page.length-1].$vm.windStationName="香山";
  68. }
  69. }
  70. // uni.showModal({
  71. // title: '提示',
  72. // content: page,
  73. // success: function (res) {
  74. // if (res.confirm) {
  75. // console.log('用户点击确定');
  76. // } else if (res.cancel) {
  77. // console.log('用户点击取消');
  78. // }
  79. // }
  80. // });
  81. // uni.switchTab({
  82. // url: url,success: function(e) {
  83. // //if (page[0] == undefined || page[0] == null) return;
  84. // page[page.length-1].onLoad();
  85. // }
  86. // })
  87. }
  88. }
  89. let common = new Common();
  90. export default common;