Owing to the high economic benefits, flexible deployment, and controllable maneuverability, unmanned aerial vehicles (UAVs) have been envisioned as promising and potential technologies for dispensing wireless communication services. This paper investigates a mobile edge computing (MEC) system assisted by multiple access points (APs) and an UAV, in which APs may not be able to straightly establish wireless communications with terrestrial Internet of Thing devices (IoT) due to ground signal blockage. Consequently, an UAV is dispatched as a mobile AP to serve a group of users and render the air-to-ground channel. In this scenario, we contemplate dividing the computing tasks of IoTDs into three parts: either be calculated locally, or offloaded to the UAV for processing, or accomplished on AP through relaying. This work attempts to minimize the weighted sum of communication consumption, calculation consumption, and the UAV’s flight consumption over a finite UAV mission duration by jointly optimizing calculation task allocation ratio, power distribution as well as the UAV’s trajectory. However, the resulting problem we put forward is demonstrated to be highly non-convex and challenging to solve. To tackle this issue, we decompose the original problem into two sub-problems hinging on the block coordinate descent (BCD) method. We settle the two sub-problems iteratively through the Lagrangian duality method and succession convex approximation (SCA) technique. The simulation results further reveal that the proposed approach is superior to other comparison baselines.