trainingExperience.js 1.26 KB
const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/supervisor-miniprogram/'

Component({
  properties: {
    detailInfo: {
      type: Object,
      value: {},
    },
  },
  data: {
		IMG_URL,
		topStats: [
			{ label: '学习时长', value: 20 },
			{ label: '完成课程数', value: 22 },
			{ label: '带教次数', value: 2 }
		],
		tabs: [
			{ key: 'course', label: '课程学习' },
			{ key: 'coach', label: '督导带教' }
		],
		activeTab: 'course',
		courseList: [
			{
				id: 1,
				title: '客情维护客户画像的重要性',
				completedAt: '2026-03-01 12:56:37'
			},
			{
				id: 2,
				title: '客情维护客户画像的重要性',
				completedAt: '2026-03-01 12:56:37'
			}
		],
		coachList: [
			{
				id: 1,
				title: '督导带教',
				coachedAt: '2026-03-01 12:56:37'
			},
			{
				id: 2,
				title: '督导带教',
				coachedAt: '2026-03-01 12:56:37'
			}
		]
	},
  methods: {
		search(e) {
			this.triggerEvent('search', e?.detail || {})
		},
		onTabTap(e) {
			const { key } = e.currentTarget.dataset || {}
			if (!key || key === this.data.activeTab) return
			this.setData({ activeTab: key })
		},
		onViewItem(e) {
			const { type, item } = e.currentTarget.dataset || {}
			this.triggerEvent('view', { type, item })
		}
	},
})