Commit 8f66932b59fb6918806969c10e0eca4b48af5cd0

Authored by fengtao
1 parent a680eb0b

feat:新增全局变量openid和修改解绑弹窗点击否关闭事件

@@ -56,9 +56,9 @@ @@ -56,9 +56,9 @@
56 <view> 56 <view>
57 <u-popup bgColor="transparent" :overlay="true" :show="showBind" mode="bottom"> 57 <u-popup bgColor="transparent" :overlay="true" :show="showBind" mode="bottom">
58 <view class="u-flex logout-main"> 58 <view class="u-flex logout-main">
59 - <view class="main"><text style="color: #999999">是否需要解?</text></view> 59 + <view class="main"><text style="color: #999999">是否需要解除绑定的账号?</text></view>
60 <view @click="confrimBind(info)" class="main"><text style="color: #f95e5a">是</text></view> 60 <view @click="confrimBind(info)" class="main"><text style="color: #f95e5a">是</text></view>
61 - <view class="main1"><text @click="showBind = false" style="color: #3478f7">否</text></view> 61 + <view @click="showBind = false" class="main1"><text style="color: #3478f7">否</text></view>
62 </view> 62 </view>
63 </u-popup> 63 </u-popup>
64 </view> 64 </view>
@@ -134,7 +134,8 @@ export default { @@ -134,7 +134,8 @@ export default {
134 } 134 }
135 ] 135 ]
136 }, 136 },
137 - info: {} 137 + info: {},
  138 + openIds: ''
138 }; 139 };
139 }, 140 },
140 onLoad(e) { 141 onLoad(e) {
@@ -150,13 +151,21 @@ export default { @@ -150,13 +151,21 @@ export default {
150 this.id = params.data.userId; 151 this.id = params.data.userId;
151 } 152 }
152 }, 153 },
  154 + onShow() {
  155 + let getOpenId = getApp().globalData.openId;
  156 + console.log('获取全局openId', getOpenId);
  157 + if (getOpenId) {
  158 + this.openIds = getOpenId;
  159 + }
  160 + },
153 methods: { 161 methods: {
154 confrimBind(e) { 162 confrimBind(e) {
155 if (e) { 163 if (e) {
  164 + console.log('Bind', e.third?.thirdUserId);
156 //解绑 165 //解绑
157 let httpData = { 166 let httpData = {
158 appUserId: e.data?.userId, 167 appUserId: e.data?.userId,
159 - thirdUserId: e.third?.thirdUserId 168 + thirdUserId: e.third?.thirdUserId == null ? this.openIds : e.third?.thirdUserId
160 }; 169 };
161 uni.$u.http.delete('/yt/third', httpData).then(res => { 170 uni.$u.http.delete('/yt/third', httpData).then(res => {
162 if (res) { 171 if (res) {