Generalized semiparametric varying-coefficient models for longitudinal data