There are multiple ways to generalize inv to $B_n$, and the literature is not always consistent. Here is one such generalization (denoted $\mathrm{inv_B}$ for clarity), and a corresponding proof. As in hoyland's answer, the approach is to show a bijection between permutations and inversion sequences, where the corresponding statistic is much simpler to count.
Let $\bar w$ be a signed permutation, and $w$ be the same permutation stripped of signs. Let $\sigma_i$ be 1 if the $i$th position in $w$ is signed, 0 if it is unsigned. Let $\mathrm{inv}(w)$ be the standard inversion statistic on unsigned permutations.
Define $\mathrm{inv}_B(\bar w)=\mathrm{inv}(w)+\sum_{i=1}^n i\sigma_i$
For $w\in S_n$, the inversion sequence of $w$ is defined as $a=(a_1,\cdots,a_n)$, where $a_i=|\{0\le j\le i-1\mid w_j>w_i\}|$. It is easy to see that $|a|\equiv\sum_{i=1}^n a_i=\mathrm{inv}(w).$ This produces a bijection between permutations and inversion sequences, although I will not prove that here. Now for $\bar w\in B_n$, let the inversion sequence of $\bar w$ be $(b_1,⋯,b_n)$, where $b_i=a_i+i\sigma_i$. Thus we have $0≤b_i≤2i−1$. By the way we've defined things it follows that $|b|\equiv\sum_{i=1}^n b_i=\mathrm{inv_B}(w).$ It's straightforward to see that the modified inversion sequences are also bijective assuming the original inversion sequences were. Denoting the set of inversion sequences of length $n$ as $I_n$, we have $\sum_{w\in B_n}q^{\mathrm{inv_B}(w)}=\sum_{b\in I_n}q^{|b|}=\prod_{i=1}^n [2i]_q.$ I hope this definition of inv is equal, or at least equivalent to the one you were using.