Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-app
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李伟
cust-app
Commits
c3f16e8b
Commit
c3f16e8b
authored
Jan 25, 2025
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改留言
parent
1087e21a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
162 additions
and
203 deletions
+162
-203
index.js
api/user/index.js
+21
-0
addMessage.vue
pagesUser/addMessage.vue
+2
-2
userFilterPage.vue
pagesUser/userFilterPage.vue
+59
-1
info.vue
pagesme/message/info.vue
+52
-159
message.vue
pagesme/message/message.vue
+28
-41
No files found.
api/user/index.js
View file @
c3f16e8b
...
...
@@ -98,3 +98,24 @@ export function addMessage(data){
method
:
'POST'
,
});
}
/**
* 获取消息列表
*/
export
function
messageList
(
data
){
return
request
({
method
:
"get"
,
url
:
'/app/memInfo/leaveMessageList'
,
data
});
}
/**
* 获取对话消息
*/
export
function
telMessage
(
data
){
return
request
({
method
:
"get"
,
url
:
'/app/memInfo/leaveMessageDetailList'
,
data
,
});
}
\ No newline at end of file
pagesUser/addMessage.vue
View file @
c3f16e8b
...
...
@@ -5,7 +5,7 @@
count
></u-textarea>
</view>
<view
class=
"adding"
@
click=
"saveAbout"
>
保存
发送
</view>
<ELM
ref=
"elm"
:msg=
"tipMsg"
:isConfirm=
"isConfirm"
@
confirm=
"confirm"
></ELM>
</view>
...
...
@@ -49,7 +49,7 @@
addMessage
(
data
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
this
.
isConfirm
=
true
;
this
.
tipMsg
=
"
保存
成功"
;
this
.
tipMsg
=
"
发送
成功"
;
this
.
$refs
.
elm
.
showDialog
();
}
else
{
this
.
tipMsg
=
res
.
data
.
msg
;
...
...
pagesUser/userFilterPage.vue
View file @
c3f16e8b
...
...
@@ -74,6 +74,18 @@
></u-icon>
</u-form-item>
</u--form>
<view
class=
"u-page__tag-item"
>
<u-tag
v-for=
"(item, index) in checkboxs"
:key=
"index"
:text=
"`选项$
{index + 1}`"
:plain="!item.checked"
type="warning"
:name="index"
@click="checkboxClick"
>
</u-tag>
</view>
<u-button
type=
"primary"
text=
"提交"
...
...
@@ -126,9 +138,10 @@
<
script
>
import
UFormItem
from
"../uni_modules/uview-ui/components/u-form-item/u-form-item"
;
import
{
getOptions
}
from
"../common/options"
;
import
UCol
from
"../uni_modules/uview-ui/components/u-col/u-col.vue"
;
export
default
{
components
:
{
UFormItem
},
components
:
{
U
Col
,
U
FormItem
},
data
()
{
return
{
//数据选项
...
...
@@ -148,6 +161,44 @@ export default {
value
:
'0101'
}]
],
checkboxs
:
[
{
checked
:
true
,
},
{
checked
:
false
,
},
{
checked
:
false
,
},
{
checked
:
false
,
},
{
checked
:
false
,
},
{
checked
:
false
,
},
{
checked
:
false
,
},
{
checked
:
false
,
},
{
checked
:
false
,
},
{
checked
:
false
,
},
{
checked
:
false
,
},
{
checked
:
false
,
},
],
//选择器显示
showSex
:
false
,
showResidence
:
false
,
...
...
@@ -216,6 +267,9 @@ export default {
memResidenceCity
:
''
,
//居住城市
}
},
checkboxClick
(
name
)
{
this
.
checkboxs
[
name
].
checked
=
!
this
.
checkboxs
[
name
].
checked
;
},
//阻止键盘
hideKeyboard
()
{
uni
.
hideKeyboard
()
...
...
@@ -230,4 +284,8 @@ export default {
padding-left
:
20rpx
;
padding-right
:
20rpx
;
}
.u-page__tag-item
{
display
:
flex
;
flex-wrap
:
wrap
;
}
</
style
>
pagesme/message/info.vue
View file @
c3f16e8b
...
...
@@ -6,22 +6,22 @@
<view
class=
"page-body"
id=
"x_chat"
>
<view
v-for=
"(item, index) in chatList"
:key=
"index"
>
<view
class=
"chat-item-body"
>
<view
class=
"chat-item-time"
>
{{
item
.
tim
e
}}
</view>
<view
v-if=
"item.
type == '0'
"
class=
"chat-item-layout chat-left"
>
<view
class=
"chat-item-time"
>
{{
item
.
createDat
e
}}
</view>
<view
v-if=
"item.
userId == targetId
"
class=
"chat-item-layout chat-left"
>
<view
class=
"chat-inner-layout"
>
<view
class=
"chat-item-name"
>
{{
item
.
n
ame
}}
</view>
<view
class=
"chat-item-name"
>
{{
item
.
memNickN
ame
}}
</view>
<view
class=
"chat-item-msg-layout"
>
<image
class=
"chat-item-photo"
@
tap=
"scanClick"
:src=
"item.photo
Url"
mode=
"aspectFit"
></image>
<view
class=
"chat-inner-msg-left"
>
{{
item
.
msg
}}
</view>
<image
class=
"chat-item-photo"
:src=
"item.avatar
Url"
mode=
"aspectFit"
></image>
<view
class=
"chat-inner-msg-left"
>
{{
item
.
leaveMessageContent
}}
</view>
</view>
</view>
</view>
<view
v-
if=
"item.type == '1'"
class=
"chat-item-layout chat-right"
>
<view
v-
else
class=
"chat-item-layout chat-right"
>
<view
class=
"chat-inner-layout"
>
<view
class=
"chat-item-name-right"
>
{{
item
.
n
ame
}}
</view>
<view
class=
"chat-item-name-right"
>
{{
item
.
memNickN
ame
}}
</view>
<view
class=
"chat-item-msg-layout"
>
<view
class=
"chat-inner-msg-right"
>
{{
item
.
msg
}}
</view>
<image
class=
"chat-item-photo"
@
tap=
"scanClick"
:src=
"item.photo
Url"
mode=
"aspectFit"
></image>
<view
class=
"chat-inner-msg-right"
>
{{
item
.
leaveMessageContent
}}
</view>
<image
class=
"chat-item-photo"
:src=
"item.avatar
Url"
mode=
"aspectFit"
></image>
</view>
</view>
</view>
...
...
@@ -37,155 +37,26 @@
</
template
>
<
script
>
import
{
addMessage
,
telMessage
}
from
"../../api/user"
;
import
{
getOssUrl
}
from
"../../api/article"
;
export
default
{
name
:
"info"
,
data
()
{
return
{
chatList
:
[
{
type
:
'0'
,
name
:
'群主'
,
msg
:
'大家好,欢迎进入微社区群,如有问题可在群里聊天询问'
,
time
:
'2024-01-26 13:43:12'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_two.jpg'
,
},
{
type
:
'0'
,
name
:
'小助手'
,
msg
:
'2024微报事、微呼应活动正在进行中,希望大家踊跃参加。'
,
time
:
'2024-01-26 13:43:15'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_service.png'
,
},
{
type
:
'1'
,
name
:
''
,
msg
:
'已参加微呼应活动'
,
time
:
'2024-01-26 13:56:10'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_three.jpg'
,
},
{
type
:
'0'
,
name
:
'第五网格员'
,
msg
:
'已参加微报事活动'
,
time
:
'2024-01-26 13:59:12'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_one.jpg'
,
},
{
type
:
'0'
,
name
:
'群主'
,
msg
:
'大家好,欢迎进入微社区群,如有问题可在群里聊天询问'
,
time
:
'2024-01-26 13:43:12'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_two.jpg'
,
},
{
type
:
'0'
,
name
:
'小助手'
,
msg
:
'2024微报事、微呼应活动正在进行中,希望大家踊跃参加。'
,
time
:
'2024-01-26 13:43:15'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_service.png'
,
},
{
type
:
'1'
,
name
:
''
,
msg
:
'已参加微呼应活动'
,
time
:
'2024-01-26 13:56:10'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_three.jpg'
,
},
{
type
:
'0'
,
name
:
'第五网格员'
,
msg
:
'已参加微报事活动'
,
time
:
'2024-01-26 13:59:12'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_one.jpg'
,
},
{
type
:
'0'
,
name
:
'群主'
,
msg
:
'大家好,欢迎进入微社区群,如有问题可在群里聊天询问'
,
time
:
'2024-01-26 13:43:12'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_two.jpg'
,
},
{
type
:
'0'
,
name
:
'小助手'
,
msg
:
'2024微报事、微呼应活动正在进行中,希望大家踊跃参加。'
,
time
:
'2024-01-26 13:43:15'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_service.png'
,
},
{
type
:
'1'
,
name
:
''
,
msg
:
'已参加微呼应活动'
,
time
:
'2024-01-26 13:56:10'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_three.jpg'
,
},
{
type
:
'0'
,
name
:
'第五网格员'
,
msg
:
'已参加微报事活动'
,
time
:
'2024-01-26 13:59:12'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_one.jpg'
,
},
{
type
:
'0'
,
name
:
'群主'
,
msg
:
'大家好,欢迎进入微社区群,如有问题可在群里聊天询问'
,
time
:
'2024-01-26 13:43:12'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_two.jpg'
,
},
{
type
:
'0'
,
name
:
'小助手'
,
msg
:
'2024微报事、微呼应活动正在进行中,希望大家踊跃参加。'
,
time
:
'2024-01-26 13:43:15'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_service.png'
,
},
{
type
:
'1'
,
name
:
''
,
msg
:
'已参加微呼应活动'
,
time
:
'2024-01-26 13:56:10'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_three.jpg'
,
},
{
type
:
'0'
,
name
:
'第五网格员'
,
msg
:
'已参加微报事活动'
,
time
:
'2024-01-26 13:59:12'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_one.jpg'
,
},
{
type
:
'0'
,
name
:
'群主'
,
msg
:
'大家好,欢迎进入微社区群,如有问题可在群里聊天询问'
,
time
:
'2024-01-26 13:43:12'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_two.jpg'
,
},
{
type
:
'0'
,
name
:
'小助手'
,
msg
:
'2024微报事、微呼应活动正在进行中,希望大家踊跃参加。'
,
time
:
'2024-01-26 13:43:15'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_service.png'
,
},
{
type
:
'1'
,
name
:
''
,
msg
:
'已参加微呼应活动'
,
time
:
'2024-01-26 13:56:10'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_three.jpg'
,
},
{
type
:
'0'
,
name
:
'第五网格员'
,
msg
:
'已参加微报事活动'
,
time
:
'2024-01-26 13:59:12'
,
photoUrl
:
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_one.jpg'
,
},
],
chatList
:
[],
inputTemp
:
''
,
targetId
:
''
,
}
},
onLoad
()
{
onLoad
(
options
)
{
this
.
targetId
=
options
.
targetId
this
.
getMessageList
()
// 滚动到页面底部
this
.
pageScrollToBottom
()
},
onShow
(){
this
.
getMessageList
()
// 滚动到页面底部
this
.
pageScrollToBottom
()
},
...
...
@@ -196,6 +67,28 @@ export default {
bindKeyInput
(
e
)
{
this
.
inputTemp
=
e
.
detail
.
value
},
getMessageList
()
{
const
form
=
{
page
:
1
,
rows
:
10
,
targetId
:
this
.
targetId
}
telMessage
(
form
).
then
(
res
=>
{
console
.
log
(
'11111111'
,
res
.
data
.
data
)
this
.
chatList
=
res
.
data
.
data
this
.
chatList
.
forEach
(
item
=>
{
//处理头像
if
(
item
.
avatar
!=
null
&&
item
.
avatar
!=
''
){
getOssUrl
(
item
.
avatar
).
then
(
imgRes
=>
{
if
(
imgRes
.
data
.
data
!=
null
)
{
imgRes
.
data
.
data
=
imgRes
.
data
.
data
.
replace
(
/
\\
/g
,
"/"
);
item
.
avatarUrl
=
imgRes
.
data
.
data
}
})
}
})
})
},
/**
* 发送
*/
...
...
@@ -208,14 +101,14 @@ export default {
})
return
}
this
.
inputTemp
=
""
const
chatObj
=
{}
chatObj
.
type
=
'1'
chatObj
.
name
=
''
chatObj
.
msg
=
inputValue
chatObj
.
time
=
this
.
getCurTime
()
chatObj
.
photoUrl
=
'https://zhsq.zhnbxc.top:58080/weChatFile/szfwPeople/icon_chat_photo_three.jpg
'
this
.
chatList
.
push
(
chatObj
)
const
data
=
{
targetId
:
this
.
targetId
,
content
:
inputValue
}
addMessage
(
data
).
then
(
res
=>
{
this
.
getMessageList
()
this
.
inputTemp
=
'
'
}
)
// 滚动到页面底部
this
.
pageScrollToBottom
()
},
...
...
pagesme/message/message.vue
View file @
c3f16e8b
...
...
@@ -9,16 +9,16 @@
<view
class=
"card"
>
<view
class=
"recommendation-card"
v-for=
"item in userList"
@
click=
"gotoBusinessDetail(item)"
>
<view
class=
"card-image"
style=
"justify-content: left;display: flex"
>
<image
class=
"img"
src=
"https://cdn.uviewui.com/uview/album/1.jpg
"
/>
<image
class=
"img"
:src=
"item.avatarUrl
"
/>
<view
style=
"margin-left: 20rpx;margin-top: 20rpx;font-weight: 400;font-size: 32rpx"
>
{{
item
.
n
ickName
}}
{{
item
.
memN
ickName
}}
<view
class=
"message"
>
{{
item
.
message
}}
{{
item
.
leaveMessageContent
}}
</view>
</view>
</view>
<view
style=
"margin: 20rpx 20rpx 0 0;font-size: 24rpx;color: #8a8888;"
>
{{
item
.
create
Tim
e
}}
{{
item
.
create
Dat
e
}}
</view>
</view>
</view>
...
...
@@ -27,6 +27,9 @@
</
template
>
<
script
>
import
{
messageList
}
from
"../../api/user"
;
import
{
getOssUrl
}
from
"../../api/article"
;
export
default
{
data
()
{
return
{
...
...
@@ -46,7 +49,7 @@ export default {
menuButtonInfo
:
''
,
};
},
on
Load
()
{
on
Show
()
{
//获取当前页面的页头高度
this
.
menuButtonInfo
=
uni
.
getMenuButtonBoundingClientRect
()
const
{
...
...
@@ -68,44 +71,28 @@ export default {
},
methods
:
{
getUserList
(){
//我喜欢的
const
list
=
[
{
nickName
:
'暖洋洋'
,
message
:
'你好'
,
createTime
:
'2021-08-08 12:12:12'
},
{
nickName
:
'暖洋洋'
,
message
:
'最近的一条信息'
,
createTime
:
'2021-08-08 12:12:12'
},
{
nickName
:
'暖洋洋'
,
message
:
'最近的一条信息'
,
createTime
:
'2021-08-08 12:12:12'
},
{
nickName
:
'暖洋洋'
,
message
:
'最近的一条信息'
,
createTime
:
'2021-08-08 12:12:12'
},
{
nickName
:
'暖洋洋'
,
message
:
'最近的一条信息'
,
createTime
:
'2021-08-08 12:12:12'
},
{
nickName
:
'暖洋洋'
,
message
:
'最近的一条信息测试长度滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴滴的'
,
createTime
:
'2021-08-08 12:12:12'
},
]
this
.
userList
=
list
const
query
=
{
page
:
1
,
rows
:
10
}
messageList
(
query
).
then
(
res
=>
{
this
.
userList
=
res
.
data
.
data
this
.
userList
.
forEach
(
item
=>
{
//处理头像
if
(
item
.
avatar
!=
null
&&
item
.
avatar
!=
''
){
getOssUrl
(
item
.
avatar
).
then
(
imgRes
=>
{
if
(
imgRes
.
data
.
data
!=
null
)
{
imgRes
.
data
.
data
=
imgRes
.
data
.
data
.
replace
(
/
\\
/g
,
"/"
);
item
.
avatarUrl
=
imgRes
.
data
.
data
}
})
}
})
})
},
gotoBusinessDetail
(){
gotoBusinessDetail
(
item
){
uni
.
navigateTo
({
url
:
"/pagesme/message/info
"
url
:
"/pagesme/message/info
?targetId="
+
item
.
targetId
})
},
backbar
()
{
...
...
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