The legislation would require companies like Uber and Lyft to close the gap between the amount drivers earn and the amount customers are charged.