Commit 559039a0 by hank

放重复点击

parent 14e98da8
......@@ -5,7 +5,7 @@ import { ITempItem } from '@/reducers/counter'
import { View, Text, Image } from '@tarojs/components'
import './index.scss'
import api from '@/api'
import api from '@/api/index'
type IProps = ITempItem
......@@ -18,21 +18,29 @@ interface TempItem {
}
class TempItem extends Component {
goDetail = () => {
protected isload = false
goDetail() {
const { templateId, filmId } = this.props
// Taro.navigateTo({ url: '/pages/home/device/my_film/index' })
if (filmId) {
Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?filmId=${filmId}` })
// Taro.navigateTo({ url: `/pages/home/device/my_film/index` })
if (!this.isload) {
this.isload = true
if (filmId) {
Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?filmId=${filmId}` })
// Taro.navigateTo({ url: `/pages/home/device/my_film/index` })
} else {
api.tempalte.getTempalteFilmCount(templateId).then(res => {
if (res.data === 0) {
Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?templateId=${templateId}` })
} else {
Taro.navigateTo({ url: `/pages/home/tempaltes/detail?templateId=${templateId}` })
}
})
}
} else {
api.tempalte.getTempalteFilmCount(templateId).then(res => {
if (res.data === 0) {
Taro.navigateTo({ url: `/pages/home/tempaltes/film_detail?templateId=${templateId}` })
} else {
Taro.navigateTo({ url: `/pages/home/tempaltes/detail?templateId=${templateId}` })
}
})
setTimeout(() => {
this.isload = false
}, 500)
}
// Taro.navigateTo({ url: '/pages/home/device/my_film/index' })
}
render() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment