simpo-component-library 3.6.661 → 3.6.663
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/esm2022/lib/ecommerce/sections/authentication-required/authentication-required.component.mjs +3 -3
- package/esm2022/lib/ecommerce/sections/cart/cart.component.mjs +97 -98
- package/esm2022/lib/ecommerce/sections/user-profile/user-profile.component.mjs +2 -1
- package/fesm2022/simpo-component-library.mjs +99 -99
- package/fesm2022/simpo-component-library.mjs.map +1 -1
- package/package.json +1 -1
- package/simpo-component-library-3.6.663.tgz +0 -0
- package/simpo-component-library-3.6.661.tgz +0 -0
|
@@ -9097,103 +9097,102 @@ class CartComponent extends BaseSection {
|
|
|
9097
9097
|
}
|
|
9098
9098
|
}
|
|
9099
9099
|
async proceedToPayment() {
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
const
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
const
|
|
9112
|
-
|
|
9113
|
-
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
}
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
const
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9155
|
-
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
}
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
9170
|
-
|
|
9171
|
-
|
|
9172
|
-
|
|
9173
|
-
|
|
9174
|
-
|
|
9175
|
-
|
|
9176
|
-
|
|
9177
|
-
|
|
9178
|
-
|
|
9179
|
-
|
|
9180
|
-
|
|
9181
|
-
|
|
9182
|
-
|
|
9183
|
-
|
|
9184
|
-
|
|
9185
|
-
|
|
9186
|
-
|
|
9187
|
-
|
|
9188
|
-
|
|
9189
|
-
|
|
9190
|
-
|
|
9191
|
-
|
|
9192
|
-
|
|
9193
|
-
|
|
9194
|
-
|
|
9195
|
-
|
|
9196
|
-
});
|
|
9100
|
+
console.log("getting referraldetails", this.storageService.getReferralDetails(), JSON.parse(this.storageService.getReferralDetails() ?? "{}"), decodeURIComponent(this.storageService.getReferralDetails() ?? "{}"));
|
|
9101
|
+
// if (!this.storageService.getUser()) {
|
|
9102
|
+
// this.messageService.add({ severity: 'info', summary: 'Login', detail: 'Please login with mobile number to order' });
|
|
9103
|
+
// return;
|
|
9104
|
+
// }
|
|
9105
|
+
// const isPaymentGatewayEnabled = localStorage.getItem("isPaymentGatewayEnabled") ? localStorage.getItem("isPaymentGatewayEnabled") == "true" : true;
|
|
9106
|
+
// const merchantId = localStorage.getItem('pMId') == "null" || localStorage.getItem('pMId') == "undefined" ? null : localStorage.getItem('pMId');
|
|
9107
|
+
// if (isPaymentGatewayEnabled && !merchantId) {
|
|
9108
|
+
// this.messageService.add({ severity: 'error', summary: 'Merchant onboarded', detail: 'Merchant is not onboarded' });
|
|
9109
|
+
// return;
|
|
9110
|
+
// }
|
|
9111
|
+
// const userDetail = this.storageService.getUser() as User;
|
|
9112
|
+
// const address = userDetail?.addressDetailsList[this.selectedAddressIdx] as Address;
|
|
9113
|
+
// if (address?.receiverName?.length == 0) {
|
|
9114
|
+
// this.messageService.add({ severity: 'error', summary: 'Payment Failure', detail: 'Please provide address details' });
|
|
9115
|
+
// return;
|
|
9116
|
+
// }
|
|
9117
|
+
// if (!(localStorage.getItem("cartId") == "undefined" || localStorage.getItem("cartId") == "null"))
|
|
9118
|
+
// this.cartInfo["cartId"] = localStorage.getItem("cartId");
|
|
9119
|
+
// else {
|
|
9120
|
+
// this.messageService.add({ severity: 'info', summary: 'Please wait', detail: 'We are processing your payment', life: 2000 });
|
|
9121
|
+
// await this.restService.addItemToDB(this.cartInfo).toPromise().then((response: any) => {
|
|
9122
|
+
// localStorage.setItem("cartId", response.data?.cartId);
|
|
9123
|
+
// this.cartInfo["cartId"] = response.data?.cartId;
|
|
9124
|
+
// })
|
|
9125
|
+
// }
|
|
9126
|
+
// this.cartInfo["addressDetails"] = address;
|
|
9127
|
+
// const updateAddress = await this.restService.addItemToDB(this.cartInfo).toPromise();
|
|
9128
|
+
// const payload = {
|
|
9129
|
+
// "userId": userDetail.userId,
|
|
9130
|
+
// "cartId": localStorage.getItem('cartId'),
|
|
9131
|
+
// "orderAmount": Number(Number(((this.responseData?.totalAmount ?? 0))).toFixed(2)),
|
|
9132
|
+
// "isPaymentGatewayEnabled": isPaymentGatewayEnabled,
|
|
9133
|
+
// "contactDetails": {
|
|
9134
|
+
// "name": address.receiverName,
|
|
9135
|
+
// "mobile": address.receiverPhone,
|
|
9136
|
+
// "countryCode": "91",
|
|
9137
|
+
// "email": address.receiverEmail
|
|
9138
|
+
// },
|
|
9139
|
+
// "paymentMerchantId": merchantId,
|
|
9140
|
+
// "isJewellery": this.isJewellery
|
|
9141
|
+
// }
|
|
9142
|
+
// this.restService.createPaymentToken(payload).subscribe((paymentDetails: any) => {
|
|
9143
|
+
// if (isPaymentGatewayEnabled)
|
|
9144
|
+
// this._eventService.cashFreeEvent.emit(paymentDetails);
|
|
9145
|
+
// else {
|
|
9146
|
+
// localStorage.removeItem("orderId");
|
|
9147
|
+
// localStorage.removeItem("cartId");
|
|
9148
|
+
// localStorage.removeItem("paymentFor");
|
|
9149
|
+
// this.storageService.clearUserCart();
|
|
9150
|
+
// Swal.fire({
|
|
9151
|
+
// icon: "success",
|
|
9152
|
+
// title: "Hurray",
|
|
9153
|
+
// text: "Order placed successfully",
|
|
9154
|
+
// confirmButtonText: "See Details"
|
|
9155
|
+
// }).then((response) => {
|
|
9156
|
+
// if (response.isConfirmed) {
|
|
9157
|
+
// this.router.navigate(['/profile']);
|
|
9158
|
+
// }
|
|
9159
|
+
// })
|
|
9160
|
+
// }
|
|
9161
|
+
// }, (error) => {
|
|
9162
|
+
// if (error.errorCode == 1001 || error.errorCode == 1002) {
|
|
9163
|
+
// Swal.fire({
|
|
9164
|
+
// icon: "info",
|
|
9165
|
+
// html: "<p>" + error.message.replace(/ *\([^)]*\) */g, "") + "</p>",
|
|
9166
|
+
// showCancelButton: error.errorCode == 1002,
|
|
9167
|
+
// confirmButtonText: "Remove item & Place Order",
|
|
9168
|
+
// cancelButtonText: "Reduce quantity",
|
|
9169
|
+
// cancelButtonColor: "#928c8c",
|
|
9170
|
+
// }).then(async (response) => {
|
|
9171
|
+
// this.messageService.add({ severity: 'info', summary: 'Processing', detail: 'Please wait, updaing your cart', life: 2000 });
|
|
9172
|
+
// const regExp = /{([^}]+)}/g;
|
|
9173
|
+
// const id = regExp.exec(error.message)?.[1];
|
|
9174
|
+
// let itemDetail: Product | null = null;
|
|
9175
|
+
// const productDetailsAsync = await this.restService.getProductDetails(id).toPromise().then((response) => {
|
|
9176
|
+
// itemDetail = response[0] as Product;
|
|
9177
|
+
// })
|
|
9178
|
+
// if (response.isDismissed) {
|
|
9179
|
+
// this.cartInfo.orderedItems.forEach((item: OrderedItems) => {
|
|
9180
|
+
// if (item.itemId == itemDetail?.itemId)
|
|
9181
|
+
// item.quantity = itemDetail?.itemInventory.openingStock;
|
|
9182
|
+
// })
|
|
9183
|
+
// const addItemDBAsync = await this.restService.addItemToDB(this.cartInfo).toPromise();
|
|
9184
|
+
// const addItemIndexDBAsync = await this.storageService.addAllProductsToCart(this.cartInfo.orderedItems);
|
|
9185
|
+
// } else if (response.isConfirmed) {
|
|
9186
|
+
// this.cartInfo.orderedItems = this.cartInfo.orderedItems.filter((item: OrderedItems) => item.itemId != itemDetail?.itemId);
|
|
9187
|
+
// const addItemDBAsync = await this.restService.addItemToDB(this.cartInfo).toPromise();
|
|
9188
|
+
// const addItemIndexDBAsync = await this.storageService.addAllProductsToCart(this.cartInfo.orderedItems);
|
|
9189
|
+
// this.proceedToPayment();
|
|
9190
|
+
// }
|
|
9191
|
+
// })
|
|
9192
|
+
// } else {
|
|
9193
|
+
// this.messageService.add({ severity: 'error', summary: 'Payment Failure', detail: 'Please try again' });
|
|
9194
|
+
// }
|
|
9195
|
+
// })
|
|
9197
9196
|
}
|
|
9198
9197
|
addressSelected(index) {
|
|
9199
9198
|
this.selectedAddressIdx = index;
|
|
@@ -9677,8 +9676,8 @@ class AuthenticationRequiredComponent extends BaseSection {
|
|
|
9677
9676
|
}
|
|
9678
9677
|
endUserRefferalDetails(userId, referralUniqueId) {
|
|
9679
9678
|
this.restService.endUserRefferalDetails(userId, referralUniqueId).subscribe((response) => {
|
|
9680
|
-
console.log("response", response.data);
|
|
9681
|
-
this.storageService.setReferralDetails(response.data);
|
|
9679
|
+
console.log("response", response.data.referralDetails);
|
|
9680
|
+
this.storageService.setReferralDetails(response.data.referralDetails);
|
|
9682
9681
|
}, (error) => {
|
|
9683
9682
|
// console.log("error", error)
|
|
9684
9683
|
this.messageService.add({ severity: 'error', summary: 'Login request', detail: error?.error?.message });
|
|
@@ -21456,6 +21455,7 @@ class UserProfileComponent extends BaseSection {
|
|
|
21456
21455
|
}).then((response) => {
|
|
21457
21456
|
if (response.isConfirmed) {
|
|
21458
21457
|
this.cookieService.delete("user");
|
|
21458
|
+
this.cookieService.delete("referralDetails");
|
|
21459
21459
|
sessionStorage.clear();
|
|
21460
21460
|
localStorage.removeItem("perId");
|
|
21461
21461
|
localStorage.removeItem('cartId');
|