promise对微信小程序封装

import initCalendar, { getSelectedDay, jumpToToday } from '../../../template/calendar/index'

import api from '../../../api/sdk.js'

const conf = {

  data: {

    hiddenmodal: true, 

    hasEmptyGrid: false,

    showPicker: false,

    selectedDay:{},

    courseList:[

      {

        city:'襄阳市',

        courseName:'策略课',

        teacher:'襄阳事业部(陈雪琴)'

      },{

        city: '襄阳市',

        courseName: '策略课',

        teacher: '襄阳事业部(陈雪琴)'

      }

    ]

  },

  onShow: function() {

    api.admin_course_list_by_page()

    initCalendar({

      // multi: true, // 是否开启多选,

      // disablePastDay: true, // 是否禁选过去日期

      /**

      * 选择日期后执行的事件

      * @param { object } currentSelect 当前点击的日期

      * @param { array } allSelectedDays 选择的所有日期(当mulit为true时,才有allSelectedDays参数)

      */

      afterTapDay: (currentSelect, allSelectedDays) => {

        console.log('当前点击的日期', currentSelect);

        allSelectedDays && console.log('选择的所有日期', allSelectedDays);

        console.log('getSelectedDay方法', getSelectedDay());

      },

      /**

      * 日期点击事件(此事件会完全接管点击事件)

      * @param { object } currentSelect 当前点击的日期

      * @param { object } event 日期点击事件对象

      */

      // onTapDay(currentSelect, event) {

      //  console.log(currentSelect);

      //  console.log(event);

      // },

    });

  },

  openDetail:function(){

        wx.navigateTo({

            url: '../../weiketang/detail/detail',

        })

  },

  search:function(){

      this.setData({

          hiddenmodal: !this.data.hiddenmodal

      }) 

  },

  cancel: function () {

      this.setData({

          hiddenmodal: true

      });

  },

  //确认 

  confirm: function () {

      this.setData({

          hiddenmodal: true

      })

  }, 

  openCitys:function(e){

      if (e.target.id == 'close') {

          return;

      } else {

          wx.navigateTo({

              url: '../city/city',

          })

      }

  },

  openDepart: function (e) {

      if (e.target.id == 'close') {

          return;

      } else {

          wx.navigateTo({

              url: '../department/department',

          })

      }

  },

  openTeacher: function (e) {

      if (e.target.id == 'close') {

          return;

      } else {

          wx.navigateTo({

              url: '../teacher/teacher',

          })

      }

  },

  openCourse: function (e) {

      if (e.target.id == 'close') {

          return;

      } else {

          wx.navigateTo({

              url: '../course/course',

          })

      }

  },

  /**

  * 跳转至今天

  */

  jump() {

    jumpToToday();

  }

};

Page(conf);

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • "use strict";function _classCallCheck(e,t){if(!(e instanc...
    久些阅读 2,068评论 0 2
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,269评论 19 139
  • 微信小程序在无论在功能、文档及相关支持方面,都是优于前面几种微信账号类型,它提供了很多原生程序才有的接口,使得我们...
    未央大佬阅读 2,355评论 0 12
  • 北京2018年4月1日上午,NBA常规赛勇士客战国王的比赛中,发生了令人痛心不已的一幕。比赛进行到第三节还有41...
    Curry_宇阅读 1,281评论 1 1
  • 配置文件 app.json的配置(全局) {// 用来配置页面的路径"pages":["pages/index/i...
    Q轩哥阅读 27,247评论 2 31