Asian markets have mostly retreated ahead of the weekend’s Greek referendum that could decide its eurozone future, while Shanghai plunged.