Compare commits
27 Commits
728fefac03
...
dev-hxf
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b1db47383 | |||
| 79236493e6 | |||
| 59c49bfdf2 | |||
| 110e9d4adc | |||
|
|
b533581a5d | ||
| ac8acdccda | |||
| f4b6f96649 | |||
| 9ba3f6ed48 | |||
| 253ab2a80d | |||
| bfdbd3f7f3 | |||
| e3544ee06e | |||
| 7e15974ea6 | |||
| 46972d5bff | |||
| 851319e24c | |||
| 19616d56c5 | |||
| 89c4b2148e | |||
| e68a422cc8 | |||
| 2e93ad93e9 | |||
| c783ff969d | |||
| 4526430a38 | |||
| 3a0545852f | |||
| 0410e5dda9 | |||
| 0c230fa5f1 | |||
| ded28b62fb | |||
| 6834b3f9fe | |||
| 3379a9b18e | |||
| 9e871e4079 |
@@ -6,6 +6,5 @@ VITE_APP_ENV = 'development'
|
|||||||
|
|
||||||
# 金武联驾校/开发环境
|
# 金武联驾校/开发环境
|
||||||
VITE_APP_BASE_API = 'https://jwl.ahduima.com/'
|
VITE_APP_BASE_API = 'https://jwl.ahduima.com/'
|
||||||
|
|
||||||
#
|
#
|
||||||
VITE_WEB_BASE_URL = 'https://jwl.ahduima.com'
|
VITE_WEB_BASE_URL = 'https://jwl.ahduima.com'
|
||||||
14
src/App.vue
14
src/App.vue
@@ -1,16 +1,21 @@
|
|||||||
<script>
|
<script>
|
||||||
import useUserStore from '@/jtools/store/user'
|
import useUserStore from '@/jtools/store/user'
|
||||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||||
|
import storage from './jtools/storage'
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function () {
|
onLaunch: function (options) {
|
||||||
|
// 如果是二维码扫描过来的,需要保存公司id
|
||||||
|
if (options.query?.scene) {
|
||||||
|
storage.set('companyId', options.query?.scene)
|
||||||
|
}
|
||||||
useUserStore().queryVipList()
|
useUserStore().queryVipList()
|
||||||
useQuestionStore().getAllQuestion()
|
|
||||||
if (useUserStore().isLogin) {
|
if (useUserStore().isLogin) {
|
||||||
useUserStore().getUserInfo()
|
useUserStore().getUserInfo()
|
||||||
useUserStore().searchUserVip()
|
useUserStore().searchUserVip()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
|
useQuestionStore().getAllQuestion()
|
||||||
console.log('App Show')
|
console.log('App Show')
|
||||||
},
|
},
|
||||||
onHide: function () {
|
onHide: function () {
|
||||||
@@ -23,5 +28,8 @@ export default {
|
|||||||
/*每个页面公共css */
|
/*每个页面公共css */
|
||||||
@import "uni_modules/uview-plus/index.scss";
|
@import "uni_modules/uview-plus/index.scss";
|
||||||
@import "static/style/index.scss";
|
@import "static/style/index.scss";
|
||||||
button::after{ border: none;}
|
|
||||||
|
button::after {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -8,3 +8,20 @@ export function getAliCompanyInfo(data) {
|
|||||||
noToken: true
|
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
|
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) {
|
export function queryProjectList(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -64,7 +64,8 @@ export default class JtoolsPay {
|
|||||||
"description": this.order.description,
|
"description": this.order.description,
|
||||||
"money": this.order.money,
|
"money": this.order.money,
|
||||||
"outTradeNo": this.order.outTradeNo,
|
"outTradeNo": this.order.outTradeNo,
|
||||||
"userId": this.order.userId
|
"userId": this.order.userId,
|
||||||
|
"tradeType":'1'
|
||||||
}
|
}
|
||||||
if (uni.getStorageSync('openId')) {
|
if (uni.getStorageSync('openId')) {
|
||||||
params.openId = uni.getStorageSync('openId');
|
params.openId = uni.getStorageSync('openId');
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function service(options = {}) {
|
|||||||
title: res?.data?.message || '请重新登录',
|
title: res?.data?.message || '请重新登录',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
useUserStore().logout()
|
useUserStore().logoutWithoutToken()
|
||||||
//请求成功
|
//请求成功
|
||||||
resolved(res.data);
|
resolved(res.data);
|
||||||
} else if(res.data.code != '0000'&&res.data.code !='4001') {
|
} else if(res.data.code != '0000'&&res.data.code !='4001') {
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import {
|
|||||||
import http from '@/jtools/request/index';
|
import http from '@/jtools/request/index';
|
||||||
import {
|
import {
|
||||||
queryQuestion,
|
queryQuestion,
|
||||||
getVersion
|
getVersion,
|
||||||
|
querySysConfig
|
||||||
} from '@/jtools/api/question';
|
} from '@/jtools/api/question';
|
||||||
import storage from '@/jtools/storage';
|
import storage from '@/jtools/storage';
|
||||||
|
|
||||||
@@ -12,6 +13,7 @@ const question = defineStore({
|
|||||||
id: 'question',
|
id: 'question',
|
||||||
state: () => ({
|
state: () => ({
|
||||||
currentCartype: storage.get('carType') || '1001',
|
currentCartype: storage.get('carType') || '1001',
|
||||||
|
currentCarName: storage.get('carName') || '小车C1/C2/C3',
|
||||||
orderQuestion_subject1: storage.get('question_subject1') || [], //科目一顺序做题
|
orderQuestion_subject1: storage.get('question_subject1') || [], //科目一顺序做题
|
||||||
orderQuestion_subject4: storage.get('question_subject4') || [], //科目四顺序做题
|
orderQuestion_subject4: storage.get('question_subject4') || [], //科目四顺序做题
|
||||||
currentIndex_subject1: 0, //科目一索引 顺序做题
|
currentIndex_subject1: 0, //科目一索引 顺序做题
|
||||||
@@ -23,18 +25,36 @@ const question = defineStore({
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
actions: {
|
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() {
|
getAllQuestion() {
|
||||||
|
this.currentCartype = storage.get('carType') || '1001'
|
||||||
getVersion(this.currentCartype).then(resp => {
|
getVersion(this.currentCartype).then(resp => {
|
||||||
if (resp.code === '0000') {
|
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) {
|
if (this.version != resp.data) {
|
||||||
this.version = resp.data
|
this.version = resp.data
|
||||||
storage.set('version', resp.data)
|
storage.set('version', resp.data)
|
||||||
this.getOrderQuestion_sub1(true)
|
this.getOrderQuestion_sub1(true, urlOne)
|
||||||
this.getOrderQuestion_sub4(true)
|
this.getOrderQuestion_sub4(true, urlFour)
|
||||||
} else {
|
} else {
|
||||||
this.getOrderQuestion_sub1()
|
this.getOrderQuestion_sub1(false, urlOne)
|
||||||
this.getOrderQuestion_sub4()
|
this.getOrderQuestion_sub4(false, urlOne)
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -53,12 +73,12 @@ const question = defineStore({
|
|||||||
storage.set('curSubject', val)
|
storage.set('curSubject', val)
|
||||||
},
|
},
|
||||||
// 获取顺序做题科目1
|
// 获取顺序做题科目1
|
||||||
getOrderQuestion_sub1(isUpdate) {
|
getOrderQuestion_sub1(isUpdate, url) {
|
||||||
if (isUpdate) {
|
if (isUpdate) {
|
||||||
this.loading_subject1 = true
|
this.loading_subject1 = true
|
||||||
const that = this
|
const that = this
|
||||||
uni.request({
|
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) {
|
success(resp) {
|
||||||
if (resp.data) {
|
if (resp.data) {
|
||||||
that.orderQuestion_subject1 = resp.data.data
|
that.orderQuestion_subject1 = resp.data.data
|
||||||
@@ -99,7 +119,7 @@ const question = defineStore({
|
|||||||
this.loading_subject1 = true
|
this.loading_subject1 = true
|
||||||
const that = this
|
const that = this
|
||||||
uni.request({
|
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) {
|
success(resp) {
|
||||||
if (resp.data) {
|
if (resp.data) {
|
||||||
that.orderQuestion_subject1 = resp.data.data
|
that.orderQuestion_subject1 = resp.data.data
|
||||||
@@ -131,12 +151,12 @@ const question = defineStore({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 获取顺序做题科目4
|
// 获取顺序做题科目4
|
||||||
getOrderQuestion_sub4(isUpdate) {
|
getOrderQuestion_sub4(isUpdate, url) {
|
||||||
if (isUpdate) {
|
if (isUpdate) {
|
||||||
this.loading_subject4 = true
|
this.loading_subject4 = true
|
||||||
const that = this
|
const that = this
|
||||||
uni.request({
|
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) {
|
success(resp) {
|
||||||
if (resp.data) {
|
if (resp.data) {
|
||||||
that.orderQuestion_subject4 = resp.data.data
|
that.orderQuestion_subject4 = resp.data.data
|
||||||
@@ -177,7 +197,7 @@ const question = defineStore({
|
|||||||
this.loading_subject4 = true
|
this.loading_subject4 = true
|
||||||
const that = this
|
const that = this
|
||||||
uni.request({
|
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) {
|
success(resp) {
|
||||||
if (resp.data) {
|
if (resp.data) {
|
||||||
that.orderQuestion_subject4 = resp.data.data
|
that.orderQuestion_subject4 = resp.data.data
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
import { login, logout, getInfo } from '@/jtools/api/login';
|
import { login, logout, getInfo } from '@/jtools/api/login';
|
||||||
import { queryVip,getVipList } from '@/jtools/api/vip'
|
import { queryVip, getVipList } from '@/jtools/api/vip';
|
||||||
import constants from '@/jtools/constants';
|
import constants from '@/jtools/constants';
|
||||||
import storage from '@/jtools/storage';
|
import storage from '@/jtools/storage';
|
||||||
|
|
||||||
@@ -23,10 +23,11 @@ const useUserStore = defineStore({
|
|||||||
// 保存登录信息,用于重新登录
|
// 保存登录信息,用于重新登录
|
||||||
this.isLogin = true;
|
this.isLogin = true;
|
||||||
this.token = resp.data.token;
|
this.token = resp.data.token;
|
||||||
this.userInfo = resp.data
|
this.userInfo = resp.data;
|
||||||
storage.set('isLogin', true)
|
storage.set('isLogin', true);
|
||||||
storage.set('token', resp.data.token)
|
storage.set('token', resp.data.token);
|
||||||
storage.set('userInfo', resp.data)
|
storage.set('userInfo', resp.data);
|
||||||
|
storage.remove('companyId');
|
||||||
resolve(resp.data);
|
resolve(resp.data);
|
||||||
} else {
|
} else {
|
||||||
reject();
|
reject();
|
||||||
@@ -39,44 +40,53 @@ const useUserStore = defineStore({
|
|||||||
this.resetUserData();
|
this.resetUserData();
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
})
|
});
|
||||||
resolve();
|
resolve();
|
||||||
})
|
});
|
||||||
|
},
|
||||||
|
//过期登出
|
||||||
|
logoutWithoutToken(force = false) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.resetUserData();
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
getUserInfo() {
|
getUserInfo() {
|
||||||
getInfo().then(resp => {
|
getInfo().then(resp => {
|
||||||
if (resp.code == '0000') {
|
if (resp.code == '0000') {
|
||||||
this.userInfo = resp.data
|
this.userInfo = resp.data;
|
||||||
storage.set('userInfo', resp.data)
|
storage.set('userInfo', resp.data);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
resetUserData() {
|
resetUserData() {
|
||||||
this.isLogin = false;
|
this.isLogin = false;
|
||||||
this.token = '';
|
this.token = '';
|
||||||
this.userInfo = {}
|
this.userInfo = {};
|
||||||
this.vipOnList = []
|
this.vipOnList = [];
|
||||||
storage.remove('isLogin')
|
storage.remove('isLogin');
|
||||||
storage.remove('token')
|
storage.remove('token');
|
||||||
storage.remove('userInfo')
|
storage.remove('userInfo');
|
||||||
},
|
},
|
||||||
// 查询当前用户的vip开通情况
|
// 查询当前用户的vip开通情况
|
||||||
async searchUserVip() {
|
async searchUserVip() {
|
||||||
const resp=await queryVip({ carTypeId: this.currentCartype,memberId: null, subject:'' })
|
this.currentCartype = storage.get('carType') || '1001';
|
||||||
|
const resp = await queryVip({ carTypeId: this.currentCartype, memberId: null, subject: '' });
|
||||||
if (resp.code == '0000') {
|
if (resp.code == '0000') {
|
||||||
this.vipOnList = resp.data
|
this.vipOnList = resp.data;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 查询所有的vip
|
// 查询所有的vip
|
||||||
queryVipList() {
|
queryVipList() {
|
||||||
|
this.currentCartype = storage.get('carType') || '1001';
|
||||||
getVipList({ carTypeId: this.currentCartype, memberId: null, subject: '' }).then(resp => {
|
getVipList({ carTypeId: this.currentCartype, memberId: null, subject: '' }).then(resp => {
|
||||||
if (resp.code == '0000') {
|
if (resp.code == '0000') {
|
||||||
this.vipAllList = resp.data
|
this.vipAllList = resp.data;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default useUserStore;
|
export default useUserStore;
|
||||||
|
|||||||
@@ -105,6 +105,13 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/index/testTip",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "模拟考试",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/login/login",
|
"path": "pages/login/login",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -159,6 +166,13 @@
|
|||||||
"navigationBarTitleText": "考前密卷",
|
"navigationBarTitleText": "考前密卷",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/me/changeCarType",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "切换车型",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@@ -41,11 +41,11 @@
|
|||||||
<view class="mt5">VIP课程</view>
|
<view class="mt5">VIP课程</view>
|
||||||
</view>
|
</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">
|
<view class="text-center wp100">
|
||||||
<image style="width: 72rpx;height: 72rpx;margin: 0 auto" src="../../static/image/index/500icon.png">
|
<image style="width: 72rpx;height: 72rpx;margin: 0 auto" src="../../static/image/index/500icon.png">
|
||||||
</image>
|
</image>
|
||||||
<view class="mt5">精简500题</view>
|
<view class="mt5">精简{{titleNum}}题</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wp33 flex ai-c jc-c" @tap="toExclusive">
|
<view class="wp33 flex ai-c jc-c" @tap="toExclusive">
|
||||||
@@ -78,11 +78,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</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="video-box">
|
||||||
<view class="flex jc-sb ai-c wp100">
|
<view class="flex jc-sb ai-c wp100">
|
||||||
<text style="color: #05C341;font-size: 36rpx;">科{{subject==1?'一':'四'}}精品视频课</text>
|
<text style="color: #05C341;font-size: 36rpx;">科{{subject==1?'一':'四'}}精品视频课</text>
|
||||||
<!-- <text class="cor-666 fs12">全部10节课 ></text> -->
|
|
||||||
</view>
|
</view>
|
||||||
<view class="flex ai-c mt20">
|
<view class="flex ai-c mt20">
|
||||||
<view class="contain-box relative">
|
<view class="contain-box relative">
|
||||||
@@ -97,7 +96,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -110,6 +109,7 @@
|
|||||||
import storage from '@/jtools/storage';
|
import storage from '@/jtools/storage';
|
||||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||||
import {
|
import {
|
||||||
|
querySysConfig,
|
||||||
queryQuestionId,
|
queryQuestionId,
|
||||||
getTestQuestionId
|
getTestQuestionId
|
||||||
} from '@/jtools/api/question';
|
} from '@/jtools/api/question';
|
||||||
@@ -127,11 +127,12 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
titleNum:500,
|
||||||
allQuestionNum: 0,
|
allQuestionNum: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.getTitle()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useUserStore, ["vipOnList", "token"]),
|
...mapState(useUserStore, ["vipOnList", "token"]),
|
||||||
@@ -143,6 +144,15 @@
|
|||||||
methods: {
|
methods: {
|
||||||
...mapActions(useUserStore, ['searchUserVip']),
|
...mapActions(useUserStore, ['searchUserVip']),
|
||||||
...mapActions(useQuestionStore, ['getOrderQuestion_sub1', 'getOrderQuestion_sub4', 'getAllQuestion']),
|
...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() {
|
async toTestRoom() {
|
||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url:"/pages/index/trueTest"
|
// url:"/pages/index/trueTest"
|
||||||
@@ -214,7 +224,7 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
toAnswer(title, val) {
|
toAnswer(title, val) {
|
||||||
if (title == '精简500题') {
|
if (title == `精简${this.titleNum}题`) {
|
||||||
queryQuestionId({
|
queryQuestionId({
|
||||||
versionId: this.version,
|
versionId: this.version,
|
||||||
carTypeId: storage.get('carType') || '1001',
|
carTypeId: storage.get('carType') || '1001',
|
||||||
@@ -225,6 +235,7 @@
|
|||||||
if (this.token) {
|
if (this.token) {
|
||||||
await this.searchUserVip()
|
await this.searchUserVip()
|
||||||
const result = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
const result = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||||
|
let arr = []
|
||||||
if (result) {
|
if (result) {
|
||||||
if(resp.data&&resp.data.length){
|
if(resp.data&&resp.data.length){
|
||||||
const listJson = JSON.stringify(resp.data)
|
const listJson = JSON.stringify(resp.data)
|
||||||
@@ -240,9 +251,9 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (resp.data && resp.data.length > 3) {
|
if (resp.data && resp.data.length > 3) {
|
||||||
const arr = resp.data.slice(0, 3)
|
arr = resp.data.slice(0, 3)
|
||||||
} else {
|
} else {
|
||||||
const arr = resp.data
|
arr = resp.data
|
||||||
}
|
}
|
||||||
if(arr&&arr.length){
|
if(arr&&arr.length){
|
||||||
const listJson = JSON.stringify(arr)
|
const listJson = JSON.stringify(arr)
|
||||||
@@ -289,7 +300,7 @@
|
|||||||
const arr = resp.data
|
const arr = resp.data
|
||||||
const listJson = JSON.stringify(arr)
|
const listJson = JSON.stringify(arr)
|
||||||
uni.navigateTo({
|
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') {
|
} else if (resp.code === '4001') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -308,6 +319,7 @@
|
|||||||
...param
|
...param
|
||||||
}).then(async (resp) => {
|
}).then(async (resp) => {
|
||||||
if (resp.code === '0000') {
|
if (resp.code === '0000') {
|
||||||
|
let arr = []
|
||||||
if (this.token) {
|
if (this.token) {
|
||||||
await this.searchUserVip()
|
await this.searchUserVip()
|
||||||
const result = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
const result = this.vipOnList.some(item => item.subjects.includes(this.subject))
|
||||||
@@ -317,13 +329,13 @@
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (resp.data && resp.data.length > 3) {
|
if (resp.data && resp.data.length > 3) {
|
||||||
const arr = resp.data.slice(0, 3)
|
arr = resp.data.slice(0, 3)
|
||||||
} else {
|
} else {
|
||||||
const arr = resp.data
|
arr = resp.data
|
||||||
}
|
}
|
||||||
const listJson = JSON.stringify(arr)
|
const listJson = JSON.stringify(arr)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/questionBank/practiceExams?title=" + title + "&subject=" + this.subject + "&questionIdList=" + listJson+"&needVip="+result
|
url: "/pages/index/videoVip?subject=" + this.subject
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
await this.getDiverType()
|
// await this.getDiverType()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useUserStore, ["vipOnList", "token"])
|
...mapState(useUserStore, ["vipOnList", "token"])
|
||||||
@@ -134,9 +134,9 @@
|
|||||||
"subject": String(this.subject),
|
"subject": String(this.subject),
|
||||||
"type": "2"
|
"type": "2"
|
||||||
}).then(resp => {
|
}).then(resp => {
|
||||||
if (resp.code === '0000') {
|
if (resp.code === '0000' && resp.data &&resp.data.length) {
|
||||||
this.baseList = resp.data
|
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
|
const formatSecond = second > 59 ? 59 : second
|
||||||
return `${hours > 0 ? `${hours}:` : ''}${minute < 10 ? '0' + minute : minute}:${formatSecond < 10 ? '0' + formatSecond : formatSecond}`
|
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))
|
let arr = JSON.parse(JSON.stringify(this.operateList))
|
||||||
arr = arr.map(item => {
|
arr = arr.map(item => {
|
||||||
return {
|
return {
|
||||||
@@ -158,10 +166,17 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
let jsonString = JSON.stringify(arr)
|
let jsonString = JSON.stringify(arr)
|
||||||
|
console.log('arr',jsonString);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/questionBank/videoDetail?videoList=" + jsonString + "&subject=" + this.subject +
|
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) {
|
toOperateDetail(val) {
|
||||||
let arr = JSON.parse(JSON.stringify(this.baseList[0].videoList))
|
let arr = JSON.parse(JSON.stringify(this.baseList[0].videoList))
|
||||||
@@ -186,8 +201,10 @@
|
|||||||
"subject": String(this.subject),
|
"subject": String(this.subject),
|
||||||
"type": "1"
|
"type": "1"
|
||||||
}).then(resp => {
|
}).then(resp => {
|
||||||
|
if(resp.code==='0000'){
|
||||||
this.operateList = resp.data
|
this.operateList = resp.data
|
||||||
this.projectId = this.operateList[0]?.projectId
|
this.projectId = this.operateList[0]?.projectId
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getDiverType() {
|
getDiverType() {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<u-sticky bgColor="#fff">
|
<u-sticky bgColor="#fff">
|
||||||
<u-tabs :list="categoryList" :current="curTab" :scrollable="false" @change="changeCategory"></u-tabs>
|
<u-tabs :list="categoryList" :current="curTab" :scrollable="false" @change="changeCategory"></u-tabs>
|
||||||
</u-sticky>
|
</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'">
|
<template v-if="subject=='1' || subject=='4'">
|
||||||
<Subject1 :subject="subject" :rightList="rightList" :wrongList="wrongList" />
|
<Subject1 :subject="subject" :rightList="rightList" :wrongList="wrongList" />
|
||||||
</template>
|
</template>
|
||||||
@@ -41,6 +41,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
show:false,
|
||||||
subject: storage.get('curSubject') || '1',
|
subject: storage.get('curSubject') || '1',
|
||||||
curTab: 0,
|
curTab: 0,
|
||||||
searchValue: '',
|
searchValue: '',
|
||||||
@@ -50,25 +51,37 @@
|
|||||||
wrongList: storage.get(`wrongList_subject${this.subject}`) || [],
|
wrongList: storage.get(`wrongList_subject${this.subject}`) || [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
|
||||||
this.curTab=Number(this.curSubject)-1
|
|
||||||
this.getSubjectConfig()
|
|
||||||
},
|
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.show=true
|
||||||
|
this.getSubjectConfig()
|
||||||
if (this.subject == '1' || this.subject == '4') {
|
if (this.subject == '1' || this.subject == '4') {
|
||||||
this.rightList = storage.get(`rightList_subject${this.subject}`) || []
|
this.rightList = storage.get(`rightList_subject${this.subject}`) || []
|
||||||
this.wrongList = storage.get(`wrongList_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: {
|
computed: {
|
||||||
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1","curSubject"]), //映射函数,取出tagslist
|
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1","curSubject","orderQuestion_subject1","orderQuestion_subject4"]), //映射函数,取出tagslist
|
||||||
getLoading() {
|
getLoading() {
|
||||||
|
return this.loading_subject4 && this.loading_subject1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
getLoading(newVal){
|
||||||
|
if(this.show){
|
||||||
|
if(newVal){
|
||||||
if(this.loading_subject4 && this.loading_subject1){
|
if(this.loading_subject4 && this.loading_subject1){
|
||||||
uni.hideTabBar();
|
uni.hideTabBar();
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
uni.showTabBar()
|
uni.showTabBar()
|
||||||
}
|
}
|
||||||
return this.loading_subject4 && this.loading_subject1
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -84,6 +97,8 @@
|
|||||||
name: item.configItemName
|
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>
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
this.subject = option.subject || 1
|
this.subject = option.subject || 1
|
||||||
if(option.questionIdList){
|
if(option.questionIdList){
|
||||||
const idList=JSON.parse(op.questionIdList)
|
const idList=JSON.parse(option.questionIdList)
|
||||||
let arr = this[`orderQuestion_subject${this.subject}`].filter(qItem=>idList.includes(qItem.questionId))
|
let arr = this[`orderQuestion_subject${this.subject}`].filter(qItem=>idList.includes(qItem.questionId))
|
||||||
this.list = arr.map(it => ({
|
this.list = arr.map(it => ({
|
||||||
...it,
|
...it,
|
||||||
|
|||||||
@@ -1,36 +1,73 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="relative" style="height: 100vh;">
|
<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 style="height: 100%;overflow: scroll;background-color: #fff;">
|
||||||
<view class="p14">
|
<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 class="flex jc-sb ai-c wp100">
|
<view style="margin-bottom: 100px;">
|
||||||
<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 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>
|
<text class="fw600 fs12 cor-333">{{ item.memberName }}</text>
|
||||||
<view class="mt5">
|
<view class="mt5" v-if="!isIOS">
|
||||||
<text class="fs14" style="color: #FF6E02;">¥</text>
|
<text class="fs14" style="color: #FF6E02;">¥</text>
|
||||||
<text class="fs30 fw600" style="color: #FF6E02;">{{ item.price }}</text>
|
<text class="fs30 fw600" style="color: #FF6E02;">{{ item.price }}</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="fs12 cor-999">长期有效</text>
|
<view v-else class="mt5">
|
||||||
<view class="bottom_box fs12 cor-333" :class="checkedId===item.memberId?'checked_bottom':''">赠送vip题库</view>
|
<text class="fs14" style="color: #FF6E02;">iOS暂不支持</text>
|
||||||
|
</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">
|
<view class="tag" v-if="item.all">
|
||||||
<text style="transform:scale(0.83);">合买更优惠</text>
|
<text style="transform:scale(0.83);">合买更优惠</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt15 intr_box">
|
</view>
|
||||||
<view class="fw600 fs16 cor-000">免费获赠<text style="color: #FF6E02;">价值68元</text>的VIP题库</view>
|
<view class="intr_box p14">
|
||||||
<view class="flex ai-c jc-sb mt15">
|
<view class="fw600 fs16 cor-000">尊享以下权益</view>
|
||||||
<view class="flex ai-c">
|
<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>
|
<image style="width: 63rpx;height: 63rpx;margin-right: 5px;" src="../../static/image/index/vip500.png"></image>
|
||||||
<view class="vip_item">含精简500题</view>
|
|
||||||
</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>
|
<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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wp100 p14" style="position: absolute;left: 0;bottom:20px" @tap="handlePay()">
|
<view class="wp100 mt15" v-if="subject == '1' || subject == '4'">
|
||||||
|
<image class="wp100" mode="widthFix" :src="picUrl"></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-if="!isIOS" class="wp100 p14" style="position: absolute;left: 0;bottom:20px" @tap="handlePay()">
|
||||||
<view class="sub_btn flex ai-c jc-sb">
|
<view class="sub_btn flex ai-c jc-sb">
|
||||||
<text class="cor-fff fs14">¥<text class="fs24 cor-fff">{{ nowPrice }}</text></text>
|
<text class="cor-fff fs14">¥<text class="fs24 cor-fff">{{ nowPrice }}</text></text>
|
||||||
<image style="width: 276rpx;height: 88rpx;margin-top: -5px;" src="../../static/image/index/buy.png"></image>
|
<image style="width: 276rpx;height: 88rpx;margin-top: -5px;" src="../../static/image/index/buy.png"></image>
|
||||||
@@ -45,12 +82,15 @@
|
|||||||
mapActions
|
mapActions
|
||||||
} from 'pinia' //引入映射函数
|
} from 'pinia' //引入映射函数
|
||||||
import { getVipList } from '@/jtools/api/vip'
|
import { getVipList } from '@/jtools/api/vip'
|
||||||
|
import { querySysConfig } from '@/jtools/api/question';
|
||||||
import storage from '@/jtools/storage';
|
import storage from '@/jtools/storage';
|
||||||
import Pay from '@/jtools/pay/index.js';
|
import Pay from '@/jtools/pay/index.js';
|
||||||
import useUserStore from '@/jtools/store/user'
|
import useUserStore from '@/jtools/store/user'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
picUrl: '',
|
||||||
|
titleNum: 500,
|
||||||
subject: '1',
|
subject: '1',
|
||||||
loading: true,
|
loading: true,
|
||||||
nowPrice: 168,
|
nowPrice: 168,
|
||||||
@@ -59,22 +99,41 @@
|
|||||||
order: {
|
order: {
|
||||||
money: 0,
|
money: 0,
|
||||||
description: '会员充值'
|
description: '会员充值'
|
||||||
}
|
},
|
||||||
|
isIOS: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(op) {
|
onLoad(op) {
|
||||||
|
this.isIOS = this.$platform.device().includes('ios')
|
||||||
if (op.subject) {
|
if (op.subject) {
|
||||||
this.subject = op.subject
|
this.subject = op.subject
|
||||||
}
|
}
|
||||||
this.loading = true
|
this.loading = true
|
||||||
this.getVipList()
|
this.getVipList()
|
||||||
this.getWXOpenId()
|
this.getWXOpenId()
|
||||||
|
this.getTitle()
|
||||||
|
this.getPic()
|
||||||
this.$set(this.order, 'userId', this.userInfo.userId);
|
this.$set(this.order, 'userId', this.userInfo.userId);
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useUserStore, ["userInfo"])
|
...mapState(useUserStore, ["userInfo"])
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getPic() {
|
||||||
|
const currentCartype = storage.get('carType') || '1001'
|
||||||
|
querySysConfig(currentCartype, 'VipDescImageUrl').then(res => {
|
||||||
|
this.picUrl = JSON.parse(res.data.configJson).url
|
||||||
|
})
|
||||||
|
},
|
||||||
|
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() {
|
async handlePay() {
|
||||||
if (this.loading) {
|
if (this.loading) {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
@@ -93,9 +152,10 @@
|
|||||||
},
|
},
|
||||||
getVipList() {
|
getVipList() {
|
||||||
getVipList({
|
getVipList({
|
||||||
currentCartype: storage.get('carType') || '1001',
|
carTypeId: storage.get('carType') || '1001',
|
||||||
subject: this.subject
|
subject: this.subject
|
||||||
}).then(resp => {
|
}).then(resp => {
|
||||||
|
if (resp.code === '0000') {
|
||||||
this.priceList = resp.data
|
this.priceList = resp.data
|
||||||
this.checkedId = this.priceList[0].memberId
|
this.checkedId = this.priceList[0].memberId
|
||||||
this.order.outTradeNo = this.priceList[0].memberId
|
this.order.outTradeNo = this.priceList[0].memberId
|
||||||
@@ -106,6 +166,7 @@
|
|||||||
item.all = true
|
item.all = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
checkPrice(val, price) {
|
checkPrice(val, price) {
|
||||||
@@ -128,11 +189,12 @@
|
|||||||
border-radius: 16rpx 46rpx 16rpx 16rpx;
|
border-radius: 16rpx 46rpx 16rpx 16rpx;
|
||||||
padding: 14px;
|
padding: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checked_item {
|
.checked_item {
|
||||||
width: 228rpx;
|
|
||||||
background: #FFF0E5;
|
background: #FFF0E5;
|
||||||
border: 4px solid #FF6E02;
|
border: 4px solid #FF6E02;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom_box {
|
.bottom_box {
|
||||||
width: 214rpx;
|
width: 214rpx;
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
@@ -144,12 +206,14 @@
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.checked_bottom {
|
.checked_bottom {
|
||||||
width: 218rpx;
|
width: 218rpx;
|
||||||
border-radius: 0 0 16rpx 5rpx;
|
border-radius: 0 0 16rpx 5rpx;
|
||||||
background-color: #FF6E02;
|
background-color: #FF6E02;
|
||||||
color: #fff
|
color: #fff
|
||||||
}
|
}
|
||||||
|
|
||||||
.tag {
|
.tag {
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
height: 36rpx;
|
height: 36rpx;
|
||||||
@@ -163,6 +227,7 @@
|
|||||||
left: 10rpx;
|
left: 10rpx;
|
||||||
top: -18rpx
|
top: -18rpx
|
||||||
}
|
}
|
||||||
|
|
||||||
.intr_box {
|
.intr_box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -170,6 +235,7 @@
|
|||||||
background: #FFF0E5;
|
background: #FFF0E5;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vip_item {
|
.vip_item {
|
||||||
width: 208rpx;
|
width: 208rpx;
|
||||||
height: 54rpx;
|
height: 54rpx;
|
||||||
@@ -179,6 +245,7 @@
|
|||||||
background: #F3D7C2;
|
background: #F3D7C2;
|
||||||
border-radius: 0rpx 10rpx 10rpx 10rpx;
|
border-radius: 0rpx 10rpx 10rpx 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub_btn {
|
.sub_btn {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 110rpx;
|
height: 110rpx;
|
||||||
@@ -188,4 +255,19 @@
|
|||||||
border-radius: 55rpx;
|
border-radius: 55rpx;
|
||||||
padding: 14rpx;
|
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>
|
</style>
|
||||||
@@ -35,6 +35,7 @@
|
|||||||
login
|
login
|
||||||
} from '@/jtools/api/login'
|
} from '@/jtools/api/login'
|
||||||
import useUserStore from '@/jtools/store/user'
|
import useUserStore from '@/jtools/store/user'
|
||||||
|
import storage from '@/jtools/storage';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -80,7 +81,11 @@
|
|||||||
},
|
},
|
||||||
bindLogin() {
|
bindLogin() {
|
||||||
if (isPhone(this.login.phone) && this.login.code) {
|
if (isPhone(this.login.phone) && this.login.code) {
|
||||||
useUserStore().login(this.login).then(resp => {
|
let params = { ...this.login }
|
||||||
|
if (storage.get('companyId')) {
|
||||||
|
params.id = storage.get('companyId')
|
||||||
|
}
|
||||||
|
useUserStore().login(params).then(resp => {
|
||||||
if (resp.userId) {
|
if (resp.userId) {
|
||||||
useUserStore().getUserInfo()
|
useUserStore().getUserInfo()
|
||||||
useUserStore().searchUserVip()
|
useUserStore().searchUserVip()
|
||||||
@@ -160,5 +165,4 @@
|
|||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</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>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<view v-if="!isLogin || !vipOn.length" class="text-center">
|
<view v-if="!isLogin || !vipOn.length" class="text-center">
|
||||||
<view class="fs18 fwb" style="color: #7E4012FF;">开通VIP尊享以下权益</view>
|
<view class="fs18 fwb" style="color: #7E4012FF;">开通VIP尊享以下权益</view>
|
||||||
<view class="fs15" style="color: #7E4012FF;">精选500题 / 真是模考 / 考前密卷</view>
|
<view class="fs15" style="color: #7E4012FF;">精选500题 / 真是模考 / 考前密卷</view>
|
||||||
<view class="study fs16 text-center" style="margin: 25px auto 0;color: #F6E99FFF;">立即开通</view>
|
<view class="study fs16 text-center" style="margin: 25px auto 0;color: #F6E99FFF;">{{ isIOS ? 'iOS暂不可用' : '立即开通' }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-else-if="vipOn.length" class="text-center">
|
<view v-else-if="vipOn.length" class="text-center">
|
||||||
<view class="fs18 fwb" style="color: #7E4012FF;">{{ vipText }}</view>
|
<view class="fs18 fwb" style="color: #7E4012FF;">{{ vipText }}</view>
|
||||||
@@ -81,11 +81,16 @@
|
|||||||
<img src="/static/image/mine/wdtj.png" style="width: 24px;height: 24px;">
|
<img src="/static/image/mine/wdtj.png" style="width: 24px;height: 24px;">
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
<u-cell size="large" title="我的题库" value="小车">
|
<u-cell size="large" title="我的题库" :value="carName" @tap="toChangeCarType">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<img src="/static/image/mine/wdtk.png" style="width: 24px;height: 24px;">
|
<img src="/static/image/mine/wdtk.png" style="width: 24px;height: 24px;">
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
|
<u-cell size="large" title="联系我们" @tap="callPhoneNumber">
|
||||||
|
<template #icon>
|
||||||
|
<img src="/static/image/mine/callme.png" style="width: 24px;height: 24px;">
|
||||||
|
</template>
|
||||||
|
</u-cell>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isLogin" class="flex ai-c jc-c mt12 br8 bc-fff" style="height: 50px;" @tap="handleLogout">
|
<view v-if="isLogin" class="flex ai-c jc-c mt12 br8 bc-fff" style="height: 50px;" @tap="handleLogout">
|
||||||
@@ -96,6 +101,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import useUserStore from '@/jtools/store/user'
|
import useUserStore from '@/jtools/store/user'
|
||||||
|
import storage from '@/jtools/storage';
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
components: {},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -136,12 +142,30 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
};
|
carName: storage.get('carName') || '小车C1/C2/C3',
|
||||||
|
isIOS: true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.isIOS = this.$platform.device().includes('ios')
|
||||||
|
this.carName = storage.get('carName') || '小车C1/C2/C3'
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 拨打电话
|
||||||
|
callPhoneNumber() {
|
||||||
|
uni.makePhoneCall({
|
||||||
|
phoneNumber: '15105693067'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
toChangeCarType() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/me/changeCarType"
|
||||||
|
})
|
||||||
|
},
|
||||||
handleVip() {
|
handleVip() {
|
||||||
|
if (this.isIOS) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
// if (this.vipOn.length) {
|
// if (this.vipOn.length) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -181,8 +205,12 @@ export default {
|
|||||||
},
|
},
|
||||||
handleTJ() {
|
handleTJ() {
|
||||||
if (this.isLogin) {
|
if (this.isLogin) {
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url: '/pages/me/tijian'
|
// url: '/pages/me/tijian'
|
||||||
|
// })
|
||||||
|
uni.showToast({
|
||||||
|
title: '敬请期待',
|
||||||
|
icon: 'none'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.toLogin()
|
this.toLogin()
|
||||||
|
|||||||
@@ -1,28 +1,50 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="p15 bc-f5">
|
<view class="p15 bc-f5">
|
||||||
<view class="br8 bc-fff p15lr">
|
<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="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" />
|
<u-icon name="arrow-right" color="#999" />
|
||||||
</view>
|
</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="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" />
|
<u-icon name="arrow-right" color="#999" />
|
||||||
</view>
|
</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>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import storage from '@/jtools/storage';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
sfzNum:storage.get('sfzNum') || ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onShow(){
|
||||||
|
this.sfzNum=storage.get('sfzNum') || ''
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
toUploadPic(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/me/uploadPic'
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -24,11 +24,11 @@
|
|||||||
<view class="mt20">
|
<view class="mt20">
|
||||||
<view class="title fontColor">第二步 核实后再提交</view>
|
<view class="title fontColor">第二步 核实后再提交</view>
|
||||||
<u--form labelPosition="left" labelWidth="80" :model="form" :rules="rules" ref="form1">
|
<u--form labelPosition="left" labelWidth="80" :model="form" :rules="rules" ref="form1">
|
||||||
<u-form-item label="姓名" :required="true" prop="name" borderBottom ref="item1">
|
<u-form-item label="姓名" :required="true" prop="idCardName" borderBottom ref="item1">
|
||||||
<u--input v-model="form.name" border="none"></u--input>
|
<u--input v-model="form.idCardName" border="none"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="身份证号" :required="true" prop="idNum" borderBottom ref="item2">
|
<u-form-item label="身份证号" :required="true" prop="sfzmhm" borderBottom ref="item2">
|
||||||
<u--input v-model="form.idNum" border="none"></u--input>
|
<u--input v-model="form.sfzmhm" border="none"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</u--form>
|
</u--form>
|
||||||
</view>
|
</view>
|
||||||
@@ -42,6 +42,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import storage from '@/jtools/storage';
|
import storage from '@/jtools/storage';
|
||||||
|
import {
|
||||||
|
addInfo,
|
||||||
|
} from '@/jtools/api/index';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
const shenfenzhen = (rule, value, callback) => {
|
const shenfenzhen = (rule, value, callback) => {
|
||||||
@@ -50,20 +53,21 @@
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
name: '',
|
idCardName: '',
|
||||||
idNum: ''
|
sfzmhm: ''
|
||||||
},
|
},
|
||||||
|
driverLicenseImg:'',
|
||||||
fileList:[],
|
fileList:[],
|
||||||
fileList1: [],
|
fileList1: [],
|
||||||
uploadList: [],
|
uploadList: [],
|
||||||
saving: false,
|
saving: false,
|
||||||
rules: {
|
rules: {
|
||||||
name: [{
|
idCardName: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入姓名',
|
message: '请输入姓名',
|
||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
}],
|
}],
|
||||||
idNum: [{
|
sfzmhm: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入身份证号',
|
message: '请输入身份证号',
|
||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
@@ -78,13 +82,6 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onReady() {
|
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);
|
this.$refs.form1.setRules(this.rules);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -95,7 +92,17 @@
|
|||||||
},
|
},
|
||||||
// 新增图片
|
// 新增图片
|
||||||
async afterRead(event) {
|
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 为数组格式,否则为对象格式
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||||
const lists = [].concat(event.file);
|
const lists = [].concat(event.file);
|
||||||
this.fileList=lists
|
this.fileList=lists
|
||||||
@@ -129,10 +136,12 @@
|
|||||||
this.$refs.form1.validate().then((valid) => {
|
this.$refs.form1.validate().then((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const param={
|
const param={
|
||||||
file:this.fileList,
|
driverLicenseImg:this.driverLicenseImg,
|
||||||
...this.form
|
...this.form,
|
||||||
|
schoolOrgCode:'340103000700',
|
||||||
|
operater:'1d08daf852cf4ee28f67cb583f538cbf'
|
||||||
}
|
}
|
||||||
storage.set('photoForm',param)
|
addInfo(param).then(resp=>{
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title:"提交成功!",
|
title:"提交成功!",
|
||||||
duration:2000,
|
duration:2000,
|
||||||
@@ -140,51 +149,34 @@
|
|||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
},1000)
|
},1000)
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
console.log('验证失败');
|
console.log('验证失败');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
async compressImage(image) {
|
urlTobase64(url){
|
||||||
const img = new Image();
|
let base64=''
|
||||||
img.src = image.url;
|
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>
|
</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" /> -->
|
<!-- <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:300rpx;background-color: rgb(247, 255, 255);border-radius: 20rpx;">
|
||||||
<view style="width: 320rpx;height:240rpx;" class="flex jc-c ai-c">
|
<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>
|
</image>
|
||||||
<u-avatar v-else class="br-p50 overflow-h" :size="64" mp-avatar shape="circle"></u-avatar>
|
<u-avatar v-else class="br-p50 overflow-h" :size="64" mp-avatar shape="circle"></u-avatar>
|
||||||
</view>
|
</view>
|
||||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="1" width="150"
|
<u-upload :fileList="fileList1" :maxSize="500 * 1024" @oversize="oversize" @afterRead="afterRead"
|
||||||
height="150">
|
@delete="deletePic" multiple :maxCount="1" width="150" height="150">
|
||||||
<view
|
<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">
|
class="text-center cor-fff">
|
||||||
点击
|
点击
|
||||||
</view>
|
</view>
|
||||||
@@ -24,17 +24,17 @@
|
|||||||
<view class="mt20">
|
<view class="mt20">
|
||||||
<view class="title fontColor">第二步 核实后再提交</view>
|
<view class="title fontColor">第二步 核实后再提交</view>
|
||||||
<u--form labelPosition="left" labelWidth="80" :model="form" :rules="rules" ref="form1">
|
<u--form labelPosition="left" labelWidth="80" :model="form" :rules="rules" ref="form1">
|
||||||
<u-form-item label="姓名" :required="true" prop="name" borderBottom ref="item1">
|
<u-form-item label="姓名" :required="true" prop="idCardName" borderBottom ref="item1">
|
||||||
<u--input v-model="form.name" border="none"></u--input>
|
<u--input v-model="form.idCardName" border="none"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="身份证号" :required="true" prop="idNum" borderBottom ref="item2">
|
<u-form-item label="身份证号" :required="true" prop="sfzmhm" borderBottom ref="item2">
|
||||||
<u--input v-model="form.idNum" border="none"></u--input>
|
<u--input v-model="form.sfzmhm" border="none"></u--input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
</u--form>
|
</u--form>
|
||||||
</view>
|
</view>
|
||||||
<view style="margin-top: 20px;">
|
<view style="margin-top: 20px;">
|
||||||
<u-button type="primary" :style="{width: '100%',borderRadius:'40rpx'}" :disabled="saving" text="提交"
|
<u-button type="primary" :style="{width: '100%',borderRadius:'40rpx',backgroundColor:'#05C341'}"
|
||||||
@click="submit" />
|
:disabled="saving" text="提交" @click="submit" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -42,6 +42,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import storage from '@/jtools/storage';
|
import storage from '@/jtools/storage';
|
||||||
|
import {
|
||||||
|
addInfo,
|
||||||
|
} from '@/jtools/api/index';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
const shenfenzhen = (rule, value, callback) => {
|
const shenfenzhen = (rule, value, callback) => {
|
||||||
@@ -50,19 +53,21 @@
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
name: '',
|
idCardName: '',
|
||||||
idNum: ''
|
sfzmhm: storage.get('sfzNum') || ''
|
||||||
},
|
},
|
||||||
|
driverLicenseImg: '',
|
||||||
|
fileList: [],
|
||||||
fileList1: [],
|
fileList1: [],
|
||||||
uploadList: [],
|
uploadList: [],
|
||||||
saving: false,
|
saving: false,
|
||||||
rules: {
|
rules: {
|
||||||
name: [{
|
idCardName: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入姓名',
|
message: '请输入姓名',
|
||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
}],
|
}],
|
||||||
idNum: [{
|
sfzmhm: [{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入身份证号',
|
message: '请输入身份证号',
|
||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
@@ -77,17 +82,17 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onReady() {
|
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);
|
this.$refs.form1.setRules(this.rules);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
// 文件超出大小限制
|
||||||
|
oversize() {
|
||||||
|
uni.showToast({
|
||||||
|
title: "图片最大不能超过500k",
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
},
|
||||||
// 删除图片
|
// 删除图片
|
||||||
deletePic(event) {
|
deletePic(event) {
|
||||||
this.fileList1.splice(event.index, 1);
|
this.fileList1.splice(event.index, 1);
|
||||||
@@ -95,43 +100,44 @@
|
|||||||
},
|
},
|
||||||
// 新增图片
|
// 新增图片
|
||||||
async afterRead(event) {
|
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 为数组格式,否则为对象格式
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
||||||
const lists = [].concat(event.file);
|
const lists = [].concat(event.file);
|
||||||
this.fileList1 = lists;
|
this.fileList = lists
|
||||||
|
this.fileList1 = [];
|
||||||
uni.showToast({
|
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() {
|
submit() {
|
||||||
this.$refs.form1.validate().then((valid) => {
|
this.$refs.form1.validate().then((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const param = {
|
const param = {
|
||||||
file:this.fileList1,
|
driverLicenseImg: this.driverLicenseImg,
|
||||||
...this.form
|
...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({
|
uni.showToast({
|
||||||
title: "提交成功!",
|
title: "提交成功!",
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
@@ -139,51 +145,49 @@
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
},
|
||||||
|
fail: () => {},
|
||||||
|
|
||||||
|
});
|
||||||
|
// addInfo(param).then(resp=>{
|
||||||
|
// if(resp.code==='0000'){
|
||||||
|
// uni.showToast({
|
||||||
|
// title:"提交成功!",
|
||||||
|
// duration:2000,
|
||||||
|
// })
|
||||||
|
// setTimeout(()=>{
|
||||||
|
// uni.navigateBack()
|
||||||
|
// },1000)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
} else {
|
} else {
|
||||||
console.log('验证失败');
|
console.log('验证失败');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
async compressImage(image) {
|
urlTobase64(url) {
|
||||||
const img = new Image();
|
let base64 = ''
|
||||||
img.src = image.url;
|
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>
|
</script>
|
||||||
@@ -214,4 +218,9 @@
|
|||||||
::v-deep .u-button--square {
|
::v-deep .u-button--square {
|
||||||
border-radius: 40rpx !important;
|
border-radius: 40rpx !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::v-deep .u-button--primary {
|
||||||
|
background-color: #05C341 !important;
|
||||||
|
border-color: #05C341 !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
<template>
|
<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>
|
<u-sticky>
|
||||||
<view class="flex ai-c">
|
<view class="flex ai-c">
|
||||||
<view v-for="(item, index) in vipAllList" :key="index" class="km-item" :class="{ actived: index == current }"
|
<view v-for="(item, index) in vipAllList" :key="index" class="km-item" :class="{ actived: index == current }"
|
||||||
@@ -9,10 +11,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</u-sticky>
|
</u-sticky>
|
||||||
<view class="mt15">
|
<view class="mt15">
|
||||||
<swiper class="swiper" :current="current" style="height: 120px;" :autoplay="false" :display-multiple-items="1.45"
|
<swiper class="swiper" :current="current" style="height: 120px;" :autoplay="false"
|
||||||
:disable-programmatic-animation="true" @change="onChange">
|
:display-multiple-items="1.45" :disable-programmatic-animation="true" @change="onChange">
|
||||||
<swiper-item v-for="(item, index) in vipAllList" :key="index">
|
<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> -->
|
<!-- <image src="" mode="widthFix" style="width:95%;"></image> -->
|
||||||
<view class="vip-info">
|
<view class="vip-info">
|
||||||
<u-avatar class="br-p50 overflow-h" style="border: 3px solid #873E1D;" :size="35" mp-avatar></u-avatar>
|
<u-avatar class="br-p50 overflow-h" style="border: 3px solid #873E1D;" :size="35" mp-avatar></u-avatar>
|
||||||
@@ -110,7 +113,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="ml15 text-center">
|
<view class="ml15 text-center">
|
||||||
<u-button :customStyle="{width:'200rpx',height:'66rpx',borderRadius: '33rpx'}" iconColor="#fff"
|
<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>
|
</u-button>
|
||||||
<view class="cor-333 fs15 fw600 mt10">真实考场模拟</view>
|
<view class="cor-333 fs15 fw600 mt10">真实考场模拟</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -121,12 +125,27 @@
|
|||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
mapState,
|
||||||
|
mapActions
|
||||||
|
} from 'pinia' //引入映射函数
|
||||||
|
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||||
import useUserStore from '@/jtools/store/user'
|
import useUserStore from '@/jtools/store/user'
|
||||||
|
import {
|
||||||
|
queryQuestionId,
|
||||||
|
getTestQuestionId
|
||||||
|
} from '@/jtools/api/question';
|
||||||
|
import storage from '@/jtools/storage';
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1", "version"]), //映射函数,取出tagslist
|
||||||
|
getLoading() {
|
||||||
|
return this.loading_subject4 && this.loading_subject1
|
||||||
|
},
|
||||||
vipAllList() {
|
vipAllList() {
|
||||||
return useUserStore().vipAllList.filter(it => [1, 2, 3, 4].includes(Number(it.subjects)))
|
return useUserStore().vipAllList.filter(it => [1, 2, 3, 4].includes(Number(it.subjects)))
|
||||||
},
|
},
|
||||||
@@ -141,6 +160,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapActions(useQuestionStore, ['getOrderQuestion_sub1', 'getOrderQuestion_sub4', 'getAllQuestion']),
|
||||||
chargeVip(item) {
|
chargeVip(item) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/index/videoVip?subject=" + item.subjects
|
url: "/pages/index/videoVip?subject=" + item.subjects
|
||||||
@@ -165,7 +185,8 @@ export default {
|
|||||||
return '开通vip助您快速拿证'
|
return '开通vip助您快速拿证'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
vipHasOpened(item) {;
|
vipHasOpened(item) {
|
||||||
|
;
|
||||||
return !!this.vipOnList.some(it => it.subjects.includes(item.subjects))
|
return !!this.vipOnList.some(it => it.subjects.includes(item.subjects))
|
||||||
},
|
},
|
||||||
// 去精选500题 item=> 当前科目vip信息
|
// 去精选500题 item=> 当前科目vip信息
|
||||||
@@ -173,8 +194,33 @@ export default {
|
|||||||
// 当前vip是否已开通
|
// 当前vip是否已开通
|
||||||
if (this.vipHasOpened(item)) {
|
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({
|
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 {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -204,7 +250,7 @@ export default {
|
|||||||
if (this.vipHasOpened(item)) {
|
if (this.vipHasOpened(item)) {
|
||||||
// 跳转
|
// 跳转
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:"/pages/questionBank/practiceExams?subject="+item.subjects+'&title=考前密卷&isExam1=1'
|
url: "/pages/index/secretPapers?subject=" + item.subjects
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -334,12 +380,14 @@ export default {
|
|||||||
border: 2rpx solid #CF8B6D;
|
border: 2rpx solid #CF8B6D;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.contain-box {
|
.contain-box {
|
||||||
width: 406rpx;
|
width: 406rpx;
|
||||||
height: 228rpx;
|
height: 228rpx;
|
||||||
background: #00B74F;
|
background: #00B74F;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.play_btn_2 {
|
.play_btn_2 {
|
||||||
width: 65rpx;
|
width: 65rpx;
|
||||||
height: 65rpx;
|
height: 65rpx;
|
||||||
|
|||||||
@@ -7,9 +7,8 @@
|
|||||||
:class="tCurrent==item.value?'checked':'unchecked'" @tap="sectionChange(item.value)">{{item.label}}</view>
|
:class="tCurrent==item.value?'checked':'unchecked'" @tap="sectionChange(item.value)">{{item.label}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<swiper class="swiper mt20" :current="swiperIndex" :duration="duration" :autoplay="false"
|
<swiper class="swiper mt20" :current="swiperIndex" :duration="duration" :autoplay="false" @change="onChange"
|
||||||
@change="onChange" @animationfinish="onAnimationfinish"
|
@animationfinish="onAnimationfinish" @touchend="touchEnd">
|
||||||
@touchend="touchEnd">
|
|
||||||
<swiper-item v-for="(quesItem,quesIndex) in swiperList" :key="quesIndex.questionId">
|
<swiper-item v-for="(quesItem,quesIndex) in swiperList" :key="quesIndex.questionId">
|
||||||
<scroll-view scroll-y="true" class="swiper-scroll">
|
<scroll-view scroll-y="true" class="swiper-scroll">
|
||||||
<view>
|
<view>
|
||||||
@@ -17,8 +16,10 @@
|
|||||||
<text class="tag_box">{{getQuestType(quesItem.type)}}</text>
|
<text class="tag_box">{{getQuestType(quesItem.type)}}</text>
|
||||||
<text class="fs18" style="line-height: 42rpx;vertical-align: middle;">{{quesItem.question}}</text>
|
<text class="fs18" style="line-height: 42rpx;vertical-align: middle;">{{quesItem.question}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="p14" v-if="quesItem.imageUrl">
|
<view class="p14 flex jc-c ai-c" v-if="quesItem.imageUrl">
|
||||||
<image v-show="quesItem.imageUrl" style="width: 100%;height: auto;" mode="widthFix" :lazy-load="true" @load="onoff='1'" :src="quesItem.imageUrl"></image>
|
<image v-show="quesItem.imageUrl" style="width: auto;max-height:40vh;" mode="heightFix"
|
||||||
|
:lazy-load="true" @load="onoff='1'" :src="quesItem.imageUrl" @click="preview(quesItem.imageUrl)">
|
||||||
|
</image>
|
||||||
</view>
|
</view>
|
||||||
<template v-if="quesItem.type!='3'">
|
<template v-if="quesItem.type!='3'">
|
||||||
<view class="flex m14lr ai-c mt20" v-for="(item,index) in quesItem.optionList" :key="item.op"
|
<view class="flex m14lr ai-c mt20" v-for="(item,index) in quesItem.optionList" :key="item.op"
|
||||||
@@ -41,7 +42,21 @@
|
|||||||
v-if="quesItem.clickAnswer&&!quesItem.trueAnswer.includes(quesItem.clickAnswer) || showBestAnswer">
|
v-if="quesItem.clickAnswer&&!quesItem.trueAnswer.includes(quesItem.clickAnswer) || showBestAnswer">
|
||||||
<view class="answer_box">
|
<view class="answer_box">
|
||||||
<text class="fs18 fw600 cor-000">答案:{{getRightOp(quesItem.trueAnswer)}}</text>
|
<text class="fs18 fw600 cor-000">答案:{{getRightOp(quesItem.trueAnswer)}}</text>
|
||||||
<view class="fs18 cor-000" style="text-indent:2em;"> {{quesItem.bestAnswer}}</view>
|
<view v-if="showSkillInfo==='show'&&quesItem.skillInfo" class="fs18 cor-000 mt5">
|
||||||
|
答题技巧:{{quesItem.skillInfo}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex ai-c jc-c mt10">
|
||||||
|
<view style="height: 6rpx;width: 120rpx;background-color: rgb(232, 232, 232);"></view>
|
||||||
|
<view class="fs18 fw600 cor-000 p15lr">试题详解</view>
|
||||||
|
<view style="height: 6rpx;width: 120rpx;background-color: rgb(232, 232, 232);"></view>
|
||||||
|
</view>
|
||||||
|
<view class="mt10">
|
||||||
|
<view class="fw600 cor-000 mb10 flex ai-c">
|
||||||
|
<view
|
||||||
|
style="background: linear-gradient(90deg, #11DF20 0%, #00B74F 100%);height: 36rpx;width: 8rpx;"
|
||||||
|
class="mr5"></view>题目解析
|
||||||
|
</view>
|
||||||
|
<view style="text-indent:2em;">{{quesItem.bestAnswer}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -82,7 +97,21 @@
|
|||||||
<view class="m14lr mt30" v-if="isShowAnswer">
|
<view class="m14lr mt30" v-if="isShowAnswer">
|
||||||
<view class="answer_box">
|
<view class="answer_box">
|
||||||
<text class="fs18 fw600 cor-000">答案:{{getRightOp(quesItem.trueAnswer)}}</text>
|
<text class="fs18 fw600 cor-000">答案:{{getRightOp(quesItem.trueAnswer)}}</text>
|
||||||
<view class="fs18 cor-000" style="text-indent:2em;"> {{quesItem.bestAnswer}}</view>
|
<view v-if="showSkillInfo==='show'&&quesItem.skillInfo" class="fs18 cor-000">
|
||||||
|
答题技巧:{{quesItem.skillInfo}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="flex ai-c jc-c mt10">
|
||||||
|
<view style="height: 6rpx;width: 120rpx;background-color: rgb(232, 232, 232);"></view>
|
||||||
|
<view class="fs18 fw600 cor-000 p15lr">试题详解</view>
|
||||||
|
<view style="height: 6rpx;width: 120rpx;background-color: rgb(232, 232, 232);"></view>
|
||||||
|
</view>
|
||||||
|
<view class="mt10">
|
||||||
|
<view class="fw600 cor-000 mb10 flex ai-c">
|
||||||
|
<view
|
||||||
|
style="background: linear-gradient(90deg, #11DF20 0%, #00B74F 100%);height: 36rpx;width: 8rpx;"
|
||||||
|
class="mr5"></view>题目解析
|
||||||
|
</view>
|
||||||
|
<view style="text-indent:2em;">{{quesItem.bestAnswer}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -90,6 +119,7 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
</swiper>
|
</swiper>
|
||||||
|
<q-previewImage ref="previewRef" :urls="imgs" @open="open"></q-previewImage>
|
||||||
<view class="wp100 flex jc-sb ai-c p14 bc-fff" v-if="isShowAll" style="position: fixed;bottom: 0;left: 0;">
|
<view class="wp100 flex jc-sb ai-c p14 bc-fff" v-if="isShowAll" style="position: fixed;bottom: 0;left: 0;">
|
||||||
<view style="width: 220rpx;">
|
<view style="width: 220rpx;">
|
||||||
<view v-if="type==='practice'" style="width: 220rpx;height: 80rpx;"></view>
|
<view v-if="type==='practice'" style="width: 220rpx;height: 80rpx;"></view>
|
||||||
@@ -100,16 +130,16 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="text-center flex jc-c ai-c" style="flex-direction: column;" @tap="toCollect">
|
<view class="text-center flex jc-c ai-c" style="flex-direction: column;" @tap="toCollect">
|
||||||
<u-icon name="star-fill" v-if="collectList.includes(questionList[topicIndex].questionId)"
|
<u-icon name="star-fill" v-if="collectList.includes(questionList[topicIndex].questionId)"
|
||||||
color="rgb(249,236,141)" size="24"></u-icon>
|
color="rgb(249,236,141)" size="20"></u-icon>
|
||||||
<u-icon name="star" v-else size="24"></u-icon>
|
<u-icon name="star" v-else size="20"></u-icon>
|
||||||
<text class="cor-666">{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}</text>
|
<text class="cor-666">{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center">
|
<view class="text-center">
|
||||||
<view style="color: #00B74F;">{{rightList.length}}</view>
|
<view style="color: #00B74F;">{{navTitle !== '顺序答题'?rightList.length:storageRightList.length}}</view>
|
||||||
<text class="cor-666">答对</text>
|
<text class="cor-666">答对</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center">
|
<view class="text-center">
|
||||||
<view style="color: #FF6E02;">{{wrongList.length}}</view>
|
<view style="color: #FF6E02;">{{navTitle !== '顺序答题'?wrongList.length:storageWrongList.length}}</view>
|
||||||
<text class="cor-666">答错</text>
|
<text class="cor-666">答错</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center" @tap="popupShow=!popupShow">
|
<view class="text-center" @tap="popupShow=!popupShow">
|
||||||
@@ -192,16 +222,16 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="text-center flex jc-c ai-c" style="flex-direction: column;" @tap="toCollect">
|
<view class="text-center flex jc-c ai-c" style="flex-direction: column;" @tap="toCollect">
|
||||||
<u-icon name="star-fill" v-if="collectList.includes(questionList[topicIndex].questionId)"
|
<u-icon name="star-fill" v-if="collectList.includes(questionList[topicIndex].questionId)"
|
||||||
color="rgb(249,236,141)" size="24"></u-icon>
|
color="rgb(249,236,141)" size="20"></u-icon>
|
||||||
<u-icon name="star" v-else size="24"></u-icon>
|
<u-icon name="star" v-else size="20"></u-icon>
|
||||||
<text class="cor-666">{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}</text>
|
<text class="cor-666">{{collectList.includes(questionList[topicIndex].questionId)?'已收藏':'收藏'}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center">
|
<view class="text-center">
|
||||||
<view style="color: #00B74F;">{{rightList.length}}</view>
|
<view style="color: #00B74F;">{{navTitle !== '顺序答题'?rightList.length:storageRightList.length}}</view>
|
||||||
<text class="cor-666">答对</text>
|
<text class="cor-666">答对</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center">
|
<view class="text-center">
|
||||||
<view style="color: #FF6E02;">{{wrongList.length}}</view>
|
<view style="color: #FF6E02;">{{navTitle !== '顺序答题'?wrongList.length:storageWrongList.length}}</view>
|
||||||
<text class="cor-666">答错</text>
|
<text class="cor-666">答错</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center" @tap="popupShow=!popupShow">
|
<view class="text-center" @tap="popupShow=!popupShow">
|
||||||
@@ -212,15 +242,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex ai-c jc-fs p14" style="flex-wrap: wrap;max-height: 400px;overflow-y: scroll;">
|
<view class="flex ai-c jc-fs p14" style="flex-wrap: wrap;max-height: 400px;overflow-y: scroll;">
|
||||||
<view v-for="(item,index) of questionList" :key="item.questionId" style="width:20%;" class="flex ai-c jc-c"
|
<view v-for="(item,index) of questionList" :key="item.questionId" style="width:20%;position: relative;"
|
||||||
@tap="chooseQueston(index)">
|
class="flex ai-c jc-c" @tap="chooseQueston(index)">
|
||||||
<view class="tCircle mb10" :class="{
|
<view class="tCircle mb10" :class="{
|
||||||
'active':index == topicIndex,
|
'active':index == topicIndex,
|
||||||
'success':rightList.includes(item.questionId),
|
'success':type=='exam'?rightList.includes(item.questionId):storageRightList.includes(item.questionId),
|
||||||
'error':wrongList.includes(item.questionId)
|
'error':type=='exam'?wrongList.includes(item.questionId):storageWrongList.includes(item.questionId)
|
||||||
}">
|
}">
|
||||||
{{index+1}}
|
{{index+1}}
|
||||||
</view>
|
</view>
|
||||||
|
<u-icon name="star-fill" v-if="collectList.includes(item.questionId)"
|
||||||
|
style="position: absolute;right: 5px;top:-3px" color="rgb(249,236,141)" size="24"></u-icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -272,6 +304,7 @@
|
|||||||
import storage from '@/jtools/storage';
|
import storage from '@/jtools/storage';
|
||||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||||
import {
|
import {
|
||||||
|
querySysConfig,
|
||||||
submitTest
|
submitTest
|
||||||
} from '@/jtools/api/question';
|
} from '@/jtools/api/question';
|
||||||
export default {
|
export default {
|
||||||
@@ -290,14 +323,14 @@
|
|||||||
isShowAll: {
|
isShowAll: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
}
|
||||||
subject: {
|
|
||||||
type: [String, Number],
|
|
||||||
default: 1,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
imgs: [],
|
||||||
|
subject: '1',
|
||||||
|
showSkillInfo: 'hidden',
|
||||||
|
currentType: storage.get('carType') || '1001',
|
||||||
onoff: '0',
|
onoff: '0',
|
||||||
navTitle: '',
|
navTitle: '',
|
||||||
originArray: '',
|
originArray: '',
|
||||||
@@ -311,6 +344,8 @@
|
|||||||
tCurrent: 0,
|
tCurrent: 0,
|
||||||
index: 0,
|
index: 0,
|
||||||
qIndex: 0,
|
qIndex: 0,
|
||||||
|
storageRightList: storage.get(`rightList_subject${this.subject}`) || [],
|
||||||
|
storageWrongList: storage.get(`wrongList_subject${this.subject}`) || [],
|
||||||
rightList: [],
|
rightList: [],
|
||||||
wrongList: [],
|
wrongList: [],
|
||||||
collectList: storage.get(`collectList_subject${this.subject}`) || [],
|
collectList: storage.get(`collectList_subject${this.subject}`) || [],
|
||||||
@@ -323,7 +358,14 @@
|
|||||||
time: 0,
|
time: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
const carType = storage.get('carType') || '1001'
|
||||||
|
querySysConfig(carType, 'NeedSkillInfo').then(resp => {
|
||||||
|
if (resp.code === '0000') {
|
||||||
|
this.showSkillInfo = resp.data.configValue
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useQuestionStore, ["currentIndex_subject1", "currentIndex_subject4"]), //映射函数,取出tagslist
|
...mapState(useQuestionStore, ["currentIndex_subject1", "currentIndex_subject4"]), //映射函数,取出tagslist
|
||||||
isShowAnswer() {
|
isShowAnswer() {
|
||||||
@@ -346,12 +388,27 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
timeCount() {
|
timeCount() {
|
||||||
const time = this.subject == '1' ? 60 * 60 * 1000 : 45 * 60 * 1000
|
const time = 45 * 60 * 1000
|
||||||
return time
|
return time
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useQuestionStore, ['getCurrentIndex']),
|
...mapActions(useQuestionStore, ['getCurrentIndex']),
|
||||||
|
open() {
|
||||||
|
|
||||||
|
},
|
||||||
|
preview(url) {
|
||||||
|
this.imgs = [url] //设置图片数组
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.imgs = [url]
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.$refs.previewRef.open(url);
|
||||||
|
},500)
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
},
|
||||||
getOriginArr(val) {
|
getOriginArr(val) {
|
||||||
const arr = JSON.parse(val)
|
const arr = JSON.parse(val)
|
||||||
let arr1 = []
|
let arr1 = []
|
||||||
@@ -377,8 +434,8 @@
|
|||||||
if (this.tCurrent != 1) {
|
if (this.tCurrent != 1) {
|
||||||
this.originArray = JSON.stringify(this.questionList)
|
this.originArray = JSON.stringify(this.questionList)
|
||||||
}
|
}
|
||||||
const falseList = storage.get(`wrongList_subject${this.subject}`) || []
|
// const falseList = storage.get(`wrongList_subject${this.subject}`) || []
|
||||||
const trueList = storage.get(`rightList_subject${this.subject}`) || []
|
// const trueList = storage.get(`rightList_subject${this.subject}`) || []
|
||||||
if (this.tCurrent !== 1) {
|
if (this.tCurrent !== 1) {
|
||||||
const arr1 = this.questionList[this.topicIndex].clickAnswer.split('')
|
const arr1 = this.questionList[this.topicIndex].clickAnswer.split('')
|
||||||
const arr2 = this.questionList[this.topicIndex].trueAnswer.split('')
|
const arr2 = this.questionList[this.topicIndex].trueAnswer.split('')
|
||||||
@@ -388,18 +445,18 @@
|
|||||||
if (!this.rightList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (!this.rightList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
this.rightList.push(this.questionList[this.topicIndex].questionId)
|
this.rightList.push(this.questionList[this.topicIndex].questionId)
|
||||||
}
|
}
|
||||||
if (!trueList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (!this.storageRightList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
trueList.push(this.questionList[this.topicIndex].questionId)
|
this.storageRightList.push(this.questionList[this.topicIndex].questionId)
|
||||||
storage.set(`rightList_subject${this.subject}`, trueList)
|
storage.set(`rightList_subject${this.subject}`, this.storageRightList)
|
||||||
}
|
}
|
||||||
if (this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
const wIndex = this.wrongList.indexOf(this.questionList[this.topicIndex].questionId)
|
const wIndex = this.wrongList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||||
this.wrongList.splice(wIndex, 1)
|
this.wrongList.splice(wIndex, 1)
|
||||||
}
|
}
|
||||||
if (falseList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (this.storageWrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
const wIndex = falseList.indexOf(this.questionList[this.topicIndex].questionId)
|
const wIndex = this.storageWrongList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||||
falseList.splice(wIndex, 1)
|
this.storageWrongList.splice(wIndex, 1)
|
||||||
storage.set(`wrongList_subject${this.subject}`, falseList)
|
storage.set(`wrongList_subject${this.subject}`, this.storageWrongList)
|
||||||
}
|
}
|
||||||
//答对题目 如果不是最后一题,跳下一题
|
//答对题目 如果不是最后一题,跳下一题
|
||||||
if (this.topicIndex < this.questionList.length - 1) {
|
if (this.topicIndex < this.questionList.length - 1) {
|
||||||
@@ -425,14 +482,14 @@
|
|||||||
if (!this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (!this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
this.wrongList.push(this.questionList[this.topicIndex].questionId)
|
this.wrongList.push(this.questionList[this.topicIndex].questionId)
|
||||||
}
|
}
|
||||||
if (!falseList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (!this.storageWrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
falseList.push(this.questionList[this.topicIndex].questionId)
|
this.storageWrongList.push(this.questionList[this.topicIndex].questionId)
|
||||||
storage.set(`wrongList_subject${this.subject}`, falseList)
|
storage.set(`wrongList_subject${this.subject}`, this.storageWrongList)
|
||||||
}
|
}
|
||||||
if (trueList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (this.storageRightList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
const rIndex = trueList.indexOf(this.questionList[this.topicIndex].questionId)
|
const rIndex = this.storageRightList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||||
trueList.splice(rIndex, 1)
|
this.storageRightList.splice(rIndex, 1)
|
||||||
storage.set(`rightList_subject${this.subject}`, trueList)
|
storage.set(`rightList_subject${this.subject}`, this.storageRightList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -486,6 +543,7 @@
|
|||||||
this.$refs.countDown_1.pause();
|
this.$refs.countDown_1.pause();
|
||||||
this.$refs.countDown_2.pause();
|
this.$refs.countDown_2.pause();
|
||||||
}
|
}
|
||||||
|
this.popupShow = false
|
||||||
this.$refs.countDown_3.pause();
|
this.$refs.countDown_3.pause();
|
||||||
this.$emit('update:isSubmit', true)
|
this.$emit('update:isSubmit', true)
|
||||||
},
|
},
|
||||||
@@ -504,10 +562,15 @@
|
|||||||
toSubmit() {
|
toSubmit() {
|
||||||
const restTime = this.time.hours * 60 * 60 + this.time.minutes * 60 + this.time.seconds
|
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)
|
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({
|
submitTest({
|
||||||
"carTypeId": storage.get('carType') || '1001',
|
"carTypeId": storage.get('carType') || '1001',
|
||||||
"score": score,
|
"score": score,
|
||||||
"testTime": 60 * 60 - restTime,
|
"testTime": 45 * 60 - restTime,
|
||||||
subject: this.subject
|
subject: this.subject
|
||||||
}).then(resp => {
|
}).then(resp => {
|
||||||
const doNotNum = this.questionList.length - this.rightList.length - this.wrongList.length
|
const doNotNum = this.questionList.length - this.rightList.length - this.wrongList.length
|
||||||
@@ -519,6 +582,7 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
//查看考试结果
|
//查看考试结果
|
||||||
toResult() {
|
toResult() {
|
||||||
@@ -638,8 +702,8 @@
|
|||||||
},
|
},
|
||||||
//答题
|
//答题
|
||||||
answerQues(op, index) {
|
answerQues(op, index) {
|
||||||
const falseList = storage.get(`wrongList_subject${this.subject}`) || []
|
// const falseList = storage.get(`wrongList_subject${this.subject}`) || []
|
||||||
const trueList = storage.get(`rightList_subject${this.subject}`) || []
|
// const trueList = storage.get(`rightList_subject${this.subject}`) || []
|
||||||
if (!this.questionList[this.topicIndex].clickAnswer) {
|
if (!this.questionList[this.topicIndex].clickAnswer) {
|
||||||
this.questionList[this.topicIndex].optionList[index].chooseOption =
|
this.questionList[this.topicIndex].optionList[index].chooseOption =
|
||||||
`${this.questionList[this.topicIndex].optionList[index].chooseOption?this.questionList[this.topicIndex].optionList[index].chooseOption:''}${op}`
|
`${this.questionList[this.topicIndex].optionList[index].chooseOption?this.questionList[this.topicIndex].optionList[index].chooseOption:''}${op}`
|
||||||
@@ -672,18 +736,18 @@
|
|||||||
if (!this.rightList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (!this.rightList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
this.rightList.push(this.questionList[this.topicIndex].questionId)
|
this.rightList.push(this.questionList[this.topicIndex].questionId)
|
||||||
}
|
}
|
||||||
if (!trueList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (!this.storageRightList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
trueList.push(this.questionList[this.topicIndex].questionId)
|
this.storageRightList.push(this.questionList[this.topicIndex].questionId)
|
||||||
storage.set(`rightList_subject${this.subject}`, trueList)
|
storage.set(`rightList_subject${this.subject}`, this.storageRightList)
|
||||||
}
|
}
|
||||||
if (this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
const wIndex = this.wrongList.indexOf(this.questionList[this.topicIndex].questionId)
|
const wIndex = this.wrongList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||||
this.wrongList.splice(wIndex, 1)
|
this.wrongList.splice(wIndex, 1)
|
||||||
}
|
}
|
||||||
if (falseList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (this.storageWrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
const wIndex = falseList.indexOf(this.questionList[this.topicIndex].questionId)
|
const wIndex = this.storageWrongList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||||
falseList.splice(wIndex, 1)
|
this.storageWrongList.splice(wIndex, 1)
|
||||||
storage.set(`wrongList_subject${this.subject}`, falseList)
|
storage.set(`wrongList_subject${this.subject}`, this.storageWrongList)
|
||||||
}
|
}
|
||||||
//答对题目 如果不是最后一题,跳下一题
|
//答对题目 如果不是最后一题,跳下一题
|
||||||
if (this.topicIndex < this.questionList.length - 1) {
|
if (this.topicIndex < this.questionList.length - 1) {
|
||||||
@@ -709,14 +773,14 @@
|
|||||||
if (!this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (!this.wrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
this.wrongList.push(this.questionList[this.topicIndex].questionId)
|
this.wrongList.push(this.questionList[this.topicIndex].questionId)
|
||||||
}
|
}
|
||||||
if (!falseList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (!this.storageWrongList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
falseList.push(this.questionList[this.topicIndex].questionId)
|
this.storageWrongList.push(this.questionList[this.topicIndex].questionId)
|
||||||
storage.set(`wrongList_subject${this.subject}`, falseList)
|
storage.set(`wrongList_subject${this.subject}`, this.storageWrongList)
|
||||||
}
|
}
|
||||||
if (trueList.includes(this.questionList[this.topicIndex].questionId)) {
|
if (this.storageRightList.includes(this.questionList[this.topicIndex].questionId)) {
|
||||||
const rIndex = trueList.indexOf(this.questionList[this.topicIndex].questionId)
|
const rIndex = this.storageRightList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||||
trueList.splice(rIndex, 1)
|
this.storageRightList.splice(rIndex, 1)
|
||||||
storage.set(`rightList_subject${this.subject}`, trueList)
|
storage.set(`rightList_subject${this.subject}`, this.storageRightList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -727,10 +791,17 @@
|
|||||||
// this.renderSwiper(0)
|
// this.renderSwiper(0)
|
||||||
this.$emit('changeTab', index)
|
this.$emit('changeTab', index)
|
||||||
},
|
},
|
||||||
getQuestionList(val, title) {
|
getQuestionList(val, title, subject) {
|
||||||
if (title) {
|
if (title) {
|
||||||
this.navTitle = title
|
this.navTitle = title
|
||||||
}
|
}
|
||||||
|
if (subject) {
|
||||||
|
this.subject = subject
|
||||||
|
console.log(this.subject);
|
||||||
|
this.storageRightList = storage.get(`rightList_subject${subject}`) || []
|
||||||
|
this.storageWrongList = storage.get(`wrongList_subject${subject}`) || []
|
||||||
|
this.collectList = storage.get(`collectList_subject${subject}`) || []
|
||||||
|
}
|
||||||
if (val && val.length) {
|
if (val && val.length) {
|
||||||
this.questionList = JSON.parse(val)
|
this.questionList = JSON.parse(val)
|
||||||
} else {
|
} else {
|
||||||
@@ -738,7 +809,12 @@
|
|||||||
}
|
}
|
||||||
console.log(this.questionList);
|
console.log(this.questionList);
|
||||||
if (this.navTitle === '顺序答题') {
|
if (this.navTitle === '顺序答题') {
|
||||||
|
if (subject) {
|
||||||
|
this.pickerTopic(this[`currentIndex_subject${subject}`])
|
||||||
|
} else {
|
||||||
this.pickerTopic(this[`currentIndex_subject${this.subject}`])
|
this.pickerTopic(this[`currentIndex_subject${this.subject}`])
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.pickerTopic(this.topicIndex)
|
this.pickerTopic(this.topicIndex)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<image style="width: 363rpx;height: 170rpx;" src="../../static/image/practice/chapter_bg.png"></image>
|
<image style="width: 363rpx;height: 170rpx;" src="../../static/image/practice/chapter_bg.png"></image>
|
||||||
<view style="position: absolute;left: 0;top: 0;" class="p10">
|
<view style="position: absolute;left: 0;top: 0;" class="p10">
|
||||||
<view style="color: #FF6E02;font-size: 18px;">章节练习</view>
|
<view style="color: #FF6E02;font-size: 18px;">章节练习</view>
|
||||||
<text style="color: #FF6E02;font-size: 14px;">共5章</text>
|
<text style="color: #FF6E02;font-size: 14px;">共{{chapterNum}}章</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -67,6 +67,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
chapterNum:0,
|
||||||
errorIcon,
|
errorIcon,
|
||||||
newRulesIcon,
|
newRulesIcon,
|
||||||
neverWriteIcon,
|
neverWriteIcon,
|
||||||
@@ -111,6 +112,7 @@
|
|||||||
}
|
}
|
||||||
this.getExamPoint()
|
this.getExamPoint()
|
||||||
this.getQuestionNum()
|
this.getQuestionNum()
|
||||||
|
this.getChapterList()
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1", "version"]), //映射函数,取出tagslist
|
...mapState(useQuestionStore, ["loading_subject4", "loading_subject1", "version"]), //映射函数,取出tagslist
|
||||||
@@ -120,6 +122,15 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useQuestionStore, ['getAllQuestion']),
|
...mapActions(useQuestionStore, ['getAllQuestion']),
|
||||||
|
getChapterList(){
|
||||||
|
const carTypeId=storage.get('carType') || '1001'
|
||||||
|
const key=this.subject=='1'?'ChapterOfSubjectOne':'ChapterOfSubjectFour'
|
||||||
|
querySysConfigList(carTypeId,'ChapterOfSubjectOne').then(resp=>{
|
||||||
|
if(resp.code==='0000'&&resp.data){
|
||||||
|
this.chapterNum=resp.data.length
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
getQuestionNum() {
|
getQuestionNum() {
|
||||||
querySpecialNum({
|
querySpecialNum({
|
||||||
carTypeId: storage.get('carType') || '1001',
|
carTypeId: storage.get('carType') || '1001',
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
<!-- <u-navbar title="模拟考试" @rightClick="rightClick" :autoBack="true">
|
<!-- <u-navbar title="模拟考试" @rightClick="rightClick" :autoBack="true">
|
||||||
</u-navbar> -->
|
</u-navbar> -->
|
||||||
<j-navbar :isDefineBack="true" @toBack="toBack">{{title}}</j-navbar>
|
<j-navbar :isDefineBack="true" @toBack="toBack">{{title}}</j-navbar>
|
||||||
<Question ref="question" :tabsList="tabsList" v-model:isSubmit="isSubmit" :type="type" :isShowAll="isShowAll"
|
<Question ref="question" :tabsList="tabsList" v-model:isSubmit="isSubmit" :type="type" :isShowAll="isShowAll" @changeTab="changeTab" />
|
||||||
:subject="subject" @changeTab="changeTab" />
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -72,7 +71,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.type = 'exam'
|
this.type = 'exam'
|
||||||
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.title)
|
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.title,this.subject)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<GradesChart :titleName="rightPencentDesc" :actualValue="Number(rightPencent)" />
|
<GradesChart :titleName="rightPencentDesc" :actualValue="Number(rightPencent)" />
|
||||||
<view class="top_box flex jc-c" style="flex-direction: column;">
|
<view class="top_box flex jc-c" style="flex-direction: column;">
|
||||||
<view class="wp100 text-center" style="margin-top: -80px;">
|
<view class="wp100 text-center" style="margin-top: -80px;">
|
||||||
<text v-if="Number(rightPencent)>=90">太棒了!正确率很高了!</text>
|
<text v-if="Number(rightPencent * 100)>=90">太棒了!正确率很高了!</text>
|
||||||
<text v-else>继续努力吧,正确率有点低~</text>
|
<text v-else>继续努力吧,正确率有点低~</text>
|
||||||
<view class="flex ai-c jc-c mt10">
|
<view class="flex ai-c jc-c mt10">
|
||||||
<view class="text-center wp50" @tap="toQuestionBank">
|
<view class="text-center wp50" @tap="toQuestionBank">
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.navTitle)
|
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr), this.navTitle , this.subject)
|
||||||
this.$refs.question.getOriginArr(JSON.stringify(this.questionArr))
|
this.$refs.question.getOriginArr(JSON.stringify(this.questionArr))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
label: "庐江考场",
|
label: "庐江考场",
|
||||||
value: 6
|
value: 6
|
||||||
}],
|
}],
|
||||||
|
driveType:'',
|
||||||
videoType: '',
|
videoType: '',
|
||||||
popupShow: false,
|
popupShow: false,
|
||||||
videoList: [{
|
videoList: [{
|
||||||
@@ -128,6 +129,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(op) {
|
onLoad(op) {
|
||||||
|
if(op.driveType){
|
||||||
|
this.driveType=op.driveType
|
||||||
|
this.param.driveType=op.driveType
|
||||||
|
}
|
||||||
if (op.type) {
|
if (op.type) {
|
||||||
this.videoType = op.type
|
this.videoType = op.type
|
||||||
}
|
}
|
||||||
@@ -139,6 +144,7 @@
|
|||||||
}
|
}
|
||||||
if (op.type) {
|
if (op.type) {
|
||||||
this.param.type = op.type
|
this.param.type = op.type
|
||||||
|
this.getVideoList()
|
||||||
}
|
}
|
||||||
if (op.type == '1') {
|
if (op.type == '1') {
|
||||||
if (this.param.subject == '2') {
|
if (this.param.subject == '2') {
|
||||||
@@ -149,10 +155,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.title = '基础操作讲解'
|
this.title = '基础操作讲解'
|
||||||
}
|
}
|
||||||
if (op.videoList) {
|
|
||||||
this.videoList = JSON.parse(op.videoList)
|
|
||||||
this.currentIndex = this.videoList.findIndex(item => item.projectId == this.projectId)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
getScrollLeft() {
|
getScrollLeft() {
|
||||||
@@ -161,6 +164,46 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
checkTest(val) {
|
||||||
this.videoIndex = val
|
this.videoIndex = val
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -68,7 +68,9 @@
|
|||||||
<view class="flex ai-c jc-sb mt10" style="flex-wrap: wrap;">
|
<view class="flex ai-c jc-sb mt10" style="flex-wrap: wrap;">
|
||||||
<!-- 这个点击效果没加 -->
|
<!-- 这个点击效果没加 -->
|
||||||
<view v-for="(item,index) of typeList" :key="index" class="category_item p14 flex jc-sb ai-c mb10" @tap="toCategoryQuestion(item)">
|
<view v-for="(item,index) of typeList" :key="index" class="category_item p14 flex jc-sb ai-c mb10" @tap="toCategoryQuestion(item)">
|
||||||
|
<view class="topic_cont_text" style="max-width: 75%;">
|
||||||
<text class="cor-000">{{item.categoryName}}</text>
|
<text class="cor-000">{{item.categoryName}}</text>
|
||||||
|
</view>
|
||||||
<text class="cor-666">{{item.num}}</text>
|
<text class="cor-666">{{item.num}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -139,8 +141,9 @@
|
|||||||
},
|
},
|
||||||
toCategoryQuestion(item){
|
toCategoryQuestion(item){
|
||||||
const jsonString = JSON.stringify(item.errorQuestionIdList)
|
const jsonString = JSON.stringify(item.errorQuestionIdList)
|
||||||
|
console.log(item);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/questionBank/questionBank?navTitle=" + item.categoryName + "&questionIdList=" + jsonString
|
url: "/pages/questionBank/questionBank?navTitle=" + item.categoryName + "&questionIdList=" + jsonString+"&subject="+this.subject
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
toPractice() {
|
toPractice() {
|
||||||
@@ -264,4 +267,18 @@
|
|||||||
left: 165.5rpx;
|
left: 165.5rpx;
|
||||||
top: 78rpx
|
top: 78rpx
|
||||||
}
|
}
|
||||||
|
.topic_cont_text {
|
||||||
|
overflow: hidden;
|
||||||
|
word-break: break-all;
|
||||||
|
/* break-all(允许在单词内换行。) */
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
/* 超出部分省略号 */
|
||||||
|
display: -webkit-box;
|
||||||
|
/** 对象作为伸缩盒子模型显示 **/
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
/** 设置或检索伸缩盒对象的子元素的排列方式 **/
|
||||||
|
-webkit-line-clamp: 1;
|
||||||
|
/** 显示的行数 **/
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
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 |
BIN
src/static/image/mine/callme.png
Normal file
BIN
src/static/image/mine/callme.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.9 KiB |
11
src/uni_modules/g-preview-img/changelog.md
Normal file
11
src/uni_modules/g-preview-img/changelog.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
## 1.0.4(2022-12-07)
|
||||||
|
修改:判断在APP端不监听document的滚动
|
||||||
|
## 1.0.3(2022-12-05)
|
||||||
|
新增:支持视频预览,视频图片混用
|
||||||
|
新增:支持预览单张,handlePreviewImg方法直接传入图片或视频地址即可单张预览
|
||||||
|
## 1.0.2(2022-12-05)
|
||||||
|
|
||||||
|
## 1.0.1(2022-12-05)
|
||||||
|
文档错误修改
|
||||||
|
## 1.0.0(2022-11-29)
|
||||||
|
初始化插件
|
||||||
@@ -0,0 +1,235 @@
|
|||||||
|
<template>
|
||||||
|
<view class="pos">
|
||||||
|
<uni-transition :mode-class="modeClass" :show="show">
|
||||||
|
<!-- 多张图片预览 -->
|
||||||
|
<view class="content" @tap="closedPreview">
|
||||||
|
<swiper
|
||||||
|
class="swiper"
|
||||||
|
circular
|
||||||
|
:current="curDot"
|
||||||
|
@change="swiperChange"
|
||||||
|
:indicator-dots="false"
|
||||||
|
>
|
||||||
|
<swiper-item v-for="(item, idx) in selfImgList" :key="idx">
|
||||||
|
<movable-area scale-area>
|
||||||
|
<movable-view
|
||||||
|
:scale="!disabledScale"
|
||||||
|
direction="all"
|
||||||
|
scale="true"
|
||||||
|
scale-min="0.5"
|
||||||
|
scale-max="5"
|
||||||
|
:scale-value="1"
|
||||||
|
damping="150"
|
||||||
|
friction="15"
|
||||||
|
>
|
||||||
|
<image v-if="isImg(item)" :src="item" mode="widthFix"></image>
|
||||||
|
<view class="video-preview" v-else>
|
||||||
|
<video
|
||||||
|
:autoplay="true"
|
||||||
|
:src="item"
|
||||||
|
:enable-progress-gesture="false"
|
||||||
|
:show-fullscreen-btn="false"
|
||||||
|
></video>
|
||||||
|
</view>
|
||||||
|
</movable-view>
|
||||||
|
</movable-area>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
</view>
|
||||||
|
<!-- 指示器 -->
|
||||||
|
<slot name="indicator" v-if="imgList.length > 1 && !indicatorDotsType">
|
||||||
|
<view class="current-dot">
|
||||||
|
<view class="change-buttom" @tap.stop="previousImg">
|
||||||
|
<uni-icons class="font-white" type="back" size="30"></uni-icons>
|
||||||
|
</view>
|
||||||
|
<view class="font-white cur">
|
||||||
|
{{ curDot + 1 }}/{{ imgList.length }}
|
||||||
|
</view>
|
||||||
|
<view class="change-buttom" @tap.stop="nextImg">
|
||||||
|
<uni-icons class="font-white" type="forward" size="30"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</slot>
|
||||||
|
</uni-transition>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
// 过渡效果
|
||||||
|
modeClass: {
|
||||||
|
type: Array,
|
||||||
|
default: ['fade', 'zoom-out'],
|
||||||
|
},
|
||||||
|
// 指示器类型 true 圆点 false 数字
|
||||||
|
indicatorDotsType: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
// 图片列表
|
||||||
|
imgList: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
// 是否禁止放大缩小 禁止后swiper可以滑动切换
|
||||||
|
disabledScale: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: false,
|
||||||
|
curDot: 0,
|
||||||
|
selfImgList: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
isImg() {
|
||||||
|
return (src) => {
|
||||||
|
return src.indexOf('.mp4') === -1 ? true : false;
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
//监听打开时阻止下面元素的滚动事件
|
||||||
|
/* #ifdef APP-PLUS*/
|
||||||
|
show(val) {
|
||||||
|
if (val) {
|
||||||
|
document
|
||||||
|
.getElementsByClassName('pos')[0]
|
||||||
|
.addEventListener('touchmove', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/* #endif */
|
||||||
|
imgList: {
|
||||||
|
handler(val) {
|
||||||
|
if (val.length) {
|
||||||
|
this.selfImgList = val.concat();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handlePreviewImg(param) {
|
||||||
|
this.show = !this.show;
|
||||||
|
if (typeof param === 'string') {
|
||||||
|
this.selfImgList = [param];
|
||||||
|
} else {
|
||||||
|
if (param) {
|
||||||
|
this.curDot = param;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$emit('preview', this.show);
|
||||||
|
},
|
||||||
|
closedPreview() {
|
||||||
|
this.show = !this.show;
|
||||||
|
this.curDot = 0;
|
||||||
|
this.$emit('preview', this.show);
|
||||||
|
},
|
||||||
|
swiperChange(e) {
|
||||||
|
this.curDot = e.detail.current;
|
||||||
|
this.$emit('changeImg', e.detail.current);
|
||||||
|
},
|
||||||
|
previousImg() {
|
||||||
|
let num = this.imgList.length - 1;
|
||||||
|
if (this.curDot <= 0) {
|
||||||
|
this.curDot = num;
|
||||||
|
} else {
|
||||||
|
this.curDot--;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
nextImg() {
|
||||||
|
let num = this.imgList.length - 1;
|
||||||
|
if (this.curDot >= num) {
|
||||||
|
this.curDot = 0;
|
||||||
|
} else {
|
||||||
|
this.curDot++;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
movable-view {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
movable-area {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
position: fixed;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
movable-view image {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
height: 100vh;
|
||||||
|
width: 100vw;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
background: #00000076;
|
||||||
|
}
|
||||||
|
.pos {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
.swiper {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.current-dot {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10%;
|
||||||
|
left: 25%;
|
||||||
|
width: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
.change-buttom {
|
||||||
|
padding: 10rpx;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #3f3f3f;
|
||||||
|
}
|
||||||
|
.cur {
|
||||||
|
font-size: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.font-white {
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
::v-deep {
|
||||||
|
.uni-swiper-dots-horizontal {
|
||||||
|
bottom: 12%;
|
||||||
|
}
|
||||||
|
.uni-swiper-dot {
|
||||||
|
width: 10rpx;
|
||||||
|
height: 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
uni-video {
|
||||||
|
width: 100vw;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.video-preview {
|
||||||
|
position: relative;
|
||||||
|
.video-close {
|
||||||
|
position: absolute;
|
||||||
|
right: 50rpx;
|
||||||
|
top: 50rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
84
src/uni_modules/g-preview-img/package.json
Normal file
84
src/uni_modules/g-preview-img/package.json
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
{
|
||||||
|
"id": "g-preview-img",
|
||||||
|
"displayName": "g-preview-img一款兼容vue2,vue3的图片预览插件,视频预览,支持单张多张,左右滑动,放大缩小",
|
||||||
|
"version": "1.0.4",
|
||||||
|
"description": "g-preview-img一款兼容vue2,vue3的图片预览插件,视频预览,支持单张多张,左右滑动,放大缩小",
|
||||||
|
"keywords": [
|
||||||
|
"vue2",
|
||||||
|
"vue3",
|
||||||
|
"图片预览",
|
||||||
|
"视频预览"
|
||||||
|
],
|
||||||
|
"repository": "",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": "^3.1.0"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"type": "component-vue",
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": ""
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": [],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "y",
|
||||||
|
"vue3": "y"
|
||||||
|
},
|
||||||
|
"App": {
|
||||||
|
"app-vue": "y",
|
||||||
|
"app-nvue": "y"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "y",
|
||||||
|
"Android Browser": "y",
|
||||||
|
"微信浏览器(Android)": "y",
|
||||||
|
"QQ浏览器(Android)": "y"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "y",
|
||||||
|
"IE": "y",
|
||||||
|
"Edge": "y",
|
||||||
|
"Firefox": "y",
|
||||||
|
"Safari": "y"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "u",
|
||||||
|
"阿里": "u",
|
||||||
|
"百度": "u",
|
||||||
|
"字节跳动": "u",
|
||||||
|
"QQ": "u",
|
||||||
|
"钉钉": "u",
|
||||||
|
"快手": "u",
|
||||||
|
"飞书": "u",
|
||||||
|
"京东": "u"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "u",
|
||||||
|
"联盟": "u"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
64
src/uni_modules/g-preview-img/readme.md
Normal file
64
src/uni_modules/g-preview-img/readme.md
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|

|
||||||
|
### 一款兼容vue2,vue3的图片预览插件,视频预览,支持图片视频混用,支持单张多张,左右滑动,放大缩小
|
||||||
|
|
||||||
|
### 基础使用方法
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
<template>
|
||||||
|
|
||||||
|
<image v-for="(item,idx) in imgList" :src="item" :key="idx" @tap="handleClick(idx)"></image>
|
||||||
|
<g-preview-img :imgList="imgList" ref="preview"><g-preview-img>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
const preview = ref(null)
|
||||||
|
const imgList = ['图片路径1','图片路径2']
|
||||||
|
const handleClick = (idx)=>{
|
||||||
|
// idx为要打开的图片的索引,也可以不传,默认打开第一张
|
||||||
|
// handlePreviewImg的参数支持传入单张图片地址或单个视频地址
|
||||||
|
preview.value.handlePreviewImg(idx)
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
| 属性名/事件 | 类型 | 默认值 | 说明 |
|
||||||
|
| ----------------- | ------------ | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| modeClass | Array/String | \['fade', 'zoom-out'] | uni-transition组件过渡效果,可选值见 <https://uniapp.dcloud.net.cn/component/uniui/uni-transition.html#mode-class-%E5%86%85%E7%BD%AE%E8%BF%87%E6%B8%A1%E5%8A%A8%E7%94%BB%E7%B1%BB%E5%9E%8B%E8%AF%B4%E6%98%8E> |
|
||||||
|
| indicatorDotsType | Boolean | false | 多张图片的指示器,ture为圆点,false数字,当图片列表只有一张图片时,默认不展示指示器 |
|
||||||
|
| imgList | Array | | 图片列表 |
|
||||||
|
| disabledScale | Boolean | false | 是否禁止双指放大缩小 |
|
||||||
|
| @preview | 打开关闭事件 | | 接受一个参数,ture为开启,false为关闭 |
|
||||||
|
| @changeImg | 图片切换的事件 | | 参数为当前的图片索引 |
|
||||||
|
|
||||||
|
#### 插槽,自定义翻页按钮
|
||||||
|
|
||||||
|
```js
|
||||||
|
|
||||||
|
<g-preview-img :imgList="imgList" ref="preview">
|
||||||
|
<template>
|
||||||
|
<!--你的翻页按钮-->
|
||||||
|
<view @tap.stop="previousImg">上一页</view>
|
||||||
|
<view @tap.stop="nextImg">下一页</view>
|
||||||
|
</template>
|
||||||
|
</g-preview-img>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const preview = ref(null)
|
||||||
|
//上一页的方法
|
||||||
|
const previousImg = ()=>{
|
||||||
|
preview.value.previousImg()
|
||||||
|
}
|
||||||
|
//下一页的方法
|
||||||
|
const previousImg = ()=>{
|
||||||
|
preview.value.nextImg()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 支持uniapp原生swiper的属性
|
||||||
|
|
||||||
|
插件内部swiper标签上绑定了$attrs,所以在使用时可以传入一些swiper的属性
|
||||||
|
注意:不要传disable-touch这个属性,会有意想不到的错误
|
||||||
|
|
||||||
|
**插件bug会及时修复!!**
|
||||||
24
src/uni_modules/q-previewImage/changelog.md
Normal file
24
src/uni_modules/q-previewImage/changelog.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
## 1.1.1(2023-08-01)
|
||||||
|
优化文档
|
||||||
|
## 1.1.0(2023-08-01)
|
||||||
|
优化文档
|
||||||
|
## 1.0.9(2023-07-10)
|
||||||
|
优化文档
|
||||||
|
## 1.0.8(2023-06-25)
|
||||||
|
优化文档
|
||||||
|
## 1.0.7(2023-06-25)
|
||||||
|
优化文档
|
||||||
|
## 1.0.6(2023-05-26)
|
||||||
|
优化文档
|
||||||
|
## 1.0.5(2023-05-22)
|
||||||
|
优化文档
|
||||||
|
## 1.0.4(2023-04-30)
|
||||||
|
新增图片放大功能,解决原生组件和tabbar导航栏等无法覆盖的问题
|
||||||
|
## 1.0.3(2023-04-28)
|
||||||
|
优化文档
|
||||||
|
## 1.0.2(2023-04-28)
|
||||||
|
优化文档
|
||||||
|
## 1.0.1(2023-04-28)
|
||||||
|
新增长按事件
|
||||||
|
## 1.0.0(2023-04-28)
|
||||||
|
插件上线
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
<template>
|
||||||
|
<view class="previewImage" v-if="show" @tap="close">
|
||||||
|
<view class="page" v-if="urls.length > 0">
|
||||||
|
<text class="text">{{ current + 1 }} / {{ urls.length }}</text>
|
||||||
|
</view>
|
||||||
|
<swiper class="swiper" :current="current" @change="swiperChange" @touchstart="handleTouchStart" @touchend="handleTouchEnd">
|
||||||
|
<swiper-item v-for="(item, index) in urls" :key="index">
|
||||||
|
<movable-area class="movable-area" scale-area>
|
||||||
|
<movable-view class="movable-view" direction="all" :inertia="true" damping="100" scale="true" scale-min="1" scale-max="4" :scale-value="scale">
|
||||||
|
<scroll-view scroll-y="true" class="uni-scroll-view">
|
||||||
|
<view class="scroll-view"><image :key="index" class="image" :src="item" mode="widthFix" @longpress="onLongpress(item)" /></view>
|
||||||
|
</scroll-view>
|
||||||
|
</movable-view>
|
||||||
|
</movable-area>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
urls: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: false,
|
||||||
|
current: 0, //当前页
|
||||||
|
scale: 1,
|
||||||
|
isZooming: false // 是否处于缩放状态
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//打开
|
||||||
|
open(current) {
|
||||||
|
this.current = this.urls.findIndex(item => item === current);
|
||||||
|
this.show = true;
|
||||||
|
this.$emit('open');
|
||||||
|
},
|
||||||
|
//关闭
|
||||||
|
close() {
|
||||||
|
if (!this.isZooming) {
|
||||||
|
this.show = false;
|
||||||
|
this.current = 0;
|
||||||
|
this.$emit('close');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//图片改变
|
||||||
|
swiperChange(e) {
|
||||||
|
this.current = e.detail.current;
|
||||||
|
},
|
||||||
|
//监听长按
|
||||||
|
onLongpress(e) {
|
||||||
|
this.$emit('onLongpress', e);
|
||||||
|
},
|
||||||
|
handleTouchStart() {
|
||||||
|
this.isZooming = true;
|
||||||
|
},
|
||||||
|
handleTouchEnd() {
|
||||||
|
this.isZooming = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.previewImage {
|
||||||
|
z-index: 9999;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: #000000;
|
||||||
|
.swiper {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
swiper-item {
|
||||||
|
.movable-area {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
.movable-view {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100%;
|
||||||
|
.scroll-view {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 100vh;
|
||||||
|
.image {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.page {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 9999;
|
||||||
|
width: 100%;
|
||||||
|
top: 60rpx;
|
||||||
|
text-align: center;
|
||||||
|
.text {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 32rpx;
|
||||||
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
|
padding: 3rpx 16rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
81
src/uni_modules/q-previewImage/package.json
Normal file
81
src/uni_modules/q-previewImage/package.json
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{
|
||||||
|
"id": "q-previewImage",
|
||||||
|
"displayName": "图片预览、多图左右滑动、图片放大、支持覆盖原生组件、原生导航栏、tabbar",
|
||||||
|
"version": "1.1.1",
|
||||||
|
"description": "最简洁的模拟图片预览,支持长按事件,多图左右滑动,大图上下滑动查看,支持图片放大,支持覆盖原生组件/原生导航栏/tabbar 支持vue2/vue3/app/小程序/h5",
|
||||||
|
"keywords": [
|
||||||
|
"图片预览"
|
||||||
|
],
|
||||||
|
"repository": "",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": "^3.4.14"
|
||||||
|
},
|
||||||
|
"dcloudext": {
|
||||||
|
"type": "component-vue",
|
||||||
|
"sale": {
|
||||||
|
"regular": {
|
||||||
|
"price": "0.00"
|
||||||
|
},
|
||||||
|
"sourcecode": {
|
||||||
|
"price": "0.00"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"contact": {
|
||||||
|
"qq": ""
|
||||||
|
},
|
||||||
|
"declaration": {
|
||||||
|
"ads": "无",
|
||||||
|
"data": "无",
|
||||||
|
"permissions": "无"
|
||||||
|
},
|
||||||
|
"npmurl": ""
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": [],
|
||||||
|
"encrypt": [],
|
||||||
|
"platforms": {
|
||||||
|
"cloud": {
|
||||||
|
"tcb": "y",
|
||||||
|
"aliyun": "y"
|
||||||
|
},
|
||||||
|
"client": {
|
||||||
|
"Vue": {
|
||||||
|
"vue2": "y",
|
||||||
|
"vue3": "y"
|
||||||
|
},
|
||||||
|
"App": {
|
||||||
|
"app-vue": "y",
|
||||||
|
"app-nvue": "n"
|
||||||
|
},
|
||||||
|
"H5-mobile": {
|
||||||
|
"Safari": "y",
|
||||||
|
"Android Browser": "u",
|
||||||
|
"微信浏览器(Android)": "u",
|
||||||
|
"QQ浏览器(Android)": "u"
|
||||||
|
},
|
||||||
|
"H5-pc": {
|
||||||
|
"Chrome": "u",
|
||||||
|
"IE": "u",
|
||||||
|
"Edge": "u",
|
||||||
|
"Firefox": "u",
|
||||||
|
"Safari": "u"
|
||||||
|
},
|
||||||
|
"小程序": {
|
||||||
|
"微信": "y",
|
||||||
|
"阿里": "u",
|
||||||
|
"百度": "u",
|
||||||
|
"字节跳动": "u",
|
||||||
|
"QQ": "u",
|
||||||
|
"钉钉": "u",
|
||||||
|
"快手": "u",
|
||||||
|
"飞书": "u",
|
||||||
|
"京东": "u"
|
||||||
|
},
|
||||||
|
"快应用": {
|
||||||
|
"华为": "u",
|
||||||
|
"联盟": "u"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
244
src/uni_modules/q-previewImage/readme.md
Normal file
244
src/uni_modules/q-previewImage/readme.md
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
# 最简洁的模拟图片预览,支持长按事件,多图左右滑动,大图上下滑动查看,支持图片放大,支持覆盖原生组件/原生导航栏/tabbar 支持vue2/vue3/app/小程序/h5
|
||||||
|
|
||||||
|
- 为了解决项目中因一些特殊原因无法使用uni.previewImage,例如App.onShow或者页面的oShow中写了方法。
|
||||||
|
- 如果用uni.previewImage,每次预览图片都会进到onShow的方法里
|
||||||
|
- 可以基本实现官方的预览图片功能,但是体验不如uni.previewImage()
|
||||||
|
- 如没有特殊原因,还是推荐官方的uni.previewImage()
|
||||||
|
|
||||||
|
## 安装指引
|
||||||
|
|
||||||
|
##1. 在插件市场打开本插件页面,在右侧点击`使用 HBuilderX 导入插件`,选择要导入的项目点击确定
|
||||||
|
|
||||||
|
##2. 使用方法 vue2写法
|
||||||
|
|
||||||
|
```
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<video v-if="videoShow" id="myVideo" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4" controls></video>
|
||||||
|
<image v-for="(item, index) in imgs" :key="index" :src="item" @click="preview(item)"></image>
|
||||||
|
<q-previewImage ref="previewImage" :urls="imgs" @onLongpress="onLongpress" @open="open" @close="close"></q-previewImage>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
videoShow:true,//video组件是否显示
|
||||||
|
imgs: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
preview(url) {
|
||||||
|
this.imgs = ['https://web-assets.dcloud.net.cn/unidoc/zh/multiport-20210812.png', 'https://web-assets.dcloud.net.cn/unidoc/zh/uni-function-diagram.png'] //设置图片数组
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.previewImage.open(url); // 传入当前选中的图片地址(小程序必须添加$nextTick,解决组件首次加载无图)
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
this.$refs.previewImage.open(url); // 传入当前选中的图片地址
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
onLongpress(e){ //长按事件
|
||||||
|
console.log('当前长按的图片是' + e);
|
||||||
|
uni.showActionSheet({
|
||||||
|
itemList: ['转发给朋友', '保存到手机'],
|
||||||
|
success: function (res) {
|
||||||
|
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
|
||||||
|
},
|
||||||
|
fail: function (res) {
|
||||||
|
console.log(res.errMsg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/* open和close方法一般用不到,但是在一些特殊场景会用到,
|
||||||
|
* 比如预览图片时你需要覆盖 NavigationBar和 TabBar,
|
||||||
|
* 或者在app中需要预览图片时覆盖住原生组件,比如video或者map等,
|
||||||
|
* 你可以根据open和close去做一些操作,例如隐藏导航栏或者隐藏一些原生组件等
|
||||||
|
*/
|
||||||
|
open(){ //监听组件显示 (隐藏TabBar和NavigationBar,隐藏video原生组件)
|
||||||
|
// uni.hideTabBar()
|
||||||
|
// uni.setNavigationBarColor({
|
||||||
|
// frontColor: '#000000', // 设置前景色为黑色
|
||||||
|
// backgroundColor: '#000000', // 设置背景色为黑色
|
||||||
|
// })
|
||||||
|
// this.videoShow = false
|
||||||
|
},
|
||||||
|
close(){ //监听组件隐藏 (显示TabBar和NavigationBar,显示video原生组件)
|
||||||
|
// uni.showTabBar()
|
||||||
|
// uni.setNavigationBarColor({
|
||||||
|
// frontColor: '#ffffff', // 设置前景色为白色
|
||||||
|
// backgroundColor: '#000000', // 设置背景色为黑色
|
||||||
|
// })
|
||||||
|
// this.videoShow = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
##3. vue3 setup写法
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<video v-if="videoShow" id="myVideo" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4" controls></video>
|
||||||
|
<image v-for="(item, index) in imgs" :key="index" :src="item" @click="preview(item)"></image>
|
||||||
|
<q-previewImage ref="previewImage" :urls="imgs" @onLongpress="onLongpress" @open="open" @close="close"></q-previewImage>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, toRefs,nextTick } from 'vue';
|
||||||
|
|
||||||
|
const data = reactive({
|
||||||
|
videoShow:true,//video组件是否显示
|
||||||
|
imgs: [],
|
||||||
|
});
|
||||||
|
const previewImage = ref(null);
|
||||||
|
|
||||||
|
const { imgs,videoShow } = toRefs(data)// 解构
|
||||||
|
|
||||||
|
const preview = url => {
|
||||||
|
data.imgs = ['https://web-assets.dcloud.net.cn/unidoc/zh/multiport-20210812.png', 'https://web-assets.dcloud.net.cn/unidoc/zh/uni-function-diagram.png'] //设置图片数组
|
||||||
|
|
||||||
|
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
nextTick(()=>{
|
||||||
|
previewImage.value.open(url); // 传入当前选中的图片地址(小程序必须添加nextTick,解决组件首次加载无图)
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
previewImage.value.open(url); // 传入当前选中的图片地址
|
||||||
|
// #endif
|
||||||
|
};
|
||||||
|
|
||||||
|
const onLongpress = e =>{
|
||||||
|
console.log('当前长按的图片是' + e);
|
||||||
|
uni.showActionSheet({
|
||||||
|
itemList: ['转发给朋友', '保存到手机'],
|
||||||
|
success: function (res) {
|
||||||
|
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
|
||||||
|
},
|
||||||
|
fail: function (res) {
|
||||||
|
console.log(res.errMsg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/* open和close方法一般用不到,但是在一些特殊场景会用到,
|
||||||
|
* 比如预览图片时你需要覆盖 NavigationBar和 TabBar,
|
||||||
|
* 或者在app中需要预览图片时覆盖住原生组件,比如video或者map等,
|
||||||
|
* 你可以根据open和close去做一些操作,例如隐藏导航栏或者隐藏一些原生组件等
|
||||||
|
*/
|
||||||
|
const open = () => { //监听组件显示 (隐藏TabBar和NavigationBar,隐藏video原生组件)
|
||||||
|
// uni.hideTabBar()
|
||||||
|
// uni.setNavigationBarColor({
|
||||||
|
// frontColor: '#000000', // 设置前景色为黑色
|
||||||
|
// backgroundColor: '#000000', // 设置背景色为黑色
|
||||||
|
// })
|
||||||
|
// data.videoShow = false
|
||||||
|
}
|
||||||
|
|
||||||
|
const close = () => { //监听组件隐藏 (显示TabBar和NavigationBar,显示video原生组件)
|
||||||
|
// uni.showTabBar()
|
||||||
|
// uni.setNavigationBarColor({
|
||||||
|
// frontColor: '#ffffff', // 设置前景色为白色
|
||||||
|
// backgroundColor: '#000000', // 设置背景色为黑色
|
||||||
|
// })
|
||||||
|
// data.videoShow = true
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
##4. 项目示例 (一般返回的数据图片是以逗号或特殊字符分割的字符串,点击时就需要传两个参数,一个是图片数组,一个是当前图片的index)
|
||||||
|
## 注意q-previewImage不要写在循环体中,imgs其实就是用来存放当前图片的数组,每次点击每次赋值就行
|
||||||
|
|
||||||
|
```
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<video v-if="videoShow" id="myVideo" src="https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20200317.mp4" controls></video>
|
||||||
|
<view v-for="(item, index) in list" :key="index" class="list">
|
||||||
|
<image :src="i" mode="aspectFill" v-for="(i,imgindex) in item.urls.split(',')" @click.stop="preimg(item.urls.split(','),imgindex)"></image>
|
||||||
|
<view>
|
||||||
|
<q-previewImage ref="previewImage" :urls="imgs" @onLongpress="onLongpress" @open="open" @close="close"></q-previewImage>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
videoShow:true,//是否显示video组件
|
||||||
|
imgs: [],//imgs其实就是用来存放当前图片的数组,每次点击每次赋值就行
|
||||||
|
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
preimg(urls,index){
|
||||||
|
this.imgs = urls //imgs其实就是用来存放当前图片的数组,每次点击每次赋值就行
|
||||||
|
// #ifdef MP-WEIXIN
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.previewImage.open(this.imgs[index]); // 传入当前选中的图片地址(小程序必须添加$nextTick,解决组件首次加载无图)
|
||||||
|
})
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifndef MP-WEIXIN
|
||||||
|
this.$refs.previewImage.open(this.imgs[index]); // 传入当前选中的图片地址
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
onLongpress(e){ //长按事件
|
||||||
|
console.log('当前长按的图片是' + e);
|
||||||
|
uni.showActionSheet({
|
||||||
|
itemList: ['转发给朋友', '保存到手机'],
|
||||||
|
success: function (res) {
|
||||||
|
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
|
||||||
|
},
|
||||||
|
fail: function (res) {
|
||||||
|
console.log(res.errMsg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/* open和close方法一般用不到,但是在一些特殊场景会用到,
|
||||||
|
* 比如预览图片时你需要覆盖 NavigationBar和 TabBar,
|
||||||
|
* 或者在app中需要预览图片时覆盖住原生组件,比如video或者map等,
|
||||||
|
* 你可以根据open和close去做一些操作,例如隐藏导航栏或者隐藏一些原生组件等
|
||||||
|
*/
|
||||||
|
open(){ //监听组件显示 (隐藏TabBar和NavigationBar,隐藏video原生组件)
|
||||||
|
// uni.hideTabBar()
|
||||||
|
// uni.setNavigationBarColor({
|
||||||
|
// frontColor: '#000000', // 设置前景色为黑色
|
||||||
|
// backgroundColor: '#000000', // 设置背景色为黑色
|
||||||
|
// })
|
||||||
|
// this.videoShow = false
|
||||||
|
},
|
||||||
|
close(){ //监听组件隐藏 (显示TabBar和NavigationBar,显示video原生组件)
|
||||||
|
// uni.showTabBar()
|
||||||
|
// uni.setNavigationBarColor({
|
||||||
|
// frontColor: '#ffffff', // 设置前景色为白色
|
||||||
|
// backgroundColor: '#000000', // 设置背景色为黑色
|
||||||
|
// })
|
||||||
|
// this.videoShow = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## 如果插件对您有一点帮助,请给个五星好评,感谢支持
|
||||||
|
|
||||||
|
|
||||||
|
## 如有问题,请加qq 965969604
|
||||||
Reference in New Issue
Block a user