修改预览分包管理文件管理

v2
king 1 year ago committed by xing
parent 39aa8c808c
commit ed2c5aedb0
  1. 1
      src/api/brand.ts
  2. 14
      src/app.config.ts
  3. 2
      src/components/textCollapse/collapse.tsx
  4. 4
      src/pages/brand/article/article.config.ts
  5. 28
      src/pages/brand/article/article.tsx
  6. 4
      src/pages/brand/info/info.config.ts
  7. 65
      src/pages/brand/info/info.module.scss
  8. 4
      src/pages/brand/list/list.config.ts
  9. 32
      src/pages/brand/list/list.module.scss
  10. 58
      src/pages/brand/list/list.tsx
  11. 2
      src/pages/home/components/feature.tsx
  12. 6
      src/pages/home/components/feature_recommended.tsx
  13. 0
      src/pages/preview/health/health.config.ts
  14. 0
      src/pages/preview/health/health.module.scss
  15. 2
      src/pages/preview/health/health.tsx
  16. 0
      src/pages/preview/videoFull/videoFull.config.ts
  17. 0
      src/pages/preview/videoFull/videoFull.tsx

@ -7,6 +7,7 @@ export type BrandRecord = {
brand_album: string[] brand_album: string[]
graphic_introduction: string graphic_introduction: string
disabled: number disabled: number
introductory_video_resource:any
} }
export type ArticleRecord = { export type ArticleRecord = {
title: string title: string

@ -6,7 +6,6 @@ export default defineAppConfig({
'pages/login/login', 'pages/login/login',
'pages/check/check', 'pages/check/check',
'pages/my/my', 'pages/my/my',
'pages/health/health',
], ],
window: { window: {
backgroundTextStyle: 'light', backgroundTextStyle: 'light',
@ -59,7 +58,6 @@ export default defineAppConfig({
'curHistory/curHistory', 'curHistory/curHistory',
'hourHistory/hourHistory', 'hourHistory/hourHistory',
'courType/courType', 'courType/courType',
'videoFull/videoFull', // 资源id 视频全屏
'sort/sort', // 公共二级分类 'sort/sort', // 公共二级分类
] ]
}, },
@ -80,13 +78,15 @@ export default defineAppConfig({
] ]
}, },
{ {
root: 'pages/brand', root: 'pages/preview',
pages: [ pages: [
'list/list', 'brand/list/list',
'info/info', 'brand/info/info',
'article/article', 'brand/article/article',
'health/health', // 健康
'videoFull/videoFull', // 资源id 视频全屏
] ]
} },
], ],
lazyCodeLoading: "requiredComponents" lazyCodeLoading: "requiredComponents"
}) })

@ -8,7 +8,7 @@ interface Props {
text: string text: string
} }
const LineEllipsis:FC = ({text}:Props) => { const LineEllipsis:FC<Props> = ({text}:Props) => {
const [disabled, setDisabled] = useState(false) const [disabled, setDisabled] = useState(false)
const [isExpansioned, setIsExpansioned] = useState(false) const [isExpansioned, setIsExpansioned] = useState(false)
const [overflow, setOverflow] = useState(false) const [overflow, setOverflow] = useState(false)

@ -1,4 +0,0 @@
export default definePageConfig({
navigationBarTitleText: '文章详情',
onReachBottomDistance: 30
})

@ -1,28 +0,0 @@
import {FC, useEffect, useState} from "react";
import {View} from "@tarojs/components";
import Taro, {useRouter} from "@tarojs/taro";
import {ArticleRecord, brandApi} from "@/api";
const article:FC = () => {
const {id} = useRouter().params as unknown as { id: number}
const [articleInfo,setArticleInfo] = useState<ArticleRecord>()
useEffect(() => {
getData()
}, [id])
const getData = async () => {
try {
const data = await brandApi.articleInfo(id)
Taro.setNavigationBarTitle({title:data.title})
setArticleInfo(data)
} catch (e) {
}
}
function helloWorld() {
const html = articleInfo?.content;
return <View dangerouslySetInnerHTML={{ __html: html! }}></View>
}
return helloWorld()
}
export default article

@ -1,4 +0,0 @@
export default definePageConfig({
navigationBarTitleText: '',
onReachBottomDistance: 30
})

@ -1,65 +0,0 @@
.swiper{
width:750rpx;
height:600rpx;
background-color: pink;
}
.body{
border-radius: 32rpx 32rpx 0 0;
background-color:cadetblue;
width: 750rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
min-height: 80vh;
position: absolute;
top: 520rpx;
.top{
padding:40rpx 30rpx 30rpx 30rpx;
border-radius: 32rpx;
background-color: #fff;
.title{
font-size: 32rpx;
font-weight: bold;
color: #323635;
line-height:44rpx;
}
}
.bottom{
margin-top: 20rpx;
flex:1;
background-color: #fff;
border-radius: 32rpx 32rpx 0 0;
width: 100%;
.box {
display: flex;
background-color: #fff;
border-radius: 16rpx;
padding: 30rpx;
box-sizing: border-box;
}
.inner{
flex:1;
display: flex;
padding-bottom: 24rpx;
border-bottom: 2rpx solid #F5F8F7;
.image{
width: 172rpx;
height:128rpx;
background-color: pink;
border-radius: 8rpx;
}
.leftBox{
padding-right: 24rpx;
box-sizing: border-box;
flex: 1;
}
.desc{
font-size: 22rpx;
font-weight: 500;
color: #909795;
line-height: 32rpx
}
}
}
}

@ -1,4 +0,0 @@
export default definePageConfig({
navigationBarTitleText: '品牌列表',
onReachBottomDistance: 30
})

@ -1,32 +0,0 @@
.box {
display: flex;
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 16rpx;
padding: 24rpx;
box-sizing: border-box;
}
.image{
width: 128rpx;
height:128rpx;
background-color: pink;
border-radius: 8rpx;
}
.rightBox{
padding-left: 24rpx;
box-sizing: border-box;
flex: 1;
}
.desc{
font-size: 24rpx;
font-weight: 500;
color: #909795;
line-height: 34rpx;
display: -webkit-box;
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
-webkit-box-orient:vertical;
-webkit-line-clamp:2;
}

@ -1,58 +0,0 @@
import {FC, useCallback, useEffect, useState} from "react";
import {Image, View} from "@tarojs/components";
import {brandApi, BrandRecord} from "@/api";
import styles from './list.module.scss'
import Taro, {useReachBottom} from "@tarojs/taro";
import Empty from "@/components/empty/empty";
const BrandList: FC = () => {
const [page, setPage] = useState(1)
const [brands, setBrands] = useState<BrandRecord[]>([])
const [total, setTotal] = useState(0)
useEffect(() => {
getData()
}, [page])
const getData = useCallback( async () => {
try {
const res = await brandApi.list(1, 10)
setTotal(res.total)
setBrands([
...res.data
])
} catch (e) {
}
}, [page])
function jumpInfo(id: number) {
Taro.navigateTo({url: `/pages/brand/info/info?id=${id}`})
}
useReachBottom(useCallback(() => {
if (brands?.length < total) {
setPage(page + 1)
}
}, [total, brands]))
return (
<View className='p-2'>
{
brands.length ? brands.map((d) =>
<View onClick={() => jumpInfo(d.id)} className={styles.box} key={d.id}>
<Image src={d.brand_album?.[0]} mode='aspectFill' className={styles.image}/>
<View className={styles.rightBox}>
<View className='font-weight mb-2 font-28'>{d.name}</View>
<View className={styles.desc}>{d.graphic_introduction.repeat(30)}</View>
</View>
</View>)
: <Empty name='空空如也'/>
}
</View>
)
}
export default BrandList

@ -8,7 +8,7 @@ import Taro from "@tarojs/taro";
const Feature: FC = () => { const Feature: FC = () => {
const list = [ const list = [
{url: '/pages/brand/list/list', image: article, text: '品牌'}, {url: '/pages/preview/brand/list/list', image: article, text: '品牌'},
{url: '', image: health, text: '健康管理'}, {url: '', image: health, text: '健康管理'},
{url: '', image: profession, text: '专业技能'}, {url: '', image: profession, text: '专业技能'},
{url: '', image: illness, text: '疾病知识'}, {url: '', image: illness, text: '疾病知识'},

@ -27,14 +27,14 @@ const FeatureRecommended: FC = () => {
{title: "品牌TOP3", url: '', detailsUrl: '', data: []}, {title: "品牌TOP3", url: '', detailsUrl: '', data: []},
{ {
title: "健康知识TOP3", title: "健康知识TOP3",
url: '/pages/health/health', url: '/pages/preview/health/health',
detailsUrl: '/pages/business/videoFull/videoFull?url=', detailsUrl: '/pages/preview/videoFull/videoFull?url=',
data: [] data: []
}, },
{ {
url: '', url: '',
title: "专业技能TOP3", title: "专业技能TOP3",
detailsUrl: '/pages/business/videoFull/videoFull?url=', detailsUrl: '/pages/preview/videoFull/videoFull?url=',
data: [] data: []
}, },
{title: "疾病知识TOP3", url: '', detailsUrl: '', data: []}, {title: "疾病知识TOP3", url: '', detailsUrl: '', data: []},

@ -26,7 +26,7 @@ const Health: FC = () => {
function jump(url: string, id: number) { function jump(url: string, id: number) {
HomeApi.healthSetPlay(id) HomeApi.healthSetPlay(id)
Taro.navigateTo({url: '/pages/business/videoFull/videoFull?url=' + url}) Taro.navigateTo({url: '/pages/preview/videoFull/videoFull?url=' + url})
} }
return ( return (
Loading…
Cancel
Save