Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleOpenResult = async () => {
Taro.showLoading({
title: '照片生成中...',
mask: true,
})
const canvasImageUrl = await this.createCanvas()
console.log('canvasImageUrl', canvasImageUrl)
Taro.hideLoading()
this.setState({
result: {
url: canvasImageUrl,
show: true
}
})
}
// 再玩一次
that.setState({
repo: res.data,
baseUrl: baseUrl
}, ()=>{
that.getReadme()
that.checkStarring()
// that.checkWatching()
})
} else {
Taro.showToast({
icon: 'none',
title: res.data.message
})
}
Taro.stopPullDownRefresh()
Taro.hideLoading()
})
}
api.get(url, params).then((res) => {
if (user_page === 1) {
that.setState({
users: res.data.items
})
} else {
that.setState({
users: users.concat(res.data.items)
})
}
let status = res.data.length < GLOBAL_CONFIG.PER_PAGE ? REFRESH_STATUS.NO_MORE_DATA : REFRESH_STATUS.NORMAL
that.setState({
user_status: status
})
Taro.hideLoading()
Taro.stopPullDownRefresh()
})
}
getUserInfo() {
if (hasLogin()) {
userAction.getUserInfo().then(()=>{
Taro.hideLoading()
Taro.stopPullDownRefresh()
this.checkStarring()
})
} else {
Taro.hideLoading()
Taro.stopPullDownRefresh()
}
}
const success = res => {
let { data } = res.result || {}
const list = data || []
this.setState({
articalList: query.offset === 0 ? list : [...articalList, ...list],
isComplete: list.length < PAGE_SIZE,
isPaging: false,
})
Taro.hideLoading()
}
api.get(url).then((res)=>{
that.setState({
dataList: res.data
})
Taro.hideLoading()
})
}
}).then(res=>{
if(res.statusCode ==200){
Taro.hideLoading();
const seatData = res.data.seatData;
const seatArray = [];
seatData.seat.sections[0].seats.map(item=>{
let arr = [];
item["columns"].map(seat=>{
if(seat["st"] == "N"){
arr.push('0');
}else{
arr.push('E')
}
})
seatArray.push(arr);
})
self.setState({
seatData:seatData,
seatArray:seatArray
userAction.getUserInfo().then(()=>{
Taro.hideLoading()
Taro.stopPullDownRefresh()
this.checkStarring()
})
} else {