Commit ad703f68 authored by wangxuelai's avatar wangxuelai

''

parent 820ff9d1
import {
bulletGet
} from '../../service/common.js';
var app = getApp();
Component({
properties: {
},
data: {
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
},
created () {
},
ready () {
},
moved () {
},
pageLifetimes: {
show: function () {
},
hide: function () {
}
},
methods: {
bulletGet() {
let data = {
class_id: this.data.cid,
page: this.data.page,
perPage: this.data.perPage
}
if (this.data.tid) {
data.subject_id = this.data.tid;
}
bulletGet(data).then(res => {
const {data, code} = res;
if (code == 200) {
if (data.total) {
this.setData({
bulletTotal: data.total > this.data.perPage ? this.data.perPage : data.total
})
}
const bulletList = this.data.bulletList;
if (this.data.page == 1) {
this.setData({
bulletList: data.list
})
} else {
this.setData({
bulletList: bulletList.concat(data.list)
})
}
if (this.data.page == 1 && this.data.bulletTotal > 0) {
this.bulletPlay();
}
}
})
},
bulletPlay (type) { // 弹幕播放效果
const that = this;
// this.setData({
// addFade: true,
// })
this.setData({
current: 0,
currentBullet: this.data.bulletList[0],
})
this.timeOut = setInterval(() => {
that.data.current++;
if (this.data.current >= this.data.bulletTotal - 1) {
clearInterval(this.timeOut);
this.setData({
current: 0,
// bulletTotal: 0,
page: 1,
// bulletList: [],
currentBullet: {}
}, () => {
this.bulletPlay();
// this.bulletGet();
})
} else {
this.setData({
current: that.data.current,
currentBullet: this.data.bulletList[this.data.current],
})
}
}, 3000)
}
}
})
\ No newline at end of file
{
"component": true
}
\ No newline at end of file
<wxs src="../../filter/index.wxs" module="filter" />
<view class="sjd-bullet-box">
<view hover-class="none" hover-stop-propagation="false" wx:if="{{currentBullet.id}}">
<!-- 打卡的模板 -->
<!-- <view class="bullet-content {{addFade ? 'bulletfade' : ''}}" hover-class="none" hover-stop-propagation="false" wx:if="{{currentBullet.type == 1}}"> -->
<view class="bullet-content bulletfade" hover-class="none" hover-stop-propagation="false" wx:if="{{currentBullet.type == 1}}">
<image class="avator" src="{{currentBullet.info.avatar}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
<text class="nickname" selectable="false" space="false" decode="false">{{filter.nameSplice(currentBullet.info.nickname)}}</text>
<text class="time" selectable="false" space="false" decode="false">{{filter.bulletTimeCompare(currentBullet.created_at)}}</text>
<text class="action" selectable="false" space="false" decode="false">{{filter.actionFilter(currentBullet.type)}}</text>
</view>
<!-- 打卡的模板 -->
<!-- 评论的模板 -->
<!-- <view class="bullet-content {{addFade ? 'bulletfade' : ''}}" hover-class="none" hover-stop-propagation="false" wx:if="{{currentBullet.type == 2}}"> -->
<view class="bullet-content bulletfade" hover-class="none" hover-stop-propagation="false" wx:if="{{currentBullet.type == 2}}">
<!-- <image class="avator" wx:if="{{currentBullet.consumer_id == 0}}" src="{{currentBullet.member_user.avator}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image> -->
<image class="avator" src="{{currentBullet.info.avatar}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
<text class="nickname" selectable="false" space="false" decode="false">{{filter.nameSplice(currentBullet.info.nickname)}}</text>
<!-- <text class="nickname" wx:if="{{currentBullet.consumer_id > 0}}" selectable="false" space="false" decode="false">{{currentBullet.clock_circle_user && filter.nameSplice(currentBullet.clock_circle_user.remark) || filter.nameSplice(currentBullet.wechat_consumer.nickname)}}</text> -->
<text class="time" selectable="false" space="false" decode="false">{{filter.bulletTimeCompare(currentBullet.created_at)}}</text>
<text class="action" selectable="false" space="false" decode="false">{{filter.actionFilter(currentBullet.type)}}</text>
<text class="pnickname" selectable="false" space="false" decode="false">{{filter.nameSplice(currentBullet.info.record_user_nickname)}}的日记</text>
</view>
<!-- 评论的模板 -->
<!-- 老师点评的模板 -->
<!-- <view class="bullet-content {{addFade ? 'bulletfade' : ''}}" hover-class="none" hover-stop-propagation="false" wx:if="{{currentBullet.type == 3}}"> -->
<view class="bullet-content bulletfade" hover-class="none" hover-stop-propagation="false" wx:if="{{currentBullet.type == 3}}">
<image class="avator" src="{{currentBullet.info.avatar}}" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload=""></image>
<text class="nickname" selectable="false" space="false" decode="false">{{filter.nameSplice(currentBullet.info.nickname)}}</text>
<text class="time" selectable="false" space="false" decode="false">{{filter.bulletTimeCompare(currentBullet.created_at)}}</text>
<text class="action" selectable="false" space="false" decode="false">{{filter.actionFilter(currentBullet.type)}}</text>
<text class="pnickname" selectable="false" space="false" decode="false">{{filter.nameSplice(currentBullet.info.passive_nickname)}}的日记</text>
</view>
<!-- 老师点评的模板 -->
</view>
</view>
\ No newline at end of file
@keyframes bulletfade {
0% {
opacity: 0;
}
10% {
opacity: 0;
}
20% {
opacity: 1;
}
40% {
opacity: 1;
}
60% {
opacity: 0;
}
80% {
opacity: 0;
}
100% {
opacity: 0;
}
}
@-webkit-keyframes bulletfade {
0% {
opacity: 0;
}
10% {
opacity: 1;
}
20% {
opacity: 1;
}
40% {
opacity: 1;
}
60% {
opacity: 0;
}
80% {
opacity: 0;
}
100% {
opacity: 0;
}
}
/* @keyframes moveup {
from {
transform: translateY(0) scale(1);
-webkit-transform: translateY(0) scale(1);
}
to {
transform: translateY(100%) scale(1.01);
-webkit-transform: translateY(100%) scale(1.01);
}
} */
.sjd-bullet-box {
position: fixed;
top: 20rpx;
left: 20rpx;
z-index: 200;
color: #fff;
}
.bulletfade {
animation: bulletfade 3s linear infinite forwards;
}
.sjd-bullet-box .bullet-content {
background-color: rgba(0, 0, 0, 0.5);
display: flex;
display: -webkit-flex;
align-items: center;
justify-content: flex-start;
height: 60rpx;
padding: 0 15rpx 0 5rpx;
border-radius: 40rpx;
padding-right: 40rpx;
font-size: 14rpx;
}
.sjd-bullet-box .bullet-content .avator {
width: 50rpx;
height: 50rpx;
display: block;
border-radius: 50%;
margin-right: 20rpx;
}
.sjd-bullet-box .bullet-content .nickname {
padding-right: 20rpx
}
.sjd-bullet-box .bullet-content .time {
padding-right: 20rpx
}
\ No newline at end of file
......@@ -24,7 +24,7 @@
<go-top wx:if="{{backTopValue}}"></go-top>
<view class="videodialog" hover-class="none" hover-stop-propagation="false" wx:if="{{videostatus.videoShow}}">
<view class="videodialogmask" hover-class="none" hover-stop-propagation="false" bindtap="closeVideo"></view>
<video class="" src="{{filter.transformOssVideofy(videostatus.src)}}" id="{{videostatus.videoId}}" initial-time="0" autoplay="false" loop="false" muted="false" direction="0" bindplay="" bindpause="" bindended="" bindtimeupdate="" bindwaiting="" binderror=""
<video class="" src="{{filter.transformOssVideofy(videostatus.src)}}" id="{{videostatus.videoId}}" initial-time="0" autoplay="false" loop="false" direction="0" bindplay="" bindpause="" bindended="" bindtimeupdate="" bindwaiting="" binderror=""
bindfullscreenchange="screenchange">
</video>
</view>
......
......@@ -91,7 +91,10 @@ Page({
},
onShareAppMessage: function () { // return custom share data when user share.
return {
title: '打卡管家',
path: `/ucenter/index`
}
},
onPageScroll: function() { // Do something when page scroll
......
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