1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- //import * as WxJsApi from '@/utils/wxJsApi.js'
- import * as API from '@/apis/common.js'
- export default {
- data() {
- return {
- isReady:false,
- page:{
- classifyId:0,
- pageIndex:1,
- pageSize:10,
-
- },
- result:[],
- recordsTotal:0,
- }
- },
- components: {
-
- },
- // onPullDownRefresh() {
- // if(this.result.length<this.recordsTotal){
- // this.myLoadmore();
- // }
- // },
- onReachBottom() {
- if(this.result.length<this.recordsTotal){
- this.myLoadmore();
- }
- },
- onLoad(op){
- this.page.classifyId=op.id;
- },
- methods: {
- myLoadmore(){
- this.page.pageIndex++;
- this.getList();
- },
- getList(){
- uni.showLoading({
- title:"加载中",mask:true,
- })
- API.messageList(this.page).then((response) => {
- this.result=[
-
- ...this.result,
- ...response.data.data,
-
- ];
- this.recordsTotal=response.data.recordsTotal
- uni.stopPullDownRefresh();
- uni.hideLoading()
- }).catch(error => {
- uni.showToast({
- title:error
- })
- })
- },
-
- },onReady(){
- this.getList();
- this.isReady=true;
- },onShow(){
- if(this.isReady){
-
- }
- },
- }
|