网站转百度小程序教程
后记:这篇文章躺在草稿箱将近半个月,今天终于发布出来了。方法没有问题,跟微信转小程序差不多,并可以自定义TDK。但是,审核相当严格。前前后后修改修改再修改了近20遍。今天终于上线了。
一直想做个百度小程序,可惜受条件限制,没法搞。最近帮企业代运营网站,因为新买的域名,上线刚一周,还没有收录,有点捉急。所以,就来尝试下百度小程序,看能否加快网站收录。
准备工作:
1、营业执照。百度智能小程序不支持个人开发,如果你没有营业执照,以下信息你就不必再看了。(也是因为这条,一直没弄自己的百度小程序 )。
2、网站必须有手机端,或者为自适应网站。
3、注册百度小程序账号。
4、下载百度小程序开发工具最新版
5、网站必须部署SSL证书。
资料:

百度小程序注册地址:
https://smartprogram.baidu.com
百度小程序开发者工具下载地址:https://smartprogram.baidu.com/docs/develop/devtools/history/
一、小程序后台设置

设置--开发者设置--填写自己的业务域名及服务器域名(跟微信小程序一样)
二、开发者工具

打开开发者工具,选择新建小程序。
三、填写信息

填写对应信息,AppID比较重要,其次选择不使用智能小程序云开发。其他随便填,点击完成即可。
四、修改index.json文件

修改pages/index/index.json内容为自己小程序名称
五、修改index.swan文件

原内容

修改后
将pages/index/index.swan里面的代码全部清空替换为以下代码
第六步:流量配置


这应该是所有SEOer最关注的TDK设置。
将pages/index/index.js内添加如下代码即可,TDK根据需求自己修改。
测试
开发工具端:

其实从第五步配置好域名左侧就应该显示网站信息了,因为我用的不是主账号,绑定开发者的时候出错,提示一直提示没有AppID授权,设置完重新绑定下开发者才显示的(主要是用错了百度账号名字,搞的有点混乱)。
手机端:


注意顶端标题,是我们最后一步时候设置的title,说明TDK设置生效了。
所以,测试无误发布即可。
整个来说跟配置微信小程序差不多,只是多了TDK的设置,不过由于商标问题,账号还在审核中。做好了还不能上线,比较蛋疼。

其实整个流程都很简单,比较烦人的就是百度各种账号审核比较麻烦,相对于微信来说那就是非常麻烦,商标证书什么都提交了,还一大堆细则,如果不是看中百度的流量扶持,真的是懒得搞。
#程序员# #互联网资讯# #新媒体#