Files
thinksaas_lmve/app/shop/html/buy.html
T
2023-06-22 13:33:25 +08:00

135 lines
3.1 KiB
HTML

{php include pubTemplate("header")}
<div class="container">
<nav aria-label="breadcrumb" class="position-relative">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
<li class="breadcrumb-item"><a href="{tsUrl('shop')}">商店</a></li>
<li class="breadcrumb-item active" aria-current="page">{$strshop[title]}</li>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:94px;background-color:#FF9933" href="{tsUrl('shop','cart')}">购物车</a>
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:6px;" href="{tsUrl('shop','myorder')}">我的订单</a>
</ol>
</nav>
<div class="card">
<div class="card-body">
<div class="shopping">
<form action="{tsUrl('shop','buy')}" method="post">
<input name="ts" value="do" hidden></input>
<input name="shopid" value="$strshop[shopid]" hidden></input>
<table class="table table-hover table-bordered">
<thead class="thead-light">
<tr><th>商品</th><th>价格</th><th>数量</th></tr>
</thead>
<tbody>
<tr>
<td>
<img class="mw100" src="{if $strshop[photo] == ''}{SITE_URL}app/{$app}/skins/{$skin}/photo_album.png{else}{php echo tsXimg($strshop[photo],'shop',50,'50',$strshop[path],1)}{/if}" alt="{$strshop[title]}">
<a target="_blank" href="{tsUrl('shop','show',array('id'=>$strshop[shopid]))}">{$strshop[title]}</a>
</td>
<td> <n id="pay_{$strshop[shopid]}">{$strshop[pay]}</n>{if $strshop[pay_type] == '1'}积分{/if}</td><td>
<a href="javascript:void('0');" onclick="jian('{$strshop[shopid]}')">-</a> <input id="number_{$strshop[shopid]}" style="width:50px;" name="much" value="{$much}" > <a href="javascript:void('0');" onclick="jia('{$strshop[shopid]}')">+</a>
</td></tr>
</tbody>
</table>
<div class="shopping_total">应付总额:<h1><n id="needpay_{$strshop[shopid]}">{$strshop[pay]}</n>{if $strshop[pay_type] == '1'}积分{/if}</h1></div>
<table class="table table-bordered">
<thead class="thead-light">
<tr bgcolor="#f0f0f0"><th>收货信息</th></tr>
</thead>
<tbody>
<tr>
<td>
<h4>地址</h4>
<textarea name="address" style="width:100%;height:100px;overflow:scroll;"></textarea>
</td>
</tr>
</tbody>
</table>
<div class="text-right"><button class="btn btn-lg btn-danger" type="submit">提交订单</button></div>
</form>
</div>
</div>
</div>
</div>
{php include pubTemplate("footer")}
<script>
function buyadd()
{
var sl=$('#number_{$strshop[shopid]}').val();
var s2=$('#pay_{$strshop[shopid]}').text();
s2=parseInt(s2);
var s3=sl*s2;
$('#number_{$strshop[shopid]}').val(sl);
$('#needpay_{$strshop[shopid]}').text(s3);
}
setInterval(buyadd,500);
function jia(shopid){
var sl=$('#number_'+shopid).val();
if(sl)
{
sl=parseInt(sl)+1;
$('#number_'+shopid).val(sl);
}else
{
$('#number_'+shopid).val(0);
}
}
function jian(shopid){
var sl=$('#number_'+shopid).val();
if (sl>1){
sl=parseInt(sl)-1;
$('#number_'+shopid).val(sl);
}else
{
$('#number_'+shopid).val(1);
}
}
</script>