zhengyiming
91 分钟以前 fd06689a59dcdaf03d8f98d9531ad6f2c2b258c3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!--
 * @Author: 秦少卫
 * @Date: 2024-04-25 15:30:54
 * @LastEditors: 秦少卫
 * @LastEditTime: 2024-05-30 11:53:28
 * @Description: 我的素材
-->
 
<template>
  <div class="my-material" v-if="isLogin">
    <Tabs v-model="type">
      <TabPane label="模板" name="templ">
        <myTempl v-if="type === 'templ'"></myTempl>
      </TabPane>
      <TabPane label="图片" name="img">
        <uploadMaterial v-if="type === 'img'"></uploadMaterial>
      </TabPane>
    </Tabs>
  </div>
  <div class="tip" v-else>请先登录</div>
</template>
 
<script setup name="ImportTmpl">
import { getFileList } from '@/api/user';
import uploadMaterial from './uploadMaterial';
import myTempl from './myTempl';
 
const type = ref('templ');
const isLogin = ref(false);
const getFileListHandle = () => {
  // 获取素材列表
  getFileList()
    .then(() => {
      isLogin.value = true;
    })
    .catch(() => {
      isLogin.value = false;
    });
};
 
getFileListHandle();
</script>
 
<style scoped lang="less">
.tip {
  padding: 20px;
  text-align: center;
}
</style>