Commit dd72dbb5 by 施宇

1111

parent bff2d0d5
...@@ -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) {
......
...@@ -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");
......
...@@ -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>
......
.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: #E6ECF2; background-color: #e6ecf2;
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:#0D84D1; color: #0d84d1;
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;
} }
...@@ -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({
......
...@@ -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)
} }
}, },
......
...@@ -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) { //用户名或者账号错误
......
...@@ -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)
};
}
}); });
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment