Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xinrenli-app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
郑云飞
xinrenli-app
Commits
01c69967
Commit
01c69967
authored
Apr 09, 2023
by
honghong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
音频
parent
6fa2eb07
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
38 deletions
+82
-38
components/form.vue
+19
-14
components/record/record.vue
+8
-2
pages/my/index.vue
+55
-22
No files found.
components/form.vue
View file @
01c69967
...
@@ -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
(
'图片、视频、音频选其一必填'
)
}
}
}
}
...
...
components/record/record.vue
View file @
01c69967
...
@@ -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
)
{
...
...
pages/my/index.vue
View file @
01c69967
...
@@ -4,10 +4,10 @@
...
@@ -4,10 +4,10 @@
<view
:style=
"
{ height: `calc(${globalData.statusBarHeight}rpx + 158rpx)` }">
</view>
<view
:style=
"
{ height: `calc(${globalData.statusBarHeight}rpx + 158rpx)` }">
</view>
<view
class=
"content-in"
>
<view
class=
"content-in"
>
<view
class=
"content-in-info baiyin-flex baiyin-flex-c-b"
>
<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>
<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',
...
@@ -84,7 +87,7 @@
...
@@ -84,7 +87,7 @@
<
script
>
<
script
>
import
apiBaseConfig
from
'@/config/index.js'
;
import
apiBaseConfig
from
'@/config/index.js'
;
import
{
mapMutations
}
from
'vuex'
;
import
{
mapMutations
}
from
'vuex'
;
import
{
updateUserMsg
}
from
'@/api/system/index.js'
import
{
updateUserMsg
}
from
'@/api/system/index.js'
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -92,8 +95,8 @@ export default {
...
@@ -92,8 +95,8 @@ export default {
imgBgUrl
:
apiBaseConfig
.
imgBgUrl
,
imgBgUrl
:
apiBaseConfig
.
imgBgUrl
,
globalData
:
getApp
().
globalData
,
globalData
:
getApp
().
globalData
,
scrollTopHeader
:
0
,
scrollTopHeader
:
0
,
nameDisabled
:
true
,
nameDisabled
:
true
,
nickname
:
'用户名称'
,
nickname
:
'用户名称'
,
mobile
:
''
,
//手机号
mobile
:
''
,
//手机号
list
:
[
list
:
[
{
{
...
@@ -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
let
mobile
=
uni
.
getStorageSync
(
'mobile'
)
if
(
that
.
$store
.
state
.
login
.
userInfo
&&
that
.
$store
.
state
.
login
.
userInfo
.
user
){
this
.
mobile
=
mobile
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
:
{
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,16 +168,19 @@ export default {
...
@@ -156,16 +168,19 @@ export default {
// self.upDateUserInfoMount();
// self.upDateUserInfoMount();
}
}
});
});
},
fail
:
err
=>
{
console
.
log
(
err
,
'啊hi吧I'
)
}
}
});
});
},
},
inputNameConfirm
(
e
)
{
inputNameConfirm
(
e
)
{
console
.
log
(
'======inputNameConfirm:'
,
e
.
detail
.
value
);
console
.
log
(
'======inputNameConfirm:'
,
e
.
detail
.
value
);
this
.
updateUser
(
e
.
detail
.
value
)
this
.
updateUser
(
e
.
detail
.
value
)
},
},
async
updateUser
(
value
){
async
updateUser
(
value
){
const
back_data
=
await
updateUserMsg
({
nickname
:
value
})
const
back_data
=
await
updateUserMsg
({
nickname
:
value
})
console
.
log
(
back_data
)
console
.
log
(
back_data
)
},
},
clickJumpNPage
(
row
)
{
clickJumpNPage
(
row
)
{
if
(
row
.
url
)
{
if
(
row
.
url
)
{
...
@@ -173,11 +188,29 @@ export default {
...
@@ -173,11 +188,29 @@ export default {
url
:
row
.
url
url
:
row
.
url
});
});
}
}
},
},
handleLogin
(){
handleLogin
(){
this
.
$uniGo
.
navigateTo
({
if
(
this
.
token
){
url
:
'/my/login/login'
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'
})
}
}
}
}
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment