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
964ac899
authored
Sep 02, 2019
by
施宇
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
sy
parent
6ca1f1fa
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
32 deletions
app.js
components/priceItem/priceItem.js
components/priceItem/priceItem.wxml
pages/person/setting/index.js
pages/tab/home/home.js
pages/tab/message/message.js
utils/chat.js
utils/util.js
app.js
View file @
964ac899
...
...
@@ -18,9 +18,11 @@ App({
customerNum
:
"001"
,
customerName
:
"IC助手客服"
,
isRelogin
:
true
,
//登入环信失败后是否重新登入,只允许重新登入一次
bus
:
bus
bus
:
bus
,
imBoolean
:
false
,
},
getImUser
:
chat
.
getImUser
,
conn
:
chat
.
conn
,
addChatMember
:
function
(
id
,
userId
)
{
//id为环信id userId为账户id
let
token
=
wx
.
getStorageSync
(
'access_token'
)
||
''
;
...
...
@@ -56,12 +58,12 @@ App({
// url: '/pages/tab/home/home'
// });
}
else
{
wx
.
re
directTo
({
wx
.
re
Launch
({
url
:
'/pages/person/login/index'
});
}
}
else
{
wx
.
re
directTo
({
wx
.
re
Launch
({
url
:
'/pages/person/auth/index'
});
}
...
...
components/priceItem/priceItem.js
View file @
964ac899
...
...
@@ -46,7 +46,6 @@ Component({
url
:
"/pages/list/xj/index?type=1&inquiryItemsId="
+
inquiryItemsId
})
}
else
if
(
type
==
2
)
{
console
.
log
(
111
)
wx
.
navigateTo
({
url
:
"/pages/list/xj/index?type=2&inquiryItemsId="
+
inquiryItemsId
+
'&offerId='
+
offerId
})
...
...
components/priceItem/priceItem.wxml
View file @
964ac899
...
...
@@ -140,7 +140,7 @@
<text class="address ellipsis">备注:{{item.remark||'--'}}</text>
</view>
</view>
</block>
</block>
<!-- 商品管理 -->
<block wx:if="{{priceType == 5}}">
<view class="price-item good-item" wx:for="{{priceList}}" wx:key="{{index}}" bindtap="emitevent" data-goodid="{{item.goods_id}}" data-pricetype="5">
...
...
pages/person/setting/index.js
View file @
964ac899
...
...
@@ -84,11 +84,18 @@ Page({
if
(
res
.
confirm
)
{
http
.
getData
(
apis
.
authLogout
,
'POST'
,
null
,
(
res
)
=>
{
if
(
res
.
errcode
===
0
)
{
wx
.
switchTab
({
url
:
'/pages/tab/home/home'
// wx.switchTab({
// url: '/pages/tab/home/home'
// });
wx
.
reLaunch
({
url
:
'/pages/person/auth/index'
,
});
wx
.
removeStorageSync
(
'access_token'
);
wx
.
removeStorageSync
(
'user_id'
);
wx
.
removeStorageSync
(
'myUsername'
);
wx
.
removeStorageSync
(
'myPassword'
);
wx
.
removeStorageSync
(
'auth'
);
}
else
{
wx
.
showToast
({
title
:
res
.
errmsg
,
...
...
pages/tab/home/home.js
View file @
964ac899
...
...
@@ -26,11 +26,11 @@ Page({
*/
onLoad
:
function
(
options
)
{
let
me
=
this
;
wx
.
removeStorageSync
(
'homeToken'
)
//
wx.removeStorageSync('homeToken')
this
.
getData
();
if
(
!
judgeToken
())
{
wx
.
setStorageSync
(
'homeToken'
,
1
)
};
//
if (!judgeToken()) {
//
wx.setStorageSync('homeToken', 1)
//
};
getApp
().
globalData
.
bus
.
on
(
'addXj'
,
()
=>
{
if
(
me
.
data
.
xb
==
1
){
me
.
getData
();
...
...
@@ -135,13 +135,13 @@ Page({
*/
onShow
:
function
()
{
this
.
getTopData
();
if
(
judgeToken
())
{
if
(
wx
.
getStorageSync
(
'homeToken'
))
{
this
.
getData
();
wx
.
removeStorageSync
(
'homeToken'
)
}
//
if (judgeToken()) {
//
if (wx.getStorageSync('homeToken')) {
//
this.getData();
//
wx.removeStorageSync('homeToken')
//
}
}
//
}
},
...
...
pages/tab/message/message.js
View file @
964ac899
...
...
@@ -155,7 +155,6 @@ Page({
onShow
:
function
()
{
let
my
=
wx
.
getStorageSync
(
"myUsername"
);
let
token
=
wx
.
getStorageSync
(
'access_token'
)
||
''
;
let
im
=
wx
.
getStorageSync
(
'im'
)
||
''
;
this
.
getSys
(
token
)
//获取系统消息
if
(
getApp
().
globalData
.
customerNum
!=
my
)
{
this
.
getCustom
();
...
...
@@ -171,7 +170,7 @@ Page({
arr
:
this
.
getChatList
(),
userId
:
wx
.
getStorageSync
(
'user_id'
),
});
if
(
wx
.
getStorageSync
(
'im'
)
)
{
if
(
getApp
().
globalData
.
imBoolean
)
{
reloginIm
()
}
...
...
utils/chat.js
View file @
964ac899
...
...
@@ -102,8 +102,7 @@ const webimListen = () => {
let
my
=
wx
.
getStorageSync
(
'myUsername'
)
||
''
;
WebIM
.
conn
.
listen
({
onOpened
(
message
)
{
let
im
=
wx
.
getStorageSync
(
'im'
);
wx
.
removeStorageSync
(
'im'
);
let
im
=
getApp
().
globalData
.
imBoolean
;
if
(
im
)
{
wx
.
showToast
({
title
:
"登录成功"
,
...
...
@@ -130,7 +129,7 @@ const webimListen = () => {
// icon: 'none',
// duration: 2000
// });
me
.
conn
.
closed
=
true
;
conn
.
closed
=
true
;
WebIM
.
conn
.
close
();
},
onCmdMessage
(
message
)
{
...
...
@@ -177,14 +176,14 @@ const webimListen = () => {
},
// 各种异常
onError
(
error
)
{
if
(
error
.
type
==
8
)
{
if
(
error
.
type
==
8
)
{
//异地登录
let
pages
=
getCurrentPages
();
let
curPage
=
pages
[
pages
.
length
-
1
];
wx
.
setStorageSync
(
'im'
,
true
)
;
getApp
().
globalData
.
imBoolean
=
true
;
if
(
curPage
.
route
==
"pages/detail/chat/index"
||
curPage
.
route
==
'pages/tab/message/message'
)
{
reloginIm
()
}
}
else
if
(
error
.
type
==
1
)
{
}
else
if
(
error
.
type
==
1
)
{
//用户名或者账号错误
if
(
getApp
().
globalData
.
isRelogin
)
{
getApp
().
globalData
.
isRelogin
=
false
;
registerIm
()
...
...
utils/util.js
View file @
964ac899
...
...
@@ -270,11 +270,11 @@ const judgeToken = (boolen) => {
}
else
{
if
(
boolen
)
{
if
(
wx
.
getStorageSync
(
'auth'
))
{
wx
.
re
directTo
({
wx
.
re
Launch
({
url
:
'/pages/person/login/index'
})
}
else
{
wx
.
re
directTo
({
wx
.
re
Launch
({
url
:
'/pages/person/auth/index'
})
}
...
...
@@ -321,10 +321,9 @@ const reloginIm = ()=>{
confirmText
:
"重新登录"
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
wx
.
showLoading
();
setTimeout
(()
=>
{
getApp
().
getImUser
()
},
1000
)
wx
.
showLoading
();
getApp
().
conn
.
closed
=
true
;
getApp
().
conn
.
reopen
();
}
else
if
(
res
.
cancel
)
{
wx
.
switchTab
({
url
:
'/pages/tab/home/home'
...
...
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