@nuskin/ns-shop 7.1.5 → 7.1.6
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/package.json
CHANGED
|
@@ -4,6 +4,9 @@ import {RunConfigService} from '@nuskin/ns-util';
|
|
|
4
4
|
import {OrderManager, CartService, OrderType, OrderAdapter} from '../shop';
|
|
5
5
|
import axios from 'axios';
|
|
6
6
|
|
|
7
|
+
const SHIP_METHODS = 'shipMethods';
|
|
8
|
+
const Pick_UP_POINTS = 'pickUpPoints';
|
|
9
|
+
|
|
7
10
|
let PickupUtil = function() {
|
|
8
11
|
'use strict';
|
|
9
12
|
const SERVICE_GROUP = 'SERVICE_GROUP',
|
|
@@ -22,8 +25,6 @@ let PickupUtil = function() {
|
|
|
22
25
|
CARRIER_CODE = 'CARRIER_CODE';
|
|
23
26
|
|
|
24
27
|
let promise = Promise.resolve();
|
|
25
|
-
let shipMethods = [];
|
|
26
|
-
let pickupPoints = [];
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Pickup Point shipping methods.
|
|
@@ -190,12 +191,12 @@ let PickupUtil = function() {
|
|
|
190
191
|
}
|
|
191
192
|
}
|
|
192
193
|
).then((results) => {
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
sessionStorage.setItem(SHIP_METHODS, JSON.stringify(results.data.shipMethods))
|
|
195
|
+
sessionStorage.setItem(Pick_UP_POINTS, JSON.stringify(results.data.pickupPoints))
|
|
195
196
|
}).catch((err) => {
|
|
196
197
|
console.log(err);
|
|
197
|
-
|
|
198
|
-
|
|
198
|
+
sessionStorage.setItem(SHIP_METHODS, JSON.stringify([]));
|
|
199
|
+
sessionStorage.setItem(Pick_UP_POINTS, JSON.stringify([]));
|
|
199
200
|
});
|
|
200
201
|
}
|
|
201
202
|
}
|
|
@@ -203,13 +204,13 @@ let PickupUtil = function() {
|
|
|
203
204
|
async function getShipMethods() {
|
|
204
205
|
await promise;
|
|
205
206
|
|
|
206
|
-
return
|
|
207
|
+
return JSON.parse((sessionStorage.getItem(SHIP_METHODS) || []));
|
|
207
208
|
}
|
|
208
209
|
|
|
209
210
|
async function getPickupPoints() {
|
|
210
211
|
await promise;
|
|
211
212
|
|
|
212
|
-
return
|
|
213
|
+
return JSON.parse(sessionStorage.getItem(Pick_UP_POINTS) || []);
|
|
213
214
|
}
|
|
214
215
|
|
|
215
216
|
return {
|