I am learning the coordinate transform between cylindrical and cartesian,and the picture is the teaching,and i don't understand why is $\vec u_x \cdot \vec u_\phi =-\sin\phi $ ? I guess the reason of $\vec u_x \cdot \vec u_r =\cos\phi $ is $x=r\cos\phi$,but it can't explain why $\vec u_x \cdot \vec u_\phi =-\sin\phi $,can anyone teach me?

$ \newcommand\PD[2]{\frac{\partial#1}{\partial#2}} $
$\vec u_x$ is the vector telling you how a point $P(x, y, z)$ moves when you change $x$ a tiny bit; similarly for $\vec u_y$ and $\vec u_z$. Since the point at coordinates $(x, y, z)$ is $$ P(x, y, z) = x\vec u_x + y\vec u_y + z\vec u_z $$ and $\vec u_x, \vec u_y, \vec u_z$ are constant, we see $$ \PD Px = \vec u_x,\quad \PD Py = \vec u_y,\quad \PD Pz = \vec u_z. $$ The partial derivatives of $P$ capture the idea of moving a point a tiny bit and giving the resulting displacement vector. So now write $P$ in cylindrical coordinates: $$ P(r, \phi, z) = (r\cos\phi)\vec u_x + (r\sin\phi)\vec u_y + z\vec u_z. $$ Then $$ \vec u_\phi = \PD p\phi = -(r\sin\phi)\vec u_x + (r\cos\phi)\vec u_y, $$ so we see $$ \vec u_x\cdot\vec u_\phi = -(r\sin\phi)\vec u_x\cdot\vec u_x + (r\cos\phi)\vec u_x\cdot\vec u_y = -r\sin\phi. $$
The coordinate basis $\vec u_r, \vec u_\phi, \vec u_z$ derived in this way does not have to consist of unit vectors, but it is often desirable to normalize and make them into unit vectors. In this particular case $$ |\vec u_\phi| = \sqrt{\vec u_\phi\cdot\vec u_\phi} = \sqrt{r^2\sin^2\phi + r^2\cos^2\phi} = \sqrt{r^2} = r, $$ the last equality following since $r$ is usually assumed to be positive. Then $$ \hat u_\phi = \frac{\vec u_\phi}{|\vec u_\phi|} = -(\sin\phi)\vec u_x + (\cos\phi)\vec u_y $$ and so $$ \vec u_x\cdot\hat u_\phi = -\sin\phi. $$