webview.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. const app = getApp();
  4. Page({
  5. data: {
  6. },
  7. onLoad: function (options) {
  8. var that = this;
  9. if (options.url){
  10. that.setData({
  11. Url:options.url,
  12. });
  13. }
  14. else{
  15. that.setData({
  16. PageID:options.PageID,
  17. Url:"https://www.kylx365.com/webpage?PageID="+options.PageID,
  18. });
  19. }
  20. },
  21. onUnload:function(){
  22. },
  23. onShareAppMessage: function () {
  24. var imageUrl = app.globalData.uploadImageUrl +"web/program_screenshot_lesson_c0"+this.data.PageID+".png";
  25. console.log(imageUrl);
  26. var path = "/pages/index/index?type=webview&PageID="+this.data.PageID;
  27. var title ="课外课";
  28. if (this.data.PageID==="0"){
  29. imageUrl = app.globalData.uploadImageUrl +"web/program_screenshot_mustread.png";
  30. title="家长必读";
  31. }
  32. else if (this.data.PageID === "8"){
  33. imageUrl = app.globalData.uploadImageUrl + "web/program_screenshot_grouprule.png";
  34. title = "家长社群小组须知";
  35. }
  36. return {
  37. title: title,
  38. path: path,
  39. imageUrl: imageUrl,
  40. }
  41. },
  42. })