The increasing discharge of dyes and antibiotic pollutants in water has brought serious environmental problems. However, it is difficult to remove such pollutants effectively by traditional sewage treatment technologies. Semiconductor photocatalysis is a new environment-friendly technique and is widely used in aqueous pollution control. TiO2 is one of the most investigated photocatalysts; however, it still faces the main drawbacks of a poor visible-light response and a low charge-separation efficiency. Moreover, powder photocatalyst is difficult to be recovered, which is another obstacle limiting the practical application. In this article, g-C3N4/TiO2 heterojunction is simply immobilized on a glass substrate to form an all-solid-state Z-scheme heterojunction. The obtained thin-film photocatalyst was characterized and applied in the visible-light photodegradation of colored rhodamine B and tetracycline hydrochloride. The photocatalytic performance is related to the deposited layers, and the sample with five layers shows the best photocatalytic efficiency. The thin-film photocatalyst is easy to be recovered with stability. The active component responsible for the photodegradation is identified and a Z-scheme mechanism is proposed.