district.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import common from '../../utils/util';
  2. import main from '../../utils/main';
  3. import constant from '../../utils/constant';
  4. const app = getApp();
  5. Page({
  6. data: {
  7. ImagePath: app.globalData.uploadImageUrl,
  8. DistrictID: "01",
  9. SchoolType:constant.arrSchoolType,
  10. Article:[
  11. {ID:1,Title:"市实验性示范性高中、市特色普通高中、\n市级优秀体育学生、艺术骨干学生",Url:"recruitment?PanelType=1&DistrictID="},
  12. {ID:2,Title:"国际课程班和中外合作办学高中",Url:"recruitment?PanelType=2&DistrictID="},
  13. {ID:3,Title:"中本贯通、五年一贯制、中高职费通",Url:"subscribe?"},
  14. ],
  15. },
  16. onLoad: function (options) {
  17. var that = this;
  18. that.setData({
  19. Containnerheight: main.getWindowHeight(),
  20. DistrictID:options.ID,
  21. DistrictName:options.Name,
  22. });
  23. that.init();
  24. },
  25. init:function(){
  26. var that = this;
  27. var id=Number(that.data.DistrictID);
  28. main.getData("GetMPSSchool?SelectType=structure&DistrictID="+id, function (data) {
  29. if (data) {
  30. that.setData({
  31. SchoolAll: data,
  32. SchoolCurrent:data[0].List
  33. });
  34. }
  35. });
  36. },
  37. onSelect:function(event){
  38. var that=this;
  39. main.onSelect(that,event,function(obj,e,result){
  40. if (e.currentTarget.dataset.object=="SchoolType"){
  41. that.setData({
  42. SchoolCurrent:that.data.SchoolAll[e.currentTarget.dataset.index].List
  43. });
  44. }
  45. });
  46. },
  47. goto: function (e) {
  48. main.goto(e);
  49. },
  50. returnTop:function(){
  51. main.returnTop();
  52. },
  53. onShareTimeline: function () {
  54. return this.onShareAppMessage();
  55. },
  56. onShareAppMessage: function () {
  57. var that=this;
  58. var url=that.data.ImagePath+"web/_ScoreLine/fs_b"+that.data.DistrictID+".png";
  59. return {
  60. title: that.data.DistrictName+"中考招生信息",
  61. path: app.globalData.SharePath + '?type=district&ID='+that.data.DistrictID+'&Name='+that.data.DistrictName+'&UserID=' + app.globalData.userInfo.UserID,
  62. imageUrl: url,
  63. }
  64. },
  65. })