Commit 282955e9 by honghong

要写上传头像

parent a40fee19
......@@ -2,7 +2,7 @@
<!-- 音频播放器组件 -->
<view v-if='url' class='flex justify-between a-center audio j-sb'>
<view class="d-flex">
<view :class="status ? 'timeCheck' : ''" class="font" v-if="duration != 0">{{duration.toFixed(0)}}</view>
<view :class="status ? 'timeCheck' : ''" class="font" >11</view>
<view class='' @click='start(audioId)'>
<image :src='startPic' class='icon' v-show='!status'></image>
<image :src='endPic' class='icon' v-show='status'></image>
......@@ -13,10 +13,13 @@
</view> -->
<!-- <view>{{getTime(Math.round(currentTime))}}</view> -->
</view>
<view>{{getTime(Math.round(currentTime))}}</view>
<view @click="handleIconDel">
<u-icon name="close-circle-fill" color="#D9001B" size="32"></u-icon>
<view class="d-flex" v-if="isDel">
<view>{{getTime(Math.round(currentTime))}}</view>
<view @click="handleIconDel">
<u-icon name="close-circle-fill" color="#D9001B" size="32"></u-icon>
</view>
</view>
</view>
</template>
......@@ -36,10 +39,19 @@
type: String,
default: '#0E7EFC'
},
startPic: String,
endPic: String,
startPic: {
type: String,
default: '../../static/stopStatus.png'
},
endPic: {
type: String,
default: '../../static/startStatus.png'
},
audioId: [String, Number],
isDel: true
isDel:{
type:Boolean,
default: true
}
},
created() {
this.context = uni.createInnerAudioContext();
......
......@@ -56,7 +56,7 @@
<view class="form-tips">以下内容三选一必填</view>
</view>
<view class="">
<comUpload v-model="formInfo.pictureList" @getVal="getPhotoList" @delVal="delPhotoItem"
<comUpload v-model="formInfo.pictureList" @getVal="getPhotoList" @delVal="delPhotoItem"
ref="photoRef"></comUpload>
</view>
</view>
......@@ -65,13 +65,22 @@
<view class="form-item-name">上传视频</view>
</view>
<view class="">
<video class="video-box" v-if="formInfo.videoList.length" id="myVideo"
:src="formInfo.videoList[0].url"
@error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls
:show-fullscreen-btn='false'></video>
<comUpload v-else :afterWidth="350" v-model="formInfo.videoList" @getVal="getVideoList" ref="videoRef"
:acceptType="acceptType" :maxCount="1" :multiple="isMultiple"></comUpload>
<view v-if="formInfo.videoList.length">
<view class="video-box">
<video id="myVideo" :src="formInfo.videoList[0].url"
@error="videoErrorCallback" :danmu-list="danmuList" enable-danmu controls
:show-fullscreen-btn='false'></video>
</view>
<view @click="delVideoList">
<u-icon name="close-circle-fill" color="#D9001B" size="32"></u-icon>
</view>
</view>
<comUpload v-else :afterWidth="350" @getVal="getVideoList"
ref="videoRef" :acceptType="acceptType" :maxCount="1" :multiple="isMultiple">
</comUpload>
</view>
</view>
<view>
......@@ -79,8 +88,8 @@
<view class="form-item-name">语音描述</view>
</view>
<view v-if="formInfo.voiceList.length" class="">
<free-audio startPic='../../static/play.png' endPic='../../static/stop.png'
audioId='audio1' :url='formInfo.voiceList[0].url' @delete="handleDelete"></free-audio>
<free-audio audioId='audio1' :url='formInfo.voiceList[0].url' @delete="handleDelete">
</free-audio>
</view>
<view v-else class="paddding-x-three d-flex j-center " @click="showPopup = true">
<view class="voice-box d-flex a-center j-center">
......@@ -223,7 +232,12 @@
})
that.formInfo.videoList = videoList
},
delVideoList(){
console.log('删除',this.formInfo.videoList)
this.formInfo.videoList.splice(0, 1)
console.log('删除后',this.formInfo.videoList)
},
// 上传音频事件
getVoiceList(data) {
let that = this
......@@ -309,7 +323,7 @@
handleDelete() {
console.log('删除')
let that = this
that.formInfo.voiceList.splice(0,1)
that.formInfo.voiceList.splice(0, 1)
// const recorderManager = uni.getRecorderManager()
// console.log(recorderManager,'大数据可能')
},
......@@ -356,11 +370,21 @@
}
}
}
.video-box{
width:373rpx;
height:210rpx;
.video-box {
width: 373rpx;
height: 210rpx;
video{
width:100%;
height:100%
}
}
.position-icon {
}
@import url("@/css/form.css");
// ::v-deep .u-border {
......
......@@ -49,8 +49,8 @@
</view>
<!-- class="content-voice-audio" -->
<view class="margin-y-two">
<free-audio startPic='../../static/play.png' endPic='../../static/stop.png'
audioId='audio1' :url='detailData.voiceList[0].url'></free-audio>
<free-audio
audioId='audio1' :url='detailData.voiceList[0].url' :isDel="false"></free-audio>
</view>
</view>
<view class="content-remarks">
......
......@@ -124,7 +124,11 @@ export default {
url: '/my/coupon/index?type=coupon'
}
],
token:''
token:'',
userParams:{
nickname:'',
headImgUrl:'',
}
};
},
onLoad() {
......@@ -141,7 +145,6 @@ export default {
that.mobile = mobile
},
methods: {
...mapMutations(['upDateUserInfoMount']),
onChooseavatar(e) {
console.log(e,'1211');
// return;
......@@ -150,24 +153,23 @@ export default {
this.fdsa = avatarUrl;
wx.getFileSystemManager().readFile({
filePath: avatarUrl, //选择图片返回的相对路径
encoding: 'base64', //编码格式
// encoding: 'base64', //编码格式
success: res => {
//成功的回调
console.log(res);
console.log(res.data);
userUpdatePOST({
headImgUrl: res.data
}).then(res => {
console.log(res.code, 'pppppppppppp');
if (res.code === 200) {
uni.showToast({
title: '修改成功',
icon: 'none'
});
console.log(111111111111);
// self.upDateUserInfoMount();
}
});
// userUpdatePOST({
// headImgUrl: res.data
// }).then(res => {
// console.log(res.code, 'pppppppppppp');
// if (res.code === 200) {
// uni.showToast({
// title: '修改成功',
// icon: 'none'
// });
// console.log(111111111111);
// }
// });
},
fail:err=>{
console.log(err,'啊hi吧I')
......@@ -175,12 +177,21 @@ export default {
});
},
inputNameConfirm(e) {
console.log('======inputNameConfirm:', e.detail.value);
this.updateUser(e.detail.value)
console.log('======inputNameConfirm:', e.detail.value);
let that = this
that.$set(that.userParams,'nickname',e.detail.value)
this.updateUser()
},
async updateUser(value){
const back_data = await updateUserMsg({nickname:value})
console.log(back_data)
async updateUser(){
const back_data = await updateUserMsg(this.userParams)
console.log(back_data)
const {code} = back_data
if(code === 200){
uni.showToast({
title:'修改成功!',
icon:'none'
})
}
},
clickJumpNPage(row) {
if (row.url) {
......
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