Appment_main.js 1.38 KB
var e = getApp(),
  a = e.globalData.setting,
  os = a,
  t = e.request;
Page({

  /**
   * 页面的初始数据
   */
  data: {
    iurl: a.imghost, //服务器网址
    store: 0, //是否显示服务门店列表
    beautician: 0, //是否显示美容师列表
    beautician_name: "", //选中的美容师名称
    placeholder: "填写备注",//备注为空的placeholder
  },
  onclickstore: function() {
    var th = this;
    var store = th.data.store;
    if (store) {
      th.setData({
        store: 0
      })
    } else {
      th.setData({
        store: 1,
        placeholder:""
      })
    }
  },
  onclickbea: function(e) {
    var th = this;
    var beautician = th.data.beautician;
    var beaname = e.currentTarget.dataset.beaname;
    if (beautician) {
      // 判断是否选择美容师没有的话就把美容师列表收起来
      if (beaname != undefined) {
        th.setData({
          beautician: 0,
          beautician_name: beaname,
          placeholder: "填写备注"
        })
      } else {
        th.setData({
          beautician: 0,
          placeholder: "填写备注"
        })
      }
    } else {
      th.setData({
        beautician: 1,
        placeholder: ""
      })
    }
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  }
})