//为授权的小程序帐号上传小程序代码&生成体验版

$ext_json = [

// 授权给第三方平台的小程序
‘extAppid’ => $data[‘key’],
‘ext’ => [

]
‘window’ => [‘navigationBarTitleText’=>$data[‘name’]]
];
$token = $this->getAccessToken();
if (is_error($token)) {
return $token;
}
$data = array(
‘template_id’ => $template_id,
‘ext_json’ => !empty($ext_json) ? json_encode($ext_json) : ”,
‘user_version’ => $version,
‘user_desc’ => $desc,
);
$url = “https://api.weixin.qq.com/wxa/commit?access_token={$token}”;
$result = $this->request($url, $data);
var_dump($result);

原因:

1、window同级覆盖。遍历 extjson 的window对象成员,如果 app.json 的window对象存在该对象成员,则覆盖,如果不存在,就添加。

2、但是如果页面.json中设置了navigationBarTitleText,则优先显示页面配置。

作者 admin

百度广告效果展示