Compare commits

...

7 Commits

  1. 1
      config/index.js
  2. 7
      src/api/illness.ts
  3. 12
      src/api/public.ts
  4. 1
      src/app.config.ts
  5. 2
      src/app.scss
  6. 1
      src/components/image/image.tsx
  7. 21
      src/components/learningRecord/learningRecord.tsx
  8. 30
      src/components/lineChart/lineChart.module.scss
  9. 13
      src/components/lineChart/lineChart.tsx
  10. 18
      src/components/pageScript/pageScript.tsx
  11. 25
      src/components/tabs/tabs.scss
  12. 5
      src/components/tabs/tabs.tsx
  13. 5
      src/components/videoList/videoList.tsx
  14. 3
      src/pages/business/courType/courType.tsx
  15. 3
      src/pages/business/curHistory/curHistory.tsx
  16. 3
      src/pages/business/history/history.tsx
  17. 2
      src/pages/home/components/adware.tsx
  18. 26
      src/pages/home/components/curRecommended.tsx
  19. 4
      src/pages/home/home.module.scss
  20. 4
      src/pages/home/home.tsx
  21. 3
      src/pages/index/components/videoList.tsx
  22. 5
      src/pages/index/index.tsx
  23. 18
      src/pages/manage/courseAdmin/components/search.tsx
  24. 24
      src/pages/manage/courseAdmin/courseAdmin.module.scss
  25. 3
      src/pages/manage/courseAdmin/courseAdmin.tsx
  26. 4
      src/pages/manage/depAdmin/depAdmin.scss
  27. 3
      src/pages/manage/student/student.tsx
  28. 15
      src/pages/manage/userInfo/components/info.tsx
  29. 19
      src/pages/manage/userInfo/userInfo.module.scss
  30. 44
      src/pages/my/my.module.scss
  31. 13
      src/pages/my/my.tsx
  32. 3
      src/pages/preview/brand/info/info.tsx
  33. 3
      src/pages/preview/brand/list/list.tsx
  34. 24
      src/pages/preview/collect/collect.tsx
  35. 11
      src/pages/preview/health/health.module.scss
  36. 3
      src/pages/preview/health/health.tsx
  37. 4
      src/pages/preview/illness/list/list.tsx
  38. 4
      src/pages/preview/jumpArticles/jumpArticles.config.ts
  39. 56
      src/pages/preview/jumpArticles/jumpArticles.tsx
  40. 2
      src/pages/preview/profession/profession.module.scss
  41. 4
      src/pages/preview/profession/profession.tsx
  42. 34
      src/pages/preview/videoFull/videoFull.module.scss
  43. 28
      src/pages/preview/videoFull/videoFull.tsx
  44. 53
      src/static/img/logo.svg

@ -27,6 +27,7 @@ const config = {
"@": path.resolve(__dirname, '..', 'src')
},
mini: {
debugReact: true,
postcss: {
pxtransform: {
enable: true,

@ -1,11 +1,13 @@
import {request} from "@/api/request";
export interface Illness {
illness: {
name: string;
description: string;
resource: any;
album: string[]
created_at:string
created_at: string
}
list: {
list: any[],
total: number
@ -18,7 +20,6 @@ export const illnessApi = {
return request<{ list: any[], total: number }>(`/home/v1/illness/list`, "GET", {page, page_size, id})
},
articleInfo(owner_id: number, page: number, page_size: number) {
return request<{ illness: Illness }>
(`/home/v1/article/illness_list`, "GET", {page, page_size, owner_id})
return request<Illness>(`/home/v1/article/illness_list`, "GET", {page, page_size, owner_id})
},
}

@ -9,10 +9,6 @@ export interface Category {
resource_category?: Category[]
}
interface CategoryList {
categories: Record<number, Category[]>
}
export interface CoursesMode {
articles: any[]
audit_mode: boolean
@ -20,7 +16,6 @@ export interface CoursesMode {
}
export interface Courses {
/** 选秀 */
is_not_required: Curriculum[]
/** 必修 */
@ -33,12 +28,11 @@ export type CoursesKey = keyof Omit<Courses, 'total_course_duration'>
export const publicApi = {
/** 分类 */
category() {
return request<CategoryList>('/api/v1/category/all', "GET")
},
/** 课程 */
course(data: { page: number, pageSize: number }) {
return request<CoursesMode>('/api/v1/category/course/index', "GET", data)
},
articlesPush(page: number, page_size: number) {
return request<{ list: Articles[], total: number }>('/home/v1/article/list', "GET", {page, page_size})
}
}

@ -94,6 +94,7 @@ export default defineAppConfig({
'webView/webView',
'search/search/index',
'collect/collect', // 收藏列表
'jumpArticles/jumpArticles', // 推荐文章
]
},
],

@ -1,5 +1,5 @@
@import "static/css/module";
@import 'taro-ui/dist/style/index.scss';
//@import 'taro-ui/dist/style/index.scss';
.flex {display: flex !important;flex-direction:row}
.flex-row{ flex-direction:row!important}

@ -24,7 +24,6 @@ const Img: FC<Props> = ({src, mode = 'aspectFill', width, fallback = shard, ...p
const imgAnimation = Taro.createAnimation({duration: 0}).opacity(0).step()
const [animationData, setAnimationData] = useState<TaroGeneral.IAnyObject>(imgAnimation.export())
useEffect(() => {
if (!isError && props.fit) {
Taro.getImageInfo({

@ -5,7 +5,7 @@ import LineChart from "@/components/lineChart/lineChart";
import {CSSProperties, FC, useEffect, useState} from "react";
import {StatisticsParam, userApi} from "@/api";
import styles from './learningRecord.module.scss'
// import Spin from "@/components/spinner";
import Spin from "@/components/spinner";
import {Profile} from "@/store";
import Taro from "@tarojs/taro";
import debounce from "@/utils/debounce";
@ -44,7 +44,7 @@ interface Props {
*/
const LearningRecord: FC<Props> = ({userId, style, className}) => {
const [lineData, setLineData] = useState<any[]>([])
// const [loading, setLoading] = useState(false)
const [loading, setLoading] = useState(false)
const {token} = Profile.useContainer()
async function getStatistics(data: StatisticsParam) {
@ -64,21 +64,26 @@ const LearningRecord: FC<Props> = ({userId, style, className}) => {
Taro.navigateTo({url: '/pages/login/login'})
return
}
// getStatistics(tab?.value! as StatisticsParam)
debounce(()=>{
// console.log(this,'this')
getStatistics(tab?.value! as StatisticsParam)
setLoading(true)
debounce(() => {
try {
getStatistics(tab?.value! as StatisticsParam).then()
} catch (e) {
}
setLoading(false)
})
}
useEffect(() => {
userId && setTimeout(() => {getStatistics(tabList[0].value)},500)
userId && setTimeout(() => {
getStatistics(tabList[0].value)
}, 500)
}, [userId])
return (<View className={[styles.box, className].filter(Boolean).join(' ')} style={{display: 'block', ...style}}>
<Tabs tabList={tabList} onChange={tabChange} backMode/>
<View style={{position: "relative"}}>
{/*<Spin enable={loading} block/>*/}
{loading && <Spin enable={loading} block/>}
<View className={styles.total}>
<Text style={{margin: '0 10px', color: '#00D6AC'}}>

@ -3,8 +3,18 @@
align-items: flex-end;
justify-content: left;
flex-wrap: nowrap;
height: 400px;
height: 380px;
position: relative;
padding-bottom: 10rpx;
}
.overlay {
width: 100%;
height: 10rpx;
background: #fff;
position: absolute;
bottom: 0;
left: 0
}
.empty {
@ -19,7 +29,7 @@
align-items: center;
background: rgba(#fff, .9);
view{
view {
position: absolute;
top: 0;
bottom: 0;
@ -54,6 +64,22 @@
overflow: hidden;
animation: rise 300ms ease-in-out forwards;
max-height: 0;
margin-top: 10rpx;
}
.value {
whiteSpace: nowrap;
font-size: 20rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #606563;
}
.time {
font-size: 20rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #323635;
}
.line {

@ -29,12 +29,12 @@ const LineChart: FC<Props> = ({data}) => {
}, [data])
return (
<>
<View style={{width: '100%', position: 'relative'}}>
<View className={style.records}>
<Text>{formatDateTime(new Date(maxHeight.time), 'MM月dd日')}</Text>
{maxHeight.value > 0 ? `日最努力` : `期间没有学习记录`}{formatTime(maxHeight.value, 0)}
</View>
<ScrollView scrollX={!!maxHeight.value} enhanced showScrollbar={false}>
<ScrollView scrollX={!!maxHeight.value} enhanced showScrollbar={false} type='list'>
<View className={style.lineChart}>
{
!maxHeight.value && <View className={style.empty}>
@ -45,19 +45,20 @@ const LineChart: FC<Props> = ({data}) => {
{
!!maxHeight.value
&& lineChartList.map(d => <View key={d.time}>
<View className={style.columnBox} style={{width: "100px"}}>
<View className={style.columnBox} style={{width: "80px"}}>
<View className={style.line} style={{height: height - 10 - (d.value / maxHeight.value * height) + "px"}}/>
{
d.value > 0 && <View style={{whiteSpace: "nowrap"}}>{formatTime(d.value, 0)}</View>
d.value > 0 && <View className={style.value}>{formatTime(d.value, 0)}</View>
}
<View className={style.column} style={{height: d.value / maxHeight.value * height + "px"}}/>
<View>{d.time}</View>
<View className={style.time}>{d.time}</View>
</View>
</View>)
}
</View>
</ScrollView>
</>
<View className={style.overlay}/>
</View>
)
}

@ -0,0 +1,18 @@
import {CSSProperties, FC} from "react";
import {View} from "@tarojs/components";
interface Props {
text?: string
styles?: CSSProperties
className?: string
}
const PageScript: FC<Props> = (props) => {
return <View
className={'text-center font-24 text-dark py-3 ' + props.className}
style={props.styles}>
{props.text || "暂无更多"}
</View>
}
export default PageScript

@ -4,12 +4,12 @@
border-radius: 24rpx;
.tabs-item {
padding: 8rpx 20rpx !important;
padding: 8rpx !important;
}
.current {
background: #FFF;
border-radius: 18rpx;
border-radius: 25rpx !important;
background-clip: content-box;
&:after {
@ -44,14 +44,18 @@
width: 100%;
border-radius: 90rpx;
transition: background-color 300ms;
&:first-child{
padding: 16rpx 16rpx 16rpx 0;
}
.current {
&:last-child{
padding: 16rpx 0 16rpx 16rpx;
}
}
.sliding{
position: relative;
font-size: 36rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #323635;
&:after {
position: absolute;
@ -69,6 +73,13 @@
transition: all 200ms;
}
}
.current {
font-size: 36rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #323635;
}
}
@keyframes spread {

@ -23,6 +23,7 @@ interface TabsProps {
onChange?: (data: OnChangOpt) => void
backMode?: boolean // 块级模式
style?: CSSProperties
hiddenSliding?: boolean // 取消底部滑块
}
const Tabs: FC<TabsProps> = (opt) => {
@ -50,12 +51,12 @@ const Tabs: FC<TabsProps> = (opt) => {
return (
<View className={`tabs ${opt.backMode ? 'tabsBack' : ''}`} style={{height: opt.height, ...opt.style}}>
<View className={`tabs ${opt.backMode && 'tabsBack'}`} style={{height: opt.height, ...opt.style}}>
<ScrollView scrollX scrollLeft={left} scrollWithAnimation showScrollbar={false} style={{height: opt.height}}>
<View className={'tabs-scroll ' + (opt.tabList.length < 5 ? 'justify-around' : '')}>
{opt.tabList.map((d, index) => <View
key={index}
className={'tabs-item ' + (is_current(d.value, index) ? 'current' : null)}
className={'tabs-item ' + (is_current(d.value, index) && 'current ') + (!opt.hiddenSliding && 'sliding')}
onClick={(event) => onChange(event, index, d)}>
{d.title}
</View>)}

@ -39,7 +39,9 @@ const VideoList: FC<Props> = (props) => {
}
return (
<View key={data.id} className={styles.health} onClick={jump}>
<View className={styles.health}>
<View key={data.id} onClick={jump} className="bg-white">
<Img src={data.url_path} mode='widthFix' errorType={props.errorType} height={346}/>
<View className='p-2 relative'>
<View className='text-ellipsis-1 font-28 text-dark'>{data.title}</View>
@ -61,6 +63,7 @@ const VideoList: FC<Props> = (props) => {
<View>{formatMinute(data.duration || 0)}</View>
</View>
</View>
</View>
</View>)
}

@ -5,6 +5,7 @@ import {courseApi} from "@/api";
import VideoCover from "@/components/videoCover/videoCover";
import {formatMinute} from "@/utils/time";
import Empty from "@/components/empty/empty";
import PageScript from "@/components/pageScript/pageScript";
const CourType: FC = () => {
const params = useRouter().params
@ -73,7 +74,7 @@ const CourType: FC = () => {
/>)
}
</View>
<View className='text-center font-24 text-dark'></View>
<PageScript/>
</>
: <Empty name='暂无数据'/>
}

@ -6,6 +6,7 @@ import {userApi} from "@/api";
import {formatDateTime, formatMinute} from "@/utils/time";
import CustomPageContainer from "@/components/custom-page-container/custom-page-container";
import Empty from "@/components/empty/empty";
import PageScript from "@/components/pageScript/pageScript";
const CurHistory = () => {
const [show, setShow] = useState(false)
@ -106,7 +107,7 @@ const CurHistory = () => {
/>
</View>)
}
<View className='text-center font-24 text-dark mt-3'></View>
<PageScript/>
</View>
: <Empty name='暂无学习记录'/>
}

@ -6,6 +6,7 @@ import {formatMinute} from "@/utils/time";
import Empty from "@/components/empty/empty";
import {userApi} from "@/api";
import Img from "@/components/image/image";
import PageScript from "@/components/pageScript/pageScript";
const History = () => {
const [data, setData] = useState<HourHistory[]>([])
@ -45,7 +46,7 @@ const History = () => {
</View>
</View>)
}
<View className='text-center font-24 text-dark mt-3'></View>
<PageScript/>
</>
: <Empty name='无观看记录'/>
}

@ -41,6 +41,7 @@ const Adware: FC<Props> = ({data, only_flag, width}) => {
fadeIn
onClick={() => jumpAdware(adverts[0].image_path)}
width={width}
errorType='profession'
height={(space.height / space.width) * width}/>
}
{
@ -56,6 +57,7 @@ const Adware: FC<Props> = ({data, only_flag, width}) => {
lazyLoad
fadeIn
width={width}
errorType='profession'
height={(space.height / space.width) * width}
onClick={() => jumpAdware(d.image_path)}/>
</SwiperItem>)}

@ -1,11 +1,13 @@
import {FC, ReactNode, useEffect, useState} from "react";
import {Image, View} from "@tarojs/components";
import {Image, Text, View} from "@tarojs/components";
import {HomeApi} from "@/api";
import {useReachBottom} from "@tarojs/taro";
import Taro, {useReachBottom} from "@tarojs/taro";
import styles from "../home.module.scss";
import VideoCover from "@/components/videoCover/videoCover";
import courseTag from '@/static/img/courseTag.png'
import ArticlesBox from "@/components/articlesBox/articlesBox";
import arrowRight from '@/static/img/arrow-right.png'
import PageScript from "@/components/pageScript/pageScript";
const CurRecommended: FC = () => {
const [page, setPage] = useState(1)
@ -29,6 +31,10 @@ const CurRecommended: FC = () => {
setData(newData ?? [])
}
function jumpArticles() {
Taro.navigateTo({url: '/pages/preview/jumpArticles/jumpArticles'})
}
useEffect(() => {
getData()
}, [page])
@ -40,13 +46,15 @@ const CurRecommended: FC = () => {
let examines: ReactNode | undefined
if (articles.length > 0) {
examines = (
<View className="mb-5">
<View className='bg-white rounded-20 clip px-3'>
<View className='mt-3 mb-3 font-32 bold text-dark'></View>
{
articles.map(d => <ArticlesBox data={d}/>)
}
<View className='mt-3 bold text-dark flex justify-between'>
<Text className='font-32'></Text>
<View className='font-24 text-muted flex align-center' onClick={jumpArticles}>
<Text></Text>
<Image src={arrowRight} mode='widthFix' style={{width: '20rpx', height: '20rpx'}}/>
</View>
</View>
{articles.map(d => <ArticlesBox data={d}/>)}
</View>
)
}
@ -54,7 +62,7 @@ const CurRecommended: FC = () => {
let videos: ReactNode | undefined
if (data.length > 0) {
videos = (
<View>
<View className='mt-3'>
<Image src={courseTag} mode='widthFix' className={styles.courseTag}/>
<View className={'pb-2 flex justify-between flex-wrap ' + styles.videoListBox}>
{
@ -76,7 +84,7 @@ const CurRecommended: FC = () => {
<>
{examines}
{videos}
<View className='text-center font-24 text-dark'></View>
<PageScript/>
</>
)
}

@ -1,3 +1,7 @@
page {
padding: 0 !important;
}
.tipsLogin {
padding: 20px;
color: #fff;

@ -51,8 +51,8 @@ const Home: FC = () => {
cancelBack
leftNode={
<>
<Image src={logo} style={{height: "110%"}} mode='heightFix'/>
<Text className='font-36 font-weight'></Text>
<Image src={logo} style={{height: "70%"}} mode='heightFix'/>
<Text className='font-36 font-weight ml-2'></Text>
</>
}
>

@ -8,6 +8,7 @@ import {userApi} from "@/api";
import Empty from "@/components/empty/empty";
import {Profile} from "@/store";
import LoginView from "@/components/loginView";
import PageScript from "@/components/pageScript/pageScript";
interface Props {
categoryKey: CoursesKey
@ -128,7 +129,7 @@ export const VideoList: FC<Props> = ({categoryKey, setCategoryKey}) => {
/>)
}
</View>
<View className='text-center font-24 text-dark mt-2'></View>
<PageScript/>
</>
: <Empty name='暂无课程'/>
}

@ -8,6 +8,7 @@ import NavigationBar from "@/components/navigationBar/navigationBar";
import Spin from "@/components/spinner";
import {isBoolean} from "@tarojs/shared";
import ArticlesBox from "@/components/articlesBox/articlesBox";
import PageScript from "@/components/pageScript/pageScript";
const category: TabList[] = [
{title: "企选课程", value: 'is_required'},
@ -25,7 +26,7 @@ const Index: FC = () => {
<View className={styles.content}>
<NavigationBar
cancelBack
leftNode={<Tabs tabList={category} onChange={tabChange} current={categoryKey}/>}
leftNode={<Tabs tabList={category} onChange={tabChange} current={categoryKey} hiddenSliding/>}
backgroundColor={'transparent'}
/>
<VideoList
@ -59,7 +60,7 @@ const AuditMode: FC = () => {
articles.map(d => <ArticlesBox data={d}/>)
}
</View>
<View className='text-center font-24 text-dark mt-2'></View>
<PageScript/>
</>
: <Index/>
}

@ -1,12 +1,11 @@
import {FC, useCallback, useEffect, useState} from "react";
import {Image, Input, Radio, Text, View} from "@tarojs/components";
import {Input, Radio, View} from "@tarojs/components";
import styles from "../courseAdmin.module.scss";
import Icon from "@/components/icon";
import {CourseAllParam, curriculum} from "@/api";
import CustomPageContainer from "@/components/custom-page-container/custom-page-container";
import Empty from "@/components/empty/empty";
import MyButton from "@/components/button/MyButton";
import screen from '@/static/img/screen.png'
interface Props {
param: CourseAllParam
@ -70,17 +69,10 @@ export const Search: FC<Props> = ({param, setParam}) => {
})}
/>
</View>
<View onClick={() => setShow(true)}>
<Text></Text>
<Image src={screen}
mode='aspectFit'
style={{
display: 'inline-block',
width: '15px',
height: '15px',
verticalAlign: 'middle',
marginLeft: '5px'
}}/>
<View className='mt-3'>
<View onClick={() => setShow(true)} className={styles.select}>
</View>
</View>
</View>

@ -1,15 +1,17 @@
page {
background: #fff !important;
}
.searchBox {
background: #fff;
padding: 24rpx 30rpx;
display: flex;
justify-content: space-between;
box-sizing: border-box;
position: sticky;
top: 0;
border-bottom: 1px solid #F5F8F7;
}
.searchInput {
width: 550rpx;
width: 100%;
height: 68rpx;
display: flex;
align-items: center;
@ -19,6 +21,20 @@
overflow: hidden;
}
.select{
width: 172rpx;
height: 56rpx;
background: #F6F6F6;
border-radius: 28rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #323635;
}
.radioBox {
border-bottom: 1px solid #F5F8F7;
padding: 20px 0;

@ -8,6 +8,7 @@ import MyButton from "@/components/button/MyButton";
import storageDep from "@/hooks/storageDep";
import Spin from "@/components/spinner";
import Img from "@/components/image/image";
import PageScript from "@/components/pageScript/pageScript";
const CourseAdmin: FC = () => {
const [total, setTotal] = useState(0)
@ -172,7 +173,7 @@ const CourseAdmin: FC = () => {
</View>
</View>)
}
<View className='text-center font-24 text-dark mt-3'></View>
<PageScript/>
</View>
<View className={styles.add}>

@ -3,7 +3,7 @@
background: white;
min-height: calc(100vh - 20rpx - env(safe-area-inset-bottom));
box-sizing: border-box;
padding-bottom: calc(env(safe-area-inset-bottom) + 80rpx);
padding-bottom: calc(env(safe-area-inset-bottom) + 100rpx);
}
.operation {
@ -16,7 +16,7 @@
left: 0;
.safeAreaInsetBottom {
height: 80rpx;
height: 100rpx;
align-items: center;
justify-content: space-around;
padding-bottom: env(safe-area-inset-bottom);

@ -4,6 +4,7 @@ import {useEffect, useState} from "react";
import {View, Progress, CustomWrapper} from "@tarojs/components";
import './student.scss'
import Taro from "@tarojs/taro";
import PageScript from "@/components/pageScript/pageScript";
const Student = () => {
const {id, name} = getCurrentInstance()?.router?.params as any
@ -32,7 +33,7 @@ const Student = () => {
)
})
}
<View className='text-center py-1'></View>
<PageScript/>
</CustomWrapper>
)
}

@ -14,16 +14,15 @@ const Info: FC<Props> = ({data}) => {
<>
<View className={styles.box} style={{height: '184rpx'}}>
<Img width={120} height={120} src={data?.avatar || ''} className={styles.image} errorType='avatar'/>
<View className='ml-2'>
<View>
<View className='ml-3'>
<View className='flex align-center'>
<Text className='font-weight font-32'>{data?.name}</Text>
<Text
<View
className={data?.is_lock ? styles.tag_muted : styles.tag}>
{data?.is_lock ? '禁用' : '正常'}
</Text>
</View>
<View className='text-muted font-28'
style={{marginTop: '2px'}}>
</View>
<View className='text-muted font-28 mt-2'>
{['学员', '管理员', '超级管理员'][data?.role_type || 0]}
</View>
</View>
@ -31,11 +30,11 @@ const Info: FC<Props> = ({data}) => {
<View className={`${styles.box}`} style={{display: 'block', margin: '16rpx 0', padding: '0 32rpx'}}>
<View className={styles.information} style={{borderBottom: "1px solid #F5F8F7"}}>
<Text style={{width: '100px', display: 'inline-block'}}></Text>
<Text style={{width: '100px', display: 'inline-block', color: '#323635'}}></Text>
<Text>{data?.id}</Text>
</View>
<View className={styles.information}>
<Text style={{width: '100px', display: 'inline-block'}}></Text>
<Text style={{width: '100px', display: 'inline-block', color: '#323635'}}></Text>
<Text>{data?.phone_number}</Text>
</View>
</View>

@ -10,6 +10,8 @@
align-items: center;
box-sizing: border-box;
line-height: 1.75;
color: #606563;
font-family: PingFang SC-Regular, PingFang SC;
}
.image {
@ -25,10 +27,14 @@
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
margin-left: 20rpx;
padding: 3rpx 10rpx;
margin-left: 16rpx;
border-radius: 8rpx;
box-sizing: border-box;
height: 32rpx;
width: 60rpx;
display: inline-flex;
justify-content: center;
align-items: center;
}
.tag_muted {
@ -37,17 +43,20 @@
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
margin-left: 20rpx;
padding: 3rpx 10rpx;
margin-left: 16rpx;
border-radius: 8rpx;
box-sizing: border-box;
height: 32rpx;
width: 60rpx;
display: inline-flex;
justify-content: center;
align-items: center;
}
.information {
height: 96rpx;
box-sizing: border-box;
width: 100%;
color: #606563;
padding: 20rpx 0;
}

@ -53,46 +53,12 @@ page {
}
}
/*.page {
background: linear-gradient(180deg, #45D4A8 0%, rgba(69, 212, 168, 0) 100%) no-repeat;
background-size: 100% 458rpx;
width: 100%;
overflow: hidden;
&:before {
content: '';
display: block;
position: absolute;
top: -80rpx;
left: -80rpx;
width: 230rpx;
height: 230rpx;
background: #FFFF;
opacity: 0.2;
border-radius: 230rpx;
}
}*/
.content {
z-index: 8;
position: relative;
box-sizing: border-box;
padding: 0 30rpx 24rpx;
width: 100%;
//overflow: hidden;
/* &:after {
content: '';
display: block;
position: absolute;
top: 0rpx;
right: -100rpx;
width: 290rpx;
height: 290rpx;
background: #FFFF;
opacity: 0.2;
border-radius: 290rpx;
}*/
}
@ -127,8 +93,6 @@ page {
justify-content: space-between;
background: #fff;
height: 100%;
}
.timeImag {
@ -156,7 +120,6 @@ page {
background: #fff;
border-radius: 20rpx;
padding: 30rpx;
//margin-top: 30rpx;
}
.box {
@ -210,5 +173,12 @@ page {
}
}
}
}
.corporation {
font-size: 32rpx;
padding-bottom: 30rpx;
display: flex;
justify-content: center;
border-bottom: 2rpx solid #f5f8f7;
}

@ -22,6 +22,7 @@ interface List {
src: string,
type?: number
}
function jump(token: string | null, type?: number) {
if (!token) {
Taro.navigateTo({url: '/pages/login/login'})
@ -36,7 +37,7 @@ const My: FC = () => {
const {token, company, setCompany, user} = Profile.useContainer()
const [companyShow, setCompanyShow] = useState(false)
const [companyList, setCompanyList] = useState<Company[]>([])
const [courseRecord,setCourseRecord] = useState<Course | undefined>(undefined)
const [courseRecord, setCourseRecord] = useState<Course | undefined>(undefined)
const [navbarOpacity, setNavbarOpacity] = useState('0')
const navbarHeight = globalData.statusBarHeight + globalData.textBarHeight;
const [auditMode, setAuditMode] = useState(true)
@ -123,22 +124,16 @@ const My: FC = () => {
</>
}
<Service/>
<PageContainer
overlayStyle={'background:rgba(0,0,0,0.3)'}
overlayStyle='background:rgba(0,0,0,0.3)'
position='bottom'
round
show={companyShow}
onClickOverlay={() => setCompanyShow(false)}>
<View className="px-3 py-5">
<View className="font-32 pb-3" style={{
display: 'flex',
justifyContent: 'center',
borderBottom: '2rpx solid #f5f8f7'
}}>
</View>
<View className={styles.corporation}></View>
{
companyList.length >= 1 &&
companyList.map((d, idx) =>

@ -9,6 +9,7 @@ import Img from "@/components/image/image";
import Spin from "@/components/spinner";
import Collect from "@/components/collect/collect";
import ArticlesBox from "@/components/articlesBox/articlesBox";
import PageScript from "@/components/pageScript/pageScript";
type Params = {
id: number
@ -120,7 +121,7 @@ const BrandInfo: FC = () => {
{
articleList?.length ? <>{
articleList.map(d => <ArticlesBox data={d}/>)}
<View className='text-center font-24 text-dark mt-3'></View>
<PageScript/>
</>
: <Empty name='空空如也'/>
}

@ -9,6 +9,7 @@ import {beforeTime} from "@/utils/time";
import styles from './list.module.scss'
import articleLine from "@/static/img/articleLine.png"
import Collect from "@/components/collect/collect";
import PageScript from "@/components/pageScript/pageScript";
const BrandItem: FC<{ data: BrandRecord; onClick: VoidFunction }> = ({data, onClick}) => {
let media: ReactNode
@ -130,7 +131,7 @@ const BrandList: FC = () => {
brands.length ?
<>
{brands.map(d => <BrandItem data={d} key={d.id} onClick={() => jumpInfo(d.id)}/>)}
<View className='text-center font-24 text-dark mt-3'>{text}</View>
<PageScript text={text}/>
</>
: <Empty name='暂无品牌入驻'/>
}

@ -9,6 +9,7 @@ import Spin from "@/components/spinner";
import Img from "@/components/image/image";
import {rfc33392time} from "@/utils/day";
import play from "@/static/img/play.png";
import PageScript from "@/components/pageScript/pageScript";
interface KillData {
data: any[]
@ -59,7 +60,7 @@ const Profession = () => {
}
Taro.useDidShow(useCallback(() => {
if(categoryId){
if (categoryId) {
let tempMap = new Map()
tempMap.set(categoryId, {
data: [],
@ -69,7 +70,7 @@ const Profession = () => {
setData(tempMap)
getData()
}
},[data]))
}, [data]))
useEffect(() => {
categoryId && getData()
@ -77,7 +78,7 @@ const Profession = () => {
async function getCategory() {
try {
const res = [{name:'视频',id:2},{name:'文章',id:1},{name:'课程',id:3},{name:'其他',id:4}]
const res = [{name: '视频', id: 2}, {name: '文章', id: 1}, {name: '课程', id: 3}, {name: '其他', id: 4}]
const newTabs = res.map<TabList>(d => ({title: d.name, value: d.id}))
setTabs(newTabs)
setCategoryId(newTabs[0].value as number)
@ -89,15 +90,16 @@ const Profession = () => {
function tabsChange(tab: OnChangOpt) {
setCategoryId(tab.tab?.value as number)
}
function jumpInfo(info: any) {
console.log(info,'info')
if(info.article){
console.log(info, 'info')
if (info.article) {
Taro.navigateTo({url: `/pages/preview/brand/article/article?id=${info.owner_id}`})
}else if(info.course){
} else if (info.course) {
Taro.navigateTo({url: `/pages/business/videoInfo/videoInfo?id=${info.owner_id}`})
}else if(info.video_records){
} else if (info.video_records) {
Taro.navigateTo({url: `/pages/preview/videoFull/videoFull?id=${info.owner_id}`})
}else if(info.brand){
} else if (info.brand) {
Taro.navigateTo({url: `/pages/preview/brand/info/info?id=${info.owner_id}`})
}
}
@ -144,7 +146,8 @@ const Profession = () => {
{
d.video_records &&
<>
<Img width={192} height={192} src={d.video_records.url_path} mode='aspectFill' className={styles.image}/>
<Img width={192} height={192} src={d.video_records.url_path} mode='aspectFill'
className={styles.image}/>
<Image src={play} className={styles.play} mode='aspectFit'/>
<View className={styles.videoRightBox}>
<View className='font-weight mb-2 font-28 lh-40'>{d.video_records.title}</View>
@ -163,11 +166,10 @@ const Profession = () => {
</View>
</>
}
</View>
)
}
<View className='text-center font-24 text-dark mt-2'></View>
<PageScript/>
</ScrollView>
)
}

@ -1,18 +1,17 @@
.container {
width: 100%;
padding: 20rpx;
padding: 0 20rpx;
box-sizing: border-box;
columns: 2;
column-count: 2;
column-gap: 20rpx;
}
.health {
break-inside: avoid;
background: #fff;
border-radius: 10px;
overflow: hidden;
margin-bottom: 20rpx;
padding-top: 20rpx;
position: relative;
break-inside: avoid;
overflow: hidden;
}
.play {

@ -6,6 +6,7 @@ import styles from './health.module.scss'
import Empty from "@/components/empty/empty";
import Spin from "@/components/spinner";
import VideoList from "@/components/videoList/videoList";
import PageScript from "@/components/pageScript/pageScript";
const Health: FC = () => {
const [page, setPage] = useState(1)
@ -44,7 +45,7 @@ const Health: FC = () => {
<View className={styles.container}>
{data.map(d => <VideoList data={d} errorType='health'/>)}
</View>
<View className='text-center font-24 text-dark mt-2'></View>
<PageScript/>
</>
: <Empty name='暂无数据'/>
}

@ -15,7 +15,7 @@ const BrandList: FC = () => {
const [enable, setEnable] = useState(true)
useEffect(() => {
getData().then()
getData()
}, [page])
const getData = useCallback(async () => {
@ -49,7 +49,7 @@ const BrandList: FC = () => {
articles.map(d => <ArticlesBox data={d}/>)
}
</View>
<View className='text-center font-24 text-dark mt-3'></View>
</>
: <Empty name='暂无文章'/>
}

@ -0,0 +1,4 @@
export default definePageConfig({
navigationBarTitleText: '推荐文章',
onReachBottomDistance: 50
})

@ -0,0 +1,56 @@
import {FC, useEffect, useState} from "react";
import {View} from "@tarojs/components";
import {publicApi} from "@/api";
import Spin from "@/components/spinner";
import ArticlesBox from "@/components/articlesBox/articlesBox";
import {useReachBottom} from "@tarojs/taro";
import PageScript from "@/components/pageScript/pageScript";
import Empty from "@/components/empty/empty";
const JumpArticlesConfig: FC = () => {
const [page, setPage] = useState(1)
const [total, setTotal] = useState(0)
const [enable, setEnable] = useState(true)
const [data, setData] = useState<Articles[]>([])
useEffect(() => {
publicApi.articlesPush(page, 10).then(res => {
setTotal(res.total)
const result = res.list.reduce((pre, cur) => {
const index = pre.findIndex(d => d.id === cur.id)
if (index === -1) {
pre.push(cur)
} else {
pre.splice(index, 1, cur)
}
return pre
}, data)
setData(result)
}).finally(() => {
setEnable(false)
})
}, [page])
useReachBottom(() => {
if (data.length < total) {
setPage(page + 1)
}
})
return (
<View>
<Spin enable={enable} overlay/>
<View className='bg-white rounded-20 clip m-3 px-3'>
{
data.length > 0
?data.map(d => <ArticlesBox data={d}/>)
:<Empty name='暂无更多文章'/>
}
</View>
<PageScript/>
</View>
)
}
export default JumpArticlesConfig

@ -1,6 +1,6 @@
.container {
width: 100%;
padding: 20rpx;
padding: 0 20rpx;
box-sizing: border-box;
columns: 2;
column-gap: 20rpx;

@ -7,6 +7,7 @@ import Taro from "@tarojs/taro";
import styles from './profession.module.scss'
import Spin from "@/components/spinner";
import VideoList from "@/components/videoList/videoList";
import PageScript from "@/components/pageScript/pageScript";
interface KillData {
data: VideList[]
@ -98,12 +99,11 @@ const Profession = () => {
onScrollToLower={() => getData(true)}
className={styles.height}>
<View className={styles.container}>
{
data.data.map(d => <VideoList data={d} errorType='profession'/>)
}
</View>
<View className='text-center font-24 text-dark mt-2'></View>
<PageScript/>
</ScrollView>
)
}

@ -10,19 +10,43 @@ page {
top: 0;
left: 0;
right: 0;
bottom: calc(env(safe-area-inset-bottom) + 320rpx);
bottom: calc(env(safe-area-inset-bottom) + 200rpx);
margin: auto;
background: #000;
}
.text {
position: fixed;
z-index: 20;
width: 100%;
color: #fff;
bottom: calc(env(safe-area-inset-bottom));
padding: 0 30rpx;
box-sizing: border-box;
color: #FFFFFF;
transform: translateY(-200%);
}
.title {
position: fixed;
z-index: 10;
bottom: env(safe-area-inset-bottom);
width: 100%;
color: #fff;
padding:20rpx 30rpx;
box-sizing: border-box;
background: #000;
width: 100%;
bottom: env(safe-area-inset-bottom);
padding: 0 50rpx;
box-sizing: border-box;
height: 100rpx;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 26rpx;
font-family: PingFang SC-Medium, PingFang SC;
}
.img {
width: 48rpx;
height: 48rpx;
verticalAlign: middle;
margin-right: 15rpx;
}

@ -1,4 +1,4 @@
import {Video, View} from "@tarojs/components";
import {Video, View, Text, Image} from "@tarojs/components";
import {FC, useState} from "react";
import Taro from "@tarojs/taro";
import styles from './videoFull.module.scss'
@ -6,6 +6,7 @@ import {brandApi, HomeApi} from "@/api";
import Collect from "@/components/collect/collect";
import Spin from "@/components/spinner";
import VideoEvent from "@/hooks/videoEvent";
import palyWhite from '@/static/img/palyWhite.png'
interface Params {
id: string
@ -91,12 +92,12 @@ const VideoFull: FC = () => {
data ? <>
<Video
posterSize='100%'
id={'myVideo'}
id='myVideo'
onClick={click}
className={styles.video}
controls
src={data?.resource?.url}
autoplay
className={styles.video}
src={data?.resource?.url}
showCenterPlayBtn
autoPauseIfOpenNative
autoPauseIfNavigate
@ -107,13 +108,22 @@ const VideoFull: FC = () => {
onPause={() => setpalying(false)}
onError={onError}
/>
<View className={styles.text}>
<View className='font-32 font-weight'>{data.title}</View>
<View className='font-28 mt-2 text-ellipsis-2'>{data.introduction}</View>
</View>
<View className={styles.title}>
<View className='flex'>
<View className='font-36 font-weight flex-1 pr-3 text-row1'>{data.title}</View>
<Collect owner_id={Number(id)} owner_type={2} styles={{color: '#fff'}} select={data.collects}/>
<View className='flex align-center mr-5'>
<Image src={palyWhite} mode='widthFix' className={styles.img}/>
<Text>{data.video_view}</Text>
</View>
<View className='font-32'>{data.video_view}</View>
<View className='font-32 mt-1 text-ellipsis-1'>{data.introduction}</View>
<Collect owner_id={Number(id)}
owner_type={2}
stylesImage={{width: '48rpx', height: '48rpx'}}
styles={{color: '#fff', width: 'auto'}}
select={data.collects}/>
</View>
</> : <Spin enable={enable} overlay/>
}

@ -1,52 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="60" height="60"
viewBox="0 0 60 60">
<defs>
<style>
.a,.f,.k{fill:none;}.a{stroke:rgba(255,0,0,0);}.b{fill:#45d4a8;}.c{fill:#ffbb8f;}.c,.d{stroke:rgba(0,0,0,0);}.d{fill:#ff9e5f;stroke-miterlimit:10;}.e{fill:#36bb92;}.f{stroke:#ebebeb;}.g{clip-path:url(#a);}.h{clip-path:url(#c);}.i{clip-path:url(#d);}.j{stroke:none;}
</style>
<clipPath id="a">
<rect class="a" width="30" height="31.006"/>
</clipPath>
<clipPath id="c">
<rect class="b" width="30" height="31.166"/>
</clipPath>
<clipPath id="d">
<rect class="e" width="30" height="31.166"/>
</clipPath>
</defs>
<g transform="translate(-159 -180)">
<g transform="translate(-1)">
<g transform="translate(175 194.975)">
<g transform="translate(0 0.028)">
<g class="g">
<g class="g">
<path class="a"
d="M28.887,18.313A41.879,41.879,0,0,1,16.2,27.768,40.857,40.857,0,0,1,7.1,30.911a4.273,4.273,0,0,1-4.907-2.725,37.1,37.1,0,0,1-1.98-8.75A40.568,40.568,0,0,1,.12,12.158,44.3,44.3,0,0,1,1.756,3.1,4.279,4.279,0,0,1,6.988.153,52.15,52.15,0,0,1,20.1,5.752,46.709,46.709,0,0,1,28.731,12.4a4.27,4.27,0,0,1,.156,5.912"
transform="translate(0 0)"/>
</g>
</g>
</g>
<g transform="translate(0 0)">
<g class="h" transform="translate(0 0)">
<path class="b"
d="M1.424,3.749a48.472,48.472,0,0,0,.083,23.657,4.987,4.987,0,0,0,6.127,3.587,50.257,50.257,0,0,0,20.754-11.9,4.994,4.994,0,0,0,.042-7.31A48.826,48.826,0,0,0,7.528.166a4.982,4.982,0,0,0-6.1,3.584"
transform="translate(0 0)"/>
</g>
</g>
</g>
<path class="c"
d="M.5,14.519a.529.529,0,0,1-.5-.53V0A52.031,52.031,0,0,1,8.914,3.98v9.97a.529.529,0,0,1-.865.409L4.911,11.751a.528.528,0,0,0-.666-.009L.855,14.405a.521.521,0,0,1-.3.114Z"
transform="translate(185.543 196.083)"/>
<path class="d"
d="M0,14.026V0C.187.063.373.126.558.191V14.026L3.9,11.338a1.083,1.083,0,0,1,1.364.018L8.4,13.964,8.371,3.725q.274.155.543.31v9.951a.529.529,0,0,1-.53.529.516.516,0,0,1-.335-.123L4.91,11.785a.531.531,0,0,0-.338-.122.525.525,0,0,0-.327.113L.854,14.441a.523.523,0,0,1-.324.113A.529.529,0,0,1,0,14.026Z"
transform="translate(185.542 196.048)"/>
<g transform="translate(175 194.975)">
<g class="i" transform="translate(0 0)">
<path class="e"
d="M6.253.43A4.61,4.61,0,0,1,7.42.581,48.178,48.178,0,0,1,28.136,12.092a4.565,4.565,0,0,1-.039,6.682,49.677,49.677,0,0,1-20.575,11.8,4.545,4.545,0,0,1-5.6-3.278A47.787,47.787,0,0,1,1.842,3.854,4.537,4.537,0,0,1,6.253.43m0-.43A4.975,4.975,0,0,0,1.425,3.749a48.472,48.472,0,0,0,.083,23.657,4.976,4.976,0,0,0,6.127,3.587,50.256,50.256,0,0,0,20.754-11.9,5,5,0,0,0,.042-7.31A48.828,48.828,0,0,0,7.529.166,5.026,5.026,0,0,0,6.253,0"
transform="translate(0 0)"/>
</g>
</g>
</g>
</g>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="108.673" height="66.496" viewBox="0 0 108.673 66.496"><defs><style>.a{fill:url(#a);}.b{clip-path:url(#d);}.c{clip-path:url(#f);}.d{clip-path:url(#h);}</style><linearGradient id="a" x1="0.211" y1="-0.397" x2="0.919" y2="-0.372" gradientUnits="objectBoundingBox"><stop offset="0" stop-color="#99d039"/><stop offset="1" stop-color="#3caf3b"/></linearGradient><clipPath id="d"><path class="a" d="M50.843,54.07c26.033.222,29.816-9.346,29.816-9.346a74.891,74.891,0,0,1-37.27,1.669C16.021,37.715,0,45.058,0,45.058c28.591.215,31.221,21.406,58.855,21.437h.119q1.4,0,2.883-.077c31.6-2.448,46.816-25.254,46.816-25.254-40.295,28.7-57.83,12.906-57.83,12.906"/></clipPath><clipPath id="f"><path class="a" d="M54.12,22a10.427,10.427,0,0,0-17.8,7.374,12.6,12.6,0,0,0,1.534,5.954,16.977,16.977,0,0,0,2.1,3.05,29.974,29.974,0,0,0,3.853,3.71c.623.513,1.239.991,1.811,1.421A70.841,70.841,0,0,0,61.078,44.63c.883-.617,2.108-1.511,3.356-2.538a30.106,30.106,0,0,0,3.853-3.71,16.97,16.97,0,0,0,2.1-3.05,12.6,12.6,0,0,0,1.534-5.954A10.428,10.428,0,0,0,54.12,22"/></clipPath><clipPath id="h"><path class="a" d="M68.8,0A20.751,20.751,0,0,0,54.12,6.08,20.759,20.759,0,0,0,18.683,20.758a25.1,25.1,0,0,0,3.054,11.853,33.8,33.8,0,0,0,4.179,6.071q.282.33.574.66c2.354.277,4.851.678,7.485,1.229-.549-.568-1.067-1.135-1.546-1.7A25.935,25.935,0,0,1,29.214,34.2a19.3,19.3,0,0,1-2.349-9.116A15.966,15.966,0,0,1,54.12,13.8a15.965,15.965,0,0,1,27.254,11.29A19.308,19.308,0,0,1,79.025,34.2a26.031,26.031,0,0,1-3.214,4.669,43.63,43.63,0,0,1-4.836,4.785,69.727,69.727,0,0,0,8.476-1.89c1.05-1.038,2-2.062,2.871-3.085A33.759,33.759,0,0,0,86.5,32.611a25.1,25.1,0,0,0,3.053-11.853A20.76,20.76,0,0,0,68.8,0Z"/></clipPath></defs><g transform="translate(0 0.001)"><g class="b"><rect class="a" width="108.673" height="32.152" transform="translate(0 37.715)"/></g><g class="c"><rect class="a" width="35.601" height="25.842" transform="translate(36.319 18.951)"/></g><g class="d"><rect class="a" width="70.873" height="43.658" transform="translate(18.683 -0.001)"/></g></g></svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Loading…
Cancel
Save