js 订单代码

<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%  
	String path = request.getContextPath();  
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> 
<head>
<title>查询系统</title>        
<link rel="stylesheet" type="text/css"
	href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="http://www.jeasyui.com/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css"
	href="http://www.jeasyui.com/easyui/demo/demo.css">
<script type="text/javascript"
	src="http://code.jquery.com/jquery-1.6.min.js"></script>
<script type="text/javascript"
	src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="http://www.jeasyui.com/easyui/datagrid-detailview.js"></script>
<script src="<%=basePath %>js/jquery.confirm.js"></script>
<link rel="stylesheet" href="<%=basePath %>css/jquery.confirm.css">

<style type="text/css">
form { 
	margin: 0;
	padding: 0;
}

.dv-table td {
	border: 0;
} 

.dv-table input {
	border: 1px solid #ccc;
} 
</style> 
</head> 
<body>       
	<table id="dg" title="预订装修管理" class="easyui-datagrid"    
		style="width: 1200px; height: 590px" url="<%=basePath%>findSubsByPage.action"
		toolbar="#toolbar" pagination="true" rownumbers="true"
		fitColumns="true" singleSelect="true">  
		<thead>  
			<tr> 
				<th field="tel" width="40">联系方式</th>
				<th field="name" width="20">联系人</th> 
				<th field="nametype" width="30">装修名称</th> 
				<th field="orderTime" width="50">预订时间</th>
				<th field="content" width="50">备注内容</th>
				<th field="sex" width="20">性别</th>
				<th field="nowTime" width="50">提交时间</th> 
				<!-- <th field="status" width="10">状态</th>   -->    
				       
			</tr>   
		</thead> 
	</table>       
	<div id="toolbar">
		<div id="toolbar">
		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" οnclick="destroyUser()">删除订单</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" id="unorder">未成交订单</a> <a
			href="javascript:void(0)" class="easyui-linkbutton" id="order">已成交订单</a> <a href="javascript:void(0)"
			class="easyui-linkbutton" id="ok">成交</a>
	</div>
	</div>
	<table>
		<tr>
			<td colspan="1"></td>
		</tr>
	</table>
	<script type="text/javascript">
		$(function() {
			$("#unorder").click(function() {
				var url = "../findSubsByPage.action";
				$.post(url, {
					status : 0
				}, function() {
					$('#dg').datagrid('reload');
				});
			});
			$("#order").click(function() {
				var url = "../findSubsByPage.action";
				$.post(url, {
					status : 1
				}, function() {
					$('#dg').datagrid('reload');
				});
			});
			$("#ok").click(function() {
				var url = "../updateSub.action";
				var row = $('#dg').datagrid('getSelected');
				var elem = $(this).closest('.item');
				if (row != null) {
					$.confirm({
						'title' : '操作确认提示',
						'message' : '您确认要进行此成交操作?',
						'buttons' : {
							'Yes' : {
								'class' : 'blue',
								'action' : function() {
									elem.slideUp();
									$.post(url, {
										id : row.id
									}, function() {
										$('#dg').datagrid('reload');
									});
								}
							},
							'No' : {
								'class' : 'gray',
								'action' : function() {

								}
							}
						}
					});
				} else {
					alert("您未选中任何信息!");
				}
			});
			setInterval(function() {
				$('#dg').datagrid('reload');
			}, 60000);
		});
		function destroyUser() {
			var row = $('#dg').datagrid('getSelected');
			if (row) {
				$.messager.confirm('操作提示',
						'您确定要删除此条订单?',
						function(r) {
							if (r) {
								$.post('../deleteSub.action', {
									id : row.id
								}, function(result) {
									if (result.success) {
										$('#dg').datagrid('reload'); // reload the user data
									} else {
										$.messager.show({ // show error message
											title : 'Error',
											msg : result.errorMsg
										});
									}
								}, 'json');
							}
						});
			}
		}
	</script>
	<script language="JavaScript">
	function myrefresh()
	{
	       window.location.reload(); 
	}
	setTimeout('myrefresh()',3000000); //指定5秒刷新一次
	</script>
	<style type="text/css">
#fm { 
	margin: 0;
	padding: 10px 30px;
}

.ftitle {
	font-size: 14px;
	font-weight: bold;
	padding: 5px 0;
	margin-bottom: 10px;
	border-bottom: 1px solid #ccc;
}

.fitem {
	margin-bottom: 5px;
}

.fitem label {
	display: inline-block;
	width: 80px;
}
</style>
</body>
</html>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
美妆微信小程序订单JS代码主要包括以下几个方面的内容: 1. 订单列表渲染: 根据用户订单数据,使用wx.request从后端获取订单列表数据,然后在前端用wx.navigateTo或者wx.redirectTo来跳转到订单列表页面。在订单列表页面的onLoad函数中,通过setData方法将请求到的订单数据保存在页面的data中。然后在wxml文件中使用wx:for来遍历订单数据,构建订单列表的视图。 2. 订单详情展示: 在订单列表页面的wxml文件中,为每一个订单列表项绑定一个点击事件,点击事件会将对应订单订单号作为参数传递给跳转到订单详情页的函数中。然后在订单详情页的onLoad函数中通过参数获取到订单号,并使用wx.request向后端请求订单详情数据。然后再使用setData将订单详情数据保存在页面的data中,在页面的wxml文件中展示出来。 3. 订单支付: 在订单详情页中,添加一个支付按钮,绑定一个点击事件。点击事件触发时,调用wx.requestPayment方法,传递订单号、支付金额等参数给后端,进支付操作。支付成功后,后端会返回支付结果,根据支付结果显示相应的提示消息,成功则跳转到支付成功页,失败则显示相应的失败提示。 4. 订单取消和删除: 在订单详情页中,添加取消订单和删除订单按钮,分别绑定点击事件。点击取消订单按钮时,调用wx.showModal显示确认取消订单的提示框,点击确认后,向后端发送请求进取消订单的操作。点击删除订单按钮时,同样调用wx.showModal显示确认删除订单的提示框,点击确认后,向后端发送请求进删除订单的操作。操作成功后,根据接口返回的结果刷新订单列表数据。 以上是美妆微信小程序订单JS代码的基本实现逻辑,具体的实现细节和接口调用方式还需要根据具体需求进配置和调整。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值