addgoods.html 159 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  42. <link href="/static/css/snailfish.css" rel="stylesheet">
  43. <script type="text/javascript" src="/static/js/dist/area/cascade.js"></script>
  44. <script type="text/javascript" src="/static/js/dist/select2/select2.min.js"></script>
  45. <link rel="stylesheet" href="/static/js/dist/select2/select2-bootstrap.css">
  46. <link rel="stylesheet" href="/static/js/dist/select2/select2.css">
  47. <script type="text/javascript" src="/web/resource/js/lib/moment.js"></script>
  48. <link rel="stylesheet" href="/web/resource/components/datetimepicker/jquery.datetimepicker.css">
  49. <link rel="stylesheet" href="/web/resource/components/daterangepicker/daterangepicker.css">
  50. <style type='text/css'>
  51. .tabs-container .layui-form-item {overflow: hidden;}
  52. .tabs-container .tabs-left > .nav-tabs {}
  53. .tab-goods .nav li {float:left;}
  54. .spec_item_thumb {position: relative; width: 30px; height: 20px; padding: 0; border-left: none;}
  55. .spec_item_thumb i {position: absolute; top: -5px; right: -5px;}
  56. .input-group .spec_item_thumb{padding:0px;}
  57. .multi-img-details, .multi-audio-details {margin-top:.5em;max-width: 700px; padding:0; }
  58. .multi-audio-details .multi-audio-item {width:155px; height: 40px; position:relative; float: left; margin-right: 5px;}
  59. .region-goods-details {
  60. background: #f8f8f8;
  61. margin-bottom: 10px;
  62. padding: 0 10px;
  63. }
  64. .region-goods-left{
  65. text-align: center;
  66. font-weight: bold;
  67. color: #333;
  68. font-size: 14px;
  69. padding: 20px 0;
  70. }
  71. .region-goods-right{
  72. border-left: 3px solid #fff;
  73. padding: 10px 10px;
  74. }
  75. .input-group .input-group-btn .btn:hover{background-color:#5bc0de}
  76. .layui-form-select{display:none;}
  77. .daterangepicker select.ampmselect, .daterangepicker select.hourselect, .daterangepicker select.minuteselect {
  78. width: auto!important;
  79. }
  80. .input-group .input-group-addon{}
  81. .fa-arrows{display:none;}
  82. .spec_item_thumb img{min-height:20px;}
  83. .choose_room_title{position: absolute;top: 0px;left: -90px;font-size: 14px;}
  84. </style>
  85. </head>
  86. <body layadmin-themealias="default">
  87. <div class="layui-fluid">
  88. <div class="layui-card">
  89. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text"><?php if( !empty($item['id'])){ ?>编辑<?php }else{ ?>添加<?php } ?>商品 <small><?php if( !empty($item['id'])){ ?>修改【<span class="text-info">{$item['goodsname']}</span>】<?php } ?></small></span></div>
  90. <div class="layui-card-body" style="padding:15px;">
  91. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  92. <input type="hidden" name="goods_id" id="goods_id" value="{$id}"/>
  93. <input type="hidden" name="head_id_arr" id="head_id_arr" value="{$head_id_arr}"/>
  94. <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
  95. <ul class="layui-tab-title">
  96. <li <?php if( empty($_GPC['tab']) || $_GPC['tab']=='basic'){ ?>class="layui-this"<?php } ?>>基本信息</li>
  97. <li <?php if( $_GPC['tab']=='option'){ ?>class="layui-this"<?php } ?> >规格库存</li>
  98. <li <?php if( $_GPC['tab']=='des'){ ?>class="layui-this"<?php } ?> >商品详情</li>
  99. <?php $commiss_level = D('Home/Front')->get_config_by_name('commiss_level'); ?>
  100. <li <?php if( $_GPC['tab']=='community_head_level'){ ?>class="layui-this"<?php } ?> >提成/分销/等级</li>
  101. <?php if( !empty($is_open_goods_relative_goods) && $is_open_goods_relative_goods == 1 ){ ?>
  102. <li <?php if( $_GPC['tab']=='goods_relative_goods'){ ?>class="layui-this"<?php } ?> >推荐商品</li>
  103. <?php } ?>
  104. <?php if (!defined('ROLE')) { ?>
  105. <?php if($isopen_localtown_delivery == 1){ ?>
  106. <li <?php if( $_GPC['tab']=='goods_distribution'){ ?>class="layui-this"<?php } ?> >同城配送</li>
  107. <?php $open_goods_distribution = 1 ?>
  108. <?php } ?>
  109. <?php } ?>
  110. <?php if (defined('ROLE') && ROLE == 'agenter' ){ ?>
  111. <?php if($isopen_localtown_delivery == 1 && $supply_is_open_localtown_distribution == 1){ ?>
  112. <li <?php if( $_GPC['tab']=='goods_distribution'){ ?>class="layui-this"<?php } ?> >同城配送</li>
  113. <?php $open_goods_distribution = 1 ?>
  114. <?php }?>
  115. <?php }?>
  116. <li <?php if( $_GPC['tab']=='hexiao'){ ?>class="layui-this"<?php } ?> >到店核销</li>
  117. </ul>
  118. <div class="layui-tab-content" >
  119. <div class="layui-tab-item <?php if( empty($_GPC['tab']) || $_GPC['tab']=='basic'){ ?>layui-show<?php } ?>" >
  120. <!---- 基本信息begin --->
  121. <div class="region-goods-details layui-row">
  122. <div class="layui-form-item">
  123. <div class="layui-form-item" style="padding-top:10px;">
  124. <label class="layui-form-label must">商品名称<label style="color:red;font-size:16px;font-weight:900">*</label></label>
  125. <div class="layui-input-block" style="padding-right:0;" >
  126. <input type="text" name="goodsname" id="goodsname" class="form-control" value="{$item['goodsname']}" data-rule-required="true" />
  127. </div>
  128. </div>
  129. <div class="layui-form-item">
  130. <label class="layui-form-label">商品分类</label>
  131. <div class="layui-input-block">
  132. <select id="cates" multiple="multiple" name='cates[]' class="form-control select2" >
  133. <?php foreach( $category as $c ){ ?>
  134. <option value="{$c['id']}" <?php if( is_array($item['cates']) && in_array($c['id'],$item['cates'])){ ?>selected<?php } ?> >{$c['name']}</option>
  135. <?php } ?>
  136. </select>
  137. </div>
  138. </div>
  139. <div class="layui-form-item">
  140. <label class="layui-form-label">商品简介</label>
  141. <div class="layui-input-block">
  142. <textarea name="subtitle" id="subtitle" rows="5" class="form-control" data-parent=".subtitle" maxlength="100" data-rule-maxlength="100">{$item['subtitle']}</textarea>
  143. <div class="layui-form-mid layui-word-aux">商品名称下方的副标题,标题长度请控制在100字以内</div>
  144. </div>
  145. </div>
  146. <div class="layui-form-item">
  147. <label class="layui-form-label">默认商品预达简介</label>
  148. <div class="layui-input-block ">
  149. <input type="checkbox" lay-skin="primary" name="is_show_arrive" class="form-control valid" <?php if( empty($item) || $item['is_show_arrive'] ==1 || !isset($item['is_show_arrive']) ){ ?>checked<?php } ?> value="1" title="展示预达时间" />
  150. <br/>
  151. <div class="layui-form-mid layui-word-aux">“商品预达简介”为商品名称下方的“预计送达时间”。例如:"现在下单 预计(12点前下单,预计当天送达)可自提" 默认开启,关闭后不进行显示。</div>
  152. </div>
  153. </div>
  154. <div class="layui-form-item">
  155. <label class="layui-form-label">商品自定义预达简介</label>
  156. <div class="layui-input-block">
  157. <label class="radio-inline"><input type="radio" name="diy_arrive_switch" value="0" <?php if( !isset($item['diy_arrive_switch']) || $item['diy_arrive_switch'] == 0 ){ ?>checked="true"<?php } ?> title="关闭" /> </label>
  158. <label class="radio-inline"><input type="radio" name="diy_arrive_switch" value="1" <?php if( isset($item['diy_arrive_switch']) && $item['diy_arrive_switch'] == 1 ){ ?>checked="true"<?php } ?> title="开启" /> </label>
  159. <div class="layui-form-mid layui-word-aux">“商品自定义预达简介”为商品名称下方“预计送达时间”,配合“商品预达简介”使用默认关闭状态,在“商品预达简介”描述不精确的情况下建议使用此项,如果使用此项建议关闭“商品预达简介”。</div>
  160. </div>
  161. </div>
  162. <div class="layui-form-item">
  163. <label class="layui-form-label"></label>
  164. <div class="layui-input-block">
  165. <textarea name="diy_arrive_details" id="diy_arrive_details" rows="3" class="form-control" maxlength="35" data-rule-maxlength="35">{$item['diy_arrive_details']}</textarea>
  166. <div class="layui-form-mid layui-word-aux">文字的长度请控制在35字以内</div>
  167. </div>
  168. </div>
  169. <div class="layui-form-item">
  170. <label class="layui-form-label">商品简短标题</label>
  171. <div class="layui-input-block">
  172. <input type="text" name="print_sub_title" id="print_sub_title" class="form-control" value="{$item['print_sub_title']}" />
  173. <div class="layui-form-mid layui-word-aux">小票打印机使用,请控制字数,未填写默认截取商品标题(无须打印的可以不填写)</div>
  174. </div>
  175. </div>
  176. <div class="layui-form-item">
  177. <label class="layui-form-label must">商品视频</label>
  178. <div class="layui-input-block gimgs">
  179. {:tpl_form_field_video('video',$item['video'] );}
  180. <span class="layui-form-mid layui-word-aux image-block">
  181. 请输入视频链接地址或者选择上传视频(支持抖音视频地址)
  182. </span>
  183. </div>
  184. </div>
  185. <div class="layui-form-item">
  186. <label class="layui-form-label must">首页商品(大图)</label>
  187. <div class="layui-input-block gimgs">
  188. {:tpl_form_field_image2('big_img',$item['big_img'])}
  189. <span class="layui-form-mid layui-word-aux image-block">此图为首页商品大图模式封面图,最佳尺寸:710*400</span>
  190. </div>
  191. </div>
  192. <div class="layui-form-item">
  193. <label class="layui-form-label must">商品图片<label style="color:red;font-size:16px;font-weight:900">*</label></label>
  194. <div class="layui-input-block gimgs" id="gimgs_mult">
  195. {:tpl_form_field_multi_image3('thumbs',$item['piclist'])}
  196. <span class="layui-form-mid layui-word-aux image-block">商品详情页主图(轮播图),第一张为商品列表调用图,<span style="color: red;">图片类型必须为jpg或者png24,不支持png8</span>,建议为正方型,尺寸建议宽度为640,并保持图片大小一致,可拖拽改变图片顺序</span>
  197. </div>
  198. </div>
  199. <div class="layui-form-item">
  200. <label class="layui-form-label">分享标题</label>
  201. <div class="layui-input-block">
  202. <input type="text" name="share_title" class="form-control" value="{$item['share_title']}" />
  203. <div class="layui-form-mid layui-word-aux"></div>
  204. </div>
  205. </div>
  206. <div class="layui-form-item">
  207. <label class="layui-form-label ">分享图片</label>
  208. <div class="layui-input-block gimgs">
  209. {:tpl_form_field_image2('goods_share_image',$item['goods_share_image'])}
  210. <span class="layui-form-mid layui-word-aux image-block">此图为商品详情页分享图片(比例为长宽比5:4)</span>
  211. </div>
  212. </div>
  213. <div class="layui-form-item">
  214. <label class="layui-form-label">起售数量</label>
  215. <div class="layui-input-block">
  216. <div style="float: left;height: 35px;line-height:35px">商品至少&nbsp;&nbsp;</div>
  217. <input style="width: 35px; height: 35px; border: 2px white; float: left;" type="button" value="-" onclick="reduction(this)"/>
  218. <input type="text" name="goods_start_count" class="layui-input goods_start_count" value="<?php if( isset($item['goods_start_count']) && !empty($item['goods_start_count'])){echo $item['goods_start_count'];}else{echo '1';} ?>" maxlength="10" style="width: 100px;float: left;" onchange="validationNumber(this, 0)"/>
  219. <input style="width: 35px; height: 35px; border: 2px white;float: left;" type="button" value="+" onclick="add(this)"/>
  220. <div style="float: left;height: 35px;line-height:35px">&nbsp;&nbsp;件起售</div>
  221. <br/>
  222. <div style="clear:both;"></div>
  223. <span class="layui-form-mid layui-word-aux image-block">起售数量超出商品库存时,买家无法购买该商品</span>
  224. </div>
  225. </div>
  226. <?php if($is_updown){ ?>
  227. <div class="layui-form-item">
  228. <label class="layui-form-label">商品状态</label>
  229. <div class="layui-input-block">
  230. <label class="radio-inline"><input type="radio" name="grounding" value="1" <?php if( !isset($item['grounding']) || $item['grounding'] == 1){ ?>checked="true"<?php } ?> title="上架" /> </label>
  231. <label class="radio-inline"><input type="radio" name="grounding" value="0" <?php if( isset($item['grounding']) && $item['grounding'] == 0){ ?>checked="true"<?php } ?> title="下架" /> </label>
  232. </div>
  233. </div>
  234. <?php } ?>
  235. <?php if($is_index){ ?>
  236. <div class="layui-form-item">
  237. <label class="layui-form-label">首页推荐</label>
  238. <div class="layui-input-block">
  239. <label class="radio-inline"><input type="radio" name="is_index_show" value="1" <?php if( !isset($item['is_index_show']) || $item['is_index_show'] == 1){ ?>checked="true"<?php } ?> title="是" /> </label>
  240. <label class="radio-inline"><input type="radio" name="is_index_show" value="0" <?php if( isset($item['is_index_show']) && $item['is_index_show'] == 0){ ?>checked="true"<?php } ?> title="否" /> </label>
  241. </div>
  242. </div>
  243. <?php } ?>
  244. <div class="layui-form-item" style="display:none;">
  245. <label class="layui-form-label">分享描述</label>
  246. <div class="layui-input-block">
  247. <input type="text" name="share_description" class="form-control" value="{$item['share_description']}" />
  248. <div class="layui-form-mid layui-word-aux">公众号才有的,小程序没有这个描述</div>
  249. </div>
  250. </div>
  251. <div class="layui-form-item price" >
  252. <label class="layui-form-label">售价<label style="color:red;font-size:16px;font-weight:900">*</label></label>
  253. <div class="layui-input-block">
  254. <div class="input-group">
  255. <input type="text" name="price" id="price" class="form-control" value="{$item['price']}" <?php if($item['hasoption']!=1){ ?> <?php } ?> />
  256. <span class="input-group-addon">元&nbsp;</span>
  257. <span class="input-group-addon">原价(市场价、划线价)</span>
  258. <input type="text" name="productprice" id="productprice" class="form-control" value="{$item['productprice']}" />
  259. <span class="input-group-addon">元&nbsp;</span>
  260. <span class="input-group-addon"> 成本价</span>
  261. <input type="text" name="costprice" id="costpriceprice" class="form-control" value="{$item['costprice']}" placeholder=""/>
  262. <span class="input-group-addon">元&nbsp;</span>
  263. </div>
  264. <span class='layui-form-mid layui-word-aux' style="display:none;">如未启用商品规格,请填写商品价格</span>
  265. </div>
  266. </div>
  267. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1 ){ ?>
  268. <div class="layui-form-item" >
  269. <label class="layui-form-label">付费会员专享价</label>
  270. <div class="col-sm-10 col-xs-12" style="width: 600px;">
  271. <div class="radio-inline">
  272. <input type="checkbox" lay-skin="primary" lay-filter="is_take_vipcard" name="is_take_vipcard" <?php if( isset($item['is_take_vipcard']) && $item['is_take_vipcard'] ==1 ){ ?> checked <?php } ?> value="1" />
  273. <div class="input-group card_price_txt" style="width:500px;float: right; <?php if( isset($item['is_take_vipcard']) && $item['is_take_vipcard'] ==1 ){ ?><?php }else{?>display: none;<?php } ?>">
  274. <span class="input-group-addon">商品付费会员价</span>
  275. <input type="text" name="card_price" id="card_price" style="width: 360px;" class="form-control" value="{$item['card_price']}" placeholder="请填写会员价"/>
  276. <span class="input-group-addon" style="width: auto;">元&nbsp;</span>
  277. </div>
  278. <div style="clear:both;"></div>
  279. <span class="layui-form-mid layui-word-aux">开启后,付费会员下单享专属价格</span>
  280. </div>
  281. </div>
  282. </div>
  283. <?php } ?>
  284. <?php if($is_vir_count){ ?>
  285. <div class="layui-form-item" >
  286. <label class="layui-form-label">已出售数</label>
  287. <div class="layui-input-block">
  288. <div class="input-group">
  289. <input type="text" name="sales" id="sales" class="form-control" value="{$item['sales']}" />
  290. <span class="input-group-addon">备注:前台销量=虚拟销量+实际销量</span>
  291. </div>
  292. </div>
  293. </div>
  294. <?php } ?>
  295. <div class="layui-form-item" >
  296. <label class="layui-form-label">提货时间</label>
  297. <div class="col-sm-10 col-xs-12" id="radPickupDateTip">
  298. <?php $item['pick_up_type'] = isset($item['pick_up_type']) ? $item['pick_up_type'] : 1; ?>
  299. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( !isset($item['pick_up_type']) || $item['pick_up_type'] ==0 ){ ?> checked <?php } ?> value="0" title="当日达" /><span class="fake-radio"></span></label>
  300. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($item['pick_up_type']) && $item['pick_up_type'] ==1 ){ ?> checked <?php } ?> value="1" title="次日达" /><span class="fake-radio"></span></label>
  301. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($item['pick_up_type']) && $item['pick_up_type'] ==2 ){ ?> checked <?php } ?> value="2" title="隔日达" /><span class="fake-radio"></span></label>
  302. <label class="radio-inline"><input type="radio" name="pick_up_type" <?php if( isset($item['pick_up_type']) && $item['pick_up_type'] ==3 ){ ?> checked <?php } ?> value="3" title="自定义" /><span class="fake-radio"></span></label>
  303. <input class="form-control " id="txtPickupDateTip" name="pick_up_modify" style="vertical-align: sub; <?php if( isset($item['pick_up_type']) && $item['pick_up_type'] ==3){ ?>display:inline-block;<?php }else{ ?>display: none;<?php } ?>width: 120px;" type="text" value="{$item['pick_up_modify']}">
  304. <div style="clear:both;"></div>
  305. <span class="layui-form-mid layui-word-aux">系统会根据当前日期自动生成具体提货时间,或直接显示自定义内容</span>
  306. </div>
  307. </div>
  308. <div class="layui-form-item" style="display:none;">
  309. <label class="layui-form-label"></label>
  310. <div class="layui-input-block">
  311. <label class="checkbox-inline"><input type="checkbox" name="showsales" value="1" <?php if( $item['showsales'] == 1){ ?>checked="true"<?php } ?> /> 显示销量</label>
  312. <span class="layui-form-mid layui-word-aux"></span>
  313. </div>
  314. </div>
  315. <div class="layui-form-item" style="display:none;">
  316. <label class="layui-form-label">标签</label>
  317. <div class="layui-input-block">
  318. <label class="checkbox-inline"><input type="checkbox" name="quality" value="1" <?php if( !empty($item['quality'])){ ?>checked="true"<?php } ?> /> 正品保证</label>
  319. <label class="checkbox-inline"><input type="checkbox" name="seven" value="1" <?php if( !empty($item['seven'])){ ?>checked="true"<?php } ?> /> 7天无理由退换</label>
  320. <label class="checkbox-inline"><input type="checkbox" name="repair" value="1" <?php if( !empty($item['repair'])){ ?>checked="true"<?php } ?> /> 保修</label>
  321. </div>
  322. </div>
  323. <div class="layui-form-item">
  324. <label class="layui-form-label">自定义标签</label>
  325. <div class="layui-input-block">
  326. <div class="input-group " style="margin: 0;">
  327. <input type="text" disabled value="{$item['label']['id']}" class="form-control valid" name="labelname" placeholder="" id="label_id">
  328. <span class="input-group-btn">
  329. <span data-input="#label_id" id="chose_label_id" class="btn btn-default">选择标签</span>
  330. </span>
  331. </div>
  332. <?php if( $item['label']){ ?>
  333. <div class="input-group " style="margin: 0;">
  334. <div class="layadmin-text-center choose_user">
  335. <div class="" style="">{$item['label']['tagname']}</div>
  336. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this,'label_id')"><i class="layui-icon">&#xe640;</i></button>
  337. </div>
  338. </div>
  339. <?php } ?>
  340. </div>
  341. </div>
  342. <?php if($is_open_only_express == 1){ ?>
  343. <div class="layui-form-item" >
  344. <label class="layui-form-label">仅快递</label>
  345. <div class="col-sm-10 col-xs-12" >
  346. <input type="checkbox" lay-skin="primary" lay-filter="is_only_express" id="is_only_express" name="is_only_express" <?php if(isset($item['is_only_express']) && $item['is_only_express'] ==1 ){ ?> checked <?php } ?> value="1" />
  347. <div style="clear:both;"></div>
  348. <span class="layui-form-mid layui-word-aux">勾选后该商品会在购物车中显示快递配送,所有仅快递的商品单独结算,订单提交页只有快递配送方式<br />
  349. <font color="red">勾选后,此商品为仅快递商品。会自动取消同城配送和到店核销的勾选</font>
  350. </span>
  351. <!--
  352. <span class="layui-form-mid layui-word-aux">开启仅快递后,该商品只会快递商品一起下单<br/>
  353. <font color="red">用户开启仅快递的时候,该商品只能快递配送。</font><br/>
  354. <font color="red">其他配送服务失效。</font><br/>
  355. <font color="red">购物车中,只能和快递商品一起结算。</font><br/>
  356. </span>-->
  357. </div>
  358. </div>
  359. <?php } ?>
  360. <div class="layui-form-item dispatch_info">
  361. <label class="layui-form-label">运费设置</label>
  362. <div class="layui-input-block" style='padding-left:0'>
  363. <div class="input-group">
  364. <span class='input-group-addon' style='border:none;padding:0px;'><label class="radio-inline" style='margin-top:-7px;' ><input type="radio" name="dispatchtype" value="0" <?php if( empty($item['dispatchtype'])){ ?>checked="true"<?php } ?> title="运费模板" /> </label></span>
  365. <select class="form-control tpl-category-parent select2" id="dispatchid" name="dispatchid">
  366. <?php foreach( $dispatch_data as $dispatch_item ){ ?>
  367. <option value="{$dispatch_item['id']}" <?php if( $item['dispatchid'] == $dispatch_item['id']){ ?>selected="true"<?php } ?>>{$dispatch_item['name']}</option>
  368. <?php } ?>
  369. </select>
  370. </div>
  371. </div>
  372. </div>
  373. <div class="layui-form-item dispatch_info">
  374. <label class="layui-form-label"></label>
  375. <div class="layui-input-block" style='padding-left:0'>
  376. <div class="input-group">
  377. <span class='input-group-addon' style='border:none;padding:0px;'><label class="radio-inline" style='margin-top:-7px;' >
  378. <input type="radio"name="dispatchtype" value="1" <?php if( $item['dispatchtype'] == 1){ ?>checked="true"<?php } ?> title="统一邮费" /> </label></span>
  379. <input type="text" name="dispatchprice" id="dispatchprice" class="form-control" value="{$item['dispatchprice']}" />
  380. <span class="input-group-addon">元</span>
  381. </div>
  382. </div>
  383. </div>
  384. <?php
  385. $is_show_fullre = true;
  386. if (defined('ROLE') && ROLE == 'agenter' ) {
  387. $supper_info = get_agent_logininfo();
  388. if($supper_info['type'] == 1)
  389. {
  390. $is_show_fullre = false;
  391. }
  392. }
  393. ?>
  394. <?php if( $is_show_fullre && !empty($is_open_fullreduction) && $is_open_fullreduction == 1){ ?>
  395. <div class="layui-form-item" >
  396. <label class="layui-form-label">满减活动</label>
  397. <div class="col-sm-10 col-xs-12">
  398. <label class="radio-inline"><input type="radio" name="is_take_fullreduction" <?php if( !isset($item['is_take_fullreduction']) || $item['is_take_fullreduction'] ==1 ){ ?> checked <?php } ?> value="1" title="参与" /><span class="fake-radio"></span></label>
  399. <label class="radio-inline"><input type="radio" name="is_take_fullreduction" <?php if( isset($item['is_take_fullreduction']) && $item['is_take_fullreduction'] ==0 ){ ?> checked <?php } ?> value="0" title="不参与" /><span class="fake-radio"></span></label>
  400. <div style="color:red;margin-left: 25px;">独立供应商不参与平台满减活动</div>
  401. </div>
  402. </div>
  403. <?php } ?>
  404. <?php if($open_buy_send_score == 1){ ?>
  405. <?php if($supply_can_goods_sendscore == 1){ ?>
  406. <div class="layui-form-item" >
  407. <label class="layui-form-label">下单送积分</label>
  408. <div class="col-sm-10 col-xs-12" id="send_score_div">
  409. <input type="checkbox" lay-filter="is_modify_sendscore" lay-skin="primary" name="is_modify_sendscore" <?php if(isset($item['is_modify_sendscore']) && $item['is_modify_sendscore'] ==1){ ?> checked <?php } ?> value="1" />
  410. <input class="form-control " id="send_score_divTip" name="send_socre" style="vertical-align: sub; <?php if(isset($item['is_modify_sendscore']) && $item['is_modify_sendscore'] ==1){ ?>display:inline;<?php }else{ ?>display: none;<?php } ?>width: 120px;" type="text" value="{$item['send_socre']}" >
  411. <div id="send_score_divTip2" style=" display: inline; <?php if(isset($item['is_modify_sendscore']) && $item['is_modify_sendscore'] ==1){ ?>display:inline;<?php }else{ ?>display: none;<?php } ?>">积分</div>
  412. <div style="clear:both;"></div>
  413. <div style="color:#999">赠送数量 = 商品数量 * 下单送积分数量(未开启,则使用系统全局设置)</div>
  414. <div style="color:#999">订单结算,才送积分。订单结算时间,请看订单——订单设置——售后期设置</div>
  415. </div>
  416. </div>
  417. <?php } ?>
  418. <?php } ?>
  419. <?php if($index_sort_method == 1){ ?>
  420. <div class="layui-form-item" >
  421. <label class="layui-form-label">首页排序</label>
  422. <div class="layui-input-block">
  423. <div class="input-group">
  424. <input type="text" name="index_sort" id="index_sort" class="form-control" value="{$item['index_sort']}" />
  425. <span class="input-group-addon">备注:排序越大显示越靠前</span>
  426. </div>
  427. </div>
  428. </div>
  429. <?php } ?>
  430. </div>
  431. </div>
  432. <div class="region-goods-details ">
  433. <div class="layui-form-item">
  434. <div class="layui-form-item">
  435. <label class="layui-form-label">团购时间</label>
  436. <div class="layui-input-block">
  437. {:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $item['begin_time']),'endtime'=>date('Y-m-d H:i', $item['end_time'])),true);}
  438. </div>
  439. </div>
  440. </div>
  441. </div>
  442. <div class="region-goods-details ">
  443. <div class="layui-form-item">
  444. <div class="layui-form-item">
  445. <label class="layui-form-label">每天限购</label>
  446. <div class="layui-input-block">
  447. <input type="text" name="oneday_limit_count" class="form-control " value="{$item['oneday_limit_count']}" />
  448. <div class="layui-form-mid layui-word-aux">用户每天提交订单最多可购买数,默认为0表示不限制</div>
  449. </div>
  450. </div>
  451. </div>
  452. </div>
  453. <div class="region-goods-details ">
  454. <div class="layui-form-item">
  455. <div class="layui-form-item">
  456. <label class="layui-form-label">单次限购</label>
  457. <div class="layui-input-block">
  458. <input type="text" name="one_limit_count" class="form-control " value="{$item['one_limit_count']}" />
  459. <div class="layui-form-mid layui-word-aux">用户单次提交订单最多可购买数,默认为0表示不限制</div>
  460. </div>
  461. </div>
  462. <div class="layui-form-item">
  463. <label class="layui-form-label">历史限购</label>
  464. <div class="layui-input-block">
  465. <input type="text" name="total_limit_count" class="form-control" value="{$item['total_limit_count']}" />
  466. <div class="layui-form-mid layui-word-aux">用户历史累积最多可购买数,默认为0表示不限制</div>
  467. </div>
  468. </div>
  469. </div>
  470. </div>
  471. <div class="region-goods-details ">
  472. <div class="region-goods-right col-sm-10">
  473. <!--
  474. <?php if( empty($community_head_level) || count($community_head_level) ==1 || $is_head_takegoods ==0 ){ ?>
  475. <div class="layui-form-item">
  476. <label class="layui-form-label"></label>
  477. <div class="layui-col-sm-10 ">
  478. <input type="checkbox" id="is_community_head_commission" lay-skin="primary" value="1" name="is_community_head_commission" lay-filter="is_community_head_commission" <?php if( $item['is_community_head_commission']==1){ ?>checked<?php } ?> title="商品启用独立团长提成" />
  479. <br />
  480. <div class="layui-form-mid layui-word-aux" style="margin-left: 155px;" >勾选使用 商品独立团长提成 计算佣金,不勾选则使用 后台——“团长设置”中团长提成比例 计算佣金</div>
  481. </div>
  482. </div>
  483. <div id="head_commission_div2" <?php if( empty($item['is_community_head_commission'])){ ?>style="display:none"<?php } ?> >
  484. <div class="layui-form-item">
  485. <label class="layui-form-label">商品独立团长提成</label>
  486. <?php if( !empty($community_money_type) && $community_money_type ==1 ){ ?>
  487. <div class="layui-col-sm-10 ">
  488. <div class="input-group">
  489. <input type="text" name="community_head_commission" id="community_head_commission" class="form-control valid" value="<?php if(empty($item)){ ?>{$communityhead_commission}<?php }else{ ?>{$item['community_head_commission']}<?php } ?>" />
  490. <span class="input-group-addon">元 </span>
  491. </div>
  492. <div class="layui-form-mid layui-word-aux">预计团长可得佣金¥<font ><?php if(isset($item['community_head_commission'])){ ?>{:round( $item['community_head_commission'] ,2) }<?php }else{ ?>0.00<?php } ?></font></div>
  493. </div>
  494. <?php }else{ ?>
  495. <div class="layui-col-sm-10 ">
  496. <div class="input-group">
  497. <input type="text" name="community_head_commission" id="community_head_commission" class="form-control valid" value="<?php if( empty($item)){ ?>{$communityhead_commission}<?php }else{ ?>{$item['community_head_commission']}<?php } ?>" />
  498. <span class="input-group-addon">% </span>
  499. </div>
  500. <div class="layui-form-mid layui-word-aux">预计团长可得佣金¥<font id="precommiss_head_money_tip"><?php if( isset($item['community_head_commission'])){ ?><?php echo round( ($item['community_head_commission']*$item['price'])/100 ,2); ?><?php }else{ ?>0.00<?php } ?></font>,将根据商品最终的成交价格来计算佣金</div>
  501. </div>
  502. <?php } ?>
  503. </div>
  504. </div>
  505. <?php } ?> -->
  506. <!--<div class="layui-form-item">
  507. <label class="layui-form-label">所有团长可销售</label>
  508. <div class="layui-input-block ">
  509. <input type="checkbox" lay-skin="primary" name="is_all_sale" class="form-control valid" <?php if( empty($item) || $item['is_all_sale'] ==1 || !isset($item['is_all_sale'])){ ?>checked<?php } ?> value="1" />
  510. </div>
  511. </div>-->
  512. <?php if($supply_can_distribution_sale == 1){ ?>
  513. <div class="layui-form-item">
  514. <label class="layui-form-label">售卖团长</label>
  515. <div class="layui-input-block">
  516. <label class="radio-inline"><input type="radio" class="radio_sale" name="is_all_sale" value="1" <?php if( !isset($item['is_all_sale']) || $item['is_all_sale'] == 1){ ?>checked="true"<?php } ?> title="所有团长可售" /> </label>
  517. <label class="radio-inline"><input type="radio" class="radio_sale" name="is_all_sale" value="0" <?php if( isset($item['is_all_sale']) && $item['is_all_sale'] == 0){ ?>checked="true"<?php } ?> title="部分团长可售" /> </label>
  518. </div>
  519. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">选择所有团长可售,部分团长可售失效</div>
  520. </div>
  521. <?php } ?>
  522. <?php if($is_newbuy){ ?>
  523. <div class="layui-form-item">
  524. <label class="layui-form-label">新人专享</label>
  525. <div class="layui-input-block ">
  526. <input type="checkbox" id="xinrenckbox" lay-filter="xinrenckbox" lay-skin="primary" name="is_new_buy" class="form-control valid" <?php if( !empty($item) && $item['is_new_buy'] ==1 ){ ?>checked<?php } ?> value="1" />
  527. </div>
  528. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">未付款过的用户。勾选后,只在首页新人专区显示</div>
  529. </div>
  530. <?php } ?>
  531. <?php if( $seckill_is_open == 1 ){ ?>
  532. <div class="layui-form-item">
  533. <label class="layui-form-label">整点秒杀</label>
  534. <div class="layui-input-block ">
  535. <input type="checkbox" id="is_seckill" lay-filter="is_seckill" lay-skin="primary" name="is_seckill" class="form-control valid" <?php if( !empty($item) && $item['is_seckill'] ==1 ){ ?>checked<?php } ?> value="1" />
  536. </div>
  537. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">
  538. 勾选后,商品团购时间设置整点,后台——营销——整点秒杀勾选这个整点,系统会自动调用显示到“整点秒杀”方块以及该页面中。该整点开始前设置好这些,才会调用
  539. </div>
  540. </div>
  541. <?php } ?>
  542. <?php if($is_goodsspike){ ?>
  543. <div class="layui-form-item">
  544. <label class="layui-form-label">限时秒杀</label>
  545. <div class="layui-input-block ">
  546. <input type="checkbox" id="xianshickbox" lay-filter="xianshickbox" lay-skin="primary" name="is_spike_buy" class="form-control valid" <?php if(!empty($item) && $item['is_spike_buy'] ==1){ ?>checked<?php } ?> value="1" />
  547. </div>
  548. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">
  549. 勾选后,只在首页限时秒杀显示
  550. </div>
  551. </div>
  552. <?php } ?>
  553. <div class="layui-form-item">
  554. <label class="layui-form-label">限制普通会员下单</label>
  555. <div class="layui-input-block ">
  556. <input type="checkbox" lay-skin="primary" name="is_limit_levelunbuy" class="form-control valid" <?php if( !empty($item) && $item['is_limit_levelunbuy'] ==1 ){ ?>checked<?php } ?> value="1" />
  557. </div>
  558. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">
  559. 勾选后,默认等级会员不能购买此商品
  560. </div>
  561. </div>
  562. <div class="layui-form-item">
  563. <label class="layui-form-label">付费会员专享</label>
  564. <div class="layui-input-block ">
  565. <input type="checkbox" lay-skin="primary" name="is_limit_vipmember_buy" class="form-control valid" <?php if( !empty($item) && $item['is_limit_vipmember_buy'] ==1 ){ ?>checked<?php } ?> value="1" />
  566. </div>
  567. <div class="layui-form-mid layui-word-aux" style="margin-left:15px;">
  568. 勾选后,非vip会员不能购买此商品
  569. </div>
  570. </div>
  571. </div>
  572. </div>
  573. <?php if( !defined('ROLE') ){
  574. ?>
  575. <div class="region-goods-details ">
  576. <div class="layui-form-item">
  577. <label class="layui-form-label">选择供应商</label>
  578. <div class="layui-input-block">
  579. <div class="input-group " style="margin: 0;">
  580. <input type="text" disabled value="{$item['supply_id']}" class="form-control valid" name="supply_id" placeholder="" id="member_id">
  581. <span class="input-group-btn">
  582. <span data-input="#member_id" id="chose_member_id" class="btn btn-default">选择供应商</span>
  583. </span>
  584. </div>
  585. <?php if( $item['supply_info']){ ?>
  586. <div class="input-group " style="margin: 0;">
  587. <div class="layadmin-text-center choose_user">
  588. <img style="" src="{:tomedia($item['supply_info']['logo'])}">
  589. <div class="layadmin-maillist-img" style="">{$item['supply_info']['shopname']}</div>
  590. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this,'member_id')"><i class="layui-icon">&#xe640;</i></button>
  591. </div>
  592. </div>
  593. <?php } ?>
  594. </div>
  595. </div>
  596. </div>
  597. <?php } ?>
  598. <script language="javascript">
  599. function validationNumber(e, num) {
  600. var regu = /^[\-0-9]+\.?[0-9]*$/;
  601. if (e.value != "") {
  602. if (!regu.test(e.value)) {
  603. e.value = 1;
  604. e.focus();
  605. } else {
  606. if (num == 0) {
  607. if (e.value.indexOf('.') > -1) {
  608. e.value = e.value.substring(0, e.value.length - e.value.split('.')[1].length - 1);
  609. e.focus();
  610. }
  611. }
  612. if (e.value.indexOf('.') > -1) {
  613. if (e.value.split('.')[1].length > num) {
  614. e.value = e.value.substring(0, e.value.length - e.value.split('.')[1].length - 1);
  615. e.focus();
  616. }
  617. }
  618. if(parseFloat(e.value) < 1){
  619. e.value = 1;
  620. e.focus();
  621. }
  622. }
  623. }
  624. }
  625. function reduction(obj){
  626. var goods_start_count = $.trim($('.goods_start_count').val());
  627. if(goods_start_count == ''){
  628. $('.goods_start_count').val(1);
  629. }else{
  630. var count = parseInt(goods_start_count)-1;
  631. if(count < 1){
  632. $('.goods_start_count').val(1);
  633. }else{
  634. $('.goods_start_count').val(count);
  635. }
  636. }
  637. }
  638. function add(obj){
  639. var goods_start_count = $.trim($('.goods_start_count').val());
  640. if(goods_start_count == ''){
  641. $('.goods_start_count').val(1);
  642. }else{
  643. var count = parseInt(goods_start_count)+1;
  644. $('.goods_start_count').val(count);
  645. }
  646. }
  647. $(function () {
  648. $('#price').blur(function(){
  649. var price = parseFloat( $("#price").val() );
  650. var community_head_commission = parseFloat( $("#community_head_commission").val() );
  651. if(price > 0 && community_head_commission >0)
  652. {
  653. $('#precommiss_head_money_tip').html( ( (price * community_head_commission) /100 ).toFixed(2) );
  654. }else{
  655. $('#precommiss_head_money_tip').html('0.00');
  656. }
  657. })
  658. $("#community_head_commission").blur(function(){
  659. var price = parseFloat( $("#price").val() );
  660. var community_head_commission = parseFloat( $(this).val() );
  661. if(price > 0 && community_head_commission >0)
  662. {
  663. $('#precommiss_head_money_tip').html( ( (price * community_head_commission) /100 ).toFixed(2) );
  664. }else{
  665. $('#precommiss_head_money_tip').html('0.00');
  666. }
  667. });
  668. $('#radPickupDateTip input[type=radio]').click(function(){
  669. var s_val = $(this).val();
  670. if(s_val == 3)
  671. {
  672. $('#txtPickupDateTip').css('display','inline-block');
  673. }else{
  674. $('#txtPickupDateTip').css('display', 'none');
  675. }
  676. })
  677. $("input[name=isstatustime]").off('click').on('click',function () {
  678. if($(this).val()==1){
  679. $("#shelves").show()
  680. }else{
  681. $("#shelves").hide();
  682. }
  683. })
  684. })
  685. </script>
  686. <!--- 基本信息 end -->
  687. </div>
  688. <div class="layui-tab-item <?php if( $_GPC['tab']=='option'){ ?>layui-show<?php } ?>" >
  689. <!--规格begin-->
  690. <div class="region-goods-details ">
  691. <div class="region-goods-left col-sm-2">规格库存</div>
  692. <div class="region-goods-right col-sm-10">
  693. <div class="layui-form-item">
  694. <label class="layui-form-label">商品编码</label>
  695. <div class="layui-input-block">
  696. <input type="text" name="codes" class="form-control" value="{$item['codes']}" />
  697. <div class="help-block">商品编码 用部分商家用于统计</div>
  698. </div>
  699. </div>
  700. <div class="layui-form-item">
  701. <label class="layui-form-label">重量</label>
  702. <div class="layui-input-block">
  703. <div class="input-group fixsingle-input-group">
  704. <input type="text" name="weight" id="weight" <?php if( $item['hasoption']){ ?>readonly<?php } ?> class="form-control hasoption" value="{$item['weight']}"/>
  705. <span class="input-group-addon">克</span>
  706. </div>
  707. </div>
  708. </div>
  709. <div class="layui-form-item">
  710. <label class="layui-form-label">库存<label style="color:red;font-size:16px;font-weight:900">*</label></label>
  711. <div class="layui-input-block">
  712. <input type="text" name="total" id="total" class="form-control hasoption" lay-verify="" value="{$item['total']}" style="width:150px;display: inline;margin-right: 20px;" <?php if( $item['hasoption']){ ?>readonly<?php } ?>/>
  713. <span class="help-block">商品的剩余数量, 如启用多规格,则此处设置无效.</span>
  714. </div>
  715. </div>
  716. </div>
  717. </div>
  718. <div class="region-goods-details ">
  719. <div class="region-goods-left col-sm-2">
  720. 规格
  721. </div>
  722. <div class="region-goods-right col-sm-10">
  723. <div class="layui-form-item">
  724. <div class="layui-row" style=''>
  725. <input type="checkbox" lay-skin="primary" title="启用商品规格" lay-filter="hasoption" value="1" id="hasoption" name="hasoption" <?php if( $item['hasoption']==1){ ?>checked<?php } ?> />
  726. <span class="help-block">启用商品规格后,商品的价格及库存以商品规格为准,库存设置为0则会到”已售罄“中,手机也不会显示</span>
  727. </div>
  728. </div>
  729. <div id='tboption' style="padding-left:15px;<?php if( $item['hasoption']!=1){ ?>display:none<?php } ?>" >
  730. <div class="alert alert-info" style="display:none;">
  731. 1. 拖动规格可调整规格显示顺序, 更改规格及规格项后请点击下方的【刷新规格项目表】来更新数据。<br/>
  732. 2. 每一种规格代表不同型号,例如颜色为一种规格,尺寸为一种规格,如果设置多规格,手机用户必须每一种规格都选择一个规格项,才能添加购物车或购买。
  733. </div>
  734. <div id='specs'>
  735. <?php foreach( $item['allspecs'] as $spec ){ ?>
  736. <!--spec-->
  737. <div class='spec_item spec_class_{$cur_cate_id}' id="spec_{$spec['id']}" >
  738. <div style='border:1px solid #e7eaec;padding:10px;margin-bottom: 10px;' >
  739. <input name="spec_id[]" type="hidden" class="form-control spec_id" value="{$spec['id']}"/>
  740. <div class="form-group">
  741. <div class="col-sm-12">
  742. <div class='input-group'>
  743. <input name="spec_title[{$spec['id']}]" type="text" class="form-control spec_title" value="{$spec['title']}" placeholder="规格名称 (比如: 颜色)"/>
  744. <div class='input-group-btn'>
  745. <a href="javascript:;" id="add-specitem-{$spec['id']}" specid='{$spec['id']}' class='btn btn-info add-specitem' onclick="addSpecItem('{$spec['id']}')"><i class="fa fa-plus"></i> 添加规格项</a>
  746. <a href="javascript:void(0);" class='btn btn-danger' onclick="removeSpec('{$spec['id']}')"><i class="fa fa-remove"></i></a>
  747. </div>
  748. </div>
  749. </div>
  750. </div>
  751. <div class="form-group">
  752. <div class="col-md-12">
  753. <div id='spec_item_{$spec['id']}' class='spec_item_items'>
  754. <?php foreach( $spec['items'] as $specitem ){ ?>
  755. <!--spec_item begin-->
  756. <div class="spec_item_item" style="float:left;margin:5px;width:250px; position: relative">
  757. <input type="hidden" class="form-control spec_item_show" name="spec_item_show_{$spec['id']}[]" value="{$specitem['show']}" />
  758. <input type="hidden" class="form-control spec_item_id" name="spec_item_id_{$spec['id']}[]" value="{$specitem['id']}" />
  759. <div class="input-group">
  760. <span class="input-group-addon">
  761. <input type="checkbox" lay-skin="primary" <?php if( $specitem['id']>0){ ?>checked<?php } ?> value="1" onclick='showItem(this)'>
  762. </span>
  763. <input type="text" class="form-control spec_item_title" onblur="refreshOptions()" name="spec_item_title_{$spec['id']}[]" VALUE="{$specitem['title']}" />
  764. <span class="input-group-addon spec_item_thumb <?php if( !empty($specitem['thumb'])){ ?>has_thumb<?php } ?>">
  765. <input type='hidden' name="spec_item_thumb_{$spec['id']}[]" value="{$specitem['thumb']}"
  766. />
  767. <img onclick="selectSpecItemImage(this)"
  768. src="<?php if( empty($specitem['thumb'])){ ?><?php }else{ ?>{:resize($specitem['thumb'],100)}<?php } ?>" style='width:100%;'
  769. <?php if( !empty($specitem['thumb'])){ ?>
  770. data-toggle='popover'
  771. data-html ='true'
  772. data-placement='top'
  773. data-trigger ='hover'
  774. data-content="<img src='{:tomedia($specitem['thumb'])}' style='width:100px;height:100px;' />"
  775. <?php } ?>
  776. >
  777. <i class="fa fa-times-circle" <?php if( empty($specitem['thumb'])){ ?>style="display:none"<?php } ?>></i>
  778. </span>
  779. <span class="input-group-addon">
  780. <a href="javascript:;" onclick="removeSpecItem(this)" title='删除'><i class="fa fa-times"></i></a>
  781. <a href="javascript:;" class="fa fa-arrows" title="拖动调整显示顺序" ></a>
  782. </span>
  783. </div>
  784. </div>
  785. <!--spec_item end-->
  786. <?php } ?>
  787. </div>
  788. </div>
  789. </div>
  790. </div>
  791. </div>
  792. <!--end spec-->
  793. <?php } ?>
  794. </div>
  795. <table class="table">
  796. <tr>
  797. <td>
  798. <div class="layui-form-item">
  799. <label class="col-sm-2 control-label">选择已有规格</label>
  800. <div class="col-sm-8 col-xs-12">
  801. <select id="cates2" name='options[]' class="form-control select2" style='width:605px;' multiple='' >
  802. <?php foreach( $spec_list as $c ){ ?>
  803. <option value="{$c['id']}" data-names="{$c['value_str']}">{$c['name']}</option>
  804. <?php } ?>
  805. </select>
  806. </div>
  807. </div>
  808. <td>
  809. </tr>
  810. <tr>
  811. <td>
  812. <h4>
  813. <a href="javascript:;" class='btn btn-primary' id='add-spec' onclick="addSpec()" style="margin-top:10px;margin-bottom:10px;" title="新建规格"><i class='fa fa-plus'></i> 新建规格</a>
  814. <a style="display:none;" href="javascript:;" onclick="refreshOptions();" title="刷新规格项目表" class="btn btn-primary"><i class="fa fa-refresh"></i> 刷新规格项目表</a>
  815. </h4>
  816. </td>
  817. </tr>
  818. <tr style="display: none;" >
  819. <td>
  820. <div class="alert alert-danger">警告:规格数据有变动,请重新点击上方 [刷新规格项目表] 按钮!</div>
  821. </td>
  822. </tr>
  823. </table>
  824. <div class="alert alert-info wholesalewarning" style="display:none;">
  825. </div>
  826. <div id="options" style="padding:0;">{$item['html']}</div>
  827. </div>
  828. </div>
  829. </div>
  830. <input type="hidden" name="optionArray" value=''>
  831. <input type="hidden" name="isdiscountDiscountsArray" value=''>
  832. <input type="hidden" name="discountArray" value=''>
  833. <input type="hidden" name="commissionArray" value=''>
  834. <!--规格end-->
  835. </div>
  836. <div class="layui-tab-item <?php if( $_GPC['tab']=='des'){ ?>layui-show<?php } ?>" >
  837. <div class="region-goods-details row">
  838. <div class="region-goods-left col-sm-2">商品详情</div>
  839. <div class=" region-goods-right col-sm-10">
  840. <div class="" >
  841. {:tpl_ueditor('content',htmlspecialchars_decode($item['content']),array('height'=>'300'))}
  842. </div>
  843. </div>
  844. </div>
  845. </div>
  846. <!---团长分销begin --->
  847. <div class="layui-tab-item <?php if( $_GPC['tab']=='community_head_level'){ ?>layui-show<?php } ?>" >
  848. <div class="region-goods-details row">
  849. <div class="region-goods-left col-sm-2">团长提成</div>
  850. <div class="region-goods-right col-sm-10">
  851. <?php if( !empty($community_head_level) && count($community_head_level) > 1 && $is_head_takegoods == 1 ) { ?>
  852. <div class="form-group">
  853. <label class="col-sm-2 control-label">独立规则</label>
  854. <div class="col-sm-9 col-xs-12">
  855. <input type="checkbox" id="is_modify_head_commission" lay-skin="primary" value="1" name="is_modify_head_commission" lay-filter="is_modify_head_commission" <?php if( $item['is_modify_head_commission']==1){ ?>checked<?php } ?> title="启用独立团长提成" />
  856. <span class="help-block">默认使用团长等级提成设置,启用独立团长提成设置,此商品拥有独自的团长提成比例,不受团长等级比例及默认设置限制,团长提成 = 订单有效金额 * 设置比例</span>
  857. </div>
  858. </div>
  859. <div id="head_commission_div" <?php if( empty($item['is_modify_head_commission'])){ ?>style="display:none"<?php } ?> >
  860. <?php foreach($community_head_level as $head_level){ ?>
  861. <div class="form-group">
  862. <label class="col-sm-2 control-label"><?php echo $head_level['levelname']; ?></label>
  863. <div class="col-sm-4 col-xs-12">
  864. <div class="input-group">
  865. <input type="text" name="head_level<?php echo $head_level['id']; ?>" class="form-control" value="<?php echo $item['head_level'.$head_level['id']]; ?>" />
  866. <?php if( !empty($community_money_type) && $community_money_type ==1 ){ ?>
  867. <div class="input-group-addon">元 </div>
  868. <?php }else{ ?>
  869. <div class="input-group-addon">%</div>
  870. <?php } ?>
  871. </div>
  872. </div>
  873. </div>
  874. <?php } ?>
  875. </div>
  876. <?php } ?>
  877. <?php if( empty($community_head_level) || count($community_head_level) ==1 || $is_head_takegoods ==0 ){ ?>
  878. <div class="form-group">
  879. <label class="col-sm-2 control-label">独立规则</label>
  880. <div class="col-sm-9 col-xs-12">
  881. <input type="checkbox" id="is_community_head_commission" lay-skin="primary" value="1" name="is_community_head_commission" lay-filter="is_community_head_commission" <?php if( $item['is_community_head_commission']==1){ ?>checked<?php } ?> title="商品启用独立团长提成" />
  882. <br />
  883. <span class="help-block">勾选后此处优先生效,不勾选则使用 后台——“团长设置”中团长提成比例 计算佣金</span>
  884. </div>
  885. </div>
  886. <div id="head_commission_div2" <?php if( empty($item['is_community_head_commission'])){ ?>style="display:none"<?php } ?> >
  887. <div class="form-group">
  888. <label class="col-sm-2 control-label">商品独立团长提成</label>
  889. <?php if( !empty($community_money_type) && $community_money_type ==1 ){ ?>
  890. <div class="col-sm-4 col-xs-12">
  891. <div class="input-group">
  892. <input type="text" name="community_head_commission" id="community_head_commission" class="form-control valid" value="<?php if(empty($item)){ ?>{$communityhead_commission}<?php }else{ ?>{$item['community_head_commission']}<?php } ?>" />
  893. <span class="input-group-addon">元 </span>
  894. </div>
  895. <div class="layui-form-mid layui-word-aux">预计团长可得佣金¥<font ><?php if(isset($item['community_head_commission'])){ ?>{:round( $item['community_head_commission'] ,2) }<?php }else{ ?>0.00<?php } ?></font></div>
  896. </div>
  897. <?php }else{ ?>
  898. <div class="col-sm-4 col-xs-12">
  899. <div class="input-group">
  900. <input type="text" name="community_head_commission" id="community_head_commission" class="form-control valid" value="<?php if( empty($item)){ ?>{$communityhead_commission}<?php }else{ ?>{$item['community_head_commission']}<?php } ?>" />
  901. <span class="input-group-addon">% </span>
  902. </div>
  903. <div class="layui-form-mid layui-word-aux">预计团长可得佣金¥<font id="precommiss_head_money_tip"><?php if( isset($item['community_head_commission'])){ ?><?php echo round( ($item['community_head_commission']*$item['price'])/100 ,2); ?><?php }else{ ?>0.00<?php } ?></font>,将根据商品最终的成交价格来计算佣金</div>
  904. </div>
  905. <?php } ?>
  906. </div>
  907. </div>
  908. <?php } ?>
  909. </div>
  910. </div>
  911. <?php if($commiss_level > 0){ ?>
  912. <div class="region-goods-details row">
  913. <div class="region-goods-left col-sm-2">会员分销</div>
  914. <div class="region-goods-right col-sm-10">
  915. <div class="form-group">
  916. <label class="col-sm-2 control-label">是否参与分销</label>
  917. <div class="col-sm-9 col-xs-12">
  918. <input type="radio" value="0" name="nocommission" <?php if($item['nocommission']==0){ ?>checked<?php } ?> title="参与分销" />
  919. <input type="radio" value="1" name="nocommission" <?php if($item['nocommission']==1){ ?>checked<?php } ?> title="不参与分销" />
  920. <span class="help-block">如果不参与分销,则不产生分销佣金</span>
  921. </div>
  922. </div>
  923. <div class="form-group">
  924. <label class="col-sm-2 control-label">独立规则</label>
  925. <div class="col-sm-9 col-xs-12">
  926. <input type="checkbox" lay-filter="hascommission" lay-skin="primary" id="hascommission" value="1" name="hascommission" <?php if($item['hascommission']==1){ ?>checked<?php } ?> title="启用独立佣金比例" />
  927. <span class="help-block">启用独立佣金设置,此商品拥有独自的佣金比例,不受分销商等级比例及默认设置限制</span>
  928. </div>
  929. </div>
  930. <div style="clear:both;"></div>
  931. <div id="commission_div" <?php if(empty($item['hascommission'])){ ?>style="display:none"<?php } ?> >
  932. <div id="commission_0" <?php if($commission_type!=0){ ?> style="display:none;" <?php } ?>>
  933. <div class='alert alert-danger'>
  934. 如果比例为空,则使用固定规则,如果都为空则无分销佣金,都填写则以比例优先
  935. </div>
  936. <?php if($set['commiss_level']>=1){ ?>
  937. <div class="form-group">
  938. <label class="col-sm-2 control-label">一级分销</label>
  939. <div class="col-sm-4 col-xs-12">
  940. <div class="input-group">
  941. <input type="text" name="commission1_rate" id="commission1_rate" class="form-control" value="{$item['commission1_rate']}" />
  942. <div class="input-group-addon">% 固定</div>
  943. <input type="text" name="commission1_pay" id="commission1_pay" class="form-control" value="{$item['commission1_pay']}" />
  944. <div class="input-group-addon">元</div>
  945. </div>
  946. </div>
  947. </div>
  948. <?php } ?>
  949. <?php if($set['commiss_level']>=2){ ?>
  950. <div class="form-group">
  951. <label class="col-sm-2 control-label">二级分销</label>
  952. <div class="col-sm-4 col-xs-12">
  953. <div class="input-group">
  954. <input type="text" name="commission2_rate" id="commission2_rate" class="form-control" value="{$item['commission2_rate']}" />
  955. <div class="input-group-addon">% 固定</div>
  956. <input type="text" name="commission2_pay" id="commission2_pay" class="form-control" value="{$item['commission2_pay']}" />
  957. <div class="input-group-addon">元</div>
  958. </div>
  959. </div>
  960. </div>
  961. <?php } ?>
  962. <?php if($set['commiss_level']>=3){ ?>
  963. <div class="form-group">
  964. <label class="col-sm-2 control-label">三级分销</label>
  965. <div class="col-sm-4 col-xs-12">
  966. <div class="input-group">
  967. <input type="text" name="commission3_rate" id="commission3_rate" class="form-control" value="{$item['commission3_rate']}" />
  968. <div class="input-group-addon">% 固定</div>
  969. <input type="text" name="commission3_pay" id="commission3_pay" class="form-control" value="{$item['commission3_pay']}" />
  970. <div class="input-group-addon">元</div>
  971. </div>
  972. </div>
  973. </div>
  974. <?php } ?>
  975. </div>
  976. </div>
  977. </div>
  978. </div>
  979. <?php } ?>
  980. <div class="region-goods-details row">
  981. <div class="region-goods-left col-sm-2">会员等级折扣</div>
  982. <div class="region-goods-right col-sm-10">
  983. <div class="form-group">
  984. <label class="col-sm-2 control-label">是否参与会员折扣</label>
  985. <div class="col-sm-9 col-xs-12">
  986. <input type="radio" value="1" name="is_mb_level_buy" <?php if(!isset($item['is_mb_level_buy']) || $item['is_mb_level_buy']==1){ ?>checked<?php } ?> title="参与" />
  987. <input type="radio" value="0" name="is_mb_level_buy" <?php if($item['is_mb_level_buy']==0){ ?>checked<?php } ?> title="不参与" />
  988. <span class="help-block">如果不参与会员折扣,则不打折</span>
  989. </div>
  990. </div>
  991. <div class="form-group">
  992. <label class="col-sm-2 control-label">独立规则</label>
  993. <div class="col-sm-9 col-xs-12">
  994. <input type="checkbox" lay-filter="has_mb_level_buy" lay-skin="primary" id="has_mb_level_buy" value="1" name="has_mb_level_buy" <?php if($item['has_mb_level_buy']==1){ ?>checked<?php } ?> title="启用独立折扣比例" />
  995. <span class="help-block">启用独立折扣设置,此商品拥有独立的会员等级折扣比例,不受会员等级折扣设置限制</span>
  996. </div>
  997. </div>
  998. <div style="clear:both;"></div>
  999. <div id="mb_level_div" <?php if(empty($item['has_mb_level_buy'])){ ?>style="display:none"<?php } ?> >
  1000. <div id="mb_level_tip">
  1001. <div class='alert alert-danger'>
  1002. 请填写1-99的<span style="color:red">整数</span>,100不打折。例如:80,打八折,该会员对应等级会员价=商品现价*80%
  1003. <?php if( empty($member_level_ist) ){ ?>
  1004. <br>
  1005. <span style="color:red">暂无会员等级,请前往会员--》会员等级 添加会员等级</span>
  1006. <?php } ?>
  1007. </div>
  1008. </div>
  1009. <?php foreach($member_level_ist as $k=>$v){?>
  1010. <div class="form-group">
  1011. <label class="col-sm-2 control-label"><?php echo $v['levelname']?></label>
  1012. <div class="col-sm-4 col-xs-4">
  1013. <div class="input-group">
  1014. <input type="hidden" name="level_id[]" class="form-control" value="<?php echo $v['id']?>" />
  1015. <input type="text" name="discount[]" class="form-control" value="<?php echo $mb_level_discount_list[$v['id']];?>" />
  1016. <div class="input-group-addon">% </div>
  1017. </div>
  1018. </div>
  1019. </div>
  1020. <?php }?>
  1021. </div>
  1022. </div>
  1023. </div>
  1024. <!--团长分销end--->
  1025. </div>
  1026. <?php if( !empty($is_open_goods_relative_goods) && $is_open_goods_relative_goods == 1 ){ ?>
  1027. <div class="layui-tab-item <?php if( $_GPC['tab']=='goods_relative_goods'){ ?>layui-show<?php } ?>" >
  1028. <div class="region-goods-details row">
  1029. <div class="region-goods-left col-sm-2">推荐商品</div>
  1030. <div class=" region-goods-right col-sm-10">
  1031. <div class="input-group " style="margin: 0;">
  1032. <input type="text" disabled value="" class="form-control valid" name="" placeholder="" id="agent_id">
  1033. <span class="input-group-btn">
  1034. <span data-input="#agent_id" id="chose_agent_id2" class="btn btn-default">选择商品</span>
  1035. </span>
  1036. </div>
  1037. <?php if(!empty($limit_goods)){ ?>
  1038. <?php foreach( $limit_goods as $goods ){ ?>
  1039. <div class="input-group mult_choose_goodsid" data-gid="{$goods['gid']}" style="border-radius: 0;float: left;margin: 10px;margin-left:0px;width: 22%;">
  1040. <div class="layadmin-text-center choose_user">
  1041. <img style="" src="{$goods['image']}">
  1042. <div class="layadmin-maillist-img" style="">{$goods['goodsname']}</div>
  1043. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this)">
  1044. <i class="layui-icon"></i>
  1045. </button>
  1046. </div>
  1047. </div>
  1048. <?php }} ?>
  1049. </div>
  1050. </div>
  1051. </div>
  1052. <?php } ?>
  1053. <?php if( $open_goods_distribution == 1 ) { ?>
  1054. <div class="layui-tab-item <?php if( $_GPC['tab']=='goods_distribution'){ ?>layui-show<?php } ?>" >
  1055. <div class="region-goods-details row">
  1056. <div class="region-goods-left col-sm-2">同城配送</div>
  1057. <div class=" region-goods-right col-sm-10">
  1058. <div class="form-group">
  1059. <label class="col-sm-2 control-label">同城配送</label>
  1060. <div class="col-sm-4 col-xs-12 col-md-10">
  1061. <div class="input-group">
  1062. <input type="checkbox" lay-skin="primary" id="is_only_distribution" name="is_only_distribution" lay-filter="is_only_distribution" <?php if(isset($item['is_only_distribution']) && $item['is_only_distribution'] ==1 ){ ?> checked <?php } ?> value="1" />
  1063. </div>
  1064. <span style="color:#999!important;">勾选后该商品会在购物车中显示同城配送,所有同城配送的商品单独结算,订单提交只有同城配送方式</span><br />
  1065. <span style="color:red">勾选后,此商品为同城配送商品。会自动取消仅快递和到店核销的勾选</span>
  1066. </div>
  1067. </div>
  1068. <div class="form-group">
  1069. <label class="col-sm-2 control-label">包装费</label>
  1070. <div class="col-sm-4 col-xs-12">
  1071. <div class="input-group">
  1072. <input type="text" name="packing_free" id="packing_free" class="form-control" value="<?php if( !isset($item['packing_free']) ){ ?>0<?php }else{ ?>{$item['packing_free']}<?php } ?>" />
  1073. <div class="input-group-addon">元</div>
  1074. </div>
  1075. <span style="color:#999!important;">零元表示没有包装费这一项</span>
  1076. </div>
  1077. </div>
  1078. </div>
  1079. </div>
  1080. </div>
  1081. <?php } ?>
  1082. <div class="layui-tab-item <?php if( $_GPC['tab']=='hexiao'){ ?>layui-show<?php } ?>" >
  1083. <div class="region-goods-details row">
  1084. <div class="region-goods-left col-sm-2">到店核销</div>
  1085. <div class="region-goods-right col-sm-10">
  1086. <?php if(empty($is_exist_salesroom)){ ?>
  1087. <div class="form-group" style="margin: 20px;">
  1088. <div class="col-sm-12 col-xs-12 col-md-12">
  1089. <span style="color:red;">“到店核销”功能需要与门店信息配合使用,您暂无设置门店信息,请先<a href="{:U('salesroom/index')}" style="color:#428bca;">去添加</a>门店信息然后再进行到店核销设置</span>
  1090. </div>
  1091. </div>
  1092. <?php }else{ ?>
  1093. <div class="form-group">
  1094. <label class="col-sm-2 control-label">到店核销</label>
  1095. <div class="col-sm-4 col-xs-12 col-md-10">
  1096. <div class="input-group">
  1097. <input type="checkbox" lay-skin="primary" name="is_only_hexiao" id="is_only_hexiao" lay-filter="is_only_hexiao" <?php if(isset($item['is_only_hexiao']) && $item['is_only_hexiao'] ==1 ){ ?> checked <?php } ?> value="1" />
  1098. </div>
  1099. <span style="color:#999!important;">勾选后该商品会在购物车中显示核销商品,所有核销商品单独结算,订单提交只有到店核销方式</span><br />
  1100. <span style="color:red">勾选后,此商品为到店核销商品。会自动取消仅快递和同城配送的勾选</span>
  1101. </div>
  1102. </div>
  1103. <div class="form-group">
  1104. <label class="col-sm-2 control-label">核销方式</label>
  1105. <div class="col-sm-9 col-xs-12">
  1106. <input type="radio" value="0" name="hexiao_type" lay-filter="hexiao_type" <?php if(!isset($item['hexiao_type']) || $item['hexiao_type'] == 0){ ?>checked<?php } ?> title="订单核销" />
  1107. <input type="radio" value="1" name="hexiao_type" lay-filter="hexiao_type" <?php if(isset($item['hexiao_type']) && $item['hexiao_type'] == 1){ ?>checked<?php } ?> title="自定义核销次数" />
  1108. <span class="help-block" style="font-size: 12px;<?php if(!isset($item['hexiao_type']) || $item['hexiao_type'] == 0){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>" id="hexiao_type_0">核销一次后即过期</span>
  1109. <span class="help-block" style="font-size: 12px;margin-left:120px;<?php if(isset($item['hexiao_type']) && $item['hexiao_type'] == 1){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>" id="hexiao_type_1">设置的单个到店核销次数核销</span>
  1110. </div>
  1111. </div>
  1112. <div class="form-group" id="hx_goods_time" style="<?php if(isset($item['hexiao_type']) && $item['hexiao_type'] == 1){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>">
  1113. <label class="col-sm-2 control-label"></label>
  1114. <div class="col-sm-9 col-xs-12">
  1115. <div class="col-sm-9 col-xs-12">
  1116. <label class="col-sm-2 control-label">单个到店核销次数</label>
  1117. <div class="col-sm-9 col-xs-12">
  1118. <input type="text" name="hx_one_goods_time" id="hx_one_goods_time" class="form-control" value="{$item['hx_one_goods_time']}" style="width: 500px;"/>
  1119. <span class="help-block" style="font-size: 12px;">单个到店核销次数,不填或填写0及以下为默认不限次数,核销员 “全部核销” 为一次核销完成,管理员订单 “确认使用” 为一次核销完成</span>
  1120. </div>
  1121. </div>
  1122. </div>
  1123. </div>
  1124. <div class="form-group">
  1125. <label class="col-sm-2 control-label">核销有效期</label>
  1126. <div class="col-sm-9 col-xs-12">
  1127. <input type="radio" value="0" name="hx_expire_type" lay-filter="hx_expire_type" <?php if(!isset($item['hx_expire_type']) || $item['hx_expire_type'] == 0){ ?>checked<?php } ?> title="购买后有效期" />
  1128. <input type="radio" value="1" name="hx_expire_type" lay-filter="hx_expire_type" <?php if(isset($item['hx_expire_type']) && $item['hx_expire_type'] == 1){ ?>checked<?php } ?> title="指定过期时间" />
  1129. </div>
  1130. </div>
  1131. <div class="form-group" id="hx_expire_type_0" style="<?php if(!isset($item['hx_expire_type']) || $item['hx_expire_type'] == 0){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>">
  1132. <label class="col-sm-2 control-label"></label>
  1133. <div class="col-sm-9 col-xs-12">
  1134. <div class="col-sm-9 col-xs-12">
  1135. <label class="col-sm-2 control-label">有效天数</label>
  1136. <div class="col-sm-9 col-xs-12">
  1137. <input type="text" name="hx_expire_day" id="hx_expire_day" class="form-control" value="{$item['hx_expire_day']}" style="width: 300px;display: inline-block;"/><span style="margin:5px;">天</span>
  1138. <span class="help-block" style="font-size: 12px;">自购买之日起多少天内有效,不写默认90天</span>
  1139. </div>
  1140. </div>
  1141. </div>
  1142. </div>
  1143. <div class="form-group" id="hx_expire_type_1" style="<?php if(isset($item['hx_expire_type']) && $item['hx_expire_type'] == 1){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>">
  1144. <label class="col-sm-2 control-label"></label>
  1145. <div class="col-sm-9 col-xs-12">
  1146. <div class="col-sm-9 col-xs-12">
  1147. <label class="col-sm-2 control-label">过期时间</label>
  1148. <div class="col-sm-9 col-xs-12">
  1149. <input type="text" name="hx_expire_end_time" id="hx_expire_end_time" class="form-control" value="{$item['hx_expire_end_time']}" lay-filter="hx_expire_end_time" placeholder="yyyy-MM-dd HH:mm:ss" style="width: 300px;"/>
  1150. <span class="help-block" style="font-size: 12px;">在指定过期时间之前才能核销</span>
  1151. </div>
  1152. <label class="col-sm-2 control-label"></label>
  1153. <div class="col-sm-9 col-xs-12 input-group fixsingle-input-group" style="padding-left: 15px;">
  1154. <div class="input-group-addon"><input type="checkbox" lay-skin="primary" name="hx_auto_off" id="hx_auto_off" lay-filter="hx_auto_off" <?php if(!isset($item['hx_auto_off']) || $item['hx_auto_off'] == 1){ ?>checked<?php } ?> value="1" />自动下架商品,提前</div>
  1155. <input class="form-control" name="hx_auto_off_time" id="hx_auto_off_time" type="text" placeholder="" value="<?php if(!isset($item['hx_auto_off'])){?>6<?php }else{ echo $item['hx_auto_off_time'];} ?>">
  1156. <div class="input-group-addon">小时</div>
  1157. </div>
  1158. <label class="col-sm-2 control-label" style="margin-right: 15px;"></label>
  1159. <span class="layui-form-mid layui-word-aux" style="font-size: 12px;">在指定过期时间前多少个小时自动下架,防止已过期商品还可以购买;没勾选,到期自动下架。 </span>
  1160. </div>
  1161. </div>
  1162. </div>
  1163. <div class="form-group">
  1164. <label class="col-sm-2 control-label">指定门店</label>
  1165. <div class="col-sm-9 col-xs-12">
  1166. <input type="radio" value="0" name="hx_assign_salesroom" lay-filter="hx_assign_salesroom" <?php if(!isset($item['hx_assign_salesroom']) || $item['hx_assign_salesroom'] == 0){ ?>checked<?php } ?> title="所有门店" />
  1167. <input type="radio" value="1" name="hx_assign_salesroom" lay-filter="hx_assign_salesroom" <?php if(isset($item['hx_assign_salesroom']) && $item['hx_assign_salesroom'] == 1){ ?>checked<?php } ?> title="指定门店" />
  1168. </div>
  1169. </div>
  1170. <div class="form-group" id="hx_assign_salesroom_1" style="<?php if(isset($item['hx_assign_salesroom']) && $item['hx_assign_salesroom'] == 1){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>">
  1171. <label class="col-sm-2 control-label"></label>
  1172. <div class="col-sm-9 col-xs-12">
  1173. <div class="input-group " style="margin: 0;">
  1174. <input type="text" disabled value="" class="form-control valid" placeholder="" id="salesroom_id">
  1175. <span class="input-group-btn">
  1176. <span data-input="#hexiao_salesroom_list" id="chose_salesroom_id" class="btn btn-default">选择门店</span>
  1177. </span>
  1178. </div>
  1179. <span class="help-block" style="font-size: 12px;">门店下方所有核销人员都可以核销该商品,也可以单独指定门店的核销人员进行核销。</span>
  1180. </div>
  1181. </div>
  1182. <div class="form-group" id="hx_salesroom_list" style="<?php if(isset($item['hx_assign_salesroom']) && $item['hx_assign_salesroom'] == 1){ ?>display:block;<?php }else{ ?>display:none;<?php } ?>">
  1183. <label class="col-sm-2 control-label"></label>
  1184. <div class="col-sm-9 col-xs-12">
  1185. <?php if(isset($item['salesroom_list']) && count($item['salesroom_list']) > 0){ $i = 1;?>
  1186. <?php foreach($item['salesroom_list'] as $rk=>$rv){?>
  1187. <div class="input-group mult_choose_room_list" style="width:100%">
  1188. <div class="input-group mult_choose_roomid" data-roomid="<?php echo $rv['salesroom_id']; ?>" style="border-radius: 0;margin: 10px;margin-left:0px;">
  1189. <div class="choose_room_title">指定门店<?php echo $i;$i++;?></div>
  1190. <div class="layadmin-text-center choose_user">
  1191. <img style="" src="<?php echo tomedia($rv['room_logo']);?>">
  1192. <div class="layadmin-maillist-img" style=""><?php echo $rv['room_name']; ?></div>
  1193. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_room_bind(this)">
  1194. <i class="layui-icon"></i>
  1195. </button>
  1196. </div>
  1197. </div>
  1198. <div class="input-group" style="margin-top: 10px;">
  1199. <input type="checkbox" class="is_hx_member" lay-filter="is_hx_member" lay-skin="primary" name="is_hx_member" value="1" title="是否指定核销人员" <?php if(isset($rv['is_hx_member']) && $rv['is_hx_member'] == 1){ ?>checked<?php } ?>>
  1200. <div class="layui-unselect layui-form-checkbox" lay-skin="primary">
  1201. <span>是否指定核销人员</span>
  1202. <i class="layui-icon layui-icon-ok"></i>
  1203. </div>
  1204. </div>
  1205. <div class="input-group selectHxMember" style="margin-top: 10px;<?php if(empty($rv['smember_list'])){ ?>display:none;<?php } ?>">
  1206. <input type="text" disabled="" value="" class="form-control valid" name="smember_id" placeholder="">
  1207. <span class="input-group-btn">
  1208. <span data-input="#hexiao_smember_list_<?php echo $rv['salesroom_id']; ?>" class="btn btn-default chose_smember_id">选择核销人员</span>
  1209. </span>
  1210. </div>
  1211. <div class="form-group hx_smember_list" id="hx_smember_list" style="<?php if(empty($rv['smember_list'])){ ?>display:none;<?php } ?>">
  1212. <div class="col-sm-12 col-xs-12">
  1213. <div id="hexiao_smember_list_<?php echo $rv['salesroom_id']; ?>"></div>
  1214. <?php if(isset($rv['smember_list']) && count($rv['smember_list']) > 0){?>
  1215. <?php foreach($rv['smember_list'] as $mk=>$mv){?>
  1216. <div class="input-group mult_choose_smemberid" data-smemberid="<?php echo $mv['smember_id']; ?>" style="border-radius: 0;float: left;margin: 10px;margin-left:0px;">
  1217. <div class="layadmin-text-center choose_user">
  1218. <img src="<?php echo $mv['avatar']; ?>" style="padding1px;border:1px solid #ccc">
  1219. <div class="layadmin-maillist-img" style=""><?php echo $mv['username']; ?></div>
  1220. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this)">
  1221. <i class="layui-icon"></i>
  1222. </button>
  1223. </div>
  1224. </div>
  1225. <?php } ?>
  1226. <?php } ?>
  1227. </div>
  1228. </div>
  1229. </div>
  1230. <?php } ?>
  1231. <?php } ?>
  1232. <div id="hexiao_salesroom_list"></div>
  1233. </div>
  1234. </div>
  1235. <?php } ?>
  1236. <!--
  1237. <div class="form-group">
  1238. <label class="col-sm-2 control-label"></label>
  1239. <div class="col-sm-9 col-xs-12">
  1240. <input type="button" value="测试按钮" class="btn btn-primary hexiao_btn" />
  1241. </div>
  1242. </div>-->
  1243. </div>
  1244. </div>
  1245. </div>
  1246. </div>
  1247. <script>
  1248. $(function(){
  1249. $(".select2").select2({
  1250. placeholder:'请选择',
  1251. allowClear:true
  1252. })
  1253. })
  1254. </script>
  1255. <div class="layui-form-item">
  1256. <label class="layui-form-label"> </label>
  1257. <div class="layui-input-block">
  1258. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  1259. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1260. <a class="btn btn-default" style='margin-left:10px;' href="{:U('goods/index' , array( 'ok' => 1))}">返回列表</a>
  1261. </div>
  1262. </div>
  1263. </form>
  1264. </div>
  1265. </div>
  1266. </div>
  1267. <div id="batchheads" style="z-index: 999;display: none;position: fixed;top: 0;left: 0;right: 0;bottom: 0;background: rgba(0,0,0,0.5)" class="form-horizontal form-validate batchcates" enctype="multipart/form-data">
  1268. <div class="modal-dialog" style="position: absolute;margin-top: -300px">
  1269. <div class="modal-content">
  1270. <div class="modal-header" style="padding:5px;">
  1271. <button data-dismiss="modal" class="close" type="button">×</button>
  1272. <h4 class="modal-title">选取团长</h4>
  1273. </div>
  1274. <div class="modal-body" style="height:600px">
  1275. <div class="form-group">
  1276. <label class="col-sm-2 control-label">社区位置</label>
  1277. <div class="col-sm-10 col-xs-12">
  1278. <p>
  1279. <select id="sel-provance" name="province_id" onChange="selectCity();" class="select form-control" style="width:160px;display:inline;">
  1280. <option value="" selected="true">省/直辖市</option>
  1281. </select>
  1282. <select id="sel-city" name="city_id" onChange="selectcounty(0)" class="select form-control" style="width:160px;display:inline;">
  1283. <option value="" selected="true">请选择</option>
  1284. </select>
  1285. <select id="sel-area" name="area_id" onChange="selectstreet(0)" class="select form-control" style="width:160px;display:inline;">
  1286. <option value="" selected="true">请选择</option>
  1287. </select>
  1288. <select id="sel-street" name="country_id" class="select form-control" style="width:160px;display:inline;">
  1289. <option value="" selected="true">请选择</option>
  1290. </select>
  1291. </p>
  1292. </div>
  1293. </div>
  1294. <div class="form-group">
  1295. <label class="col-sm-2 control-label">团长名称</label>
  1296. <div class="col-sm-10 col-xs-12">
  1297. <div class="input-group">
  1298. <input type="text" class="form-control" name="keyword" id="supply_id_input" placeholder="团长名称/团长手机号/社区地址">
  1299. <span class="input-group-btn">
  1300. <button type="button" class="btn btn-default" onclick="search_heads()">搜索</button>
  1301. </span>
  1302. </div>
  1303. </div>
  1304. </div>
  1305. <div class="form-group">
  1306. <div class="col-sm-1 control-label">
  1307. </div>
  1308. <div class="col-sm-10 col-xs-12">
  1309. <div class="page-table-header">
  1310. <input type="checkbox" class="check_heads_all">
  1311. <div class="btn-group">
  1312. 全选/反选
  1313. </div>
  1314. <br/>
  1315. <label><input type="checkbox" class="is_cancle_old" id="is_cancle_old" style="vertical-align: text-bottom;">
  1316. <div class="btn-group" style="color:#666;">
  1317. 同时取消以前所有分配
  1318. </div>
  1319. </label>
  1320. &nbsp;&nbsp;&nbsp;&nbsp;
  1321. <label><input type="checkbox" class="is_cancle_allhead" id="is_cancle_allhead" style="vertical-align: text-bottom;">
  1322. <div class="btn-group" style="color:#666;">
  1323. 同时取消商品 “所有团长可售”
  1324. </div>
  1325. </label>
  1326. </div>
  1327. </div>
  1328. </div>
  1329. <div class="row">
  1330. <label class="col-sm-1 control-label"></label>
  1331. <div class="col-sm-11 col-xs-12">
  1332. <div class="content" style="padding-top:5px;" data-name="supply_id">
  1333. <div style="max-height:410px;overflow:auto;" id="batchheads_content">
  1334. </div>
  1335. <div class="" id="batchheads_page">
  1336. </div>
  1337. </div>
  1338. </div>
  1339. </div>
  1340. </div>
  1341. <div class="modal-footer">
  1342. <button class="btn btn-primary model_heads">确认</button>
  1343. <button class="btn btn-default" >取消</button>
  1344. </div>
  1345. </div>
  1346. </div>
  1347. </div>
  1348. <script src="/layuiadmin/layui/layui.js"></script>
  1349. <script type="text/javascript" src="/static/js/jquery-migrate-1.1.1.js"></script>
  1350. <script src="/static/js/jquery-ui.min.js"></script>
  1351. <style>
  1352. .multi-img-details{width:100%;}
  1353. </style>
  1354. <script>
  1355. layui.config({
  1356. base: '/layuiadmin/' //静态资源所在路径
  1357. }).extend({
  1358. index: 'lib/index' //主入口模块
  1359. }).use('index');
  1360. </script>
  1361. <script>
  1362. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  1363. var layer = layui.layer;
  1364. var $;
  1365. var cur_open_div;
  1366. var form;
  1367. layui.use(['jquery', 'layer','form', 'laydate'], function(){
  1368. $ = layui.$;
  1369. form = layui.form;
  1370. laydate = layui.laydate;
  1371. laydate.render({
  1372. elem: '#hx_expire_end_time'
  1373. ,type: 'datetime'
  1374. ,min: '<?php echo date("Y-m-d H:i:s"); ?>'
  1375. });
  1376. form.on('radio(linktype)', function(data){
  1377. if (data.value == 2) {
  1378. $('#typeGroup').show();
  1379. } else {
  1380. $('#typeGroup').hide();
  1381. }
  1382. });
  1383. form.on('checkbox(is_modify_sendscore)', function(data){
  1384. console.log(data.elem.checked)
  1385. if (data.elem.checked) {
  1386. console.log(12);
  1387. $("#send_score_divTip").css('display','inline');
  1388. $("#send_score_divTip2").css('display','inline');
  1389. } else {
  1390. console.log(33);
  1391. $("#send_score_divTip").hide();
  1392. $("#send_score_divTip2").hide();
  1393. }
  1394. form.render('checkbox');
  1395. });
  1396. form.on('checkbox(xinrenckbox)', function(data){
  1397. if (data.elem.checked) {
  1398. $("#xianshickbox").removeAttr("checked");
  1399. } else {
  1400. }
  1401. form.render('checkbox');
  1402. });
  1403. form.on('checkbox(xianshickbox)', function(data){
  1404. if (data.elem.checked) {
  1405. $("#xinrenckbox").removeAttr("checked");
  1406. } else {
  1407. }
  1408. form.render('checkbox');
  1409. });
  1410. form.on('checkbox(hascommission)', function(data){
  1411. if (data.elem.checked) {
  1412. $('#commission_div').show();
  1413. } else {
  1414. $('#commission_div').hide();
  1415. }
  1416. })
  1417. //hascommission
  1418. form.on('checkbox(has_mb_level_buy)', function(data){
  1419. if (data.elem.checked) {
  1420. $('#mb_level_div').show();
  1421. } else {
  1422. $('#mb_level_div').hide();
  1423. }
  1424. })
  1425. form.on('checkbox(is_hx_member)', function(data){
  1426. if (data.elem.checked) {
  1427. $(this).parent().parent().find('.selectHxMember').show();
  1428. $(this).parent().parent().find('.hx_smember_list').show();
  1429. } else {
  1430. $(this).parent().parent().find('.selectHxMember').hide();
  1431. $(this).parent().parent().find('.hx_smember_list').hide();
  1432. }
  1433. })
  1434. form.on('radio(hexiao_type)', function(data){
  1435. if (data.elem.value == 1) {
  1436. $('#hexiao_type_0').hide();
  1437. $('#hexiao_type_1').show();
  1438. $('#hx_goods_time').show();
  1439. } else {
  1440. $('#hexiao_type_0').show();
  1441. $('#hexiao_type_1').hide();
  1442. $('#hx_goods_time').hide();
  1443. }
  1444. })
  1445. form.on('radio(hx_expire_type)', function(data){
  1446. if (data.elem.value == 1) {
  1447. $('#hx_expire_type_0').hide();
  1448. $('#hx_expire_type_1').show();
  1449. } else {
  1450. $('#hx_expire_type_0').show();
  1451. $('#hx_expire_type_1').hide();
  1452. }
  1453. })
  1454. form.on('radio(hx_assign_salesroom)', function(data){
  1455. if (data.elem.value == 1) {
  1456. $('#hx_assign_salesroom_1').show();
  1457. $('#hx_salesroom_list').show();
  1458. } else {
  1459. $('#hx_assign_salesroom_1').hide();
  1460. $('#hx_salesroom_list').hide();
  1461. }
  1462. })
  1463. //同城配送
  1464. form.on('checkbox(is_only_distribution)', function (data) {
  1465. if (data.elem.checked) {
  1466. $("#is_only_hexiao").removeAttr("checked");
  1467. $("#is_only_express").removeAttr("checked");
  1468. }
  1469. form.render('checkbox');
  1470. });
  1471. //仅快递
  1472. form.on('checkbox(is_only_express)', function (data) {
  1473. if (data.elem.checked) {
  1474. $("#is_only_distribution").removeAttr("checked");
  1475. $("#is_only_hexiao").removeAttr("checked");
  1476. }
  1477. form.render('checkbox');
  1478. });
  1479. //核销
  1480. form.on('checkbox(is_only_hexiao)', function (data) {
  1481. if (data.elem.checked) {
  1482. $("#is_only_distribution").removeAttr("checked");
  1483. $("#is_only_express").removeAttr("checked");
  1484. }
  1485. form.render('checkbox');
  1486. });
  1487. $('#chose_salesroom_id').click(function(){
  1488. var supply_id = $('input[name="supply_id"]').val();
  1489. cur_open_div = $(this).attr('data-input');
  1490. $.post("{:U('salesroom/query', array('template' => 'mult_goods'))}", {supply_id:supply_id}, function(shtml){
  1491. layer.open({
  1492. type: 1,
  1493. area: '930px',
  1494. content: shtml //注意,如果str是object,那么需要字符拼接。
  1495. });
  1496. });
  1497. })
  1498. $('.chose_smember_id').live('click',function(){
  1499. var room_id = $(this).parent().parent().parent().find('.mult_choose_roomid').attr('data-roomid');
  1500. cur_open_div = $(this).attr('data-input');
  1501. var post_url = "{:U('salesroom_member/query', array('template' => 'mult_goods'))}";
  1502. $.post(post_url, {room_id:room_id}, function(shtml){
  1503. layer.open({
  1504. type: 1,
  1505. area: '930px',
  1506. content: shtml //注意,如果str是object,那么需要字符拼接。
  1507. });
  1508. });
  1509. })
  1510. /**
  1511. <?php if($delivery_type_express == 2){?>
  1512. form.on('checkbox(is_only_express111)', function(data){
  1513. if (data.elem.checked) {
  1514. $('#is_only_express').removeAttr("checked");
  1515. layer.msg("启用仅快递配送模式,请在物流设置开启快递配送方式!",{icon: 2,time: 3000});
  1516. }
  1517. form.render('checkbox');
  1518. })
  1519. <?php } ?>
  1520. **/
  1521. $('#chose_label_id').click(function(){
  1522. cur_open_div = $(this).attr('data-input');
  1523. $.post("{:U('goods/labelquery', array('ok' => 1))}", {}, function(shtml){
  1524. layer.open({
  1525. type: 1,
  1526. area: '930px',
  1527. content: shtml //注意,如果str是object,那么需要字符拼接。
  1528. });
  1529. });
  1530. })
  1531. $('#chose_member_id').click(function(){
  1532. cur_open_div = $(this).attr('data-input');
  1533. $.post("{:U('supply/zhenquery', array('ok' => 1))}", {}, function(shtml){
  1534. layer.open({
  1535. type: 1,
  1536. area: '930px',
  1537. content: shtml //注意,如果str是object,那么需要字符拼接。
  1538. });
  1539. });
  1540. })
  1541. $('#chose_agent_id').click(function(){
  1542. cur_open_div = $(this).attr('data-input');
  1543. $.post("{:U('communityhead/query_head_user', array('ok' => 1))}", {}, function(shtml){
  1544. layer.open({
  1545. type: 1,
  1546. area: '930px',
  1547. content: shtml //注意,如果str是object,那么需要字符拼接。
  1548. });
  1549. });
  1550. })
  1551. $('#chose_link').click(function(){
  1552. cur_open_div = $(this).attr('data-input');
  1553. $.post("{:U('util.selecturl', array('ok' => 1))}", {}, function(shtml){
  1554. layer.open({
  1555. type: 1,
  1556. area: '930px',
  1557. content: shtml //注意,如果str是object,那么需要字符拼接。
  1558. });
  1559. });
  1560. })
  1561. $('.layui-tab-title li').click(function(){
  1562. form.render('radio');
  1563. form.render('checkbox');
  1564. })
  1565. //监听提交
  1566. form.on('submit(formDemo)', function(data){
  1567. var loadingIndex = layer.load();
  1568. $('input').blur(function () {
  1569. $(this).css('border','#e7e7eb 1px solid');
  1570. })
  1571. var goodsname = $.trim($('#goodsname').val());
  1572. if(goodsname == ''){
  1573. layer.msg('商品名称必须填写',{icon: 1,time: 2000});
  1574. $('#goodsname').focus();
  1575. $('#goodsname').css('border','red 2px solid');
  1576. layer.close(loadingIndex);
  1577. return false;
  1578. }
  1579. var price = $.trim($('#price').val());
  1580. if(price == ''){
  1581. layer.msg('售价必须填写',{icon: 1,time: 2000});
  1582. $('#price').focus();
  1583. $('#price').css('border','red 2px solid');
  1584. layer.close(loadingIndex);
  1585. return false;
  1586. }
  1587. var productprice = $.trim($('#productprice').val());
  1588. if(productprice == ''){
  1589. layer.msg('原价必须填写',{icon: 1,time: 2000});
  1590. $('#productprice').focus();
  1591. $('#productprice').css('border','red 2px solid');
  1592. layer.close(loadingIndex);
  1593. return false;
  1594. }
  1595. if($('#hasoption').get(0).checked == false){
  1596. console.log(222);
  1597. var total =$('#total').val();
  1598. if(total == ''){
  1599. layer.msg('库存必须填写',{icon: 1,time: 2000});
  1600. $('#total').focus();
  1601. $('#total').css('border','red 2px solid');
  1602. layer.close(loadingIndex);
  1603. return false;
  1604. }
  1605. }
  1606. var goods_start_count = $.trim($('input[name="goods_start_count"]').val());
  1607. var r = /^\+?[1-9][0-9]*$/;  //正整数
  1608. if(r.test(goods_start_count)){
  1609. var oneday_limit_count = $.trim($('input[name="oneday_limit_count"]').val());
  1610. if(parseInt(oneday_limit_count) > 0){
  1611. if(parseInt(goods_start_count) > parseInt(oneday_limit_count)){
  1612. layer.msg('起购数量必须小于每天限购',{icon: 1,time: 2000});
  1613. $('input[name="goods_start_count"]').focus();
  1614. layer.close(loadingIndex);
  1615. return false;
  1616. }
  1617. }
  1618. var one_limit_count = $.trim($('input[name="one_limit_count"]').val());
  1619. if(parseInt(one_limit_count) > 0){
  1620. if(parseInt(goods_start_count) > parseInt(one_limit_count)){
  1621. layer.msg('起购数量必须小于单次限购',{icon: 1,time: 2000});
  1622. $('input[name="goods_start_count"]').focus();
  1623. layer.close(loadingIndex);
  1624. return false;
  1625. }
  1626. }
  1627. var total_limit_count = $.trim($('input[name="total_limit_count"]').val());
  1628. if(parseInt(total_limit_count) > 0){
  1629. if(parseInt(goods_start_count) > parseInt(total_limit_count)){
  1630. layer.msg('起购数量必须小于历史限购',{icon: 1,time: 2000});
  1631. $('input[name="goods_start_count"]').focus();
  1632. layer.close(loadingIndex);
  1633. return false;
  1634. }
  1635. }
  1636. }
  1637. //判断付费会员价
  1638. var is_take_vipcard = $('input[name="is_take_vipcard"]').prop('checked');
  1639. if(is_take_vipcard){
  1640. var card_price = $.trim($('#card_price').val());
  1641. var price = $.trim($('#price').val());
  1642. var fix_amountTest=/^(([1-9]\d*)|\d)(\.\d{1,2})?$/;
  1643. if(card_price == '' || fix_amountTest.test(card_price)==false){
  1644. layer.msg('请填写正确的商品付费会员专享价');
  1645. layer.close(loadingIndex);
  1646. return false;
  1647. }
  1648. if(price == '' || fix_amountTest.test(price)==false){
  1649. layer.msg('请填写正确的商品价格售价');
  1650. layer.close(loadingIndex);
  1651. return false;
  1652. }
  1653. if(parseFloat(card_price) > parseFloat(price)){
  1654. layer.msg('付费会员专享价不能大于售价');
  1655. layer.close(loadingIndex);
  1656. return false;
  1657. }
  1658. var check_cardprice = true;
  1659. var check_market_price = true;
  1660. var check_card_market = true;
  1661. $('.option_cardprice').each(function(){
  1662. var cardprice = $.trim($(this).val());
  1663. var marketprice = $.trim($(this).parent().parent().find('.option_marketprice').val());
  1664. if(cardprice == '' || fix_amountTest.test(cardprice) == false || parseFloat(cardprice) < 0.01){
  1665. check_cardprice = false;
  1666. }
  1667. if(marketprice == '' || fix_amountTest.test(marketprice) == false || parseFloat(marketprice) < 0.01){
  1668. check_market_price = false;
  1669. }
  1670. if(parseFloat(cardprice) > parseFloat(marketprice)){
  1671. check_card_market = false;
  1672. }
  1673. })
  1674. if(!check_cardprice){
  1675. layer.msg('多规格付费会员专享价不能为空且最低0.01元');
  1676. layer.close(loadingIndex);
  1677. return false;
  1678. }
  1679. if(!check_market_price){
  1680. layer.msg('多规格商品售价不能为空且最低0.01元');
  1681. layer.close(loadingIndex);
  1682. return false;
  1683. }
  1684. if(!check_card_market){
  1685. layer.msg('多规格付费会员专享价不能大于售价');
  1686. layer.close(loadingIndex);
  1687. return false;
  1688. }
  1689. }
  1690. var s_cates = $('#cates').val();
  1691. var cate_mult = [];
  1692. for(var i in s_cates)
  1693. {
  1694. cate_mult.push(s_cates[i]);
  1695. }
  1696. data.field.cate_mult = cate_mult;
  1697. <?php if( !empty($is_open_goods_relative_goods) && $is_open_goods_relative_goods == 1 ){ ?>
  1698. var gd_ar = [];
  1699. var gd_str = '';
  1700. $('.mult_choose_goodsid').each(function(){
  1701. gd_ar.push( $(this).attr('data-gid') );
  1702. })
  1703. gd_str = gd_ar.join(',');
  1704. data.field.limit_goods_list = gd_str;
  1705. <?php } ?>
  1706. var is_mult_option = $('input[name=hasoption]').is(':checked');
  1707. if( is_mult_option )
  1708. {
  1709. var spec_item_all_count = 0;
  1710. var spec_item_all = false;
  1711. $('.spec_item').each(function(){
  1712. spec_item_all_count++;
  1713. });
  1714. if(spec_item_all || spec_item_all_count == 0)
  1715. {
  1716. layer.msg('请填写商品的规格名称');
  1717. layer.close(loadingIndex);
  1718. return false;
  1719. }
  1720. var is_spec_break = false;
  1721. $('.spec_item').each(function(){
  1722. spec_item_all_count++;
  1723. //检测商品规格是否配置
  1724. var spec_val;
  1725. var spec_item_val;
  1726. var is_spec = false;
  1727. var is_spec_item = false;
  1728. var spec_count = 0;
  1729. var spec_item_count = 0;
  1730. $(this).find('.spec_title').each(function(){
  1731. spec_val = $(this).val();
  1732. spec_count++;
  1733. if( spec_val == '' )
  1734. {
  1735. is_spec = true;
  1736. }
  1737. if(is_spec || spec_count == 0)
  1738. {
  1739. is_spec_break = true;
  1740. layer.msg('请填写商品的规格名称',{icon:2});
  1741. $(this).focus();
  1742. $(this).css('border','2px solid #FF0000');
  1743. layer.close(loadingIndex);
  1744. return false;
  1745. }
  1746. })
  1747. $(this).find('.spec_item_title').each(function(){
  1748. spec_item_val = $(this).val();
  1749. spec_item_count++;
  1750. if( spec_item_val == '' )
  1751. {
  1752. is_spec_item = true;
  1753. }
  1754. if(is_spec_item || spec_item_count == 0){
  1755. is_spec_break = true;
  1756. $(this).focus();
  1757. $(this).css('border','2px solid #FF0000');
  1758. //$('.hasoption').focus();
  1759. layer.msg('请填写商品的具体规格值',{icon:2});
  1760. layer.close(loadingIndex);
  1761. return false;
  1762. }
  1763. })
  1764. })
  1765. if(is_spec_break){
  1766. layer.close(loadingIndex);
  1767. return false;
  1768. }
  1769. var t_val;
  1770. var is_pos = false;
  1771. var s_total = 0;
  1772. var is_break = false;
  1773. $('.option_stock').each(function(){
  1774. t_val = $(this).val();
  1775. if(!(/(^[1-9]\d*$)/.test(t_val)) && t_val != 0){
  1776. layer.msg('多规格商品库存输入错误,请输入正确的数字!',{icon:2});
  1777. $(this).focus();
  1778. $(this).css('border','red 2px solid');
  1779. layer.close(loadingIndex);
  1780. is_break = true;
  1781. return false;
  1782. }
  1783. if( t_val == '' )
  1784. {
  1785. is_pos = true;
  1786. }
  1787. if(is_pos)
  1788. {
  1789. layer.msg('多规格商品库存未填写',{icon:2});
  1790. $(this).focus();
  1791. $(this).css('border','red 2px solid');
  1792. console.log(888);
  1793. layer.close(loadingIndex);
  1794. is_break = true;
  1795. return false;
  1796. }
  1797. s_total += parseInt( t_val );
  1798. })
  1799. if(is_break){
  1800. return false;
  1801. }
  1802. var t_val2;
  1803. var is_pos2 = false;
  1804. $('.option_marketprice').each(function(){
  1805. t_val2 = $(this).val();
  1806. if( t_val2 == '' )
  1807. {
  1808. is_pos2 = true;
  1809. }
  1810. console.log(is_pos2);
  1811. if(is_pos2)
  1812. {
  1813. layer.msg('多规格商品价格未填写',{icon:2});
  1814. $(this).focus();
  1815. $(this).css('border','red 2px solid');
  1816. layer.close(loadingIndex);
  1817. is_break = true;
  1818. return false;
  1819. }
  1820. })
  1821. if(is_break){
  1822. return false;
  1823. }
  1824. var t_val3;
  1825. var is_pos3 = false;
  1826. $('.option_productprice').each(function(){
  1827. t_val3 = $(this).val();
  1828. if( t_val3 == '' )
  1829. {
  1830. is_pos3 = true;
  1831. }
  1832. })
  1833. if(is_pos3)
  1834. {
  1835. layer.msg('多规格商品原价未填写',{icon:2});
  1836. layer.close(loadingIndex);
  1837. return false;
  1838. }
  1839. if( s_total > 100000 || s_total< 0 )
  1840. {
  1841. layer.msg('商品库存值的取值范围是1~100000',{icon:2});
  1842. layer.close(loadingIndex);
  1843. return false;
  1844. }
  1845. if(!(/(^[1-9]\d*$)/.test(s_total)) && s_total != 0){
  1846. layer.msg('多规格商品库存输入错误,请输入正确的数字!',{icon:2});
  1847. layer.close(loadingIndex);
  1848. return false;
  1849. }
  1850. }else{
  1851. var g_total = $('#total').val();
  1852. if( g_total > 100000 || g_total< 0 )
  1853. {
  1854. layer.msg('商品库存值的取值范围是1~100000',{icon:2});
  1855. layer.close(loadingIndex);
  1856. return false;
  1857. }
  1858. if(!(/(^[1-9]\d*$)/.test(g_total)) && g_total != 0){
  1859. layer.msg('商品库存输入错误,请输入正确的数字!',{icon:2});
  1860. layer.close(loadingIndex);
  1861. return false;
  1862. }
  1863. }
  1864. /**
  1865. var supply_id = $('input[name=supply_id]').val();
  1866. var is_only_distribution = $('input[name=is_only_distribution]').is(':checked');
  1867. if(supply_id != '' && supply_id > 0){
  1868. if(is_only_distribution){
  1869. layer.msg('独立供应商不能开启同城配送');
  1870. layer.close(loadingIndex);
  1871. return false;
  1872. }
  1873. }**/
  1874. //商品核销
  1875. var is_only_hexiao = $('input[name=is_only_hexiao]').is(':checked');
  1876. if(is_only_hexiao){
  1877. var hx_expire_type = $('input:radio[name="hx_expire_type"]:checked').val();
  1878. if(hx_expire_type == 1){
  1879. if($.trim($('#hx_expire_end_time').val()) == ''){
  1880. layer.msg('指定过期时间不能为空');
  1881. layer.close(loadingIndex);
  1882. return false;
  1883. }
  1884. }
  1885. var goods_room = [];
  1886. var goods_room_smember = {};
  1887. var goods_is_hx_member = {};
  1888. var goods_room_ids = "";
  1889. $('#hx_salesroom_list').find('.mult_choose_room_list').each(function(){
  1890. var goods_room_sid = [];
  1891. var room_id = $(this).find('.mult_choose_roomid').attr('data-roomid');
  1892. $(this).find('.mult_choose_smemberid').each(function(){
  1893. var smember_id = $(this).attr('data-smemberid');
  1894. goods_room_sid.push(smember_id);
  1895. });
  1896. goods_room_smember[room_id] = goods_room_sid.join(',');
  1897. goods_room.push(room_id);
  1898. $(this).find('.is_hx_member').each(function(){
  1899. if($(this).is(':checked')){
  1900. goods_is_hx_member[room_id] = 1;
  1901. }else{
  1902. goods_is_hx_member[room_id] = 0;
  1903. }
  1904. });
  1905. });
  1906. goods_room_ids = goods_room.join(',');
  1907. data.field.goods_room_ids = goods_room_ids;
  1908. data.field.goods_room_smember = goods_room_smember;
  1909. data.field.goods_is_hx_member = goods_is_hx_member;
  1910. var hx_assign_salesroom = $('input:radio[name="hx_assign_salesroom"]:checked').val();
  1911. if(hx_assign_salesroom == 1){
  1912. if(goods_room_ids == ''){
  1913. layer.msg('请选择指定门店');
  1914. layer.close(loadingIndex);
  1915. return false;
  1916. }
  1917. }
  1918. }
  1919. $.ajax({
  1920. url: data.form.action,
  1921. type: data.form.method,
  1922. data: data.field,
  1923. dataType:'json',
  1924. success: function (info) {
  1925. if(info.status == 0)
  1926. {
  1927. layer.msg(info.result.message,{icon: 1,time: 2000});
  1928. layer.close(loadingIndex);
  1929. }else if(info.status == 1){
  1930. var go_url = location.href;
  1931. if( info.result.hasOwnProperty("url") )
  1932. {
  1933. go_url = info.result.url;
  1934. }
  1935. layer.msg('操作成功',{time: 1000,
  1936. end:function(){
  1937. location.href = info.result.url;
  1938. }
  1939. });
  1940. }
  1941. }
  1942. });
  1943. return false;
  1944. });
  1945. form.on('checkbox(hasoption)', function(data){
  1946. if(data.elem.checked)
  1947. {
  1948. $('#goodssn').attr('readonly',true);
  1949. $('#productsn').attr('readonly',true);
  1950. $('#weight').attr('readonly',true);
  1951. $('#total').attr('readonly',true);
  1952. $("#tboption").show();
  1953. $("#tbdiscount").show();
  1954. $("#isdiscount_discounts").show();
  1955. $("#isdiscount_discounts_default").hide();
  1956. $("#commission").show();
  1957. $("#commission_default").hide();
  1958. $("#discounts_type1").show().parent().show();
  1959. refreshOptions();
  1960. }else{
  1961. $('#weight').removeAttr('readonly');
  1962. $('#total').removeAttr('readonly');
  1963. $("#tboption").hide();
  1964. refreshOptions();
  1965. $("#isdiscount_discounts").hide();
  1966. var isdiscount_discounts = $("#isdiscount_discounts").html();
  1967. $("#isdiscount_discounts").html('');
  1968. $("#isdiscount_discounts").html(isdiscount_discounts);
  1969. $("#tbdiscount").hide();
  1970. $("#isdiscount_discounts_default").show();
  1971. $("#commission_default").show();
  1972. $('#goodssn').removeAttr('readonly');
  1973. $('#productsn').removeAttr('readonly');
  1974. $("#discounts_type1").hide().parent().hide();
  1975. $("#discounts_type0").click();
  1976. $(this).prop("checked", false);
  1977. }
  1978. form.render('checkbox');
  1979. });
  1980. $('#chose_agent_id2').click(function(){
  1981. cur_open_div = $(this).attr('data-input');
  1982. $.post("{:U('goods/query_normal', array('template' => 'mult', 'unselect_goodsid' => $id))}", {}, function(shtml){
  1983. layer.open({
  1984. type: 1,
  1985. area: '930px',
  1986. content: shtml //注意,如果str是object,那么需要字符拼接。
  1987. });
  1988. });
  1989. })
  1990. form.on('checkbox(is_modify_head_commission)', function(data){
  1991. if(data.elem.checked)
  1992. {
  1993. $("#head_commission_div").show();
  1994. }else{
  1995. $("#head_commission_div").hide();
  1996. }
  1997. form.render('checkbox');
  1998. });
  1999. form.on('checkbox(is_community_head_commission)', function(data){
  2000. if(data.elem.checked)
  2001. {
  2002. $("#head_commission_div2").show();
  2003. }else{
  2004. $("#head_commission_div2").hide();
  2005. }
  2006. form.render('checkbox');
  2007. });
  2008. form.on('checkbox(is_take_vipcard)', function(data){
  2009. if(data.elem.checked)
  2010. {
  2011. $(".card_price_txt").show();
  2012. }else{
  2013. $(".card_price_txt").hide();
  2014. }
  2015. form.render('checkbox');
  2016. refreshOptions();
  2017. });
  2018. })
  2019. function cancle_bind(obj,sdiv)
  2020. {
  2021. $('#'+sdiv).val('');
  2022. $(obj).parent().parent().remove();
  2023. }
  2024. function cancle_room_bind(obj){
  2025. $(obj).parent().parent().parent().remove();
  2026. }
  2027. </script>
  2028. <script>
  2029. $(function () {
  2030. // 拖拽时开始滚动的间距
  2031. var scrollingSensitivity = 20
  2032. // 拖拽时滚动速度
  2033. let scrollingSpeed = 20
  2034. // 拖拽前的父级节点
  2035. let dragBeforeParentNode = null
  2036. // 初始化拖拽函数
  2037. $('.multi-img-details').sortable({
  2038. // 自适应placeholder的大小
  2039. forceHelperSize: true,
  2040. // 拖拽时的鼠标形状
  2041. cursor: '-webkit-grabbing',
  2042. // 拖拽的父级节点(该节点一定要注意,配置错误会导致当前屏幕外的元素没法自动滚动拖拽,两列之间拖拽的滚动也会出问题)
  2043. appendTo: '.layui-form-item',
  2044. // 拖拽时的倾斜度
  2045. rotate: '5deg',
  2046. // 延迟时间(毫秒),避免和click同时操作时出现的冲突
  2047. delay: 0,
  2048. // 以clone方式拖拽
  2049. helper: 'clone',
  2050. // 拖拽到边框出现滚动的间距,
  2051. scrollSensitivity: scrollingSensitivity,
  2052. // 应用于拖拽空白区域的样式
  2053. placeholder: 'portlet-placeholder ui-state-highlight',
  2054. // 允许拖拽预留空白区域
  2055. forcePlaceholderSize: false,
  2056. // 多个列表之间的拖拽的dom元素
  2057. connectWith: '.multi-img-details',
  2058. // 鼠标到区域则填充
  2059. tolerance: "pointer",
  2060. // 可以拖拽的项
  2061. items: '.multi-item',
  2062. // 填充动画
  2063. revert: 0,
  2064. // 拖拽结束函数
  2065. stop: (e, ui) => {
  2066. // 当前拽入的元素
  2067. let item = $(ui.item)
  2068. // 当前拽入元素的下标
  2069. let index = item.index()
  2070. let kid = ''
  2071. // xxxx 这里面可以操作数据更新
  2072. },
  2073. // 开始拖拽时的函数
  2074. start: (e, ui) => {
  2075. // 拖拽前的父级节点
  2076. dragBeforeParentNode = ui.item[0].parentNode
  2077. // 让placeholder和源高度一致
  2078. ui.helper.addClass('item').width(110)
  2079. // xxxx 这里可以记录一些拖拽前的元素属性
  2080. },
  2081. // 处理两列滚动条问题
  2082. sort: function (event, ui) {
  2083. var scrollContainer = ui.placeholder[0].parentNode
  2084. // 设置拽入的列表的滚动位置
  2085. var overflowOffset = $(scrollContainer).offset()
  2086. if ((overflowOffset.top + scrollContainer.offsetHeight) - event.pageY <
  2087. scrollingSensitivity) {
  2088. scrollContainer.scrollTop = scrollContainer.scrollTop + scrollingSpeed
  2089. } else if (event.pageY - overflowOffset.top < scrollingSensitivity) {
  2090. scrollContainer.scrollTop = scrollContainer.scrollTop - scrollingSpeed
  2091. }
  2092. }
  2093. }).disableSelection()
  2094. })
  2095. </script>
  2096. <script language="javascript">
  2097. var chose_cate = -1;
  2098. var chose_cate_id_arr = [];
  2099. $(function(){
  2100. $('#cates2').on('change',function(){
  2101. var s_length = $("#cates2 option:selected").length -1;
  2102. var options_name = $("#cates2 option:selected:eq("+s_length+")").text();
  2103. var options_str = $("#cates2 option:selected:eq("+s_length+")").attr('data-names');
  2104. if(s_length > chose_cate)
  2105. {
  2106. chose_cate++;
  2107. var cur_cate_id = '';
  2108. $("#cates2 option:selected").each(function(){
  2109. var tmp_cate_id = parseInt($(this).val());
  2110. if( $.inArray( tmp_cate_id, chose_cate_id_arr ) == -1)
  2111. {
  2112. chose_cate_id_arr.push( parseInt(tmp_cate_id) );
  2113. cur_cate_id = tmp_cate_id;
  2114. }
  2115. })
  2116. addSpecList(options_name,options_str,cur_cate_id);
  2117. }else{
  2118. chose_cate--;
  2119. var new_chose_cate_id_arr = [];
  2120. if(chose_cate_id_arr.length == 1)
  2121. {
  2122. $('.spec_class_'+chose_cate_id_arr[0]).remove();
  2123. }
  2124. $("#cates2 option:selected").each(function(){
  2125. var tmp_cate_id = parseInt( $(this).val() );
  2126. if( $.inArray( tmp_cate_id, chose_cate_id_arr ) != -1)
  2127. {
  2128. new_chose_cate_id_arr.push( parseInt(tmp_cate_id) );
  2129. chose_cate_id_arr.splice($.inArray( tmp_cate_id, chose_cate_id_arr ), 1);
  2130. }
  2131. })
  2132. if(chose_cate_id_arr.length == 1)
  2133. {
  2134. $('.spec_class_'+chose_cate_id_arr[0]).remove();
  2135. }
  2136. chose_cate_id_arr = new_chose_cate_id_arr;
  2137. refreshOptions();
  2138. }
  2139. })
  2140. $(document).on('input propertychange change', '#specs input', function () {
  2141. window.optionchanged = true;
  2142. $('#optiontip').show();
  2143. });
  2144. $(document).on('input propertychange change', '#specs input', function () {
  2145. window.optionchanged = true;
  2146. $('#optiontip').show();
  2147. });
  2148. $(".spec_item_thumb").find('i').click(function(){
  2149. var group =$(this).parent();
  2150. group.find('img').attr('src',"{SNAILFISH_LOCAL}static/images/nopic100.jpg");
  2151. group.find(':hidden').val('');
  2152. $(this).hide();
  2153. group.find('img').popover('destroy');
  2154. });
  2155. });
  2156. function selectSpecItemImage(obj){
  2157. util.image('',function(val){
  2158. $(obj).attr('src',val.url).popover({
  2159. trigger: 'hover',
  2160. html: true,
  2161. container: $(document.body),
  2162. content: "<img src='" + val.url + "' style='width:100px;height:100px;' />",
  2163. placement: 'top'
  2164. });
  2165. var group =$(obj).parent();
  2166. group.find(':hidden').val(val.attachment), group.find('i').show().unbind('click').click(function(){
  2167. $(obj).attr('src',"{SNAILFISH_LOCAL}static/images/nopic100.jpg");
  2168. group.find(':hidden').val('');
  2169. group.find('i').hide();
  2170. $(obj).popover('destroy');
  2171. });
  2172. });
  2173. }
  2174. function addSpecList(options_name,spec_str, cur_cate_id)
  2175. {
  2176. var len = $(".spec_item").length;
  2177. $("#add-spec").html("正在处理...").attr("disabled", "true").toggleClass("btn-primary");
  2178. var url = "{:U('goods/mult_tpl',array('tpl'=>'spec'))}";
  2179. $.ajax({
  2180. "url": url,
  2181. type:'post',
  2182. data:{options_name:options_name,spec_str:spec_str,cur_cate_id:cur_cate_id},
  2183. success:function(data){
  2184. $("#add-spec").html('<i class="fa fa-plus"></i> 新建规格').removeAttr("disabled").toggleClass("btn-primary"); ;
  2185. $('#specs').append(data);
  2186. var len = $(".add-specitem").length -1;
  2187. $(".add-specitem:eq(" +len+ ")").focus();
  2188. refreshOptions();
  2189. }
  2190. });
  2191. }
  2192. function addSpec(){
  2193. var len = $(".spec_item").length;
  2194. $("#add-spec").html("正在处理...").attr("disabled", "true").toggleClass("btn-primary");
  2195. var url = "{:U('goods/tpl',array('tpl'=>'spec'))}";
  2196. $.ajax({
  2197. "url": url,
  2198. success:function(data){
  2199. $("#add-spec").html('<i class="fa fa-plus"></i> 新建规格').removeAttr("disabled").toggleClass("btn-primary"); ;
  2200. $('#specs').append(data);
  2201. var len = $(".add-specitem").length -1;
  2202. $(".add-specitem:eq(" +len+ ")").focus();
  2203. refreshOptions();
  2204. }
  2205. });
  2206. }
  2207. function removeSpec(specid){
  2208. if (confirm('确认要删除此规格?')){
  2209. $("#spec_" + specid).remove();
  2210. refreshOptions();
  2211. }
  2212. }
  2213. function addSpecItem(specid){
  2214. $("#add-specitem-" + specid).html("正在处理...").attr("disabled", "true");
  2215. var url = "{:U('goods/tpl',array('tpl'=>'specitem'))}" + "&specid=" + specid;
  2216. $.ajax({
  2217. "url": url,
  2218. success:function(data){
  2219. $("#add-specitem-" + specid).html('<i class="fa fa-plus"></i> 添加规格项').removeAttr("disabled");
  2220. $('#spec_item_' + specid).append(data);
  2221. var len = $("#spec_" + specid + " .spec_item_title").length -1;
  2222. $("#spec_" + specid + " .spec_item_title:eq(" +len+ ")").focus();
  2223. refreshOptions
  2224. if(type==3 && virtual==0){
  2225. $(".choosetemp").show();
  2226. }
  2227. }
  2228. });
  2229. }
  2230. function removeSpecItem(obj){
  2231. $(obj).closest('.spec_item_item').remove();
  2232. refreshOptions();
  2233. }
  2234. function refreshOptions(){
  2235. // 刷新后重置
  2236. window.optionchanged = false;
  2237. $('#optiontip').hide();
  2238. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  2239. var specs = [];
  2240. if($('.spec_item').length<=0){
  2241. $("#options").html('');
  2242. $("#discount").html('');
  2243. $("#isdiscount_discounts").html('');
  2244. $("#commission").html('');
  2245. return;
  2246. }
  2247. $(".spec_item").each(function(i){
  2248. var _this = $(this);
  2249. var spec = {
  2250. id: _this.find(".spec_id").val(),
  2251. title: _this.find(".spec_title").val()
  2252. };
  2253. var items = [];
  2254. _this.find(".spec_item_item").each(function(){
  2255. var __this = $(this);
  2256. var item = {
  2257. id: __this.find(".spec_item_id").val(),
  2258. title: __this.find(".spec_item_title").val(),
  2259. virtual: __this.find(".spec_item_virtual").val(),
  2260. show:__this.find(".spec_item_show").get(0).checked?"1":"0"
  2261. }
  2262. items.push(item);
  2263. });
  2264. spec.items = items;
  2265. specs.push(spec);
  2266. });
  2267. specs.sort(function(x,y){
  2268. if (x.items.length > y.items.length){
  2269. return 1;
  2270. }
  2271. if (x.items.length < y.items.length) {
  2272. return -1;
  2273. }
  2274. });
  2275. var len = specs.length;
  2276. var newlen = 1;
  2277. var h = new Array(len);
  2278. var rowspans = new Array(len);
  2279. for(var i=0;i<len;i++){
  2280. html+="<th>" + specs[i].title + "</th>";
  2281. var itemlen = specs[i].items.length;
  2282. if(itemlen<=0) { itemlen = 1 };
  2283. newlen*=itemlen;
  2284. h[i] = new Array(newlen);
  2285. for(var j=0;j<newlen;j++){
  2286. h[i][j] = new Array();
  2287. }
  2288. var l = specs[i].items.length;
  2289. rowspans[i] = 1;
  2290. for(j=i+1;j<len;j++){
  2291. rowspans[i]*= specs[j].items.length;
  2292. }
  2293. }
  2294. var is_take_vipcard = $('input[name="is_take_vipcard"]').prop('checked');
  2295. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">库存<label style="color:red;font-size:16px;font-weight:900">*</label></div><div class="input-group"><input type="text" class="form-control input-sm option_stock_all" VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_stock\');"></a></span></div></div></th>';
  2296. html += '<th class="type-4"><div class=""><div style="padding-bottom:10px;text-align:center;">售价<label style="color:red;font-size:16px;font-weight:900">*</label></div><div class="input-group"><input type="text" class="form-control input-sm option_marketprice_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_marketprice\');"></a></span></div></div></th>';
  2297. html+='<th class="type-4"><div class=""><div style="padding-bottom:10px;text-align:center;">原价<label style="color:red;font-size:16px;font-weight:900">*</label></div><div class="input-group"><input type="text" class="form-control input-sm option_productprice_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_productprice\');"></a></span></div></div></th>';
  2298. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1){ ?>
  2299. html += '<th class="type-4 cardprice_title"><div class=""><div style="padding-bottom:10px;text-align:center;">付费会员专享价</div><div class="input-group"><input type="text" class="form-control input-sm option_cardprice_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_cardprice\');"></a></span></div></div></th>';
  2300. <?php } ?>
  2301. html+='<th class="type-4"><div class=""><div style="padding-bottom:10px;text-align:center;">成本价</div><div class="input-group"><input type="text" class="form-control input-sm option_costprice_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_costprice\');"></a></span></div></div></th>';
  2302. html+='<th><div class=""><div style="padding-bottom:10px;text-align:center;">编码</div><div class="input-group"><input type="text" class="form-control input-sm option_goodssn_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_goodssn\');"></a></span></div></div></th>';
  2303. html+='<th><div class=""><div style="padding-bottom:10px;text-align:center;">重量(克)</div><div class="input-group"><input type="text" class="form-control input-sm option_weight_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_weight\');"></a></span></div></div></th>';
  2304. html+='</tr></thead>';
  2305. for(var m=0;m<len;m++){
  2306. var k = 0,kid = 0,n=0;
  2307. for(var j=0;j<newlen;j++){
  2308. var rowspan = rowspans[m];
  2309. if( j % rowspan==0){
  2310. h[m][j]={title: specs[m].items[kid].title, virtual: specs[m].items[kid].virtual,html: "<td class='full' rowspan='" +rowspan + "'>"+ specs[m].items[kid].title+"</td>\r\n",id: specs[m].items[kid].id};
  2311. }
  2312. else{
  2313. h[m][j]={title:specs[m].items[kid].title,virtual: specs[m].items[kid].virtual, html: "",id: specs[m].items[kid].id};
  2314. }
  2315. n++;
  2316. if(n==rowspan){
  2317. kid++; if(kid>specs[m].items.length-1) { kid=0; }
  2318. n=0;
  2319. }
  2320. }
  2321. }
  2322. var hh = "";
  2323. for(var i=0;i<newlen;i++){
  2324. hh+="<tr>";
  2325. var ids = [];
  2326. var titles = [];
  2327. var virtuals = [];
  2328. /*for(var j=0;j<len;j++){
  2329. hh+=h[j][i].html;
  2330. ids.push( h[j][i].id);
  2331. titles.push( h[j][i].title);
  2332. virtuals.push( h[j][i].virtual);
  2333. }*/
  2334. for(var j=len-1;j >= 0;j--){
  2335. hh+=h[j][i].html;
  2336. ids.push( h[j][i].id);
  2337. titles.push( h[j][i].title);
  2338. virtuals.push( h[j][i].virtual);
  2339. }
  2340. ids =ids.join('_');
  2341. titles= titles.join('+');
  2342. var val ={ id : "",title:titles, stock : "",presell : "",costprice : "",productprice : "",<?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1 ){ ?>cardprice:"",<?php } ?>marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  2343. if( $(".option_id_" + ids).length>0){
  2344. val ={
  2345. id : $(".option_id_" + ids+":eq(0)").val(),
  2346. title: titles,
  2347. stock : $(".option_stock_" + ids+":eq(0)").val(),
  2348. presell : $(".option_presell_" + ids+":eq(0)").val(),
  2349. costprice : $(".option_costprice_" + ids+":eq(0)").val(),
  2350. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1){ ?>
  2351. cardprice : $(".option_cardprice_" + ids+":eq(0)").val(),
  2352. cardprice_hi : $(".option_cardprice_hi_" + ids+":eq(0)").val(),
  2353. <?php } ?>
  2354. productprice : $(".option_productprice_" + ids+":eq(0)").val(),
  2355. marketprice : $(".option_marketprice_" + ids +":eq(0)").val(),
  2356. goodssn : $(".option_goodssn_" + ids +":eq(0)").val(),
  2357. productsn : $(".option_productsn_" + ids +":eq(0)").val(),
  2358. weight : $(".option_weight_" + ids+":eq(0)").val(),
  2359. virtual : virtuals
  2360. }
  2361. }
  2362. hh += '<td>'
  2363. hh += '<input name="option_stock_' + ids +'" type="text" class="form-control option_stock option_stock_' + ids +'" value="' +(val.stock=='undefined'?'':val.stock )+'"/></td>';
  2364. hh += '<input name="option_id_' + ids+'" type="hidden" class="form-control option_id option_id_' + ids +'" value="' +(val.id=='undefined'?'':val.id )+'"/>';
  2365. hh += '<input name="option_ids[]" type="hidden" class="form-control option_ids option_ids_' + ids +'" value="' + ids +'"/>';
  2366. hh += '<input name="option_title_' + ids +'" type="hidden" class="form-control option_title option_title_' + ids +'" value="' +(val.title=='undefined'?'':val.title )+'"/></td>';
  2367. hh += '<input name="option_virtual_' + ids +'" type="hidden" class="form-control option_virtual option_virtual_' + ids +'" value="' +(val.virtual=='undefined'?'':val.virtual )+'"/></td>';
  2368. hh += '<input name="option_cardprice_hi_' + ids +'" type="hidden" class="form-control option_virtual option_cardprice_hi_' + ids +'" value="' +(val.cardprice=='undefined'?'':val.cardprice )+'"/></td>';
  2369. hh += '</td>';
  2370. //hh += '<td class="type-4"><input data-name="option_presell_' + ids+'" type="text" class="form-control option_presell option_presell_' + ids +'" value="' +(val.presell=='undefined'?'':val.presell )+'"/></td>';
  2371. hh += '<td class="type-4"><input name="option_marketprice_' + ids+'" type="text" class="form-control option_marketprice option_marketprice_' + ids +'" value="' +(val.marketprice=='undefined'?'':val.marketprice )+'"/></td>';
  2372. hh += '<td class="type-4"><input name="option_productprice_' + ids+'" type="text" class="form-control option_productprice option_productprice_' + ids +'" " value="' +(val.productprice=='undefined'?'':val.productprice )+'"/></td>';
  2373. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1){ ?>
  2374. if(typeof(val.cardprice) == "undefined" || val.cardprice == 'undefined' || val.cardprice == null){
  2375. val.cardprice = "";
  2376. }
  2377. if(val.cardprice == ""){
  2378. if(typeof(val.cardprice_hi) == "undefined" || val.cardprice_hi == 'undefined' || val.cardprice_hi == null){
  2379. val.cardprice = "";
  2380. }else{
  2381. val.cardprice = val.cardprice_hi;
  2382. }
  2383. }
  2384. console.log(val.cardprice+'=='+val.cardprice_hi);
  2385. hh += '<td class="type-4 cardprice_td"><input name="option_cardprice_' + ids + '" type="text" class="form-control option_cardprice option_cardprice_' + ids + '" " value="' + (val.cardprice=='undefined' ? '' : val.cardprice ) + '"/></td>';
  2386. <?php } ?>
  2387. hh += '<td class="type-4"><input name="option_costprice_' +ids+'" type="text" class="form-control option_costprice option_costprice_' + ids +'" " value="' +(val.costprice=='undefined'?'':val.costprice )+'"/></td>';
  2388. hh += '<td><input name="option_goodssn_' +ids+'" type="text" class="form-control option_goodssn option_goodssn_' + ids +'" " value="' +(val.goodssn=='undefined'?'':val.goodssn )+'"/></td>';
  2389. //hh += '<td><input data-name="option_productsn_' +ids+'" type="text" class="form-control option_productsn option_productsn_' + ids +'" " value="' +(val.productsn=='undefined'?'':val.productsn )+'"/></td>';
  2390. hh += '<td><input name="option_weight_' + ids +'" type="text" class="form-control option_weight option_weight_' + ids +'" " value="' +(val.weight=='undefined'?'':val.weight )+'"/></td>';
  2391. hh += "</tr>";
  2392. }
  2393. html+=hh;
  2394. html+="</table>";
  2395. $("#options").html(html);
  2396. refreshDiscount();
  2397. refreshIsDiscount();
  2398. if(window.type=='4'){
  2399. $('.type-4').hide();
  2400. }else{
  2401. $('.type-4').show();
  2402. }
  2403. if(is_take_vipcard) {
  2404. $('.cardprice_td').show();
  2405. $('.cardprice_title').show();
  2406. }else{
  2407. $('.cardprice_td').hide();
  2408. $('.cardprice_title').hide();
  2409. }
  2410. }
  2411. function refreshDiscount() {
  2412. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  2413. var specs = [];
  2414. $(".spec_item").each(function (i) {
  2415. var _this = $(this);
  2416. var spec = {
  2417. id: _this.find(".spec_id").val(),
  2418. title: _this.find(".spec_title").val()
  2419. };
  2420. var items = [];
  2421. _this.find(".spec_item_item").each(function () {
  2422. var __this = $(this);
  2423. var item = {
  2424. id: __this.find(".spec_item_id").val(),
  2425. title: __this.find(".spec_item_title").val(),
  2426. virtual: __this.find(".spec_item_virtual").val(),
  2427. show: __this.find(".spec_item_show").get(0).checked ? "1" : "0"
  2428. }
  2429. items.push(item);
  2430. });
  2431. spec.items = items;
  2432. specs.push(spec);
  2433. });
  2434. specs.sort(function (x, y) {
  2435. if (x.items.length > y.items.length) {
  2436. return 1;
  2437. }
  2438. if (x.items.length < y.items.length) {
  2439. return -1;
  2440. }
  2441. });
  2442. var len = specs.length;
  2443. var newlen = 1;
  2444. var h = new Array(len);
  2445. var rowspans = new Array(len);
  2446. for (var i = 0; i < len; i++) {
  2447. html += "<th>" + specs[i].title + "</th>";
  2448. var itemlen = specs[i].items.length;
  2449. if (itemlen <= 0) {
  2450. itemlen = 1
  2451. }
  2452. ;
  2453. newlen *= itemlen;
  2454. h[i] = new Array(newlen);
  2455. for (var j = 0; j < newlen; j++) {
  2456. h[i][j] = new Array();
  2457. }
  2458. var l = specs[i].items.length;
  2459. rowspans[i] = 1;
  2460. for (j = i + 1; j < len; j++) {
  2461. rowspans[i] *= specs[j].items.length;
  2462. }
  2463. }
  2464. <?php foreach( $levels as $level ){ ?>
  2465. <?php if( $level['key']=='default'){ ?>
  2466. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm discount_{$level["key"]}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'discount_{$level["key"]}\');"></a></span></div></div></th>';
  2467. <?php }else{ ?>
  2468. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm discount_level{$level['id']}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'discount_level{$level['id']}\');"></a></span></div></div></th>';
  2469. <?php } ?>
  2470. <?php } ?>
  2471. html += '</tr></thead>';
  2472. for (var m = 0; m < len; m++) {
  2473. var k = 0, kid = 0, n = 0;
  2474. for (var j = 0; j < newlen; j++) {
  2475. var rowspan = rowspans[m];
  2476. if (j % rowspan == 0) {
  2477. h[m][j] = {
  2478. title: specs[m].items[kid].title,
  2479. virtual: specs[m].items[kid].virtual,
  2480. html: "<td class='full' rowspan='" + rowspan + "'>" + specs[m].items[kid].title + "</td>\r\n",
  2481. id: specs[m].items[kid].id
  2482. };
  2483. }
  2484. else {
  2485. h[m][j] = {
  2486. title: specs[m].items[kid].title,
  2487. virtual: specs[m].items[kid].virtual,
  2488. html: "",
  2489. id: specs[m].items[kid].id
  2490. };
  2491. }
  2492. n++;
  2493. if (n == rowspan) {
  2494. kid++;
  2495. if (kid > specs[m].items.length - 1) {
  2496. kid = 0;
  2497. }
  2498. n = 0;
  2499. }
  2500. }
  2501. }
  2502. var hh = "";
  2503. for (var i = 0; i < newlen; i++) {
  2504. hh += "<tr>";
  2505. var ids = [];
  2506. var titles = [];
  2507. var virtuals = [];
  2508. for (var j = 0; j < len; j++) {
  2509. hh += h[j][i].html;
  2510. ids.push(h[j][i].id);
  2511. titles.push(h[j][i].title);
  2512. virtuals.push(h[j][i].virtual);
  2513. }
  2514. ids = ids.join('_');
  2515. titles = titles.join('+');
  2516. var val = {
  2517. id: "",
  2518. title: titles,
  2519. <?php foreach( $levels as $level ){ ?>
  2520. <?php if( $level['key']=='default'){ ?>
  2521. level{$level['key']}: '',
  2522. <?php }else{ ?>
  2523. level{$level['id']}: '',
  2524. <?php } ?>
  2525. <?php } ?>
  2526. costprice: "",
  2527. presell: "",
  2528. productprice: "",
  2529. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1){ ?>
  2530. cardprice: "",
  2531. <?php } ?>
  2532. marketprice: "",
  2533. weight: "",
  2534. productsn: "",
  2535. goodssn: "",
  2536. virtual: virtuals
  2537. };
  2538. var val ={ id : "",title:titles,<?php foreach( $levels as $level ){ ?><?php if( $level['key']=='default'){ ?> level{$level['key']}: '',<?php }else{ ?> level{$level['id']}: '',<?php } ?><?php } ?>costprice : "",productprice : "",marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  2539. if ($(".discount_id_" + ids).length > 0) {
  2540. val = {
  2541. id: $(".discount_id_" + ids + ":eq(0)").val(),
  2542. title: titles,
  2543. <?php foreach( $levels as $level ){ ?>
  2544. <?php if( $level['key']=='default'){ ?>
  2545. level{$level['key']}: $(".discount_{$level['key']}_" + ids + ":eq(0)").val(),
  2546. <?php }else{ ?>
  2547. level{$level['id']}: $(".discount_level{$level['id']}_" + ids + ":eq(0)").val(),
  2548. <?php } ?>
  2549. <?php } ?>
  2550. costprice: $(".discount_costprice_" + ids + ":eq(0)").val(),
  2551. presell: $(".discount_presell_" + ids + ":eq(0)").val(),
  2552. productprice: $(".discount_productprice_" + ids + ":eq(0)").val(),
  2553. <?php if( !empty($is_open_vipcard_buy) && $is_open_vipcard_buy == 1){ ?>
  2554. cardprice: $(".discount_cardprice_" + ids + ":eq(0)").val(),
  2555. <?php } ?>
  2556. marketprice: $(".discount_marketprice_" + ids + ":eq(0)").val(),
  2557. presell: $(".discount_presell_" + ids + ":eq(0)").val(),
  2558. goodssn: $(".discount_goodssn_" + ids + ":eq(0)").val(),
  2559. productsn: $(".discount_productsn_" + ids + ":eq(0)").val(),
  2560. weight: $(".discount_weight_" + ids + ":eq(0)").val(),
  2561. virtual: virtuals
  2562. }
  2563. }
  2564. <?php foreach( $levels as $level ){ ?>
  2565. hh += '<td>'
  2566. <?php if( $level['key']=='default'){ ?>
  2567. hh += '<input data-name="discount_level_{$level['key']}_' + ids +'"type="text" class="form-control discount_{$level['key']} discount_{$level['key']}_' + ids +'" value="' +(val.level{$level['key']}=='undefined'?'':val.level{$level['key']} )+'"/>';
  2568. <?php }else{ ?>
  2569. hh += '<input data-name="discount_level_{$level['id']}_' + ids +'"type="text" class="form-control discount_level{$level['id']} discount_level{$level['id']}_' + ids +'" value="' +(val.level{$level['id']}=='undefined'?'':val.level{$level['id']} )+'"/>';
  2570. <?php } ?>
  2571. hh += '</td>';
  2572. <?php } ?>
  2573. hh += '<input data-name="discount_id_' + ids+'"type="hidden" class="form-control discount_id discount_id_' + ids +'" value="' +(val.id=='undefined'?'':val.id )+'"/>';
  2574. hh += '<input data-name="discount_ids"type="hidden" class="form-control discount_ids discount_ids_' + ids +'" value="' + ids +'"/>';
  2575. hh += '<input data-name="discount_title_' + ids +'"type="hidden" class="form-control discount_title discount_title_' + ids +'" value="' +(val.title=='undefined'?'':val.title )+'"/></td>';
  2576. hh += '<input data-name="discount_virtual_' + ids +'"type="hidden" class="form-control discount_virtual discount_virtual_' + ids +'" value="' +(val.virtual=='undefined'?'':val.virtual )+'"/></td>';
  2577. hh += "</tr>";
  2578. }
  2579. html += hh;
  2580. html += "</table>";
  2581. $("#discount").html(html);
  2582. }
  2583. function refreshIsDiscount() {
  2584. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  2585. var specs = [];
  2586. $(".spec_item").each(function (i) {
  2587. var _this = $(this);
  2588. var spec = {
  2589. id: _this.find(".spec_id").val(),
  2590. title: _this.find(".spec_title").val()
  2591. };
  2592. var items = [];
  2593. _this.find(".spec_item_item").each(function () {
  2594. var __this = $(this);
  2595. var item = {
  2596. id: __this.find(".spec_item_id").val(),
  2597. title: __this.find(".spec_item_title").val(),
  2598. virtual: __this.find(".spec_item_virtual").val(),
  2599. show: __this.find(".spec_item_show").get(0).checked ? "1" : "0"
  2600. }
  2601. items.push(item);
  2602. });
  2603. spec.items = items;
  2604. specs.push(spec);
  2605. });
  2606. specs.sort(function (x, y) {
  2607. if (x.items.length > y.items.length) {
  2608. return 1;
  2609. }
  2610. if (x.items.length < y.items.length) {
  2611. return -1;
  2612. }
  2613. });
  2614. var len = specs.length;
  2615. var newlen = 1;
  2616. var h = new Array(len);
  2617. var rowspans = new Array(len);
  2618. for (var i = 0; i < len; i++) {
  2619. html += "<th>" + specs[i].title + "</th>";
  2620. var itemlen = specs[i].items.length;
  2621. if (itemlen <= 0) {
  2622. itemlen = 1
  2623. }
  2624. ;
  2625. newlen *= itemlen;
  2626. h[i] = new Array(newlen);
  2627. for (var j = 0; j < newlen; j++) {
  2628. h[i][j] = new Array();
  2629. }
  2630. var l = specs[i].items.length;
  2631. rowspans[i] = 1;
  2632. for (j = i + 1; j < len; j++) {
  2633. rowspans[i] *= specs[j].items.length;
  2634. }
  2635. }
  2636. <?php foreach( $levels as $level ){ ?>
  2637. <?php if( $level['key']=='default'){ ?>
  2638. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm isdiscount_discounts_{$level['key']}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'isdiscount_discounts_{$level['key']}\');"></a></span></div></div></th>';
  2639. <?php }else{ ?>
  2640. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm isdiscount_discounts_level{$level['id']}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'isdiscount_discounts_level{$level['id']}\');"></a></span></div></div></th>';
  2641. <?php } ?>
  2642. <?php } ?>
  2643. html += '</tr></thead>';
  2644. for (var m = 0; m < len; m++) {
  2645. var k = 0, kid = 0, n = 0;
  2646. for (var j = 0; j < newlen; j++) {
  2647. var rowspan = rowspans[m];
  2648. if (j % rowspan == 0) {
  2649. h[m][j] = {
  2650. title: specs[m].items[kid].title,
  2651. virtual: specs[m].items[kid].virtual,
  2652. html: "<td class='full' rowspan='" + rowspan + "'>" + specs[m].items[kid].title + "</td>\r\n",
  2653. id: specs[m].items[kid].id
  2654. };
  2655. }
  2656. else {
  2657. h[m][j] = {
  2658. title: specs[m].items[kid].title,
  2659. virtual: specs[m].items[kid].virtual,
  2660. html: "",
  2661. id: specs[m].items[kid].id
  2662. };
  2663. }
  2664. n++;
  2665. if (n == rowspan) {
  2666. kid++;
  2667. if (kid > specs[m].items.length - 1) {
  2668. kid = 0;
  2669. }
  2670. n = 0;
  2671. }
  2672. }
  2673. }
  2674. var hh = "";
  2675. for (var i = 0; i < newlen; i++) {
  2676. hh += "<tr>";
  2677. var ids = [];
  2678. var titles = [];
  2679. var virtuals = [];
  2680. for (var j = 0; j < len; j++) {
  2681. hh += h[j][i].html;
  2682. ids.push(h[j][i].id);
  2683. titles.push(h[j][i].title);
  2684. virtuals.push(h[j][i].virtual);
  2685. }
  2686. ids = ids.join('_');
  2687. titles = titles.join('+');
  2688. var val = {
  2689. id: "",
  2690. title: titles,
  2691. <?php foreach( $levels as $level ){ ?>
  2692. <?php if( $level['key']=='default'){ ?>
  2693. level{$level['key']}: '',
  2694. <?php }else{ ?>
  2695. level{$level['if']}: '',
  2696. <?php } ?>
  2697. <?php } ?>
  2698. costprice: "",
  2699. presell: "",
  2700. productprice: "",
  2701. marketprice: "",
  2702. weight: "",
  2703. productsn: "",
  2704. goodssn: "",
  2705. virtual: virtuals
  2706. };
  2707. var val ={ id : "",title:titles,<?php foreach( $levels as $level ){ ?><?php if( $level['key']=='default'){ ?> level{$level['key']}: '',<?php }else{ ?> level{$level['id']}: '',<?php } ?><?php } ?>costprice : "",productprice : "",marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  2708. if ($(".isdiscount_discounts_id_" + ids).length > 0) {
  2709. val = {
  2710. id: $(".isdiscount_discounts_id_" + ids + ":eq(0)").val(),
  2711. title: titles,
  2712. <?php foreach( $levels as $level ){ ?>
  2713. <?php if( $level['key']=='default'){ ?>
  2714. level{$level['key']}: $(".isdiscount_discounts_{$level['key']}_" + ids + ":eq(0)").val(),
  2715. <?php }else{ ?>
  2716. level{$level['id']}: $(".isdiscount_discounts_level{$level['id']}_" + ids + ":eq(0)").val(),
  2717. <?php } ?>
  2718. <?php } ?>
  2719. costprice: $(".isdiscount_discounts_costprice_" + ids + ":eq(0)").val(),
  2720. productprice: $(".isdiscount_discounts_productprice_" + ids + ":eq(0)").val(),
  2721. marketprice: $(".isdiscount_discounts_marketprice_" + ids + ":eq(0)").val(),
  2722. presell: $(".isdiscount_discounts_presell_" + ids + ":eq(0)").val(),
  2723. goodssn: $(".isdiscount_discounts_goodssn_" + ids + ":eq(0)").val(),
  2724. productsn: $(".isdiscount_discounts_productsn_" + ids + ":eq(0)").val(),
  2725. weight: $(".isdiscount_discounts_weight_" + ids + ":eq(0)").val(),
  2726. virtual: virtuals
  2727. }
  2728. }
  2729. <?php foreach( $levels as $level ){ ?>
  2730. hh += '<td>'
  2731. <?php if( $level['key']=='default'){ ?>
  2732. hh += '<input data-name="isdiscount_discounts_level_{$level['key']}_' + ids +'"type="text" class="form-control isdiscount_discounts_{$level['key']} isdiscount_discounts_{$level['key']}_' + ids +'" value="' +(val.level{$level['key']}=='undefined'?'':val.level{$level['key']} )+'"/>';
  2733. <?php }else{ ?>
  2734. hh += '<input data-name="isdiscount_discounts_level_{$level['id']}_' + ids +'"type="text" class="form-control isdiscount_discounts_level{$level['id']} isdiscount_discounts_level{$level['id']}_' + ids +'" value="' +(val.level{$level['id']}=='undefined'?'':val.level{$level['id']} )+'"/>';
  2735. <?php } ?>
  2736. hh += '</td>';
  2737. <?php } ?>
  2738. hh += '<input data-name="isdiscount_discounts_id_' + ids+'"type="hidden" class="form-control isdiscount_discounts_id isdiscount_discounts_id_' + ids +'" value="' +(val.id=='undefined'?'':val.id )+'"/>';
  2739. hh += '<input data-name="isdiscount_discounts_ids"type="hidden" class="form-control isdiscount_discounts_ids isdiscount_discounts_ids_' + ids +'" value="' + ids +'"/>';
  2740. hh += '<input data-name="isdiscount_discounts_title_' + ids +'"type="hidden" class="form-control isdiscount_discounts_title isdiscount_discounts_title_' + ids +'" value="' +(val.title=='undefined'?'':val.title )+'"/></td>';
  2741. hh += '<input data-name="isdiscount_discounts_virtual_' + ids +'"type="hidden" class="form-control isdiscount_discounts_virtual isdiscount_discounts_virtual_' + ids +'" value="' +(val.virtual=='undefined'?'':val.virtual )+'"/></td>';
  2742. hh += "</tr>";
  2743. }
  2744. html += hh;
  2745. html += "</table>";
  2746. $("#isdiscount_discounts").html(html);
  2747. }
  2748. function refreshCommission() {
  2749. var commission_level = {:json_encode($commission_level)};
  2750. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  2751. var specs = [];
  2752. $(".spec_item").each(function (i) {
  2753. var _this = $(this);
  2754. var spec = {
  2755. id: _this.find(".spec_id").val(),
  2756. title: _this.find(".spec_title").val()
  2757. };
  2758. var items = [];
  2759. _this.find(".spec_item_item").each(function () {
  2760. var __this = $(this);
  2761. var item = {
  2762. id: __this.find(".spec_item_id").val(),
  2763. title: __this.find(".spec_item_title").val(),
  2764. virtual: __this.find(".spec_item_virtual").val(),
  2765. show: __this.find(".spec_item_show").get(0).checked ? "1" : "0"
  2766. }
  2767. items.push(item);
  2768. });
  2769. spec.items = items;
  2770. specs.push(spec);
  2771. });
  2772. specs.sort(function (x, y) {
  2773. if (x.items.length > y.items.length) {
  2774. return 1;
  2775. }
  2776. if (x.items.length < y.items.length) {
  2777. return -1;
  2778. }
  2779. });
  2780. var len = specs.length;
  2781. var newlen = 1;
  2782. var h = new Array(len);
  2783. var rowspans = new Array(len);
  2784. for (var i = 0; i < len; i++) {
  2785. html += "<th>" + specs[i].title + "</th>";
  2786. var itemlen = specs[i].items.length;
  2787. if (itemlen <= 0) {
  2788. itemlen = 1
  2789. }
  2790. ;
  2791. newlen *= itemlen;
  2792. h[i] = new Array(newlen);
  2793. for (var j = 0; j < newlen; j++) {
  2794. h[i][j] = new Array();
  2795. }
  2796. var l = specs[i].items.length;
  2797. rowspans[i] = 1;
  2798. for (j = i + 1; j < len; j++) {
  2799. rowspans[i] *= specs[j].items.length;
  2800. }
  2801. }
  2802. $.each(commission_level,function (key,level) {
  2803. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">'+level.levelname+'</div></div></th>';
  2804. })
  2805. html += '</tr></thead>';
  2806. for (var m = 0; m < len; m++) {
  2807. var k = 0, kid = 0, n = 0;
  2808. for (var j = 0; j < newlen; j++) {
  2809. var rowspan = rowspans[m];
  2810. if (j % rowspan == 0) {
  2811. h[m][j] = {
  2812. title: specs[m].items[kid].title,
  2813. virtual: specs[m].items[kid].virtual,
  2814. html: "<td class='full' rowspan='" + rowspan + "'>" + specs[m].items[kid].title + "</td>\r\n",
  2815. id: specs[m].items[kid].id
  2816. };
  2817. }
  2818. else {
  2819. h[m][j] = {
  2820. title: specs[m].items[kid].title,
  2821. virtual: specs[m].items[kid].virtual,
  2822. html: "",
  2823. id: specs[m].items[kid].id
  2824. };
  2825. }
  2826. n++;
  2827. if (n == rowspan) {
  2828. kid++;
  2829. if (kid > specs[m].items.length - 1) {
  2830. kid = 0;
  2831. }
  2832. n = 0;
  2833. }
  2834. }
  2835. }
  2836. var hh = "";
  2837. for (var i = 0; i < newlen; i++) {
  2838. hh += "<tr>";
  2839. var ids = [];
  2840. var titles = [];
  2841. var virtuals = [];
  2842. for (var j = 0; j < len; j++) {
  2843. hh += h[j][i].html;
  2844. ids.push(h[j][i].id);
  2845. titles.push(h[j][i].title);
  2846. virtuals.push(h[j][i].virtual);
  2847. }
  2848. ids = ids.join('_');
  2849. titles = titles.join('+');
  2850. var val = {
  2851. id: "",
  2852. title: titles,
  2853. <?php foreach( $commission_level as $level ){ ?>
  2854. <?php if( $level["key"] == "default"){ ?>
  2855. level{$level['key']}: '',
  2856. <?php }else{ ?>
  2857. level{$level['id']}: '',
  2858. <?php } ?>
  2859. <?php } ?>
  2860. costprice: "",
  2861. presell: "",
  2862. productprice: "",
  2863. marketprice: "",
  2864. weight: "",
  2865. productsn: "",
  2866. goodssn: "",
  2867. virtual: virtuals
  2868. };
  2869. var val ={ id : "",title:titles,<?php foreach( $commission_level as $level ){ ?> <?php if( $level["key"] == "default"){ ?>level{$level['key']}: '',<?php }else{ ?>level{$level['id']}: '',<?php } ?><?php } ?>costprice : "",productprice : "",marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  2870. <?php foreach( $commission_level as $level ){ ?>
  2871. <?php if( $level["key"] == "default"){ ?>
  2872. var level{$level['key']} = new Array(3);
  2873. $(".commission_{$level['key']}_"+ ids).each(function(index,val){
  2874. level{$level['key']}[index] = val;
  2875. })
  2876. <?php }else{ ?>
  2877. var level{$level['id']} = new Array(3);
  2878. $(".commission_level{$level['id']}_"+ ids).each(function(index,val){
  2879. level{$level['id']}[index] = val;
  2880. })
  2881. <?php } ?>
  2882. <?php } ?>
  2883. if ($(".commission_id_" + ids).length > 0) {
  2884. val = {
  2885. id: $(".commission_id_" + ids + ":eq(0)").val(),
  2886. title: titles,
  2887. costprice: $(".commission_costprice_" + ids + ":eq(0)").val(),
  2888. presell: $(".commission_presell_" + ids + ":eq(0)").val(),
  2889. productprice: $(".commission_productprice_" + ids + ":eq(0)").val(),
  2890. marketprice: $(".commission_marketprice_" + ids + ":eq(0)").val(),
  2891. goodssn: $(".commission_goodssn_" + ids + ":eq(0)").val(),
  2892. productsn: $(".commission_productsn_" + ids + ":eq(0)").val(),
  2893. weight: $(".commission_weight_" + ids + ":eq(0)").val(),
  2894. virtual: virtuals
  2895. }
  2896. }
  2897. <?php foreach( $commission_level as $level ){ ?>
  2898. hh += '<td>';
  2899. var level_temp = <?php if( $level['key'] == 'default'){ ?>level{$level['key']}<?php }else{ ?>level{$level['id']}<?php } ?>;
  2900. if (len >= i && typeof (level_temp) != 'undefined')
  2901. {
  2902. if('{$level['key']}' == 'default')
  2903. {
  2904. for (var li = 0; li<{$shopset_level};li++)
  2905. {
  2906. if (typeof (level_temp[li])!= "undefined")
  2907. {
  2908. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2909. }
  2910. else
  2911. {
  2912. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2913. }
  2914. }
  2915. }
  2916. else
  2917. {
  2918. for (var li = 0; li<{$shopset_level};li++)
  2919. {
  2920. if (typeof (level_temp[li])!= "undefined")
  2921. {
  2922. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2923. }
  2924. else
  2925. {
  2926. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2927. }
  2928. }
  2929. }
  2930. }
  2931. else
  2932. {
  2933. if('{$level['key']}' == 'default')
  2934. {
  2935. for (var li = 0; li<{$shopset_level};li++)
  2936. {
  2937. if (typeof (level_temp[li])!= "undefined")
  2938. {
  2939. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2940. }
  2941. else
  2942. {
  2943. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2944. }
  2945. }
  2946. }
  2947. else
  2948. {
  2949. for (var li = 0; li<{$shopset_level};li++)
  2950. {
  2951. if (typeof (level_temp[li])!= "undefined")
  2952. {
  2953. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2954. }
  2955. else
  2956. {
  2957. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2958. }
  2959. }
  2960. }
  2961. }
  2962. hh += '</td>';
  2963. <?php } ?>
  2964. hh += '<input data-name="commission_id_' + ids+'"type="hidden" class="form-control commission_id commission_id_' + ids +'" value="' +(val.id=='undefined'?'':val.id )+'"/>';
  2965. hh += '<input data-name="commission_ids"type="hidden" class="form-control commission_ids commission_ids_' + ids +'" value="' + ids +'"/>';
  2966. hh += '<input data-name="commission_title_' + ids +'"type="hidden" class="form-control commission_title commission_title_' + ids +'" value="' +(val.title=='undefined'?'':val.title )+'"/></td>';
  2967. hh += '<input data-name="commission_virtual_' + ids +'"type="hidden" class="form-control commission_virtual commission_virtual_' + ids +'" value="' +(val.virtual=='undefined'?'':val.virtual )+'"/></td>';
  2968. hh += "</tr>";
  2969. }
  2970. html += hh;
  2971. html += "</table>";
  2972. $("#commission").html(html);
  2973. }
  2974. function setCol(cls){
  2975. $("."+cls).val( $("."+cls+"_all").val());
  2976. }
  2977. function showItem(obj){
  2978. var show = $(obj).get(0).checked?"1":"0";
  2979. $(obj).parents('.spec_item_item').find('.spec_item_show:eq(0)').val(show);
  2980. }
  2981. function nofind(){
  2982. var img=event.srcElement;
  2983. img.src="./resource/image/module-nopic-small.jpg";
  2984. img.onerror=null;
  2985. }
  2986. function choosetemp(id){
  2987. $('#modal-module-chooestemp').modal();
  2988. $('#modal-module-chooestemp').data("temp",id);
  2989. }
  2990. function addtemp(){
  2991. var id = $('#modal-module-chooestemp').data("temp");
  2992. var temp_id = $('#modal-module-chooestemp').find("select").val();
  2993. var temp_name = $('#modal-module-chooestemp option[value='+temp_id+']').text();
  2994. //alert(temp_id+":"+temp_name);
  2995. $("#temp_name_"+id).val(temp_name);
  2996. $("#temp_id_"+id).val(temp_id);
  2997. $('#modal-module-chooestemp .close').click();
  2998. refreshOptions()
  2999. }
  3000. function setinterval(type)
  3001. {
  3002. var intervalfloor =$('#intervalfloor').val();
  3003. if(intervalfloor=="")
  3004. {
  3005. intervalfloor=0;
  3006. }
  3007. intervalfloor = parseInt(intervalfloor);
  3008. if(type=='plus')
  3009. {
  3010. if(intervalfloor==3)
  3011. {
  3012. tip.msgbox.err("最多添加三个区间价格");
  3013. return;
  3014. }
  3015. intervalfloor=intervalfloor+1;
  3016. }
  3017. else if(type=='minus')
  3018. {
  3019. if(intervalfloor==0)
  3020. {
  3021. tip.msgbox.err("请最少添加一个区间价格");
  3022. return;
  3023. }
  3024. intervalfloor=intervalfloor-1;
  3025. }else
  3026. {
  3027. return;
  3028. }
  3029. if(intervalfloor<1)
  3030. {
  3031. $('#interval1').hide();
  3032. $('#intervalnum1').val("");
  3033. $('#intervalprice1').val("");
  3034. }else
  3035. {
  3036. $('#interval1').show();
  3037. }
  3038. if(intervalfloor<2)
  3039. {
  3040. $('#interval2').hide();
  3041. $('#intervalnum2').val("");
  3042. $('#intervalprice2').val("");
  3043. }else
  3044. {
  3045. $('#interval2').show();
  3046. }
  3047. if(intervalfloor<3)
  3048. {
  3049. $('#interval3').hide();
  3050. $('#intervalnum3').val("");
  3051. $('#intervalprice3').val("");
  3052. }else
  3053. {
  3054. $('#interval3').show();
  3055. }
  3056. $('#intervalfloor').val(intervalfloor);
  3057. }
  3058. </script>
  3059. <script language="javascript">
  3060. $(function() {
  3061. })
  3062. </script>
  3063. <script>
  3064. var heads_page = 1;
  3065. $("body").delegate("#batchheads_page .pagination a","click",function(){
  3066. heads_page = $(this).attr('page');
  3067. search_heads_do();
  3068. })
  3069. function search_heads()
  3070. {
  3071. heads_page = 1;
  3072. search_heads_do();
  3073. }
  3074. function search_heads_do()
  3075. {
  3076. var province_name = $('#sel-provance').val();
  3077. var city_name = $('#sel-city').val();
  3078. var area_name = $('#sel-area').val();
  3079. var country_name = $('#sel-street').val();
  3080. var keyword = $('#supply_id_input').val();
  3081. $.post("{:U('communityhead/query_head')}",{page:heads_page,'province_name':province_name,'city_name': city_name,'area_name':area_name,'country_name':country_name,'keyword':keyword},
  3082. function (ret) {
  3083. if (ret.status == 1) {
  3084. $('#batchheads_content').html(ret.html);
  3085. $('#batchheads_page').html(ret.page_html);
  3086. return
  3087. } else {
  3088. layer.msg('修改失败');
  3089. }
  3090. }, 'json');
  3091. }
  3092. //显示批量分类
  3093. $('#batchcatesbut').click(function () {
  3094. // var index = layer.load(1);
  3095. var index = layer.open({
  3096. type: 1,
  3097. area: '500px',
  3098. title: '选取分类'
  3099. ,content: $('#batchcates_html').html(),
  3100. yes: function(index, layero){
  3101. //do something
  3102. layer.close(index); //如果设定了yes回调,需进行手工关闭
  3103. }
  3104. });
  3105. })
  3106. $('#batch_head_group').click(function () {
  3107. // var index = layer.load(1);
  3108. var index = layer.open({
  3109. type: 1,
  3110. area: '500px',
  3111. title: '选取团长分组'
  3112. ,content: $('#batchcates_headgroup_html').html(),
  3113. yes: function(index, layero){
  3114. //do something
  3115. layer.close(index); //如果设定了yes回调,需进行手工关闭
  3116. }
  3117. });
  3118. })
  3119. $('#batch_head_group2').click(function () {
  3120. // var index = layer.load(1);
  3121. var index = layer.open({
  3122. type: 1,
  3123. area: '500px',
  3124. title: '选取团长分组'
  3125. ,content: $('#batchcates_headgroup_html').html(),
  3126. yes: function(index, layero){
  3127. //do something
  3128. layer.close(index); //如果设定了yes回调,需进行手工关闭
  3129. }
  3130. });
  3131. })
  3132. $('.check_heads_all').click(function(){
  3133. //head_id
  3134. if($(this).is(':checked')){
  3135. $('.head_id').prop('checked',true);
  3136. }else{
  3137. $('.head_id').prop('checked',false);
  3138. }
  3139. })
  3140. $(".radio_sale").click(function(){
  3141. var checkedvalue = $("input[name='is_all_sale']:checked").val();
  3142. if(checkedvalue == 1){
  3143. }else{
  3144. cascdeInit("1","1","","","","");
  3145. search_heads_do();
  3146. var offs_lf = ( $(window).width() -720 )/2;
  3147. var offs_ht = ( $(window).height() -690 )/2;
  3148. $('#batchheads .modal-dialog').css('top',offs_ht+'px');
  3149. $('#batchheads .modal-dialog').css('margin-top','0px');
  3150. $('#batchheads .modal-dialog').css('left',offs_lf+'px');
  3151. $('#batchheads .modal-dialog').css('margin-left','0px');
  3152. $('#batchheads').show();
  3153. }
  3154. })
  3155. $('#batchcatesbut2').click(function () {
  3156. var index = layer.open({
  3157. type: 1,
  3158. area: '500px',
  3159. title: '选取分类'
  3160. ,content: $('#batchcates_html').html(),
  3161. yes: function(index, layero){
  3162. //do something
  3163. layer.close(index); //如果设定了yes回调,需进行手工关闭
  3164. }
  3165. });
  3166. })
  3167. //关闭批量分类
  3168. $('.modal-header .close').click(function () {
  3169. $('#batchcates').hide();
  3170. $('#batchheads').hide();
  3171. $('#batch_time').hide();
  3172. })
  3173. // 取消批量分类
  3174. $('.modal-footer .btn.btn-default').click(function () {
  3175. $('#batchcates').hide();
  3176. $('#batchheads').hide();
  3177. $('#batch_time').hide();
  3178. })
  3179. $('.model_heads').click(function(){
  3180. var head_id_arr = [];
  3181. $('.head_id').each(function(){
  3182. if($(this).is(':checked')) {
  3183. head_id_arr.push( $(this).val() )
  3184. }
  3185. })
  3186. //modal-group-head
  3187. var is_clear_old = 0;
  3188. if( $('#is_cancle_old').is(':checked') )
  3189. {
  3190. is_clear_old = 1;
  3191. }
  3192. var is_cancle_allhead2 = 0;
  3193. if( $('#is_cancle_allhead').is(':checked') )
  3194. {
  3195. is_cancle_allhead2 = 1;
  3196. }
  3197. is_cancle_allhead2 = 1;
  3198. //is_cancle_allhead2
  3199. if(head_id_arr.length > 0)
  3200. {
  3201. var goodsids = [];
  3202. var goods_id = $('#goods_id').val();
  3203. goodsids.push(goods_id);
  3204. if(goods_id != '')
  3205. {
  3206. $.post("{:U('goods/ajax_batchheads')}",{'goodsids':goodsids,'head_id_arr': head_id_arr,'is_cancle_allhead':is_cancle_allhead2,'is_clear_old':is_clear_old}, function (ret) {
  3207. if (ret.status == 1) {
  3208. $('#batchheads').hide();
  3209. layer.msg('分配成功', {
  3210. time: 1000
  3211. }, function(){
  3212. window.location.reload();
  3213. });
  3214. return
  3215. } else {
  3216. layer.msg('修改失败');
  3217. }
  3218. }, 'json');
  3219. }else{
  3220. $('#head_id_arr').val(head_id_arr);
  3221. $('#batchheads').hide();
  3222. layer.msg('团长选择成功', {
  3223. time: 1000
  3224. });
  3225. }
  3226. }else{
  3227. layer.msg('请选择团长');
  3228. }
  3229. })
  3230. //确认
  3231. var cates2 = 0;
  3232. $("body").delegate("#cates2","click",function(){
  3233. cates2 = $(this).val() ;
  3234. })
  3235. var group_heads2 = 'default';
  3236. $("body").delegate("#group_heads","click",function(){
  3237. group_heads2 = $(this).val() ;
  3238. })
  3239. $("body").delegate(".cancle","click",function(){
  3240. layer.closeAll();
  3241. })
  3242. $("body").delegate(".modal-group-head","click",function(){
  3243. var group_heads=$('#group_heads').val();
  3244. if(group_heads2 != 'default')
  3245. {
  3246. group_heads = group_heads2;
  3247. }
  3248. var selected_checkboxs = $('.table-responsive tbody tr td:first-child [type="checkbox"]:checked');
  3249. var goodsids = selected_checkboxs.map(function () {
  3250. return $(this).val()
  3251. }).get();
  3252. if(goodsids.length <=0 )
  3253. {
  3254. layer.msg('请先选择商品');
  3255. return false;
  3256. }
  3257. var is_clear_old = 0;
  3258. $('.is_cancle_old2').each(function(){
  3259. if( $(this).is(':checked') )
  3260. {
  3261. is_clear_old = 1;
  3262. }
  3263. })
  3264. var is_cancle_allhead = 0;
  3265. $('.is_cancle_allhead2').each(function(){
  3266. if( $(this).is(':checked') )
  3267. {
  3268. is_cancle_allhead = 1;
  3269. }
  3270. })
  3271. var iscover=$('input[name="iscover"]:checked').val();
  3272. $.post("{:U('goods/ajax_batchcates_headgroup')}",{'goodsids':goodsids,'groupid': group_heads,'is_cancle_allhead':is_cancle_allhead,'is_clear_old' : is_clear_old }, function (ret) {
  3273. if (ret.status == 1) {
  3274. layer.msg('分配成功', {
  3275. time: 1000
  3276. }, function(){
  3277. window.location.reload();
  3278. });
  3279. return
  3280. } else {
  3281. layer.msg('分配失败');
  3282. }
  3283. }, 'json');
  3284. })
  3285. $('.layui-table-sort').click(function(){
  3286. $(this).attr('lay-sort','asc');
  3287. })
  3288. $("body").delegate(".modal-fenlei","click",function(){
  3289. var cates=$('#cates2').val();
  3290. if(cates2 != 0)
  3291. {
  3292. cates = cates2;
  3293. }
  3294. var selected_checkboxs = $('.table-responsive tbody tr td:first-child [type="checkbox"]:checked');
  3295. var goodsids = selected_checkboxs.map(function () {
  3296. return $(this).val()
  3297. }).get();
  3298. //id="cates"
  3299. var iscover=$('input[name="iscover"]:checked').val();
  3300. $.post("{:U('goods/ajax_batchcates')}",{'goodsids':goodsids,'cates': cates,'iscover':iscover}, function (ret) {
  3301. if (ret.status == 1) {
  3302. $('#batchcates').hide();
  3303. layer.msg('修改成功', {
  3304. time: 1000
  3305. }, function(){
  3306. window.location.reload();
  3307. });
  3308. return
  3309. } else {
  3310. layer.msg('修改失败');
  3311. }
  3312. }, 'json');
  3313. })
  3314. //----
  3315. //显示时间设置
  3316. $('#batchtime,#batchtime2').click(function () {
  3317. var offs_lf = ( $(window).width() -720 )/2;
  3318. var offs_ht = ( $(window).height() -290 )/2;
  3319. $('#batch_time .modal-dialog').css('top',offs_ht+'px');
  3320. $('#batch_time .modal-dialog').css('margin-top','0px');
  3321. $('#batch_time .modal-dialog').css('left',offs_lf+'px');
  3322. $('#batch_time .modal-dialog').css('margin-left','0px');
  3323. $('#batch_time').show();
  3324. })
  3325. $('.modal-time').click(function () {
  3326. var selected_checkboxs = $('.table-responsive tbody tr td:first-child [type="checkbox"]:checked');
  3327. var goodsids = selected_checkboxs.map(function () {
  3328. return $(this).val()
  3329. }).get();
  3330. var begin_time=$('#batch_time input[name="setsametime[start]"]').val();
  3331. var end_time=$('#batch_time input[name="setsametime[end]"]').val();
  3332. $.post("{:U('goods/ajax_batchtime')}",{'goodsids':goodsids,'begin_time': begin_time,'end_time':end_time}, function (ret) {
  3333. if (ret.status == 1) {
  3334. $('#batch_time').hide();
  3335. layer.msg('设置成功');
  3336. window.location.reload();
  3337. return
  3338. } else {
  3339. layer.msg('设置失败');
  3340. }
  3341. }, 'json');
  3342. })
  3343. $(document).on("click", '[data-toggle="ajaxEdit"]', function(e) {
  3344. var obj = $(this),
  3345. url = obj.data('href') || obj.attr('href'),
  3346. data = obj.data('set') || {},
  3347. html = $.trim(obj.text()),
  3348. required = obj.data('required') || true,
  3349. edit = obj.data('edit') || 'input';
  3350. var oldval = $.trim($(this).text());
  3351. e.preventDefault();
  3352. submit = function() {
  3353. e.preventDefault();
  3354. var val = $.trim(input.val());
  3355. if (required) {
  3356. if (val == '') {
  3357. layer.msg(tip.lang.empty);
  3358. return
  3359. }
  3360. }
  3361. if (val == html) {
  3362. input.remove(), obj.html(val).show();
  3363. return
  3364. }
  3365. if (url) {
  3366. $.post(url, {
  3367. value: val
  3368. }, function(ret) {
  3369. ret = eval("(" + ret + ")");
  3370. if (ret.status == 1) {
  3371. obj.html(val).show()
  3372. } else {
  3373. layer.msg(ret.result.message, ret.result.url)
  3374. }
  3375. input.remove()
  3376. }).fail(function() {
  3377. input.remove(), layer.msg(tip.lang.exception)
  3378. })
  3379. } else {
  3380. input.remove();
  3381. obj.html(val).show()
  3382. }
  3383. obj.trigger('valueChange', [val, oldval])
  3384. }, obj.hide().html('<i class="fa fa-spinner fa-spin"></i>');
  3385. var input = $('<input type="text" class="form-control input-sm" style="width: 80%;display: inline;" />');
  3386. if (edit == 'textarea') {
  3387. input = $('<textarea type="text" class="form-control" style="resize:none" rows=3 ></textarea>')
  3388. }
  3389. obj.after(input);
  3390. input.val(html).select().blur(function() {
  3391. submit(input)
  3392. }).keypress(function(e) {
  3393. if (e.which == 13) {
  3394. submit(input)
  3395. }
  3396. })
  3397. })
  3398. </script>
  3399. </body>