Commit 68468494 authored by Mac's avatar Mac

朋友圈

parent cdd502d8
...@@ -478,6 +478,8 @@ ...@@ -478,6 +478,8 @@
"path":"mydetails"//动态详情 "path":"mydetails"//动态详情
},{ },{
"path":"friendcircle"//朋友圈 "path":"friendcircle"//朋友圈
},{
"path":"medynamic"//我的互动消息
}] }]
}, },
//抖音商品短视频 //抖音商品短视频
......
...@@ -183,14 +183,59 @@ ...@@ -183,14 +183,59 @@
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.friendcircle .mynews-top {
width: 100%;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
position: fixed;
left: 0;
top: 0;
background: #FFF;
z-index: 2;
}
.friendcircle .top-box {
padding: 0 12px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
height: 30px;
border-radius: 15px;
background: #40766E;
font-size: 14px;
color: #FFFFFF;
position: relative;
}
.friendcircle .badgestyle{
padding: 0 5px;
font-size: 11px;
color: #FFFFFF;
position: absolute;
right: -5px;
top: -5px;
background: #C92B2B;
border-radius: 8px;
}
</style> </style>
<template> <template>
<div class='friendcircle'> <div class='friendcircle'>
<view class="mynews-top" v-if="Messagecount>0">
<view class="top-box" @click="gomymessage()">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/wodehufong.png" mode="widthFix" style="width: 16px;height: auto;"></image>
<text style="margin-left: 6px;">我的互动消息</text>
<view class="badgestyle">
{{Messagecount>99?'99+':Messagecount}}
</view>
</view>
</view>
<u-empty v-if="g.length == 0" text="暂无动态" mode="list"></u-empty> <u-empty v-if="g.length == 0" text="暂无动态" mode="list"></u-empty>
<view v-if="g.length > 0" style=" <view v-if="g.length > 0" :style="{'width':'100vw','overflow':'hidden','margin-top':Messagecount>0?'60px':'0','height':Messagecount>0?calc('100vh-60px'):'100vh',}">
height: calc(100vh);width: calc(100vw)
overflow: hidden;
">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scroll='inputscroll' @scrolltolower="lower" <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scroll='inputscroll' @scrolltolower="lower"
:style="{ height: '100%' }"> :style="{ height: '100%' }">
<view class="ftBox" v-for="(x, i) in g" :key="i"> <view class="ftBox" v-for="(x, i) in g" :key="i">
...@@ -226,9 +271,10 @@ ...@@ -226,9 +271,10 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="x.fileType==3" class="audios"> <view v-if="x.fileType==3" class="audios" @click.stop="playVoice(x,i)">
<view class="andiostyle" @click.stop="playVoice(x)"> <view class="andiostyle" >
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png" mode="widthFix" style="width: 19px;height: auto;"></image> <image v-if="x.playshow==false" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png" mode="widthFix" style="width: 19px;height: auto;"></image>
<image v-if="x.playshow==true" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/bofanggif.gif" mode="widthFix" style="width: 19px;height: auto;"></image>
</view> </view>
</view> </view>
<view class="text" style="font-size: 11px;" v-if="x.address && x.address!=''"> <view class="text" style="font-size: 11px;" v-if="x.address && x.address!=''">
...@@ -359,6 +405,8 @@ ...@@ -359,6 +405,8 @@
choiceId: 0,//保存评论和点赞时候的id choiceId: 0,//保存评论和点赞时候的id
show:false, show:false,
user:'',//点击用户保存的数据 user:'',//点击用户保存的数据
Messagecount:0,
playindex:0,
} }
}, },
created() { created() {
...@@ -396,6 +444,14 @@ ...@@ -396,6 +444,14 @@
this.init(); this.init();
} }
}, },
onShow(){
if (!this.u) {
} else {
this.getDMCount();
}
},
methods: { methods: {
init() { init() {
this.loading = true; this.loading = true;
...@@ -408,7 +464,7 @@ ...@@ -408,7 +464,7 @@
this.loading = false; this.loading = false;
this.count = res.data.count; this.count = res.data.count;
res.data.pageData.forEach(x => { res.data.pageData.forEach(x => {
x.nowbofo = false; x.playshow = false;
x.dianshow = false; x.dianshow = false;
}) })
this.g = this.g.concat(res.data.pageData); this.g = this.g.concat(res.data.pageData);
...@@ -417,6 +473,20 @@ ...@@ -417,6 +473,20 @@
this.status = "nomore"; this.status = "nomore";
} }
} }
this.getDMCount()
}
);
},
getDMCount(){
this.request2({
url: '/api/AppletEducation/GetDynamicMessageCount',
data: {}
},
res => {
if (res.resultCode == 1) {
this.Messagecount = res.data
};
} }
); );
}, },
...@@ -429,19 +499,30 @@ ...@@ -429,19 +499,30 @@
}, },
//语音播放 //语音播放
playVoice(x) { playVoice(x,i) {
let that = this let that = this
if (innerAudioContext.src != x.files[0]) { //如果切换听其他的语音 if (innerAudioContext.src != x.files[0]) { //如果切换听其他的语音
innerAudioContext.stop(); innerAudioContext.stop();
this.nowbofo = false this.nowbofo = false;
this.g[this.playindex].playshow=false;
this.playindex= i
}else{
this.playindex= i
} }
innerAudioContext.src = x.files[0]; innerAudioContext.src = x.files[0];
if (this.nowbofo == false) { if (this.nowbofo == false) {
innerAudioContext.play() innerAudioContext.play()
this.nowbofo = true this.nowbofo = true;
this.g[i].playshow=true
innerAudioContext.onEnded(()=>{
innerAudioContext.stop()
this.nowbofo == false
this.g[this.playindex].playshow=false
})
} else { } else {
innerAudioContext.pause(); innerAudioContext.pause();
this.nowbofo = false this.nowbofo = false;
this.g[i].playshow=false
} }
}, },
getList() { getList() {
...@@ -626,7 +707,13 @@ ...@@ -626,7 +707,13 @@
data: this.user.item.content, data: this.user.item.content,
}); });
}, },
gomymessage(){//我的动态消息
innerAudioContext.stop();
uni.navigateTo({
url: '/pages/friendcircle/medynamic'
})
} }
} }
}
</script> </script>
<style>
.mynews {
width: 100%;
height: 100vh;
background: #FFF;
}
.mynews .ftBox {
width: 100%;
padding: 0 15px;
margin-top: 20px;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
}
.mynews .ftBox-left{
margin-right: 15px;
}
.mynews .ftBox-center{
width: 1;
flex: 1;
margin-right: 5px;
}
.mynews .ftBox-right{
width: 80px;
height: 80px;
border-radius: 5px;
overflow: hidden;
}
.mynews .ftBox-right-text{
width: 100%;
height: 100%;
border-radius: 5px;
font-size: 14px;
color: #333333;
background: #F5F5F5;
}
.mynews .text{
font-size: 14px;
color: #A68237;
}
</style>
<template>
<div class='mynews'>
<u-empty v-if="g.length == 0" text="暂无动态" mode="list"></u-empty>
<view v-if="g.length > 0" style="
height: 100vh ;width: calc(100vw)
overflow: hidden;
">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }">
<view class="ftBox" v-for="(x, i) in g" :key="i" @click="godetails(x)">
<view class="ftBox-left">
<u-avatar :src="x.crearteEmPhoto" size='80' mode="square"></u-avatar>
</view>
<view class="ftBox-center">
<view class="text">
{{x.createEmName}}
</view>
<view v-if="x.realtionType==1">
<view>{{x.replyName==''?'回复了':'评论了'}} <text class="text" style="margin-left: 3px;">{{x.replyName}}</text></view>
<view>
{{x.commentContent}}
</view>
</view>
<view v-if="x.realtionType==2">
<u-icon name="like-o" :size="30" color="#000000"></u-icon>
</view>
<view style="font-size: 11px;color: #B0B0B0;">{{x.createTime}}</view>
</view>
<view class="ftBox-right" >
<view class="ftBox-right-text" style="padding: 6px;" v-if="x.fileType==0">
{{x.content}}
</view>
<view class="ftBox-right-text" v-if="x.fileType==1">
<image :src="x.coverPhoto" mode='aspectFill' style="width: 100%;height: 100%;border-radius: 5px;"></image>
</view>
<view class="ftBox-right-text" v-if="x.fileType==2" style="position: relative;">
<video id="myVideo" :src="x.coverPhoto" style="width: 100%;height: 100%;border-radius: 5px;" :controls='false'
:show-center-play-btn='false'></video>
<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;"
>
<u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon>
</view>
</view>
<view class="ftBox-right-text" v-if="x.fileType==3" style="display: flex;align-items: center;justify-content: center;background: #BBA16B;">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mic.png" mode='aspectFill' style="width: 27px;height: 40px;border-radius: 5px;"></image>
</view>
</view>
</view>
<u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20" bg-color="#FFF" />
</scroll-view>
</view>
</view>
</div>
</template>
<script>
const innerAudioContext = uni.createInnerAudioContext();
export default {
data() {
return {
pageTitle: "我的互动消息",
showAuth: false,
msg: {
pageIndex: 1,
pageSize: 10,
},
mainColor: "",
secondary: '',
pricecolor: '',
page_count: 1,
g: [],
loading: false,
status: "loadmore",
count: 0,
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
windowWidth: 0,
}
},
created() {
this.contentHeight = this.$utils.calcContentHeight(-40) + "px";
this.mainColor = this.$uiConfig.mainColor;
this.secondary = this.$uiConfig.secondary;
this.pricecolor = this.$uiConfig.pricecolor;
this.windowWidth = this.$utils.SystemInfo().windowWidth;
},
mounted() {
let currentPages = getCurrentPages();
let u = "/" + currentPages[currentPages.length - 1].route;
let pages = wx.getStorageSync("basedata") ?
wx.getStorageSync("basedata").bar_title : [];
pages.forEach((x) => {
if (x.value == u) {
this.pageTitle = x.new_name ? x.new_name : x.name;
}
});
uni.setNavigationBarTitle({
title: this.pageTitle,
});
this.init()
},
onLoad() {
},
methods: {
init() {
this.loading = true;
this.request2({
url: '/api/AppletEducation/AboutMeDynamicList',
data: this.msg
},
res => {
if (res.resultCode == 1) {
this.loading = false;
this.count = res.data.count;
this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
}
}
);
},
lower(e) {
console.log(2)
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
this.init();
} else {
this.status = "nomore";
}
},
godetails(x){
uni.navigateTo({
url: '/pages/friendcircle/mydetails?ID=' + x.id
})
}
}
}
</script>
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
background: #40766E; background: #40766E;
font-size: 14px; font-size: 14px;
color: #FFFFFF; color: #FFFFFF;
position: relative;
} }
.mynews .ftBox { .mynews .ftBox {
...@@ -121,24 +122,25 @@ ...@@ -121,24 +122,25 @@
margin-top: 10px; margin-top: 10px;
justify-content: space-between; justify-content: space-between;
} }
.mynews .badgestyle{
padding: 1px 4px;
font-size: 11px;
color: #FFFFFF;
position: absolute;
right: -5px;
top: -5px;
background: #C92B2B;
border-radius: 8px;
}
</style> </style>
<template> <template>
<div class='mynews'> <div class='mynews'>
<view class="mynews-top">
<view class="top-box">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/wodehufong.png" mode="widthFix" style="width: 16px;height: auto;"></image>
<text style="margin-left: 6px;">我的互动消息</text>
</view>
</view>
<!-- 发布动态按钮 --> <!-- 发布动态按钮 -->
<floatbutton :list='list' openIcon='https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/fabupyq.png' <floatbutton :list='list' openIcon='https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/fabupyq.png'
background='#40766E' openText='发布' bottom='80' @click='btnclick'></floatbutton> background='#40766E' openText='发布' bottom='80' @click='btnclick'></floatbutton>
<u-empty v-if="g.length == 0" text="暂无动态" mode="list"></u-empty> <u-empty v-if="g.length == 0" text="暂无动态" mode="list"></u-empty>
<view v-if="g.length > 0" style=" <view v-if="g.length > 0" :style="{'width':'100vw','overflow':'hidden','margin-top':Messagecount>0?'60px':'0','height':Messagecount>0?calc('100vh-60px'):'100vh'}">
height: calc(100vh - 60px);width: calc(100vw)
overflow: hidden;
margin-top: 60px;
">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }"> <scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower" :style="{ height: '100%' }">
<view class="ftBox" v-for="(x, i) in g" :key="i" @click="godetails(x)"> <view class="ftBox" v-for="(x, i) in g" :key="i" @click="godetails(x)">
<view class="jiazu" v-if="x.YearTime!=''">{{x.YearTime}}</view> <view class="jiazu" v-if="x.YearTime!=''">{{x.YearTime}}</view>
...@@ -151,8 +153,8 @@ ...@@ -151,8 +153,8 @@
<view class="inter-r-o" v-if="x.fileType==0"> <view class="inter-r-o" v-if="x.fileType==0">
{{x.content}} {{x.content}}
</view> </view>
<view class="inter-r-t wrap" v-if="x.fileType==1"> <view class="inter-r-t wrap" v-if="x.fileType==1" >
<view class="inter-r-t-l"> <view class="inter-r-t-l" @click.stop="previewImage(0,x.files)">
<image :src="x.files[0]" v-if="x.files.length==1" mode='aspectFill' style="width: 100%;height: 100%;"></image> <image :src="x.files[0]" v-if="x.files.length==1" mode='aspectFill' style="width: 100%;height: 100%;"></image>
<view v-if="x.files.length==2" v-for="(item, iq) in x.files" :key="iq" :style="{'margin-right':(iq%2 ==0)?'2px':'0',width:'34px','height':'100%'}"> <view v-if="x.files.length==2" v-for="(item, iq) in x.files" :key="iq" :style="{'margin-right':(iq%2 ==0)?'2px':'0',width:'34px','height':'100%'}">
<image :src="item" mode='aspectFill' style="width: 100%;height: 100%;"></image> <image :src="item" mode='aspectFill' style="width: 100%;height: 100%;"></image>
...@@ -182,7 +184,7 @@ ...@@ -182,7 +184,7 @@
<video id="myVideo" :src="x.files[0]" style="width: 70px;height: 70px;" :controls='false' <video id="myVideo" :src="x.files[0]" style="width: 70px;height: 70px;" :controls='false'
:show-center-play-btn='false'></video> :show-center-play-btn='false'></video>
<view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;" <view style="width: 100%;height: 100%;position: absolute;left: 0;top: 0;display: flex;align-items: center;justify-content: center;"
@click="enlarge(x.files[0])"> @click.stop="enlarge(x.files[0])">
<u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon> <u-icon name="play-circle-o" :size="50" color="#FFF"></u-icon>
</view> </view>
</view> </view>
...@@ -196,8 +198,9 @@ ...@@ -196,8 +198,9 @@
<view> <view>
{{x.content}} {{x.content}}
</view> </view>
<view class="andiostyle" @click.stop="playVoice(x)"> <view class="andiostyle" @click.stop="playVoice(x,i)">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png" mode="widthFix" style="width: 19px;height: auto;"></image> <image v-if="x.playshow==false" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png" mode="widthFix" style="width: 19px;height: auto;"></image>
<image v-if="x.playshow==true" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/bofanggif.gif" mode="widthFix" style="width: 19px;height: auto;"></image>
</view> </view>
</view> </view>
...@@ -268,6 +271,8 @@ ...@@ -268,6 +271,8 @@
}, },
], ],
nowbofo: false, nowbofo: false,
Messagecount:0,
playindex:0,
} }
}, },
created() { created() {
...@@ -303,8 +308,10 @@ ...@@ -303,8 +308,10 @@
this.showAuth = true; this.showAuth = true;
} else { } else {
this.init(); this.init();
} }
}, },
methods: { methods: {
init() { init() {
this.loading = true; this.loading = true;
...@@ -317,17 +324,19 @@ ...@@ -317,17 +324,19 @@
this.loading = false; this.loading = false;
this.count = res.data.count; this.count = res.data.count;
res.data.pageData.forEach(x => { res.data.pageData.forEach(x => {
x.nowbofo = false; x.playshow = false;
}) })
this.g = this.g.concat(res.data.pageData); this.g = this.g.concat(res.data.pageData);
this.page_count = res.data.pageCount; this.page_count = res.data.pageCount;
if (this.page_count == 1) { if (this.page_count == 1) {
this.status = "nomore"; this.status = "nomore";
} }
} };
} }
); );
}, },
btnclick(item) { btnclick(item) {
if (item.type == 2) { if (item.type == 2) {
this.upvideo() this.upvideo()
...@@ -398,19 +407,30 @@ ...@@ -398,19 +407,30 @@
innerAudioContext.stop(); innerAudioContext.stop();
}, },
//语音播放 //语音播放
playVoice(x) { playVoice(x,i) {
let that = this
if (innerAudioContext.src != x.files[0]) { //如果切换听其他的语音 if (innerAudioContext.src != x.files[0]) { //如果切换听其他的语音
innerAudioContext.stop(); innerAudioContext.stop();
this.nowbofo = false this.nowbofo = false;
this.g[this.playindex].playshow=false;
this.playindex= i
}else{
this.playindex= i
} }
innerAudioContext.src = x.files[0]; innerAudioContext.src = x.files[0];
if (this.nowbofo == false) { if (this.nowbofo == false) {
innerAudioContext.play() innerAudioContext.play()
this.nowbofo = true this.nowbofo = true
this.g[i].playshow=true
innerAudioContext.onEnded(()=>{
innerAudioContext.stop()
this.nowbofo == false
this.g[this.playindex].playshow=false
})
} else { } else {
innerAudioContext.pause(); innerAudioContext.pause();
this.nowbofo = false this.nowbofo = false
this.g[i].playshow=false
} }
}, },
getList() { getList() {
...@@ -419,7 +439,7 @@ ...@@ -419,7 +439,7 @@
this.init(); this.init();
}, },
lower(e) { lower(e) {
console.log(2)
if (this.msg.pageIndex < this.page_count) { if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++; this.msg.pageIndex++;
this.status = "loading"; this.status = "loading";
...@@ -443,6 +463,20 @@ ...@@ -443,6 +463,20 @@
}) })
innerAudioContext.stop(); innerAudioContext.stop();
}, },
gomymessage(){//我的动态消息
innerAudioContext.stop();
uni.navigateTo({
url: '/pages/friendcircle/medynamic'
})
},
//图片预览
previewImage(index, images) {
uni.previewImage({
urls: images,
current: index,
});
},
} }
} }
</script> </script>
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
</view> </view>
<!-- 输入框 --> <!-- 输入框 -->
<view class="comment" > <view class="comment" >
<input type="text" v-model="commentMsg.Content" :placeholder='placeholder' class="commentinput" :focus='focu'> <input type="text" v-model="commentMsg.Content" :placeholder='placeholder' class="commentinput" @blur='blurc' :focus='focu'>
<view class="comment-pl" :style="{background:mainColor}" @click="addComment">评论</view> <view class="comment-pl" :style="{background:mainColor}" @click="addComment">评论</view>
</view> </view>
...@@ -484,6 +484,10 @@ ...@@ -484,6 +484,10 @@
} }
); );
}, },
blurc(){
this.commentMsg.Content = '';
this.placeholder = '评论';
},
mydelete(){//删除自己的回复 mydelete(){//删除自己的回复
this.request2({ this.request2({
url: '/api/AppletEducation/DynamicDeleteComment', url: '/api/AppletEducation/DynamicDeleteComment',
......
...@@ -187,13 +187,14 @@ ...@@ -187,13 +187,14 @@
<!-- 音频 --> <!-- 音频 -->
<view class="audio" v-if='addMsg.FileType==3'> <view class="audio" v-if='addMsg.FileType==3'>
<view class="audio-o" @click="statraudio()" v-if="addMsg.FileList.length==0"> <view class="audio-o" @click="statraudio()" v-if="addMsg.FileList.length==0">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound2.png" mode="widthFix" style="width: 20px;height: auto;"></image> <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png" mode="widthFix" style="width: 20px;height: auto;"></image>
<text style="margin-left: 10px;">语音录制</text> <text style="margin-left: 10px;">语音录制</text>
<text style="color: #BBBBBB;">(点击进入录制页面)</text> <text style="color: #BBBBBB;">(点击进入录制页面)</text>
</view> </view>
<view v-if="addMsg.FileList.length>0" class="audio-o" style="justify-content: space-around;width: 100%;"> <view v-if="addMsg.FileList.length>0" class="audio-o" style="justify-content: space-around;width: 100%;">
<view class="audio-ot" @click="playVoice"> <view class="audio-ot" @click="playVoice">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound2.png" mode="widthFix" style="width: 20px;height: auto;"></image> <image v-if="playshow==false" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/Sound.png" mode="widthFix" style="width: 20px;height: auto;"></image>
<image v-if="playshow==true" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/bofanggif.gif" mode="widthFix" style="width: 20px;height: auto;"></image>
<text>{{reDate2!=reDate?(reDate2+'/'):''}}{{reDate}}</text> <text>{{reDate2!=reDate?(reDate2+'/'):''}}{{reDate}}</text>
</view> </view>
<view style="font-size: 14px;color: #40766E;" @click="reset"> <view style="font-size: 14px;color: #40766E;" @click="reset">
...@@ -245,7 +246,8 @@ ...@@ -245,7 +246,8 @@
@longpress="onStartRecoder" @longpress="onStartRecoder"
@touchend="onEndRecoder" @touchend="onEndRecoder"
> >
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mic.png" mode="widthFix" style="width: 37px;height: auto;"></image> <image v-if="gifshow==false" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/mic.png" mode="widthFix" style="width: 37px;height: auto;"></image>
<image v-if="gifshow==true" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/luyin.gif" mode="widthFix" style="width: 37px;height: auto;"></image>
</view> </view>
<text class="now-date">{{ reDate }}</text> <text class="now-date">{{ reDate }}</text>
<view class="as-btn"> <view class="as-btn">
...@@ -300,7 +302,9 @@ ...@@ -300,7 +302,9 @@
min: 0, min: 0,
voicePath:'', voicePath:'',
nowbofo:false,//播放状态 nowbofo:false,//播放状态
videoContext:null videoContext:null,
gifshow:false,
playshow:false
} }
}, },
...@@ -396,11 +400,8 @@ ...@@ -396,11 +400,8 @@
}); });
}, },
uploadSuccessHandler(data, index, lists) { uploadSuccessHandler(data, index, lists) {
console.log(this.addMsg.FileList)
let r = JSON.parse(data); let r = JSON.parse(data);
this.addMsg.FileList.push(r.data); this.addMsg.FileList.push(r.data);
console.log(this.addMsg.FileList)
}, },
onRemove1(index) { onRemove1(index) {
this.addMsg.FileList.splice(index, 1); this.addMsg.FileList.splice(index, 1);
...@@ -416,6 +417,7 @@ ...@@ -416,6 +417,7 @@
scope: 'scope.record', scope: 'scope.record',
success(r) { success(r) {
console.log(r) console.log(r)
that.reDate = '00:00'
that.audioshow = true; that.audioshow = true;
},fail(){ },fail(){
wx.showModal({ wx.showModal({
...@@ -431,6 +433,7 @@ ...@@ -431,6 +433,7 @@
icon: 'success', icon: 'success',
duration: 1000 duration: 1000
}) })
that.reDate = '00:00'
that.audioshow = true; that.audioshow = true;
} else { } else {
wx.showToast({ wx.showToast({
...@@ -453,6 +456,7 @@ ...@@ -453,6 +456,7 @@
} }
}) })
}else{ }else{
that.reDate = '00:00'
that.audioshow = true; that.audioshow = true;
} }
} }
...@@ -518,6 +522,7 @@ ...@@ -518,6 +522,7 @@
// 开始录制 // 开始录制
onStartRecoder () { onStartRecoder () {
console.log('长按') console.log('长按')
this.gifshow = true
recorderManager.start({ recorderManager.start({
duration: 600000, duration: 600000,
format:'mp3' format:'mp3'
...@@ -525,23 +530,25 @@ ...@@ -525,23 +530,25 @@
}, },
// 录制结束 // 录制结束
onEndRecoder () { onEndRecoder () {
this.gifshow = false
recorderManager.stop() recorderManager.stop()
}, },
// 播放暂停录音 // 播放暂停录音
playVoice() { playVoice() {
let that = this let that = this
console.log(innerAudioContext.src)
innerAudioContext.src = this.voicePath; innerAudioContext.src = this.voicePath;
if (this.nowbofo== false) { if (this.nowbofo== false) {
this.playstartDate() this.playstartDate()
this.nowbofo=true this.nowbofo=true;
this.playshow =true
} else { } else {
console.log('暂停') console.log('暂停')
innerAudioContext.pause(); innerAudioContext.pause();
clearInterval(that.timer) clearInterval(that.timer)
this.nowbofo=false this.nowbofo=false;
this.playshow =false
} }
}, },
playstartDate(){ playstartDate(){
...@@ -551,6 +558,7 @@ ...@@ -551,6 +558,7 @@
this.min = 0 this.min = 0
} }
innerAudioContext.play() innerAudioContext.play()
this.playshow =true
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.sec++ this.sec++
if (this.sec >= 60) { if (this.sec >= 60) {
...@@ -565,6 +573,7 @@ ...@@ -565,6 +573,7 @@
let _m = this.min < 10 ? '0' + this.min : this.min let _m = this.min < 10 ? '0' + this.min : this.min
this.reDate2 = _m + ':' + _s this.reDate2 = _m + ':' + _s
if(this.reDate2==this.reDate){ if(this.reDate2==this.reDate){
this.playshow =false
innerAudioContext.stop();//视频播放完停止 innerAudioContext.stop();//视频播放完停止
this.nowbofo=false;//控制播放的字段 this.nowbofo=false;//控制播放的字段
clearInterval(this.timer) clearInterval(this.timer)
......
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