mykaoshi.vue 3.3 KB
<template>
  <div class="container">
    <div class="mykaoshitop flexone" v-if="show">
      <div class="tieziimg">
        <img :src="userinfo.avatar" alt="" />
      </div>
      <div class="tieziright">
        <div class="tiezirighttop flex">
          <div>
            <div class="tieziming">{{ userinfo.nickname }}</div>
          </div>
          <div>
            <div class="vipimg" style="margin-left:0.4rem">
              <img src="../../../assets/vip_icon@2x.png" alt="" />
              <div class="vipname" >{{ userinfo.level.name1 }}</div>
            </div>
          </div>
         <img
                :src="item.logo_image"
                class="banggongimg"
                alt=""
                v-for="(item, index) in userinfo.label"
                :key="index"
              />
              <img
                src="../../../assets/yirenzheng_icon@2x.png"
                class="banggongimg"
                alt=""
                v-if="userinfo.is_card == 1"
              />
        </div>
        <div class="tiezibto flexone"></div>
      </div>
    </div>
    <div class="kaoshilist flextwo">
      <div
        class="homepageboxitem flexfour"
        v-for="(item, index) in questionlist"
        :key="index"
        @click="examinetext(item)"
      >
        <img :src="item.imageexaminetext" alt="" class="homepageitemimg" />
        <div class="homepageitemname">{{ item.name }}</div>
      </div>
    </div>
    <div class="kaoshirule">
      <div class="kaoshiruletitle">考试规则</div>
      <div class="kaoshiruletext" v-html="rulecontent">
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      rulecontent: '',//考试规则
      userinfo: '',
      show: false,
      questionlist: []
    }
  },
  created() {
     document.body.style.backgroundColor = "#fff";
    this.getuserinfo()
    this.getrulecontent();
    this.getquestionlist()
  },
  methods: {
    // 获取用户信息
    getuserinfo() {
      let that = this;
      var url = '/api/member/index';
      var params = {

      }
      console.log('7766554', params)
      that.$axios.post(url, params).then((res) => {
        console.log('用户信息', res);
        that.userinfo = res.data;
        setTimeout(function () {
          that.show = true
        }, 200)
      }).catch((err) => {
        console.log(err)

      })
    },
    // 获取问卷列表
    getquestionlist() {
      let that = this;
      var url = '/api/question/get_questionnaire';
      var params = {

      }
      console.log('7766554', params)
      that.$axios.post(url, params).then((res) => {
        console.log(res);
        that.questionlist = res.data

      }).catch((err) => {

      })
    },
    // 考试规则
    getrulecontent() {
      let that = this;
      var url = '/api/sundry/get_page';
      var params = {
        id: 5
      }
      console.log('7766554', params)
      that.$axios.post(url, params).then((res) => {
        console.log(res);
        that.rulecontent = res.data.content == null ? '' : res.data.content
      }).catch((err) => {
        console.log(err)

      })
    },
    //帮工考试
    examinetext(item) {
      this.$router.push({
        path: '/kaoshenginfo',
        query: { id: item.id }
      })

    },
  }
};
</script>
<style scoped>
@import "../../style/homepage.css";
</style>