Commit 31380d63 by Jaxon

feat(workspace): 替换企业通知弹窗为 vant-dialog 组件

使用 vant-dialog 组件替代原生的 wx.showModal,以提供更一致和可自定义的 UI 体验。
调整了 dialog 的样式,包括标题、内容和按钮的样式定制,并添加了相应的样式隔离配置。
1 parent 615a98ed
// pages/tab/workspace/workspace.js // pages/tab/workspace/workspace.js
const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/"; const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/";
import { getWaitAuditCountAPI, waitstaffstateAPI, getStaffTemplate } from "~/api/api"; import { getWaitAuditCountAPI, waitstaffstateAPI, getStaffTemplate } from "~/api/api";
import Dialog from "@vant/weapp/dialog/dialog";
import { dialogOptions, noticeSort, ServerCenterEnum } from "~/utils/enum/index.js"; import { dialogOptions, noticeSort, ServerCenterEnum } from "~/utils/enum/index.js";
import { getCompanyNoticeDetail, getCompanyNoticeList } from "~/api/serviceCenter/index.js"; import { getCompanyNoticeDetail, getCompanyNoticeList } from "~/api/serviceCenter/index.js";
...@@ -9,6 +10,7 @@ Page({ ...@@ -9,6 +10,7 @@ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
styleIsolation: "shared",
data: { data: {
IMG_URL, IMG_URL,
navBarHeight: 0, navBarHeight: 0,
...@@ -159,18 +161,24 @@ Page({ ...@@ -159,18 +161,24 @@ Page({
that.setData({ that.setData({
isShowingModal: true, isShowingModal: true,
}); });
wx.showModal({
title: dialogParams.title, try {
content: message(noticeItem.msgTitle), await Dialog.alert({
showCancel: false, title: dialogParams.title,
confirmText: dialogParams.confirmButtonText, message: message(noticeItem.msgTitle),
success: function (res) { confirmButtonText: dialogParams.confirmButtonText,
that.setData({ showCancelButton: false,
isShowingModal: false, closeOnClickOverlay: false,
}); customStyle: "border-radius: 20rpx;",
wx.$router.go("packageWorkspace.companyNoticeDetail", { id: noticeItem.id }); });
}, that.setData({
}); isShowingModal: false,
});
wx.$router.go("packageWorkspace.companyNoticeDetail", { id: noticeItem.id });
} catch (e) {
console.log("?catch", e);
console.log(e);
}
break; break;
} }
} }
...@@ -213,7 +221,6 @@ Page({ ...@@ -213,7 +221,6 @@ Page({
this.getWaitStaff(); this.getWaitStaff();
}, },
); );
if (!this.data.isShowingModal) { if (!this.data.isShowingModal) {
// 服务中心 - 检查通知 // 服务中心 - 检查通知
await this.checkServiceNotice(); await this.checkServiceNotice();
......
{ {
"usingComponents": {
"report-template-popup": "/components/report-template-popup/report-template-popup"
},
"navigationStyle": "custom"
}
\ No newline at end of file \ No newline at end of file
"usingComponents": {
"report-template-popup": "/components/report-template-popup/report-template-popup",
"van-dialog": "@vant/weapp/dialog/index"
},
"navigationStyle": "custom"
}
...@@ -95,3 +95,31 @@ page { ...@@ -95,3 +95,31 @@ page {
} }
} }
} }
// dialog的样式
#van-dialog {
.van-popup {
.van-dialog__header {
padding: 48rpx 48rpx 0 48rpx;
color: #292d33;
font-size: 34rpx;
font-weight: 500;
text-align: center;
}
.van-dialog__message {
padding: 32rpx 48rpx 48rpx;
color: #5a5e66;
font-size: 32rpx;
font-weight: 400;
line-height: 24px;
}
.van-button {
padding: 24rpx 0 !important;
opacity: 1;
color: #347bff;
font-size: 32rpx;
font-weight: 400;
line-height: 24px;
}
}
}
...@@ -82,3 +82,4 @@ ...@@ -82,3 +82,4 @@
templateList="{{ reportTemplateList }}" templateList="{{ reportTemplateList }}"
bind:cancel="onReportPopupCancel" bind:cancel="onReportPopupCancel"
bind:select="onReportPopupSelect" /> bind:select="onReportPopupSelect" />
<van-dialog id="van-dialog" confirm-button-color="#2C66F7" />
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!