| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import common from '../../utils/util';
- import main from '../../utils/main';
- import constant from '../../utils/constant';
- const app = getApp();
- Page({
- data: {
- SchoolType1:constant.arrSchoolType1,
- ImagePath: app.globalData.uploadImageUrl,
- },
- onLoad: function (options) {
- var that = this;
- that.setData({
- Containnerheight: main.getWindowHeight(),
- SchoolType1Index:0,
- });
- },
- onShow:function(res){
- this.init();
- },
- init:function(){
- var that = this;
- main.getCollect(function(data){
- if (data){
- var arr=[data["收藏的高中"],data["收藏的初中"]];
- that.setData({
- SchoolCollect:arr,
- SchoolCurrent: arr[that.data.SchoolType1Index],
- });
- }
- });
- },
- onSelect:function(event){
- var that=this;
- main.onSelect(that,event,function(obj,e,result){
- if (e.currentTarget.dataset.object=="SchoolType1"){
- that.setData({
- SchoolType1Index:e.currentTarget.dataset.index,
- SchoolCurrent:that.data.SchoolCollect[e.currentTarget.dataset.index],
- });
- }
- });
- },
- goto: function (e) {
- main.goto(e);
- },
- gotoMap:function(e){
- if (this.data.SchoolCurrent.length>0){
- main.goto({currentTarget:{dataset:{url:"map?PageType=3"}}});
- }
- else
- main.goto(e);
- },
- onShareTimeline: function () {
- return this.onShareAppMessage();
- },
- onShareAppMessage: function () {
- return {
- title: app.globalData.ShareTitle,
- path: app.globalData.SharePath + '?UserID=' + app.globalData.userInfo.UserID,
- }
- },
- })
|