<template>
  <view class="page-content expertsdetails">
    <view class="expertsdetails-content">
      <view class="expertsdetails-item expertsdetails-matuser">
        <view class="item-content">
          <view class="item-text">
            <view class="item-textlable">
              <text class="item-lable">真实姓名：</text>
            </view>
            <view class="item-textvalue">
              <text class="item-value">{{ expertsDetailsObj.matUser }}</text>
            </view>
          </view>
        </view>
      </view>
      <view class="expertsdetails-item expertsdetails-matphone">
        <view class="item-content">
          <view class="item-text">
            <view class="item-textlable">
              <text class="item-lable">手机号码：</text>
            </view>
            <view class="item-textvalue">
              <text
                class="item-value"
              >{{ expertsDetailsObj.matPhone ? expertsDetailsObj.matPhone.toString().replace(/^(.{3})(.*)(.{4})$/, '$1-$2-$3') : '' }}</text>
            </view>
          </view>
        </view>
      </view>
      <view class="expertsdetails-item expertsdetails-matname">
        <view class="item-content">
          <view class="item-text">
            <view class="item-textlable">
              <text class="item-lable">投诉标题：</text>
            </view>
            <view class="item-textvalue">
              <text class="item-value">{{ expertsDetailsObj.matName }}</text>
            </view>
          </view>
        </view>
      </view>
      <view class="expertsdetails-matcontent">
        <view class="matcontent-text">
          <view class="matcontent-textlable">
            <text class="matcontent-lable">投诉内容：</text>
          </view>
          <view class="matcontent-textvalue">
            <text class="matcontent-textarea">{{ expertsDetailsObj.matContent }}</text>
          </view>
        </view>
      </view>
      <template v-if="expertsDetailsObj.matRes != null && expertsDetailsObj.matRes != ''">
        <view class="expertsdetails-matres">
          <view class="matres-text">
            <view class="matres-textlable">
              <text class="matres-lable">反馈内容：</text>
            </view>
            <view class="matres-textvalue">
              <text class="matres-textarea">{{ expertsDetailsObj.matRes }}</text>
            </view>
          </view>
        </view>
      </template>
      <template v-else>
        <view class="expertsdetails-matres">
          <view class="matres-text">
            <view class="matres-textlable">
              <text class="matres-lable">反馈内容：</text>
            </view>
            <view class="matres-textnovalue">
              <text class="matres-value">暂无</text>
            </view>
          </view>
        </view>
      </template>
    </view>
  </view>
</template>

<script>
import {
  expertsModalViewData
} from '@/agrcloud-api/expertsmodal';

export default {
  name: 'expertsdetails',
  data() {
    return {
      expertsDetailsObj: {
        matUser: '',
        matPhone: null,
        matName: '',
        matContent: '',
        matRes: ''
      },
      custLabelStyle: {
        'height': '42rpx',
        'font-size': '30rpx',
        'font-family': 'PingFangSC-Regular, PingFang SC',
        'font-weight': '400',
        'color': '#666666',
        'line-height': '42rpx'
      },
      custPlaceholderStyle: 'font-size: 34rpx;font-family: PingFangSC-Regular, PingFang SC;font-weight: 400;'
    };
  },
  onLoad() {
    this.initData();
  },
  methods: {
    /** 初始化数据 */
    initData() {
      const currExpertsDetailIsItem = (this.$store.getters || {}).expertsDetailsObj || {};
      expertsModalViewData({
        id: currExpertsDetailIsItem.matId
      }).then(res => {
        this.expertsDetailsObj = res.data || {};
      }).catch(() => {
        this.expertsDetailsObj = {};
      });
    }
  }
}
</script>

<style lang="scss" scoped>
.expertsdetails {
  padding: 0;

  .expertsdetails-content {
    width: 100%;
    padding-top: 24rpx;

    .expertsdetails-item {
      height: 138rpx;
      padding-left: 24rpx;
      background-color: #ffffff;

      .item-content {
        height: 138rpx;
        border-bottom: 1px solid #eeeeee;

        .item-text {
          padding: 24rpx 24rpx 24rpx 0;

          .item-textlable {
            height: 42rpx;
            line-height: 42rpx;

            .item-lable {
              height: 42rpx;
              font-size: 30rpx;
              font-family: PingFangSC-Regular, PingFang SC;
              font-weight: 400;
              color: #666666;
              line-height: 42rpx;
            }
          }

          .item-textvalue {
            height: 48rpx;
            line-height: 48rpx;

            .item-value {
              height: 48rpx;
              font-size: 34rpx;
              font-family: PingFangSC-Regular, PingFang SC;
              font-weight: 400;
              color: #333333;
              line-height: 48rpx;
            }
          }
        }
      }
    }

    .expertsdetails-matcontent {
      margin-top: 24rpx;
      background-color: #ffffff;
      min-height: 154rpx;

      .matcontent-text {
        padding: 24rpx;

        .matcontent-textlable {
          height: 42rpx;
          line-height: 42rpx;

          .matcontent-lable {
            height: 42rpx;
            font-size: 30rpx;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #666666;
            line-height: 42rpx;
          }
        }

        .matcontent-textvalue {
          .matcontent-textarea {
            min-height: 48rpx;
            font-size: 34rpx;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #333333;
          }
        }
      }
    }

    .expertsdetails-matres {
      margin-top: 24rpx;
      background-color: #ffffff;
      min-height: 154rpx;

      .matres-text {
        padding: 24rpx;

        .matres-textlable {
          height: 42rpx;
          line-height: 42rpx;

          .matres-lable {
            height: 42rpx;
            font-size: 30rpx;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #666666;
            line-height: 42rpx;
          }
        }

        .matres-textvalue {
          .matres-textarea {
            min-height: 48rpx;
            font-size: 34rpx;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #333333;
          }
        }

        .matres-textnovalue {
          height: 48rpx;
          line-height: 48rpx;

          .matres-value {
            height: 48rpx;
            font-size: 34rpx;
            font-family: PingFangSC-Regular, PingFang SC;
            font-weight: 400;
            color: #333333;
            line-height: 48rpx;
          }
        }
      }
    }
  }
}
</style>
