index.js 1.06 KB
Component({
    properties: {
        isShow: {
            type: Boolean,
            value: false,
            observer: '_show'
        },
        menus: {
            type: Array,
            value: [{
                type: 'share',
                icon: '/static/images/share/wechat@2x.png',
                name: '分享给好友'
            }, {
                type: 'friend',
                icon: '/static/images/share/friend@2x.png',
                name: '分享到朋友圈'
            }]
        }
    },
    data: {
        indicatorAnimation: {},
        isSwitch: false
    },
    methods: {
        tapSheet: function(e) {
            let dataset = e.currentTarget.dataset;

            this.triggerEvent('tapActionSheetMenu', {dataset});
        },
        _show: function() {
            if (this.data.isShow) {
                this.setData({
                    isSwitch: true,

                });
            } else {
                setTimeout(() => {
                    this.setData({isSwitch: false});
                }, 300);
            }
        }
    }
});