@{
    string RightInfo = ViewBag.RightInfo as string;
    string SysRealRole = ViewBag.SysRealRole as string;
    string SysId = ViewBag.SysId as string;
    string right = ViewBag.right as string;
    string SysUserName = ViewBag.SysUserName as string;
}
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>商品信息(增加)</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <script src="/admin/js/jquery-1.10.1.min.js"></script>
    <script src="/admin/js/LAreaData2.js"></script>
    <script src="/admin/js/vue.min.js"></script>
</head>

<body>

    <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
        <div class="layui-card">
            <div class="layui-card-body">
                <div class="layui-tab" lay-filter="mytabbar">
                    <ul class="layui-tab-title">
                        <li class="layui-this" lay-id="1">基本信息</li>
                        <li lay-id="2">商品图集</li>
                        <li lay-id="3">价格设置</li>
                        <li lay-id="5">运费设置</li>
                        @* <li lay-id="6">限时抢购</li> *@
                        <li lay-id="7">数据</li>
                        @* <li lay-id="8">宣传标语</li> *@
                        @* <li lay-id="9">SEO设置</li> *@
                    </ul>
                    <div class="layui-tab-content mt20" id="app">
                        <div class="layui-tab-item layui-show">
                            @* @{
                                Dictionary<string, string> KqProductsDic = new MySystem.DictionaryClass().getKqProductBrandDic();
                            }
                            <div class="layui-form-item">
                                <label class="layui-form-label">产品类型</label>
                                <div class="layui-input-inline">
                                    <select id="MerchantClassId" name="MerchantClassId" lay-search="">
                                        <option value="">全部...</option>
                                        @foreach (string key in KqProductsDic.Keys)
                                        {
                                            <option value="@key">@KqProductsDic[key]</option>
                                        }
                                    </select>
                                </div>
                            </div> *@
                            <div class="layui-form-item">
                                <label class="layui-form-label">商品类型</label>
                                <div class="layui-input-inline">
                                    <select id="ProductKind" name="ProductKind" lay-verify="required|">
                                        <option value="">请选择</option>
                                        <option value="1">实物商品</option>
                                        <option value="2">虚拟商品</option>
                                    </select>
                                </div>
                            </div>
                            @{
                                Dictionary<string, string> ColDic = new MySystem.DictionaryClass().getColDic("006");
                            }
                            <div class="layui-form-item">
                                <label class="layui-form-label">分类</label>
                                <div class="layui-input-block">
                                    <input type="hidden" id="ColId" name="ColId" value="" lay-verify="required|"/>
                                    <div id="ColIdTransfer" class="demo-transfer"></div>
                                    @{
                                        string ColJson = "[";
                                    }
                                    @foreach (string key in ColDic.Keys)
                                    {
                                        ColJson += "{\"value\": \"" + key + "\", \"title\": \"" + ColDic[key] + "\" },";
                                    }
                                    @{
                                        ColJson = ColJson.TrimEnd(','); ColJson += "]";
                                    }
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">商品名称</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" type="text" id="ProductName" name="ProductName"
                                        maxlength="100" lay-verify="required" autocomplete="off" placeholder="请输入商品名称">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">简介</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" type="text" id="Details" name="Details" maxlength="200"
                                        lay-verify="" autocomplete="off" placeholder="请输入简介">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">分享描述</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" type="text" id="ShareDetail" name="ShareDetail"
                                        maxlength="200" lay-verify="" autocomplete="off" placeholder="请输入分享描述">
                                </div>
                            </div>
                            <div class="layui-form-item layui-form-text">
                                <label class="layui-form-label">内容</label>
                                <div class="layui-input-block">
                                    <textarea class="layui-textarea" id="Contents" name="Contents" placeholder="请输入内容"
                                        style="width:100%;height:500px;"></textarea>
                                </div>
                            </div>

                            @* <div class="layui-form-item">
                                <label class="layui-form-label">推荐</label>
                                <div class="layui-input-block">
                                    <input type="checkbox" id="IsRecommend" name="IsRecommend" value="1"
                                        lay-skin="switch" lay-filter="switchTest" title="开关">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">有好货</label>
                                <div class="layui-input-block">
                                    <input type="checkbox" id="IsRecommend2" name="IsRecommend2" value="1"
                                        lay-skin="switch" lay-filter="switchTest" title="开关">
                                </div>
                            </div> *@
                            @* <div class="layui-form-item">
                                <label class="layui-form-label">上架时间</label>
                                <div class="layui-input-inline">
                                <input class="layui-input" type="text" id="PublishDate" name="PublishDate" lay-verify=""
                                autocomplete="off" placeholder="请输入上架时间">
                                </div>
                                </div> *@
                            <div class="layui-form-item">
                                <label class="layui-form-label">上架时间</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="StartDate" name="StartDate"
                                        lay-verify="required" autocomplete="off" placeholder="请输入上架时间">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">下架时间</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="EndDate" name="EndDate"
                                        lay-verify="required" autocomplete="off" placeholder="请输入下架时间">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">起购数量</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="StartBuyCount" name="StartBuyCount"
                                        maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入起购数量">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">限购数量</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="LimitCount" name="LimitCount"
                                        maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入限购数量">
                                </div>
                            </div>
                            @* <div class="layui-form-item">
                                <label class="layui-form-label">首页Banner推荐</label>
                                <div class="layui-input-block">
                                    <input type="checkbox" id="IsBanner" name="IsBanner" value="1"
                                        lay-skin="switch" lay-filter="IsBanner" title="开关">
                                </div>
                            </div>
                            <div class="layui-form-item" id="BannerList" style="display: none;">
                                <label class="layui-form-label">Banner图片</label>
                                <div class="layui-input-block">
                                    <div class="layui-upload">
                                        <input type="hidden" id="BannerPhoto" name="BannerPhoto" value="">
                                        <button class="layui-btn" type="button" id="ListPicBtn">选择图片</button>
                                        <div class="layui-inline layui-word-aux">@(new MySystem.PublicFunction().GetUploadHint("ProductsBannerPhoto"))</div>
                                    </div>
                                    <div style="margin-top:10px;" id="BannerPhotoImage">
                                    </div>
                                </div>
                            </div> *@
                            @* <div class="layui-form-item" id="OutLink" style="display: none;">
                                <label class="layui-form-label">外部连接</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" type="text" id="LinkUrl" name="LinkUrl" maxlength="500"
                                        lay-verify="" autocomplete="off" placeholder="请输入外部连接，可不填">
                                </div>
                            </div>
                            <div class="layui-form-item" id="SortBanner" style="display: none;">
                                <label class="layui-form-label">Banner排序</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" type="text" id="BannerSort" name="BannerSort" maxlength="500"
                                        lay-verify="" autocomplete="off" placeholder="请输入Banner排序，可不填">
                                </div>
                            </div> *@
                            @* <div class="layui-form-item layui-form-text">
                                <label class="layui-form-label">关键词</label>
                                <div class="layui-input-block">
                                    <textarea class="layui-textarea" id="KeyWord" name="KeyWord" lay-verify=""
                                        placeholder="请输入关键词"></textarea>
                                </div>
                            </div> *@

                        </div>
                        <div class="layui-tab-item">
                            <div class="layui-form-item">
                                <label class="layui-form-label">图集</label>
                                <div class="layui-input-block">
                                    <div class="layui-upload">
                                        <input type="hidden" id="DetailPicPath" name="DetailPicPath" value="">
                                        <button class="layui-btn" type="button" id="DetailPicPathBtn">选择图片</button>
                                        <div class="layui-inline layui-word-aux"></div>
                                    </div>
                                    <div class="mt10" id="DetailPicPathImage">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">缩略图</label>
                                <div class="layui-input-block">
                                    <div class="layui-upload">
                                        <input type="hidden" id="ListPicPath" name="ListPicPath" value="">
                                    </div>
                                    <div class="mt10" id="ListPicPathImage">
                                        <img src="" class="layui-upload-img" style="max-width:285px; max-height:285px;">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-tab-item">
                            @* <div class="layui-form-item">
                                <label class="layui-form-label">成本价</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="CostPrice" name="CostPrice"
                                        maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入成本价">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">原价</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="SourcePrice" name="SourcePrice"
                                        maxlength="20" lay-verify="required|number|" autocomplete="off"
                                        placeholder="请输入原价">
                                </div>
                            </div> *@
                            <div class="layui-form-item">
                                <label class="layui-form-label">价格</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="Price" name="Price" maxlength="20"
                                        lay-verify="" autocomplete="off" placeholder="请输入价格">
                                </div>
                            </div>
                            @* <div class="layui-form-item">
                                <label class="layui-form-label">抵扣积分</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="Integral" name="Integral" maxlength="20"
                                        lay-verify="" autocomplete="off" placeholder="请输入抵扣积分">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">创客价</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="MemberPrice" name="MemberPrice"
                                        maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入创客价">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">创客抵扣积分</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="UserIntegral" name="UserIntegral"
                                        maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入创客抵扣积分">
                                </div>
                            </div> *@
                        </div>
                        <div class="layui-tab-item">
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">运费模板</label>
                                    <div class="layui-input-inline">
                                        <select id="FareTemplateId" name="FareTemplateId" lay-search="">
                                            <option value="">请选择</option>
                                            <option v-for="item in tempList" :value="item.id">{{item.name}}</option>
                                        </select>
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">
                                        <a href="###" v-on:click="showTemplate">刷新</a>
                                    </div>
                                    <div class="layui-form-mid layui-word-aux">
                                        <a href="###" id="FareTempUrl" lay-href="">模板管理</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        @* <div class="layui-tab-item">
                            <div class="layui-form-item">
                            <label class="layui-form-label">抢购开关</label>
                            <div class="layui-input-block">
                            <input type="checkbox" id="IsLimit" name="IsLimit" value="1" lay-skin="switch"
                            lay-filter="switchTest" title="开关">
                            </div>
                            </div>
                            <div class="layui-form-item">
                            <label class="layui-form-label">开始时间</label>
                            <div class="layui-input-inline">
                            <input class="layui-input" type="text" id="StartDate" name="StartDate" lay-verify=""
                            autocomplete="off" placeholder="请输入开始时间">
                            </div>
                            </div>
                            <div class="layui-form-item">
                            <label class="layui-form-label">结束时间</label>
                            <div class="layui-input-inline">
                            <input class="layui-input" type="text" id="EndDate" name="EndDate" lay-verify=""
                            autocomplete="off" placeholder="请输入结束时间">
                            </div>
                            </div>

                            </div> *@
                        <div class="layui-tab-item">
                            <div class="layui-form-item">
                                <label class="layui-form-label">库存</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="Stock" name="Stock" maxlength="20"
                                        value="0" lay-verify="" autocomplete="off" placeholder="请输入库存">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">已购买数</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="BuyCount" name="BuyCount" maxlength="20"
                                        value="0" lay-verify="required;integer;" autocomplete="off"
                                        placeholder="请输入已购买数">
                                </div>
                            </div>
                            @* <div class="layui-form-item">
                                <label class="layui-form-label">评价数</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="CommentCount" name="CommentCount"
                                        maxlength="20" value="0" lay-verify="required|int|" autocomplete="off"
                                        placeholder="请输入评价数">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">好评率</label>
                                <div class="layui-input-inline">
                                    <input class="layui-input" type="text" id="GoodPercent" name="GoodPercent"
                                        maxlength="20" value="0" lay-verify="required|number|" autocomplete="off"
                                        placeholder="请输入好评率">
                                </div>
                            </div> *@
                        </div>
                        @* <div class="layui-tab-item">
                            <div class="layui-form-item">
                                <label class="layui-form-label">标语1</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" type="text" id="Title" name="Title" maxlength="50"
                                        autocomplete="off" placeholder="请输入标语1">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">标语2</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" type="text" id="Title2" name="Title2" maxlength="50"
                                        autocomplete="off" placeholder="请输入标语2">
                                </div>
                            </div>
                        </div>
                        <div class="layui-tab-item">
                            <div class="layui-form-item">
                                <label class="layui-form-label">网页标题</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" type="text" id="SeoTitle" name="SeoTitle" maxlength="50"
                                        autocomplete="off" placeholder="请输入网页标题">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">网页关键字</label>
                                <div class="layui-input-block">
                                    <input class="layui-input" type="text" id="SeoKeyword" name="SeoKeyword"
                                        maxlength="50" autocomplete="off" placeholder="请输入网页关键字">
                                </div>
                            </div>
                            <div class="layui-form-item layui-form-text">
                                <label class="layui-form-label">网页描述</label>
                                <div class="layui-input-block">
                                    <textarea class="layui-textarea" name="SeoDescription" id="SeoDescription"
                                        placeholder="请输入网页描述"></textarea>
                                </div>
                            </div>

                        </div> *@

                    </div>
                </div>
                <div class="layui-form-item layui-hide">
                    <input type="button" lay-submit lay-filter="LAY-list-front-submit" id="LAY-list-front-submit"
                        value="确认">
                </div>
            </div>
        </div>
    </div>

    <script src="/layuiadmin/layui/layui.js"></script>
    <script
        src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
    <script src="/other/mybjq/kindeditor-min.js"></script>
    <script src="/other/mybjq/lang/zh_CN.js"></script>
    <script>
        //内容
        @(Html.Raw(Library.Control.kindeditorVar("Contents")))


            //编辑器
            KindEditor.ready(function (K) {
                //内容
        @(Html.Raw(Library.Control.kindeditor("Contents", 1)))

        });

        var ids = "";
        function getChildren(obj) {
            $.each(obj, function (index, value) {
                var id = obj[index].id;
                ids += id + ",";
                var children = obj[index].children;
                if (children) {
                    getChildren(children);
                }
            });
        }


        function AreasProvinceInit(tagId, areasVal, form) {
            for (var i = 0; i < provs_data.length; i++) {
                var sel = "";
                if (areasVal.indexOf(provs_data[i].text) > -1) {
                    sel = " selected=selected";
                }
                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
            }
            form.render();
        }

        function AreasProvinceSelected(tagId, areasVal, form, value) {
            $("#" + tagId + "City").html('<option value="">市</option>');
            var list = citys_data[value];
            for (var i = 0; i < list.length; i++) {
                var sel = "";
                if (areasVal.indexOf(list[i].text) > -1) {
                    sel = " selected=selected";
                }
                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
            }
            $("#" + tagId + "Area").html('<option value="">县/区</option>');
            form.render();
            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
        }

        function AreasCitySelected(tagId, areasVal, form, value) {
            $("#" + tagId + "Area").html('<option value="">县/区</option>');
            var list = dists_data[value];
            for (var i = 0; i < list.length; i++) {
                var sel = "";
                if (areasVal.indexOf(list[i].text) > -1) {
                    sel = " selected=selected";
                }
                $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
            }
            form.render();
            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
        }

        function AreasAreaSelected(tagId, form) {
            form.render();
            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
        }
        function movePrev(obj, tagId) {
            $(obj).parent().prev().insertAfter($(obj).parent());
            checkPics(tagId);
        }
        function moveNext(obj, tagId) {
            $(obj).parent().next().insertBefore($(obj).parent());
            checkPics(tagId);
        }
        function deletePic(obj, tagId) {
            $(obj).parent().remove();
            checkPics(tagId);
        }
        function checkPics(tagId) {
            var pics = "";
            var texts = "";
            $("#" + tagId + "Image div img").each(function (i) {
                pics += $(this).attr("src").replace(osshost, '') + "|";
            });
            $("#" + tagId + "Image div input").each(function (i) {
                texts += $(this).val() + "|";
            });
            if (pics == "") {
                $("#" + tagId).val("");
            } else {
                pics = pics.substring(0, pics.length - 1);
                texts = texts.substring(0, pics.length - 1);
                $("#" + tagId).val(pics + "#cut#" + texts);
            }
        }
        function checkBox(tagId) {
            var text = "";
            $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
                text += $(this).val() + ",";
            });
            $("#" + tagId).val(text);
        }
        function showBigPic(picpath) {
            parent.layer.open({
                type: 1,
                title: false,
                closeBtn: 0,
                shadeClose: true,
                area: ['auto', 'auto'],
                content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
            });
        }
        function setListPhoto(picpath) {
            $("#ListPicPath").val(picpath);
            $("#ListPicPathImage img").attr("src", osshost + picpath);
        }
        function changeMerchant() {
            $("#FareTempUrl").attr("lay-href", "/Admin/ProductFareTemp/Index?MerchantId=" + MerchantId + "&right=@right");
            $("#MerchantClassUrl").attr("lay-href", "/Admin/MerchantClass/Index?MerchantId=" + MerchantId + "&right=@right");
            $("#MerchantColUrl").attr("lay-href", "/Admin/MerchantCol/Index?MerchantId=" + MerchantId + "&right=@right");
            app.showTemplate();
            app.showMerchantClass();
            app.showMerchantCol();
        }


        var tree;
        var element;
        var form;
        var upload;
        var MerchantId;
        function init_layui() {
            layui.config({
                base: '/layuiadmin/' //静态资源所在路径
            }).extend({
                index: 'lib/index' //主入口模块
            }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
                var $ = layui.$
                    , table = layui.table
                    , layer = layui.layer
                    , layedit = layui.layedit
                    , laydate = layui.laydate
                    , croppers = layui.croppers
                    , transfer = layui.transfer
                    , util = layui.util;
                tree = layui.tree;
                element = layui.element;
                form = layui.form;
                upload = layui.upload;

                form.on('select(MerchantId)', function (data) {
                    MerchantId = data.value;
                    changeMerchant();
                });

                //Hash地址的定位
                var layid = location.hash.replace(/^#test=/, '');
                element.tabChange('test', layid);
                element.on('tab(test)', function (elem) {
                    location.hash = 'test=' + $(this).attr('lay-id');
                });

                form.on('switch(IsBanner)', function (data) {
                    console.log(data);
                    if (this.checked) {
                        $('#BannerList').css('display', 'block');
                        $('#OutLink').css('display', 'block');
                        $('#SortBanner').css('display', 'block');
                    } else {
                        $('#BannerList').css('display', 'none');
                        $('#OutLink').css('display', 'none');
                        $('#SortBanner').css('display', 'none');
                    }
                    form.render();
                });

                //日期
                laydate.render({
                    elem: '#StartDate',
                    type: 'datetime'
                });
                laydate.render({
                    elem: '#EndDate',
                    type: 'datetime'
                });
                laydate.render({
                    elem: '#PublishDate',
                    type: 'datetime'
                });


                //上传文件
                WebUploadJs('DetailPicPathBtn', '@(Library.ConfigurationManager.AppSettings["Database"].ToString())/upload/v2', @(Html.Raw(new MySystem.PublicFunction().GetUploadParam("ProductsDetailPicPath"))), function (filename) {
                    $('#DetailPicPathImage').append('<div style="float:left; width:285px; height:320px; margin:10px; padding:10px; border:1px solid #cccccc; text-align:center;"><div style="height:285px;"><img src="' + osshost + filename + '" style="max-width:285px; max-height:285px;" onclick="showBigPic(\'' + osshost + filename + '\')" /></div><input type="text" placeholder="图片说明" value="" style="width:285px; margin-top:5px; font-size:12px;" /><br><a href="javascript:;" onclick="movePrev(this,\'DetailPicPath\')" style="color:#000; font-size:12px; padding:0px 2px;">左移</a><a href="javascript:;" onclick="moveNext(this,\'DetailPicPath\')" style="color:#000; font-size:12px; padding:0px 2px;">右移</a><a href="javascript:;" onclick="deletePic(this,\'DetailPicPath\')" style="color:#000; font-size:12px; padding:0px 2px;">删除</a><a href="javascript:;" onclick="setListPhoto(\'' + filename + '\')" style="color:#000; font-size:12px; padding:0px 2px;">设为缩略图</a></div>');
                });

                WebUploadJs('ListPicBtn', '@(Library.ConfigurationManager.AppSettings["Database"].ToString())/upload/v2', @(Html.Raw(new MySystem.PublicFunction().GetUploadParam("ProductBannerListPic"))), function (filename) {
                    $('#BannerPhotoImage').html('<img src="' + osshost + filename + '" class="layui-upload-img" style="max-width:85px; max-height:85px;" onclick="showBigPic(\'' + osshost + filename + '\')">')
                    $('#BannerPhoto').val(filename);
                });


                //穿梭框
                transfer.render({
                    elem: '#ColIdTransfer'
                    , data: @Html.Raw(ColJson)
                    , title: ['待选项', '选中项']
                    , showSearch: true
                    , onchange: function (obj, index) {
                        if (index == 0) {
                            var source = $("#ColId").val();
                            $.each(obj, function (index, value) {
                                var val = obj[index].value;
                                if (source != "") {
                                    source += "," + val;
                                } else {
                                    source += val;
                                }
                            });
                            $("#ColId").val(source);
                        } else if (index == 1) {
                            var source = "," + $("#ColId").val() + ",";
                            $.each(obj, function (index, value) {
                                var val = obj[index].value;
                                source = source.replace("," + val + ",", ",");
                            });
                            if (source != "") {
                                if (source == ",") {
                                    source = "";
                                } else {
                                    source = source.substring(1, source.length - 1);
                                }
                            }
                            $("#ColId").val(source);
                        }
                    }
                });


                //TreeView，比如权限管理


                //省市区

            });
        }

        //加载vue
        var app = new Vue({
            el: '#app',
            data() {
                return {
                    tempList: [],
                    classList: [],
                    merchantColList: [],
                };
            },
            mounted() {
                init_layui();
                this.showTemplate();
            },
            methods: {
                showTemplate() {
                    let that = this;
                    $.ajax({
                        url: "/Admin/ProductFareTemp/GetTemplate?r=" + Math.random(1),
                        data: "MerchantId=" + MerchantId,
                        dataType: "json",
                        success: function (data) {
                            that.tempList = data;
                            setTimeout(function () {
                                form.render();
                            }, 1000);
                        }
                    });
                },
                showMerchantClass() {
                    let that = this;
                    $.ajax({
                        url: "/Admin/MerchantClass/GetSelect?r=" + Math.random(1),
                        data: "MerchantId=" + MerchantId,
                        dataType: "json",
                        success: function (data) {
                            that.classList = data;
                            setTimeout(function () {
                                form.render();
                            }, 1000);
                        }
                    });
                },
                showMerchantCol() {
                    let that = this;
                    @* $.ajax({
                        url: "/Admin/MerchantCol/GetSelect?r=" + Math.random(1),
                        data: "MerchantId=" + MerchantId,
                        dataType: "json",
                        success: function (data) {
                            that.merchantColList = data;
                            setTimeout(function () {
                                form.render();
                            }, 1000);
                        }
                    }); *@
                },
            }
        });
    </script>
    @if (SysRealRole == "3")
    {
        <script>
            MerchantId = "@SysId";
            setTimeout(function () {
                changeMerchant();
            }, 1000);
        </script>
    }
</body>

</html>
