| 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') | ||||
| }) | }) |
| // 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 => { |