webview.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. Url:"https://www.kylx365.com/webpage?PageID="+options.PageID,
  17. });
  18. }
  19. },
  20. onUnload:function(){
  21. },
  22. onShareAppMessage: function () {
  23. var imageUrl = app.globalData.uploadImageUrl +"web/program_screenshot_lesson_c0"+this.data.PageID+".png";
  24. var path = "/pages/index/index?type=webview&PageID="+this.data.PageID;
  25. var title ="课外课";
  26. if (this.data.PageID==="0"){
  27. imageUrl = app.globalData.uploadImageUrl +"web/program_screenshot_mustread.png";
  28. title="家长必读";
  29. }
  30. else if (this.data.PageID === "8"){
  31. imageUrl = app.globalData.uploadImageUrl + "web/program_screenshot_grouprule.png";
  32. title = "家长社群小组须知";
  33. }
  34. return {
  35. title: title,
  36. path: path,
  37. imageUrl: imageUrl,
  38. }
  39. },
  40. })