You need to use Magento 2's dependency injection system. It means in your block class in __construct() method, inject Magento\Store\Model\StoreManagerInterface class as an object. Then you'll be able to get store view id. You need to do something like the following in your block class:
protected $storeManager;
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = []
)
{
$this->storeManager = $storeManager;
parent::__construct($context, $data);
}
/**
* Get store identifier
*
* @return int
*/
public function getStoreId()
{
return $this->storeManager->getStore()->getId();
}
If your current block class is Magento\Catalog\Block\Category\View
, then you'd need to use di.xml to extend your own module's block class to this class. More information on extending classes in Magento 2 is here