1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- import {
- getHeight
- } from "../../utils/GetRheRemainingHeight";
- Component({
- properties: {
- height: {
- type: Number
- }, //组件高度
- getlist: {
- type: Function
- },
- pullDown: { //是否开启下拉
- type: Boolean,
- value: true
- },
- safety: { //适配苹果底部安全距离
- type: Boolean,
- value: true
- },
- },
- data: {
- inRefresh: false, //下拉开启自定义项
- },
- methods: {
- /* 下拉刷新 */
- pullToRefresh() {
- this.setData({
- inRefresh: true
- })
- this.triggerEvent("getlist", true)
- },
- /* 刷新完成 */
- RefreshToComplete() {
- setTimeout(() => {
- this.setData({
- inRefresh: false
- })
- }, 500)
- },
- /* 加载分页 */
- loadThePage() {
- this.triggerEvent("getlist", false)
- },
- /* 设置组件高度 */
- setHeight(element, that) {
- getHeight(element, that).then(res => {
- if (this.data.height != res) this.setData({
- height: res
- })
- });
- }
- }
- })
|