You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
165 lines
5.9 KiB
165 lines
5.9 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<!-- 通用 -->
|
|
{include file="common/head" /}
|
|
<!-- 当前 -->
|
|
<link rel="stylesheet" href="__TMPL__/static/scss/trade.css">
|
|
{if isset($app_id)}
|
|
<style>
|
|
.commissionBlock .w1280{
|
|
width: 100%;
|
|
}
|
|
@media (max-width:1080px) {
|
|
.commissionBlock2 .w1280 .content p{
|
|
margin-bottom: 0;
|
|
}
|
|
}
|
|
</style>
|
|
{/if}
|
|
</head>
|
|
|
|
<body>
|
|
<!-- header start -->
|
|
{if !isset($app_id)}
|
|
{include file="common/header" /}
|
|
<!-- header end -->
|
|
<!-- banner start -->
|
|
<div class="bannerList">
|
|
<div class="img"><img src="__TMPL__/static/images/trade/tradeBanner.jpg" alt=""></div>
|
|
<div class="w1280">
|
|
<div class="bannerTitle">交易服务</div>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
<!-- banner end -->
|
|
{if !isset($app_id)}
|
|
<div class="pageListNav">
|
|
<div class="w1280">
|
|
{hcTaglib:subcategory pid="9" item="vo" field="id,title" sort="sort asc"}
|
|
<a href="{:hcUrl('list/index',['id'=>$vo.id])}" class="{$current_cate['id']==$vo.id?'on':''}">{$vo.title}</a>
|
|
{/hcTaglib:subcategory}
|
|
</div>
|
|
</div>
|
|
{else /}
|
|
<div class="pageListNav">
|
|
<div class="w1280">
|
|
{hcTaglib:categoryList ids="18,19" item="vo" field="id,title" sort="id desc"}
|
|
<a href="{:hcUrl('list/index',['id'=>$vo.id,'query'=>['app_id'=>$app_id]])}" class="{$current_cate['id']==$vo.id?'on':''}">{$vo.title}</a>
|
|
{/hcTaglib:categoryList}
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
<div class="commissionBlock">
|
|
<div class="w1280">
|
|
<div class="tradeTit">
|
|
<p>保证金标准</p>
|
|
<div class="tradeSearch">
|
|
<input type="text" placeholder="请输入品种名称/交易代码/合约代码">
|
|
<div class="searchBtn">搜索</div>
|
|
</div>
|
|
</div>
|
|
<div class="tab">
|
|
{hcTaglib:subcategory pid="19" item="vo" field="id,title" sort="sort asc"}
|
|
<a href="javascript:;" class="{$key == 1 ? 'on' : ''}" data-id="{$vo.id}">{$vo.title}</a>
|
|
{/hcTaglib:subcategory}
|
|
</div>
|
|
<div class="content">
|
|
{hcTaglib:subcategory pid="19" item="vo" field="id,title" sort="sort asc"}
|
|
<div class="cont">
|
|
<table class="table2">
|
|
<tbody>
|
|
<tr>
|
|
<td>品种</td>
|
|
<td>代码</td>
|
|
<td>合约单位(吨/手)</td>
|
|
<td>保证金(交易所+公司上浮)</td>
|
|
</tr>
|
|
{hcTaglib:content cid="$vo.id" moduleId="10" item="vv" limit="100" mainField="id,title,sub_title,description" subField="id,min_change,chg,margin,unit,limit_price,last_date" sort="id asc"}
|
|
<tr>
|
|
<td>{$vv.title}</td>
|
|
<td>{$vv.sub_title}</td>
|
|
<td>{$vv.description}</td>
|
|
<td>{$vv.main_content.margin}</td>
|
|
</tr>
|
|
{/hcTaglib:content}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{/hcTaglib:subcategory}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- footer start-->
|
|
{if !isset($app_id)}
|
|
{include file="common/footer" /}
|
|
{/if}
|
|
<!-- footer end -->
|
|
<!-- 通用 -->
|
|
{include file="common/foot" /}
|
|
<!-- 当前 -->
|
|
<script src="__TMPL__/static/js/layui.js"></script>
|
|
<script>
|
|
let index = 1;
|
|
$('.commissionBlock .w1280 .content .cont').eq(0).css('display','block')
|
|
$('.commissionBlock .w1280 .tab a').click(function(){
|
|
let thisIndex = $(this).index()
|
|
index = thisIndex + 1;
|
|
|
|
if($(this).hasClass('on')){
|
|
return
|
|
}
|
|
$(this).siblings().removeClass('on')
|
|
$(this).addClass('on')
|
|
$('.commissionBlock .w1280 .content .cont').css('display','none')
|
|
$('.commissionBlock .w1280 .content .cont').eq(thisIndex).fadeIn()
|
|
})
|
|
// 页内搜索
|
|
// 页内搜索
|
|
$('.tradeSearch .searchBtn').click(function(){
|
|
let searchInput = $('.tradeSearch input').val()
|
|
let cid = $('.commissionBlock .w1280 .tab a.on').attr('data-id');
|
|
$.ajax({
|
|
'type':'get',
|
|
'url':'content/list',
|
|
'data':{'category_id':cid,'title':searchInput,'limit':500,'sort':'id asc'},
|
|
'dataType':'json',
|
|
'success':function(res){
|
|
createTableDom(res.data)
|
|
}
|
|
})
|
|
})
|
|
function createTableDom(data)
|
|
{
|
|
let tableStart = `
|
|
<tr>
|
|
<td>品种</td>
|
|
<td>代码</td>
|
|
<td>合约单位(吨/手)</td>
|
|
<td>保证金(交易所+公司上浮)</td>
|
|
</tr>
|
|
`
|
|
let tableDom = ''
|
|
data.forEach((item) => {
|
|
let tmp = `
|
|
<tr>
|
|
<td>${item.title}</td>
|
|
<td>${item.sub_title}</td>
|
|
<td>${item.description}</td>
|
|
<td>${item.main_content.margin}</td>
|
|
</tr>
|
|
`
|
|
tableDom += tmp;
|
|
})
|
|
let selector = `.commissionBlock .w1280 .content .cont:nth-child(${index}) table tbody`
|
|
|
|
$(selector).html(tableStart + tableDom)
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html>
|