import user from '$config/user';
import {FunctionTrigger} from "$mixins/trigger/class";
import popup, {PopupExportComponent} from "$utils/tool/popup";
import personalDetail from '$utils/control/personal-detail';
export default [
    {
        label:'关注',
        activeLabel:'取消关注',
        icon:require('../images/follow.png'),
        activeIcon: require('../images/follow-active.png'),
        useKey:'follow',
        key:'uid',
        where:function (value){
            return value != user.uid();
        },
        trigger: new FunctionTrigger(function (){
            return this.toggleFollow();
        }),
    },
    {
        label: '私聊',
        icon: require('../images/chat.png'),
        trigger: new FunctionTrigger(function (){
            return popup.$open(PopupExportComponent.chat,{
                user: this.vItem
            });
        }),
        key:'uid',
        where:function (value){
            return value != user.uid();
        }
    },
    {
        label: '下单',
        icon: require('../images/game.png'),
        key:'is_player',
        where:function (value,item){
            return value && item.uid != user.uid();
        },
        trigger: new FunctionTrigger(function (){
            console.log(this.vItem);
            return personalDetail.openDetail(this.vItem);
        })
    },
    {
        label: '送礼物',
        icon: require('../images/gift.png'),
        trigger: new FunctionTrigger(function (){
            if (this.$attrs.giveGift) {
                return this.$attrs.giveGift(this.vItem);
            }
        })
    }
]
