直播间优化提示,安卓以及ios扫码权限判定

master
lemon橪 2021-06-29 16:26:32 +08:00
parent 73c307173b
commit 4599b02a41
4 changed files with 39 additions and 46 deletions

View File

@ -98,23 +98,14 @@ export default {
* 提交保存
*/
submit() {
if (this.form.regionId.length != 0 && this.birthday) {
delete this.form.___path;
let params = JSON.parse(JSON.stringify(this.form));
saveUserInfo(params).then((res) => {
if (res.statusCode == 200) {
storage.setUserInfo(res.data.result);
uni.navigateBack();
}
});
} else {
uni.showToast({
title: "请填写生日和城市!",
duration: 2000,
icon: "none",
});
}
},
/**

View File

@ -104,7 +104,6 @@ export default {
this.params[this.current].pageNumber = 1;
this.liveList = [];
this.getLives();
this.getRecommendLives();
},
onReachBottom() {
@ -225,6 +224,7 @@ export default {
* 进入直播间
*/
handleLivePlayer(val) {
// #ifdef MP-WEIXIN
let roomId = val.roomId; // API
let customParams = encodeURIComponent(
JSON.stringify({ path: "pages/index/index", pid: 1 })
@ -236,6 +236,15 @@ export default {
"&custom_params=" +
customParams,
});
// #endif
// #ifndef MP-WEIXIN
uni.showToast({
title: "请从微信小程序中预览直播功能",
duration: 2000,
icon: "none",
});
// #endif
},
},
};

View File

@ -68,6 +68,7 @@ export default {
return {
config,
pageData: "", //
isIos: "",
};
},
components: {
@ -96,7 +97,7 @@ export default {
this.init();
// #ifdef MP-WEIXIN
//
uni.showShareMenu({ withShareTicket: true, });
uni.showShareMenu({ withShareTicket: true });
// #endif
},
@ -137,9 +138,6 @@ export default {
}, 100);
}
});
// let
// webview
},
});
},
@ -153,9 +151,7 @@ export default {
content: "您已经关闭相机权限,去设置",
success: function (res) {
if (res.confirm) {
let isIos = plus.os.name == "iOS";
if (isIos) {
if (this.isIos) {
plus.runtime.openURL("app-settings:");
} else {
permision.gotoAppPermissionSetting();
@ -171,32 +167,28 @@ export default {
*/
async scan() {
// #ifdef APP-PLUS
let isIos = plus.os.name == "iOS";
this.isIos = plus.os.name == "iOS";
// Ios
if (isIos) {
if (this.isIos) {
const iosFirstCamera = uni.getStorageSync("iosFirstCamera"); //
if (iosFirstCamera !== "false") {
uni.setStorageSync("iosFirstCamera", "false"); //false
this.seacnCode();
} else {
if (permision.judgeIosPermission("camera")) {
this.seacnCode();
} else {
//
uni.showModal({
title: "提示",
content: "您已经关闭相机权限,去设置",
success: function (res) {
if (res.confirm) {
plus.runtime.openURL("app-settings:");
}
},
});
}
} else {
//
const result = await permision.requestAndroidPermission("CAMERA");
if (result == 1 || result == 0) {
this.seacnCode();
} else {
this.tipsGetSettings();
}
}
} else {
/**
* TODO 安卓 权限已经授权了调用api总是显示用户已永久拒绝申请人傻了
* TODO 如果xdm有更好的办法请在 https://gitee.com/beijing_hongye_huicheng/lilishop/issues
*/
this.seacnCode();
}
// #endif

View File

@ -9,6 +9,7 @@ const FACE_LOGIN = isDev ? "face_login_dev" : "face_login";
const FINGER_LOGIN = isDev ? "finger_login_dev" : "finger_login";
const CART_BACKBTN = isDev ? "cart_backbtn_dev" : "cart_backbtn";
export default {
// 获取face id登录
getFaceLogin() {
return uni.getStorageSync(FACE_LOGIN);