首页 > 微信 > 详细

微信公众号获取图片素材接口

时间:2018-01-10 11:02:30      阅读:339      评论:0      收藏:0      [点我收藏+]

看代码

getImage(){
                this.$http.put(wechatapi+‘/token?access-token=‘+this.token).then((res)=> {

                    var postobj = {
                        ‘type‘:‘image‘,
                        ‘offset‘:this.listnum2,
                        ‘count‘:this.perpage2
                    }
                    postobj = JSON.stringify(postobj)
                    this.$http.post(‘/cgi-bin/material/batchget_material?access_token=‘+res.body,postobj,{emulateJSON: true}).then((res)=>{
                        console.log(res,6666)
                        this.data2 = res.body.item;
                        this.listTotal2 = res.body[‘total_count‘];
                        this.page2 =  Math.ceil((res.body[‘total_count‘])/(this.perpage2));
                    }).catch((res)=>{})
                }).catch((error)=> {})
                
 },

分页需要根据自定义页数perpage2去请求,offset参数就是请求到哪一个位置,count是页数

微信公众号获取图片素材接口

原文:https://www.cnblogs.com/xiaoluoli/p/8256998.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!