浏览代码

提交代码~

release/210823_需求对对碰
王饶冀 4 年前
父节点
当前提交
0df6345a45
共有 4 个文件被更改,包括 40 次插入7 次删除
  1. 1
    0
      app.js
  2. 13
    2
      pages/index/index.js
  3. 1
    1
      pages/index/index.wxml
  4. 25
    4
      pages/login/login.js

+ 1
- 0
app.js 查看文件

@@ -86,6 +86,7 @@ App({
sessionKey: "",
suiteCode: "",
customerId: null,
customer:null,
},
// 跳转登录页
goLogin(e) {

+ 13
- 2
pages/index/index.js 查看文件

@@ -244,7 +244,18 @@ Page({
this.getListData();
}
},
goLogin() {
app.goLogin();
setAttention() {
if(!app.globalData.customerId){
app.goLogin();
return
}
let customerid = app.globalData.customerId;
wx.navigateTo({
url:"/pages/myModule/components/myAttention/myAttention",
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('customerid', { customerid })
}
})
},
})

+ 1
- 1
pages/index/index.wxml 查看文件

@@ -15,7 +15,7 @@
全方位需求
<text class="sub-title">交流平台</text>
</view>
<button type="default" plain class="set-attention" id="shouquan" bindtap="goLogin">
<button type="default" plain class="set-attention" id="shouquan" bindtap="setAttention">
设置关注类型喜好 >>
</button>
<image class="header-img" src="/images/home/header-icon.png" />

+ 25
- 4
pages/login/login.js 查看文件

@@ -60,7 +60,7 @@ Page({
province,
city
}).then(res => {
console.log(res,'保存用户信息返回的Res')
console.log(res, '保存用户信息返回的Res')
this.getUserSession()
}).catch(error => {
console.log(error, 'error appletLogin')
@@ -69,9 +69,9 @@ Page({
// 获取用户信息弹框
onCheckboxChange() {
if (!this.data.hasUserInfo) {
if(!this.data.userInfo){
if (!this.data.userInfo) {
this.getUserProfile()
}else{
} else {
this.setData({
hasUserInfo: true
})
@@ -109,8 +109,29 @@ Page({
let that = this
$request.post('/script/getSession.action', {}).then(res => {
wx.hideLoading()
console.log(res, '返回的res')
app.globalData.customerId = res.data.customer.customerId;
wx.navigateBack()
app.globalData.customer = res.data.customer;
let pages = getCurrentPages();
let Page = pages[pages.length - 1];//当前页
let prevPage = pages[pages.length - 2]; //上一个页面
let info = prevPage.data //取上页data里的数据也可以修改
console.log(prevPage,'prevPage');
console.log(info,'info');
// 如果是上一页是我的页面
if(prevPage.route == "pages/myModule/index"){
}else{
wx.navigateBack()
}
// let tempListData = info.listData;
// tempListData.forEach(el => {
// if (el.businessCommunicationDemandId == businessCommunicationDemandId) {
// el.info = Page.data.detailValue
// }
// })
// prevPage.setData({ listData: tempListData })//设置数据
// wx.navigateBack()
}).catch(error => {
console.log(error, "获取error")
})

正在加载...
取消
保存