<template>
  <view class="content p-10">
    <view class="card">
      <u-cell-group :border="false" class="mt-10">
        <u-cell>
          <view slot="title" class="title">证书名称：</view>
          <view slot="value">{{ form.NAME }}</view>
        </u-cell>
        <u-cell>
          <view slot="title" class="title">证书有效期：</view>
          <view slot="value">{{ form.VALIDITYTIME }}</view>
        </u-cell>
        <u-cell>
          <view slot="title" class="title">证书编号：</view>
          <view slot="value">{{ form.NUMBER }}</view>
        </u-cell>
        <u-cell class="flex-none">
          <view slot="title" class="title">备注：</view>
          <view slot="value" class="mt-10">{{ form.DESCR }}</view>
        </u-cell>
        <u-cell class="flex-none">
          <view slot="title" class="title">已上传证书：</view>
          <view slot="value" class="mt-10">
            <u-row>
              <u-col span="3" v-for="item in hImgs" :key="item">
                <u--image :showLoading="true" :src="item" width="80px" height="80px" @click="previewImage(item)"></u--image>
              </u-col>
            </u-row>
          </view>
        </u-cell>
      </u-cell-group>
    </view>
  </view>
</template>

<script>
import {getCorpInfoQualificationGoEdit} from "../../../api";

export default {
  data() {
    return {
      form: {},
      hImgs: [],
      QUALIFICATIONS_ID: ''
    }
  },
  onLoad(event) {
    this.QUALIFICATIONS_ID = event.QUALIFICATIONS_ID
    this.fnGetCorpInfoQualificationGoEdit()
  },
  methods: {
    async fnGetCorpInfoQualificationGoEdit() {
      let resData = await getCorpInfoQualificationGoEdit({QUALIFICATIONS_ID: this.QUALIFICATIONS_ID})
      this.form = resData.pd
      for (let i = 0; i < resData.hImgs.length; i++) {
        this.hImgs.push(this.$store.state.filePath + resData.hImgs[i].FILEPATH)
      }
    },
    previewImage(current) {
      uni.previewImage({
        urls: this.hImgs,
        current
      });
    },
  },
}
</script>

<style scoped>
.title {
  min-width: 150rpx;
}
</style>
