Compare commits
3 Commits
bf05f771f7
...
3379a9b18e
| Author | SHA1 | Date | |
|---|---|---|---|
| 3379a9b18e | |||
| 9e871e4079 | |||
| 728fefac03 |
@@ -5,7 +5,6 @@ VITE_APP_TITLE = 金武联驾校
|
||||
VITE_APP_ENV = 'development'
|
||||
|
||||
# 金武联驾校/开发环境
|
||||
VITE_APP_BASE_API = 'https://jwl.ahduima.com/'
|
||||
|
||||
VITE_APP_BASE_API = 'http://118.31.23.45:8888/'
|
||||
#
|
||||
VITE_WEB_BASE_URL = 'https://jwl.ahduima.com'
|
||||
VITE_WEB_BASE_URL = 'http://118.31.23.45:8888'
|
||||
@@ -8,3 +8,20 @@ export function getAliCompanyInfo(data) {
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
|
||||
export function getCarTypeList(data) {
|
||||
return request({
|
||||
url: 'driver-api/tdCar/list',
|
||||
method: 'GET',
|
||||
data,
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
|
||||
export function addInfo(data) {
|
||||
return request({
|
||||
url: 'chaoyuan-api/driver/addInfo',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
}
|
||||
@@ -50,7 +50,14 @@ export function querySysConfigList(carTypeId, configKey) {
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
|
||||
//获取配置
|
||||
export function querySysConfig(carTypeId, configKey) {
|
||||
return request({
|
||||
url: 'driver-api/tdSysConfig/queryConfigByKey?configKey=' + configKey + '&carTypeId=' + carTypeId,
|
||||
method: 'GET',
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
//获取项目列表 (考试项目和基础操作)
|
||||
export function queryProjectList(data) {
|
||||
return request({
|
||||
|
||||
@@ -29,7 +29,7 @@ function service(options = {}) {
|
||||
title: res?.data?.message || '请重新登录',
|
||||
icon: 'none'
|
||||
});
|
||||
useUserStore().logout()
|
||||
useUserStore().logoutWithoutToken()
|
||||
//请求成功
|
||||
resolved(res.data);
|
||||
} else if(res.data.code != '0000'&&res.data.code !='4001') {
|
||||
|
||||
@@ -4,7 +4,8 @@ import {
|
||||
import http from '@/jtools/request/index';
|
||||
import {
|
||||
queryQuestion,
|
||||
getVersion
|
||||
getVersion,
|
||||
querySysConfig
|
||||
} from '@/jtools/api/question';
|
||||
import storage from '@/jtools/storage';
|
||||
|
||||
@@ -12,6 +13,7 @@ const question = defineStore({
|
||||
id: 'question',
|
||||
state: () => ({
|
||||
currentCartype: storage.get('carType') || '1001',
|
||||
currentCarName: storage.get('carName') || '小车C1/C2/C3',
|
||||
orderQuestion_subject1: storage.get('question_subject1') || [], //科目一顺序做题
|
||||
orderQuestion_subject4: storage.get('question_subject4') || [], //科目四顺序做题
|
||||
currentIndex_subject1: 0, //科目一索引 顺序做题
|
||||
@@ -23,18 +25,36 @@ const question = defineStore({
|
||||
}),
|
||||
|
||||
actions: {
|
||||
resetStorage(){
|
||||
this.currentIndex_subject1=0
|
||||
this.currentIndex_subject4=0
|
||||
this.curSubject=0
|
||||
storage.remove('curSubject')
|
||||
storage.remove('wrongList_subject1')
|
||||
storage.remove('wrongList_subject4')
|
||||
storage.remove('rightList_subject1')
|
||||
storage.remove('rightList_subject4')
|
||||
this.getAllQuestion()
|
||||
},
|
||||
getAllQuestion() {
|
||||
this.currentCartype = storage.get('carType') || '1001'
|
||||
getVersion(this.currentCartype).then(resp => {
|
||||
if (resp.code === '0000') {
|
||||
querySysConfig(this.currentCartype, 'QuestionBank').then(res => {
|
||||
const urlList = JSON.parse(res.data.configJson)
|
||||
const urlOne = urlList.find(item => item.subject == '1').url
|
||||
const urlFour = urlList.find(item => item.subject == '4').url
|
||||
if (this.version != resp.data) {
|
||||
this.version = resp.data
|
||||
storage.set('version', resp.data)
|
||||
this.getOrderQuestion_sub1(true)
|
||||
this.getOrderQuestion_sub4(true)
|
||||
this.getOrderQuestion_sub1(true, urlOne)
|
||||
this.getOrderQuestion_sub4(true, urlFour)
|
||||
} else {
|
||||
this.getOrderQuestion_sub1()
|
||||
this.getOrderQuestion_sub4()
|
||||
this.getOrderQuestion_sub1(false, urlOne)
|
||||
this.getOrderQuestion_sub4(false, urlOne)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -53,12 +73,12 @@ const question = defineStore({
|
||||
storage.set('curSubject', val)
|
||||
},
|
||||
// 获取顺序做题科目1
|
||||
getOrderQuestion_sub1(isUpdate) {
|
||||
getOrderQuestion_sub1(isUpdate, url) {
|
||||
if (isUpdate) {
|
||||
this.loading_subject1 = true
|
||||
const that=this
|
||||
const that = this
|
||||
uni.request({
|
||||
url: 'https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E9%A2%98%E5%BA%93/%E5%B0%8F%E8%BD%A6%E7%A7%91%E7%9B%AE%E4%B8%80%E9%A2%98%E5%BA%93.json',
|
||||
url: url,
|
||||
success(resp) {
|
||||
if (resp.data) {
|
||||
that.orderQuestion_subject1 = resp.data.data
|
||||
@@ -99,7 +119,7 @@ const question = defineStore({
|
||||
this.loading_subject1 = true
|
||||
const that = this
|
||||
uni.request({
|
||||
url: 'https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E9%A2%98%E5%BA%93/%E5%B0%8F%E8%BD%A6%E7%A7%91%E7%9B%AE%E4%B8%80%E9%A2%98%E5%BA%93.json',
|
||||
url: url,
|
||||
success(resp) {
|
||||
if (resp.data) {
|
||||
that.orderQuestion_subject1 = resp.data.data
|
||||
@@ -131,12 +151,12 @@ const question = defineStore({
|
||||
}
|
||||
},
|
||||
// 获取顺序做题科目4
|
||||
getOrderQuestion_sub4(isUpdate) {
|
||||
getOrderQuestion_sub4(isUpdate, url) {
|
||||
if (isUpdate) {
|
||||
this.loading_subject4 = true
|
||||
const that = this
|
||||
uni.request({
|
||||
url: 'https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E9%A2%98%E5%BA%93/%E5%B0%8F%E8%BD%A6%E7%A7%91%E7%9B%AE%E5%9B%9B%E9%A2%98%E5%BA%93.json',
|
||||
url: url,
|
||||
success(resp) {
|
||||
if (resp.data) {
|
||||
that.orderQuestion_subject4 = resp.data.data
|
||||
@@ -177,7 +197,7 @@ const question = defineStore({
|
||||
this.loading_subject4 = true
|
||||
const that = this
|
||||
uni.request({
|
||||
url: 'https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E9%A2%98%E5%BA%93/%E5%B0%8F%E8%BD%A6%E7%A7%91%E7%9B%AE%E5%9B%9B%E9%A2%98%E5%BA%93.json',
|
||||
url: url,
|
||||
success(resp) {
|
||||
if (resp.data) {
|
||||
that.orderQuestion_subject4 = resp.data.data
|
||||
|
||||
@@ -43,6 +43,13 @@ const useUserStore = defineStore({
|
||||
resolve();
|
||||
})
|
||||
},
|
||||
//过期登出
|
||||
logoutWithoutToken(force = false) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.resetUserData();
|
||||
resolve();
|
||||
})
|
||||
},
|
||||
// 获取用户信息
|
||||
getUserInfo() {
|
||||
getInfo().then(resp => {
|
||||
@@ -63,6 +70,7 @@ const useUserStore = defineStore({
|
||||
},
|
||||
// 查询当前用户的vip开通情况
|
||||
async searchUserVip() {
|
||||
this.currentCartype=storage.get('carType') || '1001'
|
||||
const resp=await queryVip({ carTypeId: this.currentCartype,memberId: null, subject:'' })
|
||||
if(resp.code == '0000') {
|
||||
this.vipOnList = resp.data
|
||||
@@ -70,6 +78,7 @@ const useUserStore = defineStore({
|
||||
},
|
||||
// 查询所有的vip
|
||||
queryVipList() {
|
||||
this.currentCartype= storage.get('carType') || '1001'
|
||||
getVipList({ carTypeId: this.currentCartype,memberId: null, subject:'' }).then(resp => {
|
||||
if(resp.code == '0000') {
|
||||
this.vipAllList = resp.data
|
||||
|
||||
@@ -105,6 +105,13 @@
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/testTip",
|
||||
"style": {
|
||||
"navigationBarTitleText": "模拟考试",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/login/login",
|
||||
"style": {
|
||||
@@ -159,6 +166,13 @@
|
||||
"navigationBarTitleText": "考前密卷",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/me/changeCarType",
|
||||
"style": {
|
||||
"navigationBarTitleText": "切换车型",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
@@ -41,11 +41,11 @@
|
||||
<view class="mt5">VIP课程</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toAnswer('精简500题',true)">
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toAnswer(`精简${titleNum}题`,true)">
|
||||
<view class="text-center wp100">
|
||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto" src="../../static/image/index/500icon.png">
|
||||
</image>
|
||||
<view class="mt5">精简500题</view>
|
||||
<view class="mt5">精简{{titleNum}}题</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wp33 flex ai-c jc-c" @tap="toExclusive">
|
||||
@@ -78,11 +78,10 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding: 0 28rpx;margin-top: 30rpx;" @tap="toClass">
|
||||
<!-- <view style="padding: 0 28rpx;margin-top: 30rpx;" @tap="toClass">
|
||||
<view class="video-box">
|
||||
<view class="flex jc-sb ai-c wp100">
|
||||
<text style="color: #05C341;font-size: 36rpx;">科{{subject==1?'一':'四'}}精品视频课</text>
|
||||
<!-- <text class="cor-666 fs12">全部10节课 ></text> -->
|
||||
</view>
|
||||
<view class="flex ai-c mt20">
|
||||
<view class="contain-box relative">
|
||||
@@ -97,7 +96,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -110,6 +109,7 @@
|
||||
import storage from '@/jtools/storage';
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import {
|
||||
querySysConfig,
|
||||
queryQuestionId,
|
||||
getTestQuestionId
|
||||
} from '@/jtools/api/question';
|
||||
@@ -127,11 +127,12 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
titleNum:500,
|
||||
allQuestionNum: 0,
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.getTitle()
|
||||
},
|
||||
computed: {
|
||||
...mapState(useUserStore, ["vipOnList", "token"]),
|
||||
@@ -143,6 +144,15 @@
|
||||
methods: {
|
||||
...mapActions(useUserStore, ['searchUserVip']),
|
||||
...mapActions(useQuestionStore, ['getOrderQuestion_sub1', 'getOrderQuestion_sub4', 'getAllQuestion']),
|
||||
getTitle(){
|
||||
const carId=storage.get('carType') || '1001'
|
||||
querySysConfig(carId,'SimplifyQuestionNum').then(resp=>{
|
||||
if(resp.code==='0000'){
|
||||
const list = JSON.parse(resp.data.configJson)
|
||||
this.titleNum=list.find(item=>item.subject==this.subject).num
|
||||
}
|
||||
})
|
||||
},
|
||||
async toTestRoom() {
|
||||
// uni.navigateTo({
|
||||
// url:"/pages/index/trueTest"
|
||||
@@ -214,7 +224,7 @@
|
||||
})
|
||||
},
|
||||
toAnswer(title, val) {
|
||||
if (title == '精简500题') {
|
||||
if (title == `精简${this.titleNum}题`) {
|
||||
queryQuestionId({
|
||||
versionId: this.version,
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
@@ -225,6 +235,7 @@
|
||||
if (this.token) {
|
||||
await this.searchUserVip()
|
||||
const result = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||
let arr = []
|
||||
if (result) {
|
||||
if(resp.data&&resp.data.length){
|
||||
const listJson = JSON.stringify(resp.data)
|
||||
@@ -240,9 +251,9 @@
|
||||
}
|
||||
} else {
|
||||
if (resp.data && resp.data.length > 3) {
|
||||
const arr = resp.data.slice(0, 3)
|
||||
arr = resp.data.slice(0, 3)
|
||||
} else {
|
||||
const arr = resp.data
|
||||
arr = resp.data
|
||||
}
|
||||
if(arr&&arr.length){
|
||||
const listJson = JSON.stringify(arr)
|
||||
@@ -289,7 +300,7 @@
|
||||
const arr = resp.data
|
||||
const listJson = JSON.stringify(arr)
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/practiceExams?title=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson
|
||||
url: "/pages/index/testTip?subject=" + this.subject + "&questionIdList=" + listJson
|
||||
})
|
||||
} else if (resp.code === '4001') {
|
||||
uni.showToast({
|
||||
@@ -308,6 +319,7 @@
|
||||
...param
|
||||
}).then(async (resp) => {
|
||||
if (resp.code === '0000') {
|
||||
let arr = []
|
||||
if (this.token) {
|
||||
await this.searchUserVip()
|
||||
const result = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||
@@ -317,13 +329,13 @@
|
||||
})
|
||||
} else {
|
||||
if (resp.data && resp.data.length > 3) {
|
||||
const arr = resp.data.slice(0, 3)
|
||||
arr = resp.data.slice(0, 3)
|
||||
} else {
|
||||
const arr = resp.data
|
||||
arr = resp.data
|
||||
}
|
||||
const listJson = JSON.stringify(arr)
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/practiceExams?title=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson+"&needVip="+result
|
||||
url: "/pages/index/videoVip?subject=" + this.subject
|
||||
})
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
await this.getDiverType()
|
||||
// await this.getDiverType()
|
||||
},
|
||||
computed: {
|
||||
...mapState(useUserStore, ["vipOnList", "token"])
|
||||
@@ -134,9 +134,9 @@
|
||||
"subject": String(this.subject),
|
||||
"type": "2"
|
||||
}).then(resp => {
|
||||
if (resp.code === '0000') {
|
||||
if (resp.code === '0000' && resp.data &&resp.data.length) {
|
||||
this.baseList = resp.data
|
||||
this.videoList = resp.data[0] ? resp.data[0].videoList.slice(0, 5) : []
|
||||
this.videoList = resp.data[0] && resp.data[0].videoList? resp.data[0].videoList.slice(0, 5) : []
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -148,7 +148,15 @@
|
||||
const formatSecond = second > 59 ? 59 : second
|
||||
return `${hours > 0 ? `${hours}:` : ''}${minute < 10 ? '0' + minute : minute}:${formatSecond < 10 ? '0' + formatSecond : formatSecond}`
|
||||
},
|
||||
toVideo() {
|
||||
async toVideo() {
|
||||
if (this.token) {
|
||||
await this.searchUserVip()
|
||||
const res = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||
if (!res) {
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/videoVip?subject="+this.subject
|
||||
})
|
||||
}else{
|
||||
let arr = JSON.parse(JSON.stringify(this.operateList))
|
||||
arr = arr.map(item => {
|
||||
return {
|
||||
@@ -158,10 +166,17 @@
|
||||
}
|
||||
})
|
||||
let jsonString = JSON.stringify(arr)
|
||||
console.log('arr',jsonString);
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/videoDetail?videoList=" + jsonString + "&subject=" + this.subject +
|
||||
"&projectId=" + this.projectId + "&type=1"
|
||||
"&projectId=" + this.projectId + "&type=1&driveType=2"
|
||||
})
|
||||
}
|
||||
} else {
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
});
|
||||
}
|
||||
},
|
||||
toOperateDetail(val) {
|
||||
let arr = JSON.parse(JSON.stringify(this.baseList[0].videoList))
|
||||
@@ -186,8 +201,10 @@
|
||||
"subject": String(this.subject),
|
||||
"type": "1"
|
||||
}).then(resp => {
|
||||
if(resp.code==='0000'){
|
||||
this.operateList = resp.data
|
||||
this.projectId = this.operateList[0]?.projectId
|
||||
}
|
||||
})
|
||||
},
|
||||
getDiverType() {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<u-sticky bgColor="#fff">
|
||||
<u-tabs :list="categoryList" :current="curTab" :scrollable="false" @change="changeCategory"></u-tabs>
|
||||
</u-sticky>
|
||||
<view style="height: 100vh;background-color: rgb(245, 245, 245);">
|
||||
<view style="background-color: rgb(245, 245, 245);">
|
||||
<template v-if="subject=='1' || subject=='4'">
|
||||
<Subject1 :subject="subject" :rightList="rightList" :wrongList="wrongList" />
|
||||
</template>
|
||||
@@ -41,6 +41,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show:false,
|
||||
subject: storage.get('curSubject') || '1',
|
||||
curTab: 0,
|
||||
searchValue: '',
|
||||
@@ -50,25 +51,37 @@
|
||||
wrongList: storage.get(`wrongList_subject${this.subject}`) || [],
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.curTab=Number(this.curSubject)-1
|
||||
this.getSubjectConfig()
|
||||
},
|
||||
onShow() {
|
||||
this.show=true
|
||||
this.getSubjectConfig()
|
||||
if (this.subject == '1' || this.subject == '4') {
|
||||
this.rightList = storage.get(`rightList_subject${this.subject}`) || []
|
||||
this.wrongList = storage.get(`wrongList_subject${this.subject}`) || []
|
||||
}
|
||||
if(this.subject=='2'||this.subject=='3'){
|
||||
this.$refs.subjectRef.getDiverType()
|
||||
}
|
||||
},
|
||||
onHide(){
|
||||
this.show=false
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1","curSubject"]), //映射函数,取出tagslist
|
||||
getLoading() {
|
||||
return this.loading_subject4 && this.loading_subject1
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
getLoading(newVal){
|
||||
if(this.show){
|
||||
if(newVal){
|
||||
if(this.loading_subject4 && this.loading_subject1){
|
||||
uni.hideTabBar();
|
||||
}
|
||||
}else{
|
||||
uni.showTabBar()
|
||||
}
|
||||
return this.loading_subject4 && this.loading_subject1
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -84,6 +97,8 @@
|
||||
name: item.configItemName
|
||||
}
|
||||
})
|
||||
this.subject=storage.get('curSubject') || '1',
|
||||
this.curTab=this.categoryList.findIndex(item=>item.configItemCode==this.subject)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
83
src/pages/index/testTip.vue
Normal file
83
src/pages/index/testTip.vue
Normal file
@@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<view class="bc-fff hp100">
|
||||
<view class="wp100 p14 flex ai-c jc-c">
|
||||
<view class="text-center">
|
||||
<view style="width: 64px;height: 64px;border-radius: 50%;overflow: hidden;margin-bottom: 10px;">
|
||||
<u-avatar class="br-p50 overflow-h" :size="64" mp-avatar shape="circle"></u-avatar>
|
||||
</view>
|
||||
<text class="fs18">{{user.userName}}{{ user.userId }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="p14">
|
||||
<view class="wp100 p14lr p20tb mb14" style="background-color: rgb(248, 248, 248);border-radius: 20rpx;">
|
||||
<view class="flex ai-c jc-sb pb10">
|
||||
<text style="color: rgb(175, 175, 175);">考试类型</text>
|
||||
<text>{{carName}}</text>
|
||||
</view>
|
||||
<view class="flex ai-c jc-sb pb10">
|
||||
<text style="color: rgb(175, 175, 175);">考试标准</text>
|
||||
<text>{{subject=='1'?100:50}}题/45分钟</text>
|
||||
</view>
|
||||
<view class="flex ai-c jc-sb pb10">
|
||||
<text style="color: rgb(175, 175, 175);">合格标准</text>
|
||||
<text>90分及格(满分100分)</text>
|
||||
</view>
|
||||
<view class="flex ai-c jc-sb">
|
||||
<text style="color: rgb(175, 175, 175);">出题规则</text>
|
||||
<text>根据公安部出题规则组卷</text>
|
||||
</view>
|
||||
</view>
|
||||
<text>模拟考试不能修改答案,每错1题扣{{subject=='1'?1:2}}分,错题累计超过{{subject=='1'?10:5}}道,考试不通过</text>
|
||||
</view>
|
||||
<view class="p14lr wp100" style="margin-top: 30px;">
|
||||
<u-button :customStyle="{width: '100%',borderRadius:'40rpx',backgroundColor:'#05C341',color:'#fff'}" text="开始考试"
|
||||
@click="submit" />
|
||||
</view>
|
||||
<view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<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 {
|
||||
data() {
|
||||
return {
|
||||
carName:storage.get('carName') ||'小车C1/C2/C3',
|
||||
questionList: '',
|
||||
subject:'1',
|
||||
}
|
||||
},
|
||||
onLoad(op) {
|
||||
if (op.questionIdList) {
|
||||
this.questionList = op.questionIdList
|
||||
}
|
||||
if(op.subject){
|
||||
this.subject = op.subject
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["currentCarName"]), //映射函数,取出tagslist
|
||||
user() {
|
||||
return useUserStore().userInfo
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
submit(){
|
||||
uni.navigateTo({
|
||||
url: "/pages/questionBank/practiceExams?title=模拟考试&subject=" + this.subject + "&questionIdList=" + this.questionList
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -1,32 +1,66 @@
|
||||
<template>
|
||||
<view class="relative" style="height: 100vh;">
|
||||
<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-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)">
|
||||
<view style="height: 100%;overflow: scroll;background-color: #fff;">
|
||||
<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%A2%98%E5%BA%93_20230911211532.png"></image>
|
||||
<view style="margin-bottom: 100px;">
|
||||
<view class="flex jc-fa ai-c wp100 p14">
|
||||
<view style="width: 33.3%;" v-for="(item,index) of priceList" :key="index">
|
||||
<view class="option_tem relative" :class="checkedId===item.memberId?'checked_item':''" @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>
|
||||
<text class="fs30 fw600" style="color: #FF6E02;">{{item.price}}</text>
|
||||
</view>
|
||||
<text class="fs12 cor-999">长期有效</text>
|
||||
<view class="bottom_box fs12 cor-333" :class="checkedId===item.memberId?'checked_bottom':''">赠送vip题库</view>
|
||||
<text class="fs12 cor-999">一年有效</text>
|
||||
<!-- <view class="bottom_box fs12 cor-333" :class="checkedId===item.memberId?'checked_bottom':''">赠送vip题库</view> -->
|
||||
<view class="tag" v-if="item.all">
|
||||
<text style="transform:scale(0.83);">合买更优惠</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt15 intr_box">
|
||||
<view class="fw600 fs16 cor-000">免费获赠<text style="color: #FF6E02;">价值68元</text>的VIP题库</view>
|
||||
<view class="flex ai-c jc-sb mt15">
|
||||
<view class="flex ai-c">
|
||||
</view>
|
||||
<view class="intr_box p14">
|
||||
<view class="fw600 fs16 cor-000">尊享以下权益</view>
|
||||
<view class="flex ai-c jc-sb mt15" v-if="subject=='1'||subject=='4'">
|
||||
<view class="text-center" style="width: 33%">
|
||||
<view class="wp100 flex ai-c jc-c mb5">
|
||||
<image style="width: 63rpx;height: 63rpx;margin-right: 5px;" src="../../static/image/index/vip500.png"></image>
|
||||
<view class="vip_item">含精简500题</view>
|
||||
</view>
|
||||
<view class="flex ai-c">
|
||||
<text>精简{{titleNum}}题</text>
|
||||
</view>
|
||||
<view class="text-center" style="width: 33%;">
|
||||
<view class="wp100 flex ai-c jc-c mb5">
|
||||
<image style="width: 63rpx;height: 63rpx;margin-right: 5px;" src="../../static/image/index/vip_trueRoom.png"></image>
|
||||
</view>
|
||||
<text>真实考场模拟</text>
|
||||
</view>
|
||||
<view class="text-center" style="width: 33%;">
|
||||
<view class="wp100 flex ai-c jc-c mb5">
|
||||
<image style="width: 63rpx;height: 63rpx;margin-right: 5px;" src="../../static/image/index/vipmijuan.png"></image>
|
||||
<view class="vip_item">含考前密卷2套</view>
|
||||
</view>
|
||||
<text>考前密卷</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class="flex ai-c jc-c mt15">
|
||||
<view class="flex ai-c">
|
||||
<image style="width: 63rpx;height: 63rpx;margin-right: 5px;" src="../../static/image/index/vip_ksxj.png"></image>
|
||||
<view class="vip_item">考试项目详解</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex ai-c mt20">
|
||||
<view class="contain-box relative">
|
||||
<image class="contain-box" src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E5%B0%8F%E8%BD%A6_20230911211545.png"></image>
|
||||
</view>
|
||||
<view class="ml15" style="text-align: left;">
|
||||
<view class="cor-333 fw600">考试项目详解</view>
|
||||
<view class="fs15 mt10" style="color: #9F826C ;">考试实操技巧讲解事半功倍</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wp100 mt15" v-if="subject=='1'||subject=='4'">
|
||||
<image class="wp100" mode="widthFix" src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/vip%E6%8F%8F%E8%BF%B0_20230911211600.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -45,12 +79,14 @@
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import { getVipList } from '@/jtools/api/vip'
|
||||
import { querySysConfig } from '@/jtools/api/question';
|
||||
import storage from '@/jtools/storage';
|
||||
import Pay from '@/jtools/pay/index.js';
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
titleNum:500,
|
||||
subject:'1',
|
||||
loading:true,
|
||||
nowPrice:168,
|
||||
@@ -69,12 +105,22 @@
|
||||
this.loading=true
|
||||
this.getVipList()
|
||||
this.getWXOpenId()
|
||||
this.getTitle()
|
||||
this.$set(this.order, 'userId', this.userInfo.userId);
|
||||
},
|
||||
computed: {
|
||||
...mapState(useUserStore, ["userInfo"])
|
||||
},
|
||||
methods:{
|
||||
getTitle(){
|
||||
const carId=storage.get('carType') || '1001'
|
||||
querySysConfig(carId,'SimplifyQuestionNum').then(resp=>{
|
||||
if(resp.code==='0000'){
|
||||
const list = JSON.parse(resp.data.configJson)
|
||||
this.titleNum=list.find(item=>item.subject==this.subject).num
|
||||
}
|
||||
})
|
||||
},
|
||||
async handlePay(){
|
||||
if(this.loading){
|
||||
this.loading=false
|
||||
@@ -93,7 +139,7 @@
|
||||
},
|
||||
getVipList(){
|
||||
getVipList({
|
||||
currentCartype: storage.get('carType') || '1001',
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
subject:this.subject
|
||||
}).then(resp=>{
|
||||
this.priceList=resp.data
|
||||
@@ -188,4 +234,18 @@
|
||||
border-radius: 55rpx;
|
||||
padding: 14rpx;
|
||||
}
|
||||
.contain-box {
|
||||
width: 344rpx;
|
||||
height: 196rpx;
|
||||
background: #00B74F;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.play_btn_2 {
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
position: absolute;
|
||||
left: 165.5rpx;
|
||||
top: 78rpx
|
||||
}
|
||||
</style>
|
||||
99
src/pages/me/changeCarType.vue
Normal file
99
src/pages/me/changeCarType.vue
Normal file
@@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="p14">
|
||||
<view class="wp100 p14lr p20tb bc-fff br8 mb10 relative" style="box-sizing: border-box;" :class="checkedCar==item.carTypeId?'checked':''" v-for="(item,index) of carTypeList" :key="index" @click="changeType(item)">{{item.carName}}{{item.remark}}
|
||||
<view class="p5 cor-fff fs12 br4" style="background-color:#05C341;position: absolute;right: -1rpx;top:-1rpx" v-if="checkedCar==item.carTypeId">已选</view>
|
||||
</view>
|
||||
<view class="wp100" style="margin-top: 40px;">
|
||||
<u-button :customStyle="{width: '100%',borderRadius:'40rpx',backgroundColor:'#05C341',color:'#fff'}" text="确定"
|
||||
@click="submit" />
|
||||
</view>
|
||||
<u-modal :show="show" title="提示" content="切换题库后上一个题库练习记录将会全部清空,确定要切换吗" showCancelButton @confirm="confirmSubmit" @cancel="cancel"></u-modal>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import {
|
||||
getCarTypeList,
|
||||
} from '@/jtools/api/index';
|
||||
import storage from '@/jtools/storage';
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
export default{
|
||||
data() {
|
||||
return{
|
||||
show:false,
|
||||
carTypeList:[],
|
||||
checkedCar: storage.get('carType') ||'1001',
|
||||
checkedCarName:storage.get('carName') || '小车C1/C2/C3'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getCarTypeList()
|
||||
},
|
||||
computed:{
|
||||
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1","curSubject"]), //映射函数,取出tagslist
|
||||
getLoading() {
|
||||
return this.loading_subject4 && this.loading_subject1
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
getLoading(newVal){
|
||||
console.log(newVal);
|
||||
if(newVal){
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title:'切换成功!'
|
||||
})
|
||||
this.cancel()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
getCarTypeList(){
|
||||
getCarTypeList().then(resp=>{
|
||||
if(resp.code==='0000'){
|
||||
this.carTypeList=resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
changeType(item){
|
||||
this.checkedCar=item.carTypeId
|
||||
this.checkedCarName=item.carName+item.remark
|
||||
},
|
||||
submit(){
|
||||
const id=storage.get('carType') ||'1001'
|
||||
if(this.checkedCar==id){
|
||||
uni.showToast({
|
||||
title:'当前已是该车型题库!',
|
||||
icon:'error'
|
||||
})
|
||||
}else{
|
||||
this.show=true
|
||||
}
|
||||
},
|
||||
cancel(){
|
||||
this.show=false
|
||||
},
|
||||
confirmSubmit(){
|
||||
storage.set('carType',this.checkedCar)
|
||||
storage.set('carName',this.checkedCarName)
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
useQuestionStore().resetStorage()
|
||||
useQuestionStore().getAllQuestion()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.checked{
|
||||
border: 6rpx solid #05C341;
|
||||
}
|
||||
</style>
|
||||
@@ -81,7 +81,7 @@
|
||||
<img src="/static/image/mine/wdtj.png" style="width: 24px;height: 24px;">
|
||||
</template>
|
||||
</u-cell>
|
||||
<u-cell size="large" title="我的题库" value="小车">
|
||||
<u-cell size="large" title="我的题库" :value="carName" isLink @tap="toChangeCarType">
|
||||
<template #icon>
|
||||
<img src="/static/image/mine/wdtk.png" style="width: 24px;height: 24px;">
|
||||
</template>
|
||||
@@ -96,6 +96,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
import storage from '@/jtools/storage';
|
||||
export default {
|
||||
components: {},
|
||||
computed: {
|
||||
@@ -134,13 +135,20 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
data(){
|
||||
return{
|
||||
carName:storage.get('carName') || '小车C1/C2/C3'
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.carName=storage.get('carName') || '小车C1/C2/C3'
|
||||
},
|
||||
methods: {
|
||||
toChangeCarType(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/me/changeCarType"
|
||||
})
|
||||
},
|
||||
handleVip() {
|
||||
if (this.isLogin) {
|
||||
// if (this.vipOn.length) {
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
<template>
|
||||
<view class="p15 bc-f5">
|
||||
<view class="br8 bc-fff p15lr">
|
||||
<view class="flex ai-c bb1" style="height: 110rpx;">
|
||||
<view class="flex jc-sb ai-c bb1" style="height: 110rpx;">
|
||||
<view class="title">联系电话</view>
|
||||
<view class="m30lr fs14 cor-333 fl1">15122305568</view>
|
||||
<view class="flex">
|
||||
<view class="m30lr fs14 cor-333">15122305568</view>
|
||||
<u-icon name="arrow-right" color="#999" />
|
||||
</view>
|
||||
<view class="flex ai-c" style="height: 110rpx;">
|
||||
</view>
|
||||
<view class="flex jc-sb ai-c bb1" style="height: 110rpx;">
|
||||
<view class="title">地址</view>
|
||||
<view class="m30lr fs14 cor-333 fl1">安徽省合肥市包河区</view>
|
||||
<view class="flex">
|
||||
<view class="m30lr fs14 cor-333">安徽省合肥市包河区</view>
|
||||
<u-icon name="arrow-right" color="#999" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex jc-sb ai-c bb1" style="height: 110rpx;">
|
||||
<view class="title">身份证号</view>
|
||||
<view class="m30lr fs14 cor-333">{{sfzNum}}</view>
|
||||
</view>
|
||||
<view class="flex ai-c" style="height: 110rpx;" @tap="toUploadPic">
|
||||
<view class="title">证件照</view>
|
||||
<view class="m30lr fs14 cor-333 fl1"></view>
|
||||
<u-icon name="arrow-right" color="#999" />
|
||||
</view>
|
||||
</view>
|
||||
@@ -16,13 +29,22 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import storage from '@/jtools/storage';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
sfzNum:storage.get('sfzNum') || ''
|
||||
}
|
||||
},
|
||||
onShow(){
|
||||
this.sfzNum=storage.get('sfzNum') || ''
|
||||
},
|
||||
methods: {
|
||||
toUploadPic(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/me/uploadPic'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -24,11 +24,11 @@
|
||||
<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 label="姓名" :required="true" prop="idCardName" borderBottom ref="item1">
|
||||
<u--input v-model="form.idCardName" 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 label="身份证号" :required="true" prop="sfzmhm" borderBottom ref="item2">
|
||||
<u--input v-model="form.sfzmhm" border="none"></u--input>
|
||||
</u-form-item>
|
||||
</u--form>
|
||||
</view>
|
||||
@@ -42,6 +42,9 @@
|
||||
|
||||
<script>
|
||||
import storage from '@/jtools/storage';
|
||||
import {
|
||||
addInfo,
|
||||
} from '@/jtools/api/index';
|
||||
export default {
|
||||
data() {
|
||||
const shenfenzhen = (rule, value, callback) => {
|
||||
@@ -50,20 +53,21 @@
|
||||
}
|
||||
return {
|
||||
form: {
|
||||
name: '',
|
||||
idNum: ''
|
||||
idCardName: '',
|
||||
sfzmhm: ''
|
||||
},
|
||||
driverLicenseImg:'',
|
||||
fileList:[],
|
||||
fileList1: [],
|
||||
uploadList: [],
|
||||
saving: false,
|
||||
rules: {
|
||||
name: [{
|
||||
idCardName: [{
|
||||
required: true,
|
||||
message: '请输入姓名',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
idNum: [{
|
||||
sfzmhm: [{
|
||||
required: true,
|
||||
message: '请输入身份证号',
|
||||
trigger: ['blur', 'change']
|
||||
@@ -78,13 +82,6 @@
|
||||
};
|
||||
},
|
||||
onReady() {
|
||||
if(storage.get('photoForm')){
|
||||
this.fileList=storage.get('photoForm').file
|
||||
this.form={
|
||||
name: storage.get('photoForm').name,
|
||||
idNum: storage.get('photoForm').idNum
|
||||
}
|
||||
}
|
||||
this.$refs.form1.setRules(this.rules);
|
||||
},
|
||||
methods: {
|
||||
@@ -95,7 +92,17 @@
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
// this.compressImage(event.file);
|
||||
let imageInfoObj = await uni.getImageInfo({src: event.file[0].url})
|
||||
console.log(imageInfoObj);
|
||||
if(imageInfoObj.width!=720&&imageInfoObj.height!=720){
|
||||
uni.showToast({
|
||||
icon:'error',
|
||||
title:'证件照尺寸有误'
|
||||
})
|
||||
this.fileList=[]
|
||||
return false
|
||||
}
|
||||
this.driverLicenseImg = this.urlTobase64(event.file[0].url)
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
const lists = [].concat(event.file);
|
||||
this.fileList=lists
|
||||
@@ -129,10 +136,12 @@
|
||||
this.$refs.form1.validate().then((valid) => {
|
||||
if (valid) {
|
||||
const param={
|
||||
file:this.fileList,
|
||||
...this.form
|
||||
driverLicenseImg:this.driverLicenseImg,
|
||||
...this.form,
|
||||
schoolOrgCode:'340103000700',
|
||||
operater:'1d08daf852cf4ee28f67cb583f538cbf'
|
||||
}
|
||||
storage.set('photoForm',param)
|
||||
addInfo(param).then(resp=>{
|
||||
uni.showToast({
|
||||
title:"提交成功!",
|
||||
duration:2000,
|
||||
@@ -140,51 +149,34 @@
|
||||
setTimeout(()=>{
|
||||
uni.navigateBack()
|
||||
},1000)
|
||||
})
|
||||
} else {
|
||||
console.log('验证失败');
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
async compressImage(image) {
|
||||
const img = new Image();
|
||||
img.src = image.url;
|
||||
urlTobase64(url){
|
||||
let base64=''
|
||||
console.log(url);
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getFileSystemManager().readFile({
|
||||
filePath: url, //选择图片返回的相对路径
|
||||
encoding: 'base64', //编码格式
|
||||
success: res => { //成功的回调
|
||||
console.log(res);
|
||||
base64 = 'data:image/jpeg;base64,' + res.data //不加上这串字符,在页面无法显示的哦
|
||||
resolve(base64);
|
||||
},fail: (e) => {
|
||||
console.log("图片转换失败");
|
||||
reject(e)
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
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>
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
<!-- <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" /> -->
|
||||
<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 v-if="fileList&&fileList.length" style="width: 240rpx;height: 240rpx;" :src="fileList[0].url">
|
||||
</image>
|
||||
<u-avatar v-else class="br-p50 overflow-h" :size="64" mp-avatar shape="circle"></u-avatar>
|
||||
</view>
|
||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="1" width="150"
|
||||
height="150">
|
||||
<u-upload :fileList="fileList1" :maxSize="500 * 1024" @oversize="oversize" @afterRead="afterRead"
|
||||
@delete="deletePic" multiple :maxCount="1" width="150" height="150">
|
||||
<view
|
||||
style="width: 320rpx;height:60rpx;line-height:60rpx;background-color: #3C9CFF;border-radius: 0 0 20rpx 20rpx;"
|
||||
style="width: 320rpx;height:60rpx;line-height:60rpx;background-color: #05C341;border-radius: 0 0 20rpx 20rpx;"
|
||||
class="text-center cor-fff">
|
||||
点击
|
||||
</view>
|
||||
@@ -24,17 +24,17 @@
|
||||
<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 label="姓名" :required="true" prop="idCardName" borderBottom ref="item1">
|
||||
<u--input v-model="form.idCardName" 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 label="身份证号" :required="true" prop="sfzmhm" borderBottom ref="item2">
|
||||
<u--input v-model="form.sfzmhm" 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" />
|
||||
<u-button type="primary" :style="{width: '100%',borderRadius:'40rpx',backgroundColor:'#05C341'}"
|
||||
:disabled="saving" text="提交" @click="submit" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -42,6 +42,9 @@
|
||||
|
||||
<script>
|
||||
import storage from '@/jtools/storage';
|
||||
import {
|
||||
addInfo,
|
||||
} from '@/jtools/api/index';
|
||||
export default {
|
||||
data() {
|
||||
const shenfenzhen = (rule, value, callback) => {
|
||||
@@ -50,23 +53,25 @@
|
||||
}
|
||||
return {
|
||||
form: {
|
||||
name: '',
|
||||
idNum: ''
|
||||
idCardName: '',
|
||||
sfzmhm: storage.get('sfzNum') || ''
|
||||
},
|
||||
driverLicenseImg: '',
|
||||
fileList: [],
|
||||
fileList1: [],
|
||||
uploadList: [],
|
||||
saving: false,
|
||||
rules: {
|
||||
name: [{
|
||||
idCardName: [{
|
||||
required: true,
|
||||
message: '请输入姓名',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
idNum: [{
|
||||
sfzmhm: [{
|
||||
required: true,
|
||||
message: '请输入身份证号',
|
||||
trigger: ['blur', 'change']
|
||||
},{
|
||||
}, {
|
||||
// 自定义验证函数,见上说明
|
||||
validator: shenfenzhen,
|
||||
message: '身份证号码不正确',
|
||||
@@ -77,17 +82,17 @@
|
||||
};
|
||||
},
|
||||
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: {
|
||||
|
||||
// 文件超出大小限制
|
||||
oversize() {
|
||||
uni.showToast({
|
||||
title: "图片最大不能超过500k",
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
// 删除图片
|
||||
deletePic(event) {
|
||||
this.fileList1.splice(event.index, 1);
|
||||
@@ -95,95 +100,94 @@
|
||||
},
|
||||
// 新增图片
|
||||
async afterRead(event) {
|
||||
// this.compressImage(event.file);
|
||||
let imageInfoObj = await uni.getImageInfo({
|
||||
src: event.file[0].url
|
||||
})
|
||||
console.log(imageInfoObj);
|
||||
if (imageInfoObj.width != 260 && imageInfoObj.height != 378) {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '证件照尺寸有误'
|
||||
})
|
||||
this.fileList = []
|
||||
return false
|
||||
}
|
||||
this.driverLicenseImg = await this.urlTobase64(event.file[0].url)
|
||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||
const lists = [].concat(event.file);
|
||||
this.fileList1 = lists;
|
||||
this.fileList = lists
|
||||
this.fileList1 = [];
|
||||
uni.showToast({
|
||||
title:'上传成功!'
|
||||
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
|
||||
const param = {
|
||||
driverLicenseImg: this.driverLicenseImg,
|
||||
...this.form,
|
||||
schoolOrgCode: '340103000700',
|
||||
operater: '1d08daf852cf4ee28f67cb583f538cbf'
|
||||
}
|
||||
storage.set('photoForm',param)
|
||||
storage.set('sfzNum', this.form.sfzmhm)
|
||||
uni.request({
|
||||
url: 'https://www.hfcgs.cn:20223/driver/addInfo',
|
||||
method: 'POST',
|
||||
data: param,
|
||||
success: res => {
|
||||
console.log(res);
|
||||
uni.showToast({
|
||||
title:"提交成功!",
|
||||
duration:2000,
|
||||
title: "提交成功!",
|
||||
duration: 2000,
|
||||
})
|
||||
setTimeout(()=>{
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
},1000)
|
||||
}, 1000)
|
||||
},
|
||||
fail: () => {},
|
||||
|
||||
});
|
||||
// addInfo(param).then(resp=>{
|
||||
// if(resp.code==='0000'){
|
||||
// uni.showToast({
|
||||
// title:"提交成功!",
|
||||
// duration:2000,
|
||||
// })
|
||||
// setTimeout(()=>{
|
||||
// uni.navigateBack()
|
||||
// },1000)
|
||||
// }
|
||||
// })
|
||||
} else {
|
||||
console.log('验证失败');
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
async compressImage(image) {
|
||||
const img = new Image();
|
||||
img.src = image.url;
|
||||
urlTobase64(url) {
|
||||
let base64 = ''
|
||||
console.log(url);
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getFileSystemManager().readFile({
|
||||
filePath: url, //选择图片返回的相对路径
|
||||
encoding: 'base64', //编码格式
|
||||
success: res => { //成功的回调
|
||||
console.log(res);
|
||||
base64 = 'data:image/jpeg;base64,' + res.data //不加上这串字符,在页面无法显示的哦
|
||||
resolve(base64);
|
||||
},
|
||||
fail: (e) => {
|
||||
console.log("图片转换失败");
|
||||
reject(e)
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
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>
|
||||
@@ -214,4 +218,9 @@
|
||||
::v-deep .u-button--square {
|
||||
border-radius: 40rpx !important;
|
||||
}
|
||||
|
||||
::v-deep .u-button--primary {
|
||||
background-color: #05C341 !important;
|
||||
border-color: #05C341 !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<view class="flex fld-c p15">
|
||||
<view>
|
||||
<u-loading-page :loading="getLoading" loading-text="题库更新中..."></u-loading-page>
|
||||
<view class="flex fld-c p15" v-if="!getLoading">
|
||||
<u-sticky>
|
||||
<view class="flex ai-c">
|
||||
<view v-for="(item, index) in vipAllList" :key="index" class="km-item" :class="{ actived: index == current }"
|
||||
@@ -9,10 +11,11 @@
|
||||
</view>
|
||||
</u-sticky>
|
||||
<view class="mt15">
|
||||
<swiper class="swiper" :current="current" style="height: 120px;" :autoplay="false" :display-multiple-items="1.45"
|
||||
:disable-programmatic-animation="true" @change="onChange">
|
||||
<swiper class="swiper" :current="current" style="height: 120px;" :autoplay="false"
|
||||
:display-multiple-items="1.45" :disable-programmatic-animation="true" @change="onChange">
|
||||
<swiper-item v-for="(item, index) in vipAllList" :key="index">
|
||||
<view class="relative" style="background-image: url(https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/vip%E8%83%8C%E6%99%AF_20230831010348.png);width: 95%;height: 204rpx;background-size: 100% 100%;">
|
||||
<view class="relative"
|
||||
style="background-image: url(https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/vip%E8%83%8C%E6%99%AF_20230831010348.png);width: 95%;height: 204rpx;background-size: 100% 100%;">
|
||||
<!-- <image src="" mode="widthFix" style="width:95%;"></image> -->
|
||||
<view class="vip-info">
|
||||
<u-avatar class="br-p50 overflow-h" style="border: 3px solid #873E1D;" :size="35" mp-avatar></u-avatar>
|
||||
@@ -110,7 +113,8 @@
|
||||
</view>
|
||||
<view class="ml15 text-center">
|
||||
<u-button :customStyle="{width:'200rpx',height:'66rpx',borderRadius: '33rpx'}" iconColor="#fff"
|
||||
text="去看视频" color="linear-gradient(90deg, #E66501 0%, #F8A42C 100%)" icon="play-circle" @click="toPlaceLive(item)">
|
||||
text="去看视频" color="linear-gradient(90deg, #E66501 0%, #F8A42C 100%)" icon="play-circle"
|
||||
@click="toPlaceLive(item)">
|
||||
</u-button>
|
||||
<view class="cor-333 fs15 fw600 mt10">真实考场模拟</view>
|
||||
</view>
|
||||
@@ -121,12 +125,27 @@
|
||||
</swiper>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
export default {
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
import {
|
||||
queryQuestionId,
|
||||
getTestQuestionId
|
||||
} from '@/jtools/api/question';
|
||||
import storage from '@/jtools/storage';
|
||||
export default {
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1", "version"]), //映射函数,取出tagslist
|
||||
getLoading() {
|
||||
return this.loading_subject4 && this.loading_subject1
|
||||
},
|
||||
vipAllList() {
|
||||
return useUserStore().vipAllList.filter(it => [1, 2, 3, 4].includes(Number(it.subjects)))
|
||||
},
|
||||
@@ -141,9 +160,10 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
chargeVip(item){
|
||||
...mapActions(useQuestionStore, ['getOrderQuestion_sub1', 'getOrderQuestion_sub4', 'getAllQuestion']),
|
||||
chargeVip(item) {
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/videoVip?subject="+item.subjects
|
||||
url: "/pages/index/videoVip?subject=" + item.subjects
|
||||
})
|
||||
},
|
||||
onChange(e) {
|
||||
@@ -155,7 +175,7 @@ export default {
|
||||
'2': '科二',
|
||||
'3': '科三',
|
||||
'4': '科四',
|
||||
}[km]
|
||||
} [km]
|
||||
},
|
||||
getExpireText(item) {
|
||||
const vipOn = this.vipOnList.find(it => it.memberId == item.memberId)
|
||||
@@ -165,16 +185,42 @@ export default {
|
||||
return '开通vip助您快速拿证'
|
||||
}
|
||||
},
|
||||
vipHasOpened(item) {;
|
||||
return !!this.vipOnList.some(it => it.subjects.includes(item.subjects) )
|
||||
vipHasOpened(item) {
|
||||
;
|
||||
return !!this.vipOnList.some(it => it.subjects.includes(item.subjects))
|
||||
},
|
||||
// 去精选500题 item=> 当前科目vip信息
|
||||
to500(item) {
|
||||
// 当前vip是否已开通
|
||||
if (this.vipHasOpened(item)) {
|
||||
// 跳转
|
||||
queryQuestionId({
|
||||
versionId: this.version,
|
||||
carTypeId: storage.get('carType') || '1001',
|
||||
subject: item.subjects,
|
||||
isVip: '1'
|
||||
}).then(async (resp) => {
|
||||
if (resp.code === '0000') {
|
||||
const arr = resp.data
|
||||
if (arr && arr.length) {
|
||||
const listJson = JSON.stringify(arr)
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle=精简500题&subject="+item.subjects+"&needVip=true&isVip=1"
|
||||
url: "/pages/questionBank/questionBank?navTitle=精简500题&subject=" + item.subjects +
|
||||
"&questionIdList=" + listJson
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '暂无题目',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} else if (resp.code === '4001') {
|
||||
uni.showToast({
|
||||
title: '当前题库非最新版,请更新~',
|
||||
icon: 'none'
|
||||
})
|
||||
this.getAllQuestion()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -189,7 +235,7 @@ export default {
|
||||
if (this.vipHasOpened(item)) {
|
||||
// 跳转
|
||||
uni.navigateTo({
|
||||
url: "/pages/index/trueTest?subject="+item.subjects
|
||||
url: "/pages/index/trueTest?subject=" + item.subjects
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -204,7 +250,7 @@ export default {
|
||||
if (this.vipHasOpened(item)) {
|
||||
// 跳转
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/practiceExams?subject="+item.subjects+'&title=考前密卷&isExam1=1'
|
||||
url: "/pages/index/secretPapers?subject=" + item.subjects
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -219,8 +265,8 @@ export default {
|
||||
if (this.vipHasOpened(item)) {
|
||||
// 跳转
|
||||
uni.showToast({
|
||||
title:'敬请期待',
|
||||
icon:'none'
|
||||
title: '敬请期待',
|
||||
icon: 'none'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -230,11 +276,11 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.km-item {
|
||||
.km-item {
|
||||
margin-right: 8px;
|
||||
width: 72px;
|
||||
height: 30px;
|
||||
@@ -244,27 +290,27 @@ export default {
|
||||
text-align: center;
|
||||
border-radius: 15px;
|
||||
border: 1px solid #CCCCCC;
|
||||
}
|
||||
}
|
||||
|
||||
.actived {
|
||||
.actived {
|
||||
background: linear-gradient(90deg, #E66501 0%, #F8A42C 100%);
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.km-item:last-of-type {
|
||||
.km-item:last-of-type {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.vip-info {
|
||||
.vip-info {
|
||||
position: absolute;
|
||||
top: 15px;
|
||||
left: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.corner {
|
||||
.corner {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
@@ -279,9 +325,9 @@ export default {
|
||||
font-size: 12px;
|
||||
color: #fff;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.renew {
|
||||
.renew {
|
||||
position: absolute;
|
||||
right: 10%;
|
||||
bottom: 15px;
|
||||
@@ -295,9 +341,9 @@ export default {
|
||||
font-size: 12px;
|
||||
color: #F6E99F;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.buy {
|
||||
.buy {
|
||||
position: absolute;
|
||||
left: 45%;
|
||||
transform: translateX(-50%);
|
||||
@@ -312,9 +358,9 @@ export default {
|
||||
font-size: 14px;
|
||||
color: #F6E99F;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.study {
|
||||
.study {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -324,22 +370,24 @@ export default {
|
||||
border-radius: 34rpx;
|
||||
font-size: 12px;
|
||||
color: #873E1D;
|
||||
}
|
||||
}
|
||||
|
||||
.video-box {
|
||||
.video-box {
|
||||
padding: 20rpx;
|
||||
width: 694rpx;
|
||||
height: 369rpx;
|
||||
background: #F9F3E7;
|
||||
border: 2rpx solid #CF8B6D;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.contain-box {
|
||||
width: 406rpx;
|
||||
height: 228rpx;
|
||||
background: #00B74F;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.play_btn_2 {
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
|
||||
@@ -346,7 +346,7 @@
|
||||
|
||||
},
|
||||
timeCount() {
|
||||
const time = this.subject == '1' ? 60 * 60 * 1000 : 45 * 60 * 1000
|
||||
const time = 45 * 60 * 1000
|
||||
return time
|
||||
}
|
||||
},
|
||||
@@ -504,10 +504,15 @@
|
||||
toSubmit() {
|
||||
const restTime = this.time.hours * 60 * 60 + this.time.minutes * 60 + this.time.seconds
|
||||
const score = (this.rightList.length / this.questionList.length * 100).toFixed(0)
|
||||
if(this.rightList.length+this.wrongList.length==0){
|
||||
uni.navigateBack({
|
||||
delta:1
|
||||
})
|
||||
}else{
|
||||
submitTest({
|
||||
"carTypeId": storage.get('carType') || '1001',
|
||||
"score": score,
|
||||
"testTime": 60 * 60 - restTime,
|
||||
"testTime": 45 * 60 - restTime,
|
||||
subject: this.subject
|
||||
}).then(resp => {
|
||||
const doNotNum = this.questionList.length - this.rightList.length - this.wrongList.length
|
||||
@@ -519,6 +524,7 @@
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
//查看考试结果
|
||||
toResult() {
|
||||
|
||||
@@ -96,6 +96,7 @@
|
||||
label: "庐江考场",
|
||||
value: 6
|
||||
}],
|
||||
driveType:'',
|
||||
videoType: '',
|
||||
popupShow: false,
|
||||
videoList: [{
|
||||
@@ -128,6 +129,10 @@
|
||||
}
|
||||
},
|
||||
onLoad(op) {
|
||||
if(op.driveType){
|
||||
this.driveType=op.driveType
|
||||
this.param.driveType=op.driveType
|
||||
}
|
||||
if (op.type) {
|
||||
this.videoType = op.type
|
||||
}
|
||||
@@ -139,6 +144,7 @@
|
||||
}
|
||||
if (op.type) {
|
||||
this.param.type = op.type
|
||||
this.getVideoList()
|
||||
}
|
||||
if (op.type == '1') {
|
||||
if (this.param.subject == '2') {
|
||||
@@ -149,10 +155,7 @@
|
||||
} else {
|
||||
this.title = '基础操作讲解'
|
||||
}
|
||||
if (op.videoList) {
|
||||
this.videoList = JSON.parse(op.videoList)
|
||||
this.currentIndex = this.videoList.findIndex(item => item.projectId == this.projectId)
|
||||
}
|
||||
|
||||
},
|
||||
computed: {
|
||||
getScrollLeft() {
|
||||
@@ -161,6 +164,46 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formateTime(time) {
|
||||
const h = parseInt(time / 3600)
|
||||
const minute = parseInt(time / 60 % 60)
|
||||
const second = Math.ceil(time % 60)
|
||||
const hours = h < 10 ? '0' + h : h
|
||||
const formatSecond = second > 59 ? 59 : second
|
||||
return `${hours > 0 ? `${hours}:` : ''}${minute < 10 ? '0' + minute : minute}:${formatSecond < 10 ? '0' + formatSecond : formatSecond}`
|
||||
},
|
||||
getVideoList() {
|
||||
queryProjectList({
|
||||
"carTypeId": storage.get('carType') || '1001',
|
||||
...this.param,
|
||||
}).then(resp => {
|
||||
if(resp.code==='0000'){
|
||||
let arr=[]
|
||||
if(this.param.type=='1'){
|
||||
arr = JSON.parse(JSON.stringify(resp.data))
|
||||
arr = arr.map(item => {
|
||||
return {
|
||||
...item,
|
||||
videoUrl: item.videoList[0]?.videoUrl,
|
||||
videoTime: this.formateTime(item.videoList[0]?.videoTime)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
arr = JSON.parse(JSON.stringify(resp.data[0].videoList))
|
||||
arr = arr.map(item => {
|
||||
return {
|
||||
...item,
|
||||
projectId: item.videoId,
|
||||
subDesc: resp.data[0].description,
|
||||
videoTime: this.formateTime(item.videoTime)
|
||||
}
|
||||
})
|
||||
}
|
||||
this.videoList = arr
|
||||
this.currentIndex = this.videoList.findIndex(item => item.projectId == this.projectId)
|
||||
}
|
||||
})
|
||||
},
|
||||
checkTest(val) {
|
||||
this.videoIndex = val
|
||||
},
|
||||
|
||||
BIN
src/static/image/index/vip_ksxj.png
Normal file
BIN
src/static/image/index/vip_ksxj.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
BIN
src/static/image/index/vip_trueRoom.png
Normal file
BIN
src/static/image/index/vip_trueRoom.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Reference in New Issue
Block a user