Merge branch 'master-xie'

This commit is contained in:
@fawn-nine
2023-09-22 11:17:28 +08:00
2 changed files with 418 additions and 284 deletions

View File

@@ -2,6 +2,11 @@
<view :class="['container', currentDay == linshiDay && taskInfo.id && myword.length == 0 ? 'pb100':'']"> <view :class="['container', currentDay == linshiDay && taskInfo.id && myword.length == 0 ? 'pb100':'']">
<z-nav-bar title="读书打卡"></z-nav-bar> <z-nav-bar title="读书打卡"></z-nav-bar>
<!-- 仿钉钉打卡日历组件 --> <!-- 仿钉钉打卡日历组件 -->
<view class=""
style="padding: 10rpx 20rpx; border-radius: 10rpx; margin-bottom: 20rpx; background-color: #fff; font-size: 24rpx;">
<text>正在参与<em @click="gotoDetail"
style="font-style: normal; font-weight: bold; color: #55aa7f; padding: 10rpx;">{{bookInfo.name}}</em>的打卡任务</text>
</view>
<view class="calendar_container"> <view class="calendar_container">
<!-- <zsy-calendar @change="change" /> --> <!-- <zsy-calendar @change="change" /> -->
<!-- <clock-date></clock-date> --> <!-- <clock-date></clock-date> -->
@@ -12,10 +17,12 @@
<text>返回今天</text> <text>返回今天</text>
</view> </view>
<!-- <u-icon name="checkbox-mark" color="#55aa7f" size="14" style="display: inline;"></u-icon> --> <!-- <u-icon name="checkbox-mark" color="#55aa7f" size="14" style="display: inline;"></u-icon> -->
<view class="dakaBtn" @tap="buSign()" v-if="signList.indexOf(currentDay) == -1 && currentDay > linshiDay"> <view class="dakaBtn" @tap="buSign()"
v-if="signList.indexOf(currentDay) == -1 && currentDay > linshiDay">
<text style="font-size: 24rpx;">补卡</text> <text style="font-size: 24rpx;">补卡</text>
</view> </view>
<view class="dakaBtn" @tap="kuickSign()" v-if="signList.indexOf(currentDay) == -1 && currentDay == linshiDay"> <view class="dakaBtn" @tap="kuickSign()"
v-if="signList.indexOf(currentDay) == -1 && currentDay == linshiDay">
<text style="font-size: 24rpx;">签到</text> <text style="font-size: 24rpx;">签到</text>
</view> </view>
<!-- <view v-else class="dakaBtn" style="border-color: #fff;"> <!-- <view v-else class="dakaBtn" style="border-color: #fff;">
@@ -23,19 +30,21 @@
</view> --> </view> -->
</view> </view>
</view> </view>
<swiper class="swiper scroll-view_H" @animationfinish="animationfinish" @change="swiperChange" :current='currentIndex' :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" <swiper class="swiper scroll-view_H" @animationfinish="animationfinish" @change="swiperChange"
:current='currentIndex' :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
:duration="duration"> :duration="duration">
<swiper-item v-for="(item,index) in dayList" :key="index" class="flexbox swiperPage"> <swiper-item v-for="(item,index) in dayList" :key="index" class="flexbox swiperPage">
<!-- <view class="swiper-item item" v-for="(item1,index1) in item" :key=""><span class="day"> <em>{{item1}}</em> </span></view> --> <!-- <view class="swiper-item item" v-for="(item1,index1) in item" :key=""><span class="day"> <em>{{item1}}</em> </span></view> -->
<view v-for="(item1,index1) in item" :key="index1" <view v-for="(item1,index1) in item" :key="index1" :class="['item','swiper-item', signList.indexOf(item1) != -1 ? 'havSign' : '',
:class="['item','swiper-item', signList.indexOf(item1) != -1 ? 'havSign' : '',
currentDay == item1 && signList.indexOf(item1) == -1 ? 'current' : '', currentDay == item1 && signList.indexOf(item1) == -1 ? 'current' : '',
linshiDay == item1 ? 'linshiDay':'']" @click="getInfo(item1)"> linshiDay == item1 ? 'linshiDay':'']" @click="getInfo(item1)">
<span class="day"><em>{{item1}}</em> </span> <span class="day"><em>{{item1}}</em> </span>
<u-icon v-if="signList.indexOf(item1) != -1" name="checkbox-mark" color="#fff" size="28" style="margin: 0 auto; width: 28px; text-align: center;"></u-icon> <u-icon v-if="signList.indexOf(item1) != -1" name="checkbox-mark" color="#fff" size="28"
style="margin: 0 auto; width: 28px; text-align: center;"></u-icon>
<span v-if="signList.indexOf(item1) == -1 && currentDay > item1" class="buka">未签</span> <span v-if="signList.indexOf(item1) == -1 && currentDay > item1" class="buka">未签</span>
<span v-if="currentDay < item1" class="weidaka">未开始</span> <span v-if="currentDay < item1" class="weidaka">未开始</span>
<span v-if="currentDay == item1 && signList.indexOf(item1) == -1" class="daka" @click="kuickSign()">签到</span> <span v-if="currentDay == item1 && signList.indexOf(item1) == -1" class="daka"
@click.stop="kuickSign()">签到</span>
</view> </view>
</swiper-item> </swiper-item>
</swiper> </swiper>
@@ -48,14 +57,14 @@
<view class="video " v-if="taskInfo.video"> <view class="video " v-if="taskInfo.video">
<!-- 视频形式的任务 --> <!-- 视频形式的任务 -->
<view class="taskinfo"> <view class="taskinfo">
<video id="myVideo" :poster="poster" v-show="!addTextShow" <video id="myVideo" :poster="poster" v-show="!addTextShow" :src="taskInfo.video"
:src="taskInfo.video"
@error="videoErrorCallback" controls></video> @error="videoErrorCallback" controls></video>
</view> </view>
</view> </view>
<view class="image " v-if="taskInfo.images"> <view class="image " v-if="taskInfo.images">
<!-- 图片形式的任务 --> <!-- 图片形式的任务 -->
<image :src="taskInfo.images" @click="previewImage(taskInfo.images)" style="width: 100%;" mode="aspectFit"></image> <image :src="taskInfo.images" @click="previewImage(taskInfo.images)" style="width: 100%;"
mode="aspectFit"></image>
</view> </view>
<view class="txt" v-if="taskInfo.content" v-html="taskInfo.content"></view> <view class="txt" v-if="taskInfo.content" v-html="taskInfo.content"></view>
</view> </view>
@@ -73,11 +82,13 @@
</view> </view>
<view class="pjimgs flexbox"> <view class="pjimgs flexbox">
<view class="item" v-for="(item1,index) in item.clockinimages"> <view class="item" v-for="(item1,index) in item.clockinimages">
<image v-if="item1.length > 10" @click="previewImage(item1)" :src="item1" mode="aspectFill" style="width:100%; height: 50px;"></image> <image v-if="item1.length > 10" @click="previewImage(item1)" :src="item1"
mode="aspectFill" style="width:100%; height: 50px;"></image>
</view> </view>
</view> </view>
<view class="opBtns flexbox"> <view class="opBtns flexbox">
<span class="flexbox"><u-icon name="clock" color="#b3b3b3"></u-icon>{{item.createTime}}</span> <span class="flexbox"><u-icon name="clock"
color="#b3b3b3"></u-icon>{{item.createTime}}</span>
</view> </view>
</view> </view>
</view> </view>
@@ -95,7 +106,8 @@
<view class="contentBox"> <view class="contentBox">
<div class="pjimgs flexbox"> <div class="pjimgs flexbox">
<view class="item" v-for="(item1,index) in item.images"> <view class="item" v-for="(item1,index) in item.images">
<image v-if="item1.length > 10" @click="previewImage(item1)" :src="item1" mode="aspectFill" style="width:100%; height: 50px;"></image> <image v-if="item1.length > 10" @click="previewImage(item1)" :src="item1"
mode="aspectFill" style="width:100%; height: 50px;"></image>
</view> </view>
</div> </div>
@@ -153,7 +165,8 @@
</view> </view>
</u-popup> </u-popup>
<view class="leaveBtn" v-if="!addTextShow && currentDay == linshiDay && taskInfo.id && myword.length == 0"> <view class="leaveBtn" v-if="!addTextShow && currentDay == linshiDay && taskInfo.id && myword.length == 0">
<button style="height: 70rpx; font-size: 28rpx; line-height: 70rpx;" type="primary" plain="true" @click="addTextShow = true">说点什么</button> <button style="height: 70rpx; font-size: 28rpx; line-height: 70rpx;" type="primary" plain="true"
@click="addTextShow = true">说点什么</button>
</view> </view>
<music-play :playData="playData"></music-play> <music-play :playData="playData"></music-play>
<!-- <z-navigation></z-navigation> --> <!-- <z-navigation></z-navigation> -->
@@ -202,6 +215,7 @@
windowHeight: 500, windowHeight: 500,
isShowEmj: false, isShowEmj: false,
playData: {}, playData: {},
bookInfo: {}, // 书籍信息
videoContext: null, videoContext: null,
innerAudioContext: null, // 音频对象 innerAudioContext: null, // 音频对象
poster: '', poster: '',
@@ -235,9 +249,11 @@
onLoad(e) { onLoad(e) {
this.bookid = e.bookid this.bookid = e.bookid
this.windowWidth = uni.getSystemInfoSync().windowWidth; this.windowWidth = uni.getSystemInfoSync().windowWidth;
},
onShow() {
this.getBookInfo()
this.initDay() this.initDay()
this.getmySign() this.getmySign()
}, },
onReady() { onReady() {
this.videoContext = uni.createVideoContext('myVideo') this.videoContext = uni.createVideoContext('myVideo')
@@ -248,6 +264,27 @@
...mapState(['userInfo']) ...mapState(['userInfo'])
}, },
methods: { methods: {
// 获取书籍信息
getBookInfo() {
this.$http
.post('book/book/appinfo/' + this.bookid + '/' + this.userInfo.id)
.then(res => {
if (res.code == 0) {
console.log(res, 'res')
this.bookInfo = res.book
} else {
console.log(res.msg)
}
console.log(res, 'res基本信息')
}).catch((error) => {
console.log(error)
})
},
gotoDetail() {
uni.navigateTo({
url: '../eBook/bookContent?Id=' + this.bookInfo.id
});
},
swiperChange(e) { swiperChange(e) {
console.log(e, 'change') console.log(e, 'change')
}, },
@@ -329,7 +366,8 @@
// 获取当天我的发布内容 // 获取当天我的发布内容
getmyWord() { getmyWord() {
this.$http this.$http
.post('book/clockin/myinfolist?userid='+this.userInfo.id+'&taskid='+ this.taskInfo.id + '&bookid='+this.bookid) .post('book/clockin/myinfolist?userid=' + this.userInfo.id + '&taskid=' + this.taskInfo.id +
'&bookid=' + this.bookid)
.then(res => { .then(res => {
console.log(res, '当天我的打卡内容') console.log(res, '当天我的打卡内容')
if (res.code == 0 && res.productlist.length > 0) { if (res.code == 0 && res.productlist.length > 0) {
@@ -419,7 +457,8 @@
console.log(res, '任务信息') console.log(res, '任务信息')
if (res.page.list.length > 0) { if (res.page.list.length > 0) {
this.taskInfo = res.page.list[0] this.taskInfo = res.page.list[0]
this.taskInfo.video != ''? this.poster = this.taskInfo.video + "?x-oss-process=video/snapshot,t_0,f_jpg" : '' this.taskInfo.video != '' ? this.poster = this.taskInfo.video +
"?x-oss-process=video/snapshot,t_0,f_jpg" : ''
this.getmyWord() this.getmyWord()
this.getAllSign(this.taskInfo) this.getAllSign(this.taskInfo)
} else { } else {
@@ -438,7 +477,7 @@
console.log('正在补卡', this.taskInfo) console.log('正在补卡', this.taskInfo)
if (!this.taskInfo.id) { if (!this.taskInfo.id) {
uni.showToast({ uni.showToast({
title:'当天未发布打卡任务', title: '当天未发布打卡任务,不可补卡哦',
icon: 'none' icon: 'none'
}) })
return return
@@ -474,6 +513,14 @@
}, },
// 快捷签到 // 快捷签到
kuickSign() { kuickSign() {
if (!this.taskInfo.id) {
uni.showToast({
title: '当天未发布打卡任务,不可签到哦',
icon: 'none'
})
return false
}
let data = { let data = {
"bookId": this.bookid, "bookId": this.bookid,
"userId": this.userInfo.id, "userId": this.userInfo.id,
@@ -491,8 +538,10 @@
if (res.code == 0) { if (res.code == 0) {
//console.log(res, '快捷签到') //console.log(res, '快捷签到')
uni.showToast({ uni.showToast({
title:'签到成功' title: '签到成功',
icon: 'success'
}) })
return false
this.addTextShow = false this.addTextShow = false
this.formData.content = '' this.formData.content = ''
this.formData.images = [] this.formData.images = []
@@ -501,6 +550,7 @@
} }
}); });
}, },
// 说点什么 // 说点什么
goToSign() { goToSign() {
@@ -665,23 +715,76 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.pjimgs{ margin: 10px 0;flex-wrap: wrap; display: flex; .pjimgs {
.item{width: 23%; margin-right: 10px; margin: 10px 0;
flex-wrap: wrap;
display: flex;
.item {
width: 23%;
margin-right: 10px;
image {} image {}
} }
} }
.contentBox{width: calc(100% - 50px);box-sizing: border-box; padding-left: 20rpx;
.content{font-size: 28rpx; line-height: 40rpx;} .contentBox {
.time{font-size: 24rpx; color: #999; margin-top: 6rpx; float: right;} width: calc(100% - 50px);
box-sizing: border-box;
padding-left: 20rpx;
.content {
font-size: 28rpx;
line-height: 40rpx;
} }
.touxiang{width:50px; overflow: hidden; text-align: center;
image{width:50px !important; padding: 3px; height: 50px !important; border: 1px solid #eee; border-radius: 64px; overflow: hidden;;} .time {
.username{font-size: 24rpx; color: #999; margin-top: 6rpx; } font-size: 24rpx;
color: #999;
margin-top: 6rpx;
float: right;
} }
.allComments{ background-color: #fff; margin-top: 20rpx; padding: 20rpx; } }
.quesheng{text-align: center; margin-top: 100rpx; color: #8b8a91;}
.haveSignText{color: #999 ;} .touxiang {
width: 50px;
overflow: hidden;
text-align: center;
image {
width: 50px !important;
padding: 3px;
height: 50px !important;
border: 1px solid #eee;
border-radius: 64px;
overflow: hidden;
;
}
.username {
font-size: 24rpx;
color: #999;
margin-top: 6rpx;
}
}
.allComments {
background-color: #fff;
margin-top: 20rpx;
padding: 20rpx;
}
.quesheng {
text-align: center;
margin-top: 100rpx;
color: #8b8a91;
}
.haveSignText {
color: #999;
}
.calendar_info { .calendar_info {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -699,7 +802,9 @@
border: #55aa7f 1px solid; border: #55aa7f 1px solid;
border-radius: 10rpx; border-radius: 10rpx;
} }
.fanhuiDay{ margin-right: 20rpx;
.fanhuiDay {
margin-right: 20rpx;
// height: 52rpx; // height: 52rpx;
font-size: 24rpx; font-size: 24rpx;
// line-height: 52rpx; // line-height: 52rpx;
@@ -713,10 +818,17 @@
.scroll-view_H { .scroll-view_H {
white-space: nowrap; white-space: nowrap;
margin: 8rpx 0; height: 120rpx !important; margin: 8rpx 0;
height: 120rpx !important;
width: 100%; width: 100%;
.swiperPage{ justify-content: space-between; height: 120rpx !important;}
.item { box-sizing: border-box; .swiperPage {
justify-content: space-between;
height: 120rpx !important;
}
.item {
box-sizing: border-box;
width: calc(20% - 12rpx) !important; width: calc(20% - 12rpx) !important;
border: 1px dashed #999; border: 1px dashed #999;
height: 120rpx; height: 120rpx;
@@ -728,7 +840,8 @@
border-radius: 20rpx; border-radius: 20rpx;
padding: 12rpx; padding: 12rpx;
.day {display: block; .day {
display: block;
font-size: 26rpx; font-size: 26rpx;
color: #999; color: #999;
@@ -746,13 +859,15 @@
.buka { .buka {
font-size: 24rpx; font-size: 24rpx;
display: inline-block; padding: 0 12rpx; display: inline-block;
padding: 0 12rpx;
color: #888; color: #888;
// border: 1px solid #888; // border: 1px solid #888;
margin: 10px 0; margin: 10px 0;
border-radius: 20rpx; border-radius: 20rpx;
margin-bottom: 0; ; margin-bottom: 0;
;
} }
.weidaka { .weidaka {
@@ -763,9 +878,11 @@
margin-bottom: 0; margin-bottom: 0;
display: block; display: block;
} }
.daka { .daka {
font-size: 24rpx; font-size: 24rpx;
display: inline-block; padding: 0 6rpx; display: inline-block;
padding: 0 6rpx;
border: 1px solid #55aaff; border: 1px solid #55aaff;
color: #55aaff; color: #55aaff;
margin: 10px 0; margin: 10px 0;
@@ -787,6 +904,7 @@
.day { .day {
font-size: 26rpx; font-size: 26rpx;
color: #fff; color: #fff;
em { em {
font-size: 30rpx; font-size: 30rpx;
font-style: normal; font-style: normal;
@@ -799,6 +917,7 @@
display: block; display: block;
} }
} }
.item.current { .item.current {
border: 1px solid #55aaff; border: 1px solid #55aaff;
@@ -811,6 +930,7 @@
.day { .day {
font-size: 26rpx; font-size: 26rpx;
color: #55aaff; color: #55aaff;
em { em {
font-size: 30rpx; font-size: 30rpx;
font-style: normal; font-style: normal;
@@ -819,10 +939,13 @@
} }
} }
} }
.item.linshiDay { .item.linshiDay {
.daka { .daka {
color: #fff; border-color:#fff; color: #fff;
border-color: #fff;
} }
border: 1px solid #55aaff; border: 1px solid #55aaff;
text-align: center; text-align: center;
@@ -830,9 +953,11 @@
background-color: #55aaff; background-color: #55aaff;
border-radius: 20rpx; border-radius: 20rpx;
padding: 6px 6px; padding: 6px 6px;
.day { .day {
font-size: 26rpx; font-size: 26rpx;
color: #fff; color: #fff;
em { em {
font-size: 32rpx; font-size: 32rpx;
font-style: normal; font-style: normal;
@@ -840,7 +965,10 @@
padding-right: 2px; padding-right: 2px;
} }
} }
.buka{color: #fff; }
.buka {
color: #fff;
}
} }
} }
@@ -902,13 +1030,16 @@
} }
.clockTitle { .clockTitle {
color: #55aa7f; color: #55aa7f;
font-size: 38rpx; font-size: 38rpx;
text-align: center; text-align: center;
display: block; display: block;
margin-top: 30rpx; margin-bottom: 30rpx; margin-top: 30rpx;
margin-bottom: 30rpx;
} }
.container1 { .container1 {
.margin-top { .margin-top {
margin-top: 30rpx; margin-top: 30rpx;
@@ -1027,6 +1158,12 @@
.flexbox { .flexbox {
display: flex; display: flex;
} }
.mb50{margin-bottom: 50rpx;}
.pb100{padding-bottom: 100rpx;} .mb50 {
margin-bottom: 50rpx;
}
.pb100 {
padding-bottom: 100rpx;
}
</style> </style>

View File

@@ -8,11 +8,11 @@
<view class="wrap" > <view class="wrap" >
<u-row gutter="16" justify="flex-start"> <u-row gutter="16" justify="flex-start">
<u-col span="4" v-for="(item,index) in bookList" :key="index"> <u-col span="4" v-for="(item,index) in bookList" :key="index">
<view class="videoBox demo-layout bg-purple" @click="goToClock(item.book)"> <view class="videoBox demo-layout bg-purple" @click="goToClock(item)">
<image v-if="item.book.images != ''" :src="item.book.images" mode="scaleToFill" ></image> <image v-if="item.images != ''" :src="item.images" mode="scaleToFill" ></image>
<image v-else src="../../static/icon/wufeng.jpg" mode="scaleToFill" ></image> <image v-else src="../../static/icon/wufeng.jpg" mode="scaleToFill" ></image>
</view> </view>
<text class="bookName">{{item.book.name}}</text> <text class="bookName">{{item.name}}</text>
</u-col> </u-col>
</u-row> </u-row>
</view> </view>
@@ -66,19 +66,16 @@
// 获取打卡图书 // 获取打卡图书
getfreeBook(){ getfreeBook(){
this.$http this.$http
.post('book/userebookbuy/appbooklist', { .post('book/userebookbuy/getUserClockBookList', { // 磊哥新写
// .post('book/userebookbuy/buylist', { // .post('book/userebookbuy/appbooklist', { 原接口
// .post('book/buyorderdetail/querybuy', {
'userId': this.userInfo.id, 'userId': this.userInfo.id,
// 'page':this.page,
// 'limit':100
}) })
.then(res => { .then(res => {
if(res.code == 0){ if(res.code == 0){
//this.ygtotalPage = res.resultlist.totalCount //this.ygtotalPage = res.resultlist.totalCount
this.bookList = res.resultlist this.bookList = res.books
console.log(res,'已购买') console.log(this.bookList,'打卡列表')
this.status = 3 // this.status = 3
} }
}); });
@@ -124,7 +121,7 @@
height: 350rpx; height: 350rpx;
} }
.u-row{flex-wrap: wrap;} .u-row{flex-wrap: wrap;}
.u-col{overflow: hidden; height: 250px; margin-bottom: 30rpx; } .u-col{overflow: hidden; margin-bottom: 30rpx; }
.listenList{padding: 10rpx; box-sizing: border-box; width: calc(100% - 10rpx);} .listenList{padding: 10rpx; box-sizing: border-box; width: calc(100% - 10rpx);}
.flexbox{display: flex;} .flexbox{display: flex;}
.scroll-Y { .scroll-Y {