123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- show: {
- type: Boolean,
- observer: 'show'
- },
- showHeight: {
- type: Number,
- value: -68
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- hidden: true,
- animation: {}
- },
- /**
- * 组件的方法列表
- */
- methods: {
- call: function (sender) {
- this.hidden()
- wx.makePhoneCall({
- phoneNumber: '02028834746',
- })
- },
- cancel: function (sender) {
- this.hidden()
- },
- hidden: function () {
- var animation = wx.createAnimation({
- duration: 300,
- timingFunction: 'ease',
- })
- animation.bottom('-532rpx').step()
- this.setData({
- animation: animation.export()
- })
- setTimeout(function () {
- this.data.show = false
- this.data.hidden = true
- this.setData({
- hidden: this.data.hidden
- })
- this.triggerEvent('hiddenContact', {}, {})
- }.bind(this), 300)
- },
- show: function () {
- if (!this.data.hidden) {
- return
- }
- this.data.hidden = false
- this.setData({
- hidden: this.data.hidden
- })
- setTimeout(function () {
- var animation = wx.createAnimation({
- duration: 300,
- timingFunction: 'ease',
- })
- var bottom = this.data.showHeight + 'rpx'
- animation.bottom(bottom).step()
- this.setData({
- animation: animation.export(),
- })
- }.bind(this), 100)
- },
- }
- })
|