In the era of big data, locally repairable codes (LRCs) are widely used in distributed storage systems due to their efficient data recovery capabilities. A q-ary optimal \((r,\delta )\) -LRC is defined as an [n, k, d] linear code over \(\mathbb {F}_{q}\) where each code symbol has locality \((r,\delta )\) , and the minimum distance achieves the well-known Singleton-type bound. In this paper, we investigate the case where the local repair groups of optimal LRCs are disjoint, that is, \( (r+\delta -1) \mid n \) . We first extend the results on weight distributions of LRCs with locality r in Hao et al. (IEEE Trans Commun 70(5):2895–2908, 2022) to LRCs with locality \((r,\delta )\) . Specifically, we demonstrate that the weight distribution of any q-ary optimal LRC with locality \((r=2,\delta )\) , minimum distance \(2\delta +1\) and even dimension can be uniquely determined by characterizing the weight type hierarchy of codewords. Subsequently, we derive an explicit expression for these weight distributions. Then, the weight distributions of optimal \((r=2,\delta )\) -LRCs have been proven to be determinable when \(d = \delta ,\delta +1\) or \(2\delta +1\) . Furthermore, we explain that the weight distribution of any q-ary optimal \((r=2,\delta )\) -LRC with minimum distance \(2\delta +2\) cannot be uniquely ascertained using knowledge of projective geometry. Finally, we apply our hierarchical method to compute the weight distributions of optimal \([n,k\ge 5r-1,d=\delta +1]\) -LRCs with general locality \((r,\delta )\) and offer a detailed study for the case where the locality is \((r=3,\delta )\) .