Regulate the direct-indirect electronic band gap transition by electron-phonon interaction in BaSnO3