We introduce a new approach to the enumeration of rational slope parking functions with respect to the <mathrm>area</mathrm> and a generalized <mathrm>dinv</mathrm> statistics, and relate the combinatorics of parking functions to that of affine permutations. We relate our construction to two previously known combinatorial constructions: Haglund's bijection ζ exchanging the pairs of statistics (<mathrm>area</mathrm>,<mathrm>dinv</mathrm>) and (<mathrm>bounce</mathrm>, <mathrm>area</mathrm>) on Dyck paths, and Pak-Stanley labeling of the regions of k-Shi hyperplane arrangements by k-parking functions. Essentially, our approach can be viewed as a generalization and a unification of these two constructions.