pull/24/head
脆皮鸭 1 year ago
parent d88f92a893
commit 135bcc71ee
  1. 10
      src/pages.json
  2. 33
      src/pages/index/components/Subject1.vue
  3. 71
      src/pages/index/components/Subject2.vue
  4. 6
      src/pages/index/videoVip.vue
  5. 10
      src/pages/me/info.vue
  6. 217
      src/pages/me/uploadPic.vue
  7. 22
      src/pages/me/vip.vue
  8. 23
      src/pages/questionBank/baseOperate.vue
  9. 10
      src/pages/questionBank/components/Question.vue
  10. 21
      src/pages/questionBank/exclusiveExercise.vue
  11. BIN
      src/static/image/index/danxuan.png
  12. BIN
      src/static/image/index/panduan.png
  13. BIN
      src/static/image/index/tupian.png

@ -144,8 +144,14 @@
"navigationBarTitleText": "真实考场模拟",
"enablePullDownRefresh": false
}
}
},
{
"path": "pages/me/uploadPic",
"style": {
"navigationBarTitleText": "上传证件照",
"enablePullDownRefresh": false
}
}
],
"globalStyle": {

@ -1,7 +1,7 @@
<template>
<view>
<view class="box-nav">
<image style="width: 100%;" src="../../static/image/index/index_bg.jpg"></image>
<image style="width: 100%;" src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E9%A6%96%E9%A1%B5_20230830213855.png"></image>
<view class="center-box flex jc-sb ai-c">
<view class="box-item flex ai-c jc-c">
<view class="flex jc-c ai-c relative" style="width: 230rpx;height: 230rpx;" @tap="toAnswer('顺序答题',false)">
@ -27,7 +27,7 @@
</view>
</view>
</view>
<view style="padding: 0 28rpx;margin-top: 60rpx;">
<view style="padding: 0 28rpx;margin-top: calc(100% - 718rpx);">
<view class="tabs-box">
<view class="wp33 flex ai-c jc-c" @tap="toVip">
<view class="text-center wp100">
@ -102,6 +102,7 @@
<script>
import { mapState,mapActions } from 'pinia' //
import useUserStore from '@/jtools/store/user'
import storage from '@/jtools/storage';
import useQuestionStore from '@/jtools/store/question' //store
export default {
@ -125,16 +126,35 @@
},
computed: {
...mapState(useUserStore, ["vipOnList", "token"]),
...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject4"]) ,//tagslist
getDoNum(){
return this.rightList.length+this.wrongList.length
}
},
methods: {
toTestRoom(){
uni.navigateTo({
url:"/pages/index/trueTest"
})
...mapActions(useUserStore, ['searchUserVip']),
async toTestRoom(){
// uni.navigateTo({
// url:"/pages/index/trueTest"
// })
if (this.token) {
await this.searchUserVip()
const res = this.vipOnList.some(item => item.subjects == this.subject)
if (!res) {
uni.navigateTo({
url:"/pages/index/videoVip?subject="+this.subject
})
}else{
uni.navigateTo({
url: "/pages/index/trueTest?subject="+this.subject
})
}
} else {
uni.redirectTo({
url: '/pages/login/login'
});
}
},
toVip(){
// if(storage.get('token')){
@ -197,6 +217,7 @@
.box-nav {
width: 100%;
position: relative;
height: 500rpx;
}
.center-box {

@ -1,10 +1,10 @@
<template>
<view>
<view class="box-nav">
<image style="width: 100%;" src="../../../static/image/index/index_bg.jpg"></image>
<view style="width: 100%;position: absolute;top: 80px;left: 0;" class="flex jc-c">
<image style="width: 100%;" src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E9%A6%96%E9%A1%B5_20230830213855.png"></image>
<view style="width: 100%;position: absolute;top: 80px;left: 0;" class="flex jc-c" @tap="toVipVideo">
<image style="width: 694rpx" mode="widthFix"
:src="subject=='2'?'../../../static/image/index/subject2_bg.png':'../../../static/image/index/subject3_bg.png'">
:src="subject=='2'?'https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E7%A7%91%E4%BA%8C%E9%A6%96%E9%A1%B5banner_20230830214212.png':'https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E7%A7%91%E4%B8%89%E9%A6%96%E9%A1%B5banner_20230830214245.png'">
</image>
</view>
</view>
@ -28,10 +28,13 @@
<swiper class="swiper" :current="videoIndex" style="height: 362rpx;" :autoplay="false"
:disable-programmatic-animation="true" @change="onChange">
<swiper-item v-for="(item,index) of operateList" :key="index" @tap="toVideo">
<view class="wp100 relative p5lr" style="height: 362rpx;border-radius: 16rpx;overflow: hidden;">
<image style="width: 100%;height: 362rpx;border-radius: 16rpx;" mode="widthFix"
:src="item.videoList[0].videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image>
<image class="play_btn_2" src="../../static/image/index/play.png" />
<view class="p5lr wp100">
<view class="wp100 relative hide"
style="height: 362rpx;border-radius: 16rpx;overflow: hidden;">
<image style="width: 100%;height: 362rpx;position: absolute;left: 0;top: 0;" mode="widthFix"
:src="item.videoList[0].videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image>
<image class="play_btn_2" src="../../static/image/index/play.png" />
</view>
</view>
</swiper-item>
</swiper>
@ -44,7 +47,7 @@
<u-icon color="#666" name="arrow-right" size="18"></u-icon>
</view>
</view>
<view class="flex p14lr p20tb bc-fff mt10" style="border-bottom: 1rpx solid #DDDCDC;"
<view class="flex p14lr p20tb bc-fff" style="border-bottom: 1rpx solid #DDDCDC;"
v-for="(item,index) of videoList" :key="index" @click="toOperateDetail(item.videoId)">
<view class="pic relative" style="overflow: hidden;">
<image class="pic" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image>
@ -61,6 +64,11 @@
</template>
<script>
import {
mapState,
mapActions
} from 'pinia' //
import useUserStore from '@/jtools/store/user'
import {
querySysConfigList,
queryProjectList
@ -88,7 +96,31 @@
async mounted() {
await this.getDiverType()
},
computed: {
...mapState(useUserStore, ["vipOnList", "token"])
},
methods: {
...mapActions(useUserStore, ['searchUserVip']),
//vip
async toVipVideo(){
if (this.token) {
await this.searchUserVip()
const res = this.vipOnList.some(item => item.subjects == this.subject)
if (!res) {
uni.navigateTo({
url:"/pages/index/videoVip?subject="+this.subject
})
}else{
uni.navigateTo({
url: "/pages/questionBank/baseOperate?subject=" + this.subject+"&type=3"
})
}
} else {
uni.redirectTo({
url: '/pages/login/login'
});
}
},
onChange(e) {
this.videoIndex = e.detail.current
this.$nextTick(() => {
@ -105,7 +137,7 @@
}).then(resp => {
if (resp.code === '0000') {
this.baseList = resp.data
this.videoList = resp.data[0].videoList.slice(0, 5)
this.videoList = resp.data[0] ? resp.data[0].videoList.slice(0, 5) : []
}
})
},
@ -123,7 +155,7 @@
return {
...item,
videoUrl: item.videoList[0]?.videoUrl,
videoTime:this.formateTime(item.videoList[0]?.videoTime)
videoTime: this.formateTime(item.videoList[0]?.videoTime)
}
})
let jsonString = JSON.stringify(arr)
@ -132,14 +164,14 @@
"&projectId=" + this.projectId + "&type=1"
})
},
toOperateDetail(val){
toOperateDetail(val) {
let arr = JSON.parse(JSON.stringify(this.baseList[0].videoList))
arr = arr.map(item => {
return {
...item,
projectId:item.videoId,
subDesc:this.baseList[0].description,
videoTime:this.formateTime(item.videoTime)
projectId: item.videoId,
subDesc: this.baseList[0].description,
videoTime: this.formateTime(item.videoTime)
}
})
let jsonString = JSON.stringify(arr)
@ -181,7 +213,7 @@
},
toDetail() {
uni.navigateTo({
url: "/pages/questionBank/baseOperate?subject=" + this.subject
url: "/pages/questionBank/baseOperate?subject=" + this.subject+"&type=2"
})
}
}
@ -227,7 +259,7 @@
width: 300rpx;
height: 169rpx;
background: #00B74F;
border-radius: 8rpx;
border-radius: 10rpx;
}
.play_btn_3 {
@ -262,4 +294,11 @@
display: inline-block;
margin-right: 15px;
}
.hide {
backface-visibility: hidden;
transform: translate3d(0, 0, 0);
-webkit-backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
}
</style>

@ -1,9 +1,9 @@
<template>
<view class="relative" style="height: 100vh;">
<image style="width: 100%;height: 600rpx;" src="../../static/image/index/vip_bg.jpg"></image>
<image style="width: 100%;height: 600rpx;" src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/vip%E9%A1%B5%E8%83%8C%E6%99%AF%E5%9B%BE_20230830214136.png"></image>
<view class="p14">
<view class="flex jc-fa ai-c wp100">
<view class="option_tem relative mr15" :class="checkedId===item.memberId?'checked_item':''" v-for="(item,index) of priceList" :key="index" @click="checkPrice(item.memberId,item.price)">
<view class="flex jc-sb ai-c wp100">
<view class="option_tem relative" :class="checkedId===item.memberId?'checked_item':''" v-for="(item,index) of priceList" :key="index" @click="checkPrice(item.memberId,item.price)">
<text class="fw600 fs12 cor-333">{{item.memberName}}</text>
<view class="mt5">
<text class="fs14" style="color: #FF6E02;">¥</text>

@ -11,6 +11,10 @@
<view class="m30lr fs14 cor-333 fl1">安徽省合肥市包河区</view>
<u-icon name="arrow-right" color="#999" />
</view>
<view class="flex ai-c wp100" style="height: 110rpx;" @tap="toUpload">
<view class="fs14 cor-666 fl1">证件照上传</view>
<u-icon name="arrow-right" color="#999" />
</view>
</view>
</view>
</template>
@ -23,7 +27,11 @@
}
},
methods: {
toUpload(){
uni.navigateTo({
url:"/pages/me/uploadPic"
})
}
}
}
</script>

@ -0,0 +1,217 @@
<template>
<view class="">
<view class="wp100 bc-fff p14">
<view class="title fontColor">第一步 上传学员图像</view>
<view class="mt15">
<!-- <u-upload width="165" height="165" :file-list=" fileList1" multiple :max-count="1" @afterRead="afterRead" @delete="deletePic" /> -->
<!-- <u-upload ref="uUpload" class="mt25" :size-type="['compressed']" :file-list="fileList1" deletable :multiple="false" :max-count="1" width="165rpx" height="165rpx" @afterRead="afterRead" @delete="deletePic" /> -->
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="1" width="150"
height="150">
<view style="width: 320rpx;height:300rpx;background-color: rgb(247, 255, 255);border-radius: 20rpx;">
<view style="width: 320rpx;height:240rpx;" class="flex jc-c ai-c">
<image v-if="fileList1&&fileList1.length" style="width: 240rpx;height: 240rpx;" :src="fileList1[0].url">
</image>
<u-avatar v-else class="br-p50 overflow-h" :size="64" mp-avatar shape="circle"></u-avatar>
</view>
<view
style="width: 320rpx;height:60rpx;line-height:60rpx;background-color: #3C9CFF;border-radius: 0 0 20rpx 20rpx;"
class="text-center cor-fff">
点击
</view>
</view>
</u-upload>
</view>
<view class="mt20">
<view class="title fontColor">第二步 核实后再提交</view>
<u--form labelPosition="left" labelWidth="80" :model="form" :rules="rules" ref="form1">
<u-form-item label="姓名" :required="true" prop="name" borderBottom ref="item1">
<u--input v-model="form.name" border="none"></u--input>
</u-form-item>
<u-form-item label="身份证号" :required="true" prop="idNum" borderBottom ref="item2">
<u--input v-model="form.idNum" border="none"></u--input>
</u-form-item>
</u--form>
</view>
<view style="margin-top: 20px;">
<u-button type="primary" :style="{width: '100%',borderRadius:'40rpx'}" :disabled="saving" text="提交"
@click="submit" />
</view>
</view>
</view>
</template>
<script>
import storage from '@/jtools/storage';
export default {
data() {
const shenfenzhen = (rule, value, callback) => {
/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value) ? callback() : callback(
new Error('请输入正确的身份证号'))
}
return {
form: {
name: '',
idNum: ''
},
fileList1: [],
uploadList: [],
saving: false,
rules: {
name: [{
required: true,
message: '请输入姓名',
trigger: ['blur', 'change']
}],
idNum: [{
required: true,
message: '请输入身份证号',
trigger: ['blur', 'change']
},{
//
validator: shenfenzhen,
message: '身份证号码不正确',
// blurchange
trigger: ['change', 'blur'],
}]
}
};
},
onReady() {
console.log(storage.get('photoForm'));
if(storage.get('photoForm')){
this.fileList1=storage.get('photoForm').file
this.form={
name: storage.get('photoForm').name,
idNum: storage.get('photoForm').idNum
}
}
this.$refs.form1.setRules(this.rules);
},
methods: {
//
deletePic(event) {
this.fileList1.splice(event.index, 1);
this.uploadList.splice(event.index, 1);
},
//
async afterRead(event) {
// this.compressImage(event.file);
// multiple true , file
const lists = [].concat(event.file);
this.fileList1 = lists;
uni.showToast({
title:'上传成功!'
})
},
uploadFilePromise(url) {
this.saving = true;
return new Promise((resolve, reject) => {
uni.uploadFile({
url: process.env.VUE_APP_BASE_API + 'mongodb/uploadFile', //
filePath: url,
name: 'file',
success: (res) => {
// setTimeout(() => {
resolve(JSON.parse(res.data).data);
// }, 100);
this.saving = false;
},
fail: () => {
resolve(null);
this.saving = false;
}
});
});
},
//
submit() {
this.$refs.form1.validate().then((valid) => {
if (valid) {
const param={
file:this.fileList1,
...this.form
}
storage.set('photoForm',param)
uni.showToast({
title:"提交成功!",
duration:2000,
})
setTimeout(()=>{
uni.navigateBack()
},1000)
} else {
console.log('验证失败');
}
});
},
async compressImage(image) {
const img = new Image();
img.src = image.url;
img.onload = async () => {
const canvas = document.createElement('canvas'); // Canvas()
const context = canvas.getContext('2d');
//
const cw = img.width;
const ch = img.height;
let w = img.width;
let h = img.height;
canvas.width = w;
canvas.height = h;
if (cw > 400 && cw > ch) {
w = 400;
h = (400 * ch) / cw;
canvas.width = w;
canvas.height = h;
}
if (ch > 400 && ch > cw) {
h = 400;
w = (400 * cw) / ch;
canvas.width = w;
canvas.height = h;
}
// canvas
let base64;
//
context.clearRect(0, 0, 0, w, h);
context.drawImage(img, 0, 0, w, h);
if (image.size > 2000000) {
// 2m,
base64 = canvas.toDataURL(image['type'], 0.5);
}
const result = await this.uploadFilePromise(base64 || image.url);
this.uploadList.push(result);
};
}
}
};
</script>
<style lang="scss" scoped>
.upload-img {
width: 165rpx;
height: 165rpx;
border: 1px dashed #c4c4c4;
display: flex;
justify-content: center;
align-items: center;
}
.fontColor {
color: #383838;
font-weight: 400;
}
::v-deep .u-textarea__count {
background-color: #f9faf9 !important;
}
::v-deep .u-upload__button>.u-icon>.u-icon__icon {
font-size: 90rpx !important;
}
::v-deep .u-button--square {
border-radius: 40rpx !important;
}
</style>

@ -28,10 +28,10 @@
<view v-if="vipHasOpened(item)" class="corner">
VIP已开通
</view>
<view v-if="vipHasOpened(item)" class="renew">
<view v-if="vipHasOpened(item)" @tap="chargeVip(item)" class="renew">
{{ item.price }}元立即续费
</view>
<view v-else class="buy">
<view v-else class="buy" @tap="chargeVip(item)">
立即充值
</view>
</view>
@ -141,6 +141,11 @@ export default {
}
},
methods: {
chargeVip(item){
uni.navigateTo({
url:"/pages/index/videoVip?subject="+item.subjects
})
},
onChange(e) {
this.current = e.detail.current
},
@ -168,6 +173,9 @@ export default {
// vip
if (this.vipHasOpened(item)) {
//
uni.navigateTo({
url:"/pages/questionBank/questionBank?navTitle=精简500题&subject="+item.subjects+"&needVip=true&isVip=1"
})
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,
@ -180,6 +188,9 @@ export default {
// vip
if (this.vipHasOpened(item)) {
//
uni.navigateTo({
url: "/pages/index/trueTest?subject="+item.subjects
})
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,
@ -192,6 +203,9 @@ export default {
// vip
if (this.vipHasOpened(item)) {
//
uni.navigateTo({
url:"/pages/questionBank/practiceExams?subject="+item.subjects+'&title=考前密卷&isExam1=1'
})
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,
@ -204,6 +218,10 @@ export default {
// vip
if (this.vipHasOpened(item)) {
//
uni.showToast({
title:'敬请期待',
icon:'none'
})
} else {
uni.showToast({
title: `请先充值${this.getKmTitle(item.subjects)}vip`,

@ -8,7 +8,7 @@
<!-- <view class="flex ai-c">
<view class="car_item mr10" v-for="(item,index) of carTypeList" :key="index" @tap="chooseCar(item.value)" :class="item.value===tCar?'checked_car':'unchecked_car'">{{item.label}}</view>
</view> -->
<view class="flex p14lr p20tb bc-fff mt10" style="border-bottom: 1rpx solid #DDDCDC;;"
<view class="flex p14lr p20tb bc-fff mb10" style="border-radius: 10rpx;"
v-for="(item,index) of videoList" :key="index" @tap="toOperateDetail(item.videoId)">
<view class="pic relative" style="overflow: hidden;">
<image class="pic" mode="widthFix" :src="item.videoUrl+'?x-oss-process=video/snapshot,t_0,f_jpg'"></image>
@ -32,6 +32,7 @@
export default {
data(){
return{
type:'2',
subject:'1',
tCar:0,
categoryList:[{
@ -40,22 +41,18 @@
name:'自动挡C2'
}],
allVideoList:[],
videoList:[{
label:"111"
},{
label:'222'
},{
label:'333'
},{
label:'444'
}]
videoList:[]
}
},
onLoad(op){
if(op.subject){
this.subject=op.subject
this.getDiverType()
}
if(op.type){
this.type=op.type
}
console.log(this.type);
this.getDiverType()
},
methods:{
formateTime(time) {
@ -87,7 +84,7 @@
"carTypeId": storage.get('carType') || '1001',
"subject": String(this.subject),
"driveType": this.categoryList[this.tCar].configItemCode,
"type": "2"
"type": this.type
}).then(resp => {
if(resp.code==='0000'){
this.videoList=resp.data[0]?resp.data[0].videoList:[]
@ -150,7 +147,7 @@
width: 300rpx;
height: 169rpx;
background: #00B74F;
border-radius: 8rpx;
border-radius: 10rpx;
}
.play_btn_2 {
width: 65rpx;

@ -84,7 +84,7 @@
<view style="width: 220rpx;">
<view v-if="type==='practice'" style="width: 220rpx;height: 80rpx;"></view>
<view v-else-if="type=='exam'" class="btn" style="text-align: center;" @tap="submitPaper">
<u-count-down ref="countDown_1" :time=" 1*60*60 * 1000" format="HH:mm:ss" @change="timeChange"></u-count-down>
<u-count-down ref="countDown_1" :time=" timeCount" format="HH:mm:ss" @change="timeChange"></u-count-down>
<text>交卷</text>
</view>
</view>
@ -135,7 +135,7 @@
<view class="cor-333">未答题数</view>
</view>
<view class="text-center">
<u-count-down ref="countDown_3" class="balckColor" :time="1*60*60 * 1000" format="HH:mm:ss"></u-count-down>
<u-count-down ref="countDown_3" class="balckColor" :time="timeCount" format="HH:mm:ss"></u-count-down>
<view>剩余时间</view>
</view>
<view class="text-center">
@ -164,7 +164,7 @@
<view style="width: 220rpx;">
<view v-if="type==='practice'" style="width: 220rpx;height: 80rpx;"></view>
<view v-else-if="type=='exam'" class="btn" style="text-align: center;" @tap="submitPaper">
<u-count-down ref="countDown_2" :time="1 * 60 * 60 * 1000" format="HH:mm:ss"></u-count-down>
<u-count-down ref="countDown_2" :time="timeCount" format="HH:mm:ss"></u-count-down>
<text>交卷</text>
</view>
</view>
@ -308,6 +308,10 @@ export default {
}else{
return false
}
},
timeCount() {
const time=this.subject == '1' ? 60 * 60 * 1000 : 45 * 60 * 1000
return time
}
},
methods: {

@ -44,6 +44,9 @@
import errorIcon from "../../static/image/practice/error_icon.png"
import newRulesIcon from "../../static/image/practice/newRules_icon.png"
import neverWriteIcon from "../../static/image/practice/neverWrite_icon.png"
import danxuanIcon from "../../static/image/index/danxuan.png"
import panduanIcon from "../../static/image/index/panduan.png"
import tupianIcon from "../../static/image/index/tupian.png"
import {
querySysConfigList,
querySpecialNum
@ -72,19 +75,19 @@
subTitle:'392题',
isNew:0,
isError:0,
image:newRulesIcon
image:danxuanIcon
},{
title:'判断题',
subTitle:'392题',
isNew:0,
isError:0,
image:errorIcon
image:panduanIcon
},{
title:'图片题',
subTitle:'392题',
isNew:0,
isError:0,
image:neverWriteIcon
image:tupianIcon
}],
testCenterList:[],
subject:'1'
@ -122,19 +125,19 @@
subTitle:resp.data.radioQuestionNum+'题',
isNew:0,
isError:0,
image:newRulesIcon
image:danxuanIcon
},{
title:'判断题',
subTitle:resp.data.judgeQuestionNum+'题',
isNew:0,
isError:0,
image:errorIcon
image:panduanIcon
},{
title:'图片题',
subTitle:resp.data.imageQuestionNum+'题',
isNew:0,
isError:0,
image:neverWriteIcon
image:tupianIcon
}]
}else{
this.list=[{
@ -154,7 +157,7 @@
subTitle:resp.data.radioQuestionNum+'题',
isNew:0,
isError:0,
image:newRulesIcon
image:danxuanIcon
},{
title:'多选题',
subTitle:resp.data.multipleChoiceQuestionNum+'题',
@ -166,13 +169,13 @@
subTitle:resp.data.judgeQuestionNum+'题',
isNew:0,
isError:0,
image:errorIcon
image:panduanIcon
},{
title:'图片题',
subTitle:resp.data.imageQuestionNum+'题',
isNew:0,
isError:0,
image:neverWriteIcon
image:tupianIcon
}]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Loading…
Cancel
Save