FAHUO



<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
span{
color:red;
}
.myborder{
border: 1px solid red;
}
</style>
<script src="js/angular.min.js"></script>
<script>
angular.module("zhao",[]).controller("tro",function($scope,$http){
$http.get("http://result.eolinker.com/lKgJQ8Zec38423e5603b8e055d1193a8127c0c060bb1b55?uri=goodstest")
.success(function(d){
$scope.dates=d;
})
$scope.dj=function(o){
o.state="已发货";
  
}
$scope.qx=function(){
for(var i=0;i<$scope.dates.length;i++){
$scope.dates[i].ck=$scope.id;
}
}
$scope.pl=function(){
for(var i=0;i<$scope.dates.length;i++){
if($scope.dates[i].ck==true && $scope.dates[i].state=="已发货"){
$scope.dates.splice(i,1);
i--;
}
}
}
$scope.xz=function(){
$scope.f;
}
$scope.bc=function(){
if($scope.gname==""||$scope.gname==null){
$scope.u=true;
}
if($scope.uname==""||$scope.uname==null){
$scope.i=true;
}
if($scope.tel==""||$scope.tel==null){
$scope.o=true;
}
if($scope.price==""||$scope.price==null){
$scope.p=true;
}
if($scope.city==""||$scope.city==null){
$scope.l=true;
}
else{
$scope.u=false;
$scope.i=false;
$scope.o=false;
$scope.p=false;
$scope.l=false;
$scope.regdate=new Date();
$scope.dates.push({id:$scope.dates.length+1,uname:$scope.uname,gname:$scope.gname,tel:$scope.tel,price:$scope.price,city:$scope.city,regdate:$scope.regdate,state:"未发货"});
$scope.aa=false;
}
 
}
})
</script>
</head>}
<body ng-app="zhao" ng-controller="tro">
<table border="f">
<input type="button" value="新增表单" ng-click="aa=true" />
<input type="button" value="批量删除" ng-click="pl()" />
<input type="text" ng-model="test" placeholder="按商品名称查询"/>
<input type="text" ng-model="tset" placeholder="按商品手机查询"/>
<select ng-model="state">
<option ng-model="fh">已发货</option>
<option ng-model="wfh">未发货</option>
</select>
<tr>
<td><input type="checkbox" ng-model="id" ng-click="qx()"></td>
<td>id<button ng-click="px='id';sj=!sj">排序</button></td>
<td>商品名</td>
<td>用户名</td>
<td>手机号</td>
<td>价格<button ng-click="px='price';sj=!sj">排序</td>
<td>城市</td>
<td>下单时间</td>
<td>状态</td>
</tr>
<tr ng-repeat="n in dates|filter:{gname:test,tel:tset,state:state}|orderBy:px:sj">
<td><input type="checkbox" ng-model="n.ck"></td>
<td>{{n.id}}</td>
<td>{{n.gname}}</td>
<td>{{n.uname}}</td>
<td>{{n.tel}}</td>
<td>{{n.price|currency:"¥"}}</td>
<td>{{n.city}}</td>
<td>{{n.regdate|date:"yyyy-MM-dd hh:mm:dd"}}</td>
<td>
<span style="background:green;" ng-show="n.state=='已发货'">
<button id="bu" ng-click="dj(n)">{{n.state}}</button>
</span>
<span style="background:yellow;" ng-show="n.state=='未发货'">
<button id="bu" ng-click="dj(n)">{{n.state}}</button>
</span>
</td>
</tr>
</table>
<form ng-show="aa">
<input ng-model="gname" /><span ng-show="u">:商品名不能为空</span><br>
<input ng-model="uname" /><span ng-show="i">:用户名不能为空</span><br>
<input ng-model="tel" /><span ng-show="o">:手机号不能为空</span><br>
<input ng-model="price" /><span ng-show="p">:价格不能为空</span><br>
<select ng-model="city">
<option value="广东">广东</option>
<option value="上海">上海</option>
<option value="北京">北京</option>
</select><span ng-show="l">:城市必须选择</span><br>
<input type="button" value="保存" ng-click="bc()" />
</form>
</body>
</html>
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值