Commit 8ece89e1 authored by wangxuelai's avatar wangxuelai

Merge remote-tracking branch 'origin/lvtz_clock' into wxl-user-optimize

parents d0f6e9db 5fdb4066
import {
bulletGet
} from '../../service/common.js';
var app = getApp();
Component({
properties: {
cid: { // 圈子id
type: Number,
value: 0
},
tid: { // 主题id
type: Number,
value: 0
}
},
data: {
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
page: 1,
perPage: 100,
bulletList: [],
bulletTotal: 0,
current: 0,
currentBullet: {
},
addFade: true
},
created () {
},
ready () {
},
moved () {
this.setData({
bulletTotal: 0,
current: 0,
page: 1,
perPage: 100,
bulletList: []
})
clearInterval(this.timeOut);
},
pageLifetimes: {
show: function () {
this.bulletGet()
},
hide: function () {
this.setData({
bulletTotal: 0,
current: 0,
page: 1,
perPage: 100,
bulletList: []
})
clearInterval(this.timeOut);
}
},
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 wx:if="{{currentBullet.id}}">
<!-- 打卡的模板 -->
<!-- <view class="bullet-content {{addFade ? 'bulletfade' : ''}}" wx:if="{{currentBullet.type == 1}}"> -->
<view class="bullet-content bulletfade" wx:if="{{currentBullet.type == 1}}">
<image class="avator" src="{{filter.imagify(currentBullet.info.avatar, 'image/resize,w_160/format,jpg')}}" 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' : ''}}" wx:if="{{currentBullet.type == 2}}"> -->
<view class="bullet-content bulletfade" 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="{{filter.imagify(currentBullet.info.avatar, 'image/resize,w_160/format,jpg')}}" 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' : ''}}" wx:if="{{currentBullet.type == 3}}"> -->
<view class="bullet-content bulletfade" wx:if="{{currentBullet.type == 3}}">
<image class="avator" src="{{filter.imagify(currentBullet.info.avatar, 'image/resize,w_160/format,jpg')}}" 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
import {
bulletGet,
courseGalleryCommentPost,
} from '../../service/common.js';
......
......@@ -47,7 +47,6 @@ const apis = {
generateBusinessQrcode: `${api}common/qr_code_unlimit`,
generateCustomerQrcode: `${api}common/qr_code_unlimit`,
updateUserinfo: `${api}consumer/clock/userinfo/edit`,
bulletGet: `${api}common/bullet_screens`,
// screenShot: `${api}common/wechat/clock_qrcode`,
screenShot: `https://wx.shangjiadao.com/v2/api/service/activity/screenshot`,
posterLog: `${api}consumer/clock/poster/log`,
......
......@@ -63,14 +63,6 @@ function updateUserinfo(data) {
errorresolve: 1,
})
}
function bulletGet(data) {
return wxRequest({
url: apis.customer.common.bulletGet,
data,
method: 'GEt',
errorresolve: 1,
})
}
function clockSs(data) {
return wxRequest({
url: apis.customer.common.clockSs,
......@@ -511,7 +503,6 @@ export {
generateCustomerQrcode,
generateBusinessQrcode,
updateUserinfo,
bulletGet,
posterLog,
lastReply,
clockSs,
......
......@@ -10,7 +10,6 @@
"remark-editor": "../../components/remarkeditor",
"psd-editor": "../../components/psdeditor",
"poster-box": "../../../components/posterbox",
"sjd-bullet": "../../../components/bullet",
"sjd-contact": "../../../components/contact",
"go-top": "../../../components/goTop",
"list-loading": "../../../components/listloading",
......
......@@ -191,10 +191,10 @@ Page({
sid: data.school_id,
id: data.class_id,
contentLimit: {
text: data.text_require_status == 0 ? 0 : data.text_require_num,
video: data.video_require_status == 0 ? 0 : data.video_require_num,
img: data.image_require_status == 0 ? 0 : data.image_require_num,
audio: data.audio_require_status == 0 ? 0 : data.audio_require_num,
text: data.text_require_status == 2 ? 0 : data.text_require_num,
video: data.video_require_status == 2 ? 0 : data.video_require_num,
img: data.image_require_status == 2 ? 0 : data.image_require_num,
audio: data.audio_require_status == 2 ? 0 : data.audio_require_num,
}
}, () => {
console.log(this.data.themeDetail.content.length,'content')
......
......@@ -11,7 +11,6 @@
"remark-editor": "../../components/remarkeditor",
"psd-editor": "../../components/psdeditor",
"poster-box": "../../../components/posterbox",
"sjd-bullet": "../../../components/bullet",
"sjd-contact": "../../../components/contact",
"go-top": "../../../components/goTop",
"list-loading": "../../../components/listloading",
......
......@@ -9,7 +9,6 @@
"remark-editor": "../../components/remarkeditor",
"psd-editor": "../../components/psdeditor",
"poster-box": "../../../components/posterbox",
"sjd-bullet": "../../../components/bullet",
"sjd-contact": "../../../components/contact",
"go-top": "../../../components/goTop",
"list-loading": "../../../components/listloading",
......
......@@ -9,7 +9,6 @@
"remark-editor": "../../components/remarkeditor",
"psd-editor": "../../components/psdeditor",
"poster-box": "../../../components/posterbox",
"sjd-bullet": "../../../components/bullet",
"sjd-contact": "../../../components/contact",
"go-top": "../../../components/goTop",
"list-loading": "../../../components/listloading",
......
......@@ -9,7 +9,6 @@
"remark-editor": "../../components/remarkeditor",
"psd-editor": "../../components/psdeditor",
"poster-box": "../../../components/posterbox",
"sjd-bullet": "../../../components/bullet",
"sjd-contact": "../../../components/contact",
"go-top": "../../../components/goTop",
"list-loading": "../../../components/listloading",
......
......@@ -13,14 +13,11 @@
<view class="shadow-box"></view>
<view class="title-box">
<view class="title">{{themeSelect.title}}</view>
<view class="time">老师 {{themeSelect.created_at}} 发布</view>
<view class="time">{{themeSelect.subject_creator.nickname}} {{themeSelect.homework_set.publish_time}} 发布</view>
</view>
</view>
<!-- wx:if="{{!noUser && auditStatus == 3"> -->
<view class="instro-bx" wx:if="{{themeSelect.content.length>0}}">
<!-- <view class="title-box">
<view class="title">介绍</view>
</view> -->
<view class="media-box">
<sjd-media-show
actionsPalyvalue="{{actPalyaudioValue}}"
......@@ -186,11 +183,6 @@
<view class='poste_box' id='canvas-container' wx:if="{{canvasShow}}">
<canvas canvas-id="myCanvas" style="width:100%;height:1334rpx;" />
</view>
<!-- <sjd-bullet
cid="{{id}}"
tid="{{tid}}"
>
</sjd-bullet> -->
<sjd-contact wx:if="{{concatDiaShow}}" address="{{circleInfo.clock_address}}" bind:closecontact="closecontact">
</sjd-contact>
<!-- <prize-get wx-if="{{adGetShow}}" bind:closeAdModal="closeAdModal" adInfo="{{adInfo}}" circleid="{{id}}">
......
......@@ -152,6 +152,7 @@ Page({
signStudentsTotal: 0,
signStudentsList: [],
secret: '',//加入的密码
studentMobile: "" //手机号
},
onLoad: function(options, b) {
......@@ -839,7 +840,6 @@ Page({
// 去打卡
goClock(e) {
// 先授权
const visitor = LocalStorage.getItem("visitor");
console.log(this.data.themeSelect.is_join, "是佛加入");
if (this.data.themeSelect.is_join != 1) {
if(this.data.themeSelect.join_rule_type==3){
......@@ -854,14 +854,6 @@ Page({
url: `/src/pages/themeindex/index?id=${this.data.id}&tid=${this.data.themeSelect.id}&sid=${this.data.sid}`
});
}
// console.log(this.data.circleInfo,'信息')
// if (this.data.themeSelect.join_rule_type==3) {
// this.setData({
// showPsdDia: true
// });
// } else {
// }
},
// 加入圈子输入码相关代码
closepsddia() {
......@@ -1203,26 +1195,36 @@ Page({
const visitor = LocalStorage.getItem("visitor");
let that = this;
const { encryptedData, iv } = e.detail;
if (!encryptedData) {
wx.login({
success(res) {
const sessionCode = res.code;
that.setData({
sessionCode: sessionCode,
encryptData: encryptedData,
iv
});
}
});
wx.showToast({
title: "授权失败",
icon: "none",
duration: 2000
});
return;
} else {
}
this.joinClock();
console.log(e,'手机爱吃')
that.setData({
sessionCode: that.data.sessionCode,
encryptData: encryptedData,
iv
},()=>{
that.joinClock();
});
// if (!encryptedData) {
// wx.login({
// success(res) {
// console.log(res,'313')
// const sessionCode = res.code;
// that.setData({
// sessionCode: sessionCode,
// encryptData: encryptedData,
// iv
// },()=>{
// that.joinClock();
// });
// }
// });
// wx.showToast({
// title: "授权失败",
// icon: "none",
// duration: 2000
// });
// return;
// } else {
// }
// wx.showLoading({
// title: '手机号获取中',
// })
......@@ -1263,7 +1265,48 @@ Page({
// })
// })
},
passwordInput(e) {
const {
value
} = e.detail;
this.setData({
secret: value,
})
},
cancle() {
this.setData({
showPsdDia: false
})
},
sure() {
this.setData({
secret: this.data.secret,
showPsdDia: false
},()=>{
this.joinClock()
})
// if (this.data.password == this.data.moreTheme.password) {
// wx.showToast({
// title: '密码正确',
// icon: 'none',
// duration: 2000
// })
// wx.navigateTo({
// url: `/src/pages/morethemeindex/index?id=${this.data.moreTheme.class_id}&tid=${this.data.tid}`
// });
// } else {
// wx.showToast({
// title: '密码错误',
// icon: 'none',
// duration: 2000
// })
// this.setData({
// password: ''
// })
// }
},
joinClock() {
console.log('该区打卡了')
let mobileParams =
this.data.studentMobile != ""
? {}
......@@ -1282,11 +1325,11 @@ Page({
.then(res => {
const { code, data } = res;
if (code == 200) {
this.goClock();
} else {
wx.showToast({
title: "加入失败"
wx.navigateTo({
url: `/src/pages/themeindex/index?id=${this.data.id}&tid=${this.data.themeSelect.id}&sid=${this.data.sid}`
});
} else {
}
})
.catch(err => {
......
......@@ -7,7 +7,6 @@
"remark-editor": "../../components/remarkeditor",
"psd-editor": "../../components/psdeditor",
"poster-box": "../../../components/posterbox",
"sjd-bullet": "../../../components/bullet",
"sjd-contact": "../../../components/contact",
"go-top": "../../../components/goTop",
"list-loading": "../../../components/listloading",
......
......@@ -10,7 +10,7 @@
<view class="shadow-box"></view>
<view class="title-box">
<view class="title">{{themeSelect.title}}</view>
<view class="time">老师 {{themeSelect.start_time}} 发布</view>
<view class="time">{{themeSelect.subject_creator.nickname}} {{themeSelect.homework_set.publish_time}} 发布</view>
</view>
</view>
<view class="instro-bx" wx:if="{{themeSelect.contentDetail}}">
......@@ -113,23 +113,27 @@
</view>
<view class="footer-box">
<view class="footer-innerbox" wx:if="{{true}}">
<view class="btn btn-inviteinfo">
<view class="footer-innerbox" >
<!-- 来源于分享 就显示邀请 否则回到微官网 -->
<view class="btn btn-inviteinfo" wx:if="{{true}}">
<image class="avatar" src="https://cdn.img.shangjiadao.cn/qingxiao/daka/images/2c/sharemoretheme/newunlockbg.png"></image>
<view class="info">
<view class="nickname">***</view>
<view class="tip">邀请你加入</view>
</view>
</view>
<!-- <button class="btn btn-clock" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber">加入打卡</button> -->
<button class="btn btn-clock" bindtap="goClock">加入打卡</button>
</view>
<view class="footer-innerbox" wx:if="{{!true}}">
<view class="btn btn-home" bindtap="goWebsiteIndex">
<view class="btn btn-home" bindtap="goWebsiteIndex" wx:if="{{false}}">
<image class="icon-home" src="{{localImageRoot}}common/icon_home.png?{{imageVersion}}"></image>
<view class="tip">学校首页</view>
</view>
<view class="btn btn-clock" bindtap="goClock">去打卡</view>
<!-- 没有手机号 需要授权 但是如果加入类型为密码加入 则在输入密码才授权-->
<block wx:if="{{studentMobile==''}}">
<button class="btn btn-clock" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{themeSelect.join_rule_type!=3}}">加入打卡</button>
<view class="btn btn-clock" bindtap="goClock" wx:else>加入打卡</view>
</block>
<block wx:if="{{studentMobile!=''}}">
<view class="btn btn-clock" bindtap="goClock">{{themeSelect.is_join==1 ? (themeSelect.is_clock ? '已打卡' : '去打卡') : '打入打卡'}}</view>
</block>
</view>
</view>
......@@ -150,8 +154,8 @@
</view>
</view>
<psd-editor bind:closepsddia="closepsddia" circleid="{{id}}" wx:if="{{showPsdDia}}" bind:checkPsd="checkPsd">
</psd-editor>
<!-- <psd-editor bind:closepsddia="closepsddia" circleid="{{id}}" wx:if="{{showPsdDia}}" bind:checkPsd="checkPsd">
</psd-editor> -->
<go-top wx:if="{{backTopValue}}"></go-top>
......@@ -166,6 +170,21 @@
bindtimeupdate="" bindwaiting="" binderror="" bindfullscreenchange="screenchange">
</video>
</view>
<!-- 密码输入 -->
<view class="dailog-box" wx:if="{{showPsdDia}}">
<view class="content-box" style="padding-top: 40px;">
<view class="closebox" bindtap="cancle">
<image class="closeicon" src="{{imageRoot}}2c/clockdetail/close.png?{{imageVersion}}"></image>
</view>
<view class="ipt-box" style="padding-bottom: 40px;">
<input type="number" placeholder-class="placeholderclass" class="iteminput" maxlength="6" value="{{secret}}" bindinput="passwordInput" placeholder="请输入密码"></input>
</view>
<!-- <view class="joinbtn" bindtap="sure"> -->
<button class="joinbtn" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" wx:if="{{studentMobile}}">立即加入</button>
<view class="joinbtn" bindtap="sure" wx:else>立即加入</view>
</view>
</view>
<guidecollection/>
</view>
\ No newline at end of file
......@@ -219,6 +219,16 @@ page {
align-items: center;
justify-content: center;
border-radius: 0;
position: relative;
}
.footer-box .footer-innerbox .formBtn{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
z-index: 1;
}
.footer-box .footer-innerbox .btn-inviteinfo {
flex: 1;
......@@ -428,3 +438,109 @@ page {
height: 500rpx;
position: relative;
}
.dailog-box{
width: 100%;
height: 100%;
background:rgba(0,0,0,.5);
position: fixed;
left: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
letter-spacing: 2rpx;
z-index: 101;
}
.info-dialog .tip-title{
text-align: center;
padding: 30rpx;
font-size: 26rpx;
font-weight: bold;
}
.dailog-box .content-box{
width: 600rpx;
background:rgba(255,255,255,1);
border-radius:20rpx;
box-shadow:0px 5rpx 20prx 1rpx rgba(255,195,38,0.2);
margin: 0 auto;
padding:0 24rpx 50rpx 24rpx;
position: relative;
}
.dailog-box .content-box .title{
font-size:32rpx;
font-family:PingFang-SC-Bold;
font-weight:bold;
color:rgba(0,0,0,1);
line-height:1;
text-align: center;
padding: 48rpx 0 90rpx 0;
}
.dailog-box .content-box .ipt-box{
padding: 0 40rpx;
padding-bottom: 38rpx;
position: relative;
}
.dailog-box .content-box .getmobilebtn{
position: absolute;
width: 160rpx;
height: 70rpx;
top: 0;
right: 40rpx;
font-size: 28rpx;
border-radius: 35rpx;
background-color: #FFD146;
line-height: 70rpx;
text-align: center;
z-index: 2;
padding: 0;
}
.dailog-box .content-box .ipt-box .iteminput{
height:70rpx;
background:rgba(240,240,244,1);
border-radius:35rpx;
padding: 0 40rpx;
line-height: 70rpx;
}
.dailog-box .content-box .ipt-box .iteminput.mobile{
width: 350rpx;
border-top-right-radius: none;
border-bottom-right-radius: none;
}
.closebox {
position: absolute;
top: -20rpx;
left: -10px;
width: 50rpx;
height: 50rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background-color: rgba(0,0,0,0.5);
}
.closebox .closeicon{
width: 20rpx;
height: 20rpx;
}
.joinbtn {
width: 520rpx;
margin: 0 auto;
background-color: #FFD146;
text-align: center;
line-height: 80rpx;
box-shadow:0px -1px 0px 0px rgba(232,232,232,1);
border-radius: 20rpx;
position: relative;
}
.joinbtn .formBtn{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
z-index: 1;
}
\ No newline at end of file
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