@infrab4a/connect-angular 3.4.0-beta.4 → 3.4.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/infrab4a-connect-angular.umd.js +35 -37
- package/bundles/infrab4a-connect-angular.umd.js.map +1 -1
- package/esm2015/services/shipping.service.js +14 -13
- package/fesm2015/infrab4a-connect-angular.js +13 -9
- package/fesm2015/infrab4a-connect-angular.js.map +1 -1
- package/package.json +1 -1
- package/services/shipping.service.d.ts +1 -3
|
@@ -1223,51 +1223,49 @@
|
|
|
1223
1223
|
} });
|
|
1224
1224
|
|
|
1225
1225
|
var ShippingService = /** @class */ (function () {
|
|
1226
|
-
function ShippingService(http,
|
|
1226
|
+
function ShippingService(http,
|
|
1227
|
+
// private homeService: HomeShopService,
|
|
1228
|
+
apiUrl) {
|
|
1227
1229
|
this.http = http;
|
|
1228
|
-
this.homeService = homeService;
|
|
1229
1230
|
this.apiUrl = apiUrl;
|
|
1230
1231
|
}
|
|
1231
1232
|
ShippingService.prototype.getMensShippingMethods = function (zip, weightGrams, totalPrice, personId, shop, subscriptionPlan) {
|
|
1232
1233
|
var _this = this;
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
]).pipe(
|
|
1234
|
+
// combineLatest([
|
|
1235
|
+
// this.homeService.getHomeData(),
|
|
1236
|
+
// this.http.get(`${this.apiUrl}open/checkshippingcompany?personId=${personId}&postalCode=${zip}&weightGrams=${weightGrams}`)
|
|
1237
|
+
// ]).pipe(
|
|
1238
|
+
// map((datas, shippings) => console.log('combineLatest', datas, shippings))
|
|
1239
|
+
// )
|
|
1237
1240
|
return this.http.get(this.apiUrl + "open/checkshippingcompany?personId=" + personId + "&postalCode=" + zip + "&weightGrams=" + weightGrams)
|
|
1238
1241
|
.pipe(operators.map(function (data) { return data.result; }), operators.map(function (shippingMethods) { return __awaiter(_this, void 0, void 0, function () {
|
|
1239
1242
|
var shippingMethodsResponse, datas;
|
|
1240
1243
|
return __generator(this, function (_a) {
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1265
|
-
else
|
|
1266
|
-
return s;
|
|
1267
|
-
})];
|
|
1268
|
-
}
|
|
1269
|
-
return [2 /*return*/, shippingMethodsResponse];
|
|
1244
|
+
shippingMethodsResponse = shippingMethods;
|
|
1245
|
+
console.log('shippingMethods', shippingMethods);
|
|
1246
|
+
if (!shippingMethods.length)
|
|
1247
|
+
return [2 /*return*/, []];
|
|
1248
|
+
datas = [];
|
|
1249
|
+
if (this.isHolidays(datas)) {
|
|
1250
|
+
shippingMethodsResponse = shippingMethods.filter(function (method) { return method.ShippingCompanyName !== 'Same Day'; });
|
|
1251
|
+
}
|
|
1252
|
+
if (totalPrice >= 200 || this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
|
|
1253
|
+
return [2 /*return*/, shippingMethodsResponse.map(function (s) {
|
|
1254
|
+
if (s.serviceName !== 'Same Day')
|
|
1255
|
+
return Object.assign(Object.assign({}, s), { totalPrice: 0 });
|
|
1256
|
+
else
|
|
1257
|
+
return s;
|
|
1258
|
+
})];
|
|
1259
|
+
}
|
|
1260
|
+
if (this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
|
|
1261
|
+
return [2 /*return*/, shippingMethodsResponse.map(function (s) {
|
|
1262
|
+
if (s.serviceName !== 'Same Day')
|
|
1263
|
+
return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
|
|
1264
|
+
else
|
|
1265
|
+
return s;
|
|
1266
|
+
})];
|
|
1270
1267
|
}
|
|
1268
|
+
return [2 /*return*/, shippingMethodsResponse];
|
|
1271
1269
|
});
|
|
1272
1270
|
}); }));
|
|
1273
1271
|
};
|
|
@@ -1301,12 +1299,12 @@
|
|
|
1301
1299
|
};
|
|
1302
1300
|
return ShippingService;
|
|
1303
1301
|
}());
|
|
1304
|
-
ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$3.HttpClient }, { token:
|
|
1302
|
+
ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$3.HttpClient }, { token: API_URL }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1305
1303
|
ShippingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService });
|
|
1306
1304
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, decorators: [{
|
|
1307
1305
|
type: i0.Injectable
|
|
1308
1306
|
}], ctorParameters: function () {
|
|
1309
|
-
return [{ type: i1__namespace$3.HttpClient }, { type:
|
|
1307
|
+
return [{ type: i1__namespace$3.HttpClient }, { type: undefined, decorators: [{
|
|
1310
1308
|
type: i0.Inject,
|
|
1311
1309
|
args: [API_URL]
|
|
1312
1310
|
}] }];
|