|
...
|
...
|
@@ -8,16 +8,21 @@ |
|
|
|
</view>
|
|
|
|
<view class="answer-2">
|
|
|
|
<view class="answer-2-l">
|
|
|
|
<picker @change="bindpickerChange" :value="index" :range="subjectList" range-key="title">
|
|
|
|
<picker @change="keMupickerChange" :value="keMu.value" :range="keMu.list">
|
|
|
|
<view class="answer-2-l-i">
|
|
|
|
任课科目 <u-icon size="12" name="arrow-down-fill" color="#646464"></u-icon>
|
|
|
|
{{ keMu.list[keMu.value] === '全部' ? '任课科目' : keMu.list[keMu.value] }}
|
|
|
|
<u-icon size="12" name="arrow-down-fill" color="#646464"></u-icon>
|
|
|
|
</view>
|
|
|
|
</picker>
|
|
|
|
<picker @change="bindpickerChange2" :value="index" :range="basedOnList" range-key="title">
|
|
|
|
<view class="answer-2-l-i">
|
|
|
|
用户评价 <u-icon size="12" name="arrow-down-fill" color="#646464"></u-icon>
|
|
|
|
<view
|
|
|
|
class="answer-2-l-i"
|
|
|
|
@click="sortChange"
|
|
|
|
>
|
|
|
|
用户评价
|
|
|
|
<view class="icon" :class="{asc: sort === 'asc'}">
|
|
|
|
<u-icon size="12" name="arrow-down-fill" color="#2D81FF"></u-icon>
|
|
|
|
</view>
|
|
|
|
</picker>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="answer-2-r" @click="toMyQuestion">
|
|
|
|
<image class="answer-2-r-i" src="@/static/imagesV2/icon39.png" mode="widthFix"></image>
|
|
...
|
...
|
@@ -36,63 +41,69 @@ |
|
|
|
<template>
|
|
|
|
<view class="answer">
|
|
|
|
<view v-if="type === PAGETYPE.ONLINE">
|
|
|
|
<view class="answer-item" v-for="item in 20" :key="item">
|
|
|
|
<view class="answer-item-tw" @click="toAnswerForm">
|
|
|
|
<view class="answer-item" v-for="d in list" :key="d.id">
|
|
|
|
<view class="answer-item-tw" @click="toAnswerForm(d)">
|
|
|
|
<image class="answer-item-tw-i" src="@/static/imagesV2/icon41.png"></image>
|
|
|
|
<text>提问</text>
|
|
|
|
</view>
|
|
|
|
<view class="answer-item-l">
|
|
|
|
<image class="answer-item-l-img" src="@/static/images/tx.png" mode="widthFix"></image>
|
|
|
|
<view class="answer-item-l-img">
|
|
|
|
<image :src="d.img_url || '/static/images/tx.png'" mode="widthFix"></image>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="answer-item-r">
|
|
|
|
<view class="answer-item-r-1">程菲</view>
|
|
|
|
<view class="answer-item-r-2">笔试系统精讲班</view>
|
|
|
|
<view class="answer-item-r-1">{{d.title}}</view>
|
|
|
|
<view class="answer-item-r-2">{{d.sub_title}}</view>
|
|
|
|
<view class="answer-item-r-3">
|
|
|
|
<image class="answer-item-r-3-i" src="@/static/imagesV2/icon40.png" mode="widthFix"></image>
|
|
|
|
<text class="answer-item-r-3-la">用户评分</text>
|
|
|
|
<text class="answer-item-r-3-f">3.6</text>
|
|
|
|
<text class="answer-item-r-3-f">{{d.start}}</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view v-if="type === PAGETYPE.CLASSROOM">
|
|
|
|
<view class="answer-item2">
|
|
|
|
<view class="answer-item2" v-for="d in list" :key="d.id">
|
|
|
|
<view class="myQuestion-2-i-1">
|
|
|
|
<view class="myQuestion-2-i-1-l">
|
|
|
|
<image class="myQuestion-2-i-1-l-i" src="@/static/images/tx.png" mode="widthFix"></image>
|
|
|
|
<view class="myQuestion-2-i-1-l-i">
|
|
|
|
<image :src="d.img || '/static/images/tx.png'" mode="widthFix"></image>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
</view>
|
|
|
|
<view class="myQuestion-2-i-1-r">
|
|
|
|
<view class="myQuestion-2-i-1-r-1">李晋心</view>
|
|
|
|
<view class="myQuestion-2-i-1-r-2">2023-12-10发布</view>
|
|
|
|
<view class="myQuestion-2-i-1-r-1">{{d.name}}</view>
|
|
|
|
<view class="myQuestion-2-i-1-r-2">{{d.create_time}}发布</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="myQuestion-2-i-2">
|
|
|
|
老师你好请问工商管理专业的应届生可以报考工商管理
|
|
|
|
内的二级专业吗?比如说会计学,旅游管理?
|
|
|
|
{{d.question}}
|
|
|
|
</view>
|
|
|
|
<view class="myQuestion-2-i-4">
|
|
|
|
<view class="myQuestion-2-i-4" v-if="d.imgs && d.imgs.length">
|
|
|
|
<u--image
|
|
|
|
v-for="(item, index) in []"
|
|
|
|
v-for="(item, index) in d.imgs"
|
|
|
|
:key="index"
|
|
|
|
radius="15rpx"
|
|
|
|
height="145rpx"
|
|
|
|
width="145rpx"
|
|
|
|
@click.native="seeImg(index)"
|
|
|
|
@click.native="seeImg(d.imgs, index)"
|
|
|
|
:src="item"></u--image>
|
|
|
|
</view>
|
|
|
|
<view class="myQuestion-2-i-3">
|
|
|
|
<view class="myQuestion-2-i-3" >
|
|
|
|
<view class="myQuestion-2-i-3-l">
|
|
|
|
<view class="myQuestion-2-i-3-l-1" v-if="false">已解答</view>
|
|
|
|
<view class="myQuestion-2-i-3-l-1 myQuestion-2-i-3-l-1s" v-else>已解答</view>
|
|
|
|
<view class="myQuestion-2-i-3-l-t">程菲</view>
|
|
|
|
<view class="myQuestion-2-i-3-l-1" v-if="d.answer_type != 0">已解答</view>
|
|
|
|
<view class="myQuestion-2-i-3-l-1 myQuestion-2-i-3-l-1s" v-else>未解答</view>
|
|
|
|
<view class="myQuestion-2-i-3-l-t">{{d.tname}}</view>
|
|
|
|
</view>
|
|
|
|
<view class="myQuestion-2-i-3-r">
|
|
|
|
2023-12-11
|
|
|
|
{{d.answer_time || ''}}
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<u-loadmore :status="status" v-if="!notData"/>
|
|
|
|
<u-empty
|
|
|
|
v-if="notData"
|
|
|
|
mode="data"
|
|
|
|
text="暂无数据"
|
|
|
|
icon="/static/imagesV2/icon24.png"
|
|
...
|
...
|
@@ -117,36 +128,162 @@ |
|
|
|
return {
|
|
|
|
PAGETYPE,
|
|
|
|
type: PAGETYPE.CLASSROOM,
|
|
|
|
subjectList: [
|
|
|
|
{
|
|
|
|
title: '科目',
|
|
|
|
id: 1
|
|
|
|
}
|
|
|
|
],
|
|
|
|
basedOnList: [
|
|
|
|
{
|
|
|
|
title: '用户评价',
|
|
|
|
id: 1
|
|
|
|
}
|
|
|
|
]
|
|
|
|
keMu: {
|
|
|
|
list: [],
|
|
|
|
value: 0
|
|
|
|
},
|
|
|
|
// 分页
|
|
|
|
page: 1,
|
|
|
|
// 排序 asc-升序,desc-降序
|
|
|
|
sort: 'desc',
|
|
|
|
title: '',
|
|
|
|
list: [],
|
|
|
|
// 加载前值为loadmore,加载中为loading,没有数据为nomore
|
|
|
|
status: 'loadmore',
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
notData() {
|
|
|
|
return this.status === 'nomore' && !this.list.length
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
this.onRetry()
|
|
|
|
},
|
|
|
|
onReachBottom() {
|
|
|
|
debugger
|
|
|
|
this.getData()
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
this.getKeMuList();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toAnswerForm() {
|
|
|
|
// tab切换
|
|
|
|
switchItem(type) {
|
|
|
|
this.type = type;
|
|
|
|
this.onRetry();
|
|
|
|
},
|
|
|
|
// 科目选择修改
|
|
|
|
keMupickerChange(e) {
|
|
|
|
this.keMu.value = e.detail.value;
|
|
|
|
this.onRetry();
|
|
|
|
},
|
|
|
|
// 排序切换
|
|
|
|
sortChange() {
|
|
|
|
this.sort = this.sort === 'asc' ? 'desc' : 'asc';
|
|
|
|
this.onRetry();
|
|
|
|
},
|
|
|
|
confirm(e) {
|
|
|
|
this.title = e;
|
|
|
|
this.onRetry();
|
|
|
|
},
|
|
|
|
// 获取科目列表
|
|
|
|
getKeMuList() {
|
|
|
|
uni.showLoading({
|
|
|
|
title: '加载中',
|
|
|
|
mask: true
|
|
|
|
})
|
|
|
|
this.$service.P_get('/question/kemu').then(res => {
|
|
|
|
uni.hideLoading();
|
|
|
|
if (res.code == 1) {
|
|
|
|
this.keMu.list = [
|
|
|
|
'全部',
|
|
|
|
...res.data
|
|
|
|
];
|
|
|
|
}else {
|
|
|
|
if (res.msg) {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: res.msg
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: '获取数据失败'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch(e => {
|
|
|
|
uni.hideLoading()
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: '获取数据失败,请检查您的网络连接'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 列表分页初始化
|
|
|
|
onRetry(){
|
|
|
|
this.page= 1;
|
|
|
|
this.list = [];
|
|
|
|
this.status = 'loadmore';
|
|
|
|
this.getData()
|
|
|
|
},
|
|
|
|
// 获取数据
|
|
|
|
getData() {
|
|
|
|
if(this.status === 'loading' || this.status === 'nomore') return;
|
|
|
|
this.status = 'loading';
|
|
|
|
uni.showLoading({
|
|
|
|
title: '加载中',
|
|
|
|
mask: true
|
|
|
|
})
|
|
|
|
const { keMu, page, sort, type, title } = this;
|
|
|
|
|
|
|
|
let api = '';
|
|
|
|
if(type === PAGETYPE.CLASSROOM) {
|
|
|
|
api = '/question/all'
|
|
|
|
}else {
|
|
|
|
api = '/question/lecturer'
|
|
|
|
}
|
|
|
|
|
|
|
|
this.$service.P_get(api, {
|
|
|
|
page,
|
|
|
|
order_sort: sort,
|
|
|
|
sub_tilte: keMu.list[keMu.value] === '全部' || !keMu.list[keMu.value] ? '' : keMu.list[keMu.value],
|
|
|
|
title,
|
|
|
|
}).then(res => {
|
|
|
|
uni.hideLoading();
|
|
|
|
if (res.code == 1) {
|
|
|
|
this.page++;
|
|
|
|
this.list = [
|
|
|
|
...this.list,
|
|
|
|
...res.data.data
|
|
|
|
];
|
|
|
|
this.status = res.data.data.length < res.data.per_page ? 'nomore' : 'loadmore'
|
|
|
|
}else {
|
|
|
|
this.status = 'loadmore';
|
|
|
|
if (res.msg) {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: res.msg
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: '获取数据失败'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}).catch(e => {
|
|
|
|
this.status = 'loadmore';
|
|
|
|
uni.hideLoading()
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: '获取数据失败,请检查您的网络连接'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 提问
|
|
|
|
toAnswerForm(data) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pagesStu/answerForm/answerForm'
|
|
|
|
url: '/pagesStu/answerForm/answerForm?id=' + data.id
|
|
|
|
})
|
|
|
|
},
|
|
|
|
seeImg(index) {
|
|
|
|
seeImg(urls, current = 0) {
|
|
|
|
uni.previewImage({
|
|
|
|
current: index, // 当前显示图片的链接,不填则默认为 urls 的第一张图片
|
|
|
|
urls: this.info.imgs // 需要预览的图片链接列表
|
|
|
|
current, // 当前显示图片的链接,不填则默认为 urls 的第一张图片
|
|
|
|
urls // 需要预览的图片链接列表
|
|
|
|
})
|
|
|
|
},
|
|
|
|
toMyQuestion() {
|
|
...
|
...
|
@@ -158,18 +295,9 @@ |
|
|
|
let result = this.$refs.searchTopRef.getOtherHeight()
|
|
|
|
this.$refs.paddingTopBRef.setOtherHeight(result, 'px')
|
|
|
|
},
|
|
|
|
bindpickerChange(e) {
|
|
|
|
|
|
|
|
},
|
|
|
|
bindpickerChange2(e) {
|
|
|
|
|
|
|
|
},
|
|
|
|
switchItem(type) {
|
|
|
|
this.type = type
|
|
|
|
},
|
|
|
|
confirm(e) {
|
|
|
|
console.log(e)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
...
|
...
|
@@ -219,6 +347,9 @@ |
|
|
|
padding-right: 25rpx;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
.asc {
|
|
|
|
transform: scaleY(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.answer-2-r{
|
|
...
|
...
|
@@ -283,7 +414,8 @@ |
|
|
|
.answer-item-l-img{
|
|
|
|
height: 110rpx;
|
|
|
|
width: 110rpx;
|
|
|
|
border-radius: 200rpx;
|
|
|
|
border-radius: 50%;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.answer-item-r{
|
|
...
|
...
|
@@ -328,6 +460,7 @@ |
|
|
|
background-color: #FFFFFF;
|
|
|
|
box-sizing: border-box;
|
|
|
|
border-radius: 20rpx;
|
|
|
|
margin-bottom: 20rpx;
|
|
|
|
.myQuestion-2-i-1{
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
...
|
...
|
@@ -335,7 +468,8 @@ |
|
|
|
.myQuestion-2-i-1-l-i{
|
|
|
|
height: 60rpx;
|
|
|
|
width: 60rpx;
|
|
|
|
border-radius: 100%;
|
|
|
|
border-radius: 50%;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.myQuestion-2-i-1-r{
|
|
...
|
...
|
@@ -364,8 +498,10 @@ |
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
margin-top: 20rpx;
|
|
|
|
.myQuestion-2-i-3-l{
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
.myQuestion-2-i-3-l-1{
|
|
|
|
border-radius: 20rpx 20rpx 0px 20rpx;
|
|
|
|
height: 40rpx;
|
...
|
...
|
|