Welcome to WebmasterWorld Guest from 22.214.171.124
Redirecting the links to an intermediate page that is blocked from search engines with a robots.txt file
Adding a rel="nofollow" attribute to the <a> tag
[edited by: aakk9999 at 7:04 pm (utc) on Nov 3, 2013]
I presume the problem is losing the hash tag (#) when redirecting to intermediate page?
The other way that crosses my mind is to have an affiliate link that uses your own query string parameter, which then gets turned to hash tag (#) in your redirect script.
We also know that Google changed how they handle urls blocked by robots.txt, they are now indexed without a description when they used to be left out of results.
Amazon uses rel=canonical to point to the appropriate non-affiliate URL and has turned their affiliates into link builders. Google appears okay with this, so maybe you should look into it.
You have Google ignoring nofollow tags to big brand sites that GOOGLE trusts while also treating intermediate links being blocked by robots.txt as if they are just a bridge. The link value jumps from the affiliate site to the big brand site despite nofollow AND robots.txt and it can do it through multiple jumps and even through multiple domains.