enter_view.html 6.6 KB
<!DOCTYPE html>
<html lang="en">

{include file="public/head"/}
<link rel="stylesheet" href="__CDN__/assets/advertising/css/entry.css">
<style>
    body,
    html {
        background-color: #f9f9f9;
    }
    .images{
        width: 1.6rem;
        height: 1.6rem;
        float: left;
        padding-left: 0.1rem;
    }
</style>

<body>
    <div class="submit_entry">
        <div class="submit_table">
            <div class="submit_single align_center layout flex_row">
                <div class="submit_title">商家名称<i>*</i></div>
                <input type="text" id="merchant_title" value="{$data.merchant_title}" placeholder="请填写商家名称">
            </div>
            <div class="submit_single align_center layout flex_row">
                <div class="submit_title">联系人<i>*</i></div>
                <input type="text" id="merchant_name" value="{$data.merchant_name}" placeholder="请填写联系人姓名">
            </div>
            <div class="submit_single align_center layout flex_row">
                <div class="submit_title">联系电话<i>*</i></div>
                <input type="text" id="merchant_mobile" value="{$data.merchant_mobile}" placeholder="请填写联系人电话">
            </div>
            <div class="submit_single align_center layout flex_row">
                <div class="submit_title">地址</div>
                <input type="text" id="area" value="{$data.area}" placeholder="请填写所在地址">
            </div>
            <div class="submit_single  layout flex_row">
                <div class="submit_title">简介</div>
                <textarea name="" id="brief" cols="30" rows="5" placeholder="请填写商家简介">{$data.brief}</textarea>
            </div>
            <div class="submit_single clearfix">
                <div class="submit_title">
                    营业执照<i>*</i>
                </div>
                <div class="submit_img ">
                    <div class="clearfix">
                        {foreach name="$data.business_images" item="b_i"}
                        <div class="images">
                            <img src="{$b_i}"/>
                        </div>
                        <div class="images">
                            <img src="{$b_i}"/>
                        </div>
                        {/foreach}
                        <div class="submit_img_add upload_one">
                            <img src="__CDN__/assets/advertising/img/add.png" alt="">
                        </div>
                    </div>
                    <!-- <div class="submited_img">
                        <img src="" alt="" id="img1">
                    </div>
                    <input type="file" id="imgFile" class="submit_img_input" onchange="fileImg(this)"> -->
                </div>
            </div>
            <div class="submit_single  layout flex_row">
                <div class="submit_title">
                    其他证件
                </div>
                <div class="submit_img">
                    {foreach name="$data.other_images" item="o_i"}
                    <div class="images">
                        <img src="{$o_i}"/>
                    </div>
                    {/foreach}
                    <div class="submit_img_add upload_two">
                        <img src="__CDN__/assets/advertising/img/add.png" alt="">
                    </div>
                    <!-- <input type="file" class="submit_img_input" onchange="fileImgOther"> -->
                </div>
            </div>
        </div>
        <div class="btn_box">
            <div class="btn">
                申请入驻
            </div>
        </div>

    </div>
    {include file="public/js" /}
    <script>
        $(function(){
            wx.config(
                {$jssdk}
            );
            wx.ready(function () {
                $('.upload_one').click(function () {
                    wx.chooseImage({
                        count: 1, // 默认9
                        sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
                        sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
                        success: function (res) {
                            $(res.localIds).each(function (key, localId) {
                                uploadImages(localId,1);
                            });
                        }
                    });
                });
                $('.upload_two').click(function () {
                    wx.chooseImage({
                        count: 1, // 默认9
                        sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
                        sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
                        success: function (res) {
                            $(res.localIds).each(function (key, localId) {
                                uploadImages(localId,2);
                            });
                        }
                    });
                });
                function uploadImages(localId,type) {
                    wx.uploadImage({
                        localId: localId,
                        isShowProgressTips: 1,
                        success: function (res) {
                            var serverId = res.serverId; // 返回图片的服务器端ID
                            $.ajax({
                                url:"{:url('home/upload/fetImage')}",
                                type:"GET",
                                data:{'media':serverId},
                                success:function(res){
                                    console.log(res);
                                    if(res.code == 1){
                                        if(type == 1){

                                        }else if(type == 2){

                                        }
                                        $('.upload').find('img').attr('src',res.data);
                                        $('#avatar').val(res.data);
                                    }
                                },
                                error:function(res){
                                    toast('与服务器断开连接');
                                }
                            })
                        },
                        fail: function (res) {
                            toast(JSON.stringify(res));
                        }
                    });
                }
            });
        })
    </script>
</body>

</html>