Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
施宇
/
icsalesProgram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
dd72dbb5
authored
Sep 29, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1111
parent
bff2d0d5
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
21 deletions
app.js
components/chat/inputbar/inputbar.js
components/chat/inputbar/suit/main/main.wxml
components/chat/inputbar/suit/main/main.wxss
pages/detail/chat/index.js
pages/tab/message/message.js
utils/chat.js
utils/util.js
app.js
View file @
dd72dbb5
...
...
@@ -8,8 +8,6 @@ import {
import
{
apis
}
from
'./utils/api.js'
;
App
({
globalData
:
{
auth
:
wx
.
getStorageSync
(
'auth'
),
//是否授权
...
...
@@ -45,6 +43,7 @@ App({
wx
.
setStorageSync
(
"member"
,
member
)
},
onLaunch
()
{
wx
.
removeStorageSync
(
'is_ShowModal'
)
//由于小程序的show切后台时会执行,导致异地登入弹窗会重复弹起,所以设置一个缓存进行转换
this
.
versionUpdate
();
//验证是否授权
if
(
this
.
globalData
.
auth
)
{
...
...
components/chat/inputbar/inputbar.js
View file @
dd72dbb5
...
...
@@ -56,7 +56,7 @@ Component({
ready
()
{
this
.
setData
({
isIPX
:
getApp
().
globalData
.
isIPX
})
})
;
let
comps
=
this
.
data
.
__comps__
;
comps
.
main
=
this
.
selectComponent
(
"#chat-suit-main"
);
comps
.
emoji
=
this
.
selectComponent
(
"#chat-suit-emoji"
);
...
...
components/chat/inputbar/suit/main/main.wxml
View file @
dd72dbb5
...
...
@@ -6,15 +6,15 @@
class="f news"
type="text"
value="{{ inputMessage }}"
cursor-spacing="
65
"
cursor-spacing="
10
"
confirm-type="send"
bindconfirm="sendMessage"
bindinput="bindMessage"
bindtap="focus"
bindfocus="focus"
bindblur="blur"
placeholder-class="chatinput-placeholder"
placeholder="{{isTopic?'不来点什么吗?':'输入新消息'}}"
placeholder-style="color:#CFCFCF; padding-left:5px;"
/>
<view class="send_btn" bind:tap="sendMessage">{{isTopic?'发布':'发送'}}</view>
...
...
components/chat/inputbar/suit/main/main.wxss
View file @
dd72dbb5
.text-input {
width: 100%;
height: 100rpx;
padding: 0;
display: block;
}
.news {
...
...
@@ -13,27 +11,32 @@
font-size: 28rpx;
padding: 0 32rpx;
display: inline-block;
margin-left:24rpx;
margin-left:
24rpx;
line-height: 48rpx;
position:
relative;
position:
relative;
top: 0;
background-color: #
E6ECF
2;
background-color: #
e6ecf
2;
border-radius: 8rpx;
box-sizing: border-box;
}
.chatinput-placeholder {
color: #cfcfcf;
padding-left: 5px;
}
.send_btn {
flex: 0 0 120rpx;
font-size: 28rpx;
color:#0D84D
1;
color: #0d84d
1;
padding: 0;
height:62rpx;
height:
62rpx;
text-align: center;
line-height: 62rpx;
}
.f-row{
height:
100rpx;
display:
flex;
align-items:
center;
.f-row
{
height:
100rpx;
display:
flex;
align-items:
center;
}
pages/detail/chat/index.js
View file @
dd72dbb5
...
...
@@ -32,7 +32,7 @@ Page({
},
onUnload
()
{
disp
.
fire
(
"em.chatroom.leave"
);
//
disp.fire("em.chatroom.leave");
},
closeTip
:
function
()
{
this
.
setData
({
...
...
pages/tab/message/message.js
View file @
dd72dbb5
...
...
@@ -172,7 +172,7 @@ Page({
userId
:
wx
.
getStorageSync
(
'user_id'
),
});
if
(
getApp
().
globalData
.
imBoolean
&&
isShowModal
)
{
reloginIm
()
reloginIm
(
true
)
}
},
...
...
utils/chat.js
View file @
dd72dbb5
...
...
@@ -199,7 +199,9 @@ const webimListen = () => {
let
curPage
=
pages
[
pages
.
length
-
1
];
getApp
().
globalData
.
imBoolean
=
true
;
wx
.
setStorageSync
(
'is_ShowModal'
,
true
);
if
(
curPage
.
route
==
"pages/detail/chat/index"
||
curPage
.
route
==
'pages/tab/message/message'
)
{
if
(
curPage
.
route
==
'pages/tab/message/message'
)
{
reloginIm
(
true
)
}
else
if
(
curPage
.
route
==
"pages/detail/chat/index"
){
reloginIm
()
}
}
else
if
(
error
.
type
==
1
)
{
//用户名或者账号错误
...
...
utils/util.js
View file @
dd72dbb5
...
...
@@ -343,7 +343,7 @@ const matchReg = (str) => {
let
newStr
=
str
.
replace
(
reg
,
''
);
return
newStr
}
const
reloginIm
=
()
=>
{
const
reloginIm
=
(
bool
)
=>
{
wx
.
showModal
({
title
:
'提示'
,
content
:
'您的聊天账号掉线啦!'
,
...
...
@@ -355,7 +355,12 @@ const reloginIm = () => {
getApp
().
conn
.
reopen
();
}
else
if
(
res
.
cancel
)
{
wx
.
switchTab
({
url
:
'/pages/tab/home/home'
url
:
'/pages/tab/home/home'
,
success
:
function
(){
if
(
bool
)
{
wx
.
setStorageSync
(
'is_ShowModal'
,
true
)
};
}
});
}
}
...
...
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