<template>
  <div>

          <div styly="position:relatie;width:170px;height:89px;">
          <img src="/static/images/20200909.png"  alt="" style="width: 320px; height: 180px; margin-right: 10px; display: block;"/>


          <span style="position:absolute;top:50px;left:130px;"><tr style="font-size: 18px;"><td>总题数：</td></tr></span>

          <span style="position:absolute;top:80px;left:140px;"><tr style="font-size: 28px;"><td>{{total}}</td></tr></span>

          <span style="position:absolute;top:20px;left:80px;">
          <img src="/static/images/20200911.png" alt="" style="width: 160px; height: 140px; margin-right: 50px; display: block;"/>
          </span>
          </div>


      <div></div>


       <div class="weui-cells__title">请选择科目</div>

            <div class="weui-cells">
            <a class="weui-cell  weui-cell_access weui-cell_example" :href="'/pages/mistake/WtbList/main?subject=语文&grade='+grade">
                <div class="weui-cell__hd"><img src="/static/images/20200912.png" alt="" style="width: 50px; height: 50px; margin-right: 10px; display: block;"></div>
                <div class="weui-cell__bd">
                    <p>语文</p>
                </div>
                <div class="weui-cell__ft">{{chinese}}</div>
            </a>
            <a class="weui-cell  weui-cell_access weui-cell_example" :href="'/pages/mistake/WtbList/main?subject=数学&grade='+grade">
                <div class="weui-cell__hd"><img src="/static/images/20200913.png" alt="" style="width: 50px; height: 50px; margin-right: 10px; display: block;"></div>
                <div class="weui-cell__bd">
                    <p>数学</p>
                </div>
                <div class="weui-cell__ft">{{math}}</div>
            </a>
            <a class="weui-cell  weui-cell_access weui-cell_example" :href="'/pages/mistake/WtbList/main?subject=英语&grade='+grade">
                <div class="weui-cell__hd"><img src="/static/images/20200914.png" alt="" style="width: 50px; height: 50px; margin-right: 10px; display: block;"></div>
                <div class="weui-cell__bd">
                <p>英语</p>
                </div>
                <div class="weui-cell__ft">{{english}}</div>
            </a>
            </div>


  </div>
</template>

<script type="text/javascript">
import HttpKit from '@/utils/http-kit'
export default {
  components: {
  },
  data () {
    return {
      uid: 1,
      grade:'',
      chinese:0,
      math:0,
      english:0,
      total:0
    }
  },
  name: 'wangcan',

  methods:{
      detail (){
        HttpKit.post('/wx/wrongbook/list',{
        gradeName: this.gradeName,
        groupName: '小学',
        subject: this.subject,
        uid: this.uid
        })
        .then(res => {

        })
        .catch(err => {
          console.log(err)
        })
      }
 },
 onLoad: function (option) {
      this.total = 0
     this.uid = JSON.parse(wx.getStorageSync('uid'))
     //console.log(this.uid)
     this.grade = option.grade;
        HttpKit.post('/wx/wrongbook/count',{
        gradeName: this.grade,
        groupName: '小学',
        subject: '语文',
        uid: this.uid
        })
        .then(res => {
          this.chinese = res.data
          this.total+=res.data
        })
        HttpKit.post('/wx/wrongbook/count',{
        gradeName: this.grade,
        groupName: '小学',
        subject: '数学',
        uid: this.uid
        })
        .then(res => {
          this.math = res.data
          this.total+=res.data
        })
        HttpKit.post('/wx/wrongbook/count',{
        gradeName: this.grade,
        groupName: '小学',
        subject: '英语',
        uid: this.uid
        })
        .then(res => {
          this.english = res.data
          this.total+=res.data
        })
     console.log(this.total)
  }
}

</script>

<style scoped>
</style>
