收藏样式 我的权限页面

v2
king 1 year ago
parent c37e360cb6
commit e97f59d7f8
  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. 7
      src/pages/manage/courseAdmin/courseAdmin.tsx
  7. 20
      src/pages/manage/depAdmin/depAdmin.tsx
  8. 53
      src/pages/my/my.tsx
  9. 6
      src/pages/preview/brand/info/info.tsx
  10. 34
      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 { export interface Course {
audit_mode: boolean
/** 完成 */ /** 完成 */
finished_count: number; 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; align-items: flex-end;
justify-content: left; justify-content: left;
flex-wrap: nowrap; flex-wrap: nowrap;
height: 380px; height: 400px;
position: relative; position: relative;
} }

@ -58,7 +58,7 @@ const AuditMode: FC = () => {
{ {
articles.map((d, i) => <View className='p-3 relative'> articles.map((d, i) => <View className='p-3 relative'>
{i > 0 && <View className='absolute top left right divided ml-3 mr-3'/>} {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'> {(d.intro || '').length > 40 && (<View className='flex mt-1'>
<View className="flex-1 font-24 lh1_5">{d.intro}</View> <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"/>} {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 {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 {Search} from "./components/search";
import {CourseAllParam, courseApi, ManageApi} from "@/api"; import {CourseAllParam, courseApi, ManageApi} from "@/api";
import styles from './courseAdmin.module.scss' import styles from './courseAdmin.module.scss'
@ -7,6 +7,7 @@ import Taro, {useReachBottom} from "@tarojs/taro";
import MyButton from "@/components/button/MyButton"; import MyButton from "@/components/button/MyButton";
import storageDep from "@/hooks/storageDep"; import storageDep from "@/hooks/storageDep";
import Spin from "@/components/spinner"; import Spin from "@/components/spinner";
import Img from "@/components/image/image";
const CourseAdmin: FC = () => { const CourseAdmin: FC = () => {
const [total, setTotal] = useState(0) const [total, setTotal] = useState(0)
@ -125,7 +126,7 @@ const CourseAdmin: FC = () => {
Taro.useDidShow(useCallback(async () => { Taro.useDidShow(useCallback(async () => {
const dep_id = storageDep.get() const dep_id = storageDep.get()
if (!dep_id.length || !curs.length) return; if (!dep_id.length || !curs.length) return;
try { try {
@ -162,7 +163,7 @@ const CourseAdmin: FC = () => {
checked={curs.includes(d.id)} checked={curs.includes(d.id)}
style={{marginTop: '30px'}} style={{marginTop: '30px'}}
onClick={() => addCurs(d.id)}/>} onClick={() => addCurs(d.id)}/>}
<Image src={d.thumb} className={styles.curImage}/> <Img src={d.thumb} className={styles.curImage}/>
<View>{d.title}</View> <View>{d.title}</View>
</View> </View>
<View className={styles.Operation}> <View className={styles.Operation}>

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

@ -38,6 +38,7 @@ const My: FC = () => {
const [companyList, setCompanyList] = useState<Company[]>([]) const [companyList, setCompanyList] = useState<Company[]>([])
const [navbarOpacity, setNavbarOpacity] = useState('0') const [navbarOpacity, setNavbarOpacity] = useState('0')
const navbarHeight = globalData.statusBarHeight + globalData.textBarHeight; const navbarHeight = globalData.statusBarHeight + globalData.textBarHeight;
const [auditMode, setAuditMode] = useState(true)
Taro.useDidShow(() => { Taro.useDidShow(() => {
token && userApi.companyList().then(res => { token && userApi.companyList().then(res => {
@ -60,9 +61,10 @@ const My: FC = () => {
Taro.useDidShow(async () => { Taro.useDidShow(async () => {
try { try {
const res = await curriculum.course() const res = await curriculum.course()
setAuditMode(res.audit_mode)
const oldList: List[] = JSON.parse(JSON.stringify(list)) const oldList: List[] = JSON.parse(JSON.stringify(list))
oldList[1].time = res.finished_count oldList[1].time = res.finished_count || 0
oldList[2].time = res.not_finished_count oldList[2].time = res.not_finished_count || 0
setList(oldList) setList(oldList)
} catch (e) { } catch (e) {
} }
@ -91,31 +93,34 @@ const My: FC = () => {
<Header companyList={companyList} showCompany={() => companyList.length >= 2 && setCompanyShow(true)}/> <Header companyList={companyList} showCompany={() => companyList.length >= 2 && setCompanyShow(true)}/>
</View> </View>
<Time/> {
!auditMode && <>
<View className="bg-white rounded-20 mb-2 clip"> <Time/>
<View className="flex p-2"> <View className="bg-white rounded-20 mb-2 clip">
{list.map((d) => ( <View className="flex p-2">
<View className={styles.timeBox} style={{marginBottom: '0 !important'}} key={d.title} {list.map((d) => (
onClick={() => jump(token, d.type)}> <View className={styles.timeBox} style={{marginBottom: '0 !important'}} key={d.title}
<View className={styles.timeBoxFlex} onClick={() => jump(token, d.type)}>
style={{backgroundColor: 'rgba(0,0,0,0.02)', borderRadius: '16rpx'}}> <View className={styles.timeBoxFlex}
<View> style={{backgroundColor: 'rgba(0,0,0,0.02)', borderRadius: '16rpx'}}>
<View className='mb-2 font-28 font-weight'>{d.title}</View> <View>
<View className='text-muted font-26 mt-1'>{d.time}</View> <View className='mb-2 font-28 font-weight'>{d.title}</View>
<View className='text-muted font-26 mt-1'>{d.time}</View>
</View>
<Image src={d.src} mode='aspectFit' className={styles.timeImag}/>
</View>
</View> </View>
<Image src={d.src} mode='aspectFit' className={styles.timeImag}/> ))}
</View>
</View> </View>
))} {
</View> <View className="p-2">
<LearningRecord style={{paddingTop: '0 !important'}} userId={user?.id}/>
</View>
}
</View>
</>
}
{
token && (<View className="p-2">
<LearningRecord style={{paddingTop: '0 !important'}} userId={user?.id}/>
</View>)
}
</View>
<Service/> <Service/>

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

@ -1,5 +1,4 @@
.box2 { .box2 {
//display: flex;
margin-bottom: 20rpx; margin-bottom: 20rpx;
background-color: #fff; background-color: #fff;
border-radius: 16rpx; border-radius: 16rpx;
@ -14,10 +13,7 @@
.box { .box {
display: flex; display: flex;
//margin-bottom: 20rpx;
//background-color: #fff;
border-radius: 16rpx; border-radius: 16rpx;
//margin-bottom: 6rpx;
padding: 24rpx; padding: 24rpx;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
@ -30,26 +26,26 @@
display: block; display: block;
content: ""; content: "";
height: 0; height: 0;
border-bottom: 1px solid rgba(0,0,0,0.2); border-bottom: 1px solid rgba(0, 0, 0, 0.2);
transform-origin: bottom center; transform-origin: bottom center;
transform: scaleY(0.5); transform: scaleY(0.5);
} }
} }
.image{ .image {
width: 128rpx; width: 128rpx;
height:128rpx; height: 128rpx;
background-color: #ededed; background-color: #ededed;
border-radius: 8rpx; border-radius: 8rpx;
} }
.rightBox{ .rightBox {
padding-left: 24rpx; padding-left: 24rpx;
box-sizing: border-box; box-sizing: border-box;
flex: 1; flex: 1;
} }
.desc{ .desc {
font-size: 24rpx; font-size: 24rpx;
font-weight: 500; font-weight: 500;
color: #909795; color: #909795;
@ -58,7 +54,23 @@
word-break: break-all; word-break: break-all;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
-webkit-box-orient:vertical; -webkit-box-orient: vertical;
-webkit-line-clamp:2; -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 {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 {brandApi, BrandRecord} from "@/api";
import Taro, {useReachBottom} from "@tarojs/taro"; import Taro, {useReachBottom} from "@tarojs/taro";
import Empty from "@/components/empty/empty"; import Empty from "@/components/empty/empty";
import Spinner from "@/components/spinner"; import Spinner from "@/components/spinner";
import Img from "@/components/image/image"; import Img from "@/components/image/image";
import {beforeTime} from "@/utils/time"; 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}) => { const BrandItem: FC<{ data: BrandRecord; onClick: VoidFunction }> = ({data, onClick}) => {
let media: ReactNode let media: ReactNode
@ -40,22 +43,24 @@ const BrandItem: FC<{ data: BrandRecord; onClick: VoidFunction }> = ({data, onCl
/> />
<View className="ml-2 flex-1"> <View className="ml-2 flex-1">
<View className="text-row1 font-28">{data.name}</View> <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>
<View> <View className={styles.previewImag}>
{media} {media}
</View> </View>
<View className="font-24 text-muted mb-4 text-row3 mt-2" style={{lineHeight: 1.4}}> <View className="font-24 text-muted mb-4 text-row3 mt-2" style={{lineHeight: 1.4}}>
{data.graphic_introduction} {data.graphic_introduction}
</View> </View>
<View className="flex gap20rpx font-24 text-muted">
<View className="flex-1"></View> <View className="flex gap20rpx font-24 text-muted justify-around">
<View>{data.article_count || 0}</View> <View className={styles.feature}>
<View>{(Math.random() * 100).toFixed(0)}</View> <Image src={articleLine}/>
{data.article_count || 0}
</View>
<Collect/>
</View> </View>
</View> </View>
</View> </View>
@ -78,9 +83,9 @@ const BrandList: FC = () => {
const res = await brandApi.list(page, 10) const res = await brandApi.list(page, 10)
if (page === 1) { if (page === 1) {
if (res.list.length < 10) { if (res.list.length < 10) {
setText('- 暂无更多 -') setText('暂无更多')
} else { } else {
setText('上拉加载更多~') setText('上拉加载更多')
} }
} }
setTotal(res.total) 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