The distributed nonconvex constrained optimization problem with equality and inequality constraints is researched in this paper, where the objective function and the function for constraints are all nonconvex. To solve this problem from a control perspective, a virtual reference-based convex penalty function is added to the augmented Lagrangian function. Then, based on the primal-dual technique, a two-timescale distributed approach is designed based on the consensus scheme. The slower subsystem aims to ensure the optimality, and the faster subsystem intends to guarantee the stability. Finally, three cases are presented to illustrate the approach's effectiveness.