Compare commits
18 Commits
49abbc764b
...
f36cffdd37
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f36cffdd37 | ||
|
|
7db9e68e77 | ||
| d82a84798c | |||
| 4bfce94c24 | |||
| c3e6002ca3 | |||
| fa6665d9f6 | |||
| 77de5d5d6e | |||
| 9e4b78882e | |||
| 5640ef7f36 | |||
| d36b01a69f | |||
| 8a1d49b47f | |||
| 0b39b49a5d | |||
| 9afe858077 | |||
| 5f6646ae4e | |||
| 3c137e8025 | |||
| 3c4e11799b | |||
| 97547afc4d | |||
| 4c4bd6236d |
@@ -4,8 +4,12 @@ import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
export default {
|
||||
onLaunch: function () {
|
||||
useUserStore().queryVipList()
|
||||
useQuestionStore().getOrderQuestion('1')
|
||||
if (useUserStore().isLogin) {
|
||||
if(useQuestionStore().curSubject=='1'){
|
||||
useQuestionStore().getOrderQuestion_sub1()
|
||||
}else if(useQuestionStore().curSubject=='4'){
|
||||
useQuestionStore().getOrderQuestion_sub4()
|
||||
}
|
||||
if(useUserStore().isLogin) {
|
||||
useUserStore().getUserInfo()
|
||||
useUserStore().searchUserVip()
|
||||
}
|
||||
@@ -23,4 +27,5 @@ export default {
|
||||
/*每个页面公共css */
|
||||
@import "uni_modules/uview-plus/index.scss";
|
||||
@import "static/style/index.scss";
|
||||
button::after{ border: none;}
|
||||
</style>
|
||||
|
||||
@@ -140,8 +140,8 @@ export default {
|
||||
.cu-bar {
|
||||
width: 100%;
|
||||
.content {
|
||||
// width: 350rpx;
|
||||
display: flex;
|
||||
width: 350rpx;
|
||||
// display: flex;
|
||||
flex-direction: row;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
|
||||
9
src/jtools/api/pay.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import request from '../request/index.js';
|
||||
|
||||
export function prePay(data) {
|
||||
return request({
|
||||
url: 'driver-api/applet/pay/prepay',
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
@@ -13,7 +13,8 @@ export function questionCategory(data) {
|
||||
return request({
|
||||
url: 'driver-api/tdQuestion/questionCategory',
|
||||
method: 'POST',
|
||||
data
|
||||
data,
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
|
||||
@@ -45,7 +46,8 @@ export function testTotal(data) {
|
||||
export function querySysConfigList(carTypeId, configKey) {
|
||||
return request({
|
||||
url: 'driver-api/tdSysConfigList/querySysConfigList?configKey=' + configKey + '&carTypeId=' + carTypeId,
|
||||
method: 'GET'
|
||||
method: 'GET',
|
||||
noToken: true
|
||||
});
|
||||
}
|
||||
|
||||
@@ -54,6 +56,7 @@ export function queryProjectList(data) {
|
||||
return request({
|
||||
url: 'driver-api/tdTestProject/queryProjectList',
|
||||
method: 'POST',
|
||||
data
|
||||
data,
|
||||
noToken:true
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import request from '../request/index.js';
|
||||
// #ifdef H5
|
||||
import wxsdk from '@/jtools/wechat/sdk'
|
||||
// import wxsdk from '@/jtools/wechat/sdk'
|
||||
// #endif
|
||||
import wechat from '@/jtools/wechat/wechat'
|
||||
// import wechat from '@/jtools/wechat/wechat'
|
||||
import $platform from '@/jtools/platform';
|
||||
|
||||
import {prePay} from '@/jtools/api/pay'
|
||||
/**
|
||||
* 支付
|
||||
*
|
||||
@@ -16,150 +16,142 @@ import $platform from '@/jtools/platform';
|
||||
export default class JtoolsPay {
|
||||
|
||||
|
||||
// wxOfficialAccount wxMiniProgram App H5
|
||||
// wechat 公众号JSSDK支付 小程序支付 微信开放平台支付 H5网页支付
|
||||
// alipay 复制网址 复制网址 支付宝开放平台支付 直接跳转链接
|
||||
// wallet v v v v
|
||||
// wxOfficialAccount wxMiniProgram App H5
|
||||
// wechat 公众号JSSDK支付 小程序支付 微信开放平台支付 H5网页支付
|
||||
// alipay 复制网址 复制网址 支付宝开放平台支付 直接跳转链接
|
||||
// wallet v v v v
|
||||
|
||||
|
||||
constructor(payment, order, orderType) {
|
||||
this.payment = payment;
|
||||
this.order = order;
|
||||
this.orderType = orderType;
|
||||
this.platform = $platform.get();
|
||||
let payMehod = this.getPayMethod();
|
||||
payMehod();
|
||||
constructor(payment, order, orderType) {
|
||||
this.payment = payment;
|
||||
this.order = order;
|
||||
this.orderType = orderType;
|
||||
this.platform = $platform.get();
|
||||
let payMehod = this.getPayMethod();
|
||||
payMehod();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
getPayMethod() {
|
||||
var payMethod = {
|
||||
'wxMiniProgram': {
|
||||
'wechat': () => {
|
||||
this.wxMiniProgramPay()
|
||||
},
|
||||
},
|
||||
'App': {
|
||||
'wechat': () => {
|
||||
this.wechatPay()
|
||||
},
|
||||
'alipay': () => {
|
||||
this.aliPay()
|
||||
},
|
||||
},
|
||||
}
|
||||
return payMethod[this.platform][this.payment];
|
||||
}
|
||||
getPayMethod() {
|
||||
var payMethod = {
|
||||
'wxMiniProgram': {
|
||||
'wechat': () => {
|
||||
this.wxMiniProgramPay()
|
||||
},
|
||||
},
|
||||
'App': {
|
||||
'wechat': () => {
|
||||
this.wechatPay()
|
||||
},
|
||||
'alipay': () => {
|
||||
this.aliPay()
|
||||
},
|
||||
},
|
||||
}
|
||||
return payMethod[this.platform][this.payment];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 预支付
|
||||
prepay() {
|
||||
let that = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
const p = $platform.device()
|
||||
const tradeInfoType = p == 'android' ? 'Android' : p == 'ios' ? 'iOS' : 'Wap'
|
||||
let params = {
|
||||
orderId: this.order.orderId,
|
||||
orderPayType: this.order.orderPayType,
|
||||
money: this.order.money,
|
||||
microServiceName: this.order.microServiceName,
|
||||
prepayParamUrl: this.order.prepayParamUrl,
|
||||
paymentType: 'weChatPay',
|
||||
payType: 'JSAPI',
|
||||
tradeInfoType: tradeInfoType,
|
||||
tenantId: '-1',
|
||||
clientType: 'miniWx'
|
||||
}
|
||||
if (uni.getStorageSync('openId')) {
|
||||
params.openId = uni.getStorageSync('openId');
|
||||
}
|
||||
request({
|
||||
url: 'driver-api/applet/pay/prepay',
|
||||
method: 'POST',
|
||||
param,
|
||||
}).then(res => {
|
||||
if (res.code == 'SUCCESS') {
|
||||
// 预支付
|
||||
prepay() {
|
||||
let that = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
const p = $platform.device()
|
||||
const tradeInfoType = p == 'android' ? 'Android' : p == 'ios' ? 'iOS' : 'Wap'
|
||||
let params = {
|
||||
"code":this.order.code,
|
||||
"description": this.order.description,
|
||||
"money": this.order.money,
|
||||
"outTradeNo": this.order.outTradeNo,
|
||||
"userId": this.order.userId
|
||||
}
|
||||
if (uni.getStorageSync('openId')) {
|
||||
params.openId = uni.getStorageSync('openId');
|
||||
}
|
||||
prePay(params).then(res => {
|
||||
if (res.code == '0000') {
|
||||
resolve(res);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 微信小程序支付
|
||||
async wxMiniProgramPay() {
|
||||
let that = this;
|
||||
let result = await this.prepay();
|
||||
const params = result.data.jsApiResult
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
...{
|
||||
appId: params.appId, //公众号名称,由商户传入
|
||||
timeStamp: params.timestamp, //时间戳,自1970年以来的秒数
|
||||
nonceStr: params.nonceStr, //随机串
|
||||
package: `prepay_id=${params.prepay_id}`,
|
||||
signType: params.signType, //微信签名方式:
|
||||
paySign: params.paySign, //微信签名
|
||||
},
|
||||
success: res => {
|
||||
that.payResult('success', result.data.orderPayNo)
|
||||
},
|
||||
fail: err => {
|
||||
console.log('支付取消或者失败:', err);
|
||||
err.errMsg !== "requestPayment:fail cancel" && that.payResult('fail')
|
||||
}
|
||||
});
|
||||
}
|
||||
// 微信小程序支付
|
||||
async wxMiniProgramPay() {
|
||||
let that = this;
|
||||
let result = await this.prepay();
|
||||
const params = result.data
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
...{
|
||||
appId: params.appId, //公众号名称,由商户传入
|
||||
timeStamp: params.timeStamp, //时间戳,自1970年以来的秒数
|
||||
nonceStr: params.nonceStr, //随机串
|
||||
package: params.packageVal,
|
||||
signType: params.signType, //微信签名方式:
|
||||
paySign: params.paySign, //微信签名
|
||||
},
|
||||
success: res => {
|
||||
console.log(res);
|
||||
that.payResult('success', result.data.orderPayNo)
|
||||
},
|
||||
fail: err => {
|
||||
console.log('支付取消或者失败:', err);
|
||||
err.errMsg !== "requestPayment:fail cancel" && that.payResult('fail')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 支付宝支付
|
||||
async aliPay() {
|
||||
let that = this;
|
||||
let result = await this.prepay();
|
||||
if (result.code === 1) {
|
||||
uni.requestPayment({
|
||||
provider: 'alipay',
|
||||
orderInfo: result.data.pay_data, //支付宝订单数据
|
||||
success: res => {
|
||||
that.payResult('success')
|
||||
},
|
||||
fail: err => {
|
||||
console.log('支付取消或者失败:', err);
|
||||
err.errMsg !== "requestPayment:fail cancel" && that.payResult('fail')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 支付宝支付
|
||||
async aliPay() {
|
||||
let that = this;
|
||||
let result = await this.prepay();
|
||||
if (result.code === 1) {
|
||||
uni.requestPayment({
|
||||
provider: 'alipay',
|
||||
orderInfo: result.data.pay_data, //支付宝订单数据
|
||||
success: res => {
|
||||
that.payResult('success')
|
||||
},
|
||||
fail: err => {
|
||||
err.errMsg !== "requestPayment:fail cancel" && that.payResult('fail')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 微信支付
|
||||
async wechatPay() {
|
||||
let that = this;
|
||||
let result = await this.prepay();
|
||||
if (result.code === 1) {
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
orderInfo: JSON.parse(result.data.pay_data), //微信订单数据(官方说是string。实测为object)
|
||||
success: res => {
|
||||
that.payResult('success')
|
||||
},
|
||||
fail: err => {
|
||||
err.errMsg !== "requestPayment:fail cancel" && that.payResult('fail')
|
||||
console.log('支付取消或者失败:', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
// 微信支付
|
||||
async wechatPay() {
|
||||
let that = this;
|
||||
let result = await this.prepay();
|
||||
console.log('微信支付');
|
||||
if (result.code === 1) {
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
orderInfo: JSON.parse(result.data.pay_data), //微信订单数据(官方说是string。实测为object)
|
||||
success: res => {
|
||||
that.payResult('success')
|
||||
},
|
||||
fail: err => {
|
||||
err.errMsg !== "requestPayment:fail cancel" && that.payResult('fail')
|
||||
console.log('支付取消或者失败:', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 支付结果跳转,success:成功,fail:失败
|
||||
payResult(resultType, orderPayNo) {
|
||||
const that = this;
|
||||
let path = ''
|
||||
// 支付结果跳转,success:成功,fail:失败
|
||||
payResult(resultType, orderPayNo) {
|
||||
const that = this;
|
||||
let path = 'paySuccess'
|
||||
uni.navigateTo({
|
||||
url:path
|
||||
url: path
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -11,22 +11,78 @@ const question = defineStore({
|
||||
id: 'question',
|
||||
state: () => ({
|
||||
currentCartype: storage.get('carType') || '1001',
|
||||
orderQuestion: [], //顺序做题
|
||||
orderQuestion_subject1: [], //科目一顺序做题
|
||||
orderQuestion_subject4:[],//科目二顺序做题
|
||||
currentIndex_subject1:0,//科目一索引 顺序做题
|
||||
currentIndex_subject4:0,//科目四索引 顺序做题
|
||||
curSubject:storage.get('curSubject') || '1'
|
||||
}),
|
||||
|
||||
actions: {
|
||||
// 获取顺序做题
|
||||
getOrderQuestion(val) {
|
||||
queryQuestion({
|
||||
carTypeId: this.currentCartype,
|
||||
subject: val
|
||||
}).then(res => {
|
||||
if (res.code == '0000') {
|
||||
this.orderQuestion = res.data
|
||||
}
|
||||
})
|
||||
//改变当前科目
|
||||
changeSubject(val){
|
||||
this.curSubject=val
|
||||
storage.set('curSubject',val)
|
||||
},
|
||||
// 获取顺序做题科目1
|
||||
getOrderQuestion_sub1() {
|
||||
this.curSubject='1'
|
||||
storage.set('curSubject','1')
|
||||
if(!this.orderQuestion_subject1.length){
|
||||
queryQuestion({
|
||||
carTypeId: this.currentCartype,
|
||||
subject: '1',
|
||||
// questionIdList:[10982,10983,10985,10986]
|
||||
}).then(res => {
|
||||
if (res.code == '0000') {
|
||||
this.orderQuestion_subject1 = res.data
|
||||
const falseList =storage.get('wrongList_subject1') || []
|
||||
const trueList =storage.get('rightList_subject1')|| []
|
||||
const falseArr=[]
|
||||
const rightArr=[]
|
||||
this.orderQuestion_subject1.forEach(item=>{
|
||||
if(falseList.includes(item.questionId)){
|
||||
falseArr.push(item.questionId)
|
||||
}
|
||||
if(trueList.includes(item.questionId)){
|
||||
rightArr.push(item.questionId)
|
||||
}
|
||||
})
|
||||
storage.set('wrongList_subject1',falseArr)
|
||||
storage.set('rightList_subject1',rightArr)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取顺序做题科目4
|
||||
getOrderQuestion_sub4() {
|
||||
this.curSubject='4'
|
||||
storage.set('curSubject','4')
|
||||
if(!this.orderQuestion_subject4.length){
|
||||
queryQuestion({
|
||||
carTypeId: this.currentCartype,
|
||||
subject: '4',
|
||||
// questionIdList:[10982,10983,10985,10986]
|
||||
}).then(res => {
|
||||
if (res.code == '0000') {
|
||||
this.orderQuestion_subject4 = res.data
|
||||
const falseList =storage.get('wrongList_subject4') || []
|
||||
const trueList =storage.get('rightList_subject4')|| []
|
||||
const falseArr=[]
|
||||
const rightArr=[]
|
||||
this.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){
|
||||
|
||||
261
src/jtools/wechat/wechat.js
Normal file
@@ -0,0 +1,261 @@
|
||||
/**
|
||||
* Wechat v1.1.0
|
||||
* @Class Wechat
|
||||
* @description jtools-wechat 1.1.0 wehcat第三方登录组件
|
||||
* @Author lidongtony
|
||||
* @Date 2020-05-20
|
||||
* @Email lidongtony@qq.com
|
||||
*/
|
||||
import api from "@/jtools/request/index";
|
||||
import $platform from "@/jtools/platform";
|
||||
import store from "@/jtools/store";
|
||||
import {
|
||||
API_URL
|
||||
} from "@/env";
|
||||
|
||||
export default {
|
||||
eventMap(event) {
|
||||
let map = "";
|
||||
switch (event) {
|
||||
case "login":
|
||||
map = "登录中...";
|
||||
break;
|
||||
case "refresh":
|
||||
map = "更新中...";
|
||||
break;
|
||||
case "bind":
|
||||
map = "绑定中...";
|
||||
break;
|
||||
}
|
||||
return map;
|
||||
},
|
||||
|
||||
async login() {
|
||||
let token = "";
|
||||
// #ifdef MP-WEIXIN
|
||||
token = await this.wxMiniProgramOauth("login");
|
||||
return token;
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.wxOfficialAccountOauth("login");
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
token = await this.wxOpenPlatformOauth("login");
|
||||
return token;
|
||||
// #endif
|
||||
},
|
||||
async refresh() {
|
||||
let token = "";
|
||||
// #ifdef MP-WEIXIN
|
||||
token = await this.wxMiniProgramOauth("refresh");
|
||||
return token;
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.wxOfficialAccountOauth("refresh");
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
token = await this.wxOpenPlatformOauth("refresh");
|
||||
return token;
|
||||
// #endif
|
||||
},
|
||||
async bind() {
|
||||
let token = "";
|
||||
// #ifdef MP-WEIXIN
|
||||
token = await this.wxMiniProgramOauth("bind");
|
||||
return token;
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
this.wxOfficialAccountOauth("bind");
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
token = await this.wxOpenPlatformOauth("bind");
|
||||
return token;
|
||||
// #endif
|
||||
},
|
||||
|
||||
// #ifdef H5
|
||||
// 微信公众号网页登录&刷新头像昵称&绑定
|
||||
wxOfficialAccountOauth(event = "login") {
|
||||
if ($platform.get() !== "wxOfficialAccount") {
|
||||
uni.showToast({
|
||||
title: "请在微信浏览器中打开",
|
||||
icon: "none"
|
||||
});
|
||||
throw false;
|
||||
}
|
||||
let host = $platform.host();
|
||||
let payloadObject = {
|
||||
host: host,
|
||||
event,
|
||||
token: (event !== "login" && store.getters.isLogin) ? uni.getStorageSync("token") : ""
|
||||
};
|
||||
let payload = encodeURIComponent(JSON.stringify(payloadObject));
|
||||
let redirect_uri = encodeURIComponent(`${API_URL}user/wxOfficialAccountOauth?payload=${payload}`);
|
||||
let oauthUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + store.getters.initWechat.appid +
|
||||
`&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_userinfo&state=1`;
|
||||
uni.setStorageSync("lastPage", window.location.href);
|
||||
window.location = oauthUrl;
|
||||
},
|
||||
|
||||
// 微信公众号网页静默登录:临时登录获取OpenId 不入库不绑定用户
|
||||
wxOfficialAccountBaseLogin() {
|
||||
let state = encodeURIComponent(window.location.href);
|
||||
window.location = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + store.getters.initWechat.appid +
|
||||
`&redirect_uri=${API_URL}user/wxOfficialAccountBaseLogin&response_type=code&scope=snsapi_base&state=${state}`;
|
||||
throw "stop";
|
||||
},
|
||||
// #endif
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// 微信开放平台登录
|
||||
wxOpenPlatformOauth(event = "login") {
|
||||
let that = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.login({
|
||||
provider: "weixin",
|
||||
success: function(loginRes) {
|
||||
if (loginRes.errMsg === "login:ok") {
|
||||
let authResult = loginRes.authResult;
|
||||
api("user.wxOpenPlatformOauth", {
|
||||
authResult,
|
||||
event
|
||||
}, that.eventMap(event)).then(res => {
|
||||
if (res.code === 1) {
|
||||
resolve(res.data.token);
|
||||
} else {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: function(res) {
|
||||
uni.showToast({
|
||||
title: "登录失败,请稍后再试"
|
||||
});
|
||||
resolve(false);
|
||||
api("common.debug", {
|
||||
info: res
|
||||
});
|
||||
},
|
||||
complete: function(res) {}
|
||||
});
|
||||
});
|
||||
},
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// 微信小程序静默登录
|
||||
async getWxMiniProgramSessionKey(autoLogin = true) {
|
||||
let sessionStatus = false;
|
||||
let session_key = "";
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.checkSession({
|
||||
success(res) {
|
||||
if (res.errMsg === "checkSession:ok") sessionStatus = true;
|
||||
},
|
||||
complete() {
|
||||
if (uni.getStorageSync("session_key") && sessionStatus && !autoLogin) {
|
||||
resolve(uni.getStorageSync("session_key"));
|
||||
} else {
|
||||
uni.login({
|
||||
success: function(info) {
|
||||
let code = info.code;
|
||||
api("user.getWxMiniProgramSessionKey", {
|
||||
code: code,
|
||||
autoLogin: autoLogin
|
||||
}).then(res => {
|
||||
if (res.code === 1) {
|
||||
uni.setStorageSync("session_key", res
|
||||
.data.session_key);
|
||||
if (autoLogin) {
|
||||
if (res.data.token) {
|
||||
resolve(res.data.token);
|
||||
} else {
|
||||
resolve(false);
|
||||
}
|
||||
}
|
||||
resolve(res.data.session_key);
|
||||
} else {
|
||||
reject(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// 微信小程序获取用户信息登录
|
||||
wxMiniProgramOauth(event = "login") {
|
||||
let that = this;
|
||||
let session_key = uni.getStorageSync("session_key");
|
||||
uni.showLoading({
|
||||
title: that.eventMap(event)
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.getUserProfile({ // 必须手动确认触发
|
||||
desc: "完善会员资料", // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
|
||||
success: res => {
|
||||
if (res.errMsg === "getUserProfile:ok") {
|
||||
api("user.wxMiniProgramOauth", {
|
||||
event,
|
||||
session_key,
|
||||
encryptedData: res.encryptedData,
|
||||
iv: res.iv,
|
||||
signature: res.signature,
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 1) {
|
||||
resolve(res.data.token);
|
||||
} else {
|
||||
uni.removeStorageSync("session_key");
|
||||
that.getWxMiniProgramSessionKey(false);
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
complete: res => {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 小程序更新
|
||||
checkMiniProgramUpdate() {
|
||||
if (uni.canIUse("getUpdateManager")) {
|
||||
const updateManager = uni.getUpdateManager();
|
||||
updateManager.onCheckForUpdate(function(res) {
|
||||
// 请求完新版本信息的回调
|
||||
if (res.hasUpdate) {
|
||||
updateManager.onUpdateReady(function() {
|
||||
uni.showModal({
|
||||
title: "更新提示",
|
||||
content: "新版本已经准备好,是否重启应用?",
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||
updateManager.applyUpdate();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
updateManager.onUpdateFailed(function() {
|
||||
// 新的版本下载失败
|
||||
uni.showModal({
|
||||
title: "已经有新版本了哟~",
|
||||
content: "新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~"
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
// #endif
|
||||
|
||||
|
||||
};
|
||||
@@ -100,7 +100,7 @@
|
||||
{
|
||||
"path": "pages/index/videoVip",
|
||||
"style": {
|
||||
"navigationBarTitleText": "视频精品课",
|
||||
"navigationBarTitleText": "开通会员",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
@@ -111,27 +111,41 @@
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/iconSkill",
|
||||
"style": {
|
||||
"navigationBarTitleText": "图标技巧",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/questionBank/chapterExercise",
|
||||
"style": {
|
||||
"navigationBarTitleText": "章节练习",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/testRoom",
|
||||
"style": {
|
||||
"navigationBarTitleText": "考场实况",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}
|
||||
{
|
||||
"path": "pages/index/iconSkill",
|
||||
"style": {
|
||||
"navigationBarTitleText": "图标技巧",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/questionBank/chapterExercise",
|
||||
"style": {
|
||||
"navigationBarTitleText": "章节练习",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/testRoom",
|
||||
"style": {
|
||||
"navigationBarTitleText": "考场实况",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/index/paySuccess",
|
||||
"style": {
|
||||
"navigationBarTitleText": "支付结果",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}, {
|
||||
"path": "pages/index/trueTest",
|
||||
"style": {
|
||||
"navigationBarTitleText": "真实考场模拟",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}
|
||||
],
|
||||
|
||||
"globalStyle": {
|
||||
@@ -145,8 +159,7 @@
|
||||
"selectedColor": "#333333",
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"color": "#999999",
|
||||
"list": [
|
||||
{
|
||||
"list": [{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "static/image/tabbar/tab-home.png",
|
||||
"selectedIconPath": "static/image/tabbar/tab-home-selected.png",
|
||||
@@ -161,4 +174,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,19 +4,21 @@
|
||||
<image style="width: 100%;" src="../../static/image/index/index_bg.jpg"></image>
|
||||
<view class="center-box flex jc-sb ai-c">
|
||||
<view class="box-item flex ai-c jc-c">
|
||||
<view class="flex jc-c ai-c" style="width: 230rpx;height: 230rpx;background-image: url(../../../static/image/index/green_bg.png);background-size: 100% 100%;">
|
||||
<view class="flex jc-c ai-c relative" style="width: 230rpx;height: 230rpx;" @tap="toAnswer('顺序答题',false)">
|
||||
<image style="width: 230rpx;height: 230rpx;position: absolute;left: 0;top: 0;" src="../../../static/image/index/green_bg.png"></image>
|
||||
<view class="btn-item flex ai-c jc-c">
|
||||
<view class="text-center cor-fff" style="line-height: 40rpx;" @tap="toAnswer('顺序答题',false)">
|
||||
<view class="text-center cor-fff" style="line-height: 40rpx;">
|
||||
<view class="fs16">顺序练习</view>
|
||||
<text class="fs14">{{rightList.length+wrongList.length}}/{{orderQuestion.length}}</text>
|
||||
<text class="fs14">{{getDoNum}}/{{subject=='1'?orderQuestion_subject1.length:orderQuestion_subject4.length}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box-item flex ai-c jc-c">
|
||||
<view class="flex jc-c ai-c" style="width: 230rpx;height: 230rpx;background-image: url(../../../static/image/index/orange_bg.png);background-size: 100% 100%;">
|
||||
<view class="flex jc-c ai-c relative" style="width: 230rpx;height: 230rpx;" @tap="toExams">
|
||||
<image style="width: 230rpx;height: 230rpx;position: absolute;left: 0;top: 0;" src="../../../static/image/index/orange_bg.png"></image>
|
||||
<view class="btn2-item flex ai-c jc-c">
|
||||
<view class="text-center cor-fff" style="line-height: 40rpx;" @tap="toExams">
|
||||
<view class="text-center cor-fff" style="line-height: 40rpx;">
|
||||
<view class="fs16">模拟考试</view>
|
||||
<text class="fs14">去考试</text>
|
||||
</view>
|
||||
@@ -81,7 +83,10 @@
|
||||
<text class="cor-666 fs12">全部10节课 ></text>
|
||||
</view>
|
||||
<view class="flex ai-c mt20">
|
||||
<image class="contain-box" src="../../static/image/index/index_bg.jpg"></image>
|
||||
<view class="contain-box relative">
|
||||
<image class="contain-box" src="../../../static/image/index/jpsp.png"></image>
|
||||
<image class="play_btn_2" src="../../static/image/index/play.png" />
|
||||
</view>
|
||||
<view class="ml15 text-center">
|
||||
<u-button :customStyle="{width:'200rpx',height:'66rpx',borderRadius: '33rpx'}" iconColor="#fff"
|
||||
text="去看视频" color="linear-gradient(90deg, #11DF20 0%, #00B74F 100%)" icon="play-circle">
|
||||
@@ -103,36 +108,55 @@
|
||||
props:{
|
||||
subject:{
|
||||
type:[String,Number],
|
||||
},
|
||||
rightList:{
|
||||
type:Array
|
||||
},
|
||||
wrongList:{
|
||||
type:Array
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
rightList:storage.get(`rightList_subject${this.subject}`) || [],
|
||||
wrongList:storage.get(`wrongList_subject${this.subject}`) || [],
|
||||
allQuestionNum:0,
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
// this.allQuestionNum=useQuestionStore().orderQuestion.length
|
||||
mounted(){
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["orderQuestion"]) //映射函数,取出tagslist
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject4"]) ,//映射函数,取出tagslist
|
||||
getDoNum(){
|
||||
return this.rightList.length+this.wrongList.length
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toTestRoom(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/testRoom"
|
||||
url:"/pages/index/trueTest"
|
||||
})
|
||||
},
|
||||
toVip(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/videoVip"
|
||||
})
|
||||
if(storage.get('token')){
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/videoVip?subject="+this.subject
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
toClass(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/baseOperate"
|
||||
})
|
||||
if(storage.get('token')){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/baseOperate"
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
toAnswer(title,val) {
|
||||
uni.navigateTo({
|
||||
@@ -140,13 +164,19 @@
|
||||
})
|
||||
},
|
||||
toExams(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/practiceExams?subject="+this.subject
|
||||
})
|
||||
if(storage.get('token')){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/practiceExams?subject="+this.subject
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
}
|
||||
},
|
||||
toExclusive(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/exclusiveExercise"
|
||||
url:"/pages/questionBank/exclusiveExercise?subject="+this.subject
|
||||
})
|
||||
},
|
||||
toWrongList(){
|
||||
@@ -224,4 +254,11 @@
|
||||
background: #00B74F;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.play_btn_2 {
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
position: absolute;
|
||||
left: 165.5rpx;
|
||||
top: 78rpx
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,31 +3,45 @@
|
||||
<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;">
|
||||
<view class="video_box">
|
||||
<view class="flex ai-c jc-sb mt5">
|
||||
<text class="fs18 cor-000">科二考试项目讲解</text>
|
||||
<text class="fs18 cor-000">科{{subject=='2'?'二':'三'}}考试项目讲解</text>
|
||||
<view class="flex ai-c" style="height: 34rpx;line-height: 34rpx;" @tap="changeDiverType">
|
||||
<text style="color:#05C341;font-size: 16px;">{{diverTypeList[diverTypeIndex].configItemName}}</text>
|
||||
<text style="color:#05C341;font-size: 16px;">{{diverTypeList[diverTypeIndex]?.configItemName}}</text>
|
||||
<u-icon name="list" color="#05C341" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex ai-c jc-sb mt15">
|
||||
<view class="tab_iem" :class="videoIndex===item.value?'checked_tab':''" v-for="(item,index) of operateList" :key="index" @tap="checkVideo(index)">{{item.description}}</view>
|
||||
<view class="flex ai-c jc-fa mt15" style="flex-wrap: wrap;">
|
||||
<view class="tab_iem mr10 mb10" :class="videoIndex===index?'checked_tab':''" v-for="(item,index) of operateList" :key="index" @tap="checkVideo(index)">{{item.description}}</view>
|
||||
</view>
|
||||
<view class="mt15">
|
||||
<video style="width: 100%;height: 362rpx;border-radius: 16rpx;" id="myVideo" :src="operateList[videoIndex].videoList[0].videoUrl"></video>
|
||||
<view @tap="toVideo">
|
||||
<view class="wp100 relative" style="height: 362rpx;border-radius: 16rpx;">
|
||||
<image style="width: 100%;height: 362rpx;border-radius: 16rpx;" id="myVideo" src="../../../static/image/index/jpsp.png"></image>
|
||||
<image class="play_btn_2" src="../../static/image/index/play.png" />
|
||||
</view>
|
||||
</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="toDetail">
|
||||
<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="toVideo">
|
||||
<view class="pic relative">
|
||||
<image class="pic" src="../../static/image/index/index_bg.jpg"></image>
|
||||
<image class="play_btn_3" src="../../static/image/index/play.png" />
|
||||
</view>
|
||||
<view class="ml10">
|
||||
<text class="fs16 cor-000 fw600">上车、下车的方法</text>
|
||||
<view class="fs14 mt5 cor-666">上车、下车的方法</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -52,6 +66,7 @@ export default {
|
||||
diverTypeIndex:0,
|
||||
diverTypeList:[],
|
||||
videoIndex:0,
|
||||
projectId:undefined,
|
||||
operateList:[]
|
||||
}
|
||||
},
|
||||
@@ -59,17 +74,29 @@ export default {
|
||||
await this.getDiverType()
|
||||
},
|
||||
methods:{
|
||||
getOperateList(){
|
||||
queryProjectList({
|
||||
"carTypeId": storage.get('carType') || '1001',
|
||||
"subject": String(this.subject),
|
||||
"type": "2"
|
||||
}).then(resp=>{
|
||||
console.log(resp);
|
||||
})
|
||||
},
|
||||
toVideo(){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/videoDetail?driveType="+this.diverTypeList[this.diverTypeIndex].configItemCode+"&subject="+this.subject+"&projectId="+this.projectId+"&type=1"
|
||||
})
|
||||
},
|
||||
getVideoList(){
|
||||
console.log('index',this.diverTypeIndex);
|
||||
console.log(this.diverTypeList[this.diverTypeIndex]);
|
||||
queryProjectList({
|
||||
"carTypeId": storage.get('carType') || '1001',
|
||||
"driveType": this.diverTypeList[this.diverTypeIndex].configItemCode,
|
||||
"subject": String(this.subject),
|
||||
"projectId":'1001',
|
||||
"type": "1"
|
||||
}).then(resp=>{
|
||||
this.operateList=resp.data
|
||||
this.projectId=this.operateList[0]?.projectId
|
||||
})
|
||||
},
|
||||
getDiverType(){
|
||||
@@ -86,6 +113,7 @@ export default {
|
||||
this.getVideoList()
|
||||
},
|
||||
checkVideo(val){
|
||||
this.projectId=this.operateList[val]?.projectId
|
||||
this.videoIndex=val
|
||||
},
|
||||
toDetail(){
|
||||
@@ -115,7 +143,7 @@ export default {
|
||||
padding: 14px;
|
||||
}
|
||||
.tab_iem{
|
||||
width: 145rpx;
|
||||
padding: 0 5px;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
@@ -127,4 +155,24 @@ export default {
|
||||
background: linear-gradient(90deg, #11DF20 0%, #01B74F 100%);
|
||||
color:#fff
|
||||
}
|
||||
.pic{
|
||||
width: 300rpx;
|
||||
height: 169rpx;
|
||||
background: #00B74F;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.play_btn_3{
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
position: absolute;
|
||||
left:117.5rpx;
|
||||
top: 52rpx
|
||||
}
|
||||
.play_btn_2{
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
position: absolute;
|
||||
left: calc((100% - 65rpx)/2);
|
||||
top: 148.5rpx
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-sticky bgColor="#fff">
|
||||
<u-tabs :list="categoryList" :scrollable="false" @change="changeCategory"></u-tabs>
|
||||
<u-tabs :list="categoryList" :current="curTab" :scrollable="false" @change="changeCategory"></u-tabs>
|
||||
</u-sticky>
|
||||
<view style="height: 100vh;background-color: rgb(245, 245, 245);">
|
||||
<template v-if="tIndex===0 || tIndex===3">
|
||||
<Subject1 :subject="tIndex+1" />
|
||||
<template v-if="subject=='1' || subject=='4'">
|
||||
<Subject1 :subject="subject" :rightList="rightList" :wrongList="wrongList" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<subject2 :subject="tIndex+1" />
|
||||
<subject2 :subject="subject" ref="subjectRef" />
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
@@ -17,37 +17,66 @@
|
||||
import { mapState,mapActions } from 'pinia' //引入映射函数
|
||||
import useQuestionStore from '@/jtools/store/question' //引入store
|
||||
import storage from '@/jtools/storage';
|
||||
import {
|
||||
querySysConfigList,
|
||||
} from '@/jtools/api/question';
|
||||
import Subject1 from "./components/Subject1";
|
||||
import Subject2 from "./components/Subject2";
|
||||
export default {
|
||||
components: {Subject1,Subject2},
|
||||
data() {
|
||||
return {
|
||||
tIndex:0,
|
||||
subject:storage.get('curSubject') || '1',
|
||||
curTab:Number(storage.get('curSubject'))-1,
|
||||
searchValue:'',
|
||||
cityName:'',
|
||||
categoryList:[{
|
||||
name:'科目1'
|
||||
},{
|
||||
name:'科目2'
|
||||
},{
|
||||
name:'科目3'
|
||||
},{
|
||||
name:'科目4'
|
||||
}]
|
||||
categoryList:[],
|
||||
rightList:storage.get(`rightList_subject${this.subject}`) || [],
|
||||
wrongList:storage.get(`wrongList_subject${this.subject}`) || [],
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(){
|
||||
this.getSubjectConfig()
|
||||
},
|
||||
onShow() {
|
||||
if(this.subject=='1'||this.subject=='4'){
|
||||
this.rightList=storage.get(`rightList_subject${this.subject}`) || []
|
||||
this.wrongList=storage.get(`wrongList_subject${this.subject}`) || []
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
...mapActions(useQuestionStore,['getOrderQuestion']),
|
||||
...mapActions(useQuestionStore,['getOrderQuestion_sub4','getOrderQuestion_sub1','changeSubject']),
|
||||
//获取科目配置
|
||||
getSubjectConfig(){
|
||||
const carTypeId=storage.get('carType') || '1001'
|
||||
querySysConfigList(carTypeId,'Subject').then(resp=>{
|
||||
if(resp.code==='0000'){
|
||||
this.categoryList=resp.data.map(item=>{
|
||||
return{
|
||||
...item,
|
||||
name:item.configItemName
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
//切换科目
|
||||
changeCategory(val){
|
||||
this.tIndex=val.index
|
||||
if(this.tIndex==0){
|
||||
this.getOrderQuestion('1')
|
||||
}else if(this.tIndex==3){
|
||||
this.getOrderQuestion('4')
|
||||
async changeCategory(val){
|
||||
this.subject=val.configItemCode
|
||||
console.log();
|
||||
if(this.subject=='1'){
|
||||
await this.getOrderQuestion_sub1()
|
||||
}else if(this.subject=='4'){
|
||||
await this.getOrderQuestion_sub4()
|
||||
}else{
|
||||
this.changeSubject(this.subject)
|
||||
setTimeout(()=>{
|
||||
this.$refs.subjectRef.getDiverType()
|
||||
},100)
|
||||
}
|
||||
if(this.subject=='1'||this.subject=='4'){
|
||||
this.rightList=storage.get(`rightList_subject${this.subject}`) || []
|
||||
this.wrongList=storage.get(`wrongList_subject${this.subject}`) || []
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
47
src/pages/index/paySuccess.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<view class="wp100 flex jc-c bc-fff " style="height: 100vh;">
|
||||
<view class="mt50 text-center flex ai-c" style="flex-direction: column;">
|
||||
<view style="width: 211rpx;" class="text-center">
|
||||
<image style="width: 211rpx;height: 222rpx;;" src="../../static/image/index/paysucess.jpg"></image>
|
||||
</view>
|
||||
<view style="width: 385rpx;" class="text-center">
|
||||
<view class="fw600 fs16 cor-000 mb10">支付成功</view>
|
||||
<tetx class="fs14 cor-666">恭喜您,您已成功购买VIP课程,赶紧去学习吧!</tetx>
|
||||
</view>
|
||||
<button class="btn mt10" @click="goBack">去学习</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
|
||||
}
|
||||
},
|
||||
onLoad(){
|
||||
useUserStore().searchUserVip()
|
||||
},
|
||||
methods:{
|
||||
goBack(){
|
||||
uni.switchTab({
|
||||
url:"/pages/index/index"
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.btn{
|
||||
width: 260rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
color:#00B74F;
|
||||
border: 2px solid #00B74F;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
</style>
|
||||
257
src/pages/index/trueTest.vue
Normal file
@@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<view class="ml40 p10lr hp100 bc-f5" style="overflow-y: auto;">
|
||||
<view class="flex" style="align-items: stretch;">
|
||||
<view class="left hp100">
|
||||
<view class="fl1 flex" style="align-items: stretch;">
|
||||
<view class="info">
|
||||
<view class="flex ai-c jc-c mt10 mr10 fs16" style="border: 1px solid #999;height: 32px;">
|
||||
第01考台
|
||||
</view>
|
||||
<view class="mt10 p10tb" style="background-color: rgb(177, 222, 255);">
|
||||
<view style="margin: 0 auto;width: 64px;">
|
||||
<u-avatar :size="64" mp-avatar shape="circle"></u-avatar>
|
||||
</view>
|
||||
</view>
|
||||
<view class="p10" style="background-color: rgb(235, 235, 235);">
|
||||
<view class="flex ai-c">
|
||||
<text class="fs12 cor-333">姓名</text>
|
||||
<view class="fl1 info-box">
|
||||
{{ user.userName }}{{ user.userId }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex ai-c">
|
||||
<text class="fs12 cor-333">类型</text>
|
||||
<view class="fl1 info-box">
|
||||
小车
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex ai-c">
|
||||
<text class="fs12 cor-333">科目</text>
|
||||
<view class="fl1 info-box">
|
||||
科目一
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="fl1 question-box">
|
||||
<view class="fs14 cor-000">
|
||||
{{questionIndex}} {{question.question}}
|
||||
</view>
|
||||
<view v-if="question.type != 1" v-for="item in question.optionList" class="mt5 fs14 cor-000">
|
||||
{{item}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="ans-box">
|
||||
<view class="flex ai-c">
|
||||
<view class="time">
|
||||
<text class="mt7">45:00</text>
|
||||
</view>
|
||||
<view class="ml20 fs16 cor-333 fwb">
|
||||
您的答案:
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="question.type==1" class="flex">
|
||||
<button class="btn" :class="{ done: question.yourAnswer==1 }" @tap="handleAnswer(1)">√</button>
|
||||
<button class="btn" :class="{ done: question.yourAnswer==2 }" @tap="handleAnswer(2)">×</button>
|
||||
</view>
|
||||
<view v-else class="flex">
|
||||
<template v-for="(item,index) in question.optionList">
|
||||
<button class="btn" :class="{ done: question.yourAnswer.includes(index+1) }" @tap="handleAnswer(index+1)">{{['A','B','C','D','E','F','G'][index]}}</button>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right" style="border: 1px solid #999;;">
|
||||
<u-grid border col="10">
|
||||
<u-grid-item v-for="(listItem,listIndex) in list" :key="listIndex" style="box-sizing: border-box;">
|
||||
<view class="q-item" :class="{ 'current-question': questionIndex==listIndex+1, done: listItem.yourAnswer }" @tap="questionIndex=listIndex+1">{{listIndex+1}}</view>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
</view>
|
||||
</view>
|
||||
<view class="operate-box">
|
||||
<view class="fl1">
|
||||
<view class="fs16" style="height: 20px;line-height: 20px;color: rgb(232, 72, 75);">
|
||||
操作提示:{{['','判断题','单选题','多选题'][question.type]}}
|
||||
</view>
|
||||
<view class="fs14 cor-333" style="height: 20px;line-height: 20px;">
|
||||
本题是{{getDesc(question.type)}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex">
|
||||
<button :disabled="questionIndex==1" class="btn" @tap="questionIndex--">上一题</button>
|
||||
<button :disabled="questionIndex==list.length" class="btn" @tap="questionIndex++">下一题</button>
|
||||
<button class="btn">交卷</button>
|
||||
</view>
|
||||
</view>
|
||||
<view class="img-box">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
question: {},
|
||||
questionIndex: 1,
|
||||
list: [],
|
||||
mutiAns: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
user() {
|
||||
return useUserStore().userInfo
|
||||
},
|
||||
question() {
|
||||
if(this.questionIndex!=0 && this.list.length) {
|
||||
return this.list[this.questionIndex-1]
|
||||
} else {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.fz()
|
||||
setTimeout(() => {
|
||||
for (var i = 0; i < 100; i++) {
|
||||
this.list.push({
|
||||
type: i%3+1,
|
||||
question: '这是题目这是题目内容这是题目内容这是题目内容内容这是题目这是题目内容这是题目内容这是题目内容内容',
|
||||
optionList: ['A', 'B', 'C', 'D'],
|
||||
yourAnswer:''
|
||||
})
|
||||
}
|
||||
},1000)
|
||||
},
|
||||
methods: {
|
||||
fz() {
|
||||
wx.setPageOrientation({
|
||||
orientation: 'landscape'
|
||||
});
|
||||
},
|
||||
handleAnswer(index) {
|
||||
// 如果是多选
|
||||
let q = this.list[this.questionIndex-1]
|
||||
if(q.type == 3) {
|
||||
let arr = q.yourAnswer ? q.yourAnswer.split(',') : []
|
||||
arr.includes(index+'') ? arr = arr.filter(it=>it!=(index+'')) : arr.push(index)
|
||||
this.list[this.questionIndex-1].yourAnswer = arr.join(',')
|
||||
} else {
|
||||
this.list[this.questionIndex-1].yourAnswer = index+''
|
||||
}
|
||||
},
|
||||
getDesc(type) {
|
||||
let tt1 = ['','判断题,','单选题,','多选题,'][type]
|
||||
let tt2 = ['','请判断对错!','请在备选答案中选择你认为正确的答案!','请在备选答案中选择多个你认为正确的答案!'][type]
|
||||
return tt1 + tt2
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.left {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.info {
|
||||
width: 100px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.info-box {
|
||||
margin-left: 5px;
|
||||
padding-left: 5px;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
box-shadow: inset 2px 2px 5px #babecc, inset -5px -5px 10px #fff;
|
||||
font-size: 10px;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
.question-box {
|
||||
position: relative;
|
||||
padding: 10px;
|
||||
border-top: 1px solid #999;
|
||||
border-left: 1px solid #999;
|
||||
}
|
||||
.ans-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 44px;
|
||||
border-top: 1px solid #999;
|
||||
.time {
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 90px;
|
||||
height: 28px;
|
||||
line-height: 16px;
|
||||
justify-content: center;
|
||||
font-size: 14px;
|
||||
color: #333;
|
||||
border: 1px solid #ccc;
|
||||
|
||||
&::before {
|
||||
content: '剩余时间';
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
top: 0;
|
||||
background-color: #f5f5f5;
|
||||
font-size: 10px;
|
||||
color: #333;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 270px;
|
||||
|
||||
.q-item {
|
||||
width: 28px;
|
||||
height: 27px;
|
||||
font-size: 10px;
|
||||
line-height: 27px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.operate-box {
|
||||
padding-left: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 50px;
|
||||
border-top: 2px solid rgb(43, 102, 167);
|
||||
border-bottom: 2px solid rgb(43, 102, 167);
|
||||
border-left: 1px solid #999;
|
||||
border-right: 1px solid #999;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin-right: 10px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background-color: rgb(244, 243, 239);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.img-box {
|
||||
height: 120px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border: 1px solid #999;
|
||||
}
|
||||
.current-question{
|
||||
background-color: #93F0E4;
|
||||
}
|
||||
.done {
|
||||
background-color: #33FF66;
|
||||
}
|
||||
</style>
|
||||
@@ -2,15 +2,15 @@
|
||||
<view class="relative" style="height: 100vh;">
|
||||
<image style="width: 100%;height: 600rpx;" src="../../static/image/index/vip_bg.jpg"></image>
|
||||
<view class="p14">
|
||||
<view class="flex jc-sb ai-c">
|
||||
<view class="option_tem relative" :class="checkedPrice===item.priceId?'checked_item':''" v-for="(item,index) of priceList" :key="index" @click="checkPrice(item.priceId,item.money)">
|
||||
<text class="fw600 fs16 cor-333">{{item.title}}</text>
|
||||
<view class="flex jc-fa ai-c wp100">
|
||||
<view class="option_tem relative mr15" :class="checkedId===item.memberId?'checked_item':''" v-for="(item,index) of priceList" :key="index" @click="checkPrice(item.memberId,item.price)">
|
||||
<text class="fw600 fs15 cor-333">{{item.memberName}}</text>
|
||||
<view class="mt5">
|
||||
<text class="fs14" style="color: #FF6E02;">¥</text>
|
||||
<text class="fs30 fw600" style="color: #FF6E02;">{{item.money}}</text>
|
||||
<text class="fs30 fw600" style="color: #FF6E02;">{{item.price}}</text>
|
||||
</view>
|
||||
<text class="fs12 cor-999">长期有效</text>
|
||||
<view class="bottom_box fs12 cor-333" :class="checkedPrice===item.priceId?'checked_bottom':''">赠送vip题库</view>
|
||||
<view class="bottom_box fs12 cor-333" :class="checkedId===item.memberId?'checked_bottom':''">赠送vip题库</view>
|
||||
<view class="tag" v-if="item.all">
|
||||
<text style="transform:scale(0.83);">合买更优惠</text>
|
||||
</view>
|
||||
@@ -30,7 +30,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wp100 p14" style="position: absolute;left: 0;bottom:20px">
|
||||
<view class="wp100 p14" style="position: absolute;left: 0;bottom:20px" @tap="handlePay()">
|
||||
<view class="sub_btn flex ai-c jc-sb">
|
||||
<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>
|
||||
@@ -40,34 +40,75 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import { getVipList } from '@/jtools/api/vip'
|
||||
import storage from '@/jtools/storage';
|
||||
import Pay from '@/jtools/pay/index.js';
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
subject:'1',
|
||||
loading:true,
|
||||
nowPrice:168,
|
||||
checkedPrice:0,
|
||||
priceList:[{
|
||||
priceId:0,
|
||||
title:'科一精品课',
|
||||
money:168,
|
||||
all:false
|
||||
},
|
||||
{
|
||||
priceId:1,
|
||||
title:'科四精品课',
|
||||
money:168,
|
||||
all:false
|
||||
},
|
||||
{
|
||||
priceId:2,
|
||||
title:'科一+科四',
|
||||
money:268,
|
||||
all:true,
|
||||
}]
|
||||
checkedId:0,
|
||||
priceList:[],
|
||||
order:{
|
||||
money:0.01,
|
||||
description:'会员充值'
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(op){
|
||||
if(op.subject){
|
||||
this.subject=op.subject
|
||||
}
|
||||
this.loading=true
|
||||
this.getVipList()
|
||||
this.getWXOpenId()
|
||||
this.$set(this.order, 'userId', this.userInfo.userId);
|
||||
},
|
||||
computed: {
|
||||
...mapState(useUserStore, ["userInfo"])
|
||||
},
|
||||
methods:{
|
||||
handlePay(){
|
||||
console.log(this.order);
|
||||
if(this.loading){
|
||||
this.loading=false
|
||||
new Pay('wechat', this.order);
|
||||
}
|
||||
},
|
||||
getWXOpenId() {
|
||||
const that = this
|
||||
uni.login({
|
||||
success(res) {
|
||||
that.$set(that.order, 'code', res.code);
|
||||
}
|
||||
})
|
||||
},
|
||||
getVipList(){
|
||||
getVipList({
|
||||
currentCartype: storage.get('carType') || '1001',
|
||||
subject:this.subject
|
||||
}).then(resp=>{
|
||||
this.priceList=resp.data
|
||||
this.checkedId=this.priceList[0].memberId
|
||||
this.order.outTradeNo=this.priceList[0].memberId
|
||||
this.nowPrice=this.priceList[0].price
|
||||
this.priceList.forEach(item=>{
|
||||
if(item.subjects.length>1){
|
||||
item.all=true
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
checkPrice(val,price){
|
||||
this.checkedPrice=val
|
||||
this.checkedId=val
|
||||
this.order.outTradeNo=val
|
||||
this.nowPrice=price
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,15 +143,15 @@ export default {
|
||||
methods: {
|
||||
handleVip() {
|
||||
if (this.isLogin) {
|
||||
if (this.vipOn.length) {
|
||||
// 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()
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
<u-tabs :list="categoryList" :scrollable="false" @click="changeCategory"></u-tabs>
|
||||
</u-sticky>
|
||||
<view class="p14">
|
||||
<view class="flex ai-c">
|
||||
<!-- <view class="flex ai-c">
|
||||
<view class="car_item mr10" v-for="(item,index) of carTypeList" :key="index" @tap="chooseCar(item.value)" :class="item.value===tCar?'checked_car':'unchecked_car'">{{item.label}}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="flex p14 bc-fff mt10" style="border-radius: 16rpx;" v-for="(item,index) of videoList" :key="index" @tap="toDetail">
|
||||
<image class="pic" src="../../static/image/index/index_bg.png"></image>
|
||||
<view class="ml10">
|
||||
|
||||
@@ -11,32 +11,71 @@
|
||||
<view>
|
||||
<view class="m14lr">
|
||||
<text class="tag_box">{{getQuestType(quesItem.type)}}</text>
|
||||
<text class="fs18">{{quesItem.question}}</text>
|
||||
<text class="fs18" style="line-height: 42rpx;vertical-align: middle;">{{quesItem.question}}</text>
|
||||
</view>
|
||||
<view class="flex m14lr ai-c mt20" v-for="(item,index) in quesItem.optionList"
|
||||
:key="item.op" @tap="answerQues(item.opValue,index)">
|
||||
<template v-if="item.opDesc">
|
||||
<template
|
||||
v-if="quesItem.clickAnswer&&quesItem.trueAnswer.includes(item.opValue)">
|
||||
<u-icon class="mr15" name="checkmark-circle-fill" color="#05C341" size="32"></u-icon>
|
||||
</template>
|
||||
<template
|
||||
v-else-if="quesItem.clickAnswer&&quesItem.clickAnswer.includes(item.opValue)&&!quesItem.trueAnswer.includes(item.opValue)">
|
||||
<u-icon class="mr15" name="close-circle-fill" color="red" size="32"></u-icon>
|
||||
</template>
|
||||
<template v-else-if="!item.chooseOption">
|
||||
<view class="option_item">{{item.op}}</view>
|
||||
</template>
|
||||
<text class="fs18">{{item.opDesc}}</text>
|
||||
</template>
|
||||
</view>
|
||||
<view class="m14lr mt30"
|
||||
v-if="quesItem.clickAnswer&&!quesItem.trueAnswer.includes(quesItem.clickAnswer) || tCurrent===1">
|
||||
<view class="answer_box">
|
||||
<text class="fs18 fw600 cor-000">答案:{{getRightOp(quesItem.trueAnswer)}}</text>
|
||||
<view class="fs18 cor-000" style="text-indent:2em;"> {{quesItem.bestAnswer}}</view>
|
||||
<view class="p14" v-if="quesItem.imageUrl">
|
||||
<image style="width: 100%;" mode="widthFix" :src="quesItem.imageUrl"></image>
|
||||
</view>
|
||||
<template v-if="quesItem.type!='3'">
|
||||
<view class="flex m14lr ai-c mt20" v-for="(item,index) in quesItem.optionList"
|
||||
:key="item.op" @tap="answerQues(item.opValue,index)">
|
||||
<template v-if="item.opDesc">
|
||||
<template
|
||||
v-if="quesItem.clickAnswer&&quesItem.trueAnswer.includes(item.opValue)">
|
||||
<u-icon class="mr15" name="checkmark-circle-fill" color="#05C341" size="32"></u-icon>
|
||||
</template>
|
||||
<template
|
||||
v-else-if="quesItem.clickAnswer&&quesItem.clickAnswer?.includes(item.opValue)&&!quesItem.trueAnswer.includes(item.opValue)">
|
||||
<u-icon class="mr15" name="close-circle-fill" color="red" size="32"></u-icon>
|
||||
</template>
|
||||
<template v-else-if="!item.chooseOption">
|
||||
<view class="option_item">{{item.op}}</view>
|
||||
</template>
|
||||
<text class="fs18">{{item.opDesc}}</text>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
<view class="m14lr mt30"
|
||||
v-if="quesItem.clickAnswer&&!quesItem.trueAnswer.includes(quesItem.clickAnswer) || showBestAnswer">
|
||||
<view class="answer_box">
|
||||
<text class="fs18 fw600 cor-000">答案:{{getRightOp(quesItem.trueAnswer)}}</text>
|
||||
<view class="fs18 cor-000" style="text-indent:2em;"> {{quesItem.bestAnswer}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="flex m14lr ai-c mt20" v-for="(item,index) in quesItem.optionList"
|
||||
:key="item.op" @tap="answerQues(item.opValue,index)">
|
||||
<template v-if="item.opDesc">
|
||||
<template
|
||||
v-if="quesItem.isChoose&&quesItem.trueAnswer.includes(item.opValue)&&quesItem.clickAnswer&&quesItem.clickAnswer.includes(item.opValue)">
|
||||
<u-icon class="mr15" name="checkmark-circle-fill" color="#05C341" size="32"></u-icon>
|
||||
</template>
|
||||
<template
|
||||
v-else-if="quesItem.isChoose&&quesItem.clickAnswer&&quesItem.clickAnswer.includes(item.opValue)&&!quesItem.trueAnswer.includes(item.opValue)">
|
||||
<u-icon class="mr15" name="close-circle-fill" color="red" size="32"></u-icon>
|
||||
</template>
|
||||
<template v-else-if="!quesItem.isChoose||quesItem.clickAnswer&&!quesItem.clickAnswer.includes(item.opValue)&&quesItem.isChoose">
|
||||
<template v-if="quesItem.isChoose">
|
||||
<view class="option_item" :class="quesItem.trueAnswer.includes(item.opValue)&&quesItem.clickAnswer&&!quesItem.clickAnswer.includes(item.opValue)?'right_option':''">{{item.op}}</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<view class="option_item" :class="quesItem.clickAnswer&&quesItem.clickAnswer.includes(item.opValue)&&!quesItem.isChoose?'checked_option':''">{{item.op}}</view>
|
||||
</template>
|
||||
</template>
|
||||
<text class="fs18">{{item.opDesc}}</text>
|
||||
</template>
|
||||
</view>
|
||||
<view class="p14">
|
||||
<button :class="quesItem.clickAnswer&&quesItem.clickAnswer.length>1?'dx_checked':'dx_btn'" @click="duoxuan(quesItem.clickAnswer)">确认</button>
|
||||
</view>
|
||||
<view class="m14lr mt30"
|
||||
v-if="isShowAnswer">
|
||||
<view class="answer_box">
|
||||
<text class="fs18 fw600 cor-000">答案:{{getRightOp(quesItem.trueAnswer)}}</text>
|
||||
<view class="fs18 cor-000" style="text-indent:2em;"> {{quesItem.bestAnswer}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</swiper-item>
|
||||
@@ -154,7 +193,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>
|
||||
@@ -174,8 +213,8 @@
|
||||
<image style="width: 65rpx;height: 65rpx; position: absolute;right: 20px;top: -5px;" src="../../static/image/practice/vip_include.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view style="height: 528rpx;width: 100%;background-image: url(../../static/image/practice/vip_bg.png);background-size: 100% 100%;margin-top: -65px;position: relative;">
|
||||
<text style="position: absolute;top: 138px;left:100px;rotate: 16deg;" class="fs25 cor-fff">VIP题库</text>
|
||||
<view style="height: 528rpx;width: 100%;background-image: url(../../static/image/practice/vip_bg.jpg);background-size: 100% 100%;margin-top: -65px;position: relative;">
|
||||
<text style="position: absolute;top: 151px;left:117px;rotate: 16deg;" class="fs25 cor-fff">VIP题库</text>
|
||||
</view>
|
||||
<view class="wp100 p14" style="position: absolute;left: 0;bottom:20px">
|
||||
<view class="sub_btn flex ai-c jc-sb">
|
||||
@@ -183,7 +222,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>
|
||||
|
||||
@@ -224,6 +263,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showBestAnswer:false,
|
||||
nowPrice:68,
|
||||
showVip:false,
|
||||
popupShow:false,
|
||||
@@ -245,12 +285,92 @@ export default {
|
||||
time:0,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["currentIndex_subject1","currentIndex_subject2"]) //映射函数,取出tagslist
|
||||
...mapState(useQuestionStore, ["currentIndex_subject1","currentIndex_subject2"]) ,//映射函数,取出tagslist
|
||||
isShowAnswer(){
|
||||
// quesItem.isChoose&&quesItem.clickAnswer&&!quesItem.trueAnswer.includes(quesItem.clickAnswer)
|
||||
if(this.questionList[this.topicIndex].isChoose){
|
||||
const arr1=this.questionList[this.topicIndex].clickAnswer.split('')
|
||||
const arr2=this.questionList[this.topicIndex].trueAnswer.split('')
|
||||
if(!this.isArrEqual(arr1,arr2)){
|
||||
return true
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}else{
|
||||
return false
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useQuestionStore,['getCurrentIndex']),
|
||||
isShowBest(val){
|
||||
this.showBestAnswer=val
|
||||
},
|
||||
duoxuan(val){
|
||||
if(val&&val.length>1){
|
||||
this.questionList[this.topicIndex].isChoose=true
|
||||
const falseList =storage.get(`wrongList_subject${this.subject}`) || []
|
||||
const trueList =storage.get(`rightList_subject${this.subject}`) || []
|
||||
if(this.tCurrent!==1){
|
||||
const arr1=this.questionList[this.topicIndex].clickAnswer.split('')
|
||||
const arr2=this.questionList[this.topicIndex].trueAnswer.split('')
|
||||
if(this.isArrEqual(arr1,arr2)){
|
||||
//判断选择的答案和实际的答案是否相同,如果相同,判断如果该题的ID在不在正确的数组中,不在则Push(存储的的同理)
|
||||
//如果这道题在错误的数组中则把这道题在错误数组中删掉
|
||||
if(!this.rightList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
this.rightList.push(this.questionList[this.topicIndex].questionId)
|
||||
}
|
||||
if(!trueList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
trueList.push(this.questionList[this.topicIndex].questionId)
|
||||
storage.set(`rightList_subject${this.subject}`,trueList)
|
||||
}
|
||||
if(this.wrongList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
const wIndex=this.wrongList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||
this.wrongList.splice(wIndex,1)
|
||||
}
|
||||
if(falseList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
const wIndex=falseList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||
falseList.splice(wIndex,1)
|
||||
storage.set(`wrongList_subject${this.subject}`,falseList)
|
||||
}
|
||||
//答对题目 如果不是最后一题,跳下一题
|
||||
if(this.topicIndex<this.questionList.length-1){
|
||||
this.topicIndex ++;
|
||||
this.qIndex=this.topicIndex
|
||||
setTimeout(()=>{
|
||||
this.renderSwiper(this.topicIndex);
|
||||
},1000)
|
||||
}
|
||||
if(this.topicIndex===this.questionList.length-1){
|
||||
this.qIndex=this.topicIndex+1
|
||||
}
|
||||
if(this.qIndex>this.questionList.length-1){
|
||||
setTimeout(()=>{
|
||||
this.tipShow=true
|
||||
},1000)
|
||||
}else{
|
||||
this.tipShow=false
|
||||
}
|
||||
}else{
|
||||
if(!this.wrongList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
this.wrongList.push(this.questionList[this.topicIndex].questionId)
|
||||
}
|
||||
if(!falseList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
falseList.push(this.questionList[this.topicIndex].questionId)
|
||||
storage.set(`wrongList_subject${this.subject}`,falseList)
|
||||
}
|
||||
if(trueList.includes(this.questionList[this.topicIndex].questionId)){
|
||||
const rIndex=trueList.indexOf(this.questionList[this.topicIndex].questionId)
|
||||
trueList.splice(rIndex,1)
|
||||
storage.set(`rightList_subject${this.subject}`,trueList)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
timeChange(e){
|
||||
this.time=e
|
||||
if(e.hours==0&&e.minutes==0&&e.seconds==0&&e.milliseconds==0){
|
||||
@@ -289,7 +409,9 @@ export default {
|
||||
},
|
||||
//开通VIP
|
||||
toVip(){
|
||||
this.showVip=true
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/videoVip?subject="+this.subject
|
||||
})
|
||||
},
|
||||
submitPaper(){
|
||||
this.$refs.countDown_1.pause();
|
||||
@@ -381,7 +503,7 @@ export default {
|
||||
if (this.questionList[index + 1]) {
|
||||
list.push(this.questionList[index + 1]);
|
||||
}
|
||||
|
||||
|
||||
this.duration = 0;
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -407,6 +529,7 @@ export default {
|
||||
// 轮播图当前位置小于原来时则表示为上一题
|
||||
this.topicIndex--;
|
||||
}
|
||||
|
||||
this.getCurrentIndex(this.topicIndex,this.subject)
|
||||
// 更新轮播图位置数值,为更新时让 Vue 能监听到数据有改变
|
||||
this.swiperIndex = e.detail.current;
|
||||
@@ -447,8 +570,18 @@ export default {
|
||||
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:''}${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){
|
||||
if(this.tCurrent!==1&&this.questionList[this.topicIndex].type!='3'){
|
||||
const arr1=this.questionList[this.topicIndex].clickAnswer.split('')
|
||||
const arr2=this.questionList[this.topicIndex].trueAnswer.split('')
|
||||
if(this.isArrEqual(arr1,arr2)){
|
||||
@@ -478,12 +611,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)
|
||||
@@ -521,6 +652,7 @@ export default {
|
||||
isCollect=true
|
||||
}
|
||||
this.questionList.push({
|
||||
isChoose:false,
|
||||
isCollect:isCollect,
|
||||
...item
|
||||
})
|
||||
@@ -536,6 +668,11 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.checked_option{
|
||||
background-color: #000;
|
||||
border: 1px solid #000;
|
||||
color:#fff
|
||||
}
|
||||
.type_box {
|
||||
width: 350rpx;
|
||||
height: 72rpx;
|
||||
@@ -561,6 +698,7 @@ export default {
|
||||
}
|
||||
|
||||
.tag_box {
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
width: 78rpx;
|
||||
height: 42rpx;
|
||||
@@ -610,26 +748,26 @@ export default {
|
||||
border-radius: 50%;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
|
||||
|
||||
&.active {
|
||||
border: #05C341 solid 1px;
|
||||
}
|
||||
|
||||
|
||||
&.success {
|
||||
background-color:rgb(236,247,241);
|
||||
color: #05C341;
|
||||
border: none;
|
||||
|
||||
|
||||
&.active {
|
||||
border: #05C341 solid 1px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
&.error {
|
||||
background-color: #ffeceb;
|
||||
color: #f84d27;
|
||||
border: none;
|
||||
|
||||
|
||||
&.active {
|
||||
border: #f84d27 solid 1px;
|
||||
}
|
||||
@@ -657,4 +795,27 @@ export default {
|
||||
border-radius: 55rpx;
|
||||
padding: 14rpx;
|
||||
}
|
||||
.dx_btn{
|
||||
width:100%;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
color:#fff;
|
||||
background: rgb(204,204,204);
|
||||
border-radius:100rpx;
|
||||
}
|
||||
.dx_checked{
|
||||
width:100%;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
text-align: center;
|
||||
color:#fff;
|
||||
background: #05C341;
|
||||
border-radius:100rpx;
|
||||
}
|
||||
.right_option{
|
||||
border-color: #05C341;
|
||||
background-color: #fff;
|
||||
color: #05C341
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<view class="wp100 text-center" style="margin-top: -153rpx;">
|
||||
<text v-if="score>=90">太棒了!正确率很高了!</text>
|
||||
<text v-else>很遗憾!考试不及格</text>
|
||||
<button class="centerBtn">马上提分</button>
|
||||
<button class="centerBtn" @click="toVip">马上提分</button>
|
||||
<view class="flex ai-c jc-c mt10">
|
||||
<view class="text-center wp33">
|
||||
<view>{{doNotNum}}</view>
|
||||
@@ -48,6 +48,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapState,
|
||||
mapActions
|
||||
} from 'pinia' //引入映射函数
|
||||
import useUserStore from '@/jtools/store/user'
|
||||
import GradesChart from "./components/GradesChart.vue"
|
||||
import storage from '@/jtools/storage';
|
||||
import {
|
||||
@@ -119,7 +124,24 @@
|
||||
onReady() {
|
||||
this.getServerData();
|
||||
},
|
||||
computed: {
|
||||
...mapState(useUserStore, ["vipOnList"])
|
||||
},
|
||||
methods: {
|
||||
...mapActions(useUserStore, ['searchUserVip']),
|
||||
async toVip(){
|
||||
await this.searchUserVip()
|
||||
const res = this.vipOnList.some(item => item.subjects == this.subject)
|
||||
if(res){
|
||||
uni.navigateTo({
|
||||
url: '/pages/me/vip'
|
||||
})
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:"/pages/index/videoVip?subject="+this.subject
|
||||
})
|
||||
}
|
||||
},
|
||||
getServerData() {
|
||||
testTotal({
|
||||
"carTypeId": storage.get('carType') || '1001',
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
</view>
|
||||
<view class="bc-fff pt14" style="border-radius: 20rpx;">
|
||||
<u-grid :border="false" col="4">
|
||||
<u-grid-item v-for="(listItem,listIndex) in list" :key="listIndex" @click="toAnswer(listItem.title)">
|
||||
<u-grid-item v-for="(listItem,listIndex) in list" :key="listIndex" @click="toAnswer(listItem.title,listItem.isError,listItem.isNew)">
|
||||
<view style="width: 84rpx;height: 84rpx;">
|
||||
<image style="width: 84rpx;" mode="widthFix" :src="listItem.image"></image>
|
||||
<image style="width: 84rpx;height: 100rpx;" mode="widthFix" :src="listItem.image"></image>
|
||||
</view>
|
||||
<text class="grid-text fs14 cor-000">{{listItem.title}}</text>
|
||||
<text class="grid-text mb10 fs12 cor-999">{{listItem.subTitle}}</text>
|
||||
@@ -30,10 +30,10 @@
|
||||
</view>
|
||||
<view class="mt14 p14 bc-fff" style="border-radius: 20rpx;">
|
||||
<text class="fs18 cor-000 fw600">常见考点</text>
|
||||
<view class="flex ai-c wp100 mt15" style="flex-wrap: wrap;">
|
||||
<view class="wp50 flex ai-c mb15" v-for="(item,index) of testCenterList" :key="index">
|
||||
<view class="flex ai-c wp100 mt10" style="flex-wrap: wrap;">
|
||||
<view class="wp50 flex ai-c p15tb" style="border-bottom: 1rpx solid #DDDCDC;" v-for="(item,index) of testCenterList" :key="index" @tap="toQuestionBank(item)">
|
||||
<view class="dot_item">{{index+1}}</view>
|
||||
<text class="ml5">{{item.label}}</text>
|
||||
<text class="ml5 topic_cont_text" style="width: calc(100% - 65rpx);">{{item.configItemName}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -44,6 +44,10 @@
|
||||
import errorIcon from "../../static/image/practice/error_icon.png"
|
||||
import newRulesIcon from "../../static/image/practice/newRules_icon.png"
|
||||
import neverWriteIcon from "../../static/image/practice/neverWrite_icon.png"
|
||||
import {
|
||||
querySysConfigList,
|
||||
} from '@/jtools/api/question';
|
||||
import storage from '@/jtools/storage';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -53,43 +57,62 @@
|
||||
list:[{
|
||||
title:'新规题',
|
||||
subTitle:'392题',
|
||||
isNew:1,
|
||||
isError:0,
|
||||
image:newRulesIcon
|
||||
},{
|
||||
title:'易错题',
|
||||
isNew:0,
|
||||
isError:1,
|
||||
subTitle:'392题',
|
||||
image:errorIcon
|
||||
},{
|
||||
title:'未做题',
|
||||
subTitle:'392题',
|
||||
image:neverWriteIcon
|
||||
},{
|
||||
title:'单选题',
|
||||
subTitle:'392题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:newRulesIcon
|
||||
},{
|
||||
title:'判断题',
|
||||
subTitle:'392题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:errorIcon
|
||||
},{
|
||||
title:'图片题',
|
||||
subTitle:'392题',
|
||||
isNew:0,
|
||||
isError:0,
|
||||
image:neverWriteIcon
|
||||
}],
|
||||
testCenterList:[
|
||||
{label:'驾驶证申请相关'},
|
||||
{label:'驾驶证申请相关'},
|
||||
{label:'驾驶证登记处罚'},
|
||||
{label:'机动车强制报废'},
|
||||
{label:'其他考点'},
|
||||
{label:'驾驶证登记处罚'},
|
||||
{label:'机动车强制报废'},
|
||||
{label:'其他考点'}]
|
||||
testCenterList:[],
|
||||
subject:'1'
|
||||
}
|
||||
},
|
||||
onLoad(op){
|
||||
if(op.subject){
|
||||
this.subject=op.subject
|
||||
}
|
||||
this.getExamPoint()
|
||||
},
|
||||
methods: {
|
||||
toAnswer(title) {
|
||||
getExamPoint(){
|
||||
const carTypeId=storage.get('carType') || '1001'
|
||||
const examKey = this.subject=='1'?'ExamKeysOfSubjectOne':'ExamKeysOfSubjectFour'
|
||||
querySysConfigList(carTypeId,examKey).then(resp=>{
|
||||
if(resp.code==='0000'){
|
||||
this.testCenterList=resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
toAnswer(title,isError,isNew) {
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+title
|
||||
url:"/pages/questionBank/questionBank?navTitle="+title+"&isError="+isError+"&isNew="+isNew
|
||||
})
|
||||
},
|
||||
toQuestionBank(val){
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+val.configItemName+"&examKey="+val.configItemCode
|
||||
})
|
||||
},
|
||||
toIconSkill(){
|
||||
@@ -110,10 +133,20 @@
|
||||
.dot_item{
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
line-height: 41rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background: #0BD032;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.topic_cont_text{
|
||||
height:45rpx;
|
||||
overflow: hidden;
|
||||
word-break: break-all; /* break-all(允许在单词内换行。) */
|
||||
text-overflow: ellipsis; /* 超出部分省略号 */
|
||||
display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
|
||||
-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
|
||||
-webkit-line-clamp:1; /** 显示的行数 **/
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
<view class="p14 wp100">
|
||||
<GradesChart :titleName="rightPencentDesc" :actualValue="Number(rightPencent)" />
|
||||
<view class="top_box flex jc-c" style="flex-direction: column;">
|
||||
<view class="wp100 text-center" >
|
||||
<text>太棒了!正确率很高了!</text>
|
||||
<view class="wp100 text-center" style="margin-top: -80px;">
|
||||
<text v-if="Number(rightPencent)>=90">太棒了!正确率很高了!</text>
|
||||
<text v-else>继续努力吧,正确率有点低~</text>
|
||||
<view class="flex ai-c jc-c mt10">
|
||||
<view class="text-center wp50" @tap="toQuestionBank">
|
||||
<view>{{wrongList.length}}/{{allDoNum}}</view>
|
||||
@@ -25,7 +26,7 @@
|
||||
<view class="flex ai-c jc-sb">
|
||||
<view>
|
||||
<text class="fs18 cor-000 fw600">累计练题</text>
|
||||
<text class="fs14 cor-666 ml10">33题</text>
|
||||
<text class="fs14 cor-666 ml10">{{allRightList.length+allWrongList.length}}题</text>
|
||||
</view>
|
||||
<text class="fs14 cor-666">未做题{{getNotDoNum}}题</text>
|
||||
</view>
|
||||
@@ -80,7 +81,7 @@
|
||||
}
|
||||
if(op.wrongList){
|
||||
this.wrongList=JSON.parse(op.wrongList)
|
||||
this.rightPencent=((this.allDoNum-this.wrongList.length)/this.allDoNum).toFixed(2)
|
||||
this.rightPencent=this.allDoNum>0?((this.allDoNum-this.wrongList.length)/this.allDoNum).toFixed(2):0
|
||||
this.rightPencentDesc=(this.rightPencent*100).toFixed(0)+'%'
|
||||
}
|
||||
if(op.subject){
|
||||
@@ -91,9 +92,9 @@
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["orderQuestion"]), //映射函数,取出tagslist
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject1"]), //映射函数,取出tagslist
|
||||
getNotDoNum(){
|
||||
return this.orderQuestion.length-(this.allRightList.length+this.allWrongList.length)
|
||||
return this[`orderQuestion_subject${this.subject}`].length-(this.allRightList.length+this.allWrongList.length)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -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>
|
||||
</view>
|
||||
</template>
|
||||
<Question ref="question" :tabsList="tabsList" :isShowAll="isShowAll" :subject="subject" :navTitle="navTitle"
|
||||
@changeTab="changeTab"></Question>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
@@ -25,55 +26,71 @@
|
||||
},
|
||||
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.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.subject){
|
||||
this.subject=op.subject
|
||||
}
|
||||
if (op && op.navTitle) {
|
||||
this.navTitle = op.navTitle
|
||||
const param = {}
|
||||
if (this.navTitle === '顺序答题' || this.navTitle === '精简500题') {
|
||||
if(this.subject=='1'){
|
||||
this.questionArr = [...this.orderQuestion_subject1]
|
||||
}else if(this.subject=='4'){
|
||||
this.questionArr = [...this.orderQuestion_subject4]
|
||||
}
|
||||
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'
|
||||
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 (this.navTitle === '错题本') {
|
||||
param.questionIdList = storage.get(`wrongList_subject${this.subject}`) || []
|
||||
} else if (this.navTitle === '收藏夹') {
|
||||
param.questionIdList = storage.get(`collectList_subject${this.subject}`) || []
|
||||
}
|
||||
if(op.questionList){
|
||||
param.questionIdList=JSON.parse(op.questionList)
|
||||
if (op.questionList) {
|
||||
param.questionIdList = JSON.parse(op.questionList)
|
||||
}
|
||||
if(op.chapter){
|
||||
param.chapter=op.chapter
|
||||
if (op.chapter) {
|
||||
param.chapter = op.chapter
|
||||
}
|
||||
if (op.examKey) {
|
||||
param.examKey = op.examKey
|
||||
}
|
||||
if(op.isError&&op.isError=='1'){
|
||||
param.isError=Number(op.isError)
|
||||
}
|
||||
if(op.isNew&&op.isNew=='1'){
|
||||
param.isNew=Number(op.isNew)
|
||||
}
|
||||
queryQuestion(param).then(res => {
|
||||
if (res.code == '0000') {
|
||||
@@ -83,27 +100,26 @@
|
||||
})
|
||||
}
|
||||
}
|
||||
if(op.subject){
|
||||
this.subject=op.subject
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState(useQuestionStore, ["orderQuestion"]) ,//映射函数,取出tagslist
|
||||
...mapState(useUserStore, ["vipOnList","token"])
|
||||
...mapState(useQuestionStore, ["orderQuestion_subject1","orderQuestion_subject4"]), //映射函数,取出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.isShowBest(true)
|
||||
this.$refs.question.getQuestionList(JSON.stringify(list))
|
||||
}else{
|
||||
} else {
|
||||
this.$refs.question.isShowBest(false)
|
||||
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr))
|
||||
}
|
||||
},
|
||||
@@ -116,4 +132,4 @@
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
@@ -1,13 +1,15 @@
|
||||
<template>
|
||||
<view>
|
||||
<sunny-video style="width: 100%" videoHeight="422rpx" ref="sunny-video" title="测试视频" 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" @timeupdate="timeupdate" />
|
||||
<view class="p14 bc-fff">
|
||||
<u-scroll-list :indicator="false" v-if="videoType=='test'">
|
||||
<view class="flex ai-c jc-sb mt15">
|
||||
<view class="tab_iem mr15" :class="videoIndex===item.value?'checked_tab':''" v-for="(item,index) of testList" :key="index" @tap="checkTest(item.value)">{{item.label}}</view>
|
||||
<sunny-video style="width: 100%" videoHeight="422rpx" ref="sunny-video" title="测试视频"
|
||||
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" />
|
||||
<view class="p14tb bc-fff">
|
||||
<view class="skill-sequence-panel-content-wrapper pr14" v-if="videoType=='test'">
|
||||
<scroll-view class="skill-sequence-panel-content" scroll-x>
|
||||
<view class="skill-sequence-skill-wrapper tab_iem" :class="videoIndex===item.value?'checked_tab':''" v-for="(item,index) of testList"
|
||||
:key="index" @tap="checkTest(item.value)">{{item.label}}</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</u-scroll-list>
|
||||
<view class="flex ai-c jc-sb mt10 wp100">
|
||||
<view class="flex ai-c jc-sb mt10 wp100 p14">
|
||||
<text class="fs18 fw600 cor-000">C1捷达-基础操作视频讲解</text>
|
||||
<view class="flex" @tap="popupShow=true" v-if="videoType!='test'">
|
||||
<text class="fs14 cor-666">更多</text>
|
||||
@@ -18,20 +20,23 @@
|
||||
<view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pl14 bc-fff">
|
||||
<u-scroll-list :indicator="false" class="mr15">
|
||||
<view v-for="(item, index) in videoList" :key="index" class="mr15" @click="checkVideo(item.id)">
|
||||
<view>
|
||||
<view class="mb10 relative">
|
||||
<image class="contain-box" src="../../static/image/index/index_bg.png"></image>
|
||||
<view v-if="nowVideo===item.id" class="playLogo">播放中</view>
|
||||
<image class="play_btn" src="../../static/image/index/play.png" />
|
||||
<text style="position: absolute;right: 8rpx;bottom: 8rpx;color:#fff">13:14</text>
|
||||
</view>
|
||||
<text :style="{color:nowVideo===item.id?'#FF6E02':'#333'}">正确的驾驶姿势</text>
|
||||
<view class="bc-fff pl14">
|
||||
<view class="skill-sequence-panel-content-wrapper">
|
||||
<scroll-view class="skill-sequence-panel-content" scroll-x :scroll-left="164*currentIndex">
|
||||
<view class="skill-sequence-skill-wrapper" v-for="(item, index) in videoList" :key="index"
|
||||
@click="checkVideo(item.projectId)">
|
||||
<view>
|
||||
<view class="mb10 relative">
|
||||
<image class="contain-box" src="../../static/image/index/jpsp.png"></image>
|
||||
<view v-if="projectId==item.projectId" class="playLogo">播放中</view>
|
||||
<image class="play_btn" src="../../static/image/index/play.png" />
|
||||
<text style="position: absolute;right: 8rpx;bottom: 8rpx;color:#fff">13:14</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-scroll-list>
|
||||
<text :style="{color:projectId==item.projectId?'#FF6E02':'#333'}">{{item.description}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<u-popup :show="popupShow" mode="bottom" :closeOnClickOverlay="true" @close="popupShow=false">
|
||||
<view class="p14 flex ai-c jc-sb">
|
||||
@@ -39,14 +44,15 @@
|
||||
<text class="fs16 cor-666" @tap="popupShow=false">收起</text>
|
||||
</view>
|
||||
<view style="max-height: 800rpx;overflow-y: scroll;" class="p14lr">
|
||||
<view class="flex bc-fff mt10" style="border-radius: 16rpx;" v-for="(item,index) of videoList" :key="index" @tap="toDetail">
|
||||
<view class="flex bc-fff mt10" style="border-radius: 16rpx;" v-for="(item,index) of videoList" :key="index"
|
||||
@tap="toDetail">
|
||||
<view class="pic relative">
|
||||
<image class="pic" src="../../static/image/index/index_bg.png"></image>
|
||||
<image class="pic" src="../../static/image/index/jpsp.png"></image>
|
||||
<image class="play_btn_2" src="../../static/image/index/play.png" />
|
||||
<text style="position: absolute;right: 8rpx;bottom: 8rpx;color:#fff">13:14</text>
|
||||
</view>
|
||||
<view class="ml10">
|
||||
<text class="fs16 cor-000 fw600">上车、下车的方法</text>
|
||||
<text class="fs16 cor-000 fw600">{{item.description}}</text>
|
||||
<view class="fs14 mt5 cor-666">上车、下车的方法</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -56,73 +62,103 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
videoIndex:0,
|
||||
testList:[{
|
||||
label:"八一考场",
|
||||
value:0,
|
||||
},{
|
||||
label:"富凯考场",
|
||||
value:1
|
||||
},{
|
||||
label:"新亚考场",
|
||||
value:2
|
||||
},{
|
||||
label:"庐江考场",
|
||||
value:3
|
||||
},{
|
||||
label:"富凯考场",
|
||||
value:4
|
||||
},{
|
||||
label:"新亚考场",
|
||||
value:5
|
||||
},{
|
||||
label:"庐江考场",
|
||||
value:6
|
||||
}],
|
||||
videoType:'',
|
||||
popupShow:false,
|
||||
nowVideo:0,
|
||||
videoList:[{
|
||||
title:'正确的驾驶姿势',
|
||||
time:'13:14',
|
||||
id:0
|
||||
},{
|
||||
title:'正确的驾驶姿势',
|
||||
time:'13:14',
|
||||
id:1
|
||||
},{
|
||||
title:'正确的驾驶姿势',
|
||||
time:'13:14',
|
||||
id:2
|
||||
},{
|
||||
title:'正确的驾驶姿势',
|
||||
time:'13:14',
|
||||
id:3
|
||||
},{
|
||||
title:'正确的驾驶姿势',
|
||||
time:'13:14',
|
||||
id:4
|
||||
},{
|
||||
title:'正确的驾驶姿势',
|
||||
time:'13:14',
|
||||
id:5
|
||||
}]
|
||||
import {
|
||||
queryProjectList
|
||||
} from '@/jtools/api/question';
|
||||
import storage from '@/jtools/storage';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
currentIndex:0,
|
||||
videoIndex: 0,
|
||||
testList: [{
|
||||
label: "八一考场",
|
||||
value: 0,
|
||||
}, {
|
||||
label: "富凯考场",
|
||||
value: 1
|
||||
}, {
|
||||
label: "新亚考场",
|
||||
value: 2
|
||||
}, {
|
||||
label: "庐江考场",
|
||||
value: 3
|
||||
}, {
|
||||
label: "富凯考场",
|
||||
value: 4
|
||||
}, {
|
||||
label: "新亚考场",
|
||||
value: 5
|
||||
}, {
|
||||
label: "庐江考场",
|
||||
value: 6
|
||||
}],
|
||||
videoType: '',
|
||||
popupShow: false,
|
||||
videoList: [{
|
||||
title: '正确的驾驶姿势',
|
||||
time: '13:14',
|
||||
id: 0
|
||||
}, {
|
||||
title: '正确的驾驶姿势',
|
||||
time: '13:14',
|
||||
id: 1
|
||||
}, {
|
||||
title: '正确的驾驶姿势',
|
||||
time: '13:14',
|
||||
id: 2
|
||||
}, {
|
||||
title: '正确的驾驶姿势',
|
||||
time: '13:14',
|
||||
id: 3
|
||||
}, {
|
||||
title: '正确的驾驶姿势',
|
||||
time: '13:14',
|
||||
id: 4
|
||||
}, {
|
||||
title: '正确的驾驶姿势',
|
||||
time: '13:14',
|
||||
id: 5
|
||||
}],
|
||||
projectId:undefined,
|
||||
param:{}
|
||||
}
|
||||
},
|
||||
onLoad(op){
|
||||
onLoad(op) {
|
||||
if (op.type) {
|
||||
this.videoType = op.type
|
||||
}
|
||||
if(op.projectId){
|
||||
this.projectId=op.projectId
|
||||
}
|
||||
if(op.driveType){
|
||||
this.param.driveType=op.driveType
|
||||
}
|
||||
if(op.subject){
|
||||
this.param.subject=op.subject
|
||||
}
|
||||
if(op.type){
|
||||
this.videoType=op.type
|
||||
this.param.type=op.type
|
||||
}
|
||||
this.getVieoList()
|
||||
},
|
||||
methods:{
|
||||
checkTest(val){
|
||||
this.videoIndex=val
|
||||
methods: {
|
||||
getVieoList(){
|
||||
queryProjectList({
|
||||
"carTypeId": storage.get('carType') || '1001',
|
||||
"driveType": this.param.driveType,
|
||||
"subject": this.param.subject,
|
||||
"type": this.param.type
|
||||
}).then(resp=>{
|
||||
this.videoList=resp.data
|
||||
this.currentIndex=this.videoList.findIndex(item=>item.projectId==this.projectId)
|
||||
})
|
||||
},
|
||||
checkVideo(val){
|
||||
this.nowVideo=val
|
||||
checkTest(val) {
|
||||
this.videoIndex = val
|
||||
},
|
||||
checkVideo(val) {
|
||||
this.projectId = val
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,7 +171,8 @@
|
||||
background: #00B74F;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.playLogo{
|
||||
|
||||
.playLogo {
|
||||
width: 90rpx;
|
||||
height: 40rpx;
|
||||
background: #FF6E02;
|
||||
@@ -146,39 +183,58 @@
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top:0
|
||||
top: 0
|
||||
}
|
||||
.play_btn{
|
||||
|
||||
.play_btn {
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
position: absolute;
|
||||
left: 97.5rpx;
|
||||
top:39.5rpx
|
||||
top: 39.5rpx
|
||||
}
|
||||
.play_btn_2{
|
||||
|
||||
.play_btn_2 {
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
position: absolute;
|
||||
left: 117.5rpx;
|
||||
top:52rpx
|
||||
top: 52rpx
|
||||
}
|
||||
.pic{
|
||||
|
||||
.pic {
|
||||
width: 300rpx;
|
||||
height: 169rpx;
|
||||
background: #00B74F;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
.tab_iem{
|
||||
|
||||
.tab_iem {
|
||||
width: 145rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
text-align: center;
|
||||
background: #F5F5F5;
|
||||
border-radius: 10rpx;
|
||||
color:#333
|
||||
}
|
||||
.checked_tab{
|
||||
color: #333
|
||||
}
|
||||
|
||||
.checked_tab {
|
||||
background: linear-gradient(90deg, #11DF20 0%, #01B74F 100%);
|
||||
color:#fff
|
||||
color: #fff
|
||||
}
|
||||
/*scroll-view外层*/
|
||||
.skill-sequence-panel-content-wrapper{
|
||||
position: relative;
|
||||
white-space:nowrap;
|
||||
}
|
||||
/*scroll-view本身*/
|
||||
.skill-sequence-panel-content{
|
||||
min-width:100%;
|
||||
}
|
||||
/*scroll-view内层*/
|
||||
.skill-sequence-skill-wrapper{
|
||||
display: inline-block;
|
||||
margin-right: 15px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,77 +1,84 @@
|
||||
<template>
|
||||
<view>
|
||||
<u-sticky bgColor="#fff">
|
||||
<u-tabs :list="categoryList" :scrollable="false" @click="tabChange"></u-tabs>
|
||||
<u-tabs :list="categoryList" :scrollable="false" @click="tabChange"></u-tabs>
|
||||
</u-sticky>
|
||||
<view class="p14">
|
||||
<view class="top_box">
|
||||
<view class="tip_box flex ai-c jc-sb" v-if="tIndex==0">
|
||||
<view class="flex ai-c">
|
||||
<u-icon name="error-circle-fill" color="#FF6E02" size="18"></u-icon>
|
||||
<text class="ml10 fs12" style="color: #FF6E02;">{{title}}</text>
|
||||
</view>
|
||||
<u-icon name="close" color="#FF6E02" size="18"></u-icon>
|
||||
<view class="tip_box flex ai-c jc-sb" v-if="tIndex==0">
|
||||
<view class="flex ai-c">
|
||||
<u-icon name="error-circle-fill" color="#FF6E02" size="18"></u-icon>
|
||||
<text class="ml10 fs12" style="color: #FF6E02;">{{title}}</text>
|
||||
</view>
|
||||
<view class="p14">
|
||||
<text class="fs18 cor-000 fw600">{{tIndex==0?'错题':'收藏'}}情况</text>
|
||||
<view class="total_box mt10">
|
||||
<view class="flex ai-c jc-sb">
|
||||
<view class="text-center">
|
||||
<view style="width: 111rpx;" class="fs30 cor-000">{{tIndex==0?wrongList.length:collectList.length}}</view>
|
||||
</view>
|
||||
<view style="text-align: right;flex-direction: column;justify-content: right" class="flex ai-c" @tap="toPractice">
|
||||
<u-icon name="arrow-right" size="18"></u-icon>
|
||||
<u-icon name="close" color="#FF6E02" size="18"></u-icon>
|
||||
</view>
|
||||
<view class="p14">
|
||||
<text class="fs18 cor-000 fw600">{{tIndex==0?'错题':'收藏'}}情况</text>
|
||||
<view class="total_box mt10">
|
||||
<view class="flex ai-c jc-sb">
|
||||
<view class="text-center">
|
||||
<view style="width: 111rpx;" class="fs30 cor-000">{{tIndex==0?wrongList.length:collectList.length}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex ai-c jc-sb mt5">
|
||||
<view class="text-center">
|
||||
<text class="fs14 cor-666">全部{{tIndex==0?'错题':'收藏'}}</text>
|
||||
</view>
|
||||
<view style="text-align: right;flex-direction: column;justify-content: right" class="flex ai-c">
|
||||
<text v-if="tIndex==0" class="fs14 cor-666">错{{wrongList.length}}/已做{{wrongList.length+rightList.length}}</text>
|
||||
</view>
|
||||
<view style="text-align: right;flex-direction: column;justify-content: right" class="flex ai-c"
|
||||
@tap="toPractice">
|
||||
<u-icon name="arrow-right" size="18"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="yellow_box" v-if="tIndex==0&&getPercent>10">
|
||||
<view class="flex jc-sb ai-c">
|
||||
<view>
|
||||
<text class="fs24 fw600" style="color: #FF6E02;">{{getPercent}}%</text><text class="fs18 cor-000 fw600">错题率</text>
|
||||
<view class="fs14 cor-000">错题率有点高,快去提升吧</view>
|
||||
</view>
|
||||
<!-- <view style="width: 156rpx;">
|
||||
<view class="flex ai-c jc-sb mt5">
|
||||
<view class="text-center">
|
||||
<text class="fs14 cor-666">全部{{tIndex==0?'错题':'收藏'}}</text>
|
||||
</view>
|
||||
<view style="text-align: right;flex-direction: column;justify-content: right" class="flex ai-c">
|
||||
<text v-if="tIndex==0"
|
||||
class="fs14 cor-666">错{{wrongList.length}}/已做{{wrongList.length+rightList.length}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="yellow_box" v-if="tIndex==0&&getPercent>10">
|
||||
<view class="flex jc-sb ai-c">
|
||||
<view>
|
||||
<text class="fs24 fw600" style="color: #FF6E02;">{{getPercent}}%</text><text
|
||||
class="fs18 cor-000 fw600">错题率</text>
|
||||
<view class="fs14 cor-000">错题率有点高,快去提升吧</view>
|
||||
</view>
|
||||
<!-- <view style="width: 156rpx;">
|
||||
<button class="riseBtn">马上提升</button>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex jc-sb ai-c mt10" v-if="tIndex==0">
|
||||
<text>答对后自动移除错题</text>
|
||||
<u-switch v-model="isMoveWrong" activeColor="#0BD032"></u-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view style="margin-top: 30rpx;" v-if="tIndex==0">
|
||||
<view class="video-box">
|
||||
<view class="flex jc-sb ai-c wp100">
|
||||
<text style="color: #05C341;font-size: 36rpx;">科{{subject==1?'一':'四'}}精品视频课</text>
|
||||
<text class="cor-666 fs12">全部10节课 ></text>
|
||||
</view>
|
||||
<view class="flex ai-c mt20">
|
||||
<view class="contain-box relative">
|
||||
<image class="contain-box" src="../../../static/image/index/jpsp.png"></image>
|
||||
<image class="play_btn_2" src="../../static/image/index/play.png" />
|
||||
</view>
|
||||
<view class="ml15 text-center">
|
||||
<u-button :customStyle="{width:'200rpx',height:'66rpx',borderRadius: '33rpx'}" iconColor="#fff"
|
||||
text="去看视频" color="linear-gradient(90deg, #11DF20 0%, #00B74F 100%)" icon="play-circle">
|
||||
</u-button>
|
||||
<view class="cor-333 fs15 fw600 mt10">科{{subject==1?'一':'四'}}易错试题</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex jc-sb ai-c mt10" v-if="tIndex==0">
|
||||
<text>答对后自动移除错题</text>
|
||||
<u-switch v-model="isMoveWrong" activeColor="#0BD032" ></u-switch>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view style="margin-top: 30rpx;" v-if="tIndex==0">
|
||||
<view class="video-box">
|
||||
<view class="flex jc-sb ai-c wp100">
|
||||
<text style="color: #05C341;font-size: 36rpx;">科{{subject==1?'一':'四'}}精品视频课</text>
|
||||
<text class="cor-666 fs12">全部10节课 ></text>
|
||||
</view>
|
||||
<view class="flex ai-c mt20">
|
||||
<image class="contain-box" src="../../static/image/index/index_bg.png"></image>
|
||||
<view class="ml15 text-center">
|
||||
<u-button :customStyle="{width:'200rpx',height:'66rpx',borderRadius: '33rpx'}" iconColor="#fff"
|
||||
text="去看视频" color="linear-gradient(90deg, #11DF20 0%, #00B74F 100%)" icon="play-circle">
|
||||
</u-button>
|
||||
<view class="cor-333 fs15 fw600 mt10">科{{subject==1?'一':'四'}}易错试题</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="top_box mt15 p14">
|
||||
<view class="top_box mt15 p14">
|
||||
<view class="flex jc-sb aic">
|
||||
<text class="fs18 cor-000 fw600">{{tIndex==0?'错题':'收藏题'}}分类</text>
|
||||
<u-icon name="arrow-right" size="18"></u-icon>
|
||||
<!-- <u-icon name="arrow-right" size="18"></u-icon> -->
|
||||
</view>
|
||||
<view class="flex ai-c jc-sb" style="flex-wrap: wrap;">
|
||||
<view v-for="(item,index) of typeList" :key="index" class="category_item p14 flex jc-sb ai-c mb10">
|
||||
@@ -80,7 +87,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -89,56 +96,85 @@
|
||||
import {
|
||||
questionCategory
|
||||
} from '@/jtools/api/question';
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
collectList:[],
|
||||
rightList:storage.get(`rightList_subject${this.subject}`) || [],
|
||||
wrongList:storage.get(`wrongList_subject${this.subject}`) || [],
|
||||
subject:0,
|
||||
tIndex:0,
|
||||
isMoveWrong:true,
|
||||
title:'重要提示:所有错题做对,再去考试!',
|
||||
categoryList:[{
|
||||
name:'错题本'
|
||||
},{name:'收藏夹'}],
|
||||
typeList:[]
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
collectList: [],
|
||||
rightList: storage.get(`rightList_subject${this.subject}`) || [],
|
||||
wrongList: storage.get(`wrongList_subject${this.subject}`) || [],
|
||||
subject: 0,
|
||||
tIndex: 0,
|
||||
isMoveWrong: true,
|
||||
title: '重要提示:所有错题做对,再去考试!',
|
||||
categoryList: [{
|
||||
name: '错题本'
|
||||
}, {
|
||||
name: '收藏夹'
|
||||
}],
|
||||
typeList: []
|
||||
}
|
||||
},
|
||||
onLoad(op){
|
||||
if(op.subject){
|
||||
this.subject=op.subject
|
||||
this.rightList=storage.get(`rightList_subject${this.subject}`) || []
|
||||
this.wrongList=storage.get(`wrongList_subject${this.subject}`) || []
|
||||
this.collectList=storage.get(`collectList_subject${this.subject}`) || []
|
||||
onLoad(op) {
|
||||
if (op.subject) {
|
||||
this.subject = op.subject
|
||||
this.rightList = storage.get(`rightList_subject${this.subject}`) || []
|
||||
this.wrongList = storage.get(`wrongList_subject${this.subject}`) || []
|
||||
this.collectList = storage.get(`collectList_subject${this.subject}`) || []
|
||||
this.getQuestionCategory()
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
getPercent(){
|
||||
return ((this.wrongList.length/(this.wrongList.length+this.rightList.length))*100).toFixed(0)
|
||||
computed: {
|
||||
getPercent() {
|
||||
return ((this.wrongList.length / (this.wrongList.length + this.rightList.length)) * 100).toFixed(0)
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
getQuestionCategory(){
|
||||
const param={}
|
||||
if(this.tIndex==0){
|
||||
param.questionIdList=this.wrongList
|
||||
}else{
|
||||
param.questionIdList=this.collectList
|
||||
methods: {
|
||||
getQuestionCategory() {
|
||||
const param = {}
|
||||
if (this.tIndex == 0) {
|
||||
param.questionIdList = this.wrongList
|
||||
} else {
|
||||
param.questionIdList = this.collectList
|
||||
}
|
||||
questionCategory(param).then(resp=>{
|
||||
this.typeList=resp.data
|
||||
questionCategory(param).then(resp => {
|
||||
this.typeList = resp.data
|
||||
})
|
||||
},
|
||||
tabChange(val){
|
||||
this.tIndex=val.index
|
||||
tabChange(val) {
|
||||
this.tIndex = val.index
|
||||
this.getQuestionCategory()
|
||||
},
|
||||
toPractice(){
|
||||
const navTitle=this.tIndex==0?'错题本':'收藏夹'
|
||||
toPractice() {
|
||||
const navTitle = this.tIndex == 0 ? '错题本' : '收藏夹'
|
||||
if (navTitle == '错题本') {
|
||||
if (!this.wrongList.length) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '当前无错题,继续保持吧~',
|
||||
showCancel:false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
}
|
||||
}
|
||||
});
|
||||
return
|
||||
}
|
||||
} else if (navTitle == '收藏夹') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '当前无收藏题~',
|
||||
showCancel:false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定');
|
||||
}
|
||||
}
|
||||
});
|
||||
return
|
||||
}
|
||||
uni.navigateTo({
|
||||
url:"/pages/questionBank/questionBank?navTitle="+navTitle+"&subject="+this.subject
|
||||
url: "/pages/questionBank/questionBank?navTitle=" + navTitle + "&subject=" + this.subject
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -147,65 +183,80 @@
|
||||
|
||||
<style scoped>
|
||||
::v-deep .u-tabs__wrapper__nav__line {
|
||||
background: linear-gradient(90deg, #11DF20 0%, #00B74F 100%) !important;
|
||||
bottom: 14rpx !important;
|
||||
}
|
||||
.top_box{
|
||||
width: 100%;
|
||||
background: #FDFDFD;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.tip_box{
|
||||
width: 100%;
|
||||
background: #FFE6D4;
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
padding: 10px 14px;
|
||||
}
|
||||
.total_box{
|
||||
width: 100%;
|
||||
background: #F5F5F5;
|
||||
border-radius: 20rpx;
|
||||
padding: 14px;
|
||||
}
|
||||
.yellow_box{
|
||||
margin-top: 10px;
|
||||
padding: 14px;
|
||||
width: 100%;
|
||||
background: linear-gradient(90deg, #FBF2D4 0%, #F7E4B5 100%);
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.riseBtn{
|
||||
width: 156rpx;
|
||||
height: 56rpx;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
font-size: 12px;
|
||||
background-color: #F7E4B5;
|
||||
border: 1px solid #FF6E02;
|
||||
color: #FF6E02;
|
||||
border-radius: 28rpx;
|
||||
}
|
||||
.video-box {
|
||||
padding: 20rpx;
|
||||
width: 694rpx;
|
||||
height: 369rpx;
|
||||
background: #DEEFE5;
|
||||
border: 2px solid #47DB87;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.contain-box {
|
||||
width: 406rpx;
|
||||
height: 228rpx;
|
||||
background: #00B74F;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
.category_item{
|
||||
width: 312rpx;
|
||||
height: 90rpx;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
background: linear-gradient(90deg, #11DF20 0%, #00B74F 100%) !important;
|
||||
bottom: 14rpx !important;
|
||||
}
|
||||
|
||||
.top_box {
|
||||
width: 100%;
|
||||
background: #FDFDFD;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.tip_box {
|
||||
width: 100%;
|
||||
background: #FFE6D4;
|
||||
border-radius: 20rpx 20rpx 0rpx 0rpx;
|
||||
padding: 10px 14px;
|
||||
}
|
||||
|
||||
.total_box {
|
||||
width: 100%;
|
||||
background: #F5F5F5;
|
||||
border-radius: 20rpx;
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
.yellow_box {
|
||||
margin-top: 10px;
|
||||
padding: 14px;
|
||||
width: 100%;
|
||||
background: linear-gradient(90deg, #FBF2D4 0%, #F7E4B5 100%);
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.riseBtn {
|
||||
width: 156rpx;
|
||||
height: 56rpx;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
font-size: 12px;
|
||||
background-color: #F7E4B5;
|
||||
border: 1px solid #FF6E02;
|
||||
color: #FF6E02;
|
||||
border-radius: 28rpx;
|
||||
}
|
||||
|
||||
.video-box {
|
||||
padding: 20rpx;
|
||||
width: 694rpx;
|
||||
height: 369rpx;
|
||||
background: #DEEFE5;
|
||||
border: 2px solid #47DB87;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.contain-box {
|
||||
width: 406rpx;
|
||||
height: 228rpx;
|
||||
background: #00B74F;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.category_item {
|
||||
width: 312rpx;
|
||||
height: 90rpx;
|
||||
text-align: center;
|
||||
line-height: 90rpx;
|
||||
background: #F5F5F5;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
.play_btn_2 {
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
position: absolute;
|
||||
left: 165.5rpx;
|
||||
top: 78rpx
|
||||
}
|
||||
</style>
|
||||
BIN
src/static/image/index/jpsp.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
src/static/image/index/paysucess.jpg
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
src/static/image/index/subject3_bg.png
Normal file
|
After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 5.9 KiB |