提交 0c690aa3 authored 作者: lhh's avatar lhh

update

上级 69cbbaad
...@@ -60,7 +60,7 @@ const route = useRoute() ...@@ -60,7 +60,7 @@ const route = useRoute()
<AppNav></AppNav> <AppNav></AppNav>
<div class="app-header-right" v-if="!mobile"> <div class="app-header-right" v-if="!mobile">
<div class="study" @click="handleStudy" v-if="user.isLogin && user.courses.length > 0">立即学习</div> <div class="study" @click="handleStudy" v-if="user.isLogin && user.courses.length > 0">立即学习</div>
<div class="study">学员展示</div> <router-link to="/student"><div class="study">学员展示</div></router-link>
<template v-if="user.isLogin"> <template v-if="user.isLogin">
<div @click="handleOrder" style="cursor: pointer">你好,{{ user.userName }}</div> <div @click="handleOrder" style="cursor: pointer">你好,{{ user.userName }}</div>
<div class="app-header-logout" @click="handleLogout">退出</div> <div class="app-header-logout" @click="handleLogout">退出</div>
......
...@@ -25,5 +25,5 @@ export function getAvatar() { ...@@ -25,5 +25,5 @@ export function getAvatar() {
* 上传权益人头像 * 上传权益人头像
* */ * */
export function uploadAvatar(data?: any) { export function uploadAvatar(data?: any) {
return httpRequest.post('https://project-api.ezijing.com/api/psp/v1/welfare/avatar', data) return httpRequest.post('https://project-api.ezijing.com/api/psp/v1/welfare/avatar', data, { headers: { 'Content-Type': 'multipart/form-data' } })
} }
\ No newline at end of file
...@@ -10,9 +10,9 @@ const rules = { ...@@ -10,9 +10,9 @@ const rules = {
const handleSubmit = function () { const handleSubmit = function () {
if (formData.avatar !== '') { if (formData.avatar !== '') {
uploadAvatar({ avatar: formData.avatar }).then(res => { uploadAvatar({ avatar: formData.avatar }).then((res: any) => {
if (res.status) { if (res.status) {
ElMessage.error(res.message) ElMessage.error(res?.message || '')
} else { } else {
ElMessage({ type: 'success', message: '提交成功' }) ElMessage({ type: 'success', message: '提交成功' })
} }
...@@ -23,9 +23,9 @@ const handleSubmit = function () { ...@@ -23,9 +23,9 @@ const handleSubmit = function () {
} }
const getAvatarInfo = function () { const getAvatarInfo = function () {
getAvatar().then(res => { getAvatar().then((res: any) => {
if (res.status === 400) { if (res.status === 400) {
ElMessage.error(res.message) ElMessage.error(res?.message || '')
} else { } else {
formData = res.data.info formData = res.data.info
} }
......
...@@ -8,7 +8,7 @@ let page = $ref(1) ...@@ -8,7 +8,7 @@ let page = $ref(1)
let total = $ref(0) let total = $ref(0)
const showIndex = $ref(1) const showIndex = $ref(1)
function infiniteHandler() { function infiniteHandler() {
getAvatarList({ page: page, page_size: 9 }).then(response => { getAvatarList({ page: page, page_size: 9, type: 'paa' }).then(response => {
if (response.data.list) { if (response.data.list) {
total = response.data.total total = response.data.total
list = response.data.list list = response.data.list
...@@ -19,7 +19,7 @@ function infiniteHandler() { ...@@ -19,7 +19,7 @@ function infiniteHandler() {
}) })
} }
const sizeChange = function (n) { const sizeChange = function (n: any) {
page = n page = n
infiniteHandler() infiniteHandler()
} }
...@@ -51,8 +51,11 @@ onMounted(() => { ...@@ -51,8 +51,11 @@ onMounted(() => {
<img :src="item.avatar + '?x-oss-process=image/resize,m_fill,h_360,w_300'" class="pic" /> <img :src="item.avatar + '?x-oss-process=image/resize,m_fill,h_360,w_300'" class="pic" />
</div> </div>
</template> </template>
<div v-else style="width: 100%; display: flex; justify-content: center">
<el-empty description="暂无数据" />
</div>
</div> </div>
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center" v-if="list.length">
<el-pagination class="page" @current-change="sizeChange" layout="prev, pager, next" :total="total" /> <el-pagination class="page" @current-change="sizeChange" layout="prev, pager, next" :total="total" />
</div> </div>
</div> </div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论