district.js 2.8 KB

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