During the construction and operation of the lunar gateway in the artemis program, a large number of cargo and crew rendezvous missions will be conducted in the near-rectilinear halo orbit (NRHO). Addressing the optimization of phase orbits in NRHO, based on the circular restricted three-body problem (CRTBP) model, the transfer time is first traversed using the trust-region methods. Subsequently, the position is locally optimized using a nonlinear optimization algorithm. Finally, the velocity increment is reduced by iteratively solving nonlinear equations, achieving NRHO phasing with low fuel consumption. For the problem of fuel cost, the method analyzes orbital transfer scenarios with different transmission time and phase relationships in NRHO. The results show that the algorithm has high computational efficiency, reducing computation time by 53.2% compared to the genetic algorithm; the longer the transfer time (the more transfer orbit revolutions), the smaller the velocity increment consumed; selecting the outer loop of NRHO for phasing saves fuel when the target spacecraft lags in phase, while the inner loop saves fuel otherwise; the transfer cost is lower when the tracking spacecraft departs from the perilune.