xbx #66
10
package.json
10
package.json
@ -22,8 +22,8 @@
|
||||
"vuex": "^4.0.0-0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^4.4.1",
|
||||
"@typescript-eslint/parser": "^4.4.1",
|
||||
"@typescript-eslint/eslint-plugin": "^2.33.0",
|
||||
"@typescript-eslint/parser": "^2.33.0",
|
||||
"@vue/cli-plugin-babel": "~4.5.0",
|
||||
"@vue/cli-plugin-eslint": "~4.5.0",
|
||||
"@vue/cli-plugin-router": "~4.5.0",
|
||||
@ -31,12 +31,12 @@
|
||||
"@vue/cli-plugin-vuex": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"@vue/compiler-sfc": "^3.0.0-0",
|
||||
"@vue/eslint-config-typescript": "^7.0.0",
|
||||
"eslint": "^7.11.0",
|
||||
"@vue/eslint-config-typescript": "^5.0.2",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-plugin-vue": "^7.0.0-0",
|
||||
"node-sass": "^4.14.1",
|
||||
"sass-loader": "^10.0.2",
|
||||
"typescript": "~4.0.3"
|
||||
"typescript": "~3.9.3"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
|
185
src/api/index.ts
185
src/api/index.ts
@ -153,8 +153,8 @@ export async function getstatisticlist() {
|
||||
* 发布直播
|
||||
*/
|
||||
interface Liveaddrule{
|
||||
code: number,
|
||||
msg: string
|
||||
code: number;
|
||||
msg: string;
|
||||
}
|
||||
export async function liveadd(data: any) {
|
||||
const res = await post<Liveaddrule>('live',data);
|
||||
@ -194,11 +194,11 @@ 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) {
|
||||
@ -225,9 +225,9 @@ 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,
|
||||
deletedAt: res.data.deleted_at,
|
||||
createdAt: res.data.created_at,
|
||||
updatedAt: res.data.updated_at,
|
||||
watch: res.data.watch,
|
||||
share: res.data.share
|
||||
}
|
||||
@ -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[];
|
||||
@ -326,13 +326,13 @@ 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<AccountInfo>('wallect/'+data)
|
||||
@ -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<TransactionInfo>('account/'+data)
|
||||
@ -418,24 +418,24 @@ export async function editpassword(data?:any) :Promise<any> {
|
||||
* 提现记录 列表
|
||||
*/
|
||||
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[];
|
||||
@ -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,7 +484,7 @@ interface ReplylistData{
|
||||
data: CommentList[];
|
||||
code: number;
|
||||
msg: string;
|
||||
score?:string,
|
||||
score?: string;
|
||||
total: number;
|
||||
}
|
||||
export async function getcommentlist(data?: any) {
|
||||
@ -511,11 +511,11 @@ 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<void> {
|
||||
const res=await post<SendData>('comments',data)
|
||||
@ -541,20 +541,20 @@ export async function addcomment(data?:any):Promise<void> {
|
||||
* 验证用户是否存在
|
||||
*/
|
||||
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;
|
||||
}
|
||||
@ -610,7 +610,7 @@ interface Countries{
|
||||
|
||||
interface Willsay{
|
||||
languageid: number;
|
||||
name: string
|
||||
name: string;
|
||||
}
|
||||
|
||||
export async function getarchives(): Promise<[Countries[],Willsay[]]>{
|
||||
@ -809,3 +809,16 @@ export async function refusedtolive(signupid: number, msg: string){
|
||||
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;
|
||||
}
|
@ -169,7 +169,7 @@ export default defineComponent({
|
||||
}
|
||||
const stars=ref<Array<number>>([])
|
||||
console.log(prop.score)
|
||||
let score1=ref<any>(prop.score)
|
||||
const score1=ref<any>(prop.score)
|
||||
// console.log(score1)
|
||||
if(score1.value==5){
|
||||
for(let i=0;i < score1.value ; i++){
|
||||
|
@ -134,7 +134,7 @@ export default defineComponent({
|
||||
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)
|
||||
}
|
||||
|
@ -119,11 +119,11 @@ export default defineComponent({
|
||||
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<SendData>({})
|
||||
|
@ -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}],
|
||||
|
@ -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) => ({
|
||||
|
@ -10,7 +10,7 @@ interface UploaderDone {
|
||||
video: {
|
||||
url: string;
|
||||
verify_content: string;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export async function uploadflie(file: File,on?: OnFunctio): Promise<UploaderDone> {
|
||||
|
@ -114,9 +114,10 @@ export default defineComponent({
|
||||
const uinfo=ref({
|
||||
phone:"",
|
||||
code:"",
|
||||
quhao:"",
|
||||
password:"",
|
||||
repassword:"",
|
||||
quhao:"",
|
||||
checkcodequhao:"",
|
||||
memberid:0
|
||||
})
|
||||
const time = ref(60); //倒计时初始值
|
||||
@ -187,11 +188,11 @@ export default defineComponent({
|
||||
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")
|
||||
if(checkcode){
|
||||
console.log(uinfo.value)
|
||||
let res= await editpassword(toRaw(uinfo.value))
|
||||
const res= await editpassword(toRaw(uinfo.value))
|
||||
if(res.code==0){
|
||||
stepnow.value=e
|
||||
}
|
||||
|
@ -305,7 +305,8 @@ export default defineComponent({
|
||||
const modalNode = () => document.getElementsByClassName('modal-container')[0]
|
||||
|
||||
const chiveslist = ref<any>([[],[]]);
|
||||
const languages = ref<unknown>([])
|
||||
const languages = ref<unknown>([]);
|
||||
const isSecondStep: Ref<boolean> = ref(false);
|
||||
onMounted(async ()=>{
|
||||
chiveslist.value = await getarchives()
|
||||
languages.value = await getlanguages()
|
||||
@ -377,7 +378,6 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
// 绑定手机号是否是第二步
|
||||
const isSecondStep: Ref<boolean> = 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<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])
|
||||
|
||||
if(typeof toRaw(formData.value).willsay[i].name=='string'){
|
||||
@ -504,7 +504,7 @@ export default defineComponent({
|
||||
async function uploads(file: AntUpload) {
|
||||
uploadprogress.value=0
|
||||
|
||||
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;
|
||||
});
|
||||
|
@ -121,7 +121,7 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
interface FileItem {
|
||||
video:Array<string>,
|
||||
video: Array<string>;
|
||||
}
|
||||
const fileList: Array<FileItem> = [];
|
||||
|
||||
@ -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;
|
||||
});
|
||||
|
@ -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;
|
||||
});
|
||||
|
@ -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,
|
||||
|
@ -45,7 +45,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
console.log(useRoute().query.id);
|
||||
const id = useRoute().query.id;
|
||||
let liveinfo = ref<any>({})
|
||||
const liveinfo = ref<any>({})
|
||||
if (typeof id == "string") {
|
||||
getliveinfo(parseInt(id)).then((res) => {
|
||||
liveinfo.value = res;
|
||||
|
@ -191,6 +191,7 @@ import { defineComponent, onMounted } from "vue";
|
||||
import LivePlaying from "@/components/LivePlaying.vue";
|
||||
import LiveingWatcher from "@/components/LiveingWatcher.vue";
|
||||
import TRTC from "trtc-js-sdk"
|
||||
import { usersig } from '@/api';
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
@ -202,48 +203,7 @@ export default defineComponent({
|
||||
let client: any;
|
||||
let localStream: any;
|
||||
let statie = true;
|
||||
onMounted(()=>{
|
||||
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()
|
||||
});
|
||||
}
|
||||
let userSing = '';
|
||||
function pingmu(){
|
||||
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{
|
||||
fenxiang
|
||||
}
|
||||
|
@ -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")
|
||||
}
|
||||
|
@ -219,14 +219,13 @@ export default defineComponent({
|
||||
const week = ref<any>(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);
|
||||
|
Loading…
Reference in New Issue
Block a user