From 6120b17c08c3651e6b7e3cae113837f295297c54 Mon Sep 17 00:00:00 2001 From: Zhang Ziyu <1772127579@qq.com> Date: Tue, 30 May 2023 10:58:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=B7=A5=E4=BD=9C=E7=A7=8D?= =?UTF-8?q?=E7=B1=BB=E5=92=8C=E5=9F=8E=E5=B8=82=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.js | 34 + src/components/Checkbox-Transfer.vue | 16 +- src/components/Input-Search.vue | 2 +- src/components/Loading/Loading.vue | 2 +- src/components/Loading/main.js | 207 +- src/main.js | 4 +- src/views/Home/Home.vue | 166 +- src/views/JobDetail/JobDetail.vue | 154 +- src/views/Jobs/Jobs.vue | 2965 +------------------------- src/views/Login/Login.vue | 2 +- src/views/Products/Products.vue | 108 +- 11 files changed, 285 insertions(+), 3375 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index 70d3c28..33a16c9 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -4,15 +4,49 @@ import request from "./request.js"; export default { + // 登录 login: (data) => request({ url: '/login/', method: 'post', data: data }), + // 注册 sign: (data) => request({ url: '/sign/', method: 'post', data: data + }), + + // 获取产品列表 + getProductList: (data) => request({ + url: '/product/', + method: 'get', + data: data + }), + + // 获取岗位种类 + getCategory: () => request({ + url: '/category/', + method: 'get', + }), + + // 获取城市列表 + getCity: () => request({ + url: '/city/', + method: 'get', + }), + + // 获取岗位信息 + getJobList: (data) => request({ + url: '/job/', + method: 'post', + data: data, + }), + + // 获取某个岗位详情 + getJobDetail: (id) => request({ + url: `/job_detail/${id}`, + method: 'get', }) } \ No newline at end of file diff --git a/src/components/Checkbox-Transfer.vue b/src/components/Checkbox-Transfer.vue index 51e16f8..d6d0c0b 100644 --- a/src/components/Checkbox-Transfer.vue +++ b/src/components/Checkbox-Transfer.vue @@ -73,6 +73,8 @@ const prop = defineProps({ }, }) +const emit = defineEmits(['update:modelValue']) + const {title, targetCount, data, modelValue, props} = toRefs(prop) // 计算属性 @@ -102,16 +104,9 @@ const placeholder = computed(() => { return !focusing.value ? "更多" : "搜索" }) + // 监视函数 watch(data, (newValue, oldValue) => { - -}) - -onMounted(() => { - changeTargets() -}) - -const changeTargets = () => { targets.value = data.value.slice(0, 6).map(item => item[props.value.key]); checked.value.length = targets.value.length; modelValue.value.forEach(key => { @@ -120,7 +115,8 @@ const changeTargets = () => { checked.value.push(true); } }); -} +}) + // 事件 const clearChecked = () => { @@ -158,7 +154,7 @@ const check = (item, e) => { EventBus.emit("check", e.target.checked) EventBus.emit("check", item[props.value.key]) - EventBus.emit("input", modelValue.value) + emit('update:modelValue', modelValue.value) } \ No newline at end of file diff --git a/src/views/Login/Login.vue b/src/views/Login/Login.vue index 8d46845..e6eb25b 100644 --- a/src/views/Login/Login.vue +++ b/src/views/Login/Login.vue @@ -121,7 +121,7 @@ const svg = ` ` const changeLogin = () => { - const loadingInstance1 = ElLoading.service({spinner: svg, fullscreen: true}) + const loadingInstance1 = ElLoading.service({fullscreen: true, text: '加载中...'}) setTimeout(() => { isLogin.value = !isLogin.value loadingInstance1.close() diff --git a/src/views/Products/Products.vue b/src/views/Products/Products.vue index f028f1f..2b8b7aa 100644 --- a/src/views/Products/Products.vue +++ b/src/views/Products/Products.vue @@ -44,97 +44,8 @@ import {useRoute} from "vue-router"; const route = useRoute() const {proxy} = getCurrentInstance() // 产品列表 -const products = ref([ - { - "name": "faceu", - "title": "激萌", - "logo": "//sf3-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/Faceu2x_1574665474719.png", - "cover": "//sf1-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/jimeng.jpeg", - "description": "Faceu激萌,4 亿年轻人都爱用的卖萌自拍神器。", - "subDescription": "一款能社交的 AR 相机,海量酷炫贴纸、 激萌表情包 、实时美颜、 趣味特效让聊天姿势更丰富更有趣,满足全方位拍摄需求。累计用户量超过 4 亿, 平均每天为用户提供 1.7 亿次拍摄服务。", - "id": 1, - "link": "https://www.faceu.com" - }, - { - "name": "lightFaceCamera", - "title": "轻颜相机", - "logo": "https://sf6-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/qingyan_square_logo_1577262252373.png", - "cover": "//sf1-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/qingyan-bg2.jpg", - "description": "轻颜相机是一款主打高级感的质感自拍相机,连续霸榜应用商店。拥有时下最流行的滤镜、美颜效果、和海量拍照“姿势”模板,一键就能 get 潮流自拍。", - "subDescription": "", - "id": 2, - "link": "https://m.ulikecam.com/" - }, - { - "name": "headNews", - "title": "今日头条", - "logo": "https://sf1-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/toutiao_square_logo_1577262251819.png", - "cover": "//sf1-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/toutiao_new_2.png", - "description": "今日头条是一款个性化资讯推荐引擎产品,致力于连接人与信息,让优质、丰富的信息得到高效、精准的分发,为用户创造价值。", - "subDescription": "今日头条目前拥有科技、体育、健康、美食、教育、三农、国风、NBA 等超过 100 个垂直领域,覆盖了图文、图集、小视频、短视频、短内容、直播、小程序等多种信息体裁。", - "id": 3, - "link": "https://m.ulikecam.com/" - }, - { - "name": "trillShortVideo", - "title": "抖音短视频", - "logo": "https://sf1-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/douyin_square_logo_1577262251779.png", - "cover": "//sf1-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/douyin-bg2.jpg", - "description": "抖音是一个帮助用户表达自我,记录美好生活的短视频平台。截至 2020 年 1 月,日活跃用户数已经突破 4 亿,并继续保持高速增长。", - "subDescription": "", - "id": 4, - "link": "https://douyin.com/" - }, - { - "name": "trillShortVideo", - "title": "西瓜视频", - "logo": "https://sf6-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/xigua_square_logo_1577262253312.png", - "cover": "//sf1-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/xigua-bg2.jpg", - "description": "西瓜视频是字节跳动旗下的一款视频 App,作为聚合多元文化的综合视频平台,它通过个性化推荐,源源不断地为不同人群提供丰富的优质内容,同时鼓励多样化创作,帮助人们轻松地向全世界分享视频作品。", - "subDescription": "目前西瓜视频累计用户数超过 3.5 亿,日均播放量超过 40 亿。", - "id": 5, - "link": "https://ixigua.com/" - }, - { - "name": "trillShortVideo", - "title": "懂车帝", - "logo": "https://sf6-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/dongchedi_square_logo_1577262251826.png", - "cover": "//sf1-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/dongche-bg2.jpg", - "description": "懂车帝是“看车、选车、买车”一站式汽车媒体和服务平台,产品基于个性化推荐引擎帮助用户发现感兴趣的汽车内容,同时配有车型库、360 度全景看车等选车工具,首创短视频社区“车友圈”,为用户打造内容 + 社区 + 工具的多元生态。目前,懂车帝已经成长为增长最快的汽车类手机应用。", - "subDescription": "目前西瓜视频累计用户数超过 3.5 亿,日均播放量超过 40 亿。", - "id": 6, - "link": "https://www.dongchediapp.com/" - }, - { - "name": "gogokid", - "logo": "https://sf6-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/gogokid_square_logo_1577262251773.png", - "title": "GoGoKid", - "id": 7, - "description": "GoGokid 是一个面向 4 - 12 岁孩子的在线少儿英语 1 对 1学习平台。主打 100% 纯北美外教;教材对标美国小学主流课标(CCSS),融入 SED(社交情商培养)、多元智能理论,为中国孩子带来高效的英语学习体验。", - "cover": "//sf1-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/gogokid-bg2.jpg", - "link": "https://www.gogokid.com.cn" - }, - { - "name": "naughtyShrimp", - "logo": "https://sf6-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/pipixia_square_logo_1577262251826.png", - "title": "皮皮虾", - "id": 8, - "description": "今日头条官方爆笑社区,一个只要打开就能让你笑到停不下来的 App。", - "cover": "//sf1-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/pipi_new.png", - "subDescription": "皮皮虾一直坚持「传播快乐,分享生活」的目标,以特有的「神评」玩法形成了独特的社区氛围。之后,皮皮虾将不断提供更多有趣的功能,帮助用户创造出更多优质的内容。", - "link": "https://mp.pipix.com" - }, - { - "name": "urgentLetter", - "logo": "https://sf6-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/feishu_squre.png", - "title": "飞书", - "id": 9, - "description": "飞书是新一代企业办公套件,整合即时沟通、日历、音视频会议、在线文档、云盘、工作台等功能于一体,为企业提供全方位协作解决方案,成就组织和个人,更高效、更愉悦。", - "cover": "//sf1-ttcdn-tos.pstatp.com/obj/ttfe/ATSX/mainland/feishu_bg.jpg", - "subDescription": "", - "link": "https://www.feishu.com" - } -]) +const products = ref([]) + const activeIndex = ref(0) const loading = ref(false) const scrolling = ref(false) @@ -144,10 +55,6 @@ const transitionName = ref("") // created生命周期钩子 --- vue3setup // loading.value = true -if (route.query.id) { - activeIndex.value = products.value.findIndex(item => item.id == route.query.id) -} - // 方法 const mousewheelHandler = (e) => { if (this.scrolling) { @@ -173,6 +80,7 @@ const mousewheelHandler = (e) => { onMounted(() => { window.addEventListener("mousewheel", mousewheelHandler); + getProductList() }) onUnmounted(() => { @@ -194,9 +102,19 @@ watch(activeIndex, (newValue, oldValue) => { // 计算属性 const item = computed(() => { + // console.log(activeIndex.value) return products.value[activeIndex.value] || {}; }) +// 获取产品列表 +const getProductList = async () => { + let res = await proxy.$api.getProductList({}) + products.value = res.data + if (route.query.id) { + activeIndex.value = products.value.findIndex(item => item.nid == route.query.id) + } +} +