Commit ee329591 authored by Mac's avatar Mac

修改东西

parent 5110e599
...@@ -221,10 +221,29 @@ ...@@ -221,10 +221,29 @@
background: #C92B2B; background: #C92B2B;
border-radius: 8px; border-radius: 8px;
}
.fbanniu{
width: 42px;
height: 42px;
border-radius: 21px;
position: fixed;
right: 20rpx;
bottom: 140rpx;
background: #40766E;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index: 99;
} }
</style> </style>
<template> <template>
<div class='friendcircle'> <div class='friendcircle'>
<!-- 发布动态按钮 -->
<view class="fbanniu"@click="btnclick">
<image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/fabupyq.png" style="height: 26rpx;" mode="aspectFit"></image>
<text style="font-size: 10px;color: #FFF;">发布</text>
</view>
<view class="mynews-top" v-if="Messagecount>0"> <view class="mynews-top" v-if="Messagecount>0">
<view class="top-box" @click="gomymessage()"> <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> <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/wodehufong.png" mode="widthFix" style="width: 16px;height: auto;"></image>
...@@ -788,7 +807,14 @@ ...@@ -788,7 +807,14 @@
this.videoContext.play() this.videoContext.play()
this.controls=true this.controls=true
} }
} },
btnclick(item) {//跳入发布
uni.navigateTo({
url: '/pages/friendcircle/release'
})
innerAudioContext.stop();
},
} }
} }
</script> </script>
...@@ -131,14 +131,32 @@ ...@@ -131,14 +131,32 @@
top: -5px; top: -5px;
background: #C92B2B; background: #C92B2B;
border-radius: 8px; border-radius: 8px;
}
.fbanniu{
width: 42px;
height: 42px;
border-radius: 21px;
position: fixed;
right: 20rpx;
bottom: 80rpx;
background: #40766E;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
z-index:99
} }
</style> </style>
<template> <template>
<div class='mynews'> <div class='mynews'>
<!-- 发布动态按钮 --> <!-- 发布动态按钮 -->
<floatbutton :list='list' openIcon='https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/fabupyq.png' <view class="fbanniu"@click="btnclick">
background='#40766E' openText='发布' bottom='80' @click='btnclick'></floatbutton> <image src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/fabupyq.png" style="height: 26rpx;" mode="aspectFit"></image>
<text style="font-size: 10px;color: #FFF;">发布</text>
</view>
<!-- <floatbutton :list='list' openIcon='https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/fabupyq.png'
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="{'width':'100vw','overflow':'hidden','margin-top':Messagecount>0?'60px':'0','height':Messagecount>0?calc('100vh-60px'):'100vh'}"> <view v-if="g.length > 0" :style="{'width':'100vw','overflow':'hidden','margin-top':Messagecount>0?'60px':'0','height':Messagecount>0?calc('100vh-60px'):'100vh'}">
<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%' }">
...@@ -344,14 +362,18 @@ ...@@ -344,14 +362,18 @@
}, },
btnclick(item) { btnclick(item) {
if (item.type == 2) { // if (item.type == 2) {
this.upvideo() // this.upvideo()
} else { // } else {
uni.navigateTo({ // uni.navigateTo({
url: '/pages/friendcircle/release?type=' + item.type // url: '/pages/friendcircle/release?type=' + item.type
}) // })
innerAudioContext.stop(); // innerAudioContext.stop();
} // }
uni.navigateTo({
url: '/pages/friendcircle/release'
})
innerAudioContext.stop();
}, },
upvideo() { upvideo() {
......
...@@ -163,6 +163,16 @@ ...@@ -163,6 +163,16 @@
<textarea placeholder="今天有什么可以给大家分享呢?" style="width: 100%;height: 100px;" maxlength='-1' confirm-type='done' v-model="addMsg.Content"> <textarea placeholder="今天有什么可以给大家分享呢?" style="width: 100%;height: 100px;" maxlength='-1' confirm-type='done' v-model="addMsg.Content">
</textarea> </textarea>
<u-radio-group v-model="addMsg.FileType" style='margin-top: 20px;'>
<u-radio
@change="releaseChange"
v-for="(item, index) in list2" :key="index"
:name="item.id"
>
{{item.name}}
</u-radio>
</u-radio-group>
<text v-if='addMsg.FileType==1 ' style="font-size: 12px;color: #333333">上传图片<span style='color: ;#A9A9A9'>(图片无上限)</span> </text> <text v-if='addMsg.FileType==1 ' style="font-size: 12px;color: #333333">上传图片<span style='color: ;#A9A9A9'>(图片无上限)</span> </text>
<text v-if=' addMsg.FileType==2' style="font-size: 12px;color: #333333">上传视频 </text> <text v-if=' addMsg.FileType==2' style="font-size: 12px;color: #333333">上传视频 </text>
<view style="width: 100%;margin-top: 15px;"> <view style="width: 100%;margin-top: 15px;">
...@@ -178,7 +188,7 @@ ...@@ -178,7 +188,7 @@
<!-- 视频 --> <!-- 视频 -->
<view style="width: 100%;margin-top: 15px;display: flex;flex-direction: row;" v-if="addMsg.FileType==2"> <view style="width: 100%;margin-top: 15px;display: flex;flex-direction: row;" v-if="addMsg.FileType==2">
<view style="width: 150px; height: 200px;position: relative;margin-right: 20px;"> <view style="width: 150px; height: 200px;position: relative;margin-right: 20px;" v-if="addMsg.FileList.length>0">
<video id="myVideo" :src="addMsg.FileList[0]" <video id="myVideo" :src="addMsg.FileList[0]"
:controls='controls' :controls='controls'
:show-center-play-btn='false' :show-center-play-btn='false'
...@@ -189,6 +199,12 @@ ...@@ -189,6 +199,12 @@
<u-icon name="play-circle-o" :size="70" color="#FFF"></u-icon> <u-icon name="play-circle-o" :size="70" color="#FFF"></u-icon>
</view> </view>
</view> </view>
<view v-if="addMsg.FileList.length==0">
<view slot="addBtn" class="slot-btn" @click="upvideo()">
<u-icon name="photograph" size="40" color="#888"></u-icon>
<view class="mian-title">上传视频</view>
</view>
</view>
</view> </view>
...@@ -296,7 +312,17 @@ ...@@ -296,7 +312,17 @@
FileList: [], FileList: [],
FileType: 0, FileType: 0,
}, },
fileList:[], fileList:[],
list2: [
{name: '文字',id:0},
{name: '图文',id:1},
{name: '视频',id:2},
{name: '音频',id:3},
],
value: 'orange',
list: [{ list: [{
'name': '全部可见', 'name': '全部可见',
Id: 1 Id: 1
...@@ -407,6 +433,10 @@ ...@@ -407,6 +433,10 @@
} }
); );
}, },
releaseChange(e){//发布的类型
console.log(e)
this.addMsg.FileList = []
},
//打开地图 //打开地图
getAddress() { getAddress() {
let that = this; let that = this;
...@@ -712,7 +742,56 @@ ...@@ -712,7 +742,56 @@
this.videoContext.play() this.videoContext.play()
this.controls=true this.controls=true
} }
} },
upvideo() {
let that = this
uni.chooseVideo({
count: 1,
sourceType: ['camera', 'album'],
success: function(res) {
console.log(res)
that.upFile(res.tempFilePath, 1)
uni.showLoading({
title: '上传中...'
})
},
fail(err) {
console.log(err, )
}
});
},
upFile(filePath, type) {
let MallBaseId = uni.getStorageSync("mall_UserInfo").MallBaseId ? uni.getStorageSync("mall_UserInfo").MallBaseId :
1;
let action = this.host2 + '/api/File/UploadTencent?MallBaseId=' + MallBaseId
let that = this
uni.uploadFile({
url: action,
filePath: filePath,
name: 'file',
formData: {
user: 'tesdt'
},
success: (uploadFileRes) => {
uni.hideLoading()
if (uploadFileRes.statusCode == 200) {
let data = JSON.parse(uploadFileRes.data)
that.addMsg.FileList.push(data.data)
}
},
fail: function(res) {
console.log(res)
wx.showToast({
title: '上传失败!',
icon: 'none',
duration: 1000
})
}
});
},
} }
} }
......
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