Diet during pregnancy is crucial to maternal metabolism and fetal development, so exploring the most potent food risk factor could improve maternal and child health. In this study, we investigated the diet and lifestyle of 833 healthy pregnant women in the second trimester from November 2020 to August 2021. Based on the Tianjin Antenatal Care System in China, we followed up with these women and recorded their gestational weight gain (GWG) and newborn birth weight. We conducted a dietary survey through FFQ based on the food groups recommended by the Chinese Dietary Guidelines and included common ultra-processed foods. We collected 219 semi-quantitative FFQs and 614 self-reported FFQs for analysis. According to the consumption frequency of 12 food groups, 4 dietary patterns were extracted by principal component analysis. We analyzed the associations of food energy, consumption frequency, and dietary patterns with GWG and birth weight, especially GWG in the first and second trimesters (f-GWG). The results showed that f-GWG was positively correlated with food energy. Beverage consumption was associated with f-GWG (r = 0.288, P = .026) in obese pregnant women. A dietary pattern that favors high consumption of ultra-processed foods (fried foods, baked desserts, and sweet beverages) was associated with increased GWGs. Non-obesity women with high consumption of baked desserts and sweet beverages had higher GWGs (P < .05). After adjusting for confounding factors (including total energy, physical activity, and sleep quality), only sweet beverage consumption was associated with f-GWG (β 0.498, 95%CI 0.153-0.843) and birth weight (β 0.124, 95%CI 0.009-0.240). Sweet beverage consumption is a key adjustable risk factor for prenatal care.