E-bikes are ramping up in popularity these days. You can buy very capable e-bikes, though they are not inexpensive. Of
course, compared to a car, they are pretty cheap. And the operating cost per mile is hard to beat.
Regarding your question of having two batteries, and charging one while using the other on the trip...that is largely impractical. Here's why:
If you're thinking
solar, it takes a ginormous
solar panel to make even 100 watts. Where do you mount such a panel? It will probably act like a sail and knock you or the bike over with a good gust.
If you're thinking of charging the 2nd battery by pedaling, a typical fit human can product 60-100 watts of electricity if you pedal like mad. That's not a ton of electricity to recharge a sizable battery. And the bigger problem is you always lose some efficiency when you change the form of
energy. Thus, it will always be more efficient to use the pedaling energy to drive the bike directly. If you make electricity first, and then charge the battery, and then use the battery to drive the electric motor, you would be lucky to put 60% of your original pedaling energy to the wheel of the bike.
What you can do, fairly efficiently on an e-bike, is "help" the electric drive system by pushing the pedals around. This reduces the draw on the motor and battery and extends range.
There is a ton of how to articles on the web about how to make an ebike by converting a regular pedal bike. My wild guess is that you can build an e-bike for 40 or 50% less than buying one of the same capacity/range.
Here's a couple resources to get you started.
https://www.electricbike.com/category/build/diy/
http://www.instructables.com/id/How-to-build-an-electric-bike-for-less-than-100/
http://www.wikihow.com/Build-an-Inexpensive-Electric-Bicycle