<template>
  <div class="TopicDetail">
    <h2>#闲置物品交易</h2>
    <p>贴子：23913</p>
    <div class="tab">
      <span @click="currIndex = 0" :class="[currIndex === 0 ? 'active' : '']">广场</span>
      <span @click="currIndex = 1" :class="[currIndex === 1 ? 'active' : '']">社区</span>
    </div>
    <div class="AppCircle-list">
      <div class="item" v-for="(item, index) in 10" :key="index">
        <div class="item-top">
          <image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-fangwuchuzu.png" />
          <div class="right">
            <h3>李在地</h3>
            <span>清风街道</span>
          </div>
        </div>
        <div class="item-content">
          <span @click="$linkTo('./TopicDetail')">#【闲置物品交易】</span>
          <text>社家用闲置柜子自用，原价212，现价80要的联系</text>
        </div>
        <div class="item-imgs">
          <image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/home-bg.png" />
          <image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/home-bg.png" />
          <image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/home-bg.png" />
        </div>
        <p>2020-12-11 10:10</p>
        <div class="item-bottom">
          <div>
            <image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-zhuanfa.png" />
            <i>10</i>
          </div>
          <div>
            <image src="https://cdn.cunwuyun.cn/wxmp/fengdu/zan.png" />
            <i>10</i>
          </div>
          <div>
            <image src="https://cdn.cunwuyun.cn/wxmp/fengdu/ic-pinglun.png" />
            <i>10</i>
          </div>
        </div>
      </div>
    </div>
    <AiLogin ref="login"/>
  </div>
</template>
<script>
  import { mapActions, mapState } from 'vuex'

  export default {
    name: 'TopicDetail',
    appName: '话题详情',

    data () {
      return {
        currIndex: 0
      }
    },

    computed: {
      ...mapState(['user', 'token'])
    },

    onLoad() {
    },

    methods: {
      ...mapActions(['autoLogin', 'authCheck'])
    },

    onShareAppMessage() {
      return {
        title: '欢迎使用数字乡村治理服务一体化平台~',
        path: `/pages/AppCircle/AppCircle`
      }
    }
  }
</script>

<style scoped lang="scss">
  .TopicDetail {
    padding-top: 32px;
    padding-bottom: 40px;

    div {
      box-sizing: border-box;
    }

    & > h2 {
      margin: 0 32px 24px;
      font-size: 46px;
      color: #3d3d3d;
    }

    .tab {
      margin: 0 32px 24px;
    }

    & > p {
      margin: 0 32px 12px;
      color: #999999;
      font-size: 28px;
    }

    .AppCircle-list {
      .item {
        margin: 0 24px 24px;
        padding: 24px 24px 0;
        background: #ffffff;
        border-radius: 16px;
        box-shadow: inset 0 -1px 0 0 #eeeeee;

        .item-top {
          display: flex;
          align-items: center;

          image {
            width: 96px;
            height: 96px;
            margin-right: 16px;
            border-radius: 50%;
          }

          h3 {
            margin-bottom: 12px;
            color: #333333;
            text-align: left;
            font-size: 34px;
            font-weight: 500;
          }

          span {
            color: #999999;
            font-size: 28px;
          }
        }

        .item-imgs {
          display: flex;
          align-items: center;

          image {
            flex: 1;
            height: 202px;
            margin-right: 12px;

            &:nth-of-type(3n) {
              margin-right: 0;
            }
          }
        }

        & > p {
          margin: 24px 0;
          font-size: 28px;
          color: #333333;
        }

        .item-bottom {
          display: flex;
          align-items: center;
          height: 88px;
          border-top: 1px solid #eeeeee;

          div {
            display: flex;
            align-items: center;
            justify-content: center;
            flex: 1;

            image {
              width: 40px;
              height: 40px;
              margin: 16px;
            }

            i {
              color: #687DA6;
              font-size: 28px;
            }
          }
        }

        .item-content {
          margin: 16px;
          line-height: 1.3;
          // text-align: justify;

          span {
            font-size: 28px;
            color: #4181FF;
          }

          text {
            font-size: 28px;
            color: #333333;
          }
        }
      }
    }

    .tab {
      display: flex;
      align-items: center;
      height: 100px;

      span {
        position: relative;
        height: 100px;
        line-height: 100px;
        color: #222;
        font-size: 30px;

        &:first-child {
          margin-right: 64px;
        }

        &.active {
          font-weight: 600;
          font-size: 32px;

          &::after {
            position: absolute;
            bottom: 12px;
            left: 50%;
            width: 40px;
            height: 6px;
            border-radius: 3px;
            background: #2d7dffff;
            transform: translateX(-50%);
            content: ' ';
          }
        }
      }
    }
  }
</style>
