component3.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <view>
  3. <view class="box1" v-for="(item,index) in list" :key="index">
  4. {{ item.name }}<text>{{ item.name1 }}</text>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import post from "../../../common/httpClient.js";
  10. export default {
  11. props: {},
  12. data: () => ({
  13. list: [
  14. { name: "aaaaaaa", id: 0 },
  15. { name: "bbbbbbb", id: 1 },
  16. { name: "ccccccc", id: 2 },
  17. { name: "ddddddd", id: 3 },
  18. { name: "eeeeeee", id: 4 },
  19. { name: "fffffff", id: 5 },
  20. { name: "ggggggg", id: 6 },
  21. ],
  22. }),
  23. computed: {},
  24. methods: {},
  25. watch: {},
  26. // 页面周期函数--监听页面加载
  27. onLoad() {
  28. },
  29. // 页面周期函数--监听页面初次渲染完成
  30. onReady() {},
  31. // 页面周期函数--监听页面显示(not-nvue)
  32. onShow() {},
  33. // 页面周期函数--监听页面隐藏
  34. onHide() {},
  35. // 页面周期函数--监听页面卸载
  36. onUnload() {},
  37. onPullDownRefresh() {
  38. this.list[0].name1 = this.list[0].name+1
  39. uni.stopPullDownRefresh()
  40. //this.$forceUpdate();
  41. },
  42. onReachBottom(){
  43. let that = this;
  44. post({
  45. server: 2,
  46. servant: 1005,
  47. data: {
  48. phone: "3246541321",
  49. type: 1,
  50. verifyInfo: "asdasd",
  51. },
  52. })
  53. .then((result) => {
  54. let count = that.list.length
  55. that.list.push({
  56. name:result.msg,
  57. id:count
  58. })
  59. })
  60. .catch((err) => {
  61. });
  62. }
  63. };
  64. </script>
  65. <style lang="scss">
  66. @import url("./a.css");
  67. .box1 {
  68. width: 100vw;
  69. height: 200rpx;
  70. color: #353535;
  71. font-size: 50rpx;
  72. text {
  73. font-size: $fs-middel;
  74. color: red;
  75. }
  76. }
  77. </style>