         
         let tempIndex = self.currentIndex - 1
         guard tempIndex >= 0 else {
-            return 0
+            return self.data.count - 1 //0
         }
         return tempIndex
     }

        let offset = scrollView.contentOffset.x
        if offset == 0 {
            self.indexOfCurrentImage = self.getLastImageIndex(indexOfCurrentImage: self.indexOfCurrentImage)
        }else if offset == self.frame.size.width * 2 {
            self.indexOfCurrentImage = self.getNextImageIndex(indexOfCurrentImage: self.indexOfCurrentImage)
        }
        // 重新布局图片
        self.setScrollViewOfImage()

        
        let tempIndex = self.currentIndex + 1
        guard tempIndex < self.data.count else {

            return 0//self.data.count - 1
        }
        return tempIndex
    }
