index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view class="content">
  3. <view @click="getAndroid">安卓测试</view>
  4. {{androidData}}
  5. <view @click="gojkorder">集客订单</view>
  6. <view>救援订单1</view>
  7. <view>
  8. {{longitude}}-----{{latitude}}
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. data() {
  15. return {
  16. title: 'Hello',
  17. androidData:'',
  18. latitude:'',
  19. longitude:'',
  20. }
  21. },
  22. onLoad() {
  23. window.getAndroid=this.getAndroid;
  24. // setTimeout( this.getAndroid(),500)
  25. // alert(11)
  26. // this.callByAndroid()
  27. // window.LoginOut=this.LoginOut
  28. /* uni.getLocation({
  29. type: 'wgs84',
  30. success: function (res) {
  31. console.log('当前位置的经度:' + res.longitude);
  32. console.log('当前位置的纬度:' + res.latitude);
  33. this.latitude=res.latitude
  34. this.longitude=res.longitude
  35. },fail(err){
  36. console.log(err)
  37. }
  38. }); */
  39. },
  40. created() {
  41. },
  42. methods: {
  43. gojkorder(){
  44. uni.navigateTo({
  45. url:'../myOrder/myOrder'
  46. })
  47. },
  48. // LoginOut(){
  49. // uni.showToast({
  50. // title: '66666',
  51. // icon:'none',
  52. // duration: 6000
  53. // });
  54. // },
  55. getAndroid(e){
  56. uni.showToast({
  57. title: '66666',
  58. icon:'none',
  59. duration: 6000
  60. });
  61. this.androidData=e
  62. return "hello";
  63. },
  64. callByAndroid(){
  65. alert("Js收到消息");
  66. }
  67. }
  68. }
  69. </script>
  70. <style scoped>
  71. .content {
  72. display: flex;
  73. flex-direction: column;
  74. align-items: center;
  75. justify-content: center;
  76. }
  77. .logo {
  78. height: 200rpx;
  79. width: 200rpx;
  80. margin-top: 200rpx;
  81. margin-left: auto;
  82. margin-right: auto;
  83. margin-bottom: 50rpx;
  84. }
  85. .text-area {
  86. display: flex;
  87. justify-content: center;
  88. }
  89. .title {
  90. font-size: 36rpx;
  91. color: #8f8f94;
  92. }
  93. </style>