浏览代码

2020.7.4

git-svn-id: svn://svn7.apicloud.com/A6007457911931/%E5%9C%88%E5%A4%9A%E5%A4%9A@645 0e1a2743-8d03-4e5a-a60c-7e26af42b145
1149931599@qq.com 4 年之前
父节点
当前提交
ad03ac78f8
共有 1 个文件被更改,包括 6 次插入14 次删除
  1. 6 14
      html/frame0.html

+ 6 - 14
html/frame0.html

@@ -249,9 +249,14 @@ apiready = function() {
     _myalias = "member" + $api.getStorage("memberid");
     jpushInit();
 	var storage = hasPermission('storage');
+	var has = hasPermission('camera');
 	if(!storage || !storage[0] || !storage[0].granted){
 		reqPermission('storage')
 	}
+	if(!has || !has[0] || !has[0].granted){
+	    reqPermission('location');
+
+	}
 	//滑动到底部
     api.addEventListener({
         name: 'scrolltobottom'
@@ -305,7 +310,6 @@ $("#hotel-list").on("tap", ".home-hotel-list", function() {
 })
 
 $(".scan-barcode").on("tap", function() {
-    var has = hasPermission('camera');
     if(!has || !has[0] || !has[0].granted){
         api.confirm({
             title: '提醒',
@@ -484,7 +488,6 @@ function getmsgtotal() {
                 }
             } else {
                 if (datas.code == 2000) {
-                    console.log(datas)
                 } else {
                     errcode(datas, datas.code);
                 }
@@ -736,18 +739,7 @@ $("#set-local").on("tap", function() {
 function getAddress() {
     var has = hasPermission('location');
     if(!has || !has[0] || !has[0].granted){
-        api.confirm({
-            title: '提醒',
-            msg: "没有获得 定位 权限\n是否前往设置?",
-            buttons: ['去设置', '取消']
-        }, function (ret, err) {
-            var index = ret.buttonIndex;
-            if (index == 1) {
-                reqPermission('location');
-            } else {
-                api.toast({ msg: '获取定位权限失败...' });
-            }
-        });
+        reqPermission('location');
         $(".border-none").removeClass("mask-hidden");
         return false;
     }