| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 | <!-- 招聘会 --><template>  <view>    <Navbar title="招聘会" />    <view class="box defaultBgc" :style="{'padding-top': navbarHeight + 'px', 'min-height': `calc(100vh - ${(navbarHeight + 100)}px)`}" style="padding-bottom: 100px;">      <view v-if="items.length">        <view class="commonBackground"></view>        <view v-for="val in items" :key="val.id" @tap="handleToJobFairEnterprises(val)" class="list-item defaultBgc default-border">          <image v-if="val?.previewImg" class="ss-m-t-10" :src="val.previewImg" mode="widthFix" style="width: 100%; height: auto; border-radius: 6px;"></image>          <view class="ss-m-t-20 MiSans-Normal">活动时间:{{ timesTampChange(val.startTime, 'Y-M-D') }}至{{ timesTampChange(val.endTime, 'Y-M-D') }}</view>          <button class="ss-m-t-20 ss-m-b-10 MiSans-Medium" style="background-color: #00B760; color: #fff;" type="primary">查看详情</button>        </view>      </view>      <view v-else>        <view class="commonBackground"></view>        <view class="nodata-img-parent" :style="{'height': `calc(100vh - ${(navbarHeight + 100)}px)`}">          <image src="https://minio.citupro.com/dev/static/nodata.png" mode="widthFix" style="width: 100vw;height: 100vh;"></image>        </view>      </view>    </view>  </view></template><script setup>import { onShow, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'import { ref }  from 'vue'import { getJobFairList } from '@/api/jobFair'import { timesTampChange } from '@/utils/date'import Navbar from '@/components/Navbar'const navbarHeight = ref(uni.getStorageSync('navbarHeight'))// 设置自定义tabbar选中值onShow(() => {  const currentPage = getCurrentPages()[0];  // 获取当前页面实例  const currentTabBar = currentPage?.getTabBar?.();  // 设置当前tab页的下标index  currentTabBar?.setData({ selected: 3 });})const items = ref([])// 获得招聘会列表const getList = async () => {  const res = await getJobFairList()  items.value = res?.data || []}getList()//招聘会const handleToJobFairEnterprises = (val) => {  if (!val?.id) {    uni.showToast({ title: '进去招聘会失败!', icon: 'none' })  }  let url = `/pagesB/jobFair/${Number(val?.category) ? 'positionClassification': 'enterprisesClassification'}?jobFairId=${val.id}`	uni.navigateTo({url})}const getShareParams = () => {  return {    title: '门墩儿-招聘会',    path: '/pages/index/jobFair',  }}// 转发朋友onShareAppMessage(() => {  return getShareParams()})// 转发朋圈onShareTimeline(() => {  return getShareParams()})</script><style lang="scss" scoped>.list-item {  margin: 0 30rpx 30rpx 30rpx;  border-radius: 20rpx;  padding: 30rpx;  position: relative;  box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);  view {    font-size: 28rpx;    color: #666;  }}</style>
 |