setpageinfo时,image字段怎么调用文章内页图片?

lxf2023-04-02 12:48:01

前言:

随着百度小程序的风头正劲,越来越多的站长投入到百度小程序的开发中来,但是开发过程中难免会碰到诸多问题无法自己解决,04-13小编发现百度用户:【AdminJS】提出了一个关于“setpageinfo时,image字段怎么调用文章内页图片?”的问题,在问题中开发者爱押对该问题做了如下阐述:

问题类型:

  • 问题类型:咨询

问题描述:

问题描述

请问下,setpageinfo时,image怎么调用文章内页图片?

                content: bdParse.bdParse(‘article’, ‘html’, content.body, that, 10),                that.setData({                    description: content.description,                    pubdate: util.formatTime(content.pubdate, ‘Y-M-D h:m:s’),                    title: content.arctitle,                    writer: content.writer,                    desc: content.description,                    isrelations: isrelations,                    relations: content.relations,                    pictureurls: content.pictureurls,                    pre: content.preNext.pre,                    next: content.preNext.next,                })                swan.setNavigationBarTitle({                    title: content.title + “-” + swan.getStorageSync(‘system’).seotitle                })                swan.setPageInfo && swan.setPageInfo({                    title: content.title + ” – ” + CATEGORYS[that.data.typeid][‘typename’] + ” – ” + swan.getStorageSync(‘system’).seotitle,                    keywords: content.keywords,                    description: content.description,                    releaseDate: util.formatTime(swan.getStorageSync(‘system’).releasedate, ‘Y-M-D h:m:s’),                    image: [content.pictureurls],                    articleTitle: content.title,                    success: function () {                        console.log(‘setPageInfo success’);                    },                    fail: function (err) {                        console.log(‘setPageInfo fail’, err);                    }                })

 

这样image调取不出来

注:以上是百度小程序开发者:”爱押”对于本问题的一些阐述,这里做一个引用,我们将实时关注百度小程序助手对该问题提出的解决方案

解决方案:

【AdminJS】百度官方对用户爱押提出的setpageinfo时,image字段怎么调用文章内页图片?给予如下回复

数组,是用dedecms系统做的后台。

结语:

百度工程师对于小程序倾入了大量精力,有了开源框架,百度智能小程序可以让第三方平台轻轻松松构建自己的小程序平台,还可以将小程序和APP关联起来,让你的APP不再是一座孤岛。

如果您也在使用百度小程序,请关注AdminJS.cn,如果您有关于百度小程序的使用问题请联系我们,或者去百度小程序平台找官方人员给予解决,相信百度在小程序上的发力会是一个里程碑!