pull/15/head
脆皮鸭 1 year ago
commit 3c4e11799b
  1. 4
      .env.development
  2. 4
      .env.production
  3. 18
      src/jtools/api/question.js
  4. 3
      src/jtools/api/vip.js
  5. 4
      src/jtools/store/question.js
  6. 20
      src/pages/index/components/Subject1.vue
  7. 27
      src/pages/index/components/Subject2.vue
  8. 4
      src/pages/index/index.vue
  9. 4
      src/pages/index/paySuccess.vue
  10. 15
      src/pages/index/videoVip.vue
  11. 61
      src/pages/me/index.vue
  12. 30
      src/pages/questionBank/components/Question.vue
  13. 109
      src/pages/questionBank/questionBank.vue
  14. BIN
      src/static/image/index/subject3_bg.png

@ -5,7 +5,7 @@ VITE_APP_TITLE = 金武联驾校
VITE_APP_ENV = 'development'
# 金武联驾校/开发环境
VITE_APP_BASE_API = 'http://118.31.23.45:8888/'
VITE_APP_BASE_API = 'https://jwl.ahduima.com/'
#
VITE_WEB_BASE_URL = 'http://118.31.23.45:8888/'
VITE_WEB_BASE_URL = 'https://jwl.ahduima.com'

@ -5,7 +5,7 @@ VITE_APP_TITLE = 金武联驾校
VITE_APP_ENV = 'production'
# 金武联驾校/开发环境
VITE_APP_BASE_API = 'https://i.equ-tech.com/zongheng-api/'
VITE_APP_BASE_API = 'https://jwl.ahduima.com/'
#
VITE_WEB_BASE_URL = 'https://i.equ-tech.com/zongheng'
VITE_WEB_BASE_URL = 'https://jwl.ahduima.com'

@ -1,11 +1,11 @@
import request from '../request/index.js';
export function queryQuestion(data) {
return request({
url: 'driver-api/tdQuestion/queryQuestion',
method: 'POST',
data,
noToken: true
});
}
@ -13,7 +13,7 @@ export function questionCategory(data) {
return request({
url: 'driver-api/tdQuestion/questionCategory',
method: 'POST',
data,
data
});
}
@ -21,7 +21,7 @@ export function getTestQuestion(data) {
return request({
url: 'driver-api/tdQuestion/getTestQuestion',
method: 'POST',
data,
data
});
}
@ -29,7 +29,7 @@ export function submitTest(data) {
return request({
url: 'driver-api/tdQuestionTest/testSubmit',
method: 'POST',
data,
data
});
}
@ -37,15 +37,15 @@ export function testTotal(data) {
return request({
url: 'driver-api/tdQuestionTest/testTotal',
method: 'POST',
data,
data
});
}
//获取配置
export function querySysConfigList(carTypeId,configKey) {
export function querySysConfigList(carTypeId, configKey) {
return request({
url: 'driver-api/tdSysConfigList/querySysConfigList?configKey='+configKey+'&carTypeId='+carTypeId,
method: 'GET',
url: 'driver-api/tdSysConfigList/querySysConfigList?configKey=' + configKey + '&carTypeId=' + carTypeId,
method: 'GET'
});
}
@ -54,6 +54,6 @@ export function queryProjectList(data) {
return request({
url: 'driver-api/tdTestProject/queryProjectList',
method: 'POST',
data,
data
});
}

@ -4,7 +4,7 @@ export function queryVip(data) {
return request({
url: 'driver-api/tdMember/queryUserMember',
method: 'POST',
data,
data
});
}
@ -13,5 +13,6 @@ export function getVipList(data) {
url: 'driver-api/tdMember/queryMember',
method: 'POST',
data,
noToken: true
});
}

@ -21,8 +21,8 @@ const question = defineStore({
getOrderQuestion(val) {
queryQuestion({
carTypeId: this.currentCartype,
subject: val,
// questionIdList:[10982,10983,10985,10986]
// subject: val,
questionIdList:[10982,10983,10985,10986]
}).then(res => {
if (res.code == '0000') {
this.orderQuestion = res.data

@ -132,14 +132,26 @@
})
},
toVip(){
if(storage.get('token')){
uni.navigateTo({
url:"/pages/index/videoVip"
url:"/pages/index/videoVip?subject="+this.subject
})
}else{
uni.navigateTo({
url:'/pages/login/login'
})
}
},
toClass(){
if(storage.get('token')){
uni.navigateTo({
url:"/pages/questionBank/baseOperate"
})
}else{
uni.navigateTo({
url:'/pages/login/login'
})
}
},
toAnswer(title,val) {
uni.navigateTo({
@ -147,9 +159,15 @@
})
},
toExams(){
if(storage.get('token')){
uni.navigateTo({
url:"/pages/questionBank/practiceExams?subject="+this.subject
})
}else{
uni.navigateTo({
url:'/pages/login/login'
})
}
},
toExclusive(){
uni.navigateTo({

@ -3,7 +3,7 @@
<view class="box-nav">
<image style="width: 100%;" src="../../../static/image/index/index_bg.jpg"></image>
<view style="width: 100%;position: absolute;top: 80px;left: 0;" class="flex jc-c">
<image style="width: 694rpx" mode="widthFix" src="../../../static/image/index/subject2_bg.png"></image>
<image style="width: 694rpx" mode="widthFix" :src="subject=='2'?'../../../static/image/index/subject2_bg.png':'../../../static/image/index/subject3_bg.png'"></image>
</view>
</view>
<view class="p14lr" style="margin-top: -20px;">
@ -23,11 +23,19 @@
</view>
</view>
<view class="video_box mt10">
<text class="fs18 cor-000">驾驶方法</text>
<view class="text-center mt10" style="width: 200rpx;" @tap="toDetail">
<image style="width: 200rpx;height: 200rpx;margin-bottom: 5px;" src="../../../static/image/index/base_operate.png"></image>
<text class="fs16 cor-000">基础操作讲解</text>
<view class="fs14 cor-999 mt5">操作方法精讲</view>
<view class="flex ai-c jc-sb">
<text class="fs18 cor-000">基础操作讲解</text>
<view class="flex cor-666" @tap="toVideo">
<text>全部</text>
<u-icon color="#666" name="arrow-right" size="18"></u-icon>
</view>
</view>
<view class="flex p14lr p20tb bc-fff mt10" style="border-bottom: 1rpx solid #DDDCDC;;" v-for="(item,index) of operateList" :key="index" @tap="toDetail">
<image class="pic" src="../../static/image/index/index_bg.jpg"></image>
<view class="ml10">
<text class="fs16 cor-000 fw600">上车下车的方法</text>
<view class="fs14 mt5 cor-666">上车下车的方法</view>
</view>
</view>
</view>
</view>
@ -66,6 +74,7 @@ export default {
})
},
getVideoList(){
console.log(this.subject);
queryProjectList({
"carTypeId": storage.get('carType') || '1001',
"driveType": this.diverTypeList[this.diverTypeIndex].configItemCode,
@ -133,4 +142,10 @@ export default {
background: linear-gradient(90deg, #11DF20 0%, #01B74F 100%);
color:#fff
}
.pic{
width: 300rpx;
height: 169rpx;
background: #00B74F;
border-radius: 8rpx;
}
</style>

@ -8,7 +8,7 @@
<Subject1 :subject="tIndex+1" :rightList="rightList" :wrongList="wrongList" />
</template>
<template v-else>
<subject2 :subject="tIndex+1" />
<subject2 :subject="tIndex+1" ref="subject2" />
</template>
</view>
</view>
@ -54,6 +54,8 @@
this.getOrderQuestion('1')
}else if(this.tIndex==3){
this.getOrderQuestion('4')
}else{
this.$refs.subject2.getDiverType()
}
},
}

@ -14,12 +14,16 @@
</template>
<script>
import useUserStore from '@/jtools/store/user'
export default{
data(){
return{
}
},
onLoad(){
useUserStore().searchUserVip()
},
methods:{
goBack(){
uni.switchTab({

@ -51,16 +51,22 @@
export default {
data(){
return{
subject:'1',
loading:true,
nowPrice:168,
checkedId:0,
priceList:[],
order:{
money:1,
money:0.01,
description:'会员充值'
}
}
},
onLoad(){
onLoad(op){
if(op.subject){
this.subject=op.subject
}
this.loading=true
this.getVipList()
this.getWXOpenId()
this.$set(this.order, 'userId', this.userInfo.userId);
@ -71,7 +77,10 @@
methods:{
handlePay(){
console.log(this.order);
if(this.loading){
this.loading=false
new Pay('wechat', this.order);
}
},
getWXOpenId() {
const that = this
@ -84,7 +93,7 @@
getVipList(){
getVipList({
currentCartype: storage.get('carType') || '1001',
subject:'1'
subject:this.subject
}).then(resp=>{
this.priceList=resp.data
this.checkedId=this.priceList[0].memberId

@ -7,7 +7,7 @@
<u-avatar class="br-p50 overflow-h" :size="64" mp-avatar shape="circle"></u-avatar>
<view class="ml12">
<view class="flex ai-c fs18 cor-333 fwb">
<text class="mr10">{{ user.userName }}{{user.userId}}</text>
<text class="mr10">{{ user.userName }}{{ user.userId }}</text>
<image v-if="vipOn.length" src="/static/image/mine/vip.png" mode="widthFix" style="width: 18px;"></image>
</view>
<view class="mt5 fs14 cor-666">陪您学车 {{ user.days }}</view>
@ -33,22 +33,26 @@
</view>
<text class="ml5 fs16 fwb" style="color: #7E4012FF;">VIP会员</text>
</view>
<text v-if="vipOn.length" class="fs12" style="color: #7E4012FF;">{{expireTime}}到期</text>
<text v-if="!isLogin || !vipOn.length" class="fs12" style="color: #7E4012FF;">您还不是VIP会员</text>
<text v-else-if="vipOn.length" class="fs12" style="color: #7E4012FF;">{{ expireTime }}到期</text>
</view>
<view class="absolute flex ai-c jc-c" style="left: 0;top: 40px;right: 0;bottom: 0;">
<view class="text-center">
<view v-if="vipOn.length" class="fs18 fwb" style="color: #7E4012FF;">{{vipText}}</view>
<view class="study fs16 text-center" style="margin: 25px auto 0;color: #F6E99FFF;">
{{ vipOn.length?'马上学习':'开通会员'}}
<view v-if="!isLogin || !vipOn.length" class="text-center">
<view class="fs18 fwb" style="color: #7E4012FF;">开通VIP尊享以下权益</view>
<view class="fs15" style="color: #7E4012FF;">精选500题 / 真是模考 / 考前密卷</view>
<view class="study fs16 text-center" style="margin: 25px auto 0;color: #F6E99FFF;">立即开通</view>
</view>
<view v-else-if="vipOn.length" class="text-center">
<view class="fs18 fwb" style="color: #7E4012FF;">{{ vipText }}</view>
<view class="study fs16 text-center" style="margin: 25px auto 0;color: #F6E99FFF;">马上学习</view>
</view>
</view>
</view>
<view class="br8 bc-fff p15 z-index2">
<view v-if="isLogin" class="br8 bc-fff p15 z-index2">
<text class="fs16 cor-333">我的驾校</text>
<view v-if="user.schoolId">
<view v-if="user?.schoolId">
<div class="mt12 flex ai-c jc-sb">
<text class="fs18 cor-000 fwb">{{user.schoolName}}</text>
<text class="fs18 cor-000 fwb">{{ user.schoolName }}</text>
<u-button text="切换驾校" shape="circle" @click="handleChangeSchool"></u-button>
</div>
<u-line margin="14px 0 18px 0"></u-line>
@ -57,10 +61,11 @@
<img src="/static/image/mine/phone.png" style="width: 12px;height: 12px;">
<text class="ml2 fs12 cor-fff">客服热线</text>
</view>
<text class="ml5 fs26 cor-333 fwb" style="line-height: 26px;">{{user.schoolPhone}}</text>
<text class="ml5 fs26 cor-333 fwb" style="line-height: 26px;">{{ user.schoolPhone }}</text>
</view>
</view>
<view v-else class="pt30 pb15">
<view v-else class="p15tb flex ai-c jc-sb">
<view class="fs20 cor-333 fwb">尚未绑定驾校</view>
<u-button text="绑定驾校" shape="circle" @click="handleChangeSchool"></u-button>
</view>
</view>
@ -104,27 +109,27 @@ export default {
return useUserStore().vipOnList
},
expireTime() {
if(this.vipOn.length) {
if (this.vipOn.length) {
const t = this.vipOn.reduce((pre, cur) => {
if(Date.parse(pre) > Date.parse(cur.endDate)) {
if (Date.parse(pre) > Date.parse(cur.endDate)) {
return cur.endDate
}
return pre
}, '2099-12-31')
return t.split(' ')[0]
}else {
} else {
return ''
}
},
vipText() {
if(this.vipOn.length) {
if (this.vipOn.length) {
const t = this.vipOn.reduce((pre, cur) => {
return [...pre, ...cur.subjects.split(',').map(it =>['','一','二','三','四'][it])]
return [...pre, ...cur.subjects.split(',').map(it => ['', '一', '二', '三', '四'][it])]
}, [])
let val = Array.from(new Set(t))
val = val.length == 4 ? val.join('')+'全部':val.join('')
val = val.length == 4 ? val.join('') + '全部' : val.join('')
return `尊享科目${val}付费权益`
}else {
} else {
return ''
}
}
@ -137,16 +142,16 @@ export default {
},
methods: {
handleVip() {
if(this.isLogin) {
if(this.vipOn.length) {
if (this.isLogin) {
// if (this.vipOn.length) {
uni.navigateTo({
url: '/pages/me/vip'
})
} else {
uni.navigateTo({
url: '/pages/index/videoVip'
})
}
// } else {
// uni.navigateTo({
// url: '/pages/index/videoVip'
// })
// }
} else {
this.toLogin()
}
@ -157,7 +162,7 @@ export default {
})
},
handleChangeSchool() {
if(this.isLogin) {
if (this.isLogin) {
uni.navigateTo({
url: '/pages/me/school'
})
@ -166,7 +171,7 @@ export default {
}
},
handleInfo() {
if(this.isLogin) {
if (this.isLogin) {
uni.navigateTo({
url: '/pages/me/info'
})
@ -175,7 +180,7 @@ export default {
}
},
handleTJ() {
if(this.isLogin) {
if (this.isLogin) {
uni.navigateTo({
url: '/pages/me/tijian'
})

@ -190,7 +190,7 @@
</view>
</view>
</u-popup>
<u-popup :show="showVip" mode="bottom" :closeOnClickOverlay="true" :round="16" @close="showVip=false">
<!-- <u-popup :show="showVip" mode="bottom" :closeOnClickOverlay="true" :round="16" @close="showVip=false">
<view class="p14" style="z-index: 9;">
<view class="wp100 flex ai-c jc-sb">
<text class="fs30 fw600 cor-000">VIP题库</text>
@ -219,7 +219,7 @@
<image style="width: 276rpx;height: 88rpx;margin-top: -5px;" src="../../static/image/index/buy.png"></image>
</view>
</view>
</u-popup>
</u-popup> -->
</view>
</template>
@ -333,16 +333,13 @@ export default {
this.topicIndex ++;
this.qIndex=this.topicIndex
setTimeout(()=>{
console.log(12345);
this.renderSwiper(this.topicIndex);
},1000)
}
if(this.topicIndex<=this.questionList.length-1){
this.qIndex=this.topicIndex
}else{
this.qIndex++
if(this.topicIndex===this.questionList.length-1){
this.qIndex=this.topicIndex+1
}
if(this.qIndex>=this.questionList.length-1){
if(this.qIndex>this.questionList.length-1){
setTimeout(()=>{
this.tipShow=true
},1000)
@ -405,7 +402,9 @@ export default {
},
//VIP
toVip(){
this.showVip=true
uni.navigateTo({
url:"/pages/index/videoVip?subject="+this.subject
})
},
submitPaper(){
this.$refs.countDown_1.pause();
@ -565,9 +564,14 @@ export default {
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].clickAnswer = `${this.questionList[this.topicIndex].optionList[index].clickAnswer?this.questionList[this.topicIndex].optionList[index].clickAnswer:''}${op}`
}else{
//
if(this.questionList[this.topicIndex].type=='3'&&!this.questionList[this.topicIndex].clickAnswer.includes(op)){
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].clickAnswer =`${this.questionList[this.topicIndex].clickAnswer}${op}`
}else if(this.questionList[this.topicIndex].type=='3'&&this.questionList[this.topicIndex].clickAnswer.includes(op)){
this.questionList[this.topicIndex].optionList[index].chooseOption =''
let reg2 = new RegExp(op); // 'g'"a"
this.questionList[this.topicIndex].clickAnswer = this.questionList[this.topicIndex].clickAnswer.replace(reg2,"");
}
}
if(this.tCurrent!==1&&this.questionList[this.topicIndex].type!='3'){
@ -600,12 +604,10 @@ export default {
this.renderSwiper(this.topicIndex);
},1000)
}
if(this.topicIndex<=this.questionList.length-1){
this.qIndex=this.topicIndex
}else{
this.qIndex++
if(this.topicIndex===this.questionList.length-1){
this.qIndex=this.topicIndex+1
}
if(this.qIndex>=this.questionList.length-1){
if(this.qIndex>this.questionList.length-1){
setTimeout(()=>{
this.tipShow=true
},1000)

@ -3,9 +3,10 @@
<!-- <u-navbar :title="navTitle" @rightClick="rightClick" :autoBack="true">
</u-navbar> -->
<j-navbar>{{navTitle}}</j-navbar>
<Question ref="question" :tabsList="tabsList" :isShowAll="isShowAll" :subject="subject" :navTitle="navTitle" @changeTab="changeTab"></Question>
<Question ref="question" :tabsList="tabsList" :isShowAll="isShowAll" :subject="subject" :navTitle="navTitle"
@changeTab="changeTab"></Question>
</view>
</template>
</template>
<script>
import {
@ -25,58 +26,64 @@
},
data() {
return {
isShowAll:true,
needVip:false,
subject:1,
navTitle:'',
tabsList:[{
label:"答题",
value:0
},{
label:"背题",
value:1
isShowAll: true,
needVip: false,
subject: 1,
navTitle: '',
tabsList: [{
label: "答题",
value: 0
}, {
label: "背题",
value: 1
}],
questionArr:[]
questionArr: []
}
},
async onLoad(op) {
if(op.needVip){
this.needVip=op.needVip
}
if(op&&op.navTitle){
this.navTitle=op.navTitle
const param={}
if(this.navTitle==='顺序答题'||this.navTitle==='精简500题'){
this.questionArr=[...this.orderQuestion]
if(this.needVip==='true'){
if(this.token){
if (op.needVip) {
this.needVip = op.needVip
}
if (op && op.navTitle) {
this.navTitle = op.navTitle
const param = {}
if (this.navTitle === '顺序答题' || this.navTitle === '精简500题') {
this.questionArr = [...this.orderQuestion]
if (this.needVip === 'true') {
if (this.token) {
await this.searchUserVip()
const res=this.vipOnList.some(item=>item.subject==this.subject)
if(!res){
this.questionArr=this.questionArr.slice(0,3)
this.isShowAll=false
const res = this.vipOnList.some(item => item.subjects == this.subject)
if (!res) {
this.questionArr = this.questionArr.slice(0, 3)
this.isShowAll = false
}
}else{
} else {
uni.redirectTo({
url: '/pages/login/login'
});
}
}
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr))
}else{
if(this.navTitle==='错题本'){
param.questionIdList=storage.get(`wrongList_subject${this.subject}`) || []
}else if(this.navTitle==='收藏夹'){
param.questionIdList=storage.get(`collectList_subject${this.subject}`) || []
} else {
if (!storage.get('token')) {
uni.navigateTo({
url: '/pages/login/login'
})
return
}
if(op.questionList){
param.questionIdList=JSON.parse(op.questionList)
if (this.navTitle === '错题本') {
param.questionIdList = storage.get(`wrongList_subject${this.subject}`) || []
} else if (this.navTitle === '收藏夹') {
param.questionIdList = storage.get(`collectList_subject${this.subject}`) || []
}
if(op.chapter){
param.chapter=op.chapter
if (op.questionList) {
param.questionIdList = JSON.parse(op.questionList)
}
if(op.examKey){
param.examKey=op.examKey
if (op.chapter) {
param.chapter = op.chapter
}
if (op.examKey) {
param.examKey = op.examKey
}
queryQuestion(param).then(res => {
if (res.code == '0000') {
@ -86,27 +93,27 @@
})
}
}
if(op.subject){
this.subject=op.subject
if (op.subject) {
this.subject = op.subject
}
},
computed: {
...mapState(useQuestionStore, ["orderQuestion"]) ,//tagslist
...mapState(useUserStore, ["vipOnList","token"])
...mapState(useQuestionStore, ["orderQuestion"]), //tagslist
...mapState(useUserStore, ["vipOnList", "token"])
},
methods: {
...mapActions(useUserStore,['searchUserVip']),
changeTab(val){
if(val==1){
let list =JSON.parse(JSON.stringify(this.questionArr))
list=list.map(item=>{
return{
...mapActions(useUserStore, ['searchUserVip']),
changeTab(val) {
if (val == 1) {
let list = JSON.parse(JSON.stringify(this.questionArr))
list = list.map(item => {
return {
...item,
clickAnswer:item.trueAnswer
clickAnswer: item.trueAnswer
}
})
this.$refs.question.getQuestionList(JSON.stringify(list))
}else{
} else {
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr))
}
},

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Loading…
Cancel
Save