Merge pull request '添加了部分接口' (#33) from xbx into master

Reviewed-on: http://git.luyuan.tk/luyuan/beelink/pulls/33
This commit is contained in:
luyuan 2020-10-12 10:51:15 +08:00
commit ab2be88b14
6 changed files with 113 additions and 1 deletions

View File

@ -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) {

View File

@ -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);
}

View File

@ -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){

View File

@ -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
}

View File

@ -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,
};

View File

@ -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
}