web汲取

作者: 然亦伞 | 来源:发表于2017-06-13 14:32 被阅读15次

    基础:

    1、href 属性值是 URL,或者 JavaScript 表达式、方法和函数的列表。
    <a href="javascript:deleteProduct('shoppingProduct_06')">
    2、onblur Form事件属性 元素失去焦点时触发,用于表单验证。与 onfocus 属性相反。
    事件属性有window、form、mouse、keyboard、media 。
    <input id="pwd" type="password" class="login_content_input" onFocus="pwdFocus()" onBlur="pwdBlur()">
    3、
    

    <a> 标签创建判断按钮

    <a style="color: #fff" 
                                                            onclick="if (confirm('确定要退出吗?')) return true; else return false;" 
                                                            href="{$smarty.const.__MODULE__}/Manager/logout" target=_top>退出系统</a>
    

    二级联动菜单:

    //二级联动初始化
    function init()
    {
        //获取name=province和name=city的元素对象
        var province = document.form1.province;
        var city = document.form1.city;
        //指定province中<option>标记的个数,添加多少个空的<option>标记
        var len = arr_province.length;
        province.length = len;
        //循环写入省份数据
        for(var i=0;i<len;i++)
        {
            province.options[i].text = arr_province[i];
            province.options[i].value = arr_province[i];
        }
        //更改省份的默认选择项
        var index = 3;
        province.selectedIndex = index;
        //********************************************************************
        //指定city中<option>标记的个数,添加多少个空的<option>标记
        var len = arr_city[index].length;
        city.length = len;
        //循环写入对应城市数据
        for(var i=0;i<len;i++)
        {
            city.options[i].text = arr_city[index][i];
            city.options[i].value = arr_city[index][i];
        }
    }
    
    //当省份下拉列表被修改,相应城市列表中的数据也要相应变化
    function change_select(index)
    {
        //获取name=city的元素对象
        var city = document.form1.city;
        //指定city中<option>标记的个数,添加多少个空的<option>标记
        var len = arr_city[index].length;
        city.length = len;
        //循环写入对应城市数据
        for(var i=0;i<len;i++)
        {
            city.options[i].text = arr_city[index][i];
            city.options[i].value = arr_city[index][i];
        }
    }
    

    $("input[name='company_name']").val("");
    $("input[type=radio][name=subject_type][value='2']").attr("checked",'checked');

    //html与php交互。html里的if语句

     <foreach name="list" item="vo">
                    <tr>
                        <td align="center">{$vo.create_time}</td>
                        <td>{$vo.cnname}</td><!--国际化用的各种语言均查出了-->
                        <td>{$vo.shop_name}</td>
                        <td>{$vo.user_id}</td>
    
                        <td>{$vo.phone}</td>
                        <!--<td>{$vo.merchant_level}</td>-->
                        <!--<td>{$vo.merchant_level}-->
                        </td>
                        <!--<td>{$vo['is_recommend']}-->
                        </td>
                        <!--<td>{$vo.follower_count}</td>-->
                        <td <?php if($vo['review_status']==L('REVIEWING')) echo 'style="color:red;"';?>>
                            {$vo['review_status']}
                        </td>
                        <td align="center">
                            <button type="button" class="btn-link detail" >{:L('MERCHANT_DETAIL')}</button>
                            <?php if($vo['review_status']==L('VERIFY_PASS')):?>
                            <button type="button" class="btn-link edit">{:L('EDIT')}<tton>
                            <?php endif;?>
                            <!--<button type="button" class="btn-link point_detail" >{:L('PIONT_DETAIL')}</button>-->
                        </td>
                        <td>{$vo['creator']}</td>
                    </tr>
                </foreach>
    
    <?php if($info['subject_type']==1):?>
                    <tr>
                        <th width="30%">{:L('OBJ_TYPE')}</th>
                        <td width="70%">{:L('COMPANY')}</td>
                    </tr>
                    <tr>
                        <th width="30%">{:L('COMPANY_NAME')}</th>
                        <td width="70%"><?php echo $info['company_name']?></td>
                    </tr>
                    <tr>
                        <th width="30%">{:L('BUSINESS_LICENSE_NO')}</th>
                        <td width="70%"><?php echo $info['business_id']?></td>
                    </tr>
                    <?php else:?>
                    <tr>
                        <th width="30%">{:L('OBJ_TYPE')}</th>
                        <td width="70%">{:L('PERSONAL')}</td>
                    </tr>
                    <tr>
                        <th width="30%">{:L('NAME')}</th>
                        <td width="70%"><?php echo $info['company_name']?></td>
                    </tr>
                    <tr>
                        <th width="30%">{:L('ID_CARD')}</th>
                        <td width="70%"><?php echo $info['id_number']?></td>
                    </tr>
                    <?php endif;?>
    

    及时监测input输入

     //监测兑换积分数量输入框
      $("input[name='point_number']").on("input",function () {});
    

    //获取当前日期

     var d = new Date();
     var day = d.getDate();
    

    多层div叠加显示并居中(div做假弹出框)

    #alertDiv{
                position:absolute;
                top:0;
                left:0;
                right:0;
                bottom:0;
                display:none;
            }
    
            #bankInfoDiv{
                border:1px solid #999;
                background-color:#FFF;
                border-radius:5px;
                position:absolute;
                top:50%;
                left:50%;
                margin-left:-230px;
                margin-top:-135px;
                width:460px;
                height:270px;
                padding:10px 10px;
    
            }
    //半透明背景
    .bgDiv{
                position:absolute;
                top:0;
                left:0;
                right:0;
                bottom:0;
                background-color:#666;
                opacity:0.5;
            }
    

    table分隔线设置

    <table border="0" cellspacing="0" cellpadding="0"></table>
     table{
                width:100%;
                border-right:1px solid #999;
                border-bottom:1px solid #999;
            }
            table td{
                text-align:center;
                padding-left:5px;
                padding-right:5px;
                font-size:14px;
                border-left:1px solid #999;
                border-top:1px solid #999;
                height: 30px;
            }
    

    <a>标签调用php方法

    <a class="btn btn-danger" href="{:U('Eunion/merchantReview')}">{:L('CLEAR')}</a>
    

    form表单请求调用php方法

        <form  class="request" method="post" action="{:U('Eunion/exportMerchantReviewList')}" onsubmit="return check()">
            <input type="hidden" name="request"  value="{:I('request.begin_time')},{:I('request.end_time')},{:I('request.create_time')},{:I('request.status')},{:I('request.region')},{:I('request.key_type')},{:I('request.key_word')}">
        </form>
    

    表单内详情按钮的点击处理

    //详情页面
            $(".detail").on('click',function () {
                var id = $(this.parentNode.parentNode).find("td").eq(3).text();
                var region = $(this.parentNode.parentNode).find("td").eq(1).text();
                var reviewIndex = layer.open({
                    title:"{:L('DETAIL')}",
    //                    skin: 'layui-layer-demo', //样式类名
                    shift: 2,
                    type:2,
                    area: ['860px', '650px'],
                    shadeClose: false,
                    content: "{:U(reviewDetail)}&id="+id+"&region="+region
                });
    
    //                layer.open({
    //                    skin: 'layui-layer-demo', //样式类名
    //                    shift: 2,
    //                    shadeClose: true, //开启遮罩关闭
    //                    content: html
    //                });
            })
    

    相关文章

      网友评论

          本文标题:web汲取

          本文链接:https://www.haomeiwen.com/subject/nzmdqxtx.html