index.js 928 B

123456789101112131415161718192021222324252627282930313233343536
  1. // index.js
  2. Page({
  3. data:{
  4. src:"https://wy.dazhengyun.com/public/wap/ph?orgId="
  5. },
  6. onLoad:function(options){
  7. this.getScene(options);
  8. var orgId = wx.getStorageSync("orgId");
  9. var orgId = orgId?orgId:3;
  10. console.log(this.data.src+orgId);
  11. this.setData({
  12. 'src':this.data.src+orgId
  13. })
  14. },
  15. getScene(options){
  16. if(options.hasOwnProperty('scene')){
  17. const scene = decodeURIComponent(options.scene);
  18. let ss = scene.split('_');
  19. if(ss.length == 2){
  20. wx.setStorageSync("orgId", ss[1]);
  21. }else {
  22. wx.showToast({
  23. title: '项目id不存在',
  24. icon: 'none',
  25. duration: 2000
  26. });
  27. return false;
  28. }
  29. }else {
  30. wx.setStorageSync("orgId", 3);
  31. }
  32. },
  33. })