The transverse momentum spectra of J/ψ, ψ2S, and YnS,n=1,2,3 produced in proton-proton p+p, proton-antiproton p+p¯, proton-lead p+Pb, gold-gold Au+Au, and lead-lead (Pb+Pb) collisions over a wide energy range are analyzed by the (two-component) Erlang distribution, the Hagedorn function (the inverse power-law), and the Tsallis-Levy function. The initial temperature is obtained from the color string percolation model from the fit by the (two-component) Erlang distribution in the framework of a multisource thermal model. The excitation functions of several parameters such as the mean transverse momentum and initial temperature increase from 39 GeV to 13 TeV, which is considered in this work. The mean transverse momentum and initial temperature decrease (increase slightly or do not change significantly) with the increase of rapidity (centrality). Meanwhile, the mean transverse momentum of YnS,n=1,2,3 is larger than that of J/ψ and ψ2S, and the initial temperature for YnS,n=1,2,3 emission is higher than that for J/ψ and ψ2S emission, which shows a mass-dependent behavior.