作者 xuyangjie

修改今日任务bug

... ... @@ -49,6 +49,7 @@ Component({
that.data.backgroundAudioManager.onEnded(function () { //结束播放监听
console.log('播放结束!');
that.setData({
sliderValue:0,
audioPlay: false
})
})
... ...
... ... @@ -2,7 +2,7 @@
<text class="audio_title">{{audioName}}</text>
<view class="audio-time">
<view>
<slider min="0" max="{{sliderMax}}" bindchange="sliderChange" block-size="14" value="{{sliderValue}}" activeColor="#8b8b8d" style="width: 64%;margin: 0 auto;"/>
<slider disabled min="0" max="{{sliderMax}}" bindchange="sliderChange" block-size="14" value="{{sliderValue}}" activeColor="#8b8b8d" style="width: 64%;margin: 0 auto;"/>
</view>
<text>{{currentTimeStr}}</text>
<text>{{durationTimeStr}}</text>
... ...
... ... @@ -3,7 +3,7 @@
</view>
<view class="nav">
<view class="nav-1">
<image src="{{schoolData.avatar}}"></image>
<image src="{{schoolData.avatar}}" mode="widthFix"></image>
</view>
<view class="anniu fs28" >当前分数·{{schoolData.number}}</view>
</view>
... ...
... ... @@ -11,6 +11,8 @@
position: absolute;
left: 44rpx;
top: -84rpx;
}
.nav-1 image {
width: 168rpx;
height: 168rpx;
border-radius: 50%;
... ... @@ -123,7 +125,7 @@
}
.aihao {
padding: 0 32rpx;
padding: 0 20rpx;
color: rgba(196, 196, 196, 1);
font-size: 24rpx;
font-weight: 400;
... ...
... ... @@ -28,7 +28,7 @@
<view>{{item.text}}</view>
</view>
<view bindtap="dianji" data-index="{{index}}">
<view class="buka">{{item.TodayStatus == 0 ? '补卡' : '打卡'}}</view>
<view class="buka" wx:if="{{item.type == 'today'}}">{{item.TodayStatus == 0 ? '补卡' : '打卡'}}</view>
</view>
<!-- <view bindtap="dianji" data-bool="{{item.bool}}" data-index="{{index}}">
<view class="{{item.bool?'buka':' buka yibuka'}}" bindtap="gotoday">{{item.bool?'打卡':'已打卡'}}</view>
... ...
... ... @@ -5,13 +5,15 @@
<view class="top-1">
<text>{{meData.nickname}} 的阅读打卡</text>
<view class="cent">
已连续打卡
已连续打卡
<text class="color">{{clockData.clock_number}}</text>
天,共读过
<text class="color">{{clockData.readbook}}</text>
本书
天,
<text class="cent">阅读量<text class="color">{{clockData.readwords}}</text>词</text>
</view>
<view class="cent">我的阅读量<text class="color">{{clockData.readwords}}</text>词</view>
<text class="color">共读过<text class="color" style="color:rgba(226,201,155,1) ;margin: 0 8rpx;">{{clockData.readbook}}</text>本书</text>
</view>
<image src="/img/02.png"></image>
</view>
\ No newline at end of file
... ...
/* pages/28/26.wxss */
page{
padding-right:34rpx;
padding-top: 70rpx;
background:#383744;
}
.top{
width: 100%;
height: 1208rpx;
}
.tips{
background:#383744;
text-align: right;
padding-right:34rpx;
padding-top: 70rpx;
text-align: right;
position: absolute;
right: 0;
top: 0;
}
.tips image{
width: 144rpx;
... ...
... ... @@ -6,7 +6,6 @@ innerAudioContext.autoplay = true
let time = null
let time_num = 0;
Page({
/**
* 页面的初始数据
*/
... ... @@ -18,7 +17,7 @@ Page({
http_url:'',
Count:0,//总题数
current:0,//当前题号
current:"0",//当前题号
today_id:'',//今日任务id
match_id:'',//比赛任务id
all_data:[],//全部题目
... ... @@ -48,7 +47,9 @@ Page({
alterType:false,//弹窗状态
alterData:{},//弹窗数据
taskType:'',//任务类型 比赛任务 今日任务
TodayTaskType:''//1 打卡 0 补卡
TodayTaskType:'',//1 打卡 0 补卡
webImg:'',//第三方链接封面
pages_types:false,//页面加载
},
PlayState(){
this.selectComponent("#audio").changePlayState()
... ... @@ -98,7 +99,7 @@ Page({
}
}else if(this.data.taskType == "match"){//比赛任务
answer = {
'match_subject_id': res.data.List[0].match_subject_id, //'题目ID',
'match_subject_id': this.data.all_data[index].match_subject_id, //'题目ID',
'type':0,//题目类型:1=用户上传图片,2=用户上传音频,
'file_url': [] //'图片/音频 【多张图 , 分割 拼接字符串】'
}
... ... @@ -134,6 +135,7 @@ Page({
var url = '' //接口地址
//判断任务类型
var temporary = Math.ceil(time_num/60);//学习时间
var all_data = JSON.stringify(this.data.allAnswer)
if(this.data.taskType == "today"){ //今日任务
url = 'today/TodayTask'
data = {today_id:this.data.today_id,json:all_data,learn_time:temporary,type:this.data.TodayTaskType}
... ... @@ -141,7 +143,6 @@ Page({
url = 'match/MatchTask'
data = {match_id:this.data.match_id,json:all_data,learn_time:temporary}
}
var all_data = JSON.stringify(this.data.allAnswer)
app.post(url,data ).then(res => {
if(res.code == 1){
console.log(res)
... ... @@ -180,6 +181,7 @@ Page({
http_url:app.globalData.imgBaseUrl,
})
var that = this;
this.WebImage()
time = setInterval(function(){
time_num++
},1000)
... ... @@ -226,9 +228,13 @@ Page({
},
//获取今日任务列表
TodayQuestion(){
wx.showLoading({
title: '加载中...',
})
var that = this;
app.post("today/TodayQuestion", {today_id:this.data.today_id}).then(res => {
if(res.code == 1){
wx.hideLoading()
console.log(res)
let answer = {
... ... @@ -249,6 +255,7 @@ Page({
Count:res.data.Count,//总题数
current:1,//当前题数
answer,
pages_types:true,
})
}
}).catch(err => {
... ... @@ -261,10 +268,13 @@ Page({
//比赛任务
MatchQuestion(){
var that = this;
wx.showLoading({
title: '加载中...',
})
app.post("match/MatchQuestion", {match_id:this.data.match_id}).then(res => {
if(res.code == 1){
console.log(res)
wx.hideLoading()
let answer = {
'match_subject_id': res.data.List[0].match_subject_id, //'题目ID',
'type':0,//题目类型:1=用户上传图片,2=用户上传音频,
... ... @@ -283,6 +293,7 @@ Page({
Count:res.data.Count,//总题数
current:1,//当前题数
answer,
pages_types:true,
})
}
}).catch(err => {
... ... @@ -292,6 +303,23 @@ Page({
})
})
},
//答题页外部链接按钮图片
WebImage(){
var that = this;
app.post("index/WebImage", {}).then(res => {
if(res.code == 1){
console.log(res)
this.setData({
webImg: res.data.web_image
})
}
}).catch(err => {
wx.showToast({
title: err.msg,
icon: 'none'
})
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -303,14 +331,18 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
innerAudioContext.onEnded((res)=>{ // 监听音频自然播放至结束的事件
console.log(res)
this.setData({
soundType : 2
})
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
... ... @@ -318,6 +350,10 @@ Page({
*/
onUnload: function () {
clearInterval(time)
innerAudioContext.offEnded((res)=>{//取消监听音频自然播放至结束的事件
console.log(res)
})
this.PlayState()//暂停后台播放的音乐
},
/**
... ... @@ -340,6 +376,7 @@ Page({
onShareAppMessage: function () {
},
//第三方链接
web_url(e){
var webUrl = e.currentTarget.dataset.weburl;
... ... @@ -377,6 +414,7 @@ Page({
//看原图
showImg: function (e) {
var that = this;
console.log(e.currentTarget.dataset.index)
wx.previewImage({
urls: that.data.uploaderList,
current: that.data.uploaderList[e.currentTarget.dataset.index]
... ... @@ -509,6 +547,8 @@ Page({
soundType:3,//录音结束
})
innerAudioContext.src = this.data.musicUrl
innerAudioContext.play()
console.log(innerAudioContext.paused)
innerAudioContext.onPlay(() => { // 监听音频播放事件
console.log('开始播放')
})
... ... @@ -516,13 +556,14 @@ Page({
console.log(res.errMsg)
console.log(res.errCode)
})
},
//录音暂停事件
pause_voice(){
this.setData({
soundType:2,//录音结束
})
console.log("暂停录音")
console.log("暂停播放")
innerAudioContext.pause()
innerAudioContext.onPause(() => { // 监听音频暂停事件
console.log('暂停播放')
... ... @@ -531,5 +572,8 @@ Page({
console.log(res.errMsg)
console.log(res.errCode)
})
// innerAudioContext.offEnded((res)=>{//取消监听音频自然播放至结束的事件
// console.log(res)
// })
}
})
\ No newline at end of file
... ...
<!-- 视频 -->
<view class="video" wx:if="{{today_data.video_file}}">
<video src="{{today_data.video_file}}" loop show-fullscreen-btn="{{false}}"></video>
</view>
<!-- 音频 -->
<view class="audio" wx:if="{{today_data.audio_file}}" >
<view wx-if="{{pages_types}}">
<!-- 视频 -->
<view class="video" wx:if="{{today_data.video_file}}">
<video src="{{today_data.video_file}}" show-center-play-btn="{{true}}" show-progress="{{false}}" show-fullscreen-btn="{{true}}"></video>
</view>
<!-- 音频 -->
<view class="audio" wx:if="{{today_data.audio_file}}" >
<!-- <audio controls src="http://m10.music.126.net/20210728150904/ef325f8ac68a3710a2c7cfec82a70096/ymusic/045e/000b/0f0f/34bf44037a7a4cb160928e5a21c314a0.mp3"></audio> -->
<view style="width:686rpx;margin:0 auto">
<slider-audio audio-src="{{today_data.audio_file}}" id="audio" audioName="{{today_data.title}}"></slider-audio>
</view>
</view>
</view>
<!-- 播放音频 -->
<view class="audio_play" bindtap="PlayState" wx:if="{{today_data.audio_file && today_data.type != 3}}">
<!-- 播放音频 -->
<view class="audio_play" bindtap="PlayState" wx:if="{{today_data.audio_file && today_data.type != 3}}">
<image class="audio_img" src="../../img/ic_voice56@2x.png"></image>
</view>
</view>
<!-- 文本 -->
<view class="essay" wx:if="{{today_data.text}}">
<!-- 文本 -->
<view class="essay" wx:if="{{today_data.text}}">
<text>{{today_data.text}}</text>
</view>
</view>
<!-- 第三方外部连接 -->
<view class="essay" wx:if="{{today_data.web_url}}" bindtap="web_url" data-webUrl="{{today_data.web_url}}">
<image src="../../img/7.jpg"></image>
</view>
<!-- 图片 -->
<view class="image" wx:if="{{today_data.image.length != 0}}">
<!-- 第三方外部连接 -->
<view class="essay" wx:if="{{today_data.web_url}}" bindtap="web_url" data-webUrl="{{today_data.web_url}}">
<image src="{{webImg}}"></image>
<image src="../../img/ic_play@2x.png" mode="widthFix"></image>
</view>
<!-- 图片 -->
<view class="image" wx:if="{{today_data.image.length != 0}}">
<swiper indicator-dots
autoplay interval="{{2000}}" >
<block wx:for="{{today_data.image}}" wx:key="index">
... ... @@ -35,10 +37,10 @@
</swiper-item>
</block>
</swiper>
</view>
</view>
<!-- 音频录制 -->
<view class="recording" wx:if="{{today_data.type == 3}}">
<!-- 音频录制 -->
<view class="recording" wx:if="{{today_data.type == 3}}">
<view class="art">
<!-- //录音状态 0未录音 1开始录音 2录音完成 3播放录音 -->
<view>
... ... @@ -50,10 +52,10 @@
<image src="/img/ic_play_n@2x.png" wx:if="{{soundType == 2}}" bindtap="play_voice" ></image>
<image src="/img/play.png" wx:if="{{soundType == 3}}" bindtap="pause_voice"></image>
</view>
</view>
</view>
<!-- 上传图片 -->
<view class='ui_uploader_cell' wx:if="{{today_data.type == 2}}">
<!-- 上传图片 -->
<view class='ui_uploader_cell' wx:if="{{today_data.type == 2}}">
<!-- 根据已选择的图片临时路径数组展示图片-->
<view class='ui_uploader_item' wx:for="{{imglist}}" wx:key="index">
<!-- 删除-->
... ... @@ -68,15 +70,15 @@
</view>
</view>
<view class="porogress">
<view class="porogress">
<text>{{current}}</text>
<text>/</text>
<text>{{Count}}</text>
</view>
</view>
<view class="box-end" bindtap="gotoday">{{current == Count ? '完成打卡' : 'Next'}}</view>
<view class="box-end" bindtap="gotoday">{{current != Count ? 'Next' : ' 完成打卡'}}</view>
<view class="alter" wx:if="{{alterType}}">
<view class="alter" wx:if="{{alterType}}">
<view class="mask">
<image src="/img/img_star@2x.png"></image>
</view>
... ... @@ -109,4 +111,5 @@
<text>{{alterData.Happy}}</text>
<view class="button" bindtap="gototram">开心收下</view>
</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -80,6 +80,7 @@ swiper{
position: fixed;
top: 30rpx;
right: 20rpx;
background-color: #fff;
}
.porogress>text{
font-size: 24rpx;
... ... @@ -101,10 +102,10 @@ swiper{
.ui_uploader_item {
float: left;
position: relative;
margin-right: 30rpx;
margin-bottom: 30rpx;
width: 165rpx;
height: 165rpx;
margin-right: 3%;
margin-bottom: 40rpx;
width: 30%;
height: 204rpx;
}
... ... @@ -127,11 +128,14 @@ swiper{
margin-right: 25rpx;
margin-bottom: 25rpx;
box-sizing: border-box;
width: 30%;
}
.ui_uploader:nth-child(3n){
margin-right: 0;
}
.ui_uploader image {
width: 165rpx;
height: 165rpx;
width: 100%;
height: 204rpx;
}
... ... @@ -150,6 +154,19 @@ swiper{
.essay image{
width: 100%;
}
.essay{
position: relative;
}
.essay>image:last-child{
position: absolute;
width: 164rpx;
height: 164rpx;
top: 50%;
left: 50%;
margin-left: -82rpx;
margin-top: -82rpx;
opacity: 0.5;
}
/* */
.alter{
... ...
... ... @@ -11,11 +11,12 @@
border-top-left-radius: 24rpx;
border-top-right-radius: 24rpx;
overflow: hidden;
border-radius: 24rpx 24rpx 0 0;
}
.top image {
width: 100%;
height: 100%;
border-radius: 24rpx 24rpx 0 0;
}
.box {
... ...
... ... @@ -6,15 +6,14 @@
<view>{{meData.score}}</view>
</view>
<view class="moon">
<view class="mony" wx:for="{{shoppingData}}" wx:key='key'>
<view class="mony" wx:for="{{shoppingData}}" wx:key='key' >
<view>
<image src="{{item.image}}"></image>
</view>
<view class="mon-1">
<text>{{item.title}}</text>
<view class="mon-2">
<view class="mon-4">
<image src="/img/ic_jifen@2x.png"></image>
<view class="mon-4"><image src="/img/ic_jifen@2x.png"></image>
<view>{{item.number}}</view>
</view>
<view class="mon-3" bindtap="duihuan" data-id="{{item}}">兑换</view>
... ...
... ... @@ -26,14 +26,19 @@ page{
display: flex;
margin-bottom: 40rpx;
flex-wrap: wrap;
margin-left: 18rpx;
padding: 34rpx;
box-sizing: border-box;
}
.mony{
width:336rpx;
border-radius: 12rpx;
width:49%;
height:520rpx;
margin-top:16rpx;
margin-left: 14rpx;
background: #ffffff;
overflow: hidden;
margin-top: 18rpx;
}
.mony:nth-child(2n){
margin-left: 2%;
}
.mony image{
width: 100%;
... ...
<view class="calendar_bg">
<view class="calendar">
<image src="/img/ic_date.png" catchtap="goCalend"></image>
</view>
</view>
<!--今日任务 -->
<view class="cast" style="background:rgba(113,116,132,1);" bindtap="gotoday" data-type="today"
data-id="{{raskData.Today.today_id}}" wx:if="{{raskData.Today}}">
... ... @@ -8,9 +13,9 @@
<view class="cast-logo">
<image src="/img/ic_date_dangri@2x.png"></image>
</view>
<view class="cast-logos">
<!-- <view class="cast-logos">
<image src="/img/ic_date.png" catchtap="goCalend"></image>
</view>
</view> -->
</view>
<!-- 比赛任务 -->
<view class="cast" style="background:rgba(109,134,157,1);" bindtap="gotoday" data-type="match"
... ... @@ -44,8 +49,9 @@
<!-- -->
<view class="footer">
分享到
<button open-type="share" class="share">
<text style="margin-right: 10rpx;">分享到</text>
<image src="/img/chat.png" wx:if="{{raskData.Today.type != 1 && raskData.Match.type != 1 && raskData.Evaluation.type != 1 }}"></image>
<button open-type="share" class="share" wx:if="{{raskData.Today.type == 1 && raskData.Match.type == 1 && raskData.Evaluation.type == 1 }}">
<image src="/img/ic_wechat@2x.png"></image>
</button>
</view>
\ No newline at end of file
... ...
... ... @@ -53,7 +53,7 @@
.footer {
position: absolute;
bottom: 10%;
bottom: 3%;
left: 50%;
font-size: 28rpx;
color: rgba(139, 139, 141, 1);
... ... @@ -83,3 +83,22 @@
font-size: 28rpx;
color: gray;
}
.calendar_bg{
width: 686rpx;
margin: 0 auto;
}
.calendar{
width: 80rpx;
height: 80rpx;
margin-left: auto;
background-color: #ebebeb;
border-radius: 20rpx;
overflow: hidden;
}
.calendar image{
width: 80rpx;
height: 80rpx;
}
.cast:nth-child(2){
margin-top: 42rpx;
}
\ No newline at end of file
... ...
... ... @@ -4,10 +4,16 @@
</view>
</navigator>
<view class="top">
<view class="top-1">
<image src="{{token ? meData.avatar : '../../img/ic_head@2x.png'}}"></image>
<view class="top-1" bindtap="getmy">
<view>
<view style="display: flex;justify-content: center;">
<image src="{{token ? meData.avatar : '../../img/ic_head@2x.png'}}" mode="widthFix"></image>
</view>
<view style="display: flex;justify-content: center;">
<view class="bigtitle">{{meData.nickname}}</view>
<text class="t3" bindtap="getmy">{{token ? '查看并编辑个人资料' : '您还没有登录,请进行登录'}}</text>
</view>
</view>
<text class="t3" >{{token ? '查看并编辑个人资料' : '您还没有登录,请进行登录'}}</text>
</view>
<view class="right">积分·{{token ? meData.score : '0'}}</view>
</view>
... ...
.logo {
page{
background: #3A3942;
padding-top: 36rpx;
}
.logo {
padding-top: 20rpx;
padding-right: 48rpx;
}
.logo_bg{
... ... @@ -19,15 +21,14 @@
}
.top {
display: flex;
justify-content: center;
justify-content: space-between;
align-items: center;
padding: 0 48rpx;
padding-bottom: 80rpx;
background: #3A3942;
}
.top-1 {
flex: 7;
width: 216rpx;
}
.top image {
... ... @@ -38,7 +39,7 @@
.bigtitle {
font-size: 52rpx;
margin-top: 48rpx;
margin-top: 28rpx;
font-weight: 600;
color: white;
}
... ... @@ -49,7 +50,6 @@
}
.right {
flex: 3;
width: 202rpx;
height: 72rpx;
text-align: center;
... ... @@ -65,6 +65,8 @@
display: flex;
flex-wrap: wrap;
justify-content: space-around;
border-radius: 24rpx 24rpx 0 0;
background-color: #fff;
}
.contents .cont:last-child{
margin-top:24rpx;
... ... @@ -100,7 +102,8 @@
font-size:24rpx;
line-height: 42rpx;
color:rgba(196,196,196,1);
margin-bottom: 100rpx;
padding-bottom: 100rpx;
background: #fff;
}
.footer{
position: fixed;
... ...
{
"usingComponents": {}
"usingComponents": {},
"navigationBarTitleText": "B&C HOUSE"
}
\ No newline at end of file
... ...
{
"setting": {},
"condition": {
"plugin": {
"list": []
... ... @@ -16,6 +17,12 @@
"pathName": "pages/question/question",
"query": "",
"scene": null
},
{
"name": "pages/integral/integral",
"pathName": "pages/integral/integral",
"query": "",
"scene": null
}
]
}
... ...