The decoherence of entanglement states stored in quantum memory is a major obstacle when implementing a quantum repeater. So far, the electron spins in quantum dots are usually utilized to construct entangled states in quantum repeater. In the quantum repeater process, the distance between quantum dots is large, so the interaction between them can be neglected. Thus the hyperfine interaction between the electron spin and its neighbor nuclear spins in the quantum dot is considered to be the main reason for the decoherence of the system. In early researches, the hyperfine interaction between the electron spin and its neighbor nuclear spins was considered as an effective magnetic field whose magnitude and direction are random and the magnitude follows the Gaussian distribution. In this paper, we simultaneously consider an applied magnetic field and the interaction between the electron spin and its neighbor nuclear spins, and investigate the decoherence of the quantum repeater of two quantum dots. We first solve the time evolution of the system by the numerical method, and the result shows that when the applied magnetic field is increased to a certain value, the four Bell states can be divided into two kinds, each with two Bell states. The system cannot transit from the Bell state in one kind to that in the other kind, but can transit between two Bell states with in the same kind. This effectively improves the fidelity of the initial state and suppresses the decoherence of the system. For a given applied magnetic field with large magnitude, we theoretically study the effect of the fluctuation of nuclear spin on the entangled state, and give an analytical expression for each of the fidelity and the decoherence time of the initial state. We show that the decoherence times of the four Bell states are the same, but the time evolutions of the Bell states belonging to different kinds are different obviously. The fidelity of two Bell states not only decays exponentially but also oscillates rapidly, so such two Bell states are difficult to be manipulated and not suggested in quantum repeater process. The results in this paper are expected to provide theoretical suggestions for selecting the entangled states in quantum repeater.