@anker-in/campaign-ui 0.4.0-beta.9 → 0.4.1

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.
Files changed (61) hide show
  1. package/dist/cjs/components/index.d.ts +2 -2
  2. package/dist/cjs/components/index.js +1 -1
  3. package/dist/cjs/components/index.js.map +2 -2
  4. package/dist/esm/components/index.d.ts +2 -2
  5. package/dist/esm/components/index.js +1 -1
  6. package/dist/esm/components/index.js.map +2 -2
  7. package/package.json +1 -2
  8. package/src/components/index.ts +2 -2
  9. package/dist/cjs/components/credits/modal/MyRewardsModal.d.ts +0 -32
  10. package/dist/cjs/components/credits/modal/MyRewardsModal.js +0 -2
  11. package/dist/cjs/components/credits/modal/MyRewardsModal.js.map +0 -7
  12. package/dist/esm/components/credits/modal/MyRewardsModal.d.ts +0 -32
  13. package/dist/esm/components/credits/modal/MyRewardsModal.js +0 -2
  14. package/dist/esm/components/credits/modal/MyRewardsModal.js.map +0 -7
  15. package/dist/index.js +0 -22333
  16. package/dist/index.js.map +0 -1
  17. package/dist/index.mjs +0 -22318
  18. package/dist/index.mjs.map +0 -1
  19. package/src/stories/CartCard.stories.tsx +0 -459
  20. /package/dist/cjs/components/credits/modal/{activitiesModal.d.ts → ActivitiesModal.d.ts} +0 -0
  21. /package/dist/cjs/components/credits/modal/{activitiesModal.js → ActivitiesModal.js} +0 -0
  22. /package/dist/cjs/components/credits/modal/{activitiesModal.js.map → ActivitiesModal.js.map} +0 -0
  23. /package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.d.ts → CreditsUploadReceiptModal.d.ts} +0 -0
  24. /package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.js → CreditsUploadReceiptModal.js} +0 -0
  25. /package/dist/cjs/components/credits/modal/{creditsUploadReceiptModal.js.map → CreditsUploadReceiptModal.js.map} +0 -0
  26. /package/dist/cjs/components/credits/modal/{loadingDots.d.ts → LoadingDots.d.ts} +0 -0
  27. /package/dist/cjs/components/credits/modal/{loadingDots.js → LoadingDots.js} +0 -0
  28. /package/dist/cjs/components/credits/modal/{loadingDots.js.map → LoadingDots.js.map} +0 -0
  29. /package/dist/cjs/components/credits/modal/{modalContainer.d.ts → ModalContainer.d.ts} +0 -0
  30. /package/dist/cjs/components/credits/modal/{modalContainer.js → ModalContainer.js} +0 -0
  31. /package/dist/cjs/components/credits/modal/{modalContainer.js.map → ModalContainer.js.map} +0 -0
  32. /package/dist/cjs/components/credits/modal/{rulesModal.d.ts → RulesModal.d.ts} +0 -0
  33. /package/dist/cjs/components/credits/modal/{rulesModal.js → RulesModal.js} +0 -0
  34. /package/dist/cjs/components/credits/modal/{rulesModal.js.map → RulesModal.js.map} +0 -0
  35. /package/dist/cjs/components/credits/modal/{subscribeModal.d.ts → SubscribeModal.d.ts} +0 -0
  36. /package/dist/cjs/components/credits/modal/{subscribeModal.js → SubscribeModal.js} +0 -0
  37. /package/dist/cjs/components/credits/modal/{subscribeModal.js.map → SubscribeModal.js.map} +0 -0
  38. /package/dist/cjs/components/credits/modal/{tip.d.ts → Tip.d.ts} +0 -0
  39. /package/dist/cjs/components/credits/modal/{tip.js → Tip.js} +0 -0
  40. /package/dist/cjs/components/credits/modal/{tip.js.map → Tip.js.map} +0 -0
  41. /package/dist/esm/components/credits/modal/{activitiesModal.d.ts → ActivitiesModal.d.ts} +0 -0
  42. /package/dist/esm/components/credits/modal/{activitiesModal.js → ActivitiesModal.js} +0 -0
  43. /package/dist/esm/components/credits/modal/{activitiesModal.js.map → ActivitiesModal.js.map} +0 -0
  44. /package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.d.ts → CreditsUploadReceiptModal.d.ts} +0 -0
  45. /package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.js → CreditsUploadReceiptModal.js} +0 -0
  46. /package/dist/esm/components/credits/modal/{creditsUploadReceiptModal.js.map → CreditsUploadReceiptModal.js.map} +0 -0
  47. /package/dist/esm/components/credits/modal/{loadingDots.d.ts → LoadingDots.d.ts} +0 -0
  48. /package/dist/esm/components/credits/modal/{loadingDots.js → LoadingDots.js} +0 -0
  49. /package/dist/esm/components/credits/modal/{loadingDots.js.map → LoadingDots.js.map} +0 -0
  50. /package/dist/esm/components/credits/modal/{modalContainer.d.ts → ModalContainer.d.ts} +0 -0
  51. /package/dist/esm/components/credits/modal/{modalContainer.js → ModalContainer.js} +0 -0
  52. /package/dist/esm/components/credits/modal/{modalContainer.js.map → ModalContainer.js.map} +0 -0
  53. /package/dist/esm/components/credits/modal/{rulesModal.d.ts → RulesModal.d.ts} +0 -0
  54. /package/dist/esm/components/credits/modal/{rulesModal.js → RulesModal.js} +0 -0
  55. /package/dist/esm/components/credits/modal/{rulesModal.js.map → RulesModal.js.map} +0 -0
  56. /package/dist/esm/components/credits/modal/{subscribeModal.d.ts → SubscribeModal.d.ts} +0 -0
  57. /package/dist/esm/components/credits/modal/{subscribeModal.js → SubscribeModal.js} +0 -0
  58. /package/dist/esm/components/credits/modal/{subscribeModal.js.map → SubscribeModal.js.map} +0 -0
  59. /package/dist/esm/components/credits/modal/{tip.d.ts → Tip.d.ts} +0 -0
  60. /package/dist/esm/components/credits/modal/{tip.js → Tip.js} +0 -0
  61. /package/dist/esm/components/credits/modal/{tip.js.map → Tip.js.map} +0 -0
@@ -1,5 +1,5 @@
1
- export { default as Chat } from './chat/index.js';
2
- export { Role, ActionExecutionMessage, TextMessage, useCopilotChat, useCopilotAction, useCopilotReadable, } from './chat/utils.js';
1
+ export { default as Chat } from './chat/index';
2
+ export { Role, ActionExecutionMessage, TextMessage, useCopilotChat, useCopilotAction, useCopilotReadable, } from './chat/utils';
3
3
  export * from './credits/index.js';
4
4
  export * from './registration/index.js';
5
5
  export { LiveChatWidget } from './LiveChatWidget/index.js';
@@ -1,2 +1,2 @@
1
- "use strict";var l=Object.create;var C=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var s in t)C(e,s,{get:t[s],enumerable:!0})},i=(e,t,s,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of x(t))!c.call(e,r)&&r!==s&&C(e,r,{get:()=>t[r],enumerable:!(p=u(t,r))||p.enumerable});return e},a=(e,t,s)=>(i(e,t,"default"),s&&i(s,t,"default")),h=(e,t,s)=>(s=e!=null?l(M(e)):{},i(t||!e||!e.__esModule?C(s,"default",{value:e,enumerable:!0}):s,e)),m=e=>i(C({},"__esModule",{value:!0}),e);var n={};f(n,{ActionExecutionMessage:()=>o.ActionExecutionMessage,Chat:()=>g.default,LiveChatWidget:()=>d.LiveChatWidget,Role:()=>o.Role,TextMessage:()=>o.TextMessage,useCopilotAction:()=>o.useCopilotAction,useCopilotChat:()=>o.useCopilotChat,useCopilotReadable:()=>o.useCopilotReadable});module.exports=m(n);var g=h(require("./chat/index.js")),o=require("./chat/utils.js");a(n,require("./credits/index.js"),module.exports);a(n,require("./registration/index.js"),module.exports);var d=require("./LiveChatWidget/index.js");
1
+ "use strict";var l=Object.create;var C=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var f=(e,t)=>{for(var s in t)C(e,s,{get:t[s],enumerable:!0})},i=(e,t,s,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of x(t))!c.call(e,r)&&r!==s&&C(e,r,{get:()=>t[r],enumerable:!(p=u(t,r))||p.enumerable});return e},a=(e,t,s)=>(i(e,t,"default"),s&&i(s,t,"default")),h=(e,t,s)=>(s=e!=null?l(M(e)):{},i(t||!e||!e.__esModule?C(s,"default",{value:e,enumerable:!0}):s,e)),m=e=>i(C({},"__esModule",{value:!0}),e);var n={};f(n,{ActionExecutionMessage:()=>o.ActionExecutionMessage,Chat:()=>g.default,LiveChatWidget:()=>d.LiveChatWidget,Role:()=>o.Role,TextMessage:()=>o.TextMessage,useCopilotAction:()=>o.useCopilotAction,useCopilotChat:()=>o.useCopilotChat,useCopilotReadable:()=>o.useCopilotReadable});module.exports=m(n);var g=h(require("./chat/index")),o=require("./chat/utils");a(n,require("./credits/index.js"),module.exports);a(n,require("./registration/index.js"),module.exports);var d=require("./LiveChatWidget/index.js");
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/index.ts"],
4
- "sourcesContent": ["export { default as Chat } from './chat/index.js'\n\nexport {\n Role,\n ActionExecutionMessage,\n TextMessage,\n useCopilotChat,\n useCopilotAction,\n useCopilotReadable,\n} from './chat/utils.js'\n\nexport * from './credits/index.js'\n\nexport * from './registration/index.js'\n\n\n\n// LiveChatWidget \u5BFC\u51FA\nexport { LiveChatWidget } from './LiveChatWidget/index.js'\nexport type {\n LiveChatWidgetProps,\n Message,\n MessageContent,\n MessageRole,\n MessageContentType,\n MessageMetadata,\n MessageRenderer,\n QuickReply,\n ProductCardContent,\n ProductListContent,\n PolicyContent,\n QuickRepliesContent,\n ThinkingContent,\n ErrorContent,\n SSEEvent,\n ChatStreamRequest,\n} from './LiveChatWidget/index.js'\n"],
5
- "mappings": "wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mSAAAE,EAAAF,GAAA,IAAAG,EAAgC,8BAEhCC,EAOO,2BAEPC,EAAAL,EAAc,8BAXd,gBAaAK,EAAAL,EAAc,mCAbd,gBAkBA,IAAAM,EAA+B",
4
+ "sourcesContent": ["export { default as Chat } from './chat/index'\n\nexport {\n Role,\n ActionExecutionMessage,\n TextMessage,\n useCopilotChat,\n useCopilotAction,\n useCopilotReadable,\n} from './chat/utils'\n\nexport * from './credits/index.js'\n\nexport * from './registration/index.js'\n\n\n\n// LiveChatWidget \u5BFC\u51FA\nexport { LiveChatWidget } from './LiveChatWidget/index.js'\nexport type {\n LiveChatWidgetProps,\n Message,\n MessageContent,\n MessageRole,\n MessageContentType,\n MessageMetadata,\n MessageRenderer,\n QuickReply,\n ProductCardContent,\n ProductListContent,\n PolicyContent,\n QuickRepliesContent,\n ThinkingContent,\n ErrorContent,\n SSEEvent,\n ChatStreamRequest,\n} from './LiveChatWidget/index.js'\n"],
5
+ "mappings": "wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mSAAAE,EAAAF,GAAA,IAAAG,EAAgC,2BAEhCC,EAOO,wBAEPC,EAAAL,EAAc,8BAXd,gBAaAK,EAAAL,EAAc,mCAbd,gBAkBA,IAAAM,EAA+B",
6
6
  "names": ["components_exports", "__export", "__toCommonJS", "import_chat", "import_utils", "__reExport", "import_LiveChatWidget"]
7
7
  }
@@ -1,5 +1,5 @@
1
- export { default as Chat } from './chat/index.js';
2
- export { Role, ActionExecutionMessage, TextMessage, useCopilotChat, useCopilotAction, useCopilotReadable, } from './chat/utils.js';
1
+ export { default as Chat } from './chat/index';
2
+ export { Role, ActionExecutionMessage, TextMessage, useCopilotChat, useCopilotAction, useCopilotReadable, } from './chat/utils';
3
3
  export * from './credits/index.js';
4
4
  export * from './registration/index.js';
5
5
  export { LiveChatWidget } from './LiveChatWidget/index.js';
@@ -1,2 +1,2 @@
1
- import{default as o}from"./chat/index.js";import{Role as n,ActionExecutionMessage as a,TextMessage as r,useCopilotChat as i,useCopilotAction as C,useCopilotReadable as p}from"./chat/utils.js";export*from"./credits/index.js";export*from"./registration/index.js";import{LiveChatWidget as u}from"./LiveChatWidget/index.js";export{a as ActionExecutionMessage,o as Chat,u as LiveChatWidget,n as Role,r as TextMessage,C as useCopilotAction,i as useCopilotChat,p as useCopilotReadable};
1
+ import{default as o}from"./chat/index";import{Role as n,ActionExecutionMessage as a,TextMessage as r,useCopilotChat as i,useCopilotAction as C,useCopilotReadable as p}from"./chat/utils";export*from"./credits/index.js";export*from"./registration/index.js";import{LiveChatWidget as u}from"./LiveChatWidget/index.js";export{a as ActionExecutionMessage,o as Chat,u as LiveChatWidget,n as Role,r as TextMessage,C as useCopilotAction,i as useCopilotChat,p as useCopilotReadable};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/index.ts"],
4
- "sourcesContent": ["export { default as Chat } from './chat/index.js'\n\nexport {\n Role,\n ActionExecutionMessage,\n TextMessage,\n useCopilotChat,\n useCopilotAction,\n useCopilotReadable,\n} from './chat/utils.js'\n\nexport * from './credits/index.js'\n\nexport * from './registration/index.js'\n\n\n\n// LiveChatWidget \u5BFC\u51FA\nexport { LiveChatWidget } from './LiveChatWidget/index.js'\nexport type {\n LiveChatWidgetProps,\n Message,\n MessageContent,\n MessageRole,\n MessageContentType,\n MessageMetadata,\n MessageRenderer,\n QuickReply,\n ProductCardContent,\n ProductListContent,\n PolicyContent,\n QuickRepliesContent,\n ThinkingContent,\n ErrorContent,\n SSEEvent,\n ChatStreamRequest,\n} from './LiveChatWidget/index.js'\n"],
5
- "mappings": "AAAA,OAAoB,WAAXA,MAAuB,kBAEhC,OACE,QAAAC,EACA,0BAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,oBAAAC,EACA,sBAAAC,MACK,kBAEP,WAAc,qBAEd,WAAc,0BAKd,OAAS,kBAAAC,MAAsB",
4
+ "sourcesContent": ["export { default as Chat } from './chat/index'\n\nexport {\n Role,\n ActionExecutionMessage,\n TextMessage,\n useCopilotChat,\n useCopilotAction,\n useCopilotReadable,\n} from './chat/utils'\n\nexport * from './credits/index.js'\n\nexport * from './registration/index.js'\n\n\n\n// LiveChatWidget \u5BFC\u51FA\nexport { LiveChatWidget } from './LiveChatWidget/index.js'\nexport type {\n LiveChatWidgetProps,\n Message,\n MessageContent,\n MessageRole,\n MessageContentType,\n MessageMetadata,\n MessageRenderer,\n QuickReply,\n ProductCardContent,\n ProductListContent,\n PolicyContent,\n QuickRepliesContent,\n ThinkingContent,\n ErrorContent,\n SSEEvent,\n ChatStreamRequest,\n} from './LiveChatWidget/index.js'\n"],
5
+ "mappings": "AAAA,OAAoB,WAAXA,MAAuB,eAEhC,OACE,QAAAC,EACA,0BAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,oBAAAC,EACA,sBAAAC,MACK,eAEP,WAAc,qBAEd,WAAc,0BAKd,OAAS,kBAAAC,MAAsB",
6
6
  "names": ["default", "Role", "ActionExecutionMessage", "TextMessage", "useCopilotChat", "useCopilotAction", "useCopilotReadable", "LiveChatWidget"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/campaign-ui",
3
- "version": "0.4.0-beta.9",
3
+ "version": "0.4.1",
4
4
  "description": "Campaign UI components and utilities for Anker projects",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -95,7 +95,6 @@
95
95
  "swiper": "^11.1.3",
96
96
  "tailwind-merge": "^2.3.0",
97
97
  "tailwindcss": "^3.4.3",
98
- "@anker-in/headless-ui": "1.1.25-alpha.1767516866003",
99
98
  "@anker-in/lib": "1.1.3"
100
99
  },
101
100
  "publishConfig": {
@@ -1,4 +1,4 @@
1
- export { default as Chat } from './chat/index.js'
1
+ export { default as Chat } from './chat/index'
2
2
 
3
3
  export {
4
4
  Role,
@@ -7,7 +7,7 @@ export {
7
7
  useCopilotChat,
8
8
  useCopilotAction,
9
9
  useCopilotReadable,
10
- } from './chat/utils.js'
10
+ } from './chat/utils'
11
11
 
12
12
  export * from './credits/index.js'
13
13
 
@@ -1,32 +0,0 @@
1
- import { type ModalContainerProps } from './modalContainer';
2
- export interface MyRewardsMetafields {
3
- title: string;
4
- orderNumberLabel: string;
5
- valueLabel: string;
6
- receivedLabel: string;
7
- failedLabel: string;
8
- approveSuccessLabel: string;
9
- couponTab: string;
10
- productTab: string;
11
- pendingLabel: string;
12
- unfulfilledLabel: string;
13
- fulfilledLabel: string;
14
- confirmedTip: string;
15
- pendingTip: string;
16
- processingTip: string;
17
- ShippedTip: string;
18
- emptyListLabel: string;
19
- pointUnit: string;
20
- code: string;
21
- copied: string;
22
- copy: string;
23
- emptyListImage: {
24
- url: string;
25
- alt?: string;
26
- };
27
- }
28
- interface MyRewardsModalProps extends ModalContainerProps {
29
- data: MyRewardsMetafields;
30
- }
31
- declare function MyRewardsModal({ data, ...props }: MyRewardsModalProps): import("react/jsx-runtime").JSX.Element;
32
- export default MyRewardsModal;
@@ -1,2 +0,0 @@
1
- "use strict";var G=Object.create;var m=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Z=(o,n)=>{for(var s in n)m(o,s,{get:n[s],enumerable:!0})},S=(o,n,s,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Q(n))!X.call(o,a)&&a!==s&&m(o,a,{get:()=>n[a],enumerable:!(u=J(n,a))||u.enumerable});return o};var d=(o,n,s)=>(s=o!=null?G(W(o)):{},S(n||!o||!o.__esModule?m(s,"default",{value:o,enumerable:!0}):s,o)),ee=o=>S(m({},"__esModule",{value:!0}),o);var ie={};Z(ie,{default:()=>te});module.exports=ee(ie);var i=require("react/jsx-runtime"),p=require("@anker-in/headless-ui"),g=d(require("classnames")),F=d(require("copy-to-clipboard")),_=d(require("dayjs")),r=require("react"),e=require("../context/const"),h=require("./modalContainer"),D=d(require("./tip")),A=d(require("./loadingDots")),v=d(require("../context/hooks/useMyRewards")),O=require("@anker-in/lib"),I=require("../../../constants");function oe({data:o,...n}){const[s,u]=(0,r.useState)(e.AlpcConsumeType.Coupon),{brand:a}=(0,O.useHeadlessContext)(),x=I.ROUNDED_BRANDS.includes(a),[c,U]=(0,r.useState)(1),[f,k]=(0,r.useState)(1),[E,y]=(0,r.useState)(-1),Y=(0,r.useMemo)(()=>{const t=[];return o.couponTab&&t.push({title:o.couponTab,type:e.AlpcConsumeType.Coupon}),o.productTab&&t.push({title:o.productTab,type:e.AlpcConsumeType.Product}),t},[o.couponTab,o.productTab]),j=(0,r.useMemo)(()=>({page:n.isOpen?f:0,pageSize:1e3,consumeType:e.AlpcConsumeType.Product}),[n.isOpen,f]),H=(0,r.useMemo)(()=>({page:n.isOpen?c:0,pageSize:1e3,consumeType:e.AlpcConsumeType.Coupon}),[n.isOpen,c]),{myRewards:C=[],canNext:N,isLoading:$}=(0,v.default)(H),{myRewards:T=[],canNext:L,isLoading:z}=(0,v.default)(j),P=(0,r.useMemo)(()=>s===e.AlpcConsumeType.Coupon?C.map(t=>({title:t.goods_title,value:t.consume_credits,type:e.RewardType.Received,date:new Date(t.create_time*1e3),couponCode:t.coupon_code,orderNumber:""})):s===e.AlpcConsumeType.Product?T.map(t=>{let l=e.RewardType.Pending;return t.fulfillment_status&&t.fulfillment_status!=="null"?t.fulfillment_status==="fulfilled"?l=e.RewardType.Fulfilled:l=e.RewardType.Unfulfilled:t.approval_status===e.ApprovalStatus.Success||t.approval_status===e.ApprovalStatus.DoubleConfirm?l=e.RewardType.ApproveSuccess:t.approval_status===e.ApprovalStatus.Failed&&(l=e.RewardType.Failed),{title:t.goods_title,value:t.consume_credits,type:l,date:new Date(t.create_time*1e3),orderNumber:t.order_number,couponCode:""}}):[],[s,T,C]),M=(0,r.useMemo)(()=>s===e.AlpcConsumeType.Coupon?N:s===e.AlpcConsumeType.Product?L:!1,[s,N,L]),q=(0,r.useMemo)(()=>({[e.RewardType.Received]:o.receivedLabel,[e.RewardType.Pending]:o.pendingLabel,[e.RewardType.ApproveFail]:o.failedLabel,[e.RewardType.ApproveSuccess]:o.approveSuccessLabel,[e.RewardType.Unfulfilled]:o.unfulfilledLabel,[e.RewardType.Fulfilled]:o.fulfilledLabel,[e.RewardType.Failed]:o.failedLabel}),[o]),w=(0,r.useMemo)(()=>({[e.RewardType.Received]:"",[e.RewardType.Pending]:o.pendingTip,[e.RewardType.ApproveFail]:"",[e.RewardType.ApproveSuccess]:o.confirmedTip,[e.RewardType.Unfulfilled]:o.processingTip,[e.RewardType.Fulfilled]:o.ShippedTip,[e.RewardType.Failed]:""}),[o]),B=(0,r.useMemo)(()=>({[e.RewardType.Received]:"#52C41A",[e.RewardType.Pending]:"#999",[e.RewardType.ApproveFail]:"#F84D4F",[e.RewardType.ApproveSuccess]:"#999",[e.RewardType.Unfulfilled]:"#999",[e.RewardType.Fulfilled]:"#999",[e.RewardType.Failed]:"#F84D4F"}),[]),K=(0,r.useCallback)(()=>{M&&(s===e.AlpcConsumeType.Coupon?U(c+1):s===e.AlpcConsumeType.Product&&k(f+1))},[s,f,c,M]),V=(0,r.useCallback)((t,l)=>{y(l),(0,F.default)(t),setTimeout(()=>{y(-1)},2e3)},[]),R=s===e.AlpcConsumeType.Coupon?$:z;return(0,i.jsxs)(h.CreditsModalContainer,{title:o.title,className:(0,g.default)("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"md:mb-0",...n,onScrollEnd:K,children:[(0,i.jsx)("div",{className:"",children:(0,i.jsx)(p.Tabs,{align:"left",shape:x?"rounded":"square",value:s.toString(),onValueChange:t=>{u(Number(t))},children:(0,i.jsx)(p.TabsList,{children:Y.map(t=>(0,i.jsx)(p.TabsTrigger,{value:t.type.toString(),children:t.title},t.type))})})}),R&&(0,i.jsx)("div",{className:"flex h-full flex-col items-center justify-center",children:(0,i.jsx)(A.default,{})}),!R&&(0,i.jsx)("div",{className:"mt-[24px] overflow-auto overscroll-contain",children:P.length>0?(0,i.jsx)("div",{className:"grid gap-[18px] md:gap-[12px]",children:P.map((t,l)=>(0,i.jsxs)("div",{className:"grid gap-[8px]",children:[t?.orderNumber&&(0,i.jsxs)("div",{className:"text-[15px] font-semibold leading-[1.4] text-[#777]",children:[o.orderNumberLabel,": ",t.orderNumber]}),(0,i.jsxs)("div",{className:(0,g.default)("flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]",!x&&"rounded-none"),children:[(0,i.jsxs)("div",{className:"grid gap-[4px]",children:[(0,i.jsx)("div",{className:"text-[16px] font-bold leading-[1.4]",children:t.title}),(0,i.jsxs)("div",{className:"text-[14px] font-semibold text-[#999]",children:[o.valueLabel,": ",t.value," ",o?.pointUnit]}),(0,i.jsxs)("div",{className:"text-[14px] font-semibold text-[#999]",children:[t?.couponCode?`${o?.code||"Code"}: ${t.couponCode} `:"",t?.couponCode&&(0,i.jsx)("span",{className:"cursor-pointer text-[14px] font-semibold text-brand underline",onClick:()=>{V(t.couponCode,l)},role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&b.preventDefault()},children:E===l?o?.copied||"COPIED":o?.copy||"COPY"})]})]}),(0,i.jsxs)("div",{className:"grid gap-[4px] text-right",children:[(0,i.jsxs)("div",{className:(0,g.default)("flex items-center justify-end text-[16px] font-bold leading-[1.4]",`text-[${B[t.type]}]`),children:[(0,i.jsx)("span",{children:q[t.type]}),w[t.type]&&(0,i.jsx)(D.default,{info:w[t.type],index:l})]}),(0,i.jsx)("div",{className:"text-[14px] font-semibold text-[#999]",children:(0,_.default)(t.date).format("YYYY-MM-DD HH:mm").toString()})]})]})]},l))}):(0,i.jsxs)("div",{className:"flex h-full flex-col items-center justify-center",children:[(0,i.jsx)(p.Picture,{className:"mb-[12px] w-[160px]",source:o?.emptyListImage?.url,alt:o?.emptyListImage?.alt||"empty list image"}),(0,i.jsx)("div",{className:"text-[16px] font-semibold leading-[1.4]",children:o?.emptyListLabel})]})})]})}var te=oe;
2
- //# sourceMappingURL=MyRewardsModal.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/components/credits/modal/MyRewardsModal.tsx"],
4
- "sourcesContent": ["import { Tabs, TabsList, TabsTrigger, Picture } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport clipboard from 'copy-to-clipboard'\nimport dayjs from 'dayjs'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport { ApprovalStatus, AlpcConsumeType, RewardType } from '../context/const'\nimport { CreditsModalContainer, type ModalContainerProps } from './modalContainer'\nimport Tip from './tip'\nimport LoadingDots from './loadingDots'\nimport useMyRewards from '../context/hooks/useMyRewards'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport interface MyRewardsMetafields {\n title: string\n orderNumberLabel: string\n valueLabel: string\n receivedLabel: string\n failedLabel: string\n approveSuccessLabel: string\n couponTab: string\n productTab: string\n pendingLabel: string\n unfulfilledLabel: string\n fulfilledLabel: string\n confirmedTip: string\n pendingTip: string\n processingTip: string\n ShippedTip: string\n emptyListLabel: string\n pointUnit: string\n code: string\n copied: string\n copy: string\n emptyListImage: {\n url: string\n alt?: string\n }\n}\ninterface MyRewardsModalProps extends ModalContainerProps {\n data: MyRewardsMetafields\n}\n\nfunction MyRewardsModal({ data, ...props }: MyRewardsModalProps) {\n const [activeTab, setActiveTab] = useState(AlpcConsumeType.Coupon)\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const [couponPage, setCouponPage] = useState(1)\n const [productPage, setProductPage] = useState(1)\n const [copied, setCopied] = useState(-1)\n\n const tabs = useMemo(() => {\n const availableTabs: { title: string; type: number }[] = []\n\n if (data.couponTab) {\n availableTabs.push({\n title: data.couponTab,\n type: AlpcConsumeType.Coupon,\n })\n }\n\n if (data.productTab) {\n availableTabs.push({\n title: data.productTab,\n type: AlpcConsumeType.Product,\n })\n }\n\n return availableTabs\n }, [data.couponTab, data.productTab])\n\n const myProductRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? productPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Product,\n }\n }, [props.isOpen, productPage])\n const myCouponRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? couponPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Coupon,\n }\n }, [props.isOpen, couponPage])\n\n const {\n myRewards: myCouponRewards = [],\n canNext: couponCanNext,\n isLoading: couponIsLoading,\n } = useMyRewards(myCouponRewardsOptions)\n const {\n myRewards: myProductRewards = [],\n canNext: productCanNext,\n isLoading: productIsLoading,\n } = useMyRewards(myProductRewardsOptions)\n\n const list = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return myCouponRewards.map(item => ({\n title: item.goods_title,\n value: item.consume_credits,\n type: RewardType.Received,\n date: new Date(item.create_time * 1000),\n couponCode: item.coupon_code,\n orderNumber: '',\n }))\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return myProductRewards.map(item => {\n let type = RewardType.Pending\n\n if (item.fulfillment_status && item.fulfillment_status !== 'null') {\n // \u7269\u6D41\u72B6\u6001\n if (item.fulfillment_status === 'fulfilled') {\n type = RewardType.Fulfilled\n } else {\n type = RewardType.Unfulfilled\n }\n } else {\n if (\n item.approval_status === ApprovalStatus.Success ||\n item.approval_status === ApprovalStatus.DoubleConfirm\n ) {\n type = RewardType.ApproveSuccess\n } else if (item.approval_status === ApprovalStatus.Failed) {\n type = RewardType.Failed\n }\n }\n\n return {\n title: item.goods_title,\n value: item.consume_credits,\n type,\n date: new Date(item.create_time * 1000),\n orderNumber: item.order_number,\n couponCode: '',\n }\n })\n }\n\n return []\n }, [activeTab, myProductRewards, myCouponRewards])\n\n const canNext = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return couponCanNext\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return productCanNext\n }\n\n return false\n }, [activeTab, couponCanNext, productCanNext])\n\n const TypeMap = useMemo(() => {\n return {\n [RewardType.Received]: data.receivedLabel,\n [RewardType.Pending]: data.pendingLabel,\n [RewardType.ApproveFail]: data.failedLabel,\n [RewardType.ApproveSuccess]: data.approveSuccessLabel,\n [RewardType.Unfulfilled]: data.unfulfilledLabel,\n [RewardType.Fulfilled]: data.fulfilledLabel,\n [RewardType.Failed]: data.failedLabel,\n }\n }, [data])\n\n const TipMap = useMemo(() => {\n return {\n [RewardType.Received]: '',\n [RewardType.Pending]: data.pendingTip,\n [RewardType.ApproveFail]: '',\n [RewardType.ApproveSuccess]: data.confirmedTip,\n [RewardType.Unfulfilled]: data.processingTip,\n [RewardType.Fulfilled]: data.ShippedTip,\n [RewardType.Failed]: '',\n }\n }, [data])\n\n const ColorMap = useMemo(() => {\n return {\n [RewardType.Received]: '#52C41A',\n [RewardType.Pending]: '#999',\n [RewardType.ApproveFail]: '#F84D4F',\n [RewardType.ApproveSuccess]: '#999',\n [RewardType.Unfulfilled]: '#999',\n [RewardType.Fulfilled]: '#999',\n [RewardType.Failed]: '#F84D4F',\n }\n }, [])\n\n const handleScrollEnd = useCallback(() => {\n if (!canNext) {\n return\n }\n\n if (activeTab === AlpcConsumeType.Coupon) {\n setCouponPage(couponPage + 1)\n } else if (activeTab === AlpcConsumeType.Product) {\n setProductPage(productPage + 1)\n }\n }, [activeTab, productPage, couponPage, canNext])\n\n const handleCopy = useCallback((code: string, idx: number) => {\n setCopied(idx)\n clipboard(code)\n setTimeout(() => {\n setCopied(-1)\n }, 2000)\n }, [])\n\n const isLoading = activeTab === AlpcConsumeType.Coupon ? couponIsLoading : productIsLoading\n\n return (\n <CreditsModalContainer\n title={data.title}\n className={classNames('h-[800px] w-[640px]')}\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n scrollClassName=\"md:mb-0\"\n {...props}\n onScrollEnd={handleScrollEnd}\n >\n <div className=\"\">\n <Tabs\n align=\"left\"\n shape={rounded ? 'rounded' : 'square'}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(Number(value))\n }}\n >\n <TabsList>\n {tabs.map(tab => (\n <TabsTrigger key={tab.type} value={tab.type.toString()}>\n {tab.title}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n </div>\n\n {isLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <LoadingDots />\n </div>\n )}\n\n {!isLoading && (\n <div className=\"mt-[24px] overflow-auto overscroll-contain\">\n {list.length > 0 ? (\n <div className=\"grid gap-[18px] md:gap-[12px]\">\n {list.map((item, index) => (\n <div key={index} className=\"grid gap-[8px]\">\n {item?.orderNumber && (\n <div className=\"text-[15px] font-semibold leading-[1.4] text-[#777]\">\n {data.orderNumberLabel}: {item.orderNumber}\n </div>\n )}\n <div\n className={classNames(\n 'flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]',\n !rounded && 'rounded-none'\n )}\n >\n <div className=\"grid gap-[4px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{item.title}</div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {data.valueLabel}: {item.value} {data?.pointUnit}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {item?.couponCode ? `${data?.code || 'Code'}: ${item.couponCode} ` : ''}\n {item?.couponCode && (\n <span\n className=\"cursor-pointer text-[14px] font-semibold text-brand underline\"\n onClick={() => {\n handleCopy(item.couponCode, index)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copied === index ? data?.copied || 'COPIED' : data?.copy || 'COPY'}\n </span>\n )}\n </div>\n </div>\n <div className=\"grid gap-[4px] text-right\">\n <div\n className={classNames(\n 'flex items-center justify-end text-[16px] font-bold leading-[1.4]',\n `text-[${ColorMap[item.type]}]`\n )}\n >\n <span>{TypeMap[item.type]}</span>\n {TipMap[item.type] && <Tip info={TipMap[item.type]} index={index} />}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {dayjs(item.date).format('YYYY-MM-DD HH:mm').toString()}\n </div>\n </div>\n </div>\n </div>\n ))}\n </div>\n ) : (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <Picture\n className=\"mb-[12px] w-[160px]\"\n source={data?.emptyListImage?.url}\n alt={data?.emptyListImage?.alt || 'empty list image'}\n ></Picture>\n <div className=\"text-[16px] font-semibold leading-[1.4]\">{data?.emptyListLabel}</div>\n </div>\n )}\n </div>\n )}\n </CreditsModalContainer>\n )\n}\n\nexport default MyRewardsModal\n"],
5
- "mappings": "2jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IA8Oc,IAAAI,EAAA,6BA9OdC,E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,EAAK,IAAI,MAAK,OAAC,EAAAkB,QAAA,CAAI,KAAMd,EAAOJ,EAAK,IAAI,EAAG,MAAOgB,EAAO,GACpE,KACA,OAAC,OAAI,UAAU,wCACZ,cAAAG,SAAMnB,EAAK,IAAI,EAAE,OAAO,kBAAkB,EAAE,SAAS,EACxD,GACF,GACF,IApDQgB,CAqDV,CACD,EACH,KAEA,QAAC,OAAI,UAAU,mDACb,oBAAC,WACC,UAAU,sBACV,OAAQxC,GAAM,gBAAgB,IAC9B,IAAKA,GAAM,gBAAgB,KAAO,mBACnC,KACD,OAAC,OAAI,UAAU,0CAA2C,SAAAA,GAAM,eAAe,GACjF,EAEJ,GAEJ,CAEJ,CAEA,IAAOhB,GAAQe",
6
- "names": ["MyRewardsModal_exports", "__export", "MyRewardsModal_default", "__toCommonJS", "import_jsx_runtime", "import_headless_ui", "import_classnames", "import_copy_to_clipboard", "import_dayjs", "import_react", "import_const", "import_modalContainer", "import_tip", "import_loadingDots", "import_useMyRewards", "import_lib", "import_constants", "MyRewardsModal", "data", "props", "activeTab", "setActiveTab", "brand", "rounded", "couponPage", "setCouponPage", "productPage", "setProductPage", "copied", "setCopied", "tabs", "availableTabs", "myProductRewardsOptions", "myCouponRewardsOptions", "myCouponRewards", "couponCanNext", "couponIsLoading", "useMyRewards", "myProductRewards", "productCanNext", "productIsLoading", "list", "item", "type", "canNext", "TypeMap", "TipMap", "ColorMap", "handleScrollEnd", "handleCopy", "code", "idx", "clipboard", "isLoading", "classNames", "value", "tab", "LoadingDots", "index", "e", "Tip", "dayjs"]
7
- }
@@ -1,32 +0,0 @@
1
- import { type ModalContainerProps } from './modalContainer';
2
- export interface MyRewardsMetafields {
3
- title: string;
4
- orderNumberLabel: string;
5
- valueLabel: string;
6
- receivedLabel: string;
7
- failedLabel: string;
8
- approveSuccessLabel: string;
9
- couponTab: string;
10
- productTab: string;
11
- pendingLabel: string;
12
- unfulfilledLabel: string;
13
- fulfilledLabel: string;
14
- confirmedTip: string;
15
- pendingTip: string;
16
- processingTip: string;
17
- ShippedTip: string;
18
- emptyListLabel: string;
19
- pointUnit: string;
20
- code: string;
21
- copied: string;
22
- copy: string;
23
- emptyListImage: {
24
- url: string;
25
- alt?: string;
26
- };
27
- }
28
- interface MyRewardsModalProps extends ModalContainerProps {
29
- data: MyRewardsMetafields;
30
- }
31
- declare function MyRewardsModal({ data, ...props }: MyRewardsModalProps): import("react/jsx-runtime").JSX.Element;
32
- export default MyRewardsModal;
@@ -1,2 +0,0 @@
1
- import{jsx as i,jsxs as l}from"react/jsx-runtime";import{Tabs as $,TabsList as z,TabsTrigger as q,Picture as B}from"@anker-in/headless-ui";import m from"classnames";import K from"copy-to-clipboard";import V from"dayjs";import{useCallback as w,useMemo as p,useState as c}from"react";import{ApprovalStatus as g,AlpcConsumeType as n,RewardType as t}from"../context/const";import{CreditsModalContainer as G}from"./modalContainer";import J from"./tip";import Q from"./loadingDots";import R from"../context/hooks/useMyRewards";import{useHeadlessContext as W}from"@anker-in/lib";import{ROUNDED_BRANDS as X}from"../../../constants";function Z({data:o,...a}){const[r,S]=c(n.Coupon),{brand:F}=W(),b=X.includes(F),[d,_]=c(1),[u,h]=c(1),[D,v]=c(-1),A=p(()=>{const e=[];return o.couponTab&&e.push({title:o.couponTab,type:n.Coupon}),o.productTab&&e.push({title:o.productTab,type:n.Product}),e},[o.couponTab,o.productTab]),O=p(()=>({page:a.isOpen?u:0,pageSize:1e3,consumeType:n.Product}),[a.isOpen,u]),I=p(()=>({page:a.isOpen?d:0,pageSize:1e3,consumeType:n.Coupon}),[a.isOpen,d]),{myRewards:x=[],canNext:y,isLoading:U}=R(I),{myRewards:C=[],canNext:N,isLoading:k}=R(O),T=p(()=>r===n.Coupon?x.map(e=>({title:e.goods_title,value:e.consume_credits,type:t.Received,date:new Date(e.create_time*1e3),couponCode:e.coupon_code,orderNumber:""})):r===n.Product?C.map(e=>{let s=t.Pending;return e.fulfillment_status&&e.fulfillment_status!=="null"?e.fulfillment_status==="fulfilled"?s=t.Fulfilled:s=t.Unfulfilled:e.approval_status===g.Success||e.approval_status===g.DoubleConfirm?s=t.ApproveSuccess:e.approval_status===g.Failed&&(s=t.Failed),{title:e.goods_title,value:e.consume_credits,type:s,date:new Date(e.create_time*1e3),orderNumber:e.order_number,couponCode:""}}):[],[r,C,x]),L=p(()=>r===n.Coupon?y:r===n.Product?N:!1,[r,y,N]),E=p(()=>({[t.Received]:o.receivedLabel,[t.Pending]:o.pendingLabel,[t.ApproveFail]:o.failedLabel,[t.ApproveSuccess]:o.approveSuccessLabel,[t.Unfulfilled]:o.unfulfilledLabel,[t.Fulfilled]:o.fulfilledLabel,[t.Failed]:o.failedLabel}),[o]),P=p(()=>({[t.Received]:"",[t.Pending]:o.pendingTip,[t.ApproveFail]:"",[t.ApproveSuccess]:o.confirmedTip,[t.Unfulfilled]:o.processingTip,[t.Fulfilled]:o.ShippedTip,[t.Failed]:""}),[o]),Y=p(()=>({[t.Received]:"#52C41A",[t.Pending]:"#999",[t.ApproveFail]:"#F84D4F",[t.ApproveSuccess]:"#999",[t.Unfulfilled]:"#999",[t.Fulfilled]:"#999",[t.Failed]:"#F84D4F"}),[]),j=w(()=>{L&&(r===n.Coupon?_(d+1):r===n.Product&&h(u+1))},[r,u,d,L]),H=w((e,s)=>{v(s),K(e),setTimeout(()=>{v(-1)},2e3)},[]),M=r===n.Coupon?U:k;return l(G,{title:o.title,className:m("h-[800px] w-[640px]"),useAnimation:!0,animationClassName:"md:translate-y-[100vh]",scrollClassName:"md:mb-0",...a,onScrollEnd:j,children:[i("div",{className:"",children:i($,{align:"left",shape:b?"rounded":"square",value:r.toString(),onValueChange:e=>{S(Number(e))},children:i(z,{children:A.map(e=>i(q,{value:e.type.toString(),children:e.title},e.type))})})}),M&&i("div",{className:"flex h-full flex-col items-center justify-center",children:i(Q,{})}),!M&&i("div",{className:"mt-[24px] overflow-auto overscroll-contain",children:T.length>0?i("div",{className:"grid gap-[18px] md:gap-[12px]",children:T.map((e,s)=>l("div",{className:"grid gap-[8px]",children:[e?.orderNumber&&l("div",{className:"text-[15px] font-semibold leading-[1.4] text-[#777]",children:[o.orderNumberLabel,": ",e.orderNumber]}),l("div",{className:m("flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]",!b&&"rounded-none"),children:[l("div",{className:"grid gap-[4px]",children:[i("div",{className:"text-[16px] font-bold leading-[1.4]",children:e.title}),l("div",{className:"text-[14px] font-semibold text-[#999]",children:[o.valueLabel,": ",e.value," ",o?.pointUnit]}),l("div",{className:"text-[14px] font-semibold text-[#999]",children:[e?.couponCode?`${o?.code||"Code"}: ${e.couponCode} `:"",e?.couponCode&&i("span",{className:"cursor-pointer text-[14px] font-semibold text-brand underline",onClick:()=>{H(e.couponCode,s)},role:"button",tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&f.preventDefault()},children:D===s?o?.copied||"COPIED":o?.copy||"COPY"})]})]}),l("div",{className:"grid gap-[4px] text-right",children:[l("div",{className:m("flex items-center justify-end text-[16px] font-bold leading-[1.4]",`text-[${Y[e.type]}]`),children:[i("span",{children:E[e.type]}),P[e.type]&&i(J,{info:P[e.type],index:s})]}),i("div",{className:"text-[14px] font-semibold text-[#999]",children:V(e.date).format("YYYY-MM-DD HH:mm").toString()})]})]})]},s))}):l("div",{className:"flex h-full flex-col items-center justify-center",children:[i(B,{className:"mb-[12px] w-[160px]",source:o?.emptyListImage?.url,alt:o?.emptyListImage?.alt||"empty list image"}),i("div",{className:"text-[16px] font-semibold leading-[1.4]",children:o?.emptyListLabel})]})})]})}var ce=Z;export{ce as default};
2
- //# sourceMappingURL=MyRewardsModal.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../src/components/credits/modal/MyRewardsModal.tsx"],
4
- "sourcesContent": ["import { Tabs, TabsList, TabsTrigger, Picture } from '@anker-in/headless-ui'\nimport classNames from 'classnames'\nimport clipboard from 'copy-to-clipboard'\nimport dayjs from 'dayjs'\nimport { useCallback, useMemo, useState } from 'react'\n\nimport { ApprovalStatus, AlpcConsumeType, RewardType } from '../context/const'\nimport { CreditsModalContainer, type ModalContainerProps } from './modalContainer'\nimport Tip from './tip'\nimport LoadingDots from './loadingDots'\nimport useMyRewards from '../context/hooks/useMyRewards'\nimport { useHeadlessContext } from '@anker-in/lib'\nimport { ROUNDED_BRANDS } from '../../../constants'\n\nexport interface MyRewardsMetafields {\n title: string\n orderNumberLabel: string\n valueLabel: string\n receivedLabel: string\n failedLabel: string\n approveSuccessLabel: string\n couponTab: string\n productTab: string\n pendingLabel: string\n unfulfilledLabel: string\n fulfilledLabel: string\n confirmedTip: string\n pendingTip: string\n processingTip: string\n ShippedTip: string\n emptyListLabel: string\n pointUnit: string\n code: string\n copied: string\n copy: string\n emptyListImage: {\n url: string\n alt?: string\n }\n}\ninterface MyRewardsModalProps extends ModalContainerProps {\n data: MyRewardsMetafields\n}\n\nfunction MyRewardsModal({ data, ...props }: MyRewardsModalProps) {\n const [activeTab, setActiveTab] = useState(AlpcConsumeType.Coupon)\n const { brand } = useHeadlessContext()\n const rounded = ROUNDED_BRANDS.includes(brand)\n\n const [couponPage, setCouponPage] = useState(1)\n const [productPage, setProductPage] = useState(1)\n const [copied, setCopied] = useState(-1)\n\n const tabs = useMemo(() => {\n const availableTabs: { title: string; type: number }[] = []\n\n if (data.couponTab) {\n availableTabs.push({\n title: data.couponTab,\n type: AlpcConsumeType.Coupon,\n })\n }\n\n if (data.productTab) {\n availableTabs.push({\n title: data.productTab,\n type: AlpcConsumeType.Product,\n })\n }\n\n return availableTabs\n }, [data.couponTab, data.productTab])\n\n const myProductRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? productPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Product,\n }\n }, [props.isOpen, productPage])\n const myCouponRewardsOptions = useMemo(() => {\n return {\n page: props.isOpen ? couponPage : 0,\n pageSize: 1000,\n consumeType: AlpcConsumeType.Coupon,\n }\n }, [props.isOpen, couponPage])\n\n const {\n myRewards: myCouponRewards = [],\n canNext: couponCanNext,\n isLoading: couponIsLoading,\n } = useMyRewards(myCouponRewardsOptions)\n const {\n myRewards: myProductRewards = [],\n canNext: productCanNext,\n isLoading: productIsLoading,\n } = useMyRewards(myProductRewardsOptions)\n\n const list = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return myCouponRewards.map(item => ({\n title: item.goods_title,\n value: item.consume_credits,\n type: RewardType.Received,\n date: new Date(item.create_time * 1000),\n couponCode: item.coupon_code,\n orderNumber: '',\n }))\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return myProductRewards.map(item => {\n let type = RewardType.Pending\n\n if (item.fulfillment_status && item.fulfillment_status !== 'null') {\n // \u7269\u6D41\u72B6\u6001\n if (item.fulfillment_status === 'fulfilled') {\n type = RewardType.Fulfilled\n } else {\n type = RewardType.Unfulfilled\n }\n } else {\n if (\n item.approval_status === ApprovalStatus.Success ||\n item.approval_status === ApprovalStatus.DoubleConfirm\n ) {\n type = RewardType.ApproveSuccess\n } else if (item.approval_status === ApprovalStatus.Failed) {\n type = RewardType.Failed\n }\n }\n\n return {\n title: item.goods_title,\n value: item.consume_credits,\n type,\n date: new Date(item.create_time * 1000),\n orderNumber: item.order_number,\n couponCode: '',\n }\n })\n }\n\n return []\n }, [activeTab, myProductRewards, myCouponRewards])\n\n const canNext = useMemo(() => {\n if (activeTab === AlpcConsumeType.Coupon) {\n return couponCanNext\n }\n\n if (activeTab === AlpcConsumeType.Product) {\n return productCanNext\n }\n\n return false\n }, [activeTab, couponCanNext, productCanNext])\n\n const TypeMap = useMemo(() => {\n return {\n [RewardType.Received]: data.receivedLabel,\n [RewardType.Pending]: data.pendingLabel,\n [RewardType.ApproveFail]: data.failedLabel,\n [RewardType.ApproveSuccess]: data.approveSuccessLabel,\n [RewardType.Unfulfilled]: data.unfulfilledLabel,\n [RewardType.Fulfilled]: data.fulfilledLabel,\n [RewardType.Failed]: data.failedLabel,\n }\n }, [data])\n\n const TipMap = useMemo(() => {\n return {\n [RewardType.Received]: '',\n [RewardType.Pending]: data.pendingTip,\n [RewardType.ApproveFail]: '',\n [RewardType.ApproveSuccess]: data.confirmedTip,\n [RewardType.Unfulfilled]: data.processingTip,\n [RewardType.Fulfilled]: data.ShippedTip,\n [RewardType.Failed]: '',\n }\n }, [data])\n\n const ColorMap = useMemo(() => {\n return {\n [RewardType.Received]: '#52C41A',\n [RewardType.Pending]: '#999',\n [RewardType.ApproveFail]: '#F84D4F',\n [RewardType.ApproveSuccess]: '#999',\n [RewardType.Unfulfilled]: '#999',\n [RewardType.Fulfilled]: '#999',\n [RewardType.Failed]: '#F84D4F',\n }\n }, [])\n\n const handleScrollEnd = useCallback(() => {\n if (!canNext) {\n return\n }\n\n if (activeTab === AlpcConsumeType.Coupon) {\n setCouponPage(couponPage + 1)\n } else if (activeTab === AlpcConsumeType.Product) {\n setProductPage(productPage + 1)\n }\n }, [activeTab, productPage, couponPage, canNext])\n\n const handleCopy = useCallback((code: string, idx: number) => {\n setCopied(idx)\n clipboard(code)\n setTimeout(() => {\n setCopied(-1)\n }, 2000)\n }, [])\n\n const isLoading = activeTab === AlpcConsumeType.Coupon ? couponIsLoading : productIsLoading\n\n return (\n <CreditsModalContainer\n title={data.title}\n className={classNames('h-[800px] w-[640px]')}\n useAnimation\n animationClassName=\"md:translate-y-[100vh]\"\n scrollClassName=\"md:mb-0\"\n {...props}\n onScrollEnd={handleScrollEnd}\n >\n <div className=\"\">\n <Tabs\n align=\"left\"\n shape={rounded ? 'rounded' : 'square'}\n value={activeTab.toString()}\n onValueChange={value => {\n setActiveTab(Number(value))\n }}\n >\n <TabsList>\n {tabs.map(tab => (\n <TabsTrigger key={tab.type} value={tab.type.toString()}>\n {tab.title}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n </div>\n\n {isLoading && (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <LoadingDots />\n </div>\n )}\n\n {!isLoading && (\n <div className=\"mt-[24px] overflow-auto overscroll-contain\">\n {list.length > 0 ? (\n <div className=\"grid gap-[18px] md:gap-[12px]\">\n {list.map((item, index) => (\n <div key={index} className=\"grid gap-[8px]\">\n {item?.orderNumber && (\n <div className=\"text-[15px] font-semibold leading-[1.4] text-[#777]\">\n {data.orderNumberLabel}: {item.orderNumber}\n </div>\n )}\n <div\n className={classNames(\n 'flex items-center justify-between rounded-[8px] bg-[#f7f8f9] px-[16px] py-[20px]',\n !rounded && 'rounded-none'\n )}\n >\n <div className=\"grid gap-[4px]\">\n <div className=\"text-[16px] font-bold leading-[1.4]\">{item.title}</div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {data.valueLabel}: {item.value} {data?.pointUnit}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {item?.couponCode ? `${data?.code || 'Code'}: ${item.couponCode} ` : ''}\n {item?.couponCode && (\n <span\n className=\"cursor-pointer text-[14px] font-semibold text-brand underline\"\n onClick={() => {\n handleCopy(item.couponCode, index)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {copied === index ? data?.copied || 'COPIED' : data?.copy || 'COPY'}\n </span>\n )}\n </div>\n </div>\n <div className=\"grid gap-[4px] text-right\">\n <div\n className={classNames(\n 'flex items-center justify-end text-[16px] font-bold leading-[1.4]',\n `text-[${ColorMap[item.type]}]`\n )}\n >\n <span>{TypeMap[item.type]}</span>\n {TipMap[item.type] && <Tip info={TipMap[item.type]} index={index} />}\n </div>\n <div className=\"text-[14px] font-semibold text-[#999]\">\n {dayjs(item.date).format('YYYY-MM-DD HH:mm').toString()}\n </div>\n </div>\n </div>\n </div>\n ))}\n </div>\n ) : (\n <div className=\"flex h-full flex-col items-center justify-center\">\n <Picture\n className=\"mb-[12px] w-[160px]\"\n source={data?.emptyListImage?.url}\n alt={data?.emptyListImage?.alt || 'empty list image'}\n ></Picture>\n <div className=\"text-[16px] font-semibold leading-[1.4]\">{data?.empt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,EAAK,UAAU,IAAM,GACpEA,GAAM,YACL7C,EAAC,QACC,UAAU,gEACV,QAAS,IAAM,CACboD,EAAWP,EAAK,WAAYa,CAAK,CACnC,EACA,KAAK,SACL,SAAU,EACV,UAAWC,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAA3B,IAAW0B,EAAQpC,GAAM,QAAU,SAAWA,GAAM,MAAQ,OAC/D,GAEJ,GACF,EACArB,EAAC,OAAI,UAAU,4BACb,UAAAA,EAAC,OACC,UAAWK,EACT,oEACA,SAAS4C,EAASL,EAAK,IAAI,CAAC,GAC9B,EAEA,UAAA7C,EAAC,QAAM,SAAAgD,EAAQH,EAAK,IAAI,EAAE,EACzBI,EAAOJ,EAAK,IAAI,GAAK7C,EAACgB,EAAA,CAAI,KAAMiC,EAAOJ,EAAK,IAAI,EAAG,MAAOa,EAAO,GACpE,EACA1D,EAAC,OAAI,UAAU,wCACZ,SAAAQ,EAAMqC,EAAK,IAAI,EAAE,OAAO,kBAAkB,EAAE,SAAS,EACxD,GACF,GACF,IApDQa,CAqDV,CACD,EACH,EAEAzD,EAAC,OAAI,UAAU,mDACb,UAAAD,EAACK,EAAA,CACC,UAAU,sBACV,OAAQiB,GAAM,gBAAgB,IAC9B,IAAKA,GAAM,gBAAgB,KAAO,mBACnC,EACDtB,EAAC,OAAI,UAAU,0CAA2C,SAAAsB,GAAM,eAAe,GACjF,EAEJ,GAEJ,CAEJ,CAEA,IAAOsC,GAAQvC",
6
- "names": ["jsx", "jsxs", "Tabs", "TabsList", "TabsTrigger", "Picture", "classNames", "clipboard", "dayjs", "useCallback", "useMemo", "useState", "ApprovalStatus", "AlpcConsumeType", "RewardType", "CreditsModalContainer", "Tip", "LoadingDots", "useMyRewards", "useHeadlessContext", "ROUNDED_BRANDS", "MyRewardsModal", "data", "props", "activeTab", "setActiveTab", "brand", "rounded", "couponPage", "setCouponPage", "productPage", "setProductPage", "copied", "setCopied", "tabs", "availableTabs", "myProductRewardsOptions", "myCouponRewardsOptions", "myCouponRewards", "couponCanNext", "couponIsLoading", "myProductRewards", "productCanNext", "productIsLoading", "list", "item", "type", "canNext", "TypeMap", "TipMap", "ColorMap", "handleScrollEnd", "handleCopy", "code", "idx", "isLoading", "value", "tab", "index", "e", "MyRewardsModal_default"]
7
- }