import { defineComponent, reactive, ref } from 'vue'
import styles from './newspaper-item.module.less'
import msgIcon from '@/school/images/msg-icon.png'
import sendmsgIcon from '@/school/images/sendmsg-icon.png'
import phoneIcon from '@/school/images/phone-icon.png'
import { postMessage } from '@/helpers/native-message'
import clockIcon from '@/school/attendance/images/clock-icon.png'
import { Icon, ActionSheet } from 'vant'

export default defineComponent({
  props: ['item'],
  name: 'newspaper-item',

  setup(props) {
    const gotoDetail = () => {
      // window.open()
    }
    return () => (
      <>
        <div>
          <div class={styles.itemWrap} onClick={gotoDetail}>
            <div class={styles.titleWrap}>{props.item?.unitExaminationName}</div>
            <div class={styles.itemBottom}>
              <div class={styles.itemBottomDot}>
                <p class={styles.dotMain}>
                  {props.item?.totalScore || 0}
                  <span>分</span>
                </p>
                <p class={styles.dotSub}> 总分</p>
              </div>
              <div class={styles.itemBottomDot}>
                <p class={styles.dotMain} style={{ color: '#F67146' }}>
                  {props.item?.passScore || 0}
                  <span>分</span>
                </p>
                <p class={styles.dotSub}>合格分 </p>
              </div>
              <div class={styles.itemBottomDot}>
                <p class={styles.dotMain}>
                  {props.item?.questionNum || 0}
                  <span>分</span>{' '}
                </p>
                <p class={styles.dotSub}>题目数量 </p>
              </div>
            </div>
            <div class={styles.uniTimeWrap}>
              <div class={styles.uniTimeWrapLeft}>
                {' '}
                <Icon name={clockIcon} class={styles.clockIcon}></Icon> 测验时长：
                <span style={{ color: '#F67146' }}>{props.item?.timeMinutes || 0} </span> 分钟
              </div>
              <Icon name="arrow" color="#777"></Icon>
            </div>
          </div>
        </div>
      </>
    )
  }
})
