Browse Source

完成首页我的关注搜索!

release/210823_需求对对碰
王饶冀 4 years ago
parent
commit
a1bb0eb072
2 changed files with 17 additions and 4 deletions
  1. 9
    4
      pages/index/index.js
  2. 8
    0
      pages/myModule/components/myAttention/myAttention.js

+ 9
- 4
pages/index/index.js View File

onRefresh: true, onRefresh: true,
}, },
onLoad() { onLoad() {
this.getListData();
},
onShow(){
// console.log(`会触发吗?`)
this.toSearch();
}, },
toggleMore() { toggleMore() {
this.selectComponent('#item').toggle(); this.selectComponent('#item').toggle();
{ page, size, keyword, type, isInterest: 0 } { page, size, keyword, type, isInterest: 0 }
).then(res => { ).then(res => {
// console.log(res); // console.log(res);
this.setData({
listLoading: false
})
let tempListData = this.data.listData; let tempListData = this.data.listData;
if (res.status == 0) { if (res.status == 0) {
let datas = res.data; let datas = res.data;
}) })
} }
} }
this.setData({
listLoading: false
})
}).catch(error => { }).catch(error => {
console.log(error, 'error appletLogin') console.log(error, 'error appletLogin')
}) })

+ 8
- 0
pages/myModule/components/myAttention/myAttention.js View File

// pages/myModule/components/myCollect/myAttention.js // pages/myModule/components/myCollect/myAttention.js
const $request = require('../../../../utils/request.js'); const $request = require('../../../../utils/request.js');
const app = getApp()
Page({ Page({


/** /**
).then(res => { ).then(res => {
console.log(res); console.log(res);
if (res.status == 0) { if (res.status == 0) {
const businessCommunicationCustomer = wx.getStorageSync('businessCommunicationCustomer');
if(businessCommunicationCustomer){
businessCommunicationCustomer.attentionTypeIds = selectedTags.join(',');
wx.setStorageSync('businessCommunicationCustomer',businessCommunicationCustomer);
app.globalData.businessCommunicationCustomer = businessCommunicationCustomer;
}
wx.showToast({ wx.showToast({
title: '保存成功', title: '保存成功',
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
wx.navigateBack()
} }
wx.hideLoading() wx.hideLoading()
}).catch(error => { }).catch(error => {

Loading…
Cancel
Save