|
|
@@ -234,6 +234,9 @@ define(['app/app'], function(app) {
|
|
|
if ($scope.order.status == 501){
|
|
|
DistributionRule.findUsableRule({area:$scope.payment.address.area}, $scope.storeArray, function (data) {
|
|
|
if (data){
|
|
|
+ //更换地址后先清空数据
|
|
|
+ $scope.deliveryList = {};
|
|
|
+ $scope.fareList = {};
|
|
|
angular.forEach($scope.storeArray, function (item) {
|
|
|
$scope.ruleMap[item.uuid] = [];
|
|
|
var arr = data[item.uuid];
|
|
|
@@ -271,9 +274,15 @@ define(['app/app'], function(app) {
|
|
|
updateStoreArray(detail);
|
|
|
$q.all([updateFare($scope.ruleMap[detail.storeid], $scope.storePrice[detail.storeName]).$promise]).then(function (data) {
|
|
|
if (data){
|
|
|
+ var id = $scope.deliveryList[detail.storeid].id;
|
|
|
var arr = data[0];
|
|
|
$scope.ruleMap[detail.storeid] = arr;
|
|
|
- $scope.deliveryList[detail.storeid] = arr[0];
|
|
|
+ angular.forEach(arr, function (item) {
|
|
|
+ if (item.id == id){
|
|
|
+ $scope.deliveryList[detail.storeid] = item;
|
|
|
+ $scope.fareList[detail.storeid] = item.fare;
|
|
|
+ }
|
|
|
+ });
|
|
|
$scope.calculateFare();
|
|
|
}
|
|
|
});
|
|
|
@@ -295,9 +304,15 @@ define(['app/app'], function(app) {
|
|
|
updateStoreArray(detail);
|
|
|
$q.all([updateFare($scope.ruleMap[detail.storeid], $scope.storePrice[detail.storeName]).$promise]).then(function (data) {
|
|
|
if (data){
|
|
|
+ var id = $scope.deliveryList[detail.storeid].id;
|
|
|
var arr = data[0];
|
|
|
$scope.ruleMap[detail.storeid] = arr;
|
|
|
- $scope.deliveryList[detail.storeid] = arr[0];
|
|
|
+ angular.forEach(arr, function (item) {
|
|
|
+ if (item.id == id){
|
|
|
+ $scope.deliveryList[detail.storeid] = item;
|
|
|
+ $scope.fareList[detail.storeid] = item.fare;
|
|
|
+ }
|
|
|
+ });
|
|
|
$scope.calculateFare();
|
|
|
}
|
|
|
});
|
|
|
@@ -324,8 +339,7 @@ define(['app/app'], function(app) {
|
|
|
var updateFare = function (ruleList, price) {
|
|
|
return DistributionRule.findFareOfRule({price:price}, ruleList, function (data) {
|
|
|
if (data){
|
|
|
- var rule = ruleList[0];
|
|
|
- $scope.fareList[rule.uuid] = rule.fare;
|
|
|
+
|
|
|
}
|
|
|
}, function (error) {
|
|
|
// toaster.pop("error", error.data);
|
|
|
@@ -349,9 +363,15 @@ define(['app/app'], function(app) {
|
|
|
updateStoreArray(detail);
|
|
|
$q.all([updateFare($scope.ruleMap[detail.storeid], $scope.storePrice[detail.storeName]).$promise]).then(function (data) {
|
|
|
if (data){
|
|
|
+ var id = $scope.deliveryList[detail.storeid].id;
|
|
|
var arr = data[0];
|
|
|
$scope.ruleMap[detail.storeid] = arr;
|
|
|
- $scope.deliveryList[detail.storeid] = arr[0];
|
|
|
+ angular.forEach(arr, function (item) {
|
|
|
+ if (item.id == id){
|
|
|
+ $scope.deliveryList[detail.storeid] = item;
|
|
|
+ $scope.fareList[detail.storeid] = item.fare;
|
|
|
+ }
|
|
|
+ });
|
|
|
$scope.calculateFare();
|
|
|
}
|
|
|
});
|
|
|
@@ -427,7 +447,7 @@ define(['app/app'], function(app) {
|
|
|
}
|
|
|
var validTakeSelf = checkTakeSelf();
|
|
|
if (!validTakeSelf){
|
|
|
- toaster.pop("info", "当前无选择自提点信息ddd");
|
|
|
+ toaster.pop("info", "请选择一个自提点");
|
|
|
return ;
|
|
|
}
|
|
|
var orderInfos = [], orderInfo;
|