Tunable interlayer excitons and switchable interlayer trions via dynamic near-field cavity