Quasiperiodic waves, solitary waves and asymptotic properties for a generalized (3 + 1)-dimensional variable-coefficient B-type Kadomtsev–Petviashvili equation