diff --git a/pages/adminMy/index.vue b/pages/adminMy/index.vue index 6321589..9b78967 100644 --- a/pages/adminMy/index.vue +++ b/pages/adminMy/index.vue @@ -203,6 +203,8 @@ export default { content: "确定注销吗?", showCancel: true, success: function (res) { + if(!res.confirm){return} + console.log(res,'res--') // 确定退出 let u = navigator.userAgent; let isAndroid = diff --git a/pages/user/index.vue b/pages/user/index.vue index 064be0d..b0b9398 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -189,44 +189,46 @@ export default { toPage(path,item) { if(item.title === '注销'){ + uni.showModal({ title: "提示", content: "确定注销吗?", showCancel: true, success: function (res) { - // 确定退出 - let u = navigator.userAgent; - let isAndroid = - u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android - // let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios - try { - if (isAndroid && AndroidJs) { - console.log("%c%s", "color:red", "安卓--调用返回方法"); - const reqRow = { - name: "logout", - data: "", - }; - AndroidJs.func(JSON.stringify(reqRow)); // 给安卓传参 - } else { - console.log("%c%s", "color:red", "苹果--调用返回方法"); - const reqRow = { - name: "back-iphone", - data: "", - }; - window.webkit.messageHandlers.func.postMessage( - JSON.stringify(reqRow) - ); // 给ios 传参 + if(res.confirm){ + // 确定退出 + let u = navigator.userAgent; + let isAndroid = + u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android + // let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios + try { + if (isAndroid && AndroidJs) { + console.log("%c%s", "color:red", "安卓--调用返回方法"); + const reqRow = { + name: "logout", + data: "", + }; + AndroidJs.func(JSON.stringify(reqRow)); // 给安卓传参 + } else { + console.log("%c%s", "color:red", "苹果--调用返回方法"); + const reqRow = { + name: "back-iphone", + data: "", + }; + window.webkit.messageHandlers.func.postMessage( + JSON.stringify(reqRow) + ); // 给ios 传参 + } + } catch (e) { + console.log(e, "e-----判断安卓苹果类型出错"); } - } catch (e) { - console.log(e, "e-----判断安卓苹果类型出错"); + return } - return }, }); return; } if (!path) return; - useRouter(path, {}, "navigateTo"); }, },