_type.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <template>
  2. <div class="creditIndex">
  3. <credit-common-title :data="topAreaData"/>
  4. <section class="contentArea">
  5. <div class="tabList">
  6. <div class="cell" v-for="item in typeList" :key="item.type" @click="jumpTo(item.topAreaData.url)">
  7. <p class="word">{{item.topAreaData.tabTitle || item.topAreaData.title}}</p>
  8. <p class="line" v-if="item.type === type"></p>
  9. </div>
  10. </div>
  11. <div class="list">
  12. <div class="cell" v-for="(item, index) in list" :key="'creditIndexList' + index">
  13. <div class="cellBody">
  14. <div class="left">
  15. <img :src="item.icon" alt="">
  16. </div>
  17. <div class="center">
  18. <p class="title">{{item.title}}</p>
  19. <p class="subTitle">{{item.subTitle}}</p>
  20. </div>
  21. <div
  22. class="right"
  23. :class="item.rightStatus || ''"
  24. @click="jumpTo(item.jumpUrl, item)">
  25. <p>{{item.rightName}}</p>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </section>
  31. <ToastIndex :type="toastType" :closeToast="closeToast" :dataInfo="toastDataInfo" :submitRefresh="refresh"/>
  32. </div>
  33. </template>
  34. <script>
  35. import CreditCommonTitle from '@/components/credit/header.vue'
  36. import ToastIndex from '@/components/credit/toastIndex.vue'
  37. import data from '../../components/credit/data'
  38. import DealData from '../../components/credit/dealData'
  39. /**
  40. * type: 'project' //项目经验
  41. * type: 'identify' //身份特征
  42. * type: 'professional' //专业经历
  43. * type: 'credit' //社会信用
  44. * type: 'other' //其他
  45. */
  46. export default {
  47. layout: "opacity_header",
  48. components: { CreditCommonTitle, ToastIndex },
  49. head() {
  50. return {
  51. title: '程序员客栈技术信用-程序员技术开发能力认证,企业程序员背调专用数据平台',
  52. meta: [ {
  53. 'name': 'keywords',
  54. 'content': '技术信用,程序员背调,程序员技术能力认证'
  55. }, {
  56. 'name': 'descrption',
  57. 'content': '程序员客栈技术信用平台依托多年的程序员数据,提供程序员技能等级认证,服务口碑,就业情况数据核实。为每一位入驻的程序员提供真实有效符合自身能力的技术信用认证,给用工单位提供所录用的程序员以往从业经历或者服务历史口碑的准确报告;对接程序员和用工企业,找出最适合程序员发展的平台,为用工单位提供最合适的程序员人选。程序员技术信用认证、程序员背景调查,请认准程序员客栈技术信用平台!'
  58. }, {
  59. 'name': 'h1',
  60. 'content': '技术信用'
  61. } ]
  62. }
  63. },
  64. async asyncData({ $axios, params, req, store}) {
  65. let userinfo = store.state.userinfo
  66. const dealData = new DealData({ $axios, req, userinfo})
  67. const type = params.type || 'identify'
  68. let { topAreaData, list } = data[ type ]
  69. //处理数据,假若有 跳转链接, 设置按钮样式
  70. list.forEach(item => {
  71. if (item.jumpUrl) {
  72. item.rightStatus = 'ok click'
  73. }
  74. })
  75. switch (params.type) {
  76. case 'professional': //专业经历
  77. list = await dealData.professional(list)
  78. break
  79. case 'identify': //身份特征
  80. list = await dealData.identify(list)
  81. break
  82. case 'project': //项目经验
  83. list = await dealData.project(list)
  84. break
  85. case 'credit': //社会信用
  86. list = await dealData.credit(list)
  87. break
  88. }
  89. //data转化为数组
  90. let typeList = []
  91. for (let key in data) {
  92. if (data[ key ] && data[ key ].list) {
  93. typeList.push({
  94. type: key,
  95. ...data[ key ]
  96. })
  97. }
  98. }
  99. return {
  100. typeList,
  101. type,
  102. list,
  103. topAreaData,
  104. }
  105. },
  106. data() {
  107. return {
  108. toastType: '',
  109. toastDataInfo: {},
  110. }
  111. },
  112. mounted() {
  113. this.needLogin();
  114. },
  115. methods: {
  116. jumpTo(url, item) {
  117. console.log('点击', "url", url, "item", item)
  118. if (url) {
  119. switch (url) {
  120. case 'openRealNameAuth': //打开实名认证弹窗
  121. console.log('openRealNameAuth 打开实名认证弹窗')
  122. this.toastType = 'openRealNameAuth'
  123. this.toastDataInfo = item || {}
  124. break;
  125. case 'openEducation': //打开最高学历认证
  126. console.log('openEducation 打开最高学历认证')
  127. this.toastType = 'openEducation'
  128. this.toastDataInfo = item || {}
  129. break;
  130. case 'openWorkHistory': //工作经历弹窗
  131. console.log('openWorkHistory 工作经历弹窗')
  132. this.toastType = 'openWorkHistory'
  133. this.toastDataInfo = item || {}
  134. break;
  135. default:
  136. location.href = url
  137. }
  138. }
  139. },
  140. closeToast() {
  141. this.toastType = ''
  142. },
  143. async refresh(type) {
  144. const dealData = new DealData({
  145. $axios: this.$axios,
  146. res: { header: {} },
  147. userinfo: this.$store.state.userinfo
  148. })
  149. switch (type) {
  150. case 'openWorkHistory':
  151. this.list = await dealData.professional(this.list)
  152. break
  153. case 'openEducation':
  154. this.list = await dealData.identify(this.list)
  155. break
  156. }
  157. }
  158. }
  159. }
  160. </script>
  161. <style scope lang="scss">
  162. @import "../../assets/css/credit/type.scss";
  163. </style>