xbx #66

Merged
asd merged 2 commits from xbx into master 2020-10-22 03:13:09 +00:00
24 changed files with 755 additions and 928 deletions

View File

@ -22,8 +22,8 @@
"vuex": "^4.0.0-0" "vuex": "^4.0.0-0"
}, },
"devDependencies": { "devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.4.1", "@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^4.4.1", "@typescript-eslint/parser": "^2.33.0",
"@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0", "@vue/cli-plugin-router": "~4.5.0",
@ -31,12 +31,12 @@
"@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0", "@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0-0", "@vue/compiler-sfc": "^3.0.0-0",
"@vue/eslint-config-typescript": "^7.0.0", "@vue/eslint-config-typescript": "^5.0.2",
"eslint": "^7.11.0", "eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0-0", "eslint-plugin-vue": "^7.0.0-0",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
"sass-loader": "^10.0.2", "sass-loader": "^10.0.2",
"typescript": "~4.0.3" "typescript": "~3.9.3"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,

View File

@ -10,7 +10,7 @@ import { MessageType } from 'ant-design-vue/types/message';
export interface Get { export interface Get {
<T>(url: string, params?: unknown, config?: AxiosRequestConfig): Promise<CustomSuccessData<T>>; <T>(url: string, params?: unknown, config?: AxiosRequestConfig): Promise<CustomSuccessData<T>>;
} }
const login:MessageType[] = [] const login: MessageType[] = []
axios.interceptors.request.use((config)=>{ axios.interceptors.request.use((config)=>{
login.push(message.loading('加载中..', 0)) login.push(message.loading('加载中..', 0))
return config; return config;

View File

@ -79,7 +79,7 @@ interface Teacherliked {
interest: string; interest: string;
} }
export async function getteacherliked(data?:any){ export async function getteacherliked(data?: any){
const res = await get<Array<Teacherliked>>('teacherliked',data); const res = await get<Array<Teacherliked>>('teacherliked',data);
// console.log(res) // console.log(res)
return res; return res;
@ -111,7 +111,7 @@ interface VideoListInfo {
msg: string; msg: string;
total: number; total: number;
} }
export async function getvideolist(data?:any): Promise<VideoListInfo>{ export async function getvideolist(data?: any): Promise<VideoListInfo>{
const res = await get<Array<VideoList>>('video',data) const res = await get<Array<VideoList>>('video',data)
console.log(res) console.log(res)
return res return res
@ -123,7 +123,7 @@ export async function getvideolist(data?:any): Promise<VideoListInfo>{
export async function getlivelist(data?:any):Promise<LivelistInfo> { export async function getlivelist(data?: any): Promise<LivelistInfo> {
const res = await get<Array<LiveList>>('live',data); const res = await get<Array<LiveList>>('live',data);
console.log(res); console.log(res);
return res; return res;
@ -144,8 +144,8 @@ export async function getstatisticlist() {
// console.log(res) // console.log(res)
return { return {
liveInfo: res.data.liveInfo, liveInfo: res.data.liveInfo,
videoInfo:res.data.videoInfo, videoInfo: res.data.videoInfo,
studentInfo:res.data.studentInfo studentInfo: res.data.studentInfo
} }
} }
@ -153,10 +153,10 @@ export async function getstatisticlist() {
* *
*/ */
interface Liveaddrule{ interface Liveaddrule{
code: number, code: number;
msg: string msg: string;
} }
export async function liveadd(data:any) { export async function liveadd(data: any) {
const res = await post<Liveaddrule>('live',data); const res = await post<Liveaddrule>('live',data);
console.log(res) console.log(res)
} }
@ -175,7 +175,7 @@ export async function videoadd( form: any,data: any) {
fileurl: "", fileurl: "",
fileduration: "", fileduration: "",
desc: "", desc: "",
video:[""], video: [""],
} }
} }
} }
@ -194,14 +194,14 @@ interface VideoDetail{
fileduration: string; fileduration: string;
status: number; status: number;
desc: string; desc: string;
deleted_at: null; deleted_at: string;
created_at: string; created_at: string;
updated_at: string; updated_at: string;
share:number, share: number;
watch:number watch: number;
} }
export async function videodetail(data?:any,ifupdate?:number) { export async function videodetail(data?: any,ifupdate?: number) {
const res=await get<VideoDetail>('video/'+data) const res=await get<VideoDetail>('video/'+data)
if(ifupdate){ if(ifupdate){
console.log(111) console.log(111)
@ -211,8 +211,8 @@ export async function videodetail(data?:any,ifupdate?:number) {
fileid: res.data.fileid, fileid: res.data.fileid,
fileurl: res.data.fileurl, fileurl: res.data.fileurl,
fileduration: res.data.fileduration, fileduration: res.data.fileduration,
desc:res.data.desc, desc: res.data.desc,
video:[res.data.fileurl], video: [res.data.fileurl],
} }
}else{ }else{
return { return {
@ -225,11 +225,11 @@ export async function videodetail(data?:any,ifupdate?:number) {
fileduration: res.data.fileduration, fileduration: res.data.fileduration,
status: res.data.status, status: res.data.status,
desc: res.data.desc, desc: res.data.desc,
deleted_at: res.data.deleted_at, deletedAt: res.data.deleted_at,
created_at: res.data.created_at, createdAt: res.data.created_at,
updated_at: res.data.updated_at, updatedAt: res.data.updated_at,
watch:res.data.watch, watch: res.data.watch,
share:res.data.share share: res.data.share
} }
} }
@ -241,7 +241,7 @@ export async function videodetail(data?:any,ifupdate?:number) {
/** /**
* *
*/ */
export async function videodel(data:any) { export async function videodel(data: any) {
const res = await del<Liveaddrule>('video/'+data); const res = await del<Liveaddrule>('video/'+data);
if(res.code==0){ if(res.code==0){
message.success("删除成功") message.success("删除成功")
@ -253,7 +253,7 @@ export async function videodel(data:any) {
/** /**
* *
*/ */
export async function accountadd(data?:any) { export async function accountadd(data?: any) {
const res = await post<Liveaddrule>('wallect',data); const res = await post<Liveaddrule>('wallect',data);
if(res.code==0){ if(res.code==0){
message.success("新增成功") message.success("新增成功")
@ -263,19 +263,19 @@ export async function accountadd(data?:any) {
} }
interface SaleInfo{ interface SaleInfo{
total:number, total: number;
accountid:number, accountid: number;
memberid:number, memberid: number;
sn:string, sn: string;
type:number, type: number;
typename:string, typename: string;
money:string, money: string;
source:number, source: number;
remark:string, remark: string;
deleted_at:string, deleted_at: string;
created_at:string, created_at: string;
updated_at:string, updated_at: string;
basemoney:string basemoney: string;
} }
interface SaleInfolData{ interface SaleInfolData{
data: SaleInfo[]; data: SaleInfo[];
@ -288,7 +288,7 @@ interface SaleInfolData{
* @param data * @param data
*/ */
export async function saleinfo(data?:any){ export async function saleinfo(data?: any){
const res=await get<SaleInfolData>('account',data) const res=await get<SaleInfolData>('account',data)
console.log(res) console.log(res)
return res return res
@ -297,7 +297,7 @@ export async function saleinfo(data?:any){
/** /**
* *
*/ */
export async function cashout(data?:any,accountinfo?:any){ export async function cashout(data?: any,accountinfo?: any){
// data.type=data.typeid?data.typeid:0 // data.type=data.typeid?data.typeid:0
// if(data.type!=0){ // if(data.type!=0){
@ -326,31 +326,31 @@ export async function cashout(data?:any,accountinfo?:any){
* *
*/ */
interface AccountInfo{ interface AccountInfo{
wallectid:number, wallectid: number;
typeid:number, typeid: number;
type:number, type: number;
account:number, account: number;
mname:string, mname: string;
bankcode:string, bankcode: string;
bankname:string bankname: string;
} }
export async function getaccountinfo(data?: any){ export async function getaccountinfo(data?: any){
const res=await get<AccountInfo>('wallect/'+data) const res=await get<AccountInfo>('wallect/'+data)
console.log(res,2333) console.log(res,2333)
return { return {
accountid:res.data.wallectid, accountid: res.data.wallectid,
type:res.data.type, type: res.data.type,
account:res.data.account, account: res.data.account,
mname:res.data.mname, mname: res.data.mname,
bankcode:res.data.bankcode, bankcode: res.data.bankcode,
bankname:res.data.bankname bankname: res.data.bankname
} }
} }
/** /**
* *
*/ */
export async function editaccount(data?:any){ export async function editaccount(data?: any){
const res=await put<Liveaddrule>('wallect/'+data); const res=await put<Liveaddrule>('wallect/'+data);
if(res.code==0){ if(res.code==0){
message.success("修改成功") message.success("修改成功")
@ -359,9 +359,9 @@ export async function editaccount(data?:any){
/** /**
* *
*/ */
export async function deleteaccount(data:any) { export async function deleteaccount(data: any) {
const res = await del<Liveaddrule>('wallect/'+data); const res = await del<Liveaddrule>('wallect/' + data);
if(res.code==0){ if(res.code==0){
message.success("删除成功") message.success("删除成功")
} }
@ -374,17 +374,17 @@ export async function deleteaccount(data:any) {
* *
*/ */
interface TransactionInfo{ interface TransactionInfo{
accountid:number, accountid: number;
memberid:number, memberid: number;
sn:string, sn: string;
type:number, type: number;
typename:string, typename: string;
money:number, money: number;
source:number, source: number;
remark:string, remark: string;
deleted_at:any, deleted_at: any;
created_at:string, created_at: string;
updated_at:string updated_at: string;
} }
export async function transactioninfo(data?: any){ export async function transactioninfo(data?: any){
const res = await get<TransactionInfo>('account/'+data) const res = await get<TransactionInfo>('account/'+data)
@ -395,12 +395,12 @@ export async function transactioninfo(data?: any){
/** /**
* *
*/ */
export async function editpassword(data?:any) :Promise<any> { export async function editpassword(data?: any): Promise<any> {
console.log(data,111) console.log(data,111)
const newdata={ const newdata={
memberid:0, memberid:0,
password:"", password: "",
topassword:"" topassword: ""
} }
newdata.memberid=data.memberid newdata.memberid=data.memberid
newdata.password=data.password newdata.password=data.password
@ -418,24 +418,24 @@ export async function editpassword(data?:any) :Promise<any> {
* *
*/ */
interface WithDrawal{ interface WithDrawal{
withdrawalid:number, withdrawalid: number;
memberid:number, memberid: number;
sn:string, sn: string;
status:number, status: number;
statusname:string, statusname: string;
type:number, type: number;
typename:string, typename: string;
money:number money: number;
sxf:number, sxf: number;
international:number, international: number;
account:string, account: string;
mname:string, mname: string;
bankcode:string, bankcode: string;
bankname:string, bankname: string;
remark:string, remark: string;
deleted_at:string, deleted_at: string;
created_at:string, created_at: string;
updated_at:string updated_at: string;
} }
interface WithdrawlData{ interface WithdrawlData{
data: WithDrawal[]; data: WithDrawal[];
@ -443,7 +443,7 @@ interface WithdrawlData{
msg: string; msg: string;
total: number; total: number;
} }
export async function withdrawal(data?:any) { export async function withdrawal(data?: any) {
console.log(data) console.log(data)
const res=await get<WithdrawlData>('withdrawal',data) const res=await get<WithdrawlData>('withdrawal',data)
// console.log(res) // console.log(res)
@ -453,7 +453,7 @@ export async function withdrawal(data?:any) {
/** /**
* *
*/ */
export async function withdrawlxq(data?:any){ export async function withdrawlxq(data?: any){
const res=await get<WithDrawal>('withdrawal/'+data) const res=await get<WithDrawal>('withdrawal/'+data)
return res.data return res.data
} }
@ -462,17 +462,17 @@ export async function withdrawlxq(data?:any){
* *
*/ */
interface CommentList{ interface CommentList{
commentid:number, commentid: number;
memberid:number, memberid: number;
cid:number, cid: number;
type:number, type: number;
score:number, score: number;
content:string, content: string;
deleted_at:null, deleted_at: null;
created_at:string, created_at: string;
updated_at:string, updated_at: string;
name:string, name: string;
img:string img: string;
} }
interface CommentlData{ interface CommentlData{
data: CommentList[]; data: CommentList[];
@ -484,10 +484,10 @@ interface ReplylistData{
data: CommentList[]; data: CommentList[];
code: number; code: number;
msg: string; msg: string;
score?:string, score?: string;
total: number; total: number;
} }
export async function getcommentlist(data?:any) { export async function getcommentlist(data?: any) {
console.log(data.type==2) console.log(data.type==2)
if(data.type==2){ if(data.type==2){
@ -511,13 +511,13 @@ export async function getcommentlist(data?:any) {
* *
*/ */
interface SendData{ interface SendData{
type?:number, type?: number;
cid?:number, cid?: number;
teacherid?:number, teacherid?: number;
score?:number, score?: number;
content?:string content?: string;
} }
export async function addcomment(data?:any):Promise<void> { export async function addcomment(data?: any): Promise<void> {
const res=await post<SendData>('comments',data) const res=await post<SendData>('comments',data)
if(res.code==0){ if(res.code==0){
message.success("发布成功") message.success("发布成功")
@ -528,7 +528,7 @@ export async function addcomment(data?:any):Promise<void> {
* *
*/ */
export async function delreply(data?:any) { export async function delreply(data?: any) {
const res = await del<Liveaddrule>('comments/'+data); const res = await del<Liveaddrule>('comments/'+data);
if(res.code==0){ if(res.code==0){
message.success("删除成功") message.success("删除成功")
@ -541,37 +541,37 @@ export async function addcomment(data?:any):Promise<void> {
* *
*/ */
interface CheckuserRule{ interface CheckuserRule{
memberid: number, memberid: number;
name: string, name: string;
mobile: string, mobile: string;
email: string, email: string;
code:string code: string;
} }
interface CheckData{ interface CheckData{
data: { data: {
memberid: any, memberid: any;
name: string, name: string;
mobile: string, mobile: string;
email: string, email: string;
code:string code: string;
}, };
code: number; code: number;
msg: string; msg: string;
} }
export async function checkuser(data?:any){ export async function checkuser(data?: any){
const newdata={number:""} const newdata={number: ""}
newdata.number=data.phone newdata.number=data.phone
const res = await get<CheckuserRule>('checkUser',newdata); const res = await get<CheckuserRule>('checkUser',newdata);
// console.log(res) // console.log(res)
return { return {
code :res.code, code: res.code,
msg:res.msg, msg: res.msg,
data:{ data: {
memberid:res.data.memberid, memberid: res.data.memberid,
name: res.data.name, name: res.data.name,
mobile: res.data.mobile, mobile: res.data.mobile,
email: res.data.email, email: res.data.email,
code:res.data.code code: res.data.code
} }
} }
} }
@ -610,7 +610,7 @@ interface Countries{
interface Willsay{ interface Willsay{
languageid: number; languageid: number;
name: string name: string;
} }
export async function getarchives(): Promise<[Countries[],Willsay[]]>{ export async function getarchives(): Promise<[Countries[],Willsay[]]>{
@ -629,7 +629,7 @@ interface Language {
dictionaryid: number; dictionaryid: number;
name: string; name: string;
alias: string; alias: string;
code :string; code: string;
position: number; position: number;
publish: number; publish: number;
value: string; value: string;
@ -657,22 +657,22 @@ export async function putmember(data: any): Promise<any>{
data.willsayValue[i].level=data.willsayValue[i].level+'' data.willsayValue[i].level=data.willsayValue[i].level+''
} }
const newdata={ const newdata={
name:data.name, name: data.name,
mobile:data.mobile, mobile: data.mobile,
img:data.img, img: data.img,
country:data.countryValue, country: data.countryValue,
live:data.live, live: data.live,
mtongue:data.mtongue, mtongue: data.mtongue,
email:data.email, email: data.email,
interest:JSON.stringify(data.interest), interest: JSON.stringify(data.interest),
willsay:JSON.stringify(data.willsayValue), willsay: JSON.stringify(data.willsayValue),
birthday:data.birthday, birthday: data.birthday,
zoneid:data.zoneid, zoneid: data.zoneid,
currency:data.currencyValue, currency: data.currencyValue,
language:data.languageValue, language: data.languageValue,
tlanguage:data.tlanguageValue, tlanguage: data.tlanguageValue,
video:data.video, video: data.video,
desc:data.desc desc: data.desc
} }
console.log(newdata) console.log(newdata)
const res = await put<Liveaddrule>(`member/${store.state.userinfo.memberid}`, newdata) const res = await put<Liveaddrule>(`member/${store.state.userinfo.memberid}`, newdata)
@ -809,3 +809,16 @@ export async function refusedtolive(signupid: number, msg: string){
return false; return false;
} }
} }
/**
*
*/
export async function usersig(userid: number) {
const res = await get<string>("userSig",{userid});
if(res.code != 0){
message.error(res.msg)
return '';
}
return res.data;
}

View File

@ -159,17 +159,17 @@ export default defineComponent({
const videoid=ref(useRoute().query.id) const videoid=ref(useRoute().query.id)
const ifshow=ref(false) const ifshow=ref(false)
onMounted(async () => { onMounted(async () => {
reviewlist.value=await getcommentlist({type:2,id:videoid.value}) reviewlist.value=await getcommentlist({type: 2,id: videoid.value})
}) })
async function refresh(e?:any){ async function refresh(e?: any){
console.log("rekload") console.log("rekload")
reviewlist.value=await getcommentlist({type:2,id:videoid.value}) reviewlist.value=await getcommentlist({type: 2,id: videoid.value})
replylist.value=await getcommentlist({type:3,id:e}) replylist.value=await getcommentlist({type: 3,id: e})
} }
const stars=ref<Array<number>>([]) const stars=ref<Array<number>>([])
console.log(prop.score) console.log(prop.score)
let score1=ref<any>(prop.score) const score1=ref<any>(prop.score)
// console.log(score1) // console.log(score1)
if(score1.value==5){ if(score1.value==5){
for(let i=0;i < score1.value ; i++){ for(let i=0;i < score1.value ; i++){
@ -187,13 +187,13 @@ export default defineComponent({
} }
} }
function reply(e?:string){ function reply(e?: string){
console.log(155) console.log(155)
context.emit("replying",{name:e,replyid:prop.replyid,score:prop.score}) context.emit("replying",{name: e,replyid: prop.replyid,score: prop.score})
} }
async function findall(e :number){ async function findall(e: number){
console.log("all") console.log("all")
replylist.value =await getcommentlist({type:3,id:e}) replylist.value =await getcommentlist({type: 3,id: e})
ifshow.value=ifshow.value==false?true:false ifshow.value=ifshow.value==false?true:false
} }
return { return {

View File

@ -102,39 +102,39 @@ import store from '@/store';
import { defineComponent, ref } from 'vue'; import { defineComponent, ref } from 'vue';
export default defineComponent({ export default defineComponent({
props:{ props: {
photo:{ photo: {
type:String type: String
}, },
username:{ username: {
type:String type: String
}, },
score:{ score: {
type:Number, type: Number,
}, },
content:{ content: {
type:String type: String
}, },
date:{ date: {
type:String type: String
}, },
memberid:{ memberid: {
type:Number type: Number
}, },
replyid:{ replyid: {
type:Number type: Number
} }
}, },
setup(prop,context){ setup(prop,context){
const myid=ref<number>(store.state.userinfo.memberid) const myid=ref<number>(store.state.userinfo.memberid)
function reply(e?:string){ function reply(e?: string){
console.log(155) console.log(155)
context.emit("replying",{name:e,replyid:prop.replyid,score:prop.score}) context.emit("replying",{name: e,replyid: prop.replyid,score: prop.score})
} }
console.log(1) console.log(1)
async function del(e?: number){ async function del(e?: number){
console.log(e) console.log(e)
let res=await delreply(e) const res=await delreply(e)
if(res.code==0){ if(res.code==0){
context.emit("reload",prop.replyid) context.emit("reload",prop.replyid)
} }

View File

@ -98,13 +98,13 @@ import { useRoute } from 'vue-router';
import ReviewItem from "./ReviewItem.vue" import ReviewItem from "./ReviewItem.vue"
export default defineComponent({ export default defineComponent({
components:{ components: {
ReviewItem ReviewItem
}, },
props:{ props: {
videoid:{ videoid: {
type:Number type: Number
} }
}, },
setup(prop,context){ setup(prop,context){
@ -114,16 +114,16 @@ export default defineComponent({
const replylist =ref({}) const replylist =ref({})
const videoid=ref(useRoute().query.id) const videoid=ref(useRoute().query.id)
onMounted(async () => { onMounted(async () => {
reviewlist.value=await getcommentlist({type:2,id:videoid.value}) reviewlist.value=await getcommentlist({type: 2,id: videoid.value})
}) })
console.log(useRoute().query) console.log(useRoute().query)
console.log(store.state.userinfo.memberid,"userifno") console.log(store.state.userinfo.memberid,"userifno")
interface SendData{ interface SendData{
type?:number, type?: number;
cid?:number, cid?: number;
teacherid?:number, teacherid?: number;
score?:number, score?: number;
content?:string content?: string;
} }
function send(){ function send(){
const data = ref<SendData>({}) const data = ref<SendData>({})
@ -136,10 +136,10 @@ export default defineComponent({
addcomment(toRaw(data.value)) addcomment(toRaw(data.value))
} }
async function refresh(e?:any){ async function refresh(e?: any){
console.log("rekload") console.log("rekload")
reviewlist.value=await getcommentlist({type:2,id:videoid.value}) reviewlist.value=await getcommentlist({type: 2,id: videoid.value})
replylist.value=await getcommentlist({type:3,id:e}) replylist.value=await getcommentlist({type: 3,id: e})
} }
const reply: (val: number) => void = (val: number) => { const reply: (val: number) => void = (val: number) => {
console.log("收到子组件事件", val) console.log("收到子组件事件", val)
@ -148,7 +148,7 @@ export default defineComponent({
const haslist=ref([]) const haslist=ref([])
const findreply: (e: any) => void = async (e: any) => { const findreply: (e: any) => void = async (e: any) => {
console.log("收到子组件事件", e) console.log("收到子组件事件", e)
replylist.value=await getcommentlist({type:3,id:e}) replylist.value=await getcommentlist({type: 3,id: e})
} }
console.log(1) console.log(1)
return { return {

View File

@ -3,7 +3,7 @@ import zh from "./zh"
export default { export default {
locale: "zh", //默认语言 locale: "zh", //默认语言
messages:{ messages: {
zh zh
} }
} }

View File

@ -5,15 +5,15 @@ export default createStore({
state: { state: {
userinfo:{ userinfo:{
accesstoken: "", accesstoken: "",
api_token: "", apiToken: "",
birthday: "", birthday: "",
country: "", country: "",
countryValue: "", countryValue: "",
cover: "", cover: "",
created_at: "", createdAt: "",
currency: "", currency: "",
currencyValue: "", currencyValue: "",
deleted_at: null, deletedAt: null,
desc: "", desc: "",
email: "", email: "",
img: "", img: "",
@ -22,7 +22,7 @@ export default createStore({
languageValue: "zh", languageValue: "zh",
live: "", live: "",
livetime: "", livetime: "",
login_type: 0, loginType: 0,
memberid: 0, memberid: 0,
mobile: "", mobile: "",
money: "", money: "",
@ -39,7 +39,7 @@ export default createStore({
tlanguageValue: 1, tlanguageValue: 1,
type: 1, type: 1,
uid: "", uid: "",
updated_at: "", updatedAt: "",
video: "", video: "",
willsay: [{name: "请选择", level: 0}], willsay: [{name: "请选择", level: 0}],
willsayValue: [{name: "0", level: 0}], willsayValue: [{name: "0", level: 0}],

View File

@ -1,12 +1,12 @@
import { inject, provide, ref } from 'vue'; import { inject, provide, ref } from 'vue';
interface Language { interface Language {
[key :string]: string [key: string]: string;
} }
interface Config { interface Config {
locale: string; locale: string;
messages: {[key: string]: Language} messages: {[key: string]: Language};
} }
const createI18n = (config: Config) => ({ const createI18n = (config: Config) => ({

View File

@ -10,7 +10,7 @@ interface UploaderDone {
video: { video: {
url: string; url: string;
verify_content: string; verify_content: string;
} };
} }
export async function uploadflie(file: File,on?: OnFunctio): Promise<UploaderDone> { export async function uploadflie(file: File,on?: OnFunctio): Promise<UploaderDone> {

View File

@ -114,9 +114,10 @@ export default defineComponent({
const uinfo=ref({ const uinfo=ref({
phone:"", phone:"",
code:"", code:"",
quhao:"",
password:"", password:"",
repassword:"", repassword:"",
quhao:"", checkcodequhao:"",
memberid:0 memberid:0
}) })
const time = ref(60); // const time = ref(60); //
@ -187,11 +188,11 @@ export default defineComponent({
return return
} }
let checkcode=await checksmscode(uinfo.value.quhao+uinfo.value.phone,uinfo.value.code) const checkcode=await checksmscode(uinfo.value.quhao+uinfo.value.phone,uinfo.value.code)
console.log(checkcode,"checked") console.log(checkcode,"checked")
if(checkcode){ if(checkcode){
console.log(uinfo.value) console.log(uinfo.value)
let res= await editpassword(toRaw(uinfo.value)) const res= await editpassword(toRaw(uinfo.value))
if(res.code==0){ if(res.code==0){
stepnow.value=e stepnow.value=e
} }

View File

@ -305,7 +305,8 @@ export default defineComponent({
const modalNode = () => document.getElementsByClassName('modal-container')[0] const modalNode = () => document.getElementsByClassName('modal-container')[0]
const chiveslist = ref<any>([[],[]]); const chiveslist = ref<any>([[],[]]);
const languages = ref<unknown>([]) const languages = ref<unknown>([]);
const isSecondStep: Ref<boolean> = ref(false);
onMounted(async ()=>{ onMounted(async ()=>{
chiveslist.value = await getarchives() chiveslist.value = await getarchives()
languages.value = await getlanguages() languages.value = await getlanguages()
@ -377,7 +378,6 @@ export default defineComponent({
} }
} }
// //
const isSecondStep: Ref<boolean> = ref(false);
interface BindPhoneItem{ interface BindPhoneItem{
number: string | number; number: string | number;
code: string | number; code: string | number;
@ -457,7 +457,7 @@ export default defineComponent({
// console.log(toRaw(formData.value).willsay[i]) // console.log(toRaw(formData.value).willsay[i])
// } // }
for(let m=0;m<toRaw(chiveslist.value).length;m++){ for(let m=0;m<toRaw(chiveslist.value).length;m++){
for(let i in toRaw(formData.value).willsayValue){ for(const i in toRaw(formData.value).willsayValue){
// console.log(toRaw(formData.value).willsayValue[i]) // console.log(toRaw(formData.value).willsayValue[i])
if(typeof toRaw(formData.value).willsay[i].name=='string'){ if(typeof toRaw(formData.value).willsay[i].name=='string'){
@ -504,7 +504,7 @@ export default defineComponent({
async function uploads(file: AntUpload) { async function uploads(file: AntUpload) {
uploadprogress.value=0 uploadprogress.value=0
let res = await uploadflie(file.file, (info: any) => { const res = await uploadflie(file.file, (info: any) => {
console.log(info); console.log(info);
uploadprogress.value = info.percent.toFixed(2) * 100; uploadprogress.value = info.percent.toFixed(2) * 100;
}); });

View File

@ -121,7 +121,7 @@ export default defineComponent({
}, },
setup() { setup() {
interface FileItem { interface FileItem {
video:Array<string>, video: Array<string>;
} }
const fileList: Array<FileItem> = []; const fileList: Array<FileItem> = [];
@ -195,7 +195,7 @@ export default defineComponent({
file: File; file: File;
} }
async function uploadspic(file: AntUpload) { async function uploadspic(file: AntUpload) {
let res = await uploadflie(file.file, (info: any) => { const res = await uploadflie(file.file, (info: any) => {
console.log(info); console.log(info);
uploadpicprogress.value = info.percent.toFixed(2) * 100; uploadpicprogress.value = info.percent.toFixed(2) * 100;
}); });
@ -216,7 +216,7 @@ export default defineComponent({
console.log(videos.value[0].duration); console.log(videos.value[0].duration);
form.value.fileduration = videos.value[0].duration; form.value.fileduration = videos.value[0].duration;
}); });
let res = await uploadflie(file.file, (info: any) => { const res = await uploadflie(file.file, (info: any) => {
console.log(info); console.log(info);
uploadprogress.value = info.percent.toFixed(2) * 100; uploadprogress.value = info.percent.toFixed(2) * 100;
}); });

View File

@ -272,7 +272,7 @@ export default defineComponent({
validate() validate()
.then(() => { .then(() => {
// console.log(toRaw(form),111); // console.log(toRaw(form),111);
let subdata = toRaw(form); const subdata = toRaw(form);
// subdata.fileid=picinfo. // subdata.fileid=picinfo.
console.log(subdata); console.log(subdata);
liveadd(subdata); liveadd(subdata);
@ -294,7 +294,7 @@ export default defineComponent({
*/ */
function startchange(e: string): void { function startchange(e: string): void {
let month=new Date(e).getMonth()+1 const month = new Date(e).getMonth()+1
console.log(new Date(e).getFullYear()+"-"+month+'-'+new Date(e).getDate()) console.log(new Date(e).getFullYear()+"-"+month+'-'+new Date(e).getDate())
form.dateline = form.dateline =
new Date(e).getFullYear() + new Date(e).getFullYear() +
@ -326,7 +326,7 @@ export default defineComponent({
console.log(videos.value[0].duration); console.log(videos.value[0].duration);
form.fileduration = videos.value[0].duration; form.fileduration = videos.value[0].duration;
}); });
let res = await uploadflie(file.file, (info: any) => { const res = await uploadflie(file.file, (info: any) => {
console.log(info); console.log(info);
uploadprogress.value = info.percent.toFixed(2) * 100; uploadprogress.value = info.percent.toFixed(2) * 100;
}); });
@ -337,7 +337,7 @@ export default defineComponent({
} }
async function uploadspic(file: AntUpload) { async function uploadspic(file: AntUpload) {
let res = await uploadflie(file.file, (info: any) => { const res = await uploadflie(file.file, (info: any) => {
console.log(info); console.log(info);
uploadpicprogress.value = info.percent.toFixed(2) * 100; uploadpicprogress.value = info.percent.toFixed(2) * 100;
}); });

View File

@ -67,13 +67,13 @@ export default defineComponent({
withdrawallist.value=await withdrawal() withdrawallist.value=await withdrawal()
console.log(withdrawallist.value) console.log(withdrawallist.value)
}) })
async function onChange(e: any,dateString:string){ async function onChange(e: any,dateString: string){
console.log(dateString) console.log(dateString)
dates.value[0]=dateString[0] dates.value[0]=dateString[0]
dates.value[1]=dateString[1] dates.value[1]=dateString[1]
withdrawallist.value=await withdrawal({bdate:dates.value[0],edate:dates.value[1]}) withdrawallist.value=await withdrawal({bdate:dates.value[0],edate:dates.value[1]})
} }
function navto(index: number,id?:number) { function navto(index: number,id?: number) {
let url = ""; let url = "";
switch (index) { switch (index) {
case 1: case 1:
@ -100,7 +100,7 @@ export default defineComponent({
} }
async function pagechange(e:any) { async function pagechange(e: any) {
console.log(e) console.log(e)
page.value=e page.value=e
withdrawallist.value=await withdrawal({bdate:dates.value[0],edate:dates.value[1],page:e}); withdrawallist.value=await withdrawal({bdate:dates.value[0],edate:dates.value[1],page:e});

View File

@ -121,7 +121,7 @@ export default defineComponent({
} }
}) })
function navto(index: number,id?:number) { function navto(index: number,id?: number) {
let url = ""; let url = "";
switch (index) { switch (index) {
case 1: case 1:

View File

@ -246,7 +246,7 @@ export default defineComponent({
function listchange(e: number){ function listchange(e: number){
listindex.value=e listindex.value=e
} }
async function onChange(e: any,dateString:string){ async function onChange(e: any,dateString: string){
console.log(dateString) console.log(dateString)
dates.value[0]=dateString[0] dates.value[0]=dateString[0]
dates.value[1]=dateString[1] dates.value[1]=dateString[1]
@ -255,12 +255,12 @@ export default defineComponent({
async function del(e: number){ async function del(e: number){
deleteaccount(e) deleteaccount(e)
} }
async function pagechange(e:any) { async function pagechange(e: any) {
console.log(e) console.log(e)
page.value=e page.value=e
salelist.value=await saleinfo({status:state.value,bdate:dates.value[0],edate:dates.value[1],page:e}); salelist.value=await saleinfo({status:state.value,bdate:dates.value[0],edate:dates.value[1],page:e});
} }
function navto(index: number,id?:number) { function navto(index: number,id?: number) {
let url = ""; let url = "";
switch (index) { switch (index) {
case 1: case 1:

View File

@ -190,6 +190,11 @@ export default defineComponent({
onMounted(async () => { onMounted(async () => {
livelist.value = await getlivelist(); livelist.value = await getlivelist();
}); });
async function tab(){
input.value = '';
livelist.value = await getlivelist({ status: tabindex.value});
}
function tabchange(e: number): void { function tabchange(e: number): void {
tabindex.value = e; tabindex.value = e;
livelist.value = {data:[], code: 0, msg: "",total: 0}; livelist.value = {data:[], code: 0, msg: "",total: 0};
@ -199,11 +204,7 @@ export default defineComponent({
console.log(input.value); console.log(input.value);
livelist.value = await getlivelist({title: input.value}); livelist.value = await getlivelist({title: input.value});
} }
async function tab(){
input.value = '';
livelist.value = await getlivelist({ status: tabindex.value});
}
return { return {
page, page,
tabindex, tabindex,

View File

@ -45,7 +45,7 @@ export default defineComponent({
setup() { setup() {
console.log(useRoute().query.id); console.log(useRoute().query.id);
const id = useRoute().query.id; const id = useRoute().query.id;
let liveinfo = ref<any>({}) const liveinfo = ref<any>({})
if (typeof id == "string") { if (typeof id == "string") {
getliveinfo(parseInt(id)).then((res) => { getliveinfo(parseInt(id)).then((res) => {
liveinfo.value = res; liveinfo.value = res;

View File

@ -191,6 +191,7 @@ import { defineComponent, onMounted } from "vue";
import LivePlaying from "@/components/LivePlaying.vue"; import LivePlaying from "@/components/LivePlaying.vue";
import LiveingWatcher from "@/components/LiveingWatcher.vue"; import LiveingWatcher from "@/components/LiveingWatcher.vue";
import TRTC from "trtc-js-sdk" import TRTC from "trtc-js-sdk"
import { usersig } from '@/api';
export default defineComponent({ export default defineComponent({
components: { components: {
@ -202,48 +203,7 @@ export default defineComponent({
let client: any; let client: any;
let localStream: any; let localStream: any;
let statie = true; let statie = true;
onMounted(()=>{ let userSing = '';
init(pingmu);
})
function fenxiang(){
console.log(localStream)
// client.unpublish(localStream).then(() => {
// //
// console.log("")
// client.leave().then(() => {
// // leaving room success
// console.log("")
// }).catch((error: string) => {
// console.error('leaving room failed: ' + error);
// });
// });
init(statie ? shexiang : pingmu);
statie = !statie;
}
function init(fun: any){
const el = document.querySelector("#local_stream");
if(el){
el.innerHTML = ""
}
client = TRTC.createClient({
mode: 'rtc',
sdkAppId: '1400400340',
userId: 10,
userSig: 'cf1e5db5d230ce6fee3fa23ba779c68a597dd229c11cd9ee315e5ffd6b9bf415'
});
client
.join({ roomId: 11 })
.catch((error: string) => {
console.error('进房失败 ' + error);
})
.then(() => {
console.log('进房成功');
fun()
});
}
function pingmu(){ function pingmu(){
localStream = TRTC.createStream({ userid: 10, audio: true, screen: true }); localStream = TRTC.createStream({ userid: 10, audio: true, screen: true });
@ -285,6 +245,53 @@ export default defineComponent({
}); });
}); });
} }
function init(fun: any, userSig: string){
console.log(userSig)
const el = document.querySelector("#local_stream");
if(el){
el.innerHTML = ""
}
client = TRTC.createClient({
mode: 'rtc',
sdkAppId: '1400400340',
userId: 10,
userSig: userSig
});
client
.join({ roomId: 11 })
.catch((error: string) => {
console.error('进房失败 ' + error);
})
.then(() => {
console.log('进房成功');
fun()
});
}
function fenxiang(){
console.log(localStream)
// client.unpublish(localStream).then(() => {
// //
// console.log("")
// client.leave().then(() => {
// // leaving room success
// console.log("")
// }).catch((error: string) => {
// console.error('leaving room failed: ' + error);
// });
// });
init(statie ? shexiang : pingmu, userSing);
statie = !statie;
}
onMounted(async ()=>{
userSing = await usersig(10);
init(pingmu, userSing);
})
return{ return{
fenxiang fenxiang
} }

View File

@ -182,7 +182,7 @@ export default defineComponent({
onMounted(async () => { onMounted(async () => {
teacherlikedlist.value=await getteacherliked() teacherlikedlist.value=await getteacherliked()
}); });
async function search(e:any){ async function search(e: any){
teacherlikedlist.value=await getteacherliked(e) teacherlikedlist.value=await getteacherliked(e)
} }
async function pagechange(){ async function pagechange(){

View File

@ -202,30 +202,17 @@ export default defineComponent({
console.log(date) console.log(date)
const month: any = ref(date); const month: any = ref(date);
const yue = ref(0); const yue = ref(0);
function xia(){
yue.value = yue.value + 1;
month.value = getdate(yue.value)
getdates(userid.value)
}
const userid = computed(() => { const userid = computed(() => {
return store.state.userinfo.memberid; return store.state.userinfo.memberid;
}) })
watch(userid, ()=> {
getdates(userid.value);
})
function shang(){
yue.value = yue.value - 1;
month.value = getdate(yue.value)
getdates(userid.value)
}
async function getdates(userid: number){ async function getdates(userid: number){
getdatelist(month.value.start, month.value.end, userid).then((res: any)=>{ getdatelist(month.value.start, month.value.end, userid).then((res: any)=>{
console.log(res) console.log(res)
for(let i in res){ for(const i in res){
const day = getDay(res[i].dateline) const day = getDay(res[i].dateline)
for(let j in month.value.date){ for(const j in month.value.date){
for(let k in month.value.date[j]){ for(const k in month.value.date[j]){
if(month.value.date[j][k].day == day){ if(month.value.date[j][k].day == day){
if(month.value.date[j][k].list == undefined){ if(month.value.date[j][k].list == undefined){
month.value.date[j][k].list = []; month.value.date[j][k].list = [];
@ -239,6 +226,21 @@ export default defineComponent({
console.log(month.value.date) console.log(month.value.date)
}) })
} }
function xia(){
yue.value = yue.value + 1;
month.value = getdate(yue.value)
getdates(userid.value)
}
watch(userid, ()=> {
getdates(userid.value);
})
function shang(){
yue.value = yue.value - 1;
month.value = getdate(yue.value)
getdates(userid.value)
}
function navto(){ function navto(){
router.push("/regime/week") router.push("/regime/week")
} }

View File

@ -219,14 +219,13 @@ export default defineComponent({
const week = ref<any>(getweek()); const week = ref<any>(getweek());
const userid = store.state.userinfo.memberid; const userid = store.state.userinfo.memberid;
console.log(week.value); console.log(week.value);
getdates(userid);
function getdates(userid: number){ function getdates(userid: number){
getdatelist(week.value.start, week.value.end, userid).then((res: any)=>{ getdatelist(week.value.start, week.value.end, userid).then((res: any)=>{
console.log(res) console.log(res)
for(let i in res){ for(const i in res){
const day = getDay(res[i].dateline) const day = getDay(res[i].dateline)
console.log(day) console.log(day)
for(let j in week.value.date){ for(const j in week.value.date){
console.log(getDay(week.value.date[j].day)) console.log(getDay(week.value.date[j].day))
if(day == getDay(week.value.date[j].day)){ if(day == getDay(week.value.date[j].day)){
console.log("fuzhi") console.log("fuzhi")
@ -240,6 +239,9 @@ export default defineComponent({
console.log(week.value) console.log(week.value)
}) })
} }
getdates(userid);
watch(zhou, (value) => { watch(zhou, (value) => {
week.value = getweek(value); week.value = getweek(value);
console.log(week.value); console.log(week.value);

1063
yarn.lock

File diff suppressed because it is too large Load Diff