Browse Source

bug 修改

master
slj 3 years ago
parent
commit
2b9a56a158
  1. 1
      config.js
  2. 83
      pages/topics/reportDemand/index.js
  3. 20
      pages/weChatAuth/index.js
  4. 7
      project.private.config.json

1
config.js

@ -1,4 +1,5 @@
const config = { const config = {
// api_url: 'http://10.10.11.54:7101/fqsb', // 服务器地址
// api_url: 'http://10.10.11.44:7101/fqsb', // 服务器地址 // api_url: 'http://10.10.11.44:7101/fqsb', // 服务器地址
api_url: 'https://shibeirencai.elinkit.com.cn:7101/fqsb' // 正式环境 api_url: 'https://shibeirencai.elinkit.com.cn:7101/fqsb' // 正式环境
// api_url: 'https://dingoa.elinkit.com.cn/fqsb', // 测试环境 // api_url: 'https://dingoa.elinkit.com.cn/fqsb', // 测试环境

83
pages/topics/reportDemand/index.js

@ -9,6 +9,7 @@ import {
TopicModel TopicModel
} from '../../../models/topic.js' } from '../../../models/topic.js'
let topicModel = new TopicModel() let topicModel = new TopicModel()
const app = getApp()
Page({ Page({
/** /**
@ -60,7 +61,89 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
//进入页面判断是否绑定微信号,如果绑定手机号根据segmentIndex的数值fetch留言互动和赋能中心的资源,否则退回注册页面或者首页
if (store.hasBindUserInfo()) {
console.log('已经绑定微信')
if (store.hasPhone()) {
console.log('已经绑定手机号码')
} else {
console.log('未绑定手机号码')
if (app.globalData.navigate.mobile) {
var params = {
phone: app.globalData.navigate.mobile,
nickName: app.globalData.navigate.nickname,
avatarUrl: app.globalData.navigate.faceImg
}
userModel.navigateUser(params, res => {
store.saveUserInfo({
nickName: params.nickName,
avatarUrl: params.avatarUrl,
phone: params.phone
})
})
wx.reLaunch({
url: '/pages/topics/reportDemand/index',
})
} else {
wx.showModal({
title: '温馨提示',
content: '是否前往验证手机号码?',
success(res) {
if (res.confirm) {
wx.redirectTo({
url: '/pages/weChatAuth/index?type=2',
})
} else if (res.cancel) {
wx.switchTab({
url: '/pages/home/index',
})
}
}
})
}
}
} else {
console.log('--未绑定微信--')
console.log('app.globalData.navigate.mobile--',app.globalData.navigate.mobile)
if (app.globalData.navigate.mobile) {
console.log('app.globalData.navigate.mobile--',app.globalData.navigate.mobile)
var params = {
phone: app.globalData.navigate.mobile,
nickName: app.globalData.navigate.nickname,
avatarUrl: app.globalData.navigate.faceImg
}
userModel.navigateUser(params, res => {
store.saveUserInfo({
nickName: params.nickName,
avatarUrl: params.avatarUrl,
phone: params.phone
})
})
wx.reLaunch({
url: '/pages/topics/reportDemand/index',
})
} else {
wx.showModal({
title: '温馨提示',
content: '是否前往绑定微信?',
success(res) {
if (res.confirm) {
// wx.redirectTo({
// url: '/pages/weChatAuth/index?tabType=funeng',
// })
wx.redirectTo({
url: '/pages/weChatAuth/index?tabType=reportDemand',
})
} else if (res.cancel) {
wx.switchTab({
url: '/pages/home/index',
})
}
}
})
}
}
}, },
/** /**

20
pages/weChatAuth/index.js

@ -119,6 +119,12 @@ Page({
url: '/pages/user/index' url: '/pages/user/index'
}) })
} }
if(tabType=='reportDemand'){
app.globalData.currentTab = "4"
wx.navigateTo({
url: `/pages/topics/reportDemand/index`,
})
}
} else { } else {
console.log('未绑定手机号码') console.log('未绑定手机号码')
wx.showModal({ wx.showModal({
@ -164,9 +170,19 @@ Page({
data.iv = e.detail.iv; data.iv = e.detail.iv;
// data.session = app.globalData.session; // data.session = app.globalData.session;
userModel.wxRegister(data,res => { userModel.wxRegister(data,res => {
wx.reLaunch({ console.log('res---',res)
url: '/pages/home/index', let tabType=this.data.tabType
console.log('tabType--',tabType)
if(tabType=='reportDemand'){
app.globalData.currentTab = "4"
wx.navigateTo({
url: `/pages/topics/reportDemand/index`,
}) })
return
}
wx.reLaunch({
url: '/pages/home/index',
})
}); });
} }
} }

7
project.private.config.json

@ -155,6 +155,13 @@
"query": "", "query": "",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
},
{
"name": "报需求",
"pathName": "pages/topics/reportDemand/index",
"query": "",
"launchMode": "default",
"scene": null
} }
] ]
} }

Loading…
Cancel
Save