Commit 38d6c132 by liang ce

修改绑定之后的store类型,解决绑定后数据不断增加问题

parent bcbae44e
...@@ -17,24 +17,8 @@ create.Component({ ...@@ -17,24 +17,8 @@ create.Component({
this.getData(); this.getData();
}, },
didUpdate() { didUpdate() {
if (typeof this.$store.data.relatedAppNeedUpdate === "object") { if (this.$store.data.relatedAppNeedUpdate) {
let relatedAppList = this.data.relatedAppList; this.$store.data.relatedAppNeedUpdate = false;
let relatedAppPlatformList = this.data.relatedAppPlatformList;
relatedAppList.push({
userName: this.$store.data.relatedAppNeedUpdate.name,
platform: this.$store.data.relatedAppNeedUpdate.platform
});
relatedAppPlatformList.push(
this.$store.data.relatedAppNeedUpdate.platform
);
this.setData({
relatedAppList: relatedAppList,
relatedAppPlatformList: relatedAppPlatformList
});
this.$store.data.relatedAppNeedUpdate = "";
this.update();
} else if (this.$store.data.relatedAppNeedUpdate === "1") {
this.$store.data.relatedAppNeedUpdate = "";
this.update(); this.update();
this.getData(); this.getData();
} }
......
...@@ -49,10 +49,7 @@ create.Page({ ...@@ -49,10 +49,7 @@ create.Page({
isBind: true, isBind: true,
isLoading: false isLoading: false
}); });
this.$store.data.relatedAppNeedUpdate = { this.$store.data.relatedAppNeedUpdate = true
name: item.userName,
platform: this.data.platform
};
this.update(); this.update();
} }
}); });
...@@ -94,7 +91,7 @@ create.Page({ ...@@ -94,7 +91,7 @@ create.Page({
isBind: false, isBind: false,
showSelectPopup: false showSelectPopup: false
}); });
this.$store.data.relatedAppNeedUpdate = "1"; this.$store.data.relatedAppNeedUpdate = true;
this.update(); this.update();
} }
}); });
......
...@@ -30,7 +30,7 @@ create.Page({ ...@@ -30,7 +30,7 @@ create.Page({
unbind() { unbind() {
unbindingApp(this.data.item.platform).then(res => { unbindingApp(this.data.item.platform).then(res => {
if (res.data.data) { if (res.data.data) {
this.$store.data.relatedAppNeedUpdate = "1"; this.$store.data.relatedAppNeedUpdate = true;
this.update(); this.update();
dd.navigateBack({ dd.navigateBack({
delta: 1 delta: 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment