version/0412
liudan 11 months ago
parent 9158a95b89
commit 2fef9eb560
  1. 3
      manifest.json
  2. 77
      pages/news/user/vip.vue

@ -115,6 +115,9 @@
"permission" : { "permission" : {
"scope.userLocation" : { "scope.userLocation" : {
"desc" : "获取当前所在城市位置" "desc" : "获取当前所在城市位置"
},
"makePhoneCall": {
"desc": "用于拨打电话"
} }
}, },
"optimization" : { "optimization" : {

@ -110,39 +110,58 @@
}); });
}, },
makeCall(phoneNumber) { makeCall(phoneNumber) {
uni.getSetting({
success(res) {
if (!res.authSetting['scope.phoneCall']) {
//
uni.authorize({
scope: 'scope.phoneCall',
success() {
//
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: phoneNumber // phoneNumber: phoneNumber, //
}); success: (res) => {
}, },
fail() { //
// fail: (res) => {
uni.showModal({
title: '提示',
content: '需要电话权限',
success: function(modalRes) {
if (modalRes.confirm) {
uni.openSetting();
}
}
});
}
});
} else {
//
uni.makePhoneCall({
phoneNumber: phoneNumber //
});
}
} }
}); });
// uni.getSetting({
// success(res) {
// if (!res.authSetting['scope.makePhoneCall']) {
// //
// uni.authorize({
// scope: 'scope.makePhoneCall',
// success() {
// //
// uni.makePhoneCall({
// phoneNumber: phoneNumber //
// });
// },
// fail() {
// //
// uni.showModal({
// title: '',
// content: '',
// success: function(modalRes) {
// console.log(modalRes)
// if (modalRes.confirm) {
// uni.openSetting({
// success: (res) => {
// console.log(res)
// if (res.authSetting['scope.makePhoneCall']) {
// uni.makePhoneCall({
// phoneNumber: phoneNumber //
// });
// }
// }
// });
// }
// }
// });
// }
// });
// } else {
// //
// uni.makePhoneCall({
// phoneNumber: phoneNumber //
// });
// }
// }
// });
}, },
goVipDetails(item){ goVipDetails(item){
let details = JSON.stringify(item) let details = JSON.stringify(item)

Loading…
Cancel
Save