<template>
  <view class="page__view">

		<navbar title="我的评价" leftClick @leftClick="$utils.navigateBack" color="#191919" bgColor="#FFFFFF" />

    <view class="main">
      <view class="tabs">
        <uv-tabs 
          :list="tabs" 
          :scrollable="false" 
          lineColor="#7451DE"
          lineWidth="48rpx"
          lineHeight="4rpx"
          :activeStyle="{
            'font-family': 'PingFang SC',
            'font-weight': 500,
            'font-size': '32rpx',
            'line-height': 1.4,
            'color': '#7451DE',
          }" 
          :inactiveStyle="{
            'font-family': 'PingFang SC',
            'font-weight': 400,
            'font-size': '32rpx',
            'line-height': 1.4,
            'color': '#181818',
          }" 
          @click="clickTabs"
        ></uv-tabs>
      </view>

      <view class="comment">
        <view class="comment-item" v-for="item in list" :key="item.id">
          <commentCard :data="item" mode="edit" @deleteSucc="getData"></commentCard>
        </view>
      </view>
    </view>

  </view>
</template>

<script>
	import mixinsList from '@/mixins/list.js'

  import commentCard from '@/pages_order/comment/commentCard.vue'

  export default {
		mixins: [mixinsList],
    components: {
      commentCard,
    },
    data() {
      return {
        tabs: [
          { name: '全部' },
          { name: '有图/视频' },
          { name: '最新' },
        ],
        queryParams: {
          pageNo: 1,
          pageSize: 10,
        },
				mixinsListApi: 'myEvaluate',
      }
    },
    onShow() {
      console.log('onShow')
    },
    onLoad() {
      this.getData()
    },
    methods: {
			//点击tab栏
			clickTabs({ index }) {
        // 【type不传为全部，0是有图，1是最新】
				if (index == 0) {
					delete this.queryParams.type
				} else {
					this.queryParams.type = index - 1
				}
				this.getData()
			},
    },
  }
</script>

<style scoped lang="scss">
  .page__view {
    width: 100vw;
    min-height: 100vh;
    background-color: $uni-bg-color;
    position: relative;
    
    /deep/ .nav-bar__view {
      position: fixed;
      top: 0;
      left: 0;
    }
    
  }

  .main {
    width: 100vw;
    padding-top: calc(var(--status-bar-height) + 204rpx);
    box-sizing: border-box;

    .tabs {
      position: fixed;
      top: calc(var(--status-bar-height) + 120rpx);
      left: 0;
      width: 100%;
      height: 84rpx;
      background: #FFFFFF;

      /deep/ .uv-tabs__wrapper__nav__line {
        border-radius: 2rpx;
      }
    }
	}

  
  .comment {
    padding: 40rpx 32rpx;
    
    &-item {
      & + & {
        margin-top: 40rpx;
      }
    }
  }

</style>