退出登陆调整
This commit is contained in:
parent
ee96a2b2f5
commit
c3627c8629
|
@ -198,30 +198,40 @@ export default {
|
||||||
|
|
||||||
toPage(path, item) {
|
toPage(path, item) {
|
||||||
if (item.title === "注销") {
|
if (item.title === "注销") {
|
||||||
let u = navigator.userAgent;
|
uni.showModal({
|
||||||
let isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
|
title: "提示",
|
||||||
// let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios
|
content: "确定注销吗?",
|
||||||
try {
|
showCancel: true,
|
||||||
if (isAndroid && AndroidJs) {
|
success: function (res) {
|
||||||
console.log("%c%s", "color:red", "安卓--调用返回方法");
|
// 确定退出
|
||||||
const reqRow = {
|
let u = navigator.userAgent;
|
||||||
name: "logout",
|
let isAndroid =
|
||||||
data: "",
|
u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
|
||||||
};
|
// let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios
|
||||||
AndroidJs.func(JSON.stringify(reqRow)); // 给安卓传参
|
try {
|
||||||
} else {
|
if (isAndroid && AndroidJs) {
|
||||||
console.log("%c%s", "color:red", "苹果--调用返回方法");
|
console.log("%c%s", "color:red", "安卓--调用返回方法");
|
||||||
const reqRow = {
|
const reqRow = {
|
||||||
name: "back-iphone",
|
name: "logout",
|
||||||
data: "",
|
data: "",
|
||||||
};
|
};
|
||||||
window.webkit.messageHandlers.func.postMessage(
|
AndroidJs.func(JSON.stringify(reqRow)); // 给安卓传参
|
||||||
JSON.stringify(reqRow)
|
} else {
|
||||||
); // 给ios 传参
|
console.log("%c%s", "color:red", "苹果--调用返回方法");
|
||||||
}
|
const reqRow = {
|
||||||
} catch (e) {
|
name: "back-iphone",
|
||||||
console.log(e, "e-----判断安卓苹果类型出错");
|
data: "",
|
||||||
}
|
};
|
||||||
|
window.webkit.messageHandlers.func.postMessage(
|
||||||
|
JSON.stringify(reqRow)
|
||||||
|
); // 给ios 传参
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e, "e-----判断安卓苹果类型出错");
|
||||||
|
}
|
||||||
|
return
|
||||||
|
},
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!path) return;
|
if (!path) return;
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -189,32 +189,41 @@ export default {
|
||||||
|
|
||||||
toPage(path,item) {
|
toPage(path,item) {
|
||||||
if(item.title === '注销'){
|
if(item.title === '注销'){
|
||||||
let u = navigator.userAgent;
|
uni.showModal({
|
||||||
let isAndroid =
|
title: "提示",
|
||||||
u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
|
content: "确定注销吗?",
|
||||||
// let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios
|
showCancel: true,
|
||||||
try {
|
success: function (res) {
|
||||||
if (isAndroid && AndroidJs) {
|
// 确定退出
|
||||||
console.log("%c%s", "color:red", "安卓--调用返回方法");
|
let u = navigator.userAgent;
|
||||||
const reqRow = {
|
let isAndroid =
|
||||||
name: "logout",
|
u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android
|
||||||
data: "",
|
// let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios
|
||||||
};
|
try {
|
||||||
AndroidJs.func(JSON.stringify(reqRow)); // 给安卓传参
|
if (isAndroid && AndroidJs) {
|
||||||
} else {
|
console.log("%c%s", "color:red", "安卓--调用返回方法");
|
||||||
console.log("%c%s", "color:red", "苹果--调用返回方法");
|
const reqRow = {
|
||||||
const reqRow = {
|
name: "logout",
|
||||||
name: "back-iphone",
|
data: "",
|
||||||
data: "",
|
};
|
||||||
};
|
AndroidJs.func(JSON.stringify(reqRow)); // 给安卓传参
|
||||||
window.webkit.messageHandlers.func.postMessage(
|
} else {
|
||||||
JSON.stringify(reqRow)
|
console.log("%c%s", "color:red", "苹果--调用返回方法");
|
||||||
); // 给ios 传参
|
const reqRow = {
|
||||||
}
|
name: "back-iphone",
|
||||||
} catch (e) {
|
data: "",
|
||||||
console.log(e, "e-----判断安卓苹果类型出错");
|
};
|
||||||
}
|
window.webkit.messageHandlers.func.postMessage(
|
||||||
return
|
JSON.stringify(reqRow)
|
||||||
|
); // 给ios 传参
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e, "e-----判断安卓苹果类型出错");
|
||||||
|
}
|
||||||
|
return
|
||||||
|
},
|
||||||
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (!path) return;
|
if (!path) return;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue