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
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
34 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 {
...
@@ -8,8 +8,6 @@ import {
import
{
import
{
apis
apis
}
from
'./utils/api.js'
;
}
from
'./utils/api.js'
;
App
({
App
({
globalData
:
{
globalData
:
{
auth
:
wx
.
getStorageSync
(
'auth'
),
//是否授权
auth
:
wx
.
getStorageSync
(
'auth'
),
//是否授权
...
@@ -45,6 +43,7 @@ App({
...
@@ -45,6 +43,7 @@ App({
wx
.
setStorageSync
(
"member"
,
member
)
wx
.
setStorageSync
(
"member"
,
member
)
},
},
onLaunch
()
{
onLaunch
()
{
wx
.
removeStorageSync
(
'is_ShowModal'
)
//由于小程序的show切后台时会执行,导致异地登入弹窗会重复弹起,所以设置一个缓存进行转换
this
.
versionUpdate
();
this
.
versionUpdate
();
//验证是否授权
//验证是否授权
if
(
this
.
globalData
.
auth
)
{
if
(
this
.
globalData
.
auth
)
{
...
...
components/chat/inputbar/inputbar.js
View file @
dd72dbb5
...
@@ -56,7 +56,7 @@ Component({
...
@@ -56,7 +56,7 @@ Component({
ready
()
{
ready
()
{
this
.
setData
({
this
.
setData
({
isIPX
:
getApp
().
globalData
.
isIPX
isIPX
:
getApp
().
globalData
.
isIPX
})
})
;
let
comps
=
this
.
data
.
__comps__
;
let
comps
=
this
.
data
.
__comps__
;
comps
.
main
=
this
.
selectComponent
(
"#chat-suit-main"
);
comps
.
main
=
this
.
selectComponent
(
"#chat-suit-main"
);
comps
.
emoji
=
this
.
selectComponent
(
"#chat-suit-emoji"
);
comps
.
emoji
=
this
.
selectComponent
(
"#chat-suit-emoji"
);
...
...
components/chat/inputbar/suit/main/main.wxml
View file @
dd72dbb5
...
@@ -6,15 +6,15 @@
...
@@ -6,15 +6,15 @@
class="f news"
class="f news"
type="text"
type="text"
value="{{ inputMessage }}"
value="{{ inputMessage }}"
cursor-spacing="
65
"
cursor-spacing="
10
"
confirm-type="send"
confirm-type="send"
bindconfirm="sendMessage"
bindconfirm="sendMessage"
bindinput="bindMessage"
bindinput="bindMessage"
bindtap="focus"
bindtap="focus"
bindfocus="focus"
bindfocus="focus"
bindblur="blur"
bindblur="blur"
placeholder-class="chatinput-placeholder"
placeholder="{{isTopic?'不来点什么吗?':'输入新消息'}}"
placeholder="{{isTopic?'不来点什么吗?':'输入新消息'}}"
placeholder-style="color:#CFCFCF; padding-left:5px;"
/>
/>
<view class="send_btn" bind:tap="sendMessage">{{isTopic?'发布':'发送'}}</view>
<view class="send_btn" bind:tap="sendMessage">{{isTopic?'发布':'发送'}}</view>
...
...
components/chat/inputbar/suit/main/main.wxss
View file @
dd72dbb5
.text-input {
.text-input {
width: 100%;
width: 100%;
height: 100rpx;
height: 100rpx;
padding: 0;
padding: 0;
display: block;
display: block;
}
}
.news {
.news {
width: 100%;
width: 100%;
height: 62rpx;
height: 62rpx;
font-size: 28rpx;
font-size: 28rpx;
padding: 0 32rpx;
padding: 0 32rpx;
display: inline-block;
display: inline-block;
margin-left:24rpx;
margin-left:
24rpx;
line-height: 48rpx;
line-height: 48rpx;
position:
relative;
position:
relative;
top: 0;
top: 0;
background-color: #
E6ECF
2;
background-color: #
e6ecf
2;
border-radius: 8rpx;
border-radius: 8rpx;
box-sizing: border-box;
box-sizing: border-box;
}
}
.chatinput-placeholder {
color: #cfcfcf;
padding-left: 5px;
}
.send_btn {
.send_btn {
flex: 0 0 120rpx;
flex: 0 0 120rpx;
font-size: 28rpx;
font-size: 28rpx;
color:#0D84D
1;
color: #0d84d
1;
padding: 0;
padding: 0;
height:62rpx;
height:
62rpx;
text-align: center;
text-align: center;
line-height: 62rpx;
line-height: 62rpx;
}
}
.f-row{
.f-row
{
height:
100rpx;
height:
100rpx;
display:
flex;
display:
flex;
align-items:
center;
align-items:
center;
}
}
pages/detail/chat/index.js
View file @
dd72dbb5
...
@@ -32,7 +32,7 @@ Page({
...
@@ -32,7 +32,7 @@ Page({
},
},
onUnload
()
{
onUnload
()
{
disp
.
fire
(
"em.chatroom.leave"
);
//
disp.fire("em.chatroom.leave");
},
},
closeTip
:
function
()
{
closeTip
:
function
()
{
this
.
setData
({
this
.
setData
({
...
...
pages/tab/message/message.js
View file @
dd72dbb5
...
@@ -172,7 +172,7 @@ Page({
...
@@ -172,7 +172,7 @@ Page({
userId
:
wx
.
getStorageSync
(
'user_id'
),
userId
:
wx
.
getStorageSync
(
'user_id'
),
});
});
if
(
getApp
().
globalData
.
imBoolean
&&
isShowModal
)
{
if
(
getApp
().
globalData
.
imBoolean
&&
isShowModal
)
{
reloginIm
()
reloginIm
(
true
)
}
}
},
},
...
...
utils/chat.js
View file @
dd72dbb5
...
@@ -199,7 +199,9 @@ const webimListen = () => {
...
@@ -199,7 +199,9 @@ const webimListen = () => {
let
curPage
=
pages
[
pages
.
length
-
1
];
let
curPage
=
pages
[
pages
.
length
-
1
];
getApp
().
globalData
.
imBoolean
=
true
;
getApp
().
globalData
.
imBoolean
=
true
;
wx
.
setStorageSync
(
'is_ShowModal'
,
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
()
reloginIm
()
}
}
}
else
if
(
error
.
type
==
1
)
{
//用户名或者账号错误
}
else
if
(
error
.
type
==
1
)
{
//用户名或者账号错误
...
...
utils/util.js
View file @
dd72dbb5
...
@@ -343,7 +343,7 @@ const matchReg = (str) => {
...
@@ -343,7 +343,7 @@ const matchReg = (str) => {
let
newStr
=
str
.
replace
(
reg
,
''
);
let
newStr
=
str
.
replace
(
reg
,
''
);
return
newStr
return
newStr
}
}
const
reloginIm
=
()
=>
{
const
reloginIm
=
(
bool
)
=>
{
wx
.
showModal
({
wx
.
showModal
({
title
:
'提示'
,
title
:
'提示'
,
content
:
'您的聊天账号掉线啦!'
,
content
:
'您的聊天账号掉线啦!'
,
...
@@ -355,7 +355,12 @@ const reloginIm = () => {
...
@@ -355,7 +355,12 @@ const reloginIm = () => {
getApp
().
conn
.
reopen
();
getApp
().
conn
.
reopen
();
}
else
if
(
res
.
cancel
)
{
}
else
if
(
res
.
cancel
)
{
wx
.
switchTab
({
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