The shale reservoir has the characteristics of small rock skeleton particles, large specific surface area, micro-nano pore development and mixed wetting. Previous studies have fully studied the influence of pore size of nano-scale confined space on the critical parameters of fluid phase state, but the influence mechanism of confined space wall wettability on fluid critical temperature/pressure needs to be further studied. Aiming at the problem that the interface effect of micro-nano pores affects the critical properties of n-pentane, the grand canonical Monte Carlo (GCMC) simulation method was used to construct slits with different nano-sizes and different wettability. The phase change of n-pentane in silica nanopores under different temperature and pressure conditions was simulated, and the quantitative relationship between nano-pore size, wettability and critical properties of n-pentane was obtained. Studies have shown that the critical temperature/pressure of n-pentane is lower than that of the bulk phase under restricted conditions. When the nanopore size reaches 11 nm, the critical temperature of n-pentane in slits with different wettability is close to the critical temperature of the bulk phase. When the wetting contact angle of the slit wall is 27.3° and the pore size reaches 30 nm, the critical pressure of n-pentane is close to that of the bulk. However, when the wettability of the wall changes from hydrophilic to lipophilic, and the wetting contact angle is 105.1°, n-pentane with a pore size of 110 nm can break away from the confinement effect of the slit, and its critical pressure is consistent with the bulk space. The stronger the lipophilicity, the greater the van der Waals force between the pore wall and the fluid molecules. The molecules are more likely to be attracted by the wall surface and gather and the fluid is easily undergo phase transition.This study deepens our understanding of oil and gas phase transitions in underground micro nano pores, which helps us better understand the occurrence state of underground oil and gas and facilitates us to adopt more effective development methods.