Authored by 李奇

fixed:小程序首页title动态获取miniappName

... ... @@ -258,6 +258,9 @@ App({
getMiniappType() {
return wx.getExtConfigSync().miniappType;
},
getMiniappName() {
return wx.getExtConfigSync().miniappName;
},
getUnionType() {
return config.unionType;
},
... ...
... ... @@ -6,6 +6,7 @@
"name": "wechat",
"extAppid": "wxe8bfc9b404772199",
"miniappType": "5",
"miniappName": "测试店铺名",
"attr": {
"host": "open.weixin.qq.com",
"users": [
... ...
... ... @@ -36,6 +36,10 @@ Page({
onShow: function() {
const shopId = app.getShopId();
wx.setNavigationBarTitle({
title: app.getMiniappName(),
});
if (shopId) {
this.getShopData(shopId);
this.getShopProducts(shopId);
... ... @@ -123,14 +127,6 @@ Page({
indexModel.shopInfo(params)
.then(res => {
if (res.data.shop_name) {
let shopName = res.data.shop_name;
wx.setNavigationBarTitle({
title: shopName,
});
}
let shopInfo = res.data;
this.setData({
... ...
{
"navigationBarTitleText": "店铺",
"navigationBarTitleText": "",
"usingComponents": {
"resources": "/components/resources/resources",
"copyright": "/components/layout/copyright/copyright",
... ...