品牌无数据显示

v2
xing 1 year ago
parent dfe30478ea
commit a43fc7498c
  1. 4
      .env
  2. 44314
      package-lock.json
  3. 31
      src/pages/preview/brand/article/article.tsx

@ -1,5 +1,5 @@
TARO_APP_API=https://yjx.dev.yaojiankang.top
#TARO_APP_API=https://mooc.yaojiankang.top
#TARO_APP_API=https://yjx.dev.yaojiankang.top
TARO_APP_API=https://mooc.yaojiankang.top
#TARO_APP_API=https://shopfix.yaojiankang.top
#TARO_APP_API=https://playedu.yaojiankang.top
TARO_APP_LGOIN=true

44314
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -6,13 +6,14 @@ import styles from "@/pages/preview/illness/article/article.module.scss";
import down from "@/static/img/doubleDown.png";
import {Profile} from "@/store";
import {parse} from "@/utils/marked/marked";
import Empty from "@/components/empty/empty";
const article:FC = () => {
const {token,} = Profile.useContainer()
const {id} = useRouter().params as unknown as { id: number}
const [articleInfo,setArticleInfo] = useState<ArticleRecord>()
const { children } = useMemo(() => parse(articleInfo?.content || ''), [articleInfo])
const article: FC = () => {
const {token} = Profile.useContainer()
const {id} = useRouter().params as unknown as { id: number }
const [articleInfo, setArticleInfo] = useState<ArticleRecord>()
const {children} = useMemo(() => parse(articleInfo?.content || ''), [articleInfo])
useEffect(() => {
getData()
}, [id])
@ -20,16 +21,23 @@ const article:FC = () => {
const getData = async () => {
try {
const data = await brandApi.articleInfo(id)
Taro.setNavigationBarTitle({title:data.title})
Taro.setNavigationBarTitle({title: data.title})
setArticleInfo(data)
} catch (e) {
}
}
function helloWorld() {
return (
<>
<View style={{padding:'10px',height:!token ? Taro.getWindowInfo().windowHeight-60+'px' : 'auto',overflow:!token ? 'hidden':'auto'}}>
{ children }
<View style={{
padding: '10px',
height: !token ? Taro.getWindowInfo().windowHeight - 60 + 'px' : 'auto',
overflow: !token ? 'hidden' : 'auto'
}}>
{
children.length > 0 ? children : <Empty name='暂无数据'/>
}
</View>
{
!token &&
@ -38,16 +46,19 @@ const article:FC = () => {
<View className={styles['fixedBox-inner-icon']}>
<Image src={down}></Image>
</View>
<View className={styles['fixedBox-inner-box']} onClick={()=>{Taro.navigateTo({url: '/pages/login/login'})}}>
<View className={styles['fixedBox-inner-box']} onClick={() => {
Taro.navigateTo({url: '/pages/login/login'})
}}>
<Text></Text>
</View>
</View>
</View>
}
</>
)
)
}
return helloWorld()
}
export default article

Loading…
Cancel
Save