With the continuous expansion of distributed energy resources (DERs) in the demand side, the distributed peer-to-peer (P2P) energy-trading market in prosumer community receives extensive research interests. A proper transaction structure and pricing model are inevitable. This paper proposes a bilateral energy-trading structure considering the energy trading agent (ETA) with self-built photovoltaic (PV) and energy storage system (ESS), to provide more sufficient energy transactions in community. A bilateral energy-trading model is also developed to make better use of local resources, including utility maximum model and hierarchical dynamic pricing model for the self-build energy-owed ETA and prosumers. Considering the personalized flexibilities of energy consumption and market contributions, the proposed pricing model focuses on the share of demand and supply market and demand response (DR) discount factor to make differentiated pricing decisions and promote market competitiveness. To solve the model, the distributed alternating direction method of multiplier (ADMM) with the predictor–corrector mechanism is realized. Finally, an example simulation verifies the effectiveness and advantages, that the proposed model can decrease the total cost by 5.11% and increase the ETA’s income by more than 9.38% compared to other designed cases.