In this paper, we consider a UAV-enabled MEC platform that serves multiple mobile ground users with random movements and task arrivals. We aim to minimize the average weighted energy consumption of all users subject to the average UAV energy consumption and data queue stability constraints. To control the system operation in sequential time slots, we formulate the problem as a multi-stage stochastic optimization, and propose an online algorithm that optimizes the resource allocation and the UAV trajectory in each stage. We adopt Lyapunov optimization to convert the multi-stage stochastic problem into per-slot deterministic problems with much less optimizing variables. To tackle the non-convex per-slot problem, we use the successive convex approximation (SCA) technique to jointly optimize the resource allocation and the UAV movement. Simulation results show that the proposed online algorithm can satisfy the average UAV energy and queue stability constraints, and significantly outperform the other considered benchmark methods in reducing the energy consumption of ground users.