diff --git a/src/api/base.ts b/src/api/base.ts index d5523bf..c81efc6 100644 --- a/src/api/base.ts +++ b/src/api/base.ts @@ -10,7 +10,7 @@ import { MessageType } from 'ant-design-vue/types/message'; export interface Get { (url: string, params?: unknown, config?: AxiosRequestConfig): Promise>; } -const login:MessageType[] = [] +const login: MessageType[] = [] axios.interceptors.request.use((config)=>{ login.push(message.loading('加载中..', 0)) return config; diff --git a/src/api/index.ts b/src/api/index.ts index 3d27db4..4756d95 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -79,7 +79,7 @@ interface Teacherliked { interest: string; } -export async function getteacherliked(data?:any){ +export async function getteacherliked(data?: any){ const res = await get>('teacherliked',data); // console.log(res) return res; @@ -111,7 +111,7 @@ interface VideoListInfo { msg: string; total: number; } -export async function getvideolist(data?:any): Promise{ +export async function getvideolist(data?: any): Promise{ const res = await get>('video',data) console.log(res) return res @@ -123,7 +123,7 @@ export async function getvideolist(data?:any): Promise{ -export async function getlivelist(data?:any):Promise { +export async function getlivelist(data?: any): Promise { const res = await get>('live',data); console.log(res); return res; @@ -144,8 +144,8 @@ export async function getstatisticlist() { // console.log(res) return { liveInfo: res.data.liveInfo, - videoInfo:res.data.videoInfo, - studentInfo:res.data.studentInfo + videoInfo: res.data.videoInfo, + studentInfo: res.data.studentInfo } } @@ -153,10 +153,10 @@ export async function getstatisticlist() { * 发布直播 */ interface Liveaddrule{ - code: number, - msg: string + code: number; + msg: string; } -export async function liveadd(data:any) { +export async function liveadd(data: any) { const res = await post('live',data); console.log(res) } @@ -175,7 +175,7 @@ export async function videoadd( form: any,data: any) { fileurl: "", fileduration: "", desc: "", - video:[""], + video: [""], } } } @@ -194,14 +194,14 @@ interface VideoDetail{ fileduration: string; status: number; desc: string; - deleted_at: null; + deleted_at: string; created_at: string; updated_at: string; - share:number, - watch:number + share: number; + watch: number; } -export async function videodetail(data?:any,ifupdate?:number) { +export async function videodetail(data?: any,ifupdate?: number) { const res=await get('video/'+data) if(ifupdate){ console.log(111) @@ -211,8 +211,8 @@ export async function videodetail(data?:any,ifupdate?:number) { fileid: res.data.fileid, fileurl: res.data.fileurl, fileduration: res.data.fileduration, - desc:res.data.desc, - video:[res.data.fileurl], + desc: res.data.desc, + video: [res.data.fileurl], } }else{ return { @@ -225,11 +225,11 @@ export async function videodetail(data?:any,ifupdate?:number) { fileduration: res.data.fileduration, status: res.data.status, desc: res.data.desc, - deleted_at: res.data.deleted_at, - created_at: res.data.created_at, - updated_at: res.data.updated_at, - watch:res.data.watch, - share:res.data.share + deletedAt: res.data.deleted_at, + createdAt: res.data.created_at, + updatedAt: res.data.updated_at, + watch: res.data.watch, + 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('video/'+data); if(res.code==0){ 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('wallect',data); if(res.code==0){ message.success("新增成功") @@ -263,19 +263,19 @@ export async function accountadd(data?:any) { } interface SaleInfo{ - total:number, - accountid:number, - memberid:number, - sn:string, - type:number, - typename:string, - money:string, - source:number, - remark:string, - deleted_at:string, - created_at:string, - updated_at:string, - basemoney:string + total: number; + accountid: number; + memberid: number; + sn: string; + type: number; + typename: string; + money: string; + source: number; + remark: string; + deleted_at: string; + created_at: string; + updated_at: string; + basemoney: string; } interface SaleInfolData{ data: SaleInfo[]; @@ -288,7 +288,7 @@ interface SaleInfolData{ * @param data */ -export async function saleinfo(data?:any){ +export async function saleinfo(data?: any){ const res=await get('account',data) console.log(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 // if(data.type!=0){ @@ -326,31 +326,31 @@ export async function cashout(data?:any,accountinfo?:any){ * 账户详情 */ interface AccountInfo{ - wallectid:number, - typeid:number, - type:number, - account:number, - mname:string, - bankcode:string, - bankname:string + wallectid: number; + typeid: number; + type: number; + account: number; + mname: string; + bankcode: string; + bankname: string; } export async function getaccountinfo(data?: any){ const res=await get('wallect/'+data) console.log(res,2333) return { - accountid:res.data.wallectid, - type:res.data.type, - account:res.data.account, - mname:res.data.mname, - bankcode:res.data.bankcode, - bankname:res.data.bankname + accountid: res.data.wallectid, + type: res.data.type, + account: res.data.account, + mname: res.data.mname, + bankcode: res.data.bankcode, + bankname: res.data.bankname } } /** * 账户编辑 */ -export async function editaccount(data?:any){ +export async function editaccount(data?: any){ const res=await put('wallect/'+data); if(res.code==0){ 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('wallect/'+data); + const res = await del('wallect/' + data); if(res.code==0){ message.success("删除成功") } @@ -374,17 +374,17 @@ export async function deleteaccount(data:any) { * 交易明细 详情 */ interface TransactionInfo{ - accountid:number, - memberid:number, - sn:string, - type:number, - typename:string, - money:number, - source:number, - remark:string, - deleted_at:any, - created_at:string, - updated_at:string + accountid: number; + memberid: number; + sn: string; + type: number; + typename: string; + money: number; + source: number; + remark: string; + deleted_at: any; + created_at: string; + updated_at: string; } export async function transactioninfo(data?: any){ const res = await get('account/'+data) @@ -395,12 +395,12 @@ export async function transactioninfo(data?: any){ /** * 修改密码 */ -export async function editpassword(data?:any) :Promise { +export async function editpassword(data?: any): Promise { console.log(data,111) const newdata={ memberid:0, - password:"", - topassword:"" + password: "", + topassword: "" } newdata.memberid=data.memberid newdata.password=data.password @@ -418,24 +418,24 @@ export async function editpassword(data?:any) :Promise { * 提现记录 列表 */ interface WithDrawal{ - withdrawalid:number, - memberid:number, - sn:string, - status:number, - statusname:string, - type:number, - typename:string, - money:number - sxf:number, - international:number, - account:string, - mname:string, - bankcode:string, - bankname:string, - remark:string, - deleted_at:string, - created_at:string, - updated_at:string + withdrawalid: number; + memberid: number; + sn: string; + status: number; + statusname: string; + type: number; + typename: string; + money: number; + sxf: number; + international: number; + account: string; + mname: string; + bankcode: string; + bankname: string; + remark: string; + deleted_at: string; + created_at: string; + updated_at: string; } interface WithdrawlData{ data: WithDrawal[]; @@ -443,7 +443,7 @@ interface WithdrawlData{ msg: string; total: number; } -export async function withdrawal(data?:any) { +export async function withdrawal(data?: any) { console.log(data) const res=await get('withdrawal',data) // 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/'+data) return res.data } @@ -462,17 +462,17 @@ export async function withdrawlxq(data?:any){ * 评论(视频?) */ interface CommentList{ - commentid:number, - memberid:number, - cid:number, - type:number, - score:number, - content:string, - deleted_at:null, - created_at:string, - updated_at:string, - name:string, - img:string + commentid: number; + memberid: number; + cid: number; + type: number; + score: number; + content: string; + deleted_at: null; + created_at: string; + updated_at: string; + name: string; + img: string; } interface CommentlData{ data: CommentList[]; @@ -484,10 +484,10 @@ interface ReplylistData{ data: CommentList[]; code: number; msg: string; - score?:string, + score?: string; total: number; } -export async function getcommentlist(data?:any) { +export async function getcommentlist(data?: any) { console.log(data.type==2) if(data.type==2){ @@ -511,13 +511,13 @@ export async function getcommentlist(data?:any) { * 发布评论 */ interface SendData{ - type?:number, - cid?:number, - teacherid?:number, - score?:number, - content?:string + type?: number; + cid?: number; + teacherid?: number; + score?: number; + content?: string; } -export async function addcomment(data?:any):Promise { +export async function addcomment(data?: any): Promise { const res=await post('comments',data) if(res.code==0){ message.success("发布成功") @@ -528,7 +528,7 @@ export async function addcomment(data?:any):Promise { * 删除评论 */ - export async function delreply(data?:any) { + export async function delreply(data?: any) { const res = await del('comments/'+data); if(res.code==0){ message.success("删除成功") @@ -541,37 +541,37 @@ export async function addcomment(data?:any):Promise { * 验证用户是否存在 */ interface CheckuserRule{ - memberid: number, - name: string, - mobile: string, - email: string, - code:string + memberid: number; + name: string; + mobile: string; + email: string; + code: string; } interface CheckData{ data: { - memberid: any, - name: string, - mobile: string, - email: string, - code:string - }, + memberid: any; + name: string; + mobile: string; + email: string; + code: string; + }; code: number; msg: string; } -export async function checkuser(data?:any){ - const newdata={number:""} +export async function checkuser(data?: any){ + const newdata={number: ""} newdata.number=data.phone const res = await get('checkUser',newdata); // console.log(res) return { - code :res.code, - msg:res.msg, - data:{ - memberid:res.data.memberid, + code: res.code, + msg: res.msg, + data: { + memberid: res.data.memberid, name: res.data.name, mobile: res.data.mobile, email: res.data.email, - code:res.data.code + code: res.data.code } } } @@ -610,7 +610,7 @@ interface Countries{ interface Willsay{ languageid: number; - name: string + name: string; } export async function getarchives(): Promise<[Countries[],Willsay[]]>{ @@ -629,7 +629,7 @@ interface Language { dictionaryid: number; name: string; alias: string; - code :string; + code: string; position: number; publish: number; value: string; @@ -657,22 +657,22 @@ export async function putmember(data: any): Promise{ data.willsayValue[i].level=data.willsayValue[i].level+'' } const newdata={ - name:data.name, - mobile:data.mobile, - img:data.img, - country:data.countryValue, - live:data.live, - mtongue:data.mtongue, - email:data.email, - interest:JSON.stringify(data.interest), - willsay:JSON.stringify(data.willsayValue), - birthday:data.birthday, - zoneid:data.zoneid, - currency:data.currencyValue, - language:data.languageValue, - tlanguage:data.tlanguageValue, - video:data.video, - desc:data.desc + name: data.name, + mobile: data.mobile, + img: data.img, + country: data.countryValue, + live: data.live, + mtongue: data.mtongue, + email: data.email, + interest: JSON.stringify(data.interest), + willsay: JSON.stringify(data.willsayValue), + birthday: data.birthday, + zoneid: data.zoneid, + currency: data.currencyValue, + language: data.languageValue, + tlanguage: data.tlanguageValue, + video: data.video, + desc: data.desc } console.log(newdata) const res = await put(`member/${store.state.userinfo.memberid}`, newdata) diff --git a/src/components/ReviewItem.vue b/src/components/ReviewItem.vue index 3e2be67..9643239 100644 --- a/src/components/ReviewItem.vue +++ b/src/components/ReviewItem.vue @@ -159,17 +159,17 @@ export default defineComponent({ const videoid=ref(useRoute().query.id) const ifshow=ref(false) 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") - reviewlist.value=await getcommentlist({type:2,id:videoid.value}) - replylist.value=await getcommentlist({type:3,id:e}) + reviewlist.value=await getcommentlist({type: 2,id: videoid.value}) + replylist.value=await getcommentlist({type: 3,id: e}) } const stars=ref>([]) console.log(prop.score) - let score1=ref(prop.score) + const score1=ref(prop.score) // console.log(score1) if(score1.value==5){ 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) - 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") - replylist.value =await getcommentlist({type:3,id:e}) + replylist.value =await getcommentlist({type: 3,id: e}) ifshow.value=ifshow.value==false?true:false } return { diff --git a/src/components/ReviewItemtwo.vue b/src/components/ReviewItemtwo.vue index 0fe0fe2..4d06ef8 100644 --- a/src/components/ReviewItemtwo.vue +++ b/src/components/ReviewItemtwo.vue @@ -102,39 +102,39 @@ import store from '@/store'; import { defineComponent, ref } from 'vue'; export default defineComponent({ - props:{ - photo:{ - type:String + props: { + photo: { + type: String }, - username:{ - type:String + username: { + type: String }, - score:{ - type:Number, + score: { + type: Number, }, - content:{ - type:String + content: { + type: String }, - date:{ - type:String + date: { + type: String }, - memberid:{ - type:Number + memberid: { + type: Number }, - replyid:{ - type:Number + replyid: { + type: Number } }, setup(prop,context){ const myid=ref(store.state.userinfo.memberid) - function reply(e?:string){ + function reply(e?: string){ 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) async function del(e?: number){ console.log(e) - let res=await delreply(e) + const res=await delreply(e) if(res.code==0){ context.emit("reload",prop.replyid) } diff --git a/src/components/VideoReview.vue b/src/components/VideoReview.vue index f78a176..5d9c4a3 100644 --- a/src/components/VideoReview.vue +++ b/src/components/VideoReview.vue @@ -98,13 +98,13 @@ import { useRoute } from 'vue-router'; import ReviewItem from "./ReviewItem.vue" export default defineComponent({ - components:{ + components: { ReviewItem }, - props:{ - videoid:{ - type:Number + props: { + videoid: { + type: Number } }, setup(prop,context){ @@ -114,16 +114,16 @@ export default defineComponent({ const replylist =ref({}) const videoid=ref(useRoute().query.id) 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(store.state.userinfo.memberid,"userifno") interface SendData{ - type?:number, - cid?:number, - teacherid?:number, - score?:number, - content?:string + type?: number; + cid?: number; + teacherid?: number; + score?: number; + content?: string; } function send(){ const data = ref({}) @@ -136,10 +136,10 @@ export default defineComponent({ addcomment(toRaw(data.value)) } - async function refresh(e?:any){ + async function refresh(e?: any){ console.log("rekload") - reviewlist.value=await getcommentlist({type:2,id:videoid.value}) - replylist.value=await getcommentlist({type:3,id:e}) + reviewlist.value=await getcommentlist({type: 2,id: videoid.value}) + replylist.value=await getcommentlist({type: 3,id: e}) } const reply: (val: number) => void = (val: number) => { console.log("收到子组件事件", val) @@ -148,7 +148,7 @@ export default defineComponent({ const haslist=ref([]) const findreply: (e: any) => void = async (e: any) => { console.log("收到子组件事件", e) - replylist.value=await getcommentlist({type:3,id:e}) + replylist.value=await getcommentlist({type: 3,id: e}) } console.log(1) return { diff --git a/src/i18n/init.ts b/src/i18n/init.ts index fc5ca04..772e881 100644 --- a/src/i18n/init.ts +++ b/src/i18n/init.ts @@ -3,7 +3,7 @@ import zh from "./zh" export default { locale: "zh", //默认语言 - messages:{ + messages: { zh } } \ No newline at end of file diff --git a/src/store/index.ts b/src/store/index.ts index 3755e95..404ee0b 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -5,15 +5,15 @@ export default createStore({ state: { userinfo:{ accesstoken: "", - api_token: "", + apiToken: "", birthday: "", country: "", countryValue: "", cover: "", - created_at: "", + createdAt: "", currency: "", currencyValue: "", - deleted_at: null, + deletedAt: null, desc: "", email: "", img: "", @@ -22,7 +22,7 @@ export default createStore({ languageValue: "zh", live: "", livetime: "", - login_type: 0, + loginType: 0, memberid: 0, mobile: "", money: "", @@ -39,7 +39,7 @@ export default createStore({ tlanguageValue: 1, type: 1, uid: "", - updated_at: "", + updatedAt: "", video: "", willsay: [{name: "请选择", level: 0}], willsayValue: [{name: "0", level: 0}], diff --git a/src/utils/i18n.ts b/src/utils/i18n.ts index 90250c8..5725e10 100644 --- a/src/utils/i18n.ts +++ b/src/utils/i18n.ts @@ -1,12 +1,12 @@ import { inject, provide, ref } from 'vue'; interface Language { - [key :string]: string + [key: string]: string; } interface Config { locale: string; - messages: {[key: string]: Language} + messages: {[key: string]: Language}; } const createI18n = (config: Config) => ({ diff --git a/src/utils/vod.ts b/src/utils/vod.ts index 27e32ff..f716ff8 100644 --- a/src/utils/vod.ts +++ b/src/utils/vod.ts @@ -10,7 +10,7 @@ interface UploaderDone { video: { url: string; verify_content: string; - } + }; } export async function uploadflie(file: File,on?: OnFunctio): Promise { diff --git a/src/views/login/Reset.vue b/src/views/login/Reset.vue index ce7ec56..7bce1f0 100644 --- a/src/views/login/Reset.vue +++ b/src/views/login/Reset.vue @@ -114,9 +114,10 @@ export default defineComponent({ const uinfo=ref({ phone:"", code:"", + quhao:"", password:"", repassword:"", - quhao:"", + checkcodequhao:"", memberid:0 }) const time = ref(60); //倒计时初始值 @@ -187,17 +188,17 @@ export default defineComponent({ return } - let checkcode=await checksmscode(uinfo.value.quhao+uinfo.value.phone,uinfo.value.code) - console.log(checkcode,"checked") - if(checkcode){ - console.log(uinfo.value) - let res= await editpassword(toRaw(uinfo.value)) - if(res.code==0){ - stepnow.value=e - } - }else{ + const checkcode=await checksmscode(uinfo.value.quhao+uinfo.value.phone,uinfo.value.code) + console.log(checkcode,"checked") + if(checkcode){ + console.log(uinfo.value) + const res= await editpassword(toRaw(uinfo.value)) + if(res.code==0){ + stepnow.value=e + } + }else{ message.error("验证码有误,请重新输入") - } + } } diff --git a/src/views/mine/Archives.vue b/src/views/mine/Archives.vue index 9b0f47d..288501d 100644 --- a/src/views/mine/Archives.vue +++ b/src/views/mine/Archives.vue @@ -305,7 +305,8 @@ export default defineComponent({ const modalNode = () => document.getElementsByClassName('modal-container')[0] const chiveslist = ref([[],[]]); - const languages = ref([]) + const languages = ref([]); + const isSecondStep: Ref = ref(false); onMounted(async ()=>{ chiveslist.value = await getarchives() languages.value = await getlanguages() @@ -377,7 +378,6 @@ export default defineComponent({ } } // 绑定手机号是否是第二步 - const isSecondStep: Ref = ref(false); interface BindPhoneItem{ number: string | number; code: string | number; @@ -457,7 +457,7 @@ export default defineComponent({ // console.log(toRaw(formData.value).willsay[i]) // } for(let m=0;m { + const res = await uploadflie(file.file, (info: any) => { console.log(info); uploadprogress.value = info.percent.toFixed(2) * 100; }); diff --git a/src/views/mine/ReleaseVideo.vue b/src/views/mine/ReleaseVideo.vue index 9b8685e..404250d 100644 --- a/src/views/mine/ReleaseVideo.vue +++ b/src/views/mine/ReleaseVideo.vue @@ -121,7 +121,7 @@ export default defineComponent({ }, setup() { interface FileItem { - video:Array, + video: Array; } const fileList: Array = []; @@ -195,7 +195,7 @@ export default defineComponent({ file: File; } async function uploadspic(file: AntUpload) { - let res = await uploadflie(file.file, (info: any) => { + const res = await uploadflie(file.file, (info: any) => { console.log(info); uploadpicprogress.value = info.percent.toFixed(2) * 100; }); @@ -216,7 +216,7 @@ export default defineComponent({ console.log(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); uploadprogress.value = info.percent.toFixed(2) * 100; }); diff --git a/src/views/mine/ReleaseWebcast.vue b/src/views/mine/ReleaseWebcast.vue index e638dc0..5a8cc8c 100644 --- a/src/views/mine/ReleaseWebcast.vue +++ b/src/views/mine/ReleaseWebcast.vue @@ -272,7 +272,7 @@ export default defineComponent({ validate() .then(() => { // console.log(toRaw(form),111); - let subdata = toRaw(form); + const subdata = toRaw(form); // subdata.fileid=picinfo. console.log(subdata); liveadd(subdata); @@ -294,7 +294,7 @@ export default defineComponent({ */ 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()) form.dateline = new Date(e).getFullYear() + @@ -326,7 +326,7 @@ export default defineComponent({ console.log(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); uploadprogress.value = info.percent.toFixed(2) * 100; }); @@ -337,7 +337,7 @@ export default defineComponent({ } async function uploadspic(file: AntUpload) { - let res = await uploadflie(file.file, (info: any) => { + const res = await uploadflie(file.file, (info: any) => { console.log(info); uploadpicprogress.value = info.percent.toFixed(2) * 100; }); diff --git a/src/views/mine/Transaction.vue b/src/views/mine/Transaction.vue index 72885a2..9202344 100644 --- a/src/views/mine/Transaction.vue +++ b/src/views/mine/Transaction.vue @@ -67,13 +67,13 @@ export default defineComponent({ withdrawallist.value=await withdrawal() console.log(withdrawallist.value) }) - async function onChange(e: any,dateString:string){ + async function onChange(e: any,dateString: string){ console.log(dateString) dates.value[0]=dateString[0] dates.value[1]=dateString[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 = ""; switch (index) { case 1: @@ -100,7 +100,7 @@ export default defineComponent({ } - async function pagechange(e:any) { + async function pagechange(e: any) { console.log(e) page.value=e withdrawallist.value=await withdrawal({bdate:dates.value[0],edate:dates.value[1],page:e}); diff --git a/src/views/mine/Transactiondetail.vue b/src/views/mine/Transactiondetail.vue index 90e9339..496180f 100644 --- a/src/views/mine/Transactiondetail.vue +++ b/src/views/mine/Transactiondetail.vue @@ -121,7 +121,7 @@ export default defineComponent({ } }) - function navto(index: number,id?:number) { + function navto(index: number,id?: number) { let url = ""; switch (index) { case 1: diff --git a/src/views/mine/Wallet.vue b/src/views/mine/Wallet.vue index a64ad22..e903340 100644 --- a/src/views/mine/Wallet.vue +++ b/src/views/mine/Wallet.vue @@ -246,7 +246,7 @@ export default defineComponent({ function listchange(e: number){ listindex.value=e } - async function onChange(e: any,dateString:string){ + async function onChange(e: any,dateString: string){ console.log(dateString) dates.value[0]=dateString[0] dates.value[1]=dateString[1] @@ -255,12 +255,12 @@ export default defineComponent({ async function del(e: number){ deleteaccount(e) } - async function pagechange(e:any) { + async function pagechange(e: any) { console.log(e) page.value=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 = ""; switch (index) { case 1: diff --git a/src/views/regime/Live.vue b/src/views/regime/Live.vue index f84ab28..0442e3e 100644 --- a/src/views/regime/Live.vue +++ b/src/views/regime/Live.vue @@ -190,6 +190,11 @@ export default defineComponent({ onMounted(async () => { livelist.value = await getlivelist(); }); + async function tab(){ + input.value = ''; + livelist.value = await getlivelist({ status: tabindex.value}); + + } function tabchange(e: number): void { tabindex.value = e; livelist.value = {data:[], code: 0, msg: "",total: 0}; @@ -199,11 +204,7 @@ export default defineComponent({ console.log(input.value); livelist.value = await getlivelist({title: input.value}); } - async function tab(){ - input.value = ''; - livelist.value = await getlivelist({ status: tabindex.value}); - - } + return { page, tabindex, diff --git a/src/views/regime/Livedetail.vue b/src/views/regime/Livedetail.vue index 76de111..66fc3ba 100644 --- a/src/views/regime/Livedetail.vue +++ b/src/views/regime/Livedetail.vue @@ -45,7 +45,7 @@ export default defineComponent({ setup() { console.log(useRoute().query.id); const id = useRoute().query.id; - let liveinfo = ref({}) + const liveinfo = ref({}) if (typeof id == "string") { getliveinfo(parseInt(id)).then((res) => { liveinfo.value = res; diff --git a/src/views/regime/Liveing.vue b/src/views/regime/Liveing.vue index daad918..7c129b2 100644 --- a/src/views/regime/Liveing.vue +++ b/src/views/regime/Liveing.vue @@ -204,52 +204,7 @@ export default defineComponent({ let localStream: any; let statie = true; let userSing = ''; - onMounted(async ()=>{ - userSing = await usersig(10); - - init(pingmu, userSing); - - }) - 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; - } - 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 pingmu(){ + function pingmu(){ localStream = TRTC.createStream({ userid: 10, audio: true, screen: true }); localStream @@ -290,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{ fenxiang } diff --git a/src/views/regime/Subscriber.vue b/src/views/regime/Subscriber.vue index dad8c7c..e403de6 100644 --- a/src/views/regime/Subscriber.vue +++ b/src/views/regime/Subscriber.vue @@ -182,7 +182,7 @@ export default defineComponent({ onMounted(async () => { teacherlikedlist.value=await getteacherliked() }); - async function search(e:any){ + async function search(e: any){ teacherlikedlist.value=await getteacherliked(e) } async function pagechange(){ diff --git a/src/views/regime/date.vue b/src/views/regime/date.vue index a786f97..29290ef 100644 --- a/src/views/regime/date.vue +++ b/src/views/regime/date.vue @@ -202,30 +202,17 @@ export default defineComponent({ console.log(date) const month: any = ref(date); const yue = ref(0); - function xia(){ - yue.value = yue.value + 1; - month.value = getdate(yue.value) - getdates(userid.value) - } const userid = computed(() => { 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){ getdatelist(month.value.start, month.value.end, userid).then((res: any)=>{ console.log(res) - for(let i in res){ + for(const i in res){ const day = getDay(res[i].dateline) - for(let j in month.value.date){ - for(let k in month.value.date[j]){ + for(const j in month.value.date){ + for(const k in month.value.date[j]){ if(month.value.date[j][k].day == day){ if(month.value.date[j][k].list == undefined){ month.value.date[j][k].list = []; @@ -239,6 +226,21 @@ export default defineComponent({ 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(){ router.push("/regime/week") } diff --git a/src/views/regime/week.vue b/src/views/regime/week.vue index 25f9073..f213a10 100644 --- a/src/views/regime/week.vue +++ b/src/views/regime/week.vue @@ -219,14 +219,13 @@ export default defineComponent({ const week = ref(getweek()); const userid = store.state.userinfo.memberid; console.log(week.value); - getdates(userid); function getdates(userid: number){ getdatelist(week.value.start, week.value.end, userid).then((res: any)=>{ console.log(res) - for(let i in res){ + for(const i in res){ const day = getDay(res[i].dateline) 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)) if(day == getDay(week.value.date[j].day)){ console.log("fuzhi") @@ -240,6 +239,9 @@ export default defineComponent({ console.log(week.value) }) } + + getdates(userid); + watch(zhou, (value) => { week.value = getweek(value); console.log(week.value);