<template>
  <view class="content">
    <view class="item" v-for="(item, index) in list" :key="index" @click="tapItem(item, index)">
      <view class="key">
        <view class="img">
          <img :src="item.imgUrl" style="width: 100%; height: 100%;"/>
        </view>
        <view class="text">
          {{ item.text }}
        </view>
      </view>
      <view class="value">
        {{ item.value }}
      </view>
    </view>
  </view>
</template>

<script>
export default {
  name: "centerList",
  props: {
    list: {}
  },
  data() {
    return {

    }
  },
  methods: {

    // 点击列表项
    tapItem(item, index) {
      console.log(item, index, "item,index==========")
      if (item.text === '联系客服') {
        console.log("联系客服")
        this.$emit('open')
      } else if (item.text === '我的挂单' || item.text === '系统设置' || item.text === '关于我们' || item.text === '帮助反馈') {
        console.log("进入"+item.text)
        uni.navigateTo({
          url: item.toPathUrl
        })
      }
    },


  },

}
</script>


<style scoped lang="scss">
.content {
  background-color: #2e2e2e;

  .item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20rpx 40rpx;

    .key {
      display: flex;
      justify-content: center;
      align-items: center;
      color: #FFF;
      font-size: 32rpx;

      .img {
        width: 40rpx;
        height: 40rpx;
      }

      .text {
        margin-left: 20rpx;
      }


    }

    .value {
      color: #FFF;
      font-size: 36rpx;
    }
  }
}
</style>