addgoods.html 110 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <?php $shoname_name = D('Home/Front')->get_config_by_name('shoname'); ?>
  6. <title><?php echo $shoname; ?></title>
  7. <link rel="shortcut icon" href="" />
  8. <meta name="renderer" content="webkit">
  9. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  11. <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  12. <!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
  13. <!--[if lt IE 9]>
  14. <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
  15. <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
  16. <![endif]-->
  17. <link href="./resource/css/bootstrap.min.css?v=201903260001" rel="stylesheet">
  18. <link href="./resource/css/common.css?v=201903260001" rel="stylesheet">
  19. <script type="text/javascript">
  20. window.sysinfo = {
  21. <?php if (!empty($_W['uniacid']) ){ ?>'uniacid': '{$_W['uniacid']}',<?php } ?>
  22. <?php if( !empty($_W['acid']) ){ ?>'acid': '{$_W['acid']}',<?php } ?>
  23. <?php if (!empty($_W['openid']) ) { ?>'openid': '{$_W['openid']}',<?php } ?>
  24. <?php if( !empty($_W['uid']) ) { ?>'uid': '{$_W['uid']}',<?php } ?>
  25. 'isfounder': <?php if (!empty($_W['isfounder']) ) { ?>1<?php }else{ ?>0<?php } ?>,
  26. 'siteroot': '{$_W['siteroot']}',
  27. 'siteurl': '{$_W['siteurl']}',
  28. 'attachurl': '{$_W['attachurl']}',
  29. 'attachurl_local': '{$_W['attachurl_local']}',
  30. 'attachurl_remote': '{$_W['attachurl_remote']}',
  31. 'module' : {'url' : '<?php if( defined('MODULE_URL') ) { ?>{MODULE_URL}<?php } ?>', 'name' : '<?php if (defined('IN_MODULE') ) { ?>{IN_MODULE}<?php } ?>'},
  32. 'cookie' : {'pre': ''},
  33. 'account' : {:json_encode($_W['account'])},
  34. };
  35. </script>
  36. <script type="text/javascript" src="./resource/js/lib/jquery-1.11.1.min.js"></script>
  37. <script type="text/javascript" src="./resource/js/lib/bootstrap.min.js"></script>
  38. <script type="text/javascript" src="./resource/js/app/util.js?v=201903260001"></script>
  39. <script type="text/javascript" src="./resource/js/app/common.min.js?v=201903260001"></script>
  40. <script type="text/javascript" src="./resource/js/require.js?v=201903260001"></script>
  41. <script type="text/javascript" src="./resource/js/lib/jquery.nice-select.js?v=201903260001"></script>
  42. <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  43. <link href="/static/css/snailfish.css" rel="stylesheet">
  44. <script type="text/javascript" src="/static/js/dist/area/cascade.js"></script>
  45. <script type="text/javascript" src="/static/js/dist/select2/select2.min.js"></script>
  46. <link rel="stylesheet" href="/static/js/dist/select2/select2-bootstrap.css">
  47. <link rel="stylesheet" href="/static/js/dist/select2/select2.css">
  48. <script type="text/javascript" src="/web/resource/js/lib/moment.js"></script>
  49. <link rel="stylesheet" href="/web/resource/components/datetimepicker/jquery.datetimepicker.css">
  50. <link rel="stylesheet" href="/web/resource/components/daterangepicker/daterangepicker.css">
  51. <style type='text/css'>
  52. .tabs-container .layui-form-item {overflow: hidden;}
  53. .tabs-container .tabs-left > .nav-tabs {}
  54. .tab-goods .nav li {float:left;}
  55. .spec_item_thumb {position: relative; width: 30px; height: 20px; padding: 0; border-left: none;}
  56. .spec_item_thumb i {position: absolute; top: -5px; right: -5px;}
  57. .input-group .spec_item_thumb{padding:0px;}
  58. .multi-img-details, .multi-audio-details {margin-top:.5em;max-width: 700px; padding:0; }
  59. .multi-audio-details .multi-audio-item {width:155px; height: 40px; position:relative; float: left; margin-right: 5px;}
  60. .region-goods-details {
  61. background: #f8f8f8;
  62. margin-bottom: 10px;
  63. padding: 0 10px;
  64. }
  65. .region-goods-left{
  66. text-align: center;
  67. font-weight: bold;
  68. color: #333;
  69. font-size: 14px;
  70. padding: 20px 0;
  71. }
  72. .region-goods-right{
  73. border-left: 3px solid #fff;
  74. padding: 10px 10px;
  75. }
  76. .input-group .input-group-btn .btn:hover{background-color:#5bc0de}
  77. .layui-form-select{display:none;}
  78. .daterangepicker select.ampmselect, .daterangepicker select.hourselect, .daterangepicker select.minuteselect {
  79. width: auto!important;
  80. }
  81. .input-group .input-group-addon{}
  82. .fa-arrows{display:none;}
  83. .spec_item_thumb img{min-height:20px;}
  84. </style>
  85. </head>
  86. <body layadmin-themealias="default">
  87. <div class="layui-fluid">
  88. <div class="layui-card">
  89. <div class="layui-card-header layui-elem-quote">当前位置:<span class="line-text"><?php if( !empty($item['id'])){ ?>编辑<?php }else{ ?>添加<?php } ?>商品 <small><?php if( !empty($item['id'])){ ?>修改【<span class="text-info">{$item['goodsname']}</span>】<?php } ?></small></span></div>
  90. <div class="layui-card-body" style="padding:15px;">
  91. <form action="" method="post" class="layui-form" lay-filter="component-layui-form-item" enctype="multipart/form-data" >
  92. <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
  93. <ul class="layui-tab-title">
  94. <li <?php if( empty($_GPC['tab']) || $_GPC['tab']=='basic'){ ?>class="layui-this"<?php } ?>>基本信息</li>
  95. <li <?php if( $_GPC['tab']=='option'){ ?>class="layui-this"<?php } ?> >规格库存</li>
  96. <li <?php if( $_GPC['tab']=='des'){ ?>class="layui-this"<?php } ?> >商品详情</li>
  97. <?php $commiss_level = D('Home/Front')->get_config_by_name('commiss_level'); ?>
  98. <?php if( $pintuan_model_buy == 1 ){ ?>
  99. <li <?php if( $_GPC['tab']=='community_head_level'){ ?>class="layui-this"<?php } ?> >等级/分销</li>
  100. <?php } ?>
  101. <li <?php if( $_GPC['tab']=='pintuan_commiss_config' ){ ?>class="layui-this"<?php } ?> >佣金团</li>
  102. <?php if( $is_open_pintuan_rebate == 1 ){ ?>
  103. <li <?php if( $_GPC['tab']=='pintuan_rebate'){ ?>class="layui-this"<?php } ?> >拼团返利</li>
  104. <?php } ?>
  105. </ul>
  106. <div class="layui-tab-content" >
  107. <div class="layui-tab-item <?php if( empty($_GPC['tab']) || $_GPC['tab']=='basic'){ ?>layui-show<?php } ?>" >
  108. <!---- 基本信息begin --->
  109. <div class="region-goods-details layui-row">
  110. <div class="layui-form-item">
  111. <div class="layui-form-item" style="padding-top:10px;">
  112. <label class="layui-form-label must">商品名称<span style="color: #FF0000;font-size:16px;font-weight:900;">*</span></label>
  113. <div class="layui-input-block" style="padding-right:0;" >
  114. <input type="text" name="goodsname" id="goodsname" class="form-control" value="{$item['goodsname']}" data-rule-required="true" />
  115. </div>
  116. </div>
  117. <div class="layui-form-item">
  118. <label class="layui-form-label">商品分类</label>
  119. <div class="layui-input-block">
  120. <select id="cates" multiple="multiple" name='cates[]' class="form-control select2" >
  121. <?php foreach( $category as $c ){ ?>
  122. <option value="{$c['id']}" <?php if( is_array($item['cates']) && in_array($c['id'],$item['cates'])){ ?>selected<?php } ?> >{$c['name']}</option>
  123. <?php } ?>
  124. </select>
  125. </div>
  126. </div>
  127. <div class="layui-form-item">
  128. <label class="layui-form-label">商品简介</label>
  129. <div class="layui-input-block">
  130. <textarea name="subtitle" id="subtitle" rows="5" class="form-control" data-parent=".subtitle" maxlength="100" data-rule-maxlength="100">{$item['subtitle']}</textarea>
  131. <div class="layui-form-mid layui-word-aux">副标题的长度请控制在100字以内</div>
  132. </div>
  133. </div>
  134. <div class="layui-form-item">
  135. <label class="layui-form-label must">商品视频</label>
  136. <div class="layui-input-block gimgs">
  137. {:tpl_form_field_video('video',$item['video'] );}
  138. <span class="layui-form-mid layui-word-aux image-block">
  139. 请输入视频源地址或者选择上传视频
  140. </span>
  141. </div>
  142. </div>
  143. <div class="layui-form-item">
  144. <label class="layui-form-label must">首页商品(大图)</label>
  145. <div class="layui-input-block gimgs">
  146. {:tpl_form_field_image2('big_img',$item['big_img'])}
  147. <span class="layui-form-mid layui-word-aux image-block">此图为首页商品大图模式封面图,最佳尺寸:710*400</span>
  148. </div>
  149. </div>
  150. <div class="layui-form-item">
  151. <label class="layui-form-label must">商品图片<label style="color:red;font-size:16px;font-weight:900">*</label></label>
  152. <div class="layui-input-block gimgs" id="gimgs_mult">
  153. {:tpl_form_field_multi_image3('thumbs',$item['piclist'])}
  154. <span class="layui-form-mid layui-word-aux image-block">第一张为缩略图,建议为正方型图片,其他为详情页面图片,尺寸建议宽度为640,并保持图片大小一致,可拖拽改变图片顺序</span>
  155. </div>
  156. </div>
  157. <div class="layui-form-item">
  158. <label class="layui-form-label">分享标题</label>
  159. <div class="layui-input-block">
  160. <input type="text" name="share_title" class="form-control" value="{$item['share_title']}" />
  161. <div class="layui-form-mid layui-word-aux"></div>
  162. </div>
  163. </div>
  164. <div class="layui-form-item">
  165. <label class="layui-form-label ">分享图片</label>
  166. <div class="layui-input-block gimgs">
  167. {:tpl_form_field_image2('goods_share_image',$item['goods_share_image'])}
  168. <span class="layui-form-mid layui-word-aux image-block">此图为商品详情页分享图片(比例为长宽比5:4)</span>
  169. </div>
  170. </div>
  171. <?php if($is_updown){ ?>
  172. <div class="layui-form-item">
  173. <label class="layui-form-label">商品状态</label>
  174. <div class="layui-input-block">
  175. <label class="radio-inline"><input type="radio" name="grounding" value="1" <?php if( !isset($item['grounding']) || $item['grounding'] == 1){ ?>checked="true"<?php } ?> title="上架" /> </label>
  176. <label class="radio-inline"><input type="radio" name="grounding" value="0" <?php if( isset($item['grounding']) && $item['grounding'] == 0){ ?>checked="true"<?php } ?> title="下架" /> </label>
  177. </div>
  178. </div>
  179. <?php } ?>
  180. <?php if($is_index){ ?>
  181. <div class="layui-form-item">
  182. <label class="layui-form-label">首页推荐</label>
  183. <div class="layui-input-block">
  184. <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>
  185. <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>
  186. </div>
  187. </div>
  188. <?php } ?>
  189. <div class="layui-form-item price" >
  190. <label class="layui-form-label">拼团价格<label style="color:red;font-size:16px;font-weight:900">*</label></label>
  191. <div class="layui-input-block">
  192. <div class="input-group">
  193. <input type="text" name="pinprice" id="pinprice" class="form-control" value="{$item['pinprice']}" placeholder=""/>
  194. <span class="input-group-addon">元 </span>
  195. <span class="input-group-addon">单独购买价</span>
  196. <input type="text" name="price" id="price" class="form-control" value="{$item['price']}" placeholder=""/>
  197. <span class="input-group-addon">元 </span>
  198. <span class="input-group-addon">原价(市场价、划线价)</span>
  199. <input type="text" name="productprice" id="productprice" class="form-control" value="{$item['productprice']}" placeholder=""/>
  200. <span class="input-group-addon">元 </span>
  201. <span class="input-group-addon">成本价</span>
  202. <input type="text" name="costprice" id="costpriceprice" class="form-control" value="{$item['costprice']}" placeholder=""/>
  203. <span class="input-group-addon">元 </span>
  204. </div>
  205. <span class='layui-form-mid layui-word-aux'>如未启用商品规格,请填写商品价格</span>
  206. </div>
  207. </div>
  208. <div class="layui-form-item price" >
  209. <label class="layui-form-label">拼团人数<label style="color:red;font-size:16px;font-weight:900">*</label></label>
  210. <div class="layui-input-block">
  211. <div class="input-group">
  212. <input type="text" name="pin_count" id="pin_count" class="form-control" value="{$item['pin_count']}" placeholder="请填写拼团人数"/>
  213. <span class="input-group-addon">人 </span>
  214. <span class="input-group-addon">拼团小时数</span>
  215. <input type="text" name="pin_hour" id="pin_hour" class="form-control" value="{$item['pin_hour']}" placeholder="请填写拼团小时数"/>
  216. <span class="input-group-addon">时</span>
  217. </div>
  218. <span class='layui-form-mid layui-word-aux'>以上拼团必填参数</span>
  219. </div>
  220. </div>
  221. <?php if($is_vir_count){ ?>
  222. <div class="layui-form-item" >
  223. <label class="layui-form-label">已出售数</label>
  224. <div class="layui-input-block">
  225. <div class="input-group">
  226. <input type="text" name="sales" id="sales" class="form-control" value="{$item['sales']}" />
  227. <span class="input-group-addon">备注:前台销量=虚拟销量+实际销量</span>
  228. </div>
  229. </div>
  230. </div>
  231. <?php } ?>
  232. <div class="layui-form-item" >
  233. <label class="layui-form-label">提货时间</label>
  234. <div class="col-sm-10 col-xs-12" id="radPickupDateTip">
  235. <?php $item['pick_up_type'] = isset($item['pick_up_type']) ? $item['pick_up_type'] : 1; ?>
  236. <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>
  237. <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>
  238. <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>
  239. <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>
  240. <input class="form-control " id="txtPickupDateTip" name="pick_up_modify" style="vertical-align: sub; <?php if( isset($item['pick_up_type']) && $item['pick_up_type'] ==3 ){ ?>display:inline-block;<?php }else{ ?>display: none;<?php } ?>width: 120px;" type="text" value="{$item['pick_up_modify']}">
  241. <div style="clear:both;"></div>
  242. <span class="layui-form-mid layui-word-aux">系统会根据当前日期自动生成具体提货时间,或直接显示自定义内容</span>
  243. </div>
  244. </div>
  245. <div class="layui-form-item">
  246. <label class="layui-form-label">自定义标签</label>
  247. <div class="layui-input-block">
  248. <div class="input-group " style="margin: 0;">
  249. <input type="text" disabled value="{$item['label']['id']}" class="form-control valid" name="labelname" placeholder="" id="label_id">
  250. <span class="input-group-btn">
  251. <span data-input="#label_id" id="chose_label_id" class="btn btn-default">选择标签</span>
  252. </span>
  253. </div>
  254. <?php if( $item['label']){ ?>
  255. <div class="input-group " style="margin: 0;">
  256. <div class="layadmin-text-center choose_user">
  257. <div class="" style="">{$item['label']['tagname']}</div>
  258. <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this,'label_id')"><i class="layui-icon">&#xe640;</i></button>
  259. </div>
  260. </div>
  261. <?php } ?>
  262. </div>
  263. </div>
  264. <?php if( $pintuan_model_buy == 1 ){ ?>
  265. <?php if($is_open_only_express == 1){ ?>
  266. <div class="layui-form-item" >
  267. <label class="layui-form-label">仅快递</label>
  268. <div class="col-sm-10 col-xs-12" >
  269. <input type="checkbox" lay-skin="primary" name="is_only_express" <?php if(isset($item['is_only_express']) && $item['is_only_express'] ==1 ){ ?> checked <?php } ?> value="1" />
  270. <div style="clear:both;"></div>
  271. <span class="layui-form-mid layui-word-aux">开启仅快递后,该商品只会快递商品一起下单</span>
  272. </div>
  273. </div>
  274. <?php } ?>
  275. <?php }else{ ?>
  276. <input type="hidden" name="is_only_express" value="1" />
  277. <?php } ?>
  278. <div class="layui-form-item dispatch_info">
  279. <label class="layui-form-label">运费设置</label>
  280. <div class="layui-input-block" style='padding-left:0'>
  281. <div class="input-group">
  282. <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>
  283. <select class="form-control tpl-category-parent select2" id="dispatchid" name="dispatchid">
  284. <?php foreach( $dispatch_data as $dispatch_item ){ ?>
  285. <option value="{$dispatch_item['id']}" <?php if( $item['dispatchid'] == $dispatch_item['id']){ ?>selected="true"<?php } ?>>{$dispatch_item['name']}</option>
  286. <?php } ?>
  287. </select>
  288. </div>
  289. </div>
  290. </div>
  291. <div class="layui-form-item dispatch_info">
  292. <label class="layui-form-label"></label>
  293. <div class="layui-input-block" style='padding-left:0'>
  294. <div class="input-group">
  295. <span class='input-group-addon' style='border:none;padding:0px;'><label class="radio-inline" style='margin-top:-7px;' >
  296. <input type="radio"name="dispatchtype" value="1" <?php if( $item['dispatchtype'] == 1){ ?>checked="true"<?php } ?> title="统一邮费" /> </label></span>
  297. <input type="text" name="dispatchprice" id="dispatchprice" class="form-control" value="{$item['dispatchprice']}" />
  298. <span class="input-group-addon">元</span>
  299. </div>
  300. </div>
  301. </div>
  302. <?php if($open_buy_send_score == 1){ ?>
  303. <div class="layui-form-item" >
  304. <label class="layui-form-label">下单送积分</label>
  305. <div class="col-sm-10 col-xs-12" id="send_score_div">
  306. <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" />
  307. <input class="form-control " id="send_score_divTip" name="send_socre" style="vertical-align: sub; <?php if(isset($item['is_modify_sendscore']) && $item['is_modify_sendscore'] ==1){ ?>display:inline;<?php }else{ ?>display: none;<?php } ?>width: 120px;" type="text" value="{$item['send_socre']}">
  308. <div style="clear:both;"></div>
  309. <span class="layui-form-mid layui-word-aux">赠送数量 = 商品数量 * 下单送积分数量(未开启,则使用系统全局设置)</span>
  310. </div>
  311. </div>
  312. <?php } ?>
  313. <?php if($index_sort_method == 1){ ?>
  314. <div class="layui-form-item" >
  315. <label class="layui-form-label">首页排序</label>
  316. <div class="layui-input-block">
  317. <div class="input-group">
  318. <input type="text" name="index_sort" id="index_sort" class="form-control" value="{$item['index_sort']}" />
  319. <span class="input-group-addon">备注:排序越大显示越靠前</span>
  320. </div>
  321. </div>
  322. </div>
  323. <?php } ?>
  324. </div>
  325. </div>
  326. <div class="region-goods-details ">
  327. <div class="layui-form-item">
  328. <div class="layui-form-item">
  329. <label class="layui-form-label">团购时间</label>
  330. <div class="layui-input-block">
  331. {: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);}
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. <div class="region-goods-details ">
  337. <div class="layui-form-item">
  338. <div class="layui-form-item">
  339. <label class="layui-form-label">单次限购</label>
  340. <div class="layui-input-block">
  341. <input type="text" name="one_limit_count" class="form-control " value="{$item['one_limit_count']}" />
  342. <div class="layui-form-mid layui-word-aux">用户单次提交订单最多可购买数,默认为0表示不限制</div>
  343. </div>
  344. </div>
  345. <div class="layui-form-item">
  346. <label class="layui-form-label">历史限购</label>
  347. <div class="layui-input-block">
  348. <input type="text" name="total_limit_count" class="form-control" value="{$item['total_limit_count']}" />
  349. <div class="layui-form-mid layui-word-aux">用户历史累积最多可购买数,默认为0表示不限制</div>
  350. </div>
  351. </div>
  352. <?php if( $pintuan_model_buy == 1 ){ ?>
  353. <?php if( empty($community_head_level) || count($community_head_level) ==1 || $is_head_takegoods ==0 ){ ?>
  354. <div class="layui-form-item">
  355. <label class="layui-form-label"></label>
  356. <div class="layui-col-sm-10 ">
  357. <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="商品启用独立团长提成" />
  358. <br />
  359. <div class="layui-form-mid layui-word-aux" style="margin-left: 155px;" >勾选使用 商品独立团长提成 计算佣金,不勾选则使用 后台——“团长设置”中团长提成比例 计算佣金</div>
  360. </div>
  361. </div>
  362. <div class="layui-form-item" id="head_commission_div2" <?php if( empty($item['is_community_head_commission'])){ ?>style="display:none"<?php } ?>>
  363. <label class="layui-form-label">团长提成</label>
  364. <?php if( !empty($community_money_type) && $community_money_type ==1 ){ ?>
  365. <div class="layui-col-sm-10 ">
  366. <div class="input-group">
  367. <input type="text" name="community_head_commission" id="community_head_commission" class="form-control valid" value="<?php if( empty($item) ){ ?>{$communityhead_commission}<?php }else{ ?>{$item['community_head_commission']}<?php } ?>" />
  368. <span class="input-group-addon">元 </span>
  369. </div>
  370. <div class="layui-form-mid layui-word-aux">预计团长可得佣金¥<font ><?php if( isset($item['community_head_commission']) ){ ?>{:round( $item['community_head_commission'] ,2) }<?php }else{ ?>0.00<?php } ?></font></div>
  371. </div>
  372. <?php }else{ ?>
  373. <div class="layui-col-sm-10 ">
  374. <div class="input-group">
  375. <input type="text" name="community_head_commission" id="community_head_commission" class="form-control valid" value="<?php if( empty($item) ){ ?>{$communityhead_commission}<?php }else{ ?>{$item['community_head_commission']}<?php } ?>" />
  376. <span class="input-group-addon">% </span>
  377. </div>
  378. <div class="layui-form-mid layui-word-aux">预计团长可得佣金¥<font id="precommiss_head_money_tip"><?php if( isset($item['community_head_commission']) ){ ?>{:round( ($item['community_head_commission']*$item['price'])/100 ,2) }<?php }else{ ?>0.00<?php } ?></font>,将根据商品最终的成交价格来计算佣金</div>
  379. </div>
  380. <?php } ?>
  381. </div>
  382. <?php } ?>
  383. <div class="layui-form-item">
  384. <label class="layui-form-label">所有团长可销售</label>
  385. <div class="layui-input-block ">
  386. <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" />
  387. </div>
  388. </div>
  389. <?php } ?>
  390. </div>
  391. </div>
  392. <script language="javascript">
  393. $(function () {
  394. $('#price').blur(function(){
  395. var price = parseFloat( $("#price").val() );
  396. var community_head_commission = parseFloat( $("#community_head_commission").val() );
  397. if(price > 0 && community_head_commission >0)
  398. {
  399. $('#precommiss_head_money_tip').html( ( (price * community_head_commission) /100 ).toFixed(2) );
  400. }else{
  401. $('#precommiss_head_money_tip').html('0.00');
  402. }
  403. })
  404. $("#community_head_commission").blur(function(){
  405. var price = parseFloat( $("#price").val() );
  406. var community_head_commission = parseFloat( $(this).val() );
  407. if(price > 0 && community_head_commission >0)
  408. {
  409. $('#precommiss_head_money_tip').html( ( (price * community_head_commission) /100 ).toFixed(2) );
  410. }else{
  411. $('#precommiss_head_money_tip').html('0.00');
  412. }
  413. });
  414. $('#radPickupDateTip input[type=radio]').click(function(){
  415. var s_val = $(this).val();
  416. if(s_val == 3)
  417. {
  418. $('#txtPickupDateTip').css('display','inline-block');
  419. }else{
  420. $('#txtPickupDateTip').css('display', 'none');
  421. }
  422. })
  423. $("input[name=isstatustime]").off('click').on('click',function () {
  424. if($(this).val()==1){
  425. $("#shelves").show()
  426. }else{
  427. $("#shelves").hide();
  428. }
  429. })
  430. })
  431. </script>
  432. <!--- 基本信息 end -->
  433. </div>
  434. <div class="layui-tab-item <?php if( $_GPC['tab']=='option'){ ?>layui-show<?php } ?>" >
  435. <!--规格begin-->
  436. <div class="region-goods-details ">
  437. <div class="region-goods-left col-sm-2">规格库存</div>
  438. <div class="region-goods-right col-sm-10">
  439. <div class="layui-form-item">
  440. <label class="layui-form-label">商品编码</label>
  441. <div class="layui-input-block">
  442. <input type="text" name="codes" class="form-control" value="{$item['codes']}" />
  443. <div class="help-block">商品编码 用部分商家用于统计</div>
  444. </div>
  445. </div>
  446. <div class="layui-form-item">
  447. <label class="layui-form-label">重量</label>
  448. <div class="layui-input-block">
  449. <div class="input-group fixsingle-input-group">
  450. <input type="text" name="weight" id="weight" <?php if( $item['hasoption']){ ?>readonly<?php } ?> class="form-control hasoption" value="{$item['weight']}"/>
  451. <span class="input-group-addon">克</span>
  452. </div>
  453. </div>
  454. </div>
  455. <div class="layui-form-item">
  456. <label class="layui-form-label">库存<label style="font-size:16px;font-weight:900;color: #ff0000;">*</label></label>
  457. <div class="layui-input-block">
  458. <input type="text" name="total" id="total" class="form-control hasoption" value="{$item['total']}" style="width:150px;display: inline;margin-right: 20px;" <?php if( $item['hasoption']){ ?>readonly<?php } ?>/>
  459. <span class="help-block">商品的剩余数量, 如启用多规格,则此处设置无效.</span>
  460. </div>
  461. </div>
  462. </div>
  463. </div>
  464. <div class="region-goods-details ">
  465. <div class="region-goods-left col-sm-2">
  466. 规格
  467. </div>
  468. <div class="region-goods-right col-sm-10">
  469. <div class="layui-form-item">
  470. <div class="layui-row" style=''>
  471. <input type="checkbox" lay-skin="primary" title="启用商品规格" lay-filter="hasoption" id="hasoption" value="1" name="hasoption" <?php if( $item['hasoption']==1){ ?>checked<?php } ?> />
  472. <span class="help-block">启用商品规格后,商品的价格及库存以商品规格为准,库存设置为0则会到”已售罄“中,手机也不会显示</span>
  473. </div>
  474. </div>
  475. <div id='tboption' style="padding-left:15px;<?php if( $item['hasoption']!=1){ ?>display:none<?php } ?>" >
  476. <div class="alert alert-info" style="display:none;">
  477. 1. 拖动规格可调整规格显示顺序, 更改规格及规格项后请点击下方的【刷新规格项目表】来更新数据。<br/>
  478. 2. 每一种规格代表不同型号,例如颜色为一种规格,尺寸为一种规格,如果设置多规格,手机用户必须每一种规格都选择一个规格项,才能添加购物车或购买。
  479. </div>
  480. <div id='specs'>
  481. <?php foreach( $item['allspecs'] as $spec ){ ?>
  482. <!--spec-->
  483. <div class='spec_item spec_class_{$cur_cate_id}' id="spec_{$spec['id']}" >
  484. <div style='border:1px solid #e7eaec;padding:10px;margin-bottom: 10px;' >
  485. <input name="spec_id[]" type="hidden" class="form-control spec_id" value="{$spec['id']}"/>
  486. <div class="form-group">
  487. <div class="col-sm-12">
  488. <div class='input-group'>
  489. <input name="spec_title[{$spec['id']}]" type="text" class="form-control spec_title" value="{$spec['title']}" placeholder="规格名称 (比如: 颜色)"/>
  490. <div class='input-group-btn'>
  491. <a href="javascript:;" id="add-specitem-{$spec['id']}" specid='{$spec['id']}' class='btn btn-info add-specitem' onclick="addSpecItem('{$spec['id']}')"><i class="fa fa-plus"></i> 添加规格项</a>
  492. <a href="javascript:void(0);" class='btn btn-danger' onclick="removeSpec('{$spec['id']}')"><i class="fa fa-remove"></i></a>
  493. </div>
  494. </div>
  495. </div>
  496. </div>
  497. <div class="form-group">
  498. <div class="col-md-12">
  499. <div id='spec_item_{$spec['id']}' class='spec_item_items'>
  500. <?php foreach( $spec['items'] as $specitem ){ ?>
  501. <!--spec_item begin-->
  502. <div class="spec_item_item" style="float:left;margin:5px;width:250px; position: relative">
  503. <input type="hidden" class="form-control spec_item_show" name="spec_item_show_{$spec['id']}[]" value="{$specitem['show']}" />
  504. <input type="hidden" class="form-control spec_item_id" name="spec_item_id_{$spec['id']}[]" value="{$specitem['id']}" />
  505. <div class="input-group">
  506. <span class="input-group-addon">
  507. <input type="checkbox" lay-skin="primary" <?php if( $specitem['id']>0){ ?>checked<?php } ?> value="1" onclick='showItem(this)'>
  508. </span>
  509. <input type="text" class="form-control spec_item_title" onblur="refreshOptions()" name="spec_item_title_{$spec['id']}[]" VALUE="{$specitem['title']}" />
  510. <span class="input-group-addon spec_item_thumb <?php if( !empty($specitem['thumb'])){ ?>has_thumb<?php } ?>">
  511. <input type='hidden' name="spec_item_thumb_{$spec['id']}[]" value="{$specitem['thumb']}"
  512. />
  513. <img onclick="selectSpecItemImage(this)"
  514. src="<?php if( empty($specitem['thumb'])){ ?><?php }else{ ?>{:resize($specitem['thumb'],100)}<?php } ?>" style='width:100%;'
  515. <?php if( !empty($specitem['thumb'])){ ?>
  516. data-toggle='popover'
  517. data-html ='true'
  518. data-placement='top'
  519. data-trigger ='hover'
  520. data-content="<img src='{:tomedia($specitem['thumb'])}' style='width:100px;height:100px;' />"
  521. <?php } ?>
  522. >
  523. <i class="fa fa-times-circle" <?php if( empty($specitem['thumb'])){ ?>style="display:none"<?php } ?>></i>
  524. </span>
  525. <span class="input-group-addon">
  526. <a href="javascript:;" onclick="removeSpecItem(this)" title='删除'><i class="fa fa-times"></i></a>
  527. <a href="javascript:;" class="fa fa-arrows" title="拖动调整显示顺序" ></a>
  528. </span>
  529. </div>
  530. </div>
  531. <!--spec_item end-->
  532. <?php } ?>
  533. </div>
  534. </div>
  535. </div>
  536. </div>
  537. </div>
  538. <!--end spec-->
  539. <?php } ?>
  540. </div>
  541. <table class="table">
  542. <tr>
  543. <td>
  544. <div class="layui-form-item">
  545. <label class="col-sm-2 control-label">选择已用规格</label>
  546. <div class="col-sm-8 col-xs-12">
  547. <select id="cates2" name='options[]' class="form-control select2" style='width:605px;' multiple='' >
  548. <?php foreach( $spec_list as $c ){ ?>
  549. <option value="{$c['id']}" data-names="{$c['value_str']}">{$c['name']}</option>
  550. <?php } ?>
  551. </select>
  552. </div>
  553. </div>
  554. <td>
  555. </tr>
  556. <tr>
  557. <td>
  558. <h4>
  559. <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>
  560. <a style="display:none;" href="javascript:;" onclick="refreshOptions();" title="刷新规格项目表" class="btn btn-primary"><i class="fa fa-refresh"></i> 刷新规格项目表</a>
  561. </h4>
  562. </td>
  563. </tr>
  564. <tr style="display: none;" >
  565. <td>
  566. <div class="alert alert-danger">警告:规格数据有变动,请重新点击上方 [刷新规格项目表] 按钮!</div>
  567. </td>
  568. </tr>
  569. </table>
  570. <div class="alert alert-info wholesalewarning" style="display:none;">
  571. </div>
  572. <div id="options" style="padding:0;">{$item['html']}</div>
  573. </div>
  574. </div>
  575. </div>
  576. <input type="hidden" name="optionArray" value=''>
  577. <input type="hidden" name="isdiscountDiscountsArray" value=''>
  578. <input type="hidden" name="discountArray" value=''>
  579. <input type="hidden" name="commissionArray" value=''>
  580. <!--规格end-->
  581. </div>
  582. <div class="layui-tab-item <?php if( $_GPC['tab']=='des'){ ?>layui-show<?php } ?>" >
  583. <div class="region-goods-details row">
  584. <div class="region-goods-left col-sm-2">商品详情</div>
  585. <div class=" region-goods-right col-sm-10">
  586. <div class="" >
  587. {:tpl_ueditor('content',htmlspecialchars_decode($item['content']),array('height'=>'300'))}
  588. </div>
  589. </div>
  590. </div>
  591. </div>
  592. <?php if( $pintuan_model_buy == 1 ){ ?>
  593. <!---团长分销begin --->
  594. <div class="layui-tab-item <?php if( $_GPC['tab']=='community_head_level'){ ?>layui-show<?php } ?>" >
  595. <div class="region-goods-details row">
  596. <?php if( !empty($community_head_level) && count($community_head_level) > 1 && $is_head_takegoods == 1 ) { ?>
  597. <div class="region-goods-left col-sm-2">团长提成</div>
  598. <div class="region-goods-right col-sm-10">
  599. <div class="form-group">
  600. <label class="col-sm-2 control-label">独立规则</label>
  601. <div class="col-sm-9 col-xs-12">
  602. <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="启用独立团长提成" />
  603. <span class="help-block">默认使用团长等级提成设置,启用独立团长提成设置,此商品拥有独自的团长提成比例,不受团长等级比例及默认设置限制</span>
  604. </div>
  605. </div>
  606. <div id="head_commission_div" <?php if( empty($item['is_modify_head_commission'])){ ?>style="display:none"<?php } ?> >
  607. <?php foreach($community_head_level as $head_level){ ?>
  608. <div class="form-group">
  609. <label class="col-sm-2 control-label"><?php echo $head_level['levelname']; ?></label>
  610. <div class="col-sm-4 col-xs-12">
  611. <div class="input-group">
  612. <input type="text" name="head_level<?php echo $head_level['id']; ?>" class="form-control" value="<?php echo $item['head_level'.$head_level['id']]; ?>" />
  613. <?php if( !empty($community_money_type) && $community_money_type ==1 ){ ?>
  614. <div class="input-group-addon">元 </div>
  615. <?php }else{ ?>
  616. <div class="input-group-addon">%</div>
  617. <?php } ?>
  618. </div>
  619. </div>
  620. </div>
  621. <?php } ?>
  622. </div>
  623. </div>
  624. <?php } ?>
  625. <?php if($commiss_level > 0){ ?>
  626. <div class="region-goods-details row">
  627. <div class="region-goods-left col-sm-2">会员分销</div>
  628. <div class="region-goods-right col-sm-10">
  629. <div class="form-group">
  630. <label class="col-sm-2 control-label">是否参与分销</label>
  631. <div class="col-sm-9 col-xs-12">
  632. <input type="radio" value="0" name="nocommission" <?php if($item['nocommission']==0){ ?>checked<?php } ?> title="参与分销" />
  633. <input type="radio" value="1" name="nocommission" <?php if($item['nocommission']==1){ ?>checked<?php } ?> title="不参与分销" />
  634. <span class="help-block">如果不参与分销,则不产生分销佣金</span>
  635. </div>
  636. </div>
  637. <div class="form-group">
  638. <label class="col-sm-2 control-label">独立规则</label>
  639. <div class="col-sm-9 col-xs-12">
  640. <input type="checkbox" lay-filter="hascommission" lay-skin="primary" id="hascommission" value="1" name="hascommission" <?php if($item['hascommission']==1){ ?>checked<?php } ?> title="启用独立佣金比例" />
  641. <span class="help-block">启用独立佣金设置,此商品拥有独自的佣金比例,不受分销商等级比例及默认设置限制</span>
  642. </div>
  643. </div>
  644. <div style="clear:both;"></div>
  645. <div id="commission_div" <?php if(empty($item['hascommission'])){ ?>style="display:none"<?php } ?> >
  646. <div id="commission_0" <?php if($commission_type!=0){ ?> style="display:none;" <?php } ?>>
  647. <div class='alert alert-danger'>
  648. 如果比例为空,则使用固定规则,如果都为空则无分销佣金
  649. </div>
  650. <?php if($set['commiss_level']>=1){ ?>
  651. <div class="form-group">
  652. <label class="col-sm-2 control-label">一级分销</label>
  653. <div class="col-sm-4 col-xs-12">
  654. <div class="input-group">
  655. <input type="text" name="commission1_rate" id="commission1_rate" class="form-control" value="{$item['commission1_rate']}" />
  656. <div class="input-group-addon">% 固定</div>
  657. <input type="text" name="commission1_pay" id="commission1_pay" class="form-control" value="{$item['commission1_pay']}" />
  658. <div class="input-group-addon">元</div>
  659. </div>
  660. </div>
  661. </div>
  662. <?php } ?>
  663. <?php if($set['commiss_level']>=2){ ?>
  664. <div class="form-group">
  665. <label class="col-sm-2 control-label">二级分销</label>
  666. <div class="col-sm-4 col-xs-12">
  667. <div class="input-group">
  668. <input type="text" name="commission2_rate" id="commission2_rate" class="form-control" value="{$item['commission2_rate']}" />
  669. <div class="input-group-addon">% 固定</div>
  670. <input type="text" name="commission2_pay" id="commission2_pay" class="form-control" value="{$item['commission2_pay']}" />
  671. <div class="input-group-addon">元</div>
  672. </div>
  673. </div>
  674. </div>
  675. <?php } ?>
  676. <?php if($set['commiss_level']>=3){ ?>
  677. <div class="form-group">
  678. <label class="col-sm-2 control-label">三级分销</label>
  679. <div class="col-sm-4 col-xs-12">
  680. <div class="input-group">
  681. <input type="text" name="commission3_rate" id="commission3_rate" class="form-control" value="{$item['commission3_rate']}" />
  682. <div class="input-group-addon">% 固定</div>
  683. <input type="text" name="commission3_pay" id="commission3_pay" class="form-control" value="{$item['commission3_pay']}" />
  684. <div class="input-group-addon">元</div>
  685. </div>
  686. </div>
  687. </div>
  688. <?php } ?>
  689. </div>
  690. </div>
  691. </div>
  692. </div>
  693. <?php } ?>
  694. <!--
  695. <?php if($mb_level > 0){ ?>
  696. <div class="region-goods-details row">
  697. <div class="region-goods-left col-sm-2">会员等级折扣</div>
  698. <div class="region-goods-right col-sm-10">
  699. <div class="form-group">
  700. <label class="col-sm-2 control-label">是否参与会员折扣</label>
  701. <div class="col-sm-9 col-xs-12">
  702. <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="参与" />
  703. <input type="radio" value="0" name="is_mb_level_buy" <?php if($item['is_mb_level_buy']==0){ ?>checked<?php } ?> title="不参与" />
  704. <span class="help-block">如果不参与会员折扣,则不打折</span>
  705. </div>
  706. </div>
  707. </div>
  708. </div>
  709. <?php } ?> -->
  710. </div>
  711. <!--团长分销end--->
  712. </div>
  713. <?php } ?>
  714. <!--佣金团begin-->
  715. <div class="layui-tab-item <?php if( $_GPC['tab']=='pintuan_commiss_config' ){ ?>layui-show<?php } ?>" >
  716. <div class="region-goods-details row">
  717. <div class="region-goods-left col-sm-2">新人参团</div>
  718. <div class="region-goods-right col-sm-10">
  719. <div class="form-group" >
  720. <label class="col-sm-2 control-label">新人参团</label>
  721. <div class="col-sm-9 col-xs-12">
  722. <input type="checkbox" lay-skin="primary" lay-filter="is_newman" name="is_newman" <?php if( isset($item['is_newman']) && $item['is_newman'] ==1 ){ ?> checked <?php } ?> value="1" title="仅限新用户" />
  723. <div style="clear:both;"></div>
  724. <span class="layui-form-mid layui-word-aux">
  725. “新用户”为没有下单支付过的用户,邀请新用户进入拼团并且下单为有效用户(新用户购买拼团任意商品都可以)。”不勾选“为全部用户<br/>
  726. (开启“新人参团”,“拼团返利”设置失效)
  727. </span>
  728. </div>
  729. </div>
  730. </div>
  731. <div class="region-goods-left col-sm-2">佣金团</div>
  732. <div class="region-goods-right col-sm-10">
  733. <div class="form-group">
  734. <label class="col-sm-2 control-label">是否开启</label>
  735. <div class="col-sm-9 col-xs-12">
  736. <input type="checkbox" lay-skin="primary" lay-filter="commissTuan" name="is_commiss_tuan" <?php if( isset($item['is_commiss_tuan']) && $item['is_commiss_tuan'] ==1 ){ ?> checked <?php } ?> value="1" title="启用佣金团" />
  737. <span class="help-block">发起拼团,邀请的好友参团成功,团长会产生相应的佣金,佣金直接到可提现账户(开启“佣金团”,“拼团返利”设置失效)</span>
  738. </div>
  739. </div>
  740. <div class="form-group" id="zero_opentuan_div" <?php if(isset($item['is_commiss_tuan']) && $item['is_commiss_tuan'] ==1){ ?> <?php }else{ ?> style="display:none;"<?php } ?>>
  741. <label class="col-sm-2 control-label">0元开团</label>
  742. <div class="col-sm-9 col-xs-12">
  743. <input type="checkbox" lay-skin="primary" name="is_zero_open" <?php if( isset($item['is_zero_open']) && $item['is_zero_open'] ==1 ){ ?> checked <?php } ?> value="1" title="启用“0元开团”" />
  744. <div style="clear:both;"></div>
  745. <span class="layui-form-mid layui-word-aux">发起拼团,发起拼团的人不生成订单,邀请的好友参团成功,团长会产生相应的佣金,</span>
  746. </div>
  747. </div>
  748. <div class="form-group" id="commiss_money_div" <?php if( $item['is_commiss_tuan']==0 ){ ?>style="display:none;"<?php } ?>>
  749. <label class="col-sm-2 control-label">佣金设置</label>
  750. <div class="col-sm-9 col-xs-12">
  751. <div class="input-group">
  752. <div class="input-group-addon">商品佣金</div>
  753. <input type="text" name="commiss_tuan_money1" class="form-control" value="<?php if($item['commiss_type'] == 0){ ?>{$item['commiss_money']}<?php }else{ ?>0<?php } ?>" />
  754. <div class="input-group-addon">% 固定</div>
  755. <input type="text" name="commiss_tuan_money2" class="form-control" value="<?php if($item['commiss_type'] == 1){ ?>{$item['commiss_money']}<?php }else{ ?>0<?php } ?>" />
  756. <div class="input-group-addon">元</div>
  757. </div>
  758. <div style="clear:both;"></div>
  759. <span class="layui-form-mid layui-word-aux">
  760. 填写佣金规则,如果是数字(只能是纯数字),则是以固定金额给佣金<br>
  761. 例如 1 就是按照参团1人,给团长1元<br>
  762. 如果是百分号<br>
  763. 例如 1% 则是以支付商品金额的百分比给佣金<br/>
  764. 两者都填写以支付商品金额的百分比给佣金
  765. </span>
  766. </div>
  767. </div>
  768. </div>
  769. </div>
  770. </div>
  771. <!--佣金团end-->
  772. <!--拼团返利begin-->
  773. <div class="layui-tab-item <?php if( $_GPC['tab']=='pintuan_rebate' ){ ?>layui-show<?php } ?>" >
  774. <div class="region-goods-details row">
  775. <div class="region-goods-left col-sm-2">拼团返利</div>
  776. <div class="region-goods-right col-sm-10">
  777. <div class="form-group" >
  778. <label class="col-sm-2 control-label">拼团返利</label>
  779. <div class="col-sm-9 col-xs-12">
  780. <input type="checkbox" lay-skin="primary" lay-filter="is_pintuan_rebate" name="is_pintuan_rebate" <?php if(isset($item['is_pintuan_rebate']) && $item['is_pintuan_rebate'] == 1){ ?> checked <?php } ?> value="1" title="开启" />
  781. <div style="clear:both;"></div>
  782. <span class="layui-form-mid layui-word-aux">开启拼团返利后,佣金团以及新人参团设置失效,拼团成功后,根据设置的随机人数进行发货,其他人支付金额原路退款</span>
  783. </div>
  784. </div>
  785. <div class="form-group" >
  786. <label class="col-sm-2 control-label">随机发货人数</label>
  787. <div class="col-sm-9 col-xs-12">
  788. <div class="input-group" style="width: 300px;">
  789. <input type="text" name="random_delivery_count" id="random_delivery_count" class="form-control" value="{$item['random_delivery_count']}" placeholder="请填写随机发货人数"/>
  790. <span class="input-group-addon">人 </span>
  791. </div>
  792. <div style="clear:both;"></div>
  793. <span class="layui-form-mid layui-word-aux">随机发货人数不能大于拼团人数,拼团成功随机人数进行发货,其他人员支付金额原路退款,并进行返利奖励发放</span>
  794. </div>
  795. </div>
  796. <div class="form-group" >
  797. <label class="col-sm-2 control-label">返利奖励</label>
  798. <div class="col-sm-9 col-xs-12">
  799. <div class="input-group">
  800. <label class='radio-inline'>
  801. <input type='radio' name='rebate_reward' lay-filter="rebate_reward" value='1' <?php if(!isset($item['rebate_reward']) || $item['rebate_reward'] == 1){ ?>checked <?php } ?> title="送积分" />
  802. </label>
  803. <label class='radio-inline'>
  804. <input type='radio' name='rebate_reward' lay-filter="rebate_reward" value='2' <?php if(isset($item['rebate_reward']) && $item['rebate_reward'] == 2){ ?>checked <?php } ?> title="送余额" />
  805. </label>
  806. </div>
  807. <div style="clear:both;"></div>
  808. <span class="layui-form-mid layui-word-aux">拼团失败人员获得的奖励内容,直接发放到余额和积分里面</span>
  809. </div>
  810. </div>
  811. <div class="form-group" id="reward_point_set" <?php if(!isset($item['rebate_reward']) || $item['rebate_reward'] == 1){ ?>style="display:block;" <?php }else{ ?>style="display:none;"<?php }?>>
  812. <label class="col-sm-2 control-label"></label>
  813. <div class="col-sm-9 col-xs-12">
  814. <div class="input-group" style="width: 200px;">
  815. <span class="input-group-addon">赠送 </span>
  816. <input type="text" name="reward_point" id="reward_point" class="form-control" value="{$item['reward_point']}" placeholder=""/>
  817. <span class="input-group-addon">积分 </span>
  818. </div>
  819. <div style="clear:both;"></div>
  820. <span class="layui-form-mid layui-word-aux">设置赠送的积分数量</span>
  821. </div>
  822. </div>
  823. <div class="form-group" id="reward_balance_set" <?php if(isset($item['rebate_reward']) && $item['rebate_reward'] == 2){ ?>style="display:block;" <?php }else{ ?>style="display:none;"<?php }?>>
  824. <label class="col-sm-2 control-label"></label>
  825. <div class="col-sm-9 col-xs-12">
  826. <div class="input-group" style="width: 200px;">
  827. <span class="input-group-addon">赠送 </span>
  828. <input type="text" name="reward_balance" id="reward_balance" class="form-control" value="{$item['reward_balance']}" placeholder=""/>
  829. <span class="input-group-addon">余额 </span>
  830. </div>
  831. <div style="clear:both;"></div>
  832. <span class="layui-form-mid layui-word-aux">设置赠送的余额</span>
  833. </div>
  834. </div>
  835. </div>
  836. </div>
  837. </div>
  838. <!--拼团返利end-->
  839. <script>
  840. $(function(){
  841. $(".select2").select2({
  842. placeholder:'请选择',
  843. allowClear:true
  844. })
  845. })
  846. </script>
  847. <div class="layui-form-item">
  848. <label class="layui-form-label"> </label>
  849. <div class="layui-input-block">
  850. <input type="submit" value="提交" lay-submit lay-filter="formDemo" class="btn btn-primary" />
  851. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  852. <a class="btn btn-default" style='margin-left:10px;' href="{:U('group/goods' , array( 'ok' => 1))}">返回列表</a>
  853. </div>
  854. </div>
  855. </form>
  856. </div>
  857. </div>
  858. </div>
  859. <script src="/layuiadmin/layui/layui.js"></script>
  860. <script type="text/javascript" src="/static/js/jquery-migrate-1.1.1.js"></script>
  861. <script src="/static/js/jquery-ui.min.js"></script>
  862. <style>
  863. .multi-img-details{width:100%;}
  864. </style>
  865. <script>
  866. layui.config({
  867. base: '/layuiadmin/' //静态资源所在路径
  868. }).extend({
  869. index: 'lib/index' //主入口模块
  870. }).use('index');
  871. </script>
  872. <script>
  873. //由于模块都一次性加载,因此不用执行 layui.use() 来加载对应模块,直接使用即可:
  874. var layer = layui.layer;
  875. var $;
  876. var cur_open_div;
  877. var form;
  878. layui.use(['jquery', 'layer','form'], function(){
  879. $ = layui.$;
  880. form = layui.form;
  881. form.on('radio(linktype)', function(data){
  882. if (data.value == 2) {
  883. $('#typeGroup').show();
  884. } else {
  885. $('#typeGroup').hide();
  886. }
  887. });
  888. form.on('checkbox(commissTuan)', function(data){
  889. if (data.elem.checked) {
  890. $("#zero_opentuan_div").css('display','inline');
  891. $("#newman_div").css('display','inline');
  892. $("#commiss_money_div").css('display','inline');
  893. $('input[name="is_pintuan_rebate"]').attr("checked", false);
  894. } else {
  895. $("#zero_opentuan_div").hide();
  896. $("#newman_div").hide();
  897. $("#commiss_money_div").hide();
  898. }
  899. form.render('checkbox');
  900. });
  901. form.on('checkbox(is_modify_sendscore)', function(data){
  902. console.log(data.elem.checked)
  903. if (data.elem.checked) {
  904. console.log(12);
  905. $("#send_score_divTip").css('display','inline');
  906. } else {
  907. console.log(33);
  908. $("#send_score_divTip").hide();
  909. }
  910. form.render('checkbox');
  911. });
  912. form.on('checkbox(xinrenckbox)', function(data){
  913. if (data.elem.checked) {
  914. $("#xianshickbox").removeAttr("checked");
  915. } else {
  916. }
  917. form.render('checkbox');
  918. });
  919. form.on('checkbox(xianshickbox)', function(data){
  920. if (data.elem.checked) {
  921. $("#xinrenckbox").removeAttr("checked");
  922. } else {
  923. }
  924. form.render('checkbox');
  925. });
  926. form.on('checkbox(hascommission)', function(data){
  927. if (data.elem.checked) {
  928. $('#commission_div').show();
  929. } else {
  930. $('#commission_div').hide();
  931. }
  932. })
  933. //hascommission
  934. $('#chose_label_id').click(function(){
  935. cur_open_div = $(this).attr('data-input');
  936. $.post("{:U('group/labelquery', array('ok' => 1))}", {}, function(shtml){
  937. layer.open({
  938. type: 1,
  939. area: '930px',
  940. content: shtml //注意,如果str是object,那么需要字符拼接。
  941. });
  942. });
  943. })
  944. $('#chose_member_id').click(function(){
  945. cur_open_div = $(this).attr('data-input');
  946. $.post("{:U('supply/zhenquery', array('ok' => 1))}", {}, function(shtml){
  947. layer.open({
  948. type: 1,
  949. area: '930px',
  950. content: shtml //注意,如果str是object,那么需要字符拼接。
  951. });
  952. });
  953. })
  954. $('#chose_agent_id').click(function(){
  955. cur_open_div = $(this).attr('data-input');
  956. $.post("{:U('communityhead/query_head_user', array('ok' => 1))}", {}, function(shtml){
  957. layer.open({
  958. type: 1,
  959. area: '930px',
  960. content: shtml //注意,如果str是object,那么需要字符拼接。
  961. });
  962. });
  963. })
  964. $('#chose_link').click(function(){
  965. cur_open_div = $(this).attr('data-input');
  966. $.post("{:U('util.selecturl', array('ok' => 1))}", {}, function(shtml){
  967. layer.open({
  968. type: 1,
  969. area: '930px',
  970. content: shtml //注意,如果str是object,那么需要字符拼接。
  971. });
  972. });
  973. })
  974. $('.layui-tab-title li').click(function(){
  975. form.render('radio');
  976. form.render('checkbox');
  977. })
  978. form.on('radio(rebate_reward)', function(data){
  979. if (data.value == 1) {
  980. $('#reward_point_set').show();
  981. $('#reward_balance_set').hide();
  982. } else {
  983. $('#reward_balance_set').show();
  984. $('#reward_point_set').hide();
  985. }
  986. });
  987. form.on('checkbox(is_pintuan_rebate)', function(data){
  988. if (data.elem.checked) {
  989. $('input[name="is_newman"]').attr("checked", false);
  990. $('input[name="is_commiss_tuan"]').attr("checked", false);
  991. $("#zero_opentuan_div").hide();
  992. $("#commiss_money_div").hide();
  993. }
  994. form.render('checkbox');
  995. });
  996. form.on('checkbox(is_newman)', function(data){
  997. if (data.elem.checked) {
  998. $('input[name="is_pintuan_rebate"]').attr("checked", false);
  999. }
  1000. form.render('checkbox');
  1001. });
  1002. //监听提交
  1003. form.on('submit(formDemo)', function(data){
  1004. var loadingIndex = layer.load();
  1005. var s_cates = $('#cates').val();
  1006. var cate_mult = [];
  1007. var goodsname = $.trim($('#goodsname').val());
  1008. if(goodsname == ''){
  1009. layer.msg('商品名称必须填写',{icon: 1,time: 2000});
  1010. $('#goodsname').focus();
  1011. layer.close(loadingIndex);
  1012. return false;
  1013. }
  1014. var pinprice = $.trim($('#pinprice').val());
  1015. if(pinprice == ''){
  1016. layer.msg('拼团价格必须填写',{icon: 1,time: 2000});
  1017. $('#pinprice').focus();
  1018. layer.close(loadingIndex);
  1019. return false;
  1020. }
  1021. var price = $.trim($('#price').val());
  1022. if(price == ''){
  1023. layer.msg('单独购买价必须填写',{icon: 1,time: 2000});
  1024. $('#price').focus();
  1025. layer.close(loadingIndex);
  1026. return false;
  1027. }
  1028. var productprice = $.trim($('#productprice').val());
  1029. if(productprice == ''){
  1030. layer.msg('原价必须填写',{icon: 1,time: 2000});
  1031. $('#productprice').focus();
  1032. layer.close(loadingIndex);
  1033. return false;
  1034. }
  1035. var costpriceprice = $.trim($('#costpriceprice').val());
  1036. if(costpriceprice == ''){
  1037. layer.msg('成本价必须填写',{icon: 1,time: 2000});
  1038. $('#costpriceprice').focus();
  1039. layer.close(loadingIndex);
  1040. return false;
  1041. }
  1042. var pin_count = $.trim($('#pin_count').val());
  1043. if(pin_count == ''){
  1044. layer.msg('拼团人数必须填写',{icon: 1,time: 2000});
  1045. $('#pin_count').focus();
  1046. layer.close(loadingIndex);
  1047. return false;
  1048. }
  1049. var pin_hour = $.trim($('#pin_hour').val());
  1050. if(pin_hour == ''){
  1051. layer.msg('拼团小时数必须填写',{icon: 1,time: 2000});
  1052. $('#pin_hour').focus();
  1053. layer.close(loadingIndex);
  1054. return false;
  1055. }
  1056. if(isNaN(pin_hour)){
  1057. layer.msg('拼团小时数必须是数字',{icon: 1,time: 2000});
  1058. $('#pin_hour').focus();
  1059. layer.close(loadingIndex);
  1060. return false;
  1061. }
  1062. $('input').blur(function () {
  1063. $(this).css('border','#e7e7eb 1px solid');
  1064. })
  1065. if($('#hasoption').get(0).checked == false){
  1066. // console.log(222);
  1067. var total =$('#total').val();
  1068. if(total == ''){
  1069. layer.msg('库存必须填写',{icon: 1,time: 2000});
  1070. $('#total').css('border','2px solid red');
  1071. $('#total').focus();
  1072. layer.close(loadingIndex);
  1073. return false;
  1074. }
  1075. }
  1076. for(var i in s_cates)
  1077. {
  1078. cate_mult.push(s_cates[i]);
  1079. }
  1080. data.field.cate_mult = cate_mult;
  1081. <?php if( !empty($is_open_goods_relative_goods) && $is_open_goods_relative_goods == 1 ){ ?>
  1082. var gd_ar = [];
  1083. var gd_str = '';
  1084. $('.mult_choose_goodsid').each(function(){
  1085. gd_ar.push( $(this).attr('data-gid') );
  1086. })
  1087. gd_str = gd_ar.join(',');
  1088. data.field.limit_goods_list = gd_str;
  1089. <?php } ?>
  1090. var pin_hour = $('#pin_hour').val();
  1091. pin_hour = parseFloat( pin_hour );
  1092. var pin_count = $('#pin_count').val();
  1093. pin_count = parseInt( pin_count );
  1094. if(pin_count > 5000){
  1095. layer.msg('最高拼团人数5000人',{icon:5});
  1096. $('#pin_count').removeClass('layui-form-danger').addClass('layui-form-danger');
  1097. layer.close(loadingIndex);
  1098. return false;
  1099. }
  1100. if(pin_hour < 0.01)
  1101. {
  1102. layer.msg('拼团小时数,只能填写正数',{icon:5});
  1103. $('#pin_hour').removeClass('layui-form-danger').addClass('layui-form-danger');
  1104. layer.close(loadingIndex);
  1105. return false;
  1106. }
  1107. var is_mult_option = $('input[name=hasoption]').is(':checked');
  1108. if( is_mult_option )
  1109. {
  1110. var t_val;
  1111. var is_pos = false;
  1112. var s_total = 0;
  1113. $('.option_stock').each(function(){
  1114. t_val = $(this).val();
  1115. if(!(/(^[1-9]\d*$)/.test(t_val)) && t_val != 0){
  1116. layer.msg('多规格商品库存输入错误,请输入正确的数字!',{icon:2});
  1117. $(this).focus();
  1118. $(this).css('border','red 2px solid');
  1119. layer.close(loadingIndex);
  1120. is_break = true;
  1121. return false;
  1122. }
  1123. if( t_val == '' )
  1124. {
  1125. is_pos = true;
  1126. }
  1127. s_total += parseInt( t_val );
  1128. })
  1129. if(is_pos)
  1130. {
  1131. layer.msg('多规格商品库存未填写',{icon:2});
  1132. layer.close(loadingIndex);
  1133. return false;
  1134. }
  1135. var t_val3;
  1136. var is_pos3 = false;
  1137. $('.option_presell').each(function(){
  1138. t_val3 = $(this).val();
  1139. if( t_val3 == '' )
  1140. {
  1141. is_pos3 = true;
  1142. }
  1143. })
  1144. if(is_pos3)
  1145. {
  1146. layer.msg('多规格商品拼团价未填写',{icon:2});
  1147. layer.close(loadingIndex);
  1148. return false;
  1149. }
  1150. var t_val2;
  1151. var is_pos2 = false;
  1152. $('.option_marketprice').each(function(){
  1153. t_val2 = $(this).val();
  1154. if( t_val2 == '' )
  1155. {
  1156. is_pos2 = true;
  1157. }
  1158. })
  1159. if(is_pos2)
  1160. {
  1161. layer.msg('多规格商品单独购买价格未填写',{icon:2});
  1162. layer.close(loadingIndex);
  1163. return false;
  1164. }
  1165. if( s_total > 100000 || s_total< 0 )
  1166. {
  1167. layer.msg('商品库存值的取值范围是1~100000',{icon:2});
  1168. layer.close(loadingIndex);
  1169. return false;
  1170. }
  1171. if(!(/(^[1-9]\d*$)/.test(s_total)) && s_total != 0){
  1172. layer.msg('多规格商品库存输入错误,请输入正确的数字!',{icon:2});
  1173. layer.close(loadingIndex);
  1174. return false;
  1175. }
  1176. }else{
  1177. var g_total = $('#total').val();
  1178. if( g_total > 100000 || g_total< 0 )
  1179. {
  1180. layer.msg('商品库存值的取值范围是1~100000',{icon:2});
  1181. layer.close(loadingIndex);
  1182. return false;
  1183. }
  1184. if(!(/(^[1-9]\d*$)/.test(g_total)) && g_total != 0){
  1185. layer.msg('商品库存输入错误,请输入正确的数字!',{icon:2});
  1186. layer.close(loadingIndex);
  1187. return false;
  1188. }
  1189. }
  1190. if($('input[name="is_pintuan_rebate"]').is(':checked')){
  1191. var random_delivery_count = $('#random_delivery_count').val();
  1192. var g = /^[1-9]*[1-9][0-9]*$/;
  1193. if(!g.test(random_delivery_count) || random_delivery_count == 0){
  1194. layer.msg('随机发货人数输入错误,请输入正确的数字!',{icon:2});
  1195. $('#random_delivery_count').removeClass('layui-form-danger').addClass('layui-form-danger');
  1196. layer.close(loadingIndex);
  1197. return false;
  1198. }
  1199. if(random_delivery_count > pin_count){
  1200. layer.msg('随机发货人数不能大于拼团人数',{icon:5});
  1201. $('#random_delivery_count').removeClass('layui-form-danger').addClass('layui-form-danger');
  1202. layer.close(loadingIndex);
  1203. return false;
  1204. }
  1205. var rebate_reward = $("input[name='rebate_reward']:checked").val();
  1206. var fix_amountTest=/^(([1-9]\d*)|\d)(\.\d{1,2})?$/;
  1207. if(rebate_reward == 1){
  1208. //送积分
  1209. var reward_point = $.trim($('#reward_point').val());
  1210. if(!fix_amountTest.test(reward_point) || parseFloat(reward_point) <= 0){
  1211. layer.msg('积分输入错误,请输入正确的积分!',{icon:2});
  1212. $('#reward_point').removeClass('layui-form-danger').addClass('layui-form-danger');
  1213. layer.close(loadingIndex);
  1214. return false;
  1215. }
  1216. }else if(rebate_reward == 2){
  1217. //送余额
  1218. var reward_balance = $.trim($('#reward_balance').val());
  1219. if(!fix_amountTest.test(reward_balance) || parseFloat(reward_balance) <= 0){
  1220. layer.msg('余额输入错误,请输入正确的余额!',{icon:2});
  1221. $('#reward_point').removeClass('layui-form-danger').addClass('layui-form-danger');
  1222. layer.close(loadingIndex);
  1223. return false;
  1224. }
  1225. }
  1226. }
  1227. $.ajax({
  1228. url: data.form.action,
  1229. type: data.form.method,
  1230. data: data.field,
  1231. dataType:'json',
  1232. success: function (info) {
  1233. if(info.status == 0)
  1234. {
  1235. layer.msg(info.result.message,{icon: 1,time: 2000});
  1236. layer.close(loadingIndex);
  1237. }else if(info.status == 1){
  1238. var go_url = location.href;
  1239. if( info.result.hasOwnProperty("url") )
  1240. {
  1241. go_url = info.result.url;
  1242. }
  1243. layer.msg('操作成功',{time: 1000,
  1244. end:function(){
  1245. location.href = info.result.url;
  1246. }
  1247. });
  1248. }
  1249. }
  1250. });
  1251. return false;
  1252. });
  1253. form.on('checkbox(is_community_head_commission)', function(data){
  1254. if(data.elem.checked)
  1255. {
  1256. $("#head_commission_div2").show();
  1257. }else{
  1258. $("#head_commission_div2").hide();
  1259. }
  1260. form.render('checkbox');
  1261. });
  1262. form.on('checkbox(hasoption)', function(data){
  1263. if(data.elem.checked)
  1264. {
  1265. $('#goodssn').attr('readonly',true);
  1266. $('#productsn').attr('readonly',true);
  1267. $('#weight').attr('readonly',true);
  1268. $('#total').attr('readonly',true);
  1269. $("#tboption").show();
  1270. $("#tbdiscount").show();
  1271. $("#isdiscount_discounts").show();
  1272. $("#isdiscount_discounts_default").hide();
  1273. $("#commission").show();
  1274. $("#commission_default").hide();
  1275. $("#discounts_type1").show().parent().show();
  1276. refreshOptions();
  1277. }else{
  1278. $('#weight').removeAttr('readonly');
  1279. $('#total').removeAttr('readonly');
  1280. $("#tboption").hide();
  1281. refreshOptions();
  1282. $("#isdiscount_discounts").hide();
  1283. var isdiscount_discounts = $("#isdiscount_discounts").html();
  1284. $("#isdiscount_discounts").html('');
  1285. $("#isdiscount_discounts").html(isdiscount_discounts);
  1286. $("#tbdiscount").hide();
  1287. $("#isdiscount_discounts_default").show();
  1288. $("#commission_default").show();
  1289. $('#goodssn').removeAttr('readonly');
  1290. $('#productsn').removeAttr('readonly');
  1291. $("#discounts_type1").hide().parent().hide();
  1292. $("#discounts_type0").click();
  1293. $(this).prop("checked", false);
  1294. }
  1295. form.render('checkbox');
  1296. });
  1297. $('#chose_agent_id2').click(function(){
  1298. cur_open_div = $(this).attr('data-input');
  1299. $.post("{:U('goods/query_normal', array('template' => 'mult', 'unselect_goodsid' => $id))}", {}, function(shtml){
  1300. layer.open({
  1301. type: 1,
  1302. area: '930px',
  1303. content: shtml //注意,如果str是object,那么需要字符拼接。
  1304. });
  1305. });
  1306. })
  1307. form.on('checkbox(is_modify_head_commission)', function(data){
  1308. if(data.elem.checked)
  1309. {
  1310. $("#head_commission_div").show();
  1311. }else{
  1312. $("#head_commission_div").hide();
  1313. }
  1314. form.render('checkbox');
  1315. });
  1316. })
  1317. function cancle_bind(obj,sdiv)
  1318. {
  1319. $('#'+sdiv).val('');
  1320. $(obj).parent().parent().remove();
  1321. }
  1322. </script>
  1323. <script>
  1324. $(function () {
  1325. // 拖拽时开始滚动的间距
  1326. var scrollingSensitivity = 20
  1327. // 拖拽时滚动速度
  1328. let scrollingSpeed = 20
  1329. // 拖拽前的父级节点
  1330. let dragBeforeParentNode = null
  1331. // 初始化拖拽函数
  1332. $('.multi-img-details').sortable({
  1333. // 自适应placeholder的大小
  1334. forceHelperSize: true,
  1335. // 拖拽时的鼠标形状
  1336. cursor: '-webkit-grabbing',
  1337. // 拖拽的父级节点(该节点一定要注意,配置错误会导致当前屏幕外的元素没法自动滚动拖拽,两列之间拖拽的滚动也会出问题)
  1338. appendTo: '.layui-form-item',
  1339. // 拖拽时的倾斜度
  1340. rotate: '5deg',
  1341. // 延迟时间(毫秒),避免和click同时操作时出现的冲突
  1342. delay: 0,
  1343. // 以clone方式拖拽
  1344. helper: 'clone',
  1345. // 拖拽到边框出现滚动的间距,
  1346. scrollSensitivity: scrollingSensitivity,
  1347. // 应用于拖拽空白区域的样式
  1348. placeholder: 'portlet-placeholder ui-state-highlight',
  1349. // 允许拖拽预留空白区域
  1350. forcePlaceholderSize: false,
  1351. // 多个列表之间的拖拽的dom元素
  1352. connectWith: '.multi-img-details',
  1353. // 鼠标到区域则填充
  1354. tolerance: "pointer",
  1355. // 可以拖拽的项
  1356. items: '.multi-item',
  1357. // 填充动画
  1358. revert: 0,
  1359. // 拖拽结束函数
  1360. stop: (e, ui) => {
  1361. // 当前拽入的元素
  1362. let item = $(ui.item)
  1363. // 当前拽入元素的下标
  1364. let index = item.index()
  1365. let kid = ''
  1366. // xxxx 这里面可以操作数据更新
  1367. },
  1368. // 开始拖拽时的函数
  1369. start: (e, ui) => {
  1370. // 拖拽前的父级节点
  1371. dragBeforeParentNode = ui.item[0].parentNode
  1372. // 让placeholder和源高度一致
  1373. ui.helper.addClass('item').width(110)
  1374. // xxxx 这里可以记录一些拖拽前的元素属性
  1375. },
  1376. // 处理两列滚动条问题
  1377. sort: function (event, ui) {
  1378. var scrollContainer = ui.placeholder[0].parentNode
  1379. // 设置拽入的列表的滚动位置
  1380. var overflowOffset = $(scrollContainer).offset()
  1381. if ((overflowOffset.top + scrollContainer.offsetHeight) - event.pageY <
  1382. scrollingSensitivity) {
  1383. scrollContainer.scrollTop = scrollContainer.scrollTop + scrollingSpeed
  1384. } else if (event.pageY - overflowOffset.top < scrollingSensitivity) {
  1385. scrollContainer.scrollTop = scrollContainer.scrollTop - scrollingSpeed
  1386. }
  1387. }
  1388. }).disableSelection()
  1389. })
  1390. </script>
  1391. <script language="javascript">
  1392. var chose_cate = -1;
  1393. var chose_cate_id_arr = [];
  1394. $(function(){
  1395. $('#cates2').on('change',function(){
  1396. var s_length = $("#cates2 option:selected").length -1;
  1397. var options_name = $("#cates2 option:selected:eq("+s_length+")").text();
  1398. var options_str = $("#cates2 option:selected:eq("+s_length+")").attr('data-names');
  1399. if(s_length > chose_cate)
  1400. {
  1401. chose_cate++;
  1402. var cur_cate_id = '';
  1403. $("#cates2 option:selected").each(function(){
  1404. var tmp_cate_id = parseInt($(this).val());
  1405. if( $.inArray( tmp_cate_id, chose_cate_id_arr ) == -1)
  1406. {
  1407. chose_cate_id_arr.push( parseInt(tmp_cate_id) );
  1408. cur_cate_id = tmp_cate_id;
  1409. }
  1410. })
  1411. addSpecList(options_name,options_str,cur_cate_id);
  1412. }else{
  1413. chose_cate--;
  1414. var new_chose_cate_id_arr = [];
  1415. if(chose_cate_id_arr.length == 1)
  1416. {
  1417. $('.spec_class_'+chose_cate_id_arr[0]).remove();
  1418. }
  1419. $("#cates2 option:selected").each(function(){
  1420. var tmp_cate_id = parseInt( $(this).val() );
  1421. if( $.inArray( tmp_cate_id, chose_cate_id_arr ) != -1)
  1422. {
  1423. new_chose_cate_id_arr.push( parseInt(tmp_cate_id) );
  1424. chose_cate_id_arr.splice($.inArray( tmp_cate_id, chose_cate_id_arr ), 1);
  1425. }
  1426. })
  1427. if(chose_cate_id_arr.length == 1)
  1428. {
  1429. $('.spec_class_'+chose_cate_id_arr[0]).remove();
  1430. }
  1431. chose_cate_id_arr = new_chose_cate_id_arr;
  1432. refreshOptions();
  1433. }
  1434. })
  1435. $(document).on('input propertychange change', '#specs input', function () {
  1436. window.optionchanged = true;
  1437. $('#optiontip').show();
  1438. });
  1439. $(document).on('input propertychange change', '#specs input', function () {
  1440. window.optionchanged = true;
  1441. $('#optiontip').show();
  1442. });
  1443. $(".spec_item_thumb").find('i').click(function(){
  1444. var group =$(this).parent();
  1445. group.find('img').attr('src',"{SNAILFISH_LOCAL}static/images/nopic100.jpg");
  1446. group.find(':hidden').val('');
  1447. $(this).hide();
  1448. group.find('img').popover('destroy');
  1449. });
  1450. });
  1451. function selectSpecItemImage(obj){
  1452. util.image('',function(val){
  1453. $(obj).attr('src',val.url).popover({
  1454. trigger: 'hover',
  1455. html: true,
  1456. container: $(document.body),
  1457. content: "<img src='" + val.url + "' style='width:100px;height:100px;' />",
  1458. placement: 'top'
  1459. });
  1460. var group =$(obj).parent();
  1461. group.find(':hidden').val(val.attachment), group.find('i').show().unbind('click').click(function(){
  1462. $(obj).attr('src',"{SNAILFISH_LOCAL}static/images/nopic100.jpg");
  1463. group.find(':hidden').val('');
  1464. group.find('i').hide();
  1465. $(obj).popover('destroy');
  1466. });
  1467. });
  1468. }
  1469. function addSpecList(options_name,spec_str, cur_cate_id)
  1470. {
  1471. var len = $(".spec_item").length;
  1472. $("#add-spec").html("正在处理...").attr("disabled", "true").toggleClass("btn-primary");
  1473. var url = "{:U('goods/mult_tpl',array('tpl'=>'spec'))}";
  1474. $.ajax({
  1475. "url": url,
  1476. type:'post',
  1477. data:{options_name:options_name,spec_str:spec_str,cur_cate_id:cur_cate_id},
  1478. success:function(data){
  1479. $("#add-spec").html('<i class="fa fa-plus"></i> 新增规格').removeAttr("disabled").toggleClass("btn-primary"); ;
  1480. $('#specs').append(data);
  1481. var len = $(".add-specitem").length -1;
  1482. $(".add-specitem:eq(" +len+ ")").focus();
  1483. refreshOptions();
  1484. }
  1485. });
  1486. }
  1487. function addSpec(){
  1488. var len = $(".spec_item").length;
  1489. $("#add-spec").html("正在处理...").attr("disabled", "true").toggleClass("btn-primary");
  1490. var url = "{:U('goods/tpl',array('tpl'=>'spec'))}";
  1491. $.ajax({
  1492. "url": url,
  1493. success:function(data){
  1494. $("#add-spec").html('<i class="fa fa-plus"></i> 新增规格').removeAttr("disabled").toggleClass("btn-primary"); ;
  1495. $('#specs').append(data);
  1496. var len = $(".add-specitem").length -1;
  1497. $(".add-specitem:eq(" +len+ ")").focus();
  1498. refreshOptions();
  1499. }
  1500. });
  1501. }
  1502. function removeSpec(specid){
  1503. if (confirm('确认要删除此规格?')){
  1504. $("#spec_" + specid).remove();
  1505. refreshOptions();
  1506. }
  1507. }
  1508. function addSpecItem(specid){
  1509. $("#add-specitem-" + specid).html("正在处理...").attr("disabled", "true");
  1510. var url = "{:U('goods/tpl',array('tpl'=>'specitem'))}" + "&specid=" + specid;
  1511. $.ajax({
  1512. "url": url,
  1513. success:function(data){
  1514. $("#add-specitem-" + specid).html('<i class="fa fa-plus"></i> 添加规格项').removeAttr("disabled");
  1515. $('#spec_item_' + specid).append(data);
  1516. var len = $("#spec_" + specid + " .spec_item_title").length -1;
  1517. $("#spec_" + specid + " .spec_item_title:eq(" +len+ ")").focus();
  1518. refreshOptions
  1519. if(type==3 && virtual==0){
  1520. $(".choosetemp").show();
  1521. }
  1522. }
  1523. });
  1524. }
  1525. function removeSpecItem(obj){
  1526. $(obj).closest('.spec_item_item').remove();
  1527. refreshOptions();
  1528. }
  1529. function refreshOptions(){
  1530. // 刷新后重置
  1531. window.optionchanged = false;
  1532. $('#optiontip').hide();
  1533. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  1534. var specs = [];
  1535. if($('.spec_item').length<=0){
  1536. $("#options").html('');
  1537. $("#discount").html('');
  1538. $("#isdiscount_discounts").html('');
  1539. $("#commission").html('');
  1540. return;
  1541. }
  1542. $(".spec_item").each(function(i){
  1543. var _this = $(this);
  1544. var spec = {
  1545. id: _this.find(".spec_id").val(),
  1546. title: _this.find(".spec_title").val()
  1547. };
  1548. var items = [];
  1549. _this.find(".spec_item_item").each(function(){
  1550. var __this = $(this);
  1551. var item = {
  1552. id: __this.find(".spec_item_id").val(),
  1553. title: __this.find(".spec_item_title").val(),
  1554. virtual: __this.find(".spec_item_virtual").val(),
  1555. show:__this.find(".spec_item_show").get(0).checked?"1":"0"
  1556. }
  1557. items.push(item);
  1558. });
  1559. spec.items = items;
  1560. specs.push(spec);
  1561. });
  1562. specs.sort(function(x,y){
  1563. if (x.items.length > y.items.length){
  1564. return 1;
  1565. }
  1566. if (x.items.length < y.items.length) {
  1567. return -1;
  1568. }
  1569. });
  1570. var len = specs.length;
  1571. var newlen = 1;
  1572. var h = new Array(len);
  1573. var rowspans = new Array(len);
  1574. for(var i=0;i<len;i++){
  1575. html+="<th>" + specs[i].title + "</th>";
  1576. var itemlen = specs[i].items.length;
  1577. if(itemlen<=0) { itemlen = 1 };
  1578. newlen*=itemlen;
  1579. h[i] = new Array(newlen);
  1580. for(var j=0;j<newlen;j++){
  1581. h[i][j] = new Array();
  1582. }
  1583. var l = specs[i].items.length;
  1584. rowspans[i] = 1;
  1585. for(j=i+1;j<len;j++){
  1586. rowspans[i]*= specs[j].items.length;
  1587. }
  1588. }
  1589. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">库存<label style="font-size:16px;font-weight:900;color: #ff0000;">*</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>';
  1590. html += '<th class="type-4"><div class=""><div style="padding-bottom:10px;text-align:center;">拼团价格<label style="font-size:16px;font-weight:900;color: #ff0000;">*</label></div><div class="input-group"><input type="text" class="form-control input-sm option_presell_all" VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'option_presell\');"></a></span></div></div></th>';
  1591. html += '<th class="type-4"><div class=""><div style="padding-bottom:10px;text-align:center;">单独购买价<label style="font-size:16px;font-weight:900;color: #ff0000;">*</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>';
  1592. html+='<th class="type-4"><div class=""><div style="padding-bottom:10px;text-align:center;">原价<label style="font-size:16px;font-weight:900;color: #ff0000;">*</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>';
  1593. 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>';
  1594. 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>';
  1595. 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>';
  1596. html+='</tr></thead>';
  1597. for(var m=0;m<len;m++){
  1598. var k = 0,kid = 0,n=0;
  1599. for(var j=0;j<newlen;j++){
  1600. var rowspan = rowspans[m];
  1601. if( j % rowspan==0){
  1602. 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};
  1603. }
  1604. else{
  1605. h[m][j]={title:specs[m].items[kid].title,virtual: specs[m].items[kid].virtual, html: "",id: specs[m].items[kid].id};
  1606. }
  1607. n++;
  1608. if(n==rowspan){
  1609. kid++; if(kid>specs[m].items.length-1) { kid=0; }
  1610. n=0;
  1611. }
  1612. }
  1613. }
  1614. var hh = "";
  1615. for(var i=0;i<newlen;i++){
  1616. hh+="<tr>";
  1617. var ids = [];
  1618. var titles = [];
  1619. var virtuals = [];
  1620. for(var j=0;j<len;j++){
  1621. hh+=h[j][i].html;
  1622. ids.push( h[j][i].id);
  1623. titles.push( h[j][i].title);
  1624. virtuals.push( h[j][i].virtual);
  1625. }
  1626. ids =ids.join('_');
  1627. titles= titles.join('+');
  1628. var val ={ id : "",title:titles, stock : "",presell : "",costprice : "",productprice : "",marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  1629. if( $(".option_id_" + ids).length>0){
  1630. val ={
  1631. id : $(".option_id_" + ids+":eq(0)").val(),
  1632. title: titles,
  1633. stock : $(".option_stock_" + ids+":eq(0)").val(),
  1634. presell : $(".option_presell_" + ids+":eq(0)").val(),
  1635. costprice : $(".option_costprice_" + ids+":eq(0)").val(),
  1636. productprice : $(".option_productprice_" + ids+":eq(0)").val(),
  1637. marketprice : $(".option_marketprice_" + ids +":eq(0)").val(),
  1638. goodssn : $(".option_goodssn_" + ids +":eq(0)").val(),
  1639. productsn : $(".option_productsn_" + ids +":eq(0)").val(),
  1640. weight : $(".option_weight_" + ids+":eq(0)").val(),
  1641. virtual : virtuals
  1642. }
  1643. }
  1644. hh += '<td>'
  1645. hh += '<input name="option_stock_' + ids +'" type="text" class="form-control option_stock option_stock_' + ids +'" value="' +(val.stock=='undefined'?'':val.stock )+'"/></td>';
  1646. hh += '<input name="option_id_' + ids+'" type="hidden" class="form-control option_id option_id_' + ids +'" value="' +(val.id=='undefined'?'':val.id )+'"/>';
  1647. hh += '<input name="option_ids[]" type="hidden" class="form-control option_ids option_ids_' + ids +'" value="' + ids +'"/>';
  1648. hh += '<input name="option_title_' + ids +'" type="hidden" class="form-control option_title option_title_' + ids +'" value="' +(val.title=='undefined'?'':val.title )+'"/></td>';
  1649. hh += '<input name="option_virtual_' + ids +'" type="hidden" class="form-control option_virtual option_virtual_' + ids +'" value="' +(val.virtual=='undefined'?'':val.virtual )+'"/></td>';
  1650. hh += '</td>';
  1651. hh += '<td class="type-4"><input name="option_presell_' + ids+'" type="text" class="form-control option_presell option_presell_' + ids +'" value="' +(val.presell=='undefined'?'':val.presell )+'"/></td>';
  1652. 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>';
  1653. 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>';
  1654. 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>';
  1655. hh += '<td><input name="option_goodssn_' +ids+'" type="text" class="form-control option_goodssn option_goodssn_' + ids +'" " value="' +(val.goodssn=='undefined'?'':val.goodssn )+'"/></td>';
  1656. //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>';
  1657. hh += '<td><input name="option_weight_' + ids +'" type="text" class="form-control option_weight option_weight_' + ids +'" " value="' +(val.weight=='undefined'?'':val.weight )+'"/></td>';
  1658. hh += "</tr>";
  1659. }
  1660. html+=hh;
  1661. html+="</table>";
  1662. $("#options").html(html);
  1663. refreshDiscount();
  1664. refreshIsDiscount();
  1665. if(window.type=='4'){
  1666. $('.type-4').hide();
  1667. }else{
  1668. $('.type-4').show();
  1669. }
  1670. }
  1671. function refreshDiscount() {
  1672. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  1673. var specs = [];
  1674. $(".spec_item").each(function (i) {
  1675. var _this = $(this);
  1676. var spec = {
  1677. id: _this.find(".spec_id").val(),
  1678. title: _this.find(".spec_title").val()
  1679. };
  1680. var items = [];
  1681. _this.find(".spec_item_item").each(function () {
  1682. var __this = $(this);
  1683. var item = {
  1684. id: __this.find(".spec_item_id").val(),
  1685. title: __this.find(".spec_item_title").val(),
  1686. virtual: __this.find(".spec_item_virtual").val(),
  1687. show: __this.find(".spec_item_show").get(0).checked ? "1" : "0"
  1688. }
  1689. items.push(item);
  1690. });
  1691. spec.items = items;
  1692. specs.push(spec);
  1693. });
  1694. specs.sort(function (x, y) {
  1695. if (x.items.length > y.items.length) {
  1696. return 1;
  1697. }
  1698. if (x.items.length < y.items.length) {
  1699. return -1;
  1700. }
  1701. });
  1702. var len = specs.length;
  1703. var newlen = 1;
  1704. var h = new Array(len);
  1705. var rowspans = new Array(len);
  1706. for (var i = 0; i < len; i++) {
  1707. html += "<th>" + specs[i].title + "</th>";
  1708. var itemlen = specs[i].items.length;
  1709. if (itemlen <= 0) {
  1710. itemlen = 1
  1711. }
  1712. ;
  1713. newlen *= itemlen;
  1714. h[i] = new Array(newlen);
  1715. for (var j = 0; j < newlen; j++) {
  1716. h[i][j] = new Array();
  1717. }
  1718. var l = specs[i].items.length;
  1719. rowspans[i] = 1;
  1720. for (j = i + 1; j < len; j++) {
  1721. rowspans[i] *= specs[j].items.length;
  1722. }
  1723. }
  1724. <?php foreach( $levels as $level ){ ?>
  1725. <?php if( $level['key']=='default'){ ?>
  1726. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm discount_{$level["key"]}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'discount_{$level["key"]}\');"></a></span></div></div></th>';
  1727. <?php }else{ ?>
  1728. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm discount_level{$level['id']}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'discount_level{$level['id']}\');"></a></span></div></div></th>';
  1729. <?php } ?>
  1730. <?php } ?>
  1731. html += '</tr></thead>';
  1732. for (var m = 0; m < len; m++) {
  1733. var k = 0, kid = 0, n = 0;
  1734. for (var j = 0; j < newlen; j++) {
  1735. var rowspan = rowspans[m];
  1736. if (j % rowspan == 0) {
  1737. h[m][j] = {
  1738. title: specs[m].items[kid].title,
  1739. virtual: specs[m].items[kid].virtual,
  1740. html: "<td class='full' rowspan='" + rowspan + "'>" + specs[m].items[kid].title + "</td>\r\n",
  1741. id: specs[m].items[kid].id
  1742. };
  1743. }
  1744. else {
  1745. h[m][j] = {
  1746. title: specs[m].items[kid].title,
  1747. virtual: specs[m].items[kid].virtual,
  1748. html: "",
  1749. id: specs[m].items[kid].id
  1750. };
  1751. }
  1752. n++;
  1753. if (n == rowspan) {
  1754. kid++;
  1755. if (kid > specs[m].items.length - 1) {
  1756. kid = 0;
  1757. }
  1758. n = 0;
  1759. }
  1760. }
  1761. }
  1762. var hh = "";
  1763. for (var i = 0; i < newlen; i++) {
  1764. hh += "<tr>";
  1765. var ids = [];
  1766. var titles = [];
  1767. var virtuals = [];
  1768. for (var j = 0; j < len; j++) {
  1769. hh += h[j][i].html;
  1770. ids.push(h[j][i].id);
  1771. titles.push(h[j][i].title);
  1772. virtuals.push(h[j][i].virtual);
  1773. }
  1774. ids = ids.join('_');
  1775. titles = titles.join('+');
  1776. var val = {
  1777. id: "",
  1778. title: titles,
  1779. <?php foreach( $levels as $level ){ ?>
  1780. <?php if( $level['key']=='default'){ ?>
  1781. level{$level['key']}: '',
  1782. <?php }else{ ?>
  1783. level{$level['id']}: '',
  1784. <?php } ?>
  1785. <?php } ?>
  1786. costprice: "",
  1787. presell: "",
  1788. productprice: "",
  1789. marketprice: "",
  1790. weight: "",
  1791. productsn: "",
  1792. goodssn: "",
  1793. virtual: virtuals
  1794. };
  1795. var val ={ id : "",title:titles,<?php foreach( $levels as $level ){ ?><?php if( $level['key']=='default'){ ?> level{$level['key']}: '',<?php }else{ ?> level{$level['id']}: '',<?php } ?><?php } ?>costprice : "",productprice : "",marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  1796. if ($(".discount_id_" + ids).length > 0) {
  1797. val = {
  1798. id: $(".discount_id_" + ids + ":eq(0)").val(),
  1799. title: titles,
  1800. <?php foreach( $levels as $level ){ ?>
  1801. <?php if( $level['key']=='default'){ ?>
  1802. level{$level['key']}: $(".discount_{$level['key']}_" + ids + ":eq(0)").val(),
  1803. <?php }else{ ?>
  1804. level{$level['id']}: $(".discount_level{$level['id']}_" + ids + ":eq(0)").val(),
  1805. <?php } ?>
  1806. <?php } ?>
  1807. costprice: $(".discount_costprice_" + ids + ":eq(0)").val(),
  1808. presell: $(".discount_presell_" + ids + ":eq(0)").val(),
  1809. productprice: $(".discount_productprice_" + ids + ":eq(0)").val(),
  1810. marketprice: $(".discount_marketprice_" + ids + ":eq(0)").val(),
  1811. presell: $(".discount_presell_" + ids + ":eq(0)").val(),
  1812. goodssn: $(".discount_goodssn_" + ids + ":eq(0)").val(),
  1813. productsn: $(".discount_productsn_" + ids + ":eq(0)").val(),
  1814. weight: $(".discount_weight_" + ids + ":eq(0)").val(),
  1815. virtual: virtuals
  1816. }
  1817. }
  1818. <?php foreach( $levels as $level ){ ?>
  1819. hh += '<td>'
  1820. <?php if( $level['key']=='default'){ ?>
  1821. hh += '<input data-name="discount_level_{$level['key']}_' + ids +'"type="text" class="form-control discount_{$level['key']} discount_{$level['key']}_' + ids +'" value="' +(val.level{$level['key']}=='undefined'?'':val.level{$level['key']} )+'"/>';
  1822. <?php }else{ ?>
  1823. hh += '<input data-name="discount_level_{$level['id']}_' + ids +'"type="text" class="form-control discount_level{$level['id']} discount_level{$level['id']}_' + ids +'" value="' +(val.level{$level['id']}=='undefined'?'':val.level{$level['id']} )+'"/>';
  1824. <?php } ?>
  1825. hh += '</td>';
  1826. <?php } ?>
  1827. hh += '<input data-name="discount_id_' + ids+'"type="hidden" class="form-control discount_id discount_id_' + ids +'" value="' +(val.id=='undefined'?'':val.id )+'"/>';
  1828. hh += '<input data-name="discount_ids"type="hidden" class="form-control discount_ids discount_ids_' + ids +'" value="' + ids +'"/>';
  1829. hh += '<input data-name="discount_title_' + ids +'"type="hidden" class="form-control discount_title discount_title_' + ids +'" value="' +(val.title=='undefined'?'':val.title )+'"/></td>';
  1830. hh += '<input data-name="discount_virtual_' + ids +'"type="hidden" class="form-control discount_virtual discount_virtual_' + ids +'" value="' +(val.virtual=='undefined'?'':val.virtual )+'"/></td>';
  1831. hh += "</tr>";
  1832. }
  1833. html += hh;
  1834. html += "</table>";
  1835. $("#discount").html(html);
  1836. }
  1837. function refreshIsDiscount() {
  1838. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  1839. var specs = [];
  1840. $(".spec_item").each(function (i) {
  1841. var _this = $(this);
  1842. var spec = {
  1843. id: _this.find(".spec_id").val(),
  1844. title: _this.find(".spec_title").val()
  1845. };
  1846. var items = [];
  1847. _this.find(".spec_item_item").each(function () {
  1848. var __this = $(this);
  1849. var item = {
  1850. id: __this.find(".spec_item_id").val(),
  1851. title: __this.find(".spec_item_title").val(),
  1852. virtual: __this.find(".spec_item_virtual").val(),
  1853. show: __this.find(".spec_item_show").get(0).checked ? "1" : "0"
  1854. }
  1855. items.push(item);
  1856. });
  1857. spec.items = items;
  1858. specs.push(spec);
  1859. });
  1860. specs.sort(function (x, y) {
  1861. if (x.items.length > y.items.length) {
  1862. return 1;
  1863. }
  1864. if (x.items.length < y.items.length) {
  1865. return -1;
  1866. }
  1867. });
  1868. var len = specs.length;
  1869. var newlen = 1;
  1870. var h = new Array(len);
  1871. var rowspans = new Array(len);
  1872. for (var i = 0; i < len; i++) {
  1873. html += "<th>" + specs[i].title + "</th>";
  1874. var itemlen = specs[i].items.length;
  1875. if (itemlen <= 0) {
  1876. itemlen = 1
  1877. }
  1878. ;
  1879. newlen *= itemlen;
  1880. h[i] = new Array(newlen);
  1881. for (var j = 0; j < newlen; j++) {
  1882. h[i][j] = new Array();
  1883. }
  1884. var l = specs[i].items.length;
  1885. rowspans[i] = 1;
  1886. for (j = i + 1; j < len; j++) {
  1887. rowspans[i] *= specs[j].items.length;
  1888. }
  1889. }
  1890. <?php foreach( $levels as $level ){ ?>
  1891. <?php if( $level['key']=='default'){ ?>
  1892. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm isdiscount_discounts_{$level['key']}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'isdiscount_discounts_{$level['key']}\');"></a></span></div></div></th>';
  1893. <?php }else{ ?>
  1894. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">{$level['levelname']}</div><div class="input-group"><input type="text" class="form-control input-sm isdiscount_discounts_level{$level['id']}_all"VALUE=""/><span class="input-group-addon"><a href="javascript:;" class="fa fa-angle-double-down" title="批量设置" onclick="setCol(\'isdiscount_discounts_level{$level['id']}\');"></a></span></div></div></th>';
  1895. <?php } ?>
  1896. <?php } ?>
  1897. html += '</tr></thead>';
  1898. for (var m = 0; m < len; m++) {
  1899. var k = 0, kid = 0, n = 0;
  1900. for (var j = 0; j < newlen; j++) {
  1901. var rowspan = rowspans[m];
  1902. if (j % rowspan == 0) {
  1903. h[m][j] = {
  1904. title: specs[m].items[kid].title,
  1905. virtual: specs[m].items[kid].virtual,
  1906. html: "<td class='full' rowspan='" + rowspan + "'>" + specs[m].items[kid].title + "</td>\r\n",
  1907. id: specs[m].items[kid].id
  1908. };
  1909. }
  1910. else {
  1911. h[m][j] = {
  1912. title: specs[m].items[kid].title,
  1913. virtual: specs[m].items[kid].virtual,
  1914. html: "",
  1915. id: specs[m].items[kid].id
  1916. };
  1917. }
  1918. n++;
  1919. if (n == rowspan) {
  1920. kid++;
  1921. if (kid > specs[m].items.length - 1) {
  1922. kid = 0;
  1923. }
  1924. n = 0;
  1925. }
  1926. }
  1927. }
  1928. var hh = "";
  1929. for (var i = 0; i < newlen; i++) {
  1930. hh += "<tr>";
  1931. var ids = [];
  1932. var titles = [];
  1933. var virtuals = [];
  1934. for (var j = 0; j < len; j++) {
  1935. hh += h[j][i].html;
  1936. ids.push(h[j][i].id);
  1937. titles.push(h[j][i].title);
  1938. virtuals.push(h[j][i].virtual);
  1939. }
  1940. ids = ids.join('_');
  1941. titles = titles.join('+');
  1942. var val = {
  1943. id: "",
  1944. title: titles,
  1945. <?php foreach( $levels as $level ){ ?>
  1946. <?php if( $level['key']=='default'){ ?>
  1947. level{$level['key']}: '',
  1948. <?php }else{ ?>
  1949. level{$level['if']}: '',
  1950. <?php } ?>
  1951. <?php } ?>
  1952. costprice: "",
  1953. presell: "",
  1954. productprice: "",
  1955. marketprice: "",
  1956. weight: "",
  1957. productsn: "",
  1958. goodssn: "",
  1959. virtual: virtuals
  1960. };
  1961. var val ={ id : "",title:titles,<?php foreach( $levels as $level ){ ?><?php if( $level['key']=='default'){ ?> level{$level['key']}: '',<?php }else{ ?> level{$level['id']}: '',<?php } ?><?php } ?>costprice : "",productprice : "",marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  1962. if ($(".isdiscount_discounts_id_" + ids).length > 0) {
  1963. val = {
  1964. id: $(".isdiscount_discounts_id_" + ids + ":eq(0)").val(),
  1965. title: titles,
  1966. <?php foreach( $levels as $level ){ ?>
  1967. <?php if( $level['key']=='default'){ ?>
  1968. level{$level['key']}: $(".isdiscount_discounts_{$level['key']}_" + ids + ":eq(0)").val(),
  1969. <?php }else{ ?>
  1970. level{$level['id']}: $(".isdiscount_discounts_level{$level['id']}_" + ids + ":eq(0)").val(),
  1971. <?php } ?>
  1972. <?php } ?>
  1973. costprice: $(".isdiscount_discounts_costprice_" + ids + ":eq(0)").val(),
  1974. productprice: $(".isdiscount_discounts_productprice_" + ids + ":eq(0)").val(),
  1975. marketprice: $(".isdiscount_discounts_marketprice_" + ids + ":eq(0)").val(),
  1976. presell: $(".isdiscount_discounts_presell_" + ids + ":eq(0)").val(),
  1977. goodssn: $(".isdiscount_discounts_goodssn_" + ids + ":eq(0)").val(),
  1978. productsn: $(".isdiscount_discounts_productsn_" + ids + ":eq(0)").val(),
  1979. weight: $(".isdiscount_discounts_weight_" + ids + ":eq(0)").val(),
  1980. virtual: virtuals
  1981. }
  1982. }
  1983. <?php foreach( $levels as $level ){ ?>
  1984. hh += '<td>'
  1985. <?php if( $level['key']=='default'){ ?>
  1986. hh += '<input data-name="isdiscount_discounts_level_{$level['key']}_' + ids +'"type="text" class="form-control isdiscount_discounts_{$level['key']} isdiscount_discounts_{$level['key']}_' + ids +'" value="' +(val.level{$level['key']}=='undefined'?'':val.level{$level['key']} )+'"/>';
  1987. <?php }else{ ?>
  1988. hh += '<input data-name="isdiscount_discounts_level_{$level['id']}_' + ids +'"type="text" class="form-control isdiscount_discounts_level{$level['id']} isdiscount_discounts_level{$level['id']}_' + ids +'" value="' +(val.level{$level['id']}=='undefined'?'':val.level{$level['id']} )+'"/>';
  1989. <?php } ?>
  1990. hh += '</td>';
  1991. <?php } ?>
  1992. 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 )+'"/>';
  1993. hh += '<input data-name="isdiscount_discounts_ids"type="hidden" class="form-control isdiscount_discounts_ids isdiscount_discounts_ids_' + ids +'" value="' + ids +'"/>';
  1994. 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>';
  1995. 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>';
  1996. hh += "</tr>";
  1997. }
  1998. html += hh;
  1999. html += "</table>";
  2000. $("#isdiscount_discounts").html(html);
  2001. }
  2002. function refreshCommission() {
  2003. var commission_level = {:json_encode($commission_level)};
  2004. var html = '<table class="table table-bordered table-condensed"><thead><tr class="active">';
  2005. var specs = [];
  2006. $(".spec_item").each(function (i) {
  2007. var _this = $(this);
  2008. var spec = {
  2009. id: _this.find(".spec_id").val(),
  2010. title: _this.find(".spec_title").val()
  2011. };
  2012. var items = [];
  2013. _this.find(".spec_item_item").each(function () {
  2014. var __this = $(this);
  2015. var item = {
  2016. id: __this.find(".spec_item_id").val(),
  2017. title: __this.find(".spec_item_title").val(),
  2018. virtual: __this.find(".spec_item_virtual").val(),
  2019. show: __this.find(".spec_item_show").get(0).checked ? "1" : "0"
  2020. }
  2021. items.push(item);
  2022. });
  2023. spec.items = items;
  2024. specs.push(spec);
  2025. });
  2026. specs.sort(function (x, y) {
  2027. if (x.items.length > y.items.length) {
  2028. return 1;
  2029. }
  2030. if (x.items.length < y.items.length) {
  2031. return -1;
  2032. }
  2033. });
  2034. var len = specs.length;
  2035. var newlen = 1;
  2036. var h = new Array(len);
  2037. var rowspans = new Array(len);
  2038. for (var i = 0; i < len; i++) {
  2039. html += "<th>" + specs[i].title + "</th>";
  2040. var itemlen = specs[i].items.length;
  2041. if (itemlen <= 0) {
  2042. itemlen = 1
  2043. }
  2044. ;
  2045. newlen *= itemlen;
  2046. h[i] = new Array(newlen);
  2047. for (var j = 0; j < newlen; j++) {
  2048. h[i][j] = new Array();
  2049. }
  2050. var l = specs[i].items.length;
  2051. rowspans[i] = 1;
  2052. for (j = i + 1; j < len; j++) {
  2053. rowspans[i] *= specs[j].items.length;
  2054. }
  2055. }
  2056. $.each(commission_level,function (key,level) {
  2057. html += '<th><div class=""><div style="padding-bottom:10px;text-align:center;">'+level.levelname+'</div></div></th>';
  2058. })
  2059. html += '</tr></thead>';
  2060. for (var m = 0; m < len; m++) {
  2061. var k = 0, kid = 0, n = 0;
  2062. for (var j = 0; j < newlen; j++) {
  2063. var rowspan = rowspans[m];
  2064. if (j % rowspan == 0) {
  2065. h[m][j] = {
  2066. title: specs[m].items[kid].title,
  2067. virtual: specs[m].items[kid].virtual,
  2068. html: "<td class='full' rowspan='" + rowspan + "'>" + specs[m].items[kid].title + "</td>\r\n",
  2069. id: specs[m].items[kid].id
  2070. };
  2071. }
  2072. else {
  2073. h[m][j] = {
  2074. title: specs[m].items[kid].title,
  2075. virtual: specs[m].items[kid].virtual,
  2076. html: "",
  2077. id: specs[m].items[kid].id
  2078. };
  2079. }
  2080. n++;
  2081. if (n == rowspan) {
  2082. kid++;
  2083. if (kid > specs[m].items.length - 1) {
  2084. kid = 0;
  2085. }
  2086. n = 0;
  2087. }
  2088. }
  2089. }
  2090. var hh = "";
  2091. for (var i = 0; i < newlen; i++) {
  2092. hh += "<tr>";
  2093. var ids = [];
  2094. var titles = [];
  2095. var virtuals = [];
  2096. for (var j = 0; j < len; j++) {
  2097. hh += h[j][i].html;
  2098. ids.push(h[j][i].id);
  2099. titles.push(h[j][i].title);
  2100. virtuals.push(h[j][i].virtual);
  2101. }
  2102. ids = ids.join('_');
  2103. titles = titles.join('+');
  2104. var val = {
  2105. id: "",
  2106. title: titles,
  2107. <?php foreach( $commission_level as $level ){ ?>
  2108. <?php if( $level["key"] == "default"){ ?>
  2109. level{$level['key']}: '',
  2110. <?php }else{ ?>
  2111. level{$level['id']}: '',
  2112. <?php } ?>
  2113. <?php } ?>
  2114. costprice: "",
  2115. presell: "",
  2116. productprice: "",
  2117. marketprice: "",
  2118. weight: "",
  2119. productsn: "",
  2120. goodssn: "",
  2121. virtual: virtuals
  2122. };
  2123. var val ={ id : "",title:titles,<?php foreach( $commission_level as $level ){ ?> <?php if( $level["key"] == "default"){ ?>level{$level['key']}: '',<?php }else{ ?>level{$level['id']}: '',<?php } ?><?php } ?>costprice : "",productprice : "",marketprice : "",weight:"",productsn:"",goodssn:"",virtual:virtuals };
  2124. <?php foreach( $commission_level as $level ){ ?>
  2125. <?php if( $level["key"] == "default"){ ?>
  2126. var level{$level['key']} = new Array(3);
  2127. $(".commission_{$level['key']}_"+ ids).each(function(index,val){
  2128. level{$level['key']}[index] = val;
  2129. })
  2130. <?php }else{ ?>
  2131. var level{$level['id']} = new Array(3);
  2132. $(".commission_level{$level['id']}_"+ ids).each(function(index,val){
  2133. level{$level['id']}[index] = val;
  2134. })
  2135. <?php } ?>
  2136. <?php } ?>
  2137. if ($(".commission_id_" + ids).length > 0) {
  2138. val = {
  2139. id: $(".commission_id_" + ids + ":eq(0)").val(),
  2140. title: titles,
  2141. costprice: $(".commission_costprice_" + ids + ":eq(0)").val(),
  2142. presell: $(".commission_presell_" + ids + ":eq(0)").val(),
  2143. productprice: $(".commission_productprice_" + ids + ":eq(0)").val(),
  2144. marketprice: $(".commission_marketprice_" + ids + ":eq(0)").val(),
  2145. goodssn: $(".commission_goodssn_" + ids + ":eq(0)").val(),
  2146. productsn: $(".commission_productsn_" + ids + ":eq(0)").val(),
  2147. weight: $(".commission_weight_" + ids + ":eq(0)").val(),
  2148. virtual: virtuals
  2149. }
  2150. }
  2151. <?php foreach( $commission_level as $level ){ ?>
  2152. hh += '<td>';
  2153. var level_temp = <?php if( $level['key'] == 'default'){ ?>level{$level['key']}<?php }else{ ?>level{$level['id']}<?php } ?>;
  2154. if (len >= i && typeof (level_temp) != 'undefined')
  2155. {
  2156. if('{$level['key']}' == 'default')
  2157. {
  2158. for (var li = 0; li<{$shopset_level};li++)
  2159. {
  2160. if (typeof (level_temp[li])!= "undefined")
  2161. {
  2162. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2163. }
  2164. else
  2165. {
  2166. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2167. }
  2168. }
  2169. }
  2170. else
  2171. {
  2172. for (var li = 0; li<{$shopset_level};li++)
  2173. {
  2174. if (typeof (level_temp[li])!= "undefined")
  2175. {
  2176. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2177. }
  2178. else
  2179. {
  2180. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2181. }
  2182. }
  2183. }
  2184. }
  2185. else
  2186. {
  2187. if('{$level['key']}' == 'default')
  2188. {
  2189. for (var li = 0; li<{$shopset_level};li++)
  2190. {
  2191. if (typeof (level_temp[li])!= "undefined")
  2192. {
  2193. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2194. }
  2195. else
  2196. {
  2197. hh += '<input data-name="commission_level_{$level['key']}_' +ids+ '" type="text" class="form-control commission_{$level['key']} commission_{$level['key']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2198. }
  2199. }
  2200. }
  2201. else
  2202. {
  2203. for (var li = 0; li<{$shopset_level};li++)
  2204. {
  2205. if (typeof (level_temp[li])!= "undefined")
  2206. {
  2207. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="' +$(level_temp[li]).val()+ '" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2208. }
  2209. else
  2210. {
  2211. hh += '<input data-name="commission_level_{$level['id']}_' +ids+ '" type="text" class="form-control commission_level{$level['id']} commission_level{$level['id']}_' +ids+ '" value="" style="display:inline;width: '+96/parseInt({$shopset_level})+'%;"/> ';
  2212. }
  2213. }
  2214. }
  2215. }
  2216. hh += '</td>';
  2217. <?php } ?>
  2218. hh += '<input data-name="commission_id_' + ids+'"type="hidden" class="form-control commission_id commission_id_' + ids +'" value="' +(val.id=='undefined'?'':val.id )+'"/>';
  2219. hh += '<input data-name="commission_ids"type="hidden" class="form-control commission_ids commission_ids_' + ids +'" value="' + ids +'"/>';
  2220. hh += '<input data-name="commission_title_' + ids +'"type="hidden" class="form-control commission_title commission_title_' + ids +'" value="' +(val.title=='undefined'?'':val.title )+'"/></td>';
  2221. hh += '<input data-name="commission_virtual_' + ids +'"type="hidden" class="form-control commission_virtual commission_virtual_' + ids +'" value="' +(val.virtual=='undefined'?'':val.virtual )+'"/></td>';
  2222. hh += "</tr>";
  2223. }
  2224. html += hh;
  2225. html += "</table>";
  2226. $("#commission").html(html);
  2227. }
  2228. function setCol(cls){
  2229. $("."+cls).val( $("."+cls+"_all").val());
  2230. }
  2231. function showItem(obj){
  2232. var show = $(obj).get(0).checked?"1":"0";
  2233. $(obj).parents('.spec_item_item').find('.spec_item_show:eq(0)').val(show);
  2234. }
  2235. function nofind(){
  2236. var img=event.srcElement;
  2237. img.src="./resource/image/module-nopic-small.jpg";
  2238. img.onerror=null;
  2239. }
  2240. function choosetemp(id){
  2241. $('#modal-module-chooestemp').modal();
  2242. $('#modal-module-chooestemp').data("temp",id);
  2243. }
  2244. function addtemp(){
  2245. var id = $('#modal-module-chooestemp').data("temp");
  2246. var temp_id = $('#modal-module-chooestemp').find("select").val();
  2247. var temp_name = $('#modal-module-chooestemp option[value='+temp_id+']').text();
  2248. //alert(temp_id+":"+temp_name);
  2249. $("#temp_name_"+id).val(temp_name);
  2250. $("#temp_id_"+id).val(temp_id);
  2251. $('#modal-module-chooestemp .close').click();
  2252. refreshOptions()
  2253. }
  2254. function setinterval(type)
  2255. {
  2256. var intervalfloor =$('#intervalfloor').val();
  2257. if(intervalfloor=="")
  2258. {
  2259. intervalfloor=0;
  2260. }
  2261. intervalfloor = parseInt(intervalfloor);
  2262. if(type=='plus')
  2263. {
  2264. if(intervalfloor==3)
  2265. {
  2266. tip.msgbox.err("最多添加三个区间价格");
  2267. return;
  2268. }
  2269. intervalfloor=intervalfloor+1;
  2270. }
  2271. else if(type=='minus')
  2272. {
  2273. if(intervalfloor==0)
  2274. {
  2275. tip.msgbox.err("请最少添加一个区间价格");
  2276. return;
  2277. }
  2278. intervalfloor=intervalfloor-1;
  2279. }else
  2280. {
  2281. return;
  2282. }
  2283. if(intervalfloor<1)
  2284. {
  2285. $('#interval1').hide();
  2286. $('#intervalnum1').val("");
  2287. $('#intervalprice1').val("");
  2288. }else
  2289. {
  2290. $('#interval1').show();
  2291. }
  2292. if(intervalfloor<2)
  2293. {
  2294. $('#interval2').hide();
  2295. $('#intervalnum2').val("");
  2296. $('#intervalprice2').val("");
  2297. }else
  2298. {
  2299. $('#interval2').show();
  2300. }
  2301. if(intervalfloor<3)
  2302. {
  2303. $('#interval3').hide();
  2304. $('#intervalnum3').val("");
  2305. $('#intervalprice3').val("");
  2306. }else
  2307. {
  2308. $('#interval3').show();
  2309. }
  2310. $('#intervalfloor').val(intervalfloor);
  2311. }
  2312. </script>
  2313. <script language="javascript">
  2314. $(function() {
  2315. })
  2316. </script>
  2317. </body>