Commit a0c17226 by liang ce

修改绑定第三方账号过程

parent 57233bad
...@@ -26,7 +26,11 @@ create.Component({ ...@@ -26,7 +26,11 @@ create.Component({
didUnmount() {}, didUnmount() {},
methods: { methods: {
getData() { getData() {
getThirdUserPlatForm().then(res => { let data = {
platForm: "",
ddUserId: getApp().globalData.userid
};
getThirdUserPlatForm(data).then(res => {
let relatedAppPlatformList = []; let relatedAppPlatformList = [];
res.data.data.forEach(item => { res.data.data.forEach(item => {
relatedAppPlatformList.push(item.platform); relatedAppPlatformList.push(item.platform);
......
...@@ -46,11 +46,17 @@ ...@@ -46,11 +46,17 @@
关联成功 关联成功
</view> </view>
</view> </view>
<view a:else> <view a:elif="{{bindStatus==='fail'}}">
<image class="fix-img-width-fix" mode="scaleToFill" src="./../../assests/bindFail.png"/> <image class="fix-img-width-fix" mode="scaleToFill" src="./../../assests/bindFail.png"/>
<view> <view>
关联失败 关联失败
</view> </view>
</view> </view>
<view a:else>
<image class="fix-img-width-fix" mode="scaleToFill" src="./../../assests/bindFail.png"/>
<view>
账户已关联
</view>
</view>
</view> </view>
<selectpopup showSelectPopup="{{showSelectPopup}}" selectPopupList="{{selectPopupList}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup> <selectpopup showSelectPopup="{{showSelectPopup}}" selectPopupList="{{selectPopupList}}" onSelectPopup="onSelectPopup" onSelectPopupCancel="onSelectPopupCancel"></selectpopup>
\ No newline at end of file
...@@ -47,16 +47,26 @@ create.Page({ ...@@ -47,16 +47,26 @@ create.Page({
clearInterval(interval); clearInterval(interval);
} }
requestNum++; requestNum++;
let data={ let data = {
platform: this.data.platform, platForm: this.data.platform,
ddUserId: getApp().globalData.userid ddUserId: getApp().globalData.userid
} };
getThirdUserPlatForm(data).then(res => { getThirdUserPlatForm(data).then(res => {
let relatedAppPlatformList = []; if (res.data.msg === "当前账号已被其他账号绑定!") {
res.data.data.forEach(item => { this.setData({
if (item.platform === this.data.platform) { isBind: false,
bindStatus: "fail"
});
setTimeout(() => {
that.setData({
isLoading: false
});
}, 2000);
clearInterval(interval);
} else if (res.data.data) {
if (res.data.data.platform === this.data.platform) {
this.setData({ this.setData({
name: item.userName, name: res.data.data.userName,
isBind: true, isBind: true,
bindStatus: "success" bindStatus: "success"
}); });
...@@ -69,7 +79,7 @@ create.Page({ ...@@ -69,7 +79,7 @@ create.Page({
this.$store.data.relatedAppNeedUpdate = true; this.$store.data.relatedAppNeedUpdate = true;
this.update(); this.update();
} }
}); }
}); });
}, 1000); }, 1000);
}, },
......
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