Shower drain pipe leaking through floors
Looking at your drain cover and pipe you can see that hair has accumulated around the outside of the pipe. That tells you that the drain cover wasn't properly sealed with plumbers putty or suitable bathroom sealant. In other words, the water is leaking in around the edge perimeter of the drain instead of only flowing into the drain.
The drain pipe itself should be flush up against the shower pan. You indicated the cap thread are long enough to reach the drain. Assuming the drain fitting is threaded screw the cover and pipe back into the drain. Put a bead of plumbers putty or other plumbing sealant under and around the underside of the cover and screw it in.
Be sure to clean it all up before-hand so the sealant will hold.