Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lumastoreapp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xieyishang
lumastoreapp
Commits
c3a95dfc
Commit
c3a95dfc
authored
Nov 17, 2021
by
xieyishang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addxx
parent
3195aa15
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
79 deletions
+70
-79
manifest.json
manifest.json
+2
-2
pages/chat/chat/chat.vue
pages/chat/chat/chat.vue
+46
-29
pages/chat/message/message.vue
pages/chat/message/message.vue
+9
-3
store/Im_store.js
store/Im_store.js
+10
-42
utils/request.js
utils/request.js
+3
-3
No files found.
manifest.json
View file @
c3a95dfc
...
...
@@ -2,8 +2,8 @@
"name"
:
"鹿马商家助手"
,
"appid"
:
"__UNI__1EA80F1"
,
//这个是
web
的
"description"
:
"商家"
,
"versionName"
:
"1.1
68
"
,
"versionCode"
:
11
68
,
"versionName"
:
"1.1
70
"
,
"versionCode"
:
11
70
,
"transformPx"
:
false
,
"compatible"
:
{
"ignoreVersion"
:
true
//
true
表示忽略版本检查提示框,HBuilderX
1.9
.
0
及以上版本支持
...
...
pages/chat/chat/chat.vue
View file @
c3a95dfc
...
...
@@ -122,28 +122,11 @@
<view
v-if=
"item.elemType==3"
class=
"item flex_col"
:class=
"item.isSelf == true ? 'push':'pull' "
>
<image
:src=
"item.userAvatar"
mode=
"aspectFill"
class=
"pic"
></image>
<view
class=
"contentss"
>
<view
class=
"xiaoxineir"
v-if=
"item.imageElem && item.myimgfile"
>
<image
@
tap=
"showimgdetaile(item)"
style=
"width: 100upx;"
class=
"xiaoxiimgs
"
:src=
"item
.myimgfile.path | parsepath
"
mode=
"widthFix"
>
<view
class=
"xiaoxineir"
>
<image
@
load=
"loadimgbefor"
@
tap=
"showimgdetaile(item)"
class=
"xiaoxiimgs"
style=
"width: 100upx;
"
:src=
"item
| geturlfun
"
mode=
"widthFix"
>
</image>
</view>
<view
class=
"xiaoxineir"
v-else-if=
"item.imageElem.path"
>
<image
@
tap=
"showimgdetaile(item)"
class=
"xiaoxiimgs"
style=
"width: 100upx;"
:src=
"item.imageElem.path | parsepath"
mode=
"widthFix"
>
</image>
</view>
<view
class=
"xiaoxineir"
v-else-if=
"item.imageElem.imageList"
>
<image
v-if=
"item.imageElem.imageList.length!=0"
@
tap=
"showimgdetaile(item)"
class=
"xiaoxiimgs"
style=
"width: 100upx;"
:src=
"item.imageElem.imageList[0].url | parsepath"
mode=
"widthFix"
>
</image>
<image
v-else
class=
"xiaoxiimgs"
style=
"width: 100upx;"
src=
"/static/chat/imgloaderr.png"
mode=
"widthFix"
></image>
</view>
<view
class=
"xiaoxineir"
v-else
>
<image
class=
"xiaoxiimgs"
style=
"width: 100upx;"
src=
"/static/chat/imgloaderr.png"
mode=
"widthFix"
></image>
</view>
</view>
</view>
<!-- 语音消息 4 -->
...
...
@@ -310,6 +293,40 @@
},
dateFormat
(
value
)
{
return
timestampToTime
(
value
);
},
//过滤器加载图片
geturlfun
(
item
)
{
try
{
let
url
=
""
;
// #ifndef APP-PLUS
if
(
item
.
payload
.
imageInfoArray
)
{
url
=
item
.
payload
.
imageInfoArray
[
0
].
url
};
// #endif
// #ifdef APP-PLUS
//两种形式的图片
if
(
item
.
imageElem
)
{
if
(
item
.
imageElem
.
path
)
{
if
(
item
.
imageElem
.
path
.
indexOf
(
"
http
"
)
!=
-
1
)
{
url
=
item
.
imageElem
.
path
;
}
else
{
url
=
"
file://
"
+
item
.
imageElem
.
path
;
}
}
}
//网络资源图片
if
(
item
.
url_imageList
){
if
(
item
.
url_imageList
.
length
!=
0
){
url
=
item
.
url_imageList
[
0
].
url
;
}
}
// #endif
// console.info("url",url);
return
url
;
}
catch
(
err
)
{
return
"
/static/chat/imgloaderr.png
"
;
}
}
},
data
()
{
...
...
@@ -475,6 +492,11 @@
}
},
methods
:
{
//图片加载完成
loadimgbefor
(){
// console.info('图片加载完成');
this
.
ToTheBottom
();
},
//发送快捷语
shendkjy
(
item
)
{
this
.
content
=
item
.
name
;
...
...
@@ -886,8 +908,6 @@
//item.imageElem.path
//item.imageElem.path
if
(
item
.
imageElem
)
{
// this.$api.msg("1");
// return false;
if
(
item
.
imageElem
.
path
)
{
if
(
item
.
imageElem
.
path
.
indexOf
(
"
http
"
)
!=
-
1
)
{
url
=
item
.
imageElem
.
path
;
...
...
@@ -897,13 +917,10 @@
}
}
if
(
item
.
myimgfile
)
{
if
(
item
.
myimgfile
.
path
)
{
if
(
item
.
myimgfile
.
path
.
indexOf
(
"
http
"
)
!=
-
1
)
{
url
=
item
.
myimgfile
.
path
;
}
else
{
url
=
"
file://
"
+
item
.
myimgfile
.
path
;
}
//网络资源图片
if
(
item
.
url_imageList
){
if
(
item
.
url_imageList
.
length
!=
0
){
url
=
item
.
url_imageList
[
0
].
url
;
}
}
// #endif
...
...
pages/chat/message/message.vue
View file @
c3a95dfc
...
...
@@ -27,8 +27,14 @@
<view
v-if=
"item.lastMessage"
class=
"istimes"
>
{{
item
.
lastMessage
.
time
|
dateFormat
}}
</view>
</view>
<view
v-if=
"item.lastMessage"
class=
"isliaotcon oneline"
>
<text
v-show=
"item.unreadCount==0"
>
[已读]
</text>
<text
v-show=
"item.unreadCount!=0"
>
[未读]
</text>
<text
v-show=
"item.unreadCount==0 && item.lastMessage.isSelf==false && item.type==1"
>
[已读]
</text>
<text
v-show=
"item.unreadCount!=0 && item.lastMessage.isSelf==false && item.type==1"
>
[未读]
</text>
<!-- 不是自己发的 -->
<text
v-show=
"item.lastMessage.isPeerRead==true && item.lastMessage.isSelf==true && item.type==1"
>
[已读]
</text>
<text
v-show=
"item.lastMessage.isPeerRead!=true && item.lastMessage.isSelf==true && item.type==1"
>
[未读]
</text>
<!-- 自己发的 -->
<text
v-if=
"item.lastMessage.textElem && (item.type==1 || item.type==2)"
>
{{
item
.
lastMessage
.
textElem
.
msg
}}
</text>
<text
v-if=
"item.lastMessage.elemType==2"
>
[自定义消息]
</text>
<text
v-if=
"item.lastMessage.elemType==3"
>
[图片消息]
</text>
...
...
@@ -121,7 +127,7 @@
//获取会话列表 APP
getConversationList
()
{
this
.
$store
.
dispatch
(
"
getConversationList
"
,
{}).
then
((
res
)
=>
{
console
.
info
(
"
APP获取会话列表成功
"
,
res
);
//
console.info("APP获取会话列表成功",res);
});
//获取会话列表
},
tochats
(
item
)
{
...
...
store/Im_store.js
View file @
c3a95dfc
...
...
@@ -135,13 +135,14 @@ const Im_store = {
store
.
dispatch
(
"
messageTisfun
"
,
{});
//播放提醒消息
}
}
else
if
(
result
.
type
==
'
onRecvC2CReadReceipt
'
){
if
(
store
.
state
.
dfuserId
==
result
.
receiptList
[
0
].
userId
)
{
store
.
dispatch
(
"
getC2CHistoryMessageList
"
,
{
msgId
:
""
}).
then
((
res
)
=>
{});
//去刷新聊天界面的消息
store
.
dispatch
(
"
getConversationList
"
,
{}).
then
(()
=>
{});
//刷新获取会话列表
}
else
{
store
.
dispatch
(
"
getConversationList
"
,
{}).
then
(()
=>
{});
//刷新获取会话列表
store
.
dispatch
(
"
messageTisfun
"
,
{});
//播放提醒消息
}
// if (store.state.dfuserId == result.receiptList[0].userId) {
// store.dispatch("getC2CHistoryMessageList", {msgId:""}).then((res) => {}); //去刷新聊天界面的消息
// store.dispatch("getConversationList", {}).then(()=>{}); //刷新获取会话列表
// } else {
// store.dispatch("getConversationList", {}).then(()=>{}); //刷新获取会话列表
// store.dispatch("messageTisfun", {}); //播放提醒消息
// }
return
false
;
}
else
{
store
.
dispatch
(
"
getConversationList
"
,
{}).
then
(()
=>
{});
//刷新获取会话列表
store
.
dispatch
(
"
messageTisfun
"
,
{});
//播放提醒消息
...
...
@@ -307,25 +308,9 @@ const Im_store = {
msgs
.
reverse
();
//数组逆序一下
msgs
=
msgs
.
map
((
msg
,
index
)
=>
{
if
(
msg
.
elemType
==
3
)
{
txIm
.
downloadImage
({
"
msgId
"
:
msg
.
msgId
},
progressResult
=>
{
},
succResult
=>
{
//下载成功
if
(
succResult
.
path
)
{
msg
.
myimgfile
=
succResult
;
}
},
failResult
=>
{
})
//获取图片资源
txIm
.
getImageUrl
({
"
msgId
"
:
msg
.
msgId
},
result
=>
{
if
(
result
.
code
==
0
){
msg
.
url_imageList
=
result
.
imageList
;
}
msg
.
url_imageList
=
result
.
imageList
;
})
}
else
if
(
msg
.
elemType
==
4
)
{
...
...
@@ -412,26 +397,9 @@ const Im_store = {
if
(
msg
.
elemType
==
3
)
{
//下载图片
txIm
.
downloadImage
({
"
msgId
"
:
msg
.
msgId
},
progressResult
=>
{
// console.info("progressResult",progressResult);
},
succResult
=>
{
//下载成功
if
(
succResult
.
path
)
{
// console.info("succResult",succResult)
msg
.
myimgfile
=
succResult
;
}
},
failResult
=>
{
//下载失败
})
//获取图片资源
txIm
.
getImageUrl
({
"
msgId
"
:
msg
.
msgId
},
result
=>
{
if
(
result
.
code
==
0
){
msg
.
url_imageList
=
result
.
imageList
;
}
msg
.
url_imageList
=
result
.
imageList
;
})
}
else
if
(
msg
.
elemType
==
4
)
{
...
...
utils/request.js
View file @
c3a95dfc
...
...
@@ -76,7 +76,7 @@ export default function request(api, method, data, {noAuth = false, noVerify = f
//return false;
// uni.hideLoading();
console
.
info
(
"
ssss
"
);
//
console.info("ssss");
}
}
...
...
@@ -119,8 +119,8 @@ export default function request(api, method, data, {noAuth = false, noVerify = f
header
:
header
,
data
:
data
||
{},
success
:
(
res
)
=>
{
console
.
info
(
"
data
"
,
data
);
console
.
info
(
"
res
"
,
res
);
//
console.info("data",data);
//
console.info("res",res);
// uni.hideLoading();
if
(
noVerify
)
reslove
(
res
.
data
,
res
);
...
...
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