Compare commits
13 Commits
242744c0f9
...
dev-qsh
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a684d255d2 | ||
|
|
70fe0f0c42 | ||
|
|
62896b197d | ||
|
|
9b677ade15 | ||
|
|
4bd08bde70 | ||
|
|
e889c92d35 | ||
|
|
7442289a87 | ||
|
|
d70a0141cc | ||
|
|
459baca3f8 | ||
| f5c0df688c | |||
|
|
38cc93cba4 | ||
| ccef999bbe | |||
| 589eec1d80 |
@@ -6,6 +6,7 @@ VITE_APP_ENV = 'development'
|
|||||||
|
|
||||||
# 金武联驾校/开发环境
|
# 金武联驾校/开发环境
|
||||||
VITE_APP_BASE_API = 'https://jwl.ahduima.com/'
|
VITE_APP_BASE_API = 'https://jwl.ahduima.com/'
|
||||||
|
# VITE_APP_BASE_API = 'http://tk-api.ahfkbg.com/'
|
||||||
#
|
#
|
||||||
VITE_WEB_BASE_URL = 'https://jwl.ahduima.com'
|
VITE_WEB_BASE_URL = 'https://jwl.ahduima.com'
|
||||||
# 资源地址
|
# 资源地址
|
||||||
|
|||||||
@@ -1,238 +1,157 @@
|
|||||||
import {
|
import { defineStore } from 'pinia';
|
||||||
defineStore
|
|
||||||
} from 'pinia';
|
|
||||||
import http from '@/jtools/request/index';
|
import http from '@/jtools/request/index';
|
||||||
import {
|
import { queryQuestion, getVersion, querySysConfig } from '@/jtools/api/question';
|
||||||
queryQuestion,
|
|
||||||
getVersion,
|
|
||||||
querySysConfig
|
|
||||||
} from '@/jtools/api/question';
|
|
||||||
import storage from '@/jtools/storage';
|
import storage from '@/jtools/storage';
|
||||||
|
let JSON_SPLIT_LENGTH = 10;
|
||||||
|
|
||||||
const question = defineStore({
|
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',
|
currentCarName: storage.get('carName') || '小车C1/C2/C3',
|
||||||
orderQuestion_subject1: storage.get('question_subject1') || [], //科目一顺序做题
|
orderQuestion_subject1: [], //科目一顺序做题
|
||||||
orderQuestion_subject4: storage.get('question_subject4') || [], //科目四顺序做题
|
orderQuestion_subject4: [], //科目四顺序做题
|
||||||
currentIndex_subject1: 0, //科目一索引 顺序做题
|
currentIndex_subject1: 0, //科目一索引 顺序做题
|
||||||
currentIndex_subject4: 0, //科目四索引 顺序做题
|
currentIndex_subject4: 0, //科目四索引 顺序做题
|
||||||
curSubject: storage.get('curSubject') || '1',
|
curSubject: storage.get('curSubject') || '1',
|
||||||
loading_subject1: false,
|
loading_subject1: false,
|
||||||
loading_subject4: false,
|
loading_subject4: false,
|
||||||
version: storage.get('version') || ''
|
version: storage.get('version') || ''
|
||||||
}),
|
}),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
resetStorage(){
|
resetStorage() {
|
||||||
this.currentIndex_subject1=0
|
this.currentIndex_subject1 = 0;
|
||||||
this.currentIndex_subject4=0
|
this.currentIndex_subject4 = 0;
|
||||||
this.curSubject=0
|
this.curSubject = 0;
|
||||||
storage.remove('curSubject')
|
storage.remove('curSubject');
|
||||||
storage.remove('wrongList_subject1')
|
storage.remove('wrongList_subject1');
|
||||||
storage.remove('wrongList_subject4')
|
storage.remove('wrongList_subject4');
|
||||||
storage.remove('rightList_subject1')
|
storage.remove('rightList_subject1');
|
||||||
storage.remove('rightList_subject4')
|
storage.remove('rightList_subject4');
|
||||||
this.getAllQuestion()
|
// this.getAllQuestion()
|
||||||
},
|
},
|
||||||
getAllQuestion() {
|
getAllQuestion() {
|
||||||
this.currentCartype = storage.get('carType') || '1001'
|
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 => {
|
querySysConfig(this.currentCartype, 'QuestionBank').then(res => {
|
||||||
const urlList = JSON.parse(res.data.configJson)
|
const urlList = JSON.parse(res.data.configJson);
|
||||||
const urlOne = urlList.find(item => item.subject == '1').url
|
const urlOne = urlList.find(item => item.subject == '1').url;
|
||||||
const urlFour = urlList.find(item => item.subject == '4').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, urlOne)
|
this.getOrderQuestion_sub1(true, urlOne);
|
||||||
this.getOrderQuestion_sub4(true, urlFour)
|
this.getOrderQuestion_sub4(true, urlFour);
|
||||||
} else {
|
} else {
|
||||||
this.getOrderQuestion_sub1(false, urlOne)
|
this.getOrderQuestion_sub1(false, urlOne);
|
||||||
this.getOrderQuestion_sub4(false, urlOne)
|
this.getOrderQuestion_sub4(false, urlFour);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
divideArray(array, numChunks) {
|
||||||
|
var chunkSize = Math.ceil(array.length / numChunks);
|
||||||
|
var dividedArray = [];
|
||||||
|
for (var i = 0; i < array.length; i += chunkSize) {
|
||||||
|
dividedArray.push(array.slice(i, i + chunkSize));
|
||||||
|
}
|
||||||
|
return dividedArray;
|
||||||
|
},
|
||||||
|
|
||||||
}
|
//改变当前科目
|
||||||
})
|
changeSubject(val) {
|
||||||
},
|
this.curSubject = val;
|
||||||
divideArray(array, numChunks) {
|
storage.set('curSubject', val);
|
||||||
var chunkSize = Math.ceil(array.length / numChunks);
|
},
|
||||||
var dividedArray = [];
|
// 获取顺序做题科目1
|
||||||
for (var i = 0; i < array.length; i += chunkSize) {
|
getOrderQuestion_sub1(isUpdate, url) {
|
||||||
dividedArray.push(array.slice(i, i + chunkSize));
|
if (isUpdate) {
|
||||||
}
|
this.loading_subject1 = true;
|
||||||
return dividedArray;
|
this.loadAllQuestion(url, 1);
|
||||||
},
|
} else {
|
||||||
|
this.orderQuestion_subject1 = [];
|
||||||
//改变当前科目
|
for (let i = 0; i < JSON_SPLIT_LENGTH; i++) {
|
||||||
changeSubject(val) {
|
const arr = uni.getStorageSync(`question1Sub${i + 1}`) || [];
|
||||||
this.curSubject = val
|
this.orderQuestion_subject1 = [...this.orderQuestion_subject1, ...arr];
|
||||||
storage.set('curSubject', val)
|
}
|
||||||
},
|
if (this.orderQuestion_subject1.length == 0) {
|
||||||
// 获取顺序做题科目1
|
this.loading_subject1 = true;
|
||||||
getOrderQuestion_sub1(isUpdate, url) {
|
this.loadAllQuestion(url, 1);
|
||||||
if (isUpdate) {
|
}
|
||||||
this.loading_subject1 = true
|
}
|
||||||
const that = this
|
},
|
||||||
uni.request({
|
// 获取顺序做题科目4
|
||||||
url: url,
|
getOrderQuestion_sub4(isUpdate, url) {
|
||||||
success(resp) {
|
if (isUpdate) {
|
||||||
if (resp.data) {
|
this.loading_subject4 = true;
|
||||||
that.orderQuestion_subject1 = resp.data.data
|
this.loadAllQuestion(url, 4);
|
||||||
const diveList = that.divideArray(that.orderQuestion_subject1, 5)
|
} else {
|
||||||
that.loading_subject1 = false
|
this.orderQuestion_subject4 = [];
|
||||||
uni.setStorageSync('questionOneSub1', diveList[0])
|
for (let i = 0; i < JSON_SPLIT_LENGTH; i++) {
|
||||||
uni.setStorageSync('questionOneSub2', diveList[1])
|
const arr = uni.getStorageSync(`question4Sub${i + 1}`) || [];
|
||||||
uni.setStorageSync('questionOneSub3', diveList[2])
|
this.orderQuestion_subject4 = [...this.orderQuestion_subject4, ...arr];
|
||||||
uni.setStorageSync('questionOneSub4', diveList[3])
|
}
|
||||||
uni.setStorageSync('questionOneSub5', diveList[4])
|
if (this.orderQuestion_subject4.length == 0) {
|
||||||
const falseList = storage.get('wrongList_subject1') || []
|
this.loading_subject4 = true;
|
||||||
const trueList = storage.get('rightList_subject1') || []
|
this.loadAllQuestion(url, 4);
|
||||||
const falseArr = []
|
}
|
||||||
const rightArr = []
|
}
|
||||||
that.orderQuestion_subject1.forEach(item => {
|
},
|
||||||
if (falseList.includes(item.questionId)) {
|
// 加载线上题目
|
||||||
falseArr.push(item.questionId)
|
loadAllQuestion(url, course) {
|
||||||
}
|
const that = this;
|
||||||
if (trueList.includes(item.questionId)) {
|
uni.request({
|
||||||
rightArr.push(item.questionId)
|
url: url,
|
||||||
}
|
success(resp) {
|
||||||
})
|
if (resp?.data) {
|
||||||
storage.set('wrongList_subject1', falseArr)
|
try {
|
||||||
storage.set('rightList_subject1', rightArr)
|
for (let i = 0; i < JSON_SPLIT_LENGTH; i++) {
|
||||||
}
|
storage.remove(`question${course}Sub${i + 1}`);
|
||||||
}
|
}
|
||||||
})
|
that[`orderQuestion_subject${course}`] = resp.data?.data || [];
|
||||||
} else {
|
const diveList = that.divideArray(that[`orderQuestion_subject${course}`], JSON_SPLIT_LENGTH);
|
||||||
const list1 = uni.getStorageSync('questionOneSub1') || []
|
that[`loading_subject${course}`] = false;
|
||||||
const list2 = uni.getStorageSync('questionOneSub2') || []
|
for (let i = 0; i < JSON_SPLIT_LENGTH; i++) {
|
||||||
const list3 = uni.getStorageSync('questionOneSub3') || []
|
uni.setStorageSync(`question${course}Sub${i + 1}`, diveList[i]);
|
||||||
const list4 = uni.getStorageSync('questionOneSub4') || []
|
}
|
||||||
const list5 = uni.getStorageSync('questionOneSub5') || []
|
const falseList = storage.get(`wrongList_subject${course}`) || [];
|
||||||
this.orderQuestion_subject1 = [...list1, ...list2, ...list3, ...list4, ...list5]
|
const trueList = storage.get(`rightList_subject${course}`) || [];
|
||||||
if (this.orderQuestion_subject1 && this.orderQuestion_subject1.length) {
|
const falseArr = [];
|
||||||
|
const rightArr = [];
|
||||||
} else {
|
that[`orderQuestion_subject${course}`].forEach(item => {
|
||||||
this.loading_subject1 = true
|
if (falseList.includes(item.questionId)) {
|
||||||
const that = this
|
falseArr.push(item.questionId);
|
||||||
uni.request({
|
}
|
||||||
url: url,
|
if (trueList.includes(item.questionId)) {
|
||||||
success(resp) {
|
rightArr.push(item.questionId);
|
||||||
if (resp.data) {
|
}
|
||||||
that.orderQuestion_subject1 = resp.data.data
|
});
|
||||||
const diveList = that.divideArray(that.orderQuestion_subject1, 5)
|
storage.set(`wrongList_subject${course}`, falseArr);
|
||||||
that.loading_subject1 = false
|
storage.set(`rightList_subject${course}`, rightArr);
|
||||||
uni.setStorageSync('questionOneSub1', diveList[0])
|
} catch (err) {
|
||||||
uni.setStorageSync('questionOneSub2', diveList[1])
|
console.log(err);
|
||||||
uni.setStorageSync('questionOneSub3', diveList[2])
|
uni.showToast({
|
||||||
uni.setStorageSync('questionOneSub4', diveList[3])
|
title: '题库下载异常,请稍后再试',
|
||||||
uni.setStorageSync('questionOneSub5', diveList[4])
|
icon: 'none'
|
||||||
const falseList = storage.get('wrongList_subject1') || []
|
});
|
||||||
const trueList = storage.get('rightList_subject1') || []
|
}
|
||||||
const falseArr = []
|
} else {
|
||||||
const rightArr = []
|
uni.showToast({
|
||||||
that.orderQuestion_subject1.forEach(item => {
|
title: '加载题目失败,请稍后再试',
|
||||||
if (falseList.includes(item.questionId)) {
|
icon: 'none'
|
||||||
falseArr.push(item.questionId)
|
});
|
||||||
}
|
}
|
||||||
if (trueList.includes(item.questionId)) {
|
}
|
||||||
rightArr.push(item.questionId)
|
});
|
||||||
}
|
},
|
||||||
})
|
//获取索引
|
||||||
storage.set('wrongList_subject1', falseArr)
|
getCurrentIndex(index, val) {
|
||||||
storage.set('rightList_subject1', rightArr)
|
this[`currentIndex_subject${val}`] = index;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 获取顺序做题科目4
|
|
||||||
getOrderQuestion_sub4(isUpdate, url) {
|
|
||||||
if (isUpdate) {
|
|
||||||
this.loading_subject4 = true
|
|
||||||
const that = this
|
|
||||||
uni.request({
|
|
||||||
url: url,
|
|
||||||
success(resp) {
|
|
||||||
if (resp.data) {
|
|
||||||
that.orderQuestion_subject4 = resp.data.data
|
|
||||||
const diveList = that.divideArray(that.orderQuestion_subject4, 5)
|
|
||||||
that.loading_subject4 = false
|
|
||||||
uni.setStorageSync('questionFourSub1', diveList[0])
|
|
||||||
uni.setStorageSync('questionFourSub2', diveList[1])
|
|
||||||
uni.setStorageSync('questionFourSub3', diveList[2])
|
|
||||||
uni.setStorageSync('questionFourSub4', diveList[3])
|
|
||||||
uni.setStorageSync('questionFourSub5', diveList[4])
|
|
||||||
const falseList = storage.get('wrongList_subject4') || []
|
|
||||||
const trueList = storage.get('rightList_subject4') || []
|
|
||||||
const falseArr = []
|
|
||||||
const rightArr = []
|
|
||||||
that.orderQuestion_subject4.forEach(item => {
|
|
||||||
if (falseList.includes(item.questionId)) {
|
|
||||||
falseArr.push(item.questionId)
|
|
||||||
}
|
|
||||||
if (trueList.includes(item.questionId)) {
|
|
||||||
rightArr.push(item.questionId)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
storage.set('wrongList_subject4', falseArr)
|
|
||||||
storage.set('rightList_subject4', rightArr)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
const list1 = uni.getStorageSync('questionFourSub1') || []
|
|
||||||
const list2 = uni.getStorageSync('questionFourSub2') || []
|
|
||||||
const list3 = uni.getStorageSync('questionFourSub3') || []
|
|
||||||
const list4 = uni.getStorageSync('questionFourSub4') || []
|
|
||||||
const list5 = uni.getStorageSync('questionFourSub5') || []
|
|
||||||
this.orderQuestion_subject4 = [...list1, ...list2, ...list3, ...list4, ...list5]
|
|
||||||
if (this.orderQuestion_subject4 && this.orderQuestion_subject4.length) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
this.loading_subject4 = true
|
|
||||||
const that = this
|
|
||||||
uni.request({
|
|
||||||
url: url,
|
|
||||||
success(resp) {
|
|
||||||
if (resp.data) {
|
|
||||||
that.orderQuestion_subject4 = resp.data.data
|
|
||||||
const diveList = that.divideArray(that.orderQuestion_subject4, 5)
|
|
||||||
that.loading_subject4 = false
|
|
||||||
uni.setStorageSync('questionFourSub1', diveList[0])
|
|
||||||
uni.setStorageSync('questionFourSub2', diveList[1])
|
|
||||||
uni.setStorageSync('questionFourSub3', diveList[2])
|
|
||||||
uni.setStorageSync('questionFourSub4', diveList[3])
|
|
||||||
uni.setStorageSync('questionFourSub5', diveList[4])
|
|
||||||
const falseList = storage.get('wrongList_subject4') || []
|
|
||||||
const trueList = storage.get('rightList_subject4') || []
|
|
||||||
const falseArr = []
|
|
||||||
const rightArr = []
|
|
||||||
that.orderQuestion_subject4.forEach(item => {
|
|
||||||
if (falseList.includes(item.questionId)) {
|
|
||||||
falseArr.push(item.questionId)
|
|
||||||
}
|
|
||||||
if (trueList.includes(item.questionId)) {
|
|
||||||
rightArr.push(item.questionId)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
storage.set('wrongList_subject4', falseArr)
|
|
||||||
storage.set('rightList_subject4', rightArr)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//获取索引
|
|
||||||
getCurrentIndex(index, val) {
|
|
||||||
this[`currentIndex_subject${val}`] = index
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default question;
|
export default question;
|
||||||
|
|||||||
123
src/pages.json
123
src/pages.json
@@ -84,13 +84,6 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/me/tijian",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "上传证件照",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/me/school",
|
"path": "pages/me/school",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -105,13 +98,13 @@
|
|||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/index/testTip",
|
"path": "pages/index/testTip",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "模拟考试",
|
"navigationBarTitleText": "模拟考试",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/login/login",
|
"path": "pages/login/login",
|
||||||
"style": {
|
"style": {
|
||||||
@@ -146,65 +139,56 @@
|
|||||||
"navigationBarTitleText": "支付结果",
|
"navigationBarTitleText": "支付结果",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
"path": "pages/index/trueTest",
|
"path": "pages/index/trueTest",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "真实考场模拟",
|
"navigationBarTitleText": "真实考场模拟",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/me/uploadPic",
|
"path": "pages/index/secretPapers",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "上传证件照",
|
"navigationBarTitleText": "考前密卷",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/index/secretPapers",
|
"path": "pages/me/changeCarType",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "考前密卷",
|
"navigationBarTitleText": "切换车型",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/me/changeCarType",
|
"path": "pages/index/activity",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "切换车型",
|
"navigationBarTitleText": "活动",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path" : "pages/index/activity",
|
"path": "pages/me/myGift",
|
||||||
"style" :
|
"style": {
|
||||||
{
|
"navigationBarTitleText": "我的奖品",
|
||||||
"navigationBarTitleText" : "活动",
|
"enablePullDownRefresh": false
|
||||||
"enablePullDownRefresh" : false
|
}
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
"path": "pages/me/qrCode",
|
||||||
"path" : "pages/me/myGift",
|
"style": {
|
||||||
"style" :
|
"navigationBarTitleText": "核销二维码",
|
||||||
{
|
"enablePullDownRefresh": false
|
||||||
"navigationBarTitleText" : "我的奖品",
|
}
|
||||||
"enablePullDownRefresh" : false
|
},
|
||||||
}
|
{
|
||||||
},
|
"path": "pages/me/help",
|
||||||
{
|
"style": {
|
||||||
"path" : "pages/me/qrCode",
|
"navigationBarTitleText": "好友助力",
|
||||||
"style" :
|
"enablePullDownRefresh": true
|
||||||
{
|
}
|
||||||
"navigationBarTitleText" : "核销二维码",
|
}
|
||||||
"enablePullDownRefresh" : false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/me/help",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "好友助力",
|
|
||||||
"enablePullDownRefresh": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
|
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
@@ -218,7 +202,8 @@
|
|||||||
"selectedColor": "#05C341",
|
"selectedColor": "#05C341",
|
||||||
"backgroundColor": "#FFFFFF",
|
"backgroundColor": "#FFFFFF",
|
||||||
"color": "#999999",
|
"color": "#999999",
|
||||||
"list": [{
|
"list": [
|
||||||
|
{
|
||||||
"pagePath": "pages/index/index",
|
"pagePath": "pages/index/index",
|
||||||
"iconPath": "static/image/tabbar/tab-home.png",
|
"iconPath": "static/image/tabbar/tab-home.png",
|
||||||
"selectedIconPath": "static/image/tabbar/tab-home-selected.png",
|
"selectedIconPath": "static/image/tabbar/tab-home-selected.png",
|
||||||
@@ -233,4 +218,4 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,6 +134,9 @@
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.getTitle()
|
this.getTitle()
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
this.getTitle()
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useUserStore, ["vipOnList", "token"]),
|
...mapState(useUserStore, ["vipOnList", "token"]),
|
||||||
...mapState(useQuestionStore, ["orderQuestion_subject1", "orderQuestion_subject4", "version"]), //映射函数,取出tagslist
|
...mapState(useQuestionStore, ["orderQuestion_subject1", "orderQuestion_subject4", "version"]), //映射函数,取出tagslist
|
||||||
|
|||||||
@@ -42,9 +42,9 @@
|
|||||||
} from '@/jtools/api/question';
|
} from '@/jtools/api/question';
|
||||||
import Subject1 from "./components/Subject1";
|
import Subject1 from "./components/Subject1";
|
||||||
import Subject2 from "./components/Subject2";
|
import Subject2 from "./components/Subject2";
|
||||||
import {
|
// import {
|
||||||
queryActivityList
|
// queryActivityList
|
||||||
} from '@/jtools/api/activity';
|
// } from '@/jtools/api/activity';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Subject1,
|
Subject1,
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
if (this.subject == '2' || this.subject == '3') {
|
if (this.subject == '2' || this.subject == '3') {
|
||||||
this.$refs.subjectRef.getDiverType()
|
this.$refs.subjectRef.getDiverType()
|
||||||
}
|
}
|
||||||
this.queryActivityList()
|
// this.queryActivityList()
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
this.show = false
|
this.show = false
|
||||||
|
|||||||
@@ -216,14 +216,12 @@
|
|||||||
},
|
},
|
||||||
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.list.reduce((pre, cur) => {
|
const trueCount = this.list.reduce((pre, cur) => {
|
||||||
const isTrue = cur.trueAnswer == cur.yourAnswer.replace(/,-g/, '')
|
const ya = cur.trueAnswer.replace('A', '1').replace('B', '2').replace('C', '3').replace('D', '4').replace('E', '5').replace('F', '6').replace('G', '7')
|
||||||
let s = 0
|
const isTrue = ya == cur.yourAnswer.replace(/,/g, '')
|
||||||
if (isTrue) {
|
return pre + 1 * (isTrue ? 1 : 0)
|
||||||
s = this.subject == 1 ? 1 : 2
|
|
||||||
}
|
|
||||||
return pre + s
|
|
||||||
}, 0)
|
}, 0)
|
||||||
|
const score = (trueCount / this.list.length * 100).toFixed(0)
|
||||||
submitTest({
|
submitTest({
|
||||||
"carTypeId": storage.get('carType') || '1001',
|
"carTypeId": storage.get('carType') || '1001',
|
||||||
"score": score,
|
"score": score,
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
<u-input class="sl-input" border="none" v-model="loginForm.phone" type="number" maxlength="11"
|
<u-input class="sl-input" border="none" v-model="loginForm.phone" type="number" maxlength="11"
|
||||||
placeholder="输入手机号" />
|
placeholder="输入手机号" />
|
||||||
</view>
|
</view>
|
||||||
<view class="list-call">
|
<!-- <view class="list-call">
|
||||||
<u-input class="sl-input" v-model="loginForm.code" type="text" maxlength="6" border="none" placeholder="输入验证码">
|
<u-input class="sl-input" v-model="loginForm.code" type="text" maxlength="6" border="none" placeholder="输入验证码">
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<text class="fs14 mr10" style="color: #05C341;" @tap="getCode">{{ countDown == 0 ? '获取验证码' : countDown }}</text>
|
<text class="fs14 mr10" style="color: #05C341;" @tap="getCode">{{ countDown == 0 ? '获取验证码' : countDown }}</text>
|
||||||
</template>
|
</template>
|
||||||
</u-input>
|
</u-input>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="button-login" @tap="bindLogin()">
|
<view class="button-login" @tap="bindLogin()">
|
||||||
@@ -41,7 +41,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
loginForm: {
|
loginForm: {
|
||||||
phone: '',
|
phone: '',
|
||||||
code: ''
|
code: '000000'
|
||||||
},
|
},
|
||||||
countDown: 0,
|
countDown: 0,
|
||||||
js: undefined
|
js: undefined
|
||||||
|
|||||||
@@ -1,305 +1,254 @@
|
|||||||
<template>
|
<template>
|
||||||
<view style="padding-bottom: 50px;background-color: #C5121B;">
|
<view style="padding-bottom: 50px;background-color: #C5121B;">
|
||||||
<image class="wp100 img" mode="widthFix" src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E5%8A%A9%E5%8A%9B%E4%B8%BB%E5%9B%BE.jpg"></image>
|
<image class="wp100 img" mode="widthFix"
|
||||||
|
src="https://oss-bq.ahduima.com/%E5%B0%8F%E7%A8%8B%E5%BA%8F/%E5%9B%BE%E7%89%87/%E5%8A%A9%E5%8A%9B%E4%B8%BB%E5%9B%BE.jpg">
|
||||||
|
</image>
|
||||||
<view class="relative tip">邀请好友帮助你进行助力即可有机会领取奖品</view>
|
<view class="relative tip">邀请好友帮助你进行助力即可有机会领取奖品</view>
|
||||||
<view class="relative help_div">
|
<view class="relative help_div">
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<view v-if="type == 1" class="relative help_card">
|
<view v-if="type == 1" class="relative help_card">
|
||||||
<view class="relative help_tip">
|
<view class="relative help_tip">
|
||||||
还差{{diffNum}}位好友助力即可领取奖品:
|
还差{{diffNum}}位好友助力即可领取奖品:
|
||||||
</view>
|
</view>
|
||||||
<view v-if="winnerInfo.awards != undefined" class="relative help_tip" style="font-size: 40rpx;">
|
<view v-if="winnerInfo.awards != undefined" class="relative help_tip" style="font-size: 40rpx;">
|
||||||
{{winnerInfo.awards}}
|
{{winnerInfo.awards}}
|
||||||
</view>
|
</view>
|
||||||
<view class="help_list">
|
<view class="p20">
|
||||||
<view v-for="item in helpUserList" class="help_item">
|
<u-grid :border="false" col="3">
|
||||||
<u-avatar class="help_item_avatar" :src="item.avatarUrl"></u-avatar>
|
<u-grid-item v-for="(item, index) in helpUserList" :key="index">
|
||||||
|
<u-avatar v-if="item.id" class="p10tb border" size="120rpx" :src="item.avatarUrl"></u-avatar>
|
||||||
<!-- <view class="help_item_2_yao">
|
<view v-else class="p10tb">
|
||||||
<image :src="item.avatarUrl"></image>
|
<view class="avatar-text">
|
||||||
</view> -->
|
<u-avatar bg-color="#fff" color="#ccc" size="120rpx" text="邀"></u-avatar>
|
||||||
</view>
|
</view>
|
||||||
<view v-for="item in diffNum" class="help_item_2">
|
</view>
|
||||||
<view class="help_item_2_yao">邀</view>
|
</u-grid-item>
|
||||||
</view>
|
</u-grid>
|
||||||
</view>
|
</view>
|
||||||
<view class="help_btn" >
|
<view class="help_btn">
|
||||||
<button open-type="share" class="help_btn_font"> 邀请好友助力</button>
|
<button open-type="share" class="help_btn_font"> 邀请好友助力</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="type == 2" class="relative help_card">
|
<view v-if="type == 2" class="relative help_card">
|
||||||
<view class="relative help_list" style="top: 200rpx;">
|
<view class="relative help_list" style="top: 200rpx;">
|
||||||
<view v-if="winnerInfo.activityName != undefined" class="help_tip" style="font-size: 40rpx; margin: 25rpx 0rpx;">
|
<view v-if="winnerInfo?.activityName" class="help_tip"
|
||||||
{{winnerInfo.activityName}}
|
style="font-size: 40rpx; margin: 25rpx 0rpx;">
|
||||||
</view>
|
{{winnerInfo?.activityName}}
|
||||||
<view v-if="winnerInfo.schoolName != undefined" class="help_tip">
|
</view>
|
||||||
举办单位:{{winnerInfo.schoolName}}
|
<view v-if="winnerInfo.schoolName != undefined" class="help_tip">
|
||||||
</view>
|
举办单位:{{winnerInfo.schoolName}}
|
||||||
<view v-if="winnerInfo.awards != undefined" class="help_tip" style="font-size: 45rpx;margin: 25rpx 0rpx;">
|
</view>
|
||||||
奖品:{{winnerInfo.awards}}
|
<view v-if="winnerInfo.awards != undefined" class="help_tip" style="font-size: 45rpx;margin: 25rpx 0rpx;">
|
||||||
</view>
|
奖品:{{winnerInfo.awards}}
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<view class="help_btn" >
|
|
||||||
<button class="help_btn_font" open-type="chooseAvatar" @chooseavatar="handleHelp" :disabled="disBtn">帮好友助力</button>
|
<view class="help_btn">
|
||||||
</view>
|
<button class="help_btn_font" open-type="chooseAvatar" @chooseavatar="handleHelp"
|
||||||
</view>
|
:disabled="disBtn">帮好友助力</button>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import useUserStore from '@/jtools/store/user'
|
import useUserStore from '@/jtools/store/user'
|
||||||
import { queryActivityDetail,queryHelpInfo, saveHelpInfo, queryWinnerInfo } from '@/jtools/api/activity'
|
import {
|
||||||
|
queryActivityDetail,
|
||||||
|
queryHelpInfo,
|
||||||
|
saveHelpInfo,
|
||||||
|
queryWinnerInfo
|
||||||
|
} from '@/jtools/api/activity'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
winnerId: undefined,
|
winnerId: undefined,
|
||||||
btnText: '点我刮奖',
|
helpUserList: [],
|
||||||
showBtn: true,
|
drawNum: 0,
|
||||||
helpUserList: [],
|
phone: undefined,
|
||||||
drawNum: 0,
|
type: 2,
|
||||||
diffNum: 3,
|
winnerInfo: undefined,
|
||||||
phone: undefined,
|
disBtn: false
|
||||||
type: 2,
|
|
||||||
winnerInfo: undefined,
|
|
||||||
disBtn: false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(op) {
|
onLoad(op) {
|
||||||
|
this.winnerId = op.id
|
||||||
this.winnerId = op.id
|
|
||||||
// this.type = op.type ? Number(op.type) : 1
|
// this.type = op.type ? Number(op.type) : 1
|
||||||
this.phone = useUserStore().userInfo?.phone || undefined
|
this.phone = useUserStore().userInfo?.phone || undefined
|
||||||
console.log(this.phone)
|
console.log(this.phone)
|
||||||
this.getWinnerInfo()
|
this.getWinnerInfo()
|
||||||
this.getHelpInfo()
|
this.getHelpInfo()
|
||||||
this.disBtn = false
|
this.disBtn = false
|
||||||
|
|
||||||
},
|
},
|
||||||
onShareAppMessage(res) {
|
onShareAppMessage(res) {
|
||||||
if (res.from === 'button') {// 来自页面内分享按钮
|
if (res.from === 'button') { // 来自页面内分享按钮
|
||||||
console.log(res.target)
|
console.log(res.target)
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
title: '我正在参与领奖活动柜,请帮我助力',
|
title: '我正在参与领奖活动柜,请帮我助力',
|
||||||
path: '/pages/me/help?id='+this.winnerId + '&type=2'
|
path: '/pages/me/help?id=' + this.winnerId + '&type=2'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
//查询中奖信息
|
//查询中奖信息
|
||||||
getWinnerInfo(){
|
getWinnerInfo() {
|
||||||
// uni.request({
|
queryWinnerInfo({
|
||||||
// url: 'http://192.168.1.6:8089/applet/activity/winner/info?winnerId='+this.winnerId
|
winnerId: this.winnerId
|
||||||
// }).then(resp => {
|
}).then(resp => {
|
||||||
// if(resp.data.code == 200) {
|
if (resp.code == 200) {
|
||||||
// console.log(resp)
|
console.log(resp)
|
||||||
// this.winnerInfo = resp.data.data;
|
this.winnerInfo = resp.data;
|
||||||
// if(this.phone && this.winnerInfo.phone == this.phone){
|
if (this.phone && this.winnerInfo.phone == this.phone) {
|
||||||
// this.type == 1
|
this.type = 1
|
||||||
// }
|
} else {
|
||||||
// }
|
this.type = 2
|
||||||
// })
|
}
|
||||||
queryWinnerInfo({winnerId : this.winnerId}).then(resp => {
|
}
|
||||||
if(resp.code == 200){
|
})
|
||||||
console.log(resp)
|
|
||||||
this.winnerInfo = resp.data;
|
},
|
||||||
if(this.phone && this.winnerInfo.phone == this.phone){
|
//查询助力信息
|
||||||
this.type = 1
|
getHelpInfo() {
|
||||||
} else {
|
queryHelpInfo({
|
||||||
this.type = 2
|
winnerId: this.winnerId
|
||||||
}
|
}).then(resp => {
|
||||||
}
|
if (resp.code == 200) {
|
||||||
})
|
this.drawNum = resp.data.helpNum;
|
||||||
|
const list = resp.data.helpUsers.map(item => ({
|
||||||
},
|
...item,
|
||||||
//查询助力信息
|
avatarUrl: 'https://jwl.ahduima.com' + item.avatarUrl
|
||||||
getHelpInfo(){
|
}));
|
||||||
// uni.request({
|
this.diffNum = (this.drawNum - list.length) < 0 ? 0 : (this.drawNum - list.length);
|
||||||
// url: 'http://192.168.1.6:8089/applet/activity/help/info?winnerId='+this.winnerId
|
const arr = new Array(this.diffNum).fill({})
|
||||||
// }).then(resp => {
|
this.helpUserList = [...list,...arr]
|
||||||
// if(resp.data.code == 200) {
|
}
|
||||||
// console.log(resp)
|
})
|
||||||
// this.drawNum = resp.data.data.helpNum;
|
},
|
||||||
// this.helpUserList = resp.data.data.helpUsers
|
//点击助力
|
||||||
// this.diffNum = (this.drawNum - this.helpUserList.length) < 0 ? 0 : (this.drawNum - this.helpUserList.length);
|
handleHelp(e) {
|
||||||
// console.log(this.drawNum)
|
this.disBtn = false
|
||||||
// console.log(this.diffNum)
|
uni.login({
|
||||||
// }
|
provider: 'weixin', //使用微信登录
|
||||||
// })
|
success: (loginRes) => {
|
||||||
queryHelpInfo({winnerId : this.winnerId}).then(resp => {
|
console.log(loginRes);
|
||||||
if(resp.code == 200){
|
uni.uploadFile({
|
||||||
console.log(resp)
|
url: 'https://jwl.ahduima.com/activity/applet/activity/help/save',
|
||||||
this.drawNum = resp.data.helpNum;
|
// url: 'http://192.168.1.6:8089/applet/activity/help/save',
|
||||||
this.helpUserList = resp.data.helpUsers.map(item => ({
|
filePath: e.detail.avatarUrl,
|
||||||
...item,
|
name: 'file',
|
||||||
avatarUrl: 'https://jwl.ahduima.com' + item.avatarUrl
|
formData: {
|
||||||
}));
|
'code': loginRes.code,
|
||||||
this.diffNum = (this.drawNum - this.helpUserList.length) < 0 ? 0 : (this.drawNum - this.helpUserList.length);
|
'winnerId': this.winnerId,
|
||||||
}
|
},
|
||||||
})
|
success: (uploadFileRes) => {
|
||||||
},
|
console.log(uploadFileRes.data);
|
||||||
//点击助力
|
let resp = JSON.parse(uploadFileRes.data);
|
||||||
handleHelp(e){
|
console.log(resp);
|
||||||
this.disBtn = false
|
|
||||||
console.log(e)
|
if (resp.code == 200) {
|
||||||
uni.login({
|
uni.showToast({
|
||||||
provider: 'weixin', //使用微信登录
|
icon: 'none',
|
||||||
success: (loginRes) => {
|
title: `助力成功`
|
||||||
console.log(loginRes);
|
})
|
||||||
uni.uploadFile({
|
this.disBtn = true
|
||||||
url: 'https://jwl.ahduima.com/activity/applet/activity/help/save',
|
} else {
|
||||||
// url: 'http://192.168.1.6:8089/applet/activity/help/save',
|
uni.showToast({
|
||||||
filePath: e.detail.avatarUrl,
|
icon: 'error',
|
||||||
name: 'file',
|
title: resp.msg
|
||||||
formData: {
|
})
|
||||||
'code': loginRes.code,
|
this.disBtn = true
|
||||||
'winnerId': this.winnerId,
|
}
|
||||||
},
|
}
|
||||||
success: (uploadFileRes) => {
|
});
|
||||||
console.log(uploadFileRes.data);
|
|
||||||
let resp = JSON.parse(uploadFileRes.data);
|
}
|
||||||
console.log(resp);
|
});
|
||||||
|
},
|
||||||
if(resp.code == 200){
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: `助力成功`
|
|
||||||
})
|
|
||||||
this.disBtn = true
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'error',
|
|
||||||
title: resp.msg
|
|
||||||
})
|
|
||||||
this.disBtn = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.img{
|
.img {
|
||||||
top: -130rpx !important;
|
top: -130rpx !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tip {
|
.tip {
|
||||||
height: 75px;
|
height: 75px;
|
||||||
font-family: PingFang SC;
|
font-family: PingFang SC;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #FEFEFE;
|
color: #FEFEFE;
|
||||||
line-height: 48px;
|
line-height: 48px;
|
||||||
top: -520rpx;
|
top: -520rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 35rpx;
|
font-size: 35rpx;
|
||||||
}
|
}
|
||||||
.help_div{
|
|
||||||
width: 710rpx;
|
.avatar-text {
|
||||||
height: 996rpx;
|
border-radius: 50%;
|
||||||
top: -560rpx;
|
border: 1px dashed #ccc;
|
||||||
margin-left: 20rpx;
|
}
|
||||||
margin-right: 20rpx;
|
|
||||||
background: linear-gradient(0deg, #F33D2F 100%, rgba(197,18,27,0.01) 0%);
|
|
||||||
border-radius: 40rpx;
|
.help_div {
|
||||||
|
width: 710rpx;
|
||||||
|
height: 996rpx;
|
||||||
.help_card{
|
top: -560rpx;
|
||||||
width: 630rpx;
|
margin-left: 20rpx;
|
||||||
height: 886rpx;
|
margin-right: 20rpx;
|
||||||
margin: 0rpx 39rpx;
|
background: linear-gradient(0deg, #F33D2F 100%, rgba(197, 18, 27, 0.01) 0%);
|
||||||
top: 55rpx;
|
border-radius: 40rpx;
|
||||||
background: #FFFFFF;
|
|
||||||
border-radius: 24rpx;
|
|
||||||
|
.help_card {
|
||||||
.help_tip{
|
width: 630rpx;
|
||||||
text-align: center;
|
height: 886rpx;
|
||||||
font-size: 32rpx;
|
margin: 0rpx 39rpx;
|
||||||
font-family: PingFang SC;
|
top: 55rpx;
|
||||||
font-weight: 400;
|
background: #FFFFFF;
|
||||||
color: #010101;
|
border-radius: 24rpx;
|
||||||
line-height: 55rpx;
|
|
||||||
top: 15rpx;
|
.help_tip {
|
||||||
}
|
text-align: center;
|
||||||
|
font-size: 32rpx;
|
||||||
.help_list{
|
font-family: PingFang SC;
|
||||||
margin: 68rpx 25rpx 25rpx 20rpx;
|
font-weight: 400;
|
||||||
height: 580rpx;
|
color: #010101;
|
||||||
|
line-height: 55rpx;
|
||||||
.help_item{
|
top: 15rpx;
|
||||||
display: inline-block;
|
}
|
||||||
padding: 35rpx;
|
|
||||||
width: 194rpx;
|
.help_list {
|
||||||
height: 194rpx;
|
margin: 68rpx 25rpx 25rpx 20rpx;
|
||||||
|
height: 580rpx;
|
||||||
border-radius: 50%;
|
|
||||||
|
}
|
||||||
.help_item_avatar{
|
|
||||||
margin: auto;
|
.help_btn {
|
||||||
width: 56rpx;
|
text-align: center;
|
||||||
height: 56rpx;
|
margin: 0 75rpx;
|
||||||
color: #CCCCCC;
|
margin-bottom: 30rpx;
|
||||||
background: #C42E13;
|
width: 500rpx;
|
||||||
border: 4px solid #C42E13;
|
height: 86rpx;
|
||||||
|
background: linear-gradient(0deg, #DE4224 0%, #B81706 100%);
|
||||||
image{
|
border-radius: 43rpx;
|
||||||
height: 45px;
|
|
||||||
width: 45px;
|
.help_btn_font {
|
||||||
}
|
font-size: 32rpx;
|
||||||
}
|
font-family: PingFang SC;
|
||||||
}
|
font-weight: 400;
|
||||||
|
color: #FFFFFF;
|
||||||
.help_item_2{
|
line-height: 86rpx;
|
||||||
display: inline-block;
|
background: center;
|
||||||
margin: 35rpx;
|
}
|
||||||
width: 124rpx;
|
}
|
||||||
height: 124rpx;
|
}
|
||||||
border: 2px dotted #CCCCCC;
|
|
||||||
border-radius: 50%;
|
|
||||||
|
|
||||||
.help_item_2_yao{
|
|
||||||
margin: 34rpx 33rpx;
|
|
||||||
width: 56rpx;
|
|
||||||
height: 56rpx;
|
|
||||||
font-size: 60rpx;
|
|
||||||
font-family: PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #CCCCCC;
|
|
||||||
line-height: 48rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.help_btn{
|
|
||||||
text-align: center;
|
|
||||||
margin: 0 75rpx;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
width: 500rpx;
|
|
||||||
height: 86rpx;
|
|
||||||
background: linear-gradient(0deg, #DE4224 0%, #B81706 100%);
|
|
||||||
border-radius: 43rpx;
|
|
||||||
|
|
||||||
.help_btn_font{
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-family: PingFang SC;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #FFFFFF;
|
|
||||||
line-height: 86rpx;
|
|
||||||
background: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
<view class="absolute flex ai-c jc-c" style="left: 0;top: 40px;right: 0;bottom: 0;">
|
<view class="absolute flex ai-c jc-c" style="left: 0;top: 40px;right: 0;bottom: 0;">
|
||||||
<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;">{{ isIOS ? 'iOS暂不可用' : '立即开通' }}</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">
|
||||||
@@ -83,11 +83,6 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<u-icon size="24" name="gift"></u-icon>
|
<u-icon size="24" name="gift"></u-icon>
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
|
||||||
<u-cell size="large" title="我的体检" isLink @tap="handleTJ">
|
|
||||||
<template #icon>
|
|
||||||
<img src="/static/image/mine/wdtj.png" style="width: 24px;height: 24px;">
|
|
||||||
</template>
|
|
||||||
</u-cell>
|
</u-cell>
|
||||||
<u-cell size="large" title="我的题库" :value="carName" @tap="toChangeCarType">
|
<u-cell size="large" title="我的题库" :value="carName" @tap="toChangeCarType">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
@@ -222,19 +217,6 @@ export default {
|
|||||||
this.toLogin()
|
this.toLogin()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleTJ() {
|
|
||||||
if (this.isLogin) {
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url: '/pages/me/tijian'
|
|
||||||
// })
|
|
||||||
uni.showToast({
|
|
||||||
title: '敬请期待',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.toLogin()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
toLogin() {
|
toLogin() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/login/login'
|
url: '/pages/login/login'
|
||||||
|
|||||||
@@ -15,15 +15,6 @@
|
|||||||
<u-icon name="arrow-right" color="#999" />
|
<u-icon name="arrow-right" color="#999" />
|
||||||
</view>
|
</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>
|
||||||
@@ -40,11 +31,6 @@
|
|||||||
this.sfzNum=storage.get('sfzNum') || ''
|
this.sfzNum=storage.get('sfzNum') || ''
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toUploadPic(){
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/me/uploadPic'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<view v-if="item.status == 0" class="btn" @tap="handleHelp(item)">助力</view>
|
<view v-if="item.status == 0" class="btn" @tap="handleHelp(item)">助力</view>
|
||||||
<view v-else-if="item.status == 1" class="btn" @tap="handleWriteoff(item)">核销</view>
|
<view v-else-if="item.status == 1" class="btn" @tap="handleWriteoff(item)">核销</view>
|
||||||
<img v-else-if="item.status == 2" src="/static/image/mine/writeoff.png" style="width: 120rpx;height: 120rpx;" />
|
<img v-else-if="item.status == 2" src="/static/image/mine/writeoff.png" style="width: 120rpx;height: 120rpx;" />
|
||||||
<view v-else class="btn" @tap="handleWriteoff(item)">核销</view>
|
<img v-else src="/static/image/mine/outtime.png" style="width: 120rpx;height: 120rpx;" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</u-list-item>
|
</u-list-item>
|
||||||
|
|||||||
@@ -1,214 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view class="">
|
|
||||||
<view class="wp100 bc-fff p14">
|
|
||||||
<view class="title fontColor">第一步 上传学员图像</view>
|
|
||||||
<view class="mt15">
|
|
||||||
<!-- <u-upload width="165" height="165" :file-list=" fileList1" multiple :max-count="1" @afterRead="afterRead" @delete="deletePic" /> -->
|
|
||||||
<!-- <u-upload ref="uUpload" class="mt25" :size-type="['compressed']" :file-list="fileList1" deletable :multiple="false" :max-count="1" width="165rpx" height="165rpx" @afterRead="afterRead" @delete="deletePic" /> -->
|
|
||||||
<view style="width: 320rpx;height:300rpx;background-color: rgb(247, 255, 255);border-radius: 20rpx;">
|
|
||||||
<view style="width: 320rpx;height:240rpx;" class="flex jc-c ai-c">
|
|
||||||
<image v-if="fileList&&fileList.length" style="width: 240rpx;height: 240rpx;" :src="fileList[0].url">
|
|
||||||
</image>
|
|
||||||
<u-avatar v-else class="br-p50 overflow-h" :size="64" mp-avatar shape="circle"></u-avatar>
|
|
||||||
</view>
|
|
||||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="1" width="150"
|
|
||||||
height="150">
|
|
||||||
<view
|
|
||||||
style="width: 320rpx;height:60rpx;line-height:60rpx;background-color: #05C341;border-radius: 0 0 20rpx 20rpx;"
|
|
||||||
class="text-center cor-fff">
|
|
||||||
点击
|
|
||||||
</view>
|
|
||||||
</u-upload>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="mt20">
|
|
||||||
<view class="title fontColor">第二步 核实后再提交</view>
|
|
||||||
<u--form labelPosition="left" labelWidth="80" :model="form" :rules="rules" ref="form1">
|
|
||||||
<u-form-item label="姓名" :required="true" prop="idCardName" borderBottom ref="item1">
|
|
||||||
<u--input v-model="form.idCardName" border="none"></u--input>
|
|
||||||
</u-form-item>
|
|
||||||
<u-form-item label="身份证号" :required="true" prop="sfzmhm" borderBottom ref="item2">
|
|
||||||
<u--input v-model="form.sfzmhm" border="none"></u--input>
|
|
||||||
</u-form-item>
|
|
||||||
</u--form>
|
|
||||||
</view>
|
|
||||||
<view style="margin-top: 20px;">
|
|
||||||
<u-button type="primary" :style="{width: '100%',borderRadius:'40rpx',backgroundColor:'#05C341'}" :disabled="saving" text="提交"
|
|
||||||
@click="submit" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import storage from '@/jtools/storage';
|
|
||||||
import {
|
|
||||||
addInfo,
|
|
||||||
} from '@/jtools/api/index';
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
const shenfenzhen = (rule, value, callback) => {
|
|
||||||
/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(value) ? callback() : callback(
|
|
||||||
new Error('请输入正确的身份证号'))
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
form: {
|
|
||||||
idCardName: '',
|
|
||||||
sfzmhm: ''
|
|
||||||
},
|
|
||||||
driverLicenseImg:'',
|
|
||||||
fileList:[],
|
|
||||||
fileList1: [],
|
|
||||||
uploadList: [],
|
|
||||||
saving: false,
|
|
||||||
rules: {
|
|
||||||
idCardName: [{
|
|
||||||
required: true,
|
|
||||||
message: '请输入姓名',
|
|
||||||
trigger: ['blur', 'change']
|
|
||||||
}],
|
|
||||||
sfzmhm: [{
|
|
||||||
required: true,
|
|
||||||
message: '请输入身份证号',
|
|
||||||
trigger: ['blur', 'change']
|
|
||||||
},{
|
|
||||||
// 自定义验证函数,见上说明
|
|
||||||
validator: shenfenzhen,
|
|
||||||
message: '身份证号码不正确',
|
|
||||||
// 触发器可以同时用blur和change
|
|
||||||
trigger: ['change', 'blur'],
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onReady() {
|
|
||||||
this.$refs.form1.setRules(this.rules);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 删除图片
|
|
||||||
deletePic(event) {
|
|
||||||
this.fileList1.splice(event.index, 1);
|
|
||||||
this.uploadList.splice(event.index, 1);
|
|
||||||
},
|
|
||||||
// 新增图片
|
|
||||||
async afterRead(event) {
|
|
||||||
let imageInfoObj = await uni.getImageInfo({src: event.file[0].url})
|
|
||||||
console.log(imageInfoObj);
|
|
||||||
if(imageInfoObj.width!=720&&imageInfoObj.height!=720){
|
|
||||||
uni.showToast({
|
|
||||||
icon:'error',
|
|
||||||
title:'证件照尺寸有误'
|
|
||||||
})
|
|
||||||
this.fileList=[]
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
this.driverLicenseImg = this.urlTobase64(event.file[0].url)
|
|
||||||
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
|
||||||
const lists = [].concat(event.file);
|
|
||||||
this.fileList=lists
|
|
||||||
this.fileList1 = [];
|
|
||||||
uni.showToast({
|
|
||||||
title:'上传成功!'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
uploadFilePromise(url) {
|
|
||||||
this.saving = true;
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
uni.uploadFile({
|
|
||||||
url: process.env.VUE_APP_BASE_API + 'mongodb/uploadFile', // 仅为示例,非真实的接口地址
|
|
||||||
filePath: url,
|
|
||||||
name: 'file',
|
|
||||||
success: (res) => {
|
|
||||||
// setTimeout(() => {
|
|
||||||
resolve(JSON.parse(res.data).data);
|
|
||||||
// }, 100);
|
|
||||||
this.saving = false;
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
resolve(null);
|
|
||||||
this.saving = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 提交
|
|
||||||
submit() {
|
|
||||||
this.$refs.form1.validate().then((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
const param={
|
|
||||||
driverLicenseImg:this.driverLicenseImg,
|
|
||||||
...this.form,
|
|
||||||
schoolOrgCode:'340103000700',
|
|
||||||
operater:'1d08daf852cf4ee28f67cb583f538cbf'
|
|
||||||
}
|
|
||||||
addInfo(param).then(resp=>{
|
|
||||||
uni.showToast({
|
|
||||||
title:"提交成功!",
|
|
||||||
duration:2000,
|
|
||||||
})
|
|
||||||
setTimeout(()=>{
|
|
||||||
uni.navigateBack()
|
|
||||||
},1000)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
console.log('验证失败');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
urlTobase64(url){
|
|
||||||
let base64=''
|
|
||||||
console.log(url);
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
uni.getFileSystemManager().readFile({
|
|
||||||
filePath: url, //选择图片返回的相对路径
|
|
||||||
encoding: 'base64', //编码格式
|
|
||||||
success: res => { //成功的回调
|
|
||||||
console.log(res);
|
|
||||||
base64 = 'data:image/jpeg;base64,' + res.data //不加上这串字符,在页面无法显示的哦
|
|
||||||
resolve(base64);
|
|
||||||
},fail: (e) => {
|
|
||||||
console.log("图片转换失败");
|
|
||||||
reject(e)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.upload-img {
|
|
||||||
width: 165rpx;
|
|
||||||
height: 165rpx;
|
|
||||||
border: 1px dashed #c4c4c4;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.fontColor {
|
|
||||||
color: #383838;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .u-textarea__count {
|
|
||||||
background-color: #f9faf9 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .u-upload__button>.u-icon>.u-icon__icon {
|
|
||||||
font-size: 90rpx !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
::v-deep .u-button--square {
|
|
||||||
border-radius: 40rpx !important;
|
|
||||||
}
|
|
||||||
::v-deep .u-button--primary{
|
|
||||||
background-color: #05C341 !important;
|
|
||||||
border-color: #05C341 !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<swiper class="swiper mt20" :current="swiperIndex" :duration="duration" :autoplay="false" @change="onChange"
|
<swiper class="swiper mt20" :current="swiperIndex" :duration="duration" :autoplay="false" @change="onChange"
|
||||||
@animationfinish="onAnimationfinish" @touchend="touchEnd">
|
@animationfinish="onAnimationfinish" @touchend="touchEnd">
|
||||||
<swiper-item v-for="(quesItem,quesIndex) in swiperList" :key="quesIndex.questionId">
|
<swiper-item v-for="(quesItem,quesIndex) in swiperList" :key="quesItem.questionId">
|
||||||
<scroll-view scroll-y="true" class="swiper-scroll">
|
<scroll-view scroll-y="true" class="swiper-scroll">
|
||||||
<view>
|
<view>
|
||||||
<view class="m14lr">
|
<view class="m14lr">
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
import GradesChart from "./components/GradesChart.vue"
|
import GradesChart from "./components/GradesChart.vue"
|
||||||
import storage from '@/jtools/storage';
|
import storage from '@/jtools/storage';
|
||||||
import {
|
import {
|
||||||
testTotal
|
testTotal,getTestQuestionId
|
||||||
} from '@/jtools/api/question';
|
} from '@/jtools/api/question';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -182,15 +182,28 @@
|
|||||||
}else{
|
}else{
|
||||||
const list =JSON.stringify(this.wrongList)
|
const list =JSON.stringify(this.wrongList)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:"/pages/questionBank/questionBank?navTitle=错题&subject="+this.subject+"&questionList="+list
|
url:"/pages/questionBank/questionBank?navTitle=错题&subject="+this.subject+"&questionIdList="+list
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//重新考试
|
//重新考试
|
||||||
toExams(){
|
toExams(){
|
||||||
uni.navigateTo({
|
getTestQuestionId({
|
||||||
url:"/pages/questionBank/practiceExams?subject="+this.subject
|
versionId: this.version,
|
||||||
|
carTypeId: storage.get('carType') || '1001',
|
||||||
|
subject: this.subject,
|
||||||
|
}).then(async (resp) => {
|
||||||
|
if (resp.code === '0000') {
|
||||||
|
const arr = resp.data
|
||||||
|
const listJson = JSON.stringify(arr)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/questionBank/practiceExams?title=模拟考试&subject=" + this.subject + "&questionIdList=" + listJson
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url:"/pages/questionBank/practiceExams?subject="+this.subject
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
src/static/image/mine/outtime.png
Normal file
BIN
src/static/image/mine/outtime.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Reference in New Issue
Block a user