Merge pull request '添加了部分接口' (#33) from xbx into master
Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/33
This commit is contained in:
commit
ab2be88b14
@ -2,6 +2,7 @@ import axios from '../config/axiosConfig'
|
||||
|
||||
import { AxiosRequestConfig, CustomSuccessData } from 'axios';
|
||||
import { getValue } from '@/utils/common';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
// 泛型接口
|
||||
export interface Get {
|
||||
@ -11,7 +12,9 @@ export interface Get {
|
||||
axios.interceptors.response.use((response)=>{
|
||||
return response;
|
||||
},(error)=>{
|
||||
return error;
|
||||
|
||||
message.error(error.response.data.message)
|
||||
return Promise.reject(error)
|
||||
})
|
||||
|
||||
const get: Get = async function (url: string,data?: object) {
|
||||
|
101
src/api/index.ts
101
src/api/index.ts
@ -61,3 +61,104 @@ export async function userinfo(){
|
||||
money: user.data?.money
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户绑定银行卡列表
|
||||
*/
|
||||
interface Wallect {
|
||||
wallectid: number;
|
||||
memberid: number;
|
||||
type: number;
|
||||
account: string;
|
||||
mname: string;
|
||||
bankcode: string;
|
||||
bankname: string;
|
||||
deleted_at: null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
typeName: string;
|
||||
}
|
||||
|
||||
export async function getwallect(){
|
||||
const res = await get<Array<Wallect>>('wallect')
|
||||
console.log(res)
|
||||
}
|
||||
|
||||
/**
|
||||
* 订阅者列表
|
||||
*/
|
||||
interface Teacherliked {
|
||||
memberid: number;
|
||||
name: string;
|
||||
img: string;
|
||||
live: string;
|
||||
birthday: string;
|
||||
mtongue: string;
|
||||
interest: string;
|
||||
|
||||
}
|
||||
export async function getteacherliked(){
|
||||
const res = await get<Array<Teacherliked>>('teacherliked');
|
||||
console.log(res)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 视频列表
|
||||
*/
|
||||
|
||||
interface VideoList{
|
||||
videoid: number;
|
||||
memberid: number;
|
||||
title: string;
|
||||
img: string;
|
||||
fileid: string;
|
||||
fileurl: string;
|
||||
fileduration: string;
|
||||
status: number;
|
||||
desc: string;
|
||||
deleted_at: null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
statusname: string;
|
||||
}
|
||||
|
||||
export async function getvideolist() {
|
||||
const res = await get<Array<VideoList>>('video')
|
||||
console.log(res)
|
||||
}
|
||||
|
||||
/**
|
||||
* 直播列表
|
||||
*/
|
||||
|
||||
interface LiveList {
|
||||
liveid: number;
|
||||
memberid: number;
|
||||
title: string;
|
||||
img: string;
|
||||
fileid: string;
|
||||
fileurl: string;
|
||||
fileduration: string;
|
||||
vodurl: string;
|
||||
vodid: string;
|
||||
vodduration: string;
|
||||
dateline: string;
|
||||
livetime: number;
|
||||
livenumber: number;
|
||||
status: number;
|
||||
livestatus: number;
|
||||
students: string;
|
||||
desc: string;
|
||||
deleted_at: null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
statusname: string;
|
||||
starttime: string;
|
||||
begin: number;
|
||||
}
|
||||
|
||||
export async function getlivelist() {
|
||||
const res = await get<Array<LiveList>>('live');
|
||||
console.log(res);
|
||||
}
|
@ -204,6 +204,7 @@
|
||||
import { defineComponent } from "vue";
|
||||
import NavBottom from "@/components/NavBottom.vue";
|
||||
import router from '@/router';
|
||||
import { getwallect } from '@/api';
|
||||
export default defineComponent({
|
||||
name: "Wallet",
|
||||
components: {
|
||||
@ -212,6 +213,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
const ifchina = false;
|
||||
const ifmingxi = true;
|
||||
getwallect()
|
||||
function navto(index: number){
|
||||
let url = "";
|
||||
switch (index){
|
||||
|
@ -146,6 +146,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from "vue";
|
||||
import LiveItem from "@/components/LiveItem.vue";
|
||||
import { getlivelist } from '@/api';
|
||||
export default defineComponent({
|
||||
components: {
|
||||
LiveItem,
|
||||
@ -153,6 +154,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
const page = ref(6);
|
||||
const tabindex = ref(1);
|
||||
getlivelist()
|
||||
function tabchange(e: number): void {
|
||||
tabindex.value=e
|
||||
}
|
||||
|
@ -361,12 +361,14 @@
|
||||
}
|
||||
</style>
|
||||
<script lang="ts">
|
||||
import { getteacherliked } from '@/api';
|
||||
import { defineComponent, ref } from "vue";
|
||||
export default defineComponent({
|
||||
name: "Subscriber",
|
||||
components: {},
|
||||
setup() {
|
||||
const page = ref(6);
|
||||
getteacherliked()
|
||||
return {
|
||||
page,
|
||||
};
|
||||
|
@ -156,6 +156,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from "vue";
|
||||
import VideoItem from "@/components/VideoItem.vue";
|
||||
import { getvideolist } from '@/api';
|
||||
export default defineComponent({
|
||||
components: {
|
||||
VideoItem,
|
||||
@ -163,6 +164,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
const page = ref(6);
|
||||
const tabindex = ref(1);
|
||||
getvideolist()
|
||||
function tabchange(e: number): void {
|
||||
tabindex.value=e
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user