wickes-css2 2.94.0-develop.1 → 2.94.0-develop.10
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/Readme.md +3 -3
- package/build/css/category-main.css +1 -1
- package/build/css/components/checkout-payment-details-v2.css +1 -1
- package/build/css/homepage-main.css +1 -1
- package/build/css/main.css +1 -1
- package/build/css/my-account-main-v2.css +1 -1
- package/build/css/my-account-main.css +1 -1
- package/build/css/pages/my-account-v2.css +1 -1
- package/build/css/pages/my-account.css +1 -1
- package/build/css/pages/page_default-store.css +1 -0
- package/build/css/pages/page_my-orders.css +1 -0
- package/build/css/pages/page_personal-details.css +1 -1
- package/build/css/pages/page_product-details-v2-critical.css +1 -1
- package/build/css/pages/page_product-details-v2.css +1 -1
- package/build/css/pages/page_products-list-combined.css +1 -1
- package/build/css/pages/page_products-list.css +1 -1
- package/build/css/pages/page_shopping-cart-v2.css +1 -1
- package/build/css/pdp-main-before-combine.css +1 -1
- package/build/css/pdp-main-critical.css +1 -1
- package/build/css/pdp-main-non-critical.css +1 -1
- package/build/css/pdp-main.css +1 -1
- package/build/css/plp-main.css +1 -1
- package/build/css/store-locator-main.css +1 -1
- package/build/js/account-members.min.js +1 -1
- package/build/js/basket.min.js +2 -2
- package/build/js/bundle.min.js +1 -1
- package/build/js/checkout.min.js +1 -1
- package/build/js/default-store.min.js +1 -0
- package/build/js/emulation.min.js +151 -3
- package/build/js/general.bundle.min.js +1 -1
- package/build/js/merged-checkout.min.js +1 -1
- package/build/js/my-orders.min.js +1 -0
- package/build/js/page/basket-v2.js +7 -6
- package/build/js/page/default-store.js +44 -0
- package/build/js/page/my-orders.js +165 -0
- package/build/js/page/personal-details.js +105 -36
- package/build/js/page/plp-load-more.js +1 -0
- package/build/js/pdp.bundle.min.js +1 -1
- package/build/js/personal-details.min.js +1 -1
- package/build/js/plp.bundle.min.js +1 -1
- package/build/js/project-list.min.js +1 -1
- package/package.json +1 -1
- package/src/components/account-families/actions-bar.hbs +3 -3
- package/src/components/default-store/current-store.hbs +60 -0
- package/src/components/default-store/list-of-store.hbs +39 -0
- package/src/components/default-store/store-form.hbs +29 -0
- package/src/components/default-store/store-unavailable.hbs +4 -0
- package/src/components/flatpickr-calendar.hbs +26 -0
- package/src/components/my-account/active-orders/header.hbs +6 -2
- package/src/components/my-account/active-orders/list-orders.hbs +14 -2
- package/src/components/my-account/active-orders/order-header.hbs +1 -1
- package/src/components/my-account/active-orders/order.hbs +10 -6
- package/src/components/my-account/clipboard-code-card.hbs +1 -1
- package/src/components/my-account/empty-orders.hbs +9 -0
- package/src/components/my-account/mobile-nav.hbs +23 -19
- package/src/components/my-account/orders-nav.hbs +15 -0
- package/src/components/my-account/personal-details-form.hbs +5 -0
- package/src/components/my-account/sort-by.hbs +3 -0
- package/src/components/my-account/user-account-actions.hbs +1 -1
- package/src/components/signup-form.hbs +1 -2
- package/src/components/store-details.hbs +22 -20
- package/src/components/store-preview.hbs +0 -11
- package/src/components/user-information-field.hbs +1 -1
- package/src/data/data_big-wins-stores.json +0 -22
- package/src/data/my-account/data_my-orders.json +246 -0
- package/src/data/my-account/data_personal-details.json +36 -11
- package/src/data/my-account/page_default-store.json +158 -0
- package/src/elements/dropdown.hbs +1 -1
- package/src/elements/input.hbs +2 -2
- package/src/js/components/flatpickr.js +167 -0
- package/src/js/components/general/handleAccordion.js +35 -0
- package/src/js/components/general/switchVat.js +28 -2
- package/src/js/components/leave-event.js +41 -2
- package/src/js/emulation/big-wins.js +0 -2
- package/src/js/emulation/default-store.js +97 -0
- package/src/js/emulation/forms.js +1 -1
- package/src/js/emulation/mock.js +10 -0
- package/src/js/emulation/my-orders-local.js +41 -0
- package/src/js/page/basket-v2.js +7 -6
- package/src/js/page/default-store.js +44 -0
- package/src/js/page/my-orders.js +165 -0
- package/src/js/page/personal-details.js +105 -36
- package/src/js/page/plp-load-more.js +1 -0
- package/src/page_checkout_payment-details_with-card-loader.html +56 -0
- package/src/page_default-store-page-empty.html +48 -0
- package/src/page_default-store-page.html +55 -0
- package/src/page_my-orders-empty.html +49 -0
- package/src/page_my-orders.html +64 -0
- package/src/page_personal-details-installer.html +17 -7
- package/src/page_personal-details.html +15 -7
- package/src/page_wismo-order-history-loadmore.html +3 -3
- package/src/scss/barclays-paypage-combined-minified.css +1 -1
- package/src/scss/barclays-paypage-combined.css +9 -15
- package/src/scss/components/_big-wins-critical.scss +0 -1
- package/src/scss/components/_big-wins.scss +1 -8
- package/src/scss/components/_order-item-cc.scss +0 -6
- package/src/scss/components/checkout-payment-details-v2.scss +2 -2
- package/src/scss/components/my-account/_active-orders.scss +263 -0
- package/src/scss/components/my-account/_orders-nav.scss +61 -0
- package/src/scss/components/my-account/_shipment.scss +1 -0
- package/src/scss/helpers/_variables.scss +1 -0
- package/src/scss/libs/flatpickr.scss +235 -0
- package/src/scss/pages/_my-account_new.scss +1 -12
- package/src/scss/pages/my-account-v2.scss +1 -136
- package/src/scss/pages/page_default-store.scss +634 -0
- package/src/scss/pages/page_my-orders.scss +232 -0
- package/src/scss/pages/page_personal-details.scss +37 -5
- package/src/scss/pages/page_products-list-combined.scss +0 -1
- package/src/scss/pages/page_products-list.scss +0 -1
- package/src/scss/partials/_header.scss +5 -0
- package/src/sitemap.html +7 -1
- package/src/scss/components/my-account/_order.scss +0 -112
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
var Wick = window.Wick || {};
|
|
2
|
+
|
|
3
|
+
Wick.Flatpickr = {
|
|
4
|
+
el: {
|
|
5
|
+
$crossIcon: $("#crossIcon"),
|
|
6
|
+
$calendarIcon: $("#calendarIcon"),
|
|
7
|
+
flatpickrDisabled: '.flatpickr-disabled',
|
|
8
|
+
datePickerField: '.flatpickr-datepicker__field',
|
|
9
|
+
},
|
|
10
|
+
generateInitialDisabledMonths(year, startMonth) {
|
|
11
|
+
const today = new Date();
|
|
12
|
+
const currentYear = today.getFullYear();
|
|
13
|
+
const currentMonth = today.getMonth();
|
|
14
|
+
|
|
15
|
+
if (year === currentYear) {
|
|
16
|
+
return Array.from({ length: 12 - currentMonth - 1 }, (_, i) =>
|
|
17
|
+
new Date(year, currentMonth + 1 + i, 1)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return [];
|
|
22
|
+
},
|
|
23
|
+
handleYearChange(instance, minYear, currentYear, currentMonth) {
|
|
24
|
+
const selectedYear = instance.currentYear;
|
|
25
|
+
|
|
26
|
+
if (selectedYear > currentYear) {
|
|
27
|
+
instance.changeYear(currentYear);
|
|
28
|
+
} else if (selectedYear < minYear) {
|
|
29
|
+
instance.changeYear(minYear);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
Wick.Flatpickr.updateDisabledMonths(instance, selectedYear, currentMonth, currentYear);
|
|
33
|
+
},
|
|
34
|
+
updateDisabledMonths(instance, year, month) {
|
|
35
|
+
const disabledMonths = Wick.Flatpickr.generateInitialDisabledMonths(year, month);
|
|
36
|
+
instance.set("disable", disabledMonths);
|
|
37
|
+
},
|
|
38
|
+
bindClearIcon(instance, $field) {
|
|
39
|
+
if ($field.val().trim() !== "") {
|
|
40
|
+
Wick.Flatpickr.el.$crossIcon.removeClass("d-none").addClass("d-flex");
|
|
41
|
+
} else {
|
|
42
|
+
Wick.Flatpickr.el.$crossIcon.removeClass("d-flex").addClass("d-none");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Wick.Flatpickr.el.$crossIcon.on("click", function () {
|
|
46
|
+
instance.clear();
|
|
47
|
+
instance.setDate(null);
|
|
48
|
+
$field.val("");
|
|
49
|
+
Wick.Flatpickr.el.$crossIcon.hide();
|
|
50
|
+
instance.open();
|
|
51
|
+
instance.close();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
$field.on("input", function () {
|
|
55
|
+
if ($field.val().trim() === "") {
|
|
56
|
+
Wick.Flatpickr.el.$crossIcon.removeClass("d-flex").addClass("d-none");
|
|
57
|
+
} else {
|
|
58
|
+
Wick.Flatpickr.el.$crossIcon.removeClass("d-none").addClass("d-flex");
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
bindCalendarIcon(instance) {
|
|
63
|
+
Wick.Flatpickr.el.$calendarIcon.on("click", function () {
|
|
64
|
+
instance.open();
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
formatDateToYYYYMM(date) {
|
|
68
|
+
const newDate = new Date(date);
|
|
69
|
+
const year = newDate.getFullYear();
|
|
70
|
+
const month = String(newDate.getMonth() + 1).padStart(2, "0");
|
|
71
|
+
return `${year}-${month}`;
|
|
72
|
+
},
|
|
73
|
+
getFlatpickrConfig(config) {
|
|
74
|
+
const today = new Date();
|
|
75
|
+
const chooseDate = config.chooseDate
|
|
76
|
+
? new Date(config.chooseDate)
|
|
77
|
+
: null;
|
|
78
|
+
const currentYear = config.currentYear || today.getFullYear();
|
|
79
|
+
const currentMonth = chooseDate ? chooseDate.getMonth() : today.getMonth();
|
|
80
|
+
const minYear = config.minYear || currentYear - 15;
|
|
81
|
+
|
|
82
|
+
const minDate = new Date(minYear, 0, 1);
|
|
83
|
+
const maxDate = new Date(`${currentYear}-12-31`);
|
|
84
|
+
|
|
85
|
+
const initialDisabledMonths = Wick.Flatpickr.generateInitialDisabledMonths(
|
|
86
|
+
today.getFullYear(),
|
|
87
|
+
currentMonth
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
return {
|
|
91
|
+
dateFormat: config.dateFormat || "F Y",
|
|
92
|
+
enableTime: false,
|
|
93
|
+
static: config.static || true,
|
|
94
|
+
defaultDate: chooseDate || null,
|
|
95
|
+
placeholder: "Select year and month",
|
|
96
|
+
minDate,
|
|
97
|
+
maxDate,
|
|
98
|
+
disable: initialDisabledMonths,
|
|
99
|
+
plugins: [
|
|
100
|
+
new monthSelectPlugin({
|
|
101
|
+
shorthand: false,
|
|
102
|
+
dateFormat: config.dateFormat || "F Y",
|
|
103
|
+
theme: "light",
|
|
104
|
+
}),
|
|
105
|
+
],
|
|
106
|
+
onYearChange: (selectedDates, dateStr, instance) => {
|
|
107
|
+
Wick.Flatpickr.handleYearChange(
|
|
108
|
+
instance,
|
|
109
|
+
minYear,
|
|
110
|
+
currentYear,
|
|
111
|
+
currentMonth
|
|
112
|
+
);
|
|
113
|
+
},
|
|
114
|
+
onMonthChange: (selectedDates, dateStr, instance) => {
|
|
115
|
+
Wick.Flatpickr.updateDisabledMonths(
|
|
116
|
+
instance,
|
|
117
|
+
currentYear,
|
|
118
|
+
currentMonth
|
|
119
|
+
);
|
|
120
|
+
},
|
|
121
|
+
onReady: (selectedDates, dateStr, instance) => {
|
|
122
|
+
Wick.Flatpickr.updateDisabledMonths(
|
|
123
|
+
instance,
|
|
124
|
+
currentYear,
|
|
125
|
+
currentMonth
|
|
126
|
+
);
|
|
127
|
+
},
|
|
128
|
+
onOpen: (selectedDates, dateStr, instance) => {
|
|
129
|
+
$(Wick.Flatpickr.el.datePickerField).addClass('active');
|
|
130
|
+
},
|
|
131
|
+
onClose: (selectedDates, dateStr, instance) => {
|
|
132
|
+
$(Wick.Flatpickr.el.datePickerField).removeClass("active");
|
|
133
|
+
$(Wick.Flatpickr.el.flatpickrDisabled).removeClass("flatpickr-disabled");
|
|
134
|
+
|
|
135
|
+
if (selectedDates.length > 0) {
|
|
136
|
+
const selectedDate = selectedDates[0];
|
|
137
|
+
const selectedYear = selectedDate.getFullYear();
|
|
138
|
+
const selectedMonth = selectedDate.getMonth();
|
|
139
|
+
instance.currentYear = selectedYear;
|
|
140
|
+
instance.currentMonth = selectedMonth;
|
|
141
|
+
|
|
142
|
+
Wick.Flatpickr.updateDisabledMonths(instance, selectedYear, selectedMonth);
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
onChange: (selectedDates, dateStr) => {
|
|
146
|
+
const { onChangeCallback } = config;
|
|
147
|
+
if (typeof onChangeCallback === "function") {
|
|
148
|
+
const formattedDate = Wick.Flatpickr.formatDateToYYYYMM(selectedDates[0]);
|
|
149
|
+
onChangeCallback(formattedDate);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
init(config) {
|
|
155
|
+
const $field = $(config.id);
|
|
156
|
+
|
|
157
|
+
if (!$field.length) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const flatpickrConfig = Wick.Flatpickr.getFlatpickrConfig(config);
|
|
162
|
+
const flatpickrInstance = flatpickr(config.id, flatpickrConfig);
|
|
163
|
+
|
|
164
|
+
Wick.Flatpickr.bindClearIcon(flatpickrInstance, $field);
|
|
165
|
+
Wick.Flatpickr.bindCalendarIcon(flatpickrInstance);
|
|
166
|
+
},
|
|
167
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var Wick = Wick || {};
|
|
2
|
+
|
|
3
|
+
Wick.HandleAccordions = {
|
|
4
|
+
el: {
|
|
5
|
+
$body: $('body'),
|
|
6
|
+
$accordions: $(".account-nav .accordion"),
|
|
7
|
+
accordionContent: '.accordion__content',
|
|
8
|
+
accordionHeader: '.accordion__header',
|
|
9
|
+
accordionCollapsed: 'accordion_collapsed',
|
|
10
|
+
},
|
|
11
|
+
handleOutsideClick() {
|
|
12
|
+
document.addEventListener("click", function (event) {
|
|
13
|
+
Wick.HandleAccordions.el.$accordions.each(function () {
|
|
14
|
+
const $accordion = $(this);
|
|
15
|
+
const $content = $accordion.find(Wick.HandleAccordions.el.accordionContent);
|
|
16
|
+
const $toggle = $accordion.find(Wick.HandleAccordions.el.accordionHeader);
|
|
17
|
+
|
|
18
|
+
const toggleButton = $toggle[0];
|
|
19
|
+
const content = $content[0];
|
|
20
|
+
|
|
21
|
+
if (!toggleButton || !content) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (!toggleButton.contains(event.target) && !content.contains(event.target)) {
|
|
26
|
+
if ($content.is(":visible")) {
|
|
27
|
+
$content.hide();
|
|
28
|
+
$accordion.addClass(Wick.HandleAccordions.el.accordionCollapsed);
|
|
29
|
+
$accordion.attr("aria-expanded", "false");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -36,7 +36,11 @@ Wick.VatToggle = {
|
|
|
36
36
|
},
|
|
37
37
|
|
|
38
38
|
getSwitcherState: function() {
|
|
39
|
-
|
|
39
|
+
if ($(Wick.VatToggle.el.switchVatInput).length) {
|
|
40
|
+
return !!$(Wick.VatToggle.el.switchVatInput).attr('checked');
|
|
41
|
+
} else {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
40
44
|
},
|
|
41
45
|
|
|
42
46
|
createToggleEvent: function(isToggled) {
|
|
@@ -65,6 +69,28 @@ Wick.VatToggle = {
|
|
|
65
69
|
$(includingVatEl).toggleClass(hiddenClassName);
|
|
66
70
|
$(excludingVat).toggleClass(hiddenClassName);
|
|
67
71
|
},
|
|
72
|
+
reapplyDisplayClass: function () {
|
|
73
|
+
const includingVatEl = Wick.VatToggle.el.includingVat;
|
|
74
|
+
const excludingVatEl = Wick.VatToggle.el.excludingVat;
|
|
75
|
+
const hiddenClassName = Wick.VatToggle.HIDDEN_CLASS_NAME;
|
|
76
|
+
|
|
77
|
+
let vatState = null;
|
|
78
|
+
|
|
79
|
+
// check switcher state for web or cookie for app
|
|
80
|
+
if (Wick.VatToggle.getSwitcherState() !== null) {
|
|
81
|
+
vatState = Wick.VatToggle.getSwitcherState();
|
|
82
|
+
} else {
|
|
83
|
+
vatState = Wick.VatToggle.isOn();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (vatState) {
|
|
87
|
+
$(includingVatEl).addClass(hiddenClassName);
|
|
88
|
+
$(excludingVatEl).removeClass(hiddenClassName);
|
|
89
|
+
} else {
|
|
90
|
+
$(includingVatEl).removeClass(hiddenClassName);
|
|
91
|
+
$(excludingVatEl).addClass(hiddenClassName);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
68
94
|
|
|
69
95
|
updateGlobalClass: function () {
|
|
70
96
|
const includingVatGlobal = Wick.VatToggle.el.includingVatGlobalClass;
|
|
@@ -98,7 +124,7 @@ Wick.VatToggle = {
|
|
|
98
124
|
|
|
99
125
|
init: function() {
|
|
100
126
|
const isVatShouldBeToggled = Wick.VatToggle.isOn();
|
|
101
|
-
const isVatToggled = Wick.VatToggle.getSwitcherState();
|
|
127
|
+
const isVatToggled = !!Wick.VatToggle.getSwitcherState();
|
|
102
128
|
|
|
103
129
|
if(isVatShouldBeToggled) {
|
|
104
130
|
Wick.VatToggle.setLabelState();
|
|
@@ -26,15 +26,54 @@ Wick.LeaveEvent = {
|
|
|
26
26
|
const currentState = Wick.LeaveEvent.getState(form);
|
|
27
27
|
const isDifferent = !_.isEqual(currentState, Wick.LeaveEvent.initialFormState);
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
const csrfTokenCheck = Wick.LeaveEvent.isCsrfTokenEqual(currentState, Wick.LeaveEvent.initialFormState);
|
|
30
|
+
|
|
31
|
+
if (isDifferent && (csrfTokenCheck || csrfTokenCheck === undefined)) {
|
|
30
32
|
return Wick.LeaveEvent.LEAVE_MESSAGE;
|
|
31
33
|
}
|
|
32
34
|
},
|
|
35
|
+
isCsrfTokenEqual(currentState, initialFormState) {
|
|
36
|
+
const csrfTokenCurrentState = currentState.find(item => item.name === 'CSRFToken')?.value;
|
|
37
|
+
const csrfTokenNewState = initialFormState.find(item => item.name === 'CSRFToken')?.value;
|
|
38
|
+
|
|
39
|
+
return csrfTokenCurrentState === csrfTokenNewState;
|
|
40
|
+
},
|
|
33
41
|
showCustomModal() {
|
|
34
42
|
$(Wick.LeaveEvent.el.leavePopup).modal('show')
|
|
35
43
|
},
|
|
36
44
|
getState(form) {
|
|
37
|
-
|
|
45
|
+
let arrForm = $(form).serializeArray();
|
|
46
|
+
arrForm = Wick.LeaveEvent.processSerializedArr(arrForm, form);
|
|
47
|
+
return arrForm;
|
|
48
|
+
},
|
|
49
|
+
processSerializedArr(arrForm, form) {
|
|
50
|
+
arrForm = arrForm.map((item) => {
|
|
51
|
+
let element = $(form).find(`[name="${item.name}"]`);
|
|
52
|
+
|
|
53
|
+
if (element.attr("data-tag")) {
|
|
54
|
+
let dataTagValue = element.attr("data-tag");
|
|
55
|
+
let similarElements = $(form).find(`[data-tag="${dataTagValue}"]`);
|
|
56
|
+
let hiddenElement = similarElements.filter(`[type="hidden"]`);
|
|
57
|
+
|
|
58
|
+
if (hiddenElement.length) {
|
|
59
|
+
let previousElement = similarElements.not(`[type="hidden"]`);
|
|
60
|
+
let previousValue = previousElement.val();
|
|
61
|
+
item.value = hiddenElement.val();
|
|
62
|
+
item.text = previousValue;
|
|
63
|
+
}
|
|
64
|
+
} else if (element.prop("tagName").toLowerCase() === "select") {
|
|
65
|
+
item.value = element.find("option:selected").val();
|
|
66
|
+
item.text = element.find("option:selected").text();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (item.name === "email" && item.value) {
|
|
70
|
+
item.value = item.value.toLowerCase();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return item;
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return arrForm;
|
|
38
77
|
},
|
|
39
78
|
checkLeavePopup() {
|
|
40
79
|
if (Wick.LeaveEvent.proceedBrowserLeave) {
|
|
@@ -48,7 +48,6 @@ Wick.BigWinsProto = function () {
|
|
|
48
48
|
$defaultInfo: $('.default-store__det'),
|
|
49
49
|
$store: $('.store'),
|
|
50
50
|
$chosenItem: $('.chosen__item'),
|
|
51
|
-
$storeAct: $('.store__act'),
|
|
52
51
|
$storeCount: $('.store__count'),
|
|
53
52
|
$stockList: $('.stock__list'),
|
|
54
53
|
$stockTarget: $('.stock__target'),
|
|
@@ -64,7 +63,6 @@ Wick.BigWinsProto = function () {
|
|
|
64
63
|
$findStore: $('.my-account_find-store'),
|
|
65
64
|
$postCodeErrorMsg: $('.stock__postcode_invalid-msg'),
|
|
66
65
|
$ccOrder: $('.cc-order'),
|
|
67
|
-
storeAct: 'store__act',
|
|
68
66
|
storeState: 'store__state',
|
|
69
67
|
storeCount: '.store__count',
|
|
70
68
|
ccBtn: '.bw__cc-btn',
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
var Wick = Wick || {};
|
|
2
|
+
Wick.DefaultStoreProto = {
|
|
3
|
+
el: {
|
|
4
|
+
searchStoreForm: '.search-store',
|
|
5
|
+
$searchStoreWrapInput: $('.search-store__input'),
|
|
6
|
+
searchStoreErrorClass: 'search-store__input-error',
|
|
7
|
+
searchStoreInput: '.search-store #postcode',
|
|
8
|
+
$searchStoreError: $('.form-row__error'),
|
|
9
|
+
$storeUnavailableSection: $('.store-unavailable'),
|
|
10
|
+
$listOfStoreForm: $('.list-of-store'),
|
|
11
|
+
btnCancel: '.my-account_cancel-store',
|
|
12
|
+
btnLocation: '.btn--location',
|
|
13
|
+
iconLocation: '.btn--location .icon',
|
|
14
|
+
errorIconLocation: '.btn--location .icon-error',
|
|
15
|
+
$bigWins: $('.bw'),
|
|
16
|
+
$bwActions: $('.bw_act'),
|
|
17
|
+
$sDetails: $('.s-details_hide'),
|
|
18
|
+
sDetailsHide: 's-details_hide',
|
|
19
|
+
$storeMoreLink: $('.store__more a'),
|
|
20
|
+
},
|
|
21
|
+
showStoreList() {
|
|
22
|
+
Wick.DefaultStoreProto.el.$searchStoreError.hide();
|
|
23
|
+
Wick.DefaultStoreProto.el.$storeUnavailableSection.hide();
|
|
24
|
+
Wick.DefaultStoreProto.el.$listOfStoreForm.show();
|
|
25
|
+
Wick.DefaultStoreProto.el.$searchStoreWrapInput.removeClass(Wick.DefaultStoreProto.el.searchStoreErrorClass);
|
|
26
|
+
|
|
27
|
+
if (Wick.DefaultStoreProto.el.$bigWins.css('display') === 'none') {
|
|
28
|
+
Wick.DefaultStoreProto.el.$bigWins.show();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (Wick.DefaultStoreProto.el.$bwActions.css('display') === 'none') {
|
|
32
|
+
Wick.DefaultStoreProto.el.$bwActions.show();
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
showErrorState() {
|
|
36
|
+
Wick.DefaultStoreProto.el.$searchStoreError.show();
|
|
37
|
+
Wick.DefaultStoreProto.el.$storeUnavailableSection.show();
|
|
38
|
+
Wick.DefaultStoreProto.el.$listOfStoreForm.hide();
|
|
39
|
+
Wick.DefaultStoreProto.el.$searchStoreWrapInput.addClass(Wick.DefaultStoreProto.el.searchStoreErrorClass);
|
|
40
|
+
},
|
|
41
|
+
showUnavailableState() {
|
|
42
|
+
Wick.DefaultStoreProto.el.$storeUnavailableSection.show();
|
|
43
|
+
Wick.DefaultStoreProto.el.$listOfStoreForm.hide();
|
|
44
|
+
|
|
45
|
+
Wick.DefaultStoreProto.el.$sDetails.filter(function () {
|
|
46
|
+
let isNotElementHide = !$(this).hasClass(Wick.DefaultStoreProto.el.sDetailsHide);
|
|
47
|
+
|
|
48
|
+
if (isNotElementHide) {
|
|
49
|
+
$(this)
|
|
50
|
+
.closest(Wick.DefaultStoreProto.el.$bigWins)
|
|
51
|
+
.find(Wick.DefaultStoreProto.el.$storeMoreLink)
|
|
52
|
+
.text('Store Info');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return isNotElementHide;
|
|
56
|
+
}).addClass(Wick.DefaultStoreProto.el.sDetailsHide);
|
|
57
|
+
},
|
|
58
|
+
clearSearchInput() {
|
|
59
|
+
$(Wick.DefaultStoreProto.el.searchStoreInput).val('');
|
|
60
|
+
Wick.DefaultStore.checkVisibilityOfClearButton();
|
|
61
|
+
},
|
|
62
|
+
toggleErrorStateForLocation() {
|
|
63
|
+
const iconIsVisible = $(Wick.DefaultStoreProto.el.iconLocation).is(':visible');
|
|
64
|
+
|
|
65
|
+
if (iconIsVisible) {
|
|
66
|
+
$(Wick.DefaultStoreProto.el.iconLocation).hide();
|
|
67
|
+
$(Wick.DefaultStoreProto.el.errorIconLocation).show();
|
|
68
|
+
} else {
|
|
69
|
+
$(Wick.DefaultStoreProto.el.iconLocation).show();
|
|
70
|
+
$(Wick.DefaultStoreProto.el.errorIconLocation).hide();
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
init() {
|
|
74
|
+
$(Wick.DefaultStoreProto.el.searchStoreForm).on('submit', (event) => {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
const value = Wick.DefaultStore.getPostCode();
|
|
77
|
+
if (value.length) {
|
|
78
|
+
Wick.DefaultStoreProto.showStoreList();
|
|
79
|
+
} else {
|
|
80
|
+
Wick.DefaultStoreProto.showErrorState();
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
$(Wick.DefaultStoreProto.el.btnCancel).on('click', (event) => {
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
Wick.DefaultStoreProto.clearSearchInput();
|
|
86
|
+
Wick.DefaultStoreProto.showUnavailableState();
|
|
87
|
+
})
|
|
88
|
+
$(Wick.DefaultStoreProto.el.btnLocation).on('click', (event) => {
|
|
89
|
+
event.preventDefault();
|
|
90
|
+
Wick.DefaultStoreProto.toggleErrorStateForLocation();
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
$(document).ready(function () {
|
|
96
|
+
Wick.DefaultStoreProto.init();
|
|
97
|
+
});
|
|
@@ -5,7 +5,7 @@ Wick.Forms = (function(){
|
|
|
5
5
|
fieldError = '.form-row__error',
|
|
6
6
|
formInvalid = 'form_invalid',
|
|
7
7
|
rowValidationError = 'form-row_validation-error',
|
|
8
|
-
excludedClassesForForm = ['header', 'quiz-modal__form'],
|
|
8
|
+
excludedClassesForForm = ['header', 'quiz-modal__form', 'search-store'],
|
|
9
9
|
// validationError = '<div class="form-row__error">Error message here</div>',
|
|
10
10
|
$forgotPassword = $('.link-forgot-password'),
|
|
11
11
|
scenarios = [{
|
package/src/js/emulation/mock.js
CHANGED
|
@@ -10,5 +10,15 @@ Wick.FEMock = {
|
|
|
10
10
|
"page": 2,
|
|
11
11
|
"html": '<div class="card product-card " data-product-code="177473"> <div id="product_item_code_177473" class="card__inner card__inner-v2"> <div class="products-list-v2__badges price__badges-v2 price__badges-v2-red price__badges-v2-text-white"> <div class="products-list-v2__badge">2 for £34</div> </div> <a href="/" class="card__img-wrap" title="Dulux"> <img loading="lazy" class="card__img-v2" src="//media.wickes.co.uk/is/image/wickes/GPID_1100360630_00?$normal$" alt="Dulux" title="Dulux"> </a> <div class="product-card__content"> <div class="product-card__header"> <a href="/" class="product-card__title product-card__title-v2" title="Dulux">Dulux Silk Emulsion Paint - 61</a> <div class="product-card__reviews product-card__reviews-v2"> <div class="product-rating product-rating-v2"> <div class="rating-bg"> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <div class="rating-overlay" data-rating="4.9"> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> </div> </div> (41) </div> </div></div> <div class=" product-card__price "> <div class="product-card__price__old-price product-card__price_empty"> </div> <div class="main-price"> <div class="main-price__value product-card__price-value "> £22</div> </div> <div class="product-card__price-sqm"> £8.80 per L</div> </div> <div class="energy-efficiency energy-efficiency--empty"> <div class="energy-efficiency__link"> </div> </div> </div> </div> </div> <div class="card product-card " data-product-code="116987"> <div id="product_item_code_116987" class="card__inner card__inner-v2"> <div class="products-list-v2__badges price__badges-v2 price__badges-v2-red price__badges-v2-text-white"> <div class="products-list-v2__badge">2 for £34</div> </div> <a href="/" class="card__img-wrap" title="Dulux"> <img loading="lazy" class="card__img-v2" src="//media.wickes.co.uk/is/image/wickes/I9026_116987_00?$normal$" alt="Dulux" title="Dulux"> </a> <div class="product-card__content"> <div class="product-card__header"> <a href="/" class="product-card__title product-card__title-v2" title="Dulux">Dulux Matt Emulsion Paint - 62</a> <div class="product-card__reviews product-card__reviews-v2"> <div class="product-rating product-rating-v2"> <div class="rating-bg"> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <div class="rating-overlay" data-rating="4.8"> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> </div> </div> (58) </div> </div></div> <div class=" product-card__price "> <div class="product-card__price__old-price product-card__price_empty"> </div> <div class="main-price"> <div class="main-price__value product-card__price-value "> £22</div> </div> <div class="product-card__price-sqm"> £8.80 per L</div> </div> <div class="energy-efficiency energy-efficiency--empty"> <div class="energy-efficiency__link"> </div> </div> </div> </div> </div> <div class="card product-card " data-product-code="122385"> <div id="product_item_code_122385" class="card__inner card__inner-v2"> <a href="/" class="card__img-wrap" title="Wickes"> <img loading="lazy" class="card__img-v2" src="//media.wickes.co.uk/is/image/wickes/O0814_122385_00?$normal$" alt="Wickes" title="Wickes"> </a> <div class="product-card__content"> <div class="product-card__header"> <a href="/" class="product-card__title product-card__title-v2" title="Wickes">Wickes Vinyl Silk Emulsion Paint - 63</a> <div class="product-card__reviews product-card__reviews-v2"> <div class="product-rating product-rating-v2"> <div class="rating-bg"> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <div class="rating-overlay" data-rating="4.8"> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> </div> </div> (74) </div> </div></div> <div class=" product-card__price "> <div class="product-card__price__old-price product-card__price_empty"> </div> <div class="main-price"> <div class="main-price__value product-card__price-value "> £15</div> </div> <div class="product-card__price-sqm"> £6 per L</div> </div> <div class="energy-efficiency energy-efficiency--empty"> <div class="energy-efficiency__link"> </div> </div> </div> </div> </div> <div class="card product-card " data-product-code="122195"> <div id="product_item_code_122195" class="card__inner card__inner-v2"> <a href="/" class="card__img-wrap" title="Wickes"> <img loading="lazy" class="card__img-v2" src="//media.wickes.co.uk/is/image/wickes/O0814_122195_00?$normal$" alt="Wickes" title="Wickes"> </a> <div class="product-card__content"> <div class="product-card__header"> <a href="/" class="product-card__title product-card__title-v2" title="Wickes">Wickes Vinyl Matt Emulsion Paint - 64</a> <div class="product-card__reviews product-card__reviews-v2"> <div class="product-rating product-rating-v2"> <div class="rating-bg"> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <div class="rating-overlay" data-rating="4.7"> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> </div> </div> (88) </div> </div></div> <div class=" product-card__price "> <div class="product-card__price__old-price product-card__price_empty"> </div> <div class="main-price"> <div class="main-price__value product-card__price-value "> £15</div> </div> <div class="product-card__price-sqm"> £6 per L</div> </div> <div class="energy-efficiency energy-efficiency--empty"> <div class="energy-efficiency__link"> </div> </div> </div> </div> </div> <div class="card product-card " data-product-code="122300"> <div id="product_item_code_122300" class="card__inner card__inner-v2"> <a href="/" class="card__img-wrap" title="Wickes"> <img loading="lazy" class="card__img-v2" src="//media.wickes.co.uk/is/image/wickes/O0814_122300_00?$normal$" alt="Wickes" title="Wickes"> </a> <div class="product-card__content"> <div class="product-card__header"> <a href="/" class="product-card__title product-card__title-v2" title="Wickes">Wickes Vinyl Matt Emulsion Paint - 65</a> <div class="product-card__reviews product-card__reviews-v2"> <div class="product-rating product-rating-v2"> <div class="rating-bg"> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <i class="fa fa-star star-in" aria-hidden="true"></i> <div class="rating-overlay" data-rating="4.8"> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> <span class="star-overlay"> <i class="fa fa-star" aria-hidden="true"></i> </span> </div> </div> (61) </div> </div></div> <div class=" product-card__price "> <div class="product-card__price__old-price product-card__price_empty"> </div> <div class="main-price"> <div class="main-price__value product-card__price-value "> £15</div> </div> <div class="product-card__price-sqm"> £6 per L</div> </div> <div class="energy-efficiency energy-efficiency--empty"> <div class="energy-efficiency__link"> </div> </div> </div> </div> </div>'
|
|
12
12
|
}
|
|
13
|
+
],
|
|
14
|
+
orders: [
|
|
15
|
+
{
|
|
16
|
+
"page": 1,
|
|
17
|
+
"html": '<article class="active-orders__item"><header class="order-header"><h3 class="order-header__title">Order 940564000</h3><div class="order-status completed"><svg class="svg-inline--fa fa-check-circle fa-w-16 icon" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="check-circle" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg><span>Complete</span></div></header><section class="order-details"><div class="order-details__summary"><span class="order-details__price">£92.75</span> <span class="order-details__count">7 item(s)</span></div><time class="order-details__date" datetime="21st November 2024 4:32 PM">21st November 2024 4:32 PM</time></section><div class="view-more"><a class="link" href="/"><span>View More</span> <svg class="svg-inline--fa fa-arrow-right fa-w-14 icon" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"></path></svg></a></div></article><article class="active-orders__item"><header class="order-header"><h3 class="order-header__title">Order 940520023</h3><div class="order-status cancelled"><svg class="svg-inline--fa fa-times fa-w-10 icon" aria-hidden="true" focusable="false" data-prefix="far" data-icon="times" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" data-fa-i2svg=""><path fill="currentColor" d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"></path></svg><span>Cancelled</span></div></header><section class="order-details"><div class="order-details__summary"><span class="order-details__price">£32.00</span> <span class="order-details__count">1 item(s)</span></div><time class="order-details__date" datetime="28th October 2024 7:29 AM">28th October 2024 7:29 AM</time></section><div class="view-more"><a class="link" href="/"><span>View More</span> <svg class="svg-inline--fa fa-arrow-right fa-w-14 icon" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"></path></svg></a></div></article>'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"page": 2,
|
|
21
|
+
"html": '<article class="active-orders__item"><header class="order-header"><h3 class="order-header__title">Order 940564001</h3><div class="order-status completed"><svg class="svg-inline--fa fa-check-circle fa-w-16 icon" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="check-circle" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg=""><path fill="currentColor" d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"></path></svg><span>Complete</span></div></header><section class="order-details"><div class="order-details__summary"><span class="order-details__price">£92.75</span> <span class="order-details__count">7 item(s)</span></div><time class="order-details__date" datetime="21st November 2024 4:32 PM">21st November 2024 4:32 PM</time></section><div class="view-more"><a class="link" href="/"><span>View More</span> <svg class="svg-inline--fa fa-arrow-right fa-w-14 icon" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"></path></svg></a></div></article><article class="active-orders__item"><header class="order-header"><h3 class="order-header__title">Order 940520002</h3><div class="order-status cancelled"><svg class="svg-inline--fa fa-times fa-w-10 icon" aria-hidden="true" focusable="false" data-prefix="far" data-icon="times" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" data-fa-i2svg=""><path fill="currentColor" d="M207.6 256l107.72-107.72c6.23-6.23 6.23-16.34 0-22.58l-25.03-25.03c-6.23-6.23-16.34-6.23-22.58 0L160 208.4 52.28 100.68c-6.23-6.23-16.34-6.23-22.58 0L4.68 125.7c-6.23 6.23-6.23 16.34 0 22.58L112.4 256 4.68 363.72c-6.23 6.23-6.23 16.34 0 22.58l25.03 25.03c6.23 6.23 16.34 6.23 22.58 0L160 303.6l107.72 107.72c6.23 6.23 16.34 6.23 22.58 0l25.03-25.03c6.23-6.23 6.23-16.34 0-22.58L207.6 256z"></path></svg><span>Cancelled</span></div></header><section class="order-details"><div class="order-details__summary"><span class="order-details__price">£32.00</span> <span class="order-details__count">1 item(s)</span></div><time class="order-details__date" datetime="28th October 2024 7:29 AM">28th October 2024 7:29 AM</time></section><div class="view-more"><a class="link" href="/"><span>View More</span> <svg class="svg-inline--fa fa-arrow-right fa-w-14 icon" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="arrow-right" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z"></path></svg></a></div></article>'
|
|
22
|
+
}
|
|
13
23
|
]
|
|
14
24
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
function getOrdersHtmlByCurrentPage({currentPage}) {
|
|
2
|
+
const matchingData = Wick.FEMock.orders.find(item => item.page === currentPage);
|
|
3
|
+
return matchingData.html;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
function initMyOrdersEvent() {
|
|
7
|
+
if (!Wick?.MyOrders?.events) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
$(window).on(Wick.MyOrders.events.MONTHLY_VIEW_EVENT, function ({ detail: { resolve, reject, payload } }) {
|
|
12
|
+
setTimeout(() => {
|
|
13
|
+
return resolve({});
|
|
14
|
+
}, 500);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
$(window).on(Wick.MyOrders.events.SORT_BY_EVENT, function ({ detail: { resolve, reject, payload } }) {
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
return resolve({url: '/sitemap.html'});
|
|
20
|
+
}, 500);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
$(window).on(Wick.MyOrders.events.CATEGORY_EVENT, function ({ detail: { resolve, reject, payload } }) {
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
return resolve({url: '/sitemap.html'});
|
|
26
|
+
}, 500);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
$(window).on(Wick.MyOrders.events.LOAD_MORE_EVENT, function ({ detail: { resolve, reject, payload } }) {
|
|
30
|
+
setTimeout(() => {
|
|
31
|
+
resolve({
|
|
32
|
+
innerHTML: getOrdersHtmlByCurrentPage(payload),
|
|
33
|
+
callback: () => {}
|
|
34
|
+
});
|
|
35
|
+
}, 1500);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
$(document).ready(function () {
|
|
40
|
+
initMyOrdersEvent();
|
|
41
|
+
});
|
package/src/js/page/basket-v2.js
CHANGED
|
@@ -739,6 +739,7 @@ Wick.BasketPage = {
|
|
|
739
739
|
|
|
740
740
|
Wick.BasketPage.paintActionButton();
|
|
741
741
|
checkPayPalAvailability(data);
|
|
742
|
+
Wick.VatToggle.reapplyDisplayClass();
|
|
742
743
|
$(document).trigger("cartRerender");
|
|
743
744
|
},
|
|
744
745
|
createBasketSection: function (type, group, data) {
|
|
@@ -848,11 +849,11 @@ Wick.BasketPage = {
|
|
|
848
849
|
? '<span class="order-item__value">FREE</span>'
|
|
849
850
|
: Wick.VatToggle.isToggleVatAvailable()
|
|
850
851
|
? `
|
|
851
|
-
<div class="including-vat
|
|
852
|
+
<div class="including-vat"><!--
|
|
852
853
|
--><span class="order-item__value">${currentItem.basePrice.formattedValue}</span><!--
|
|
853
854
|
--><div class="price-vat">Inc.VAT</div>
|
|
854
855
|
</div>
|
|
855
|
-
<div class="excluding-vat
|
|
856
|
+
<div class="excluding-vat"><!--
|
|
856
857
|
--><span class="order-item__value">${currentItem.basePriceExcVat.formattedValue}</span><!--
|
|
857
858
|
--><div class="price-vat">Exc.VAT</div>
|
|
858
859
|
</div>
|
|
@@ -870,11 +871,11 @@ Wick.BasketPage = {
|
|
|
870
871
|
? '<span class="order-item__value">FREE</span>'
|
|
871
872
|
: Wick.VatToggle.isToggleVatAvailable()
|
|
872
873
|
? `
|
|
873
|
-
<div class="including-vat
|
|
874
|
+
<div class="including-vat"><!--
|
|
874
875
|
--><span class="order-item__value">${currentItem.itemTotalWithoutDiscount.formattedValue}</span><!--
|
|
875
876
|
--><div class="price-vat">Inc.VAT</div><!--
|
|
876
877
|
--></div>
|
|
877
|
-
<div class="excluding-vat
|
|
878
|
+
<div class="excluding-vat"><!--
|
|
878
879
|
--><span class="order-item__value">${currentItem.itemTotalWithoutDiscountExcVat.formattedValue}</span><!--
|
|
879
880
|
--><div class="price-vat">Exc.VAT</div>
|
|
880
881
|
</div>
|
|
@@ -999,11 +1000,11 @@ Wick.BasketPage = {
|
|
|
999
1000
|
${
|
|
1000
1001
|
Wick.VatToggle.isToggleVatAvailable()
|
|
1001
1002
|
? `
|
|
1002
|
-
<div class="including-vat
|
|
1003
|
+
<div class="including-vat"><!--
|
|
1003
1004
|
--><span class="order-item__value">£${item.product.pricePerSqm.formattedPriceWithoutCurrencySymbol}</span><!--
|
|
1004
1005
|
--><div class="price-vat">Inc.VAT</div>
|
|
1005
1006
|
</div>
|
|
1006
|
-
<div class="excluding-vat
|
|
1007
|
+
<div class="excluding-vat"><!--
|
|
1007
1008
|
--><span class="order-item__value">£${item.product.pricePerSqmExcVat.formattedPriceWithoutCurrencySymbol}</span><!--
|
|
1008
1009
|
--><div class="price-vat">Exc.VAT</div>
|
|
1009
1010
|
</div>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var Wick = window.Wick || {};
|
|
2
|
+
|
|
3
|
+
Wick.DefaultStore = {
|
|
4
|
+
HIDDEN_CLASS_NAME: 'd-none',
|
|
5
|
+
el: {
|
|
6
|
+
searchForm: '.search-store',
|
|
7
|
+
$searchInput: $('.search-store #postcode'),
|
|
8
|
+
$btnClear: $('.search-store .btn--clear'),
|
|
9
|
+
$btnSubmit: $('.search-store .btn-search'),
|
|
10
|
+
},
|
|
11
|
+
getPostCode () {
|
|
12
|
+
return Wick.DefaultStore.el.$searchInput.val();
|
|
13
|
+
},
|
|
14
|
+
checkVisibilityOfClearButton () {
|
|
15
|
+
Wick.DefaultStore.el.$btnClear.toggleClass('d-block', Wick.DefaultStore.getPostCode().length > 0);
|
|
16
|
+
},
|
|
17
|
+
updateCollapseState() {
|
|
18
|
+
const dropdowns = $("#openingTimes, #specialTimes, #facilities");
|
|
19
|
+
const btn = $('[data-toggle="collapse"]');
|
|
20
|
+
|
|
21
|
+
if ($(window).width() >= 768) {
|
|
22
|
+
dropdowns.addClass("show");
|
|
23
|
+
if (btn.length) {
|
|
24
|
+
btn.attr("aria-expanded", "true");
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
dropdowns.removeClass("show");
|
|
28
|
+
if (btn.length) {
|
|
29
|
+
btn.attr("aria-expanded", "false");
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
init () {
|
|
34
|
+
Wick.DefaultStore.updateCollapseState();
|
|
35
|
+
$(window).resize( _.debounce(function () {
|
|
36
|
+
Wick.DefaultStore.updateCollapseState();
|
|
37
|
+
}, 200));
|
|
38
|
+
Wick.DefaultStore.el.$searchInput.on('input', Wick.DefaultStore.checkVisibilityOfClearButton);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
$(document).ready(function () {
|
|
43
|
+
Wick.DefaultStore.init();
|
|
44
|
+
});
|