Here we report a rational design and preparation of luminescent COFs via the synergetic interaction of electron-rich and electron-deficient moieties. 4,4′,4′-(1,3,5-triazine-2,4,6-triyl) trianiline (TTA) with the electron-deficient unit and 2,6-diformyl-4-methylphenol (Dp) with the electron-rich moiety and −OH group were employed to synthesize the imine-linked DpTTA-COF. The intramolecular charge transfer enables DpTTA-COF to present a strong solvent polarity-dependent color change, based on which a solvatochromic sensor was successfully established. We demonstrate an emission wavelength and intensity dual-mode photoluminescent sensor for the detection of trace water in organic solvents with good sensitivity, reversibility and stability. In addition, the dual-signal solvatochromic sensor is also capable for organic solvents decoding. This work proposes a new strategy for the design and preparation of COFs with fascinating solvatochromic effect. This strategy could extend the application field of COFs by the integration of functional groups, affinity, and structural selectivity.