district.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. wx.setNavigationBarTitle({
  24. title: "招生计划·"+that.data.DistrictName,
  25. });
  26. that.init();
  27. },
  28. init:function(){
  29. var that = this;
  30. var id=Number(that.data.DistrictID);
  31. main.getData("GetMPSDistrictPersonNum?DistrictID="+id, function (data) {
  32. if (data) {
  33. that.setData({
  34. DistrictPersonNum: data,
  35. });
  36. main.getData("GetMPSSchool?SelectType=structure&DistrictID="+id, function (data) {
  37. if (data) {
  38. that.setData({
  39. SchoolAll: data,
  40. SchoolCurrent:data[0].List
  41. });
  42. }
  43. });
  44. }
  45. });
  46. },
  47. onSelect:function(event){
  48. var that=this;
  49. main.onSelect(that,event,function(obj,e,result){
  50. if (e.currentTarget.dataset.object=="SchoolType"){
  51. that.setData({
  52. SchoolCurrent:that.data.SchoolAll[e.currentTarget.dataset.index].List
  53. });
  54. }
  55. });
  56. },
  57. goto: function (e) {
  58. main.goto(e);
  59. },
  60. returnTop:function(){
  61. main.returnTop();
  62. },
  63. onShareTimeline: function () {
  64. return this.onShareAppMessage();
  65. },
  66. onShareAppMessage: function () {
  67. var that=this;
  68. var url=that.data.ImagePath+"web/_ScoreLine/fs_b"+that.data.DistrictID+".png";
  69. return {
  70. title: that.data.DistrictName+"中考招生信息",
  71. path: app.globalData.SharePath + '?type=district&ID='+that.data.DistrictID+'&Name='+that.data.DistrictName+'&UserID=' + app.globalData.userInfo.UserID,
  72. imageUrl: url,
  73. }
  74. },
  75. })