A swinging LED lamp with a wireless charging function, comprising: a fixing portion comprising a base and a lug boss formed at an upper end of the base, wherein a main control circuit board and a power source end are arranged in the base; an electromagnet and a transmitting coil are arranged in the lug boss; the electromagnet and the transmitting coil are electrically connected with the power source end through the main control circuit board respectively; and a magnetic suspension portion, comprising a permanent magnet and a receiving coil, an LED control circuit board and a first LED bulb electrically connected with the LED control circuit board; the LED control circuit board electrically connected with the receiving coil, with the permanent magnet and the electromagnet in a power-on state being mutually exclusive; characterized in that, the lug boss is connected with a fixed ring perpendicular to the lug boss; and a spike is formed at a top end of the fixed ring; and the magnetic suspension portion comprising a pendant, a floating ring and a lamp base, wherein the pendant is connected to a bottom end of the floating ring; the lamp base is connected to a top end of the floating ring; the permanent magnet and the receiving coil are arranged in the pendant; the LED control circuit board and the first LED bulb are arranged on an upper end surface of the lamp base; a groove used in combination with the spike is formed in a central position of a lower end surface of the lamp base; a width of the groove is greater than a width of the spike; a depth of the groove is smaller than a height of the spike; and after the spike enters the groove, the spike and the groove form point contact; and the floating ring is sleeved on the fixed ring; the lamp base is located above the fixed ring; the pendant is located above the lug boss. a fixing portion comprising a base and a lug boss formed at an upper end of the base, wherein a main control circuit board and a power source end are arranged in the base; an electromagnet and a transmitting coil are arranged in the lug boss; the electromagnet and the transmitting coil are electrically connected with the power source end through the main control circuit board respectively; and a magnetic suspension portion, comprising a permanent magnet and a receiving coil, an LED control circuit board and a first LED bulb electrically connected with the LED control circuit board; the LED control circuit board electrically connected with the receiving coil, with the permanent magnet and the electromagnet in a power-on state being mutually exclusive; characterized in that, the lug boss is connected with a fixed ring perpendicular to the lug boss; and a spike is formed at a top end of the fixed ring; and the magnetic suspension portion comprising a pendant, a floating ring and a lamp base, wherein the pendant is connected to a bottom end of the floating ring; the lamp base is connected to a top end of the floating ring; the permanent magnet and the receiving coil are arranged in the pendant; the LED control circuit board and the first LED bulb are arranged on an upper end surface of the lamp base; a groove used in combination with the spike is formed in a central position of a lower end surface of the lamp base; a width of the groove is greater than a width of the spike; a depth of the groove is smaller than a height of the spike; and after the spike enters the groove, the spike and the groove form point contact; and the floating ring is sleeved on the fixed ring; the lamp base is located above the fixed ring; the pendant is located above the lug boss.