index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. let tips = document.querySelector('.tips');
  2. let lib = {
  3. GetRequest: () => {
  4. let url = location.search; //获取url中"?"符后的字串
  5. let theRequest = new Object();
  6. if (url.indexOf("?") != -1) {
  7. let str = url.substr(1);
  8. strs = str.split("&");
  9. for (let i = 0; i < strs.length; i++) {
  10. theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
  11. }
  12. }
  13. return theRequest;
  14. }
  15. }
  16. let params = lib.GetRequest();
  17. let from_xby = params['fromurl']
  18. if (from_xby === 'xby1' || from_xby === 'xby2' || from_xby === 'xby3') {
  19. document.querySelector('.android-pic').setAttribute('src', 'img/android-xby-200.png')
  20. }
  21. function showDialog() {
  22. tips.style.display = 'block';
  23. setTimeout(hideDialog, 3000)
  24. }
  25. function hideDialog() {
  26. tips.style.display = 'none'
  27. }
  28. let android = document.querySelector('.android-pic')
  29. let ios = document.querySelector('.ios-pic')
  30. function showAndroidDownloadPic() {
  31. android.style.width = '100%'
  32. android.style.transition = 'all .5s ease-out'
  33. }
  34. function hideAndroidDownloadPic() {
  35. android.style.width = '0%'
  36. }
  37. function showiOSDownloadPic() {
  38. ios.style.width = '100%'
  39. ios.style.transition = 'all .5s ease-out'
  40. }
  41. function hideiOSDownloadPic() {
  42. ios.style.width = '0%'
  43. }