A multiphase lattice Boltzmann method is developed to simulate immiscible three-phase flows with contact-line dynamics. In this method, the immiscible three-phase flow is modeled by a multiple-relaxation-time color-gradient model, which not only allows for a full range of interfacial tensions but also can produce viscosity-independent results especially when the fluid-surface interactions are considered. To achieve the desired contact angles, a weighted contact angle model is utilized to obtain a relatively smooth transition of contact angle for each fluid, which is enforced through a geometrical wetting condition. This method is first validated by simulations of a Janus droplet resting on a surface for various contact angles and fluid properties and dynamic capillary filling of ternary fluids with different viscosity ratios. It is then used to simulate a Janus droplet on a substrate subject to Poiseuille flow. Results show that the droplet may undergo three typical modes, namely, two stable deformation modes and breakup mode, which depend not only on the inlet velocity but also on the fluid viscosity. The terminal velocity of moving droplet increases linearly with the inlet velocity in both stable modes only when three fluids do not differ much in their viscosities.