diff --git a/src/api/account.js b/src/api/account.js index 581bb56..c569fd6 100644 --- a/src/api/account.js +++ b/src/api/account.js @@ -26,7 +26,6 @@ export function tkhostdata(data) { - export function apiGetCart() { return getAxios({ url: '/cgi-bin/cart/latest' }) } diff --git a/src/assets/MiniProgram.png b/src/assets/MiniProgram.png new file mode 100644 index 0000000..e09ad6c Binary files /dev/null and b/src/assets/MiniProgram.png differ diff --git a/src/assets/ai.png b/src/assets/ai.png new file mode 100644 index 0000000..1ef2140 Binary files /dev/null and b/src/assets/ai.png differ diff --git a/src/assets/icon.png b/src/assets/icon.png new file mode 100644 index 0000000..0458487 Binary files /dev/null and b/src/assets/icon.png differ diff --git a/src/assets/plus.png b/src/assets/plus.png new file mode 100644 index 0000000..8929a91 Binary files /dev/null and b/src/assets/plus.png differ diff --git a/src/assets/plus2.png b/src/assets/plus2.png new file mode 100644 index 0000000..43b8255 Binary files /dev/null and b/src/assets/plus2.png differ diff --git a/src/utils/axios.js b/src/utils/axios.js index c2d0b02..2169117 100644 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -25,14 +25,14 @@ if (process.env.NODE_ENV === 'development') { // baseURL = "https://api.tkpage.yolozs.com" baseURL = "http://47.79.98.113:8101" // baseURL = "http://192.168.0.103:8085/" - // baseURL = "http://192.168.1.174:8101" + // baseURL = "http://192.168.1.144:8101" } else { // 测试环境 // baseURL = "http://120.26.251.180:8085/" // 开发环境 // baseURL = "https://api.tkpage.yolozs.com" baseURL = "http://47.79.98.113:8101" - // baseURL = "http://192.168.1.174:8101" + // baseURL = "http://192.168.1.144:8101" // baseURL = "http://api.tkpage.vvtiktok.cn" } diff --git a/src/utils/pythonBridge.js b/src/utils/pythonBridge.js index f31b361..7405148 100644 --- a/src/utils/pythonBridge.js +++ b/src/utils/pythonBridge.js @@ -10,34 +10,6 @@ const initBridge = () => { }); }; export function usePythonBridge() { - - - - - // // 调用 Python 方法 - // const fetchDataConfig = (data) => { - // return new Promise((resolve, reject) => { - // if (bridge.value) { - // bridge.value.fetchDataConfig(data, function (result) { - // resolve(result); - // }); - // } - - - // }); - // }; - - // // 查询获取主播的数据 - // const fetchDataCount = () => { - // return new Promise((resolve, reject) => { - // if (bridge.value) { - // bridge.value.fetchDataCount(function (result) { - // resolve(result); - // }); - // } - // }); - // }; - //删除前端储存数据 const deleteStorageData = (data) => { return new Promise((resolve, reject) => { @@ -112,18 +84,42 @@ export function usePythonBridge() { } }; - // // 登录tk后台 - // const loginBackStage = (data) => { - // if (bridge.value) { - // if (data.index == 0) { - // bridge.value.loginBackStage(JSON.stringify(data)); - // } else if (data.index == 1) { - // bridge.value.loginBackStageCopy(JSON.stringify(data)); - // } - - // } - // }; - + //指定直播间 + const Specifystreaming = (data) => { + return new Promise((resolve, reject) => { + if (pyBridge.value) { + pyBridge.value.find_big_brother_in_rooms(data,function (result) { + resolve(result); + }); + }else{ + console.log("pyBridge is null未连接上") + } + }); + }; + //储存直播间id + const setStorageStreamId = (data) => { + return new Promise((resolve, reject) => { + if (pyBridge.value) { + pyBridge.value.saveFrontString(JSON.stringify(data),function (result) { + resolve(result); + }); + }else{ + console.log("pyBridge is null未连接上") + } + }); + }; + //获取直播间id + const getStorageStreamId = (data) => { + return new Promise((resolve, reject) => { + if (pyBridge.value) { + pyBridge.value.loadFrontStringRaw(JSON.stringify(data),function (result) { + resolve(result); + }); + }else{ + console.log("pyBridge is null未连接上") + } + }); + }; //跳转到主播页面 const givePyAnchorId = (id) => { console.log("id",id); @@ -133,29 +129,6 @@ export function usePythonBridge() { } }; - // //查询登录状态 - // const backStageloginStatus = () => { - // return new Promise((resolve, reject) => { - // if (bridge.value) { - // bridge.value.backStageloginStatus(function (result) { - // resolve(result); - // }); - // } - // }); - - // }; - // //查询登录状态 - // const backStageloginStatusCopy = () => { - // return new Promise((resolve, reject) => { - // if (bridge.value) { - // bridge.value.backStageloginStatusCopy(function (result) { - // resolve(result); - // }); - // } - // }); - - // }; - //导出表格 const exportToExcel = (data) => { if (pyBridge .value) { @@ -194,5 +167,8 @@ export function usePythonBridge() { getStorageData, setStorageData, deleteStorageData, + Specifystreaming, + setStorageStreamId, + getStorageStreamId }; } \ No newline at end of file diff --git a/src/utils/storage.js b/src/utils/storage.js index f843818..feb4641 100644 --- a/src/utils/storage.js +++ b/src/utils/storage.js @@ -28,6 +28,13 @@ export async function getUser() { return JSON.parse(res); } +export function setuserprmisson() { + return new Promise((resolve, reject) => { + const res = getStorageData({ key: 'user' }); + resolve(res); + }); +} + export async function setNumData(numData) { const res = await setStorageData({key: 'num',data: numData}) } diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index e767a66..3a48527 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -141,7 +141,7 @@ const onSubmit = () => { }) .then((res) => { loading.close(); - console.log(res); + console.log("123123123123",res); setToken(res.tokenValue); tokenCache.setToken(res.tokenValue) userCache.setUser(res) diff --git a/src/views/hosts/Home.vue b/src/views/hosts/Home.vue new file mode 100644 index 0000000..5b7f867 --- /dev/null +++ b/src/views/hosts/Home.vue @@ -0,0 +1,77 @@ + + +// + + diff --git a/src/views/hosts/ai/LanguageManagement.vue b/src/views/hosts/ai/LanguageManagement.vue new file mode 100644 index 0000000..88e3e5a --- /dev/null +++ b/src/views/hosts/ai/LanguageManagement.vue @@ -0,0 +1,288 @@ + + + + + diff --git a/src/views/hosts/ai/scriptManagement.vue b/src/views/hosts/ai/scriptManagement.vue new file mode 100644 index 0000000..f146374 --- /dev/null +++ b/src/views/hosts/ai/scriptManagement.vue @@ -0,0 +1,416 @@ + + + + + diff --git a/src/views/hosts/hostsList.vue b/src/views/hosts/hostsList.vue index 320d754..5ef1f07 100644 --- a/src/views/hosts/hostsList.vue +++ b/src/views/hosts/hostsList.vue @@ -3,66 +3,78 @@
-
+ + -
- 当前网络:{{ countryData }} -
-
+ +
{{ streamdialogVisibletext ? '已指定直播间' : '指定直播间' }}
+ +
总数:{{ getBrotherInfodata.total }}
-
+
有效数:{{ getBrotherInfodata.valid }}
- 重置 - - 打开 TikTok 登录 - 查询 @@ -126,12 +135,26 @@ @click="filterdialogVisible = true" class="put-button buttoMore-filters" type="primary" - >
- 更多筛选 -
- + > +
更多筛选
+ + 打开 TikTok 登录 +
+ 当前网络:{{ countryData }} +
+
+ 运行时间:{{ String(hourstuo).padStart(2, '0') }}:{{ String(minutestuo).padStart(2, '0') }}:{{ String(secondstuo).padStart(2, '0') }} +
@@ -145,7 +168,7 @@ > - + + + +
+ + +
+
@@ -302,7 +343,10 @@ import { } from "@/api/account"; import { usePythonBridge } from "@/utils/pythonBridge"; import { getUser, setSerch, getSerch } from "@/utils/storage"; -import { ref, reactive, onMounted } from "vue"; +import { ref, reactive, onMounted, onBeforeUnmount } from "vue"; +const hourstuo = ref(0); +const minutestuo = ref(0); +const secondstuo = ref(0); import EChartsComponent from "@/components/EChartsComponent.vue"; import { ElMessage, ElMessageBox } from "element-plus"; import { color } from "echarts"; @@ -310,6 +354,8 @@ import { getCountryName } from "@/utils/countryUtil"; import { ElLoading } from "element-plus"; //ip国家 let countryData = ref(""); +//获取屏幕宽度 +const screenWidth = ref(window.innerWidth / 11); //获取国家 const getIpInfo = async () => { try { @@ -354,7 +400,9 @@ const queryFormData = ref({ coinMax: "", levelMin: "", levelMax: "", + isFilter: false, isRunning: true, + anchor_ids: [], }); //时间 const timerId = ref(null); @@ -363,15 +411,64 @@ const getBrotherInfodata = ref({ valid: 0, }); +//结束爬取 function BigBrotherstop() { + const loading = ElLoading.service({ + lock: true, + text: "正在停止...", + background: "rgba(0, 0, 0, 0.7)", + }); + stopTimerfun(); + isRunnings.value = false; queryFormData.value.tenantId = userInfo.value.tenantId; queryFormData.value.region = countryData.value; + controlTask(JSON.stringify(queryFormData.value)).then((res) => { queryFormData.value.isRunning = true; clearInterval(timerId.value); timerId.value = null; + loading.close(); + }); + Specifystreaming(JSON.stringify(queryFormData.value)).then((res) => { + queryFormData.value.isRunning = true; + clearInterval(timerId.value); + timerId.value = null; + loading.close(); }); } +//指定直播间 +function specifyClick() { + if (textarea.value == "") { + ElMessage({ + type: "error", + message: "请输入直播间id", + }); + return; + } + setStorageStreamId(textarea.value).then((res) => { + }); + queryFormData.value.anchor_ids = textarea.value.split("\n"); + streamdialogVisible.value = false; + streamdialogVisibletext.value = true; +} +//指定直播间重置 +function specifyreset() { + textarea.value = ""; + streamdialogVisibletext.value = false; + queryFormData.value.anchor_ids = [] +} +//指定直播间取消 +function specifyCancel() { + streamdialogVisible.value = false; + streamdialogVisibletext.value = false; + queryFormData.value.anchor_ids = [] +} +//输入框input +function handleInput() { + streamdialogVisibletext.value = false; +} +//获取主播列表 +//开始爬取 function getBigBrother() { const loading = ElLoading.service({ lock: true, @@ -380,15 +477,29 @@ function getBigBrother() { }); queryFormData.value.tenantId = userInfo.value.tenantId; queryFormData.value.region = countryData.value; - controlTask(JSON.stringify(queryFormData.value)).then((res) => { - queryFormData.value.isRunning = false; - timerId.value = setInterval(() => { - getBrotherInfo().then((res) => { - loading.close(); - getBrotherInfodata.value = res; - }); - }, 1000); - }); + startTimerfun(); + isRunnings.value = true; + if (queryFormData.value.anchor_ids == [] || queryFormData.value.anchor_ids == null || queryFormData.value.anchor_ids == undefined || queryFormData.value.anchor_ids.length == "") { + controlTask(JSON.stringify(queryFormData.value)).then((res) => { + queryFormData.value.isRunning = false; + timerId.value = setInterval(() => { + getBrotherInfo().then((res) => { + loading.close(); + getBrotherInfodata.value = res; + }); + }, 1000); + }); + } else { + Specifystreaming(JSON.stringify(queryFormData.value)).then((res) => { + queryFormData.value.isRunning = false; + timerId.value = setInterval(() => { + getBrotherInfo().then((res) => { + loading.close(); + getBrotherInfodata.value = res; + }); + }, 1000); + }); + } } const loading = ref(false); @@ -399,6 +510,9 @@ const { loginTikTok, controlTask, getBrotherInfo, + Specifystreaming, + setStorageStreamId, + getStorageStreamId } = usePythonBridge(); let num = ref(0); @@ -409,8 +523,8 @@ const multipleTableRef = ref(null); let labelList = ref([ { paramCode: "userIdStr", paramCodeMeaning: "用户id" }, { paramCode: "level", paramCodeMeaning: "等级" }, + { paramCode: "fansLevel", paramCodeMeaning: "粉丝团等级" }, { paramCode: "hostcoins", paramCodeMeaning: "打赏的金币" }, - { paramCode: "totalGiftCoins", paramCodeMeaning: "最低打赏金币数" }, { paramCode: "hostDisplayId", paramCodeMeaning: "所在直播间主播id" }, { paramCode: "region", paramCodeMeaning: "地区" }, { paramCode: "followerCount", paramCodeMeaning: "粉丝数" }, @@ -426,8 +540,7 @@ const createTimes = ref([]); const page = ref(1); const pageSize = ref(10); const fields = [ - { label: "打赏的金币", minModel: "hostcoinsMin", maxModel: "hostcoinsMax" }, - { label: "打赏金币总和", minModel: "totalGiftCoinsMin", maxModel: "totalGiftCoinsMax" }, + // { label: "打赏的金币", minModel: "hostcoinsMin", maxModel: "hostcoinsMax" }, { label: "等级", minModel: "levelMin", maxModel: "levelMax" }, ]; //排序 @@ -440,23 +553,14 @@ let sortNameOptions = ref([ { label: "打赏金币总和", type: "totalGiftCoins" }, { label: "等级", type: "level" }, ]); -//员工选择列表 -let staffOptions = ref([]); -//筛选条件选择列表 - -//选择的员工 -let staffValue = ref(""); -//选择的主播列表 -let selectHostList = ref([]); -//分配弹窗是否弹出 -let dialogFormVisible = ref(false); -//分配情况弹窗是否弹出 -let hostNameVisible = ref(false); - -//备注弹窗是否弹出 -let commentVisible = ref(false); -//筛选弹窗是否弹出 -let filterdialogVisible = ref(false); +//是否在运行 +let isRunnings = ref(false); +//是否指定直播间 +let streamdialogVisibletext = ref(false); +//指定直播间弹窗 +let streamdialogVisible = ref(false); +//指定直播间id +let textarea = ref(""); //分配的员工 let staffId = ref({}); //备注信息 @@ -473,10 +577,38 @@ let options = ref([]); let version = ref("0.0.0"); onMounted(() => { + window.addEventListener("resize", handleResize); setTimeout(() => { getUserdata(); + getStorageStreamId(1).then((res) => { + textarea.value = res == "" ? "" : JSON.parse(res); + }); }, 500); }); +// 启动计时器 +function startTimerfun() { + startTime.value = setInterval(() => { + secondstuo.value++; + if (secondstuo.value >= 60) { + secondstuo.value = 0; + minutestuo.value++; + if (minutestuo.value >= 60) { + minutestuo.value = 0; + hourstuo.value++; + } + } + }, 1000); +} +// 停止计时器 +function stopTimerfun() { + clearInterval(startTime.value); +} + + +//表格单元格长度判断 +function handleResize() { + screenWidth.value = window.innerWidth / 11; +} async function getUserdata() { const User = await getUser(); @@ -492,21 +624,7 @@ function serch() { } function exportList() { - // if (searchForm.value.dataType == "InvitationType") { - // searchForm.value.dataEnd = searchForm.value.dataStart; - // } exportToExcel(requestParams.value); - - // //浏览器导出方法 - // downList('export/hostsinfo', - // { - // searchTime: searchForm.value.time, - // region: searchForm.value.country, - // pageSize: pageSize.value, - // page: page.value, - // userId: userInfo.value.userId, - // } - // ); } //分页每页条数 function handleSizeChange(val) { @@ -562,6 +680,7 @@ const getlist = () => { total.value = Number(res.total); tableData.value = res.records.map((item) => ({ level: item.level, // 等级 + fansLevel: item.fansLevel, // 粉丝团等级 createTime: formatDate(new Date(item.createTime)), // 创建时间 followerCount: item.followerCount, // 粉丝数 followingCount: item.followingCount, // 关注数 @@ -578,45 +697,18 @@ const getlist = () => { function handelClick() { filterdialogVisible.value = false; } + function reset() { searchForm.value = {}; sortData.value = { sortName: "createTime", sort: "desc" }; createTimes.value = []; } + function handleClose(done) { console.log("关闭"); done(); } -//修改主播维护状态 -// function handleSelectChange(event, data) { - -// upholdinfo({ -// "hostId": data.hostId, -// "userId": userInfo.value.userId, -// "tenantId": userInfo.value.tenantId, -// // "comment": "我已经尽力维护,但是失败了", -// "useable": event.target.value -// }).then(res => { -// console.log(res) -// }) -// } - -//更改主播维护备注 - -// function uphostcomment() { -// upholdinfo({ -// "hostId": commentHost.value, -// "userId": userInfo.value.userId, -// "tenantId": userInfo.value.tenantId, -// "comment": commentInfo.value, -// }).then(res => { -// console.log(res) -// serch() -// commentVisible.value = false -// }) -// } - function filterTag(value, row) { console.log(row.useable, value); return row.useable === value; @@ -626,7 +718,6 @@ function filterTag(value, row) { function getCountry() { getCountryinfo({}) .then((res) => { - console.log("````````国家`````````", res); res.forEach((item) => { if (item.countryGroupName) { options.value.push({ @@ -635,60 +726,12 @@ function getCountry() { }); } }); - console.log("````````国家2`````````", options.value); }) .catch((err) => { console.log("getCountry", err); }); } -//获取下级员工 -// const getStaff = () => { -// getStaffList({ -// userId: userInfo.value.userId, -// activeYn: userInfo.value.activeYn, -// tenantId: userInfo.value.tenantId, -// }).then(res => { -// console.log(res) -// res.forEach(item => { -// staffOptions.value.push({ -// value: item.userId, -// label: item.userName -// }) -// }) -// }) -// } - -// //分配主播给员工 -// function allocation() { -// managerhosts({ -// "manaId": userInfo.value.userId, -// "userId": staffValue.value, -// "tenantId": userInfo.value.tenantId, -// "hostIds": selectHostList.value -// }).then(res => { -// if (res) { -// dialogFormVisible.value = false - -// } -// }) -// } - -//获取主播信息 -// const getTkhostdetail = (id) => { -// tkhostdetail({ -// hostId: id, -// // page: 1, -// searchTimeStart: '20250401', -// searchTimeEnd: '20250403' -// }).then(res => { - -// console.log(labelList.value) - -// }) - -// } - function openPopover(hostId, paramCode) { isPopoverVisible[`${hostId}-${paramCode}`] = true; } @@ -701,30 +744,7 @@ function openHTML(id) { console.log(id); givePyAnchorId(id); - - // upholdinfo({ - // "hostId": id, - // "userId": userInfo.value.userId, - // "tenantId": userInfo.value.tenantId, - // // "comment": "我已经尽力维护,但是失败了", - // "useable": "Y" - // }).then(res => { - - // getlist(); - // }) } - -// function openAccountName(idStr) { -// if (idStr) { -// hostNameVisible.value = true -// accountName(idStr).then(res => { -// staffId.value = JSON.stringify(res).replace(/[{}"]/g, '') // 移除所有 {} 和 " -// .split(',') // 按逗号分割成数组 - -// console.log(res) -// }) -// } -// } diff --git a/src/views/hosts/mini/miniAM.vue b/src/views/hosts/mini/miniAM.vue new file mode 100644 index 0000000..e4472d9 --- /dev/null +++ b/src/views/hosts/mini/miniAM.vue @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file diff --git a/src/views/hosts/mini/miniIntegral.vue b/src/views/hosts/mini/miniIntegral.vue new file mode 100644 index 0000000..c3da9ed --- /dev/null +++ b/src/views/hosts/mini/miniIntegral.vue @@ -0,0 +1,315 @@ + + + + + diff --git a/src/views/nav.vue b/src/views/nav.vue index 3806ae4..e835324 100644 --- a/src/views/nav.vue +++ b/src/views/nav.vue @@ -9,32 +9,46 @@
- -
+ @@ -45,6 +59,11 @@ html { margin: 0; padding: 0; height: 100%; + /* 页面无法选中 */ + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } .app-container { @@ -77,7 +96,7 @@ html { margin-left: 25px; margin-right: 25px; width: 1540px; - height: 868px; + height: 848px; background: #FFFFFF; border-radius: 36px; margin-top: 16px; @@ -88,4 +107,11 @@ html { justify-content: space-around; align-items: center; } +.footer{ + position: absolute; + bottom: 10px; + left: calc(50% - 150px); + color: aqua; + font-size: 16px; +} \ No newline at end of file