From 28f24a90fdd7a644c9cf47381e37ef7c079f4159 Mon Sep 17 00:00:00 2001 From: xuli3099 Date: Wed, 13 Aug 2025 18:15:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/auth.js | 15 +- src/api/business.js | 10 +- src/api/home.js | 29 ++-- src/api/notice.js | 2 +- src/pages.json | 6 + src/pages/business/CRM/visitorReport.vue | 57 ++++++- src/pages/business/business.vue | 33 ++-- src/pages/business/editDaily.vue | 68 ++++++-- src/pages/deviceAuth/deviceAuth.vue | 156 +++++++----------- src/pages/h5-webview/h5-webview.vue | 74 +++++++++ src/pages/home/home.vue | 73 ++++---- src/pages/login/login.vue | 2 +- src/pages/notice/notice.vue | 113 +++++++------ src/pages/userinfo/userinfo.vue | 115 ++++++++----- .../images/{notice => }/icon-clean@2x.png | Bin src/utils/cache.js | 8 +- src/utils/common.js | 12 ++ src/utils/request/index.js | 23 +-- 18 files changed, 516 insertions(+), 280 deletions(-) create mode 100644 src/pages/h5-webview/h5-webview.vue rename src/static/images/{notice => }/icon-clean@2x.png (100%) create mode 100644 src/utils/common.js diff --git a/src/api/auth.js b/src/api/auth.js index bea530e..3a69f97 100644 --- a/src/api/auth.js +++ b/src/api/auth.js @@ -56,14 +56,19 @@ export function logout(data) { data }) } - + // 获取用户信息 export function getUserInfo(data) { - return request.post({ - url: '/api/getUserInfo', + return request.get({ + url: '/acc/profile/userInfo', data }) } - - +// 查询当前用户常用功能 +export function getUserFavorite(data) { + return request.post({ + url: '/acc/profile/favorite', + data + }) +} \ No newline at end of file diff --git a/src/api/business.js b/src/api/business.js index ffd690b..0cfa79b 100644 --- a/src/api/business.js +++ b/src/api/business.js @@ -8,18 +8,18 @@ export function search(data) { }) } -// 业务列表 +// 查询当前用户业务列表 export function businessList(data) { return request.post({ - url: '/api/businessList', + url: '/acc/profile/bizList', data }) } -// 企业日常 -export function businessDaily(data) { +// 设置常用服务 +export function bizFavoriteSetting(data) { return request.post({ - url: '/api/businessDaily', + url: '/acc/biz/favoriteSetting', data }) } diff --git a/src/api/home.js b/src/api/home.js index b4ed762..53ac2c5 100644 --- a/src/api/home.js +++ b/src/api/home.js @@ -1,9 +1,24 @@ import request from "@/utils/request" -// 待办数据查询 -export function backBlogCount(data) { +// 待办数据查询 获取用户消息的待阅和已阅数量 +export function messageNotifyCount(data) { + return request.get({ + url: '/acc/message/notify/count', + data + }) +} +// 获取用户审批的待办和已办数量 +export function messageFlowCount(data) { + return request.get({ + url: '/acc/message/flow/count', + data + }) +} + +// 常用服务 +export function getUserFavorite(data) { return request.post({ - url: '/api/backBlogCount', + url: '/acc/profile/favorite', data }) } @@ -32,13 +47,7 @@ export function salesTask(data) { }) } -// 常用服务 -export function commonServices(data) { - return request.post({ - url: '/api/commonServices', - data - }) -} + // 新闻公告 export function newsQueryList(data) { diff --git a/src/api/notice.js b/src/api/notice.js index 4cec826..483f367 100644 --- a/src/api/notice.js +++ b/src/api/notice.js @@ -3,7 +3,7 @@ import request from "@/utils/request" // 查询通知列表 export function noticeList(data) { return request.post({ - url: '/api/noticeList', + url: '/acc/message/notify/detail', data }) } \ No newline at end of file diff --git a/src/pages.json b/src/pages.json index 491b6a5..5e726d4 100644 --- a/src/pages.json +++ b/src/pages.json @@ -132,6 +132,12 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path": "pages/h5-webview/h5-webview", + "style": { + "navigationBarTitleText": "" + } } ], "globalStyle": { diff --git a/src/pages/business/CRM/visitorReport.vue b/src/pages/business/CRM/visitorReport.vue index df7bb38..c70e475 100644 --- a/src/pages/business/CRM/visitorReport.vue +++ b/src/pages/business/CRM/visitorReport.vue @@ -149,7 +149,62 @@ const getVisitorReportList = (pageIndex, pageSize) => { pageSize } - let res = await visitorReportList(param); + // let res = await visitorReportList(param); + let res = { + list:[ + { + id:1,title:'客户:北京中科睿信科技有限公司',name:'YS-VR2025091515', + reportType:1,reportTypeName:'I 类活动 (走访)',statusName:'待胡本华审核', + reportPeople:'管理员',dateStr:'2025-09-15' + }, + { + id:2,title:'客户:中国船舶集团有限公司第七一 七研究所',name:'YS-VR2025091307', + reportType:1,reportTypeName:'I 类活动 (走访)',statusName:'待胡本华审核', + reportPeople:'管理员',dateStr:'2025-09-15' + }, + { + id:3,title:'客户:旭日阳(北京)科技有限公司',name:'YS-VR2025090902', + reportType:1,reportTypeName:'I 类活动 (走访)',statusName:'待审核', + reportPeople:'管理员',dateStr:'2025-09-15' + }, + { + id:4,title:'客户:北京中科睿信科技有限公司',name:'YS-VR2025091515', + reportType:1,reportTypeName:'I 类活动 (走访)',statusName:'待胡本华审核', + reportPeople:'管理员',dateStr:'2025-09-15' + }, + { + id:5,title:'客户:北京中科睿信科技有限公司',name:'YS-VR2025091515', + reportType:1,reportTypeName:'I 类活动 (走访)',statusName:'待胡本华审核', + reportPeople:'管理员',dateStr:'2025-09-15' + }, + { + id:6,title:'客户:北京中科睿信科技有限公司',name:'YS-VR2025091515', + reportType:1,reportTypeName:'I 类活动 (走访)',statusName:'待胡本华审核', + reportPeople:'管理员',dateStr:'2025-09-15' + }, + { + id:7,title:'客户:北京中科睿信科技有限公司',name:'YS-VR2025091515', + reportType:1,reportTypeName:'I 类活动 (走访)',statusName:'待胡本华审核', + reportPeople:'管理员',dateStr:'2025-09-15' + }, + { + id:8,title:'客户:北京中科睿信科技有限公司',name:'YS-VR2025091515', + reportType:1,reportTypeName:'I 类活动 (走访)',statusName:'待胡本华审核', + reportPeople:'管理员',dateStr:'2025-09-15' + }, + { + id:9,title:'客户:北京中科睿信科技有限公司',name:'YS-VR2025091515', + reportType:1,reportTypeName:'I 类活动 (走访)',statusName:'待胡本华审核', + reportPeople:'管理员',dateStr:'2025-09-15' + }, + { + id:10,title:'客户:北京中科睿信科技有限公司',name:'YS-VR2025091515', + reportType:1,reportTypeName:'I 类活动 (走访)',statusName:'待胡本华审核', + reportPeople:'管理员',dateStr:'2025-09-15' + } + ], + totalCount:14 + } resolve({ list: res.list, total: res.totalCount diff --git a/src/pages/business/business.vue b/src/pages/business/business.vue index e2cc0d5..67d2ff6 100644 --- a/src/pages/business/business.vue +++ b/src/pages/business/business.vue @@ -39,9 +39,9 @@ - - + + {{ item2.bizName }} @@ -63,27 +63,37 @@ import customHeader from '@/components/customHeader.vue' import MescrollUni from 'mescroll-uni/mescroll-uni.vue'; import { getNavBarPaddingTop} from '@/utils/system.js' import { businessList } from '@/api/business.js'; +import {showLoading,hideLoading} from '@/utils/message.js' +import { initTree } from '@/utils/common.js' onLoad(async(opt) => { uni.setStorageSync('page_cache',true); + try { + showLoading("加载中...") + getList(); + hideLoading(); + } catch (error) { + hideLoading(); + } }) // 获取导航栏高度用于内容区域padding const navBarPaddingTop = ref(0); onMounted(() => { navBarPaddingTop.value = getNavBarPaddingTop()*2; - getList(); }) // 查询列表 let list = ref([]); let getList = async()=>{ - let res = await businessList({}); - let arr = res.list || []; - arr.forEach(item => { + + let res = await businessList({});//查询所有业务 + let arr = res || []; + let bizList = initTree(arr,0,'bizId');//递归获取数组处理 + bizList.forEach(item => { item.expandFlag = false; }); - list.value = arr; + list.value = bizList; } // 右侧展开 @@ -116,9 +126,10 @@ const downOption = ref({ // 下拉刷新 const downCallback = async (mescroll) => { try { - setTimeout(async ()=>{ - // mescroll.resetUpScroll(); - },500); + getList(); + // setTimeout(async ()=>{ + // // mescroll.resetUpScroll(); + // },500); } catch (error) { mescroll.endErr(); } finally { diff --git a/src/pages/business/editDaily.vue b/src/pages/business/editDaily.vue index ce2220f..0b81ffe 100644 --- a/src/pages/business/editDaily.vue +++ b/src/pages/business/editDaily.vue @@ -46,25 +46,58 @@ import { onLoad } from '@dcloudio/uni-app'; import customHeader from '@/components/customHeader.vue' import MescrollUni from 'mescroll-uni/mescroll-uni.vue'; import { getNavBarPaddingTop} from '@/utils/system.js' -import { businessList } from '@/api/business.js'; +import { businessList,bizFavoriteSetting } from '@/api/business.js'; +import { getUserFavorite } from '@/api/home.js'; +import {showLoading,hideLoading,showAlert} from '@/utils/message.js' +import { initTree } from '@/utils/common.js' + +// 初始化加载 +onLoad(async(opt) => { + uni.setStorageSync('page_cache',true); + try { + showLoading("加载中...") + getList(); + hideLoading(); + } catch (error) { + hideLoading(); + } +}) // 获取导航栏高度用于内容区域padding const navBarPaddingTop = ref(0); onMounted(() => { navBarPaddingTop.value = getNavBarPaddingTop()*2; - getList(); }) // 查询列表 let list = ref([]); -let count = ref(7); +let count = ref(0); let getList = async()=>{ - let res = await businessList({}); - let arr = res.list || []; - arr.forEach(item => { + let arrNew = []; + let res = await businessList({});//查询所有业务 + let arr = res || []; + + let res2 = await getUserFavorite({});//查询当前用户的常用服务 + let bizIdListStr = res2.bizIdList || ''; + let arr2 = bizIdListStr.split(","); + count.value = arr2.length; + + arr.forEach(item=>{ + item.isDaily=false; + arr2.forEach(item2=>{ + if(item2==item.bizId){ + item.isDaily=true; + } + }) + arrNew.push(item) + }) + + let bizList = initTree(arrNew,0,'bizId');//递归获取数组处理 + bizList.forEach(item => { item.expandFlag = false; }); - list.value = arr; + list.value = bizList; + console.log("list=>",list.value) } // 下拉刷新 @@ -94,20 +127,35 @@ const downCallback = async (mescroll) => { } } +let bizIds = ref([]); // 选择常用 const handleCheck=(item)=>{ item.isDaily = !item.isDaily; if(item.isDaily){ count.value++; + bizIds.value.push(item.bizId); }else{ count.value--; + const index = bizIds.value.findIndex(item2 => item2.bizId === item.bizId); + if (index !== -1) { + bizIds.value.splice(index, 1); + } } - + + console.log("bizIds=>",bizIds.value) } // 提交 -const handleSubmit=(item)=>{ - +const handleSubmit= async()=>{ + try { + showLoading("加载中...") + console.log("bizIds=>",bizIds.value) + await bizFavoriteSetting({bizIds:bizIds.value.join(",")}); + showAlert("操作成功") + hideLoading(); + } catch (error) { + hideLoading(); + } } diff --git a/src/pages/deviceAuth/deviceAuth.vue b/src/pages/deviceAuth/deviceAuth.vue index a4aef7e..3d2cf17 100644 --- a/src/pages/deviceAuth/deviceAuth.vue +++ b/src/pages/deviceAuth/deviceAuth.vue @@ -1,6 +1,6 @@