|
|
@@ -14575,7 +14575,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
/**
|
|
|
* 购物车详情
|
|
|
*/
|
|
|
- app.controller('CartDetailController', ['$scope', 'cartOperation', '$stateParams', 'toaster', '$timeout', 'BaseService', 'ngTableParams', '$filter', 'Product', 'Vendor', 'ShipAddress', '$modal', 'newPurcOrder', 'addtoCart', '$http', function ($scope, cartOperation, $stateParams, toaster, $timeout, BaseService, ngTableParams, $filter, Product, Vendor, ShipAddress, $modal, newPurcOrder, addtoCart, $http) {
|
|
|
+ app.controller('CartDetailController', ['$scope', 'cartOperation', '$stateParams', 'toaster', '$timeout', 'BaseService', 'ngTableParams', '$filter', 'Product', 'Vendor', 'ShipAddress', '$modal', 'newPurcOrder', 'addtoCart', '$http', 'token', function ($scope, cartOperation, $stateParams, toaster, $timeout, BaseService, ngTableParams, $filter, Product, Vendor, ShipAddress, $modal, newPurcOrder, addtoCart, $http, token) {
|
|
|
BaseService.scrollBackToTop();
|
|
|
$scope.loading = true;
|
|
|
var loadData = function () {
|
|
|
@@ -14599,6 +14599,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
};
|
|
|
loadData();
|
|
|
|
|
|
+ var getToken = function() {
|
|
|
+ token.info({userType: 'cart'}, {}, function(data) {
|
|
|
+ $scope.token = data.token;
|
|
|
+ }, function(response) {
|
|
|
+ toaster.pop('error', '提示', response.data);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ getToken();
|
|
|
+
|
|
|
// 获取地址信息
|
|
|
$http.get('resources/citydata/city.json', {
|
|
|
"Accept": "application/json;charset=utf-8", "Accept-Charset": "charset=utf-8"
|
|
|
@@ -14779,7 +14788,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
}
|
|
|
$scope.order.status = 311;
|
|
|
- addtoCart.save({}, $scope.order, function (data) {
|
|
|
+ addtoCart.save({token: $scope.token}, $scope.order, function (data) {
|
|
|
$scope.loading = false;
|
|
|
toaster.pop('success', '成功', '保存成功');
|
|
|
loadData();
|
|
|
@@ -14813,7 +14822,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
}
|
|
|
$scope.order.status = 200;
|
|
|
- addtoCart.save({}, $scope.order, function (data) {
|
|
|
+ addtoCart.save({token: $scope.token}, $scope.order, function (data) {
|
|
|
$scope.loading = false;
|
|
|
toaster.pop('success', '成功', '保存成功');
|
|
|
window.location.hash = '#/purc/order/' + data.id;
|