Sensing detection of Hg2+ and Cu2+ with use of a single organic probe is of practical importance, but there still remains a great challenge to implement the detection in pure aqueous media while avoiding mutual interference. Herein, a novel polymer chemosensor, P(META-co-RhBH–HB–Ac), was fabricated by incorporating rhodamine hydrazone moieties into a quaternary ammonium-type poly(ionic liquid). With the positively charged character of polymeric backbone, the P(META-co-RhBH–HB–Ac) exhibited a high solubility in water, and possessed a potential advantage in minimizing nonspecific binding. More importantly, the P(META-co-RhBH–HB–Ac) could serve as a dual-analyte chemosensor for differential recognition of Hg2+ and Cu2+ in pure aqueous media based on unique UV irradiation-dependent response behaviors. Specifically, Hg2+ was exclusively sensed through fluorescence enhancement in the absence of UV irradiation, while selective colorimetric response to Cu2+ was achieved under UV irradiation. Particularly, benefitting from the electrostatic effect of META units on RhBH–HB–Ac receptors, the P(META-co-RhBH–HB–Ac) could discriminate Hg2+ and Cu2+ under their coexistence without occurrence of mutual interference. Consequently, selective and differential determination of Hg2+ and Cu2+ under pure aqueous conditions was achieved, which proved to be applicable for quantitative analysis of real water samples.