<template>
  <view class="helpcenter">
    <view
      class="item"
      v-for="(item, index) in list"
      :key="index"
      @click="handleItem(item)"
    >
      <text>{{ item.name }}</text>
      <u-icon name="arrow-right" size="16"></u-icon>
    </view>
  </view>
</template>

<script>
import { getNewsList } from "@/common/api/news.js";
export default {
  data() {
    return {
      list: [],
    };
  },
  onShow() {
    this._getNewsList();
  },
  methods: {
    _getNewsList() {
      getNewsList({
        cid: 2,
        page: 1,
        pageSize: 100,
      }).then(({ data = {} }) => {
        this.list = data.list || [];
      });
    },
    handleItem(item) {
      uni.navigateTo({
        url: `/pages/article/article?id=${item.id}`,
      });
    },
  },
};
</script>

<style  lang="scss" scoped>
.helpcenter {
  padding: 20rpx 20rpx 0;
  .item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30rpx 0 25rpx;
    height: 115rpx;
    font-size: 32rpx;
    color: #232323;
    background-color: #ffffff;
    &:nth-child(n + 2) {
      border-top: 1px solid #eee;
    }
    &:first-child {
      border-radius: 16rpx 16rpx 0 0;
    }
    &:last-child {
      border-radius: 0 0 16rpx 16rpx;
    }
  }
}
</style>
