7. If the four lines
$$
x=1, y=-1, y=3, y=k x-3
$$

enclose a convex quadrilateral with an area of 12, then the value of $k$ is $\qquad$.
7.1 or -2.

From $\left\{\begin{array}{l}y=k x-3, \\ y=-1,\end{array}\right.$ we get the intersection point $A\left(\frac{2}{k},-1\right)$; from $\left\{\begin{array}{l}y=k x-3, \\ y=3,\end{array}\right.$ we get the intersection point $B\left(\frac{6}{k}, 3\right)$. According to the problem, points $A$ and $B$ are on the same side of $x=1$, and
$$
\begin{array}{l}
\frac{1}{2}\left(\left|\frac{2}{k}-1\right|+\left|\frac{6}{k}-1\right|\right) \times 4=12 \\
\Rightarrow\left|\frac{2}{k}-1\right|+\left|\frac{6}{k}-1\right|=6 \\
\Rightarrow\left|\left(\frac{2}{k}-1\right)+\left(\frac{6}{k}-1\right)\right|=6 \\
\Rightarrow k=1 \text { or }-2 .
\end{array}
$$