Commit 9b117cc0 by Jaxon

feat(服务中心): 新增企业通知模块及相关页面组件

- 新增服务中心模块,包含企业通知列表、详情页及滚动列表组件
- 添加企业通知枚举类型和API接口定义
- 在工作台菜单中添加服务中心入口,并支持未读消息提示
- 优化jsconfig配置,支持路径别名和ES2020语法
- 修复项目配置,移除SCSS文件忽略规则
- 格式化代码,统一缩进和引号风格
1 parent 64e4d047
import api from "~/utils/request/request.js";
/**
* 模块类型枚举说明:
* - 0: 系统通知
* - 1: 优秀话术
* - 2: 话术预警
* - 3: ai导师(短课程)
* - 4: 学习任务(长课程)
* - 5: 活动中心
* - 6: 学习类策略
* - 7: 优秀案例分享策略
* - 8: 任务型策略
* @typedef {0|1|2|3|4|5|6|7|8} ModuleType
*/
/**
* 业务场景枚举说明:
* - 0: 延保
* - 1: 精品
* - 2: 权益
* @typedef {0|1|2} BusinessType
*/
/**
* @typedef {Object} NewPadMessageBoxDTO
* @property {number} [id]
* @property {ModuleType} [moduleType] 模块分类
* @property {BusinessType} [businessType] 业务场景
* @property {string} [uuid]
* @property {string} [phone]
* @property {string} [name]
* @property {number} [status] 查看状态:0-待查看,1-已查看
* @property {string} [createdBy]
* @property {string} [createdTime]
* @property {string} [updatedBy]
* @property {string} [updatedTime]
* @property {string} [delFlag]
* @property {number} [popupCount]
* @property {string} [readType] 阅读模式:0不强制,1首次强制,2每日强制
* @property {number} [readCount]
* @property {string} [latestReadTime]
* @property {string} [reminderType] 提醒类型:1-首次提醒,2-进度提醒
* @property {string} [msgTitle] 消息标题
* @property {string} [taskStartTime] 任务类型消息-任务开始时间 yyyy-MM-dd HH:mm:ss
* @property {string} [startEndTime] 任务类型消息-任务结束时间 yyyy-MM-dd HH:mm:ss
* @property {Object} [msgDetail] 消息详情-业务方消息详情。根据moduleType返回不同数据结构
*/
/**
* @typedef {Object} RpcPagination
* @property {number} [pageNum]
* @property {number} [pageSize]
* @property {number} [startRow]
* @property {number} [endRow]
* @property {number} [total]
* @property {number} [pages]
* @property {Array<NewPadMessageBoxDTO>} [list]
* @property {NewPadMessageBoxDTO} [condition]
* @property {boolean} [needCount]
*/
/**
* 获取公司公告分页列表
* @param {Object} data - 请求参数
* @param {number} [data.pageNum=1] 当前页码
* @param {number} [data.pageSize=10] 每页条数
* @param {ModuleType} [data.moduleType] 模块分类
* @param {BusinessType} [data.businessType] 业务场景
* @param {string} [data.uuid] 消息接收人uuid
* @param {string} [data.phone] 消息接收人手机号
* @param {string} [data.name] 消息接收人姓名
* @param {number} [data.status] 查看状态:0-待查看,1-已查看
* @returns {Promise<{code: string, errId: string, message?: string, data?: RpcPagination}>} 返回公司公告分页数据
*/
export function getCompanyNoticeList(data = { pageNum: 1, pageSize: 10 }) {
return api.post("dj.pad.api.new.pad.message.box.page", data, [], "/rop-dj-pad/router");
}
/**
* @typedef {Object} RopResponseDetail
* @property {string} code 响应状态(0:成功;1:失败)
* @property {string} errId 错误码
* @property {string} [message] 错误描述
* @property {NewPadMessageBoxDTO} [data] 成功返回数据
*/
/**
* 获取公告详情
* @param {{ id: number }} data - 请求参数,公告ID
* @returns {Promise<RopResponseDetail>} 返回公告详情数据
*/
export function getCompanyNoticeDetail(data) {
return api.post("dj.pad.api.new.pad.message.box.detail", data, [], "/rop-dj-pad/router");
}
/**
* @typedef {Object} ModuleUnreadCountDTO
* @property {ModuleType} [moduleType] 模块类型
* @property {number} [unreadCount] 未读数量
*/
/**
* @typedef {Object} UnreadCountResponse
* @property {string} code 响应状态(0:成功;1:失败)
* @property {string} errId 错误码
* @property {string} [message] 错误描述
* @property {Array<ModuleUnreadCountDTO>} [data] 各模块未读数量列表
*/
/**
* 获取各模块类型的未读数量
* @param {Object} data - 请求参数
* @param {Array<ModuleType>} [data.moduleTypes] 模块类型列表
* @param {BusinessType} [data.businessType] 业务场景
* @param {string} data.sessionId 会话ID(必填)
* @returns {Promise<UnreadCountResponse>} 返回各模块未读数量数据
*/
export function getUnreadCountByType(data) {
return api.post("dj.pad.api.new.pad.message.box.unread.count.by.type", data, [], "/rop-dj-pad/router");
}
{ {
"pages": [
"pages/loading/loading",
"pages/sceneIndex/sceneIndex",
"pages/wxLogin/wxLogin",
"pages/accountItems/accountItems",
"pages/merchantList/merchantList",
"pages/nothing/nothing",
"pages/webView/webView",
"pages/tab/index/index",
"pages/tab/workspace/workspace",
"pages/tab/study/study",
"pages/tab/mine/mine",
"pages/log/log",
"pages/changeScene/changeScene",
"pages/h5AuthPhone/h5AuthPhone"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "嘀加区域助手",
"navigationBarTextStyle": "black",
"pageOrientation": "auto"
},
"tabBar": {
"color": "#999999",
"selectedColor": "#222222",
"backgroundColor": "#FFFFFF",
"position": "bottom",
"list": [
{
"pagePath": "pages/tab/index/index",
"text": "首页",
"iconPath": "images/tab-home.png",
"selectedIconPath": "images/tab-home-active.png"
},
{
"pagePath": "pages/tab/workspace/workspace",
"text": "工作台",
"iconPath": "images/tab-workspace.png",
"selectedIconPath": "images/tab-workspace-active.png"
},
{
"pagePath": "pages/tab/study/study",
"text": "学习",
"iconPath": "images/tab-study.png",
"selectedIconPath": "images/tab-study-active.png"
},
{
"pagePath": "pages/tab/mine/mine",
"text": "我的",
"iconPath": "images/tab-mine.png",
"selectedIconPath": "images/tab-mine-active.png"
}
]
},
"subpackages": [
{
"root": "packageWorkspace",
"name": "packageWorkspace",
"pages": [
"pages/refundOperationList/refundOperationList",
"pages/refundDetailList/refundDetailList",
"pages/refundApply/refundApply",
"pages/receptionRecords/receptionRecords",
"pages/receptionDetail/receptionDetail",
"pages/newReceptionRecords/newReceptionRecords",
"pages/residentManage/residentManage",
"pages/recruitManage/recruitDetail/recruitDetail",
"pages/recruitManage/recruitInsert/recruitInsert",
"pages/recruitManage/recruitResult/recruitResult",
"pages/recruitManage/recruitManage/recruitManage",
"pages/supervisorDaily/supervisorDaily",
"pages/talentAnalysis/talentAnalysis",
"pages/carBrands/carBrands",
"pages/carSeries/carSeries",
"pages/performanceRating/rateList/retaList",
"pages/validReferralCount/referralCountList/referralCountList"
]
},
{
"root": "packageStudy",
"name": "packageStudy",
"pages": [
"pages/sceneMarket/index/index",
"pages/sceneMarket/clue/clue",
"pages/sceneMarket/clueForm/clueForm",
"pages/sceneMarket/materialPage/materialPage",
"pages/sceneMarket/carBrands/carBrands",
"pages/sceneMarket/carSeries/carSeries",
"pages/aiCheck/chat/chat",
"pages/aiCheck/result/result",
"pages/aiCheck/scene/scene",
"pages/aiCheck/start/start",
"pages/aiCheck/redundance/redundance",
"pages/aiCheck/detail/detail",
"pages/aiCheck/defense/defense"
]
}
],
"usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea",
"gl-cell": "/components/GlCell/GlCell",
"gl-cust-form": "/components/GLCustForm/GLCustForm",
"calendar": "/components/Calendar/Calendar",
"navigation-bar": "/components/navigationBar/navigationBar",
"popup": "/components/Popup/Popup",
"search-input": "/components/SearchInput/SearchInput",
"tab-bar": "/components/TabBar/TabBar",
"modal": "components/modal/modal",
"gl-image": "components/GlImage/index",
"van-field": "@vant/weapp/field/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-radio": "@vant/weapp/radio/index",
"van-popup": "@vant/weapp/popup/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-uploader": "@vant/weapp/uploader/index",
"glsx-privacy": "glsk-applet-component/GlsxPrivacy/index",
"empty-data": "/components/EmptyData/EmptyData",
"van-switch": "@vant/weapp/switch/index"
},
"resolveAlias": {
"~/*": "/*"
},
"sitemapLocation": "sitemap.json",
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"lazyCodeLoading": "requiredComponents",
"resizable": true
}
\ No newline at end of file \ No newline at end of file
"pages": [
"pages/loading/loading",
"pages/sceneIndex/sceneIndex",
"pages/wxLogin/wxLogin",
"pages/accountItems/accountItems",
"pages/merchantList/merchantList",
"pages/nothing/nothing",
"pages/webView/webView",
"pages/tab/index/index",
"pages/tab/workspace/workspace",
"pages/tab/study/study",
"pages/tab/mine/mine",
"pages/log/log",
"pages/changeScene/changeScene",
"pages/h5AuthPhone/h5AuthPhone"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "嘀加区域助手",
"navigationBarTextStyle": "black",
"pageOrientation": "auto"
},
"tabBar": {
"color": "#999999",
"selectedColor": "#222222",
"backgroundColor": "#FFFFFF",
"position": "bottom",
"list": [
{
"pagePath": "pages/tab/index/index",
"text": "首页",
"iconPath": "images/tab-home.png",
"selectedIconPath": "images/tab-home-active.png"
},
{
"pagePath": "pages/tab/workspace/workspace",
"text": "工作台",
"iconPath": "images/tab-workspace.png",
"selectedIconPath": "images/tab-workspace-active.png"
},
{
"pagePath": "pages/tab/study/study",
"text": "学习",
"iconPath": "images/tab-study.png",
"selectedIconPath": "images/tab-study-active.png"
},
{
"pagePath": "pages/tab/mine/mine",
"text": "我的",
"iconPath": "images/tab-mine.png",
"selectedIconPath": "images/tab-mine-active.png"
}
]
},
"subpackages": [
{
"root": "packageWorkspace",
"name": "packageWorkspace",
"pages": [
"pages/serverCenter/view/serverCenter/serverCenter",
"pages/serverCenter/view/companyNoticeDetail/companyNoticeDetail",
"pages/refundOperationList/refundOperationList",
"pages/refundDetailList/refundDetailList",
"pages/refundApply/refundApply",
"pages/receptionRecords/receptionRecords",
"pages/receptionDetail/receptionDetail",
"pages/newReceptionRecords/newReceptionRecords",
"pages/residentManage/residentManage",
"pages/recruitManage/recruitDetail/recruitDetail",
"pages/recruitManage/recruitInsert/recruitInsert",
"pages/recruitManage/recruitResult/recruitResult",
"pages/recruitManage/recruitManage/recruitManage",
"pages/supervisorDaily/supervisorDaily",
"pages/talentAnalysis/talentAnalysis",
"pages/carBrands/carBrands",
"pages/carSeries/carSeries",
"pages/performanceRating/rateList/retaList",
"pages/validReferralCount/referralCountList/referralCountList"
]
},
{
"root": "packageStudy",
"name": "packageStudy",
"pages": [
"pages/sceneMarket/index/index",
"pages/sceneMarket/clue/clue",
"pages/sceneMarket/clueForm/clueForm",
"pages/sceneMarket/materialPage/materialPage",
"pages/sceneMarket/carBrands/carBrands",
"pages/sceneMarket/carSeries/carSeries",
"pages/aiCheck/chat/chat",
"pages/aiCheck/result/result",
"pages/aiCheck/scene/scene",
"pages/aiCheck/start/start",
"pages/aiCheck/redundance/redundance",
"pages/aiCheck/detail/detail",
"pages/aiCheck/defense/defense"
]
}
],
"usingComponents": {
"gl-textarea": "/components/GlTextarea/GlTextarea",
"gl-cell": "/components/GlCell/GlCell",
"gl-cust-form": "/components/GLCustForm/GLCustForm",
"calendar": "/components/Calendar/Calendar",
"navigation-bar": "/components/navigationBar/navigationBar",
"popup": "/components/Popup/Popup",
"search-input": "/components/SearchInput/SearchInput",
"tab-bar": "/components/TabBar/TabBar",
"modal": "components/modal/modal",
"gl-image": "components/GlImage/index",
"van-field": "@vant/weapp/field/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-radio": "@vant/weapp/radio/index",
"van-popup": "@vant/weapp/popup/index",
"van-dialog": "@vant/weapp/dialog/index",
"van-uploader": "@vant/weapp/uploader/index",
"glsx-privacy": "glsk-applet-component/GlsxPrivacy/index",
"empty-data": "/components/EmptyData/EmptyData",
"van-switch": "@vant/weapp/switch/index"
},
"resolveAlias": {
"~/*": "/*"
},
"sitemapLocation": "sitemap.json",
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
"lazyCodeLoading": "requiredComponents",
"resizable": true
}
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
*/ */
// 配置预发布的小程序aapId // 配置预发布的小程序aapId
export const preReleaseAppId = 'wx96c8f2a3e76907cb' export const preReleaseAppId = "wx96c8f2a3e76907cb";
// 小程序id // 小程序id
export const appId = 'wx570d9331f9ace0bd' export const appId = "wx570d9331f9ace0bd";
/** /**
* 环境指定 * 环境指定
...@@ -18,99 +18,97 @@ export const appId = 'wx570d9331f9ace0bd' ...@@ -18,99 +18,97 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布 * 4预发布
* 5cdptest * 5cdptest
*/ */
let index = 2 let index = 1;
const accountInfo = wx.getAccountInfoSync() const accountInfo = wx.getAccountInfoSync();
const systemInfo = wx.getSystemInfoSync() const systemInfo = wx.getSystemInfoSync();
const envName = accountInfo.miniProgram.envVersion const envName = accountInfo.miniProgram.envVersion;
//手动控制体验版环境的请求 true就依据下面index false就默认2 //手动控制体验版环境的请求 true就依据下面index false就默认2
const manual = false const manual = false;
const release = false const release = false;
// 判断小程序环境 // 判断小程序环境
// develop:开发版 trial:体验版 release:正式版 // develop:开发版 trial:体验版 release:正式版
if (systemInfo.platform != 'devtools') { if (systemInfo.platform != "devtools") {
if (accountInfo.miniProgram.appId == preReleaseAppId) { if (accountInfo.miniProgram.appId == preReleaseAppId) {
index = 4 index = 4;
} else { } else {
switch (envName) { switch (envName) {
case 'develop': case "develop":
break break;
case 'trial': case "trial":
index = manual ? index : 2 index = manual ? index : 2;
break break;
case 'release': case "release":
index = release ? index : 3 index = release ? index : 3;
break break;
default: default:
index = 3 index = 3;
break break;
} }
} }
} }
export const env = envName export const env = envName;
export const envIndex = index export const envIndex = index;
const createQuotedUrl = { const createQuotedUrl = {
develop: `http://192.168.1.178:9528/dj-scrm-wx-work-main-zhangls/#/equityPoster?id=`, develop: `http://192.168.1.178:9528/dj-scrm-wx-work-main-zhangls/#/equityPoster?id=`,
trial: `http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`, trial: `http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`,
release: `https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`, release: `https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`,
preRelease: `https://dj.beta.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=` preRelease: `https://dj.beta.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`,
} };
const scoketURL = { const scoketURL = {
develop: `ws://192.168.3.191:7865`, develop: `ws://192.168.3.191:7865`,
trial: `ws://salesgpt.test.glsx.com.cn`, trial: `ws://salesgpt.test.glsx.com.cn`,
release: `wss://salesgpt.glsx.com.cn`, release: `wss://salesgpt.glsx.com.cn`,
preRelease: `ws://salesgpt.test.glsx.com.cn` preRelease: `ws://salesgpt.test.glsx.com.cn`,
} };
const target = ['ip', 'develop', 'trial', 'release', 'preRelease'] const target = ["ip", "develop", "trial", "release", "preRelease"];
const ALIYUN_LIST = [ const ALIYUN_LIST = [
{ {
AKID: 'LTAI5tJday6R4sng1jgrgH3N', //个人 AKID: "LTAI5tJday6R4sng1jgrgH3N", //个人
AKKEY: 'TWvwaQqwjxw7Tj7RlnTxyEXjOjQgFh', AKKEY: "TWvwaQqwjxw7Tj7RlnTxyEXjOjQgFh",
APPKEY: 'a1HmjrmQNv6yT8zb', APPKEY: "a1HmjrmQNv6yT8zb",
URL: 'wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1' URL: "wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1",
}, },
{ {
AKID: 'LTAI5tCSaRbXmWhF7cR6k626', //公司 AKID: "LTAI5tCSaRbXmWhF7cR6k626", //公司
AKKEY: 'jYHkk6rR6UoaZWikxDTuAUNwJycJwb', AKKEY: "jYHkk6rR6UoaZWikxDTuAUNwJycJwb",
APPKEY: 'Pm7teJgylXGPnPvO', APPKEY: "Pm7teJgylXGPnPvO",
URL: 'wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1' URL: "wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1",
}, },
{ {
AKID: 'LTAI5tCv6tv55tZVyV4uQKd6', //个人 AKID: "LTAI5tCv6tv55tZVyV4uQKd6", //个人
AKKEY: 'K3eko04dQ88KWltUEbY3A7h5twdjJk', AKKEY: "K3eko04dQ88KWltUEbY3A7h5twdjJk",
APPKEY: 'xKQ7JCyBsyNFjUdL', APPKEY: "xKQ7JCyBsyNFjUdL",
URL: 'wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1' URL: "wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1",
} },
] ];
export const ALIYUN = ALIYUN_LIST[1] export const ALIYUN = ALIYUN_LIST[1];
// 报价单图片地址 // 报价单图片地址
export const quotedImgUrl = createQuotedUrl[target[envIndex]] export const quotedImgUrl = createQuotedUrl[target[envIndex]];
export const scoket_url = scoketURL[target[envIndex]] export const scoket_url = scoketURL[target[envIndex]];
// sentry Dsn 地址 // sentry Dsn 地址
export const dsnUrl = export const dsnUrl = "https://6b10bd312d154ff3a4664772bb4e50f5@sentry.glsx.com.cn/49";
'https://6b10bd312d154ff3a4664772bb4e50f5@sentry.glsx.com.cn/49'
// 图片基地址 // 图片基地址
export const ImgUrl = export const ImgUrl = "https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat";
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat'
export const ossConfig = { export const ossConfig = {
// 请求域名 格式:https://xxx.xxx.com // 请求域名 格式:https://xxx.xxx.com
HTTP_REQUEST_URL: 'http://127.0.0.1:8000/api', HTTP_REQUEST_URL: "http://127.0.0.1:8000/api",
// 阿里云oss域名 格式:https://xxx.oss-cn-xxx.aliyuncs.com // 阿里云oss域名 格式:https://xxx.oss-cn-xxx.aliyuncs.com
OSS_DOMAIN: 'https://glsk-oss.oss-cn-shenzhen.aliyuncs.com', OSS_DOMAIN: "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com",
// 文件直传到阿里云oss时需用到 // 文件直传到阿里云oss时需用到
ACCESSKEYID: 'LTAI5tCRcCUgd7bt1J7JY596', ACCESSKEYID: "LTAI5tCRcCUgd7bt1J7JY596",
ACCESSKEYSECRET: 'kJos9mgylkR5ztosnDt8Asrc3ulgqy', ACCESSKEYSECRET: "kJos9mgylkR5ztosnDt8Asrc3ulgqy",
BUKET_NAME: 'glsk-oss', BUKET_NAME: "glsk-oss",
FOLDER: 'quality/', FOLDER: "quality/",
// 与后端约定的token字段名 // 与后端约定的token字段名
TOKEN_NAME: 'glsk-oss' TOKEN_NAME: "glsk-oss",
} };
export const bytedanceConfig = { export const bytedanceConfig = {
url: 'https://openspeech.bytedance.com/api/v1/tts' url: "https://openspeech.bytedance.com/api/v1/tts",
} };
{ {
"compilerOptions": { "compilerOptions": {
"target": "es2015",
"module": "commonjs"
}
}
\ No newline at end of file \ No newline at end of file
"target": "es2020",
"module": "commonjs",
"baseUrl": ".",
"allowJs": true,
"checkJs": false,
"moduleResolution": "Node",
"lib": ["es2020"],
"paths": {
"~/*": ["./*"]
}
},
"include": ["**/*"],
"exclude": ["node_modules", "miniprogram_npm"]
}
import { ServerCenterEnum, ReminderTypeEnum } from "~/utils/enum/index";
Component({
properties: {
// 企业通知
// ServerCenterEnum
type: {
type: String,
value: "",
},
data: {
type: Object,
value: {},
},
},
/**
* 组件的初始数据
*/
data: {
itemSchema: {
// 企业通知
[ServerCenterEnum.companyNotice]: {
[ReminderTypeEnum.FIRST]: [
{ label: "企业通知", isTitle: true },
{ label: "提醒时间", field: "createdTime", colon: true },
{ label: "提醒内容", field: "msgTitle", colon: true },
],
},
},
},
});
.notice-item {
padding: 24rpx 32rpx;
border-radius: var(--fontSize16);
margin-top: 32rpx;
background-color: white;
line-height: 22px;
transition: background-color 0.1s;
&:active {
background-color: #f5f6f8;
}
> .title {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 32rpx;
color: rgba(51, 51, 51, 1);
font-weight: 500;
width: 100%;
overflow: hidden;
.tips {
font-size: 24rpx;
font-weight: 400;
color: rgb(153, 153, 153);
}
> .label {
flex: 1;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
position: relative;
display: block;
box-sizing: border-box;
padding-left: 0;
&.no-read {
padding-left: 24rpx;
&::after {
position: absolute;
content: "";
left: 0;
top: 50%;
transform: translate(0, -50%); /* X轴左移50%,Y轴上移50%,实现完全居中 */
width: 12rpx;
height: 12rpx;
border-radius: 100%;
background-color: #f24724;
}
}
}
}
> .label-item {
display: flex;
margin-top: 16rpx;
color: rgb(153, 153, 153);
font-size: 28rpx;
width: 100%;
.label {
&.colon {
&::after {
content: ":";
margin-right: 16rpx;
}
}
}
> .value {
flex: 1;
}
}
}
<view class="notice-item">
<block wx:for="{{ itemSchema[type][data.reminderType] }}"
wx:for-item="schema"
wx:key="field">
<block wx:if="{{ data.reminderType }}">
<view class="title" wx:if="{{ schema.isTitle }}">
<view class="label {{ data.status === 1 ? '':'no-read' }}">
{{ schema.label }}
</view>
<view class="tips">
查看详情>
</view>
</view>
<view class="label-item" wx:else>
<view class="label {{ schema.colon ? 'colon' : '' }}">
{{ schema.label }}
</view>
<view class="value">
{{ schema.beforeText }}{{ data[schema.field] }}{{ schema.afterText }}
</view>
</view>
</block>
</block>
</view>
Component({
properties: {
hasMore: {
type: Boolean,
value: true,
},
isLoading: {
type: Boolean,
value: false,
},
listLength: {
type: Number,
value: 0,
},
},
data: {},
methods: {
onScrollToLower(e) {
if (this.data.hasMore && !this.data.isLoading) {
this.triggerEvent("onScrollToLower", e);
console.log("滚动到底部了sssss", e);
}
},
},
lifetimes: {
created() {},
attached() {},
ready() {},
moved() {},
detached() {},
},
observers: {},
});
.tab-wrapper {
padding: 0 20rpx;
box-sizing: border-box;
height: 100%;
.scroll-anchor {
margin-top: 32rpx;
color: #999999;
font-size: 12px;
font-weight: 400;
text-align: center;
line-height: 16px;
&::before {
content: "-";
}
&::after {
content: "-";
}
}
}
<scroll-view class="tab-wrapper"
scroll-y
bind:scrolltolower="onScrollToLower"
lower-threshold="50">
<slot></slot><empty-data wx:if="{{ !isLoading && listLength === 0 && !hasMore }}" />
<block wx:else>
<view class="scroll-anchor" wx:if="{{ isLoading }}">
加载中
</view>
<view class="scroll-anchor" wx:elif="{{ !hasMore }}">
已经到底了
</view>
</block>
</scroll-view>
import { getCompanyNoticeDetail } from "~/api/serviceCenter/index.js";
Page({
data: {
navBarHeight: 0,
noticeData: {},
},
navbarReady(e) {
let navBarHeight = e?.detail?.height;
this.setData({
navBarHeight,
});
},
back() {
wx.$router.back();
},
async loadData(messageId) {
console.log("messageId", messageId);
wx.$util.showLoading();
try {
const { data } = await getCompanyNoticeDetail({ id: messageId });
this.setData({
noticeData: data,
});
} finally {
wx.$util.hideLoading();
}
},
/**
* options 仅有一个id字段
* options.id
*/
async onRoute(options) {
console.log("options", options);
await this.loadData(options.id);
},
});
page {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
padding-bottom: env(safe-area-inset-bottom);
box-sizing: border-box;
}
.layout {
flex: 1;
width: 100%;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow: hidden;
.title {
padding: 0 32rpx;
margin-top: 24rpx;
color: #333333;
font-size: 16px;
font-weight: 500;
text-align: left;
line-height: 44rpx;
}
.article-time {
padding: 0 32rpx;
margin-top: 16rpx;
color: #66666699;
font-size: 14px;
font-weight: 400;
text-align: left;
line-height: 44rpx;
}
.article-sub-title {
padding: 0 32rpx;
color: #333333;
font-size: 15px;
line-height: 44rpx;
margin-top: 16rpx;
}
.article-wrapper {
padding: 10rpx 32rpx;
margin-top: 16rpx;
line-height: 48rpx;
color: #666666;
flex: 1;
overflow-y: scroll;
}
}
<navigation-bar bind:navbarReady="navbarReady"
showBack
navStyle="{{ navStyle }}"
bind:back="back">
通知详情
</navigation-bar>
<view class="layout" style="padding-top: {{ navBarHeight }}px;">
<view class="title">
{{ noticeData.msgDetail.title }}
</view>
<view class="article-time">
{{ noticeData.createdTime }}
</view>
<view class="article-sub-title" wx:if="{{ noticeData.msgDetail.subtitle }}">
{{ noticeData.msgDetail.subtitle }}
</view>
<view class="article-wrapper">
<rich-text nodes="{{ noticeData.msgDetail.content }}"></rich-text>
</view>
</view>
import { getCompanyNoticeList, getUnreadCountByType } from "~/api/serviceCenter/index.js";
import { ServerCenterEnum, ServerCenterKeyEnum } from "~/utils/enum/index.js";
Page({
data: {
ServerCenterEnum: ServerCenterEnum,
ServerCenterKeyEnum,
tabCurrent: ServerCenterEnum.companyNotice,
tabOptions: [{ text: "企业通知", value: ServerCenterEnum.companyNotice, key: "companyNotice" }],
tabPath: {
[ServerCenterEnum.companyNotice]: {
path: "tabWorkOrder.companyNoticeDetail",
// api参数
params: {
moduleType: ServerCenterEnum.companyNotice,
},
},
},
list: {
companyNotice: {
total: 0,
list: [],
},
},
},
navbarReady(e) {
let navBarHeight = e?.detail?.height;
this.setData({
navBarHeight,
});
},
back() {
wx.$router.back();
},
handleTab({ detail }) {
this.setData({
tabCurrent: detail.value,
});
},
async handleTapItem(e) {
const { id, moduleType } = e.target.dataset.item;
wx.$router.go(this.data.tabPath[moduleType || 0].path, {
id,
});
},
async handleScrollToLower(e) {
await this.getTabList(true);
},
clearTabData() {
this.setData({
list: {
companyNotice: {
unreadNum: 0,
isLoading: false,
hasMore: true,
total: 0,
list: [],
},
},
});
},
async handleTabChange(e) {
this.setData({
tabCurrent: e.detail.name,
});
await this.getUnread();
await this.getTabList();
},
async getTabList(isPagination = false, tabCurrent = -1) {
wx.$util.showLoading();
const tabValue = tabCurrent === -1 ? this.data.tabCurrent : tabCurrent;
this.setData({
[`list.${ServerCenterKeyEnum[tabValue]}.isLoading`]: true,
});
try {
const tabData = this.data.list[`${ServerCenterKeyEnum[tabValue]}`];
const pagination = {
pageNum: 1,
pageSize: 15,
};
if (isPagination) {
pagination.pageNum = tabData.pageNum + 1;
}
const { data } = await getCompanyNoticeList({
...pagination,
...this.data.tabPath[tabValue].params,
});
if (data?.list) {
if (isPagination) {
data.list = [...tabData.list, ...data.list];
}
this.setData({
[`list.${ServerCenterKeyEnum[tabValue]}`]: {
...tabData,
...data,
hasMore: data.pageNum < data.pages,
isLoading: false,
},
});
console.log("this.data.list", this.data.list);
}
} finally {
wx.$util.hideLoading();
this.setData({
[`list.${ServerCenterKeyEnum[tabValue]}.isLoading`]: false,
});
}
},
async getUnread() {
wx.$util.showLoading();
try {
const { data } = await getUnreadCountByType({ moduleTypes: [ServerCenterEnum.companyNotice] });
if (data && data.length) {
for (let item of data) {
if (ServerCenterKeyEnum[item.moduleType]) {
this.setData({
[`list.${ServerCenterKeyEnum[item.moduleType]}.unreadNum`]: item.unreadCount,
});
}
}
console.log("list", this.data.list);
}
} finally {
wx.$util.hideLoading();
}
// const apis = [
// getUnreadCountByType({
// moduleTypes: ServerCenterEnum.companyNotice,
// }),
// getUnreadCountByType({
// moduleTypes: ServerCenterEnum.longCourse,
// }),
// getUnreadCountByType({
// moduleTypes: ServerCenterEnum.case,
// }),
// ];
// this.setData({});
// const [companyData, longCourseData, caseData] = await Promise.all(apis);
// console.log(companyData, longCourseData, caseData);
},
async onLoad(options) {
await this.getUnread();
await this.getTabList();
},
onRoute(options) {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
});
{
"navigationStyle": "custom",
"usingComponents": {
"van-tab": "@vant/weapp/tab/index",
"van-tabs": "@vant/weapp/tabs/index",
"item": "../../components/noticeItem/noticeItem",
"scrollList": "../../components/scrollList/scrollList"
}
}
/* packageEquity/pages/residentTarget/residentTarget.wxss */
page {
background-color: #f7f8fa !important;
height: 100%;
overflow: hidden;
display: flex;
flex-direction: column;
position: relative;
padding-top: var(--fontSize165);
box-sizing: border-box;
padding-bottom: env(safe-area-inset-bottom);
.bg {
box-sizing: border-box;
width: 100%;
height: 800rpx;
background: linear-gradient(-89.9deg, #e6fffb 0%, #dcecff 40%, #f2f2ff 62%, #dce9fe 100%);
/* 绑定动画:10秒循环,平滑过渡 */
position: fixed;
left: 0;
top: 0;
z-index: -1;
&::after {
content: "";
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 50%, rgba(247, 248, 250, 1) 100%);
}
}
.navigation-header {
.navigation-bar {
background-color: transparent;
box-shadow: none;
}
.navigation-header .navigation-title-text {
color: #000;
}
}
.tabs-wrapper {
flex: 1;
overflow: hidden;
.van-tabs__scroll {
background-color: transparent;
}
.van-tabs {
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
.van-tabs__content {
flex: 1;
.van-tabs__track {
height: 100%;
.van-tab__pane {
height: 100%;
overflow: hidden;
}
}
}
}
}
}
<view class="bg"></view>
<navigation-bar class="navigation-header"
bind:navbarReady="navbarReady"
showBack
bind:back="back">
<view class="navigation-title">
<view class="navigation-title-text text-hide">
服务中心
</view>
</view>
</navigation-bar>
<view class="tabs-wrapper">
<van-tabs active="{{ tabCurrent }}"
bind:change="handleTabChange"
color="#347BFF">
<van-tab wx:for="{{ tabOptions }}"
wx:key="value"
wx:for-item="options"
title="{{ options.text }}({{ list[options.key].unreadNum > 99? '99+' : list[options.key].unreadNum || 0 }})"
name="{{ options.value }}">
<scrollList bind:onScrollToLower="handleScrollToLower"
hasMore="{{ list[options.key].hasMore }}"
isLoading="{{ list[options.key].isLoading }}"
listLength="{{ list[options.key].list.length }}">
<item wx:for="{{ list[options.key].list }}"
wx:key="id"
wx:for-item="item"
data-item="{{ item }}"
bind:tap="handleTapItem"
data="{{ item }}"
type="{{ options.value }}"></item>
</scrollList>
</van-tab>
</van-tabs>
</view>
<!--pages/tab/workspace/workspace.wxml--> <!--pages/tab/workspace/workspace.wxml-->
<navigation-bar bindnavbarReady="navbarReady" class="navigation-header" navStyle="background-color:transparent;box-shadow:none;"><view class="page-title">工作台</view></navigation-bar> <navigation-bar bindnavbarReady="navbarReady"
class="navigation-header"
navStyle="background-color:transparent;box-shadow:none;">
<view class="page-title">
工作台
</view>
</navigation-bar>
<view class="bg"></view> <view class="bg"></view>
<view class="container" style="margin-top: {{navBarHeight}}px;"> <view class="container" style="margin-top: {{ navBarHeight }}px;">
<view class="banner-box" wx:if="{{showBanner}}"> <view class="banner-box" wx:if="{{ showBanner }}">
<image class="image" src="{{IMG_URL}}work-banner.png" mode=""/> <image class="image"
<image class="close-icon" bindtap="closeBannaer" src="{{IMG_URL}}blue-close.png" alt=""/> src="{{ IMG_URL }}work-banner.png"
</view> mode="" />
<view class="box"> <image class="close-icon"
<view class="label">审批管理</view> bindtap="closeBannaer"
<view class="menu"> src="{{ IMG_URL }}blue-close.png"
<block wx:for="{{ approvalMenus }}" wx:key="index"> alt="" />
<view class="item" bindtap="jump" data-target="{{ item }}"> </view>
<image src="{{ IMG_URL}}{{item.icon }}.png" /> <view class="box">
<view class="label">{{item.name}}</view> <view class="label">
<view class="hot_icon" wx:if="{{ item.tipsNum }}">{{item.tipsNum > 99?'99+': item.tipsNum}}</view> 审批管理
</view> </view>
</block> <view class="menu">
</view> <block wx:for="{{ approvalMenus }}" wx:key="index">
</view> <view class="item"
<view class="box"> bindtap="jump"
<view class="label">门店运营管理</view> data-target="{{ item }}">
<view class="menu"> <image src="{{ IMG_URL }}{{ item.icon }}.png" />
<block wx:for="{{ storeManagementMenus }}" wx:key="index"> <view class="label">
<view class="item" bindtap="jump" data-target="{{ item }}"> {{ item.name }}
<image src="{{ IMG_URL}}{{item.icon }}.png" /> </view>
<view class="label">{{item.name}}</view> <view class="hot_icon" wx:if="{{ item.tipsNum }}">
<view class="hot_icon" wx:if="{{ item.tipsNum }}">{{item.tipsNum > 99?'99+': item.tipsNum}}</view> {{ item.tipsNum > 99?'99+': item.tipsNum }}
</view> </view>
</block> </view>
</view> </block>
</view> </view>
<view class="box"> </view>
<view class="label">人员发展管理</view> <view class="box">
<view class="menu"> <view class="label">
<block wx:for="{{ staffDevelopmentMenus }}" wx:key="index"> 门店运营管理
<view class="item" bindtap="jump" data-target="{{ item }}"> </view>
<image src="{{ IMG_URL}}{{item.icon }}.png" /> <view class="menu">
<view class="label">{{item.name}}</view> <block wx:for="{{ storeManagementMenus }}" wx:key="index">
<view class="hot_icon" wx:if="{{ item.tipsNum }}">{{item.tipsNum > 99?'99+': item.tipsNum}}</view> <view class="item"
</view> bind:tap="jump"
</block> data-target="{{ item }}">
</view> <image src="{{ IMG_URL }}{{ item.icon }}.png" />
</view> <view class="label">
{{ item.name }}
</view>
<view class="hot_icon" wx:if="{{ item.tipsNum }}">
{{ item.tipsNum > 99?'99+': item.tipsNum }}
</view>
</view>
</block>
</view>
</view>
<view class="box">
<view class="label">
人员发展管理
</view>
<view class="menu">
<block wx:for="{{ staffDevelopmentMenus }}" wx:key="index">
<view class="item"
bindtap="jump"
data-target="{{ item }}">
<image src="{{ IMG_URL }}{{ item.icon }}.png" />
<view class="label">
{{ item.name }}
</view>
<view class="hot_icon" wx:if="{{ item.tipsNum }}">
{{ item.tipsNum > 99?'99+': item.tipsNum }}
</view>
</view>
</block>
</view>
</view>
</view> </view>
<report-template-popup <report-template-popup show="{{ showReportPopup }}"
show="{{showReportPopup}}" templateList="{{ reportTemplateList }}"
templateList="{{reportTemplateList}}" bind:cancel="onReportPopupCancel"
bind:cancel="onReportPopupCancel" bind:select="onReportPopupSelect" />
bind:select="onReportPopupSelect"
/>
...@@ -11,10 +11,6 @@ ...@@ -11,10 +11,6 @@
{ {
"value": ".vscode", "value": ".vscode",
"type": "folder" "type": "folder"
},
{
"value": "\\.scss",
"type": "regexp"
} }
], ],
"include": [] "include": []
...@@ -44,7 +40,7 @@ ...@@ -44,7 +40,7 @@
"sass" "sass"
], ],
"ignoreDevUnusedFiles": false, "ignoreDevUnusedFiles": false,
"ignoreUploadUnusedFiles": true "ignoreUploadUnusedFiles": false
}, },
"editorSetting": { "editorSetting": {
"tabIndent": "insertSpaces", "tabIndent": "insertSpaces",
......
export * from "./serviceCenter.js";
export const ServerCenterEnum = {
// 企业通知
companyNotice: 8,
};
export const ServerCenterKeyEnum = {
// 企业通知
8: "companyNotice",
};
export const ReminderTypeEnum = {
FIRST: 1,
PROGRESS: 2,
};
// 弹窗文字
export const dialogOptions = {
// 企业通知
[ServerCenterEnum.companyNotice]: {
1: {
title: "企业通知",
message: (text) => `您有新的企业通知:「${text}」,请及时查看。`,
confirmButtonText: "去查看",
type: ServerCenterEnum.companyNotice,
},
},
};
export const noticeSort = [ServerCenterEnum.companyNotice];
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!