Nanomechanical resonance tuning and phase effects in optical near-field interaction