import {bindEvent} from "../shares/utils.js";
import {$el, $elByClass} from "../plugin/getElPlugin.js";
export const oHomeEvent = [
    {
        node: 'newRightContent',
        fnName: 'newRightContentMousedown',
        args: [],
        type: 'mousedown'
    },
    {
        node: 'newRightContentBox',
        fnName: 'stopNewRightContentMousemove',
        args: [],
        type: 'mouseup'
    },
    {
        node: 'newRightContentBox',
        fnName: 'stopNewRightContentMousemove',
        args: [],
        type: 'mouseleave'
    },
    {
        node: 'newRightContent',
        fnName: 'newRightContentMousedown',
        args: [],
        type: 'touchstart'
    },
    {
        node: 'newRightContentBox',
        fnName: 'stopNewRightContentMousemove',
        args: [],
        type: 'touchend'
    },
    {
        node: 'newButton',
        fnName: 'newButtonEvent',
        args: [],
        type: 'click'
    }

]
export const oHeadEvent = [
    {
        node:$el('.moreButton'),
        fnName:'phoneSwitch',
        args:[],
        type:'click'
    },
    {
        node:'navSmallImg',
        fnName:'navSmallImgEvent',
        args:[],
        type:'click',
    },
    {
        node: $el('.navIconRight'),
        fnName: 'navRunRight',
        args: [],
        type: 'click'
    },
    {
        node: $el('.navIconLeft'),
        fnName: 'navRunLeft',
        args: [],
        type: 'click'
    },
    {
        node:window,
        fnName: 'headScroll',
        args: [],
        type: 'scroll'
    },
    {
        node: $el('.search '),
        fnName: 'searchBoxClick',
        args: [],
        type: 'click'
    },
    {
        node: $el('.searchBox'),
        fnName: 'searchBoxInput',
        args: [window.option.headerOption],
        type: 'input'
    },
    {
        node:window,
        fnName: 'windowResize',
        args: [],
        type: 'resize'
    },
    {
        node: 'showButton',
        fnName: 'showButtonEvent',
        args: [],
        type: 'click'
    },
    {
        node: 'showRightButton',
        fnName: 'showRightButtonEvent',
        args: [],
        type: 'click'
    },
    {
        node: 'showLeftButton',
        fnName: 'showLeftButtonEvent',
        args: [],
        type: 'click'
    },
]
export const oProEvent = [
    {
        node:'productInfoPageItem',
        fnName:'productInfoPageEvent',
        type:'click',
        args:[]
    },
    {
        node: $el('.productJump'),
        fnName: 'jumpEvent',
        type: 'click',
        args: []
    }
]

export const oProInfoEvent = [
    {
        node:$el('.productInfosHeader'),
        fnName:'startProductCheck',
        type: 'mouseenter',
        args: []
    },
    {
        node:$el('.productInfosHeader'),
        fnName:'stopProductCheck',
        type: 'mouseleave',
        args: []
    }
]
export default ()=>{
    const init = (()=>{
        bindEvent({oHeadEvent,oHomeEvent,oProEvent,oProInfoEvent})
    })
    init()
}