<template>
  <div>

<!--
        <div class="weui-navbar">
               <div class="weui-navbar__item weui-bar__item_on">
                错题
               </div>
               <div class="weui-navbar__item">
               知识点
               </div>
        </div>




        <div class="weui-flex">
        <div class="weui-flex"><button  class="weui-btn weui-btn_mini weui-btn_default" @click="click1">错题</button></div>
        <div class="weui-flex"><button  class="weui-btn weui-btn_mini weui-btn_default" @click="click2">知识点</button></div>
        </div>


        <div><button  class="weui-btn_cell weui-btn_cell-default" ></button></div>

        <div class="weui-cell__bd">1、题目简介</div>
        <div class="weui-flex">
        <div class="weui-flex"><button  class="weui-btn  weui-btn_primary">课堂测试一</button></div>
        <div>2020/09/05</div>
        </div>

        <div><button  class="weui-btn_cell weui-btn_cell-default" ></button></div>

        <div class="weui-cell__bd">2、题目简介</div>
        <div class="weui-flex">
        <div class="weui-flex"><button  class="weui-btn  weui-btn_primary">课堂测试二</button></div>
        <div>2020/09/06</div>
        </div>
-->

<!--        <div class="weui-cells">-->
<!--                    <a class="weui-cell  weui-cell_access weui-cell_example" href="javascript:">-->
<!--                        <div class="weui-cell__hd"></div>-->
<!--                        <div class="weui-cell__bd">-->
<!--                            <p>1、题目简介</p>-->
<!--                        </div>-->
<!--                        <div class="weui-cell__ft">课堂测试一</div>-->
<!--                    </a>-->
<!--                    <a class="weui-cell  weui-cell_access weui-cell_example" href="javascript:">-->
<!--                        <div class="weui-cell__hd"></div>-->
<!--                        <div class="weui-cell__bd">-->
<!--                            <p>2、题目简介</p>-->
<!--                        </div>-->
<!--                        <div class="weui-cell__ft">课堂测试二</div>-->
<!--                    </a>-->
<!--                    </div>-->


    <div class="weui-cells">
      <li v-for="(item,index) in tableData" :key="item">
        <a class="weui-cell  weui-cell_access weui-cell_example" :href="'/pages/mistake/misPractise/main?index='+index">
        <div class="weui-cell__hd"></div>
        <div class="weui-cell__bd">
            <p>{{index+1}}、{{item.name}}</p>
        </div>
          <div class="weui-cell__ft"></div>
        </a>
      </li>
    </div>

  </div>
</template>

<script>
import HttpKit from '@/utils/http-kit'

export default {

  data () {
    return {
      gradeName: '',
      subject: '',

      tableData:[],

      stemList:[],
      uid:0
    }
  },
  methods:{
        detail (){
        HttpKit.post('/wx/wrongbook/get',{
        gradeName: this.gradeName,
        groupName: '小学',
        subject: this.subject,
        uid: this.uid
        })
        .then(res => {
          console.log(res)
           this.tableData=res.data.stems;
           wx.setStorageSync('key', JSON.stringify(this.tableData));
        })
        .catch(err => {
          console.log(err)
        })
        }
  },
  onLoad: function (option) {
     this.gradeName = option.grade;
     this.subject = option.subject;
     this.uid = JSON.parse(wx.getStorageSync('uid'))
     console.log(this.gradeName+' '+this.subject);
  },
  mounted(){
        this.detail()
  }
}
</script>

<style scoped>
</style>
