123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827 |
- {extend name='admin@main'}
- {block name="content"}
- {include file='mall@store_goods/form_style'}
- <header>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
- <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css"/>
- <style>
- .layui-layedit{
- width: 1200px;
- height: 500px;
- }
- .layui-form-select{
- margin-right: 10px !important;
- }
- .layui-col-xs9{
- width: 90%;
- }
- .amap-icon img,
- .amap-marker-content img{
- width: 25px;
- height: 34px;
- }
- .marker {
- position: absolute;
- top: -20px;
- right: -118px;
- color: #fff;
- padding: 4px 10px;
- box-shadow: 1px 1px 1px rgba(10, 10, 10, .2);
- white-space: nowrap;
- font-size: 12px;
- background-color: #25A5F7;
- border-radius: 3px;
- }
- .input-card{
- width: 18rem;
- z-index: 170;
- }
- .input-card .btn{
- margin-right: .8rem;
- }
- .input-card .btn:last-child{
- margin-right: 0;
- }
- .input-item-text, input[type=text], input[type=date], select {
- height: calc(3rem + 2px) !important;
- }
- .layui-form-radio{
- margin: 0 !important;
- padding-right:0 !important;
- }
- .layui-form-select{
- margin-right: 10px !important;
- }
- #panel {
- position: absolute;
- background-color: white;
- max-height: 90%;
- overflow-y: auto;
- top: 35px;
- right: 10px;
- width: 280px;
- }
- </style>
- </header>
- <form onsubmit="return false;" id="GoodsForm" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
- <div class="layui-card-body think-box-shadow padding-left-40">
- <div class="layui-tab">
- <ul class="layui-tab-title">
- <li class="layui-this">基础设置</li>
- <li class="">其他</li>
- </ul>
- <div class="layui-tab-content">
- <!--基础设置-->
- <div class="layui-tab-item layui-show">
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs9 relative">
- <span class="color-green">标题</span>
- <input name="title" required class="layui-input" placeholder="请输入活动标题" value="{$vo.title|default=''}">
- </label>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs9 relative">
- <span class="color-green">请输入活动标签</span>
- <textarea placeholder="请输入活动标签" required class="layui-textarea" name="label">{$vo.label|default=""}</textarea>
- </label>
- </div>
- <div class="layui-form-item">
- <span class="color-green label-required-prev">海报</span>
- <table class="layui-table">
- <thead>
- <tr>
- <td width="90px" class="text-left"><input name="cover" type="hidden" value="{$vo.cover|default=''}"></td>
- </tr>
- </thead>
- </table>
- <script>$('[name="cover"]').uploadOneImage()</script>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">报名模板</span>
- <select class="layui-select" name="template_id" id="template_id" lay-filter="template_id" lay-search>
- <option value="0">请选择</option>
- {foreach $template_list as $vk=>$vv}
- <option {if isset($vo.template_id) && $vo.template_id == $vv['id'] }selected{/if} value="{$vv['id']}">{$vv['title']}</option>
- {/foreach}
- </select>
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">评论开关</span>
- <select class="layui-select" name="comment_switch" id="comment_switch" lay-filter="comment_switch" lay-search>
- <option {if isset($vo.comment_switch) && $vo.comment_switch == 1 }selected{/if} value="1">开启</option>
- <option {if isset($vo.comment_switch) && $vo.comment_switch == 0 }selected{/if} value="0">关闭</option>
- </select>
- </label>
- {notempty name='vo.id'}
- <label class="layui-col-xs3 relative">
- <span class="color-green">消息推送</span>
- <select class="layui-select" name="push_switch" lay-filter="push_switch" lay-search>
- <option value="0">否</option>
- <option value="1">是</option>
- </select>
- </label>
- {/notempty}
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">主办方</span>
- <select class="layui-select" name="sponsor_id" id="sponsor_id" lay-filter="sponsor_id" lay-search>
- <option value="0">请选择</option>
- {foreach $sponsor_list as $vk=>$vv}
- <option {if isset($vo.sponsor_id) && $vo.sponsor_id == $vv['id'] }selected{/if} data-vl_key="{$vk}" value="{$vv['id']}">{$vv['title']}</option>
- {/foreach}
- </select>
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">会员账号</span>
- <input name="phone" class="layui-input" placeholder="请输入会员账号" value="{$vo.phone|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">阅读量</span>
- <input name="read_num" class="layui-input" placeholder="" value="{$vo.read_num|default=''}">
- </label>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">热搜阅读量</span>
- <input name="hot_num" value='{$vo.hot_num|default=""}' placeholder="请输入热搜阅读量" class="layui-input">
- <input name="hot_num_old" type="hidden" value='{$vo.hot_num|default=""}' class="layui-input">
- </label>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">开始时间</span>
- <input name="start_time" id="start_time" required class="layui-input" placeholder="请输入开始时间" value="{$vo.start_time|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">结束时间</span>
- <input name="end_time" id="end_time" required class="layui-input" placeholder="请输入结束时间" value="{$vo.end_time|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">上架时间</span>
- <input name="release_time" id="release_time" required class="layui-input" placeholder="" value="{$vo.release_time|default=''}">
- </label>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs12 relative">
- <span class="color-green">关联资料</span>
- </label>
- <div class="layui-inline" style="top: -15px;margin-bottom: -25px">
- <div class="layui-input-inline">
- <select name="datum_id" lay-filter ="datum_id" lay-search>
- <option value="0">请选择</option>
- {foreach $datum_list as $dk=>$dv}
- <option {if isset($vo.datum_id) && $vo.datum_id == $dv['id'] }selected{/if} data-dl_key="{$dk}" value="{$dv['id']}">{$dv['title']}</option>
- {/foreach}
- </select>
- </div>
- <div class="layui-input-inline">
- <select name="datum_item" lay-filter ="datum_item" lay-search>
- <option value="0">请选择</option>
- {foreach $datum_list as $vk=>$vv}
- {if isset($vo.datum_id) && $vo.datum_id == $vv['id'] }
- {foreach $vv['url_arr'] as $cln}
- <option {if isset($vo.datum_item) && $vo.datum_item == $cln['id']} selected {/if} value="{$cln['id']}">{$cln['title']}</option>
- {/foreach}
- {/if}
- {/foreach}
- </select>
- </div>
- </div>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs12 relative">
- <span class="color-green">视频</span>
- </label>
- <div class="layui-inline" style="top: -15px;margin-bottom: -25px;margin-right: 20px;">
- <div class="layui-input-inline">
- <select name="video_id" lay-filter ="video_id" lay-search>
- <option value="0">请选择</option>
- {foreach $video_list as $vk=>$vv}
- <option {if isset($vo.video_id) && $vo.video_id == $vv['id'] }selected{/if} data-vl_key="{$vk}" value="{$vv['id']}">{$vv['title']}</option>
- {/foreach}
- </select>
- </div>
- <div class="layui-input-inline">
- <select name="video_item" lay-filter ="video_item" lay-search>
- <option value="0">请选择</option>
- {foreach $video_list as $vk=>$vv}
- {if isset($vo.video_id) && $vo.video_id == $vv['id'] }
- {foreach $vv['video_arr'] as $cln}
- <option {if isset($vo.video_item) && $vo.video_item == $cln['id']} selected {/if} value="{$cln['id']}">{$cln['title']}</option>
- {/foreach}
- {/if}
- {/foreach}
- </select>
- </div>
- </div>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs12 relative">
- <span class="color-green">图文</span>
- </label>
- <div class="layui-inline" style="top: -15px;margin-bottom: -25px;margin-right: 20px;">
- <div class="layui-input-inline">
- <select name="article_id" lay-filter ="article_id" lay-search>
- <option value="0">请选择</option>
- {foreach $article_list as $vk=>$vv}
- <option {if isset($vo.article_id) && $vo.article_id == $vv['id'] }selected{/if} data-vl_key="{$vk}" value="{$vv['id']}">{$vv['title']}</option>
- {/foreach}
- </select>
- </div>
- <div class="layui-input-inline">
- <select name="article_item" lay-filter ="article_item" lay-search>
- <option value="0">请选择</option>
- {foreach $article_list as $vk=>$vv}
- {if isset($vo.article_id) && $vo.article_id == $vv['id'] }
- {foreach $vv['item_children'] as $cln}
- <option {if isset($vo.article_item) && $vo.article_item == $cln['id']} selected {/if} value="{$cln['id']}">{$cln['title']}</option>
- {/foreach}
- {/if}
- {/foreach}
- </select>
- </div>
- </div>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs9 relative">
- <span class="color-green label-required-prev">地址</span>
- </label>
- <div class="layui-inline" style="top: -15px;margin-bottom: -25px">
- <div class="layui-input-inline">
- <select name="province" lay-filter ="province">
- <option value="0">请选择</option>
- {foreach $all_area as $ak=>$cv}
- {if isset($vo.province) && $vo.province == $cv['name'] }
- <option selected data-al_key="{$ak}" value="{$cv['name']}">{$cv['name']}</option>
- {else}
- <option data-al_key="{$ak}" value="{$cv['name']}">{$cv['name']}</option>
- {/if}
- {/foreach}
- </select>
- </div>
- <div class="layui-input-inline">
- <select name="city" lay-filter ="city">
- <option value="0">请选择</option>
- {foreach $all_area as $ck=>$cv}
- {if isset($vo.province) && $vo.province == $cv['name'] }
- {foreach $cv['children'] as $clk=>$cln}
- {if isset($vo.city) && $vo.city == $cln['name'] }
- <option selected data-bl_key="{$clk}" value="{$cln['name']}">{$cln['name']}</option>
- {else}
- <option data-bl_key="{$clk}" value="{$cln['name']}">{$cln['name']}</option>
- {/if}
- {/foreach}
- {/if}
- {/foreach}
- </select>
- </div>
- <div class="layui-input-inline">
- <select name="county" lay-filter ="county">
- <option value="0">请选择</option>
- {foreach $all_area as $ck=>$cv}
- {if isset($vo.province) && $vo.province == $cv['name']}
- {foreach $cv['children'] as $cln}
- {if isset($vo.city) && $vo.city == $cln['name']}
- {foreach $cln['children'] as $dln}
- {if isset($vo.county) && $vo.county == $dln['name'] }
- <option selected value="{$dln['name']}">{$dln['name']}</option>
- {else}
- <option value="{$dln['name']}">{$dln['name']}</option>
- {/if}
- {/foreach}
- {/if}
- {/foreach}
- {/if}
- {/foreach}
- </select>
- </div>
- <div class="layui-input-inline">
- <input name="address" style="width: 400px" required class="layui-input" placeholder="请输入公司地址" value="{$vo.address|default=''}">
- </div>
- </div>
- </div>
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs9 relative">
- <span class="color-green">地图</span>
- <div>
- <div id="container" style="width:100%; height: 600px;"></div>
- <div id="panel" ></div>
- </div>
- <div class="layui-input-inline">
- <input type="hidden" id="longitude" name="longitude" value="{$vo.longitude|default=''}">
- <input type="hidden" id="latitude" name="latitude" value="{$vo.latitude|default=''}">
- <input id='lnglat' type="hidden" value="{$vo.longitude|default=''},{$vo.latitude|default=''}">
- </div>
- </label>
- </div>
- </div>
- <div class="layui-tab-item">
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs12 relative" >
- <span class="color-green label-required-prev">报名价格设置</span>
- <table class="layui-table" style="margin-right: 20px;">
- <thead>
- <tr>
- <th class="text-left">标题</th>
- <th class="text-left">发行量</th>
- {notempty name='vo.id'}
- <th class="text-left">剩余量</th>
- {/notempty}
- <th class="text-left">价格</th>
- <th class="text-left">满减张数</th>
- <th class="text-left">满减优惠/张</th>
- <th class="text-left">审核</th>
- <th class="text-left">状态</th>
- <th class="text-left">备注</th>
- <th class="text-left">操作</th>
- </tr>
- <tbody class="no_html">
- </tbody>
- </thead>
- </table>
- </label>
- </div>
- <!-- 线下支付设置-->
- <div class="layui-form-item layui-row layui-col-space15">
- <label class="layui-col-xs3 relative">
- <span class="color-green">线下支付</span>
- <select class="layui-select" name="pay_offline" id="pay_offline" lay-filter="pay_offline" lay-search>
- <option {if isset($vo.pay_offline) && $vo.pay_offline == 0 }selected{/if} value="0">关闭</option>
- <option {if isset($vo.pay_offline) && $vo.pay_offline == 1 }selected{/if} value="1">开启</option>
- </select>
- </label>
- </div>
- <div class="layui-form-item layui-row layui-col-space15 offline_div" {if !isset($vo.pay_offline) || !$vo.pay_offline}style="display:none"{/if}>
- <label class="layui-col-xs3 relative">
- <span class="color-green">户名</span>
- <input name="offline_user" class="layui-input" value="{$vo.offline_user|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">开户行</span>
- <input name="offline_bank" class="layui-input" value="{$vo.offline_bank|default=''}">
- </label>
- <label class="layui-col-xs3 relative">
- <span class="color-green">账号</span>
- <input name="offline_card" class="layui-input" value="{$vo.offline_card|default=''}">
- </label>
- </div>
- <!-- 线下支付设置-->
- <div class="layui-form-item layui-row layui-col-space9">
- <label class="layui-col-xs20 relative">
- <span class="color-green">详情</span>
- <textarea id="demo" name="content">{$vo.content|default=""}</textarea>
- </label>
- </div>
- <div class="layui-form-item text-center">
- {notempty name='vo.id'}<input type="hidden" name="id" value="{$vo.id}">{/notempty}
- <button class="layui-btn" type="submit">保存</button>
- <button class="layui-btn layui-btn-danger" type='button' onclick="history.go(-1)" data-close>返回</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </form>
- {/block}
- {block name='script'}
- <script type="text/javascript" src="https://webapi.amap.com/ui/1.0/main.js?v=1.0.11"></script>
- <script src="https://webapi.amap.com/maps?v=1.4.15&key=5295cbb966c063bde1ed33c1de7ed6bd&callback=init"></script>
- <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
- <script>
- layui.config({}).extend({}).use(['index', 'form'], function(){ var $ = layui.$,form = layui.form;})
- var longitude = "{$vo.longitude|default='118.356655'}";
- var latitude = "{$vo.latitude|default='35.102929'}";
- window._AMapSecurityConfig = {
- securityJsCode: "d9ec1c40b3aa3504369f304e359586b0",
- }
- var placeSearch , sel_list;
- window.init = function(){
- var marker, map = new AMap.Map('container', {
- center:[longitude,latitude],
- resizeEnable: true,
- zoom:13
- });
- AMap.service(["AMap.PlaceSearch"], function() {
- //构造地点查询类
- placeSearch = new AMap.PlaceSearch({
- pageSize: 5, // 单页显示结果条数
- pageIndex: 1, // 页码
- city: "", // 兴趣点城市
- citylimit: true, //是否强制限制在设置的城市内搜索
- map: map, // 展现结果的地图实例
- panel: "panel", // 结果列表将在此容器中进行展示。
- autoFitView: true, // 是否自动调整地图视野使绘制的 Marker点都处于视口的可见范围
- extensions: 'all' ,
- callback: 'aaa' ,
- });
- //关键字查询
- });
- addMark(longitude,latitude)
- map.on( 'click', function (e) {
- lnglatInput.value = e.lnglat.toString();
- var inputVal = lnglatInput.value.split(',');
- clearMarker();
- addMark(inputVal[0], inputVal[1])
- $("longitude").value =inputVal[0] ;
- $("latitude").value = inputVal[1];
- });
- var $ = function(elementId){
- return document.getElementById(elementId);
- };
- var lnglatInput = $('lnglat');
- var pixelInput = $('pixel');
- lnglat2container();
- // 经纬度坐标转成容器像素坐标
- function lnglat2container() {
- if(!lnglatInput.value) return
- var inputVal = lnglatInput.value.split(',');
- var lnglat = new AMap.LngLat(inputVal[0], inputVal[1]);
- var pixel = map.lngLatToContainer(lnglat);
- pixelInput.value = pixel.round();
- }
- // 添加mark
- function addMark(lng,pix) {
- console.log(lng,pix)
- if(!lng || !pix) return ;
- marker = new AMap.Marker({
- icon: "https://a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",
- position: [lng, pix],
- offset: new AMap.Pixel(-13, -30)
- });
- marker.setMap(map);
- }
- // 清除 marker
- function clearMarker() {
- if (marker) {
- marker.setMap(null);
- marker = null;
- }
- }
- }
- $(document).on('click','.poibox',function (){
- var click_poi = $(".poibox").index(this);
- // console.log(sel_list[click_poi]);
- //console.log(sel_list[click_poi].location.lng);
- $("#longitude").val(sel_list[click_poi].location.lng);
- $("#latitude").val(sel_list[click_poi].location.lat);
- $("#lnglat").val(sel_list[click_poi].location.lng + ',' + sel_list[click_poi].location.lat ) ;
- })
- $("input[name='address']").on('change',function (e) {
- placeSearch.search( $("input[name='address']").val(),function (a,ls) {
- sel_list = ls.poiList.pois;
- }) ;
- })
- </script>
- <script src="https://webapi.amap.com/maps?v=1.4.15&key=5295cbb966c063bde1ed33c1de7ed6bd&callback=init"></script>
- <script src="https://webapi.amap.com/js/require.js" data-main="./require-init"></script>
- <script src="https://webapi.amap.com/loader.js"></script>
- <script>
- // layui.use('layedit', function(){
- // var layedit = layui.layedit;
- // layedit.set({
- // uploadImage: {
- // url: '/api/upload/uploadlay' //接口url
- // ,type: '', //默认post
- // data: {
- // type: 1
- // }
- // }
- // });
- // var index= layedit.build('demo',{
- // height: 500
- // }); //建立编辑器
- // $("#LAY_layedit_"+index).contents().find("img").css("width","auto");
- // });
- </script>
- <script>
- layui.form.render();
- require(['ckeditor', 'angular'], function () {
- window.createEditor('[name="content"]', {
- height: 500,
- });
- })
- layui.use('form', function () {
- var form = layui.form;
- //日期时间范围
- laydate.render({
- elem: '#start_time'
- ,type: 'datetime'
- });
- laydate.render({
- elem: '#end_time'
- ,type: 'datetime'
- });
- laydate.render({
- elem: '#release_time'
- ,type: 'datetime'
- });
- //监听指定开关
- form.on('select(pay_offline)', function(data) {
- if (data.value == 0) {
- $(".offline_div").hide();
- } else {
- $(".offline_div").show();
- }
- })
- })
- // 添加设置
- $(document).on('click',".add_goods_no",function () {
- var knum = $('.no_html tr').length;
- var no_html = get_ht(knum);
- $(".no_html").append(no_html);
- form.render();
- console.log(a);// 别删这个!!!
- })
- // 删除设置
- $(document).on('click',".del_no",function (){
- var knum = $('.no_html tr').length;
- if(knum == 1) {
- layer.msg('不能全部删除!')
- form.render();
- console.log(a);// 别删这个!!!
- }
- var index= $(".del_no").index(this);
- $(".no_detail").eq(index).remove();
- form.render();
- console.log(a);// 别删这个!!!
- })
- var is_add = parseInt('{$isAddMode|default=0}');
- if(is_add){
- $(".no_html").html(get_ht(0));
- form.render();
- }else{
- var ladder = {:json_encode($ladder)};
- console.log(ladder);
- if(ladder && ladder.length > 0) {
- var no_html = '';
- $.each(ladder,function (lk,lv) {
- no_html += ' <tr class="no_detail change_del" data-dh ="'+lk+'">';
- no_html += "<td class='text-left nowrap'>" +
- "<input type='text' class='layui-input' name='ladder_title[]' value='"+lv.ladder_title+"'/>" +
- "<input type='hidden' name='ladder_id[]' value='"+lv.id+"'/>" +
- "</td>";
- no_html += "<td class='text-left nowrap'>" +
- "<input type='number'min='0' class='layui-input' name='ladder_num[]' value='"+lv.ladder_num+"'/>" +
- "</td>";
- if(!is_add) {
- no_html += "<td class='text-left nowrap'>" +
- "<input type='number'min='0' class='layui-input' name='stock[]' value='"+lv.stock+"'/>" +
- "</td>";
- }
- no_html += "<td class='text-left nowrap'>" +
- "<input type='' class='layui-input' name='ladder_price[]' value='"+lv.ladder_price+"'/>" +
- "</td>";
- no_html += "<td class='text-left nowrap'>" +
- "<input type='number' class='layui-input' name='fill_num[]' value='"+lv.fill_num+"'/>" +
- "</td>";
- no_html += "<td class='text-left nowrap'>" +
- "<input type='number' class='layui-input' name='sub_money[]' value='"+lv.sub_money+"'/>" +
- "</td>";
- if(lv.is_sh)
- {
- no_html += "<td class='text-left nowrap'>" +
- "<select name='is_sh[]'>" +
- "<option value='0'>否</option>"+
- "<option value='1' selected>是</option>"+
- "</select>"+
- "</td>";
- }else{
- no_html += "<td class='text-left nowrap'>" +
- "<select name='is_sh[]'>" +
- "<option value='0'>否</option>"+
- "<option value='1'>是</option>"+
- "</select>"+
- "</td>";
- }
- if(lv.ladder_status) {
- no_html += "<td class='text-left nowrap'>" +
- "<select name='ladder_status[]'>" +
- "<option value='1' selected>上架</option>"+
- "<option value='0'>下架</option>"+
- "</select>"+
- "</td>";
- }else{
- no_html += "<td class='text-left nowrap'>" +
- "<select name='ladder_status[]'>" +
- "<option value='1'>上架</option>"+
- "<option value='0'>下架</option>"+
- "</select>"+
- "</td>";
- }
- no_html += "<td class='text-left nowrap'>" +
- "<input type='' class='layui-input' name='ladder_remark[]' value='"+lv.ladder_remark+"'/>" +
- "</td>";
- no_html += "<td class='text-left nowrap'>" +
- "<a class=\"layui-btn layui-btn-sm layui-btn-danger del_no\">删 除</a>" +
- "<a class=\"layui-btn layui-btn-sm layui-btn-sm add_goods_no\">添 加</a>" +
- "</td>"
- no_html += "</tr>";
- })
- $(".no_html").html(no_html);
- }else{
- $(".no_html").html(get_ht(0));
- }
- window.form.render();
- }
- function get_ht(k) {
- var award_length = $(".no_detail").length;
- var no_html = '';
- no_html += ' <tr class="no_detail change_del" data-dh ="'+k+'">';
- no_html += "<td class='text-left nowrap'>" +
- "<input type='text' class='layui-input' name='ladder_title[]' value=''/>" +
- "<input type='hidden' name='ladder_id[]' value='0'/>" +
- "</td>";
- no_html += "<td class='text-left nowrap'>" +
- "<input type='number' min='0' class='layui-input' name='ladder_num[]' value=''/>" +
- "</td>";
- if(!is_add) {
- no_html += "<td class='text-left nowrap'>" +
- "<input type='number'min='0' class='layui-input' name='stock[]' value=''/>" +
- "</td>";
- }
- no_html += "<td class='text-left nowrap'>" +
- "<input type='' class='layui-input' name='ladder_price[]' value=''/>" +
- "</td>";
- no_html += "<td class='text-left nowrap'>" +
- "<input type='number' class='layui-input' name='fill_num[]' value=''/>" +
- "</td>";
- no_html += "<td class='text-left nowrap'>" +
- "<input type='number' class='layui-input' name='sub_money[]' value=''/>" +
- "</td>";
- no_html += "<td class='text-left nowrap'>" +
- "<select name='is_sh[]'>" +
- "<option value='0'>否</option>"+
- "<option value='1'>是</option>"+
- "</select>"+
- "</td>";
- no_html += "<td class='text-left nowrap'>" +
- "<select name='ladder_status[]'>" +
- "<option value='1'>上架</option>"+
- "<option value='0'>下架</option>"+
- "</select>"+
- "</td>";
- no_html += "<td class='text-left nowrap'>" +
- "<input type='text' class='layui-input' name='ladder_remark[]' value=''/>" +
- "</td>";
- no_html += "<td class='text-left nowrap'>" +
- "<a class=\"layui-btn layui-btn-sm layui-btn-danger del_no\">删 除</a>" +
- "<a class=\"layui-btn layui-btn-sm layui-btn-sm add_goods_no\">添 加</a>" +
- "</td>"
- no_html += "</tr>";
- return no_html;
- }
- // 文章监听
- form.on('select(article_id)', function(data){
- var cl_html = '<option value="0">请选择</option>';
- if(data.value == 0) {
- $("select[name='article_item']").html(cl_html);
- }else{
- var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
- var article_list = {:json_encode($article_list)};
- $.each(article_list[vl_key]['item_children'],function (ck,cv) {
- cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
- })
- $("select[name='article_item']").html(cl_html);
- }
- window.form.render();
- });
- // 关联视频监听
- form.on('select(video_id)', function(data){
- var cl_html = '<option value="0">请选择</option>';
- if(data.value == 0) {
- $("select[name='video_item']").html(cl_html);
- }else{
- var vl_key = data.elem[data.elem.selectedIndex].dataset.vl_key;
- var video_list = {:json_encode($video_list)};
- $.each(video_list[vl_key]['video_arr'],function (ck,cv) {
- cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
- })
- $("select[name='video_item']").html(cl_html);
- }
- window.form.render();
- });
- // 关联资料监听
- form.on('select(datum_id)', function(data){
- var cl_html = '<option value="0">请选择</option>';
- if(data.value == 0) {
- $("select[name='datum_item']").html(cl_html);
- }else{
- var dl_key = data.elem[data.elem.selectedIndex].dataset.dl_key;
- var datum_list = {:json_encode($datum_list)};
- $.each(datum_list[dl_key]['url_arr'],function (ck,cv) {
- cl_html +='<option value="'+cv.id+'">'+cv.title+'</option>';
- })
- $("select[name='datum_item']").html(cl_html);
- }
- window.form.render();
- });
- //地址监听
- var goods_spec = {:json_encode($all_area)};
- form.on('select(province)', function(data){
- var cl_html = '<option value="0">请选择</option>';
- if(data.value == 0) {
- $("select[name='city']").html(cl_html);
- $("select[name='county']").html(cl_html);
- }else{
- var cl_key = data.elem[data.elem.selectedIndex].dataset.al_key;
- $.each(goods_spec[cl_key]['children'],function (ck,cv) {
- cl_html +='<option data-bl_key="'+ck+'" value="'+cv.name+'">'+cv.name+'</option>';
- })
- $("select[name='city']").html(cl_html);
- }
- $("select[name='county']").html('');
- window.form.render();
- });
- form.on('select(city)', function(data){
- second()
- })
- function second() {
- var cl_html = '<option value="0">请选择</option>';
- var first_key = $("select[name='province']").find("option:selected").data("al_key");
- var second_key = $("select[name='city']").find("option:selected").data("bl_key");
- console.log(first_key,second_key)
- var to_each = goods_spec[first_key]['children'][second_key]['children'];
- console.log(to_each);
- $.each(to_each,function (ck,cv) {
- cl_html +='<option value="'+cv.name+'">'+cv.name+'</option>';
- })
- $("select[name='county']").html(cl_html);
- window.form.render();
- }
- </script>
- {/block}
|