Intercropping, as a common worldwide cultivation pattern, provides opportunities for sustainable agriculture with fuller use of light, temperature and land resources and greater yield per unit of land. The intercropping impact on crop quality is a current focus. This study found that shading cultivation of purple-fleshed sweet potato can improve the storage root pigment accumulation by more than 20% to increase economic benefits. We performed gas chromatography and mass spectrometry analysis of storage roots of the anthocyanin-enriched cultivar Jihei-1 under 60% shading and nonshaded treatments. A total of 224 differential metabolites were identified, among which N-acetyl-5-hydroxytryptamine, 1-monopalmitin, 4-pyridoxic acid, dodecano, arbutin, tryptophan, citrulline and phenylalanine were significantly upregulated under shading with a more than 10-fold change. Furthermore, metabolic pathway enrichment maps were based on the biological processes and stratification level selected. These metabolites mainly influenced the pathways of phenylpropanoid biosynthesis, the citrate cycle, organic acid biosynthesis and metabolism and amino acid metabolism. Through tissue-specific dynamic changes in amino acids, soluble sugars, starch and anthocyanins during storage root development, we proposed a variety-specific strategy of purple-fleshed sweet potato in response to prolonged deep shading, that is, utilizing and enhancing broad aboveground-tissue photosynthesis and transferring photosynthates into roots in advance, leading to a rapid increase in storage root anthocyanin synthesis. With comprehensive qPCR, western blot and enzyme activity analyses, we identified three key enzymes, CHS, ANS and 3GT, in purple-fleshed sweet potato storage roots in response to shading, which affect the root anthocyanin content by influencing the flavonoid metabolism pathway. This study provides a theoretical basis for revealing the regulation of anthocyanin synthesis in crops and a guidance for high-quality sweet potato cultivation and nutritional improvement using shade facilities.