8 files modified
2 files deleted
| | |
| | | let queTypeArr = [] |
| | | |
| | | quesModules.forEach((item, index) => { |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | let quesType = item.choicesType |
| | | |
| | | |
| | | // 是否答题了 |
| | | item.selectedFlag = false |
| | | // 答题的结果 |
| | |
| | | // 题目是否做对 |
| | | item.correctOrError = false |
| | | |
| | | |
| | | queTypeArr.push(quesType) |
| | | |
| | | item.template = item.choicesType |
| | | |
| | | if (item.template == 1) { |
| | | if (item.choicesType == 1 || item.choicesType == 3) { |
| | | item.dualChooseArr = [] |
| | | } |
| | | |
| | | |
| | | item.options = item.examSubjectOptions |
| | | |
| | | if (item.template == 2) { |
| | | item.rightAnswer = item.answer |
| | | } |
| | | |
| | | if (item.template == 0 || item.template == 1) { |
| | | item.options.forEach(it => { |
| | | it.newOptLetter = it.optionName |
| | | it.optContent = it.optionContent |
| | | it.optLetter = it.newOptLetter |
| | | }) |
| | | if (item.choicesType == 0 || item.choicesType == 1 || item.choicesType == 3) { |
| | | item.options.reverse() |
| | | } |
| | | |
| | | |
| | | |
| | | questionList.push(item) |
| | | |
| | | }) |
| | |
| | | |
| | | store.state.questionList = questionList |
| | | |
| | | } |
| | | |
| | | export const topicOptions = (options) => { |
| | | |
| | | var questionList = store.state.questionList |
| | | |
| | | questionList.forEach((item, index) => { |
| | | |
| | | }) |
| | | |
| | | store.state.questionList = questionList |
| | | |
| | | // for (let j = 0; j < quesModules[i].examSubjectOptions.length; j++) { |
| | | // // 解决theoryExamAnswer可能为null的问题,把它赋值为字符串 |
| | | // quesModules[i].examSubjectOptions[j].tempAnswer = "" //暂存每题的答案 |
| | | // quesModules[i].examSubjectOptions[j].template = quesModules[i].choicesType //防止template初始值是null |
| | | // quesModules[i].examSubjectOptions[j].recordId = store.state.examDetail |
| | | // .id //搬移recordId的位置 |
| | | // quesModules[i].examSubjectOptions[j].blankArr = [] //新建blankArr属性,临时保存填空题答案 |
| | | // quesModules[i].examSubjectOptions[j].dualChooseArr = [] //新建blankArr属性,临时保存填空题答案 |
| | | // questionList.push(quesModules[i].examSubjectOptions[j]) |
| | | // } |
| | | } |
| | |
| | | paper 模拟考试 知识点练习 --> |
| | | <view class="container"> |
| | | <!-- 大标题 --> |
| | | |
| | | <u-navbar class="header" id="header" height="44" back-icon-color="#fff" title="模拟考试" title-color="#fff" |
| | | :background="{background: '#103289'}" :custom-back="exitExam"> |
| | | <u-button class="slot-wrap-right" type="primary" size="mini" @click="handleSubmit(1)">交卷 |
| | | </u-button> |
| | | </u-navbar> |
| | | |
| | | |
| | | <!-- 小标题栏 --> |
| | | <view id="subHeader"> |
| | | <view id="subHeader" :style="{'margin-top': subHeaderTop}"> |
| | | <view class="sub-header" v-if='questionList.length > 0'> |
| | | <u-tag class="typeTag" :text="answerStatusName" mode="dark" shape="circle" /> |
| | | <view v-if="examDetail.exam.examTime<=0">不限时</view> |
| | |
| | | </template> |
| | | </view> |
| | | |
| | | <!-- type == 3 实操题 --> |
| | | <view class="content-solutions" v-if='item.choicesType == 3'> |
| | | <view style="color: #103289;"> |
| | | 您选择的顺序为:<text style="text-decoration: underline;">{{item.tempAnswer}}</text> |
| | | </view> |
| | | <template v-for='subItem in item.options'> |
| | | <view class="content-solutions-item" |
| | | @click='!item.selectedFlag && chooseMutiSolution(item,subItem)'> |
| | | <view class="content-solutions-item-single"> |
| | | {{subItem.optionName}} |
| | | </view> |
| | | |
| | | <view |
| | | :class="item.tempAnswer.indexOf(subItem.optionName) > -1 ? 'content-solutions-item-select' : ''" |
| | | class="content-solutions-item-content">{{subItem.optionContent}}</view> |
| | | </view> |
| | | </template> |
| | | <u-button v-show="!item.selectedFlag" type="primary" shape="circle" |
| | | :custom-style="{backgroundColor: '#103289'}" @click="pictureConfirm(item)">确认答案 |
| | | </u-button> |
| | | </view> |
| | | |
| | | <view class="explain" v-if="item.selectedFlag"> |
| | | <view> |
| | | <view style="display: flex; justify-content: flex-start; align-items: center;"> |
| | |
| | | <view class="footer-right" @click='handleChangeCurrentSwiper(1)'>下一题</view> |
| | | </view> |
| | | |
| | | |
| | | <!-- 答题卡弹出层 --> |
| | | <modal v-model="showQuestion"> |
| | | <view class='question-modal' :style="{'height': modalHeight}"> |
| | |
| | | <template v-for="(item, index) in questionList"> |
| | | <view v-show="item.choicesType == subItem.value"> |
| | | <!-- 未作答 --> |
| | | <view v-if="item.tempAnswer == ''" |
| | | <view v-if="!item.selectedFlag" |
| | | class="question-modal-body-item question-modal-body-item-unselect" |
| | | @click="handleJumpSwiper(index)"> |
| | | {{index + 1 }} |
| | | </view> |
| | | <!-- 回答正确 --> |
| | | <view v-else-if='item.tempAnswer == item.answer' |
| | | <view v-else-if='item.selectedFlag && item.tempAnswer == item.answer' |
| | | class="question-modal-body-item question-modal-body-item-right" |
| | | @click="handleJumpSwiper(index)">{{index + 1 }}</view> |
| | | <!-- 回答错误 --> |
| | | <view v-else-if='item.tempAnswer != item.answer' |
| | | <view v-else-if='item.selectedFlag && item.tempAnswer != item.answer' |
| | | class="question-modal-body-item question-modal-body-item-failed" |
| | | @click="handleJumpSwiper(index)">{{index + 1 }}</view> |
| | | </view> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | subHeaderTop: 0, |
| | | isreadOnly: true, |
| | | quesModules: [], |
| | | judgeArr: [{ |
| | |
| | | be: false, |
| | | }, |
| | | { |
| | | name: '填空题', |
| | | value: '4', |
| | | name: '实操题', |
| | | value: '3', |
| | | be: false, |
| | | }, |
| | | { |
| | |
| | | case 2: |
| | | // 判断题 |
| | | break; |
| | | case 3: |
| | | // 实操题 |
| | | break; |
| | | |
| | | default: |
| | | } |
| | |
| | | case 2: |
| | | return '判断题' |
| | | break; |
| | | case 4: |
| | | return '填空题' |
| | | case 3: |
| | | return '实操题' |
| | | break; |
| | | case 5: |
| | | return '简答题' |
| | |
| | | uni.getSystemInfo({ |
| | | //获取手机屏幕高度信息,让swiper的高度和手机屏幕一样高 |
| | | success: function(res) { |
| | | tempHeight = res.windowHeight; |
| | | tempHeight = res.windowHeight - res.statusBarHeight; |
| | | |
| | | that.subHeaderTop = res.statusBarHeight + 'px' |
| | | |
| | | that.modalHeight = res.windowHeight - uni.upx2px(200) + 'px'; |
| | | |
| | | that.modalContentHeight = res.windowHeight - uni.upx2px(360) + 'px'; |
| | |
| | | }, |
| | | // 多选题中的答案确认 |
| | | confirm(item) { |
| | | if (item.tempAnswer == "") |
| | | return this.$refs.uToast.show({ |
| | | title: '答案不能为空,请选择', |
| | | type: 'warning', |
| | | duration: 2000 |
| | | }) |
| | | |
| | | |
| | | |
| | | let one = item.answer.split(',') |
| | | let two = item.tempAnswer.split(',') |
| | | let flag = true |
| | | if (one.length == two.length) { |
| | | |
| | | one.forEach((item) => { |
| | | if (two.indexOf(item) == -1) { |
| | | flag = false |
| | |
| | | flag = false |
| | | } |
| | | |
| | | |
| | | item.selectedFlag = true |
| | | |
| | | if (flag != false) item.correctOrError = true |
| | | |
| | | this.$forceUpdate() |
| | | |
| | | if (this.currentIndex < this.max) { |
| | | setTimeout(() => { |
| | | this.currentIndex += 1 |
| | | }, 300) |
| | | } |
| | | }, |
| | | // 实操题中的答案确认 |
| | | pictureConfirm(item) { |
| | | if (item.tempAnswer == "") { |
| | | this.$refs.uToast.show({ |
| | | title: '答案不能为空,请选择', |
| | | type: 'warning', |
| | | duration: 2000 |
| | | }) |
| | | |
| | | return |
| | | } |
| | | |
| | | let one = item.answer.split(',') |
| | | let two = item.tempAnswer.split(',') |
| | | let flag = true |
| | | if (one.length == two.length) { |
| | | one.forEach((item, index) => { |
| | | if (item != two[index]) { |
| | | flag = false |
| | | return |
| | | } |
| | | }) |
| | | } else { |
| | | flag = false |
| | | } |
| | | |
| | | item.selectedFlag = true |
| | | |
| | |
| | | font-size: 32rpx; |
| | | font-weight: bold; |
| | | background-color: #FFFFFF; |
| | | box-shadow: 0 0 5px 1px #eee; |
| | | } |
| | | |
| | | .footer { |
| | |
| | | <template> |
| | | <view class="container"> |
| | | <u-empty text="功能研发中" mode="favor" margin-top="400"></u-empty> |
| | | <view class="head"> |
| | | <u-navbar :is-fixed="false" :border-bottom="false" :is-back="true" back-icon-name="arrow-leftward" |
| | | back-icon-color="#fff" back-icon-size="35" :background="{ background: '#103289' }" title="工作台" |
| | | title-color="#fff"></u-navbar> |
| | | <view class="head-bg"></view> |
| | | <!-- 我的订阅 start --> |
| | | <view class="card sub"> |
| | | <view class="title">常用工具</view> |
| | | <view class="list"> |
| | | <u-grid :col="4" :border="false"> |
| | | <u-grid-item bg-color="transparent" v-for="(item, index) in dataOne" :key="index"> |
| | | <navigator hover-class="none" class="nav-item" @click="goOnePage(item.url,index)"> |
| | | <image :src="item.img" mode="widthFix" class="nav-item-img"></image> |
| | | <view class="nav-item-name">{{item.title}}</view> |
| | | </navigator> |
| | | </u-grid-item> |
| | | </u-grid> |
| | | </view> |
| | | </view> |
| | | <!-- 我的订阅 end --> |
| | | |
| | | <view class="card wrap"> |
| | | <view class="title">管理</view> |
| | | <view class="list"> |
| | | <u-grid :col="4" :border="false"> |
| | | <u-grid-item bg-color="transparent" v-for="(item, index) in dataTwo" :key="index"> |
| | | <navigator hover-class="none" url="" class="nav-item" @click="goTwoPage(item.url,index)"> |
| | | <image :src="item.img" mode="widthFix" class="nav-item-img"></image> |
| | | <view class="nav-item-name">{{item.title}}</view> |
| | | </navigator> |
| | | </u-grid-item> |
| | | </u-grid> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | <u-toast ref="uToast" /> |
| | | <!-- 底部导航条 --> |
| | | <u-tabbar :list="tabbar" :mid-button="false"></u-tabbar> |
| | | </view> |
| | |
| | | data() { |
| | | return { |
| | | tabbar: this.$store.state.tabbar, |
| | | dataOne: [{ |
| | | title: '群防任务', |
| | | img: '../../static/workbench/task1.png', |
| | | url: '' |
| | | }, { |
| | | title: '巡逻任务', |
| | | img: '../../static/workbench/task2.png', |
| | | url: '/pages/patrol/patrol' |
| | | }, { |
| | | title: '事件上报', |
| | | img: '../../static/workbench/task3.png', |
| | | url: '/pages/reported/reported' |
| | | }, { |
| | | title: '积分商城', |
| | | img: '../../static/workbench/task8.png', |
| | | url: '' |
| | | }, { |
| | | title: '通讯录', |
| | | img: '../../static/workbench/task4.png', |
| | | url: '' |
| | | }, { |
| | | title: '电子证件', |
| | | img: '../../static/workbench/task9.png', |
| | | url: '' |
| | | }], |
| | | dataTwo: [{ |
| | | title: '参与投票', |
| | | img: '../../static/workbench/task5.png', |
| | | url: '/pages/voting/voteManage' |
| | | }, { |
| | | title: '投票发起', |
| | | img: '../../static/workbench/task7.png', |
| | | url: '/pages/voting/vote' |
| | | }, { |
| | | title: '投票排行', |
| | | img: '../../static/workbench/task6.png', |
| | | url: '/pages/voting/votRanking' |
| | | } |
| | | // ,{ |
| | | // title:'模拟考试', |
| | | // img:'../../static/workbench/exam.png', |
| | | // url:'/pages/exam/startexam' |
| | | // } |
| | | ] |
| | | }; |
| | | }, |
| | | onLoad() { |
| | | |
| | | if (this.$store.state.billFlag) this.dataTwo.push({ |
| | | title: '模拟考试', |
| | | img: '../../static/workbench/exam.png', |
| | | url: '/pages/exam/startexam' |
| | | }) |
| | | }, |
| | | mounted() { |
| | | |
| | | if (this.$store.state.UserData.stype != "1") { |
| | | this.$refs.uToast.show({ |
| | | title: '功能暂未开放', |
| | | type: 'warning', |
| | | }); |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | //页面跳转 |
| | | goOnePage(url, index) { |
| | | if (this.$store.state.UserData.stype != "1") { |
| | | this.$refs.uToast.show({ |
| | | title: '功能暂未开放', |
| | | type: 'warning', |
| | | }); |
| | | return; |
| | | } else if (index == "0" || index == "3" || index == "4") { |
| | | this.$refs.uToast.show({ |
| | | title: '功能研发中', |
| | | type: 'warning', |
| | | }); |
| | | return; |
| | | } else if (index == 5) { |
| | | this.getUser(); |
| | | } else { |
| | | uni.navigateTo({ |
| | | url: url |
| | | }) |
| | | } |
| | | }, |
| | | //获取用户信息 |
| | | getUser() { |
| | | var that = this; |
| | | debugger |
| | | uni.request({ |
| | | url: that.$store.state.BaopiAPI + '/blade-user/detail', |
| | | method: 'GET', |
| | | data: { |
| | | cardid: that.$store.state.UserData.cardid, |
| | | isDeleted: 0, |
| | | status: 1, |
| | | }, |
| | | success: (res) => { |
| | | if (res.statusCode == "200") { |
| | | var urls = "http://223.82.109.183:2080/securityInfo.html?securityNumber=" + res |
| | | .data.data.securitynumber; |
| | | uni.navigateTo({ |
| | | url: '../voting/information?url=' + urls |
| | | }); |
| | | } else { |
| | | this.$refs.uToast.show({ |
| | | title: '暂无证件信息', |
| | | type: 'warning', |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | goTwoPage(url, index) { |
| | | if (url == '/pages/exam/startexam') uni.navigateTo({ |
| | | url: url |
| | | }) |
| | | if (this.$store.state.UserData.stype != "1") { |
| | | this.$refs.uToast.show({ |
| | | title: '功能暂未开放', |
| | | type: 'warning', |
| | | }); |
| | | return; |
| | | } else if (index == "2") { |
| | | this.$refs.uToast.show({ |
| | | title: '功能研发中', |
| | | type: 'warning', |
| | | }); |
| | | return; |
| | | } else { |
| | | uni.navigateTo({ |
| | | url: url |
| | | }) |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .container { |
| | | background-color: #f7f7f7; |
| | | min-height: 100vh; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .head { |
| | | position: relative; |
| | | top: 0; |
| | | left: 0; |
| | | z-index: 1; |
| | | } |
| | | |
| | | .head-bg { |
| | | position: absolute; |
| | | left: 0px; |
| | | top: 0px; |
| | | z-index: -1; |
| | | width: 750rpx; |
| | | height: 270rpx; |
| | | background: #103289; |
| | | } |
| | | |
| | | .card { |
| | | margin: 30rpx; |
| | | background: #ffffff; |
| | | border-radius: 20rpx; |
| | | margin-top: 36rpx; |
| | | } |
| | | |
| | | .sub { |
| | | .title { |
| | | padding-top: 36rpx; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | |
| | | font-size: 30rpx; |
| | | font-family: Source Han Sans CN; |
| | | font-weight: 500; |
| | | color: #000000; |
| | | |
| | | &::before { |
| | | content: ''; |
| | | display: block; |
| | | width: 135rpx; |
| | | height: 1rpx; |
| | | background: #e4e7ed; |
| | | margin: 0 17rpx; |
| | | } |
| | | |
| | | &::after { |
| | | content: ''; |
| | | display: block; |
| | | width: 135rpx; |
| | | height: 1rpx; |
| | | background: #e4e7ed; |
| | | margin: 0 17rpx; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .list { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | padding: 0 0 30rpx; |
| | | |
| | | .nav-item { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | font-size: 30rpx; |
| | | font-family: Source Han Sans CN; |
| | | font-weight: 400; |
| | | color: #131313; |
| | | line-height: 48rpx; |
| | | |
| | | &-img { |
| | | width: 64rpx; |
| | | height: 64rpx; |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | &-name { |
| | | font-size: 26rpx; |
| | | font-family: PingFang SC; |
| | | font-weight: 400; |
| | | color: #585b61; |
| | | opacity: 0.77; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .wrap { |
| | | .title { |
| | | padding: 36rpx 16rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | font-size: 32rpx; |
| | | font-family: Source Han Sans CN; |
| | | font-weight: 500; |
| | | color: #000000; |
| | | |
| | | &::before { |
| | | content: ""; |
| | | display: block; |
| | | width: 5rpx; |
| | | height: 36rpx; |
| | | margin-right: 10rpx; |
| | | background: #103289; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <text class="val">{{totalQueNum}}题</text> |
| | | </view> |
| | | <view class="box"> |
| | | <text class="title">总分数:</text> |
| | | <text class="val">{{totalScore}}分</text> |
| | | </view> |
| | | <view class="box"> |
| | | <text class="title">答对:</text> |
| | | <text class="val">{{rightQueNum}}题</text> |
| | | </view> |
| | |
| | | data() { |
| | | return { |
| | | totalQueNum: '', |
| | | totalScore: '', |
| | | rightQueNum: '', |
| | | wrongQueNum: '', |
| | | noneQueNum: '', |
| | | score: '', |
| | | |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | |
| | | }, |
| | | onLoad(options) { |
| | | console.log(options, 77777) |
| | | this.totalQueNum = options.totalQueNum |
| | | this.totalScore = options.totalScore |
| | | this.rightQueNum = options.rightQueNum |
| | | this.wrongQueNum = options.wrongQueNum |
| | | this.noneQueNum = options.noneQueNum |
| | |
| | | |
| | | <script> |
| | | import Answer from '@/components/dyw-answer/answer.vue'; |
| | | import { |
| | | enterExam, |
| | | submitExam |
| | | } from '@/common/api/exam' |
| | | |
| | | import { |
| | | ModifyQuesList |
| | | } from '@/common/api/examFunc' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | |
| | | var that = this |
| | | // 理论考试 |
| | | enterExam({ |
| | | idCardNo: option.id |
| | | }).then(res => { |
| | | var examObj = res.data.data.simulateExamRecord |
| | | uni.request({ |
| | | url: "http://z4042833u6.wicp.vip/simulateExamRecord/beginExam", |
| | | method: 'POST', |
| | | data: { |
| | | idCardNo: option.id |
| | | }, |
| | | success: (res) => { |
| | | var examObj = res.data.data.simulateExamRecord |
| | | |
| | | examObj.exam = { |
| | | name: '模拟考试', |
| | | examScore: 100, |
| | | examTime: res.data.data.simulateExamRecord.answerTime, |
| | | checkFace: 1, |
| | | ...option |
| | | examObj.exam = { |
| | | name: '模拟考试', |
| | | examScore: 100, |
| | | examTime: res.data.data.simulateExamRecord.answerTime, |
| | | checkFace: 1, |
| | | ...option |
| | | } |
| | | |
| | | examObj.exam.totalQuestion = res.data.data.examSubjectInfo.length |
| | | examObj.totalQuestion = res.data.data.examSubjectInfo.length |
| | | that.$store.state.examDetail = examObj |
| | | |
| | | that.$store.state.paperDetail = res.data.data.simulateExamRecord |
| | | // 提取出所有的题目 |
| | | ModifyQuesList(res.data.data.examSubjectInfo) |
| | | } |
| | | |
| | | examObj.exam.totalQuestion = res.data.data.examSubjectInfo.length |
| | | examObj.totalQuestion = res.data.data.examSubjectInfo.length |
| | | that.$store.state.examDetail = examObj |
| | | |
| | | that.$store.state.paperDetail = res.data.data.simulateExamRecord |
| | | // 提取出所有的题目 |
| | | ModifyQuesList(res.data.data.examSubjectInfo) |
| | | }) |
| | | |
| | | }); |
| | | }, |
| | | components: { |
| | | Answer |
| | |
| | | handleConfirm() { |
| | | let that = this |
| | | let totalQueNum = 0 |
| | | let totalScore = 0 |
| | | let rightQueNum = 0 |
| | | let wrongQueNum = 0 |
| | | let noneQueNum = 0 |
| | |
| | | noneQueNum += 1 |
| | | } |
| | | totalQueNum += 1 |
| | | totalScore += item.score |
| | | }) |
| | | |
| | | if (noneQueNum == totalQueNum) |
| | | return this.$refs.uToast.show({ |
| | | title: '请答题后再交卷', |
| | | type: 'warning', |
| | | duration: 2000 |
| | | }) |
| | | |
| | | // 进行交卷的api请求 |
| | | that.$u.route('/pages/exam/examResultPage', { |
| | | recordId: that.$store.state.examDetail.recordId, |
| | | totalQueNum: totalQueNum, |
| | | totalScore: totalScore, |
| | | rightQueNum: rightQueNum, |
| | | wrongQueNum: wrongQueNum, |
| | | noneQueNum: noneQueNum, |
| | | score: score |
| | | }) |
| | | |
| | | submitExam(sendData).then(res => {}) |
| | | |
| | | uni.request({ |
| | | url: "http://z4042833u6.wicp.vip/simulateExamRecord/saveSimulateExam", |
| | | method: 'POST', |
| | | data: sendData, |
| | | success: (res) => { |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | /* 题目答案变化 |
| | | */ |
| | | onChange(answer) { |
| | | } |
| | | onChange(answer) {} |
| | | } |
| | | } |
| | | </script> |
| | |
| | | </ul> |
| | | </view> |
| | | <view class="btnArea"> |
| | | <u-button class="btnClass" type="success" :ripple="true" shape="circle" |
| | | @click="enterExam">进入考试</u-button> |
| | | <u-button class="btnClass" type="error" :ripple="true" shape="circle" @click="exitExam">退出考试</u-button> |
| | | <u-button class="btnClass" type="success" shape="circle" @click="enterExam">进入考试</u-button> |
| | | <u-button class="btnClass" type="error" shape="circle" @click="exitExam">退出考试</u-button> |
| | | </view> |
| | | <u-toast ref="uToast" /> |
| | | </view> |
| | |
| | | }, |
| | | methods: { |
| | | enterExam() { |
| | | // 进入考试 |
| | | this.$u.route('/pages/exam/examTextPage', { |
| | | id: this.examItem.id, |
| | | examType: 'exam', |
| | | |
| | | uni.navigateTo({ |
| | | url: '/pages/exam/examTextPage?examType=exam&id=' + this.examItem.id |
| | | }) |
| | | |
| | | }, |
| | | exitExam() { |
| | | // 退出考试 |
| | |
| | | }) |
| | | } |
| | | }, |
| | | computed: { |
| | | }, |
| | | computed: {}, |
| | | onLoad(options) { |
| | | // 页面跳转 传递对象 传对象 |
| | | options = { |
| | |
| | | padding: 0 40rpx; |
| | | margin-left: -30rpx; |
| | | line-height: 64rpx; |
| | | |
| | | |
| | | } |
| | | |
| | | .subTitle { |
| | |
| | | |
| | | import websocket from "./websocket.js" |
| | | import positions from "./positions.js" |
| | | |
| | | |
| | | const actions = { |
| | | loging(store, data) { |
| | | var user = [{ |
| | | name: '1', |
| | | password: '111111' |
| | | }, |
| | | { |
| | | name: '2', |
| | | password: '222222' |
| | | }, |
| | | { |
| | | name: '3', |
| | | password: '333333' |
| | | }, |
| | | ], |
| | | pasw = md5(data.pass), |
| | | url = this.state.piAPI + '/blade-auth/oauth/token?tenantId=000000&username=' + data.name + |
| | | ' &password=' + pasw + '&grant_type=password&scope=all&type=account'; |
| | | // url ='http://192.168.0.109:82/blade-auth/oauth/token'; |
| | | // url ='http://192.168.0.109:82/blade-auth/oauth/token?tenantId=000000&username=admin&password=93369e86dc5fa854a0eaf75558c4039d&grant_type=password'; |
| | | // url ='http://web.byisf.com/api/blade-auth/oauth/token?tenantId=000000&username=admin&password=93369e86dc5fa854a0eaf75558c4039d&grant_type=password&scope=all'; |
| | | // console.log(url); |
| | | wx.request({ //uniapp 自带axios |
| | | url: url, //仅为示例,并非真实接口地址。 |
| | | // data: d, |
| | | // data: { |
| | | // tenantId: '000000', |
| | | // username: data.name, |
| | | // password: pasw, |
| | | // grant_type: 'password', |
| | | // scope: 'all', |
| | | // type: "account" |
| | | // }, |
| | | header: { |
| | | // "Content-Type":"", |
| | | "Authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0", |
| | | "Tenant-Id": "000000" |
| | | loging (store, data) { |
| | | var user = [{ |
| | | name: '1', |
| | | password: '111111' |
| | | }, |
| | | { |
| | | name: '2', |
| | | password: '222222' |
| | | }, |
| | | { |
| | | name: '3', |
| | | password: '333333' |
| | | }, |
| | | ], |
| | | pasw = md5(data.pass), |
| | | url = this.state.piAPI + '/blade-auth/oauth/token?tenantId=000000&username=' + data.name + |
| | | ' &password=' + pasw + '&grant_type=password&scope=all&type=account' |
| | | // url ='http://192.168.0.109:82/blade-auth/oauth/token'; |
| | | // url ='http://192.168.0.109:82/blade-auth/oauth/token?tenantId=000000&username=admin&password=93369e86dc5fa854a0eaf75558c4039d&grant_type=password'; |
| | | // url ='http://web.byisf.com/api/blade-auth/oauth/token?tenantId=000000&username=admin&password=93369e86dc5fa854a0eaf75558c4039d&grant_type=password&scope=all'; |
| | | // console.log(url); |
| | | wx.request({ //uniapp 自带axios |
| | | url: url, //仅为示例,并非真实接口地址。 |
| | | // data: d, |
| | | // data: { |
| | | // tenantId: '000000', |
| | | // username: data.name, |
| | | // password: pasw, |
| | | // grant_type: 'password', |
| | | // scope: 'all', |
| | | // type: "account" |
| | | // }, |
| | | header: { |
| | | // "Content-Type":"", |
| | | "Authorization": "Basic c2FiZXI6c2FiZXJfc2VjcmV0", |
| | | "Tenant-Id": "000000" |
| | | |
| | | // "Cookie": "JSESSIONID=maOJY05vT2jj4nHwsQGSPgWWVFH1mY-TGWOLYCSh" |
| | | }, |
| | | method: "post", |
| | | // // dataType: 'JSON', |
| | | success: (res) => { |
| | | if (res.statusCode == 200) { |
| | | if (res.data.error_code == "400") { |
| | | uni.hideNavigationBarLoading(); |
| | | uni.showToast({ |
| | | title: '密码错误,请重试', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }); |
| | | return; |
| | | } |
| | | store.commit('getUserData', res.data) |
| | | // console.log(res.data,123542); |
| | | data.isit = true; |
| | | data.userName = res.data.nick_name; //警袁姓名 |
| | | data.userID = res.data.user_id; //警袁id |
| | | data.avatar = res.data.avatar; //头像 |
| | | data.accounts = data.name; |
| | | data.pass = data.pass; |
| | | // data.userPhon = res.user_id; |
| | | store.commit('login', data); |
| | | // "Cookie": "JSESSIONID=maOJY05vT2jj4nHwsQGSPgWWVFH1mY-TGWOLYCSh" |
| | | }, |
| | | method: "post", |
| | | // // dataType: 'JSON', |
| | | success: (res) => { |
| | | if (res.statusCode == 200) { |
| | | if (res.data.error_code == "400") { |
| | | uni.hideNavigationBarLoading() |
| | | uni.showToast({ |
| | | title: '密码错误,请重试', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }) |
| | | return |
| | | } |
| | | store.commit('getUserData', res.data) |
| | | // console.log(res.data,123542); |
| | | data.isit = true |
| | | data.userName = res.data.nick_name //警袁姓名 |
| | | data.userID = res.data.user_id //警袁id |
| | | data.avatar = res.data.avatar //头像 |
| | | data.accounts = data.name |
| | | data.pass = data.pass |
| | | // data.userPhon = res.user_id; |
| | | store.commit('login', data) |
| | | |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log('失去连接 请稍等'); |
| | | // console.log(res); |
| | | } |
| | | }); |
| | | // var time = setTimeout(() => { //模拟请求时间 |
| | | // var ud = user, |
| | | // isit = false; |
| | | // for (var key in ud) { |
| | | // if (ud[key].name == data.name && ud[key].password == data.pass) { |
| | | // isit = true; |
| | | // break; |
| | | // } else { |
| | | // isit = false; |
| | | // } |
| | | // } |
| | | // data.isit = isit; |
| | | // store.commit('login', data); |
| | | // }, 2000) |
| | | wx.request({ |
| | | url: "http://z4042833u6.wicp.vip/userVip/getUserVipInfo?idCardNo=" + res |
| | | .data.cardid, |
| | | method: 'get', |
| | | success: (result) => { |
| | | if (JSON.stringify(result.data.data) != '{}') { |
| | | store.state.billFlag = true |
| | | } |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | ...websocket.actions, |
| | | ...positions.actions |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | console.log('失去连接 请稍等') |
| | | // console.log(res); |
| | | } |
| | | }) |
| | | // var time = setTimeout(() => { //模拟请求时间 |
| | | // var ud = user, |
| | | // isit = false; |
| | | // for (var key in ud) { |
| | | // if (ud[key].name == data.name && ud[key].password == data.pass) { |
| | | // isit = true; |
| | | // break; |
| | | // } else { |
| | | // isit = false; |
| | | // } |
| | | // } |
| | | // data.isit = isit; |
| | | // store.commit('login', data); |
| | | // }, 2000) |
| | | |
| | | }, |
| | | ...websocket.actions, |
| | | ...positions.actions |
| | | } |
| | | |
| | | export default actions |
| | |
| | | examDetail: {}, // 考试详情 |
| | | questionList: [], // 考试考题列表 |
| | | paperDetail: {}, |
| | | billFlag: false, |
| | | queTypeArr:[0,0,0,0,0], |
| | | loging: false, |
| | | message: { |