edit.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <form id="form" action="{:url('allwin/shop/edit')}">
  2. <input type="hidden" name="id" value="{$id}"/>
  3. <input type="hidden" id="store_id" name="store_id" value="{$info.store_id}"/>
  4. <input type="hidden" id="amout" name="amout" value="0"/>
  5. <div class="titlebar"><i class="iconfont icon-license"></i>社群设置</div>
  6. <table class="formtable">
  7. <tr>
  8. <th>经纪人:</th>
  9. <td>
  10. <input readonly="readonly" id="detective_uid" class="readonly input w100" type="text" name="detective_uid" value="{$info.detective_uid}" />
  11. <button url="{:url('allwin/store/selectStoreManage')}" data="detective_uid" type="button" class="selectid button"><i class="iconfont icon-my_icon"></i>选择经纪人</button>
  12. <span class="gray">选择经纪人后每单商品交易都将分成</span>
  13. </td>
  14. </tr>
  15. <th>绑定应答:</th>
  16. <td>
  17. <input readonly="readonly" id="keyword" class="readonly input w100" type="text" name="keyword" value="{$info.keyword}" />
  18. <button url="{:url('system/passport.keyword/selectMiniapp')}" data='keyword' type="button" class="selectid button"><i class="iconfont icon-service_icon"></i>选择应答</button>
  19. <span class="gray">输入关键字,自动回复客服信息</span>
  20. </td>
  21. </tr>
  22. <tr><th>社群名称:</th><td><input class="input" datatype="*" type="text" name="group_title" value="{$info.group_title}"/></td></tr>
  23. <tr><th>社群简述:</th><td><input class="input w500" datatype="*" type="text" name="group_note" value="{$info.group_note}"/></td></tr>
  24. <tr><th>社群Logo:</th><td><input url="{:url('system/passport.common/upload')}" class="input w500 selectid" id="group_img" datatype="*" type="text" name="group_img" value="{$info.group_img}" /></td></tr>
  25. </table>
  26. <div class="titlebar"><i class="iconfont icon-store_icon"></i>所属好店</div>
  27. <table class="formtable">
  28. <tr><th>所属好店:</th><td><div class="ext-select w500 selectid" id="store_name" url="{:url('allwin/store/selectStore')}">{$storename}</div></td></tr>
  29. <tr>
  30. <th>商品属性:</th>
  31. <td class="input-group">
  32. <select datatype="*" class="select w250" name="types">
  33. <option value="0"{if $info.types == 0} selected{/if}>默认属性</option>
  34. <option value="1"{if $info.types == 1} selected{/if}>首页横栏</option>
  35. <option value="2"{if $info.types == 2} selected{/if}>专题引荐</option>
  36. <option value="3"{if $info.types == 3} selected{/if}>精选专栏</option>
  37. <option value="4"{if $info.types == 4} selected{/if}>好店推荐</option>
  38. </select>
  39. <select id="category_id" class="select w250" datatype="*" name="category_id" class="select">
  40. <option value="">--请选择专题--</option>
  41. {foreach $cate as $vo}<option value="{$vo.id}" {if $vo.id == $info.category_id}selected{/if}>{$vo.title}</option>{/foreach}
  42. </select>
  43. </td>
  44. </tr>
  45. </table>
  46. <div class="titlebar"><i class="iconfont icon-edit"></i>价格规则 <span class="gray">活动商家收到的金额是你填写的成本价</span></div>
  47. <table class="formtable">
  48. <tr><th>用户实付(¥):</th><td><span class="blue" id="price">0</span><span class="gray"> (销售价¥ - 会员省¥ - 优惠券) = 实际付款</span></td></tr>
  49. <tr><th>实际到账(¥):</th><td><span class="red" id="realamout">0</span> <span class="gray">实际付款 - 引荐所得 - 经纪人所得 = 实际到账</span></td></tr>
  50. <tr><th>基础价格:</th><td class="input-group">
  51. <label class="fn-left">成本价(¥)</label><input placeholder="成本价(¥)" class="input w90" datatype="npot" type="text" name="cost_price" value="{$info.cost_price|money}" />
  52. <label class="fn-left">市场价(¥)</label><input placeholder="市场价(¥)" class="input w90" datatype="npot" type="text" name="market_price" value="{$info.market_price|money}"/>
  53. <label class="fn-left fn-fb">销售价(¥)</label><input placeholder="销售价(¥)" class="input w90 calculate" datatype="npot" type="text" name="sell_price" value="{$info.sell_price|money}"/>
  54. </td></tr>
  55. <tr><th>会员优惠:</th><td><input class="input w90 calculate" datatype="npot" type="text" name="vip_price" value="{$info.vip_price}" /> <span class="gray">请填写会员减去多少钱</span></td></tr>
  56. <tr><th>抵扣积分:</th><td><input class="input w90" datatype="n" type="text" name="points" value="{$info.points}" /> <span class="gray">可以用积分减免多少钱,100积分 = 1元</span></td></tr>
  57. <tr><th>绑定优惠券:</th><td class="input-group">
  58. <input id="coupon_id" readonly placeholder="优惠券" class="input w120 calculate readonly" datatype="n" type="text" name="coupon_id" value="{$info.coupon_id}"/>
  59. <button type="button" class="selectid button" url="{:url('allwin/coupon/selectId',['is_platform' => 0,'input'=>'coupon_id'])}" id="coupon_id">选择优惠券</button>
  60. <button type="button" class="button button-blue reset">清空</button>
  61. </td></tr>
  62. <tr><th>商品分润:</th><td class="input-group">
  63. <label class="fn-left">引荐(%)</label>
  64. <input class="input w60 calculate" datatype="npot" type="text" name="share_price" value="{$info.share_price}" />
  65. <span class="fn-left gray pl5">赚 ¥<span id="share_price" class="red fn-f16">0</span></span>
  66. <label class="fn-left">经纪人(%)</label>
  67. <input class="input w60 calculate" datatype="npot" type="text" name="detective_price" value="{$info.detective_price}"/>
  68. <span class="fn-left gray pl5">赚 ¥<span id="detective_price" class="red fn-f16">0</span></span>
  69. </td></tr>
  70. <tr><th>结束日期:</th><td><input class="input w500 ui-time readonly" type="text" name="end_time" value="{if !empty($info.end_time)}{$info.end_time|date='Y-m-d H:i:s'}{/if}" readonly/></td></tr>
  71. </table>
  72. <div class="titlebar"><i class="iconfont icon-edit"></i>商品信息</div>
  73. <table class="formtable">
  74. <tr><th><span class="red">*</span> 产品标题:</th><td><input class="input w500" datatype="*" type="text" name="name" value="{$info.name}" /></td></tr>
  75. <tr><th><span class="red">*</span> 推荐简述:</th><td><input class="input w500" datatype="*" type="text" name="title" value="{$info.title}"/></td></tr>
  76. <tr><th><span class="red">*</span> 产品库存:</th><td>
  77. <input class="input w90" datatype="n" type="text" name="warehouse_num" value="{$info.warehouse_num}" /> <span class="gray">0代表已经售完</span>
  78. <input class="input w90" datatype="n" type="text" name="warehouse_sellnum" value="{$info.warehouse_sellnum}" /> <span class="gray">虚拟已售</span>
  79. </td></tr>
  80. <tr class="imgs">
  81. <th><input type="hidden" name="img" id="img_index" value="{$info.img}" />产品预览图</th>
  82. <td id="imgbox">
  83. <div url="{:url('system/passport.common/upload')}" class="img-review fn-left fn-cp selectid"><img src="__PUBLIC__/admin/review.png"></div>
  84. {foreach $imgs as $pic}<div class="box-view fn-left fn-cp{if $info.img == $pic} current{/if}">
  85. <input type="hidden" name="imgs[]" value="{$pic}" /><img src="{$pic}" onclick="selectImg(this)">
  86. <div class="opera">
  87. <a class="imgbox-left" href="javascript:;"><i class="iconfont icon-arrowleft"></i></a>
  88. <a class="imgbox-right" href="javascript:;"><i class="iconfont icon-arrowright"></i></a>
  89. <a class="imgbox-link" href="javascript:;" onclick="linkImg(this)"><i class="iconfont icon-search_icon"></i></a>
  90. <a class="imgbox-close" href="javascript:;" onclick="delImg(this)"><i class="iconfont icon-close_icon"></i></a>
  91. </div>
  92. </div>{/foreach}</td>
  93. </tr>
  94. <tr><th>购买须知</th><td><textarea class="textarea ui-mieditor" id="notice" name="notice">{$info.notice|dehtml}</textarea></td></tr>
  95. <tr><th>商品详情</th><td><textarea class="textarea ui-editor" id="content" name="content">{$info.content|dehtml}</textarea></td></tr>
  96. <tr><th></th><td><input type="submit" value="确定" class="button button-blue submit" /> <input type="reset" value="重置" class="button button-blank" /></td></tr>
  97. </table>
  98. </form>
  99. <script type="text/javascript">
  100. Do('base','layer','form','editor','tpl','date',function () {
  101. $('#form').isForm({'upload':'{:url("system/passport.common/upload")}'});
  102. $(".selectid").win();
  103. calculate();
  104. $(".calculate").change(function(){
  105. calculate();
  106. });
  107. $(".reset").click(function(){
  108. $("input[name='coupon_id']").val(0)
  109. calculate();
  110. });
  111. $(".selectCoupon").click(function(){
  112. var store_id = parseFloat($("#store_id").val());;
  113. if(isNaN(store_id)){
  114. parent.layer.alert('请先选择宝贝所属好店')
  115. }else{
  116. $(this).popup({
  117. url:'{:url("allwin/coupon/selectId")}?store_id='+store_id+'&input=coupon_id&is_platform=0'
  118. });
  119. }
  120. });
  121. })
  122. function calculate(){
  123. var sell_price = parseFloat($("input[name='sell_price']").val()),sell_price = isNaN(sell_price)?0:sell_price;
  124. var vip_price = parseFloat($("input[name='vip_price']").val()),vip_price = isNaN(vip_price)?0:vip_price;
  125. var share_price = parseFloat($("input[name='share_price']").val()),share_price = isNaN(share_price)?0:share_price;
  126. var detective_price = parseFloat($("input[name='detective_price']").val()),detective_price = isNaN(detective_price)?0:detective_price;
  127. var coupon_id = parseFloat($("input[name='coupon_id']").val()),coupon_id = isNaN(coupon_id)?0:coupon_id;
  128. var points = parseFloat($("input[name='points']").val()),points = isNaN(points)?0:points;
  129. var points = points/100,price= sell_price-vip_price-points;
  130. if(coupon_id > 0){
  131. $.getJSON('{:url("allwin/shop/calculatePrice")}',{coupon_id:coupon_id,sell_price:sell_price},function (rel) {
  132. price = price-parseFloat(rel.data);
  133. var amout = (price-(price*share_price/100)-(price*detective_price/100)).toFixed(2)
  134. $("#price").html(price.toFixed(2));
  135. $("#share_price").html((price*share_price/100));
  136. $("#detective_price").html((price*detective_price/100));
  137. $("#amout").val(amout);
  138. $("#realamout").html(amout);
  139. });
  140. }else{
  141. var amout = (price-(price*share_price/100)-(price*detective_price/100)).toFixed(2)
  142. $("#price").html(price.toFixed(2));
  143. $("#amout").val(amout);
  144. $("#realamout").html(amout);
  145. $("#share_price").html((price*share_price/100));
  146. $("#detective_price").html((price*detective_price/100));
  147. }
  148. }
  149. function setState(store){
  150. $("#store_id").val(store.id);
  151. $("#store_name").html(store.store_name);
  152. }
  153. function group_img(img){
  154. $("#group_img").val(img);
  155. }
  156. </script>