Commit 4d5e105e45f1c324c61ac6675a75e39f7ed55171
1 parent
a3fab231
Exists in
master
feat:答题模块
Showing
9 changed files
with
381 additions
and
51 deletions
Show diff stats
src/main.js
| ... | ... | @@ -15,6 +15,7 @@ Vue.prototype.kqUrl = 'https://proxy.shunzhi.net/achieve' |
| 15 | 15 | |
| 16 | 16 | import yxAxios from '@/https/yxAxios' |
| 17 | 17 | Vue.prototype.yxAxios = yxAxios; |
| 18 | +Vue.prototype.dialog = Dialog; | |
| 18 | 19 | |
| 19 | 20 | import { mgop } from '@aligov/jssdk-mgop'; |
| 20 | 21 | Vue.prototype.mgop = mgop; | ... | ... |
src/views/Service/ServiceKQ.vue
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | |
| 5 | 5 | <script> |
| 6 | 6 | import ServiceBasekq from './ServiceBaseKQ.vue' |
| 7 | +const userData = require('@/views/answerRank/data.json'); | |
| 7 | 8 | export default { |
| 8 | 9 | name: 'ServiceKQ', |
| 9 | 10 | data() { |
| ... | ... | @@ -49,10 +50,10 @@ export default { |
| 49 | 50 | window.location.href = `https://puser.zjzwfw.gov.cn/sso/alipay.do?action=ssoLogin&servicecode=hswsy` |
| 50 | 51 | } else { |
| 51 | 52 | alert('非浙里办渠道访问,显示测试用户数据') |
| 52 | - console.log('非浙里办渠道访问,显示测试用户数据') | |
| 53 | + console.log('非浙里办渠道访问,显示测试用户数据',userData) | |
| 53 | 54 | this.centerNo = '2021111017103639979048000010279' |
| 54 | 55 | localStorage.setItem('centerNo', '2021111017103639979048000010279') |
| 55 | - let userInfo = JSON.stringify({'userId': 10}) | |
| 56 | + let userInfo = JSON.stringify(userData) | |
| 56 | 57 | localStorage.setItem('userInfo', userInfo) |
| 57 | 58 | this.getUserInfo() |
| 58 | 59 | } | ... | ... |
src/views/Yanxue/achievementsOne.vue
| ... | ... | @@ -66,7 +66,7 @@ export default { |
| 66 | 66 | if (res.data.code == 200) { |
| 67 | 67 | this.newsList = res.data.data.list; |
| 68 | 68 | } else { |
| 69 | - this.$message.warning(res.data.message); | |
| 69 | + this.$toast.fail(res.data.message); | |
| 70 | 70 | } |
| 71 | 71 | }); |
| 72 | 72 | // this.yxAxios |
| ... | ... | @@ -79,7 +79,7 @@ export default { |
| 79 | 79 | // if (res.data.success) { |
| 80 | 80 | // this.newsList = res.data.data.list; |
| 81 | 81 | // } else { |
| 82 | - // this.$message.warning(res.data.message); | |
| 82 | + // this.$toast.fail(res.data.message); | |
| 83 | 83 | // } |
| 84 | 84 | // }); |
| 85 | 85 | }, | ... | ... |
src/views/Yanxue/chooseSchoolOne.vue
| ... | ... | @@ -50,7 +50,7 @@ export default { |
| 50 | 50 | this.schoolList = res.data.data; |
| 51 | 51 | console.log(this.schoolList) |
| 52 | 52 | } else { |
| 53 | - this.$message.warning(res.data.message); | |
| 53 | + this.$toast.fail(res.data.message); | |
| 54 | 54 | } |
| 55 | 55 | }); |
| 56 | 56 | // this.yxAxios |
| ... | ... | @@ -63,7 +63,7 @@ export default { |
| 63 | 63 | // if (res.data.success) { |
| 64 | 64 | // this.schoolList = res.data.data.list; |
| 65 | 65 | // } else { |
| 66 | - // this.$message.warning(res.data.message); | |
| 66 | + // this.$toast.fail(res.data.message); | |
| 67 | 67 | // } |
| 68 | 68 | // }); |
| 69 | 69 | }, | ... | ... |
src/views/Yanxue/pageDetails.vue
| ... | ... | @@ -58,7 +58,7 @@ export default { |
| 58 | 58 | this.modelList = arr; |
| 59 | 59 | // this.showFrame(); |
| 60 | 60 | } else { |
| 61 | - this.$message.warning(res.data.message); | |
| 61 | + this.$toast.fail(res.data.message); | |
| 62 | 62 | } |
| 63 | 63 | }); |
| 64 | 64 | // this.yxAxios |
| ... | ... | @@ -77,7 +77,7 @@ export default { |
| 77 | 77 | // this.modelList = arr; |
| 78 | 78 | // // this.showFrame(); |
| 79 | 79 | // } else { |
| 80 | - // this.$message.warning(res.data.message); | |
| 80 | + // this.$toast.fail(res.data.message); | |
| 81 | 81 | // } |
| 82 | 82 | // }); |
| 83 | 83 | }, | ... | ... |
src/views/answerRank/ans_question.vue
| ... | ... | @@ -2,35 +2,182 @@ |
| 2 | 2 | <div class="bck"> |
| 3 | 3 | <div class="title"> |
| 4 | 4 | <div>单向选择</div> |
| 5 | - <div>1<span>/5</span></div> | |
| 5 | + <div> | |
| 6 | + {{ dataObj.curNum }}<span>/{{ dataObj.totalNum }}</span> | |
| 7 | + </div> | |
| 6 | 8 | </div> |
| 7 | 9 | <div class="ans"> |
| 8 | - 这是一套题的题目,这是一题非常有难度的题,其考点在于对地理知识的储备量 | |
| 10 | + {{ dataObj.title }} | |
| 9 | 11 | </div> |
| 10 | 12 | |
| 11 | - <div class="ans_card"> | |
| 12 | - <div class="ans_item yellow">A.火星</div> | |
| 13 | - <div class="ans_item grey">B.水性</div> | |
| 14 | - <div class="ans_item grey">C.绍兴</div> | |
| 13 | + <div class="ans_card" v-for="(v, i) in contentJsonArray" :key="i"> | |
| 14 | + <div | |
| 15 | + class="ans_item grey" | |
| 16 | + :class="checkIndex === i ? 'yellow' : 'grey'" | |
| 17 | + @click="subAns(v.k, i)" | |
| 18 | + > | |
| 19 | + {{ v.k + " . " + v.v }} | |
| 20 | + </div> | |
| 21 | + <!-- <div class="ans_item grey">B.水性</div> | |
| 22 | + <div class="ans_item yellow">C.绍兴</div> --> | |
| 15 | 23 | </div> |
| 16 | 24 | |
| 17 | 25 | <div class="whiteLine"></div> |
| 18 | 26 | |
| 19 | - <div class="reply"> | |
| 20 | - <div class="reply_title">正确答案:a</div> | |
| 21 | - <div class="reply_text"> | |
| 22 | - 解析:本题的难点在于基础知识的掌握,同学们要注意这个陷阱问题,区别火星和水星在初级阶段是比较容易混淆,所以本题答案选a | |
| 23 | - </div> | |
| 27 | + <div class="reply" v-if="rightData.isShow"> | |
| 28 | + <div class="reply_title">正确答案:{{ rightData.rightAnswer }}</div> | |
| 29 | + <div class="reply_text">解析:{{ rightData.remark }}</div> | |
| 24 | 30 | </div> |
| 25 | 31 | |
| 26 | - <div class="btn">下一题</div> | |
| 32 | + <div | |
| 33 | + class="btn blue" | |
| 34 | + v-if="dataObj.curNum != 0 && dataObj.curNum == dataObj.totalNum" | |
| 35 | + @click="toEnd" | |
| 36 | + > | |
| 37 | + 完成 | |
| 38 | + </div> | |
| 39 | + <div class="btn" v-else @click="toNext">下一题</div> | |
| 27 | 40 | </div> |
| 28 | 41 | </template> |
| 29 | 42 | |
| 30 | 43 | <script> |
| 31 | 44 | export default { |
| 32 | 45 | data() { |
| 33 | - return {}; | |
| 46 | + return { | |
| 47 | + categoryId: 0, | |
| 48 | + dataObj: { | |
| 49 | + answer: null, | |
| 50 | + contentJsonArray: null, | |
| 51 | + curNum: 0, | |
| 52 | + id: 0, | |
| 53 | + itemCategoryId: 0, | |
| 54 | + remark: null, | |
| 55 | + score: 0, | |
| 56 | + sort: 0, | |
| 57 | + status: 0, | |
| 58 | + title: "", | |
| 59 | + totalNum: 0, | |
| 60 | + version: 0, | |
| 61 | + }, | |
| 62 | + contentJsonArray: [], //选项 | |
| 63 | + checkIndex: "", | |
| 64 | + //答案-解析 | |
| 65 | + rightData: { | |
| 66 | + rightAnswer: "", | |
| 67 | + remark: "", | |
| 68 | + isShow: false, | |
| 69 | + }, | |
| 70 | + }; | |
| 71 | + }, | |
| 72 | + methods: { | |
| 73 | + //获取题目-开始答题 | |
| 74 | + toBank() { | |
| 75 | + if (!this.categoryId) return this.$toast.fail("题库Id为空"); | |
| 76 | + this.yxAxios | |
| 77 | + .get( | |
| 78 | + `${ | |
| 79 | + this.kqUrl | |
| 80 | + }/item/getItemBank?travelerNum=${localStorage.getItem( | |
| 81 | + "travelerNum" | |
| 82 | + )}&categoryId=${this.categoryId}` | |
| 83 | + ) | |
| 84 | + .then((res) => { | |
| 85 | + if (res.data.code == 200) { | |
| 86 | + this.dataObj = res.data.data; | |
| 87 | + this.contentJsonArray = JSON.parse( | |
| 88 | + this.dataObj.contentJsonArray | |
| 89 | + ); | |
| 90 | + } else { | |
| 91 | + this.$toast.fail(res.data.message); | |
| 92 | + } | |
| 93 | + }); | |
| 94 | + }, | |
| 95 | + //提交答案 | |
| 96 | + subAns(val, index) { | |
| 97 | + this.checkIndex = index; | |
| 98 | + this.yxAxios | |
| 99 | + .get( | |
| 100 | + `${ | |
| 101 | + this.kqUrl | |
| 102 | + }/item/submit?travelerNum=${localStorage.getItem( | |
| 103 | + "travelerNum" | |
| 104 | + )}&itemBankId=${this.dataObj.id}&answer=${val}` | |
| 105 | + ) | |
| 106 | + .then((res) => { | |
| 107 | + if (res.data.code == 200) { | |
| 108 | + const data = res.data.data; | |
| 109 | + this.rightData = { | |
| 110 | + rightAnswer: data.rightAnswer, | |
| 111 | + remark: data.remark, | |
| 112 | + isShow: true, | |
| 113 | + }; | |
| 114 | + } else { | |
| 115 | + this.$toast.fail(res.data.message); | |
| 116 | + } | |
| 117 | + }); | |
| 118 | + }, | |
| 119 | + //下一题 | |
| 120 | + toNext() { | |
| 121 | + this.yxAxios | |
| 122 | + .get( | |
| 123 | + `${ | |
| 124 | + this.kqUrl | |
| 125 | + }/item/nextOne?travelerNum=${localStorage.getItem( | |
| 126 | + "travelerNum" | |
| 127 | + )}&curItemBankId=${this.dataObj.id}&categoryId=${ | |
| 128 | + this.categoryId | |
| 129 | + }` | |
| 130 | + ) | |
| 131 | + .then((res) => { | |
| 132 | + if (res.data.code == 200) { | |
| 133 | + this.remakeData(); | |
| 134 | + this.dataObj = res.data.data; | |
| 135 | + } else { | |
| 136 | + this.$toast.fail(res.data.message); | |
| 137 | + } | |
| 138 | + }); | |
| 139 | + }, | |
| 140 | + //完成 | |
| 141 | + toEnd() { | |
| 142 | + this.yxAxios | |
| 143 | + .get( | |
| 144 | + `${ | |
| 145 | + this.kqUrl | |
| 146 | + }/item/finish?travelerNum=${localStorage.getItem( | |
| 147 | + "travelerNum" | |
| 148 | + )}&categoryId=${this.categoryId}` | |
| 149 | + ) | |
| 150 | + .then((res) => { | |
| 151 | + if (res.data.code == 200) { | |
| 152 | + this.$dialog.alert({ | |
| 153 | + title: "完成答题", | |
| 154 | + message: "您的分数是:" + res.data.data, | |
| 155 | + theme: "round-button", | |
| 156 | + }).then(() => { | |
| 157 | + this.$router.push({ | |
| 158 | + name: 'stars' | |
| 159 | + }) | |
| 160 | + }); | |
| 161 | + } else { | |
| 162 | + this.$toast.fail(res.data.message); | |
| 163 | + } | |
| 164 | + }); | |
| 165 | + }, | |
| 166 | + //重置数据 | |
| 167 | + remakeData() { | |
| 168 | + this.rightData = { | |
| 169 | + rightAnswer: "", | |
| 170 | + remark: "", | |
| 171 | + isShow: false, | |
| 172 | + }; | |
| 173 | + (this.contentJsonArray = []), //选项 | |
| 174 | + (this.checkIndex = ""); | |
| 175 | + this.dataObj = this.$options.data().dataObj; | |
| 176 | + }, | |
| 177 | + }, | |
| 178 | + mounted() { | |
| 179 | + this.categoryId = this.$route.query.categoryId; | |
| 180 | + this.toBank(); | |
| 34 | 181 | }, |
| 35 | 182 | }; |
| 36 | 183 | </script> |
| ... | ... | @@ -102,7 +249,7 @@ export default { |
| 102 | 249 | bottom: 5vw; |
| 103 | 250 | width: 70vw; |
| 104 | 251 | height: 100px; |
| 105 | - background-color: #FF3636; | |
| 252 | + background-color: #ff3636; | |
| 106 | 253 | font-size: 4.4vw; |
| 107 | 254 | margin: 30vw 0 10vw; |
| 108 | 255 | color: #fff; |
| ... | ... | @@ -112,5 +259,8 @@ export default { |
| 112 | 259 | border-radius: 10vw; |
| 113 | 260 | letter-spacing: 10px; |
| 114 | 261 | } |
| 262 | + .blue { | |
| 263 | + background-color: #409eff; | |
| 264 | + } | |
| 115 | 265 | } |
| 116 | 266 | </style> |
| 117 | 267 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,130 @@ |
| 1 | +{ | |
| 2 | + "nickName": null, | |
| 3 | + "travelerName": "夏洋涛", | |
| 4 | + "phone": "17858500169", | |
| 5 | + "centerNo": "2022031508525674030748540013076", | |
| 6 | + "idCard": "330881199606054935", | |
| 7 | + "thirdSource": 1, | |
| 8 | + "unionId": "oJPmPuLaAx2x2DaRGfCFeYuLWzLU", | |
| 9 | + "userState": null, | |
| 10 | + "userType": 2, | |
| 11 | + "gender": 1, | |
| 12 | + "isMember": 2, | |
| 13 | + "subUsers": [{ | |
| 14 | + "id": 49238, | |
| 15 | + "travelerName": "xia", | |
| 16 | + "travelerIdCard": "330881199606054935", | |
| 17 | + "travelerNum": "2022042515320607668704830046683", | |
| 18 | + "travelerMobile": "17858500169", | |
| 19 | + "travelerType": 0, | |
| 20 | + "enrollYear": "2016", | |
| 21 | + "age": null, | |
| 22 | + "gender": 1, | |
| 23 | + "channelCode": null, | |
| 24 | + "unionId": null, | |
| 25 | + "province": "浙江省", | |
| 26 | + "city": "温州市", | |
| 27 | + "area": "瓯海区", | |
| 28 | + "schoolName": "温州市第二十一中学", | |
| 29 | + "gradeName": "1班", | |
| 30 | + "className": "1班", | |
| 31 | + "whiteFlag": 1, | |
| 32 | + "studyCode": null, | |
| 33 | + "userState": 1, | |
| 34 | + "userType": 1, | |
| 35 | + "memberId": null, | |
| 36 | + "bingMobile": "17858500169", | |
| 37 | + "isBing": 1, | |
| 38 | + "ssoId": null, | |
| 39 | + "sex": null, | |
| 40 | + "pass": null, | |
| 41 | + "syncTime": "2022-04-25T15:32:06.250+08:00", | |
| 42 | + "updateTime": "2022-04-28T11:09:57.667+08:00" | |
| 43 | + }, { | |
| 44 | + "id": 52229, | |
| 45 | + "travelerName": "林淡", | |
| 46 | + "travelerIdCard": "331081198803306735", | |
| 47 | + "travelerNum": "2022050615163709304353550045179", | |
| 48 | + "travelerMobile": "15168313607", | |
| 49 | + "travelerType": null, | |
| 50 | + "enrollYear": null, | |
| 51 | + "age": null, | |
| 52 | + "gender": 1, | |
| 53 | + "channelCode": null, | |
| 54 | + "unionId": null, | |
| 55 | + "province": null, | |
| 56 | + "city": null, | |
| 57 | + "area": null, | |
| 58 | + "schoolName": null, | |
| 59 | + "gradeName": null, | |
| 60 | + "className": null, | |
| 61 | + "whiteFlag": null, | |
| 62 | + "studyCode": null, | |
| 63 | + "userState": 1, | |
| 64 | + "userType": 2, | |
| 65 | + "memberId": null, | |
| 66 | + "bingMobile": "13989547857,17858500169", | |
| 67 | + "isBing": 1, | |
| 68 | + "ssoId": null, | |
| 69 | + "sex": null, | |
| 70 | + "pass": null, | |
| 71 | + "syncTime": "2022-05-06T15:16:37.933+08:00", | |
| 72 | + "updateTime": "2022-05-06T15:23:51.297+08:00" | |
| 73 | + }, { | |
| 74 | + "id": 52230, | |
| 75 | + "travelerName": "林珈逸", | |
| 76 | + "travelerIdCard": "330602201507040021", | |
| 77 | + "travelerNum": "2022050615244927688271930045180", | |
| 78 | + "travelerMobile": "15168313607", | |
| 79 | + "travelerType": 1, | |
| 80 | + "enrollYear": "2021", | |
| 81 | + "age": null, | |
| 82 | + "gender": 2, | |
| 83 | + "channelCode": null, | |
| 84 | + "unionId": null, | |
| 85 | + "province": "浙江省", | |
| 86 | + "city": "绍兴市", | |
| 87 | + "area": "越城区", | |
| 88 | + "schoolName": "绍兴市塔山中心小学", | |
| 89 | + "gradeName": "3班", | |
| 90 | + "className": "3班", | |
| 91 | + "whiteFlag": null, | |
| 92 | + "studyCode": null, | |
| 93 | + "userState": 1, | |
| 94 | + "userType": 1, | |
| 95 | + "memberId": null, | |
| 96 | + "bingMobile": "17858500169,13989547857", | |
| 97 | + "isBing": 1, | |
| 98 | + "ssoId": null, | |
| 99 | + "sex": null, | |
| 100 | + "pass": null, | |
| 101 | + "syncTime": "2022-05-06T15:24:49.563+08:00", | |
| 102 | + "updateTime": "2022-07-09T12:20:29.790+08:00" | |
| 103 | + }], | |
| 104 | + "schoolNames": [{ | |
| 105 | + "schoolId": 7, | |
| 106 | + "schoolName": "绍兴市塔山中心小学", | |
| 107 | + "province": null, | |
| 108 | + "city": null, | |
| 109 | + "area": null | |
| 110 | + }, { | |
| 111 | + "schoolId": 4804, | |
| 112 | + "schoolName": "绍兴市建功中学", | |
| 113 | + "province": null, | |
| 114 | + "city": null, | |
| 115 | + "area": null | |
| 116 | + }, { | |
| 117 | + "schoolId": 355, | |
| 118 | + "schoolName": "绍兴蕺山外国语学校", | |
| 119 | + "province": null, | |
| 120 | + "city": null, | |
| 121 | + "area": null | |
| 122 | + }, { | |
| 123 | + "schoolId": 188, | |
| 124 | + "schoolName": "温州市第二十一中学", | |
| 125 | + "province": null, | |
| 126 | + "city": null, | |
| 127 | + "area": null | |
| 128 | + }], | |
| 129 | + "auth": false | |
| 130 | +} | |
| 0 | 131 | \ No newline at end of file | ... | ... |
src/views/answerRank/rank.vue
src/views/answerRank/stars.vue
| ... | ... | @@ -7,21 +7,23 @@ |
| 7 | 7 | <img src="@/assets/rank/tx.png" /> |
| 8 | 8 | </div> |
| 9 | 9 | <div class="font_box"> |
| 10 | - <div class="font_name">熊初墨</div> | |
| 11 | - <div class="font_sch">柯桥实验小学元培学院</div> | |
| 10 | + <div class="font_name" @click="getUser"> | |
| 11 | + {{ user.travelerName }} | |
| 12 | + </div> | |
| 13 | + <div class="font_sch">{{ user.schoolName }}</div> | |
| 12 | 14 | </div> |
| 13 | 15 | </div> |
| 14 | 16 | <div class="L_mid"> |
| 15 | 17 | <div class="mid_item"> |
| 16 | 18 | <div> |
| 17 | - <span class="strong_font">23</span> | |
| 19 | + <span class="strong_font">xx</span> | |
| 18 | 20 | <span>分</span> |
| 19 | 21 | </div> |
| 20 | 22 | <div class="grey_font">已完成题数</div> |
| 21 | 23 | </div> |
| 22 | 24 | <div class="mid_item"> |
| 23 | 25 | <div> |
| 24 | - <span class="strong_font">50</span> | |
| 26 | + <span class="strong_font">xx</span> | |
| 25 | 27 | <span>%</span> |
| 26 | 28 | </div> |
| 27 | 29 | <div class="grey_font">正确率</div> |
| ... | ... | @@ -59,14 +61,19 @@ |
| 59 | 61 | |
| 60 | 62 | <div class="flexBox" v-for="(v, i) in libraryList" :key="i"> |
| 61 | 63 | <div class="tipPic"> |
| 62 | - <img :src="v.imgUrl" /> | |
| 64 | + <!-- <img :src="v.imgUrl" /> --> | |
| 65 | + <img v-if="v.type == 1" src="@/assets/rank/qt.png" /> | |
| 66 | + <img v-if="v.type == 2" src="@/assets/rank/hj.png" /> | |
| 67 | + <img v-if="v.type == 3" src="@/assets/rank/bj.png" /> | |
| 63 | 68 | </div> |
| 64 | 69 | <div class="context"> |
| 65 | - <div class="context_title">{{ v.name }}</div> | |
| 66 | - <div class="context_grey">{{ v.text }}</div> | |
| 70 | + <div class="context_title" v-if="v.type == 1">青铜级</div> | |
| 71 | + <div class="context_title" v-if="v.type == 2">黄金级</div> | |
| 72 | + <div class="context_title" v-if="v.type == 3">白金级</div> | |
| 73 | + <div class="context_grey">{{ v.remark }}</div> | |
| 67 | 74 | </div> |
| 68 | 75 | <div class="btnBox"> |
| 69 | - <div class="btn" @click="toAns(i + 1)">开始答题</div> | |
| 76 | + <div class="btn" @click="toAns(v)">开始答题</div> | |
| 70 | 77 | </div> |
| 71 | 78 | </div> |
| 72 | 79 | </div> |
| ... | ... | @@ -78,30 +85,75 @@ export default { |
| 78 | 85 | data() { |
| 79 | 86 | return { |
| 80 | 87 | libraryList: [ |
| 81 | - { | |
| 82 | - name: "青铜级", | |
| 83 | - text: "夯实基础,稳步前进", | |
| 84 | - imgUrl: require("@/assets/rank/qt.png"), | |
| 85 | - }, | |
| 86 | - { | |
| 87 | - name: "黄金级", | |
| 88 | - text: "夯实基础,稳步前进", | |
| 89 | - imgUrl: require("@/assets/rank/hj.png"), | |
| 90 | - }, | |
| 91 | - { | |
| 92 | - name: "白金级", | |
| 93 | - text: "夯实基础,稳步前进", | |
| 94 | - imgUrl: require("@/assets/rank/bj.png"), | |
| 95 | - }, | |
| 88 | + // { | |
| 89 | + // name: "青铜级", | |
| 90 | + // text: "夯实基础,稳步前进", | |
| 91 | + // imgUrl: require("@/assets/rank/qt.png"), | |
| 92 | + // }, | |
| 93 | + // { | |
| 94 | + // name: "黄金级", | |
| 95 | + // text: "夯实基础,稳步前进", | |
| 96 | + // imgUrl: require("@/assets/rank/hj.png"), | |
| 97 | + // }, | |
| 98 | + // { | |
| 99 | + // name: "白金级", | |
| 100 | + // text: "夯实基础,稳步前进", | |
| 101 | + // imgUrl: require("@/assets/rank/bj.png"), | |
| 102 | + // }, | |
| 96 | 103 | ], |
| 104 | + userInfo: {}, | |
| 105 | + user: { | |
| 106 | + travelerName: "", | |
| 107 | + travelerNum: 0, | |
| 108 | + schoolName: "", | |
| 109 | + }, | |
| 97 | 110 | }; |
| 98 | 111 | }, |
| 99 | 112 | methods: { |
| 113 | + //获取用户信息 | |
| 114 | + getUser() { | |
| 115 | + this.userInfo = JSON.parse(localStorage.getItem("userInfo")); | |
| 116 | + console.log(this.userInfo); | |
| 117 | + if (!this.userInfo.subUsers || this.userInfo.subUsers.length == 0) { | |
| 118 | + return this.$toast.fail("暂无绑定出行人"); | |
| 119 | + } | |
| 120 | + localStorage.setItem( | |
| 121 | + "travelerNum", | |
| 122 | + this.userInfo.subUsers[0].travelerNum | |
| 123 | + ); | |
| 124 | + | |
| 125 | + this.user = { | |
| 126 | + travelerNum: this.userInfo.subUsers[0].travelerNum, | |
| 127 | + travelerName: this.userInfo.subUsers[0].travelerName, | |
| 128 | + schoolName: this.userInfo.subUsers[0].schoolName, | |
| 129 | + }; | |
| 130 | + }, | |
| 131 | + //开始答题 | |
| 100 | 132 | toAns(val) { |
| 101 | 133 | this.$router.push({ |
| 102 | 134 | name: "ans_question", |
| 135 | + query: {categoryId:val.itemCategoryId} | |
| 103 | 136 | }); |
| 104 | 137 | }, |
| 138 | + //获取类型 | |
| 139 | + getType() { | |
| 140 | + this.yxAxios | |
| 141 | + .get( | |
| 142 | + `${this.kqUrl}/item/getItemCategory?travelerNum=` + | |
| 143 | + localStorage.getItem("travelerNum") | |
| 144 | + ) | |
| 145 | + .then((res) => { | |
| 146 | + if (res.data.code == 200) { | |
| 147 | + this.libraryList = res.data.data | |
| 148 | + } else { | |
| 149 | + this.$toast.fail(res.data.message); | |
| 150 | + } | |
| 151 | + }); | |
| 152 | + }, | |
| 153 | + }, | |
| 154 | + mounted() { | |
| 155 | + this.getUser(); | |
| 156 | + this.getType(); | |
| 105 | 157 | }, |
| 106 | 158 | }; |
| 107 | 159 | </script> |
| ... | ... | @@ -262,6 +314,7 @@ export default { |
| 262 | 314 | border-bottom: 1px solid #f1f1f1; |
| 263 | 315 | |
| 264 | 316 | .tipPic { |
| 317 | + width: 15vw; | |
| 265 | 318 | img { |
| 266 | 319 | width: 16vw; |
| 267 | 320 | height: 16vw; | ... | ... |