Mall.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. <template>
  2. <div class="usremei-container">
  3. <div class="top-bg"></div>
  4. <div class="desc-card">
  5. <div class="desc-title">国家社会保险公共服务平台《民生为本》万亿补贴!</div>
  6. <div class="desc-content">
  7. 国家鼓励民众参与《退休计划补贴政策》,使用红旗资产参与退休计划获得退休金,退休金是国家按照社会保障制度规定,根据对社会所作出的贡献和所具备的享有享受养老保险待遇或退休条件,因年老丧失劳动能力退出劳动岗位后的基本生活而建立的一种社会保险制度,主要用于保障职工退休后的生活需要
  8. </div>
  9. </div>
  10. <div
  11. class="plan-card"
  12. v-for="item in plans"
  13. :key="item.id"
  14. >
  15. <div class="plan-header">
  16. {{ item.title }}
  17. </div>
  18. <div class="plan-table-row">
  19. <div class="plan-col">
  20. <div class="plan-label">参与金额</div>
  21. <div class="plan-value">{{ item.money }}红旗资产</div>
  22. </div>
  23. <div class="plan-col">
  24. <div class="plan-label">退休金</div>
  25. <div class="plan-value">{{ item.computing_power }}</div>
  26. </div>
  27. <div class="plan-col">
  28. <div class="plan-label">日收益</div>
  29. <div class="plan-value">{{ item.power }}%</div>
  30. </div>
  31. <div class="plan-col-btn">
  32. <button
  33. class="plan-btn"
  34. :class="{ 'disabled': !canClick(item) }"
  35. @click="canClick(item) && toPayment(item)"
  36. :disabled="!canClick(item)"
  37. >{{disabled ? '立即参与' : '已参与'}}</button>
  38. </div>
  39. </div>
  40. </div>
  41. <div v-if="loading" class="loading-mask">
  42. <div class="loading-spinner"></div>
  43. <div>加载中...</div>
  44. </div>
  45. <!-- 实名认证提示弹窗 -->
  46. <div v-if="showAuthDialog" class="custom-dialog-mask">
  47. <div class="custom-dialog auth-dialog">
  48. <div class="dialog-close" @click="showAuthDialog = false">
  49. <i class="close-icon"></i>
  50. </div>
  51. <div class="dialog-icon">
  52. <svg t="1710401275044" class="auth-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6356">
  53. <path d="M512 512m-448 0a448 448 0 1 0 896 0 448 448 0 1 0-896 0Z" fill="#1890FF" p-id="6357"></path>
  54. <path d="M512 320c-17.7 0-32 14.3-32 32v256c0 17.7 14.3 32 32 32s32-14.3 32-32V352c0-17.7-14.3-32-32-32z" fill="#FFFFFF" p-id="6358"></path>
  55. <path d="M512 720m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z" fill="#FFFFFF" p-id="6359"></path>
  56. </svg>
  57. </div>
  58. <div class="dialog-title auth-title">温馨提示</div>
  59. <div class="dialog-content">您还未完成实名认证<br/>请先进行实名认证</div>
  60. <button class="dialog-btn auth-btn" @click="goToAuth">去认证</button>
  61. </div>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import {getMiner,getUserInfo,joinRetirement} from '@/api/home.js'
  67. export default {
  68. name: 'Mall',
  69. data() {
  70. return {
  71. plans: [
  72. {
  73. "id": 1,
  74. "type": 1,
  75. "title": "初级退休补贴金",
  76. "money": "30000",
  77. "rent_cycle": 1825,
  78. "computing_power": "3000",
  79. "power": "10",
  80. },
  81. {
  82. "id": 2,
  83. "type": 2,
  84. "title": "一级退休补贴金",
  85. "money": "60000",
  86. "rent_cycle": 1825,
  87. "computing_power": "6000",
  88. "power": "10",
  89. },
  90. {
  91. "id": 3,
  92. "type": 3,
  93. "title": "二级退休补贴金",
  94. "money": "100000",
  95. "rent_cycle": 1825,
  96. "computing_power": "10000",
  97. "power": "10",
  98. },
  99. {
  100. "id": 4,
  101. "type": 4,
  102. "title": "三级退休补贴金",
  103. "money": "200000",
  104. "rent_cycle": 1825,
  105. "computing_power": "20000",
  106. "power": "10",
  107. }
  108. ],
  109. userInfo: {},
  110. loading: false,
  111. showAuthDialog: false
  112. }
  113. },
  114. methods:{
  115. async getUserInfo() {
  116. const res = await getUserInfo();
  117. this.userInfo = res.data;
  118. },
  119. getPlans(){
  120. let data = {
  121. page:'',
  122. size:'',
  123. type:1
  124. }
  125. getMiner(data).then(res=>{
  126. if(res.code === 1){
  127. this.plans = res.data
  128. }
  129. })
  130. },
  131. toPayment(item) {
  132. // 检查实名认证状态
  133. if (this.userInfo.if_real === 0) {
  134. this.showAuthDialog = true;
  135. return;
  136. }
  137. this.loading = true;
  138. joinRetirement(item.type)
  139. .then(res => {
  140. console.log(res, '2222222222');
  141. })
  142. .catch(err => {
  143. console.error(err);
  144. })
  145. .finally(() => {
  146. this.loading = false;
  147. });
  148. },
  149. canClick(item) {
  150. const { chuji, yiji, erji, sanji } = this.userInfo;
  151. switch(item.id) {
  152. case 1:
  153. return chuji === 0;
  154. case 2:
  155. return yiji === 0;
  156. case 3:
  157. return erji === 0;
  158. case 4:
  159. return sanji === 0;
  160. default:
  161. return false;
  162. }
  163. },
  164. goToAuth() {
  165. this.$router.push('/user-center');
  166. }
  167. },
  168. mounted() {
  169. this.getUserInfo()
  170. // this.getPlans()
  171. },
  172. }
  173. </script>
  174. <style scoped>
  175. .usremei-container {
  176. min-height: 100vh;
  177. background-image: url('../assets/dabag.png');
  178. background-size: cover;
  179. background-position: center;
  180. padding-top: 60px;
  181. padding-bottom: 80px; /* 为底部tab预留空间 */
  182. box-sizing: border-box; /* 确保padding不会增加容器高度 */
  183. overflow-y: auto; /* 允许内容滚动 */
  184. position: relative; /* 为fixed定位提供参考 */
  185. }
  186. .desc-card {
  187. background: #fff8e1;
  188. box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  189. margin: 0px 16px 24px 16px;
  190. padding: 18px 16px 12px 16px;
  191. z-index: 2;
  192. position: relative;
  193. }
  194. .desc-title {
  195. font-size: 14px;
  196. font-weight: bold;
  197. margin-bottom: 8px;
  198. }
  199. .desc-content {
  200. font-size: 12px;
  201. color: #333;
  202. line-height: 1.7;
  203. }
  204. .plan-card {
  205. background: #d0021b;
  206. border-radius: 8px;
  207. margin: 0 16px 22px 16px;
  208. box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  209. }
  210. .plan-header {
  211. background: #fff8e1;
  212. color: #333;
  213. font-size: 14px;
  214. font-weight: bold;
  215. padding: 6px 12px;
  216. border-bottom: 1px solid #f5c6cb;
  217. }
  218. .plan-table-row {
  219. display: flex;
  220. align-items: center;
  221. justify-content: space-between;
  222. background: #fff;
  223. padding: 0 18px;
  224. height: 70px;
  225. }
  226. .plan-col {
  227. width:auto;
  228. font-size:12px;
  229. white-space: nowrap;
  230. display: flex;
  231. flex-direction: column;
  232. justify-content: center;
  233. align-items: flex-start;
  234. }
  235. .plan-label {
  236. color: #333;
  237. font-size: 14px;
  238. font-weight: bold;
  239. margin-bottom: 2px;
  240. }
  241. .plan-value {
  242. margin-top:6px;
  243. font-size: 14px;
  244. text-align:center;
  245. }
  246. .plan-col-btn {
  247. display: flex;
  248. justify-content: center;
  249. align-items: center;
  250. }
  251. .plan-btn {
  252. background: #b80032;
  253. color: #fff;
  254. border: none;
  255. border-radius: 18px;
  256. padding: 2px 6px;
  257. font-size: 14px;
  258. cursor: pointer;
  259. transition: background 0.2s;
  260. }
  261. .plan-btn:hover {
  262. background: #a00028;
  263. }
  264. .plan-btn.disabled {
  265. background: #cccccc;
  266. cursor: not-allowed;
  267. }
  268. .loading-mask {
  269. position: fixed;
  270. left: 0; top: 0; right: 0; bottom: 0;
  271. background: rgba(0,0,0,0.3);
  272. z-index: 9999;
  273. display: flex;
  274. flex-direction: column;
  275. align-items: center;
  276. justify-content: center;
  277. }
  278. .loading-spinner {
  279. border: 4px solid #f3f3f3;
  280. border-top: 4px solid #b80032;
  281. border-radius: 50%;
  282. width: 40px; height: 40px;
  283. animation: spin 1s linear infinite;
  284. margin-bottom: 10px;
  285. }
  286. @keyframes spin {
  287. 0% { transform: rotate(0deg);}
  288. 100% { transform: rotate(360deg);}
  289. }
  290. /* 认证弹窗样式 */
  291. .custom-dialog-mask {
  292. position: fixed;
  293. top: 0;
  294. left: 0;
  295. right: 0;
  296. bottom: 0;
  297. background: rgba(0, 0, 0, 0.6);
  298. display: flex;
  299. align-items: center;
  300. justify-content: center;
  301. z-index: 9999;
  302. }
  303. .custom-dialog {
  304. position: relative;
  305. width: 280px;
  306. background: #fff;
  307. border-radius: 12px;
  308. padding: 20px;
  309. text-align: center;
  310. animation: dialogFadeIn 0.3s ease;
  311. }
  312. .dialog-icon {
  313. width: 60px;
  314. height: 60px;
  315. margin: 0 auto 16px;
  316. }
  317. .auth-icon {
  318. width: 100%;
  319. height: 100%;
  320. }
  321. .dialog-title {
  322. font-size: 18px;
  323. font-weight: 500;
  324. margin-bottom: 12px;
  325. }
  326. .auth-title {
  327. color: #1890FF;
  328. }
  329. .dialog-content {
  330. font-size: 14px;
  331. color: #666;
  332. line-height: 1.8;
  333. margin: 16px 0 24px;
  334. }
  335. .dialog-btn {
  336. width: 100%;
  337. height: 40px;
  338. border: none;
  339. border-radius: 20px;
  340. font-size: 16px;
  341. color: #fff;
  342. cursor: pointer;
  343. transition: all 0.3s ease;
  344. }
  345. .auth-btn {
  346. background: #1890FF;
  347. }
  348. .auth-btn:hover {
  349. background: #40a9ff;
  350. }
  351. .auth-dialog {
  352. box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  353. }
  354. .dialog-close {
  355. position: absolute;
  356. top: 12px;
  357. right: 12px;
  358. width: 24px;
  359. height: 24px;
  360. display: flex;
  361. align-items: center;
  362. justify-content: center;
  363. cursor: pointer;
  364. transition: all 0.3s ease;
  365. }
  366. .dialog-close:hover {
  367. transform: rotate(90deg);
  368. }
  369. .dialog-close .close-icon {
  370. position: relative;
  371. width: 16px;
  372. height: 16px;
  373. }
  374. .dialog-close .close-icon::before,
  375. .dialog-close .close-icon::after {
  376. content: '';
  377. position: absolute;
  378. width: 100%;
  379. height: 2px;
  380. background-color: #999;
  381. top: 50%;
  382. left: 0;
  383. }
  384. .dialog-close .close-icon::before {
  385. transform: rotate(45deg);
  386. }
  387. .dialog-close .close-icon::after {
  388. transform: rotate(-45deg);
  389. }
  390. @keyframes dialogFadeIn {
  391. from {
  392. opacity: 0;
  393. transform: scale(0.9);
  394. }
  395. to {
  396. opacity: 1;
  397. transform: scale(1);
  398. }
  399. }
  400. </style>