gaoluyang
3 天以前 ee42bf1badae06026efa79dc17d2a541297ab49b
src/pages/cooperativeOffice/clientVisit/index.vue
@@ -94,23 +94,23 @@
          
          <!-- 按钮区域 -->
          <view class="action-buttons">
            <van-button
            <u-button
              type="primary"
              size="small"
              class="action-btn"
              @click="viewDetail(item.id)"
            >
              查看详情
            </van-button>
            <van-button
              type="danger"
            </u-button>
            <u-button
              type="error"
              size="small"
              plain
              class="action-btn"
              @click="deleteRecord(item.id)"
            >
              删除
            </van-button>
            </u-button>
          </view>
        </view>
      </view>
@@ -134,6 +134,13 @@
import { getVisitRecords, deleteVisitRecord } from '@/api/cooperativeOffice/clientVisit'
import useUserStore from "@/store/modules/user"
// 替换 toast 方法
defineOptions({name: 'client-visit-index'})
const showToast = (message) => {
  uni.showToast({
    title: message,
    icon: 'none'
  })
}
import dayjs from "dayjs"
@@ -158,6 +165,7 @@
// 查询列表
const getList = () => {
  showLoadingToast('加载中...')
  const params = {
    current: -1,
    size: -1,
@@ -166,12 +174,27 @@
  getVisitRecords(params)
    .then((res) => {
      visitList.value = res.records || res.data?.records || []
      closeToast()
    })
    .catch(() => {
      closeToast()
      showToast('获取数据失败')
    })
}
// 显示加载提示
const showLoadingToast = (message) => {
  uni.showLoading({
    title: message,
    mask: true
  });
};
// 关闭提示
const closeToast = () => {
  uni.hideLoading();
};
// 新增拜访 - 跳转到登记页面
const addVisit = () => {
  uni.navigateTo({