The deal will see the U.S. grocery giant swap its Yihaodian platform for a 5 percent stake in JD.com Inc., worth about $1.5 billion by the firm’s latest market value.