小程序头部导航封装

2019-01-10  本文已影响0人  梦里梦不到的梦_b5c8

var app = getApp()

Component({

  /**

  * 组件的属性列表

  */

  properties: {

    title: {

      type: "String",

      value: "美容整形医院"

    },

    background: {

      type: "String",

      value: "#fff"

    },

    color: {

      type: "String",

      value: "#333"

    },

    back: {

      type: "String",

      value: "../../images/back.png",

      observer: function observer(newval, oldval) {

        if (newval == "") {

          this.setData({

            back: "",

          })

        } else {

          console.log(newval)

          console.log("newval")

          this.setData({

            back: newval,

          })

        }

      }

    },

    boxsh: {

      type: "Boolean",

      value: false

    }

  },

  ready() {

    let navgationHeight = 44

    const res = wx.getSystemInfoSync()

    let startBarHeight = res.statusBarHeight

    this.setData({

      statusHeight: navgationHeight + startBarHeight

    })

  },

  methods: {

    backHandle: function () {

      wx.navigateBack()

    },

  }

})

上一篇 下一篇

猜你喜欢

热点阅读