index.js 454 B

12345678910111213141516171819202122232425
  1. const WXAPI = require('apifm-wxapi')
  2. Page({
  3. data: {
  4. },
  5. onLoad: function (options) {
  6. options.key = 'aboutus'
  7. this.data.key = options.key
  8. this.cmsPage()
  9. },
  10. onShow: function () {
  11. },
  12. async cmsPage() {
  13. const res = await WXAPI.cmsPage(this.data.key)
  14. if (res.code == 0) {
  15. this.setData({
  16. cmsPageDetail: res.data
  17. })
  18. wx.setNavigationBarTitle({
  19. title: res.data.info.title,
  20. })
  21. }
  22. },
  23. })