You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

465 lines
11 KiB

3 years ago
<template>
<view class="dabang-index">
<view class="top-box">
3 years ago
<view class="dabang-name">{{detail.studyListDto.listName}}</view>
<!-- <view class="desc">抱朴书院孕育自华夏优秀传统文化博学致用朴含虚为院训弘扬国粹利益社会为动力</view> -->
3 years ago
<view class="time-box">
3 years ago
<span>时间{{detail.studyListDto.listStartTime}} {{detail.studyListDto.listEndTime}}{{detail.studyListDto.clockTimes}}</span>
3 years ago
<view class="sanjiao"></view>
</view>
</view>
3 years ago
<view class="join-num">参与人数{{detail.enterNum}}</view>
3 years ago
<view class="my-progress-box">
<view class="t-word acea-row row-between-wrapper">
<text>我的进度</text>
<view>
<text class="to-more" @click="toMyBangdan">我的打榜日记</text>
<text class="iconfont icon-jiantou"></text>
</view>
</view>
<view class="progress-info-box acea-row-nowrap row-between">
<view class="acea-row">
<view class="user-headerimg">
3 years ago
<image :src="detail.avatar"></image>
3 years ago
</view>
<view class="user-progress">
3 years ago
<view class="name line1">{{detail.realName}}</view>
3 years ago
<view class="progress">
3 years ago
<view class="pro-icon"><image src="../../static/course-icon1.png" mode=""></image></view>
已坚持<text class="colO">{{detail.finishTimes}}</text>/{{detail.totalTimes}}
3 years ago
</view>
<view class="progress">
<view class="pro-icon"><image src="../../static/course-icon4.png" mode=""></image></view>
3 years ago
完成进度<text class="colO">{{(detail.progress*100).toFixed(2)}}</text>%
3 years ago
</view>
<view class="progress">
<view class="pro-icon"><image src="../../static/course-icon3.png" mode=""></image></view>
3 years ago
全榜排名<text class="colO">{{detail.rank}}</text>
3 years ago
</view>
</view>
</view>
<view class="progress-r acea-row row-column row-center-wrapper">
3 years ago
<text>{{detail.enterState ? '今日已打卡' : '今日未打卡'}}</text>
<view class="dabang-btn default" v-if="detail.enterState">已打卡</view>
3 years ago
<view class="dabang-btn default" v-if="detail.studyListDto.listState == 0">未开始</view>
<view class="dabang-btn" @click="toEdit" v-if="detail.studyListDto.isClockTime && !detail.enterState && detail.studyListDto.listState == 1">立即打卡</view>
<view class="dabang-btn default" v-if="!detail.studyListDto.isClockTime && !detail.enterState && detail.studyListDto.listState == 1">未开始</view>
3 years ago
</view>
</view>
</view>
<view class="tab-box acea-row row-middle">
3 years ago
<view class="tab-item" :class="active == 0 ? 'tab-item-a' : ''" @click="tabClick(0)">打卡分享</view>
3 years ago
<view class="tab-item" :class="active == 1 ? 'tab-item-a' : ''" @click="tabClick(1)">排行榜</view>
</view>
<!-- 打榜分享 -->
3 years ago
<view class="dabang-share-box" v-if="active == 0">
<view class="dabang-share-item" v-for="(item,index) in detail.studyListRecordDtos" :key="index">
3 years ago
<view class="user-info-box acea-row row-middle">
<view class="header-img">
3 years ago
<image :src="item.avatar" mode="aspectFill"></image>
3 years ago
</view>
<view class="acea-row row-column row-center">
3 years ago
<view class="name">{{item.realName}}</view>
<view class="create-time">{{item.recordTime}}</view>
3 years ago
</view>
</view>
3 years ago
<view class="share-word" :class="item.isShow == 0 ? 'line1' : ''">
3 years ago
{{item.content}}
</view>
3 years ago
<view class="img-box acea-row" v-if="item.isShow == 1">
3 years ago
<image :src="imgUrl" mode="aspectFill" @tap="previewImage(item.imgPaths,idx)" v-for="(imgUrl,idx) in item.imgPaths" :key="idx"></image>
</view>
<view class="zan-box acea-row row-middle row-right" @click="voteClick(item)">
<image src="../../static/zan.png" v-if="!item.isVote"></image>
<image src="../../static/like.png" v-else></image>
<text class="zan-conunt">{{item.voteNum}}</text>
3 years ago
</view>
3 years ago
</view>
</view>
<!-- 排行榜 -->
<view class="rank-list" v-if="active == 1">
<view class="rank-item acea-row row-between-wrapper" v-for="(item,index) in detail.memberIntegralRankVos" :key="index">
3 years ago
<view class="acea-row row-middle" style="width: 72%;">
3 years ago
<view class="rank-img" v-if="index == 0"><image src="../../static/num1.png" mode=""></image></view>
<view class="rank-img" v-if="index == 1"><image src="../../static/num2.png" mode=""></image></view>
<view class="rank-img" v-if="index == 2"><image src="../../static/num3.png" mode=""></image></view>
<view class="ranking" v-if="index > 2">{{index+1}}</view>
<view class="header-img"><image :src="item.headImg" mode=""></image></view>
3 years ago
<view class="name line1">{{item.realName}}</view>
3 years ago
</view>
3 years ago
<view class="acea-row row-column row-center-wrapper">
<view>完成打榜{{item.finishNum}}</view>
3 years ago
<view class="jifen">累计打榜{{item.counts}}</view>
3 years ago
</view>
</view>
</view>
3 years ago
3 years ago
</view>
</template>
<script>
3 years ago
import { myProgress , studyListVote} from '@/api/knowledge';
3 years ago
export default{
data(){
return {
3 years ago
active: 0,
studyId: '',
detail:{
enterNum: 0,
totalTimes: 0,
finishTimes: 0,
progress: 0,
rank: 0,
studyListRecordDtos:[],
memberIntegralRankVos:[],
}
3 years ago
}
},
3 years ago
onLoad() {
this.studyId = this.$yroute.query.id;
this.getProgress();
},
3 years ago
methods:{
3 years ago
previewImage(imgArr,idx) {
//预览图片
uni.previewImage({
urls: imgArr,
current: imgArr[idx]
});
},
getProgress(){
3 years ago
uni.showLoading({
title: "正在加载中..."
})
3 years ago
myProgress(this.studyId).then((res)=>{
if(res.success){
res.data.studyListDto.listStartTime = res.data.studyListDto.listStartTime.split(" ")[0];
res.data.studyListDto.listEndTime = res.data.studyListDto.listEndTime.split(" ")[0]
this.detail = res.data;
3 years ago
uni.hideLoading()
3 years ago
uni.stopPullDownRefresh();
}
})
},
voteClick(item){
let id = item.id,
voteNum = item.voteNum,
isVote = !item.isVote;
this.detail.studyListRecordDtos.map((item)=>{
if(item.id == id){
if(item.isVote){
item.voteNum = item.voteNum - 1
} else{
item.voteNum = item.voteNum + 1
}
item.isVote = !item.isVote
}
})
let data = {
"studylistRecordId": id,
"type": isVote ? '1' : '0'
}
studyListVote(data).then((res)=>{
if(res.success){
uni.showToast({
title: '操作成功!'
})
}
})
},
3 years ago
tabClick(idx){
this.active = idx;
},
toMyBangdan(){
this.$yrouter.push({
3 years ago
path:'/pages/study/bangdanRecord',
query:{
id: this.studyId
}
3 years ago
})
},
toEdit(){
this.$yrouter.push({
3 years ago
path:'/pages/study/editDabang',
query:{
id: this.studyId
}
3 years ago
})
},
3 years ago
onPullDownRefresh() {
this.getProgress();
}
3 years ago
}
}
</script>
<style lang="less" scoped>
.dabang-index{
min-height: 100vh;
background: #fff;
padding-bottom: 100rpx;
.top-box{
width: 100%;
3 years ago
height: 300rpx;
3 years ago
background: linear-gradient(135deg, #E5B964 0%, #CE9F45 100%);
box-sizing: border-box;
padding: 40rpx 0;
color: #fff;
position: relative;
.dabang-name{
width: 80%;
font-size: 50rpx;
font-weight: 600;
color: #FFFFFF;
line-height: 72rpx;
margin: 40rpx auto;
}
.desc{
width: 80%;
margin: 0 auto;
font-size: 24rpx;
color: #FFFFFF;
line-height: 36rpx;
text-indent: 2em;
}
.time-box{
width: 100%;
height: 78rpx;
line-height: 78rpx;
background: rgba(0,0,0,.1);
font-size: 28rpx;
position: absolute;
bottom: 0;
text-indent: 1em;
}
.sanjiao{
width:0;
height:0;
border-right:14rpx solid transparent;
border-left:14rpx solid transparent;
border-bottom:16rpx solid #fff;
position: absolute;
left: 50%;
top: 64rpx;
transform: translateX(-50%);
}
}
.join-num{
width: 406rpx;
height: 58rpx;
background: #FFF2DA;
border-radius: 46rpx;
margin: 30rpx auto;
text-align: center;
line-height: 58rpx;
color: #E49600;
}
.my-progress-box{
width: 100%;
box-sizing: border-box;
padding: 30rpx;
font-size: 36rpx;
color: #222;
.t-word{
font-size: 36rpx;
color: #222;
font-weight: 600;
.to-more{
font-size: 28rpx;
color: #666;
font-weight: normal;
}
.iconfont{
font-size: 30rpx;
}
}
.progress-info-box{
margin-top: 30rpx;
width: 690rpx;
height: 280rpx;
background: #FFFFFF;
box-shadow: 0px 4px 8px 0px rgba(239,239,239,0.5);
border-radius: 10rpx;
3 years ago
padding: 30rpx 0;
3 years ago
.user-headerimg{
width: 130rpx;
height: 130rpx;
margin-right: 20rpx;
image{
width: 100%;
height: 100%;
border-radius: 50px;
}
}
.user-progress{
font-size: 28rpx;
.name{
3 years ago
width: 340rpx;
3 years ago
font-size: 32rpx;
font-weight: 500;
color: #222222;
line-height: 44rpx;
}
.colO{
3 years ago
// font-size: 40rpx;
font-weight: bold;
3 years ago
color: #F36F5E;
}
.progress{
display: flex;
align-items: center;
3 years ago
margin-top: 10rpx;
3 years ago
.pro-icon{
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
image{
width: 100%;
height: 100%;
}
}
}
}
.progress-r{
font-size: 24rpx;
color: #666;
.dabang-btn{
width: 160rpx;
height: 56rpx;
background: linear-gradient(180deg, #F7D08E 0%, #E2B35D 100%);
border-radius: 35rpx;
text-align: center;
line-height: 56rpx;
color: #fff;
font-size: 28rpx;
margin-top: 10rpx;
}
3 years ago
.default{
background: #999;
}
3 years ago
}
}
}
.tab-box{
width: 100%;
padding: 0rpx 30rpx;
font-size: 36rpx;
color: #222;
.tab-item{
width: 50%;
text-align: center;
border-bottom: 1px solid #ECECEC;
padding: 20rpx 0;
}
.tab-item-a{
color: #EA533E;
3 years ago
font-weight: bold;
3 years ago
border-bottom: 1px solid #EA533E;
}
}
.rank-list{
width: 100%;
padding: 0rpx 30rpx;
.rank-item{
width: 100%;
padding: 32rpx 0;
border-bottom: 1px solid #ececec;
font-size: 28rpx;
color: #222;
.ranking{
3 years ago
width: 50rpx;
height: 50rpx;
3 years ago
border-radius: 50%;
3 years ago
line-height: 50rpx;
3 years ago
text-align: center;
3 years ago
color: #EA533E;
font-size: 34rpx;
// background: #EA533E;
}
3 years ago
.name{
3 years ago
width: 60%;
3 years ago
}
3 years ago
.rank-img{
width: 50rpx;
height: 50rpx;
image{
width: 100%;
height: 100%;
}
3 years ago
}
.header-img{
width: 82rpx;
height: 82rpx;
border-radius: 50px;
overflow: hidden;
margin: 0 30rpx 0 22rpx;
}
.jifen{
color: #E5B764;
}
}
}
.dabang-share-box{
width: 100%;
padding: 30rpx;
.dabang-share-item{
color: #222;
padding:20rpx 0;
border-bottom: 1px solid #ececec;
.header-img{
width: 76rpx;
height: 76rpx;
border-radius: 50%;
overflow: hidden;
margin-right: 10rpx;
}
.name{
font-size: 28rpx;
line-height: 40rpx;
}
.create-time{
font-size: 24rpx;
color: #999;
line-height: 34rpx;
}
.share-word{
font-size: 28rpx;
line-height: 46rpx;
margin: 22rpx 0 30rpx;
}
.img-box{
3 years ago
3 years ago
image{
3 years ago
width: 222rpx;
3 years ago
height: 206rpx;
3 years ago
margin-right: 10rpx;
margin-bottom: 10rpx;
border-radius: 10rpx;
}
image:nth-child(3n){
margin-right: 0;
3 years ago
}
}
.zan-box{
margin-top: 20rpx;
image{
width: 30rpx;
height: 32rpx;
margin-right: 20rpx;
}
}
}
}
image{
width: 100%;
height: 100%;
}
}
</style>