The invention provides a triphenylamine-benzopyran onium salt derivative NIR-BT-P as well as a synthesis method and application thereof. The derivative NIR-BT-P has a Chinese name of (E)-6-(diethylamino)-4-(4 (diphenylamino) benzylidene)-1, 2, 3, 4 tetraoxypyrimidine, and the derivative NIR-BT-P has a structural formula shown in the description. The invention relates to a preparation method of a diethylene glycol dimer, which is characterized in that the diethylene glycol dimer has an English name of (E)-6-(diethylene glycol dimer)-4-(4 (diethylene glycol dimer)-1, 2, 3, 4 tetraethylene glycol dimer, and the English name of the diethylene glycol dimer is (E)-6-(diethylene glycol dimer)-4 (4)-1, 2, 3, 4 tetraethylene glycol dimer. The derivative NIR-BT-P is used as a fluorescent probe, and in different organic solvents, detection of polarity by different fluorescence intensity signals is realized through a fluorospectro photometer. According to the method, the difference of polarities in cancer cells and normal cells in a living body is utilized, so that the near-infrared fluorescence imaging is used for distinguishing and detecting tumor tissues and normal tissues in the living body.