|
@@ -1,10 +1,15 @@
|
|
|
import { defineComponent } from 'vue'
|
|
|
import iconTeacher from '@/common/images/icon_teacher.png'
|
|
|
-import { ElTag } from 'element-plus'
|
|
|
+import { ElButton, ElTag } from 'element-plus'
|
|
|
import { state } from '@/state'
|
|
|
-import { userInfo } from 'os'
|
|
|
import { getUserType } from '@/helpers/utils'
|
|
|
|
|
|
+export const getAssetsHomeFile = (fileName: string) => {
|
|
|
+ const path = `../../../user-info/images/${fileName}`
|
|
|
+ const modules = import.meta.globEager('../../../user-info/images/*')
|
|
|
+ return modules[path].default
|
|
|
+}
|
|
|
+
|
|
|
export default defineComponent({
|
|
|
name: 'users',
|
|
|
computed: {
|
|
@@ -14,37 +19,51 @@ export default defineComponent({
|
|
|
},
|
|
|
render() {
|
|
|
return (
|
|
|
- <div class="bg-white rounded-[6px] text-center pt-[30px] pb-8 flex items-center flex-col">
|
|
|
- <img src={iconTeacher} class="w-[68px] h-[68px] rounded-full" />
|
|
|
+ <div class=" text-center pb-8 relative overflow-hidden">
|
|
|
+ <div class="bg-[#FFE7CF] absolute left-6 top-0 text-[#AB5400] text-xs py-0.5 px-2 rounded-[10px]">
|
|
|
+ 学生
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <img
|
|
|
+ src={this.userInfo.heardUrl || iconTeacher}
|
|
|
+ class="w-[68px] h-[68px] rounded-full border-2 border-[#2DC7AA] border-solid mt-6 mx-auto"
|
|
|
+ />
|
|
|
|
|
|
- <p class="text-[#1A1A1A] text-lg pt-4">{this.userInfo.username}</p>
|
|
|
+ <p class="text-[#333] text-lg font-medium pt-4 flex items-center justify-center">
|
|
|
+ {this.userInfo.username}
|
|
|
+
|
|
|
+ <img
|
|
|
+ src={
|
|
|
+ this.userInfo.isVip
|
|
|
+ ? getAssetsHomeFile('icon_vip.png')
|
|
|
+ : getAssetsHomeFile('icon_vip_default.png')
|
|
|
+ }
|
|
|
+ class="h-[26px]"
|
|
|
+ />
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <div class={this.userInfo.isVip !== 1 ? 'mb-9 mt-5' : ''}>
|
|
|
+ {this.userInfo.isVip !== 1 && (
|
|
|
+ <ElButton round type="primary" size="large" class="!px-4">
|
|
|
+ 开通会员
|
|
|
+ </ElButton>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="text-[14px] text-[#666] flex items-center justify-center">
|
|
|
+ <div class="text-base text-[#999] mx-[25px] flex items-center justify-center pt-10 border-t border-solid border-[#E7E6E6]">
|
|
|
<span
|
|
|
- class={[
|
|
|
- 'flex items-center justify-center leading-6',
|
|
|
- getUserType() === 'STUDENT' && 'cursor-pointer'
|
|
|
- ]}
|
|
|
+ class="flex items-center justify-center flex-col leading-6 cursor-pointer flex-1"
|
|
|
onClick={() => {
|
|
|
if (getUserType() === 'STUDENT') {
|
|
|
this.$router.push('/studentInfo/myFollow')
|
|
|
}
|
|
|
}}
|
|
|
>
|
|
|
+ <b class="text-[#333333] text-[28px] pl-1 pb-1">
|
|
|
+ {this.userInfo.starTeacherNum || 0}
|
|
|
+ </b>
|
|
|
关注
|
|
|
- {getUserType() === 'TEACHER' ? (
|
|
|
- <b class="text-black text-xl pl-1 pb-[2px]">
|
|
|
- {this.userInfo.fansNum || 0}
|
|
|
- </b>
|
|
|
- ) : (
|
|
|
- <b class="text-black text-xl pl-1 pb-[2px]">
|
|
|
- {this.userInfo.starTeacherNum || 0}
|
|
|
- </b>
|
|
|
- )}
|
|
|
</span>
|
|
|
- {/* <span class="pl-3 flex items-center justify-center leading-6">
|
|
|
- 帖子<b class="text-black text-xl pl-1 pb-[2px]">124</b>
|
|
|
- </span> */}
|
|
|
</div>
|
|
|
</div>
|
|
|
)
|