This commit is contained in:
唐明明
2022-01-14 16:45:12 +08:00
4 changed files with 716 additions and 868 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -99,7 +99,7 @@ export default {
this.page = this.page + 1; this.page = this.page + 1;
this.getList(); this.getList();
} else { } else {
if(this.option_ids.length !== this.page){ if (this.option_ids.length !== this.page) {
this.option_ids.push(this.currentId); this.option_ids.push(this.currentId);
this.currentId = ''; this.currentId = '';
} }
@@ -124,8 +124,8 @@ export default {
}) })
.catch(err => { .catch(err => {
uni.showToast({ uni.showToast({
title:err.message title: err.message
}) });
}); });
} }
} }

View File

@@ -52,7 +52,7 @@ export default {
}); });
}, },
toResult() { toResult() {
console.log('点击了测试') console.log('点击了测试');
uni.navigateTo({ uni.navigateTo({
url: `/pages/evaluation/result?id=${this.$Route.query.id}` url: `/pages/evaluation/result?id=${this.$Route.query.id}`
}); });

View File

@@ -6,205 +6,183 @@
* @LastEditTime: 2022-01-14 08:40:36 * @LastEditTime: 2022-01-14 08:40:36
--> -->
<template> <template>
<view class="evaluation-list "> <view class="evaluation-list ">
<view <view class="evaluation-item" v-for="(item, index) in evalList" :key="index">
class="evaluation-item" <!-- 评测列表主要内容 标题 图片 描述 -->
v-for="(item,index) in evalList" <view class="--content">
:key="index" <u-image class="content-img" width="170rpx" height="170rpx" radius="20rpx" :src="item.cover ? item.cover : require('../../static/imgs/test.png')" :lazy-load="true" />
> <view class="title-des">
<!-- 评测列表主要内容 标题 图片 描述 --> <view class="title">{{ item.title }}</view>
<view class="--content"> <view class="des">{{ item.description || '--' }}</view>
<u-image </view>
class="content-img" </view>
width="170rpx"
height="170rpx"
radius="20rpx"
:src="item.cover?item.cover:require('../../static/imgs/test.png')"
:lazy-load="true"
/>
<view class="title-des">
<view class="title">{{item.title}}</view>
<view class="des">{{item.description || '--'}}</view>
</view>
</view>
<!-- 分数 --> <!-- 分数 -->
<view <view class="score" v-if="item.is_answer">
class="score" <span>{{ item.answer.total }}</span>
v-if="item.is_answer"
><span>{{item.answer.total}}</span></view> </view>
<!-- 评测状态 --> <!-- 评测状态 -->
<view class="--status"> <view class="--status">
<!-- 已测试展示 状态--> <!-- 已测试展示 状态-->
<view <view class="status" v-if="item.is_answer">
class="status" <span class="dian">·</span>
v-if="item.is_answer" {{ item.remark }}
> </view>
<span class="dian">·</span>{{item.remark}} <view v-if="item.is_answer" class="history" @click="toResult(item)">查看历史结果</view>
</view> <!-- 未测试展示 状态-->
<view <view class="status" v-if="!item.is_answer">
v-if="item.is_answer" <span class="dian">·</span>
class="history" <span class="person">{{ item.remark }}</span>
@click="toResult(item)" 人已测 | 约4~8分钟
> </view>
查看历史结果 <u-icon
</view> name="arrow-right"
<!-- 未测试展示 状态--> :color="item.is_answer ? '#26a377' : '#faa81a'"
<view size="14"
class="status" :bold="true"
v-if="!item.is_answer" :label="item.is_answer ? '重新评测' : '开始测评'"
> labelPos="left"
<span class="dian">·</span> labelSize="14"
<span class="person">{{item.remark}}</span> space="1"
人已测 | 约4~8分钟 :labelColor="item.is_answer ? '#26a377' : '#faa81a'"
</view> @click="nowEva(item)"
<u-icon />
name="arrow-right" </view>
:color="item.is_answer?'#26a377':'#faa81a'" </view>
size="14" <!-- 没有更多 -->
:bold="true" <view class="no-more">没有更多~</view>
:label="item.is_answer?'重新评测':'开始测评'" </view>
labelPos="left"
labelSize="14"
space="1"
:labelColor="item.is_answer?'#26a377':'#faa81a'"
@click="nowEva(item)"
/>
</view>
</view>
<!-- 没有更多 -->
<view class="no-more">没有更多~</view>
</view>
</template> </template>
<script> <script>
import { evaluations } from "@/apis/interfaces/evaluation.js"; import { evaluations } from '@/apis/interfaces/evaluation.js';
export default { export default {
data() { data() {
return { return {
evalList: [], evalList: []
}; };
}, },
onShow() { onShow() {
this.getList(); this.getList();
}, },
methods: { methods: {
// 测试列表 // 测试列表
getList() { getList() {
evaluations().then((res) => { evaluations().then(res => {
this.evalList = res; this.evalList = res;
}); });
}, },
// nowEva // nowEva
nowEva(item) { nowEva(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/evaluation/introduce?id=${item.evaluation_id}`, url: `/pages/evaluation/introduce?id=${item.evaluation_id}`
}); });
}, },
//测评结果 //测评结果
toResult(item) { toResult(item) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/evaluation/result?id=${item.evaluation_id}`, url: `/pages/evaluation/result?id=${item.evaluation_id}`
}); });
}, }
}, }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// 列表 // 列表
.evaluation-item { .evaluation-item {
background-color: #fff; background-color: #fff;
padding: $padding; padding: $padding;
margin: $margin; margin: $margin;
box-shadow: 0 0 10rpx 4rpx rgba($color: $main-color, $alpha: 0.1); box-shadow: 0 0 10rpx 4rpx rgba($color: $main-color, $alpha: 0.1);
border-radius: $radius; border-radius: $radius;
position: relative; position: relative;
// 评测列表主要内容 // 评测列表主要内容
.--content { .--content {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: flex-start; justify-content: flex-start;
box-sizing: border-box; box-sizing: border-box;
.content-img { .content-img {
box-shadow: 0 0 10rpx 4rpx rgba($color: $main-color, $alpha: 0.1); box-shadow: 0 0 10rpx 4rpx rgba($color: $main-color, $alpha: 0.1);
border-radius: 30rpx; border-radius: 30rpx;
} }
.title-des { .title-des {
padding-left: $padding - 10; padding-left: $padding - 10;
width: 440rpx; width: 440rpx;
.title { .title {
font-size: $title-size + 4; font-size: $title-size + 4;
font-weight: bold; font-weight: bold;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
width: 340rpx; width: 340rpx;
} }
.des { .des {
font-size: $title-size-lg; font-size: $title-size-lg;
color: $text-gray; color: $text-gray;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
padding-top: $padding - 8; padding-top: $padding - 8;
} }
} }
} }
// .测试状态 // .测试状态
.--status { .--status {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
color: $text-gray-m; color: $text-gray-m;
font-size: $title-size-m; font-size: $title-size-m;
padding-top: $padding; padding-top: $padding;
.status { .status {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-sizing: border-box; box-sizing: border-box;
.dian { .dian {
font-size: $title-size-lg; font-size: $title-size-lg;
margin-right: $padding * 0.2; margin-right: $padding * 0.2;
font-weight: bold; font-weight: bold;
} }
.person { .person {
color: #faa81a; color: #faa81a;
} }
} }
.history { .history {
text-decoration: underline; text-decoration: underline;
} }
} }
// 分数 // 分数
.score { .score {
font-size: $title-size-m - 2; font-size: $title-size-m - 2;
color: $text-gray-m; color: $text-gray-m;
position: absolute; position: absolute;
right: $padding; right: $padding;
top: $padding - 10; top: $padding - 10;
span { span {
font-size: 50rpx; font-size: 50rpx;
color: $main-color; color: $main-color;
font-weight: bold; font-weight: bold;
} }
} }
} }
// 没有更多 // 没有更多
.no-more { .no-more {
color: $uni-text-color-disable; color: $uni-text-color-disable;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-sizing: border-box; box-sizing: border-box;
padding: $padding; padding: $padding;
font-size: $title-size-m; font-size: $title-size-m;
} }
</style> </style>