import {FunctionTrigger, LocationTrigger} from '$mixins/trigger/class/index';

import popup from "$utils/tool/popup";
import {PopupExportComponent} from "$popup/popup-export/const";

import personalDetail, {OpenType} from '$utils/control/personal-detail';
import user from "$config/user";

export default <LibDataArray>[
    {
        label:'急速点单',
        icon:require('../images/quick.png'),
        trigger: new FunctionTrigger(function (item){
            return personalDetail.openDetail({
                rid: 12,
                room_cover: "http://newqiaoyu.com//uploads/all/20210706/f15b82e2c2d4d0af4b76fa2a14bc9c9d.png",
                room_name: "然心动—你爱我我爱你❤怦",
                room_number: 99999
            },OpenType.room);
        }),
    },
    {
        label:'大神入驻',
        icon:require('../images/great.png'),
        trigger: new FunctionTrigger(function (item){

            if (this.user.is_real == '2') {
                popup.$toast('请先完成实名认证');
                return popup.$popup && popup.$popup.open(PopupExportComponent.realName);
            } else if (this.user.is_real == '3') {
                return  popup.$toast('请耐心等待实名认证审核');
            } else {
                return popup.$popup && popup.$popup.open(PopupExportComponent.choosingSkill);
            }
        }),
        login:true
    },
    {
        label:'在线客服',
        icon:require('../images/service.png'),
        trigger: new FunctionTrigger(function (item){

            if (!user.verificationLogin()) return ;

            return popup.$open(PopupExportComponent.chat);
        }),
    },
    {
        label:'下载客户端',
        icon:require('../images/client.png'),
        trigger: new LocationTrigger('https://www.baidu.com')
    },
    {
        label:'帮助',
        icon:require('../images/help.png'),
        trigger: new FunctionTrigger(function (item){
            return popup.$popup && popup.$popup.open(PopupExportComponent.help);
        }),
    }
]
