The number of spanning trees of a class of self-similar fractal models