Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async rightOnPress() {
if (!this.state.list_name.trim()) {
Toast.info('请输入书单的名字噢!', 1)
return
}
if (!this.state.list_content.trim()) {
Toast.info('请输入书单的描述内容噢!', 1)
return
}
let array = await Storage.get('book_list', [])
let item = {
list_name: this.state.list_name,
list_content: this.state.list_content
}
let flag = false
if (array && array.length > 0) {
flag = array.some(d => {
if (d.list_name === item.list_name) {
Toast.info('你已经创建过同名书单啦!', 1)
onPost = async () => {
const {
content,
contact
} = this.state
if (!contact.trim()) {
Toast.info('请输入您的联系方式哦~', 1)
return
}
if (!content.trim()) {
Toast.info('请输入您的反馈内容哦~', 1)
return
}
let params = {
content,
contact
}
let response = (await HttpUtils.post(URL, params)) || {}
if (response.status !== 0) {
async rightOnPress() {
if (!this.state.list_name.trim()) {
Toast.info('请输入书单的名字噢!', 1)
return
}
if (!this.state.list_content.trim()) {
Toast.info('请输入书单的描述内容噢!', 1)
return
}
let array = await Storage.get('book_list', [])
let item = {
list_name: this.state.list_name,
list_content: this.state.list_content
}
let flag = false
if (array && array.length > 0) {
flag = array.some(d => {
if (d.list_name === item.list_name) {
Toast.info('你已经创建过同名书单啦!', 1)
Actions.pop()
flag = true
return true
}
onPost = async () => {
const {
content,
contact
} = this.state
if (!contact.trim()) {
Toast.info('请输入您的联系方式哦~', 1)
return
}
if (!content.trim()) {
Toast.info('请输入您的反馈内容哦~', 1)
return
}
let params = {
content,
contact
}
let response = (await HttpUtils.post(URL, params)) || {}
if (response.status !== 0) {
Toast.fail(response.msg, '1')
return
}
Toast.success('反馈成功', 1, () => {
flag = array.some(d => {
if (d.list_name === item.list_name) {
Toast.info('你已经创建过同名书单啦!', 1)
Actions.pop()
flag = true
return true
}
})
if (flag) {