Commit e39f3951 authored by Facius's avatar Facius

improvement: 详情页

parent 1b360b91
......@@ -340,6 +340,7 @@ export default {
url: 'pages/learn/detail',
params: {
relationId: this.relationId,
id: this.info.id,
},
})
}
......@@ -361,6 +362,7 @@ export default {
url: 'pages/learn/' + str,
params: {
relationId: this.relationId,
id: this.info.id,
},
})
},
......@@ -420,6 +422,7 @@ export default {
url: 'pages/learn/detail',
params: {
relationId: this.relationId,
id: this.info.id,
},
})
} else {
......@@ -447,6 +450,7 @@ export default {
url: 'pages/learn/detail',
params: {
relationId: this.relationId,
id: this.info.id,
},
})
} else {
......
......@@ -12,10 +12,10 @@
<view class="head-view">
<view class="head-tip">8年题库沉淀,省时省力考高分</view>
<view class="content-text">{{ info.title }}</view>
<view class="content-text">{{ info.questionWarehouse.title }}</view>
</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="tip-view"
>• 有效期90天,自购买或者绑卡后答题激活为起始日期</view
......@@ -23,11 +23,14 @@
<view class="price-view">
<view class="left-view">
<view class="discount-view">
¥<text class="count-text">{{ info.discount }}</text
¥<text class="count-text">{{
info.questionWarehouse.realPrice
}}</text
>元/套
</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>
</view>
......@@ -44,7 +47,7 @@
<view class="question-bank-view">
<view class="outline-view "
>本题库共
<text class="count">{{ info.total }}</text>
<text class="count">{{ info.totalCount }}</text>
道教研组精编考题,专业老师会根据各地政策不断更新优化题库</view
>
<view class="items-view">
......@@ -57,7 +60,7 @@
<image class="image" :src="item.icon"></image>
</view>
<view>{{ item.title }}</view>
<view class="value-view">{{ item.value }}道</view>
<view class="value-view">{{ info[item.key] }}道</view>
</view>
</view>
</view>
......@@ -93,6 +96,7 @@ export default {
return {
relationId: 0, // 绑卡用
info: {
questionWarehouse: {},
title: '高处安装、维护、拆除作业人员题库',
money: 80.0,
discount: 30.0,
......@@ -165,18 +169,18 @@ export default {
return [
{
title: '单选题',
value: '128',
icon: this.danxuanImage,
key: 'oneAnswerCount',
},
{
title: '判断题',
value: '526',
icon: this.panduanmage,
key: 'trueAnswerCount',
},
{
title: '多选题',
value: '322',
icon: this.duoxuanImage,
key: 'anyAnswerCount',
},
]
},
......@@ -185,8 +189,22 @@ export default {
if (e && e.relationId) {
this.relationId = e.relationId
}
if (e && e.id) {
this.queryQuestionWarehouseById(e.id)
}
},
methods: {
queryQuestionWarehouseById(id) {
this.$u.api
.queryQuestionWarehouseById(id)
.then((res) => {
this.info = res || { questionWarehouse: {} }
})
.catch((err) => {
this.loading = false
console.log(err)
})
},
handleClick() {
this.$u.route({
url: 'pages/learn/boundQuestions',
......
......@@ -51,26 +51,29 @@
<view class="bottom-view">
<u-button
:customStyle="buttonStyle"
@click="handleClick"
@click="show = true"
type="primary"
hover-class="hover-class"
open-type="share"
>
<image :src="pengyunquanImage" class="share-image"></image>
分享朋友圈
</u-button>
<u-button
:customStyle="buttonStyle"
@click="handleClick"
open-type="share"
type="primary"
hover-class="none"
>
<u-button :customStyle="buttonStyle" open-type="share" type="primary">
<image :src="weixinImage" class="share-image"></image>
分享给好友
</u-button>
</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>
</template>
......@@ -84,6 +87,7 @@ export default {
data() {
return {
info: {},
show: false,
}
},
......@@ -122,7 +126,7 @@ export default {
backImage() {
return this.isPass ? this.hegechengjiImage : this.buhegechengjiImage
},
hegechengjiImage() {
return process.uniEnv.qn_base_url + 'hegechengji.png'
},
......@@ -135,6 +139,9 @@ export default {
weixinImage() {
return process.uniEnv.qn_base_url + 'weixin.png'
},
jiantouImage() {
return process.uniEnv.qn_base_url + 'jiantou.png'
},
// 模考成绩60分以下则百分数在55%—65% 区间内取随机值;
// 模考成绩大于60分小于80分则百分数在66%—85% 区间内取随机值;
// 模考成绩大于80分小于90分则百分数在86%—93% 区间内取随机值;
......@@ -157,42 +164,42 @@ export default {
onLoad(e) {
if (!e) {
this.$u.route({
url: 'pages/index/index',
type: 'tab'
})
url: 'pages/index/index',
type: 'tab',
})
}
this.init(e?.id)
},
methods: {
init(id) {
uni.showLoading({
title: '加载中'
title: '加载中',
})
this.$u.api.queryExamRecordOne({id: id}).then(res => {
this.$u.api.queryExamRecordOne({ id: id }).then((res) => {
uni.hideLoading()
if (res) {
const echoMap = res.echoMap
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,
image: echoMap.studentId.avatarPath,
score: res.point,
time: res.endDatetime,
category: echoMap.questionWarehouseId.title,
type: '模拟考试'
type: '模拟考试',
}
}
})
},
handleClick() {
},
handleClickRecord() {
this.$u.route({
type: 'push',
url: '/pages/learn/answer',
params: {
source: 5
}
source: 5,
},
})
},
},
......@@ -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>
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