cardMoudule.vue 3.62 KB
<template>
  <view class="cardCss">
    <view class="titleCss">
      <text class="requiredCss" v-if="required">*</text>
      {{title}}
    </view>
    <view class="typeMoudule" v-if="cardData" v-for="(item,index) in cardData" :key="index">
      <view class="u-demo-block" v-if="item.cardType == 1">
        <view class="u-demo-block__title">
          <span>
            <text class="requiredCss" v-if="item.required">*</text>
            {{item.title}}</span>
        </view>
        <view class="u-demo-block__content" style="margin-top: 15px;">
          <u--input disabled v-model="item.value" :suffixIcon="item.icon" suffixIconStyle="color: #909399"></u--input>
        </view>
      </view>

      <view class="largeAmountOfTextCss" v-if="item.cardType == 2">
        <view class="" v-if="item.value">
          {{ item.value }}
        </view>
        <view class="" v-else>
          无
        </view>
      </view>

      <view class="u-demo-block" v-if="item.cardType == 3">
        <view class="u-demo-block__title secondTextCss">
          <span style="margin-bottom: 10rpx;">
            <!-- <text class="requiredCss" v-if="item.required">*</text> -->
            {{item.title}}
          </span>
          <u-line></u-line>
        </view>
      </view>

      <view class="u-demo-block descCss" v-if="item.cardType == 4">
        {{ item.title }}
      </view>

      <view class="u-demo-block" v-if="item.cardType == 5">
        <view class="u-demo-block__title">
          <span>
            <text class="requiredCss" v-if="item.required">*</text>
            {{item.title}}</span>
        </view>
        <view class="largeAmountOfTextCss">
          <view class="" v-if="item.value">
            {{ item.value }}
          </view>
          <view class="" v-else>
            无
          </view>
        </view>
      </view>

    </view>
  </view>
</template>

<script>
  export default {
    components: {},
    props: {
      // cardType:{
      //   type:String
      // },
      required: {
        type: Boolean,
        default: false
      },
      title: {
        type: String
      },
      cardData: {
        type: Array
      }
    },
    data() {
      return {

      }
    },
    computed: {

    },
    onLoad() {
      console.log(this.cardData);
    },
    methods: {

    }
  }
</script>

<style lang="scss" scoped>
  .cardCss {
    margin: 20rpx 24rpx;
    padding: 40rpx 30rpx;
    border-radius: 20px;
    background-color: #ffffff;
    box-sizing: border-box;
  }

  .titleCss {
    // margin: 40rpx 0;
    font-size: 30rpx;
    color: #333333;
  }

  .secondTextCss {
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #333333 !important;
  }

  .u-demo-block__title {
    display: flex;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0);
    box-sizing: border-box;
    font-family: '苹方 中等', '苹方', sans-serif;
    color: #999db0;
    text-align: left;
    line-height: normal;
    font-size: 26rpx;
  }

  .u-demo-block {
    margin: 30rpx 0;
  }

  .largeAmountOfTextCss {
    text-indent: 1em;
    margin-top: 38rpx;
    padding: 20rpx 20rpx 20rpx 20rpx;
    border-radius: 20rpx;
    background-color: #f8f9fd;
    box-sizing: border-box;
    font-family: '苹方 中等', '苹方', sans-serif;
    color: #999db0;
    text-align: left;
    line-height: 46rpx;
  }

  .descCss {
    background-color: rgba(255, 255, 255, 0);
    box-sizing: border-box;
    font-family: '苹方 中等', '苹方', sans-serif;
    color: #666666;
    text-align: left;
    line-height: normal;
    font-size: 28rpx;
  }

  /deep/.uni-input-input {
    color: #999db0;
  }
</style>