<template>
  <view>
    <view class="box1" v-for="(item,index) in list" :key="index">
      {{ item.name }}<text>{{ item.id }}</text>
    </view>
  </view>
</template>

<script>
import post from "../../../common/httpClient.js";

export default {
  props: {},
  data: () => ({
    list: [
      { name: "aaaaaaa", id: 0 },
      { name: "bbbbbbb", id: 1 },
      { name: "ccccccc", id: 2 },
      { name: "ddddddd", id: 3 },
      { name: "eeeeeee", id: 4 },
      { name: "fffffff", id: 5 },
      { name: "ggggggg", id: 6 },
    ],
  }),
  computed: {},
  methods: {},
  watch: {},
  // 页面周期函数--监听页面加载
  onLoad() {
    
  },
  // 页面周期函数--监听页面初次渲染完成
  onReady() {},
  // 页面周期函数--监听页面显示(not-nvue)
  onShow() {},
  // 页面周期函数--监听页面隐藏
  onHide() {},
  // 页面周期函数--监听页面卸载
  onUnload() {},
  onPullDownRefresh() {
    // let that = this;
    // post({
    //   server: 2,
    //   servant: 1005,
    //   data: {
    //     phone: "3246541321",
    //     type: 1,
    //     verifyInfo: "asdasd",
    //   },
    // })
    //   .then((result) => {
    //     //if (result.code === 0) {
    //       let count = that.list.length
    //       that.list.push({
    //         name:result.msg,
    //         id:count
    //       })
    //     //}
    //     uni.stopPullDownRefresh();
    //   })
    //   .catch((err) => {
    //     uni.stopPullDownRefresh();
    //   });
  },
  onReachBottom(){
    let that = this;
    post({
      server: 2,
      servant: 1005,
      data: {
        phone: "3246541321",
        type: 1,
        verifyInfo: "asdasd",
      },
    })
      .then((result) => {
          let count = that.list.length
          that.list.push({
            name:result.msg,
            id:count
          })
      })
      .catch((err) => {
      });
  }

};
</script>

<style lang="scss">
@import url("./a.css");

.box1 {
  width: 100vw;
  height: 200rpx;
  color: #353535;
  font-size: 50rpx;
  text {
    font-size: $fs-middel;
    color: red;
  }
}
</style>
