security.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view>
  3. <view class="plr-36 mt-30">
  4. <view class="gray-1">
  5. 当前位置
  6. </view>
  7. <view class="size-40 bold mt-10">
  8. {{address}}
  9. </view>
  10. </view>
  11. <view class="plr-36 mt-60 gray-1">
  12. 紧急联系人
  13. </view>
  14. <u-cell-item icon="man-add" title="点击新增紧急联系人" @click="goAdd" v-if="userInfo.emergency_contact==''"></u-cell-item>
  15. <u-cell-item icon="man-add" :title="userInfo.emergency_contact" :arrow="false" v-if="userInfo.emergency_contact!=''"></u-cell-item>
  16. <u-cell-item icon="phone" :title="userInfo.contact_tel" :arrow="false" v-if="userInfo.contact_tel!=''"></u-cell-item>
  17. <view class="fixed-bottom plr-36 pb-50">
  18. <view class="size-32 red">
  19. 遇到危险,请立即向警方求助
  20. </view>
  21. <view class="mtb-20">
  22. 谎报警将可能被处以五日以上十日以下拘留
  23. </view>
  24. <u-button type="primary" @click="submit">呼叫110</u-button>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {mapState} from 'vuex'
  30. import amapFile from '../../libs/amap-wx.js'
  31. export default {
  32. data() {
  33. return {
  34. address: '',
  35. name:'',
  36. tel:'',
  37. key:'bb6f4ed802756f963b37c184ce4e9766'
  38. }
  39. },
  40. computed:{
  41. ...mapState(['userInfo'])
  42. },
  43. onShow() {
  44. var _this = this;
  45. this.amapPlugin = new amapFile.AMapWX({
  46. key: this.key
  47. });
  48. this.getRegeo()
  49. // uni.getLocation({
  50. // type: 'gcj02',
  51. // geocode: true,
  52. // success: function(res) {
  53. // console.log(res);
  54. // _this.address = res.address.province + res.address.city + res.address.district + res.address.street + res.address
  55. // .poiName
  56. // }
  57. // });
  58. },
  59. methods: {
  60. goAdd(){
  61. uni.navigateTo({
  62. url:'/pages/home/person-add'
  63. })
  64. },
  65. //获取位置
  66. getRegeo() {
  67. let _this = this
  68. uni.showLoading({
  69. title: '获取定位信息中'
  70. });
  71. this.amapPlugin.getRegeo({
  72. success: (data) => {
  73. console.log(9888888888888888888888888, data)
  74. this.address = data[0].name
  75. uni.hideLoading();
  76. }
  77. });
  78. },
  79. submit() {
  80. uni.makePhoneCall({
  81. phoneNumber: '110' //仅为示例
  82. });
  83. }
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. /deep/.u-btn {
  89. height: 96rpx !important;
  90. }
  91. /deep/.u-primary-hover {
  92. background: linear-gradient(to right,#00b6b4,#00d496) !important;
  93. }
  94. </style>