The safe and efficient delivery of drugs is regarded as a fundamental strategy for enhancing the low effectiveness of cancer treatments. Herein, a simple preparation approach for a multifunctional drug delivery system was reported. The novel structure of spiropyran (SP), 1-(6 ´-bromo-hexyl)−3,3-dimethyl indoline-6 ´ -methoxy benzopyran, was used to modify sodium carboxymethyl cellulose (NaCMC) for controlling drug release. SP has a heightened sensitivity to variations in pH, with a linear response range of .2–5.5. The elevated drug loading (31.68 %) can be attributed to the hydrophobic interaction of SP and the adsorption of NaCMC. Porous materials composed of zinc ions and dimethylimidazole (ZIF-8) as an embedded shell, which serves as a barrier that effectively reduces drug leakage from 20 % to 12 %, thus mitigating the side effects of camptothecin (CPT) in alkaline conditions. In acidic conditions, the collapse of ZIF-8 provides zinc ions that act as crosslinking agents for NaCMC, thereby improving the channel of drug release and enhancing the release amount from 51.9 % to 66.7 % compared with SP-grafted NaCMC micelles. The inherent biological adhesion of NaCMC ensures sustained drug release for a period of up to 40 h. These pH-responsive carriers hold great promise in the safe and effective treatment of cancer in the gastrointestinal tract, with CPT emerging as a highly promising candidate.