import Taro from "@tarojs/taro" import { View,Image,Text } from "@tarojs/components" import { useState } from "react" import './style.less' export default (props) => { const { ico, textNext, onSelected, nextQuestio } = props const YES = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/RandomIIcon/YES.png' const No = 'https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/RandomIIcon/No.png' const [imageOne, setImageOne] = useState(false) const [imageTow, setImageTow] = useState(false) const handleYES = () => { setImageOne(true) setImageTow(false) onSelected() setTimeout(() => { nextQuestio() }, 500); } const handleNo = () => { setImageOne(false) setImageTow(true) onSelected()//未选择不给到下一题 setTimeout(() => { nextQuestio() }, 500); } return ( 2 / 5 你是单身吗? YES No ) }