webView.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. var app = getApp();
  2. var that;
  3. Page({
  4. data: {
  5. knowFrom:'action',
  6. url:'',
  7. },
  8. onLoad(e) {
  9. that = this;
  10. console.log(e)
  11. if(e.index&&e.page==1){
  12. let index=e.index;
  13. let url='https://www.yuque.com/books/share/9aed09b4-4387-4e5f-ae0e-afc748390a1e?#'
  14. if(index=='1'){
  15. url='https://www.yuque.com/docs/share/d3459ec7-5c62-4ae5-b0dc-a3ff2770d462?#'
  16. }else if(index=='2'){
  17. url='https://www.yuque.com/docs/share/22b4bb49-2151-4b46-8465-89301957102a?#'
  18. }else if(index=='3'){
  19. url='https://www.yuque.com/docs/share/a5d976bb-f1f3-4cb6-b5ef-899fcb5d2932?#'
  20. }else if(index=='4'){
  21. url='https://www.yuque.com/books/share/3febbd74-3455-4cfa-abc0-035931cfcc3b?#'
  22. }else{
  23. url='https://www.yuque.com/docs/share/9c209c54-685e-48a6-a773-a5078e430f35?#'
  24. }
  25. this.setData({
  26. url:url
  27. })
  28. }
  29. if(e.index&&e.page==2){
  30. let index=e.index;
  31. let url='https://www.yuque.com/docs/share/a5803b46-cffd-4ad3-aca8-f9908a743618?#'
  32. if(index=='1'){
  33. url='https://www.yuque.com/docs/share/a5803b46-cffd-4ad3-aca8-f9908a743618?#'
  34. }else if(index=='2'){
  35. url='https://www.yuque.com/docs/share/c64392c1-8c8d-40d4-9481-a5f1ad169c10?#'
  36. }else if(index=='3'){
  37. url='https://www.yuque.com/docs/share/282894d5-9309-432b-ab19-f05c06726c7e?#'
  38. }else if(index=='4'){
  39. url='https://www.yuque.com/docs/share/4ccb2328-08aa-4587-a6f5-5b5335692bd1?#'
  40. }
  41. this.setData({
  42. url:url
  43. })
  44. }
  45. },
  46. test(){
  47. }
  48. });