|
|
@@ -1,4 +1,6 @@
|
|
|
// pages/securityCheck/sharePage/sharePage.js
|
|
|
+import { postApi } from "../../../apis/api";
|
|
|
+
|
|
|
const app = getApp();
|
|
|
Page({
|
|
|
/**
|
|
|
@@ -23,36 +25,24 @@ Page({
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- getSharedNoticeInfo(noticeId) {
|
|
|
- // 调用API获取分享的海事年检通知信息
|
|
|
- // API: POST /annual/inspection/notice/share
|
|
|
- // 参数: noticeId (query)
|
|
|
+ async getSharedNoticeInfo(noticeId) {
|
|
|
wx.showLoading({
|
|
|
title: "加载中...",
|
|
|
});
|
|
|
- app.globalData.$http
|
|
|
- .post("/annual/inspection/notice/share", { noticeId })
|
|
|
- .then((res) => {
|
|
|
- wx.hideLoading();
|
|
|
- if (res.success && res.data) {
|
|
|
- this.setData({
|
|
|
- sharedNoticeInfo: res.data,
|
|
|
- });
|
|
|
- } else {
|
|
|
- wx.showToast({
|
|
|
- title: res.msg || "获取通知信息失败",
|
|
|
- icon: "none",
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- wx.hideLoading();
|
|
|
- wx.showToast({
|
|
|
- title: "网络错误",
|
|
|
- icon: "none",
|
|
|
- });
|
|
|
- console.error("获取分享海事年检通知信息失败:", err);
|
|
|
+ let { data } = await postApi("/annual/inspection/notice/share", {
|
|
|
+ noticeId,
|
|
|
+ });
|
|
|
+ wx.hideLoading();
|
|
|
+ if (data.status === 0) {
|
|
|
+ this.setData({
|
|
|
+ sharedNoticeInfo: data.result,
|
|
|
});
|
|
|
+ } else {
|
|
|
+ wx.showToast({
|
|
|
+ title: data.msg || "获取通知信息失败",
|
|
|
+ icon: "none",
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
/**
|