Quellcode durchsuchen

Merge branch 'dev_1.1.2' of DeNet/de-net into master

zhangwei vor 2 Jahren
Ursprung
Commit
3eb2c4810a
87 geänderte Dateien mit 5421 neuen und 697 gelöschten Zeilen
  1. BIN
      src/assets/gif/002.png
  2. BIN
      src/assets/img/icon-message-close.png
  3. BIN
      src/assets/img/icon-message-fail.png
  4. BIN
      src/assets/img/icon-message-win.png
  5. BIN
      src/assets/img/img-preview-draw-after-bg.png
  6. BIN
      src/assets/img/img-preview-draw-box.png
  7. 3 0
      src/assets/subject/002-back-head-top-1.svg
  8. 3 0
      src/assets/subject/002-back-head-top-180.svg
  9. 3 0
      src/assets/subject/002-back-head-top.svg
  10. 16 0
      src/assets/subject/002-card.svg
  11. 3 0
      src/assets/svg/icon-automatically.svg
  12. 6 0
      src/assets/svg/icon-flower.svg
  13. 3 3
      src/assets/svg/icon-joined-group-logo.svg
  14. 4 0
      src/assets/svg/icon-list-withdraw-s.svg
  15. 75 0
      src/assets/svg/icon-message-fail.svg
  16. 7 0
      src/assets/svg/icon-message-win.svg
  17. 5 0
      src/assets/svg/icon-participate.svg
  18. 6 0
      src/assets/svg/icon-preview-clock.svg
  19. 6 0
      src/assets/svg/icon-preview-trophy.svg
  20. 1 0
      src/assets/svg/icon-reward-v2.svg
  21. 4 0
      src/assets/svg/icon-send-giveaways-mark.svg
  22. 3 5
      src/assets/svg/icon-send-giveaways-s.svg
  23. 3 0
      src/assets/svg/icon-setting-white.svg
  24. 7 0
      src/assets/svg/icon-tasks-v2.svg
  25. 73 0
      src/assets/svg/icon-ticket.svg
  26. 6 0
      src/assets/svg/icon-time.svg
  27. 21 0
      src/assets/svg/icon-win-1.svg
  28. 21 0
      src/assets/svg/icon-win-2.svg
  29. 21 0
      src/assets/svg/icon-win-3.svg
  30. 3 0
      src/assets/svg/icon-win-time.svg
  31. 6 0
      src/assets/svg/icon-win.svg
  32. 3 0
      src/assets/svg/icon-winner-v2.svg
  33. 46 0
      src/assets/svg/img-A0.svg
  34. 46 0
      src/assets/svg/img-A1.svg
  35. 44 0
      src/assets/svg/img-B0.svg
  36. 44 0
      src/assets/svg/img-B1.svg
  37. 16 0
      src/assets/svg/img-preview-draw-bg.svg
  38. 5 0
      src/assets/svg/img-preview-draw-open.svg
  39. 23 4
      src/entry/background.js
  40. 8 5
      src/entry/content.js
  41. 29 11
      src/entry/content_help.js
  42. 2 1
      src/entry/popup.js
  43. 1 1
      src/http/configAPI.js
  44. 4 1
      src/http/fetch.js
  45. 17 6
      src/http/logApi.js
  46. 17 0
      src/http/user.js
  47. 3 2
      src/iframe/home.js
  48. 4 2
      src/iframe/red-packet.js
  49. 13 3
      src/log-center/logEnum.js
  50. 33 18
      src/log-center/logger.js
  51. 13 0
      src/logic/background/fetch/twitter.js
  52. 27 2
      src/logic/background/help.js
  53. 19 7
      src/logic/background/twitter.js
  54. 13 8
      src/logic/content/ParseCard.js
  55. 21 2
      src/logic/content/nft.js
  56. 101 33
      src/logic/content/twitter.js
  57. 8 3
      src/manifest.json
  58. 7 0
      src/router/popup.js
  59. 2 2
      src/uilts/chromeExtension.js
  60. 38 0
      src/uilts/help.js
  61. 48 10
      src/view/components/custom-card-cover.vue
  62. 1 1
      src/view/components/message-box.vue
  63. 24 8
      src/view/components/popup-transactions.vue
  64. 157 0
      src/view/content/message/index.vue
  65. 6 4
      src/view/iframe/buy-nft/buy/home.vue
  66. 3 1
      src/view/iframe/buy-nft/buy/pay.vue
  67. 25 5
      src/view/iframe/group-card/card.vue
  68. 2 1
      src/view/iframe/nft/group-card.vue
  69. 5 8
      src/view/iframe/publish/components/follow-input.vue
  70. 35 5
      src/view/iframe/publish/components/get-more.vue
  71. 4 2
      src/view/iframe/publish/components/paypal-button.vue
  72. 37 4
      src/view/iframe/publish/components/preview-card.vue
  73. 1 1
      src/view/iframe/publish/components/top-up.vue
  74. 456 438
      src/view/iframe/publish/give-dialog.vue
  75. 12 0
      src/view/iframe/red-packet/index.vue
  76. 3217 0
      src/view/iframe/red-packet/luck-draw.vue
  77. 172 44
      src/view/iframe/red-packet/red-packet.vue
  78. 10 6
      src/view/iframe/tab-group/tab-group.vue
  79. 1 2
      src/view/popup/components/tabbar.vue
  80. 15 3
      src/view/popup/components/top-bar.vue
  81. 135 0
      src/view/popup/setting/index.vue
  82. 1 1
      src/view/popup/tabbar-page/index.vue
  83. 127 30
      src/view/popup/tabbar-page/message/index.vue
  84. 3 2
      src/view/popup/tabbar-page/nft/detail.vue
  85. 1 1
      src/view/popup/tabbar-page/nft/index.vue
  86. 1 1
      src/view/popup/tabbar-page/wallter/popup.vue
  87. 6 0
      vue.config.js

BIN
src/assets/gif/002.png


BIN
src/assets/img/icon-message-close.png


BIN
src/assets/img/icon-message-fail.png


BIN
src/assets/img/icon-message-win.png


BIN
src/assets/img/img-preview-draw-after-bg.png


BIN
src/assets/img/img-preview-draw-box.png


+ 3 - 0
src/assets/subject/002-back-head-top-1.svg

@@ -0,0 +1,3 @@
+<svg width="375" height="110" viewBox="0 0 375 110" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0 0H375V85.8417C375 85.8417 320.624 110 187.5 110C54.376 110 0 85.8417 0 85.8417V0Z" fill="#7D52FD"/>
+</svg>

+ 3 - 0
src/assets/subject/002-back-head-top-180.svg

@@ -0,0 +1,3 @@
+<svg width="375" height="180" viewBox="0 0 375 180" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0 0H375V140.468C375 140.468 320.624 180 187.5 180C54.376 180 0 140.468 0 140.468V0Z" fill="#7D52FD"/>
+</svg>

+ 3 - 0
src/assets/subject/002-back-head-top.svg

@@ -0,0 +1,3 @@
+<svg width="375" height="160" viewBox="0 0 375 160" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0 0H375V124.861C375 124.861 320.624 160 187.5 160C54.376 160 0 124.861 0 124.861V0Z" fill="#7D52FD"/>
+</svg>

+ 16 - 0
src/assets/subject/002-card.svg

@@ -0,0 +1,16 @@
+<svg width="375" height="500" viewBox="0 0 375 500" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect width="375" height="500" fill="url(#paint0_linear_19822_278074)"/>
+<g clip-path="url(#clip0_19822_278074)">
+<rect x="284.926" y="-27" width="152" height="31" transform="rotate(40 284.926 -27)" fill="#FFBB55"/>
+<path d="M309.266 18.332L304.682 14.4856L310.638 7.38815L308.463 5.56327L300.814 14.6792L307.573 20.3505L309.266 18.332ZM320.664 15.5128C317.851 13.1525 314.176 13.4861 311.892 16.2079C309.608 18.9296 309.918 22.607 312.731 24.9673C315.544 27.3276 319.219 26.994 321.503 24.2723C323.787 21.5505 323.477 17.8731 320.664 15.5128ZM318.916 17.5965C320.4 18.8422 320.548 20.8082 319.237 22.3709C317.926 23.9336 315.964 24.1294 314.479 22.8837C312.995 21.638 312.847 19.672 314.158 18.1092C315.469 16.5465 317.431 16.3507 318.916 17.5965ZM333.407 26.4936L325.834 20.1394L324.14 22.1579L326.842 24.4253L320.887 31.5227L323.062 33.3476L329.017 26.2502L331.713 28.5122L333.407 26.4936ZM341.661 33.42L334.089 27.0658L332.395 29.0843L335.097 31.3517L329.142 38.4491L331.316 40.274L337.272 33.1766L339.968 35.4386L341.661 33.42ZM343.856 47.4559L339.05 43.4236L340.449 41.7567L344.948 45.5321L346.587 43.5787L342.088 39.8033L343.41 38.2276L348.19 42.2379L349.834 40.278L342.88 34.4428L335.231 43.5587L342.211 49.4158L343.856 47.4559ZM351.58 41.7427L343.931 50.8586L346.105 52.6835L348.968 49.2715L349.287 49.5392L348.827 54.9673L351.419 57.1419L351.719 51.4684C353.572 52.5793 355.336 52.3284 356.549 50.8829C358.057 49.0858 357.798 46.9605 355.545 45.0701L351.58 41.7427ZM353.864 47.0212C354.632 47.6659 354.876 48.3806 354.335 49.0253C353.788 49.6764 353.05 49.5781 352.268 48.9225L350.504 47.4418L352.099 45.5405L353.864 47.0212ZM368.351 55.8157L365.903 53.7613L360.811 55.6911L361.82 50.3356L359.301 48.2212L358.049 56.7472L355.115 60.2438L357.297 62.0741L360.242 58.5645L368.351 55.8157Z" fill="white"/>
+</g>
+<defs>
+<linearGradient id="paint0_linear_19822_278074" x1="56.5" y1="500" x2="227" y2="106" gradientUnits="userSpaceOnUse">
+<stop stop-color="#3438FF"/>
+<stop offset="1" stop-color="#8B56FC"/>
+</linearGradient>
+<clipPath id="clip0_19822_278074">
+<rect width="110" height="94" fill="white" transform="translate(265)"/>
+</clipPath>
+</defs>
+</svg>

+ 3 - 0
src/assets/svg/icon-automatically.svg

@@ -0,0 +1,3 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M10 1C5.03714 1 1 5.03714 1 10C1 14.9629 5.03714 19 10 19C14.9629 19 19 14.9629 19 10C19 5.03714 14.9629 1 10 1ZM13.1995 11.2857H9.36036C9.0055 11.2857 8.71429 10.9951 8.71429 10.6396V5.52186C8.71429 5.167 9.00229 4.879 9.35714 4.879C9.712 4.879 10 5.167 10 5.52186V10H13.1995C13.555 10 13.8424 10.288 13.8424 10.6429C13.8424 10.9984 13.5544 11.2857 13.1995 11.2857Z" fill="#1D9BF0"/>
+</svg>

Datei-Diff unterdrückt, da er zu groß ist
+ 6 - 0
src/assets/svg/icon-flower.svg


+ 3 - 3
src/assets/svg/icon-joined-group-logo.svg

@@ -1,4 +1,4 @@
-<svg width="32" height="30" viewBox="0 0 32 30" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M15.9464 28.5523L16.0002 28.6076L16.0539 28.5523L31.0538 13.1124L31.0987 13.0661L31.0597 13.0147L23.4185 2.95464L23.396 2.925H23.3588H8.64124H8.60403L8.58152 2.95464L0.940275 13.0147L0.901262 13.0661L0.946206 13.1124L15.9464 28.5523ZM28.8923 12.9257L16.0002 26.1958L3.108 12.9257L9.40121 4.64043H22.5988L28.8923 12.9257Z" fill="#1D9BF0" stroke="#1D9BF0" stroke-width="0.15"/>
-<path d="M16.8074 12.7008C17.1973 12.3323 17.5094 11.8893 17.7252 11.398C17.941 10.9068 18.0561 10.3773 18.0639 9.84079C18.0721 9.30434 17.9728 8.77168 17.7716 8.2743C17.5705 7.77691 17.2716 7.32491 16.8928 6.94501C17.2274 6.8184 17.5823 6.75364 17.94 6.75391C19.6031 6.75391 20.9528 8.13541 20.9528 9.84079C20.9528 11.5459 19.6037 12.9277 17.94 12.9277C17.5516 12.9277 17.1661 12.8512 16.8074 12.7008ZM18.2377 13.9567H19.3212C21.4695 13.9567 23.2097 15.741 23.2097 17.9438V18.2019C23.2097 18.899 22.0842 19.0577 20.5271 19.0925C20.6015 18.9758 20.6399 18.841 20.6375 18.702V18.3677C20.6421 17.4897 20.4244 16.6249 20.0048 15.8536C19.5852 15.0824 18.9773 14.4299 18.2377 13.9567ZM13.8241 6.75391C15.4869 6.75391 16.8353 8.13541 16.8353 9.84079C16.8353 11.5459 15.4884 12.9277 13.8241 12.9277C12.1616 12.9277 10.8119 11.5459 10.8119 9.84079C10.8119 8.13541 12.1616 6.75391 13.8241 6.75391ZM12.6944 13.9567H15.2041C17.3527 13.9567 19.0938 15.741 19.0938 17.9438V18.2019C19.0938 19.0687 17.3512 19.1032 15.2041 19.1032H12.6944C10.5461 19.1032 8.80469 19.1014 8.80469 18.2019V17.9438C8.80469 15.7419 10.5458 13.9567 12.6944 13.9567Z" fill="#1D9BF0"/>
+<svg width="26" height="24" viewBox="0 0 26 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M12.9463 22.8527L13.0001 22.908L13.0539 22.8527L25.0538 10.5007L25.0987 10.4545L25.0597 10.4031L18.9467 2.35503L18.9242 2.32539H18.887H7.11299H7.07578L7.05327 2.35503L0.940275 10.4031L0.901262 10.4545L0.946206 10.5007L12.9463 22.8527ZM23.2941 10.3398L13.0001 20.9355L2.70615 10.3398L7.72841 3.72774H18.2716L23.2941 10.3398Z" fill="black" stroke="black" stroke-width="0.15"/>
+<path d="M13.6443 10.1594C13.9563 9.86454 14.2059 9.51014 14.3786 9.11715C14.5512 8.72417 14.6434 8.30056 14.6495 7.87136C14.6561 7.4422 14.5766 7.01607 14.4157 6.61817C14.2548 6.22026 14.0158 5.85866 13.7127 5.55474C13.9804 5.45345 14.2642 5.40165 14.5505 5.40186C15.8809 5.40186 16.9607 6.50706 16.9607 7.87136C16.9607 9.23543 15.8814 10.3409 14.5505 10.3409C14.2397 10.3409 13.9313 10.2797 13.6443 10.1594ZM14.7886 11.1641H15.6554C17.3741 11.1641 18.7662 12.5915 18.7662 14.3538V14.5602C18.7662 15.118 17.8658 15.2449 16.6201 15.2727C16.6797 15.1794 16.7104 15.0715 16.7085 14.9603V14.6929C16.7121 13.9905 16.5379 13.2986 16.2023 12.6816C15.8666 12.0647 15.3803 11.5426 14.7886 11.1641ZM11.2577 5.40186C12.5879 5.40186 13.6667 6.50706 13.6667 7.87136C13.6667 9.23543 12.5891 10.3409 11.2577 10.3409C9.92769 10.3409 8.84796 9.23543 8.84796 7.87136C8.84796 6.50706 9.92769 5.40186 11.2577 5.40186ZM10.354 11.1641H12.3617C14.0806 11.1641 15.4735 12.5915 15.4735 14.3538V14.5602C15.4735 15.2537 14.0794 15.2813 12.3617 15.2813H10.354C8.6353 15.2813 7.24219 15.2799 7.24219 14.5602V14.3538C7.24219 12.5922 8.63507 11.1641 10.354 11.1641Z" fill="black"/>
 </svg>

+ 4 - 0
src/assets/svg/icon-list-withdraw-s.svg

@@ -0,0 +1,4 @@
+<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M17 8.5C17 3.80558 13.1944 0 8.5 0C3.80558 0 0 3.80558 0 8.5C0 13.1944 3.80558 17 8.5 17C13.1944 17 17 13.1944 17 8.5Z" fill="#FFB443"/>
+<path d="M9.63158 5.9V3.5L13.5 7.7L9.63158 11.9V9.44C6.86842 9.44 4.93421 10.4 3.55263 12.5C4.10526 9.5 5.76316 6.5 9.63158 5.9Z" fill="white"/>
+</svg>

+ 75 - 0
src/assets/svg/icon-message-fail.svg

@@ -0,0 +1,75 @@
+<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect width="40" height="40" rx="8" fill="#8554FD"/>
+<g clip-path="url(#clip0_19899_286973)">
+<path d="M20.6698 18.791V27.5443L13.3125 30.9122V21.4326L20.6698 18.791Z" fill="#582701"/>
+<path d="M28.1904 21.5007V30.7899L20.4258 27.4897V18.9121L28.1904 21.5007Z" fill="#582701"/>
+<path d="M21.0101 24.5078V33.9489L13.0898 30.9211V21.5195L21.0101 24.5078Z" fill="#F9CE46"/>
+<path d="M14.3086 24.4258L14.6796 24.5768L14.6969 26.1241L14.9909 26.2439L14.9959 26.7098L14.3309 26.4393L14.3086 24.4258Z" fill="black"/>
+<path d="M15.1289 24.7598L15.5095 24.9146L15.5254 26.3326C15.5263 26.3989 15.5412 26.4572 15.5701 26.5075C15.5993 26.5579 15.6378 26.5928 15.6858 26.6125C15.7357 26.6327 15.7749 26.6281 15.8034 26.5988C15.832 26.5692 15.8458 26.5183 15.8449 26.4461L15.829 25.0447L16.2077 25.1992L16.2223 26.5199C16.2244 26.6999 16.2069 26.8364 16.1699 26.9294C16.1325 27.0224 16.0767 27.0792 16.0026 27.0996C15.9288 27.1198 15.8249 27.1028 15.6909 27.0484C15.4934 26.968 15.3534 26.8489 15.2711 26.6914C15.1891 26.5338 15.1464 26.3067 15.143 26.0101L15.1289 24.7598Z" fill="black"/>
+<path d="M17.3574 27.1976L17.3629 27.6758C17.2848 27.6749 17.2148 27.6618 17.1528 27.6365C16.9383 27.5492 16.7631 27.3791 16.6273 27.1263C16.4915 26.8732 16.4217 26.5848 16.4181 26.2612C16.4147 25.9606 16.4793 25.7399 16.6118 25.5991C16.7443 25.4583 16.9134 25.4299 17.1191 25.5138C17.1993 25.5465 17.273 25.5894 17.3401 25.6426L17.3456 26.1221C17.2742 26.0641 17.207 26.0223 17.1441 25.9967C17.0478 25.9574 16.9685 25.9792 16.9062 26.062C16.8436 26.1447 16.8132 26.27 16.8151 26.4378C16.8172 26.6187 16.8509 26.7748 16.9162 26.9062C16.9816 27.0373 17.0677 27.1246 17.1747 27.1681C17.2266 27.1895 17.2875 27.1993 17.3574 27.1976Z" fill="black"/>
+<path d="M17.5156 25.7324L17.8866 25.8834L17.8976 26.8309L17.9035 26.833L18.243 26.0285L18.6322 26.1872L18.2644 27.0613L18.6391 28.1939L18.2316 28.0279L17.9062 27.0625L17.8998 27.06L17.9094 27.897L17.5384 27.7459L17.5156 25.7324Z" fill="black"/>
+<path d="M18.5977 26.1738L19.0142 26.3436C19.1096 26.6707 19.1791 26.9211 19.2225 27.0948L19.2275 27.097C19.2673 26.9531 19.3308 26.7567 19.418 26.5079L19.8442 26.6815L19.4185 27.6055L19.4285 28.5163L19.053 28.3631L19.0425 27.4523L18.5977 26.1738Z" fill="black"/>
+<path d="M14.3086 24.4258L14.6796 24.5768L14.6969 26.1241L14.9909 26.2439L14.9959 26.7098L14.3309 26.4393L14.3086 24.4258Z" stroke="#8D5500" stroke-width="0.857143"/>
+<path d="M15.1289 24.7598L15.5095 24.9146L15.5254 26.3326C15.5263 26.3989 15.5412 26.4572 15.5701 26.5075C15.5993 26.5579 15.6378 26.5928 15.6858 26.6125C15.7357 26.6327 15.7749 26.6281 15.8034 26.5988C15.832 26.5692 15.8458 26.5183 15.8449 26.4461L15.829 25.0447L16.2077 25.1992L16.2223 26.5199C16.2244 26.6999 16.2069 26.8364 16.1699 26.9294C16.1325 27.0224 16.0767 27.0792 16.0026 27.0996C15.9288 27.1198 15.8249 27.1028 15.6909 27.0484C15.4934 26.968 15.3534 26.8489 15.2711 26.6914C15.1891 26.5338 15.1464 26.3067 15.143 26.0101L15.1289 24.7598Z" stroke="#8D5500" stroke-width="0.857143"/>
+<path d="M17.3574 27.1976L17.3629 27.6758C17.2848 27.6749 17.2148 27.6618 17.1528 27.6365C16.9383 27.5492 16.7631 27.3791 16.6273 27.1263C16.4915 26.8732 16.4217 26.5848 16.4181 26.2612C16.4147 25.9606 16.4793 25.7399 16.6118 25.5991C16.7443 25.4583 16.9134 25.4299 17.1191 25.5138C17.1993 25.5465 17.273 25.5894 17.3401 25.6426L17.3456 26.1221C17.2742 26.0641 17.207 26.0223 17.1441 25.9967C17.0478 25.9574 16.9685 25.9792 16.9062 26.062C16.8436 26.1447 16.8132 26.27 16.8151 26.4378C16.8172 26.6187 16.8509 26.7748 16.9162 26.9062C16.9816 27.0373 17.0677 27.1246 17.1747 27.1681C17.2266 27.1895 17.2875 27.1993 17.3574 27.1976Z" stroke="#8D5500" stroke-width="0.857143"/>
+<path d="M17.5156 25.7324L17.8866 25.8834L17.8976 26.8309L17.9035 26.833L18.243 26.0285L18.6322 26.1872L18.2644 27.0613L18.6391 28.1939L18.2316 28.0279L17.9062 27.0625L17.8998 27.06L17.9094 27.897L17.5384 27.7459L17.5156 25.7324Z" stroke="#8D5500" stroke-width="0.857143"/>
+<path d="M18.5977 26.1738L19.0142 26.3436C19.1096 26.6707 19.1791 26.9211 19.2225 27.0948L19.2275 27.097C19.2673 26.9531 19.3308 26.7567 19.418 26.5079L19.8442 26.6815L19.4185 27.6055L19.4285 28.5163L19.053 28.3631L19.0425 27.4523L18.5977 26.1738Z" stroke="#8D5500" stroke-width="0.857143"/>
+<path d="M14.3086 24.4258L14.6796 24.5768L14.6969 26.1241L14.9909 26.2439L14.9959 26.7098L14.3309 26.4393L14.3086 24.4258Z" fill="#BCCFFF"/>
+<path d="M15.1289 24.7598L15.5095 24.9146L15.5254 26.3326C15.5263 26.3989 15.5412 26.4572 15.5701 26.5075C15.5993 26.5579 15.6378 26.5928 15.6858 26.6125C15.7357 26.6327 15.7749 26.6281 15.8034 26.5988C15.832 26.5692 15.8458 26.5183 15.8449 26.4461L15.829 25.0447L16.2077 25.1992L16.2223 26.5199C16.2244 26.6999 16.2069 26.8364 16.1699 26.9294C16.1325 27.0224 16.0767 27.0792 16.0026 27.0996C15.9288 27.1198 15.8249 27.1028 15.6909 27.0484C15.4934 26.968 15.3534 26.8489 15.2711 26.6914C15.1891 26.5338 15.1464 26.3067 15.143 26.0101L15.1289 24.7598Z" fill="#BCCFFF"/>
+<path d="M17.3574 27.1976L17.3629 27.6758C17.2848 27.6749 17.2148 27.6618 17.1528 27.6365C16.9383 27.5492 16.7631 27.3791 16.6273 27.1263C16.4915 26.8732 16.4217 26.5848 16.4181 26.2612C16.4147 25.9606 16.4793 25.7399 16.6118 25.5991C16.7443 25.4583 16.9134 25.4299 17.1191 25.5138C17.1993 25.5465 17.273 25.5894 17.3401 25.6426L17.3456 26.1221C17.2742 26.0641 17.207 26.0223 17.1441 25.9967C17.0478 25.9574 16.9685 25.9792 16.9062 26.062C16.8436 26.1447 16.8132 26.27 16.8151 26.4378C16.8172 26.6187 16.8509 26.7748 16.9162 26.9062C16.9816 27.0373 17.0677 27.1246 17.1747 27.1681C17.2266 27.1895 17.2875 27.1993 17.3574 27.1976Z" fill="#BCCFFF"/>
+<path d="M17.5156 25.7324L17.8866 25.8834L17.8976 26.8309L17.9035 26.833L18.243 26.0285L18.6322 26.1872L18.2644 27.0613L18.6391 28.1939L18.2316 28.0279L17.9062 27.0625L17.8998 27.06L17.9094 27.897L17.5384 27.7459L17.5156 25.7324Z" fill="#BCCFFF"/>
+<path d="M18.5977 26.1738L19.0142 26.3436C19.1096 26.6707 19.1791 26.9211 19.2225 27.0948L19.2275 27.097C19.2673 26.9531 19.3308 26.7567 19.418 26.5079L19.8442 26.6815L19.4185 27.6055L19.4285 28.5163L19.053 28.3631L19.0425 27.4523L18.5977 26.1738Z" fill="#BCCFFF"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M14.2812 26.9121L14.6276 27.0533C14.8677 27.1509 15.051 27.3093 15.1777 27.5285C15.3047 27.7478 15.3701 28.0193 15.3737 28.3429C15.3764 28.5883 15.3479 28.7739 15.288 28.8996C15.2279 29.0253 15.1429 29.0994 15.0333 29.1219C14.9233 29.144 14.8014 29.128 14.6677 29.0737L14.304 28.9256L14.2812 26.9121ZM14.6568 27.4914L14.67 28.6466C14.7824 28.6802 14.8614 28.6636 14.907 28.5967C14.9526 28.5296 14.9743 28.3975 14.9722 28.2004C14.9707 28.0838 14.9614 27.9817 14.9444 27.8941C14.9271 27.8065 14.902 27.7343 14.8692 27.6774C14.8367 27.6205 14.8049 27.5809 14.7739 27.5584C14.7432 27.5359 14.7042 27.5136 14.6568 27.4914V27.4914Z" fill="black"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M15.5508 27.4277L15.9828 27.6039C16.1576 27.675 16.2961 27.7865 16.3985 27.9384C16.5009 28.09 16.5532 28.2609 16.5553 28.4511C16.5565 28.5487 16.5384 28.6351 16.501 28.7105C16.4637 28.7856 16.4085 28.8317 16.3356 28.8479L16.6423 29.8764L16.2504 29.7168L15.94 28.6777L15.9341 28.6755L15.9441 29.5923L15.5731 29.4413L15.5508 27.4277ZM15.9263 27.9678L15.9318 28.446C16.0959 28.5089 16.1772 28.4713 16.1756 28.3334C16.1744 28.2401 16.1547 28.1656 16.1164 28.1099C16.0778 28.0541 16.0144 28.0068 15.9263 27.9678V27.9678Z" fill="black"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M17.9319 30.4005L17.5463 30.2431L17.4797 29.8813L17.0878 29.7222L17.0267 30.0319L16.6484 29.8779L17.0591 28.041L17.4756 28.2104L17.9319 30.4005ZM17.405 29.491C17.3461 29.1688 17.3011 28.8668 17.2701 28.5849L17.2655 28.5832C17.2391 28.8497 17.201 29.1179 17.1511 29.3878L17.405 29.491Z" fill="black"/>
+<path d="M17.8359 28.3594L18.1923 28.5044L18.4166 29.8042L18.4216 29.806L18.5989 28.6699L18.922 28.8013L19.1289 30.0807L19.134 30.0828L19.3213 28.9639L19.6872 29.1127L19.3181 30.9667L18.9826 30.8302L18.8172 29.8665C18.799 29.761 18.7836 29.6602 18.7712 29.5641L18.7661 29.5619C18.7476 29.7095 18.7341 29.8077 18.7256 29.8563L18.5811 30.6668L18.2507 30.532L17.8359 28.3594Z" fill="black"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M14.2812 26.9121L14.6276 27.0533C14.8677 27.1509 15.051 27.3093 15.1777 27.5285C15.3047 27.7478 15.3701 28.0193 15.3737 28.3429C15.3764 28.5883 15.3479 28.7739 15.288 28.8996C15.2279 29.0253 15.1429 29.0994 15.0333 29.1219C14.9233 29.144 14.8014 29.128 14.6677 29.0737L14.304 28.9256L14.2812 26.9121ZM14.6568 27.4914L14.67 28.6466C14.7824 28.6802 14.8614 28.6636 14.907 28.5967C14.9526 28.5296 14.9743 28.3975 14.9722 28.2004C14.9707 28.0838 14.9614 27.9817 14.9444 27.8941C14.9271 27.8065 14.902 27.7343 14.8692 27.6774C14.8367 27.6205 14.8049 27.5809 14.7739 27.5584C14.7432 27.5359 14.7042 27.5136 14.6568 27.4914V27.4914Z" stroke="#8D5500" stroke-width="0.857143"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M15.5508 27.4277L15.9828 27.6039C16.1576 27.675 16.2961 27.7865 16.3985 27.9384C16.5009 28.09 16.5532 28.2609 16.5553 28.4511C16.5565 28.5487 16.5384 28.6351 16.501 28.7105C16.4637 28.7856 16.4085 28.8317 16.3356 28.8479L16.6423 29.8764L16.2504 29.7168L15.94 28.6777L15.9341 28.6755L15.9441 29.5923L15.5731 29.4413L15.5508 27.4277ZM15.9263 27.9678L15.9318 28.446C16.0959 28.5089 16.1772 28.4713 16.1756 28.3334C16.1744 28.2401 16.1547 28.1656 16.1164 28.1099C16.0778 28.0541 16.0144 28.0068 15.9263 27.9678V27.9678Z" stroke="#8D5500" stroke-width="0.857143"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M17.9319 30.4005L17.5463 30.2431L17.4797 29.8813L17.0878 29.7222L17.0267 30.0319L16.6484 29.8779L17.0591 28.041L17.4756 28.2104L17.9319 30.4005ZM17.405 29.491C17.3461 29.1688 17.3011 28.8668 17.2701 28.5849L17.2655 28.5832C17.2391 28.8497 17.201 29.1179 17.1511 29.3878L17.405 29.491Z" stroke="#8D5500" stroke-width="0.857143"/>
+<path d="M17.8359 28.3594L18.1923 28.5044L18.4166 29.8042L18.4216 29.806L18.5989 28.6699L18.922 28.8013L19.1289 30.0807L19.134 30.0828L19.3213 28.9639L19.6872 29.1127L19.3181 30.9667L18.9826 30.8302L18.8172 29.8665C18.799 29.761 18.7836 29.6602 18.7712 29.5641L18.7661 29.5619C18.7476 29.7095 18.7341 29.8077 18.7256 29.8563L18.5811 30.6668L18.2507 30.532L17.8359 28.3594Z" stroke="#8D5500" stroke-width="0.857143"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M14.2812 26.9121L14.6276 27.0533C14.8677 27.1509 15.051 27.3093 15.1777 27.5285C15.3047 27.7478 15.3701 28.0193 15.3737 28.3429C15.3764 28.5883 15.3479 28.7739 15.288 28.8996C15.2279 29.0253 15.1429 29.0994 15.0333 29.1219C14.9233 29.144 14.8014 29.128 14.6677 29.0737L14.304 28.9256L14.2812 26.9121ZM14.6568 27.4914L14.67 28.6466C14.7824 28.6802 14.8614 28.6636 14.907 28.5967C14.9526 28.5296 14.9743 28.3975 14.9722 28.2004C14.9707 28.0838 14.9614 27.9817 14.9444 27.8941C14.9271 27.8065 14.902 27.7343 14.8692 27.6774C14.8367 27.6205 14.8049 27.5809 14.7739 27.5584C14.7432 27.5359 14.7042 27.5136 14.6568 27.4914V27.4914Z" fill="#FFB047"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M15.5508 27.4277L15.9828 27.6039C16.1576 27.675 16.2961 27.7865 16.3985 27.9384C16.5009 28.09 16.5532 28.2609 16.5553 28.4511C16.5565 28.5487 16.5384 28.6351 16.501 28.7105C16.4637 28.7856 16.4085 28.8317 16.3356 28.8479L16.6423 29.8764L16.2504 29.7168L15.94 28.6777L15.9341 28.6755L15.9441 29.5923L15.5731 29.4413L15.5508 27.4277ZM15.9263 27.9678L15.9318 28.446C16.0959 28.5089 16.1772 28.4713 16.1756 28.3334C16.1744 28.2401 16.1547 28.1656 16.1164 28.1099C16.0778 28.0541 16.0144 28.0068 15.9263 27.9678V27.9678Z" fill="#FFB047"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M17.9319 30.4005L17.5463 30.2431L17.4797 29.8813L17.0878 29.7222L17.0267 30.0319L16.6484 29.8779L17.0591 28.041L17.4756 28.2104L17.9319 30.4005ZM17.405 29.491C17.3461 29.1688 17.3011 28.8668 17.2701 28.5849L17.2655 28.5832C17.2391 28.8497 17.201 29.1179 17.1511 29.3878L17.405 29.491Z" fill="#FFB047"/>
+<path d="M17.8359 28.3594L18.1923 28.5044L18.4166 29.8042L18.4216 29.806L18.5989 28.6699L18.922 28.8013L19.1289 30.0807L19.134 30.0828L19.3213 28.9639L19.6872 29.1127L19.3181 30.9667L18.9826 30.8302L18.8172 29.8665C18.799 29.761 18.7836 29.6602 18.7712 29.5641L18.7661 29.5619C18.7476 29.7095 18.7341 29.8077 18.7256 29.8563L18.5811 30.6668L18.2507 30.532L17.8359 28.3594Z" fill="#FFB047"/>
+<path opacity="0.5" d="M21.0101 24.5068V33.948L20.9737 24.533L13.0898 21.4277L21.0101 24.5068Z" fill="url(#paint0_linear_19899_286973)"/>
+<path d="M28.3723 21.4551V30.9216L21.0117 33.9494V24.5083L28.3723 21.4551Z" fill="#FEB13E"/>
+<path opacity="0.5" d="M28.3723 21.4277L21.0567 24.533L21.0117 33.948V24.5068L28.3723 21.4277Z" fill="url(#paint1_linear_19899_286973)"/>
+<path d="M20.4544 18.8668L28.13 21.4995L21.0091 24.4309L13.2709 21.52L20.4544 18.8668ZM23.9538 21.5029C23.9538 21.3122 23.8505 21.1392 23.6824 20.9903C23.5143 20.8414 23.2751 20.7106 22.9855 20.6023C22.4057 20.3853 21.6093 20.2527 20.7321 20.2527C19.8547 20.2527 19.0582 20.3853 18.4784 20.6023C18.1888 20.7106 17.9495 20.8414 17.7814 20.9903C17.6133 21.1392 17.51 21.3122 17.51 21.5029C17.51 21.6937 17.6133 21.8667 17.7814 22.0155C17.9495 22.1644 18.1888 22.2952 18.4784 22.4035C19.0582 22.6204 19.8547 22.7529 20.7321 22.7529C21.6093 22.7529 22.4057 22.6204 22.9855 22.4035C23.2751 22.2952 23.5143 22.1644 23.6824 22.0155C23.8505 21.8667 23.9538 21.6937 23.9538 21.5029Z" fill="#F9CE46" stroke="#FFD99F" stroke-width="0.142857"/>
+<path d="M28.3707 21.8188L20.4423 18.83L13.0898 21.8188L20.4504 18.791L28.3707 21.8188Z" fill="#FFBF06"/>
+<path d="M21.1016 24.3906L21.1016 33.8871" stroke="#FFD99F" stroke-width="0.142857"/>
+<path opacity="0.3" d="M17.5798 21.6529C17.5798 21.674 17.5809 21.6947 17.5831 21.7154C17.5699 21.666 17.5625 21.616 17.5625 21.5653C17.5625 20.8379 18.9804 20.248 20.7293 20.248C22.4785 20.248 23.8965 20.8379 23.8965 21.5653C23.8965 21.616 23.8891 21.666 23.8758 21.7154C23.878 21.6947 23.8791 21.674 23.8791 21.6529C23.8791 20.9217 22.4689 20.3291 20.7293 20.3291C18.99 20.3291 17.5798 20.9217 17.5798 21.6529Z" fill="white"/>
+<path opacity="0.3" d="M23.9131 21.5195C23.8341 22.1704 22.4395 22.6888 20.7298 22.6888C19.0205 22.6888 17.6259 22.1704 17.5469 21.5195C17.7284 22.1285 19.0843 22.6015 20.7298 22.6015C22.3757 22.6015 23.7316 22.1285 23.9131 21.5195V21.5195Z" fill="white"/>
+<path d="M30.7601 16.0729L27.5989 13.9054C27.5989 13.9054 27.5997 13.9055 27.5991 13.9056C26.3203 14.1207 24.5766 18.0644 24.5766 18.0644L27.9601 20.3845C28.8307 18.6352 29.4745 17.688 30.7601 16.0729Z" fill="#9FA0FF"/>
+<path d="M7.74534 19.0143L9.66943 17.1277C9.66943 17.1277 9.6689 17.1279 9.66929 17.1279C10.581 17.1207 12.2697 19.6383 12.2697 19.6383L10.2103 21.6577C9.39399 20.5528 8.83261 19.9756 7.74534 19.0143Z" fill="#4092B8"/>
+<path d="M9.30037 12.9429L10.4241 11.8411C10.4241 11.8411 10.4238 11.8412 10.424 11.8412C10.9565 11.837 11.9428 13.3074 11.9428 13.3074L10.74 14.4868C10.2632 13.8415 9.93538 13.5044 9.30037 12.9429Z" fill="#3E6EFE"/>
+<path d="M28.0246 10.5505L25.7392 8.98352C25.7392 8.98352 25.7398 8.98362 25.7394 8.98369C24.8148 9.13916 23.5542 11.9903 23.5542 11.9903L26.0003 13.6677C26.6297 12.403 27.0952 11.7182 28.0246 10.5505Z" fill="#AB7BDB"/>
+<path d="M13.0774 10.3453L19.7983 8.48953C19.7983 8.48953 19.7984 8.48953 19.7978 8.48979C21.7693 9.17886 22.5336 17.4329 22.5336 17.4329L15.3399 19.4196C14.8785 15.8952 14.3321 13.8847 13.0774 10.3453Z" fill="url(#paint2_linear_19899_286973)"/>
+<path d="M19.2288 11.3856L19.1635 11.1719C19.1112 11.001 18.9215 10.9106 18.7456 10.9643L16.1778 11.7494C16.002 11.8031 15.8952 11.9842 15.9475 12.1551L16.0128 12.3688C15.5269 12.6218 15.2751 13.1908 15.4411 13.7338C15.6178 14.312 16.2045 14.6494 16.7827 14.5276C17.1517 14.9975 17.769 15.2376 18.3943 15.1261L18.6091 15.7437L17.6041 16.0509C17.5488 16.0678 17.5055 16.1058 17.4786 16.1525C17.4549 16.201 17.4477 16.2582 17.4646 16.3135C17.4984 16.4241 17.6165 16.4869 17.7271 16.4532L20.1391 15.7157C20.2496 15.6819 20.3124 15.5638 20.2786 15.4532C20.2448 15.3426 20.1267 15.2797 20.0161 15.3135L19.0111 15.6208L18.7963 15.0032C19.1476 14.8491 19.425 14.5883 19.5982 14.2743C19.7139 14.0685 19.7819 13.8415 19.8002 13.605C20.3477 13.3827 20.6446 12.7724 20.4686 12.1967C20.3001 11.6545 19.7731 11.3236 19.2288 11.3856ZM15.8431 13.6109C15.7455 13.2917 15.8768 12.9574 16.1396 12.7836L16.5177 14.0204C16.5293 14.0581 16.5441 14.0975 16.5581 14.1345C16.2373 14.1363 15.9407 13.9302 15.8431 13.6109ZM18.6108 12.806L18.4632 13.0957C18.4457 13.1286 18.4447 13.1701 18.4638 13.2055L18.6085 13.4993C18.6528 13.5903 18.5738 13.6914 18.4771 13.6715L18.1861 13.6093C18.1448 13.5999 18.1046 13.6122 18.0755 13.6431L17.8691 13.8574C17.8007 13.9305 17.678 13.8883 17.6638 13.7882L17.6195 13.4636C17.6138 13.4269 17.5922 13.3922 17.5587 13.3723L17.2742 13.2146C17.1881 13.1667 17.1912 13.0421 17.2796 12.9986L17.5547 12.865C17.585 12.8474 17.61 12.8123 17.6176 12.7743L17.661 12.4669C17.6743 12.3666 17.7999 12.3282 17.8695 12.4031L18.0774 12.6337C18.1032 12.6643 18.1436 12.6794 18.1828 12.6729L18.4856 12.6298C18.5831 12.6165 18.6554 12.7181 18.6108 12.806ZM19.7633 13.1518C19.7543 13.1133 19.7453 13.0748 19.733 13.0346L19.3556 11.8004C19.6715 11.8 19.9673 12.0037 20.0641 12.3204C20.1617 12.6397 20.0311 12.9764 19.7633 13.1518Z" fill="#A96F00"/>
+</g>
+<defs>
+<linearGradient id="paint0_linear_19899_286973" x1="-5414.69" y1="18923.5" x2="8676.57" y2="9722.93" gradientUnits="userSpaceOnUse">
+<stop stop-color="white"/>
+<stop offset="0.2" stop-color="white"/>
+<stop offset="0.3" stop-color="#9A969A"/>
+<stop offset="0.5" stop-color="white"/>
+<stop offset="0.6" stop-color="#B7BFC1"/>
+<stop offset="0.7" stop-color="white"/>
+<stop offset="1" stop-color="white"/>
+</linearGradient>
+<linearGradient id="paint1_linear_19899_286973" x1="15888.9" y1="53394.6" x2="44956" y2="35757.2" gradientUnits="userSpaceOnUse">
+<stop stop-color="#DED9D6"/>
+<stop offset="0.3" stop-color="#8B878D"/>
+<stop offset="0.5" stop-color="#F3F4F4"/>
+<stop offset="0.6" stop-color="#807B80"/>
+<stop offset="0.8" stop-color="white"/>
+<stop offset="1" stop-color="#A7A9AC"/>
+</linearGradient>
+<linearGradient id="paint2_linear_19899_286973" x1="16.8665" y1="9.22052" x2="15.5721" y2="15.5427" gradientUnits="userSpaceOnUse">
+<stop stop-color="#FFDD5E"/>
+<stop offset="1" stop-color="#FFCA00"/>
+</linearGradient>
+<clipPath id="clip0_19899_286973">
+<rect width="30" height="30" fill="white" transform="translate(5 5)"/>
+</clipPath>
+</defs>
+</svg>

Datei-Diff unterdrückt, da er zu groß ist
+ 7 - 0
src/assets/svg/icon-message-win.svg


Datei-Diff unterdrückt, da er zu groß ist
+ 5 - 0
src/assets/svg/icon-participate.svg


Datei-Diff unterdrückt, da er zu groß ist
+ 6 - 0
src/assets/svg/icon-preview-clock.svg


Datei-Diff unterdrückt, da er zu groß ist
+ 6 - 0
src/assets/svg/icon-preview-trophy.svg


Datei-Diff unterdrückt, da er zu groß ist
+ 1 - 0
src/assets/svg/icon-reward-v2.svg


+ 4 - 0
src/assets/svg/icon-send-giveaways-mark.svg

@@ -0,0 +1,4 @@
+<svg width="17" height="17" viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M17 8.5C17 3.80558 13.1944 0 8.5 0C3.80558 0 0 3.80558 0 8.5C0 13.1944 3.80558 17 8.5 17C13.1944 17 17 13.1944 17 8.5Z" fill="#FFB443"/>
+<path d="M9.63158 5.9V3.5L13.5 7.7L9.63158 11.9V9.44C6.86842 9.44 4.93421 10.4 3.55263 12.5C4.10526 9.5 5.76316 6.5 9.63158 5.9Z" fill="white"/>
+</svg>

Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 5
src/assets/svg/icon-send-giveaways-s.svg


Datei-Diff unterdrückt, da er zu groß ist
+ 3 - 0
src/assets/svg/icon-setting-white.svg


+ 7 - 0
src/assets/svg/icon-tasks-v2.svg

@@ -0,0 +1,7 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M18.084 4.19981L15.7443 6.53949L15.2388 7.04502C15.0865 7.19733 14.8208 7.19733 14.6685 7.04502L13.1259 5.509C12.9736 5.35669 12.9736 5.11041 13.1259 4.9581L13.6347 4.44934C13.787 4.29703 14.0333 4.29703 14.1856 4.44934L14.9212 5.1655L16.9854 3.11423C17.1378 2.96192 17.384 2.96192 17.5363 3.11423L18.0872 3.64892C18.2363 3.80123 18.2363 4.04751 18.084 4.19981ZM18.084 9.37174L15.7443 11.7114L15.2355 12.2202C15.0832 12.3725 14.8175 12.3725 14.6652 12.2202L13.1259 10.6809C12.9736 10.5286 12.9736 10.2823 13.1259 10.13L13.6347 9.62126C13.787 9.46895 14.0333 9.46895 14.1856 9.62126L14.9212 10.3374L16.9854 8.27319C17.1378 8.12088 17.384 8.12088 17.5363 8.27319L18.0872 8.82408C18.2363 8.97315 18.2363 9.21943 18.084 9.37174Z" fill="#1D9BF0"/>
+<path d="M15.7454 16.4382L18.0851 14.0985C18.2374 13.9462 18.2374 13.7 18.0883 13.5509L17.5374 13C17.3851 12.8477 17.1388 12.8477 16.9865 13L14.9223 15.0642L14.1867 14.3481C14.0344 14.1958 13.7881 14.1958 13.6358 14.3481L13.127 14.8568C12.9747 15.0091 12.9747 15.2554 13.127 15.4077L14.6663 16.947C14.8186 17.0993 15.0843 17.0993 15.2366 16.947L15.7454 16.4382Z" fill="#1D9BF0"/>
+<path d="M2.75 5.25H9.75" stroke="#1D9BF0" stroke-width="1.8" stroke-linecap="round"/>
+<path d="M2.75 10.25H9.75" stroke="#1D9BF0" stroke-width="1.8" stroke-linecap="round"/>
+<path d="M2.75 15.25H9.75" stroke="#1D9BF0" stroke-width="1.8" stroke-linecap="round"/>
+</svg>

+ 73 - 0
src/assets/svg/icon-ticket.svg

@@ -0,0 +1,73 @@
+<svg width="280" height="128" viewBox="0 0 280 128" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g filter="url(#filter0_d_19708_300008)">
+<g clip-path="url(#clip0_19708_300008)">
+<g filter="url(#filter1_d_19708_300008)">
+<rect x="10" y="6" width="260" height="108" fill="#FCAB40"/>
+<rect x="238" y="13" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="28.666" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="40.9766" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="53.2852" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="43.2148" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="71.1914" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="80.1426" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="85.7383" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="82.3809" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="73.4277" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="87.9766" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="100.285" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="91.334" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="102.523" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="62.2383" width="22" height="1.11905" fill="#FFFAD1"/>
+<rect x="238" y="17.4766" width="22" height="3.35714" fill="#FFFAD1"/>
+<rect x="238" y="30.9043" width="22" height="3.35714" fill="#FFFAD1"/>
+<rect x="238" y="45.4531" width="22" height="3.35714" fill="#FFFAD1"/>
+<rect x="238" y="58.8809" width="22" height="2.2381" fill="#FFFAD1"/>
+<rect x="238" y="21.9531" width="22" height="3.35714" fill="#FFFAD1"/>
+<rect x="238" y="35.3809" width="22" height="2.2381" fill="#FFFAD1"/>
+<rect x="238" y="49.9277" width="22" height="2.2381" fill="#FFFAD1"/>
+<rect x="238" y="64.4766" width="22" height="4.47619" fill="#FFFAD1"/>
+<rect x="238" y="93.5723" width="22" height="3.35714" fill="#FFFAD1"/>
+<rect x="238" y="104.762" width="22" height="2.2381" fill="#FFFAD1"/>
+<path d="M41.1475 51.6313H34.791V39.2104H30.0293V55.416H41.1475V51.6313ZM50.2617 38.9297C45.2529 38.9297 42.0971 42.1416 42.0971 47.3188C42.0971 52.4961 45.2417 55.6968 50.2617 55.6968C55.2705 55.6968 58.4262 52.4961 58.4262 47.3188C58.4262 42.1416 55.2705 38.9297 50.2617 38.9297ZM50.2617 42.7256C52.2495 42.7256 53.5747 44.5112 53.5747 47.3188C53.5747 50.1152 52.2607 51.9009 50.2617 51.9009C48.2627 51.9009 46.9487 50.1152 46.9487 47.3188C46.9487 44.5112 48.2739 42.7256 50.2617 42.7256ZM68.1244 55.416V42.9951H72.392V39.2104H59.0951V42.9951H63.3627V55.416H68.1244ZM82.6517 55.416V42.9951H86.9193V39.2104H73.6224V42.9951H77.89V55.416H82.6517ZM100.2 51.6313H93.5291V49.0259H99.7845V45.6118H93.5291V42.9951H100.2V39.2104H88.7674V55.416H100.2V51.6313ZM107.405 42.7256L109.382 42.7256C110.662 42.7256 111.527 43.5903 111.527 44.792C111.527 46.0161 110.707 46.8359 109.37 46.8359L107.405 46.8359V42.7256ZM107.405 49.9805H108.966L111.527 55.416H116.85L113.773 49.2729C115.469 48.4644 116.389 46.6226 116.389 44.7134C116.389 41.2432 114.166 39.2104 109.842 39.2104H102.643V55.416H107.405V49.9805ZM127.379 55.416V50.2837L132.916 39.2104H127.941L125.099 45.7803H125.01L122.168 39.2104H117.081L122.617 50.2837V55.416L127.379 55.416Z" fill="#FFFAD1"/>
+<path d="M40.5137 83V67.8789H45.709V63.2715H29.5215V67.8789H34.7168V83H40.5137ZM53.708 83V63.2715H47.9111V83H53.708ZM65.9726 83.3418C71.2909 83.3418 75.1327 79.9648 75.1601 75.043H69.6093C69.4316 77.3262 67.9823 78.7891 65.9862 78.7891C63.58 78.7891 62.0898 76.6836 62.0898 73.1152C62.0898 69.5879 63.5937 67.4824 65.9726 67.4824C67.9823 67.4824 69.4452 68.9727 69.5819 71.2148H75.1327C75.1191 66.3203 71.1816 62.9297 65.9726 62.9297C59.9433 62.9297 56.1835 66.6211 56.1835 73.1289C56.1835 79.6367 59.9296 83.3418 65.9726 83.3418ZM83.3778 83V77.832L84.9227 75.7539L89.2294 83H95.9696L89.1747 72.0352L95.6688 63.2715H89.5848L83.4872 71.6387H83.3778V63.2715H77.5809V83H83.3778ZM111.488 78.3926H103.367V75.2207H110.982V71.0645H103.367V67.8789H111.488V63.2715L97.5701 63.2715V83H111.488V78.3926ZM124.655 83V67.8789H129.85V63.2715H113.663V67.8789H118.858V83H124.655Z" fill="#FFFAD1"/>
+<rect x="18.1094" y="13.5703" width="209" height="92.587" stroke="#FFFAD1" stroke-width="2"/>
+<path fill-rule="evenodd" clip-rule="evenodd" d="M167.297 12.5664L198.369 12.5664V26.5413C208.972 32.188 216.19 43.3533 216.19 56.2044C216.19 69.0554 208.972 80.2207 198.369 85.8674V101.213L182.833 93.9021L167.297 101.213V86.1063C156.445 80.5397 149.02 69.2392 149.02 56.2044C149.02 43.1695 156.445 31.869 167.297 26.3025V12.5664ZM182.605 86.5919C199.135 86.5919 212.535 73.1919 212.535 56.6622C212.535 40.1325 199.135 26.7325 182.605 26.7325C166.076 26.7325 152.676 40.1325 152.676 56.6622C152.676 73.1919 166.076 86.5919 182.605 86.5919Z" fill="#FFFAD1"/>
+<circle cx="182.377" cy="56.434" r="26.9596" stroke="#FFFAD1" stroke-width="1.82777"/>
+<path d="M168.331 70.6986C168.331 71.4019 168.911 71.9701 169.629 71.9701H181.227V57.0301H168.331V70.6986ZM183.985 71.9701H195.583C196.301 71.9701 196.881 71.4019 196.881 70.6986V57.0301H183.985V71.9701ZM197.53 47.4939H191.544C192.096 46.6436 192.42 45.6344 192.42 44.5536C192.42 41.5299 189.91 39.0703 186.824 39.0703C185.145 39.0703 183.632 39.8014 182.606 40.9537C181.58 39.8014 180.068 39.0703 178.389 39.0703C175.303 39.0703 172.792 41.5299 172.792 44.5536C172.792 45.6344 173.113 46.6436 173.668 47.4939H167.682C166.965 47.4939 166.385 48.0621 166.385 48.7654V54.3282H181.227V47.4939H183.985V54.3282H198.828V48.7654C198.828 48.0621 198.248 47.4939 197.53 47.4939ZM181.227 47.335H178.389C176.823 47.335 175.55 46.0874 175.55 44.5536C175.55 43.0199 176.823 41.7722 178.389 41.7722C179.954 41.7722 181.227 43.0199 181.227 44.5536V47.335ZM186.824 47.335H183.985V44.5536C183.985 43.0199 185.258 41.7722 186.824 41.7722C188.389 41.7722 189.663 43.0199 189.663 44.5536C189.663 46.0874 188.389 47.335 186.824 47.335Z" fill="#FFFAD1"/>
+</g>
+<g style="mix-blend-mode:overlay" opacity="0.6" filter="url(#filter2_f_19708_300008)">
+<path d="M-53.5469 -175.893L471.55 127.272L424.28 209.146L-100.817 -94.0185L-53.5469 -175.893Z" fill="white"/>
+</g>
+</g>
+</g>
+<defs>
+<filter id="filter0_d_19708_300008" x="0.384616" y="0.23077" width="279.231" height="127.231" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
+<feFlood flood-opacity="0" result="BackgroundImageFix"/>
+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
+<feOffset dy="3.84615"/>
+<feGaussianBlur stdDeviation="4.80769"/>
+<feComposite in2="hardAlpha" operator="out"/>
+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0"/>
+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_19708_300008"/>
+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_19708_300008" result="shape"/>
+</filter>
+<filter id="filter1_d_19708_300008" x="5.43058" y="3.25835" width="269.139" height="117.139" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
+<feFlood flood-opacity="0" result="BackgroundImageFix"/>
+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
+<feOffset dy="1.82777"/>
+<feGaussianBlur stdDeviation="2.28471"/>
+<feComposite in2="hardAlpha" operator="out"/>
+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>
+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_19708_300008"/>
+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_19708_300008" result="shape"/>
+</filter>
+<filter id="filter2_f_19708_300008" x="-124.816" y="-199.893" width="620.367" height="433.039" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
+<feFlood flood-opacity="0" result="BackgroundImageFix"/>
+<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
+<feGaussianBlur stdDeviation="12" result="effect1_foregroundBlur_19708_300008"/>
+</filter>
+<clipPath id="clip0_19708_300008">
+<path d="M10 9.84615C10 7.72198 11.722 6 13.8462 6L266.154 6C268.278 6 270 7.72198 270 9.84615V110.154C270 112.278 268.278 114 266.154 114L13.8462 114C11.722 114 10 112.278 10 110.154L10 9.84615Z" fill="white"/>
+</clipPath>
+</defs>
+</svg>

Datei-Diff unterdrückt, da er zu groß ist
+ 6 - 0
src/assets/svg/icon-time.svg


+ 21 - 0
src/assets/svg/icon-win-1.svg

@@ -0,0 +1,21 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect x="0.5" y="0.5" width="19" height="19" rx="9.5" fill="url(#paint0_linear_19985_38886)" stroke="white"/>
+<g filter="url(#filter0_d_19985_38886)">
+<path d="M9.83008 14H11.582V5.54492H9.82422L7.63867 7.0625V8.65625L9.79492 7.16797H9.83008V14Z" fill="white"/>
+</g>
+<defs>
+<filter id="filter0_d_19985_38886" x="7.63867" y="5.54492" width="4.44336" height="8.95508" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
+<feFlood flood-opacity="0" result="BackgroundImageFix"/>
+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
+<feOffset dx="0.5" dy="0.5"/>
+<feComposite in2="hardAlpha" operator="out"/>
+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>
+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_19985_38886"/>
+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_19985_38886" result="shape"/>
+</filter>
+<linearGradient id="paint0_linear_19985_38886" x1="14.4444" y1="-1.66667" x2="2.77778" y2="22.2222" gradientUnits="userSpaceOnUse">
+<stop stop-color="#FEDE24"/>
+<stop offset="1" stop-color="#DFBF00"/>
+</linearGradient>
+</defs>
+</svg>

+ 21 - 0
src/assets/svg/icon-win-2.svg

@@ -0,0 +1,21 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect x="0.5" y="0.5" width="19" height="19" rx="9.5" fill="url(#paint0_linear_19985_38889)" stroke="white"/>
+<g filter="url(#filter0_d_19985_38889)">
+<path d="M6.87695 8.08789V8.11719H8.51758V8.08789C8.51758 7.30859 9.12109 6.73438 9.94141 6.73438C10.7266 6.73438 11.2832 7.23828 11.2832 7.87109C11.2832 8.45703 11.0195 8.88477 10.1641 9.74023L6.97656 12.8105V14H13.123V12.5938H9.30859V12.5586L11.3711 10.5723C12.3027 9.64648 13.0059 8.85547 13.0059 7.80078C13.0059 6.38867 11.7812 5.35742 10 5.35742C8.1543 5.35742 6.87695 6.48828 6.87695 8.08789Z" fill="white"/>
+</g>
+<defs>
+<filter id="filter0_d_19985_38889" x="6.87695" y="5.35742" width="6.74609" height="9.14258" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
+<feFlood flood-opacity="0" result="BackgroundImageFix"/>
+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
+<feOffset dx="0.5" dy="0.5"/>
+<feComposite in2="hardAlpha" operator="out"/>
+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>
+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_19985_38889"/>
+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_19985_38889" result="shape"/>
+</filter>
+<linearGradient id="paint0_linear_19985_38889" x1="7.77778" y1="20" x2="20" y2="3.33333" gradientUnits="userSpaceOnUse">
+<stop stop-color="#AFC3D2"/>
+<stop offset="1" stop-color="#CCDBE7"/>
+</linearGradient>
+</defs>
+</svg>

+ 21 - 0
src/assets/svg/icon-win-3.svg

@@ -0,0 +1,21 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect x="0.5" y="0.5" width="19" height="19" rx="9.5" fill="url(#paint0_linear_19985_38892)" stroke="white"/>
+<g filter="url(#filter0_d_19985_38892)">
+<path d="M8.875 10.3086H9.91797C10.873 10.3086 11.4531 10.7773 11.4531 11.5508C11.4531 12.2656 10.832 12.7637 9.94727 12.7637C9.01562 12.7637 8.42969 12.2949 8.37695 11.5801H6.68359C6.76562 13.1387 8.01367 14.1875 9.92383 14.1875C11.875 14.1875 13.252 13.1797 13.252 11.6621C13.252 10.4902 12.4375 9.72852 11.1777 9.62305V9.58789C12.2148 9.40039 12.9238 8.65039 12.9238 7.61328C12.9238 6.25977 11.7227 5.35742 9.96484 5.35742C8.13086 5.35742 6.91211 6.37695 6.84766 7.94141H8.47656C8.52344 7.20312 9.06836 6.7168 9.88867 6.7168C10.7676 6.7168 11.2539 7.16797 11.2539 7.85352C11.2539 8.55078 10.709 9.03125 9.90039 9.03125H8.875V10.3086Z" fill="white"/>
+</g>
+<defs>
+<filter id="filter0_d_19985_38892" x="6.68359" y="5.35742" width="7.06836" height="9.33008" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
+<feFlood flood-opacity="0" result="BackgroundImageFix"/>
+<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
+<feOffset dx="0.5" dy="0.5"/>
+<feComposite in2="hardAlpha" operator="out"/>
+<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"/>
+<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_19985_38892"/>
+<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_19985_38892" result="shape"/>
+</filter>
+<linearGradient id="paint0_linear_19985_38892" x1="7.77778" y1="17.7778" x2="20" y2="3.33333" gradientUnits="userSpaceOnUse">
+<stop stop-color="#D5AD88"/>
+<stop offset="1" stop-color="#F3DCC7"/>
+</linearGradient>
+</defs>
+</svg>

+ 3 - 0
src/assets/svg/icon-win-time.svg

@@ -0,0 +1,3 @@
+<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M11 0C4.93429 0 0 4.93429 0 11C0 17.0657 4.93429 22 11 22C17.0657 22 22 17.0657 22 11C22 4.93429 17.0657 0 11 0ZM14.9105 12.5714H10.2182C9.7845 12.5714 9.42857 12.2163 9.42857 11.7818V5.52671C9.42857 5.093 9.78057 4.741 10.2143 4.741C10.648 4.741 11 5.093 11 5.52671V11H14.9105C15.345 11 15.6962 11.352 15.6962 11.7857C15.6962 12.2202 15.3442 12.5714 14.9105 12.5714Z" fill="#1D9BF0"/>
+</svg>

Datei-Diff unterdrückt, da er zu groß ist
+ 6 - 0
src/assets/svg/icon-win.svg


+ 3 - 0
src/assets/svg/icon-winner-v2.svg

@@ -0,0 +1,3 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M10 10C12.4866 10 14.5 7.98657 14.5 5.5C14.5 3.01343 12.4866 1 10 1C9.409 0.999831 8.82377 1.11611 8.27772 1.3422C7.73168 1.56828 7.23554 1.89975 6.81764 2.31764C6.39975 2.73554 6.06828 3.23168 5.8422 3.77773C5.61611 4.32377 5.49983 4.909 5.5 5.5C5.5 7.98657 7.51343 10 10 10ZM10 11.2857C6.99657 11.2857 1 13.0086 1 16.4286V19H19V16.4286C19 13.0086 13.0034 11.2857 10 11.2857Z" fill="#1D9BF0"/>
+</svg>

Datei-Diff unterdrückt, da er zu groß ist
+ 46 - 0
src/assets/svg/img-A0.svg


Datei-Diff unterdrückt, da er zu groß ist
+ 46 - 0
src/assets/svg/img-A1.svg


Datei-Diff unterdrückt, da er zu groß ist
+ 44 - 0
src/assets/svg/img-B0.svg


Datei-Diff unterdrückt, da er zu groß ist
+ 44 - 0
src/assets/svg/img-B1.svg


+ 16 - 0
src/assets/svg/img-preview-draw-bg.svg

@@ -0,0 +1,16 @@
+<svg width="375" height="500" viewBox="0 0 375 500" fill="none" xmlns="http://www.w3.org/2000/svg">
+<rect width="375" height="500" fill="url(#paint0_linear_19822_278074)"/>
+<g clip-path="url(#clip0_19822_278074)">
+<rect x="284.926" y="-27" width="152" height="31" transform="rotate(40 284.926 -27)" fill="#FFBB55"/>
+<path d="M309.266 18.332L304.682 14.4856L310.638 7.38815L308.463 5.56327L300.814 14.6792L307.573 20.3505L309.266 18.332ZM320.664 15.5128C317.851 13.1525 314.176 13.4861 311.892 16.2079C309.608 18.9296 309.918 22.607 312.731 24.9673C315.544 27.3276 319.219 26.994 321.503 24.2723C323.787 21.5505 323.477 17.8731 320.664 15.5128ZM318.916 17.5965C320.4 18.8422 320.548 20.8082 319.237 22.3709C317.926 23.9336 315.964 24.1294 314.479 22.8837C312.995 21.638 312.847 19.672 314.158 18.1092C315.469 16.5465 317.431 16.3507 318.916 17.5965ZM333.407 26.4936L325.834 20.1394L324.14 22.1579L326.842 24.4253L320.887 31.5227L323.062 33.3476L329.017 26.2502L331.713 28.5122L333.407 26.4936ZM341.661 33.42L334.089 27.0658L332.395 29.0843L335.097 31.3517L329.142 38.4491L331.316 40.274L337.272 33.1766L339.968 35.4386L341.661 33.42ZM343.856 47.4559L339.05 43.4236L340.449 41.7567L344.948 45.5321L346.587 43.5787L342.088 39.8033L343.41 38.2276L348.19 42.2379L349.834 40.278L342.88 34.4428L335.231 43.5587L342.211 49.4158L343.856 47.4559ZM351.58 41.7427L343.931 50.8586L346.105 52.6835L348.968 49.2715L349.287 49.5392L348.827 54.9673L351.419 57.1419L351.719 51.4684C353.572 52.5793 355.336 52.3284 356.549 50.8829C358.057 49.0858 357.798 46.9605 355.545 45.0701L351.58 41.7427ZM353.864 47.0212C354.632 47.6659 354.876 48.3806 354.335 49.0253C353.788 49.6764 353.05 49.5781 352.268 48.9225L350.504 47.4418L352.099 45.5405L353.864 47.0212ZM368.351 55.8157L365.903 53.7613L360.811 55.6911L361.82 50.3356L359.301 48.2212L358.049 56.7472L355.115 60.2438L357.297 62.0741L360.242 58.5645L368.351 55.8157Z" fill="white"/>
+</g>
+<defs>
+<linearGradient id="paint0_linear_19822_278074" x1="56.5" y1="500" x2="227" y2="106" gradientUnits="userSpaceOnUse">
+<stop stop-color="#3438FF"/>
+<stop offset="1" stop-color="#8B56FC"/>
+</linearGradient>
+<clipPath id="clip0_19822_278074">
+<rect width="110" height="94" fill="white" transform="translate(265)"/>
+</clipPath>
+</defs>
+</svg>

Datei-Diff unterdrückt, da er zu groß ist
+ 5 - 0
src/assets/svg/img-preview-draw-open.svg


+ 23 - 4
src/entry/background.js

@@ -20,10 +20,11 @@ import {
     windwoLoadSetPopupPage,
     setActionPopup,
     getTwitterNftPostPre,
-    nftTxtPublish
+    nftTxtPublish,
+    getLuckMessage
 } from "@/logic/background/twitter";
-
-import { PingPong } from "@/logic/background/help";
+import Report from "@/log-center/log"
+import { PingPong, httpNetWork } from "@/logic/background/help";
 
 import {
     facebookShareSuccess
@@ -58,6 +59,9 @@ chrome.alarms.onAlarm.addListener(function (alarm) {
         case 'PingPong':
             PingPong()
             break;
+        case 'LuckMessage':
+            getLuckMessage()
+            break
     }
 });
 
@@ -81,10 +85,22 @@ function onInstalledMethod() {
         //開始後每一分鐘執行一次(該值不能小于1) 
         periodInMinutes: 4
     });
+    chrome.alarms.create('LuckMessage', {
+        //1分鐘之後開始(該值不能小於1) 
+        delayInMinutes: 1,
+        //開始後每一分鐘執行一次(該值不能小于1) 
+        periodInMinutes: 1
+    });
+    setTimeout(() => {
+        // 安装成功埋点
+        Report.reportLog({
+            objectType: Report.objectType.chrome_extension_installed
+        });
+    }, 5000);
 }
 
 function onMessageMethod(req, sender, sendResponse) {
-    sendResponse('')
+    sendResponse('ok')
     if (req) {
         switch (req.actionType) {
             case "POPUP_LOGIN":
@@ -140,6 +156,9 @@ function onMessageMethod(req, sender, sendResponse) {
             case 'CONTENT_NFT_TXT_PUBLISH':
                 nftTxtPublish(req.data, sender)
                 break
+            case 'CONTENT_HTTP_NET_WORK':
+                httpNetWork(req.funcName, req.data, sender)
+                break
         }
     }
 }

+ 8 - 5
src/entry/content.js

@@ -36,7 +36,8 @@ import {
     selectGroupTab,
     setGroupInfo,
     refreshTabGroup,
-    groupTipsSelectGroupTab
+    groupTipsSelectGroupTab,
+    TwitterApiUserByScreenName
 } from "@/logic/content/twitter.js";
 
 import { 
@@ -104,6 +105,7 @@ window.onmessage = (res) => {
 
 
 chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
+    sendResponse('ok')
     switch (req.actionType) {
         case 'BG_SHOW_PIN_TIPS':
             showPinTips()
@@ -180,8 +182,9 @@ chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
             break
         case 'BACK_NFT_PUBLISH_DONE':
             refreshTabGroup()
-            break
+            break 
+        case 'IFRAME_API_GET_TWEET_USER_INFO_REQ':
+            TwitterApiUserByScreenName(req.data)
+            break;
     }
-})
-
-
+})

+ 29 - 11
src/entry/content_help.js

@@ -2,27 +2,45 @@ import {
     appendPopupPage,
     tiggerInjectPopupPage
 } from "@/logic/content/twitter.js";
+import { createApp } from 'vue'
+import ViewMessage from '@/view/content/message/index.vue'
 
-window.onload = () => {
-    appendPopupPage();
-    chrome.runtime.sendMessage({ 
-        actionType: "CONTENT_WINDOW_LOADED_SET_POPUP_PAGE", 
-        data: { } 
+const addDomMessage = (element) => {
+    const div = document.createElement('div')
+    div.id = 'denet_message'
+    document.body.appendChild(div)
+    createApp(element).mount('#denet_message')
+}
+
+let timer = setInterval(() => {
+    if (document.body) {
+        init()
+        clearInterval(timer)
+    }
+}, 1000)
+
+const init = () => {
+    // appendPopupPage();
+    addDomMessage(ViewMessage)
+
+    chrome.runtime.sendMessage({
+        actionType: "CONTENT_WINDOW_LOADED_SET_POPUP_PAGE",
+        data: {}
     }, () => { });
-};
+}
+
 
-chrome.runtime.sendMessage({ 
-    actionType: "CONTENT_SET_POPUP_CONFIG", 
+chrome.runtime.sendMessage({
+    actionType: "CONTENT_SET_POPUP_CONFIG",
     data: {
         popup: 'popup.html'
-    } 
+    }
 }, () => { });
 
 chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
-    sendResponse('')
+    sendResponse('ok')
     switch (req.actionType) {
         case 'BACK_PING':
-            console.log('BACK_PING')
             chrome.runtime.sendMessage({ actionType: "CONTENT_PONG", data: '1' }, (res) => { console.log(res) })
             break
         case 'BG_INJECT_EXTENSION_POPUP':

+ 2 - 1
src/entry/popup.js

@@ -7,7 +7,7 @@ const app = createApp(App)
 import router from '@/router/popup.js'
 import "ant-design-vue/dist/antd.css"; // or 'ant-design-vue/dist/antd.less'
 
-import {Button,message,Tooltip} from "ant-design-vue";
+import {Button,message,Tooltip,Switch} from "ant-design-vue";
 
 
 message.config({
@@ -18,6 +18,7 @@ message.config({
 app.use(Button);
 app.use(message)
 app.use(Tooltip)
+app.use(Switch)
 
 
 app.use(router)

+ 1 - 1
src/http/configAPI.js

@@ -1,4 +1,4 @@
-export const appVersionCode = 11
+export const appVersionCode = 12
 
 const api = {
 	production: 'https://api.denetme.net',

+ 4 - 1
src/http/fetch.js

@@ -1,7 +1,7 @@
 import { appVersionCode, baseAPIUrl } from '@/http/configAPI.js'
 import { getChromeStorage } from '@/uilts/chromeExtension.js'
 
-export async function commonFetch({ url, method = 'POST' , params = {}, baseInfo = {}}) {
+export async function commonFetch({ url = '', method = 'POST' , params = {}, baseInfo = {}}) {
 
     let storage_mid = await getChromeStorage('mid') || ''
     const { mid } = storage_mid || {}
@@ -18,6 +18,9 @@ export async function commonFetch({ url, method = 'POST' , params = {}, baseInfo
 
     return new Promise(function (resolve, reject) {
         let _url = baseAPIUrl + url
+        if(url.includes('http')){
+            _url = url
+        }
         fetch(_url, {
             method: method, // or 'PUT'
             cache: 'no-cache',

+ 17 - 6
src/http/logApi.js

@@ -1,11 +1,22 @@
 import { service } from "./request";
 import { logAPIUrl } from '@/http/configAPI.js'
+import { commonFetch } from '@/http/fetch'
 
-export function logApi(params) {
-    return service({
-        url: `${logAPIUrl}/statistics/uploadLogFromFrontend
-        `,
-        method: 'post',
-        data: params
+// export function logApi(params) {
+//     return service({
+//         url: `${logAPIUrl}/statistics/uploadLogFromFrontend
+//         `,
+//         method: 'post',
+//         data: params
+//     })
+// }
+
+export function logApi(params = {}) {
+    return commonFetch({
+        url: `${logAPIUrl}/statistics/uploadLogFromFrontend`,
+        baseInfo: {
+            pageSource: params.params.pageSource || ''
+        },
+        params: params.params
     })
 }

+ 17 - 0
src/http/user.js

@@ -0,0 +1,17 @@
+import { service } from "./request";
+
+export function getSetting(params) {
+    return service({
+        url: `/user/setting/get`,
+        method: "post",
+        data: params,
+    });
+}
+
+export function putSetting(params) {
+    return service({
+        url: `/user/setting/update`,
+        method: "post",
+        data: params,
+    });
+}

+ 3 - 2
src/iframe/home.js

@@ -6,7 +6,7 @@ const app = createApp(App)
 // 引入路由对象实例
 import router from '@/router/popup.js'
 import "ant-design-vue/dist/antd.css"; // or 'ant-design-vue/dist/antd.less'
-import { Button, message, Tooltip } from "ant-design-vue";
+import { Button, message, Tooltip, Switch } from "ant-design-vue";
 
 message.config({
     top: `10px`,
@@ -15,10 +15,11 @@ message.config({
 });
 app.use(Tooltip);
 app.use(Button);
+app.use(Switch)
 app.use(message);
 app.use(router)
 app.mount('#app')
 
-window.onload= () => {
+window.onload = () => {
     document.title = 'DeNet'
 }

+ 4 - 2
src/iframe/red-packet.js

@@ -1,17 +1,19 @@
 import { createApp } from 'vue'
-import App from '@/view/iframe/red-packet/red-packet.vue'
+import App from '@/view/iframe/red-packet/index.vue'
 const app = createApp(App)
 
 // 引入路由对象实例
 import "ant-design-vue/dist/antd.css"; // or 'ant-design-vue/dist/antd.less'
 import "@/assets/css/reset.css";
 
-import { message, Tooltip } from "ant-design-vue";
+import { message, Tooltip, Switch } from "ant-design-vue";
 message.config({
     top: `10px`,
     duration: 3,
     maxCount: 1,
 });
 app.use(Tooltip);
+app.use(Switch);
+
 app.use(message)
 app.mount('#app')

+ 13 - 3
src/log-center/logEnum.js

@@ -32,12 +32,22 @@ export const objectType = {
     follow: 'follow',
     retweet: 'retweet',
     like: 'like',
+    comment_and_tag: 'comment-and-tag',
+    join_discord: 'discord',
+    share_facebook: 'share-facebook',
+
     // 查看已领取红包列表
     received_list: 'received-list',
     // 点击检测任务
     get_giveaway: 'get-giveaway',
     // 成功领取到钱包
     wallet_button: 'wallet-button',
+    // 卡片解析
+    parse_card_error: 'parse-card-error',
+    // 安装成功
+    chrome_extension_installed: 'chrome-extension-installed',
+    // 发送事件异常
+    chrome_extension_sendmessage_error: 'chrome-extension-sendmessage-error'
 }
 
 export const pageSource = {
@@ -68,10 +78,10 @@ export const pageSource = {
     // 成功领取到钱包
     received_success_page: 'received-success-page',
     received_empty_rewards_page: 'received-empty-rewards-page',
-    
+
 }
 
 export const extParams = {
-    success:'success',
-    failure:'failure'
+    success: 'success',
+    failure: 'failure'
 }

+ 33 - 18
src/log-center/logger.js

@@ -1,26 +1,39 @@
-import {logApi} from '@/http/logApi'
+import { logApi } from '@/http/logApi'
 import { getBrowser } from '@/uilts/help.js';
 import { logType } from './logEnum.js';
+import { getChromeStorage } from '@/uilts/chromeExtension'
 
-
+let userInfo = null;
+let mid = '';
 /**
  * @eventData 以键值对存储,会在最终上报里解开的参数
  * @extParams 最终上报到阿里云以json字符串存储的参数,如果extparams传入的不是obj会转换成obj
  */
-export function reportLog(eventData = {}, extParams = {}) {
+export async function reportLog(eventData = {}, extParams = {}) {
+    if (!userInfo) {
+        userInfo = await getChromeStorage('userInfo') || null;
+    }
+    if (!mid) {
+        mid = await getChromeStorage('mid') || '';
+    }
     if (chrome && chrome.tabs) {
         chrome.tabs.getCurrent((tab) => {
-            let isMobile = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
-            let { url = '' } = tab;
-            let platform = isMobile ? `mobile` : `pc`;
-            let browser = getBrowser();
-            let extData = {
-                url,
-                platform,
-                browser,
-                ...extParams,
+            if (tab && tab.url) {
+                let isMobile = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
+                let { url = '' } = tab;
+                let platform = isMobile ? `mobile` : `pc`;
+                let browser = getBrowser();
+                let extData = {
+                    url,
+                    platform,
+                    browser,
+                    twitterId: userInfo && userInfo.nickName || '',
+                    ...eventData,
+                }
+                paramsPretreatmentAndRequest(logType.denet, extData, extParams)
+            }else{
+                paramsPretreatmentAndRequest(logType.denet, eventData, extParams)
             }
-            paramsPretreatmentAndRequest(logType.denet, eventData, extData)
         })
     } else {
         paramsPretreatmentAndRequest(logType.denet, eventData, extParams)
@@ -31,16 +44,18 @@ function paramsPretreatmentAndRequest(logType, eventData, extParams) {
     extParams = wrapObject(extParams)
     let obj = {};
     let pageSource = eventData.pageSource;
-    if(eventData.hasOwnProperty('pageSource')) {
+    if (eventData.hasOwnProperty('pageSource')) {
         delete eventData.pageSource;
     }
     obj.logType = logType;
     obj.eventData = JSON.stringify(eventData)
     obj.extParams = JSON.stringify(extParams)
-    logApi({params: {
-        pageSource,
-        ...obj
-    }})
+    logApi({
+        params: {
+            pageSource,
+            ...obj
+        }
+    })
 }
 
 function wrapObject(extParams) {

+ 13 - 0
src/logic/background/fetch/twitter.js

@@ -112,4 +112,17 @@ export async function fetchPublish(params = {}) {
         },
         params
     })
+}
+// 获取所有未读消息
+export async function fetchGetAllUnReadNotices(params = {}) {
+    const { accessToken: token = '', uid = '' } = await getChromeStorage('userInfo') || {}
+    if (!token) {
+        return new Promise(function (resolve, reject) {
+            resolve({});
+        })
+    }
+    return commonFetch({
+        url: '/notice/getAllUnReadNotices',
+        params
+    })
 }

+ 27 - 2
src/logic/background/help.js

@@ -1,10 +1,35 @@
+import { commonFetch } from '@/http/fetch'
+
 // 每4分钟调用一次,保持background一直有效
-export function PingPong(){
+export function PingPong() {
     chrome.tabs.query({}, (tabs = []) => {
         if (tabs.length) {
             let tab = tabs.filter((item) => { return item.active == true })
             if (tab.length) {
-                chrome.tabs.sendMessage(tab[0].id, { actionType: 'BACK_PING' }, (res) => { console.log(res) });
+                chrome.tabs.sendMessage(tab[0].id, { actionType: 'BACK_PING' }, () => { });
+            }
+        }
+    })
+}
+
+export function httpNetWork(funcName, data, sender) {
+    return commonFetch(data)
+        .then((response) => {
+            chrome.tabs.sendMessage(sender.tab.id, { actionType: 'BACK_HTTP_RESPONSE', data: response, funcName });
+        })
+        .catch(() => {
+            chrome.tabs.sendMessage(sender.tab.id, { actionType: 'BACK_HTTP_RESPONSE', data: null, funcName });
+        })
+}
+
+// 向content 发送消息
+export const setContentMessage = (obj) => {
+    chrome.tabs.query({}, (tabs = []) => {
+        if (tabs.length) {
+            let tab = tabs.filter((item) => { return item.active == true }) || []
+            if (tab.length) {
+                // 未读消息
+                chrome.tabs.sendMessage(tab[0].id, obj);
             }
         }
     })

+ 19 - 7
src/logic/background/twitter.js

@@ -1,7 +1,8 @@
-import { fetchTtwitterRequestToken, fetchTwitterLogin, fetchTwitterShortUrl, fetchAllMessageInfo, fetchReadTaskAllMsg, getDiscordUserInfo, fetchGetTwitterNftPostPre, fetchPublish } from '@/logic/background/fetch/twitter.js'
+import { fetchTtwitterRequestToken, fetchTwitterLogin, fetchTwitterShortUrl, fetchAllMessageInfo, fetchReadTaskAllMsg, getDiscordUserInfo, fetchGetTwitterNftPostPre, fetchPublish, fetchGetAllUnReadNotices } from '@/logic/background/fetch/twitter.js'
 import { LANDING_PAGE, LANDING_PAGE_MID, setChromeStorage, setChromeCookie, getChromeCookie, getChromeStorage, removeChromeCookie } from '@/uilts/chromeExtension.js'
 import { guid } from '@/uilts/help.js'
 import { pageUrl, discordAuthRedirectUri } from '@/http/configAPI'
+import { setContentMessage } from '@/logic/background/help.js'
 
 let authToken = ''
 let consumerKey = ''
@@ -284,9 +285,11 @@ export function onInstalledCreateTab() {
                             // setChromeStorage({ groupTabData: JSON.stringify({
                             //     deTabVal: 'deGroupTab'
                             // })})
-                            chrome.storage.local.set({ groupTabData: JSON.stringify({
-                                deTabVal: 'deGroupTab'
-                            })}, (res)=> {
+                            chrome.storage.local.set({
+                                groupTabData: JSON.stringify({
+                                    deTabVal: 'deGroupTab'
+                                })
+                            }, (res) => {
                                 let url = `https://twitter.com/${twitterAccount}`
                                 chrome.tabs.create({
                                     url
@@ -428,6 +431,15 @@ export const setPopupConfig = (activeInfo) => {
     })
 }
 
+export const getLuckMessage = () => {
+    // 请求通知接口
+    fetchGetAllUnReadNotices({})
+        .then((res) => {
+            // 向选中的content发送消息
+            setContentMessage({ actionType: 'BACK_UNREAD_MESSAGE', data: res })
+        })
+}
+
 export const windwoLoadSetPopupPage = (data, sender) => {
     let { url = '' } = sender.tab;
     if (url.startsWith('chrome://')) {
@@ -466,16 +478,16 @@ export const setActionPopup = (data) => {
 
 export const getTwitterNftPostPre = (params, sender) => {
     fetchGetTwitterNftPostPre(params).then((res) => {
-        if(res.code == 0){
+        if (res.code == 0) {
             chrome.tabs.sendMessage(sender.tab.id, { actionType: 'BACK_TWITTER_NFT_POST_PRE', data: res.data }, (res) => { console.log(res) });
         }
     })
 }
 
 
-export const nftTxtPublish = (params,sender) => {
+export const nftTxtPublish = (params, sender) => {
     fetchPublish(params).then((res) => {
-        if(res.code == 0){
+        if (res.code == 0) {
             chrome.tabs.sendMessage(sender.tab.id, { actionType: 'BACK_NFT_PUBLISH_DONE', data: res.data }, (res) => { console.log(res) });
         }
     })

+ 13 - 8
src/logic/content/ParseCard.js

@@ -228,7 +228,7 @@ class ParseCard {
         return _array
     }
 
-    createIframe({ post_Id = '', tweet_Id = '', tweet_author = '' }, if_center = false) {
+    createIframe({ post_Id = '', tweet_Id = '', tweet_author = '', page_type = '' }, if_center = false) {
         let _iframe = document.createElement('iframe')
         let _iframe_url = ''
         let tweet_str = ''
@@ -236,9 +236,9 @@ class ParseCard {
             tweet_str = `&tweetId=${tweet_Id}`
         }
         _iframe.id = post_Id
-        _iframe_url =  chrome.runtime.getURL('/iframe/red-packet.html') + `?postId=${post_Id}${tweet_str}&tweet_author=${tweet_author}&window_origin=${window.location.origin}`;
+        _iframe_url = chrome.runtime.getURL('/iframe/red-packet.html') + `?postId=${post_Id}${tweet_str}&tweet_author=${tweet_author}&window_origin=${window.location.origin}&page_type=${page_type}`;
         // debugger mode
-        if(window.location.href.includes('denet_debugger')){
+        if (window.location.href.includes('denet_debugger')) {
             _iframe_url = _iframe_url + '&denet_debugger=1'
         }
         _iframe.src = _iframe_url
@@ -257,7 +257,7 @@ class ParseCard {
         _iframe.style.cssText = 'border:medium none; width:375px; min-height:300px;'
         return _iframe
     }
-    createNftGroupIframe({ project_Id, tweet_Id}) {
+    createNftGroupIframe({ project_Id, tweet_Id }) {
         let _iframe = document.createElement('iframe')
         _iframe.id = project_Id
         _iframe.src = chrome.runtime.getURL('/iframe/nft-group-card.html') + `?projectId=${project_Id}&tweet_Id=${tweet_Id}`;
@@ -330,7 +330,7 @@ class ParseCard {
         }
         return false
     }
-    replaceDOMRedPacket({ dom_card, tweet_Id, post_Id, time, short_url }) {
+    replaceDOMRedPacket({ dom_card, tweet_Id, post_Id, time, short_url, page_type = '' }) {
         if (!dom_card || !dom_card.parentElement) {
             return
         }
@@ -363,7 +363,7 @@ class ParseCard {
                 `
                 dom.parentElement.appendChild(div)
             }
-            dom.appendChild(this.createIframe({ post_Id, tweet_Id }))
+            dom.appendChild(this.createIframe({ post_Id, tweet_Id, page_type }))
         }
     }
     replaceNftDomRedPacket({ dom_card, tweet_Id, post_Id, time, short_url }) {
@@ -406,7 +406,12 @@ class ParseCard {
             let originUrl = new URL(short_url);
             let post_Id = originUrl.pathname.slice(1);
 
-            dom.appendChild(this.createIframe({ post_Id, tweet_author }, true))
+            if (post_Id.indexOf('luckdraw/') >= 0) {
+                post_Id = post_Id.replace('luckdraw/', '');
+                dom.appendChild(this.createIframe({ post_Id, tweet_author, page_type:'抽奖' }, true))
+            } else {
+                dom.appendChild(this.createIframe({ post_Id, tweet_author }, true))
+            }
         }
     }
     replaceNftGroupDomRedPacket({ dom_card, tweet_Id, post_Id, time, short_url }) {
@@ -427,7 +432,7 @@ class ParseCard {
         dom.style = 'min-height:180px'
         if (dom) {
             let project_Id = post_Id.replace('nft_group/', '');
-            dom.appendChild(this.createNftGroupIframe({ project_Id,tweet_Id }))
+            dom.appendChild(this.createNftGroupIframe({ project_Id, tweet_Id }))
         }
     }
 }

+ 21 - 2
src/logic/content/nft.js

@@ -6,6 +6,8 @@ import { jumpTwitterDetailByAlert } from '@/logic/content/help/twitter.js'
 
 var ifShowNftGroup = false;
 var tempNftGroupPost = null;
+var groupImgNoSelect = require("@/assets/img/icon-nft-group-entry.png");
+var groupImgSelect = require("@/assets/img/icon-nft-group-select.png");
 
 export const showNFTGroupIcon = () => {
     let urlInfo = new URL(window.location.href)
@@ -17,7 +19,7 @@ export const showNFTGroupIcon = () => {
         let oDiv = document.createElement(`div`);
             oDiv.id = 'de-nft-group-enter';
         let oImg = document.createElement('img');
-            oImg.src = require("@/assets/img/icon-nft-group-entry.png");
+            oImg.src = groupImgNoSelect;
             oImg.className = 'addGroup';
             oDiv.innerHTML = `
                 ${oImg.outerHTML}
@@ -112,6 +114,7 @@ export const setPostContent = (res) => {
         if (inputEle) {
             inputEle.focus();
         }
+        setGroupIconStatus();
     }, 100).then(() => {
         _setPublishContent(res.srcContent + ' ');
     })
@@ -168,6 +171,7 @@ export const setNFTGroupContent = (res) => {
 
 export const elemAddEventListener = (elem, action, fn) => {
     if (elem) {
+        elem.removeEventListener(action, fn)
         elem.addEventListener(action, fn)
     }
 }
@@ -210,7 +214,22 @@ export const setJoinedGroupIframeStyle = (params) => {
     }
 }
 
-
+export function setGroupIconStatus() {
+    let editElem = document.querySelector('div[contenteditable="true"]');
+    let main_observer = new MutationObserver(() => {
+        let groupImg = document.querySelector('#de-nft-group-enter');
+        let innerText = editElem.innerText || '';
+        if (groupImg && innerText) {
+            let where = innerText.indexOf('#DNFT') !== -1 && innerText.indexOf('nft_group') !== -1;
+            if (where) {
+                groupImg.querySelector('.addGroup').src = groupImgSelect;
+            } else {
+                groupImg.querySelector('.addGroup').src = groupImgNoSelect;
+            }
+        }
+    });
+    main_observer.observe(editElem, { attributes: false, childList: true, subtree: true })
+}
 function _addTweetButtonListen() {
     let btn = document.querySelector('div[data-testid="tweetButton"]');
 

+ 101 - 33
src/logic/content/twitter.js

@@ -7,7 +7,8 @@ import { fetchAddFinishEvent } from '@/logic/background/fetch/facebook';
 import { showNFTGroupIcon, hideNFTGroupList, checkUserJoinGroup, elemAddEventListener, addJoinedGroupList } from '@/logic/content/nft';
 import { getTwitterNftGroupInfo } from '@/http/nft'
 import { jumpTwitterDetailByAlert, showEditTweet } from '@/logic/content/help/twitter.js'
-import { clearPostContent } from '@/logic/content/nft.js'
+import { clearPostContent, setGroupIconStatus } from '@/logic/content/nft.js'
+import axios from 'axios';
 
 let dom = {};
 
@@ -26,7 +27,7 @@ let fixProfileTabAutoTimer = null;
 
 let pin_login = false
 function twitterPinLogin() {
-    if(pin_login){
+    if (pin_login) {
         return
     }
     pin_login = true
@@ -113,7 +114,8 @@ export function showTwitterPublishDialogHandler(publishRes) {
     addPublishTipsIframe({
         srcContent: publishRes.copyContent
     })
-    _setPublishContent(publishRes.srcContent);
+    // _setPublishContent(publishRes.srcContent);
+    setDialogPublishContent(publishRes.srcContent);
     _publishTweetEvent(publishRes, bindTwitterArtMethod);
 }
 
@@ -319,7 +321,7 @@ function _addDeNetEditBtn(parent, dom, isClick = false) {
  */
 function _getSliderTwitterBtn() {
     dom.tweetBtn = document.querySelector('a[data-testid="SideNav_NewTweet_Button"]');
-    dom.tweetBtn.addEventListener('click', function () {
+    dom.tweetBtn && dom.tweetBtn.addEventListener('click', function () {
         // _addDeNetBtnToDialog();
     })
 }
@@ -410,7 +412,7 @@ export function noticeBindTweet(params) {
     let iframe = document.createElement('iframe');
     iframe.id = 'de-notice-bind-tweet';
     iframe.src = chrome.runtime.getURL('/iframe/bind-tweet.html') + `?params=${JSON.stringify(params)}`;
-    iframe.style.cssText = `border: medium none; width:400px;min-height:313px;position: fixed; right: 16px; top: 16px;`
+    iframe.style.cssText = `border: medium none; width:400px;min-height:313px;position: fixed; right: 16px; top: 16px;border-radius: 20px;`
     let iframeContent = document.getElementById('de-notice-bind-tweet');
     if (!iframeContent) {
         document.querySelector('body').appendChild(iframe)
@@ -479,6 +481,28 @@ export const _setPublishContent = throttle(function (content, time = 1000) {
     }
 }, 800);
 
+
+const setDialogPublishContent = throttle(function (content) {
+    setTimeout(() => {
+        let inputEle;
+        let dialog = document.querySelector('div[role="dialog"]');
+        if (dialog) {
+            inputEle = dialog.querySelector('div[contenteditable="true"]');
+        } else {
+            inputEle = document.querySelector('div[contenteditable="true"]');
+        }
+        const dataTransfer = new DataTransfer();
+        dataTransfer.setData('text', content);
+        const event = new ClipboardEvent('paste', {
+            clipboardData: dataTransfer,
+            bubbles: true
+        });
+        if (inputEle) {
+            inputEle.dispatchEvent(event);
+        }
+    }, 300)
+}, 600);
+
 /**
  * 创建deNet按钮 添加到页面
  * @returns {{deBtn2: HTMLDivElement, deBtn1: HTMLDivElement, deBtn: HTMLSpanElement}}
@@ -726,13 +750,24 @@ function setIframeRedPacket(type = 'twitter') {
                         parseCard.replaceNftDomRedPacket(item)
                     } else if (item && item.post_Id && item.post_Id.indexOf('nft_group/') >= 0) {
                         parseCard.replaceNftGroupDomRedPacket(item)
+                    } else if (item && item.post_Id && item.post_Id.indexOf('luckdraw/') >= 0) {
+                        item.post_Id = item.post_Id.split('luckdraw/')[1] || ''
+                        item.page_type = '抽奖'
+                        parseCard.replaceDOMRedPacket(item)
                     } else {
+                        item.page_type = '红包'
                         parseCard.replaceDOMRedPacket(item)
                     }
                 }
                 if (res.need_net_short_url.length > 0) {
                     // 请求短链接
-                    chrome.runtime.sendMessage({ actionType: "CONTENT_TWITTER_SHORT_LINK", data: "", arr_url: res.need_net_short_url }, () => { })
+                    chrome.runtime.sendMessage({ actionType: "CONTENT_TWITTER_SHORT_LINK", data: "", arr_url: res.need_net_short_url }, (res) => {
+                        if (!res) {
+                            Report.reportLog({
+                                objectType: Report.objectType.parse_card_error
+                            });
+                        }
+                    })
                 }
             })
             break;
@@ -850,7 +885,7 @@ export function init() {
     if (where) {
         return
     }
-    
+
     if (window.location.host.includes('twitter.com')) {
         showNFTCard()
         showNFTGroupIcon()
@@ -1307,7 +1342,30 @@ const TwitterLikeAPI = (tweet_Id) => {
     })
 }
 
-
+export const TwitterApiUserByScreenName = (params) => {
+    let { screen_name } = params;
+    axios.get(`https://twitter.com/i/api/graphql/mCbpQvZAw6zu_4PvuAUVVQ/UserByScreenName?variables=%7B%22screen_name%22%3A%22${screen_name}%22%2C%22withSafetyModeUserFields%22%3Atrue%2C%22withSuperFollowsUserFields%22%3Atrue%7D`, {
+        headers: {
+            "accept": "*/*",
+            "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
+            "authorization": "Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA",
+            "content-type": "application/json",
+            "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"101\", \"Google Chrome\";v=\"101\"",
+            "sec-ch-ua-mobile": "?0",
+            "sec-ch-ua-platform": "\"Windows\"",
+            "sec-fetch-dest": "empty",
+            "sec-fetch-mode": "cors",
+            "sec-fetch-site": "same-origin",
+            "x-csrf-token": getCookie('ct0'),
+            "x-twitter-active-user": "yes",
+            "x-twitter-auth-type": "OAuth2Session",
+            "x-twitter-client-language": "en"
+        },
+    }).then(function (response) {
+        chrome.runtime.sendMessage({ actionType: "CONTENT_API_GET_TWEET_USER_INFO_RES", data: response.data.data || {} }, () => { })
+    }).catch(function (response) {
+    });
+}
 
 let click_old_time = new Date().getTime()
 export const showTwitterPost = (data) => {
@@ -1353,15 +1411,25 @@ export function publishNFTTweetEvent({ groupId, postId, srcContent }, callback)
                     groupFontWeight: '500',
                     lineDisplay: 'none'
                 });
-                chrome.runtime.sendMessage({
-                    actionType: "SWITCH_GROUP_BANNER_STATUS",
-                    data: { type: 'arrow' }
-                }, () => { });
+                sendMessageToGroupBanner({ type: 'arrow' })
             }, 2000);
         });
     }, 800)
 }
 
+const sendMessageToGroupBanner = (params) => {
+    chrome.runtime.sendMessage({
+        actionType: "SWITCH_GROUP_BANNER_STATUS",
+        data: params
+    }, (res) => {
+        if (!res) {
+            Report.reportLog({
+                objectType: Report.objectType.chrome_extension_sendmessage_error
+            })
+        }
+    });
+}
+
 export const publishNFTTweetPost = ({ postId, srcContent, groupId }) => {
     let inputEle = document.querySelector('div[contenteditable="true"]');
     let textContent = inputEle.innerText
@@ -1379,6 +1447,7 @@ export const publishNFTTweetPost = ({ postId, srcContent, groupId }) => {
     textContent = textContent.replaceAll('⬇️', '')
     textContent = textContent.replaceAll('Join', '')
     textContent = textContent.replaceAll('Now:', '')
+    textContent = textContent.trim()
 
     let formData = {
         groupId,
@@ -1412,9 +1481,20 @@ export const setTwitterTextarea = (params, num = 5) => {
     let inputEle = document.querySelector('div[contenteditable="true"]');
     if (inputEle) {
         inputEle.focus();
+        setGroupIconStatus();
         document.execCommand("insertText", false, '');
         setTimeout(() => {
-            document.execCommand("insertText", false, params.srcContent);
+            document.execCommand("insertText", false, params.srcContent + ' ');
+            // 光标定位到起始位置
+            setTimeout(() => {
+                inputEle.focus();
+                let sel = window.getSelection()
+                let range = document.createRange()
+                range.setStart(inputEle, 0)
+                range.setEnd(inputEle, 0)
+                sel.removeAllRanges()
+                sel.addRange(range);
+            }, 0)
             publishNFTTweetEvent(params, bindTwitterArtMethod)
         }, 1000)
     } else {
@@ -1472,7 +1552,7 @@ export const showGroupTip = () => {
 export const hideBuyNFT = () => {
     let iframe = document.querySelector('#nftProjectId')
     iframe.style.display = 'none'
-    iframe.src =''
+    iframe.src = ''
 }
 
 export const showBuyNFT = ({ nft_project_Id }) => {
@@ -1542,7 +1622,7 @@ export const appendPopupPage = (params = {}) => {
     let iframe = document.createElement('iframe');
     iframe.id = 'de-popup-page';
     iframe.src = chrome.runtime.getURL('/iframe/popup-page.html') + `#${path}`;
-    iframe.style.cssText = `border: medium none; width: 375px;
+    iframe.style.cssText = `border: medium none; width: 375px !important;
         height: 650px;position: fixed; right: 16px; top: 16px;background: #FFFFFF;border: 0.5px solid #919191;box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);box-sizing: border-box;z-index: 90000;
         animation-duration: 0.5s !important;
         animation-timing-function: ease-in-out !important;
@@ -1775,10 +1855,7 @@ const groupBtnStyleChange = () => {
         if (line) {
             let { display } = line.style;
             if (display != 'none') {
-                chrome.runtime.sendMessage({
-                    actionType: "SWITCH_GROUP_BANNER_STATUS",
-                    data: { type: 'btn' }
-                }, () => { });
+                sendMessageToGroupBanner({ type: 'btn' })
             }
         }
     }
@@ -1871,7 +1948,7 @@ export const selectGroupTab = () => {
 };
 
 export const groupTipsSelectGroupTab = (params = {}) => {
-    if(params.type =='btn') {
+    if (params.type == 'btn') {
         let groupTab = getGroupTabNode();
         if (groupTab) {
             let line = groupTab.querySelector('#de-tab-line');
@@ -1916,10 +1993,7 @@ const addGroupTabEventListener = () => {
 
         let tipsDom = document.querySelector('#denet_group_banner');
         if (tipsDom) {
-            chrome.runtime.sendMessage({
-                actionType: "SWITCH_GROUP_BANNER_STATUS",
-                data: { type: 'btn' }
-            }, () => { });
+            sendMessageToGroupBanner({ type: 'btn' })
         } else {
             onShowGroupBanner();
         }
@@ -1930,10 +2004,7 @@ const onShowGroupBanner = () => {
     chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
         switch (req.actionType) {
             case 'IFRAME_SHOW_GROUP_TIP':
-                chrome.runtime.sendMessage({
-                    actionType: "SWITCH_GROUP_BANNER_STATUS",
-                    data: { type: 'btn' }
-                }, () => { });
+                sendMessageToGroupBanner({ type: 'btn' })
                 if (!getGroupTabNode()) {
                     addGroupTab();
                 }
@@ -2010,10 +2081,7 @@ const TweetTabEventHandler = () => {
         display: 'block'
     });
 
-    chrome.runtime.sendMessage({
-        actionType: "SWITCH_GROUP_BANNER_STATUS",
-        data: { type: 'arrow' }
-    }, () => { });
+    sendMessageToGroupBanner({ type: 'arrow' })
 };
 
 
@@ -2190,7 +2258,7 @@ const fixProfileTabAutoSwitch = () => {
 export const setTabGroupIframeStyle = (params) => {
     let iframeContent = getGroupTabContentNode();
     if (iframeContent) {
-        let htmlHeight =  document.querySelector('html').offsetHeight;
+        let htmlHeight = document.querySelector('html').offsetHeight;
         let primaryColumnHeightn = document.querySelector('div[data-testid="primaryColumn"]').offsetHeight;
         let height = primaryColumnHeightn > htmlHeight ? primaryColumnHeightn : htmlHeight;
         iframeContent.style.height = height + 'px';

+ 8 - 3
src/manifest.json

@@ -2,7 +2,7 @@
     "manifest_version": 3,
     "name": "DeNet",
     "description": "Growing more twitter followers with Denet",
-    "version": "1.1.1",
+    "version": "1.1.2",
     "background": {
         "service_worker": "/js/background.js"
     },
@@ -17,10 +17,15 @@
     },
     "content_scripts": [
         {
-            "matches":["<all_urls>"],
+            "matches": [
+                "<all_urls>"
+            ],
             "run_at": "document_start",
             "js": [
                 "/js/content_help.js"
+            ],
+            "css": [
+                "/css/content_help.css"
             ]
         },
         {
@@ -33,7 +38,7 @@
                 "*://h5.denetme.net/*",
                 "*://preh5.denetme.net/*"
             ],
-            "run_at": "document_start",
+            "run_at": "document_idle",
             "js": [
                 "/js/content.js"
             ]

+ 7 - 0
src/router/popup.js

@@ -23,6 +23,8 @@ import TopUpHome from '@/view/popup/top-up/home.vue'
 
 import CurrencyDetail from '@/view/popup/currency-detail.vue'
 
+import Setting from '@/view/popup/setting/index.vue'
+
 // 2. 定义路由配置
 const routes = [
     {
@@ -122,6 +124,11 @@ const routes = [
         path: '/currencyDetail',
         name: 'currencyDetail',
         component: CurrencyDetail
+    },
+    {
+        path: '/setting',
+        name: 'setting',
+        component: Setting
     }
 ]
 

+ 2 - 2
src/uilts/chromeExtension.js

@@ -107,9 +107,9 @@ export function removeChromeCookie(params, cb) {
     })
 }
 
-export function sendChromeTabMessage(params) {
+export function sendChromeTabMessage(params,callback) {
     chrome.tabs.getCurrent((tab) => {
-        chrome.tabs.sendMessage(tab.id, params, (res) => { console.log(res) });
+        chrome.tabs.sendMessage(tab.id, params, callback);
     })
 }
 

+ 38 - 0
src/uilts/help.js

@@ -153,3 +153,41 @@ export function getOffsetRect(element) {
     left: oLeft,
   }
 }
+
+export function formatSecondsAsTime(secs) {
+  if (secs <= 0) {
+    return '00:00:00'
+  }
+  var hr = Math.floor(secs / 3600)
+  var min = Math.floor((secs - (hr * 3600)) / 60)
+  var sec = Math.floor(secs - (hr * 3600) - (min * 60))
+  var text
+  if (hr < 10) {
+    hr = "0" + hr
+  }
+  if (min < 10) {
+    min = "0" + min
+  }
+  if (sec < 10) {
+    sec = "0" + sec
+  }
+  text = hr + ':' + min + ':' + sec
+
+  return text
+}
+
+// 抽奖红包 left
+export function formatSecondsAsDaysOrTime(secs) {
+  if (secs <= 0) {
+    return '00:00:00'
+  }
+  let text = ''
+  var hr = Math.floor(secs / 3600)
+  if (hr >= 24) {
+    let day = parseInt(hr / 24)
+    text = `${day} days left`
+  } else {
+    text = formatSecondsAsTime(secs)
+  }
+  return text
+}

+ 48 - 10
src/view/components/custom-card-cover.vue

@@ -1,18 +1,29 @@
 <!-- 自定义卡片红包封面 -->
 <template>
     <div class="not-open">
-        <img class="cover" :src="require('@/assets/subject/001-card.png')"  />
-        <img class="open-gif" :src="require('@/assets/gif/001.gif')" />
-
-        <img
+        <img class="cover" v-if="data.type == 2" :src="require('@/assets/svg/img-preview-draw-bg.svg')"  />
+        <img class="cover" v-else :src="require('@/assets/subject/001-card.png')"  />
+
+        <img class="open-gif"
+            v-if="data.type == 2"
+            src="@/assets/img/img-preview-draw-box.png" />
+        <img class="open-gif"
+            v-else
+            :src="require('@/assets/gif/001.gif')" />
+
+        <img v-if="data.type == 2"
+            :src="require('@/assets/svg/img-preview-draw-open.svg')"
+            class="open"
+            @click="open" />
+        <img v-else
             :src="require('@/assets/svg/icon-open.svg')"
             class="open"
-            @click="open"
-        />
+            @click="open"/>
+
         <div class="title" v-if="data.userInfo">
             <img :src="data.userInfo.avatarUrl" />
             <span>{{
-                data.userInfo.nickName || "FutureDoctor"
+                data.userInfo.nickName || ""
             }}</span>
         </div>
         <div class="money-area">
@@ -24,7 +35,11 @@
                         fontSize: amountFontSize + 'px'
                     }">{{ data.amountValue }}</span>
             </div>
-            <div class="people">
+            <div class="time-area" v-if="data.type == 2">
+                <img class="icon-clock" :src="require('@/assets/svg/icon-time.svg')" />
+                {{formatSecondsAsDaysOrTime(data.validityDuration * 3600)}} 
+            </div>
+            <div class="people" v-else>
                 {{ data.totalCount }} WINNERS TO SHARE
             </div>
         </div>
@@ -33,6 +48,7 @@
 
 <script setup>
 import { defineProps, defineEmits, watch, ref } from "vue";
+import { formatSecondsAsDaysOrTime } from "@/uilts/help";
 
 const props = defineProps({
     data: {
@@ -42,6 +58,8 @@ const props = defineProps({
                 totalCount: 0,
                 amountValue: 0,
                 tokenSymbol: "",
+                type: 1,
+                validityDuration: '',
                 userInfo: {
                     avatarUrl: "",
                     nickName: "",
@@ -71,9 +89,9 @@ const open = () => {
 .not-open {
     width: 100%;
     height: 100%;
-    filter: drop-shadow(0px 2px 20px rgba(0, 0, 0, 0.1));
     position: relative;
     border-radius: 16px;
+    filter: drop-shadow(0px 2px 20px rgba(0, 0, 0, 0.1));
 
     .money-area {
         width: 100%;
@@ -118,8 +136,28 @@ const open = () => {
             font-size: 13px;
             line-height: 16px;
             letter-spacing: 0.05em;
-            text-align: center;
             color: #ffffff;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+        }
+
+        .time-area {
+            display: flex;
+            justify-content: center;
+            align-items: center;
+            width: 100%;
+            height: 46px;
+            background: rgba(0,0,0,.15);
+            color: #FFCC4D;
+            font-weight: 900;
+            font-size: 26px;
+            margin-top: -10px;
+            .icon-clock {
+                width: 26px;
+                height: 26px;
+                margin-right: 10px;
+            }
         }
     }
 

+ 1 - 1
src/view/components/message-box.vue

@@ -60,7 +60,7 @@ const confirm = () => {
         left: 50%;
         top: 50%;
         width: 375px;
-        height: 220px;
+        min-height: 220px;
         background: #FFFFFF;
         border-radius: 20px;
         padding: 20px;

+ 24 - 8
src/view/components/popup-transactions.vue

@@ -19,14 +19,14 @@
                         v-if="item.unReadMsgCount > 0 && isReadMsg"></red-dot> 
                     <div class="img-wrapper">
                         <!-- 收入- 任务红包领取 -->
-                        <template v-if="item.bizType == 1">
+                        <template v-if="item.bizType == 1 || item.bizType == 5">
                             <img class="icon-avatar" :src="item.bizData.avatarUrl" />
                             <img class="icon-give" :src="
                                 require('@/assets/svg/icon-get-giveaways-s.svg')
                             " />
                         </template>
                         <!-- 收入- 任务红包结余退款, -->
-                        <template v-else-if="item.bizType == 2">
+                        <template v-else-if="item.bizType == 2 || item.bizType == 6">
                             <img style="margin-left:-4px" :src="
                                 require('@/assets/svg/icon-give-refund-list.svg')
                             " />
@@ -61,6 +61,14 @@
                                         require('@/assets/svg/icon-wallter-list-blind-box.svg')
                             " />
                         </template>
+                        <template v-else-if="item.bizType == -4">
+                            <img class="icon-avatar" style="margin-left:-4px" :src="
+                                        require('@/assets/svg/icon-big-give.svg')
+                            " />
+                            <img class="icon-give" :src="
+                                require('@/assets/svg/icon-list-withdraw-s.svg')
+                            " />
+                        </template>
                     </div>
                     <div class="info-wrapper">
                         <div class="left">
@@ -77,6 +85,12 @@
                                 <template v-else-if="item.bizType == 4">
                                     Deposit
                                 </template>
+                                <template v-else-if="item.bizType == 5">
+                                    Winning the lottery
+                                </template>
+                                <template v-else-if="item.bizType == 6">
+                                    Lottery Refund
+                                </template>
                                 <template v-else-if="item.bizType == -1">
                                     Withdrawal
                                 </template>
@@ -86,6 +100,9 @@
                                 <template v-else-if="item.bizType == -3">
                                     Mystery box*{{(item.bizData && item.bizData.nftItemCount || '')}}  Sold
                                 </template>
+                                <template v-else-if="item.bizType == -4">
+                                    Lottery Giveaway
+                                </template>
                             </div>
                             <div class="time">{{ moment(item.createTimestamp).format('MM-DD HH:mm:ss') }}</div>
                         </div>
@@ -166,16 +183,15 @@
                                         :class="{'balance-direction': item.trxAmountCurrencyInfo.tokenSymbol.length + ('' + item.trxAmountValue).length > 12}">
 
                                         <!--支出—— -2:零钱余额支付 、-3: NFT盲盒余额支付 -->
-                                        <span class="amount" v-if="item.bizType == -2 || item.bizType == -3">
-                                            -
+                                        <span class="amount" v-if="item.bizType == -2 || item.bizType == -3 || item.bizType == -4">
                                             <a-tooltip :title="'-' + item.trxAmountValue">
-                                                {{ getBit(item.trxAmountValue) || 0 }}
+                                                -{{ getBit(item.trxAmountValue) || 0 }}
                                             </a-tooltip>
                                         </span>
                                         <!-- 收入—— bizType:1、2、3、4 -->
                                         <span class="amount" v-else>
-                                            <a-tooltip :title="item.trxAmountValue">
-                                                {{ getBit(item.trxAmountValue) || 0 }}
+                                            <a-tooltip :title="'+'+item.trxAmountValue">
+                                                +{{ getBit(item.trxAmountValue) || 0 }}
                                             </a-tooltip>
                                         </span>
 
@@ -401,6 +417,7 @@ const listScroll = (e) => {
                         align-items: center;
 
                         .amount {
+                            color: #E86F00;
                             max-width: 110px;
                             min-width: 20px;
                             display: inline-block;
@@ -410,7 +427,6 @@ const listScroll = (e) => {
 
                         .name {
                             margin-left: 3px;
-                            color: #E86F00;
                             max-width: 130px;
                             line-height: 14px;
                             font-size: 13px;

+ 157 - 0
src/view/content/message/index.vue

@@ -0,0 +1,157 @@
+<template>
+    <div class="denet-message" v-show="state.list.length > 0">
+        <template v-for="item in state.list">
+            <div class="denet-message-area" @click="clickItem(item)" v-if="item.bizType == 2">
+                <img :src="require('@/assets/img/icon-message-fail.png')" alt />
+                <span>You were not selected from the giveaway events... Click to see more giveaways!</span>
+                <div class="denet-message-close" @click.stop="clickClose(item)">
+                    <img :src="require('@/assets/img/icon-message-close.png')" alt />
+                </div>
+            </div>
+            <div class="denet-message-area" @click="clickItem(item)" v-if="item.bizType == 1">
+                <img :src="require('@/assets/img/icon-message-win.png')" alt />
+                <span>Congratulations! You won <b class="denet-message-money">{{ item.bizData.lotteryMoney }}
+                        {{ item.bizData.lotteryTokenSymbol }}</b> from the giveaway!🎉</span>
+                <div class="denet-message-close" @click.stop="clickClose(item)">
+                    <img :src="require('@/assets/img/icon-message-close.png')" alt />
+                </div>
+            </div>
+        </template>
+    </div>
+</template>
+<script setup>
+import { onMounted, reactive } from "vue";
+let state = reactive({
+    list: [],
+})
+
+// 过5秒消失逻辑
+const overTimeClose = () => {
+    setTimeout(() => {
+        let now_time = new Date().getTime()
+        for (let i in state.list) {
+            if ((now_time - state.list[i].read_time) > 4500) {
+                state.list.splice(i, 1)
+            }
+        }
+    }, 5000)
+}
+
+const clickClose = (item) => {
+    // 通知已读
+    for (let i in state.list) {
+        if (item.id == state.list[i].id) {
+            state.list.splice(i, 1)
+        }
+    }
+}
+
+const clickItem = (item) => {
+    if (item.bizType == 1) {
+        // 跳转详情页
+        window.open(`https://twitter.com/${item.bizData.twitterAccount}/status/${item.bizData.twitterId}`)
+    } else {
+        window.open('https://twitter.com/search?q=%23DeNet&src=typed_query')
+    }
+}
+
+// 读取消息
+const readMessage = (id = 0) => {
+    chrome.runtime.sendMessage({
+        actionType: "CONTENT_HTTP_NET_WORK",
+        funcName: '通知已读',
+        data: {
+            url: '/notice/read',
+            params: {
+                noticeId: id
+            }
+        }
+    });
+}
+
+chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
+    if (req.actionType == 'BACK_UNREAD_MESSAGE') {
+        let data = req.data.data || []
+        console.log('BACK_UNREAD_MESSAGE', data)
+        if (req.data.code == 0 && data.length > 0) {
+            data.forEach((item) => {
+                if (state.list.filter((filter_item) => { return filter_item.id == item.id }).length == 0) {
+                    item.bizData = JSON.parse(item.bizData)
+                    item.read_time = new Date().getTime()
+                    state.list.push(item)
+                }
+                readMessage(item.id)
+            })
+            overTimeClose()
+        }
+    }
+})
+</script>
+
+<style lang="scss" scoped>
+.denet-message {
+    position: fixed;
+    max-height: 100%;
+    overflow: hidden;
+    top: 0;
+    right: 0;
+    width: 500px;
+    z-index: 9999;
+
+    &-area {
+        width: 344px;
+        background: #FFFFFF;
+        border-radius: 15px;
+        min-height: 72px;
+        position: relative;
+        margin-top: 22px;
+        display: flex;
+        cursor: pointer;
+        filter: drop-shadow(0px 5px 20px rgba(0, 0, 0, 0.22));
+        margin-left: 129px;
+
+        img:first-child {
+            width: 40px;
+            height: 40px;
+            margin: 16px 14px 0 16px;
+        }
+
+        span {
+            padding: 14px 26px 14px 0;
+            font-style: normal;
+            font-weight: 500;
+            font-size: 14px;
+            line-height: 20px;
+        }
+
+        .denet-message-money {
+            color: #3D7CB4;
+        }
+    }
+
+    &-area:last-child {
+        margin-bottom: 50px;
+    }
+
+    &-close {
+        border-radius: 100px;
+        width: 24px;
+        height: 24px;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        background: #F2F2F2;
+        position: absolute;
+        right: -10px;
+        top: -10px;
+        filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.12));
+        cursor: pointer;
+
+        img:first-child {
+            height: 10px;
+            width: 10px;
+            margin: 0;
+        }
+    }
+}
+</style>

+ 6 - 4
src/view/iframe/buy-nft/buy/home.vue

@@ -149,9 +149,9 @@ onMounted(() => {
     background: #fff;
     border-radius: 25px;
     max-width: 1000px;
-    min-width: 800px;
+    min-width: 1000px;
     max-height: 90%;
-    min-height: 90%;
+    min-height: 800px;
     z-index: 23;
     display: flex;
     flex-direction: column;
@@ -202,7 +202,9 @@ onMounted(() => {
         .mark {
             margin-left: 20px;
 
-            .sold {}
+            .sold {
+                margin-bottom: 7px;
+            }
 
             .limit {
                 color: #AF934E;
@@ -251,7 +253,7 @@ onMounted(() => {
                 .off {
                     color: #AF934E;
                     font-weight: 700;
-                    font-size: 14px;
+                    font-size: 12px;
 
                     letter-spacing: 0.3px;
                 }

+ 3 - 1
src/view/iframe/buy-nft/buy/pay.vue

@@ -209,7 +209,8 @@ onMounted(() => {
     border-radius: 25px;
     max-width: 1000px;
     min-width: 800px;
-    height: 90%;
+    max-height: 90%;
+    min-height: 800px;
     z-index: 23;
     display: flex;
     flex-direction: column;
@@ -259,6 +260,7 @@ onMounted(() => {
 
             .tip {
                 margin-top: 15px;
+                font-size: 16px;    
                 display: flex;
                 justify-content: space-between;
 

+ 25 - 5
src/view/iframe/group-card/card.vue

@@ -12,7 +12,7 @@
                     <div style="display: flex; align-items: center;">
                         <img :src="require('@/assets/svg/icon-user.svg')"
                             style="width:16px;height:16px; margin-right: 5px;" alt="" />
-                        <span style="color: #fff;">{{ state.data.memberCount }} Member</span>
+                        <span style="color: #fff;">{{ state.data.memberCount }} Members</span>
                     </div>
                     <div style="display: flex; align-items: center; margin-left: 17px;">
                         <img :src="require('@/assets/svg/icon-messgae.svg')"
@@ -50,6 +50,7 @@
 import { reactive, onBeforeMount } from 'vue'
 import { getTwitterNftGroupInfo } from "@/http/group";
 import { getQueryString } from '@/uilts/help.js';
+import Report from "@/log-center/log"
 import { sendChromeTabMessage, checkIsLogin } from '@/uilts/chromeExtension.js';
 
 let state = reactive({
@@ -129,7 +130,7 @@ const init = (callback) => {
 }
 
 chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
-    sendResponse('')
+    sendResponse('ok')
     switch (req.actionType) {
         case 'FINISH_GROUP_BANNNER':
             init()
@@ -172,15 +173,34 @@ const sendMessageToContent = (params) => {
         chrome.tabs.sendMessage(tab.id, {
             actionType,
             data,
-        }, (res) => { console.log(res) });
+        }, (res) => {
+            // 异常埋点
+            if (!res) {
+                Report.reportLog({
+                    objectType: Report.objectType.chrome_extension_sendmessage_error
+                })
+            }
+        });
     })
 }
 const clickArrow = () => {
-    sendChromeTabMessage({ actionType: "SWITCH_GROUP_STATUS" }, () => { })
+    sendChromeTabMessage({ actionType: "SWITCH_GROUP_STATUS" }, (res) => {
+        if (!res) {
+            Report.reportLog({
+                objectType: Report.objectType.chrome_extension_sendmessage_error
+            })
+        }
+    })
 }
 
 async function clickPost() {
-    sendChromeTabMessage({ actionType: "SWITCH_GROUP_STATUS" }, () => { })
+    sendChromeTabMessage({ actionType: "SWITCH_GROUP_STATUS" }, (res) => {
+        if (!res) {
+            Report.reportLog({
+                objectType: Report.objectType.chrome_extension_sendmessage_error
+            })
+        }
+    })
     let _userInfo = await checkIsLogin()
     if (!_userInfo) {
         return

+ 2 - 1
src/view/iframe/nft/group-card.vue

@@ -12,7 +12,7 @@
                     <div class="opt">
                         <label>
                             <img src="../../../assets/svg/icon-nft-member.svg" />
-                            <span>{{ detail.memberCount }} Member</span>
+                            <span>{{ detail.memberCount }} Members</span>
                         </label>
                         <label>
                             <img src="../../../assets/svg/icon-nft-post.svg" />
@@ -105,6 +105,7 @@ onMounted(() => {
 
     // 登录回调
     chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
+        sendResponse('ok')
         switch (req.actionType) {
             case 'BG_LOGIN_SET_USERINFO_CB':
                 getDetail();

+ 5 - 8
src/view/iframe/publish/components/follow-input.vue

@@ -167,11 +167,11 @@ const onblur = (params, index) => {
     console.log(params, index)
 }
 
-const onInput = debounce(function(params, index) {
+const onInput = (params, index) => {
     currentIptIndex.value = index;
     emits("setUser", {index: index, name: params.name})
     getTwitterUsers(params.name)
-}, 500) 
+}
 
 const onKeydown = (params, index) => {
     // setIptWidth(index);
@@ -219,10 +219,8 @@ const rectClick = (event) => {
     }
 }
 
-const getTwitterUsers = (query, cb) => {
-    if(query.indexOf('@') > -1) {
-        return;
-    }
+const getTwitterUsers =  debounce(function(query, cb) {
+    query = query.replace("@", "");
     searchTwitterUser({
         params: {
             name : query
@@ -234,7 +232,7 @@ const getTwitterUsers = (query, cb) => {
         cb && cb(res);
         console.log('searchTwitterUser',res)
     })
-}
+}, 500)
 
 const selectedUser = (params, index) => {
     emits("setUser", {index: currentIptIndex.value, name: params.screenName});
@@ -295,7 +293,6 @@ const onUserMouseLeave = (params, index) => {
             .at-user-input-placeholder {
                 position: absolute; 
                 top: -1000px;
-                font-size: 13px;
                 min-width: 12px;
                 max-width: 128px;
             }

+ 35 - 5
src/view/iframe/publish/components/get-more.vue

@@ -1,14 +1,25 @@
 <template>
-    <div class="getMore" @click="jumpMore">
-        <img width="20" :src=" require('@/assets/svg/icon-big-give.svg') " />
+    <div class="getMore" @click="jumpMore" v-if="props.style_type == 1">
+        <img width="20" :src="require('@/assets/svg/icon-big-give.svg')" />
         <font>Get More Giveaway</font>
-        <img height="20" :src=" require('@/assets/svg/icon-cell-arrow-right.svg') " />
-      </div>
+        <img height="20" :src="require('@/assets/svg/icon-cell-arrow-right.svg')" />
+    </div>
+    <div class="get_more" v-if="props.style_type == 2" @click="jumpMore">
+        <img width="18" :src="require('@/assets/svg/icon-big-give.svg')" />
+        <span>Get More Giveaway</span>
+    </div>
 </template>
 
 <script setup>
 import { getFrontConfig } from "@/http/account";
-import { onBeforeMount, ref } from "vue";
+import { number } from "mathjs";
+import { onBeforeMount, ref, defineProps } from "vue";
+const props = defineProps({
+    style_type: {
+        type: Number,
+        default: 1,
+    },
+})
 
 // const
 const moreUrl = ref('');
@@ -38,9 +49,11 @@ const jumpMore = () => {
     align-items: center;
     justify-content: center;
     box-shadow: 0px -2px 10px rgba(0, 0, 0, 0.06);
+
     img {
         margin: 0 5px;
     }
+
     font {
         color: #000;
         font-size: 15px;
@@ -48,4 +61,21 @@ const jumpMore = () => {
         line-height: 18px;
     }
 }
+
+.get_more {
+    margin-top: 58px;
+    width: 240px;
+    height: 54px;
+    background: #FFFFFF;
+    border: 1px solid #E8E8E8;
+    border-radius: 100px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    cursor: pointer;
+
+    img {
+        margin-right: 8px;
+    }
+}
 </style>

+ 4 - 2
src/view/iframe/publish/components/paypal-button.vue

@@ -159,8 +159,9 @@ onMounted(() => {
             color: #1D9BF0;
             display: flex;
             align-items: center;
-            justify-content: end;
+            justify-content: flex-end;
             margin-bottom: 6px;
+            
             span {
                 display: inline-block;
                 color: #000000;
@@ -195,8 +196,9 @@ onMounted(() => {
             font-weight: 600;
             font-size: 18px;
             color: #fff;
-            cursor: pointer;
             padding: 0 30px;
+            word-break: break-all;
+            cursor: pointer;
             &.disabled {
                 background: #DEDEDE;
             }

+ 37 - 4
src/view/iframe/publish/components/preview-card.vue

@@ -23,6 +23,8 @@
                             amountValue: baseFormData.amountValue,
                             tokenSymbol: currentCurrencyInfo.tokenSymbol,
                             currencyIconUrl: currentCurrencyInfo.iconPath,
+                            type: baseFormData.type,
+                            validityDuration: baseFormData.validityDuration,
                             userInfo: {
                                 nickName: userInfo.name,
                                 avatarUrl: userInfo.avatarUrl
@@ -33,8 +35,11 @@
             </div> 
 
             <!-- 安装之前的卡片样式 -->
-            <div v-show="!installStatus" class="content-before" :style="{'width': reviewCanvasParams.width+ 'px'}">
-                <div class="head" :style="{'zoom': reviewCanvasParams.zoom}">
+            <div class="content-before"
+                v-show="!installStatus" 
+                :style="{'width': reviewCanvasParams.width+ 'px'}">
+                <div class="head" 
+                    :style="{'zoom': reviewCanvasParams.zoom}">
                     <img :src="userInfo.avatarUrl"
                         class="avatar"/>
                     <div class="article-wrapper">
@@ -46,8 +51,13 @@
                         </div>
                     </div>
                 </div>
-                <div class="card-wrapper" :style="{'zoom': reviewCanvasParams.zoom}">
+                <div class="card-wrapper" 
+                    :style="{'zoom': reviewCanvasParams.zoom}">
+                    <img :src="require('@/assets/img/img-preview-draw-after-bg.png')"
+                        v-if="baseFormData.type == 2"
+                        class="card-cover">
                     <img :src="require('@/assets/subject/img-card-cover-blue.png')"
+                        v-else
                         class="card-cover"/>
                     <div class="bottom-bar">
                         <div class="title">
@@ -75,7 +85,15 @@
                             </span>
                         </div>
                         <div class="desc">
-                            {{baseFormData.totalCount}} WINNERS TO SHARE
+                            <template  v-if="baseFormData.type == 2">
+                                <img class="icon-clock" 
+                                :src="require('@/assets/svg/icon-preview-clock.svg')" />  {{baseFormData.validityDuration}} H
+                                <img class="icon-trophy" 
+                                :src="require('@/assets/svg/icon-preview-trophy.svg')" /> <span class="trophy-count">{{baseFormData.totalCount}} WINNERS</span>
+                            </template>
+                            <template v-else>
+                                {{baseFormData.totalCount}} WINNERS TO SHARE
+                            </template>
                         </div>
                     </div>
                 </div>
@@ -370,6 +388,21 @@ onUnmounted(() => {
                         font-weight: 800;
                         font-size: 13px;
                         color: #ffffff;
+                        display: flex;
+                        align-items: center;
+
+                        .icon-clock {
+                            margin-right: 4px;
+                        }
+
+                        .icon-trophy {
+                            margin-left: 8px;
+                            margin-right: 4px;
+                        }
+
+                        .trophy-count {
+                            color: #FFCC4D;
+                        }
                     }
                 }
                 .card-cover {

+ 1 - 1
src/view/iframe/publish/components/top-up.vue

@@ -180,7 +180,7 @@ onMounted(() => {
             justify-content: space-between;
 
             .item {
-                width: 48%;
+                width: 49%;
 
                 .label {
                     color: #A0A0A0;

Datei-Diff unterdrückt, da er zu groß ist
+ 456 - 438
src/view/iframe/publish/give-dialog.vue


+ 12 - 0
src/view/iframe/red-packet/index.vue

@@ -0,0 +1,12 @@
+<template>
+    <red-packet v-if="state.page_type == '红包'"></red-packet>
+    <luck-draw v-else-if="state.page_type == '抽奖'"></luck-draw>
+</template>
+<script setup>
+import { reactive } from "vue";
+import RedPacket from '@/view/iframe/red-packet/red-packet.vue'
+import LuckDraw from '@/view/iframe/red-packet/luck-draw.vue'
+import { getQueryString } from '@/uilts/help.js'
+let state = reactive({})
+state.page_type = getQueryString('page_type') || '红包'
+</script>

+ 3217 - 0
src/view/iframe/red-packet/luck-draw.vue

@@ -0,0 +1,3217 @@
+<!-- 红包任务页面 -->
+<template>
+    <div class="content">
+        <!-- global-tip -->
+        <global-tip :type="'1'"></global-tip>
+        <!-- open -->
+        <div v-show="state.status == 'opened'" class="opened">
+
+            <div class="header"
+                :style="{ 'backgroundImage': `url(${require('@/assets/subject/002-back-head-top-1.svg')})` }">
+                <!--  -->
+                <img :src="require('@/assets/subject/001-icon-red-packet.svg')" alt="">
+                <div class="txt">
+                    <p>Complete tasks</p>
+                    <p>to Draw Prizes</p>
+                </div>
+            </div>
+
+            <div class="list">
+                <template v-for="item, i in state.detail.taskCondition" v-bind:key="i">
+                    <div class="item" v-if="item.type == 1 && item.relatedUsers && item.relatedUsers.length > 0">
+                        <div class="item-content">
+                            <div class="item-follow-title">
+                                <img :src="require('@/assets/svg/icon-task-twitter.svg')" alt />
+                                <!-- <img :src="require('@/assets/svg/icon-follow.svg')" alt /> -->
+                                <div class="item-title">Follow</div>
+                                <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
+                                    v-show="!state.done.follow && state.done.follow_red" />
+                                <img v-if="state.done.follow" :src="require('@/assets/svg/icon-true.svg')" alt />
+                                <div v-else class="btn" @click="clickFollowAll(item.relatedUsers, 'all')">Follow All
+                                </div>
+                            </div>
+                            <div class="item-follow-area">
+                                <template v-for="item2, i in item.relatedUsers" v-bind:key="i">
+                                    <div class="item-follow" v-if="item2.finished">
+                                        <span :class="{ finished: item2.finished }">@{{ item2.name }}</span>
+                                        <img :src="require('@/assets/svg/icon-true-ed.svg')" alt />
+                                    </div>
+                                    <div class="item-follow" v-else @click="clickFollowAll([item2])">
+                                        <span :class="{ finished: item2.finished }">@{{ item2.name }}</span>
+                                        <img :src="require('@/assets/svg/icon-add.svg')" alt />
+                                    </div>
+                                </template>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="item" v-if="item.type == 2">
+                        <img :src="require('@/assets/svg/icon-task-twitter.svg')" alt />
+                        <!-- <img :src="require('@/assets/svg/icon-like.svg')" alt /> -->
+                        <div class="item-content">
+                            <div class="item-title">Like</div>
+                        </div>
+                        <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
+                            v-show="!state.done.like && state.done.like_red" />
+                        <img v-if="state.done.like" :src="require('@/assets/svg/icon-true.svg')" alt />
+                        <div v-else class="btn" @click="clickLikeBtn">Like</div>
+                    </div>
+                    <div class="item" v-if="item.type == 3">
+                        <img :src="require('@/assets/svg/icon-task-twitter.svg')" alt />
+                        <!-- <img :src="require('@/assets/svg/icon-retweet.svg')" alt /> -->
+                        <div class="item-content">
+                            <div class="item-title">Retweet</div>
+                        </div>
+                        <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
+                            v-show="!state.done.retweet && state.done.retweet_red" />
+                        <img v-if="state.done.retweet" :src="require('@/assets/svg/icon-true.svg')" alt />
+                        <div v-else class="btn" @click="clickRetweetBtn">Retweet</div>
+                    </div>
+                    <!-- Comment、艾特 friends -->
+                    <div class="item" v-if="item.type == 9">
+                        <img :src="require('@/assets/svg/icon-task-twitter.svg')" alt />
+                        <div class="item-content">
+                            <div class="item-title">Comment and Tag 3 friends</div>
+                        </div>
+                        <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
+                            v-show="!state.done.reply && state.done.reply_red" />
+                        <img v-if="state.done.reply" :src="require('@/assets/svg/icon-true.svg')" alt />
+                        <div v-else class="btn" @click="clickReply(item)">Comment</div>
+                    </div>
+                    <!-- repost feacebook -->
+                    <div class="item" v-if="item.type == 8">
+                        <img :src="require('@/assets/svg/icon-task-facebook.svg')" alt />
+                        <div class="item-content">
+                            <div class="item-title">Repost to Facebook</div>
+                        </div>
+                        <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
+                            v-show="!state.done.repost_facebook && state.done.repost_facebook_red" />
+                        <img v-if="state.done.repost_facebook" :src="require('@/assets/svg/icon-true.svg')" alt />
+                        <div v-else class="btn" @click="clickRepostFacebook(item)">Repost</div>
+                    </div>
+                    <!-- join discord  -->
+                    <div class="item" v-if="item.type == 7">
+                        <img :src="require('@/assets/svg/icon-discord-mini.svg')" alt />
+                        <div class="item-content">
+                            <div class="item-title">Join Discord</div>
+                        </div>
+                        <img :src="require('@/assets/gif/red-right.gif')" alt class="red-right"
+                            v-show="!state.done.join_discord && state.done.join_discord_red" />
+                        <img v-if="state.done.join_discord" :src="require('@/assets/svg/icon-true.svg')" alt />
+                        <template v-else>
+                            <div v-if="joinDiscordIng" class="loading-wrapper">
+                                <img class="icon-loading" :src="require('@/assets/svg/icon-loading-gray.svg')" />
+                            </div>
+                            <div v-else class="btn" @click="joinDiscord">
+                                Join
+                            </div>
+                        </template>
+                    </div>
+                </template>
+            </div>
+            <!-- <div class="people" @click="clickRoad">
+        <div class="txt">
+          {{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners,{{
+              state.detail.receiveAmountValue
+          }}/{{ state.detail.amountValue }} {{ state.detail.currencySymbol }}</div>
+        <div class="right" v-if="state.detail.allReceived">
+
+          <img :src="require('@/assets/svg/icon-right.svg')" alt class="road" />
+        </div>
+      </div> -->
+            <div class="footer">
+
+                <div class="btn" @click="clickGetGiveaways">Complete</div>
+            </div>
+        </div>
+
+
+        <!-- success -->
+        <div v-if="state.status == 'success'" class="success">
+            <div class="header"
+                :style="{ 'backgroundImage': `url(${require('@/assets/subject/002-back-head-top-180.svg')})` }">
+                <div class="success-title">
+                    🎉 Awesome! You are Winner!
+                </div>
+                <div class="money">
+                    <img :src="state.detail.currencyIconPath" alt />
+                    <font-amount :amount="state.receiveAmount" class="big" :fontSize="46"></font-amount>
+                    <!-- <span class="small">{{ state.detail.currencySymbol }}</span> -->
+                </div>
+                <div class="done" @click="clickDone">
+                    <img :src="require('@/assets/subject/001-icon-done.svg')" alt class="icon-done" />
+                    <span>View Rewards In Wallet</span>
+                    <img :src="require('@/assets/svg/icon-right.svg')" alt class="icon-right" />
+                </div>
+            </div>
+            <div class="luck-list-title">
+                <div>{{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners</div>
+                <div class="right">
+                    <span class="text">
+                        <a-tooltip :title="state.detail.receiveAmountValue">
+                            {{ getBit(state.detail.receiveAmountValue) }}
+                        </a-tooltip>
+                        /
+                        <a-tooltip :title="state.detail.amountValue">
+                            {{ getBit(state.detail.amountValue) || '' }}
+                        </a-tooltip>
+                    </span>
+                    {{ state.detail.currencySymbol || '' }}
+                </div>
+            </div>
+            <div class="luck-list max" @scroll="handleScroll($event)">
+                <div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
+                    <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl"
+                        @click="openTwitterDetail(item)" alt />
+                    <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
+                    <img class="win" :src="require('@/assets/svg/icon-win-1.svg')" v-if="i == 0" alt />
+                    <img class="win" :src="require('@/assets/svg/icon-win-2.svg')" v-if="i == 1" alt />
+                    <img class="win" :src="require('@/assets/svg/icon-win-3.svg')" v-if="i == 2" alt />
+                    <div class="luck-content">
+                        <div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName
+                        }}</div>
+                        <div class="luck-title" v-else>Twitter User</div>
+                        <div class="luck-time">{{ moment(item.receiveTimestamp).format('MM-DD HH:mm') }}</div>
+                    </div>
+                    <div class="luck-money">
+                        <img :src="state.detail.currencyIconPath" alt />
+                        <div class="luck-money-txt">
+                            <a-tooltip :title="item.amountValue">
+                                {{ getBit(item.amountValue) }}
+                            </a-tooltip>
+                        </div>
+                    </div>
+                    <div class="luck-king" v-if="item.maxAmount">
+                        <img :src="require('@/assets/svg/icon-king-hat.svg')" alt />
+                        <span>Luckiest Draw</span>
+                    </div>
+                </div>
+            </div>
+            <get-more></get-more>
+        </div>
+
+
+        <!-- no-open -->
+        <div v-else-if="state.status == 'not-open'" class="not-open">
+            <img :src="require('@/assets/subject/002-card.svg')" alt="">
+            <img class="open-gif" :src="require('@/assets/gif/002.png')" />
+
+            <img :src="require('@/assets/svg/icon-participate.svg')" alt="" class="open" @click="clickOpenRedPacket">
+            <div class="title" v-if="state.detail.postUserInfo">
+                <img :src="state.detail.postUserInfo.avatarUrl" alt />
+                <span>{{ state.detail.postUserInfo.nickName || 'FutureDoctor' }}</span>
+            </div>
+            <div class="money-area">
+                <div class="txt">{{ state.detail.currencySymbol }} GIVEAWAY</div>
+                <div class="coin">
+                    <img :src="state.detail.currencyIconPath" alt />
+                    <font-amount :amount="state.detail.amountValue" style="color:#fff;"></font-amount>
+                </div>
+                <!-- <div class="people">{{ state.detail.totalCount }} WINNERS TO SHARE</div> -->
+                <!-- <div class="mark-area">
+                    <div class="time">
+                        <img :src="require('@/assets/svg/icon-time.svg')" />
+                        <span>{{ state.count_down_time }}</span>
+                    </div>
+                    <div class="win">
+                        <img :src="require('@/assets/svg/icon-win.svg')" />
+                        <span>{{ state.detail.totalCount }} WINNERS</span>
+                    </div>
+                </div> -->
+                <div class="time-area">
+                    <div></div>
+                    <img :src="require('@/assets/svg/icon-time.svg')" />
+                    <span>{{ state.count_down_time }}</span>
+                </div>
+
+            </div>
+        </div>
+
+
+        <!-- 领取列表 -->
+        <div v-else-if="state.status == 'luck-peopel-list'" class="luck-peopel-list">
+            <div class="head">
+                <img :src="require('@/assets/svg/icon-back.svg')" alt />
+            </div>
+            <div class="luck-list-title">
+                <div>{{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners</div>
+                <div class="right">
+                    <span class="text">
+                        <a-tooltip :title="state.detail.receiveAmountValue">
+                            {{ getBit(state.detail.receiveAmountValue) }}
+                        </a-tooltip>
+                        /
+                        <a-tooltip :title="state.detail.amountValue">
+                            {{ getBit(state.detail.amountValue) || '' }}
+                        </a-tooltip>
+                    </span> {{
+                            state.detail.currencySymbol || ''
+                    }}
+                </div>
+            </div>
+            <div class="luck-list" @scroll="handleScroll">
+                <div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
+                    <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt
+                        @click="openTwitterDetail(item)" />
+                    <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
+                    <img class="win" :src="require('@/assets/svg/icon-win-1.svg')" v-if="i == 0" alt />
+                    <img class="win" :src="require('@/assets/svg/icon-win-2.svg')" v-if="i == 1" alt />
+                    <img class="win" :src="require('@/assets/svg/icon-win-3.svg')" v-if="i == 2" alt />
+                    <div class="luck-content">
+                        <div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName
+                        }}</div>
+                        <div class="luck-title" v-else>Twitter User</div>
+                        <div class="luck-time">{{ moment(item.receiveTimestamp).format('MM-DD HH:mm:ss') }}</div>
+                    </div>
+                    <div class="luck-money">
+                        <img :src="state.detail.currencyIconPath" alt />
+                        <div class="luck-money-txt">
+                            <a-tooltip :title="item.amountValue">
+                                {{ getBit(item.amountValue) }}
+                            </a-tooltip>
+                        </div>
+                    </div>
+
+                    <div class="luck-king" v-if="item.maxAmount">
+                        <img :src="require('@/assets/svg/icon-king-hat.svg')" alt />
+                        <span>Luckiest Draw</span>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+        <!-- 关闭状态 -->
+        <div v-else-if="state.status == 'close'" class="close">
+            <!-- 红包被领完了 -->
+            <!-- <div class="header"
+                :style="{ 'backgroundImage': `url(${require('@/assets/subject/002-back-head-top.svg')})` }"
+                v-if="state.close_status == '已经过期了'">
+                <div class="rabbit">
+                    <img class="flower" :src="require('@/assets/svg/icon-flower.svg')" alt />
+                    <p>This Draw is Complete</p>
+                </div>
+            </div> -->
+            <div class="header"
+                :style="{ 'backgroundImage': `url(${require('@/assets/subject/002-back-head-top.svg')})` }"
+                v-show="state.close_status == '已经过期了'">
+                <div class="close-title" v-for="item in state.close_text">{{ item }}</div>
+            </div>
+
+            <!-- 没有抽中 -->
+            <div class="header"
+                :style="{ 'backgroundImage': `url(${require('@/assets/subject/002-back-head-top.svg')})` }"
+                v-if="state.close_status == '没有抽中'">
+                <div class="rabbit">
+                    <img :src="require('@/assets/subject/001-icon-rabbit.svg')" alt />
+                    <p>Good Luck Next Time!</p>
+                </div>
+            </div>
+
+
+            <!-- 等待结果 -->
+            <div class="header"
+                :style="{ 'backgroundImage': `url(${require('@/assets/subject/002-back-head-top.svg')})` }"
+                v-if="state.close_status == '等待结果'">
+            </div>
+            <div class="load-result" v-if="state.close_status == '等待结果'">
+                <div class="title">
+                    <img :src="require('@/assets/svg/icon-enter-ed.svg')" alt />
+                    <span>Participate Successful</span>
+                </div>
+                <!-- 票 -->
+                <div class="ticket">
+                    <div class="div-ticket">
+                        <img :src="require('@/assets/svg/icon-ticket.svg')" alt />
+                    </div>
+                </div>
+                <p>Announcement Winner</p>
+                <div class="time">
+                    <img :src="require('@/assets/svg/icon-win-time.svg')" alt />
+                    <span>{{ state.count_down_time || '' }}</span>
+                </div>
+                <get-more :style_type="2"></get-more>
+                <div class="notification_switch" v-if="state.notification_show">
+                    <span>Announcement Notification</span>
+                    <a-switch v-model:checked="state.notification_switch" @change="changeNotification" />
+                </div>
+            </div>
+
+            <div class="luck-list-title" v-show="state.close_status != '等待结果'">
+                <div>{{ state.detail.receiveCount || 0 }}/{{ state.detail.totalCount || 0 }} Winners</div>
+                <div class="right">
+                    <span class="text">
+                        <a-tooltip :title="state.detail.receiveAmountValue">
+                            {{ getBit(state.detail.receiveAmountValue) }}
+                        </a-tooltip>
+                        /
+                        <a-tooltip :title="state.detail.amountValue">
+                            {{ getBit(state.detail.amountValue || '') }}
+                        </a-tooltip>
+                    </span> {{
+                            state.detail.currencySymbol || ''
+                    }}
+                </div>
+            </div>
+
+            <div class="luck-list max" @scroll="handleScroll" v-show="state.close_status != '等待结果'">
+                <div class="luck-item" v-for="item, i in state.detail.allReceived" v-bind:key="i">
+                    <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt
+                        @click="openTwitterDetail(item)" />
+                    <img v-else :src="require('@/assets/svg/icon-twitter.svg')" alt />
+                    <img class="win" :src="require('@/assets/svg/icon-win-1.svg')" v-if="i == 0" alt />
+                    <img class="win" :src="require('@/assets/svg/icon-win-2.svg')" v-if="i == 1" alt />
+                    <img class="win" :src="require('@/assets/svg/icon-win-3.svg')" v-if="i == 2" alt />
+                    <div class="luck-content">
+                        <div class="luck-title" v-if="item.simpleUserInfoVO.nickName">{{ item.simpleUserInfoVO.nickName
+                        }}</div>
+                        <div class="luck-title" v-else>Twitter User</div>
+                        <div class="luck-time">{{ moment(item.receiveTimestamp).format('MM-DD HH:mm:ss') }}</div>
+                    </div>
+                    <div class="luck-money">
+                        <img :src="state.detail.currencyIconPath" alt />
+                        <div class="luck-money-txt">
+                            <a-tooltip :title="item.amountValue">
+                                {{ getBit(item.amountValue) }}
+                            </a-tooltip>
+                        </div>
+                    </div>
+                    <div class="luck-king" v-if="item.maxAmount">
+                        <img :src="require('@/assets/svg/icon-king-hat.svg')" alt />
+                        <span>Luckiest Draw</span>
+                    </div>
+                </div>
+
+                <div class="empty" v-show="state.detail.allReceived && state.detail.allReceived.length == 0">
+                    <img :src="require('@/assets/svg/icon-error.svg')" alt />
+                </div>
+            </div>
+            <get-more v-if="state.close_status != '等待结果'"></get-more>
+        </div>
+
+
+        <!-- error -->
+        <div v-else-if="state.status == 'error'" class="error">
+            <img :src="require('@/assets/svg/icon-error.svg')" alt />
+            <div class="txt">
+                {{ state.error_txt }}
+            </div>
+            <div class="retry" v-show="state.retry" @click="clickRetry">
+                Retry
+            </div>
+        </div>
+
+
+        <!-- loading -->
+        <div v-show="state.loading_show" class="loading">
+            <img :src="require('@/assets/svg/icon-loading.svg')" alt />
+        </div>
+
+        <div v-show="state.loading_redbag" class="redbag">
+            <img :src="require('@/assets/img/icon-loading-redbag.gif')" alt />
+        </div>
+
+    </div>
+    <div style="width: 100%; height: 30px; position: fixed; color: red; top:0;"
+        v-if="state.process_mode != 'production'">
+        {{ state.detail.validity }}</div>
+</template>
+
+<script>
+export default {
+    name: 'redPacket',
+}
+</script>
+<script setup>
+import { onMounted, reactive, ref } from "vue";
+import { getPostDetail, getRedPacket, finishRedPacket, oneKeyLike, oneKeyReTweet, oneKeyFollow, getTaskDetail, getReceivedList, addFinishEvent } from '@/http/redPacket.js'
+import { getQueryString, guid, getBit, formatSecondsAsDaysOrTime } from '@/uilts/help.js'
+import { message } from 'ant-design-vue';
+import FontAmount from '@/view/components/font-amount.vue'
+import GetMore from '@/view/iframe/publish/components/get-more.vue'
+import { setChromeStorage, getChromeStorage, sendChromeTabMessage } from '@/uilts/chromeExtension.js'
+import Report from "@/log-center/log"
+import { srcPublishSuccess } from '@/http/publishApi'
+import { discordAuthUrl, checkGuildJoined } from '@/http/discordApi'
+import { discordAuthRedirectUri, faceShareRedirectUrl } from '@/http/configAPI'
+import { getSetting, putSetting } from '@/http/user'
+import { getFrontConfig } from "@/http/account";
+import { getInviteGuildInfo } from "@/http/discordApi";
+import GlobalTip from '@/view/components/global-tip.vue'
+var moment = require('moment');
+
+let discordAuthorizeRequired = false;
+let joinDiscordActionState = 'default'; //authAndJoinIng  joinIng  reAuth
+let joinDiscordIng = ref(false);
+
+let facebookAppConfig = {
+    facebookAppId: "",
+    faceShareRedirectUrl
+};
+
+let reportParams = {
+    discordFans: '',
+    twitterFans: '',
+    done: {
+    },
+    hasReport: false,
+}
+
+let discordTaskDetail = null;
+
+let state = reactive({
+    status: '',
+    userId: '',
+    loading_show: false,
+    loading_redbag: true,
+    detail: {},
+    luck_list_end: false,
+    page_index: 1,
+    page_size: 20,
+    srcContentId: '',
+    error_txt: `oops, new accounts cannot participate in this event,`,
+    receiveAmount: 0,
+    money: 0,
+    // 状态
+    done: {
+        follow: false,
+        like: false,
+        retweet: false,
+        join_discord: false,
+        repost_facebook: false,
+        reply: false
+    },
+    notification_show: false,
+    notification_switch: false,
+    open_timer_status: false,
+    count_down_time: ''
+})
+
+let fullName = '';
+
+function clickRetry() {
+    init()
+}
+
+let follow_open_tabs = []
+
+async function clickLikeBtn() {
+    let _userInfo = await checkIsLogin()
+    if (!_userInfo) {
+        return
+    }
+    state.detail.finishTaskTypeV2 = state.detail.finishTaskTypeV2.toString() || ''
+    if (state.window_origin.indexOf('facebook.com') >= 0) {
+        state.detail.finishTaskTypeV2 = '2'
+    }
+    switch (state.detail.finishTaskTypeV2) {
+        case '1':
+            state.loading_show = true
+            oneKeyLike({
+                params: {
+                    tweetId: state.srcContentId
+                }
+            }).then((res) => {
+                state.loading_show = false
+                if (res.code == 0) {
+                    if (res.data.result) {
+                        state.done.like = true
+                    } else {
+                        state.done.like = false
+                        window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
+                    }
+                } else {
+                    window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
+                    state.done.like = false
+                }
+            }).catch(() => {
+                state.loading_show = false
+            })
+            break
+        case '2':
+            window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
+            break
+        case '3':
+            state.loading_show = true
+            chrome.tabs.getCurrent((tab) => {
+                chrome.tabs.sendMessage(tab.id, {
+                    actionType: "IFRAME_TWITTER_API_DO_TASK", task_data: {
+                        tweet_Id: state.tweetId
+                    }, task_type: 'like'
+                }, (res) => { console.log(res) });
+            })
+            break
+        default:
+            window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
+            break
+    }
+
+    // 埋点
+    Report.reportLog({
+        objectType: Report.objectType.like,
+        pageSource: Report.pageSource.task_page,
+        businessType: Report.businessType.buttonClick,
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+    });
+}
+function clickDone() {
+    window.open(`${chrome.runtime.getURL('/iframe/home.html')}`)
+    // 埋点
+    Report.reportLog({
+        objectType: Report.objectType.wallet_button,
+        pageSource: Report.pageSource.received_success_page,
+        businessType: Report.businessType.buttonClick,
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+        redPacketType: 1
+    });
+}
+function handleScroll(e) {
+    if (state.luck_list_end) {
+        return
+    }
+    e = e.target
+    if ((e.clientHeight + e.scrollTop) / e.scrollHeight > .8) {
+        state.luck_list_end = true
+        state.page_index++
+        handleReceivedList()
+    }
+}
+function handleReceivedList() {
+    getReceivedList({
+        params: {
+            pageNum: state.page_index,
+            pageSize: state.page_size,
+            postId: state.postId
+        }
+    }).then((res) => {
+        if (res.code == 0) {
+            if (res.data.length > 0) {
+                state.detail.allReceived = state.detail.allReceived.concat(res.data)
+                state.luck_list_end = false
+            } else {
+                state.luck_list_end = true
+            }
+        } else {
+            console.log('getReceivedList', res)
+        }
+    })
+}
+
+const openTwitterDetail = (item) => {
+    if (item.simpleUserInfoVO.nickName) {
+        window.open(`https://twitter.com/${item.simpleUserInfoVO.nickName}`)
+    }
+}
+
+async function clickRetweetBtn() {
+    let _userInfo = await checkIsLogin()
+    if (!_userInfo) {
+        return
+    }
+
+    state.detail.finishTaskTypeV2 = state.detail.finishTaskTypeV2.toString() || ''
+    if (state.window_origin.indexOf('facebook.com') >= 0) {
+        state.detail.finishTaskTypeV2 = '2'
+    }
+    switch (state.detail.finishTaskTypeV2) {
+        case '1':
+            state.loading_show = true
+            oneKeyReTweet({
+                params: {
+                    tweetId: state.srcContentId
+                }
+            }).then((res) => {
+                state.loading_show = false
+                if (res.code == 0) {
+                    if (res.data.result) {
+                        state.done.retweet = true
+                    } else {
+                        window.open(`https://twitter.com/intent/retweet?tweet_id=${state.tweetId}`)
+                        state.done.retweet = false
+                    }
+                } else {
+                    window.open(`https://twitter.com/retweet/like?tweet_id=${state.tweetId}`)
+                    state.done.retweet = false
+                }
+            }).catch(() => {
+                state.loading_show = false
+            })
+            break;
+        case '2':
+            window.open(`https://twitter.com/intent/retweet?tweet_id=${state.tweetId}`)
+            break
+        case '3':
+            state.loading_show = true
+            chrome.tabs.getCurrent((tab) => {
+                chrome.tabs.sendMessage(tab.id, {
+                    actionType: "IFRAME_TWITTER_API_DO_TASK", task_data: {
+                        tweet_Id: state.tweetId
+                    }, task_type: 'retweet'
+                }, (res) => { console.log(res) });
+            })
+            break
+        default:
+            window.open(`https://twitter.com/intent/retweet?tweet_id=${state.tweetId}`)
+            break;
+    }
+
+    // 埋点
+    Report.reportLog({
+        objectType: Report.objectType.retweet,
+        pageSource: Report.pageSource.task_page,
+        businessType: Report.businessType.buttonClick,
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+    });
+}
+
+function onTweetReplyClick(params) {
+    let replyData = {
+        postId: state.postId,
+        type: params.type,
+        taskLuckdropId: state.detail.taskLuckdropId
+    }
+
+    window.parent.postMessage({ actionType: "IFRAME_RED_PACKET_ON_TWEET_REPLY_CLICK", data: replyData }, "*");
+}
+
+function changeNotification(checked) {
+    let noticeSwitch = checked ? 1 : 0;
+    // set
+    putSetting({
+        params: { noticeSwitch }
+    }).then(res => {
+        let { code } = res;
+        if (code === 0) {
+            state.notification_switch = checked
+        } else {
+            state.notification_switch = !checked
+        }
+    }).catch(() => {
+        state.notification_switch = !checked
+    })
+}
+
+function setNotification(req) {
+    state.notification_switch = req.status;
+}
+
+async function clickReply(params) {
+    let _userInfo = await checkIsLogin()
+    if (!_userInfo) {
+        return
+    }
+
+    let replyData = {
+        postId: state.postId,
+        type: params.type,
+        taskLuckdropId: state.detail.taskLuckdropId
+    }
+    if (state.window_origin.indexOf('facebook.com') > -1) {
+        let url = `https://twitter.com/${state.tweet_author}/status/${state.tweetId}?actionType=denetFacebookToTwitterReply&deReplyParams=${JSON.stringify(replyData)}`
+        window.open(url)
+    } else {
+        window.parent.postMessage({ actionType: "IFRAME_RED_PACKET_REPLY_CLICK", data: replyData }, "*");
+    }
+
+    // 埋点
+    Report.reportLog({
+        objectType: Report.objectType.comment_and_tag,
+        pageSource: Report.pageSource.task_page,
+        businessType: Report.businessType.buttonClick,
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+        redPacketType: 1
+    });
+}
+
+/**
+ * 点击repost facebook
+ */
+async function clickRepostFacebook(params) {
+    let _userInfo = await checkIsLogin()
+    if (!_userInfo) {
+        return
+    }
+
+    let deUrlParams = {
+        fullName,
+        tweetId: state.tweetId
+    }
+    let href = `${state.postRedirectUrl}?deUrlParams=${JSON.stringify(deUrlParams)}`;
+    console.log(href);
+    let shareUrlparams = {
+        href,
+        type: params.type,
+        taskLuckdropId: state.detail.taskLuckdropId
+    }
+
+    setChromeStorage({
+        shareFacebookData: JSON.stringify({
+            contentStr: state.srcContent
+        })
+    })
+
+    let shareUrl = feacebookShareUrl(shareUrlparams);
+    openShareFacebookWindow({ url: shareUrl });
+
+    // 埋点
+    Report.reportLog({
+        objectType: Report.objectType.share_facebook,
+        pageSource: Report.pageSource.task_page,
+        businessType: Report.businessType.buttonClick,
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+        redPacketType: 1
+    });
+}
+
+/**
+ * 分享到facebook
+ */
+function openShareFacebookWindow({ url }) {
+    const width = 800;
+    chrome.windows.create({
+        width,
+        type: 'normal',
+        url
+    }, function (window) {
+
+    })
+}
+
+/**
+ * 分享fecebook 地址
+ */
+function feacebookShareUrl(params = {}) {
+    let { href = '', type = '', taskLuckdropId } = params;
+    let cbParams = JSON.stringify({
+        type,
+        taskLuckdropId
+    })
+    let shareUrl = `https://www.facebook.com/dialog/share?app_id=${facebookAppConfig.facebookAppId}&display=popup&href=${href}&redirect_uri=${facebookAppConfig.faceShareRedirectUrl}?params=${cbParams}`;
+
+    return shareUrl;
+}
+
+/**
+ * 分享成功
+ */
+function facebookShareSuccess(params) {
+    let { taskLuckdropId } = params;
+
+    if (taskLuckdropId == state.detail.taskLuckdropId) {
+        state.done.repost_facebook = true;
+        state.done.repost_facebook_red = false;
+    }
+}
+
+
+function getValidity() {
+    let _d1, _d2, _d3, _h, _m, _s
+    if (!state.detail.myReceived.taskEndTimestamp) {
+        return
+    }
+    let timer = setInterval(() => {
+        let _time = new Date().getTime()
+        _d3 = state.detail.myReceived.taskEndTimestamp - _time
+        if (_d3 > 0) {
+            _d1 = moment(state.detail.myReceived.taskEndTimestamp)
+            _d2 = moment(_time)
+            _h = moment.duration(_d1.diff(_d2)).hours()
+            if (_h < 10) {
+                _h = '0' + _h
+            }
+            _m = moment.duration(_d1.diff(_d2)).minutes()
+            if (_m < 10) {
+                _m = '0' + _m
+            }
+            _s = moment.duration(_d1.diff(_d2)).seconds()
+            if (_s < 10) {
+                _s = '0' + _s
+            }
+            state.detail.validity = `${_h}:${_m}:${_s}`
+        } else {
+            state.detail.validity = `00:00:00`
+            clearInterval(timer)
+        }
+    }, 1000)
+}
+
+// 倒计时
+const getTimeStr = (end_time_ms) => {
+    let now_time_ms, now_time, end_time
+    let _time, _h, _m, _s, _time_str
+    now_time_ms = new Date().getTime()
+    _time = end_time_ms - now_time_ms
+    if (_time > 0) {
+        now_time = moment(now_time_ms)
+        end_time = moment(end_time_ms)
+        _h = moment.duration(end_time.diff(now_time)).hours()
+        _m = moment.duration(end_time.diff(now_time)).minutes()
+        _s = moment.duration(end_time.diff(now_time)).seconds()
+        if (_h < 10) {
+            _h = '0' + _h
+        }
+        if (_m < 10) {
+            _m = '0' + _m
+        }
+        if (_s < 10) {
+            _s = '0' + _s
+        }
+        _time_str = `${_h}:${_m}:${_s}`
+    } else {
+        _time_str = `00:00:00`
+    }
+    return _time_str
+}
+
+function openConutDownTime(end_time_ms, callback) {
+    end_time_ms = Number(end_time_ms) + 5000
+    let end_time_s = Number((end_time_ms - new Date().getTime()) / 1000)
+    let timer = setInterval(() => {
+        end_time_s = Number((end_time_ms - new Date().getTime()) / 1000)
+        if (state.open_timer_status == true) {
+            clearInterval(timer)
+        }
+        callback(formatSecondsAsDaysOrTime(end_time_s))
+    }, 1000);
+    callback(formatSecondsAsDaysOrTime(end_time_s))
+}
+
+const openFollowTabs = (arr_name) => {
+    let array_finish = arr_name.filter((item) => { return !item.finished })
+    // let array_finish = state.detail.taskCondition[0].relatedUsers.filter((item) => { return item.finished == false })
+    let url
+    if (array_finish.length > 0) {
+        state.done.follow = false
+        // 打开标签页的方法
+        array_finish.forEach((item) => {
+            url = `https://twitter.com/intent/follow?screen_name=${item.name}&tweet_id=${state.tweetId}`
+            chrome.tabs.create({ url }, (tab) => {
+                if (follow_open_tabs.filter((item) => { return item.url == tab.url }).length == 0) {
+                    follow_open_tabs.push(tab)
+                }
+            })
+        })
+    }
+}
+
+async function clickFollowAll(item, is_all) {
+    let _userInfo = await checkIsLogin()
+    if (!_userInfo) {
+        return
+    }
+    let arr_name = []
+    for (let i in item) {
+        if (!item[i].finished) {
+            arr_name.push(item[i])
+        }
+    }
+    // ---- 
+    state.detail.finishTaskTypeV2 = state.detail.finishTaskTypeV2.toString() || ''
+    if (state.window_origin.indexOf('facebook.com') >= 0) {
+        state.detail.finishTaskTypeV2 = '2'
+    }
+    switch (state.detail.finishTaskTypeV2) {
+        case '1':
+            // openapi
+            state.loading_show = true
+            oneKeyFollow({
+                params: {
+                    names: arr_name
+                }
+            }).then((res) => {
+                state.loading_show = false
+                if (res.code == 0) {
+                    res.data.forEach((item1) => {
+                        state.detail.taskCondition[0].relatedUsers.forEach(item2 => {
+                            if (item1.name == item2.name && item1.finished) {
+                                item2.finished = true
+                            }
+                        });
+                    })
+                    openFollowTabs(arr_name)
+                }
+            }).catch(() => {
+                state.loading_show = false
+            })
+            break
+        case '2':
+            openFollowTabs(arr_name)
+            break
+        case '3':
+            if (arr_name.filter((item) => { return !item.twitterUserId }).length > 0) {
+                openFollowTabs(arr_name)
+                return
+            }
+            let follow_data = []
+            arr_name.forEach((item) => {
+                follow_data.push(item)
+            })
+            state.loading_show = true
+            chrome.tabs.getCurrent((tab) => {
+                chrome.tabs.sendMessage(tab.id, {
+                    actionType: "IFRAME_TWITTER_API_DO_TASK",
+                    task_data: {
+                        tweet_Id: state.tweetId,
+                        follow_data: follow_data,
+                    },
+                    task_type: 'follow'
+                }, (res) => { console.log(res) });
+            })
+
+            break
+        default:
+            openFollowTabs(arr_name)
+            break
+    }
+    // -------- 埋点 --------
+    let _log_obj = {
+        pageSource: Report.pageSource.task_page,
+        businessType: Report.businessType.buttonClick,
+        objectType: Report.objectType.follow
+    }
+    if (is_all) {
+        _log_obj.objectType = Report.objectType.follow_button
+    }
+    Report.reportLog(_log_obj, {
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+    });
+}
+
+
+// 重新绑定
+const reSetBindTwtterId = (_params) => {
+    let postBizData = JSON.parse(_params.postBizData);
+    let { taskCondition } = postBizData;
+    let discordTask = JSON.parse(taskCondition).find(item => item.type == 7);
+
+    getChromeStorage('userInfo', (_userInfo) => {
+        if (_userInfo && _userInfo.uid == _params.uid) {
+            srcPublishSuccess({
+                params: {
+                    postId: state.postId,
+                    srcContentId: state.tweetId
+                }
+            }).then((res) => {
+                if (res.code == 0 || res.code == 3003) {
+                    init({ from: 'reSetBindTwtterId' })
+                    reportBindTweetSuccess({ discordTask, ..._params });
+                }
+            })
+        }
+    })
+}
+
+const reportBindTweetSuccess = (params) => {
+    let { discordTask, srcUserId } = params || {};
+    discordTaskDetail = discordTask;
+    sendChromeTabMessage({
+        actionType: "IFRAME_API_GET_TWEET_USER_INFO_REQ",
+        data: {
+            screen_name: srcUserId
+        }
+    })
+
+    if (discordTask) {
+        getDiscordInfo({ inviteUrl: JSON.parse(discordTask.bizData).inviteUrl }, (res) => {
+            if (res.inviteCode == res.code) {
+                reportParams.discordFans = res.approximate_member_count;
+
+                if (reportParams.twitterFans !== '' && !reportParams.hasReport) {
+                    reportParams.hasReport = true;
+                    Report.reportLog({
+                        objectType: Report.objectType.tweetPostBinded,
+                        twitterFans: reportParams.twitterFans,
+                        discordFans: reportParams.discordFans,
+                        redPacketType: 1
+                    });
+                }
+            }
+        })
+    }
+}
+
+const getDiscordInfo = (params, cb) => {
+    let { inviteUrl } = params;
+    if (!inviteUrl) return;
+
+    let inviteCode = '';
+    let arr = inviteUrl.split('/');
+    if (arr.length > 0) {
+        inviteCode = arr[arr.length - 1];
+    }
+    if (!inviteCode) {
+        return;
+    }
+
+    getInviteGuildInfo({
+        inviteCode
+    }).then(res => {
+        cb && cb({
+            ...res,
+            inviteCode
+        })
+    }).catch((err) => {
+    });
+}
+
+const showCloseEndTimePage = () => {
+    state.status = 'close'
+    state.open_timer_status = true
+    state.close_status = '已经过期了'
+    state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
+}
+
+const showCloseEndTimePageReport = () => {
+    // 埋点
+    Report.reportLog({
+        pageSource: Report.pageSource.expired_page,
+        businessType: Report.businessType.pageView,
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+    });
+}
+
+const showSuccessPage = () => {
+    state.status = 'success'
+    state.open_timer_status = true;
+
+    if (!reportParams.reportReceivedPageViewSuccess) {
+        reportParams.reportReceivedPageViewSuccess = true;
+
+        // 埋点
+        Report.reportLog({
+            pageSource: Report.pageSource.received_success_page,
+            businessType: Report.businessType.pageView,
+            postId: state.postId,
+            srcContentId: state.tweetId,
+            senderId: state.userId,
+            isOldTwitterFans: reportParams.done.follow,
+            isOldDiscordFans: reportParams.done.join_discord,
+            redPacketType: 1
+        });
+    }
+}
+
+const showNotOpenPage = () => {
+    state.status = 'not-open'
+    openConutDownTime(state.detail.endTimestamp, (time_str) => {
+        state.count_down_time = time_str
+        if (time_str == '00:00:00') {
+            init()
+        }
+    })
+    Report.reportLog({
+        pageSource: Report.pageSource.pending_page,
+        businessType: Report.businessType.pageView,
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+        redPacketType: 1
+    });
+}
+const showOpenedPage = () => {
+    state.status = 'opened'
+    state.open_timer_status == true
+    initTaskDetail(() => {
+        showOpenedPageReport()
+    })
+}
+const showOpenedPageReport = () => {
+    reportParams.done.follow = state.done.follow;
+    reportParams.done.join_discord = state.done.join_discord;
+
+    // 埋点
+    Report.reportLog({
+        pageSource: Report.pageSource.task_page,
+        businessType: Report.businessType.pageView,
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+        isOldTwitterFans: state.done.follow,
+        isOldDiscordFans: state.done.join_discord,
+        redPacketType: 1
+    });
+}
+
+const showRabbitPage = () => {
+    state.status = 'close'
+    state.close_status = '没有抽中'
+    state.open_timer_status = true
+}
+const showRabbitPageReport = () => {
+    Report.reportLog({
+        pageSource: Report.pageSource.received_empty_rewards_page,
+        businessType: Report.businessType.pageView,
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+    });
+}
+const handleStatusPage = () => {
+    // status 红包状态(0:未开始,1:进行中,2:已结束,3:已终止,4:终止退款进行中)
+    // myReceived 我是否领取过
+    // taskFinishStatus 任务完成状态(0:未完成,1:已完成,2:已过期)
+    // receiveTimeExpired 是否已经过了红包的领取截止时间
+    // endTimestamp 开奖时间
+
+    // ---- 判断结构 ----
+    // 如果 红包状态 = 未开始
+    //    显示未打开页面 return
+
+    // 如果 红包状态 =  已终止 | 终止退款进行中
+    //      显示过期页面
+    // 如果 我领取过了
+    //    如果 任务完成状态 = 未完成 & 红包状态 = 进行中
+    //         显示任务未完成页面
+    //    如果 任务完成状态 = 未完成 & 红包状态 = 已结束
+    //         显示过期页面
+    //    如果 任务完成状态 = 已经完成
+    //        如果 领取到红包金额 = 0 & 红包状态 = 已结束
+    //            显示兔子页面
+    //        否则如果 红包状态 = 已结束
+    //            显示成功页面
+    //        如果 红包状态 = 进行中
+    //            显示等待结果页面
+
+    //    如果 任务完成状态 = 已经过期
+    //        如果 红包状态 = 进行中
+    //            显示未打开页面
+    //        否则 
+    //            显示已经过期页面
+
+    // 如果 我没有领取过 & 红包状态 = 进行中
+    //    如果 过了红包的领取截止时间 = true
+    //        显示已经过期页面
+    //    如果 过了红包的领取截止时间 = false
+    //        显示未打开页面
+
+    // 如果 我没有领取过 & 红包状态 = 已结束 | 已终止 | 终止退款进行中
+    //    显示过期页面
+
+    // -------- 华丽的分割线 --------
+    // 如果 红包状态 = 未开始
+    if (state.detail.status == 0) {
+        showNotOpenPage()
+        return
+    }
+    // 如果 红包状态 =  已终止 | 终止退款进行中
+    if (state.detail.status == 3 || state.detail.status == 4) {
+        //      显示过期页面
+        showCloseEndTimePage()
+        showCloseEndTimePageReport()
+    }
+    // 如果 我领取过了
+    else if (state.detail.myReceived) {
+        state.receiveAmount = state.detail.myReceived.amountValue || 0
+        state.detail.taskCondition = JSON.parse(state.detail.taskCondition)
+        // 如果 任务完成状态 = 未完成 & 红包状态 = 进行中
+        if (state.detail.myReceived.taskFinishStatus == 0 && state.detail.status == 1) {
+            // 显示任务未完成页面 
+            showOpenedPage()
+            if (state.process_mode != 'production') {
+                getValidity()
+            }
+            //    如果 任务完成状态 = 未完成 & 红包状态 = 已结束
+            else if (state.detail.myReceived.taskFinishStatus == 0 && state.detail.status == 2) {
+                // 显示已经过期页面
+                showCloseEndTimePage()
+                showCloseEndTimePageReport()
+            }
+            //如果 任务完成状态 = 已经完成
+        } else if (state.detail.myReceived.taskFinishStatus == 1) {
+            // 领取到空红包 & 红包状态 = 已结束
+            if (state.receiveAmount == 0 && state.detail.status == 2) {
+                showRabbitPage()
+                showRabbitPageReport()
+            } else if (state.detail.status == 2) {
+                // 显示成功页面
+                showSuccessPage()
+            }
+            // 如果  红包状态 = 进行中
+            else if (state.detail.status == 1) {
+                // 显示等待结果页面
+                showLoadResult()
+                openTimer()
+            }
+            // 如果 任务完成状态 = 已经过期
+        } else {
+            // 如果 红包状态 = 进行中
+            if (state.detail.status == 1) {
+                // 显示未打开页面
+                showNotOpenPage()
+                // 否则 
+            } else {
+                // 显示已经过期页面
+                showCloseEndTimePage()
+                showCloseEndTimePageReport()
+            }
+        }
+        // 如果 我没有领取过
+    } else {
+        // 如果 红包状态 = 进行中
+        if (state.detail.status == 1) {
+            // 如果 过了红包的领取截止时间 = true
+            if (state.detail.receiveTimeExpired) {
+                // 显示过期页面      
+                showCloseEndTimePage()
+                showCloseEndTimePageReport()
+                // 如果 过了红包的领取截止时间 = false
+            } else {
+                // 显示未打开页面
+                showNotOpenPage()
+            }
+            // 红包状态 = 已经结束了 | 已经终止 | 终止退款中
+        } else {
+            // 显示过期页面
+            showCloseEndTimePage()
+            showCloseEndTimePageReport()
+        }
+    }
+
+}
+
+function setFrontConfig() {
+    getFrontConfig({
+        params: {},
+    }).then((res) => {
+        if (res.code == 0) {
+            facebookAppConfig.facebookAppId = res.data.fbClientId;
+        }
+    });
+};
+
+function init(initParams) {
+    let { type } = initParams || {};
+    onPageVisbile();
+    onWindowMessage();
+    setFrontConfig();
+    getPostDetail({
+        params: {
+            postId: state.postId
+        }
+    }).then((res) => {
+        state.loading_show = false
+        // 领取0元为空红包继续流程
+        // ---- 完成任务接口 ----
+        // 如果金额是0
+        //    显示没有抽中
+        if (res.code == 0) {
+            state.srcContent = res.data.srcContent;
+            state.postRedirectUrl = res.data.postRedirectUrl;
+
+            // 判断推特id,绑定逻辑
+            state.srcContentId = res.data.srcContentId
+
+            if (!state.srcContentId) {
+                reSetBindTwtterId(res.data)
+                return
+            }
+            state.detail = JSON.parse(res.data.postBizData)
+            state.detail.taskCondition = state.detail.taskCondition || []
+            state.tweetId = state.srcContentId;
+            state.userId = res.data.srcUserId;
+            state.tweet_author = state.detail.postUserInfo && state.detail.postUserInfo.nickName || '';
+            // 不要删除这个console
+            console.log('postBizData', state.detail)
+            checkFacebookReply();
+            handleStatusPage()
+        } else {
+            handleErrorCode(res)
+        }
+    }).finally(() => {
+        state.loading_redbag = false
+    })
+}
+
+function initTaskDetail(cb) {
+    getChromeStorage('userInfo', (_userInfo) => {
+        if (_userInfo && _userInfo.uid) {
+            // 任务详情
+            getTaskDetail({
+                params: {
+                    postId: state.postId
+                }
+            }).then((res) => {
+                if (res.code.toString()) {
+                    for (let i in res.data) {
+                        switch (res.data[i].type) {
+                            case 1:
+                                state.done.follow = res.data[i].finished
+                                state.detail.taskCondition[0].relatedUsers = res.data[i].detail
+                                break
+                            case 2:
+                                state.done.like = res.data[i].finished
+                                break
+                            case 3:
+                                state.done.retweet = res.data[i].finished
+                                break
+                            case 7:
+                                state.done.join_discord = res.data[i].finished
+                                discordAuthorizeRequired = res.data[i].discordAuthorizeRequired
+                                break
+                            case 8:
+                                state.done.repost_facebook = res.data[i].finished;
+                                break;
+                            case 9:
+                                state.done.reply = res.data[i].finished;
+                                if (!state.done.reply) {
+                                    onTweetReplyClick({ type: 9 });
+                                }
+                                break;
+                        }
+                    }
+                } else {
+                    handleErrorCode(res)
+                }
+                cb && cb()
+            })
+        }
+    })
+}
+
+let tab_index = 0
+const doTaskReport = (req, sender) => {
+    state.loading_show = false
+    let follow_name = req.task_data.follow_name || ''
+    // 1 Twitter follow Twitter ScreenName
+    // 2 Tweet like
+    // 3 Retweet
+    let event_type = 0
+    switch (req.task_type) {
+        case 'retweet':
+            event_type = 3
+            state.done.retweet = req.task_done
+            if (!req.task_done && req.do_type == 'api') {
+                window.open(`https://twitter.com/intent/retweet?tweet_id=${state.tweetId}`)
+            }
+            break;
+        case 'like':
+            event_type = 2
+            state.done.like = req.task_done
+            // 
+            if (!req.task_done && req.do_type == 'api') {
+                window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
+            }
+            break
+        case 'follow':
+            event_type = 1
+            // for (let i = 0; i < follow_open_tabs.length; i++) {
+            //   if (follow_open_tabs[i].id == sender.tab.id) {
+            //     follow_open_tabs.splice(i, 1)
+            //     break
+            //   }
+            // }
+            // chrome.tabs.getCurrent((tab) => {
+            //   if (follow_open_tabs.length > 0) {
+            //     tab_index = follow_open_tabs[follow_open_tabs.length - 1].index
+            //   } else {
+            //     tab_index = tab.index
+            //   }
+            //   chrome.tabs.highlight({ windowId: tab.windowId, tabs: tab_index })
+            // })
+            let has_no_finished = false
+            state.detail.taskCondition[0].relatedUsers.forEach((item) => {
+                if (follow_name == item.name) {
+                    item.finished = req.task_done
+                }
+            })
+            state.detail.taskCondition[0].relatedUsers.forEach((item) => {
+                if (!item.finished) {
+                    has_no_finished = true
+                }
+            })
+            if (!has_no_finished) {
+                state.done.follow = true
+                state.done.follow_red = false
+                openFollowTabs(state.detail.taskCondition[0].relatedUsers)
+            }
+            break
+    }
+    if (req.do_type != 'api') {
+        chrome.tabs.remove(sender.tab.id)
+    }
+    if (req.task_done) {
+        addFinishEvent({
+            params: {
+                eventData: follow_name,
+                eventType: event_type,
+                luckdropId: state.detail.taskLuckdropId
+            }
+        })
+    }
+}
+
+let open_timer_flag = false
+// 倒计时开奖
+const openTimer = () => {
+    if (open_timer_flag) {
+        return
+    }
+    open_timer_flag = true
+
+    openConutDownTime(state.detail.endTimestamp, (time_str) => {
+        state.count_down_time = time_str
+        if (time_str == '00:00:00') {
+            init()
+        }
+    })
+}
+
+async function showLoadResult() {
+    state.status = 'close'
+    state.close_status = '等待结果'
+    getChromeStorage('userInfo', (_userInfo) => {
+        if (_userInfo) {
+            getUserSetting()
+        }
+    })
+}
+
+const getUserSetting = () => {
+    getSetting({}).then((res) => {
+        let { code, data } = res;
+        if (code === 0) {
+            state.notification_show = true
+            state.notification_switch = data.noticeSwitch === 1 ? true : false;
+        }
+    });
+}
+
+onMounted(() => {
+    state.process_mode = process.env.NODE_ENV
+    state.postId = getQueryString('postId')
+    state.window_origin = getQueryString('window_origin') || '';
+    if (state.window_origin.indexOf('twitter.com') > -1) {
+        state.tweetId = getQueryString('tweetId')
+        state.tweet_author = getQueryString('tweet_author');
+    }
+
+    getTweetAuthor()
+    init()
+    onRuntimeMsg();
+    // state.loading_show = true
+    // state.status = 'not-open'
+    // state.status = 'success'
+    // state.status = 'close'
+    // state.close_status = '已经过期了'
+    // state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
+    // state.close_status = '没有抽中'
+    // state.close_status = '已过期'
+
+})
+
+function getTweetAuthor() {
+    if (state.window_origin.indexOf('twitter.com') > -1) {
+        window.parent.postMessage({
+            actionType: "IFRAME_RED_PACKET_GET_TWEET_AUTHOR", data: {
+                postId: state.postId,
+                taskLuckdropId: state.detail.taskLuckdropId
+            }
+        }, "*");
+    }
+}
+
+function checkFacebookReply() {
+    console.log('checkFacebookReply')
+    if (state.window_origin.indexOf('twitter.com') > -1) {
+        window.parent.postMessage({
+            actionType: "IFRAME_RED_PACKET_CHECK_FACEBOOK_REPLY", data: {
+                postId: state.postId
+            }
+        }, "*");
+    }
+}
+
+// 点击领取
+function clickOpenRedPacket() {
+    callEventPageMethod('CONTENT_GET_PINED', {})
+    handleRedPacket()
+}
+
+function handleRedPacket() {
+    state.loading_show = true
+    getRedPacket({
+        params: {
+            postId: state.postId
+        }
+    }).then((res) => {
+        if (res.code == 0) {
+            init()
+        } else {
+            state.loading_show = false
+            handleErrorCode(res)
+        }
+    }).catch(() => {
+        state.loading_show = false
+    })
+    // 埋点
+    Report.reportLog({
+        pageSource: Report.pageSource.pending_page,
+        businessType: Report.businessType.buttonClick,
+        objectType: Report.objectType.open_button,
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+        redPacketType: 1
+    });
+}
+
+chrome.storage.onChanged.addListener(changes => {
+    if (changes.userInfo) {
+        // let item = JSON.parse(changes.userInfo.newValue)
+        state.loading_show = false
+        init()
+    }
+})
+
+// 校验是否封路
+function checkIsLogin() {
+
+    return new Promise((resolve) => {
+        getChromeStorage('userInfo', (_userInfo) => {
+            if (!_userInfo) {
+                state.loading_show = true
+                setTimeout(() => {
+                    state.loading_show = false
+                }, 3000)
+                chrome.runtime.sendMessage(
+                    { actionType: "POPUP_LOGIN", data: "" },
+                    (response) => {
+                        console.log("res", response);
+                    }
+                )
+                resolve(_userInfo)
+            } else {
+                resolve(_userInfo)
+            }
+        })
+    })
+}
+
+async function clickGetGiveaways() {
+    let _userInfo = await checkIsLogin()
+    if (_userInfo) {
+        handleFinishRedPacket()
+    }
+}
+
+function handleFinishRedPacket() {
+    state.loading_show = true
+    finishRedPacket({
+        params: {
+            postId: state.postId
+        }
+    }).then((res) => {
+        if (res.code == 0) {
+            if (res.data.finished) {
+                state.receiveAmount = res.data.receiveAmount
+                init()
+                // 埋点
+                Report.reportLog({
+                    pageSource: Report.pageSource.task_page,
+                    businessType: Report.businessType.buttonClick,
+                    objectType: Report.objectType.get_giveaway,
+                    postId: state.postId,
+                    srcContentId: state.tweetId,
+                    senderId: state.userId,
+                }, {
+                    get_giveaway_result: Report.extParams.success
+                });
+            } else {
+                state.loading_show = false
+                let _data = res.data.conditionResult
+                for (let i in _data) {
+                    switch (_data[i].type.toString()) {
+                        case '1':
+                            state.detail.taskCondition[0].relatedUsers = _data[i].detail
+                            if (_data[i].finished) {
+                                state.done.follow = true
+                                state.done.follow_red = false
+                            } else {
+                                // alert('Please complete the task: follow')
+                                state.done.follow = false
+                                state.done.follow_red = true
+                            }
+                            break
+                        case '2':
+                            if (_data[i].finished) {
+                                state.done.like = true
+                                state.done.like_red = false
+                            } else {
+                                // alert('Please complete the task: like tweet')
+                                state.done.like = false
+                                state.done.like_red = true
+                            }
+                            break
+                        case '3':
+                            if (_data[i].finished) {
+                                state.done.retweet = true
+                                state.done.retweet_red = false
+                            } else {
+                                // alert('Please complete the task: Retweet')
+                                state.done.retweet_red = true
+                                state.done.retweet = false
+                            }
+                            break
+                        case '7':
+                            //join discord
+                            discordAuthorizeRequired = _data[i].discordAuthorizeRequired;
+                            if (_data[i].finished) {
+                                state.done.join_discord = true
+                                state.done.join_discord_red = false
+                            } else {
+                                state.done.join_discord = false;
+                                state.done.join_discord_red = true
+                            }
+                            break
+                        case '8':
+                            //repost feacebook
+                            if (_data[i].finished) {
+                                state.done.repost_facebook = true
+                                state.done.repost_facebook_red = false
+                            } else {
+                                state.done.repost_facebook = false;
+                                state.done.repost_facebook_red = true
+                            }
+                            break
+                        case '9':
+                            //reply
+                            if (_data[i].finished) {
+                                state.done.reply = true
+                                state.done.reply_red = false
+                            } else {
+                                state.done.reply = false;
+                                state.done.reply_red = true
+                            }
+                            break
+                    }
+                }
+                // 埋点
+                Report.reportLog({
+                    pageSource: Report.pageSource.task_page,
+                    businessType: Report.businessType.buttonClick,
+                    objectType: Report.objectType.get_giveaway,
+                    postId: state.postId,
+                    srcContentId: state.tweetId,
+                    senderId: state.userId,
+                }, {
+                    get_giveaway_result: Report.extParams.failure,
+                });
+                if (discordAuthorizeRequired) {
+                    discordAuth('reAuth');
+                }
+            }
+        } else {
+            state.loading_show = false
+            // 埋点
+            Report.reportLog({
+                pageSource: Report.pageSource.task_page,
+                businessType: Report.businessType.buttonClick,
+                objectType: Report.objectType.get_giveaway,
+                postId: state.postId,
+                srcContentId: state.tweetId,
+                senderId: state.userId,
+            }, {
+                get_giveaway_result: Report.extParams.failure,
+            });
+            handleErrorCode(res)
+        }
+    }).catch(() => {
+        state.loading_show = false
+    })
+}
+
+
+function handleErrorCode(res) {
+    switch (res.code.toString()) {
+        // 数据异常,请联系管理员
+        case '-102':
+
+            break
+        //系统错误
+        case '-101':
+
+            break
+
+        // 参数不对
+        case '-103':
+            break
+        // 接口被限流
+        case '-105':
+            break
+
+        // 访问凭证不存在
+        case '-107':
+            break
+        // 重复操作过于频繁
+        case '-106':
+            message.error('Clicking too often, wait a moment and click again')
+            state.loading_show = false
+            break
+        // 红包不存在
+        case '2001':
+            // message.error(res.msg)
+            break
+        // 还未到红包领取时间
+        case '2002':
+            // message.error(res.msg)
+            break
+        // 已超过红包领取时间
+        case '2003':
+            init()
+            break
+        // 红包支付状态异常 没有可提交的任务红包
+        case '2004':
+            init()
+            break
+        // 红包活动已结束
+        case '2006':
+            init()
+            break
+        // 红包金额已经被领取完了
+        case '2007':
+            state.status = 'close'
+            state.close_status = '已经过期了'
+            state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
+            init()
+            break
+        // 红包个数已经被领取完了
+        case '2008':
+            state.status = 'close'
+            state.close_status = '已经过期了'
+            state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
+            init()
+            break
+        // 该用户不满足领取条件
+        case '2009':
+            state.error_txt = [`oops, new accounts cannot participate in this event,`]
+            state.status = 'error'
+            state.retry = true
+            // 埋点
+            Report.reportLog({
+                pageSource: Report.pageSource.robot_detection_failed_page,
+                businessType: Report.businessType.pageView,
+                postId: state.postId,
+                srcContentId: state.tweetId,
+                senderId: state.userId,
+            });
+            break
+        // 无法校验用户Twitter信息
+        case '2010':
+            // message.error(res.msg)
+            break
+        // 用户已经领过该红包
+        case '2011':
+            // message.error(res.msg)
+            break
+        // 推文不存在
+        case '2022':
+            // message.error(res.msg)
+            break
+        // 推文未发布 and 不是红包任务的推文
+        case '2023':
+            // message.error(res.msg)
+            break
+        // 没有可提交的任务红包
+        case '2024':
+            state.status = 'not-open'
+            break
+        // 红包任务已完成
+        case '2025':
+            break
+        // 任务已经过期
+        case '2026':
+            break
+        // 任务未完成
+        case '2027':
+            break
+        // 红包金额每人不足1分钱
+        case '2028':
+            break
+        // 推文未发布
+        case '2029':
+            message.error('Tweet not posted')
+            break
+        // 不是红包任务的推文
+        case '2030':
+            break
+        case '2037':
+            showCloseEndTimePage()
+            init()
+            break
+        //用户没有领取过红包,无法重抽
+        case '2031':
+            break
+        // 需要重新授权 discord
+        case '1010':
+            discordAuth('reAuth');
+            break
+    }
+}
+
+// function clickBack() {
+//   state.status = 'opened'
+//   // 埋点
+//   Report.reportLog({
+//     pageSource: Report.pageSource.task_page,
+//     businessType: Report.businessType.pageView,
+//   });
+// }
+
+// function clickRoad() {
+//   state.status = 'luck-peopel-list'
+//   // 埋点
+//   Report.reportLog({
+//     pageSource: Report.pageSource.task_page,
+//     businessType: Report.businessType.buttonClick,
+//     objectType: Report.objectType.received_list
+//   });
+//   // 埋点
+//   Report.reportLog({
+//     pageSource: Report.pageSource.received_list_page,
+//     businessType: Report.businessType.pageView
+//   });
+// }
+function onWindowMessage() {
+    window.addEventListener("message", function (event) {
+        if (event.data) {
+            switch (event.data.actionType) {
+                case 'CONTENT_RED_PACKET_REPLY_RASK_FINSH':
+                    state.done.reply = true;
+                    state.done.reply_red = false;
+                    break;
+                case 'CONTENT_RED_PACKET_GET_TWEET_AUTHOR':
+                    fullName = event.data.data.fullName
+                    break;
+                case 'CONTENT_RED_PACKET_FACEBOOK_REPLY':
+                    clickReply(event.data.data)
+                    break;
+            }
+        }
+    });
+}
+
+function onPageVisbile() {
+    document.addEventListener('visibilitychange', function () {
+        let isHidden = document.hidden;
+        if (!isHidden) {
+            checkJoinDiscord();
+        }
+    });
+}
+
+function onRuntimeMsg() {
+    chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
+        sendResponse('ok');
+        switch (req.actionType) {
+            case 'BACK_DISCORD_LOGIN_SUCCESS':
+                discordLoginSuccess();
+                break;
+            case 'BG_FACEBOOK_SHARE_SUCCESS':
+                facebookShareSuccess(req.data);
+                break;
+            case 'DO_TASK':
+                if (!req.task_type || state.tweetId != req.tweet_Id) {
+                    return
+                }
+                state.loading_show = false
+                doTaskReport(req, sender);
+                break;
+            case 'CONTENT_RED_PACKET_REPLY_RASK_FINSH':
+                if (req.data && req.data.postId == state.postId) {
+                    state.done.reply = true;
+                    state.done.reply_red = false;
+                }
+                break;
+            case 'CONTENT_API_GET_TWEET_USER_INFO_RES':
+                let { user } = req.data || {};
+                if (user && user.result && user.result.legacy) {
+                    let legacy = user.result.legacy;
+                    reportParams.twitterFans = legacy.followers_count;
+
+                    if (!discordTaskDetail) {
+                        if (reportParams.hasReport) return;
+                        reportParams.hasReport = true;
+                        Report.reportLog({
+                            objectType: Report.objectType.tweetPostBinded,
+                            twitterFans: reportParams.twitterFans,
+                            redPacketType: 1
+                        });
+                    } else {
+                        if (reportParams.discordFans !== '') {
+                            if (reportParams.hasReport) return;
+                            reportParams.hasReport = true;
+                            Report.reportLog({
+                                objectType: Report.objectType.tweetPostBinded,
+                                twitterFans: reportParams.twitterFans,
+                                discordFans: reportParams.discordFans,
+                                redPacketType: 1
+                            });
+                        }
+                    }
+                }
+                break;
+            case 'USER_SETTING':
+                setNotification(req.data)
+                break;
+        }
+    })
+}
+
+/**
+ * 检查是否加入discord
+ */
+function checkJoinDiscord() {
+    // 如果上次的状态是 joinIng 检查是否真正join
+    if (joinDiscordActionState == 'joinIng') {
+        joinDiscordActionState = 'default';
+        let url = getInviteUrl();
+        if (url) {
+            joinDiscordIng.value = true;
+            checkGuildJoinedStatus({ url }, (res = {}) => {
+                joinDiscordIng.value = false;
+                if (res.code == 0) {
+                    let { joined } = res.data || {};
+                    if (joined) {
+                        state.done.join_discord = true;
+                    } else {
+                        state.done.join_discord = false;
+                    }
+                } else if (res.code == 1010) {
+                    discordAuth('reAuth');
+                }
+            })
+        }
+    }
+}
+
+
+const checkGuildJoinedStatus = ({ url }, cb) => {
+    checkGuildJoined({
+        params: {
+            inviteUrl: url
+        }
+    }).then(res => {
+        cb && cb(res);
+    }).catch(err => {
+        cb && cb({ catch: true })
+    })
+}
+
+/**
+ * 加入discord 事件
+ */
+async function joinDiscord() {
+    let _userInfo = await checkIsLogin();
+    if (!_userInfo) {
+        return
+    }
+    if (joinDiscordIng.value) {
+        return;
+    }
+    // 埋点
+    Report.reportLog({
+        objectType: Report.objectType.join_discord,
+        pageSource: Report.pageSource.task_page,
+        businessType: Report.businessType.buttonClick,
+        postId: state.postId,
+        srcContentId: state.tweetId,
+        senderId: state.userId,
+        redPacketType: 1
+    });
+
+    let url = getInviteUrl();
+    if (url) {
+        joinDiscordIng.value = true;
+        checkGuildJoinedStatus({ url }, (res) => {
+            setTimeout(() => {
+                joinDiscordIng.value = false;
+            }, 1500);
+            if (res.code == 0) {
+                let { joined } = res.data || {};
+                if (joined) {
+                    state.done.join_discord = true;
+                } else {
+                    state.done.join_discord = false;
+                    if (discordAuthorizeRequired) {
+                        discordAuth('authAndJoinIng');
+                    } else {
+                        openInviteUrl();
+                    }
+                }
+            } else if (res.code == 1010) {
+                discordAuth('authAndJoinIng');
+            }
+            if (res.catch) {
+                //判断是否需要授权
+                if (discordAuthorizeRequired) {
+                    discordAuth('authAndJoinIng');
+                } else {
+                    openInviteUrl();
+                }
+            }
+        })
+    }
+}
+
+/**
+ * discord授权
+ */
+function discordAuth(actionState = 'default') {
+    let state = guid();
+    discordAuthUrl({
+        params: {
+            redirectUrl: discordAuthRedirectUri,
+            state
+        }
+    }).then(res => {
+        if (res.code == 0) {
+            let { authorizeUrl = '' } = res.data || {};
+            if (authorizeUrl) {
+                joinDiscordActionState = actionState;
+                const width = 500;
+                chrome.windows.create({
+                    width,
+                    type: 'normal',
+                    url: authorizeUrl
+                }, function (window) {
+                    let windowId = window.id;
+                    callEventPageMethod("RED_PACKET_SAVE_DISCORD_AUTH_WINDOW_ID", {
+                        windowId: windowId
+                    }, function (response) {
+                    });
+                })
+            }
+        }
+    })
+}
+
+/**
+ * sendMessage
+ */
+const callEventPageMethod = (actionType, data, callback) => {
+    chrome.runtime.sendMessage(
+        {
+            actionType: actionType,
+            data: data
+        },
+        function (response) {
+            if (typeof callback === "function") callback(response);
+        }
+    );
+};
+
+/**
+ * discord 授权成功
+ */
+function discordLoginSuccess() {
+    console.log('discordloginSuccess');
+    // 如果是授权并join 默认打开 邀请链接
+    if (joinDiscordActionState == 'authAndJoinIng') {
+        openInviteUrl();
+    }
+    if (discordAuthorizeRequired) {
+        discordAuthorizeRequired = false;
+    }
+}
+
+/**
+ * 获取discord邀请链接
+ */
+function getInviteUrl() {
+    let inviteData = state.detail.taskCondition.find(item => {
+        return item.type == 7;
+    });
+    let url;
+    if (inviteData && inviteData.bizData) {
+        url = JSON.parse(inviteData.bizData).inviteUrl;
+    }
+    return url;
+}
+
+/**
+ * 打开邀请discord链接
+ */
+function openInviteUrl() {
+    joinDiscordActionState = 'joinIng';
+    let url = getInviteUrl();
+    if (url) {
+        if (!url.startsWith('http')) {
+            url = 'https://' + url;
+        }
+        window.open(url);
+    }
+}
+
+</script>
+ 
+<style lang="scss" scoped>
+html,
+body {
+    margin: 0;
+    padding: 0;
+    width: 375px;
+    height: 500px;
+    background-color: unset !important;
+}
+
+:deep() .ant-switch {
+    background-color: #E9ECEE;
+    height: 14px;
+    line-height: 16px;
+    min-width: 36px;
+}
+
+:deep() .ant-switch-checked {
+    background-color: #AED8F5 !important;
+}
+
+:deep() .ant-switch::after {
+    width: 20px;
+    height: 20px;
+    top: -4px;
+    left: -1px;
+}
+
+:deep() .ant-switch-checked::after {
+    background-color: #1D9BF0 !important;
+    margin-left: 3px;
+    left: 100% !important;
+}
+
+.content {
+    position: relative;
+    width: 375px;
+    height: 500px;
+    background: #fafafa;
+    border-radius: 11px;
+    overflow: hidden;
+    box-sizing: border-box;
+    border: 1px solid #DCDCDC;
+    font-family: "SF Pro Display";
+    font-style: normal;
+
+    .loading {
+        background: #FFFFFF;
+        opacity: 0.8;
+        z-index: 222;
+        text-align: center;
+        width: 375px;
+        height: 500px;
+        position: fixed;
+        top: 0;
+        left: 0;
+
+        img {
+            margin-top: 216px;
+            width: 70px;
+            height: 70px;
+        }
+    }
+
+    .redbag {
+        z-index: 222;
+        text-align: center;
+        width: 375px;
+        height: 500px;
+        position: fixed;
+        top: 0;
+        left: 0;
+
+        img {
+            margin-top: 172px;
+            width: 130px;
+            height: 130px;
+        }
+    }
+
+    .error {
+        width: 100%;
+        height: 100%;
+        text-align: center;
+        position: relative;
+
+        img {
+            width: 100px;
+            height: 100px;
+            margin-top: 100px;
+        }
+
+        .txt {
+            font-weight: 500;
+            font-size: 22px;
+            line-height: 26px;
+            text-align: center;
+            letter-spacing: 0.3px;
+            color: #a8a8a8;
+            margin: 34px 44px 0 44px;
+        }
+
+        .retry {
+            position: absolute;
+            bottom: 30px;
+            left: 50%;
+            margin-left: -167.5px;
+            width: 335px;
+            height: 46px;
+            line-height: 46px;
+            text-align: center;
+            border-radius: 100px;
+            border: 1px solid #1D9BF0;
+            background: rgba(196, 196, 196, 0.01);
+            color: #1D9BF0;
+            font-size: 16px;
+            font-weight: 500;
+            cursor: pointer;
+        }
+    }
+
+    .success,
+    .close,
+    .luck-peopel-list {
+        filter: drop-shadow(0px 4px 94px rgba(0, 0, 0, 0.3));
+        width: 100%;
+        height: 100%;
+        border-radius: 11px;
+        background: #fff;
+        overflow: hidden;
+        display: flex;
+        flex-direction: column;
+
+        .close-title {
+            width: 100%;
+            font-weight: 600;
+            font-size: 27px;
+            line-height: 32px;
+            text-align: center;
+            letter-spacing: 0.3px;
+            font-weight: 800;
+            font-size: 22px;
+            color: #ffffff;
+        }
+
+        .head {
+            padding: 14px 16px;
+
+            img {
+                cursor: pointer;
+                width: 24px;
+                height: 24px;
+            }
+        }
+
+        .header {
+            text-align: center;
+            min-height: 160px;
+            width: 100%;
+            background: #fff;
+            // padding-top: 30px;
+            background-size: 100% 100%;
+            position: relative;
+            display: flex;
+            align-content: center;
+            flex-wrap: wrap;
+
+            .rabbit {
+                width: 100%;
+                height: 100%;
+                display: flex;
+                align-items: center;
+                align-content: center;
+                flex-wrap: wrap;
+                justify-content: center;
+
+                img {
+                    width: 150px;
+                    height: 80px;
+                    margin-bottom: 6px;
+                }
+
+                .flower {
+                    width: 62px;
+                    height: 62px;
+                }
+
+                p {
+                    width: 100%;
+                    margin: 0;
+                    padding: 0;
+                    font-size: 22px;
+                    font-weight: 800;
+
+                    color: #fff;
+                    text-align: center;
+                    letter-spacing: 0.3px;
+                }
+            }
+
+            .done {
+                cursor: pointer;
+                position: absolute;
+                top: 107px;
+                left: 50%;
+                margin-left: -150px;
+                width: 300px;
+                height: 60px;
+                display: flex;
+                align-items: center;
+                border-radius: 100px;
+                background: #ffffff;
+                box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
+                justify-content: center;
+
+                span {
+                    color: #000000;
+                    font-size: 14px;
+                }
+
+                .icon-done {
+                    width: 24px;
+                    height: 24px;
+                    margin-right: 10px;
+                }
+
+                .icon-right {
+                    margin-left: 5px;
+                    width: 7px;
+                    height: 14px;
+                }
+            }
+
+            .title {
+                margin-top: 30px;
+                color: #fff7e4;
+                opacity: 0.6;
+
+                font-weight: 700;
+                font-size: 18px;
+                line-height: 21px;
+                letter-spacing: -0.3px;
+            }
+
+            .money {
+                margin-bottom: 30px;
+                width: 100%;
+                display: flex;
+                justify-content: center;
+                align-items: center;
+
+                img {
+                    width: 40px;
+                    height: 40px;
+                    margin-right: 9px;
+                    border-radius: 50%;
+                    border: solid 2px #fff;
+                }
+
+                .big {
+                    font-weight: 700;
+                    font-size: 46px;
+                    line-height: 55px;
+                    /* identical to box height */
+
+                    letter-spacing: 0.3px;
+
+                    color: #fff;
+                }
+
+                .small {
+                    margin-left: 4px;
+
+                    font-weight: 700;
+                    font-size: 13px;
+                    line-height: 16px;
+                    /* identical to box height */
+
+                    letter-spacing: 0.5px;
+
+                    color: #fff;
+                }
+            }
+        }
+
+        .luck-list-title {
+            /*      margin-top: 47px;*/
+            margin: 0 16px;
+            padding: 14px 0 11px 0;
+            background: #fff;
+            display: flex;
+            justify-content: space-between;
+            color: #B0B0B0;
+            font-weight: 500;
+            border-bottom: 1px solid #F2F2F2;
+
+            div:last-child {
+                text-align: right;
+            }
+
+            .text {
+                cursor: pointer;
+            }
+        }
+
+        .luck-list {
+            background: #fff;
+            overflow: auto;
+
+            &.max {
+                height: 250px;
+            }
+
+            .empty {
+                width: 100%;
+                height: 100%;
+                text-align: center;
+
+                img {
+                    margin-top: 70px;
+                    width: 100px;
+                    height: 100px;
+                }
+            }
+
+            .luck-item {
+                display: flex;
+                padding: 10px 0;
+                margin: 0 16px;
+                border-bottom: 1px solid #F2F2F2;
+                justify-content: space-between;
+                position: relative;
+
+                .win {
+                    position: absolute;
+                    left: 28px;
+                    bottom: 7px;
+                    width: 20px;
+                    height: 20px;
+                }
+
+                img:first-child {
+                    border-radius: 50%;
+                }
+
+                .luck-king {
+                    position: absolute;
+                    top: 36px;
+                    right: 0px;
+                    display: flex;
+                    align-items: center;
+
+                    img {
+                        width: 22px;
+                        height: 19px;
+                        margin: 0;
+                    }
+
+                    span {
+                        font-weight: 500;
+                        font-size: 12px;
+                        line-height: 14px;
+                        letter-spacing: 0.3px;
+                        color: #f5b945;
+                    }
+                }
+
+                img {
+                    cursor: pointer;
+                    width: 42px;
+                    height: 42px;
+                    margin-right: 12px;
+                }
+
+                .luck-content {
+                    flex: auto;
+
+                    .luck-title {
+                        color: #444444;
+                        font-weight: 500;
+                        font-size: 16px;
+                        letter-spacing: 0.3px;
+                        margin-bottom: 5px;
+                    }
+
+                    .luck-time {
+                        font-weight: 400;
+                        font-size: 12px;
+                        line-height: 14px;
+                        color: #B0B0B0;
+                    }
+                }
+
+                .luck-money {
+                    display: flex;
+                    height: 17px;
+                    align-items: center;
+                    height: 100%;
+
+                    img {
+                        width: 14px;
+                        height: 14px;
+                        margin-right: 6px;
+                    }
+
+                    .luck-money-txt {
+                        font-weight: 500;
+                        font-size: 14px;
+                        word-break: break-all;
+                        /* identical to box height */
+
+                        text-align: right;
+                        letter-spacing: 0.3px;
+
+                        color: #444444;
+                    }
+                }
+            }
+
+            .luck-item:last-child {
+                border: 0;
+            }
+        }
+
+
+    }
+
+    .close {
+        position: relative;
+
+        .load-result {
+            position: absolute;
+            width: 100%;
+            height: 100%;
+            top: 0;
+            left: 0;
+            text-align: center;
+            display: flex;
+            flex-wrap: wrap;
+            justify-content: center;
+            align-content: flex-start;
+
+            .title {
+                width: 100%;
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                margin-top: 36px;
+
+                img {
+                    width: 26px;
+                    height: 26px;
+                    margin-right: 10px;
+                }
+
+                span {
+                    color: #FFFFFF;
+                    font-size: 18px;
+                    font-weight: 800;
+                    letter-spacing: 0.3px;
+
+                }
+            }
+
+            .ticket {
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                width: 100%;
+                height: 163px;
+
+                img {
+                    width: 250px;
+                    height: 103px;
+                    animation: myfirst 0.5s;
+                }
+
+            }
+
+            .div-ticket {
+                position: relative;
+                overflow: hidden;
+                transition-delay: 1s;
+            }
+
+            .div-ticket:after {
+                position: absolute;
+                right: -100%;
+                /*改变left的值,让其相对box影藏*/
+                top: 0;
+                width: 30%;
+                height: 100%;
+                content: "";
+                /* Safari 5.1 - 6.0 */
+                background: -webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, 0) 100%);
+                /* Opera 11.1 - 12.0 */
+                background: -o-linear-gradient(left, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, 0) 100%);
+                /* Firefox 3.6 - 15 */
+                background: -moz-linear-gradient(left, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, 0) 100%);
+                /* 标准的语法 */
+                background: linear-gradient(to right, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, 0) 100%);
+                transform: skewX(45deg);
+                animation: div_light 1s;
+                animation-delay: 0.5s;
+            }
+
+            // .div-ticket:hover:after {
+            //     right: 150%;
+            //     transition: 1s ease;
+            // }
+
+            p {
+                width: 100%;
+                margin: 0;
+                padding: 0;
+                color: #FCAB40;
+                text-align: center;
+                letter-spacing: 0.3px;
+                font-size: 18px;
+                font-weight: 700;
+
+            }
+
+            .time {
+                width: 100%;
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                margin-top: 16px;
+
+                img {
+                    width: 22px;
+                    height: 22px;
+                    margin-right: 10px;
+                }
+
+                span {
+                    font-weight: 800;
+                    font-size: 28px;
+                    color: #3F3F3F;
+                }
+            }
+
+
+
+            .notification_switch {
+                border-top: 1px solid #EFEFEF;
+                justify-content: space-between;
+                position: absolute;
+                height: 48px;
+                width: 100%;
+                display: flex;
+                align-items: center;
+                bottom: 0;
+                padding: 0 22px 0 16px;
+
+            }
+        }
+    }
+
+
+
+    .success {
+        .header {
+
+            min-height: 180px;
+            align-content: flex-start;
+
+            .success-title {
+                color: #FFFFFF;
+                font-weight: 800;
+                font-size: 21px;
+                line-height: 27px;
+                margin-top: 28px;
+                text-align: center;
+                width: 100%;
+            }
+
+            .done {
+                top: 130px;
+            }
+        }
+
+        .luck-list-title {
+            margin-top: 10px;
+            border-bottom: 1px solid #ECECEC;
+        }
+    }
+
+    .opened {
+        filter: drop-shadow(0px 4px 94px rgba(0, 0, 0, 0.3));
+        width: 100%;
+        height: 100%;
+        display: flex;
+        flex-direction: column;
+        justify-content: space-between;
+        border-radius: 11px;
+        overflow: hidden;
+
+        .header {
+            text-align: center;
+            min-height: 110px;
+            width: 100%;
+            background: #fff;
+            // padding-top: 30px;
+            background-size: 100% 100%;
+            display: flex;
+            flex-wrap: wrap;
+            align-content: center;
+            justify-content: center;
+
+            img {
+                width: 52px;
+                height: 52px;
+                margin-right: 14px;
+            }
+
+            .txt {
+                color: #FFFFFF;
+                font-weight: 700;
+                font-size: 18px;
+                letter-spacing: 0.3px;
+
+                p {
+                    margin: 0;
+                    padding: 0;
+                    text-align: left;
+                }
+            }
+        }
+
+        .list {
+            overflow-y: auto;
+            padding: 0 16px 0 16px;
+            background: #ffffff;
+            flex: 1;
+
+            .item {
+                display: flex;
+                align-items: center;
+                // min-height: 50px;
+                border-bottom: 1px solid #f0f0f0;
+                padding: 12px 0;
+                box-sizing: border-box;
+
+                img {
+                    width: 24px;
+                    height: 24px;
+                }
+
+                .red-right {
+                    width: 35px;
+                    height: 24px;
+                }
+
+                .item-content {
+                    width: 100%;
+                    flex: 1;
+
+
+                    .item-follow-title {
+                        display: flex;
+                        align-items: center;
+                        margin-top: 20px;
+                        margin-bottom: 11px;
+                        position: relative;
+
+                        .btn {
+                            // position: absolute;
+                            // right: 0;
+                        }
+                    }
+
+                    .item-title {
+                        flex: 1;
+                        margin-left: 10px;
+                        font-weight: 500;
+                        font-size: 15px;
+                        letter-spacing: 0.3px;
+                        color: #000000;
+                    }
+
+                    .item-follow-area {
+                        display: flex;
+                        flex-wrap: wrap;
+
+                        .item-follow {
+                            cursor: pointer;
+                            border: 1px solid #ebebeb;
+                            border-radius: 1000px;
+                            height: 26px;
+                            margin-right: 5px;
+                            margin-bottom: 5px;
+                            display: flex;
+                            align-items: center;
+
+                            .finished {
+                                text-decoration: line-through;
+                                color: #949494;
+                            }
+
+                            span {
+                                margin-left: 8px;
+                                margin-right: 2px;
+                                color: #1D9BF0;
+                                opacity: 1;
+                            }
+
+                            img {
+                                width: 16px;
+                                height: 16px;
+                                margin-right: 7px;
+                            }
+                        }
+                    }
+
+                    span {
+                        font-weight: 400;
+                        font-size: 11px;
+                        line-height: 13px;
+                        letter-spacing: 0.3px;
+
+                        color: #000000;
+
+                        opacity: 0.4;
+                    }
+                }
+
+                .btn {
+                    width: 90px;
+                    height: 29px;
+                    line-height: 29px;
+                    background: rgba(56, 154, 255, 0.1);
+                    border-radius: 500px;
+                    text-align: center;
+                    letter-spacing: 0.3px;
+                    color: #1D9BF0;
+                    cursor: pointer;
+                }
+
+                .loading-wrapper {
+                    width: 90px;
+                    text-align: center;
+
+                    .icon-loading {
+                        animation: loading 1s infinite linear;
+                    }
+                }
+            }
+        }
+
+        .people {
+            cursor: pointer;
+            padding-left: 16px;
+            height: 38px;
+            line-height: 38px;
+            background: #fff;
+            box-shadow: 0px 1px 0px #f2f2f2;
+            display: flex;
+            align-items: center;
+            justify-content: space-between;
+
+            .txt {
+                width: 90%;
+                font-weight: 400;
+                font-size: 12px;
+                line-height: 14px;
+                letter-spacing: 0.3px;
+                color: #000000;
+                opacity: 0.4;
+            }
+
+
+        }
+
+        .footer {
+            background: #ffffff;
+            display: flex;
+            padding: 15px 22px 15px 17px;
+
+            .btn {
+                background: #1D9BF0;
+                border-radius: 100px;
+                color: #fff;
+                width: 100%;
+                height: 48px;
+                font-weight: 600;
+                font-size: 18px;
+                line-height: 48px;
+                text-align: center;
+                cursor: pointer;
+            }
+
+            .grey {
+                background: #DDDDDD;
+                cursor: auto;
+            }
+        }
+    }
+
+    .not-open {
+        width: 100%;
+        height: 100%;
+        filter: drop-shadow(0px 2px 20px rgba(0, 0, 0, 0.1));
+        position: relative;
+        overflow: hidden;
+        border-radius: 11px;
+
+        .money-area {
+            width: 100%;
+            position: absolute;
+            top: 65px;
+            display: flex;
+            flex-wrap: wrap;
+            align-items: center;
+            justify-content: center;
+
+            .time-area {
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                position: relative;
+                width: 100%;
+                height: 46px;
+
+                div {
+                    width: 100%;
+                    height: 100%;
+                    position: absolute;
+                    background: #000000;
+                    z-index: 0;
+                    opacity: 0.15;
+                }
+
+                img {
+                    z-index: 1;
+                    width: 26px;
+                    height: 26px;
+                    margin-right: 10px;
+                }
+
+                span {
+                    z-index: 1;
+                    color: #FFCC4D;
+                    font-weight: 900;
+                    font-size: 26px;
+
+                }
+            }
+
+            .mark-area {
+                width: 100%;
+                display: flex;
+                justify-content: center;
+
+                img {
+                    width: 16px;
+                    height: 16px;
+                    margin-right: 4px;
+                }
+
+                .time {
+                    display: flex;
+                    align-items: center;
+
+                    span {
+                        color: #FFFFFF;
+                        font-weight: 800;
+                        font-size: 17px;
+                        letter-spacing: 0.05em;
+                        line-height: 22px;
+
+
+                    }
+
+                }
+
+                .win {
+                    display: flex;
+                    align-items: center;
+                    margin-left: 12px;
+                    color: #FFCC4D;
+                    letter-spacing: 0.05em;
+                    line-height: 22px;
+                    font-size: 17px;
+                    font-weight: 800;
+
+                }
+            }
+
+            .txt {
+                font-weight: 800;
+                font-size: 16px;
+                text-align: center;
+                letter-spacing: 0.3px;
+                color: #FFFFFF;
+            }
+
+            .coin {
+                text-align: center;
+                margin-top: 6px;
+                /*margin-bottom: 7px;*/
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                width: 90%;
+
+                img {
+                    width: 46px;
+                    height: 46px;
+                    border-radius: 50%;
+                    border: 3px solid #FFFFFF;
+                }
+
+                span {
+                    margin-left: 12px;
+                    font-weight: 800;
+                    font-size: 60px;
+                    line-height: 76px;
+                    color: #FFFFFF;
+                }
+            }
+
+            .people {
+                font-weight: 800;
+                font-size: 13px;
+                line-height: 16px;
+                letter-spacing: 0.05em;
+                text-align: center;
+                color: #FFFFFF;
+            }
+        }
+
+        .title {
+            position: absolute;
+            top: 15px;
+            left: 15px;
+            z-index: 3;
+            display: flex;
+            align-items: center;
+
+            img {
+                width: 24px;
+                height: 24px;
+                border: 2px solid #FFF;
+                border-radius: 50%;
+            }
+
+            span {
+                margin-left: 10px;
+                font-weight: 600;
+                font-size: 16px;
+                letter-spacing: 0.3px;
+                color: #fff;
+            }
+        }
+
+        // .txt {
+        //   width: 100%;
+        //   position: absolute;
+        //   font-style: normal;
+        //   font-weight: 700;
+        //   font-size: 42px;
+        //   line-height: 50px;
+        //   text-align: center;
+
+        //   color: #FFF2D3;
+        //   top: 90px;
+        //   z-index: 3;
+        // }
+
+        img {
+            width: 100%;
+        }
+
+        .up {
+            position: absolute;
+            top: 0;
+            // box-shadow: 0px 4px 44px rgba(0, 0, 0, 0.1);
+            z-index: 1;
+        }
+
+        .down {
+            position: absolute;
+            top: 253px;
+        }
+
+        .open {
+            width: 335px;
+            height: 50px;
+            cursor: pointer;
+            position: absolute;
+            bottom: 28px;
+            left: 50%;
+            margin-left: -167.5px;
+            z-index: 4;
+        }
+
+        .open-gif {
+            width: 200px;
+            height: 200px;
+            text-align: center;
+            position: absolute;
+            bottom: 80px;
+            left: 50%;
+            margin-left: -100px;
+            z-index: 3;
+        }
+    }
+
+    @keyframes loading {
+        from {
+            transform: rotate(0deg);
+        }
+
+        to {
+            transform: rotate(360deg);
+        }
+    }
+}
+
+
+@keyframes div_light {
+    0% {
+        right: -100%;
+    }
+
+
+
+    100% {
+        right: 150%;
+    }
+}
+
+@keyframes myfirst {
+    0% {
+        width: 250px;
+        height: 103px;
+    }
+
+    50% {
+        width: 300px;
+        height: 153px;
+    }
+
+    100% {
+        width: 250px;
+        height: 103px;
+    }
+}
+
+.none {
+    display: flex;
+    align-item: center;
+    justify-content: center;
+    width: 100%;
+    height: 100%;
+}
+</style>

+ 172 - 44
src/view/iframe/red-packet/red-packet.vue

@@ -374,12 +374,13 @@ import { getQueryString, guid, getBit } from '@/uilts/help.js'
 import { message } from 'ant-design-vue';
 import FontAmount from '@/view/components/font-amount.vue'
 import GetMore from '@/view/iframe/publish/components/get-more.vue'
-import { setChromeStorage, getChromeStorage } from '@/uilts/chromeExtension.js'
+import { setChromeStorage, getChromeStorage, sendChromeTabMessage } from '@/uilts/chromeExtension.js'
 import Report from "@/log-center/log"
 import { srcPublishSuccess } from '@/http/publishApi'
 import { discordAuthUrl, checkGuildJoined } from '@/http/discordApi'
 import { discordAuthRedirectUri, faceShareRedirectUrl } from '@/http/configAPI'
 import { getFrontConfig } from "@/http/account";
+import { getInviteGuildInfo } from "@/http/discordApi";
 import GlobalTip from '@/view/components/global-tip.vue'
 
 var moment = require('moment');
@@ -393,6 +394,16 @@ let facebookAppConfig = {
   faceShareRedirectUrl
 };
 
+let reportParams = {
+  discordFans: '',
+  twitterFans: '',
+  done: {
+  },
+  hasReport: false,
+}
+
+let discordTaskDetail = null;
+
 let state = reactive({
   status: '',
   userId: '',
@@ -454,7 +465,7 @@ async function clickLikeBtn() {
           window.open(`https://twitter.com/intent/like?tweet_id=${state.tweetId}`)
           state.done.like = false
         }
-      }).catch(()=>{
+      }).catch(() => {
         state.loading_show = false
       })
       break
@@ -480,8 +491,7 @@ async function clickLikeBtn() {
   Report.reportLog({
     objectType: Report.objectType.like,
     pageSource: Report.pageSource.task_page,
-    businessType: Report.businessType.buttonClick
-  }, {
+    businessType: Report.businessType.buttonClick,
     postId: state.postId,
     srcContentId: state.tweetId,
     senderId: state.userId,
@@ -493,11 +503,11 @@ function clickDone() {
   Report.reportLog({
     objectType: Report.objectType.wallet_button,
     pageSource: Report.pageSource.received_success_page,
-    businessType: Report.businessType.buttonClick
-  }, {
+    businessType: Report.businessType.buttonClick,
     postId: state.postId,
     srcContentId: state.tweetId,
     senderId: state.userId,
+    redPacketType: 0
   });
 }
 function handleScroll(e) {
@@ -568,7 +578,7 @@ async function clickRetweetBtn() {
           window.open(`https://twitter.com/retweet/like?tweet_id=${state.tweetId}`)
           state.done.retweet = false
         }
-      }).catch(()=>{
+      }).catch(() => {
         state.loading_show = false
       })
       break;
@@ -594,8 +604,7 @@ async function clickRetweetBtn() {
   Report.reportLog({
     objectType: Report.objectType.retweet,
     pageSource: Report.pageSource.task_page,
-    businessType: Report.businessType.buttonClick
-  }, {
+    businessType: Report.businessType.buttonClick,
     postId: state.postId,
     srcContentId: state.tweetId,
     senderId: state.userId,
@@ -629,6 +638,16 @@ async function clickReply(params) {
   } else {
     window.parent.postMessage({ actionType: "IFRAME_RED_PACKET_REPLY_CLICK", data: replyData }, "*");
   }
+  // 埋点
+  Report.reportLog({
+    objectType: Report.objectType.comment_and_tag,
+    pageSource: Report.pageSource.task_page,
+    businessType: Report.businessType.buttonClick,
+    postId: state.postId,
+    srcContentId: state.tweetId,
+    senderId: state.userId,
+    redPacketType: 0
+  });
 }
 
 /**
@@ -660,6 +679,17 @@ async function clickRepostFacebook(params) {
 
   let shareUrl = feacebookShareUrl(shareUrlparams);
   openShareFacebookWindow({ url: shareUrl });
+
+  // 埋点
+  Report.reportLog({
+    objectType: Report.objectType.share_facebook,
+    pageSource: Report.pageSource.task_page,
+    businessType: Report.businessType.buttonClick,
+    postId: state.postId,
+    srcContentId: state.tweetId,
+    senderId: state.userId,
+    redPacketType: 0
+  });
 }
 
 /**
@@ -788,7 +818,7 @@ async function clickFollowAll(item, is_all) {
           })
           openFollowTabs(arr_name)
         }
-      }).catch(()=>{
+      }).catch(() => {
         state.loading_show = false
       })
       break
@@ -840,6 +870,10 @@ async function clickFollowAll(item, is_all) {
 
 // 重新绑定
 const reSetBindTwtterId = (_params) => {
+  let postBizData = JSON.parse(_params.postBizData);
+  let { taskCondition } = postBizData;
+  let discordTask = JSON.parse(taskCondition).find(item => item.type == 7);
+
   getChromeStorage('userInfo', (_userInfo) => {
     if (_userInfo.uid == _params.uid) {
       srcPublishSuccess({
@@ -849,16 +883,65 @@ const reSetBindTwtterId = (_params) => {
         }
       }).then((res) => {
         if (res.code == 0 || res.code == 3003) {
-          Report.reportLog({
-            objectType: Report.objectType.tweetPostBinded
-          });
           init({ from: 'reSetBindTwtterId' })
+          reportBindTweetSuccess({ discordTask, ..._params });
         }
       })
     }
   })
 }
 
+const reportBindTweetSuccess = (params) => {
+  let { discordTask, srcUserId } = params || {};
+  discordTaskDetail = discordTask;
+  sendChromeTabMessage({
+    actionType: "IFRAME_API_GET_TWEET_USER_INFO_REQ",
+    data: {
+      screen_name: srcUserId
+    }
+  })
+
+  if (discordTask) {
+    getDiscordInfo({ inviteUrl: JSON.parse(discordTask.bizData).inviteUrl }, (res) => {
+      if (res.inviteCode == res.code) {
+        reportParams.discordFans = res.approximate_member_count;
+
+        if (reportParams.twitterFans !== '' && !reportParams.hasReport) {
+          reportParams.hasReport = true;
+          Report.reportLog({
+            objectType: Report.objectType.tweetPostBinded,
+            twitterFans: reportParams.twitterFans,
+            discordFans: reportParams.discordFans,
+            redPacketType: 0
+          });
+        }
+      }
+    })
+  }
+}
+
+const getDiscordInfo = (params, cb) => {
+  let { inviteUrl } = params;
+  if (!inviteUrl) return;
+  let inviteCode = '';
+  let arr = inviteUrl.split('/');
+  if (arr.length > 0) {
+    inviteCode = arr[arr.length - 1];
+  }
+  if (!inviteCode) {
+    return;
+  }
+  getInviteGuildInfo({
+    inviteCode
+  }).then(res => {
+    cb && cb({
+      ...res,
+      inviteCode
+    })
+  }).catch((err) => {
+  });
+}
+
 const showCloseEndTimePage = () => {
   state.status = 'close'
   state.close_status = '红包过期了'
@@ -870,7 +953,6 @@ const showCloseEndTimePageReport = () => {
   Report.reportLog({
     pageSource: Report.pageSource.expired_page,
     businessType: Report.businessType.pageView,
-  }, {
     postId: state.postId,
     srcContentId: state.tweetId,
     senderId: state.userId,
@@ -883,37 +965,44 @@ const showSuccessPage = () => {
   Report.reportLog({
     pageSource: Report.pageSource.received_success_page,
     businessType: Report.businessType.pageView,
-  }, {
     postId: state.postId,
     srcContentId: state.tweetId,
     senderId: state.userId,
+    isOldTwitterFans: reportParams.done.follow,
+    isOldDiscordFans: reportParams.done.join_discord,
+    redPacketType: 0
   });
 }
 const showNotOpenPage = () => {
   state.status = 'not-open'
   Report.reportLog({
     pageSource: Report.pageSource.pending_page,
-    businessType: Report.businessType.pageView
-  }, {
+    businessType: Report.businessType.pageView,
     postId: state.postId,
     srcContentId: state.tweetId,
     senderId: state.userId,
+    redPacketType: 0
   });
 }
 const showOpenedPage = () => {
   state.status = 'opened'
-
-  initTaskDetail()
+  initTaskDetail(() => {
+    showOpenedPageReport()
+  })
 }
 const showOpenedPageReport = () => {
+  reportParams.done.follow = state.done.follow;
+  reportParams.done.join_discord = state.done.join_discord;
   // 埋点
   Report.reportLog({
     pageSource: Report.pageSource.task_page,
     businessType: Report.businessType.pageView,
-  }, {
     postId: state.postId,
     srcContentId: state.tweetId,
     senderId: state.userId,
+    isOldTwitterFans: state.done.follow,
+    isOldDiscordFans: state.done.join_discord,
+    redPacketType: 0
   });
 }
 
@@ -927,7 +1016,6 @@ const showRabbitPageReport = () => {
   Report.reportLog({
     pageSource: Report.pageSource.received_empty_rewards_page,
     businessType: Report.businessType.pageView,
-  }, {
     postId: state.postId,
     srcContentId: state.tweetId,
     senderId: state.userId,
@@ -981,7 +1069,6 @@ const handleStatusPage = () => {
     if (state.detail.myReceived.taskFinishStatus == 0) {
       // 显示任务未完成页面
       showOpenedPage()
-      showOpenedPageReport()
       if (state.process_mode != 'production') {
         getValidity()
       }
@@ -1044,7 +1131,6 @@ function setFrontConfig() {
 
 function init(initParams) {
   let { type } = initParams || {};
-  onRuntimeMsg();
   onPageVisbile();
   onWindowMessage();
   setFrontConfig();
@@ -1075,18 +1161,18 @@ function init(initParams) {
       state.userId = res.data.srcUserId;
       state.tweet_author = state.detail.postUserInfo && state.detail.postUserInfo.nickName || '';
       // 不要删除这个console
-      console.log('postBizData',state.detail)
+      console.log('postBizData', state.detail)
       checkFacebookReply();
       handleStatusPage()
     } else {
       handleErrorCode(res)
     }
   }).finally(() => {
-      state.loading_redbag = false
+    state.loading_redbag = false
   })
 }
 
-function initTaskDetail() {
+function initTaskDetail(cb) {
   getChromeStorage('userInfo', (_userInfo) => {
     if (_userInfo.uid) {
       // 任务详情
@@ -1126,6 +1212,7 @@ function initTaskDetail() {
         } else {
           handleErrorCode(res)
         }
+        cb && cb()
       })
     }
   })
@@ -1213,8 +1300,8 @@ onMounted(() => {
   }
 
   getTweetAuthor();
-
   init()
+  onRuntimeMsg();
   // state.loading_show = true
   // state.status = 'opened'
   // state.close_status = '没有领到钱'
@@ -1262,18 +1349,18 @@ function handleRedPacket() {
     } else {
       handleErrorCode(res)
     }
-  }).catch(()=>{
+  }).catch(() => {
     state.loading_show = false
   })
   // 埋点
   Report.reportLog({
     pageSource: Report.pageSource.pending_page,
     businessType: Report.businessType.buttonClick,
-    objectType: Report.objectType.open_button
-  }, {
+    objectType: Report.objectType.open_button,
     postId: state.postId,
     srcContentId: state.tweetId,
     senderId: state.userId,
+    redPacketType: 0
   });
 }
 
@@ -1337,12 +1424,12 @@ function handleFinishRedPacket() {
         Report.reportLog({
           pageSource: Report.pageSource.task_page,
           businessType: Report.businessType.buttonClick,
-          objectType: Report.objectType.get_giveaway
-        }, {
-          get_giveaway_result: Report.extParams.success,
+          objectType: Report.objectType.get_giveaway,
           postId: state.postId,
           srcContentId: state.tweetId,
           senderId: state.userId,
+        }, {
+          get_giveaway_result: Report.extParams.success
         });
       } else {
         let _data = res.data.conditionResult
@@ -1416,12 +1503,12 @@ function handleFinishRedPacket() {
         Report.reportLog({
           pageSource: Report.pageSource.task_page,
           businessType: Report.businessType.buttonClick,
-          objectType: Report.objectType.get_giveaway
-        }, {
-          get_giveaway_result: Report.extParams.failure,
+          objectType: Report.objectType.get_giveaway,
           postId: state.postId,
           srcContentId: state.tweetId,
           senderId: state.userId,
+        }, {
+          get_giveaway_result: Report.extParams.failure,
         });
         if (discordAuthorizeRequired) {
           discordAuth('reAuth');
@@ -1432,16 +1519,16 @@ function handleFinishRedPacket() {
       Report.reportLog({
         pageSource: Report.pageSource.task_page,
         businessType: Report.businessType.buttonClick,
-        objectType: Report.objectType.get_giveaway
-      }, {
-        get_giveaway_result: Report.extParams.failure,
+        objectType: Report.objectType.get_giveaway,
         postId: state.postId,
         srcContentId: state.tweetId,
         senderId: state.userId,
+      }, {
+        get_giveaway_result: Report.extParams.failure,
       });
       handleErrorCode(res)
     }
-  }).catch(()=>{
+  }).catch(() => {
     state.loading_show = false
   })
 }
@@ -1516,7 +1603,6 @@ function handleErrorCode(res) {
       Report.reportLog({
         pageSource: Report.pageSource.robot_detection_failed_page,
         businessType: Report.businessType.pageView,
-      }, {
         postId: state.postId,
         srcContentId: state.tweetId,
         senderId: state.userId,
@@ -1628,7 +1714,7 @@ function onPageVisbile() {
 
 function onRuntimeMsg() {
   chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
-    sendResponse('');
+    sendResponse('ok');
     switch (req.actionType) {
       case 'BACK_DISCORD_LOGIN_SUCCESS':
         discordLoginSuccess();
@@ -1644,11 +1730,40 @@ function onRuntimeMsg() {
         doTaskReport(req, sender);
         break;
       case 'CONTENT_RED_PACKET_REPLY_RASK_FINSH':
-        if(req.data && req.data.postId == state.postId) {
+        if (req.data && req.data.postId == state.postId) {
           state.done.reply = true;
           state.done.reply_red = false;
         }
         break;
+      case 'CONTENT_API_GET_TWEET_USER_INFO_RES':
+        let { user } = req.data || {};
+        if (user && user.result && user.result.legacy) {
+          let legacy = user.result.legacy;
+          reportParams.twitterFans = legacy.followers_count;
+
+          if (!discordTaskDetail) {
+            if (reportParams.hasReport) return;
+            reportParams.hasReport = true;
+            Report.reportLog({
+              objectType: Report.objectType.tweetPostBinded,
+              twitterFans: reportParams.twitterFans,
+              redPacketType: 0
+            });
+          } else {
+            if (reportParams.discordFans !== '') {
+              if (reportParams.hasReport) return;
+              reportParams.hasReport = true;
+              Report.reportLog({
+                objectType: Report.objectType.tweetPostBinded,
+                twitterFans: reportParams.twitterFans,
+                discordFans: reportParams.discordFans,
+                redPacketType: 0
+              });
+            }
+          }
+
+        }
+        break;
     }
   })
 }
@@ -1704,6 +1819,18 @@ async function joinDiscord() {
   if (joinDiscordIng.value) {
     return;
   }
+
+  // 埋点
+  Report.reportLog({
+    objectType: Report.objectType.join_discord,
+    pageSource: Report.pageSource.task_page,
+    businessType: Report.businessType.buttonClick,
+    postId: state.postId,
+    srcContentId: state.tweetId,
+    senderId: state.userId,
+    redPacketType: 0
+  });
+
   let url = getInviteUrl();
   if (url) {
     joinDiscordIng.value = true;
@@ -1945,7 +2072,8 @@ body {
       line-height: 32px;
       text-align: center;
       letter-spacing: 0.3px;
-
+      font-weight: 800;
+      font-size: 22px;
       color: #ffffff;
     }
 

+ 10 - 6
src/view/iframe/tab-group/tab-group.vue

@@ -15,13 +15,14 @@
                             <div class="icon-nft-wrapper">
                                 <el-popover
                                     :width="340"
-                                    placement="right"
+                                    placement="right-start"
                                     trigger="hover"
                                     popper-style="background: #FFFFFF;
                                         box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);
                                         border-radius: 20px;
                                         padding: 20px;
-                                        box-sizing: border-box;">
+                                        box-sizing: border-box;
+                                        margin-top: -1px">
                                     <template #reference>
                                         <img v-if="item.nftItem" :src="item.nftItem.imagePath" class="icon-nft" @click.stop="">
                                     </template>
@@ -44,7 +45,7 @@
                                 {{item.nickName}}
                             </div>
                             <div class="screen-name">
-                                {{item.screenName}}
+                                @{{item.screenName}}
                             </div>
                         </div>
                         <div class="post-content" v-html="item.textContent"></div>
@@ -97,6 +98,7 @@ const clickItem = (data, index) => {
 
 function onRuntimeMsg() {
     chrome.runtime.onMessage.addListener((req, sender, sendResponse) => {
+        sendResponse('ok')
         switch (req.actionType) {
             case 'CONTENT_REFRESH_TAB_GROUP_LIST':
                 listReqParams.params.preTimestamp = ''
@@ -157,7 +159,9 @@ const innerPageNext = (data) => {
         if(dataLength) {
             listReqParams.params.preTimestamp = listData.value[dataLength - 1]['createTimestamp'];
         }
-        getListData();
+        if(listReqParams.params.preTimestamp) {
+            getListData();
+        }
     }
 }
 
@@ -196,7 +200,7 @@ const getListData = () => {
                 if (!listReqParams.params.preTimestamp) {
                     listData.value = resData;
                 } else {
-                    let data = dataList.value;
+                    let data = listData.value;
                     data = data.concat(resData);
                     listData.value = data;
                 }
@@ -377,11 +381,11 @@ html, body, #app {
                     }
 
                     .nick-name, .screen-name {
-                        font-weight: 600;
                         font-size: 15px;
                     }
 
                     .nick-name {
+                        font-weight: 600;
                         color: #000;
                         margin-right: 8px;
                     }

+ 1 - 2
src/view/popup/components/tabbar.vue

@@ -167,7 +167,7 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-    sendResponse('');
+    sendResponse('ok');
     switch (req.actionType) {
         case 'CONTENT_POPUP_PAGE_SHOW':
             init();
@@ -204,7 +204,6 @@ const getUserInfo = (cb) => {
 onMounted(() => {
     onMessage();
     init();
-    onPageVisbile()
 });
 
 onBeforeUnmount(() => {

+ 15 - 3
src/view/popup/components/top-bar.vue

@@ -4,14 +4,17 @@
             <img :src="userInfo.avatarUrl" class="icon-avatar">
             <span class="nick-name" :style="{color: color}">{{userInfo.nickName}}</span>
         </div>
-        <!-- <div>
-            <img :src="require('@/assets/svg/icon-denet-logo.svg')" />
-        </div> -->
+        <div>
+            <img class="setting" @click="clickSetting" :src="require('@/assets/svg/icon-setting-white.svg')" />
+        </div>
     </div>
 </template>
 
 <script setup>
 import {defineProps} from 'vue';
+import {useRouter} from 'vue-router'
+
+const router = useRouter()
 
 const props = defineProps({
     userInfo: {
@@ -37,6 +40,9 @@ const props = defineProps({
 function clickUserInfo() {
     window.open(`https://twitter.com/${props.userInfo.nickName}`);
 }
+function clickSetting() {
+    router.push({ name: 'setting' })
+}
 </script>
 
 <style scoped lang='scss'>
@@ -64,5 +70,11 @@ function clickUserInfo() {
             font-size: 14px;
         }
     }
+
+    .setting {
+        width: 24px;
+        height: 24px;
+        cursor: pointer;
+    }
 }
 </style>

+ 135 - 0
src/view/popup/setting/index.vue

@@ -0,0 +1,135 @@
+<template>
+    <div class="detail-wrapper">
+        <div class="back-bar">
+            <img
+                :src="require('@/assets/svg/icon-nft-back-arrow.svg')"
+                class="icon-arrow"
+                @click="back"
+            />
+            <span>Settings</span>
+        </div>
+
+        <div class="item">
+            <div class="l">Announcement Notification</div>
+            <div class="r">
+                <a-switch v-model:checked="noticeStatus" @change="change"></a-switch>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script setup>
+import { onBeforeMount, ref } from "vue";
+import router from "@/router/popup.js";
+import { getSetting, putSetting } from "@/http/user";
+
+let noticeStatus = ref(true);
+
+function back() {
+    router.back();
+}
+
+function change(checked) {
+    let noticeSwitch = checked ? 1 : 0;
+    // set
+    putSetting({
+        params: { noticeSwitch }
+    }).then(res => {
+        let { code, data } = res;
+        if (code === 0) {
+            noticeStatus.value = checked
+        } else {
+            noticeStatus.value = !checked
+        }
+    }).catch(() => {
+        noticeStatus.value = !checked
+    })
+
+    noticeSetting()
+}
+
+function noticeSetting() {
+    chrome.runtime.sendMessage({
+        actionType: "USER_SETTING",
+        data: {
+            status: noticeStatus.value
+        }
+    }, (response) => {
+        console.log("res", response);
+    });
+}
+
+onBeforeMount(() => {
+    getSetting({}).then((res) => {
+        let { code, data } = res;
+        if (code === 0) {
+            noticeStatus.value = data.noticeSwitch === 1 ? true : false;
+        }
+    });
+});
+</script>
+
+<style lang='scss' scoped>
+.detail-wrapper {
+    width: 100%;
+    height: 100%;
+    background-color: #f5f5f5;
+
+    .back-bar {
+        height: 48px;
+        background: #ffffff;
+        box-shadow: 0px 0.5px 0px #d1d9dd;
+        box-sizing: border-box;
+        padding: 14px;
+        font-weight: 500;
+        font-size: 16px;
+        display: flex;
+        align-items: center;
+        margin-bottom: 14px;
+
+        .icon-arrow {
+            width: 24px;
+            margin-right: 12px;
+            cursor: pointer;
+        }
+    }
+
+    .item {
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        height: 50px;
+        padding: 0 16px;
+        background-color: #ffffff;
+        .l {
+            color: #000000;
+            font-size: 15px;
+            font-weight: 500;
+        }
+    }
+}
+
+:deep() .ant-switch {
+    background-color: #e9ecee;
+    height: 14px;
+    line-height: 16px;
+    min-width: 36px;
+}
+
+:deep() .ant-switch-checked {
+    background-color: #aed8f5 !important;
+}
+
+:deep() .ant-switch::after {
+    width: 20px;
+    height: 20px;
+    top: -4px;
+    left: -1px;
+}
+
+:deep() .ant-switch-checked::after {
+    background-color: #1d9bf0 !important;
+    margin-left: 3px;
+    left: 100% !important;
+}
+</style>

+ 1 - 1
src/view/popup/tabbar-page/index.vue

@@ -115,7 +115,7 @@ const onRuntimeMsg = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-  sendResponse('');
+  sendResponse('ok');
   switch (req.actionType) {
     case 'BG_LOGIN_SET_USERINFO_CB':
       if(!userInfo.value.accessToken) {

+ 127 - 30
src/view/popup/tabbar-page/message/index.vue

@@ -1,23 +1,12 @@
 <template>
   <div class="message-wrapper">
-    <!-- <div class="tab-bar">
-      <div
-        class="tab-item"
-        :class="{ active: currentTabIndex == index }"
-        v-for="(item, index) in tabList"
-        :key="index"
-        @click="clickTab(item, index)"
-      >
-        {{ item.label }}
-      </div>
-    </div> -->
     <div class="tab-content" ref="pageWrapperDom" @scroll="pageScroll">
       <div class="list-wrapper" ref="pageGiveListDom">
         <div class="give-list" v-if="currentTabIndex == 0">
           <template v-if="giveList.length">
             <div
               class="cell"
-              :class="{ 'cell-center': item.type == 1 }"
+              :class="{ 'cell-center': item.type == 1 || item.type == 3 }"
               v-for="(item, index) in giveList"
               :key="index"
               @click="clickListItem(item, index)"
@@ -29,7 +18,7 @@
 
               <div class="img-wrapper">
                 <!-- 收到红包 -->
-                <template v-if="item.type == 1">
+                <template v-if="item.type == 1 || item.type == 3">
                   <img class="icon-avatar" :src="item.userInfo.avatarUrl" />
                   <img
                     class="icon-give"
@@ -42,6 +31,10 @@
                     class="icon-big-give"
                     :src="require('@/assets/svg/icon-send-giveaways-s.svg')"
                   />
+                  <img
+                    class="icon-mark-give"
+                    :src="require('@/assets/svg/icon-send-giveaways-mark.svg')"
+                  />
                 </template>
               </div>
               <div
@@ -50,7 +43,15 @@
               >
                 <div class="left">
                   <div class="nickname">
-                    {{ item.type == 1 ? "Get Giveaway" : "Send Giveaway" }}
+                    <template v-if="item.type == 1">
+                        Get Giveaway
+                    </template>
+                    <template v-else-if="item.type == 2">
+                        {{ item.postTaskLuckdrop.luckdropType === 1 ? 'Send Giveaway' : 'Lottery Giveaway' }}
+                    </template>
+                    <template v-else-if="item.type == 3">
+                        Lottery
+                    </template>
                   </div>
                   <div class="time">
                     {{ moment(item.timestamp).format("MM-DD HH:mm:ss") }}
@@ -106,6 +107,34 @@
                           <img :src="item.currencyIconPath" alt="" />
                         </div>
                       </template>
+                      <template v-else-if="item.type == 3">
+                        <template v-if="item.status == 1">In Progress</template>
+                        <template v-else-if="item.status == 2">
+                        Open in {{ item.downTime || '' }}
+                        </template>
+                        <template v-else-if="item.status == 3">
+                          Unfinished
+                        </template>
+                        <template v-else-if="item.status == 4">
+                          <span class="blance">
+                            <a-tooltip :title="item.amount">
+                              +{{ getBit(item.amount) }}
+                            </a-tooltip>
+                          </span>
+                          <div class="coin-type-wrapper">
+                            <span class="coin-type">{{
+                              item.currencySymbol || ""
+                            }}</span>
+                            <img :src="item.currencyIconPath" alt="" />
+                          </div>
+                        </template>
+                        <template v-else-if="item.status == 5">
+                          Didn't win
+                        </template>
+                        <template v-else-if="item.status == 6">
+                          Giveaway Expired
+                        </template>
+                      </template>
                     </div>
                     <!-- 发出的红包显示 -->
                     <div class="desc" v-if="item.type == 2">
@@ -120,17 +149,22 @@
                         }}
                       </template>
                       <!-- 2:已结束; 3:提前终止-->
-                      <template
-                        v-else-if="item.status == 2 || item.status == 3"
-                      >
-                        ({{
-                          item.status == 2 ? "Time expired" : "Termination"
-                        }}) {{ item.postTaskLuckdrop.receivedCount }}/{{
-                          item.postTaskLuckdrop.totalCount
-                        }}
+                      <template v-else-if="item.status == 2 || item.status == 3">
+                        <template v-if="item.postTaskLuckdrop && item.postTaskLuckdrop.luckdropType == 1">
+                            ({{
+                            item.status == 2 ? "Time expired" : "Termination"
+                            }}) {{ item.postTaskLuckdrop.receivedCount }}/{{
+                            item.postTaskLuckdrop.totalCount
+                            }}
+                        </template>
+                        <template v-else>
+                            Termination
+                        </template>
                       </template>
                       <!-- 红包提前终止/退款(进行中)显示-->
-                      <template v-if="item.status == 4"> Terminating </template>
+                      <template v-if="item.status == 4">
+                        {{ item.postTaskLuckdrop && item.postTaskLuckdrop.luckdropType == 1 ? 'Terminating' : 'Open in ' + item.downTime || '' }}
+                      </template>
 
                       <!-- 进行中或者未发送成功时显示 
                                                 v-if="item.status == 1 || item.postTaskLuckdrop.reSendAvailable"-->
@@ -183,8 +217,8 @@
     </div>
     <modal
       :visible="modalVisible"
-      title="Early termination of Giveaway?"
-      content="The remaining amount will be returned to your wallet within 1 day."
+      :title="modalTitle"
+      :content="modalContent"
       cancelText="Termination"
       confirmText="Cancel"
       @cancel="modalCancel"
@@ -199,7 +233,7 @@ import { ref, onMounted, inject, onBeforeUnmount } from "vue";
 import modal from "@/view/popup/components/modal.vue";
 import redDot from "@/view/components/red-dot.vue";
 
-import { getBit } from "@/uilts/help";
+import { getBit, formatSecondsAsDaysOrTime } from "@/uilts/help";
 import { getMineLuckdropRecords } from "@/http/account";
 import { terminatedLuckdrop } from "@/http/redPacket";
 import { readAllMsgByType, getAllMessageInfo } from "@/http/messageApi"
@@ -227,6 +261,8 @@ let pageWrapperDom = ref(null);
 let pageGiveListDom = ref(null);
 
 let modalVisible = ref(false);
+let modalTitle = ref('');
+let modalContent = ref('');
 let terminaTask = {};
 
 let giveList = ref([]);
@@ -261,11 +297,25 @@ const getLuckdropRecordsList = () => {
         data = data.concat(res.data);
         giveList.value = data;
       }
+      downTimeBegin()
       giveReqParams.loadMore = false;
     }
   });
 };
 
+const getCurrentList = () => {
+    getMineLuckdropRecords({
+        params: {
+            pageNum: 1,
+            pageSize: giveList.value.length || 20,
+        }
+    }).then((res) => {
+        if (res.data && res.data.length) {
+            giveList.value = res.data;
+        }
+    })
+}
+
 /**
  * 点击列表跳转到推文
  */
@@ -275,7 +325,7 @@ const clickListItem = (params) => {
   }
   let twitterUrl = "https://twitter.com/";
   let nickName = "";
-  if (params.type == 1) {
+  if (params.type == 1 || params.type == 3) {
     nickName = params.userInfo.nickName;
   } else if (params.type == 2) {
     nickName = userInfo.value.nickName;
@@ -339,6 +389,15 @@ const callEventPageMethod = (actionType, data, callback) => {
 const terminaHandler = (params, index) => {
   terminaTask = params;
   terminaTask.index = index;
+
+  // set font
+  if (params && params.postTaskLuckdrop && params.postTaskLuckdrop.luckdropType == 2) {
+    modalTitle.value = `Early Termination of Lottery?`
+    modalContent.value = `This operation will terminate the lottery process and refund the lottery prizes.`
+  } else {
+    modalTitle.value = `Early termination of Giveaway?`
+    modalContent.value = `The remaining amount will be returned to your wallet within 1 day.`
+  }
   modalVisible.value = true;
 };
 
@@ -355,6 +414,8 @@ const modalCancel = () => {
       giveList.value[index]["status"] = res.data.status;
       giveList.value[index]["postTaskLuckdrop"]["reSendAvailable"] = false;
       giveList.value[index]["postTaskLuckdrop"]["terminatedAvailable"] = false;
+      // 重新拉取
+      getCurrentList()
     }
   });
   terminaTask = {};
@@ -420,7 +481,7 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-  sendResponse('');
+  sendResponse('ok');
   switch (req.actionType) {
       case 'CONTENT_POPUP_PAGE_SHOW':
           init();
@@ -428,6 +489,32 @@ const msgListener = (req, sender, sendResponse) => {
   }
 }
 
+// 倒计时
+const downTimeBegin = () => {
+    let list = giveList.value || []
+    let ifDown = false
+    list.forEach((item) => {
+        if (item.endTimestamp) {
+            let time = moment(new Date().getTime())
+            let endTime = moment(item.endTimestamp + 5000)
+            let downTime = (endTime - time) || 0
+            if (downTime > 0) {
+                item.downTime = formatSecondsAsDaysOrTime(downTime / 1000);
+                ifDown = true;
+            }
+            if (item && item.downTime && item.downTime == '00:00:00') {
+                getCurrentList()
+            }
+        }
+    })
+
+    if (ifDown) {
+        setTimeout(() => {
+            downTimeBegin()
+        }, 1000)
+    }
+}
+
 onMounted(() => {
   onMessage();
   init();
@@ -497,6 +584,7 @@ onBeforeUnmount(() => {
 
           .img-wrapper {
             position: relative;
+            width: 38px;
             margin-right: 16px;
             box-sizing: border-box;
 
@@ -517,6 +605,15 @@ onBeforeUnmount(() => {
 
             .icon-big-give {
               margin-top: 12px;
+              width: 34px;
+            }
+
+            .icon-mark-give {
+                position: absolute;
+                right: -2px;
+                top: 31px;
+                width: 16px;
+                height: 16px;
             }
           }
 
@@ -550,7 +647,7 @@ onBeforeUnmount(() => {
 
               .msg {
                 display: flex;
-                align-items: end;
+                align-items: flex-end;
                 flex-direction: column;
                 .bold {
                   font-weight: 500;
@@ -605,7 +702,7 @@ onBeforeUnmount(() => {
                   .desc-bottom-bar {
                     display: flex;
                     align-items: center;
-                    justify-content: end;
+                    justify-content: flex-end;
                     margin-top: 10px;
 
                     .btn {

+ 3 - 2
src/view/popup/tabbar-page/nft/detail.vue

@@ -217,7 +217,7 @@ onMounted(() => {
 
             .img {
                 width: 280px;
-                border-radius: 26px;
+                border-radius: 10px;
             }
         }
 
@@ -255,7 +255,7 @@ onMounted(() => {
 
                 .prop-item {
                     width: 48%;
-                    height: 88px;
+                    min-height: 88px;
                     background: #f8f8f8;
                     border-radius: 10px;
                     display: flex;
@@ -275,6 +275,7 @@ onMounted(() => {
                         margin-top: 6px;
                         margin-bottom: 8px;
                         color: #000;
+                        word-break: break-all;
                     }
                 }
                 .prop-item:nth-child(odd) {

+ 1 - 1
src/view/popup/tabbar-page/nft/index.vue

@@ -94,7 +94,7 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-    sendResponse('');
+    sendResponse('ok');
     switch (req.actionType) {
         case 'CONTENT_POPUP_PAGE_SHOW':
             getNFTListMine();

+ 1 - 1
src/view/popup/tabbar-page/wallter/popup.vue

@@ -205,7 +205,7 @@ const onMessage = () => {
 }
 
 const msgListener = (req, sender, sendResponse) => {
-    sendResponse('');
+    sendResponse('ok');
     switch (req.actionType) {
         case 'CONTENT_POPUP_PAGE_SHOW':
             init();

+ 6 - 0
vue.config.js

@@ -108,4 +108,10 @@ module.exports = {
       })
     ],
   },
+  // 配置 content.css
+	css: {
+		extract: {
+			filename: "css/[name].css"
+		}
+	}
 }

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.