Commit e39f3951 authored by Facius's avatar Facius

improvement: 详情页

parent 1b360b91
...@@ -340,6 +340,7 @@ export default { ...@@ -340,6 +340,7 @@ export default {
url: 'pages/learn/detail', url: 'pages/learn/detail',
params: { params: {
relationId: this.relationId, relationId: this.relationId,
id: this.info.id,
}, },
}) })
} }
...@@ -361,6 +362,7 @@ export default { ...@@ -361,6 +362,7 @@ export default {
url: 'pages/learn/' + str, url: 'pages/learn/' + str,
params: { params: {
relationId: this.relationId, relationId: this.relationId,
id: this.info.id,
}, },
}) })
}, },
...@@ -420,6 +422,7 @@ export default { ...@@ -420,6 +422,7 @@ export default {
url: 'pages/learn/detail', url: 'pages/learn/detail',
params: { params: {
relationId: this.relationId, relationId: this.relationId,
id: this.info.id,
}, },
}) })
} else { } else {
...@@ -447,6 +450,7 @@ export default { ...@@ -447,6 +450,7 @@ export default {
url: 'pages/learn/detail', url: 'pages/learn/detail',
params: { params: {
relationId: this.relationId, relationId: this.relationId,
id: this.info.id,
}, },
}) })
} else { } else {
......
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
<view class="head-view"> <view class="head-view">
<view class="head-tip">8年题库沉淀,省时省力考高分</view> <view class="head-tip">8年题库沉淀,省时省力考高分</view>
<view class="content-text">{{ info.title }}</view> <view class="content-text">{{ info.questionWarehouse.title }}</view>
</view> </view>
<view class="body-view"> <view class="body-view">
<view class="title-view">{{ info.title }}</view> <view class="title-view">{{ info.questionWarehouse.title }}</view>
<view class="message-view">8年题库沉淀,省时省力考高分</view> <view class="message-view">8年题库沉淀,省时省力考高分</view>
<view class="tip-view" <view class="tip-view"
>• 有效期90天,自购买或者绑卡后答题激活为起始日期</view >• 有效期90天,自购买或者绑卡后答题激活为起始日期</view
...@@ -23,11 +23,14 @@ ...@@ -23,11 +23,14 @@
<view class="price-view"> <view class="price-view">
<view class="left-view"> <view class="left-view">
<view class="discount-view"> <view class="discount-view">
¥<text class="count-text">{{ info.discount }}</text ¥<text class="count-text">{{
info.questionWarehouse.realPrice
}}</text
>元/套 >元/套
</view> </view>
<view class="money-view" <view class="money-view"
><text class="money-text"> ¥{{ info.money }}元/套</text ><text class="money-text">
¥{{ info.questionWarehouse.price }}元/套</text
><view class="line-view"></view> ><view class="line-view"></view>
</view> </view>
</view> </view>
...@@ -44,7 +47,7 @@ ...@@ -44,7 +47,7 @@
<view class="question-bank-view"> <view class="question-bank-view">
<view class="outline-view " <view class="outline-view "
>本题库共 >本题库共
<text class="count">{{ info.total }}</text> <text class="count">{{ info.totalCount }}</text>
道教研组精编考题,专业老师会根据各地政策不断更新优化题库</view 道教研组精编考题,专业老师会根据各地政策不断更新优化题库</view
> >
<view class="items-view"> <view class="items-view">
...@@ -57,7 +60,7 @@ ...@@ -57,7 +60,7 @@
<image class="image" :src="item.icon"></image> <image class="image" :src="item.icon"></image>
</view> </view>
<view>{{ item.title }}</view> <view>{{ item.title }}</view>
<view class="value-view">{{ item.value }}道</view> <view class="value-view">{{ info[item.key] }}道</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -93,6 +96,7 @@ export default { ...@@ -93,6 +96,7 @@ export default {
return { return {
relationId: 0, // 绑卡用 relationId: 0, // 绑卡用
info: { info: {
questionWarehouse: {},
title: '高处安装、维护、拆除作业人员题库', title: '高处安装、维护、拆除作业人员题库',
money: 80.0, money: 80.0,
discount: 30.0, discount: 30.0,
...@@ -165,18 +169,18 @@ export default { ...@@ -165,18 +169,18 @@ export default {
return [ return [
{ {
title: '单选题', title: '单选题',
value: '128',
icon: this.danxuanImage, icon: this.danxuanImage,
key: 'oneAnswerCount',
}, },
{ {
title: '判断题', title: '判断题',
value: '526',
icon: this.panduanmage, icon: this.panduanmage,
key: 'trueAnswerCount',
}, },
{ {
title: '多选题', title: '多选题',
value: '322',
icon: this.duoxuanImage, icon: this.duoxuanImage,
key: 'anyAnswerCount',
}, },
] ]
}, },
...@@ -185,8 +189,22 @@ export default { ...@@ -185,8 +189,22 @@ export default {
if (e && e.relationId) { if (e && e.relationId) {
this.relationId = e.relationId this.relationId = e.relationId
} }
if (e && e.id) {
this.queryQuestionWarehouseById(e.id)
}
}, },
methods: { methods: {
queryQuestionWarehouseById(id) {
this.$u.api
.queryQuestionWarehouseById(id)
.then((res) => {
this.info = res || { questionWarehouse: {} }
})
.catch((err) => {
this.loading = false
console.log(err)
})
},
handleClick() { handleClick() {
this.$u.route({ this.$u.route({
url: 'pages/learn/boundQuestions', url: 'pages/learn/boundQuestions',
......
...@@ -51,26 +51,29 @@ ...@@ -51,26 +51,29 @@
<view class="bottom-view"> <view class="bottom-view">
<u-button <u-button
:customStyle="buttonStyle" :customStyle="buttonStyle"
@click="handleClick" @click="show = true"
type="primary" type="primary"
hover-class="hover-class" hover-class="hover-class"
open-type="share"
> >
<image :src="pengyunquanImage" class="share-image"></image> <image :src="pengyunquanImage" class="share-image"></image>
分享朋友圈 分享朋友圈
</u-button> </u-button>
<u-button <u-button :customStyle="buttonStyle" open-type="share" type="primary">
:customStyle="buttonStyle"
@click="handleClick"
open-type="share"
type="primary"
hover-class="none"
>
<image :src="weixinImage" class="share-image"></image> <image :src="weixinImage" class="share-image"></image>
分享给好友 分享给好友
</u-button> </u-button>
</view> </view>
</view> </view>
<u-mask :show="show" @click="show = false">
<view class="tip-view">
<image class="tip-image" :src="jiantouImage"></image>
<view class="tip-message"
><text class="tip-text"
>请点击右上角可分享至朋友圈或发送给指定朋友</text
>
</view>
</view>
</u-mask>
</view> </view>
</template> </template>
...@@ -84,6 +87,7 @@ export default { ...@@ -84,6 +87,7 @@ export default {
data() { data() {
return { return {
info: {}, info: {},
show: false,
} }
}, },
...@@ -135,6 +139,9 @@ export default { ...@@ -135,6 +139,9 @@ export default {
weixinImage() { weixinImage() {
return process.uniEnv.qn_base_url + 'weixin.png' return process.uniEnv.qn_base_url + 'weixin.png'
}, },
jiantouImage() {
return process.uniEnv.qn_base_url + 'jiantou.png'
},
// 模考成绩60分以下则百分数在55%—65% 区间内取随机值; // 模考成绩60分以下则百分数在55%—65% 区间内取随机值;
// 模考成绩大于60分小于80分则百分数在66%—85% 区间内取随机值; // 模考成绩大于60分小于80分则百分数在66%—85% 区间内取随机值;
// 模考成绩大于80分小于90分则百分数在86%—93% 区间内取随机值; // 模考成绩大于80分小于90分则百分数在86%—93% 区间内取随机值;
...@@ -158,7 +165,7 @@ export default { ...@@ -158,7 +165,7 @@ export default {
if (!e) { if (!e) {
this.$u.route({ this.$u.route({
url: 'pages/index/index', url: 'pages/index/index',
type: 'tab' type: 'tab',
}) })
} }
this.init(e?.id) this.init(e?.id)
...@@ -166,33 +173,33 @@ export default { ...@@ -166,33 +173,33 @@ export default {
methods: { methods: {
init(id) { init(id) {
uni.showLoading({ uni.showLoading({
title: '加载中' title: '加载中',
}) })
this.$u.api.queryExamRecordOne({id: id}).then(res => { this.$u.api.queryExamRecordOne({ id: id }).then((res) => {
uni.hideLoading() uni.hideLoading()
if (res) { if (res) {
const echoMap = res.echoMap const echoMap = res.echoMap
this.info = { this.info = {
institutionLogo: echoMap?.institutionId?.wxQrcodePath || process.uniEnv.qn_base_url + 'applets.jpg', institutionLogo:
echoMap?.institutionId?.wxQrcodePath ||
process.uniEnv.qn_base_url + 'applets.jpg',
name: echoMap.studentId.nickname, name: echoMap.studentId.nickname,
image: echoMap.studentId.avatarPath, image: echoMap.studentId.avatarPath,
score: res.point, score: res.point,
time: res.endDatetime, time: res.endDatetime,
category: echoMap.questionWarehouseId.title, category: echoMap.questionWarehouseId.title,
type: '模拟考试' type: '模拟考试',
} }
} }
}) })
}, },
handleClick() {
},
handleClickRecord() { handleClickRecord() {
this.$u.route({ this.$u.route({
type: 'push', type: 'push',
url: '/pages/learn/answer', url: '/pages/learn/answer',
params: { params: {
source: 5 source: 5,
} },
}) })
}, },
}, },
...@@ -337,5 +344,30 @@ export default { ...@@ -337,5 +344,30 @@ export default {
} }
} }
} }
.tip-view {
margin-top: 116rpx;
display: flex;
flex-direction: column;
align-items: flex-end;
.tip-image {
width: 96rpx;
height: 282rpx;
margin-right: 200rpx;
margin-bottom: 24rpx;
}
.tip-message {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
.tip-text {
color: #ffffff;
font-size: 32rpx;
font-weight: bold;
text-align: left;
width: 420rpx;
}
}
}
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment