<template>
  <view class="">
    <mescroll-body
      @init="mescrollInit"
      @down="downCallback"
      @up="upCallback"
      :up="{
        empty: {
          use: false,
        },
      }"
    >
    <view>
      <view class="h-188px w-full" v-if="detail.cover">
        <image class="w-full" mode="aspectFill" :src="detail.cover" />
      </view>
      <view class="min-h-screen relative bg-hex-1b2f85 p-3">
        <image class="absolute left-0 w-full top-0" mode="widthFix" :src="`${config.baseUrl}/images/mini-bg.jpg`"></image>
        <view class="bg-white rounded-12px relative">
            1111
        </view>
      </view>
    </view>
    </mescroll-body>
  </view>
</template>
<script setup>
import { onPageScroll, onReachBottom, onLoad } from '@dcloudio/uni-app'
import useMescroll from '@/uni_modules/mescroll-uni/hooks/useMescroll.js'
import { queryActivitiesDetail } from '@/api/xinjiang_guess'
import config from '@/common/config'
import { ref } from 'vue'
const activityId = ref(null)
const userId = ref(null)
const detail = ref({})
const { mescrollInit, downCallback, getMescroll } = useMescroll(
  onPageScroll,
  onReachBottom
)

onLoad((query) => {
  activityId.value = query.activity_id
  userId.value = query.user_id
})

const upCallback = (mescroll) => {
  const { size, num } = mescroll
  if (num === 1) getActiveDetail()
}

const getActiveDetail = async () => {
  try {
    const resData = await queryActivitiesDetail({ id: activityId.value })
    detail.value = resData.data
  } catch (error) {}
}
</script>
