hmp %!s(int64=5) %!d(string=hai) anos
pai
achega
483e8a0c50
Modificáronse 3 ficheiros con 67 adicións e 0 borrados
  1. 22 0
      pages/test/demo.vue
  2. 45 0
      pages/test/test2.vue
  3. BIN=BIN
      punch/static/icon/success.png

+ 22 - 0
pages/test/demo.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 45 - 0
pages/test/test2.vue

@@ -0,0 +1,45 @@
+<template>
+	<view>
+		<mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
+			<card :list="list"></card>
+		</mescroll-body>
+	</view>
+</template>
+
+<script>
+	// import card from "./comps/card.vue"
+	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
+	export default {
+		mixins: [MescrollMixin], // 使用mixin
+		// components:{
+		// 	card
+		// },
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			upCallback(mescroll){
+				let params={
+					
+				}
+				try{
+					this.$api.enterprise.page(params).then(res=>{
+						let data=res.data.records
+						let total=res.data.total
+						mescroll.endBySize(data.length,total);
+						if(mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
+						this.list=this.list.concat(data); //追加新数据
+					})
+				}catch(e){
+					this.mescroll.endErr()
+				}
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

BIN=BIN
punch/static/icon/success.png