We propose a dual-parameter detection method to realize the simultaneous optical absorption and viscoelasticity imaging based on photoacoustic lock-in measurement. Both optical absorption and viscoelasticity properties can be obtained simultaneously by analyzing the amplitude and phase of photoacoustic signals. This method is experimentally verified by imaging of gelatin phantoms with different absorption coefficients and viscoelastic coefficients. Furthermore, pilot experiments were performed on an in vivo murine EMT6 tumor from the back of a BALB/c mouse. Results demonstrate that the method can be used to measure the optical absorption and viscoelasticity of different biological tissues.