|
@@ -5,8 +5,8 @@
|
|
|
<view class="ddflex" style="flex-direction: column;">
|
|
<view class="ddflex" style="flex-direction: column;">
|
|
|
<view class="register ddflex">
|
|
<view class="register ddflex">
|
|
|
<view class="re-con-pic">
|
|
<view class="re-con-pic">
|
|
|
- <view class="re-con-pic-title">在线考试系统</view>
|
|
|
|
|
- <image src="/static/images/loginBg.png"></image>
|
|
|
|
|
|
|
+ <!-- <view class="re-con-pic-title">在线考试系统</view> -->
|
|
|
|
|
+ <image src="/static/images/loginBg1.png"></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="re-con">
|
|
<view class="re-con">
|
|
|
<view class="re-tit">考生登录</view>
|
|
<view class="re-tit">考生登录</view>
|
|
@@ -15,7 +15,7 @@
|
|
|
<input v-model="testNumber" type="number" placeholder="准考证号" maxlength="11" placeholder-class="placeholder" class="re-ipt flex" />
|
|
<input v-model="testNumber" type="number" placeholder="准考证号" maxlength="11" placeholder-class="placeholder" class="re-ipt flex" />
|
|
|
</view>
|
|
</view>
|
|
|
<uni-data-select
|
|
<uni-data-select
|
|
|
- v-model="password"
|
|
|
|
|
|
|
+ v-model="testProject"
|
|
|
:localdata="range"
|
|
:localdata="range"
|
|
|
@change="changeTestPro"
|
|
@change="changeTestPro"
|
|
|
placeholder="考试项目"
|
|
placeholder="考试项目"
|
|
@@ -25,7 +25,7 @@
|
|
|
<view class="yzm-box" @click="refresh()"><canvas :style="{ width: width + 'px', height: height + 'px' }" canvas-id="imgcanvas"></canvas></view>
|
|
<view class="yzm-box" @click="refresh()"><canvas :style="{ width: width + 'px', height: height + 'px' }" canvas-id="imgcanvas"></canvas></view>
|
|
|
</view> -->
|
|
</view> -->
|
|
|
<view class="re-btn" @click="okLogin()">登录</view>
|
|
<view class="re-btn" @click="okLogin()">登录</view>
|
|
|
- <view class="re-btn-text">考生成绩查询</view>
|
|
|
|
|
|
|
+ <view class="re-btn-text" @click="jumpUrl('/pages/scoreQuery/scoreQuery')">考生成绩查询</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="bottom-content ddflex">
|
|
<view class="bottom-content ddflex">
|
|
@@ -36,17 +36,9 @@
|
|
|
<view>考试公告</view>
|
|
<view>考试公告</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view>
|
|
<view>
|
|
|
- <view class="note-item ddflex">
|
|
|
|
|
- <view class="note-item-content">2022年“技能+学历”双证教育班培训简章2022年“技能+学历”双证教育班培训简章2022年“技能+学历”双证教育班培训简章</view>
|
|
|
|
|
- <view class="note-item-date">2022-08-25</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="note-item ddflex">
|
|
|
|
|
- <view class="note-item-content">2022年“技能+学历”双证教育班培训简章</view>
|
|
|
|
|
- <view class="note-item-date">2022-08-25</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="note-item ddflex">
|
|
|
|
|
- <view class="note-item-content">2022年“技能+学历”双证教育班培训简章</view>
|
|
|
|
|
- <view class="note-item-date">2022-08-25</view>
|
|
|
|
|
|
|
+ <view class="note-item ddflex" v-for="item,index in otherInfo" :key="index" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
|
|
|
|
|
+ <view class="note-item-content">{{item.title}}</view>
|
|
|
|
|
+ <view class="note-item-date">{{dateFormat(item.creatDate)}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -57,13 +49,9 @@
|
|
|
<view>注意事项</view>
|
|
<view>注意事项</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view>
|
|
<view>
|
|
|
- <view class="note-item ddflex">
|
|
|
|
|
- <view class="note-item-content">2022年“技能+学历”双证教育班培训简章2022年“技能+学历”双证教育班培训简章2022年“技能+学历”双证教育班培训简章</view>
|
|
|
|
|
- <view class="note-item-date">2022-08-25</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="note-item ddflex">
|
|
|
|
|
- <view class="note-item-content">2022年“技能+学历”双证教育班培训简章</view>
|
|
|
|
|
- <view class="note-item-date">2022-08-25</view>
|
|
|
|
|
|
|
+ <view class="note-item ddflex" v-for="item,index in noteInfo" :key="index+'zy'" @click="jumpUrl('/pages/contentDetail/contentDetail?id='+item.id)">
|
|
|
|
|
+ <view class="note-item-content">{{item.title}}</view>
|
|
|
|
|
+ <view class="note-item-date">{{dateFormat(item.creatDate)}}</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -84,63 +72,77 @@ export default {
|
|
|
width: 115,
|
|
width: 115,
|
|
|
height: 36,
|
|
height: 36,
|
|
|
testNumber: '',
|
|
testNumber: '',
|
|
|
- password: '',
|
|
|
|
|
|
|
+ testProject:'',
|
|
|
code: '',
|
|
code: '',
|
|
|
isCheckArg: true,
|
|
isCheckArg: true,
|
|
|
- range:[
|
|
|
|
|
- { value: 0, text: "考试项目1" },
|
|
|
|
|
- { value: 1, text: "考试项目2" },
|
|
|
|
|
- { value: 2, text: "考试项目3" }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ range:[],
|
|
|
|
|
+ otherInfo:[],//考试公告
|
|
|
|
|
+ noteInfo:[],//注意事项
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad() {
|
|
onLoad() {
|
|
|
var tha = this;
|
|
var tha = this;
|
|
|
|
|
+ this.getTestProject()
|
|
|
|
|
+ this.getTextOtherInfo()
|
|
|
|
|
+ this.getTextNoteInfo()
|
|
|
setTimeout(function() {
|
|
setTimeout(function() {
|
|
|
tha.initCode();
|
|
tha.initCode();
|
|
|
}, 200);
|
|
}, 200);
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- changeEnv() {
|
|
|
|
|
- // this.isCheckArg = !this.isCheckArg;
|
|
|
|
|
|
|
+ jumpUrl(url){
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url:url
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
// 考试下拉框
|
|
// 考试下拉框
|
|
|
changeTestPro(e){
|
|
changeTestPro(e){
|
|
|
console.log("e:", e);
|
|
console.log("e:", e);
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+ // 获取考试项目
|
|
|
|
|
+ getTestProject(){
|
|
|
|
|
+ console.log('11')
|
|
|
|
|
+ req.getRequest('https://mock.apifox.cn/m1/2171629-0-default/api/test/project',{},res=>{
|
|
|
|
|
+ console.log('this.range',res)
|
|
|
|
|
+ this.range = res.map(item=>{return {text:item.title,value:item.id}})
|
|
|
|
|
+ console.log(this.range)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 考试公告
|
|
|
|
|
+ getTextOtherInfo(){
|
|
|
|
|
+ req.getRequest('https://mock.apifox.cn/m1/2171629-0-default/api/ksgg',{},res=>{
|
|
|
|
|
+ this.otherInfo = res
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 考试公告
|
|
|
|
|
+ getTextNoteInfo(){
|
|
|
|
|
+ req.getRequest('https://mock.apifox.cn/m1/2171629-0-default/api/ksgg',{type:2},res=>{
|
|
|
|
|
+ this.noteInfo = res
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
okLogin() {
|
|
okLogin() {
|
|
|
- uni.reLaunch({
|
|
|
|
|
- url: '/pages/test/test'
|
|
|
|
|
- });
|
|
|
|
|
- return false
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
if (!this.testNumber) {
|
|
if (!this.testNumber) {
|
|
|
return req.msg('请输入准考证号');
|
|
return req.msg('请输入准考证号');
|
|
|
}
|
|
}
|
|
|
- if (!this.password) {
|
|
|
|
|
- return req.msg('请输入密码');
|
|
|
|
|
- }
|
|
|
|
|
- if (!this.code) {
|
|
|
|
|
- return req.msg('请输入验证码');
|
|
|
|
|
- }
|
|
|
|
|
- var imgCode = uni.getStorageSync('imgcode');
|
|
|
|
|
- if (this.code.toUpperCase() != imgCode.toUpperCase()) {
|
|
|
|
|
- req.msg('请输入正确的验证码');
|
|
|
|
|
- this.initCode();
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ if (!this.testProject) {
|
|
|
|
|
+ return req.msg('请选择考试项目');
|
|
|
}
|
|
}
|
|
|
var formP = {
|
|
var formP = {
|
|
|
- account: this.mobile,
|
|
|
|
|
- password: this.password
|
|
|
|
|
|
|
+ testNumber: this.testNumber,
|
|
|
|
|
+ testProject: this.testProject
|
|
|
};
|
|
};
|
|
|
|
|
+ uni.reLaunch({
|
|
|
|
|
+ url: '/pages/test/test'
|
|
|
|
|
+ });
|
|
|
|
|
+ return false
|
|
|
req.postRequest('/api/v3/hy/account/pwdLogin', formP, data => {
|
|
req.postRequest('/api/v3/hy/account/pwdLogin', formP, data => {
|
|
|
this.getUserInfo();
|
|
this.getUserInfo();
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+ // 时间格式化
|
|
|
|
|
+ dateFormat(date){
|
|
|
|
|
+ return req.dateFormat(date).v5
|
|
|
|
|
+ },
|
|
|
getUserInfo() {
|
|
getUserInfo() {
|
|
|
req.getRequest(
|
|
req.getRequest(
|
|
|
'/api/v3/hy/account/userInfo',
|
|
'/api/v3/hy/account/userInfo',
|
|
@@ -161,93 +163,7 @@ export default {
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- initCode() {
|
|
|
|
|
- console.log('start');
|
|
|
|
|
- var context = uni.createCanvasContext('imgcanvas', this),
|
|
|
|
|
- w = this.width,
|
|
|
|
|
- h = this.height;
|
|
|
|
|
- context.setFillStyle('white');
|
|
|
|
|
- context.setLineWidth(5);
|
|
|
|
|
- context.fillRect(0, 0, w, h);
|
|
|
|
|
- var pool = [
|
|
|
|
|
- 'A',
|
|
|
|
|
- 'B',
|
|
|
|
|
- 'C',
|
|
|
|
|
- 'D',
|
|
|
|
|
- 'E',
|
|
|
|
|
- 'F',
|
|
|
|
|
- 'G',
|
|
|
|
|
- 'H',
|
|
|
|
|
- 'I',
|
|
|
|
|
- 'J',
|
|
|
|
|
- 'K',
|
|
|
|
|
- 'L',
|
|
|
|
|
- 'I',
|
|
|
|
|
- 'M',
|
|
|
|
|
- 'N',
|
|
|
|
|
- 'O',
|
|
|
|
|
- 'P',
|
|
|
|
|
- 'Q',
|
|
|
|
|
- 'R',
|
|
|
|
|
- 'S',
|
|
|
|
|
- 'T',
|
|
|
|
|
- 'U',
|
|
|
|
|
- 'V',
|
|
|
|
|
- 'W',
|
|
|
|
|
- 'S',
|
|
|
|
|
- 'Y',
|
|
|
|
|
- 'Z',
|
|
|
|
|
- '1',
|
|
|
|
|
- '2',
|
|
|
|
|
- '3',
|
|
|
|
|
- '4',
|
|
|
|
|
- '5',
|
|
|
|
|
- '6',
|
|
|
|
|
- '7',
|
|
|
|
|
- '8',
|
|
|
|
|
- '9',
|
|
|
|
|
- '0'
|
|
|
|
|
- ],
|
|
|
|
|
- str = '';
|
|
|
|
|
- for (var i = 0; i < 4; i++) {
|
|
|
|
|
- var c = pool[this.rn(0, pool.length - 1)]; //随机的字
|
|
|
|
|
- var deg = this.rn(-30, 30); //字体的旋转角度
|
|
|
|
|
- context.setFontSize(18);
|
|
|
|
|
- context.setTextBaseline('top');
|
|
|
|
|
- context.setFillStyle(this.rc(80, 150));
|
|
|
|
|
- context.save();
|
|
|
|
|
- context.translate(30 * i + 15, parseInt(h / 1.5));
|
|
|
|
|
- context.rotate((deg * Math.PI) / 180);
|
|
|
|
|
- context.fillText(c, -15 + 5, -15);
|
|
|
|
|
- context.restore();
|
|
|
|
|
- str += c;
|
|
|
|
|
- }
|
|
|
|
|
- uni.setStorage({
|
|
|
|
|
- key: 'imgcode',
|
|
|
|
|
- data: str
|
|
|
|
|
- });
|
|
|
|
|
- for (var i = 0; i < 40; i++) {
|
|
|
|
|
- context.beginPath();
|
|
|
|
|
- context.arc(this.rn(0, w), this.rn(0, h), 1, 0, 2 * Math.PI);
|
|
|
|
|
- context.closePath();
|
|
|
|
|
- context.setFillStyle(this.rc(150, 200));
|
|
|
|
|
- context.fill();
|
|
|
|
|
- }
|
|
|
|
|
- context.draw();
|
|
|
|
|
- console.log('end');
|
|
|
|
|
- },
|
|
|
|
|
- rc(min, max) {
|
|
|
|
|
- var r = this.rn(min, max);
|
|
|
|
|
- var g = this.rn(min, max);
|
|
|
|
|
- var b = this.rn(min, max);
|
|
|
|
|
- return 'rgb(' + r + ',' + g + ',' + b + ')';
|
|
|
|
|
- },
|
|
|
|
|
- rn(max, min) {
|
|
|
|
|
- return parseInt(Math.random() * (max - min)) + min;
|
|
|
|
|
- },
|
|
|
|
|
- refresh() {
|
|
|
|
|
- this.initCode();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|