123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <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>
|