Преглед на файлове

处理设置关注类型喜好跳转 我关注的 tab

处理登录后记录用户信息
release/210823_需求对对碰
王饶冀 преди 3 години
родител
ревизия
7804e0e92c
променени са 4 файла, в които са добавени 15 реда и са изтрити 7 реда
  1. 1
    1
      app.js
  2. 8
    1
      pages/index/index.js
  3. 5
    4
      pages/login/login.js
  4. 1
    1
      pages/myModule/index.wxml

+ 1
- 1
app.js Целия файл

@@ -100,7 +100,7 @@ App({
})
},
// mangerUrl: 'http://test2.hhrchina.com',
mangerUrl: "http://192.168.18.216",
mangerUrl: "http://192.168.18.138",
// mangerUrl: "https://www.hhrchina.com",
// mangerUrlPath: "https://www.hhrchina.com",
})

+ 8
- 1
pages/index/index.js Целия файл

@@ -199,7 +199,7 @@ Page({
type = "";
}
if (currentTab == 'my') {
if(app.globalData.businessCommunicationCustomer){
if (app.globalData.businessCommunicationCustomer) {
type = app.globalData.businessCommunicationCustomer.attentionTypeIds;
}
}
@@ -210,6 +210,7 @@ Page({
this.setData({
paramIsInterest
})
console.log(`本次接口:type`,type)
$request.get('/businessCommunicationDemand/getDemandByKeywordOrType.action',
{ page, size, keyword, type, isInterest: paramIsInterest }
).then(res => {
@@ -273,11 +274,17 @@ Page({
this.getListData();
}
},
// 设置关注类型喜好
setAttention() {
if (!app.globalData.customerId) {
app.goLogin();
return
}
this.setData({
currentTab: 'my',
moreTitle: "更多",
moreTab: "gengduo"
})
let customerid = app.globalData.customerId;
wx.navigateTo({
url: "/pages/myModule/components/myAttention/myAttention",

+ 5
- 4
pages/login/login.js Целия файл

@@ -111,16 +111,18 @@ Page({
$request.post('/script/getSession.action', {}).then(res => {
wx.hideLoading()
console.log(res, '返回的res')
app.globalData.customerId = res.data.customer.customerId;
let businessCommunicationCustomer = res.data.businessCommunicationCustomer;
app.globalData.customerId = businessCommunicationCustomer.customerId;
app.globalData.customer = res.data.customer;
app.globalData.businessCommunicationCustomer = res.data.businessCommunicationCustomer;
app.globalData.businessCommunicationCustomer = businessCommunicationCustomer;
wx.setStorageSync('businessCommunicationCustomer', businessCommunicationCustomer)
let pages = getCurrentPages();
let Page = pages[pages.length - 1];//当前页
let prevPage = pages[pages.length - 2]; //上一个页面
let info = prevPage.data //取上页data里的数据也可以修改
// 如果是上一页是我的页面
if (prevPage.route == "pages/myModule/index") {
let businessCommunicationCustomer = res.data.businessCommunicationCustomer;
if (res.data.customer.paidByMonth) {
businessCommunicationCustomer.nickName = res.data.customer.nickName;
businessCommunicationCustomer.isPartner = true;
@@ -131,7 +133,6 @@ Page({
user: businessCommunicationCustomer,
isLogin:true
})
wx.setStorageSync('businessCommunicationCustomer', businessCommunicationCustomer)
wx.navigateBack()
} else {
wx.navigateBack()

+ 1
- 1
pages/myModule/index.wxml Целия файл

@@ -14,7 +14,7 @@
</view>
</view>
<view class="user-name-box fl" wx:else>
<view class="user-name yichu fl">{{ user.name }}</view>
<view class="user-name yichu fl">{{ user.nickName }}</view>
</view>
<view class="user-address fl">{{ user.province + (user.city ? '·' + user.city : '') }}</view>
<view class="show-home-page fl" bindtap="goRouterPage" data-code="homepage">

Loading…
Отказ
Запис