Mine.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <div class="mine-container">
  3. <div class="mine-top-wrapper">
  4. <el-row :gutter="0" style="height:100%">
  5. <el-col :span="16">
  6. <div class="advertise-imgs">
  7. <img
  8. src="http://sinastorage.com/storage.miaosha.sina.com.cn/products/201903/e496d11b3d74cf660c286fbd5ab8d0bb.png"
  9. >
  10. </div>
  11. </el-col>
  12. <el-col :span="8">
  13. <div class="user-banner">
  14. <p class="head">
  15. <a href="javascript:;" class="login-link">
  16. <img src="http://www.mooctest.net/assets/img/mooctest.png" class="user-img">
  17. <span class="vertify hide"></span>
  18. </a>
  19. </p>
  20. <div class="username_box">
  21. <div class="username_icon username_"></div>
  22. <span class="username">{{user.name}}</span>
  23. </div>
  24. <!--<p class="name">-->
  25. <!--<a href="javascript:;" class="login-btn btn btn-medium btn-info">登录</a>-->
  26. <!--<a-->
  27. <!--href="https://login.sina.com.cn/signup/signup?entry=tech"-->
  28. <!--class="register-btn btn btn-medium btn-info"-->
  29. <!--target="_blank"-->
  30. <!--&gt;注册</a>-->
  31. <!--</p>-->
  32. <p class="scores">
  33. <a href="/rule/merit" target="_blank">
  34. 积分
  35. <em class="num1">{{user.score}}</em>
  36. </a>
  37. <span class="line">|</span>
  38. <a href="/rule/merit" target="_blank">
  39. 威望
  40. <em class="num2">{{user.prestige}}</em>
  41. </a>
  42. </p>
  43. <p>
  44. <router-link :to="{ name: 'ProjectCreate'}">
  45. <div class="btn btn-medium">申请项目</div>
  46. </router-link>
  47. </p>
  48. </div>
  49. </el-col>
  50. </el-row>
  51. </div>
  52. <div class="mine-body">
  53. <el-tabs tabPosition="top" type="card">
  54. <el-tab-pane label="未完成任务">
  55. <span v-if="unFinishedTaskList == null || unFinishedTaskList.length == 0"> 暂无任务 </span>
  56. <task-item v-if="unFinishedTaskList != null || unFinishedTaskList.length > 0"
  57. v-for="(item,index) in unFinishedTaskList" :key="index" :task="item"/>
  58. </el-tab-pane>
  59. <el-tab-pane label="已完成任务">
  60. <span v-if="finishedTaskList == null || finishedTaskList.length == 0"> 暂无任务 </span>
  61. <task-item v-if="finishedTaskList != null || finishedTaskList.length > 0"
  62. v-for="(item,index) in finishedTaskList" :key="index" :task="item"/>
  63. </el-tab-pane>
  64. <el-tab-pane label="已申请项目">
  65. <span v-if="appliedProjectList == null || appliedProjectList.length == 0"> 暂无项目 </span>
  66. <project-item v-if="appliedProjectList != null || appliedProjectList.length > 0"
  67. v-for="(item,index) in appliedProjectList" :key="index" :projectItem="item"/>
  68. </el-tab-pane>
  69. </el-tabs>
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import TaskItem from '@/components/commons/TaskItem'
  75. import ProjectItem from '@/components/commons/ProjectItem'
  76. import Http from '@/js/http.js'
  77. import Apis from '@/js/api.js'
  78. import {notify} from '@/constants/index'
  79. export default {
  80. name: 'Mine',
  81. components: {TaskItem, ProjectItem},
  82. data () {
  83. return {
  84. unFinishedTaskList: [],
  85. finishedTaskList: [],
  86. appliedProjectList: [],
  87. user: {}
  88. }
  89. },
  90. methods: {
  91. loadData () {
  92. Http.get(Apis.PAGE.MY_CROWD_TEST_PAGE.replace('{userId}', 3), {}).then((res) => {
  93. if (res.unfinishedTasks != null && res.unfinishedTasks.length > 0) {
  94. this.unFinishedTaskList = res.unfinishedTasks
  95. }
  96. if (res.finishedTasks != null && res.finishedTasks.length > 0) {
  97. this.finishedTaskList = res.finishedTasks
  98. }
  99. if (res.crowdProjectVOList != null && res.crowdProjectVOList.length > 0) {
  100. this.appliedProjectList = res.crowdProjectVOList
  101. }
  102. if (res.userVO != null && res.userVO.length > 0) {
  103. this.user = res.userVO
  104. }
  105. })
  106. }
  107. },
  108. created: function () {
  109. this.loadData()
  110. }
  111. }
  112. </script>
  113. <style lang="less" scoped>
  114. .mine-container {
  115. padding: 0 80px 40px 80px;
  116. }
  117. .mine-top-wrapper {
  118. height: 350px;
  119. background-color: #fff;
  120. }
  121. [class*="el-col-"] {
  122. height: 100%;
  123. }
  124. .advertise-imgs {
  125. height: 100%;
  126. }
  127. .advertise-imgs img {
  128. width: 100%;
  129. height: 100%;
  130. }
  131. .user-banner {
  132. text-align: center;
  133. display: inline-table;
  134. height: 100%;
  135. width: 100%;
  136. margin-top: 40px;
  137. }
  138. .mine-body {
  139. margin-top: 30px;
  140. }
  141. </style>