Commit bb08e258 by liang ce

修改解绑绑定outlook逻辑

parent 55b9f0a9
const app = getApp(); const app = getApp();
import $http from "./http"; import $http from "./http";
import $binding from "./binding"; import $binding from "./binding";
// 获取创建会议室的会议室列表
export function getMeetingRoom(data) {
return $http({
method: "get",
data: data,
url: "/meet/meeting-room/page"
});
}
// 获取会议室分类
// 办公区域
// OFFICE_LOCATION(0,"meeting_room_location")
// 会议室设施
// OFFICE_FACILITY(1,"meeting_room_facility")
// 会议室分类
// OFFICE_CATEGORY(2,"meeting_room_category")
export function getLabelTree(data) {
return $http({
method: "get",
data: data,
url: "/admin/label/tree"
});
}
// 更新办公区域,设施,分类
export function getMettingRoomLabelUpdate(data) {
return $http({
method: "POST",
data: JSON.stringify(data),
url: "/admin/label/update"
});
}
// 添加办公区域、会议室分类、会议室设置
export function getMettingRoomLabelSave(data) {
return $http({
method: "POST",
data: JSON.stringify(data),
url: "/admin/label/save"
});
}
// 删除办公区域、会议室分类、会议室设置
export function getMettingRoomLabelRemove(data) {
return $http({
method: "get",
data: data,
url: `/admin/label/remove/${data}`
});
}
// 删除会议室
export function getRemoveMeetingRoom(data) {
return $http({
method: "get",
data: "",
url: `/meet/meeting-room/remove/${data}`
});
}
// 创建会议室
export function saveMettingRoom(data) {
return $http({
method: "post",
data: JSON.stringify(data),
url: "/meet/meeting-room/save"
});
}
// 修改会议室
export function mettingRoomUpdate(data) {
return $http({
method: "post",
data: JSON.stringify(data),
url: "/meet/meeting-room/update"
});
}
// 获取会议室详情
export function getMeetingRoomVOByUuid(data) {
return $http({
method: "get",
data: "",
url: `/meet/meeting-room/getMeetingRoomVOByUuid/${data}`
});
}
// 获取我的会议
export function myMeetingPage(data) {
return $http({
method: "post",
data: JSON.stringify(data),
url: "/meet/meeting/myPage"
});
}
// 获取预定会议室列表 // 获取预定会议室列表
export function getReserveRoomList(data) { export function getReserveRoomList(data) {
return $http({ return $http({
...@@ -97,24 +11,6 @@ export function getReserveRoomList(data) { ...@@ -97,24 +11,6 @@ export function getReserveRoomList(data) {
}); });
} }
// 获取预定会议详情
export function getMyMeetingDetails(data) {
return $http({
method: "get",
data: "",
url: `/meet/meeting/${data}`
});
}
// 修改预定时间设置
export function updateGlobalSetting(data) {
return $http({
method: "post",
data: JSON.stringify(data),
url: `/meet/meeting-global-setting/update`
});
}
// 获取首页信息 // 获取首页信息
export function getHomeUserSchedule(data) { export function getHomeUserSchedule(data) {
return $http({ return $http({
...@@ -318,3 +214,12 @@ export function getThirdUserPlatForm(data) { ...@@ -318,3 +214,12 @@ export function getThirdUserPlatForm(data) {
url: `/admin/third/user/getThirdUserPlatForm` url: `/admin/third/user/getThirdUserPlatForm`
}); });
} }
// 解绑第三方app
export function unbindingApp(data) {
return $http({
method: "get",
data: "",
url: `/admin/third/user/remove/${data}`
});
}
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<view class="applicationList" a:for="{{relatedAppList}}" a:if="{{item.platform !== 'dingTalk'}}"> <view class="applicationList" a:for="{{relatedAppList}}" a:if="{{item.platform !== 'dingTalk'}}">
<view class="applicationLogo {{item.platform}}"> <view class="applicationLogo {{item.platform}}">
</view> </view>
<view class="applicationMsg"> <view class="applicationMsg" data-item="{{item}}" catchTap="toAppDetails">
<view> <view>
<view> <view>
{{item.thirdUserIdentify}} {{item.thirdUserIdentify}}
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<view class="applicationList" a:if="{{relatedAppPlatformList.indexOf('outlook') === -1}}"> <view class="applicationList" a:if="{{relatedAppPlatformList.indexOf('outlook') === -1}}">
<view class="applicationLogo outlook"> <view class="applicationLogo outlook">
</view> </view>
<view class="applicationMsg" catchTap="bindingOutlook"> <view class="applicationMsg" data-platform="outlook" catchTap="bindingOutlook">
<view> <view>
<view> <view>
Outlook日历 Outlook日历
......
import { getThirdUserPlatForm } from "../../api/request"; import { getThirdUserPlatForm } from "../../api/request";
import { throttle } from "../../utils/utils";
import create from "dd-store"; import create from "dd-store";
create.Component({ create.Component({
mixins: [], mixins: [],
...@@ -13,18 +14,34 @@ create.Component({ ...@@ -13,18 +14,34 @@ create.Component({
this.setData({ this.setData({
userInfo: JSON.parse(getApp().globalData.userInfo) userInfo: JSON.parse(getApp().globalData.userInfo)
}); });
this.getDate(); this.getData();
}, },
didUpdate() { didUpdate() {
if (this.$store.data.relatedAppNeedUpdate) { if (typeof this.$store.data.relatedAppNeedUpdate === "object") {
this.$store.data.relatedAppNeedUpdate = false; let relatedAppList = this.data.relatedAppList;
let relatedAppPlatformList = this.data.relatedAppPlatformList;
relatedAppList.push({
thirdUserIdentify: 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.getDate(); this.getData();
} }
}, },
didUnmount() { }, didUnmount() {},
methods: { methods: {
getDate() { getData() {
getThirdUserPlatForm().then(res => { getThirdUserPlatForm().then(res => {
let relatedAppPlatformList = []; let relatedAppPlatformList = [];
res.data.data.forEach(item => { res.data.data.forEach(item => {
...@@ -32,15 +49,24 @@ create.Component({ ...@@ -32,15 +49,24 @@ create.Component({
}); });
this.setData({ this.setData({
relatedAppList: res.data.data, relatedAppList: res.data.data,
relatedAppPlatformList: relatedAppPlatformList relatedAppPlatformList: res.data.data.map(it => it.platform)
}); });
}); });
}, },
preventSort() { preventSort() {
return false; return false;
}, },
bindingOutlook() { bindingOutlook(e) {
dd.navigateTo({ url: "./../bindingOutlook/bindingOutlook" }); dd.navigateTo({
url: `./../bindingOutlook/bindingOutlook?platform=${e.target.dataset.platform}`
});
},
toAppDetails(e) {
dd.navigateTo({
url: `./../outlookDetails/outlookDetails?item=${JSON.stringify(
e.target.dataset.item
)}`
});
} }
} }
}); });
...@@ -6,9 +6,13 @@ import create from "dd-store"; ...@@ -6,9 +6,13 @@ import create from "dd-store";
create.Page({ create.Page({
data: { data: {
$data: null, $data: null,
url: "" url: "",
platform: ''
}, },
onLoad() { onLoad(e) {
this.setData({
platform: e.platform
})
this.webViewContext = dd.createWebViewContext("web-view-1"); this.webViewContext = dd.createWebViewContext("web-view-1");
let data = `${getApp().globalData.userid},${dd.corpId}`; let data = `${getApp().globalData.userid},${dd.corpId}`;
getOutlookUrl(data).then(res => { getOutlookUrl(data).then(res => {
...@@ -26,7 +30,10 @@ create.Page({ ...@@ -26,7 +30,10 @@ create.Page({
}; };
authorizationCodeReplacementToken(data).then(res => { authorizationCodeReplacementToken(data).then(res => {
if (res.data.data) { if (res.data.data) {
this.$store.data.relatedAppNeedUpdate = true; this.$store.data.relatedAppNeedUpdate = {
name: res.data.data,
platform: this.data.platform
}
this.update(); this.update();
dd.navigateBack({ dd.navigateBack({
delta: 1 delta: 1
......
import { import {
getMeetingRoom,
myMeetingPage,
getReserveRoomList, getReserveRoomList,
getAllScheduleWithMeetingRoomByTime getAllScheduleWithMeetingRoomByTime
} from "../../api/request"; } from "../../api/request";
......
.relatedAppPage {
height: 100vh;
background: #FFFFFF;
}
.platformMsg {
display: flex;
padding: 34rpx 32rpx;
align-items: center;
}
.platformImg {
width: 60rpx;
height: 60rpx;
margin-right: 24rpx;
}
.outlook {
background: url(../../assests/outlookLogo.png) center /100% 100%;
}
.zoom {
background: url(../../assests/zoomLogo.png) center /100% 100%;
}
.unBinding {
width: 686rpx;
height: 96rpx;
margin: 22rpx auto;
border-radius: 48rpx;
border: 2rpx solid rgba(222, 222, 222, 1);
text-align: center;
line-height: 0.96rem;
font-size: 34rpx;
color: rgba(242, 86, 67, 1);
}
\ No newline at end of file
<view> <view class="relatedAppPage">
New Page <view class="platformMsg" a:if="{{item.platform === 'outlook'}}">
<view class="platformImg {{item.platform}}">
</view>
<view class="platformName">
{{item.thirdUserIdentify}}
</view>
</view>
<view class="platformMsg" a:if="{{item.platform === 'zoom'}}">
<view class="platformImg {{item.platform}}">
</view>
<view class="platformName">
{{item.thirdUserIdentify}}
</view>
</view>
<view class="unBinding" onTap="unbind">
取消关联
</view>
</view> </view>
\ No newline at end of file
import {} from "../../api/request"; import { unbindingApp } from "../../api/request";
import create from "dd-store"; import create from "dd-store";
create.Page({ create.Page({
data: { data: {
$data: null, $data: null,
item: ""
}, },
onLoad() {}, onLoad(e) {
this.setData({
item: JSON.parse(e.item)
});
},
unbind() {
unbindingApp(this.data.item.platform).then(res => {
if (res.data.data) {
this.$store.data.relatedAppNeedUpdate = "1";
this.update();
dd.navigateBack({
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