Commit 01c69967 by honghong

音频

parent 6fa2eb07
......@@ -65,19 +65,19 @@
<view class="form-item-name">上传视频</view>
</view>
<view class="">
<comUpload v-model="formInfo.videoList" @getVal="getVideoList" ref="videoRef" :acceptType="acceptType"
:multiple="isMultiple"></comUpload>
<comUpload v-model="formInfo.videoList" @getVal="getVideoList" ref="videoRef"
:acceptType="acceptType" :multiple="isMultiple"></comUpload>
</view>
</view>
<view>
<view class="d-flex j-sb a-center form-item-height-only">
<view class="form-item-name">语音描述</view>
</view>
<!-- <view class="paddding-x-three margin-y-two">
<free-audio startPic='../../static/play.png' endPic='../../static/stop.png' audioId='audio1'
:url='path' @delete="handleDelete"></free-audio>
</view> -->
<view class="paddding-x-three d-flex j-center " @click="showPopup = true">
<view v-if="formInfo.voiceList" class="paddding-x-three margin-y-two">
<free-audio startPic='../../static/play.png' endPic='../../static/stop.png'
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">
<u-icon name="mic" color="#2979ff" size="32"></u-icon>
<view>添加语音描述</view>
......@@ -210,7 +210,7 @@
// 获取上传视频的值
getVideoList(data) {
let that = this
console.log(data,'有的哈桑')
console.log(data, '有的哈桑')
let videoList = []
videoList.push({
url: data.url,
......@@ -221,10 +221,14 @@
// 上传音频事件
getVoiceList(data) {
// this.formInfo.videoList.push({
// url: data.data.url,
// fileType: 'voice'
// })
let that = this
console.log(data, '有的哈桑')
let voiceList = []
voiceList.push({
url: data.url,
fileType: 'video'
})
that.formInfo.voiceList = voiceList
},
//确认修改和重新发布按钮
handleUpdateForm() {
......@@ -259,9 +263,10 @@
let that = this
this.$refs.form.validate().then(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()
}else{
} else {
uni.$u.toast('图片、视频、音频选其一必填')
}
}
......
......@@ -73,9 +73,15 @@
},
success: (res) => {
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(() => {
resolve(res.data.data)
resolve(data.url)
// resolve(res.data.data)
}, 1000)
},
fail(err) {
......
......@@ -4,10 +4,10 @@
<view :style="{ height: `calc(${globalData.statusBarHeight}rpx + 158rpx)` }"></view>
<view class="content-in">
<view class="content-in-info baiyin-flex baiyin-flex-c-b">
<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>
</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">
<text v-if="nameDisabled">{{nickname}}</text>
<input v-else confirm-type="确定" @confirm="inputNameConfirm" maxlength="15" type="text" :value="nickname" />
......@@ -15,6 +15,9 @@
</view>
<view class="content-in-info-r-b" v-if="mobile">手机号:{{mobile}}</view>
</view>
<view class="content-in-info-r-b" v-else>
未登录
</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">
<!-- 联系客服生成 -->
......@@ -27,7 +30,7 @@
</view>
<view class="content-in-btn" @click="handleLogin">
<u-button
text="退出登录"
:text="token ? '退出登录' : '登录'"
color="#EA654E"
:customStyle="{
width: '560rpx',
......@@ -84,7 +87,7 @@
<script>
import apiBaseConfig from '@/config/index.js';
import { mapMutations } from 'vuex';
import { mapMutations } from 'vuex';
import {updateUserMsg} from '@/api/system/index.js'
export default {
data() {
......@@ -92,8 +95,8 @@ export default {
imgBgUrl: apiBaseConfig.imgBgUrl,
globalData: getApp().globalData,
scrollTopHeader: 0,
nameDisabled: true,
nickname:'用户名称',
nameDisabled: true,
nickname:'用户名称',
mobile:'',//手机号
list: [
{
......@@ -120,19 +123,28 @@ export default {
title: '我的优惠券',
url: '/my/coupon/index?type=coupon'
}
]
],
token:''
};
},
onLoad() {
this.nickname = this.$store.state.login.userInfo.user.nickname
let mobile = uni.getStorageSync('mobile')
this.mobile = mobile
onLoad() {
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')
that.mobile = mobile
},
methods: {
...mapMutations(['upDateUserInfoMount']),
onChooseavatar(e) {
console.log(e,'1211');
return;
// return;
let self = this;
const { avatarUrl } = e.detail;
this.fdsa = avatarUrl;
......@@ -156,16 +168,19 @@ export default {
// self.upDateUserInfoMount();
}
});
},
fail:err=>{
console.log(err,'啊hi吧I')
}
});
},
inputNameConfirm(e) {
console.log('======inputNameConfirm:', e.detail.value);
console.log('======inputNameConfirm:', e.detail.value);
this.updateUser(e.detail.value)
},
async updateUser(value){
const back_data = await updateUserMsg({nickname:value})
console.log(back_data)
},
async updateUser(value){
const back_data = await updateUserMsg({nickname:value})
console.log(back_data)
},
clickJumpNPage(row) {
if (row.url) {
......@@ -173,11 +188,29 @@ export default {
url: row.url
});
}
},
handleLogin(){
this.$uniGo.navigateTo({
url:'/my/login/login'
})
},
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({
url:'/my/login/login'
})
}
}
}
};
......
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