|
|
@@ -43,47 +43,47 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
$scope.isChooseAll = false;
|
|
|
|
|
|
$scope.loadData = function (){
|
|
|
- Cart.getPageInfo($scope.pageInfo, function(data) {
|
|
|
- $scope.isDataLoading = false;
|
|
|
- $scope.total = data.totalElements;
|
|
|
- $scope.pageNum = data.totalPages;
|
|
|
+ Cart.getPageInfo($scope.pageInfo, function(data) {
|
|
|
+ $scope.isDataLoading = false;
|
|
|
+ $scope.total = data.totalElements;
|
|
|
+ $scope.pageNum = data.totalPages;
|
|
|
|
|
|
- angular.forEach(data.content, function (cart) {
|
|
|
- cart.buyCurrency = cart.currencyName.indexOf("RMB") > -1 ? "RMB" : "USD";
|
|
|
- cart.isSelect = false;
|
|
|
- //计算分段和统计一下价格
|
|
|
- $scope.getPrice(cart);
|
|
|
-
|
|
|
- //便于后期循环
|
|
|
- $scope.carts.push(cart);
|
|
|
- $scope.disabledAddAndSub(cart);
|
|
|
- $scope.countByPage += 1;
|
|
|
- var isContain = false;
|
|
|
- for (var i = 0; i < $scope.cartMap.length; i++) {
|
|
|
- if(angular.equals($scope.cartMap[i].name, cart.storeName)) {
|
|
|
- $scope.cartMap[i].arr.push(cart);
|
|
|
- isContain = true;
|
|
|
- }
|
|
|
- }
|
|
|
- if(!isContain) {
|
|
|
- var obj = {};
|
|
|
- obj.name = cart.storeName;
|
|
|
- obj.arr = [];
|
|
|
- obj.arr.push(cart);
|
|
|
- $scope.cartMap.push(obj);
|
|
|
+ angular.forEach(data.content, function (cart) {
|
|
|
+ cart.buyCurrency = cart.currencyName.indexOf("RMB") > -1 ? "RMB" : "USD";
|
|
|
+ cart.isSelect = false;
|
|
|
+ //计算分段和统计一下价格
|
|
|
+ $scope.getPrice(cart);
|
|
|
+
|
|
|
+ //便于后期循环
|
|
|
+ $scope.carts.push(cart);
|
|
|
+ $scope.disabledAddAndSub(cart);
|
|
|
+ $scope.countByPage += 1;
|
|
|
+ var isContain = false;
|
|
|
+ for (var i = 0; i < $scope.cartMap.length; i++) {
|
|
|
+ if(angular.equals($scope.cartMap[i].name, cart.storeName)) {
|
|
|
+ $scope.cartMap[i].arr.push(cart);
|
|
|
+ isContain = true;
|
|
|
}
|
|
|
- });
|
|
|
- $scope.cartIsEmpty = !$scope.carts.length ? true : false;
|
|
|
- //设置全选的复选框
|
|
|
- $scope.isChooseAll = $scope.isAllSelect($scope.carts);
|
|
|
+ }
|
|
|
+ if(!isContain) {
|
|
|
+ var obj = {};
|
|
|
+ obj.name = cart.storeName;
|
|
|
+ obj.arr = [];
|
|
|
+ obj.arr.push(cart);
|
|
|
+ $scope.cartMap.push(obj);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $scope.cartIsEmpty = !$scope.carts.length ? true : false;
|
|
|
+ //设置全选的复选框
|
|
|
+ $scope.isChooseAll = $scope.isAllSelect($scope.carts);
|
|
|
|
|
|
- //设置店铺复选框的状态
|
|
|
- angular.forEach($scope.cartMap, function (store) {
|
|
|
- $scope.selectedStore[store.name] = $scope.isAllSelect(store.arr);
|
|
|
- });
|
|
|
- },function() {
|
|
|
- toaster.pop('error', "提示", "获取购物车信息失败,请刷新页面");
|
|
|
+ //设置店铺复选框的状态
|
|
|
+ angular.forEach($scope.cartMap, function (store) {
|
|
|
+ $scope.selectedStore[store.name] = $scope.isAllSelect(store.arr);
|
|
|
});
|
|
|
+ },function() {
|
|
|
+ toaster.pop('error', "提示", "获取购物车信息失败,请刷新页面");
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
$scope.loadData();
|
|
|
@@ -120,7 +120,7 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
//计算总价格
|
|
|
$scope.calculateAmount($scope.selectedStoreCarts);
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
// 减少按钮,每次减minPackQty
|
|
|
$scope.reduce = function(cart){
|
|
|
if(cart.status == 1) {
|
|
|
@@ -139,7 +139,7 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
//计算总价格
|
|
|
$scope.calculateAmount($scope.selectedStoreCarts);
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
//根据搜索词过滤购物车信息,对类目、品牌、器件筛选
|
|
|
$scope.cartFilterCurrency = function(cartGroup) {
|
|
|
var result = false;
|
|
|
@@ -167,8 +167,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
|
|
|
$scope.closeTable = function() {
|
|
|
console.log('0kds');
|
|
|
- };
|
|
|
- // //监听点击的位置,隐藏价格梯度的信息
|
|
|
+ };
|
|
|
+ // //监听点击的位置,隐藏价格梯度的信息
|
|
|
// document.onclick = function(event) {
|
|
|
// $scope.$apply(function () {
|
|
|
// angular.forEach($scope.carts, function (cart) {
|
|
|
@@ -181,9 +181,9 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
|
|
|
//查看价格分段。
|
|
|
$scope.togglePrice = function (cart) {
|
|
|
- cart.display = cart.display == 'block' ? 'none' : 'block';
|
|
|
- };
|
|
|
- // 统计已勾选批次
|
|
|
+ cart.display = cart.display == 'block' ? 'none' : 'block';
|
|
|
+ };
|
|
|
+ // 统计已勾选批次
|
|
|
var creatSelectArr = function(){
|
|
|
var arr = [];
|
|
|
angular.forEach($scope.carts, function(cart) {
|
|
|
@@ -328,8 +328,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
return ;
|
|
|
}
|
|
|
}
|
|
|
- $scope.totalMoneyInfo.countBT++;
|
|
|
- $scope.selectedStoreCarts.push(cart);
|
|
|
+ $scope.totalMoneyInfo.countBT++;
|
|
|
+ $scope.selectedStoreCarts.push(cart);
|
|
|
}else {//取消勾选
|
|
|
$scope.totalMoneyInfo.countBT--;
|
|
|
$scope.selectedStoreCarts = $scope.selectedStoreCarts.filter(function(item) {
|
|
|
@@ -373,36 +373,36 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- // 清空失效产品
|
|
|
- $scope.deleteInvalid = function(){
|
|
|
+ // 清空失效产品
|
|
|
+ $scope.deleteInvalid = function(){
|
|
|
var arr = [];
|
|
|
- angular.forEach($scope.carts, function(cart){
|
|
|
- if(cart.status == 1){
|
|
|
- arr.push(cart.id);
|
|
|
- }
|
|
|
- });
|
|
|
- if(arr.length <= 0) {
|
|
|
- toaster.pop('warning', '提示', '购物车内目前没有失效的产品');
|
|
|
- return ;
|
|
|
- }
|
|
|
- var ids = angular.toJson(arr);
|
|
|
- $modal.open({
|
|
|
- templateUrl : 'static/view/common/modal/invalid_delete_modal.html',
|
|
|
- controller : 'cartDeleteCtrl',
|
|
|
- size : 'md',
|
|
|
- resolve : {
|
|
|
- description : function () {
|
|
|
- return '是否删除购物车内的无效商品';
|
|
|
- },
|
|
|
- ids : function () {
|
|
|
- return ids;
|
|
|
- }
|
|
|
- }
|
|
|
- }).result.then(function () {
|
|
|
+ angular.forEach($scope.carts, function(cart){
|
|
|
+ if(cart.status == 1){
|
|
|
+ arr.push(cart.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(arr.length <= 0) {
|
|
|
+ toaster.pop('warning', '提示', '购物车内目前没有失效的产品');
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ var ids = angular.toJson(arr);
|
|
|
+ $modal.open({
|
|
|
+ templateUrl : 'static/view/common/modal/invalid_delete_modal.html',
|
|
|
+ controller : 'cartDeleteCtrl',
|
|
|
+ size : 'md',
|
|
|
+ resolve : {
|
|
|
+ description : function () {
|
|
|
+ return '是否删除购物车内的无效商品';
|
|
|
+ },
|
|
|
+ ids : function () {
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).result.then(function () {
|
|
|
afterDeleteRefreshInfo(arr);
|
|
|
}, function () {
|
|
|
- });
|
|
|
- };
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
var afterDeleteRefreshInfo = function (arr) {
|
|
|
if(arr.length < 1) {
|
|
|
@@ -446,22 +446,22 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
$scope.calculateAmount($scope.selectedStoreCarts);
|
|
|
}
|
|
|
|
|
|
- $scope.deleteById = function(id){
|
|
|
- var arr = [];
|
|
|
- if(id != null){
|
|
|
- arr.push(id);
|
|
|
- }else {
|
|
|
- angular.forEach($scope.carts, function(cart){
|
|
|
- if(cart.isSelect){
|
|
|
- arr.push(cart.id);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if(arr.length <= 0) {
|
|
|
+ $scope.deleteById = function(id){
|
|
|
+ var arr = [];
|
|
|
+ if(id != null){
|
|
|
+ arr.push(id);
|
|
|
+ }else {
|
|
|
+ angular.forEach($scope.carts, function(cart){
|
|
|
+ if(cart.isSelect){
|
|
|
+ arr.push(cart.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if(arr.length <= 0) {
|
|
|
toaster.pop('warning', '提示', '请选择需要删除的商品');
|
|
|
return ;
|
|
|
}
|
|
|
- var ids = angular.toJson(arr);
|
|
|
+ var ids = angular.toJson(arr);
|
|
|
$modal.open({
|
|
|
templateUrl : 'static/view/common/modal/delete_modal.html',
|
|
|
controller : 'cartDeleteCtrl',
|
|
|
@@ -470,9 +470,9 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
description : function () {
|
|
|
return '是否删除此商品';
|
|
|
},
|
|
|
- ids : function () {
|
|
|
- return ids;
|
|
|
- }
|
|
|
+ ids : function () {
|
|
|
+ return ids;
|
|
|
+ }
|
|
|
}
|
|
|
}).result.then(function () {
|
|
|
afterDeleteRefreshInfo(arr);
|
|
|
@@ -499,8 +499,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
});
|
|
|
return !contain;
|
|
|
});
|
|
|
- };
|
|
|
- //判断是空对象
|
|
|
+ };
|
|
|
+ //判断是空对象
|
|
|
$scope.isNullObject = function(obj) {
|
|
|
var isObject = true;
|
|
|
for(var k in obj) {
|
|
|
@@ -538,8 +538,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
cart.contactSeller = false;
|
|
|
};
|
|
|
});
|
|
|
- };
|
|
|
- /**
|
|
|
+ };
|
|
|
+ /**
|
|
|
* 监听点击的位置,隐藏相应的状态框
|
|
|
* @param event
|
|
|
*/
|
|
|
@@ -576,8 +576,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
if(!isThisTag) {
|
|
|
$scope.carts[i].contactSeller = false;
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
|
|
|
@@ -599,23 +599,23 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
$scope.setAllCartCheck = function(checked) {
|
|
|
$scope.selectedStoreCarts = [];
|
|
|
angular.forEach($scope.cartMap, function(store) {
|
|
|
- if(store.arr && store.arr.length > 0) {
|
|
|
- var storeChecked = false;
|
|
|
- angular.forEach(store.arr, function (cart) {
|
|
|
- if(cart.status != 1 && checked) {//购物车的信息是否有效【是否下架】
|
|
|
- cart.isSelect = checked;
|
|
|
- storeChecked = true;
|
|
|
- $scope.selectedStoreCarts.push(cart);
|
|
|
- }else {
|
|
|
- cart.isSelect = false;
|
|
|
- }
|
|
|
- });
|
|
|
- if(storeChecked) {
|
|
|
- $scope.selectedStore[store.name] = checked;//店铺的复选框也需要同步
|
|
|
+ if(store.arr && store.arr.length > 0) {
|
|
|
+ var storeChecked = false;
|
|
|
+ angular.forEach(store.arr, function (cart) {
|
|
|
+ if(cart.status != 1 && checked) {//购物车的信息是否有效【是否下架】
|
|
|
+ cart.isSelect = checked;
|
|
|
+ storeChecked = true;
|
|
|
+ $scope.selectedStoreCarts.push(cart);
|
|
|
}else {
|
|
|
- $scope.selectedStore[store.name] = false;//如果没有执行过storeChecked = true,则该店铺代表所有的都没有勾选
|
|
|
+ cart.isSelect = false;
|
|
|
}
|
|
|
+ });
|
|
|
+ if(storeChecked) {
|
|
|
+ $scope.selectedStore[store.name] = checked;//店铺的复选框也需要同步
|
|
|
+ }else {
|
|
|
+ $scope.selectedStore[store.name] = false;//如果没有执行过storeChecked = true,则该店铺代表所有的都没有勾选
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
});
|
|
|
};
|
|
|
@@ -634,8 +634,8 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
}
|
|
|
}
|
|
|
return !isAlldisabled&&isAllChecked;
|
|
|
- };
|
|
|
- /**
|
|
|
+ };
|
|
|
+ /**
|
|
|
* 店铺选中状态信息
|
|
|
*/
|
|
|
$scope.selectedStore = {};
|
|
|
@@ -780,17 +780,17 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
SessionService.set("buyNow",false);
|
|
|
var jsonOrderDetails = angular.toJson(result);
|
|
|
Order.saveByGroup({}, jsonOrderDetails, function(result){
|
|
|
- if(result.code == 1) {
|
|
|
+ if(result.code == 1) {
|
|
|
if(result.message) {
|
|
|
toaster.pop('info', result.message);
|
|
|
}
|
|
|
- $state.go('order_pay', {orderid : enIdFilter(result.data.orderid)});
|
|
|
- }else if(result.code == 7){
|
|
|
- toaster.pop('info', '提示', "选中的购物车信息已经失效,将为您刷新界面之后重新操作");
|
|
|
+ $state.go('order_pay', {orderid : enIdFilter(result.data.orderid)});
|
|
|
+ }else if(result.code == 7){
|
|
|
+ toaster.pop('info', '提示', "选中的购物车信息已经失效,将为您刷新界面之后重新操作");
|
|
|
$timeout(function () {
|
|
|
window.location.reload();
|
|
|
}, 1500);
|
|
|
- }else {
|
|
|
+ }else {
|
|
|
toaster.pop('info', '提示', result.message);
|
|
|
}
|
|
|
}, function(res){
|
|
|
@@ -838,41 +838,41 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
}
|
|
|
|
|
|
};
|
|
|
- // 移入收藏后删除购物车操作
|
|
|
+ // 移入收藏后删除购物车操作
|
|
|
$scope.collectDelete = function(id){
|
|
|
- var arr = [];
|
|
|
- if(id != null){
|
|
|
- arr.push(id);
|
|
|
- }else {
|
|
|
- angular.forEach($scope.carts, function(cart){
|
|
|
- if(cart.isSelect){
|
|
|
- arr.push(cart.id);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- var ids = angular.toJson(arr);
|
|
|
- Cart.deleteById({ids : ids}, function(data){
|
|
|
- $rootScope.countCart = $rootScope.countCart - arr.length;
|
|
|
-
|
|
|
- //更新选中的购物车信息
|
|
|
- $scope.selectedStoreCarts = $scope.arrayFilterId($scope.selectedStoreCarts, arr);
|
|
|
- //更新购物车信息
|
|
|
- $scope.carts = $scope.arrayFilterId($scope.carts, arr);
|
|
|
- //判断是否全部删除,如果全部删除,就将全选置为取消状态。
|
|
|
- if($scope.carts.length == 0) {
|
|
|
- $scope.isChooseAll = false;
|
|
|
+ var arr = [];
|
|
|
+ if(id != null){
|
|
|
+ arr.push(id);
|
|
|
+ }else {
|
|
|
+ angular.forEach($scope.carts, function(cart){
|
|
|
+ if(cart.isSelect){
|
|
|
+ arr.push(cart.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ var ids = angular.toJson(arr);
|
|
|
+ Cart.deleteById({ids : ids}, function(data){
|
|
|
+ $rootScope.countCart = $rootScope.countCart - arr.length;
|
|
|
+
|
|
|
+ //更新选中的购物车信息
|
|
|
+ $scope.selectedStoreCarts = $scope.arrayFilterId($scope.selectedStoreCarts, arr);
|
|
|
+ //更新购物车信息
|
|
|
+ $scope.carts = $scope.arrayFilterId($scope.carts, arr);
|
|
|
+ //判断是否全部删除,如果全部删除,就将全选置为取消状态。
|
|
|
+ if($scope.carts.length == 0) {
|
|
|
+ $scope.isChooseAll = false;
|
|
|
$scope.cartIsEmpty = true;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- //更新map中购物车信息
|
|
|
- var deleteStoreName = [];
|
|
|
+ //更新map中购物车信息
|
|
|
+ var deleteStoreName = [];
|
|
|
angular.forEach($scope.cartMap, function(store) {
|
|
|
- if(store.arr && store.arr.length > 0) {
|
|
|
- store.arr = $scope.arrayFilterId(store.arr, arr)
|
|
|
- if(!store.arr || !store.arr.length || store.arr.length == 0) {
|
|
|
- deleteStoreName.push(store.name);
|
|
|
- }
|
|
|
+ if(store.arr && store.arr.length > 0) {
|
|
|
+ store.arr = $scope.arrayFilterId(store.arr, arr)
|
|
|
+ if(!store.arr || !store.arr.length || store.arr.length == 0) {
|
|
|
+ deleteStoreName.push(store.name);
|
|
|
}
|
|
|
+ }
|
|
|
});
|
|
|
//删除$scope.cartMap多余的部分。
|
|
|
angular.forEach(deleteStoreName, function(storeName) {
|
|
|
@@ -881,27 +881,27 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- //计算总金额
|
|
|
- $scope.calculateAmount($scope.selectedStoreCarts);
|
|
|
+ //计算总金额
|
|
|
+ $scope.calculateAmount($scope.selectedStoreCarts);
|
|
|
|
|
|
- }, function (res) {
|
|
|
- toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
|
|
|
- });
|
|
|
+ }, function (res) {
|
|
|
+ toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
|
|
|
+ });
|
|
|
|
|
|
|
|
|
};
|
|
|
- // 移入收藏
|
|
|
- $scope.collect = function(uuid, id) {
|
|
|
+ // 移入收藏
|
|
|
+ $scope.collect = function(uuid, id) {
|
|
|
if(uuid){
|
|
|
- ComponentActive.getSimpleInfoByUuid({uuid: uuid}, { }, function(data){
|
|
|
- var obj = {'componentid': data.id, 'kind': 2};
|
|
|
- collectionService.saveEntity({ }, obj, function(data) {
|
|
|
- $scope.collectDelete(id);
|
|
|
- toaster.pop('success', '收藏成功');
|
|
|
- }, function(response) {
|
|
|
- toaster.pop('error', '收藏失败');
|
|
|
- })
|
|
|
- });
|
|
|
+ ComponentActive.getSimpleInfoByUuid({uuid: uuid}, { }, function(data){
|
|
|
+ var obj = {'componentid': data.id, 'kind': 2};
|
|
|
+ collectionService.saveEntity({ }, obj, function(data) {
|
|
|
+ $scope.collectDelete(id);
|
|
|
+ toaster.pop('success', '收藏成功');
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '收藏失败');
|
|
|
+ })
|
|
|
+ });
|
|
|
}else{
|
|
|
var uuids = [];
|
|
|
angular.forEach($scope.cartMap, function(store){
|
|
|
@@ -915,14 +915,14 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
toaster.pop('info', '你还未选择任何产品');
|
|
|
return;
|
|
|
}
|
|
|
- collectionService.saveStores({ }, uuids, function(response){
|
|
|
+ collectionService.saveStores({ }, uuids, function(response){
|
|
|
if(response.data == "success"){
|
|
|
- $scope.collectDelete();
|
|
|
- toaster.pop('success', '收藏成功');
|
|
|
+ $scope.collectDelete();
|
|
|
+ toaster.pop('success', '收藏成功');
|
|
|
}
|
|
|
},function () {
|
|
|
- toaster.pop('error', '收藏失败');
|
|
|
- })
|
|
|
+ toaster.pop('error', '收藏失败');
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -968,32 +968,32 @@ define(["app/app", 'jquery-summernote'], function(app) {
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
- /**
|
|
|
- * 删除的逻辑
|
|
|
- */
|
|
|
+ /**
|
|
|
+ * 删除的逻辑
|
|
|
+ */
|
|
|
app.register.controller('cartDeleteCtrl', ['$scope', 'description', 'Cart', '$modalInstance', 'toaster', 'ids', function ($scope, description, Cart, $modalInstance, toaster,ids) {
|
|
|
|
|
|
- $scope.confirmDelete = function () {
|
|
|
- Cart.deleteById({ids : ids}, function(data){
|
|
|
- toaster.pop('success', '成功删除');
|
|
|
- $modalInstance.close()
|
|
|
- }, function (res) {
|
|
|
- toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
- $scope.confirmDeleteInvalid = function () {
|
|
|
- Cart.deleteById({ids : ids}, function(data){
|
|
|
- toaster.pop('success', '成功清除购物车内的无效产品');
|
|
|
- $modalInstance.close()
|
|
|
- }, function (res) {
|
|
|
- toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
|
|
|
- });
|
|
|
- };
|
|
|
-
|
|
|
- $scope.cancleDelete = function () {
|
|
|
- $modalInstance.dismiss();
|
|
|
- }
|
|
|
+ $scope.confirmDelete = function () {
|
|
|
+ Cart.deleteById({ids : ids}, function(data){
|
|
|
+ toaster.pop('success', '成功删除');
|
|
|
+ $modalInstance.close()
|
|
|
+ }, function (res) {
|
|
|
+ toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.confirmDeleteInvalid = function () {
|
|
|
+ Cart.deleteById({ids : ids}, function(data){
|
|
|
+ toaster.pop('success', '成功清除购物车内的无效产品');
|
|
|
+ $modalInstance.close()
|
|
|
+ }, function (res) {
|
|
|
+ toaster.pop('error', '系统错误', '购物车信息删除失败' + res.data);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.cancleDelete = function () {
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ }
|
|
|
|
|
|
}]);
|
|
|
|