Commit db4f0d0c by liang ce

添加bind第三方账号图片和load效果

parent a87368f5
...@@ -63,10 +63,19 @@ ...@@ -63,10 +63,19 @@
justify-content: center; justify-content: center;
} }
.loadingToast view { .loadingToast>view {
font-size: 28rpx; font-size: 28rpx;
color: #FFFFFF; color: #FFFFFF;
padding: 18rpx 26rpx; padding: 18rpx 26rpx;
border-radius: 40rpx; border-radius: 40rpx;
background: rgba(0, 0, 0, .59) background: rgba(0, 0, 0, .59);
display: flex;
justify-content: center;
align-items: center;
}
.loadingToast image {
width: 36rpx;
height: 36rpx;
margin-right: 8rpx;
} }
\ No newline at end of file
...@@ -34,8 +34,23 @@ ...@@ -34,8 +34,23 @@
</view> </view>
</view> </view>
<view class="loadingToast" a:if="{{isLoading}}"> <view class="loadingToast" a:if="{{isLoading}}">
<view a:if="{{bindStatus==='loading'}}">
<image class="fix-img-width-fix" mode="scaleToFill" src="./../../assests/bindLoading.gif"/>
<view> <view>
账号关联中··· 账号关联中···
</view> </view>
</view>
<view a:elif="{{bindStatus==='success'}}">
<image class="fix-img-width-fix" mode="scaleToFill" src="./../../assests/bindSuccess.png"/>
<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
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
import "dingtalk-jsapi/entry/mobile"; import "dingtalk-jsapi/entry/mobile";
import openLink from "dingtalk-jsapi/api/biz/util/openLink"; import openLink from "dingtalk-jsapi/api/biz/util/openLink";
import create from "dd-store"; import create from "dd-store";
import { fail } from "assert";
let interval = ""; let interval = "";
let requestNum = 0; let requestNum = 0;
create.Page({ create.Page({
...@@ -18,7 +19,8 @@ create.Page({ ...@@ -18,7 +19,8 @@ create.Page({
isBind: false, isBind: false,
isLoading: false, isLoading: false,
showSelectPopup: false, showSelectPopup: false,
selectPopupList: [{ text: "取消关联" }] selectPopupList: [{ text: "取消关联" }],
bindStatus: "loading"
}, },
onLoad(e) { onLoad(e) {
this.setData({ this.setData({
...@@ -31,12 +33,17 @@ create.Page({ ...@@ -31,12 +33,17 @@ create.Page({
sendRequest() { sendRequest() {
let that = this; let that = this;
interval = setInterval(() => { interval = setInterval(() => {
if (requestNum >= 300) { if (requestNum >= 180) {
requestNum = 0; requestNum = 0;
that.setData({ that.setData({
isBind: false, isBind: false,
bindStatus: "fail"
});
setTimeout(() => {
that.setData({
isLoading: false isLoading: false
}); });
}, 2000);
clearInterval(interval); clearInterval(interval);
} }
requestNum++; requestNum++;
...@@ -47,8 +54,13 @@ create.Page({ ...@@ -47,8 +54,13 @@ create.Page({
this.setData({ this.setData({
name: item.userName, name: item.userName,
isBind: true, isBind: true,
bindStatus: "success"
});
setTimeout(() => {
that.setData({
isLoading: false isLoading: false
}); });
}, 2000);
clearInterval(interval); clearInterval(interval);
this.$store.data.relatedAppNeedUpdate = true; this.$store.data.relatedAppNeedUpdate = true;
this.update(); this.update();
...@@ -62,7 +74,8 @@ create.Page({ ...@@ -62,7 +74,8 @@ create.Page({
return false; return false;
} }
this.setData({ this.setData({
isLoading: true isLoading: true,
bindStatus: "loading"
}); });
this.sendRequest(); this.sendRequest();
if (this.data.platform === "outlook") { if (this.data.platform === "outlook") {
......
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