123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- var businessT = require('../../../tool/business-tool.js')
- var key = require('../../../constant/key.js')
- Component({
- /**
- * 组件的属性列表
- */
- properties: {
- show: {
- type: Boolean,
- observer: 'show'
- },
- showHeight: {
- type: Number,
- value: -68
- }
- },
- /**
- * 组件的初始数据
- */
- data: {
- hidden: true,
- animation: {}
- },
-
- /**
- * 组件的方法列表
- */
- methods: {
- call: businessT.action(function (sender) {
- this.hidden()
- var tel = businessT.getPhone()
- wx.makePhoneCall({
- phoneNumber: tel,
- })
- }),
- add: businessT.action(function (sender) {
- this.hidden()
- var tel = businessT.getPhone()
- wx.addPhoneContact({
- firstName: '我的社保客服',
- mobilePhoneNumber: tel
- })
- }),
- cancel: businessT.action(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
- }
- businessT.debugLog(this.data.showHeight)
- 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)
-
- },
- }
- })
|