last Month
来源:互联网 发布:js排序算法 编辑:程序博客网 时间:2024/04/30 23:34
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>月考模拟3</title>
<script src="js/angular.min.js"></script>
<script>
var myapp = angular.module("myapp", []);
myapp.controller("kongzhiqi", ["$scope", function($scope) {
$scope.users=[{state:false,name:"qq",price:"12.9",number:2},
{state:false,name:"wx",price:"23.9",number:1},
{state:false,name:"2wx",price:"99.9",number:1}
];
//数量的加减
$scope.jia=function(index,number){
$scope.users[index].number=$scope.users[index].number+number;
if($scope.users[index].number == 0){
$scope.users.splice(index,1);
}
}
//删除
$scope.shanchu=function(index){
$scope.users.splice(index,1);
}
$scope.del=function(){
for(var i=0;i<$scope.users.length;i++){
if($scope.users[i].state){
$scope.users.splice(i,1);
i--; //让下个值从删除的索引开始
}
}
}
//全选的操作
$scope.ckAll=function(){
for(var i in $scope.users){
$scope.users[i].state=$scope.ckall;
}
}
$scope.counts = function() {
var con = 0;
for(var i in $scope.users) {
con += $scope.users[i].price * $scope.users[i].number;
}
return con;
}
}])
</script>
</head>
<body ng-app="myapp" ng-controller="kongzhiqi">
<h3>我的购物车</h3>
<hr/>
<br><br/><button style="margin-left: 300px;" ng-click="del()">清空购物车</button>
<table border="1px soild">
<tr>
<td>
<td><input type="checkbox" ng-model="ckall" ng-click="ckAll()" /></td>
</td>
<td>商品名</td>
<td>价格</td>
<td>数量</td>
<td>小计</td>
<td>操作</td>
</tr>
<tr ng-repeat="u in users">
<td>
<td><input type="checkbox" ng-model="u.state" /></td>
</td>
<td>{{u.name}}</td>
<td>{{u.price|currency:"¥"}}</td>
<td>
<button ng-click="jia($index,-1)">-</button>
<input ng-model="u.number"/>
<button ng-click="jia($index,+1)">+</button>
</td>
<td>{{u.number*u.price|currency:"¥"}}</td>
<td>
<button style="background: blue;" ng-click="shanchu($index)">删除</button>
</td>
</tr><br>
<tr>
<td colspan="6">
总价:{{counts()}}
</td>
</tr>
</table>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title>月考模拟3</title>
<script src="js/angular.min.js"></script>
<script>
var myapp = angular.module("myapp", []);
myapp.controller("kongzhiqi", ["$scope", function($scope) {
$scope.users=[{state:false,name:"qq",price:"12.9",number:2},
{state:false,name:"wx",price:"23.9",number:1},
{state:false,name:"2wx",price:"99.9",number:1}
];
//数量的加减
$scope.jia=function(index,number){
$scope.users[index].number=$scope.users[index].number+number;
if($scope.users[index].number == 0){
$scope.users.splice(index,1);
}
}
//删除
$scope.shanchu=function(index){
$scope.users.splice(index,1);
}
$scope.del=function(){
for(var i=0;i<$scope.users.length;i++){
if($scope.users[i].state){
$scope.users.splice(i,1);
i--; //让下个值从删除的索引开始
}
}
}
//全选的操作
$scope.ckAll=function(){
for(var i in $scope.users){
$scope.users[i].state=$scope.ckall;
}
}
$scope.counts = function() {
var con = 0;
for(var i in $scope.users) {
con += $scope.users[i].price * $scope.users[i].number;
}
return con;
}
}])
</script>
</head>
<body ng-app="myapp" ng-controller="kongzhiqi">
<h3>我的购物车</h3>
<hr/>
<br><br/><button style="margin-left: 300px;" ng-click="del()">清空购物车</button>
<table border="1px soild">
<tr>
<td>
<td><input type="checkbox" ng-model="ckall" ng-click="ckAll()" /></td>
</td>
<td>商品名</td>
<td>价格</td>
<td>数量</td>
<td>小计</td>
<td>操作</td>
</tr>
<tr ng-repeat="u in users">
<td>
<td><input type="checkbox" ng-model="u.state" /></td>
</td>
<td>{{u.name}}</td>
<td>{{u.price|currency:"¥"}}</td>
<td>
<button ng-click="jia($index,-1)">-</button>
<input ng-model="u.number"/>
<button ng-click="jia($index,+1)">+</button>
</td>
<td>{{u.number*u.price|currency:"¥"}}</td>
<td>
<button style="background: blue;" ng-click="shanchu($index)">删除</button>
</td>
</tr><br>
<tr>
<td colspan="6">
总价:{{counts()}}
</td>
</tr>
</table>
</body>
</html>
阅读全文
0 0
- last Month
- get curr month start date, last month end date
- Sql Get Last Day of Month...
- RunAProxyOnAmazonEC2VPC.md Last active a month ago
- Today---my last two month to stay this company
- get the last date of a month in oracle
- 上个月之前的一个月the month before last
- ORA-01847: day of month must be between 1 and last day of month
- ORA-01847: day of month must be between 1 and last day of month 解决方法
- ORA-01847: day of month must be between 1 and last day of month 解决方法
- Oracle 之 ORA-01847: day of month must be between 1 and last day of month
- month
- Month
- OGG ORA-01847: day of month must be between 1 and last day of month (status = 1847)
- Reduce a date range to an array of the last days of each month?
- oracle日期时间段查询遇到问题to_date ora-01847 day of month must be between 1 and last day of month
- last
- last
- jsp错误页面404、500等异常捕获
- 链表的增、删、查、找
- 注册登录
- pdfelement 破解版V6.3.5.2806下载 | Wondershare PDFelement(PDF工具箱)官方中文版无需wondershare pdfelement 注册码
- python pip 安装opencv额外库SIFT+SURF等 (避免opencv_contrib + cmake)
- last Month
- 两个类具有相同的 XML 类型名称 "{http://service.webservice.base.xm/}searchAccountBatchResponse"。 请使用 @XmlType.na
- PHP的基础整理
- SPSS学习(1)之数据录入与数据获取
- 三种菜单的简单应用
- 属性动画
- screen 使用方法 详解
- QT下载地址
- Reflection2017.12.20