diff --git a/.gitignore b/.gitignore index ef08393..c885282 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules dist .idea .DS_Store +.wepycache diff --git a/src/app.wpy b/src/app.wpy index a6a3ba1..9cdb353 100644 --- a/src/app.wpy +++ b/src/app.wpy @@ -153,20 +153,22 @@ export default class extends wepy.app { // // 在页面中定义插屏广告 let interstitialAd = null + // 在页面onLoad回调事件中创建插屏广告实例 - if (wepy.createInterstitialAd) { - interstitialAd = wepy.createInterstitialAd({ + if (wx.createInterstitialAd) { + interstitialAd = wx.createInterstitialAd({ adUnitId: 'adunit-1a35266b79a02a85' }) } + // 在适合的场景显示插屏广告 if (interstitialAd) { interstitialAd.show().catch((err) => { console.error(err) }) } - // } + // 获取权限 async getPerms() { let perms = [] diff --git a/src/components/topicList.wpy b/src/components/topicList.wpy index 8f653a9..c5be29f 100644 --- a/src/components/topicList.wpy +++ b/src/components/topicList.wpy @@ -94,6 +94,7 @@ // 格式化updated_at topics.forEach(function (topic) { topic.updated_at_diff = util.diffForHumans(topic.UpdatedAt) + console.log('------', topic) }) // 如果传入参数 reset 为true,则覆盖 topics this.topics = reset ? topics : this.topics.concat(topics) diff --git a/src/mixins/replyMixin.js b/src/mixins/replyMixin.js index 969cd76..16b8277 100644 --- a/src/mixins/replyMixin.js +++ b/src/mixins/replyMixin.js @@ -34,7 +34,7 @@ export default class ReplyMixin extends wepy.mixin { replies.forEach((reply) => { // 控制是否可以删除 reply.can_delete = this.canDelete(user, reply) - reply.created_at_diff = util.diffForHumans(reply.created_at) + reply.created_at_diff = util.diffForHumans(reply.CreatedAt) }) // 如果reset不为true则合并 this.replies;否则直接覆盖 this.replies = reset ? replies : this.replies.concat(replies) diff --git a/src/pages/topics/index.wpy b/src/pages/topics/index.wpy index ba33930..ae8e47f 100644 --- a/src/pages/topics/index.wpy +++ b/src/pages/topics/index.wpy @@ -55,16 +55,16 @@ - {{ currentCategory.name || '话题' }} + {{ currentCategory.name || '全部' }} - 话题 + 全部 - + {{ category.name }} @@ -125,7 +125,6 @@ } this.categories = categories - console.log('categories====', categories) this.$apply() } onLoad() { @@ -155,7 +154,7 @@ }, // 选择分类重新加载 changeCategory (id = 0) { - this.currentCategory = id ? this.categories.find(category => category.id === id) : {} + this.currentCategory = id ? this.categories.find(category => category.ID === id) : {} this.categoryOpen = false this.$apply() this.requestData.category_id = this.currentCategoryId diff --git a/src/pages/topics/show.wpy b/src/pages/topics/show.wpy index 9420d2d..77d47d5 100644 --- a/src/pages/topics/show.wpy +++ b/src/pages/topics/show.wpy @@ -152,7 +152,6 @@ page{ } } async onLoad(options) { - console.log('11111111 --- show onload', options.id) await this.getTopic(options.id) // 获取当前登录用户 this.user = await this.$parent.getCurrentUser() diff --git a/src/pages/users/show.wpy b/src/pages/users/show.wpy index 1370136..d1a7dd2 100644 --- a/src/pages/users/show.wpy +++ b/src/pages/users/show.wpy @@ -73,9 +73,9 @@ this.user = userResponse.data // 格式化注册时间 - this.user.created_at_diff = util.diffForHumans(this.user.created_at) + this.user.created_at_diff = util.diffForHumans(this.user.CreatedAt) // 格式化最后活跃时间 - this.user.last_actived_at_diff = util.diffForHumans(this.user.last_actived_at) + this.user.last_actived_at_diff = util.diffForHumans(this.user.LastActivedAt) this.$apply()