index.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. /*topic*/
  2. <template>
  3. <DetailLayout :title="businessType == '1' ? '比赛题目领取' : '预演题目领取'">
  4. <div class="topic">
  5. <div class="content-top">
  6. <div class="top-left">
  7. <p><img src="@/assets/match/x.png" /> 请选择您的身份</p>
  8. <span>根据您所选择的身份匹配不同难度的题目</span>
  9. </div>
  10. <div class="top-right">
  11. <div
  12. class="right-btn"
  13. v-for="(item, index) in btnsel"
  14. :key="index"
  15. @click="togglebtn(index)"
  16. :class="{ activebtn: index == newindex }"
  17. >
  18. {{ item.name }}
  19. </div>
  20. </div>
  21. </div>
  22. <div v-if="listli.length == 0" class="tips">暂无数据</div>
  23. <div v-else class="content-bottom">
  24. <ul>
  25. <li v-for="(item, index) in listli" :key="index">
  26. <div class="desc">
  27. <h3>{{ item.title }}</h3>
  28. <div class="explain" @click="details(item.title)">
  29. 说明:{{ item.content }}
  30. </div>
  31. </div>
  32. <div class="bottons" v-if="nowIndex == 0">
  33. <div
  34. class="botton"
  35. v-if="item.isJoin == '0'"
  36. @click="lingti(item.id)"
  37. >
  38. 领取题目
  39. </div>
  40. <div
  41. class="botton white"
  42. v-else
  43. @click="intoprojec(item.projectId)"
  44. >
  45. 进入项目
  46. </div>
  47. </div>
  48. <div class="bottons" v-else>
  49. <div
  50. class="botton"
  51. v-if="item.isJoin == '0'"
  52. @click="lingti(item.id)"
  53. >
  54. 领取答题
  55. </div>
  56. <div
  57. class="botton white"
  58. v-else
  59. @click="intoprojec(item.projectId)"
  60. >
  61. 进入项目
  62. </div>
  63. </div>
  64. </li>
  65. </ul>
  66. </div>
  67. </div>
  68. </DetailLayout>
  69. </template>
  70. <script>
  71. import DetailLayout from './components/DetailLayout'
  72. import { request } from '@/utils/request'
  73. import { Message } from 'element-ui' // 引入Message、MessageBox
  74. export default {
  75. name: 'Topic',
  76. components: { DetailLayout },
  77. data() {
  78. return {
  79. nowIndex: '0',
  80. businessType: '',
  81. megagameId: '',
  82. newindex: 0,
  83. tabsParam: ['预演题目领取', '比赛题目领取'],
  84. megagameId: '',
  85. uid: '',
  86. btnsel: [
  87. { id: '1', name: '学生' },
  88. { id: '2', name: '专业' },
  89. ],
  90. listli: [],
  91. }
  92. },
  93. created() {
  94. this.megagameId = sessionStorage.getItem('megagameId')
  95. this.businessType = sessionStorage.getItem('businessType')
  96. },
  97. mounted() {
  98. // this.businessType=this.$route.query.id;
  99. // this.megagameId=this.$route.query.megagameId;
  100. this.listlt(this.businessType, '1')
  101. },
  102. methods: {
  103. back() {
  104. this.$router.replace('/matchLayout/timeline')
  105. },
  106. // 调用领题列表
  107. listlt(nowIndex, newindex) {
  108. let tonewindex = nowIndex + ''
  109. let tonowIndex = nowIndex + 1 + ''
  110. const params = {
  111. transCode: 'D00022',
  112. megaganmeId: this.megagameId,
  113. uid: this.$store.getters.userId,
  114. businessType: tonewindex,
  115. rank: newindex,
  116. }
  117. request(params)
  118. .then((res) => {
  119. this.listli = res.rows
  120. })
  121. .catch((err) => {})
  122. },
  123. togglebtn(index) {
  124. this.newindex = index
  125. this.listlt(this.businessType, this.newindex + 1 + '')
  126. },
  127. //领取题目
  128. lingti(id) {
  129. const loading = this.$loading({
  130. lock: true, //lock的修改符--默认是false
  131. text: 'Loading', //显示在加载图标下方的加载文案
  132. spinner: 'el-icon-loading', //自定义加载图标类名
  133. background: 'rgba(0, 0, 0, 0.7)', //遮罩层颜色
  134. target: document.querySelector('#table'), //loadin覆盖的dom元素节点
  135. })
  136. const params = {
  137. transCode: 'D00009',
  138. questionId: id, // 每个题目的数据id
  139. uid: this.$store.getters.userId,
  140. }
  141. request(params)
  142. .then((res) => {
  143. loading.close()
  144. this.$message.success('恭喜您,领取成功!')
  145. this.listlt(this.businessType, this.newindex + 1 + '')
  146. })
  147. .catch((err) => {
  148. loading.close()
  149. })
  150. },
  151. // 点击进入详情页面
  152. details(title) {
  153. let path = ''
  154. switch (title) {
  155. case '前沿-HCFDLab-风洞模型流场分析':
  156. path = 'topic/detailsxq'
  157. break
  158. case '前沿-HCFDLab-Agard Wing升阻力曲线分析':
  159. path = 'topic/detailaw'
  160. break
  161. case '前沿-Bladesign-X棱形截面悬臂梁的动态特性(模态、瞬态)分析':
  162. path = 'detailbzs1'
  163. break
  164. case '前沿-Bladesign-考虑初始形变(预弯/预扭)的梯形截面梁受力分析':
  165. path = 'detailbzs2'
  166. break
  167. case '前沿-Bladesign-具有渐变截面特性及复合材料铺层结构的简化机翼受力分析':
  168. path = 'detailbzs3'
  169. break
  170. case '前沿-Bladesign-弧形大梁简化机翼截面的多目标优化':
  171. path = 'detailbzs4'
  172. break
  173. case '前沿-Bladesign-矩形截面梁受力分析':
  174. path = 'topic/detailbyy'
  175. break
  176. case '前沿-HCFDLab-Mavric Wing升阻力曲线分析':
  177. path = 'topic/detailmw'
  178. break
  179. case '前沿-HCFDLab-AFA飞机模型流场分析':
  180. path = 'topic/detailafa'
  181. break
  182. }
  183. this.$router.push(path)
  184. },
  185. //点击进入项目
  186. intoprojec(projectId) {
  187. this.getDetails(projectId)
  188. this.$router.replace({
  189. path: '/userLayout/details',
  190. query: { projectId: projectId },
  191. })
  192. },
  193. getDetails(projectId) {
  194. const params = {
  195. transCode: 'C00031',
  196. projectId: projectId,
  197. }
  198. request(params)
  199. .then((res) => {
  200. this.data = res
  201. })
  202. .catch((err) => {})
  203. },
  204. },
  205. }
  206. </script>
  207. <style lang="scss" scoped>
  208. @import '@/styles/variables.scss';
  209. @import '@/styles/mixin.scss';
  210. .topic {
  211. @include w_h();
  212. font-size: 16px;
  213. color: $color_f;
  214. .content-top {
  215. @include flex();
  216. padding: 20px 0;
  217. .top-left {
  218. line-height: 1.5;
  219. color: #fde800;
  220. p {
  221. font-size: 20px;
  222. }
  223. span {
  224. padding-left: 22px;
  225. }
  226. }
  227. .top-right {
  228. @include w_h(220px);
  229. @include flex();
  230. text-align: center;
  231. .right-btn {
  232. @include w_h(100px, 40px);
  233. line-height: 40px;
  234. border: 1px solid $color_f;
  235. border-radius: 20px;
  236. overflow: hidden;
  237. transition: all 0.3s;
  238. &:hover {
  239. cursor: pointer;
  240. opacity: 0.8;
  241. }
  242. }
  243. .activebtn {
  244. background: #008dfa;
  245. border: #008dfa;
  246. }
  247. }
  248. }
  249. .tips {
  250. font-size: 28px;
  251. color: $color_f;
  252. text-align: center;
  253. }
  254. .content-bottom {
  255. padding: 10px 22px;
  256. background: rgba(255, 255, 255, 0.2);
  257. li {
  258. @include flex();
  259. padding: 20px 0;
  260. border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  261. .desc {
  262. @include w_h(calc(100% - 100px));
  263. .h3 {
  264. font-size: 20px;
  265. }
  266. .explain {
  267. @include w_h();
  268. padding-top: 15px;
  269. white-space: nowrap;
  270. overflow: hidden;
  271. text-overflow: ellipsis;
  272. transition: all 0.3s;
  273. &:hover {
  274. cursor: pointer;
  275. opacity: 0.8;
  276. }
  277. }
  278. }
  279. }
  280. .bottons {
  281. @include w_h(100px);
  282. @include flex(flex-end);
  283. .botton {
  284. @include w_h(68px);
  285. color: #008dfa;
  286. transition: all 0.3s;
  287. &:hover {
  288. cursor: pointer;
  289. opacity: 0.8;
  290. }
  291. }
  292. .white {
  293. color: $color_f;
  294. }
  295. }
  296. }
  297. }
  298. </style>