洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
2.1 KiB

  1. <template>
  2. <view class="pageBgImg pad">
  3. <view class="status_bar"></view>
  4. <view class="" style="height: 100rpx;"></view>
  5. <topInfo :carType="curObject.name" @changeSubject="changeSubject"></topInfo>
  6. <subject1 v-if="curObject.id==1"></subject1>
  7. <subject2 v-if="curObject.id==2"></subject2>
  8. <subject3 v-if="curObject.id==3"></subject3>
  9. <subject4 v-if="curObject.id==4"></subject4>
  10. </view>
  11. </template>
  12. <script>
  13. import topInfo from './comp/topInfo.vue'
  14. import subject1 from './comp/subject1.vue'
  15. import subject2 from './comp/subject2.vue'
  16. import subject3 from './comp/subject3.vue'
  17. import subject4 from './comp/subject4.vue'
  18. var KJGNSS = uni.requireNativePlugin("KJ-GNSS");
  19. export default {
  20. components: { topInfo, subject1, subject2,subject3,subject4 },
  21. data() {
  22. return {
  23. curObject: {
  24. name: '科目一',
  25. id: 1
  26. }
  27. }
  28. },
  29. onLoad() {
  30. if (plus.os.name == 'Android') {
  31. plus.android.requestPermissions(
  32. ['android.permission.ACCESS_FINE_LOCATION',
  33. 'android.permission.ACCESS_COARSE_LOCATION'
  34. ],
  35. function(resultObj) {
  36. var result = 0;
  37. for (var i = 0; i < resultObj.granted.length; i++) {
  38. var grantedPermission = resultObj.granted[i];
  39. console.log('已获取的权限:' + grantedPermission);
  40. result = 1
  41. }
  42. for (var i = 0; i < resultObj.deniedPresent.length; i++) {
  43. var deniedPresentPermission = resultObj.deniedPresent[i];
  44. console.log('拒绝本次申请的权限:' + deniedPresentPermission);
  45. result = 0
  46. }
  47. for (var i = 0; i < resultObj.deniedAlways.length; i++) {
  48. var deniedAlwaysPermission = resultObj.deniedAlways[i];
  49. console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
  50. result = -1
  51. }
  52. },
  53. function(error) {
  54. console.log('申请权限错误:' + error.code + " = " + error.message);
  55. }
  56. );
  57. }
  58. },
  59. onShow() {
  60. },
  61. methods: {
  62. // 切换科目
  63. changeSubject(val) {
  64. console.log(val)
  65. this.curObject = val
  66. },
  67. getProviderFn() {
  68. }
  69. }
  70. }
  71. </script>
  72. <style scoped lang="scss">
  73. </style>