123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- Component({
- data: {
-
- showModalStatus: false,
- animationData: {},
- height: 0
- },
- lifetimes: {
- attached() {
- wx.getSystemInfo({
- success: (res) => {
- this.setData({
- height: res.windowHeight * 0.7
- })
- }
- })
- }
- },
- methods: {
-
- showModal() {
- console.log(111);
-
- var animation = wx.createAnimation({
- duration: 200,
- timingFunction: "linear",
- delay: 0
- })
- animation.translateY(this.data.height).step()
- this.setData({
- animationData: animation.export(),
- showModalStatus: true
- })
- setTimeout(function () {
- animation.translateY(0).step()
- this.setData({
- animationData: animation.export()
- })
- }.bind(this), 200)
- },
-
- hideModal: function () {
-
- var animation = wx.createAnimation({
- duration: 200,
- timingFunction: "linear",
- delay: 0
- })
- animation.translateY(this.data.height).step()
- this.setData({
- animationData: animation.export(),
- })
- setTimeout(function () {
- animation.translateY(0).step()
- this.setData({
- animationData: animation.export(),
- showModalStatus: false
- })
- }.bind(this), 200)
- },
- }
- })
|