SignInGuide.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <template>
  2. <div class="step2-card">
  3. <!-- 左侧:说明区域 -->
  4. <div class="step2-info">
  5. <div class="step2-badge">Step 2</div>
  6. <h2 class="step2-title">每日签到,积分到手</h2>
  7. <p class="step2-desc">
  8. 每天来签到,轻松赚取积分奖励!<br />
  9. <strong>连续签到</strong>还能获得额外加成 🎁
  10. </p>
  11. <!-- 签到日历示意 -->
  12. <div class="checkin-preview">
  13. <div class="preview-header">
  14. <span class="preview-weekday" v-for="d in weekDays" :key="d">{{ d }}</span>
  15. </div>
  16. <div class="preview-row">
  17. <div
  18. v-for="(day, idx) in checkinDays"
  19. :key="idx"
  20. class="preview-day"
  21. :class="{
  22. checked: day.checked,
  23. today: day.isToday,
  24. reward: day.isReward,
  25. }"
  26. >
  27. <span class="day-num">{{ day.num }}</span>
  28. <span v-if="day.isReward" class="day-bonus">+{{ day.bonus }}</span>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="step2-tip">
  33. <span class="tip-icon">💡</span>
  34. <span>连续签到 7 天可领取额外积分大礼包</span>
  35. </div>
  36. </div>
  37. <!-- 右侧:操作指引 -->
  38. <div class="step2-action">
  39. <div class="action-arrow-area">
  40. <div class="arrow-text">点击左侧菜单</div>
  41. <div class="arrow-icon">「每日签到」</div>
  42. <div class="arrow-down">
  43. <svg width="40" height="40" viewBox="0 0 40 40" fill="none">
  44. <path d="M20 8 L20 30" stroke="#2C6FBF" stroke-width="2.5" stroke-linecap="round" />
  45. <path d="M12 22 L20 30 L28 22" stroke="#2C6FBF" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" />
  46. </svg>
  47. </div>
  48. </div>
  49. <button class="btn-checkin" @click="handleGoSignIn">
  50. <span class="btn-icon">✅</span>
  51. 去签到
  52. </button>
  53. <button v-if="false" class="btn-next" @click="$emit('next')">
  54. {{ isLast ? '完成新手教程 ✓' : '下一步' }}
  55. </button>
  56. <button class="btn-prev" v-if="!isFirst" @click="$emit('prev')">
  57. 上一步
  58. </button>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. export default {
  64. name: 'SignInGuide',
  65. props: {
  66. isLast: {
  67. type: Boolean,
  68. default: false,
  69. },
  70. isFirst: {
  71. type: Boolean,
  72. default: false,
  73. },
  74. isReplay: { type: Boolean, default: false },
  75. },
  76. data() {
  77. return {
  78. weekDays: ['一', '二', '三', '四', '五', '六', '日'],
  79. checkinDays: [
  80. { num: 1, checked: true, isToday: false, isReward: false, bonus: 0 },
  81. { num: 2, checked: true, isToday: false, isReward: false, bonus: 0 },
  82. { num: 3, checked: true, isToday: false, isReward: false, bonus: 0 },
  83. { num: 4, checked: true, isToday: true, isReward: true, bonus: 10 },
  84. { num: 5, checked: false, isToday: false, isReward: false, bonus: 0 },
  85. { num: 6, checked: false, isToday: false, isReward: false, bonus: 0 },
  86. { num: 7, checked: false, isToday: false, isReward: true, bonus: 30 },
  87. ],
  88. }
  89. },
  90. methods: {
  91. handleGoSignIn() {
  92. // 跳转到签到页
  93. this.$router.push('/home/signIn')
  94. // 延迟后自动进入下一步
  95. setTimeout(() => {
  96. this.$emit('next')
  97. }, 500)
  98. },
  99. },
  100. }
  101. </script>
  102. <style scoped>
  103. .step2-card {
  104. width: 560px;
  105. max-width: 92vw;
  106. background: #fff;
  107. border-radius: 20px;
  108. overflow: hidden;
  109. box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  110. display: flex;
  111. animation: cardFloat 0.5s ease-out;
  112. }
  113. @keyframes cardFloat {
  114. from {
  115. opacity: 0;
  116. transform: translateY(30px) scale(0.95);
  117. }
  118. to {
  119. opacity: 1;
  120. transform: translateY(0) scale(1);
  121. }
  122. }
  123. /* ---- 左侧信息区 ---- */
  124. .step2-info {
  125. flex: 1;
  126. padding: 32px 28px 28px;
  127. }
  128. .step2-badge {
  129. display: inline-block;
  130. padding: 3px 12px;
  131. font-size: 12px;
  132. font-weight: 600;
  133. color: #2C6FBF;
  134. background: #eaf2ff;
  135. border-radius: 12px;
  136. margin-bottom: 16px;
  137. }
  138. .step2-title {
  139. font-size: 20px;
  140. font-weight: 700;
  141. color: #1d2129;
  142. margin: 0 0 10px;
  143. }
  144. .step2-desc {
  145. font-size: 14px;
  146. line-height: 1.7;
  147. color: #86909c;
  148. margin: 0 0 20px;
  149. }
  150. .step2-desc strong {
  151. color: #2C6FBF;
  152. }
  153. /* ---- 签到日历预览 ---- */
  154. .checkin-preview {
  155. background: #f7f9fc;
  156. border-radius: 12px;
  157. padding: 12px;
  158. margin-bottom: 16px;
  159. }
  160. .preview-header {
  161. display: flex;
  162. margin-bottom: 8px;
  163. }
  164. .preview-weekday {
  165. flex: 1;
  166. text-align: center;
  167. font-size: 11px;
  168. color: #86909c;
  169. font-weight: 500;
  170. }
  171. .preview-row {
  172. display: flex;
  173. gap: 4px;
  174. }
  175. .preview-day {
  176. flex: 1;
  177. display: flex;
  178. flex-direction: column;
  179. align-items: center;
  180. gap: 2px;
  181. padding: 6px 0;
  182. border-radius: 8px;
  183. transition: all 0.25s;
  184. position: relative;
  185. }
  186. .preview-day.checked {
  187. background: #eaf2ff;
  188. }
  189. .preview-day.today {
  190. background: #2C6FBF;
  191. box-shadow: 0 2px 8px rgba(44, 111, 191, 0.3);
  192. }
  193. .preview-day.today .day-num {
  194. color: #fff;
  195. font-weight: 700;
  196. }
  197. .preview-day.reward:not(.checked) {
  198. background: linear-gradient(135deg, #fff5e6, #fff0d6);
  199. border: 1px dashed #f5a623;
  200. }
  201. .day-num {
  202. font-size: 14px;
  203. font-weight: 600;
  204. color: #4e5969;
  205. }
  206. .day-bonus {
  207. font-size: 9px;
  208. color: #f5a623;
  209. font-weight: 700;
  210. }
  211. /* ---- 提示条 ---- */
  212. .step2-tip {
  213. display: flex;
  214. align-items: center;
  215. gap: 8px;
  216. padding: 10px 14px;
  217. background: linear-gradient(135deg, #fff9e6, #fff3cc);
  218. border-radius: 8px;
  219. font-size: 12px;
  220. color: #b8860b;
  221. }
  222. .tip-icon {
  223. font-size: 16px;
  224. }
  225. /* ---- 右侧操作区 ---- */
  226. .step2-action {
  227. width: 180px;
  228. background: linear-gradient(180deg, #f0f6ff 0%, #e4eeff 100%);
  229. display: flex;
  230. flex-direction: column;
  231. align-items: center;
  232. justify-content: center;
  233. padding: 28px 16px;
  234. border-left: 1px solid #e5eaf2;
  235. }
  236. .action-arrow-area {
  237. text-align: center;
  238. margin-bottom: 24px;
  239. }
  240. .arrow-text {
  241. font-size: 13px;
  242. color: #86909c;
  243. margin-bottom: 6px;
  244. }
  245. .arrow-icon {
  246. font-size: 18px;
  247. font-weight: 700;
  248. color: #2C6FBF;
  249. margin-bottom: 12px;
  250. }
  251. .arrow-down {
  252. animation: arrowBounce 1.5s ease-in-out infinite;
  253. }
  254. @keyframes arrowBounce {
  255. 0%, 100% { transform: translateY(0); }
  256. 50% { transform: translateY(6px); }
  257. }
  258. .btn-checkin {
  259. display: flex;
  260. align-items: center;
  261. justify-content: center;
  262. gap: 8px;
  263. width: 100%;
  264. padding: 12px 28px;
  265. font-size: 15px;
  266. font-weight: 600;
  267. color: #fff;
  268. background: linear-gradient(135deg, #2C6FBF, #5B9FE6);
  269. border: none;
  270. border-radius: 24px;
  271. cursor: pointer;
  272. transition: all 0.3s;
  273. box-shadow: 0 4px 12px rgba(44, 111, 191, 0.3);
  274. white-space: nowrap;
  275. }
  276. .btn-checkin:hover {
  277. transform: translateY(-1px);
  278. box-shadow: 0 6px 18px rgba(44, 111, 191, 0.45);
  279. }
  280. .btn-checkin:active {
  281. transform: translateY(0);
  282. }
  283. .btn-icon {
  284. font-size: 18px;
  285. }
  286. .btn-next {
  287. margin-top: 12px;
  288. width: 100%;
  289. padding: 10px 20px;
  290. font-size: 14px;
  291. font-weight: 500;
  292. color: #2C6FBF;
  293. background: #fff;
  294. border: 1.5px solid #2C6FBF;
  295. border-radius: 20px;
  296. cursor: pointer;
  297. transition: all 0.25s;
  298. white-space: nowrap;
  299. }
  300. .btn-next:hover {
  301. background: #eaf2ff;
  302. transform: translateY(-1px);
  303. }
  304. .btn-next:active {
  305. transform: translateY(0);
  306. }
  307. .btn-prev {
  308. margin-top: 12px;
  309. width: 100%;
  310. padding: 10px 20px;
  311. font-size: 13px;
  312. font-weight: 500;
  313. color: #86909c;
  314. background: #f0f2f5;
  315. border: none;
  316. border-radius: 20px;
  317. cursor: pointer;
  318. transition: all 0.25s;
  319. white-space: nowrap;
  320. }
  321. .btn-prev:hover {
  322. color: #4e5969;
  323. background: #e5e8ed;
  324. }
  325. </style>