Severe challenges in terms of real-time processing and low-energy transmission brought by the development of Internet of Things (IoT) and the proliferation of mobile terminal devices are face by compute-intensive tasks. Particularly in multi-Unmanned Aerial Vehicle (UAV) -assisted Mobile Edge Computing (MEC) scenarios, communication links are constrained by obstacle blockages and UAV trajectories in complex 3D environments, and latency and energy consumption pressures are further exacerbated. For the scenario of multiple UAVs providing computational offloading services to ground users, an optimization model was established to minimize the weighted sum of the system's maximum task completion latency and total energy consumption, so as to optimize the users' discrete offloading decisions and the UAVs' continuous 3D trajectories jointly. To solve the problem of mixed (discrete-continuous) action space and strong decision coupling, a heterogeneous multi-agent algorithm UOUM (User Offloading and UAV Mobility co-optimization) was proposed. In the algorithm, under a heterogeneous multi-agent deep reinforcement learning framework, dedicated network architectures were designed for the two types of heterogeneous agents: users and UAVs. And differential reward mechanism was introduced to quantify marginal contributions of the agents, thereby solving the multi-agent credit allocation problem. Concurrently, an Artificial Potential Field (APF) was innovatively integrated as a differentiable physical constraint into the agent learning framework, so as to ensure safe obstacle avoidance for the UAVs. Simulation results show that compared to three benchmark methods (Only User Offloading optimization (OUO), Only UAV Trajectory optimization (OUT), and a standard heterogeneous multi-agent reinforcement learning (H-MARL) using only a global reward mechanism)), UOUM has advantages in various scenarios with different numbers of users, UAVs, and obstacle densities. Compared with H-MARL, UOUM has the final convergence reward improved by approximately 28.6% on average, and achieves strong environmental adaptability in terms of latency control, energy optimization, and safe obstacle avoidance.