search
HomeWeb Front-endJS TutorialCode sharing for Angular JQuery to generate a simple express delivery management interface

The content of this article is to share the code for Angular JQuery to generate a simple express management interface. It has a certain reference value. Friends in need can refer to it

Not much to say, let’s go straight to the code:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="css/sty.css" />
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
</head>
<body ng-app="MyApp" ng-controller="MyCont">
<center ng-hide="hi">
<input type="button" value="新增订单" class="btn" ng-click="tian()"/>
<input type="button" value="批量删除" class="btn" ng-click="del_sel()"/>
<input type="text" placeholder="按商品名称查询" class="se1" ng-model="shop" ng-blur="name()"/>
<input type="text" placeholder="按手机号查询" class="se" ng-model="num" ng-blur="num_sel()"/>
<select class="sel" ng-model="zhuang_sel" ng-change="zhuang()">
<option>--按状态查询--</option>
<option>已发货</option>
<option>未发货</option>
</select><br />
<table class="table" cellpadding="0px" cellspacing="0px">
<tr style="background-color: #999999">
<td><input type="checkbox" ng-click="quan()" ng-model="cb"/></td>
<td>id  <input type="button" value="排序" class="pai" ng-click="id_pai()"/></td>
<td>商品名</td>
<td>用户名</td>
<td>手机号</td>
<td>价格  <input type="button" value="排序" class="pai" ng-click="price_pai()"/></td>
<td>城市</td>
<td>下单时间  <input type="button" value="排序" class="pai" ng-click="time_pai()"/></td>
<td>状态</td>
</tr>
<tr ng-repeat="li in xin">
<td><input type="checkbox" ng-checked="cb" ng-click="chec($index)"/></td>
<td>{{li.id}}</td>
<td>{{li.goodsName}}</td>
<td>{{li.userName}}</td>
<td>{{li.tel}}</td>
<td>{{li.price|currency:"¥:"}}</td>
<td>{{li.city}}</td>
<td>{{li.time|date:"MM-dd HH:mm:ss"}}</td>
<td><input  type="button" value="{{li.goodsState}}" class="{{li.state}}" ng-click="haha($index)"/></td>
</tr>
</table>
</center>
<center ng-show="sh">
<button style="border-radius: 5px;">新增订单</button>
<fieldset class="fie">
<legend>haha</legend>
<form>
<table>
<tr>
<td>id</td>
<td><input type="text" id="sel_id"/></td>
</tr>
<tr>
<td>商品名</td>
<td><input type="text" id="sel_name"/></td>
</tr>
<tr>
<td>用户名</td>
<td><input type="text" id="sel_user"/></td>
</tr>
<tr>
<td>手机号</td>
<td><input type="text" id="sel_tel"/></td>
</tr>
<tr>
<td>价格</td>
<td><input type="text" id="sel_pirce"/></td>
</tr>
<tr>
<td>城市</td>
<td>
<select id="sel_cary">
<option>北京</option>
<option>郑州</option>
<option>上海</option>
<option>杭州</option>
<option>黑龙江</option>
</select>
</td>
</tr>
<tr>
<td>下单时间</td>
<td><input type="text" id="sel_time"/></td>
</tr>
<tr>
<td>状态</td>
<td>
<select id="sel_zhuang">
<option>已发货</option>
<option>未发货</option>
</select>
</td>
</tr>
<tr>
<td colspan="2"><input type="button" value="保存" ng-click="bao()"/></td>
</tr>
</table>
</form>
</fieldset>
</center>
<script>
var arr = [{
id: 2001,
goodsName: "iPhoneX",
userName: "张三",
tel: 1352565588,
price: 8699.00,
city: "北京",
time: "1123100000",
goodsState: "已发货",
state: true,
flag: false
},
{
id: 3006,
goodsName: "iPhone6",
userName: "王红",
tel: 18524565588,
price: 5635.00,
city: "郑州",
time: "1123113820",
goodsState: "已发货",
state: true,
flag: false
},
{
id: 5312,
goodsName: "iPhone7",
userName: "赵小龙",
tel: 17545585598,
price: 6180.00,
city: "北京",
time: "1123091730",
goodsState: "未发货",
state: false,
flag: false
},
{
id: 2132,
goodsName: "iPhone8",
userName: "赵强",
tel: 17625565618,
price: 7190.00,
city: "上海",
time: "1123104021",
goodsState: "未发货",
state: false,
flag: false
}
]
var mo = angular.module("MyApp", []);
mo.controller("MyCont", function($scope,$filter) {
$scope.xin = arr;
$scope.tian=function(){
$scope.hi=true;
$scope.sh=true;
}
$scope.name=function(){
var aa = $scope.shop;
if(aa!=undefined){
$scope.xin = $filter("shopsha")(arr,aa);
}else{
alert("内容不能为空")
}
}
$scope.num_sel=function(){
var aa = $scope.num;
if(aa!=undefined){
$scope.xin = $filter("num_test")(arr,aa);
}else{
alert("内容不能为空")
}
}
$scope.zhuang=function(){
var aa = $scope.zhuang_sel;
$scope.xin = $filter("zhuang_test")(arr,aa);
}
var id_flag=false;
$scope.id_pai=function(){
if(id_flag){
arr.sort(function(a,b){
return b.id-a.id;
})
}else{
arr.sort(function(a,b){
return a.id-b.id;
})
}
id_flag=!id_flag;
arr=$scope.xin;
}
var price_flag=false;
$scope.price_pai=function(){
if(price_flag){
arr.sort(function(a,b){
return b.price-a.price;
})
}else{
arr.sort(function(a,b){
return a.price-b.price;
})
}
price_flag=!price_flag;
arr=$scope.xin;
}
var time_flag=false;
$scope.time_pai=function(){
if(time_flag){
arr.sort(function(a,b){
return b.time-a.time;
})
}else{
arr.sort(function(a,b){
return a.time-b.time;
})
}
time_flag=!time_flag;
arr=$scope.xin;
}
$scope.haha=function($index){
if(arr[$index].goodsState=="已发货"){
arr[$index].goodsState="未发货"
arr[$index].state=false;
}else{
arr[$index].goodsState="已发货"
arr[$index].state=true;
}
$scope.xin=arr;
}
$scope.quan=function(){
var qwe = $scope.cb;
for (var i=0;i<arr.length;i++) {
arr[i].flag=qwe;
}
$scope.xin=arr;
}
$scope.chec=function($index){
arr[$index].flag=!arr[$index].flag;
$scope.xin=arr;
}
$scope.del_sel=function(){
for (var i=arr.length-1;i>=0;i--) {
if(arr[i].flag&&!(arr[i].state)){
arr.splice(i,1);
}
}
$scope.xin=arr;
}
$scope.bao=function(){
if(test1("#sel_id")&&test1("#sel_name")&&test1("#sel_user")&&test1("#sel_tel")&&test1("#sel_pirce")&&test1("#sel_cary")&&test1("#sel_time")&&test1("#sel_zhuang")){
var val1 = $("#sel_id").val()
var val2 = $("#sel_name").val()
var val3 = $("#sel_user").val()
var val4 = $("#sel_tel").val()
var val5 = $("#sel_pirce").val()
var val6 = $("#sel_cary").val()
var val7 = $("#sel_time").val()
var val8 = $("#sel_zhuang").val()
var obj={
id: val1,
goodsName: val2,
userName: val3,
tel: val4,
price: val5,
city: val6,
time: val7,
goodsState: val8,
state: false,
flag: false
}
arr.push(obj);
$scope.xin=arr;
$scope.hi=false;
$scope.sh=false;
}else{
alert("失败!不能为空");
}
}
})
mo.filter("shopsha",function(){
return function(input,aa){
var arr2=[];
for (var i=0;i<input.length;i++) {
if(input[i].goodsName==aa){
arr2.push(input[i])
}
}
if(arr2.length==0){
alert("对不起没有数据")
}
return arr2
}
})
mo.filter("num_test",function(){
return function(input,aa){
var arr2=[];
for (var i=0;i<input.length;i++) {
if((input[i].tel+"").indexOf(aa)!=-1){
arr2.push(input[i])
}
}
if(arr2.length==0){
alert("对不起没有数据")
}
return arr2
}
})
mo.filter("zhuang_test",function(){
return function(input,aa){
var arr2=[]
for (var i=0;i<input.length;i++) {
if(input[i].goodsState==aa){
arr2.push(input[i])
}
}
if(aa=="--按状态查询--"){
return input;
}
return arr2;
}
})
mo.filter("but_test",function(){
return function(input){
}
})
function test1(yang){
var val = $(yang).val();
var f=/^\s*$/;
if(f.test(val.trim())){
$(yang).css("border","1px solid red");
return false;
}else{
$(yang).css("border","1px solid black");
return true;
}
}
</script>
</body>
</html>


The above is the detailed content of Code sharing for Angular JQuery to generate a simple express delivery management interface. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Python vs. JavaScript: Use Cases and Applications ComparedPython vs. JavaScript: Use Cases and Applications ComparedApr 21, 2025 am 12:01 AM

Python is more suitable for data science and automation, while JavaScript is more suitable for front-end and full-stack development. 1. Python performs well in data science and machine learning, using libraries such as NumPy and Pandas for data processing and modeling. 2. Python is concise and efficient in automation and scripting. 3. JavaScript is indispensable in front-end development and is used to build dynamic web pages and single-page applications. 4. JavaScript plays a role in back-end development through Node.js and supports full-stack development.

The Role of C/C   in JavaScript Interpreters and CompilersThe Role of C/C in JavaScript Interpreters and CompilersApr 20, 2025 am 12:01 AM

C and C play a vital role in the JavaScript engine, mainly used to implement interpreters and JIT compilers. 1) C is used to parse JavaScript source code and generate an abstract syntax tree. 2) C is responsible for generating and executing bytecode. 3) C implements the JIT compiler, optimizes and compiles hot-spot code at runtime, and significantly improves the execution efficiency of JavaScript.

JavaScript in Action: Real-World Examples and ProjectsJavaScript in Action: Real-World Examples and ProjectsApr 19, 2025 am 12:13 AM

JavaScript's application in the real world includes front-end and back-end development. 1) Display front-end applications by building a TODO list application, involving DOM operations and event processing. 2) Build RESTfulAPI through Node.js and Express to demonstrate back-end applications.

JavaScript and the Web: Core Functionality and Use CasesJavaScript and the Web: Core Functionality and Use CasesApr 18, 2025 am 12:19 AM

The main uses of JavaScript in web development include client interaction, form verification and asynchronous communication. 1) Dynamic content update and user interaction through DOM operations; 2) Client verification is carried out before the user submits data to improve the user experience; 3) Refreshless communication with the server is achieved through AJAX technology.

Understanding the JavaScript Engine: Implementation DetailsUnderstanding the JavaScript Engine: Implementation DetailsApr 17, 2025 am 12:05 AM

Understanding how JavaScript engine works internally is important to developers because it helps write more efficient code and understand performance bottlenecks and optimization strategies. 1) The engine's workflow includes three stages: parsing, compiling and execution; 2) During the execution process, the engine will perform dynamic optimization, such as inline cache and hidden classes; 3) Best practices include avoiding global variables, optimizing loops, using const and lets, and avoiding excessive use of closures.

Python vs. JavaScript: The Learning Curve and Ease of UsePython vs. JavaScript: The Learning Curve and Ease of UseApr 16, 2025 am 12:12 AM

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

Python vs. JavaScript: Community, Libraries, and ResourcesPython vs. JavaScript: Community, Libraries, and ResourcesApr 15, 2025 am 12:16 AM

Python and JavaScript have their own advantages and disadvantages in terms of community, libraries and resources. 1) The Python community is friendly and suitable for beginners, but the front-end development resources are not as rich as JavaScript. 2) Python is powerful in data science and machine learning libraries, while JavaScript is better in front-end development libraries and frameworks. 3) Both have rich learning resources, but Python is suitable for starting with official documents, while JavaScript is better with MDNWebDocs. The choice should be based on project needs and personal interests.

From C/C   to JavaScript: How It All WorksFrom C/C to JavaScript: How It All WorksApr 14, 2025 am 12:05 AM

The shift from C/C to JavaScript requires adapting to dynamic typing, garbage collection and asynchronous programming. 1) C/C is a statically typed language that requires manual memory management, while JavaScript is dynamically typed and garbage collection is automatically processed. 2) C/C needs to be compiled into machine code, while JavaScript is an interpreted language. 3) JavaScript introduces concepts such as closures, prototype chains and Promise, which enhances flexibility and asynchronous programming capabilities.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software