Urban delivery, especially the last-mile delivery, has become an increasingly important area in the global supply chain along with the boom of e-commerce. Delivery companies and merchants can introduce some innovative solutions such as the equipment of autonomous vehicles (AVs) to decrease their operating costs, environmental impact, and social risks during the delivery process. This research mainly develops a mathematical model to get the best allocation of AVs among city logistics centers (CLCs) as a mixed delivery method. The advantage of the presented model stems from considering the equipment cost, the delivery cost, and the CO2 emission, which is measured through social carbon cost (SCC). In addition, this research establishes a risk model considering the impact of seasonal variations to evaluate the infection risk of delivery during pandemic periods for four potential delivery scenarios: customers going to CLCs, ordering online and picking-up at CLCs, delivering by traditional vehicles (TVs), and delivering by the mixed method with the optimal allocation of AVs.