Compare commits
5 Commits
c0df8a314e
...
1596959583
| Author | SHA1 | Date | |
|---|---|---|---|
| 1596959583 | |||
| 36f8a9b2cc | |||
| fa9d6a8696 | |||
|
|
78cf2fd9f7 | ||
| a7c7b410d3 |
165
src/jtools/pay/index.js
Normal file
165
src/jtools/pay/index.js
Normal file
@@ -0,0 +1,165 @@
|
|||||||
|
import request from '../request/index.js';
|
||||||
|
// #ifdef H5
|
||||||
|
import wxsdk from '@/jtools/wechat/sdk'
|
||||||
|
// #endif
|
||||||
|
import wechat from '@/jtools/wechat/wechat'
|
||||||
|
import $platform from '@/jtools/platform';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付
|
||||||
|
*
|
||||||
|
* @param {String} payment = ['wechat','alipay','wallet'] - 支付方式
|
||||||
|
* @param {Object} order = {} - 订单详情
|
||||||
|
* @param {String} orderType = ['goods','recharge'] - 订单类型
|
||||||
|
*/
|
||||||
|
|
||||||
|
export default class JtoolsPay {
|
||||||
|
|
||||||
|
|
||||||
|
// 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();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
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') {
|
||||||
|
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 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 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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 支付结果跳转,success:成功,fail:失败
|
||||||
|
payResult(resultType, orderPayNo) {
|
||||||
|
const that = this;
|
||||||
|
let path = ''
|
||||||
|
uni.navigateTo({
|
||||||
|
url:path
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
<view class="flex fld-c p15">
|
<view class="flex fld-c p15">
|
||||||
<u-sticky>
|
<u-sticky>
|
||||||
<view class="flex ai-c">
|
<view class="flex ai-c">
|
||||||
<view v-for="(item,index) in vipAllList" :key="index" class="km-item" :class="{ actived: index==current }"
|
<view v-for="(item, index) in vipAllList" :key="index" class="km-item" :class="{ actived: index == current }"
|
||||||
@click="current=index">
|
@click="current = index">
|
||||||
{{ getKmTitle(item.subjects) }}
|
{{ getKmTitle(item.subjects) }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -11,17 +11,17 @@
|
|||||||
<view class="mt15">
|
<view class="mt15">
|
||||||
<swiper class="swiper" :current="current" style="height: 120px;" :autoplay="false" :display-multiple-items="1.45"
|
<swiper class="swiper" :current="current" style="height: 120px;" :autoplay="false" :display-multiple-items="1.45"
|
||||||
:disable-programmatic-animation="true" @change="onChange">
|
:disable-programmatic-animation="true" @change="onChange">
|
||||||
<swiper-item v-for="(item,index) in vipAllList" :key="index">
|
<swiper-item v-for="(item, index) in vipAllList" :key="index">
|
||||||
<view class="relative">
|
<view class="relative">
|
||||||
<image src="../../static/image/mine/vip_card.png" mode="widthFix" style="width:95%;"></image>
|
<image src="../../static/image/mine/vip_card.png" mode="widthFix" style="width:95%;"></image>
|
||||||
<view class="vip-info">
|
<view class="vip-info">
|
||||||
<u-avatar class="br-p50 overflow-h" style="border: 3px solid #873E1D;" :size="35" mp-avatar></u-avatar>
|
<u-avatar class="br-p50 overflow-h" style="border: 3px solid #873E1D;" :size="35" mp-avatar></u-avatar>
|
||||||
<view class="ml10">
|
<view class="ml10">
|
||||||
<view class="fs16 fwb" style="color: #7E4012;line-height: 16px;">
|
<view class="fs16 fwb" style="color: #7E4012;line-height: 16px;">
|
||||||
{{item.memberName}}
|
{{ item.memberName }}
|
||||||
</view>
|
</view>
|
||||||
<view class="mt5 fs12" style="color: #7E4012;line-height: 12px;">
|
<view class="mt5 fs12" style="color: #7E4012;line-height: 12px;">
|
||||||
{{getExpireText(item)}}
|
{{ getExpireText(item) }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
VIP已开通
|
VIP已开通
|
||||||
</view>
|
</view>
|
||||||
<view v-if="vipHasOpened(item)" class="renew">
|
<view v-if="vipHasOpened(item)" class="renew">
|
||||||
{{item.price}}元立即续费
|
{{ item.price }}元立即续费
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="buy">
|
<view v-else class="buy">
|
||||||
立即充值
|
立即充值
|
||||||
@@ -43,10 +43,10 @@
|
|||||||
<view class="mt20">
|
<view class="mt20">
|
||||||
<swiper class="swiper" :current="current" style="height: 300px;" :autoplay="false"
|
<swiper class="swiper" :current="current" style="height: 300px;" :autoplay="false"
|
||||||
:disable-programmatic-animation="true" @change="onChange">
|
:disable-programmatic-animation="true" @change="onChange">
|
||||||
<swiper-item v-for="(item,index) in vipAllList" :key="index">
|
<swiper-item v-for="(item, index) in vipAllList" :key="index">
|
||||||
<view v-if="index == 0 || index == 3" class="p15 br8 cor-fff">
|
<view v-if="index == 0 || index == 3" class="p15 br8 cor-fff">
|
||||||
<view class="fs18 cor-000 fwb">
|
<view class="fs18 cor-000 fwb">
|
||||||
3步轻松学{{getKmTitle(item.subjects)}}
|
3步轻松学{{ getKmTitle(item.subjects) }}
|
||||||
</view>
|
</view>
|
||||||
<view class="mt25 flex ai-c jc-sb">
|
<view class="mt25 flex ai-c jc-sb">
|
||||||
<view class="flex ai-c">
|
<view class="flex ai-c">
|
||||||
@@ -106,7 +106,7 @@
|
|||||||
<view class="flex ai-c mt20">
|
<view class="flex ai-c mt20">
|
||||||
<image src="../../static/image/index/index_bg.png" mode="widthFix" style="flex: 1;border-radius: 33rpx;"></image>
|
<image src="../../static/image/index/index_bg.png" mode="widthFix" style="flex: 1;border-radius: 33rpx;"></image>
|
||||||
<view class="ml18 text-center">
|
<view class="ml18 text-center">
|
||||||
<u-button :customStyle="{width:'200rpx',height:'66rpx',borderRadius: '33rpx'}" iconColor="#fff"
|
<u-button :customStyle="{ width: '200rpx', height: '66rpx', borderRadius: '33rpx' }" iconColor="#fff"
|
||||||
text="去看视频" color="linear-gradient(90deg, #E66501 0%, #F8A42C 100%)" icon="play-circle" @click="toPlaceLive(item)">
|
text="去看视频" color="linear-gradient(90deg, #E66501 0%, #F8A42C 100%)" icon="play-circle" @click="toPlaceLive(item)">
|
||||||
</u-button>
|
</u-button>
|
||||||
<view class="cor-333 fs15 mt17">真实考场模拟</view>
|
<view class="cor-333 fs15 mt17">真实考场模拟</view>
|
||||||
@@ -115,19 +115,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</swiper-item>
|
</swiper-item>
|
||||||
<swiper-item>
|
|
||||||
</swiper-item>
|
|
||||||
</swiper>
|
</swiper>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import useUserStore from '@/jtools/store/user'
|
import useUserStore from '@/jtools/store/user'
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
vipAllList() {
|
vipAllList() {
|
||||||
return useUserStore().vipAllList.filter(it=>[1,2,3,4].includes(Number(it.subjects)))
|
return useUserStore().vipAllList.filter(it => [1, 2, 3, 4].includes(Number(it.subjects)))
|
||||||
},
|
},
|
||||||
vipOnList() {
|
vipOnList() {
|
||||||
return useUserStore().vipOnList
|
return useUserStore().vipOnList
|
||||||
@@ -153,7 +151,7 @@
|
|||||||
},
|
},
|
||||||
getExpireText(item) {
|
getExpireText(item) {
|
||||||
const vipOn = this.vipOnList.find(it => it.memberId == item.memberId)
|
const vipOn = this.vipOnList.find(it => it.memberId == item.memberId)
|
||||||
if(vipOn) {
|
if (vipOn) {
|
||||||
return `${vipOn.endDate.split(' ')[0]}到期`
|
return `${vipOn.endDate.split(' ')[0]}到期`
|
||||||
} else {
|
} else {
|
||||||
return '开通vip助您快速拿证'
|
return '开通vip助您快速拿证'
|
||||||
@@ -165,7 +163,7 @@
|
|||||||
// 去精选500题 item=> 当前科目vip信息
|
// 去精选500题 item=> 当前科目vip信息
|
||||||
to500(item) {
|
to500(item) {
|
||||||
// 当前vip是否已开通
|
// 当前vip是否已开通
|
||||||
if(this.vipHasOpened(item)) {
|
if (this.vipHasOpened(item)) {
|
||||||
// 跳转
|
// 跳转
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -177,7 +175,7 @@
|
|||||||
// 去真实考场 item=> 当前科目vip信息
|
// 去真实考场 item=> 当前科目vip信息
|
||||||
toRealExam(item) {
|
toRealExam(item) {
|
||||||
// 当前vip是否已开通
|
// 当前vip是否已开通
|
||||||
if(this.vipHasOpened(item)) {
|
if (this.vipHasOpened(item)) {
|
||||||
// 跳转
|
// 跳转
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -189,7 +187,7 @@
|
|||||||
// 去秘卷 item=> 当前科目vip信息
|
// 去秘卷 item=> 当前科目vip信息
|
||||||
toSpecExam(item) {
|
toSpecExam(item) {
|
||||||
// 当前vip是否已开通
|
// 当前vip是否已开通
|
||||||
if(this.vipHasOpened(item)) {
|
if (this.vipHasOpened(item)) {
|
||||||
// 跳转
|
// 跳转
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -201,7 +199,7 @@
|
|||||||
// 去考场实况 item=> 当前科目vip信息
|
// 去考场实况 item=> 当前科目vip信息
|
||||||
toPlaceLive(item) {
|
toPlaceLive(item) {
|
||||||
// 当前vip是否已开通
|
// 当前vip是否已开通
|
||||||
if(this.vipHasOpened(item)) {
|
if (this.vipHasOpened(item)) {
|
||||||
// 跳转
|
// 跳转
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -211,11 +209,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.km-item {
|
.km-item {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
width: 72px;
|
width: 72px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
@@ -225,26 +223,26 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
border: 1px solid #CCCCCC;
|
border: 1px solid #CCCCCC;
|
||||||
}
|
}
|
||||||
|
|
||||||
.actived {
|
.actived {
|
||||||
background: linear-gradient(90deg, #E66501 0%, #F8A42C 100%);
|
background: linear-gradient(90deg, #E66501 0%, #F8A42C 100%);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.km-item:last-of-type {
|
.km-item:last-of-type {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vip-info {
|
.vip-info {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 15px;
|
top: 15px;
|
||||||
left: 10px;
|
left: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.corner {
|
.corner {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
@@ -258,9 +256,9 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.renew {
|
.renew {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 10%;
|
right: 10%;
|
||||||
bottom: 15px;
|
bottom: 15px;
|
||||||
@@ -273,8 +271,9 @@
|
|||||||
border-radius: 26rpx;
|
border-radius: 26rpx;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #F6E99F;
|
color: #F6E99F;
|
||||||
}
|
}
|
||||||
.buy {
|
|
||||||
|
.buy {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 45%;
|
left: 45%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
@@ -288,9 +287,9 @@
|
|||||||
border-radius: 30rpx;
|
border-radius: 30rpx;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #F6E99F;
|
color: #F6E99F;
|
||||||
}
|
}
|
||||||
|
|
||||||
.study {
|
.study {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -300,13 +299,14 @@
|
|||||||
border-radius: 34rpx;
|
border-radius: 34rpx;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #873E1D;
|
color: #873E1D;
|
||||||
}
|
}
|
||||||
.video-box {
|
|
||||||
|
.video-box {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
width: 694rpx;
|
width: 694rpx;
|
||||||
height: 369rpx;
|
height: 369rpx;
|
||||||
background: #F9F3E7;
|
background: #F9F3E7;
|
||||||
border: 2rpx solid #CF8B6D;
|
border: 2rpx solid #CF8B6D;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
</swiper>
|
</swiper>
|
||||||
<view class="wp100 flex jc-sb ai-c p14 bc-fff" v-if="isShowAll" style="position: fixed;bottom: 0;left: 0;">
|
<view class="wp100 flex jc-sb ai-c p14 bc-fff" v-if="isShowAll" style="position: fixed;bottom: 0;left: 0;">
|
||||||
<view style="width: 220rpx;">
|
<view style="width: 220rpx;">
|
||||||
<button v-if="type==='practice'" class="btn">四步学科一</button>
|
<view v-if="type==='practice'" style="width: 220rpx;height: 80rpx;"></view>
|
||||||
<view v-else class="btn" style="text-align: center;" @tap="submitPaper">
|
<view v-else class="btn" style="text-align: center;" @tap="submitPaper">
|
||||||
<u-count-down ref="countDown_1" :time=" 1*60*60 * 1000" format="HH:mm:ss" @change="timeChange"></u-count-down>
|
<u-count-down ref="countDown_1" :time=" 1*60*60 * 1000" format="HH:mm:ss" @change="timeChange"></u-count-down>
|
||||||
<text>交卷</text>
|
<text>交卷</text>
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<view class="wp100 flex jc-sb p14 bc-fff">
|
<view class="wp100 flex jc-sb p14 bc-fff">
|
||||||
<view style="width: 220rpx;">
|
<view style="width: 220rpx;">
|
||||||
<button v-if="type==='practice'" class="btn">四步学科一</button>
|
<view v-if="type==='practice'" style="width: 220rpx;height: 80rpx;"></view>
|
||||||
<view v-else class="btn" style="text-align: center;" @tap="submitPaper">
|
<view v-else class="btn" style="text-align: center;" @tap="submitPaper">
|
||||||
<u-count-down ref="countDown_2" :time="1 * 60 * 60 * 1000" format="HH:mm:ss"></u-count-down>
|
<u-count-down ref="countDown_2" :time="1 * 60 * 60 * 1000" format="HH:mm:ss"></u-count-down>
|
||||||
<text>交卷</text>
|
<text>交卷</text>
|
||||||
@@ -508,8 +508,9 @@ export default {
|
|||||||
},
|
},
|
||||||
sectionChange(index) {
|
sectionChange(index) {
|
||||||
this.tCurrent = index
|
this.tCurrent = index
|
||||||
this.getQuestionList()
|
// this.getQuestionList()
|
||||||
this.renderSwiper(0)
|
// this.renderSwiper(0)
|
||||||
|
this.$emit('changeTab',index)
|
||||||
},
|
},
|
||||||
getQuestionList(val) {
|
getQuestionList(val) {
|
||||||
const arr = JSON.parse(val)
|
const arr = JSON.parse(val)
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="mt14 p14 bc-fff" style="border-radius: 20rpx;">
|
<view class="mt14 p14 bc-fff" style="border-radius: 20rpx;">
|
||||||
<text class="fs18 cor-000 fw600">常见考点</text>
|
<text class="fs18 cor-000 fw600">常见考点</text>
|
||||||
<view class="flex ai-c wp100 mt10" style="flex-wrap: wrap;">
|
<view class="flex ai-c wp100 mt15" style="flex-wrap: wrap;">
|
||||||
<view class="wp50 flex ai-c mb10" v-for="(item,index) of testCenterList" :key="index">
|
<view class="wp50 flex ai-c mb15" v-for="(item,index) of testCenterList" :key="index">
|
||||||
<view class="dot_item">{{index+1}}</view>
|
<view class="dot_item">{{index+1}}</view>
|
||||||
<text class="ml5">{{item.label}}</text>
|
<text class="ml5">{{item.label}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<!-- <u-navbar :title="navTitle" @rightClick="rightClick" :autoBack="true">
|
<!-- <u-navbar :title="navTitle" @rightClick="rightClick" :autoBack="true">
|
||||||
</u-navbar> -->
|
</u-navbar> -->
|
||||||
<j-navbar>{{navTitle}}</j-navbar>
|
<j-navbar>{{navTitle}}</j-navbar>
|
||||||
<Question ref="question" :tabsList="tabsList" :isShowAll="isShowAll" :subject="subject" :navTitle="navTitle"></Question>
|
<Question ref="question" :tabsList="tabsList" :isShowAll="isShowAll" :subject="subject" :navTitle="navTitle" @changeTab="changeTab"></Question>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -93,6 +93,20 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useUserStore,['searchUserVip']),
|
...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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.$refs.question.getQuestionList(JSON.stringify(list))
|
||||||
|
}else{
|
||||||
|
this.$refs.question.getQuestionList(JSON.stringify(this.questionArr))
|
||||||
|
}
|
||||||
|
},
|
||||||
rightClick() {
|
rightClick() {
|
||||||
console.log('返回');
|
console.log('返回');
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user