Accurate prediction of drug-target interactions (DTIs) is pivotal for accelerating the processes of drug discovery and drug repurposing. MVCL-DTI, a novel model leveraging heterogeneous graphs for predicting DTIs, tackles the challenge of synthesizing information from varied biological subnetworks. It integrates neighbor view, meta-path view, and diffusion view to capture semantic features and employs an attention-based contrastive learning approach, along with a multiview attention-weighted fusion module, to effectively integrate and adaptively weight the information from the different views. Tested under various conditions on benchmark data sets, including varying positive-to-negative sample ratios, conducting hard negative sampling experiments, and masking known DTIs with different ratios, as well as redundant DTIs with various similarity metrics, MVCL-DTI exhibits strong robust generalization. The model is then employed to predict novel DTIs, with a particular focus on COVID-19-related drugs, highlighting its practical applicability. Ultimately, through features visualization and computational properties analysis, we've pinpointed critical elements, including Gene Ontology and substituent nodes, along with a proper initialization strategy, underscoring their vital role in DTI prediction tasks.