<template>
  <view class="left">
    <view v-for="(item, index) in leftList" :key="index" class="left-item">
      <image @click="goPath(item)" :src="item.img"></image>
      <text>{{ item.text }}</text>
    </view>
  </view>
</template>

<script>
import utils from "@/utils/index";
export default {
  data() {
    return {};
  },
  methods: {
    goPath(item) {
     let query = Object.assign({}, this.query);
      query.title = item.text;
      if (item.path) {
        let str = utils.mapToUrlQuery(query);
        console.log(item.path + "?" + str,'str')
        uni.navigateTo({
          url: item.path + "?" + str,
        });
      }
    },
  },
  props: {
    leftList: {
      type: Array,
      default: () => {
        return [];
      },
    },
    query: {
      type: Object,
      default: () => {
        return {};
      },
    },
    subject: {
      type: Number,
      default: 1,
    },
  },
};
</script>

<style lang="scss" scoped>
.left {
  width: 150rpx;
  margin-top: 50rpx;
  font-size: 26rpx;
  .left-item {
    width: 150rpx;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-content: center;
    align-items: center;
    margin-bottom: 36rpx;
    image {
      width: 100rpx;
      height: 100rpx;
    }
  }
}
</style>