Explorar o código

咨询页面完成

yuanmingze hai 2 meses
pai
achega
d5ee7f7f9b

+ 2 - 2
.env.development

@@ -1,6 +1,6 @@
 VITE_MODE=development
 VITE_APP_TYPE=dev
 VITE_PROJECT_TITLE=要易小助手
-VITE_BASE_API=https://pre1.yaoyi.net
-# VITE_BASE_API=https://preapi.yaoyi.net
+# VITE_BASE_API=https://pre1.yaoyi.net
+VITE_BASE_API=https://preapi.yaoyi.net
 VITE_WX_APPID=wxd03398e1bff2b241

+ 1 - 0
package.json

@@ -36,6 +36,7 @@
     "async-validator": "^4.2.5",
     "dayjs": "^1.11.19",
     "lodash-es": "^4.17.22",
+    "mp-html": "^2.5.2",
     "nanoid": "^5.1.6",
     "pinia": "^3.0.4",
     "pinia-plugin-persistedstate": "^4.7.1",

+ 8 - 0
pnpm-lock.yaml

@@ -71,6 +71,9 @@ importers:
       lodash-es:
         specifier: ^4.17.22
         version: 4.17.22
+      mp-html:
+        specifier: ^2.5.2
+        version: 2.5.2
       nanoid:
         specifier: ^5.1.6
         version: 5.1.6
@@ -3488,6 +3491,9 @@ packages:
   module-alias@2.2.3:
     resolution: {integrity: sha512-23g5BFj4zdQL/b6tor7Ji+QY4pEfNH784BMslY9Qb0UnJWRAt+lQGLYmRaM0KDBwIG23ffEBELhZDP2rhi9f/Q==}
 
+  mp-html@2.5.2:
+    resolution: {integrity: sha512-45e8c32Qgux4YU4iC3qCSFsOh3y+RwPwZ+iz/vvLkDgSGWk+1zsL4WUzWWQc9w3AsAfkaD/QR0oIufIDngBmXA==}
+
   ms@2.0.0:
     resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
 
@@ -8965,6 +8971,8 @@ snapshots:
 
   module-alias@2.2.3: {}
 
+  mp-html@2.5.2: {}
+
   ms@2.0.0: {}
 
   ms@2.1.3: {}

+ 6 - 0
src/pages.json

@@ -24,6 +24,12 @@
         "navigationStyle": "default"
       }
     },
+    {
+      "path": "pages/information/detail/index",
+      "style": {
+        "navigationBarTitleText": "资讯详情"
+      }
+    },
 
     {
       "path": "pages/mine/index",

+ 6 - 4
src/pages/information/components/academic/AcademicArticleItem.vue

@@ -94,29 +94,31 @@ const stripHtml = (value?: string): string => {
 .article-title {
   display: -webkit-box;
   overflow: hidden;
-
   font-size: 32rpx;
   font-weight: 600;
   line-height: 46rpx;
   color: #202733;
   letter-spacing: 0.2rpx;
   word-break: break-all;
-
-  -webkit-line-clamp: 2;
+  text-overflow: ellipsis;
+  line-clamp: 1;
+  -webkit-line-clamp: 1;
   -webkit-box-orient: vertical;
 }
 
 .article-desc {
   display: -webkit-box;
   overflow: hidden;
-
   margin-top: 16rpx;
+
   font-size: 26rpx;
   font-weight: 400;
   line-height: 40rpx;
   color: #667085;
   word-break: break-all;
+  text-overflow: ellipsis;
 
+  line-clamp: 2;
   -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
 }

+ 1 - 1
src/pages/information/components/academic/AcademicInfoPanel.vue

@@ -127,7 +127,7 @@ const handleSearch = (params: { region: string; keyword: string }): void => {
 
 const handleArticleClick = (item: ArticleItem): void => {
   uni.navigateTo({
-    url: `/pages-sub-packages/information/detail/index?type=academic&id=${item.id}`,
+    url: `/pages/information/detail/index?type=academic&id=${item.id}`,
   })
 }
 

+ 5 - 1
src/pages/information/components/academic/InformationSearchBar.vue

@@ -89,7 +89,11 @@ const doSearch = () => {
   })
 }
 
-const triggerSearch = debounce(doSearch)
+const triggerSearch = debounce(doSearch, {
+  wait: 500,
+  leading: false,
+  trailing: true,
+})
 
 watch([region, keyword], () => {
   triggerSearch()

+ 269 - 0
src/pages/information/components/album/ProductAlbumItem.vue

@@ -0,0 +1,269 @@
+<template>
+  <view class="album-card" hover-class="album-card--hover" @click="handleSelect">
+    <view class="album-cover">
+      <image v-if="coverUrl" class="cover-image" :src="coverUrl" mode="aspectFill" lazy-load />
+
+      <view v-else class="cover-placeholder">
+        <text class="cover-placeholder-text">暂无图片</text>
+      </view>
+    </view>
+
+    <view class="album-content">
+      <view class="album-title">
+        {{ albumTitle }}
+      </view>
+
+      <view v-if="albumSummary" class="album-summary">
+        {{ albumSummary }}
+      </view>
+
+      <view class="album-related">
+        <text class="related-label">关联药品:</text>
+        <text class="related-value">{{ relatedDrugName }}</text>
+      </view>
+
+      <view class="album-footer">
+        <text class="album-date">
+          {{ createDate }}
+        </text>
+
+        <button
+          class="forward-button"
+          hover-class="forward-button--hover"
+          open-type="share"
+          :data-title="albumTitle"
+          :data-id="item.id"
+          :data-active-tab="activeTab"
+          @click.stop
+        >
+          <image class="forward-icon" :src="shareIconUrl" mode="aspectFit" />
+          <text class="forward-text">转发</text>
+        </button>
+      </view>
+    </view>
+  </view>
+</template>
+
+<script setup lang="ts">
+import { computed } from 'vue'
+
+import type { AlbumPageNewItem } from '@/services/modules/information/type'
+
+const props = defineProps<{
+  item: AlbumPageNewItem
+  shareIconUrl: string
+  activeTab: string
+}>()
+
+const emit = defineEmits<{
+  select: [item: AlbumPageNewItem]
+}>()
+
+const albumTitle = computed(() => {
+  return props.item.xcmc || '未命名相册'
+})
+
+const albumSummary = computed(() => {
+  return stripHtml(props.item.wb || props.item.temp1 || '')
+})
+
+const relatedDrugName = computed(() => {
+  const { glypName, glyp } = props.item
+
+  if (glypName && glypName !== 'null') return glypName
+  if (glyp && glyp !== 'null') return glyp
+
+  return '无'
+})
+
+const coverUrl = computed(() => {
+  const url = props.item.scfm?.trim()
+
+  if (!url) return ''
+
+  return /^https?:\/\//i.test(url) ? url : `${import.meta.env.VITE_BASE_API}${url}`
+})
+
+const createDate = computed(() => {
+  return props.item.createTime?.slice(0, 10) || ''
+})
+
+const handleSelect = (): void => {
+  emit('select', props.item)
+}
+
+const stripHtml = (value: string): string => {
+  return value
+    .replace(/<[^>]+>/g, '')
+    .replace(/&nbsp;/g, ' ')
+    .replace(/&amp;/g, '&')
+    .replace(/&lt;/g, '<')
+    .replace(/&gt;/g, '>')
+    .replace(/\s+/g, ' ')
+    .trim()
+}
+</script>
+
+<style lang="scss" scoped>
+.album-card {
+  box-sizing: border-box;
+  display: flex;
+  width: 100%;
+  min-height: 196rpx;
+  padding: 24rpx;
+  margin-bottom: 24rpx;
+  background: #ffffff;
+  border: 1rpx solid rgba(226, 232, 240, 0.9);
+  border-radius: 26rpx;
+  box-shadow: 0 12rpx 34rpx rgba(15, 23, 42, 0.06);
+  transition:
+    opacity 0.18s ease,
+    transform 0.18s ease;
+}
+
+.album-card--hover {
+  opacity: 0.88;
+  transform: scale(0.99);
+}
+
+.album-cover {
+  position: relative;
+  flex-shrink: 0;
+  width: 196rpx;
+  height: 164rpx;
+  overflow: hidden;
+  background: linear-gradient(135deg, #f3f7fb 0%, #eaf1f8 100%);
+  border-radius: 20rpx;
+}
+
+.cover-image {
+  display: block;
+  width: 100%;
+  height: 100%;
+}
+
+.cover-placeholder {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100%;
+  height: 100%;
+}
+
+.cover-placeholder-text {
+  color: #a0aec0;
+  font-size: 24rpx;
+  line-height: 34rpx;
+}
+
+.album-content {
+  display: flex;
+  flex: 1;
+  flex-direction: column;
+  min-width: 0;
+  margin-left: 24rpx;
+}
+
+.album-title {
+  overflow: hidden;
+  color: #1f2937;
+  font-size: 32rpx;
+  font-weight: 700;
+  line-height: 44rpx;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.album-summary {
+  display: -webkit-box;
+  overflow: hidden;
+  margin-top: 8rpx;
+  color: #667085;
+  font-size: 26rpx;
+  font-weight: 400;
+  line-height: 38rpx;
+  word-break: break-all;
+  text-overflow: ellipsis;
+
+  line-clamp: 2;
+  -webkit-line-clamp: 2;
+  -webkit-box-orient: vertical;
+}
+
+.album-related {
+  display: flex;
+  align-items: center;
+  min-width: 0;
+  margin-top: 8rpx;
+  font-size: 25rpx;
+  line-height: 34rpx;
+}
+
+.related-label {
+  flex-shrink: 0;
+  color: #98a2b3;
+}
+
+.related-value {
+  overflow: hidden;
+  color: #667085;
+  text-overflow: ellipsis;
+  white-space: nowrap;
+}
+
+.album-footer {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  gap: 18rpx;
+  min-height: 56rpx;
+  margin-top: auto;
+  padding-top: 12rpx;
+}
+
+.album-date {
+  flex: 1;
+  min-width: 0;
+  color: #98a2b3;
+  font-size: 25rpx;
+  line-height: 34rpx;
+}
+
+.forward-button {
+  display: flex;
+  flex-shrink: 0;
+  align-items: center;
+  justify-content: center;
+  gap: 8rpx;
+  min-width: 136rpx;
+  height: 56rpx;
+  padding: 0 20rpx;
+  margin: 0;
+  color: #318fe8;
+  line-height: 56rpx;
+  background: #eef8ff;
+  border: none;
+  border-radius: 999rpx;
+}
+
+.forward-button::after {
+  border: none;
+}
+
+.forward-button--hover {
+  opacity: 0.72;
+}
+
+.forward-icon {
+  flex-shrink: 0;
+  width: 28rpx;
+  height: 28rpx;
+}
+
+.forward-text {
+  color: #318fe8;
+  font-size: 26rpx;
+  font-weight: 500;
+  line-height: 56rpx;
+}
+</style>

+ 267 - 3
src/pages/information/components/album/ProductAlbumPanel.vue

@@ -1,7 +1,271 @@
 <template>
-  <view>// 产品相册内容面板</view>
+  <view class="album-panel">
+    <view class="search-section">
+      <view class="search-card">
+        <input
+          v-model="keyword"
+          class="search-input"
+          type="text"
+          confirm-type="search"
+          placeholder="请输入相册名称"
+          placeholder-class="search-placeholder"
+          @input="handleKeywordInput"
+          @confirm="handleConfirmSearch"
+        />
+
+        <view v-if="keyword" class="clear-action" @tap.stop="clearKeyword">
+          <wd-icon name="close" class="clear-icon" />
+        </view>
+      </view>
+    </view>
+
+    <view class="album-list">
+      <ProductAlbumItem
+        v-for="item in albumList"
+        :key="item.id"
+        :item="item"
+        :share-icon-url="SHARE_ICON_URL"
+        :active-tab="ACTIVE_TAB"
+        @select="handleAlbumClick"
+      />
+
+      <view v-if="!loading && albumList.length === 0" class="empty-state">
+        <wd-empty icon="no-content" tip="暂无内容" />
+      </view>
+
+      <view v-if="albumList.length > 0" class="load-more">
+        <text v-if="loading">加载中...</text>
+        <text v-else-if="finished">没有更多了</text>
+        <text v-else>上拉加载更多</text>
+      </view>
+    </view>
+  </view>
 </template>
 
-<script setup lang="ts"></script>
+<script setup lang="ts">
+import { onBeforeUnmount, onMounted, ref } from 'vue'
+
+import { debounce } from '@/plugins/debounce'
+
+import { getAlbumPageApi } from '@/services/modules/information'
+import type { AlbumPageNewItem } from '@/services/modules/information/type'
+
+import { useUserStore } from '@/stores/modules/user'
+
+import ProductAlbumItem from './ProductAlbumItem.vue'
+
+const PAGE_SIZE = 10
+const ACTIVE_TAB = 'album'
+const SHARE_ICON_URL = 'https://yy-cloud-oss.oss-cn-beijing.aliyuncs.com/img/fenxiang.png'
+
+const userStore = useUserStore()
+
+const albumList = ref<AlbumPageNewItem[]>([])
+const loading = ref(false)
+const finished = ref(false)
+const currentPage = ref(1)
+const keyword = ref('')
+const searchName = ref('')
+
+let latestRequestId = 0
+
+const buildRequestParams = (current: number) => {
+  const xcmc = searchName.value.trim()
+
+  return {
+    current,
+    size: PAGE_SIZE,
+    shareUserId: userStore.currentUserInfo?.userId || '',
+    ...(xcmc ? { xcmc } : {}),
+  }
+}
+
+const getAlbumList = async (current = 1, append = false) => {
+  if (append && (loading.value || finished.value)) return
+
+  const requestId = ++latestRequestId
+
+  if (!append) {
+    finished.value = false
+  }
+
+  loading.value = true
+
+  try {
+    const { data } = await getAlbumPageApi(buildRequestParams(current))
+
+    if (requestId !== latestRequestId) return
+
+    const records = Array.isArray(data?.records) ? data.records : []
+    const page = Number(data?.current) || current
+    const pages = Number(data?.pages) || 0
+    const total = Number(data?.total) || 0
+
+    albumList.value = append ? [...albumList.value, ...records] : records
+    currentPage.value = page
+
+    const isLastPage = pages > 0 ? page >= pages : records.length < PAGE_SIZE
+    const isTotalLoaded = total > 0 && albumList.value.length >= total
+
+    finished.value = records.length < PAGE_SIZE || isLastPage || isTotalLoaded
+  } catch (error) {
+    console.error('获取产品相册分页失败:', error)
+
+    uni.showToast({
+      title: '相册加载失败',
+      icon: 'none',
+    })
+  } finally {
+    if (requestId === latestRequestId) {
+      loading.value = false
+    }
+  }
+}
+
+const refresh = async () => {
+  currentPage.value = 1
+  await getAlbumList(1)
+}
+
+const loadMore = async () => {
+  await getAlbumList(currentPage.value + 1, true)
+}
+
+const applySearch = async () => {
+  const nextSearchName = keyword.value.trim()
+
+  if (nextSearchName === searchName.value) return
+
+  searchName.value = nextSearchName
+  await refresh()
+}
+
+const debouncedSearch = debounce(applySearch, {
+  wait: 500,
+  leading: false,
+  trailing: true,
+})
+
+const handleKeywordInput = () => {
+  debouncedSearch()
+}
+
+const handleConfirmSearch = async () => {
+  debouncedSearch.cancel()
+  await applySearch()
+}
+
+const clearKeyword = async () => {
+  if (!keyword.value && !searchName.value) return
+
+  debouncedSearch.cancel()
+  keyword.value = ''
+
+  if (!searchName.value) return
+
+  searchName.value = ''
+  await refresh()
+}
+
+const handleAlbumClick = (item: AlbumPageNewItem) => {
+  if (!item.id) {
+    uni.showToast({
+      title: '相册信息异常',
+      icon: 'none',
+    })
+    return
+  }
+
+  uni.navigateTo({
+    url: `/pages/information/detail/index?type=album&id=${encodeURIComponent(String(item.id))}`,
+  })
+}
+
+onMounted(refresh)
+onBeforeUnmount(debouncedSearch.cancel)
+
+defineExpose({
+  refresh,
+  loadMore,
+})
+</script>
+
+<style lang="scss" scoped>
+.album-panel {
+  min-height: 100%;
+}
+
+.search-section {
+  position: relative;
+  z-index: 1;
+  padding: 24rpx 28rpx 8rpx;
+  background: #fff;
+}
+
+.search-card {
+  position: relative;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  width: 100%;
+  height: 72rpx;
+  overflow: hidden;
+  background: #fff;
+  border: 2rpx solid #edf0f5;
+  border-radius: 999rpx;
+}
+
+.search-input {
+  box-sizing: border-box;
+  width: 100%;
+  height: 72rpx;
+  min-height: 72rpx;
+  padding: 0 88rpx 0 32rpx;
+  font-size: 28rpx;
+  line-height: 72rpx;
+  color: #333;
+  background: transparent;
+  border: 0;
+}
+
+.search-placeholder {
+  color: #9aa3af;
+}
+
+.clear-action {
+  position: absolute;
+  top: 0;
+  right: 8rpx;
+  z-index: 2;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 72rpx;
+  height: 72rpx;
+}
+
+.clear-icon {
+  display: block;
+  font-size: 32rpx;
+  line-height: 32rpx;
+  color: #8f98a8;
+}
+
+.album-list {
+  padding: 20rpx 28rpx 36rpx;
+  background: #fff;
+}
+
+.empty-state {
+  padding: 160rpx 0;
+  text-align: center;
+}
 
-<style lang="scss" scoped></style>
+.load-more {
+  padding: 30rpx 0 36rpx;
+  font-size: 24rpx;
+  line-height: 34rpx;
+  color: #a3acba;
+  text-align: center;
+}
+</style>

+ 0 - 1
src/pages/information/components/page/InformationTabs.vue → src/pages/information/components/shared/InformationTabs.vue

@@ -46,7 +46,6 @@ const handleChange = (value: string): void => {
   display: flex;
   align-items: center;
   background: #fff;
-  border-bottom: 1rpx solid #f2f2f2;
 }
 
 .tab-item {

+ 0 - 0
src/pages/information/components/page/LoginRequiredState.vue → src/pages/information/components/shared/LoginRequiredState.vue


+ 179 - 0
src/pages/information/detail/index.vue

@@ -0,0 +1,179 @@
+<template>
+  <view class="detail-page">
+    <view v-if="detail" class="detail">
+      <view v-if="title" class="detail-title">
+        {{ title }}
+      </view>
+
+      <view v-if="createTime || author" class="detail-meta">
+        <view v-if="createTime">{{ createTime }}</view>
+        <view v-if="author" class="detail-author">{{ author }}</view>
+      </view>
+
+      <view v-if="drugName" class="detail-drug"> 关联药品:{{ drugName }} </view>
+      <view v-if="content" class="detail-content">
+        <MpHtml :content="content" />
+      </view>
+    </view>
+
+    <view v-else class="empty">暂无内容</view>
+  </view>
+</template>
+
+<script setup lang="ts">
+import { computed, ref } from 'vue'
+
+import { onLoad } from '@dcloudio/uni-app'
+import MpHtml from 'mp-html/dist/uni-app/components/mp-html/mp-html'
+
+import { getAlbumByIdApi, getArticleByIdApi } from '@/services/modules/information'
+import type { AlbumPageNewItem, ArticleItem } from '@/services/modules/information/type'
+
+type DetailType = 'academic' | 'album'
+type DetailItem = ArticleItem | AlbumPageNewItem
+
+interface PageQuery {
+  id?: string
+  type?: DetailType
+}
+
+const detail = ref<DetailItem>()
+const detailType = ref<DetailType>('academic')
+
+const isArticle = computed(() => detailType.value === 'academic')
+
+const articleDetail = computed(() => detail.value as ArticleItem | undefined)
+const albumDetail = computed(() => detail.value as AlbumPageNewItem | undefined)
+
+const title = computed(() => {
+  return isArticle.value ? articleDetail.value?.title : albumDetail.value?.xcmc
+})
+
+const createTime = computed(() => detail.value?.createTime?.slice(0, 10) || '')
+
+const author = computed(() => {
+  return isArticle.value ? articleDetail.value?.author : albumDetail.value?.createUser || ''
+})
+
+const drugName = computed(() => {
+  if (isArticle.value) return ''
+  return albumDetail.value?.glypName || albumDetail.value?.glyp || ''
+})
+
+const content = computed(() => {
+  const html = isArticle.value ? articleDetail.value?.content : albumDetail.value?.wb
+
+  return formatRichText(html || '')
+})
+
+onLoad((query) => {
+  const { id, type = 'academic' } = query as PageQuery
+
+  if (!id) return
+
+  detailType.value = type
+
+  void getDetail(id)
+})
+
+const getDetail = async (id: string): Promise<void> => {
+  try {
+    const { data } =
+      detailType.value === 'academic' ? await getArticleByIdApi(id) : await getAlbumByIdApi(id)
+
+    detail.value = data
+  } catch (error) {
+    console.error('get detail failed:', error)
+
+    uni.showToast({
+      title: '详情加载失败',
+      icon: 'none',
+    })
+  }
+}
+
+const formatRichText = (html: string): string => {
+  return html
+    .replace(
+      /<img\b(?![^>]*\bstyle=)/gi,
+      '<img style="max-width:100%;height:auto;display:block;margin:20rpx 0;"'
+    )
+    .replace(
+      /<video\b(?![^>]*\bstyle=)/gi,
+      '<video style="width:100%;height:auto;display:block;margin:20rpx 0;"'
+    )
+}
+</script>
+
+<style lang="scss" scoped>
+.detail-page {
+  min-height: 100vh;
+  background-color: #ffffff;
+}
+
+.detail {
+  padding: 36rpx 30rpx 60rpx;
+}
+
+.detail-title {
+  color: #222222;
+  font-size: 42rpx;
+  font-weight: 600;
+  line-height: 1.45;
+}
+
+.detail-meta {
+  margin-top: 18rpx;
+  color: #999999;
+  font-size: 26rpx;
+  line-height: 1.5;
+}
+
+.detail-author {
+  margin-top: 24rpx;
+}
+
+.detail-drug {
+  margin-top: 24rpx;
+  padding: 18rpx 20rpx;
+  border-left: 6rpx solid #3b82f6;
+  border-radius: 8rpx;
+  background-color: #f5f8ff;
+  color: #4b5563;
+  font-size: 26rpx;
+  line-height: 1.5;
+}
+
+.detail-content {
+  margin-top: 34rpx;
+  color: #333333;
+  font-size: 31rpx;
+  line-height: 1.8;
+  word-break: break-word;
+}
+
+.empty {
+  padding: 120rpx 30rpx;
+  color: #999999;
+  font-size: 28rpx;
+  text-align: center;
+}
+
+:deep(p) {
+  margin: 0 0 22rpx;
+}
+
+:deep(img) {
+  max-width: 100%;
+  height: auto;
+  display: block;
+  margin: 20rpx 0;
+}
+
+:deep(video) {
+  width: 100%;
+  height: auto;
+  display: block;
+  margin: 20rpx 0;
+}
+</style>

+ 2 - 2
src/pages/information/index.vue

@@ -21,8 +21,8 @@ import { useUserStore } from '@/stores/modules/user'
 
 import AcademicInfoPanel from './components/academic/AcademicInfoPanel.vue'
 import ProductAlbumPanel from './components/album/ProductAlbumPanel.vue'
-import InformationTabs from './components/page/InformationTabs.vue'
-import LoginRequiredState from './components/page/LoginRequiredState.vue'
+import InformationTabs from './components/shared/InformationTabs.vue'
+import LoginRequiredState from './components/shared/LoginRequiredState.vue'
 
 type TabKey = 'academic' | 'album'
 

+ 23 - 1
src/services/modules/information/index.ts

@@ -1,5 +1,12 @@
 import http from '../../index'
-import type { ArticlePageRequest, ArticlePageResponse } from './type'
+import type {
+  AlbumPageNewItem,
+  AlbumPageNewRequest,
+  AlbumPageNewResponse,
+  ArticleItem,
+  ArticlePageRequest,
+  ArticlePageResponse,
+} from './type'
 
 export const getArticlePageApi = (data: ArticlePageRequest) => {
   return http.get<ArticlePageResponse>(`/admin/api/getArticlePage`, data, {
@@ -7,3 +14,18 @@ export const getArticlePageApi = (data: ArticlePageRequest) => {
     loadingText: '加载中...',
   })
 }
+
+export const getAlbumPageApi = (data: AlbumPageNewRequest) => {
+  return http.get<AlbumPageNewResponse>(`/admin/api/getAlbumPageNew`, data, {
+    loading: true,
+    loadingText: '加载中...',
+  })
+}
+
+export const getArticleByIdApi = (id: string) => {
+  return http.get<ArticleItem>(`/admin/api/getArticleById?id=${id}`)
+}
+
+export const getAlbumByIdApi = (id: string) => {
+  return http.get<AlbumPageNewItem>(`/admin/api/getAlbumById?id=${id}`)
+}

+ 39 - 0
src/services/modules/information/type.d.ts

@@ -42,3 +42,42 @@ export interface ArticleItem {
   updateTime: string | null
   updateUser: string | null
 }
+
+export interface AlbumPageNewRequest {
+  current: number
+  size: number
+  shareUserId: string
+  xcmc?: string
+}
+
+export interface AlbumPageNewResponse {
+  current: number
+  hitCount: boolean
+  optimizeCountSql: boolean
+  orders: unknown[]
+  pages: number
+  records: AlbumPageNewItem[]
+  searchCount: boolean
+  size: number
+  total: number
+}
+
+export interface AlbumPageNewItem {
+  id: string
+  xcmc: string
+  scfm: string
+  createTime: string
+  createUser: string | null
+  delFlag: number
+  deptId: string | null
+  enableFlag: number
+  forwardNum: number
+  glyp: string
+  glypName: string | null
+  score: number | null
+  temp1: string
+  tenantId: number
+  updateTime: string | null
+  updateUser: string | null
+  wb: string
+}