1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<template>
<view class="content">
<u-navbar
back-icon-color="#FFFFFF"
:background="background"
title-color="#fff"
:border-bottom="false"
></u-navbar>
<view class="title">考试规则</view>
<view class="test">
<view class="slogan">
这是一场严肃的考试,请认真查看 规则,预祝您顺利通过考试!
</view>
<view class="text">
<text class="left">考试科目:</text
><text style="color: #007aff">{{ desc.title }}</text>
</view>
<view class="text">
<text class="left">合格条件:</text><text>{{ desc.score }}</text>
</view>
<view class="text">
<text class="left">考试时间:</text><text>{{ desc.time }}</text>
</view>
<view class="text">
<text class="left">题目来源:</text><text>系统随机{{ desc.number }}题</text>
</view>
<button @click="getUserExamId()">开始考试</button>
</view>
</view>
</template>
<script>
let condition = {
"dev": {
"id-2": {
"score": "60分",
"time": "30分钟",
"number": "20",
"title": "服务规范"
},
"id-3": {
"score": "30分",
"time": "15分钟",
"number": "10",
"title": "服务规范"
},
"id-4": {
"score": "15分",
"time": "6分钟",
"number": "4",
"title": "交付规范"
}
},
"test": {
"id-2": {
"score": "60分",
"time": "30分钟",
"number": "20",
"title": "服务规范"
},
"id-3": {
"score": "30分",
"time": "15分钟",
"number": "10",
"title": "服务规范"
},
"id-4": {
"score": "15分",
"time": "6分钟",
"number": "4",
"title": "交付规范"
}
},
"prod": {
"id-2": {
"score": "60分",
"time": "30分钟",
"number": "20",
"title": "服务规范"
},
"id-3": {
"score": "30分",
"time": "15分钟",
"number": "10",
"title": "服务规范"
},
"id-4": {
"score": "15分",
"time": "6分钟",
"number": "4",
"title": "交付规范"
}
}
};
let env = process.uniEnv.node_env;
let desc = condition[env];
export default {
data() {
return {
desc: null,
examId: null,
exam: null,
userExamId: null,
};
},
onLoad(param) {
this.examId = param.examId
this.desc = desc["id-" + this.examId]
// this.getUserExamInfo();
},
methods: {
//申请考试获取userExamId
getUserExamId: function () {
let examId = this.examId;
wx.navigateTo({
url: "/pages/learn/answer?examId=" + examId,
});
},
getUserExamInfo() {
uni.request({
url:
process.uniEnv.systemUrl.apiUrl +
"/wxh-worker-rest/rest/exam/serviceRule/" +
this.vuex_token +
"?examId=" +
this.examId,
method: "POST",
header: {
"Content-Type": "application/x-www-from-urlencoded",
},
success: (res) => {
console.log("标识符1", res.data);
uni.hideLoading();
if (res.data.code == 200) {
if (res.data.data.userExamId) {
this.userExamId = res.data.data.userExamId;
console.log("这个是个标识符", this.userExamId);
}
}
},
});
setTimeout(() => {
wx.navigateTo({
url: "/pages/learn/answer?userExamId=" + this.userExamId,
});
}, 1000);
},
},
};
</script>
<style>
.content {
width: 750rpx;
height: 100vh;
overflow: auto;
background-color: #f4f5f7;
background-image: linear-gradient(to top, #f4f5f7 0%, #2272ff 50%);
background-size: 750rpx 600rpx;
background-repeat: no-repeat;
}
.title {
padding: 30rpx 30rpx 46rpx;
line-height: 40rpx;
font-size: 40rpx;
color: #fff;
}
.test {
margin: 0 30rpx;
overflow: hidden;
border-radius: 12rpx;
padding-bottom: 60rpx;
background-image: url(../../static/photo/examination.png);
background-repeat: no-repeat;
background-size: 66%;
background-color: #fff;
background-position: right bottom;
min-height: 800rpx;
}
.slogan {
font-size: 40rpx;
font-weight: bold;
color: #333333;
line-height: 20px;
padding: 50rpx 58rpx 46rpx 30rpx;
}
.left {
margin-right: 8rpx;
margin-left: 30rpx;
color: #666666;
font-size: 28rpx;
}
.text {
margin: 30rpx 0;
}
button {
width: 600rpx;
height: 104rpx;
background: #2272ff;
font-size: 32rpx;
font-weight: 600;
color: #ffffff;
margin-top: 237rpx;
border-radius: 26px;
line-height: 104rpx;
}
</style>