实在没办法了,不知道怎么改,百度不到解决办法?
发布于 5 年前 作者 fengxiuying 6718 次浏览 来自 问答

首页上方的标题。

app.json

“window”: {

“navigationBarTextStyle”: “white”,

“navigationBarTitleText”: “智慧党建云平台”,

“navigationBarBackgroundColor”: “#e64340”,

“backgroundColor”: “#f5f5f5”,

“enablePullDownRefresh”: true

},

打开小程序,开始是标题是“智慧党建云平台”,可很快加载成“智慧党建”,

我去了首页home.json,填上了如下代码

{

“navigationBarTitleText”: “智慧党建云平台”

}

测试代码有效,但最后还是会变为“智慧党建”。

请教各位如何修改

6 回复

你该考虑的是home.js里面是不是用了更换title

重新建立不就好了,肯定是你自己哪里没注意到

全局搜索过,找不到“智慧党建”,所以,不知道贴什么代码片段啊。

首页JS的

var _request = require("…/…/util/request.js"), _request2 = _interopRequireDefault(_request);

function _interopRequireDefault(e) {

return e && e.__esModule ? e : {

default: e

};

}

var app = getApp();

Page({

data: {

param: [],

wxapphomenavrpx: 1,

user: [],

currentTab: 0,

tabwidth: 1

},

getData: function() {

var t = this, e = t.data.param.openhome, a = null == t.data.user ? 0 : t.data.user.id, n = null == t.data.user ? 0 : t.data.user.branchid;

_request2.default.get(“home”, {

op: “getdata”,

openhome: e,

userid: a,

branchid: n

}).then(function(e) {

t.setData({

slide: e.slide,

article: e.article,

notice: e.notice,

edulesson: e.edulesson,

activity: e.activity,

seritem: e.seritem,

exapaper: e.exapaper

});

}, function(e) {

wx.showModal({

title: “提示”,

content: e,

showCancel: !1,

success: function(e) {

e.confirm && wx.reLaunch({

url: “…/login/login”

});

}

}), console.log(e);

});

},

onLoad: function(e) {

var t = this;

_request2.default.get(“attachurl”).then(function(e) {

wx.setStorageSync(“attachurl”, e), t.setData({

attachurl: e

});

}), _request2.default.get(“home”).then(function(e) {

wx.setStorageSync(“param”, e.param), wx.setStorageSync(“user”, e.user), t.setData({

param: e.param,

user: null == e.user ? null : e.user,

wxapphomenavrpx: 750 / e.param.wxapphomenav.number,

tabwidth: 750 / e.param.wxapphomecon.length

}), t.getData(), wx.setNavigationBarTitle({

title: e.param.title

}), app.tabBar = JSON.parse(e.param.wxappfootnav), app.util.footer(t);

}, function(e) {

wx.showModal({

title: “提示”,

content: e,

showCancel: !1,

success: function(e) {

e.confirm && wx.reLaunch({

url: “home”

});

}

}), console.log(e);

});

},

clickTab: function(e) {

if (this.data.currentTab === e.target.dataset.current) return !1;

this.setData({

currentTab: e.target.dataset.current

});

},

onReady: function() {},

onShow: function() {},

onHide: function() {},

onUnload: function() {},

onPullDownRefresh: function() {},

onReachBottom: function() {},

onShareAppMessage: function() {

return {

title: this.data.param.wxappsharetitle,

path: “/vlinke_cparty/pages/home/home”,

imageUrl: this.data.param.wxappshareimageurl

};

}

});

代码应该没问题,全局搜索一下哪里用到了智慧党建

你试试首页随便标题改个文字,比如叫测试标题,再看看过会是不是被改为了智慧党建,如果是,就全局搜索一下智慧党建4个字,看看是不是自己哪里调用了设置标题的方法

没有代码片段,说个毛线,猜吗?

回到顶部