Browse Source

对接成绩单页面

master
unknown 6 days ago
parent
commit
b6975309f0
  1. 11
      config/api.js
  2. 2
      manifest.json
  3. 8
      pages.json
  4. 62
      pages/exercises/examSubjiect1/examResultsOne.vue
  5. 8
      pages/exercises/myStudy/comp/statistics.vue
  6. 107
      pages/exercises/myStudy/myStudy.vue
  7. 204
      pages/vip/paymentOrder/paymentOrder.vue
  8. 13
      pages/vip/vipEntry/comp/commentItem.vue
  9. 40
      pages/vip/vipEntry/vipEntry.vue
  10. BIN
      static/images/jiaofei_wxIphone@2x.png
  11. BIN
      static/images/jiaofei_zfbIphone@2x.png
  12. BIN
      static/images/jiaofei_zhifu_selectIphone@2x.png
  13. BIN
      static/images/jiaofei_zhifu_unselectIphone@2x.png

11
config/api.js

@ -55,7 +55,7 @@ export const logOut = (data={}) => http.post('member/auth/logout', data, {custom
// 模拟考试科目1或者4考试首页
export const questionExam = (data) => http.get(`questionExam/exam-${data.stepType}-${data.carType}`, )
// 模拟考试科目1或者4考试成绩单
export const examTranscript = (data) => http.get(`questionExam/examTranscript-${stepType}-${carType}`, )
export const examTranscript = (data) => http.get(`questionExam/examTranscript-${data.stepType}-${data.carType}`, )
// 开始考试
export const startExam = (data) => http.post('questionExam/startExam', data,)
// 交卷,模拟考试保存接口
@ -71,6 +71,15 @@ export const logOut = (data={}) => http.post('member/auth/logout', data, {custom
// 会员VIP之声
export const memberVoicePage = (data) => http.post(`vip/memberVoicePage`, data,)
// 购买会员创建预支付订单
export const createPrepaidApi = (data) => http.post(`vip/createPrepaid`, data,)
// 查询购买信息状态
export const outTradeNApi = (outTradeNo) => http.get(`getPrepaid-${outTradeNo}`, )
// 支付渠道的统一【支付】回调
export const channelIdApi = (channelId) => http.get(`vip/notify/${channelId}`, )
// 购买记录列表
export const memberGradePayPage = (data) => http.post(`vip/memberGradePayPage`,data )

2
manifest.json

@ -75,7 +75,7 @@
"disableHostCheck" : true,
"proxy" : {
"/api" : {
"target" : "http://192.168.1.202:8081/",
"target" : "http://192.168.1.201:8081/",
// "target" : "http://question.ywxcw.cn/",
"changeOrigin" : true,
"secure" : true,

8
pages.json

@ -29,6 +29,14 @@
}
},
{
"path": "paymentOrder/paymentOrder",
"style": {
"navigationBarTitleText": "vip",
"enablePullDownRefresh": true,
"navigationStyle": "custom"
}
},
{
"path": "vipQuestions/vipQuestions",
"style": {
"navigationBarTitleText": "VIP常见问题说明",

62
pages/exercises/examSubjiect1/examResultsOne.vue

@ -1,7 +1,7 @@
<template>
<view class="content">
<up-navbar leftText=" " :leftIconColor="'#fff'" :safeAreaInsetTop="true" :autoBack="true" title="我的学习"
:bgColor="'transparent'" :titleStyle="{color: '#fff'}">
<up-navbar leftText=" " :leftIconColor="'#fff'" :safeAreaInsetTop="true" :autoBack="true" title="成绩单"
:bgColor="'transparent'" :titleStyle="{color: '#fff'}" :fixed="false">
</up-navbar>
<view class="padding">
<view class="useInfo flex">
@ -9,30 +9,27 @@
<image src="" mode=""></image>
</view>
<view class="rightBox">
<view class="name">用户名</view>
<view class="name">{{ phone }}</view>
</view>
</view>
<view class="card">
<view class="flex-c">
<gaugeChart/>
</view>
<!-- <view class="bigNum">
<view class="num">80%</view>
<view class="bigNum">
<view class="num">{{ info.exampassRate || '--' }}%</view>
<view class="lab">预测通过率</view>
</view> -->
</view>
<view class="huiBg">
<view class="li">
<view class="num">10:22</view>
<view class="lab">测试时长</view>
<view class="num">{{ info.accumulate || '--' }}</view>
<view class="lab">累计考试次数</view>
</view>
<view class="li">
<view class="num">10</view>
<view class="lab">已做题</view>
<view class="num">{{ info.pass || '--' }}</view>
<view class="lab">合格次数</view>
</view>
<view class="li">
<view class="num">14</view>
<view class="lab">答错题</view>
<view class="num">{{ info.score || '--' }}</view>
<view class="lab">平均分数</view>
</view>
</view>
<view class="btnBox">
@ -40,7 +37,9 @@
</view>
</view>
<view class="card card2">
<statistics tit="模拟考试成绩" :chartData="chartData" :listData="listData" key="1" :subject="usecarStore.carInfo.stepType"></statistics>
<!-- <view class="card card2">
<view class="chartTab">
<view class="h3">模拟考试成绩</view>
<view class="btn_row">
@ -67,7 +66,7 @@
</view>
</view>
</view>
</view>
</view> -->
</view>
@ -79,6 +78,10 @@
import gaugeChart from '@/components/columnChart/gaugeChart.vue'
import { ref } from 'vue'
import nodata from '@/components/nodata/nodata.vue'
import { examTranscript } from '@/config/api.js'
import carStore from '@/store/modules/car.js'
import statistics from '../myStudy/comp/statistics.vue'
let usecarStore = carStore()
const value = ref(false)
const currentNav = ref(1)
@ -90,19 +93,40 @@
function changeChart(num) {
currentChart.value = num
}
let phone = uni.getStorageSync('loginInfo')?.phone
const info = ref({})
let chartData = ref({})
let listData = ref([])
async function examTranscriptFn() {
const {data: res} = await examTranscript({stepType: usecarStore.carInfo.stepType, carType: usecarStore.carInfo.carType})
info.value = res
console.log(res)
if(!res.examRecord?.length) return
listData.value = res.examRecord
chartData.value = {
categories: res.examRecord.map(item=>item.formatStartTime),
series: [
{
name: "目标值",
data: res.examRecord.map(item=>item.score)
}
]
}
}
examTranscriptFn()
</script>
<style lang="scss" scoped>
.content {
width: 100%;
min-height: 100vh;
padding: 100rpx 0rpx 30rpx 0rpx;
padding: 0rpx 0rpx 30rpx 0rpx;
background: url('../../../static/images/topbg.png') #F6F7FA no-repeat;
background-size: 100% 410rpx;
.useInfo {
padding: 30rpx 0;
padding: 10rpx 0 0 0 ;
.avatar {
width: 140rpx;

8
pages/exercises/myStudy/comp/statistics.vue

@ -7,7 +7,7 @@
<view class="btn" @click="changeChart(2)" :class="{bg: currentChart==2}">明细</view>
</view>
</view>
<view class="tip">近30次科目一模拟考试成绩</view>
<view class="tip">近30次科目{{ subject==1? '': '四'}}模拟考试成绩</view>
<view class="" v-if="listData.length">
<view class="con" v-if="currentChart==1">
<columnChart :chartData="chartData" :key="tit"></columnChart>
@ -54,9 +54,13 @@
type: Array,
default: []
},
subject: {
type: Number,
default: 1
},
url: {
type: String,
default: '/pages/exercises/beforeExam/beforeExam'
default: '/pages/exercises/examSubjiect1/examSubjiect1'
}
})

107
pages/exercises/myStudy/myStudy.vue

@ -1,76 +1,83 @@
<template>
<view class="content">
<up-navbar leftText=" " :leftIconColor="'#fff'" :safeAreaInsetTop="true" :autoBack="true" title="我的学习" :bgColor="'transparent'" :titleStyle="{color: '#fff'}">
<up-navbar leftText=" " :leftIconColor="'#fff'" :safeAreaInsetTop="true" :autoBack="true" title="我的学习" :bgColor="'transparent'" :titleStyle="{color: '#fff'}" :fixed="false">
</up-navbar>
<view class="studyDay">已坚持学习8天</view>
<view class="card">
<view class="tabs">
<view class="tab" @click="changeNav(1)" :class="{active: currentNav==1}">科一</view>
<view class="tab" @click="changeNav(2)" :class="{active: currentNav==2}">科四</view>
</view>
<view class="pd20">
<view class="statistics">
<view class="statisticsItem" v-for="(item,index) in statisticsData" :key="index">
<view class="num">{{ item.num }}</view>
<view class="text">{{ item.name }}</view>
</view>
<view class="padding">
<view class="studyDay" v-if="info.days">已坚持学习{{info.days}}</view>
<view class="card">
<view class="tabs">
<view class="tab" @click="changeNav(1)" :class="{active: currentNav==1}">科一</view>
<view class="tab" @click="changeNav(4)" :class="{active: currentNav==4}">科四</view>
</view>
<view class="h3">刷题进度</view>
<view class="bgCard_row">
<view class="bgCard">
<view class="lab">顺序练习</view>
<view class="tps">已完成</view>
<view class="num">140/500</view>
<view class="pd20">
<view class="statistics">
<view class="statisticsItem" v-for="(item,index) in statisticsData" :key="index">
<view class="num">{{ item.num }}</view>
<view class="text">{{ item.name }}</view>
</view>
</view>
<view class="bgCard">
<view class="lab">精选试题</view>
<view class="tps">已完成</view>
<view class="num">110/500</view>
<view class="h3">刷题进度</view>
<view class="bgCard_row">
<view class="bgCard">
<view class="lab">顺序练习</view>
<view class="tps">已完成</view>
<view class="num">{{adCount.orderAlready }} <text>/</text>{{ adCount.orderTotal }}</view>
</view>
<view class="bgCard">
<view class="lab">精选试题</view>
<view class="tps">已完成</view>
<view class="num">{{adCount.siftAlready }}<text>/</text>{{ adCount.siftTotal }}</view>
</view>
</view>
</view>
</view>
</view>
<statistics tit="模拟考试" :chartData="chartData" :listData="listData" key="1" url="/pages/exercises/examSubjiect1/examSubjiect1"></statistics>
<statistics tit="防真考试" :chartData="chartData2" :listData="listData2" key="2"></statistics>
<!-- 如果是科目四并且没有数据 -->
<!-- <view class="subject4 card2 card" v-if="currentNav==2">
<view class="h3">模拟考试</view>
<nodata>暂无考试记录</nodata>
<view class="btnE">
<oneBtn text="去考试" @oneBtnClick="$goPage('/pages/exercises/beforeExam/beforeExam')"></oneBtn>
</view>
</view> -->
<statistics tit="模拟考试" :chartData="chartData" :listData="listData" key="1" :subject="currentNav"></statistics>
<statistics tit="防真考试" :chartData="chartData2" :listData="listData2" key="2" :subject="currentNav" url="/pages/exercises/beforeExam/beforeExam"></statistics>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import nodata from '@/components/nodata/nodata.vue'
import { mystudy, examStatistics } from '@/config/api.js'
import { mystudy, examStatistics, indexAdCount } from '@/config/api.js'
import statistics from './comp/statistics.vue'
const value = ref(false)
const currentNav = ref(1)
import carStore from '@/store/modules/car.js'
let usecarStore = carStore()
currentNav.value = usecarStore.carInfo.stepType
function changeNav(val) {
if(currentNav.value == val) return
currentNav.value = val
let data = info.value.oneresponse
if(val==2) {
data = info.value.fourResponse
}
initStatisticsData(data)
indexAdCountFn()
}
const statisticsData = ref([
{name: '我的收藏', num: 0},
{name: '我的错题', num: 1},
{name: '考试记录', num: 2},
{name: '预计合格率', num: '100%'},
])
const statisticsData = ref([])
const info = ref({})
async function mystudyFn() {
const {data: res} = await mystudy(usecarStore.carInfo.carType)
initStatisticsData(res.oneresponse)
info.value = res
console.log(res)
}
function initStatisticsData(data) {
statisticsData.value = [
{name: '我的收藏', num: data.collectCount || 0},
{name: '我的错题', num: data.errorCount || 0},
{name: '考试记录', num: data.examCount || 0},
{name: '预计合格率', num: data.exampassRate +'%' || 0},
]
}
mystudyFn()
// stepType 1 2仿
let chartData = ref({})
@ -104,7 +111,13 @@
examStatisticsFn(2)
//
let adCount = ref({})
async function indexAdCountFn() {
const {data:res} = await indexAdCount({subject: currentNav.value, carType: usecarStore.carInfo.carType, city: usecarStore.carInfo.city})
adCount.value = res
}
indexAdCountFn()
</script>
<style lang="scss" scoped>
@ -133,14 +146,14 @@
width: 100%;
// background-color: #F6F7FA;
min-height: 100vh;
padding: 100rpx 30rpx 30rpx 30rpx;
padding: 0rpx 0rpx 30rpx 0rpx;
background: url('../../../static/images/topbg.png') #F6F7FA no-repeat;
background-size: 100% 410rpx;
.studyDay {
font-weight: bold;
font-size: 36rpx;
color: #FFFFFF;
padding: 40rpx 0;
padding: 20rpx 0;
}
.card {
background: #FFFFFF;

204
pages/vip/paymentOrder/paymentOrder.vue

@ -0,0 +1,204 @@
<template>
<view class="payWay">
<view class="card">
<view class="name">{{ orderName }}</view>
<view class="price"><text></text> 1000</view>
</view>
<view class="card">
<view class="h1">请选择支付方式</view>
<view class="zfb" @click="changePayWay(2)">
<view class="leftCon">
<view class="icon">
<image src="@/static/images/jiaofei_zfbIphone@2x.png" mode=""></image>
</view>
<view class="text">
支付宝支付
</view>
</view>
<view class="rightStatusIcon">
<image src="@/static/images/jiaofei_zhifu_selectIphone@2x.png" mode="" v-if="payWay==2">
</image>
<image src="@/static/images/jiaofei_zhifu_unselectIphone@2x.png" mode="" v-else></image>
</view>
</view>
<view class="zfb" @click="changePayWay(1)">
<view class="leftCon">
<view class="icon">
<image src="@/static/images/jiaofei_wxIphone@2x.png" mode=""></image>
</view>
<view class="text">
微信支付
</view>
</view>
<view class="rightStatusIcon">
<image src="@/static/images/jiaofei_zhifu_selectIphone@2x.png" mode="" v-if="payWay==1">
</image>
<image src="@/static/images/jiaofei_zhifu_unselectIphone@2x.png" mode="" v-else></image>
</view>
</view>
</view>
<view class="footBox">
<view class="btn border" @click="cancelPay" >取消本次支付</view>
<view class="btn" @click="submitPay">确认支付</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { createPrepaidApi, memberVoicePage } from '@/config/api.js'
import carStore from '@/store/modules/car.js'
import {
onLoad,
} from "@dcloudio/uni-app"
let usecarStore = carStore()
const payWay = ref(1)
function cancelPay() {
uni.navigateBack()
}
function changePayWay(val) {
payWay.value = val
}
function submitPay() {
console.log('去支付吧')
}
let memberGradeId = 1
async function createPrepaidApiFn() {
let obj = {
"memberGradeId": memberGradeId,
"payType": 2,
"returnUrl": "",
"source": 1
}
const {data: res} = await createPrepaidApi(obj)
// vipItemData.value = res
console.log(res)
}
createPrepaidApiFn()
let orderName = ref('')
let price = ref(0)
onLoad((option)=>{
if(option.id) memberGradeId = option.id
if(option.name) orderName.value = option.name
if(option.price) orderName.value = option.price
})
</script>
<style lang="scss" scoped>
.payWay {
padding: 0 32rpx;
background: #F6F7FA;
min-height: 100vh;
overflow: hidden;
.h1 {
padding: 20rpx 0 20rpx 10rpx;
font-weight: 700;
}
.card {
border-radius: 20rpx;
background-color: #fff;
padding: 20rpx;
margin: 40rpx 0;
overflow: hidden;
.price {
font-size: 56rpx;
font-weight: 700;
text-align: center;
padding-bottom: 20rpx;
text {
font-size: 30rpx;
margin-right: -10rpx;
}
}
.name {
font-weight: 400;
font-size: 28rpx;
color: #CCCCCC;
padding: 24rpx;
text-align: center;
}
}
.zfb {
background-color: #fff;
border-radius: 16rpx;
padding: 0 16px;
height: 110rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
.leftCon {
display: flex;
align-items: center;
.icon {
width: 48rpx;
height: 48rpx;
image {
display: block;
width: 100%;
height: 100%;
}
}
.text {
font-size: 32rpx;
color: #333;
margin: 0 10rpx 0 20rpx;
}
.recommendIcon {
width: 64rpx;
height: 34rpx;
image {
width: 100%;
height: 100%;
display: block;
}
}
}
.rightStatusIcon {
width: 42rpx;
height: 42rpx;
image {
display: block;
width: 100%;
height: 100%;
}
}
}
}
.footBox {
display: flex;
padding: 32rpx 0;
justify-content: space-between;
.btn {
width: 48%;
height: 98rpx;
background: #2168FC;
border-radius: 16rpx;
color: #fff;
text-align: center;
line-height: 98rpx;
&.border {
background: none;
border: 1px solid #2168FC;
color: #2168FC;
}
}
}
</style>

13
pages/vip/vipEntry/comp/commentItem.vue

@ -2,19 +2,19 @@
<view class="commentItem">
<view class="flex">
<view class="avatar">
<image src="@/static/images/avatarbg.png" mode=""></image>
<image :src="item.avatar" mode="widthFix"></image>
</view>
<view class="name">关系很好</view>
<view class="tag">7天通过科目一</view>
<view class="name">{{ item.name }}</view>
<view class="tag">{{ item.label }}</view>
</view>
<view class="text">
抱着"花钱买个心安" 的想法买了VIP后面果然很快就通过考试了比我预想的考试分高
{{ item.description }}
</view>
</view>
</template>
<script setup>
defineProps(['info'])
defineProps(['item'])
</script>
<style lang="scss" scoped>
@ -33,6 +33,7 @@
width: 40rpx;
height: 40rpx;
border-radius: 50%;
overflow: hidden;
}
.name {
@ -42,7 +43,7 @@
}
.tag {
min-width: 159rpx;
min-width: 100rpx;
height: 36rpx;
background: linear-gradient(135deg, #F9E4B1 0%, #F1C477 100%);
border-radius: 6rpx;

40
pages/vip/vipEntry/vipEntry.vue

@ -4,14 +4,14 @@
<up-navbar leftText=" " :leftIconColor="'#fff'" :safeAreaInsetTop="true" :autoBack="true" title=" " :fixed="true"
:bgColor="'transparent'">
</up-navbar>
<view class="topBg" :class="{bigBg: curVipItem.name=='全科VIP'}">
<view class="topBg" :class="{bigBg: curVipItem.type=='5'}">
<view class="tag">XXXX成为VIP会员</view>
<view class="tag">一次搞定</view>
<view class="tag">五大特权</view>
<view class="tag">最低仅需xx元/</view>
<view class="tag" @click="$goPage('/pages/vip/vipQuestions/vipQuestions')">常见问题</view>
<view class="allSubRow" v-if="curVipItem.name=='全科VIP'">
<view class="allSubRow" v-if="curVipItem.type=='5'">
<view class="allsbItem">
<view class="icon">
<image src="@/static/images/vip/allSbu1.png" mode=""></image>
@ -52,7 +52,7 @@
<view class="lab">{{item.name}}</view>
<view class="redT flex">
<view class="price"><text>{{item.price}}/</text></view>
<view class="day">{{item.day}}</view>
<view class="day">{{item.days}}</view>
</view>
</view>
</view>
@ -62,7 +62,7 @@
<view class="price"><text>{{ curVipItem.price }}/</text></view>
<view class="day">{{curVipItem.day}}</view>
</view>
<view class="upgra"></view>
<view class="upgra" @click="goPaymentOrder()"></view>
</view>
<view class="h1_row flex-b">
@ -129,9 +129,9 @@
</view>
<swiper next-margin="60rpx" previous-margin="20rpx">
<swiper-item v-for="(item,index) in 6" :key="index">
<swiper-item v-for="(item,index) in voiceList" :key="index">
<view style="padding: 0 20rpx;">
<commentItem/>
<commentItem :item="item"/>
</view>
</swiper-item>
</swiper>
@ -141,7 +141,7 @@
<view class="commentbox">
<view class="tit">VIP学员之声</view>
<view class="popComment">
<commentItem v-for="(item,index) in 10" :key="index"></commentItem>
<commentItem v-for="(item,index) in voiceList" :item="item" :key="index"></commentItem>
</view>
</view>
</up-popup>
@ -174,13 +174,13 @@
])
const curVipItem = ref({name: '全科VIP', price: 15, day: 180})
const vipItemData = ref([
{name: '全科VIP', price: 15, day: 180},
{name: '科目一VIP', price: 10, day: 180},
{name: '科目四VIP', price: 10, day: 180},
// {name: 'VIP', price: 15, day: 180},
// {name: 'VIP', price: 10, day: 180},
// {name: 'VIP', price: 10, day: 180},
])
let show = ref(false)
function lookMore() {
console.log('我是一个h5')
show.value = true
}
function chooseVip(item) {
curVipItem.value = item
@ -188,21 +188,34 @@
async function memberGradelistFn() {
const {data: res} = await memberGradelist(usecarStore.carInfo.carType)
if(!res.length) return
vipItemData.value = res
console.log(res)
}
memberGradelistFn()
let voiceList = ref([])
async function memberVoicePageFn() {
let obj = {
"carType": usecarStore.carInfo.carType,
"pageNum": 1,
"pageSize": 6
}
const {data: res} = await memberVoicePage(obj)
const res = await memberVoicePage(obj)
console.log(res)
if(!res.rows.length) return
voiceList.value = res.rows
}
memberVoicePageFn()
function goPaymentOrder() {
if(!curVipItem.value.id) return uni.$u.toast('请先选择要购买的类型')
uni.navigateTo({
url: `/pages/vip/paymentOrder/paymentOrder?name=${curVipItem.value.name}&id=${curVipItem.value.id}&price=${curVipItem.value.price}`
})
}
</script>
@ -296,7 +309,8 @@
.allVip {
transform: translateY(-96rpx);
// position: relative;
position: relative;
z-index: 99;
// top: -96rpx;
.vipItem {

BIN
static/images/jiaofei_wxIphone@2x.png

After

Width: 48  |  Height: 48  |  Size: 1.9 KiB

BIN
static/images/jiaofei_zfbIphone@2x.png

After

Width: 48  |  Height: 48  |  Size: 2.1 KiB

BIN
static/images/jiaofei_zhifu_selectIphone@2x.png

After

Width: 42  |  Height: 42  |  Size: 2.1 KiB

BIN
static/images/jiaofei_zhifu_unselectIphone@2x.png

After

Width: 43  |  Height: 43  |  Size: 4.4 KiB

Loading…
Cancel
Save