Compare commits

...

2 Commits

  1. 1
      src/api/curriculum.ts
  2. 13
      src/components/collect/collect.module.scss
  3. 22
      src/components/collect/collect.tsx
  4. 2
      src/components/lineChart/lineChart.module.scss
  5. 2
      src/pages/index/index.tsx
  6. 5
      src/pages/manage/courseAdmin/courseAdmin.tsx
  7. 8
      src/pages/manage/depAdmin/depAdmin.tsx
  8. 17
      src/pages/my/my.tsx
  9. 6
      src/pages/preview/brand/info/info.tsx
  10. 20
      src/pages/preview/brand/list/list.module.scss
  11. 23
      src/pages/preview/brand/list/list.tsx
  12. BIN
      src/static/img/articleLine.png
  13. BIN
      src/static/img/giveLike.png
  14. BIN
      src/static/img/giveLikeLine.png
  15. BIN
      src/static/img/star.png
  16. BIN
      src/static/img/starLine.png

@ -32,6 +32,7 @@ export interface HourPlayData {
}
export interface Course {
audit_mode: boolean
/** 完成 */
finished_count: number;
/** 未完成 */

@ -0,0 +1,13 @@
.collect {
display: flex;
align-items: center;
color: #909795;
font-size: 24rpx;
Image {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
//vertical-align: middle;
}
}

@ -0,0 +1,22 @@
import {FC} from "react";
import star from '@/static/img/star.png'
import starLine from '@/static/img/starLine.png'
import {Image, View} from "@tarojs/components";
import styles from './collect.module.scss'
interface Props {
onClick?: () => void
select?: boolean
}
/** 收藏 */
const Collect: FC<Props> = (props) => {
return (
<View className={styles.collect}>
<Image src={props.select ? star : starLine}/>
{props.select ? '已收藏' : '收藏'}
</View>
)
}
export default Collect

@ -3,7 +3,7 @@
align-items: flex-end;
justify-content: left;
flex-wrap: nowrap;
height: 380px;
height: 400px;
position: relative;
}

@ -58,7 +58,7 @@ const AuditMode: FC = () => {
{
articles.map((d, i) => <View className='p-3 relative'>
{i > 0 && <View className='absolute top left right divided ml-3 mr-3'/>}
<View className="font-34 bold text-black">{d.title}</View>
<View className="font-34 text-black">{d.title}</View>
{(d.intro || '').length > 40 && (<View className='flex mt-1'>
<View className="flex-1 font-24 lh1_5">{d.intro}</View>
{d.cover && <Img className='ml-l' width={140} height={100} src={d.cover} errorType="acquiesce"/>}

@ -1,5 +1,5 @@
import {FC, useCallback, useEffect, useState} from "react";
import {Image, Radio, Text, View} from "@tarojs/components";
import {Radio, Text, View} from "@tarojs/components";
import {Search} from "./components/search";
import {CourseAllParam, courseApi, ManageApi} from "@/api";
import styles from './courseAdmin.module.scss'
@ -7,6 +7,7 @@ import Taro, {useReachBottom} from "@tarojs/taro";
import MyButton from "@/components/button/MyButton";
import storageDep from "@/hooks/storageDep";
import Spin from "@/components/spinner";
import Img from "@/components/image/image";
const CourseAdmin: FC = () => {
const [total, setTotal] = useState(0)
@ -162,7 +163,7 @@ const CourseAdmin: FC = () => {
checked={curs.includes(d.id)}
style={{marginTop: '30px'}}
onClick={() => addCurs(d.id)}/>}
<Image src={d.thumb} className={styles.curImage}/>
<Img src={d.thumb} className={styles.curImage}/>
<View>{d.title}</View>
</View>
<View className={styles.Operation}>

@ -150,15 +150,17 @@ const DepAdmin: FC = () => {
leftImage={folder}
/>)}
{users.map(d => <PopPut
{
users.map(d => <PopPut
errorType='avatar'
key={d.id}
leftImage={d.avatar}
title={d.name}
onClick={() => Taro.navigateTo({url: '/pages/manage/userInfo/userInfo?userId=' + d.id})}
content={['学员', '管理员', '超级管理员'][d.role_type]}
/>)}
<View className='text-center font-24 text-dark mt-3'></View>
/>)
}
{manages.length > 0 || users.length > 0 && <View className='text-center font-24 text-dark mt-3'></View>}
{!manages.length && !users.length && <Empty name='暂无数据'/>}

@ -37,6 +37,7 @@ const My: FC = () => {
const [companyList, setCompanyList] = useState<Company[]>([])
const [navbarOpacity, setNavbarOpacity] = useState('0')
const navbarHeight = globalData.statusBarHeight + globalData.textBarHeight;
const [auditMode, setAuditMode] = useState(true)
Taro.useDidShow(() => {
token && userApi.companyList().then(res => {
@ -59,9 +60,10 @@ const My: FC = () => {
Taro.useDidShow(async () => {
try {
const res = await curriculum.course()
setAuditMode(res.audit_mode)
const oldList: List[] = JSON.parse(JSON.stringify(list))
oldList[1].time = res.finished_count
oldList[2].time = res.not_finished_count
oldList[1].time = res.finished_count || 0
oldList[2].time = res.not_finished_count || 0
setList(oldList)
} catch (e) {
}
@ -90,8 +92,9 @@ const My: FC = () => {
<Header companyList={companyList} showCompany={() => companyList.length >= 2 && setCompanyShow(true)}/>
</View>
{
!auditMode && <>
<Time/>
<View className="bg-white rounded-20 mb-2 clip">
<View className="flex p-2">
{list.map((d) => (
@ -108,13 +111,15 @@ const My: FC = () => {
</View>
))}
</View>
{
token && (<View className="p-2">
<View className="p-2">
<LearningRecord style={{paddingTop: '0 !important'}} userId={user?.id}/>
</View>)
</View>
}
</View>
</>
}
<Service/>

@ -8,6 +8,7 @@ import Empty from "@/components/empty/empty";
import Img from "@/components/image/image";
import {rfc33392time} from "@/utils/day";
import Spin from "@/components/spinner";
import Collect from "@/components/collect/collect";
type Params = {
id: number
@ -108,7 +109,10 @@ const BrandInfo: FC = () => {
<View className={styles['body']}>
<View className={styles['top']}>
<Text className={styles['title']}>{brandInfo?.name}</Text>
<View className='flex justify-between'>
<Text className={`${styles['title']} flex-1`}>{brandInfo?.name}</Text>
<Collect/>
</View>
<LineEllipsis text={brandInfo?.graphic_introduction || '暂无简介'}></LineEllipsis>
</View>
<View className={styles['bottom']}>

@ -1,5 +1,4 @@
.box2 {
//display: flex;
margin-bottom: 20rpx;
background-color: #fff;
border-radius: 16rpx;
@ -14,10 +13,7 @@
.box {
display: flex;
//margin-bottom: 20rpx;
//background-color: #fff;
border-radius: 16rpx;
//margin-bottom: 6rpx;
padding: 24rpx;
box-sizing: border-box;
position: relative;
@ -62,3 +58,19 @@
-webkit-line-clamp: 2;
}
.previewImag {
overflow: hidden;
border-radius: 20rpx;
}
.feature {
display: flex;
align-items: center;
Image {
width: 32rpx;
height: 32rpx;
margin-right: 10rpx;
vertical-align: middle;
}
}

@ -1,11 +1,14 @@
import {FC, ReactNode, useCallback, useEffect, useState} from "react";
import {Video, View} from "@tarojs/components";
import {Image, Video, View} from "@tarojs/components";
import {brandApi, BrandRecord} from "@/api";
import Taro, {useReachBottom} from "@tarojs/taro";
import Empty from "@/components/empty/empty";
import Spinner from "@/components/spinner";
import Img from "@/components/image/image";
import {beforeTime} from "@/utils/time";
import styles from './list.module.scss'
import articleLine from "@/static/img/articleLine.png"
import Collect from "@/components/collect/collect";
const BrandItem: FC<{ data: BrandRecord; onClick: VoidFunction }> = ({data, onClick}) => {
let media: ReactNode
@ -40,22 +43,24 @@ const BrandItem: FC<{ data: BrandRecord; onClick: VoidFunction }> = ({data, onCl
/>
<View className="ml-2 flex-1">
<View className="text-row1 font-28">{data.name}</View>
<View className='font-24 mt-1 text-dark'>{beforeTime(data.created_at)}·</View>
<View className='font-24 mt-2 text-muted'>{beforeTime(data.created_at)}·</View>
</View>
</View>
<View>
<View className={styles.previewImag}>
{media}
</View>
<View className="font-24 text-muted mb-4 text-row3 mt-2" style={{lineHeight: 1.4}}>
{data.graphic_introduction}
</View>
<View className="flex gap20rpx font-24 text-muted">
<View className="flex-1"></View>
<View>{data.article_count || 0}</View>
<View>{(Math.random() * 100).toFixed(0)}</View>
<View className="flex gap20rpx font-24 text-muted justify-around">
<View className={styles.feature}>
<Image src={articleLine}/>
{data.article_count || 0}
</View>
<Collect/>
</View>
</View>
</View>
@ -78,9 +83,9 @@ const BrandList: FC = () => {
const res = await brandApi.list(page, 10)
if (page === 1) {
if (res.list.length < 10) {
setText('- 暂无更多 -')
setText('暂无更多')
} else {
setText('上拉加载更多~')
setText('上拉加载更多')
}
}
setTotal(res.total)

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Loading…
Cancel
Save