  Decays of $B_{s}^{0}$ and $\overline{B}{}_{s}^{0}$ mesons into
$J/\psi\pi^+\pi^-$ final states are studied in a data sample corresponding to
1.9 fb$^{-1}$ of integrated luminosity collected with the LHCb detector in 13
TeV $pp$ collisions. A time-dependent amplitude analysis is used to determine
the final-state resonance contributions, the $CP$-violating phase
$\phi_s=-0.057\pm 0.060\pm 0.011$ rad, the decay-width difference between the
heavier mass $B_{s}^{0}$ eigenstate and the $B^{0}$ meson of $-0.050\pm
0.004\pm 0.004$ ps$^{-1}$, and the $CP$-violating parameter
$|\lambda|=1.01_{-0.06}^{+0.08}\pm0.03$, where the first uncertainty is
statistical and the second systematic. These results are combined with previous
LHCb measurements in the same decay channel using 7 TeV and 8 TeV $pp$
collisions obtaining $\phi_s =0.002\pm0.044\pm0.012$ rad, and $|\lambda|
=0.949\pm0.036\pm0.019$.
