China and Myanmar have agreed to work together to build a community with a shared future, opening a new era of bilateral ties.