Rapid detection of foodborne pathogens is crucial to prevent the outbreaks of foodborne diseases. In this work, we proposed a novel microfluidic biosensor based on magnetorheological elastomer (MRE) and smartphone. First, micropump and microvalves were constructed by deforming the MRE under magnetic actuation and integrated into the microfluidic biosensor for fluidic control. Then, the micropump was used to deliver immune porous gold@platinum nanocatalysts (Au@PtNCs), bacterial sample, and immunomagnetic nanoparticles (MNPs) into a micromixer, where they were mixed, incubated and magnetically separated to obtain the Au@PtNC-bacteria-MNP complexes. After 3,3′,5,5′-tetramethylbenzidine and hydrogen peroxide were injected and catalyzed by the Au@PtNCs, smartphone was used to measure the color of the catalysate for quantitative analysis of target bacteria. Under optimal conditions, this biosensor could detect Salmonella typhimurium quantitatively and automatically in 1 h with a linear detection range of 8.0 × 101 CFU/mL to 8.0 × 104 CFU/mL and a detection limit of 62 CFU/mL. The microfluidic biosensor was compact in size, simple to use, and efficient for detection, and might be used for in-field screening of foodborne pathogens to prevent food poisoning.