diff --git a/src/App.vue b/src/App.vue
index 5335f6f..4fe18c8 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -3,12 +3,20 @@
import util from './utils/util';
export default {
onLaunch: function() {
- // #ifndef H5
this.updateManager();
- // #endif
+
+ wx?.onNeedPrivacyAuthorization?.((resolve, eventInfo) => {
+ console.log('触发本次事件的接口是:' + eventInfo.referrer)
+ // 需要用户同意隐私授权时
+ // 弹出开发者自定义的隐私授权弹窗
+ this.globalData.resolvePrivacyAuthorization = resolve;
+ // resolve({ buttonId: 'agree-btn', event:'agree' })
+ uni.navigateTo({ url: `/subpackage/common/pages/privacy`});
+ })
},
methods: {
isLogin(){
+
return !!uni.getStorageSync('token');
},
updateManager(){
diff --git a/src/manifest.json b/src/manifest.json
index 01fc516..9995e3a 100644
--- a/src/manifest.json
+++ b/src/manifest.json
@@ -60,7 +60,16 @@
"urlCheck" : false,
"minified" : true
},
- "usingComponents" : true
+ "usingComponents" : true,
+ "permission" : {
+ "scope.userLocation" : {
+ "desc" : "你的位置信息将用于小程序位置接口的效果展示"
+ }
+ },
+ "requiredPrivateInfos": [
+ "getLocation"
+ ],
+ "__usePrivacyCheck__": true
},
"mp-alipay" : {
"usingComponents" : true
diff --git a/src/pages.json b/src/pages.json
index ba403fa..c7b7166 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -703,6 +703,12 @@
"style" : {
"navigationBarTitleText": "支付订单"
}
+ },
+ {
+ "path": "pages/privacy",
+ "style" : {
+ "navigationBarTitleText": "隐私授权"
+ }
}
]
}
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index 22486f3..0bdf33f 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -173,6 +173,17 @@
}
},
async onLoad(options) {
+ uni.getLocation({
+ type: 'gcj02',
+ success: function (res) {
+ console.log('当前位置的经度:' + res.longitude);
+ console.log('当前位置的纬度:' + res.latitude);
+ },
+ fail: function (err) {
+ console.log('获取位置失败:' + JSON.stringify(err));
+ }
+ });
+
try{
util.showLoad();
// 20230829 新增平台账户不绑定,不检验,每次进来走重新登陆绑定流程
diff --git a/src/subpackage/common/pages/privacy.vue b/src/subpackage/common/pages/privacy.vue
new file mode 100644
index 0000000..bcad176
--- /dev/null
+++ b/src/subpackage/common/pages/privacy.vue
@@ -0,0 +1,64 @@
+
+
+ {{ privacyContractName }}
+
+
+
+
+
+
+
+
\ No newline at end of file