Finite-state impedance control has been widely used in powered lower limb prosthesis. However, this method divides a certain gait into multiple phases, and each phase requires tuning some parameters through a large number of subject experiments. It is necessary to develop an effective unified controller for each gait, which can switch easily between different task modes. In this paper, a unified controller based on virtual constraint is designed for powered ankle-knee prosthesis, and a multi-Task control method that is capable of switching different locomotion modes is developed. To achieve multi-Task control, we first designed a stair ascent controller based on a piecewise phase variable utilizing the periodicity of the hip angle. The controller divides the gait into five phases, and the phase transition only changes the calculation formula of the phase variable without changing the controller parameters so that uniform control of the different phases can be achieved. Secondly, we proposed a supervisory method to switch between the level walking and stair ascent task modes. Simulation results confirmed that the unified controller of the gait can stably control the prosthesis at different speeds and the supervisory method can realize the transition of multiple motion gaits.