add.html 8.3 KB

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