123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156 |
- <form id="form" action="{:url('allwin/shop/edit')}">
- <input type="hidden" name="id" value="{$id}"/>
- <input type="hidden" id="store_id" name="store_id" value="{$info.store_id}"/>
- <input type="hidden" id="amout" name="amout" value="0"/>
- <div class="titlebar"><i class="iconfont icon-license"></i>社群设置</div>
- <table class="formtable">
- <tr>
- <th>经纪人:</th>
- <td>
- <input readonly="readonly" id="detective_uid" class="readonly input w100" type="text" name="detective_uid" value="{$info.detective_uid}" />
- <button url="{:url('allwin/store/selectStoreManage')}" data="detective_uid" type="button" class="selectid button"><i class="iconfont icon-my_icon"></i>选择经纪人</button>
- <span class="gray">选择经纪人后每单商品交易都将分成</span>
- </td>
- </tr>
- <th>绑定应答:</th>
- <td>
- <input readonly="readonly" id="keyword" class="readonly input w100" type="text" name="keyword" value="{$info.keyword}" />
- <button url="{:url('system/passport.keyword/selectMiniapp')}" data='keyword' type="button" class="selectid button"><i class="iconfont icon-service_icon"></i>选择应答</button>
- <span class="gray">输入关键字,自动回复客服信息</span>
- </td>
- </tr>
- <tr><th>社群名称:</th><td><input class="input" datatype="*" type="text" name="group_title" value="{$info.group_title}"/></td></tr>
- <tr><th>社群简述:</th><td><input class="input w500" datatype="*" type="text" name="group_note" value="{$info.group_note}"/></td></tr>
- <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>
- </table>
- <div class="titlebar"><i class="iconfont icon-store_icon"></i>所属好店</div>
- <table class="formtable">
- <tr><th>所属好店:</th><td><div class="ext-select w500 selectid" id="store_name" url="{:url('allwin/store/selectStore')}">{$storename}</div></td></tr>
- <tr>
- <th>商品属性:</th>
- <td class="input-group">
- <select datatype="*" class="select w250" name="types">
- <option value="0"{if $info.types == 0} selected{/if}>默认属性</option>
- <option value="1"{if $info.types == 1} selected{/if}>首页横栏</option>
- <option value="2"{if $info.types == 2} selected{/if}>专题引荐</option>
- <option value="3"{if $info.types == 3} selected{/if}>精选专栏</option>
- <option value="4"{if $info.types == 4} selected{/if}>好店推荐</option>
- </select>
- <select id="category_id" class="select w250" datatype="*" name="category_id" class="select">
- <option value="">--请选择专题--</option>
- {foreach $cate as $vo}<option value="{$vo.id}" {if $vo.id == $info.category_id}selected{/if}>{$vo.title}</option>{/foreach}
- </select>
- </td>
- </tr>
- </table>
- <div class="titlebar"><i class="iconfont icon-edit"></i>价格规则 <span class="gray">活动商家收到的金额是你填写的成本价</span></div>
- <table class="formtable">
- <tr><th>用户实付(¥):</th><td><span class="blue" id="price">0</span><span class="gray"> (销售价¥ - 会员省¥ - 优惠券) = 实际付款</span></td></tr>
- <tr><th>实际到账(¥):</th><td><span class="red" id="realamout">0</span> <span class="gray">实际付款 - 引荐所得 - 经纪人所得 = 实际到账</span></td></tr>
- <tr><th>基础价格:</th><td class="input-group">
- <label class="fn-left">成本价(¥)</label><input placeholder="成本价(¥)" class="input w90" datatype="npot" type="text" name="cost_price" value="{$info.cost_price|money}" />
- <label class="fn-left">市场价(¥)</label><input placeholder="市场价(¥)" class="input w90" datatype="npot" type="text" name="market_price" value="{$info.market_price|money}"/>
- <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}"/>
- </td></tr>
- <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>
- <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>
- <tr><th>绑定优惠券:</th><td class="input-group">
- <input id="coupon_id" readonly placeholder="优惠券" class="input w120 calculate readonly" datatype="n" type="text" name="coupon_id" value="{$info.coupon_id}"/>
- <button type="button" class="selectid button" url="{:url('allwin/coupon/selectId',['is_platform' => 0,'input'=>'coupon_id'])}" id="coupon_id">选择优惠券</button>
- <button type="button" class="button button-blue reset">清空</button>
- </td></tr>
- <tr><th>商品分润:</th><td class="input-group">
- <label class="fn-left">引荐(%)</label>
- <input class="input w60 calculate" datatype="npot" type="text" name="share_price" value="{$info.share_price}" />
- <span class="fn-left gray pl5">赚 ¥<span id="share_price" class="red fn-f16">0</span></span>
- <label class="fn-left">经纪人(%)</label>
- <input class="input w60 calculate" datatype="npot" type="text" name="detective_price" value="{$info.detective_price}"/>
- <span class="fn-left gray pl5">赚 ¥<span id="detective_price" class="red fn-f16">0</span></span>
- </td></tr>
- <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>
- </table>
- <div class="titlebar"><i class="iconfont icon-edit"></i>商品信息</div>
- <table class="formtable">
- <tr><th><span class="red">*</span> 产品标题:</th><td><input class="input w500" datatype="*" type="text" name="name" value="{$info.name}" /></td></tr>
- <tr><th><span class="red">*</span> 推荐简述:</th><td><input class="input w500" datatype="*" type="text" name="title" value="{$info.title}"/></td></tr>
- <tr><th><span class="red">*</span> 产品库存:</th><td>
- <input class="input w90" datatype="n" type="text" name="warehouse_num" value="{$info.warehouse_num}" /> <span class="gray">0代表已经售完</span>
- <input class="input w90" datatype="n" type="text" name="warehouse_sellnum" value="{$info.warehouse_sellnum}" /> <span class="gray">虚拟已售</span>
- </td></tr>
- <tr class="imgs">
- <th><input type="hidden" name="img" id="img_index" value="{$info.img}" />产品预览图</th>
- <td id="imgbox">
- <div url="{:url('system/passport.common/upload')}" class="img-review fn-left fn-cp selectid"><img src="__PUBLIC__/admin/review.png"></div>
- {foreach $imgs as $pic}<div class="box-view fn-left fn-cp{if $info.img == $pic} current{/if}">
- <input type="hidden" name="imgs[]" value="{$pic}" /><img src="{$pic}" onclick="selectImg(this)">
- <div class="opera">
- <a class="imgbox-left" href="javascript:;"><i class="iconfont icon-arrowleft"></i></a>
- <a class="imgbox-right" href="javascript:;"><i class="iconfont icon-arrowright"></i></a>
- <a class="imgbox-link" href="javascript:;" onclick="linkImg(this)"><i class="iconfont icon-search_icon"></i></a>
- <a class="imgbox-close" href="javascript:;" onclick="delImg(this)"><i class="iconfont icon-close_icon"></i></a>
- </div>
- </div>{/foreach}</td>
- </tr>
- <tr><th>购买须知</th><td><textarea class="textarea ui-mieditor" id="notice" name="notice">{$info.notice|dehtml}</textarea></td></tr>
- <tr><th>商品详情</th><td><textarea class="textarea ui-editor" id="content" name="content">{$info.content|dehtml}</textarea></td></tr>
- <tr><th></th><td><input type="submit" value="确定" class="button button-blue submit" /> <input type="reset" value="重置" class="button button-blank" /></td></tr>
- </table>
- </form>
- <script type="text/javascript">
- Do('base','layer','form','editor','tpl','date',function () {
- $('#form').isForm({'upload':'{:url("system/passport.common/upload")}'});
- $(".selectid").win();
- calculate();
- $(".calculate").change(function(){
- calculate();
- });
- $(".reset").click(function(){
- $("input[name='coupon_id']").val(0)
- calculate();
- });
- $(".selectCoupon").click(function(){
- var store_id = parseFloat($("#store_id").val());;
- if(isNaN(store_id)){
- parent.layer.alert('请先选择宝贝所属好店')
- }else{
- $(this).popup({
- url:'{:url("allwin/coupon/selectId")}?store_id='+store_id+'&input=coupon_id&is_platform=0'
- });
- }
- });
- })
- function calculate(){
- var sell_price = parseFloat($("input[name='sell_price']").val()),sell_price = isNaN(sell_price)?0:sell_price;
- var vip_price = parseFloat($("input[name='vip_price']").val()),vip_price = isNaN(vip_price)?0:vip_price;
- var share_price = parseFloat($("input[name='share_price']").val()),share_price = isNaN(share_price)?0:share_price;
- var detective_price = parseFloat($("input[name='detective_price']").val()),detective_price = isNaN(detective_price)?0:detective_price;
- var coupon_id = parseFloat($("input[name='coupon_id']").val()),coupon_id = isNaN(coupon_id)?0:coupon_id;
- var points = parseFloat($("input[name='points']").val()),points = isNaN(points)?0:points;
- var points = points/100,price= sell_price-vip_price-points;
- if(coupon_id > 0){
- $.getJSON('{:url("allwin/shop/calculatePrice")}',{coupon_id:coupon_id,sell_price:sell_price},function (rel) {
- price = price-parseFloat(rel.data);
- var amout = (price-(price*share_price/100)-(price*detective_price/100)).toFixed(2)
- $("#price").html(price.toFixed(2));
- $("#share_price").html((price*share_price/100));
- $("#detective_price").html((price*detective_price/100));
- $("#amout").val(amout);
- $("#realamout").html(amout);
- });
- }else{
- var amout = (price-(price*share_price/100)-(price*detective_price/100)).toFixed(2)
- $("#price").html(price.toFixed(2));
- $("#amout").val(amout);
- $("#realamout").html(amout);
- $("#share_price").html((price*share_price/100));
- $("#detective_price").html((price*detective_price/100));
- }
- }
- function setState(store){
- $("#store_id").val(store.id);
- $("#store_name").html(store.store_name);
- }
- function group_img(img){
- $("#group_img").val(img);
- }
- </script>
|