The traditional diagnostic process for autism spectrum disorder (ASD) is subjective, where early and accurate diagnosis significantly affects treatment outcomes and life quality. Thus, improving ASD diagnostic methods is critical. This paper proposes ASD-SWNet, a new shared-weight feature extraction and classification network. It resolves the issue found in previous studies of inefficiently integrating unsupervised and supervised learning, thereby enhancing diagnostic precision. The approach utilizes functional magnetic resonance imaging to improve diagnostic accuracy, featuring an autoencoder (AE) with Gaussian noise for robust feature extraction and a tailored convolutional neural network (CNN) for classification. The shared-weight mechanism utilizes features learned by the AE to initialize the convolutional layer weights of the CNN, thereby integrating AE and CNN for joint training. A novel data augmentation strategy for time-series medical data is also introduced, tackling the problem of small sample sizes. Tested on the ABIDE-I dataset through nested ten-fold cross-validation, the method achieved an accuracy of 76.52% and an AUC of 0.81. This approach surpasses existing methods, showing significant enhancements in diagnostic accuracy and robustness. The contribution of this paper lies not only in proposing new methods for ASD diagnosis but also in offering new approaches for other neurological brain diseases.