Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Followers
url = '/user/followers'
if (username) {
url = '/users/' + username + '/followers'
}
title = 'Followers'
} else if (type === 'following') {
// Following
url = '/user/following'
if (username) {
url = '/users/' + username + '/following'
}
title = 'Following'
}
Taro.setNavigationBarTitle({
title: title
})
this.setState({
url: url
})
}
componentDidMount() {
Taro.setNavigationBarTitle({ title: 'leaa-demo' }).then();
// Taro.switchTab({ url: '/pages/article/article-list' }).then();
// Taro.navigateTo({ url: '/pages/article/article-item?id=28' }).then();
// Taro.switchTab({ url: '/pages/account/account' }).then();
}
setSongInfo(songInfo) {
try {
const { name, al, url, lrcInfo } = songInfo
Taro.setNavigationBarTitle({
title: name
})
backgroundAudioManager.title = name
backgroundAudioManager.coverImgUrl = al.picUrl
backgroundAudioManager.src = url
this.setState({
lrc: lrcInfo,
isPlaying: true,
firstEnter: false
});
} catch(err) {
console.log('err', err)
this.getNextSong()
}
}
let imgList;
if (res.data.image) {
imgList = res.data.image.map(item => {
return {
image_src: item,
};
});
} else {
imgList = [
{
image_src:
'http://static-r.msparis.com/uploads/d/1/d1ca37e902e5550ad2c82c721bc216ce.png',
},
];
}
Taro.setNavigationBarTitle({
title: res.data.name,
});
this.setState({
detail: res.data,
imageObj: imgList,
specificationsList: res.data.specifications,
});
}
}
}, ()=> {
Taro.setNavigationBarTitle({
title: this.state.item.title
})
})
}
componentDidMount() {
Taro.setNavigationBarTitle({ title: '文章列表' }).then();
}
onPageScroll(e) {
let title = ''
const { repo } = this.state
if (e.scrollTop > 0) {
title = repo.name
}
Taro.setNavigationBarTitle({
title: title
})
}
componentWillMount () {
let params = this.$router.params;
let title = params.title;
Taro.setNavigationBarTitle({
title:title
})
this.setState({
params:{
title:params.title,
id:params.id,
cityId:params.cityId
}
});
}
this.props.dispatchSubMenu(payload).then((res) => {
this.setState({ loaded: true })
const { category: { name, subCategoryList } } = res
Taro.setNavigationBarTitle({ title: name })
setTimeout(() => {
const index = subCategoryList.findIndex(item => item.id === this.subId)
this.handleMenu(index)
}, 0)
})
}