退出登陆调整
This commit is contained in:
parent
ee96a2b2f5
commit
c3627c8629
|
@ -198,30 +198,40 @@ export default {
|
|||
|
||||
toPage(path, item) {
|
||||
if (item.title === "注销") {
|
||||
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-----判断安卓苹果类型出错");
|
||||
}
|
||||
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 传参
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e, "e-----判断安卓苹果类型出错");
|
||||
}
|
||||
return
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!path) return;
|
||||
|
|
|
@ -163,6 +163,7 @@ export default {
|
|||
onLoad(options) {
|
||||
console.log("options", JSON.parse(decodeURIComponent(options.params)));
|
||||
this.params = JSON.parse(decodeURIComponent(options.params));
|
||||
window.uploadFn = this.uploadResFn;
|
||||
},
|
||||
|
||||
created() {
|
||||
|
@ -185,6 +186,29 @@ export default {
|
|||
|
||||
// 拍照获取图片
|
||||
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({
|
||||
count: 1, // 每次拍摄1张
|
||||
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() {
|
||||
|
|
|
@ -14,16 +14,16 @@
|
|||
</view>
|
||||
<u-button type="primary" @click="loginFn" style="margin-top: 50rpx">登陆</u-button>
|
||||
<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"
|
||||
>登陆18174010562管理员</u-button
|
||||
>登陆18174010562-管理员</u-button
|
||||
>
|
||||
<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"
|
||||
>登陆18174010561</u-button
|
||||
>登陆18174010561-清洁工</u-button
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
@ -189,32 +189,41 @@ export default {
|
|||
|
||||
toPage(path,item) {
|
||||
if(item.title === '注销'){
|
||||
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-----判断安卓苹果类型出错");
|
||||
}
|
||||
return
|
||||
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 传参
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e, "e-----判断安卓苹果类型出错");
|
||||
}
|
||||
return
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!path) return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue