Browse Source

地图问题,异地登录统一跳转重新登陆

jw-featrue-zhanlibiao
mk 2 years ago
parent
commit
8222f5c809
  1. 4
      pages/index/index.js
  2. 12
      pages/work/work.js
  3. 2
      pages/work/work.wxml
  4. 1
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js
  5. 2
      subpages/demandCheck/pages/dissatisfied/searchResi/searchResi.js
  6. 10
      utils/request.js

4
pages/index/index.js

@ -95,8 +95,8 @@ onScrollToLower(e){
if(res.code === 0){
wx.setStorageSync('token', res.data.token)
}else{
wx.navigateTo({
url: '/pages/login/login.wxml',
wx.reLaunch({
url: '/pages/login/login',
})
}
}).catch(err=>{

12
pages/work/work.js

@ -137,13 +137,17 @@ Page({
setlectVal :e.currentTarget.dataset.value
})
},
handelBlurKeyWord(e){
handelInputKeyWord(e){
this.setData({
keyWord: e.detail.value.replace(/\s+/g, '')
keyWord: e.detail.value
})
app.globalData.keyWord = e.detail.value.replace(/\s+/g, '')
},
handelBlurKeyWord(e){
this.setData({
keyWord: e.detail.value.trim()
})
},
handelClickSearch(e){
if(!this.data.keyWord) {
wx.showToast({

2
pages/work/work.wxml

@ -11,7 +11,7 @@
</view>
<view class="inout_box">
<image src="../../images/work/search.png" mode=""/>
<input type="text" placeholder="{{setlectVal == 'resi'?'姓名/手机/身份证/住址等任意组合关键词':'输入小区/楼栋/单元/门牌号/房主等任意组合关键词'}}" confirm-type="search" bindinput="handelBlurKeyWord" bindblur="handelBlurKeyWord" value="{{keyWord}}" />
<input type="text" placeholder="{{setlectVal == 'resi'?'姓名/手机/身份证/住址等任意组合关键词':'输入小区/楼栋/单元/门牌号/房主等任意组合关键词'}}" confirm-type="search" bindinput="handelInputKeyWord" bindblur="handelBlurKeyWord" value="{{keyWord}}" />
<view class="btn_box" bind:tap="handelClickSearch"><text>搜索</text></view>
</view>
<view class="jump" wx:if="{{setlectVal == 'resi'}}">

1
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js

@ -82,7 +82,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.data.qqMapWX = new QQMapWX({
key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ'
})

2
subpages/demandCheck/pages/dissatisfied/searchResi/searchResi.js

@ -9,7 +9,7 @@ Page({
data: {
selectVal:'search',
keyWord:'张三',
keyWord:'',
lowerThreshold:'10',
loadMoreVisible:false,
loadMoreType: "none",

10
utils/request.js

@ -14,9 +14,14 @@ const request = function (url, options) {
'Authorization': token
},
success (response) {
console.log(response);
if (response.statusCode === 200) {
if(response.data.code===0){
resolve(response.data)
}else if(response.data.code === 10007 || response.data.code == 1024 || response.data.code == 2003){
wx.reLaunch({
url: '/pages/login/login',
})
}else{
let errmsg = response.data.msg
if(errmsg==undefined || errmsg=='undefined' ){
@ -29,11 +34,6 @@ const request = function (url, options) {
})
reject(response.data)
}
}else if(response.statusCode === 10007 || response.statusCode == 1024 || response.statusCode == 2003){
console.log('进不来?');
wx.redirectTo({
url: '/pages/login/login',
})
} else {
wx.showToast({
title: '网络问题,请稍后再试。',

Loading…
Cancel
Save