<template>
    <div class="menu-item">
      <router-link v-if="url" :to="url">
        <dl class="flex flex_sb flex_col flex_ac">
          <dt class="menu-item-icon-box">
            <img :src="source?source:base.config.baseUrl+'/static/icons/m1.png'" :style="'width:'+size" class="menu-item-icon" alt="">
          </dt>
          <dd class="menu-item-text font12">{{label?label:'菜单名称'}}</dd>
        </dl>
      </router-link>
      <dl v-if="!url" @click="jump(vertify)" class="flex flex_sb flex_col flex_ac">
        <dt class="menu-item-icon-box">
          <img :src="source?source:base.config.baseUrl+'/static/icons/m1.png'" :style="'width:'+size" class="menu-item-icon" alt="">
        </dt>
        <dd class="menu-item-text font12">{{label?label:'菜单名称'}}</dd>
      </dl>
    </div>
</template>
<script>
    import base from '../../lib/base'
    export default {
        name: "menu-item",
        props:['source','label','position','url','size','vertify'],
        data(){
            return{

            }
        },
      methods:{
        //余额查询，转账汇款，无卡取款，积分查询，理财撤单 功能界面
        jump(path){
          console.log(path)
          base.$.http({
            app:'WxIndexService',
            func:'MyDebitCard'
          },data=>{
            data = JSON.parse(data);
            if(data.error) {
              base.msg.alert(data.error);
              return;
            }else if(data.empty){
              base.msg.alert('请绑定银行卡');
              return;
            }else{
              this.$router.push({
                path:'/'+path,
                query:{}
              })
            }
          })
        }
      }
    }
</script>

<style scoped>
  @import "../../css/style.css";
  .menu-item-icon{
    width: .58rem;
  }
  .menu-item{
    margin-bottom: .4rem;
    height: 1.08rem;
    margin-right: .7rem;
  }
  .menu-item:nth-child(4n+4){
    margin-right: 0;
  }
  .menu-item-text{
    color: #555;
  }
</style>
