<template>
  <view>
    <cu-custom bgColor="bg-gradual-blueness" :isBack="true">
      <block slot="backText">返回</block>
      <block slot="content">学习园地</block>
    </cu-custom>
    <view class="sbanner">
      <view class="simgs">
        <image src="../../../static/study-banner.png" mode=""></image>
      </view>
    </view>
    <view class="study-apps">
      <view class="study-apps-item" @click="$noMultipleClicks(goMyTask)">
        <image src="../../../static/study-app01.png" mode=""></image>
      </view>
      <view class="study-apps-item" @click="$noMultipleClicks(goCourseware)">
        <image src="../../../static/study-app02.png" mode=""></image>
      </view>
    </view>
    <!--<scroll-view scroll-y>
      <scroll-view scroll-x class="bg-white nav" scroll-with-animation :scroll-left="scrollLeft">
        <view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabList" :key="index" @tap="tabSelect" :data-id="index">
          {{item.name}}
        </view>
      </scroll-view>
      <block v-if="TabCur==0">
        <view class="padding bg-white">
          <view class='cu-tag radius bg-blue'>技能培训</view>
          <view class='cu-tag radius'>创业培训</view>
        </view>
        <view class="slist">
          <view class="slist-item">
            <view class="slist-img">
              <image src="../../../static/1.png" mode=""></image>
            </view>
            <view class="slist-right">
              <view class="slist-title">
                职业通识公开课
              </view>
              <view class="slist-p">
                本课程从历史文化传统、公共道
                德、法律、工匠精神等方面,帮...
              </view>
            </view>
          </view>
          <view class="slist-item">
            <view class="slist-img">
              <image src="../../../static/2.png" mode=""></image>
            </view>
            <view class="slist-right">
              <view class="slist-title">
                茶艺师
              </view>
              <view class="slist-p">
                茶艺师是茶叶行业中具有茶叶专
                业知识和茶艺表演,服务,管...
              </view>
            </view>
          </view>
          <view class="slist-item">
            <view class="slist-img">
              <image src="../../../static/3.png" mode=""></image>
            </view>
            <view class="slist-right">
              <view class="slist-title">
                养老护理员
              </view>
              <view class="slist-p">
                我国处在老年人口增多,而养老
                护理的专业人士大大缺少。年...
              </view>
            </view>
          </view>
          <view class="slist-item">
            <view class="slist-img">
              <image src="../../../static/4.png" mode=""></image>
            </view>
            <view class="slist-right">
              <view class="slist-title">
                美容师
              </view>
              <view class="slist-p">
                根据人力资源社会保障部规定
                美容师资格证书作为第一批次...
              </view>
            </view>
          </view>
          <view class="slist-item">
            <view class="slist-img">
              <image src="../../../static/5.png" mode=""></image>
            </view>
            <view class="slist-right">
              <view class="slist-title">
                直播销售员
              </view>
              <view class="slist-p">
                电商直播已经成为当下新行业
                新产业的主流业态,是各行各..
              </view>
            </view>
          </view>
        </view>
      </block>

      &lt;!&ndash; <view class="cu-tabbar-height"></view> &ndash;&gt;
    </scroll-view>-->
  </view>
</template>

<script>
import {
  basePath,
  corpinfoId,
  loginUser,
  loginSession,
  baseImgPath
} from '@/common/tool.js';

export default {
  data() {
    return {
      backUrl: '/pages/index/index',
      noClick: true,
      listVal: [],
      TabCur: 0,
      scrollLeft: 0,
      tabList: [
        {
          name: '职业技能'
        },
        {
          name: '安全生产'
        },
        {
          name: '工伤预防'
        },
      ]
    }
  },
  onLoad() {
    this.getData();
    loginSession();
  },
  methods: {
    //跳转事件
    goToEdit(e) {
      uni.navigateTo({
        url: '/pages/application/basic-info-manage/basic-information/basic-information-edit'
      });
    },
    getData() {
      var _this = this;
      uni.showLoading({
        title: '请稍候'
      })
      uni.request({
        url: basePath + '/app/studysection/list',
        method: 'POST',
        dataType: 'json',
        header: {
          'Content-type': 'application/x-www-form-urlencoded'
        },
        data: {
          CORPINFO_ID: loginUser.CORPINFO_ID,
          USER_ID: loginUser.USER_ID,
        },
        success: (res) => {
          uni.hideLoading(); //结束加载中动画
          var result = res.data.result;
          if ("success" == result) {
            _this.listVal = res.data.varList;
          }
        }
      });
    },
    goStuToOpen(e) {
      var url = baseImgPath + e;
      var url2 = encodeURI(url);
      plus.runtime.openURL(url2, function (res) {
      });
    },
    goMyTask() {
      uni.redirectTo({
        url: '/pages/application/onlinexxks/my-tasks'
      });
    },
    goCourseware() {
      uni.redirectTo({
        url: '/pages/application/onlinexxks/courseware-list'
      });
    },
    tabSelect(e) {
      this.TabCur = e.currentTarget.dataset.id;
      this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
    }
  }
}
</script>

<style>
.nav {
  margin-bottom: 4upx;
}

.cu-tag + .cu-tag {
  margin-left: 30upx;
}
</style>
