Silver nanowires (Ag NWs)/glass transparent conductive film was prepared by one-step spin coating method. l-Cysteine (L-Cys) functionalized Ag NWs were employed for the surface-enhanced Raman scattering (SERS) detection, which was used to evaluate the photoelectric performance by detecting heavy metal Hg2+ ions. The L-Cys functionalized Ag NWs/glass transparent conductive film exhibits selective, rapid and sensitive detection to Hg2+. The limit of Hg2+ detection reaches 10−9 M, which is ten times lower than the maximum Hg2+ concentration in drinking water set by the US Environmental Protection Agency. Furthermore, this dual-function of transparent conductive silver sensor has high accuracy, and reliability, which provides new insights into the design of rapid and sensitive SERS detection of mercury ions, and indicates a great potential for efficient heavy metal detection.