<template>
	<view>
		<view style="margin-top: 4upx;" class="bg-white flex justify-between align-center padding"
			v-for="(item,index) in dataList" :key='index' @click="goDet(item)">
			<view class="text-lg">{{index+1}}.{{item.title}}</view>
			<image v-if="globalImages" :src="globalImages + 'imgs/static/image/go.png'" style="width: 20rpx;height: 34rpx;" mode="aspectFill"></image>
		</view>

	</view>
</template>

<script>
	import { waitForGlobalImages } from '@/utils/globalImageLoader'
	export default {
		data() {
			return {
				page: 1,
				limit: 10,
				dataList: [],
				globalImages: '',

			}
		},
		onLoad() {
			this.getDataList()
			waitForGlobalImages().then((path) => {
				console.log('✅ 全局图片路径:', path)
				this.globalImages = path
			  })
		},
		methods: {
			getDataList() {
				let data = {
					page: this.page,
					limit: this.limit,
					type: 2
				}
				this.$Request.getT("/app/trainingCenter/trainingCenterList", data).then(res => {
					this.dataList = res.data.list
				})
			},
			goDet(e) {
				uni.navigateTo({
					url: '/my/help/trainingCenter?id=' + e.trainingId
				})
				
			}
		},
		onReachBottom: function() {
			this.page = this.page + 1;
			this.getDataList();
		},
	}
</script>

<style>
</style>
