your question is very difficult. In the first phrase, 'de' make sense that you speak of 'légumes' et 'fruits' like a sort of food, that's why you use 'de'. If u'd say just 'je mange des fruits' it means simply that actually you eat fruits, with no refer to a sort af food. (it can't have a general sense). 'De' makes implicite that u eat also other sorts of food.. In the second phrase, it is inverse. 'je ne mange que des fruits' would mean that u eat this sort of food exclusively. I hope it's clear.

When you say "Je mange beaucoup de fruits", you do specify how much. This changes everything, as you can't use du, de la or des (some) with a quantity. You have to use de or d' (of), just like you would in English (I eat a lot of fruit).