Commit 31380d63 by Jaxon

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

使用 vant-dialog 组件替代原生的 wx.showModal,以提供更一致和可自定义的 UI 体验。
调整了 dialog 的样式,包括标题、内容和按钮的样式定制,并添加了相应的样式隔离配置。
1 parent 615a98ed
// pages/tab/workspace/workspace.js
const IMG_URL = "https://img02.glsx.com.cn/weapp/resource/miniprogram/regional-assistant/";
import { getWaitAuditCountAPI, waitstaffstateAPI, getStaffTemplate } from "~/api/api";
import Dialog from "@vant/weapp/dialog/dialog";
import { dialogOptions, noticeSort, ServerCenterEnum } from "~/utils/enum/index.js";
import { getCompanyNoticeDetail, getCompanyNoticeList } from "~/api/serviceCenter/index.js";
......@@ -9,6 +10,7 @@ Page({
/**
* 页面的初始数据
*/
styleIsolation: "shared",
data: {
IMG_URL,
navBarHeight: 0,
......@@ -159,18 +161,24 @@ Page({
that.setData({
isShowingModal: true,
});
wx.showModal({
title: dialogParams.title,
content: message(noticeItem.msgTitle),
showCancel: false,
confirmText: dialogParams.confirmButtonText,
success: function (res) {
that.setData({
isShowingModal: false,
});
wx.$router.go("packageWorkspace.companyNoticeDetail", { id: noticeItem.id });
},
});
try {
await Dialog.alert({
title: dialogParams.title,
message: message(noticeItem.msgTitle),
confirmButtonText: dialogParams.confirmButtonText,
showCancelButton: false,
closeOnClickOverlay: false,
customStyle: "border-radius: 20rpx;",
});
that.setData({
isShowingModal: false,
});
wx.$router.go("packageWorkspace.companyNoticeDetail", { id: noticeItem.id });
} catch (e) {
console.log("?catch", e);
console.log(e);
}
break;
}
}
......@@ -213,7 +221,6 @@ Page({
this.getWaitStaff();
},
);
if (!this.data.isShowingModal) {
// 服务中心 - 检查通知
await this.checkServiceNotice();
......
{
"usingComponents": {
"report-template-popup": "/components/report-template-popup/report-template-popup"
},
"navigationStyle": "custom"
}
\ 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 {
}
}
}
// 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 @@
templateList="{{ reportTemplateList }}"
bind:cancel="onReportPopupCancel"
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!