Solid polymer electrolytes (SPE) usually present low ionic conductivity and poor anti-oxidation resistance, which significantly restricts their applications in high-voltage lithium metal batteries. In this study, poly(ionic liquid)-based random copolymers (CPIL) with rigid-flexible segments are successfully synthesized using cross-liked copolymerization reactions by precisely adjusting the ratio of 1-vinyl-3-ethylimidazolium bis(trifluoromethylsulfonyl)imide (VEIM-TFSI) soft segment to 1-vinyl-3-ethylimidazolium hexafluorophosphate (VEIM-PF6) hard segment. The soft segment in CPIL exhibits fast ion migrations due to large volume and more delocalized structure of TFSI-, while the hard segment demonstrates high anti-oxidative property. As a result, SPEs fabricated with optimized CPIL exhibit an ionic conductivity of 1.06 × 10-4 S cm−1 and an electrochemical stability voltage of 4.5 V at 25 °C. The solid-state LiNi0.8Co0.1Mn0.1O2/CPIL SPE/Li batteries exhibit an initial discharge capacity of 159.3 mAh g−1 and a superior capacity retention of 70.8 % after 600 cycles at 1 C. In addition, the enhanced electrochemical performance of LiNi0.9Co0.05Mn0.05O2 and LiFePO4 cells incorporating CPIL SPE also further substantiates the efficacy of CPIL SPE as a highly efficient solid-state electrolyte for high-performance batteries. This work has proved the efficiency of adjusting the ratio of ionic liquid monomer with different anions in designing novel PIL-based random copolymers, and as-prepared electrolyte is a promising candidate for practical application in solid-state lithium batteries.