修正详情页面返回时不刷新数据的bug

This commit is contained in:
zhl 2019-12-03 16:51:14 +08:00
parent f31e949faa
commit 256db39fb8

View File

@ -61,10 +61,24 @@ export default {
onLoad(options) {
this._id = options._id
},
onShow() {
let tmpData = this.$mp.page.data['$root'];
if (tmpData) {
this._id = tmpData[0]._id;
this.maker = tmpData[0].maker;
this.hotList = tmpData[0].hotList;
this.users = tmpData[0].users;
}
},
mounted() {
this.getData()
this.getHot()
},
onUnload() {
this.maker = {};
this.users = '';
this.hotList.length = 0;
},
methods: {
async getData() {
try {