index.js 486 B

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