因为不想在后台操作,就使用js进行
涉及到了一个打乱数组顺序的方法
百度到的一篇
var arr=[1,2,3,0,4,5,6,7,8,9];
arr.sort(function(){return 0.5-Math.random();});
console.log(arr);
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAiAAAAAkCAIAAAA/5RZ0AAAIhElEQVR4nO2d65ErKQyFyYiIlM+QwETgACiH4BiocjjaH03TIMSrx+3x3D1fbW3tvdsNQoAOEp6xYQAAAOACzG8bAAAA4N8EAgMAAOASIDAAAAAu4XMFxlk2ho3l8NuW/GE8G8PGMPnftuQcgd3nWe4dB2bn9P8bHBbt77EtGM+uPwGBrSmeac3mP8vZnbXqqA8WmE+d8o81rMlHhukZ6PMidXC7Wnu22kpw9HE2/39IC8ZZHix5sSkas/l+lsPLUE01zu+sRUf9JYHpuX4/qjcPj/sDHe/Q6AFm9tR+INlgmlPeT8s8jVo4N8y/IDD15AZXxIjknBPbSe8isDWjMNRtRFgYH1gSmFPRoUNw0UutccUVaNiQ8n8p/X1g294LhxOqVOCFOLsWy8R0DCJ1tSnU2Xwnce60eWlBp3bED0e69PofERg/cH3a1Z50d3uKTmkdbTzFk2mrhc0Mckzt2kh/pnstbw/sloW2Pvm9L7XqlQ4mhTGfLzCBbTW5RL0/vqSL5TbEFAdlMSwJzHBJrBHYbgugPdiBG308u/QKfWXjw2V/Hs29HcTQ0pafbXyxu4tYXecn/P/zrTTvKCkw2zmRfJRT8vGQkuJ7eoDaB6XisLm9btm7eLKWLaT2y4NVfQDp+SVogVWjtf+PnNE3byyIes4Njol6Qjgbevpd+Pgfqo1pFEkvtwZFNaB3SupPdzWbvRb25dFfD3rmlzshe8C67NTsYxee2FC0MI2a8uVUd1EdWWoj42xmcbaOWXVQiwZojkrpxWaDSCa2UXA6uasbpxpm4fjs2NFabI7i7BxzkW89z9ayC+wdE+1a1fXksexVQdL8MHR1eiAusNKG5DdrsxBU7RoZCqplX+wRZq5m09leMBGzqWwcMVn9faHZILtomJHvmmKy1KJI6ai1WL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