<template>
  <layout-page class="ss-m-x-15">
    <SwiperAd :list="swiperAdListTest"></SwiperAd>
    <view class="card">
			<uni-list>
				<uni-list-item v-for="item in list" :clickable="true" :key="item.title" :title="item.title" showArrow :rightText="item.rightTex || ''" @click="handleToLink(item)"></uni-list-item>
			</uni-list>
		</view>
  </layout-page>
</template>

<script setup>
import SwiperAd from '@/components/SwiperAd'
import layoutPage from '@/layout'
import { swiperAdListTest } from '@/utils/testData'
import { getAccessToken } from '@/utils/request'
import { showAuthModal } from '@/hooks/useModal'

const list = [
	{	title: '附件简历',	path: '/pagesA/resume/index'	},					
	{ title: '我的收藏', path: '/pagesA/collect/index' },
	{ title: '前往门墩儿甄选商城', appId: 'wx6decdf12f9e7a061' },
	{ title: '切换为招聘者', rightTex: '我要招人' }
]

// 列表跳转
const handleToLink = (item) => {
	if (item.appId) {
		uni.navigateToMiniProgram({
			appId: item.appId,
			// extraData: {} // 要传递的数据
		})
		return
	}
	if (!item.path) return
  if (!getAccessToken()) {
		uni.showToast({
			title: '请先登录',
			icon: 'none'
		})
		showAuthModal()
		return
	}
	uni.navigateTo({
		url: item.path
	})
}
</script>

<style scoped lang="scss">
::v-deep .uni-list-item{
	height: 140rpx !important;
	line-height: 140rpx !important;
}
::v-deep .uni-list-item__content-title{
	font-size: 32rpx !important;
	font-weight: 500;
}
</style>
