Commit 01c69967 by honghong

音频

parent 6fa2eb07
...@@ -65,19 +65,19 @@ ...@@ -65,19 +65,19 @@
<view class="form-item-name">上传视频</view> <view class="form-item-name">上传视频</view>
</view> </view>
<view class=""> <view class="">
<comUpload v-model="formInfo.videoList" @getVal="getVideoList" ref="videoRef" :acceptType="acceptType" <comUpload v-model="formInfo.videoList" @getVal="getVideoList" ref="videoRef"
:multiple="isMultiple"></comUpload> :acceptType="acceptType" :multiple="isMultiple"></comUpload>
</view> </view>
</view> </view>
<view> <view>
<view class="d-flex j-sb a-center form-item-height-only"> <view class="d-flex j-sb a-center form-item-height-only">
<view class="form-item-name">语音描述</view> <view class="form-item-name">语音描述</view>
</view> </view>
<!-- <view class="paddding-x-three margin-y-two"> <view v-if="formInfo.voiceList" class="paddding-x-three margin-y-two">
<free-audio startPic='../../static/play.png' endPic='../../static/stop.png' audioId='audio1' <free-audio startPic='../../static/play.png' endPic='../../static/stop.png'
:url='path' @delete="handleDelete"></free-audio> audioId='audio1' :url='formInfo.voiceList[0].url' @delete="handleDelete"></free-audio>
</view> --> </view>
<view class="paddding-x-three d-flex j-center " @click="showPopup = true"> <view v-else class="paddding-x-three d-flex j-center " @click="showPopup = true">
<view class="voice-box d-flex a-center j-center"> <view class="voice-box d-flex a-center j-center">
<u-icon name="mic" color="#2979ff" size="32"></u-icon> <u-icon name="mic" color="#2979ff" size="32"></u-icon>
<view>添加语音描述</view> <view>添加语音描述</view>
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
// 获取上传视频的值 // 获取上传视频的值
getVideoList(data) { getVideoList(data) {
let that = this let that = this
console.log(data,'有的哈桑') console.log(data, '有的哈桑')
let videoList = [] let videoList = []
videoList.push({ videoList.push({
url: data.url, url: data.url,
...@@ -221,10 +221,14 @@ ...@@ -221,10 +221,14 @@
// 上传音频事件 // 上传音频事件
getVoiceList(data) { getVoiceList(data) {
// this.formInfo.videoList.push({ let that = this
// url: data.data.url, console.log(data, '有的哈桑')
// fileType: 'voice' let voiceList = []
// }) voiceList.push({
url: data.url,
fileType: 'video'
})
that.formInfo.voiceList = voiceList
}, },
//确认修改和重新发布按钮 //确认修改和重新发布按钮
handleUpdateForm() { handleUpdateForm() {
...@@ -259,9 +263,10 @@ ...@@ -259,9 +263,10 @@
let that = this let that = this
this.$refs.form.validate().then(res => { this.$refs.form.validate().then(res => {
if (res) { if (res) {
if(that.formInfo.pictureList.length || that.formInfo.videoList.length || that.formInfo.voiceList.length){ if (that.formInfo.pictureList.length || that.formInfo.videoList.length || that.formInfo
.voiceList.length) {
that.handleAdd() that.handleAdd()
}else{ } else {
uni.$u.toast('图片、视频、音频选其一必填') uni.$u.toast('图片、视频、音频选其一必填')
} }
} }
......
...@@ -73,9 +73,15 @@ ...@@ -73,9 +73,15 @@
}, },
success: (res) => { success: (res) => {
console.log(res,'dsan') console.log(res,'dsan')
that.$emit('getVal',JSON.parse(res.data)) const {
data
} = JSON.parse(res.data);
console.log(data, '大街上可能')
this.$emit('getVal', data);
setTimeout(() => { setTimeout(() => {
resolve(res.data.data) resolve(data.url)
// resolve(res.data.data)
}, 1000) }, 1000)
}, },
fail(err) { fail(err) {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<button class="content-in-info-l" type="balanced" open-type="chooseAvatar" @chooseavatar="onChooseavatar"> <button class="content-in-info-l" type="balanced" open-type="chooseAvatar" @chooseavatar="onChooseavatar">
<image src="@/static/icon/my03.png" mode=""></image> <image src="@/static/icon/my03.png" mode=""></image>
</button> </button>
<view class="content-in-info-r"> <view v-if="token" class="content-in-info-r">
<view class="content-in-info-r-t baiyin-flex"> <view class="content-in-info-r-t baiyin-flex">
<text v-if="nameDisabled">{{nickname}}</text> <text v-if="nameDisabled">{{nickname}}</text>
<input v-else confirm-type="确定" @confirm="inputNameConfirm" maxlength="15" type="text" :value="nickname" /> <input v-else confirm-type="确定" @confirm="inputNameConfirm" maxlength="15" type="text" :value="nickname" />
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
</view> </view>
<view class="content-in-info-r-b" v-if="mobile">手机号:{{mobile}}</view> <view class="content-in-info-r-b" v-if="mobile">手机号:{{mobile}}</view>
</view> </view>
<view class="content-in-info-r-b" v-else>
未登录
</view>
</view> </view>
<view class="content-in-item baiyin-flex baiyin-flex-c-sb baiyin-flex-c-b" v-for="(item, index) in list" :key="index" @click="index != 0 ? clickJumpNPage(item) : null"> <view class="content-in-item baiyin-flex baiyin-flex-c-sb baiyin-flex-c-b" v-for="(item, index) in list" :key="index" @click="index != 0 ? clickJumpNPage(item) : null">
<!-- 联系客服生成 --> <!-- 联系客服生成 -->
...@@ -27,7 +30,7 @@ ...@@ -27,7 +30,7 @@
</view> </view>
<view class="content-in-btn" @click="handleLogin"> <view class="content-in-btn" @click="handleLogin">
<u-button <u-button
text="退出登录" :text="token ? '退出登录' : '登录'"
color="#EA654E" color="#EA654E"
:customStyle="{ :customStyle="{
width: '560rpx', width: '560rpx',
...@@ -120,19 +123,28 @@ export default { ...@@ -120,19 +123,28 @@ export default {
title: '我的优惠券', title: '我的优惠券',
url: '/my/coupon/index?type=coupon' url: '/my/coupon/index?type=coupon'
} }
] ],
token:''
}; };
}, },
onLoad() { onLoad() {
this.nickname = this.$store.state.login.userInfo.user.nickname let that = this
if(that.$store.state.login.userInfo && that.$store.state.login.userInfo.user){
that.nickname = that.$store.state.login.userInfo.user.nickname
}
let token = uni.getStorageSync('token')
console.log('token',token)
if(token){
that.token = token
}
let mobile = uni.getStorageSync('mobile') let mobile = uni.getStorageSync('mobile')
this.mobile = mobile that.mobile = mobile
}, },
methods: { methods: {
...mapMutations(['upDateUserInfoMount']), ...mapMutations(['upDateUserInfoMount']),
onChooseavatar(e) { onChooseavatar(e) {
console.log(e,'1211'); console.log(e,'1211');
return; // return;
let self = this; let self = this;
const { avatarUrl } = e.detail; const { avatarUrl } = e.detail;
this.fdsa = avatarUrl; this.fdsa = avatarUrl;
...@@ -156,6 +168,9 @@ export default { ...@@ -156,6 +168,9 @@ export default {
// self.upDateUserInfoMount(); // self.upDateUserInfoMount();
} }
}); });
},
fail:err=>{
console.log(err,'啊hi吧I')
} }
}); });
}, },
...@@ -175,10 +190,28 @@ export default { ...@@ -175,10 +190,28 @@ export default {
} }
}, },
handleLogin(){ handleLogin(){
if(this.token){
uni.showModal({
content: '是否要退出登录',
success: (res) => {
if (res.confirm) {
uni.showToast({
title:'退出成功!',
icon:'none'
})
//执行退出
uni.clearStorageSync()
this.token = uni.getStorageSync('token')
}
}
})
}else{
this.$uniGo.navigateTo({ this.$uniGo.navigateTo({
url:'/my/login/login' url:'/my/login/login'
}) })
} }
}
} }
}; };
</script> </script>
......
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