Browse Source

app端权限修改

zyh
Aaron 4 years ago
parent
commit
8d4fe84606
  1. 28
      manifest.json
  2. 100
      pages/activity/Poster/index.vue

28
manifest.json

@ -28,28 +28,22 @@
/* android */ /* android */
"android" : { "android" : {
"permissions" : [ "permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>", "<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>", "<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>", "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>", "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.RECORD_AUDIO\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>"
] ]
}, },
/* ios */ /* ios */

100
pages/activity/Poster/index.vue

@ -4,7 +4,7 @@
<text class="iconfont icon-shuoming"></text>提示长按图片保存至手机相册 <text class="iconfont icon-shuoming"></text>提示长按图片保存至手机相册
</view> </view>
<view class="poster"> <view class="poster">
<image :src="image" mode="widthFix" show-menu-by-longpress /> <image :src="image" mode="widthFix" @longtap="longtap" show-menu-by-longpress />
</view> </view>
</view> </view>
</template> </template>
@ -36,54 +36,56 @@
} }
}, },
methods: { methods: {
// //
getBargainPoster: function () { getBargainPoster: function () {
var that = this; var that = this;
let from = this.$deviceType let from = this.$deviceType
if (from == 'weixin' || this.$deviceType == 'weixinh5') { if (from == 'weixin' || this.$deviceType == 'weixinh5') {
from = 'uniappH5' from = 'uniappH5'
} }
getBargainPoster({ getBargainPoster({
bargainId: that.id, bargainId: that.id,
from from
}) })
.then(res => { .then(res => {
that.image = res.data.url; that.image = res.data.url;
that.status = false; that.status = false;
}) })
.catch(res => { .catch(res => {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
}); });
}, },
// //
getCombinationPoster: function () { getCombinationPoster: function () {
var that = this; var that = this;
console.log(this.$deviceType) console.log(this.$deviceType)
let from = this.$deviceType let from = this.$deviceType
if (from == 'weixin' || this.$deviceType == 'weixinh5') { if (from == 'weixin' || this.$deviceType == 'weixinh5') {
from = 'uniappH5' from = 'uniappH5'
} }
console.log(from) console.log(from)
getCombinationPoster({ getCombinationPoster({
id: that.id, id: that.id,
from from
}) })
.then(res => { .then(res => {
that.image = res.data.url; that.image = res.data.url;
that.status = false; that.status = false;
}) })
.catch(res => { .catch(res => {
uni.showToast({ uni.showToast({
title: res.msg, title: res.msg,
icon: "none", icon: "none",
duration: 2000 duration: 2000
}); });
}); });
} },
//
longtap () {}
} }
}; };
</script> </script>

Loading…
Cancel
Save