The architecture of cloud–edge collaboration can improve the efficiency of Internet of Things (IoT) systems. Recent studies have pointed out that using IoT terminal devices as destinations for computing offloading can promote further optimized allocation of computational resources. However, in practice, this idea encounters the problem that participants might lack the motivation to take over computational tasks from others. Although the edge and the terminal are provided with symmetrical positions in collaborative offloading, their computational resources and capabilities are asymmetric. To mitigate this issue, this paper designs a distributed strategy for the trading of computational resources. The most prominent feature of our strategy is its multi-preference optimization objective that takes into account the overall satisfaction with task delay, energy cost, trading prices, and user reputation of participants. In addition, this paper proposes a system architecture based on the Blockchain-as-a-Service (BaaS) design to give full play to the good distributed technology features of blockchain, such as decentralization, traceability, immutability, and automation. Meanwhile, BaaS delivers decentralized identifier (DID) based distributed identity infrastructure for the distributed computational resource trading stakeholders as well. In the simulation evaluation, we compare our trading strategy based on a matching mechanism called multi-preference matching (MPM) to trading using the classical double auction (DA) matching mechanism. The results show that our computational resource trading strategy is able to offload and execut more tasks, achieving a better throughput compared to the DA-based strategy.