da4eb38191866c0b274728e66acb29de.php 161 KB

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