The invention discloses synthesis of a probe detecting a copper ion (Cu<2+>) and a nickel ion (Ni<2+>) by a colorimetric method, and an application in detection of Cu<2+> and Ni<2+> in a water sample.A structural formula of the molecular probe is as follows as shown in the specification. The molecular probe can give different complex reactions with Cu<2+> and Ni<2+> in an aqueous solution to showdifferent colors so as to achieve the purpose of simultaneously detecting Cu<2+> and Ni<2+> by colorimetry; a detection solution is changed to bright red from yellow after complexing of the probe andCu<2+>; the detection solution is changed to purple after complexing of the probe and Ni<2+>; a color change is obvious; a detection speed is high; and the differentiation is easy. High-sensitivity detection of Cu<2+> and Ni<2+> can be achieved in combination with ultraviolet spectrophotometry; the probe can directly detect a micro level of Cu<2+> and Ni<2+> in the water; and the limits of detection are as low as 2.1nM and 1.2nM respectively. When a pH (potential of hydrogen) is 4-10, the probe can highly sensitively detect Cu<2+> and Ni<2+> in the water sample, is simple to operate and goodin selectivity and has a higher application value in the fields of environmental science, analysis, detection and the like.