The two-dimensional (2D) transition metal dichalcogenides (TMDs) have interesting physical properties and potential applications in the field of electronics and nanophotonics. The structure, electronic, optical and photoelectric properties of WX2 (X = S, Se, Te) monolayer and their heterostructures are studied by the first principles calculation. The results show that the six different stacked structures of the WS2/WSe2 and WSe2/WTe2 heterostructures have very small and negligible effects on their electronic properties. The electronic properties of the WS2/WSe2 and WSe2/WTe2 heterostructures can be effectively regulated by biaxial strain, such as the transition from the direct bandgap semiconductor to the indirect band gap and then to the metallic property. The WS2/WSe2 and WSe2/WTe2 heterostructures are type-II band alignments, which are suitable for optoelectronic applications. Moreover, both tensile strain and compressive strain can effectively regulate the optical properties of WS2/WSe2 heterostructure, such as the peak and range of optical absorption coefficient. These good optical properties are conducive to the application of the WS2/WSe2 heterostructures in optoelectronic devices. Therefore, the photoelectric characteristics of three kinds of photoelectric devices for zigzag and armchair types (Z-type and A-type) based on the WS2/WSe2 heterostructures are studied, named PIN-junction, PIP-junction and NIN-junction photoelectric devices. The WS2/WSe2 heterostructure shows high anisotropy in the optoelectronic properties in the Z-type and A-type directions. The photoelectric properties of the A-type WS2/WSe2 heterostructure are better than those of the Z-type. The A-type WS2/WSe2 heterostructure has a higher photocurrent density under the AM1.5 standard. Our results suggest that the WS2/WSe2 and WSe2/WTe2 heterostructures are possible to make photodetector, and the strain can regulate the electronic and optical properties of the heterostructures, which have potential applications in photoelectric and other fields.