<div id="<?php echo NS; ?>toolbar">
<div style="padding:5px">
<form id="<?php echo NS; ?>searchform">
<span>订单号:</span>
<input class="easyui-textbox" id="sn" name="sn" data-options="iconCls:'icon-ok',prompt:'订单号'" style="width:200px">
<label>
<a href="#" class="easyui-linkbutton" data-options="text: '搜索', iconCls:'icon-search'" onclick="<?php echo NS; ?>search()"/>
</label>
</form>
</div>
</div>
<p></p><p></p>
<!--AJAX数据填html模板-->
<div id="<?php echo NS;?>dataview_template" style="display:none">
<div style="margin-bottom:5px;font-size:14px;border-bottom:1px solid #ccc">
订单详情
</div>
<table cellspacing="12" style="border-color:#3399ff;padding:0;margin:0;width:100%;height:30px;">
<tbody>
<tr>
<td>订单ID:</td>
<td>{{id}} </td>
<td>序号:</td>
<td>{{sn}} </td>
<td>标题描述:</td>
<td>{{title}} </td>
</tr>
<tr>
<td>订单类型:</td>
<td>{{_type}} </td>
<td>订单城市:</td>
<td>{{_cityid}} </td>
<td>总价:</td>
<td>{{sumprice}} </td>
</tr>
<tr>
<td>成本价:</td>
<td>{{cosprice}} </td>
<td>支付价:</td>
<td>{{payprice}} </td>
<td>状态:</td>
<td>{{_status}} </td>
</tr>
<tr>
<td>支付时间:</td>
<td>{{paytime}} </td>
<td>会员名称:</td>
<td>{{_memberid}} </td>
<td>机构名称:</td>
<td>{{_corperid}} </td>
</tr>
<tr>
<td>订单来源:</td>
<td>{{_platid}} </td>
<td>添加时间</td>
<td>{{_addtime}} </td>
<td>联系人手机号</td>
<td>{{contactmobile}} </td>
</tr>
</tbody>
</table>
</div> <!--AJAX数据填充容器-->
<div id="<?php echo NS;?>dataview" style='margin:0;padding:20px 50px' data-options='novalidate:true'></div> <script type="text/javascript">
$(document).ready(function(){
$('#sn').textbox({
inputEvents: $.extend({},$.fn.textbox.defaults.inputEvents,{
keyup:function(event){
alert($(this).val());
},
click:function(event){
alert($(this).val());
}
})
});
});
//JS占位符替换
String.prototype.format = function() {
if(arguments.length === 0) return this;
var obj = arguments[0];
var s = this;
for(var key in obj) {
s = s.replace(new RegExp("\\{\\{" + key + "\\}\\}", "g"), obj[key]);
}
return s;
};
//点击搜索操作按钮
function <?php echo NS; ?>search() {
//格式化键值对name:value
var param = {};
$.each($("#<?php echo NS; ?>searchform").serializeArray(), function () {
param[this['name']] = this['value'];
}); $.ajax({
type: 'POST',
url: '/orders/order/ajax_index/'+param.sn,
dataType: "json",
beforeSend: function (xhr) {$.messager.progress();},
success: function (res) {
$.messager.progress('close');
if (res.status == 200) {
//$.messager.alert('操作提示', res.msg, 'info');
//console.log(res.data.id);
//数据填充
$("#<?php echo NS; ?>dataview").html($("#<?php echo NS; ?>dataview_template").html().format(res.item));
return true;
}
$("#<?php echo NS; ?>dataview").html('');
$.messager.alert('操作提示', res.msg, 'error');
}
});
}
</script>

  

05-11 09:22