import common from '../../utils/util'; import main from '../../utils/main'; import constant from '../../utils/constant'; const app = getApp(); Page({ data: { PageType:"school", ScoreTypeID:1,//四种得分类型 IsFold:false, Years:constant.arrYear, YearIndex:0, ImagePath: app.globalData.uploadImageUrl, ScoreType:constant.arrScoreType, TailScore:constant.arrTailScore, IsShowClickLike:false, }, onLoad: function (options) { var that = this; that.setData({ Containnerheight: main.getWindowHeight(), IsShow:app.globalData.userInfo.IsShow, SchoolID:options.ID, IsCollect:false, HasWish:false, }); if (!options.ID){ wx.navigateBack({ delta: 1, }); } else that.init(); }, onShow:function(){ this.getWish(); }, init:function(){ var that = this; wx.showLoading({title:"加载中"}); main.getData("GetMPSSchoolInfo?SchoolID="+that.data.SchoolID, function (data) { if (data) { var list=[]; that.data.ScoreTypeID=1; if (data['1-15志愿'] && !(data['自主招生'])){ that.data.ScoreTypeID=4; var name=that.data.ScoreType[that.data.ScoreTypeID-1].Name; list=data[name][that.data.YearIndex].List; } else if (data['名额到校'] && data.SchoolType1=='初中'){ that.data.ScoreTypeID=3; var name=that.data.ScoreType[that.data.ScoreTypeID-1].Name; list=data[name][that.data.YearIndex].List; } wx.setNavigationBarTitle({ title: data.SchoolType1, }); var schoolList=wx.getStorageSync('CollectList'); if (schoolList && schoolList["收藏的"+data.SchoolType1]){ schoolList=schoolList["收藏的"+data.SchoolType1]; for(var i=0;i26){ var str1=data.Website.substr(0,26); var str2=data.Website.substr(26); data.WebsiteStr=str1+"\n"+str2; } else data.WebsiteStr=data.Website; if (data.ImageOther) data.ImageOtherStr=data.ImageOther.join(","); //将保存的用户习惯(显示列表样式)提取出来 var isListAll=wx.getStorageSync('TailScore'); if (isListAll){ that.data.TailScore[0].CSS="Selected"; } data.PersonCount1=0; data.PersonCount2=0; for(var i=0;i0 && that.data.Info[name].length>e.currentTarget.dataset.index) list = that.data.Info[name][e.currentTarget.dataset.index].List; else if (e.currentTarget.dataset.index==0) list = that.data.Info[name][e.currentTarget.dataset.index].List; that.setData({ List:list, YearIndex:e.currentTarget.dataset.index }); that.checkListNull(that,list); } }); }, checkListNull:function(obj,list){ var that=obj; if (list.length==0 && that.data.YearIndex==0 && that.data.ScoreTypeID==4){ // wx.showModal({ // title: '暂无公布', // showCancel:false, // content: '教育局暂未公布2024年1-15志愿信息,正式数据一般在7月公布,敬请期待。', // confirmText: '知道了', // complete: (res) => { // if (res.confirm) { // list=that.data.Info["1-15志愿"][1].List; // that.setData({ // ScoreTypeID: 4, // YearIndex:1, // List:list, // }); // var eventTemp={ // currentTarget:{ // dataset:{ // object:"Years", // clicktype:"radio", // index:1, // } // } // } // main.onSelect(that,eventTemp,function(){}); // } // } // }); } }, onFold:function(e){ var that=this; that.setData({ IsFold: !that.data.IsFold, }); }, copyUrl:function(e){ var url=e.currentTarget.dataset.url; wx.setClipboardData({ data: url, success (res) { wx.showToast({ title: '已复制', }); } }); }, gotoMiniprogram:function(){ main.gotoMiniprogram(185); }, returnTop:function(){ main.returnTop(); }, onShareTimeline: function () { return this.onShareAppMessage(); }, onUpdateTitle:function(){ if (app.globalData.userInfo.UserID<6){ wx.setNavigationBarTitle({ title: "秒过分数线·小程序", }); } }, getWish:function(){ var that = this; main.getData("GetMPSWish?WishType=school&SchoolID="+that.data.SchoolID, function (data) { if (data) { that.setData({ WishList: data, }); main.getData("GetMPSWish?WishType=person&UserID="+app.globalData.userInfo.UserID+"&SchoolID="+that.data.SchoolID, function (data2) { //debugger; if (data2 && data2.length>0) { app.globalData.MyWish=data2[0]; that.setData({ HasWish: true, }); } else{ that.setData({ HasWish: false, }); } that.getSchoolClickLike(); }); } }); }, getSchoolClickLike:function(){ var that = this; var arr2=[]; var arr=constant.arrUserSchoolClickLike; for(var j=0;j