In the applications of wireless sensor networks (WSN), it is a fundamental issue to effectively estimate and predict the quality of wireless links for the network protocol design, such as reliable WSN deployment, routing policy and resource management protocol, especially in respect of the reliability of data delivery. In this paper, we characterize the quality of wireless links from a perspective of multiple dimensions and propose a comprehensive quality index of wireless links (referred as fuzzy-logic based link quality index, FLI), which overcomes the defects of the single link quality indicator. FLI takes the link reliability, the link vibration and the burstiness of packet loss into consideration, which affects the reliable data delivery. Further, we design a mechanism based on Bayesian classifier to classify and predict wireless links based on the FLI metric. Taking the limited computing and storage resources in the WSN into account, the prediction mechanism uses offline model training and online classification prediction. Then it is tested and verified in the wireless link databases from three real WSN research testbeds, and the results show that our classifier achieves an average prediction accuracy of 85%. In comparison with the 4C approach, it avoids the sudden drop of prediction accuracy on intermediate quality links shown in the 4C, while maintaining a higher average accuracy. In other words, the distribution of prediction accuracy is uniform.