Accurate diagnosis and efficient treatment of tumors are highly significant in battling cancer. Near-infrared II (NIR-II) fluorescence imaging shows big promise for deep tumor visualization in living systems due to high temporal and spatial resolution and deep tissue penetration capability, whereas the development of efficient NIR-II probes for tumor theranostics still faces a huge challenge. Herein, we have designed and constructed intelligent mPEG5000-PCL3000-encapsulated NIR-II nanoprobe ZM1068-NPs that showed great chemical stability and excellent biocompatibility. With the merits of the strong fluorescence in the NIR-II region and prominent optical-thermal conversion efficiency, this probe was successfully used for NIR-II imaging-guided surgery and photothermal therapy of breast carcinoma in living mice. More notably, it was for the first time found that ZM1068 dyes could be covalently on-site-immobilized within tumors through the thiol-chlor nucleophilic substitution reaction, resulting in improved tumor accumulation and retention time. We thus envision that this probe may provide an attractive means for precise cancer diagnosis and treatment.