You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
50
hyhproject/home/view/default/shops/goodsconsult/goodsconsult.js
Executable file
50
hyhproject/home/view/default/shops/goodsconsult/goodsconsult.js
Executable file
@ -0,0 +1,50 @@
|
||||
function queryByPage(p){
|
||||
$('#list').html('<img src="'+WST.conf.ROOT+'/hyhproject/home/view/default/img/loading.gif">正在加载数据...');
|
||||
var params = {};
|
||||
params = WST.getParams('.s-query');
|
||||
params.page = p;
|
||||
$.post(WST.U('home/goodsconsult/pageQuery'),params,function(data,textStatus){
|
||||
var json = WST.toJson(data);
|
||||
$('#list').empty();
|
||||
if(json.status==1){
|
||||
json = json.data;
|
||||
var gettpl = document.getElementById('tblist').innerHTML;
|
||||
laytpl(gettpl).render(json.Rows, function(html){
|
||||
$('#list').html(html);
|
||||
$('.gImg').lazyload({ effect: "fadeIn",failurelimit : 10,skip_invisible : false,threshold: 200,placeholder:window.conf.IMGURL+'/'+window.conf.GOODS_LOGO});
|
||||
});
|
||||
laypage({
|
||||
cont: 'pager',
|
||||
pages:json.TotalPage,
|
||||
curr: json.CurrentPage,
|
||||
skin: '#e23e3d',
|
||||
groups: 3,
|
||||
jump: function(e, first){
|
||||
if(!first){
|
||||
queryByPage(e.curr);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function reply(t,id){
|
||||
var params = {};
|
||||
if($('#reply-'+id).val()==''){
|
||||
WST.msg('回复内容不能为空',{icon:2});
|
||||
return false;
|
||||
}
|
||||
params.reply = $('#reply-'+id).val();
|
||||
params.id=id;
|
||||
$.post(WST.U('home/goodsconsult/reply'),params,function(data){
|
||||
var json = WST.toJson(data);
|
||||
if(json.status==1){
|
||||
var today = new Date();
|
||||
var Myd = today.toLocaleDateString();
|
||||
var His = today.toLocaleTimeString();
|
||||
var html = '<p class="reply-content">'+params.reply+'【'+Myd+' '+His+'】</p>'
|
||||
$(t).parent().html(html);
|
||||
}
|
||||
});
|
||||
}
|
85
hyhproject/home/view/default/shops/goodsconsult/list.html
Executable file
85
hyhproject/home/view/default/shops/goodsconsult/list.html
Executable file
@ -0,0 +1,85 @@
|
||||
{extend name="default/shops/base" /}
|
||||
{block name="title"}商品咨询-卖家中心{__block__}{/block}
|
||||
{block name="content"}
|
||||
<style>
|
||||
.c999{color:#999;}
|
||||
.consult{margin-bottom: 15px;}
|
||||
.consultImg,.consultImg a,.consultImg a img{width: 50px !important;height: 50px !important}
|
||||
</style>
|
||||
<div class="wst-shop-head"><span>商品咨询</span></div>
|
||||
<div class="wst-shop-tbar">
|
||||
<label>
|
||||
咨询分类:
|
||||
<select name="consultType" id="consultType" class="s-query">
|
||||
<option value="0">-请选择-</option>
|
||||
{volist name=":WSTDatas('COUSULT_TYPE')" id="vo"}
|
||||
<option value="{$vo['dataVal']}" >{$vo['dataName']}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
关键词:<input type="text" id="consultKey" class="s-query" /><a class="s-btn" onclick="queryByPage()">查询</a>
|
||||
</label>
|
||||
</div>
|
||||
<div class="wst-shop-content">
|
||||
<table class='wst-list'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="40">序号</th>
|
||||
<th width="300">商品</th>
|
||||
<th>咨询内容</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id='list'></tbody>
|
||||
<tfoot>
|
||||
<tr><td colspan='10' style='padding-top:10px;text-align:center;'>
|
||||
<div id='pager'></div>
|
||||
</td></tr>
|
||||
</tfoot>
|
||||
|
||||
<script id="tblist" type="text/html">
|
||||
{{# for(var i = 0; i < d.length; i++){ }}
|
||||
<tr>
|
||||
<td rowspan="2">{{i+1}}</td>
|
||||
<td rowspan="2">
|
||||
<div class="appra-img consultImg">
|
||||
<a target='_blank' href="{{WST.U("home/goods/detail","id="+d[i]['goodsId'])}}">
|
||||
<img class='gImg' data-original='__IMGURL__/{{d[i].goodsImg}}'/>
|
||||
</a>
|
||||
</div>
|
||||
<p class="appra-goodsName" style="height:auto;">
|
||||
{{WST.cutStr(d[i]['goodsName'],43)}}
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="border-bottom:1px solid #ccc;">
|
||||
<td colspan='3'>
|
||||
<p class='consult'>
|
||||
[{{(WST.blank(d[i]['loginName'])=='')?'游客':d[i]['loginName']}}]:{{d[i]['consultContent']}} <span class="c999">({{d[i]['createTime']}})</span>
|
||||
</p>
|
||||
|
||||
<div class="reply-box">
|
||||
{{# if(d[i]['reply']==null || d[i]['reply']=='') { }}
|
||||
<textarea style="width:98%;height:80px;" id="reply-{{d[i]['id']}}" placeholder='3~200个字符长度' maxlength='200'></textarea>
|
||||
<a class="reply-btn s-btn" style="margin-left:3px;" onclick="reply(this,{{d[i]['id']}})">回复</a>
|
||||
{{# }else{ }}
|
||||
<p class="reply-content">{{d[i]['reply']}}【{{d[i]['replyTime']}}】</p>
|
||||
{{# } }}
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{{# } }}
|
||||
</script>
|
||||
</table>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script type='text/javascript' src='__STYLE__/shops/goodsconsult/goodsconsult.js?v={$v}'></script>
|
||||
<script>
|
||||
$(function(){
|
||||
queryByPage();
|
||||
})
|
||||
</script>
|
||||
{/block}
|
Reference in New Issue
Block a user