退出登陆调整

This commit is contained in:
李彪 2025-04-18 13:51:49 +08:00
parent ee96a2b2f5
commit c3627c8629
4 changed files with 109 additions and 54 deletions

View File

@ -198,8 +198,15 @@ export default {
toPage(path, item) { toPage(path, item) {
if (item.title === "注销") { if (item.title === "注销") {
uni.showModal({
title: "提示",
content: "确定注销吗?",
showCancel: true,
success: function (res) {
// 退
let u = navigator.userAgent; let u = navigator.userAgent;
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android let isAndroid =
u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
// let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios // let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios
try { try {
if (isAndroid && AndroidJs) { if (isAndroid && AndroidJs) {
@ -222,6 +229,9 @@ export default {
} catch (e) { } catch (e) {
console.log(e, "e-----判断安卓苹果类型出错"); console.log(e, "e-----判断安卓苹果类型出错");
} }
return
},
});
return; return;
} }
if (!path) return; if (!path) return;

View File

@ -163,6 +163,7 @@ export default {
onLoad(options) { onLoad(options) {
console.log("options", JSON.parse(decodeURIComponent(options.params))); console.log("options", JSON.parse(decodeURIComponent(options.params)));
this.params = JSON.parse(decodeURIComponent(options.params)); this.params = JSON.parse(decodeURIComponent(options.params));
window.uploadFn = this.uploadResFn;
}, },
created() { created() {
@ -185,6 +186,29 @@ export default {
// //
takePhoto() { takePhoto() {
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: "upload",
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-----判断安卓苹果类型出错");
}
return
uni.chooseImage({ uni.chooseImage({
count: 1, // 1 count: 1, // 1
sourceType: ["camera"], // sourceType: ["camera"], //
@ -200,6 +224,18 @@ export default {
}, },
}); });
}, },
// android
uploadResFn(data){
if (!data) {
return uni.showToast({ title: "未传入参数 uploadFn", icon: "none" });
}
uni.showModal({
title: "查看uploadFn",
content: JSON.stringify(data) || "未传入参数 initFn",
showCancel: true,
success: function (res) {},
});
},
// //
handleDelete() { handleDelete() {

View File

@ -14,16 +14,16 @@
</view> </view>
<u-button type="primary" @click="loginFn" style="margin-top: 50rpx">登陆</u-button> <u-button type="primary" @click="loginFn" style="margin-top: 50rpx">登陆</u-button>
<u-button type="primary" @click="login1Fn" style="margin-top: 50rpx" <u-button type="primary" @click="login1Fn" style="margin-top: 50rpx"
>登陆13800451500清洁工</u-button >登陆13800451500-清洁工</u-button
> >
<u-button type="primary" @click="login2Fn" style="margin-top: 50rpx" <u-button type="primary" @click="login2Fn" style="margin-top: 50rpx"
>登陆18174010562管理员</u-button >登陆18174010562-管理员</u-button
> >
<u-button type="primary" @click="login4Fn" style="margin-top: 50rpx" <u-button type="primary" @click="login4Fn" style="margin-top: 50rpx"
>登陆18174010562清洁工</u-button >登陆18174010562-清洁工</u-button
> >
<u-button type="primary" @click="login3Fn" style="margin-top: 50rpx" <u-button type="primary" @click="login3Fn" style="margin-top: 50rpx"
>登陆18174010561</u-button >登陆18174010561-清洁工</u-button
> >
</view> </view>
</template> </template>

View File

@ -189,6 +189,12 @@ export default {
toPage(path,item) { toPage(path,item) {
if(item.title === '注销'){ if(item.title === '注销'){
uni.showModal({
title: "提示",
content: "确定注销吗?",
showCancel: true,
success: function (res) {
// 退
let u = navigator.userAgent; let u = navigator.userAgent;
let isAndroid = let isAndroid =
u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
@ -215,6 +221,9 @@ export default {
console.log(e, "e-----判断安卓苹果类型出错"); console.log(e, "e-----判断安卓苹果类型出错");
} }
return return
},
});
return;
} }
if (!path) return; if (!path) return;