homePage.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="box">
  3. <!-- 自定义导航 -->
  4. <view class="zdyNavBox">
  5. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  6. <view class="zdyNav">
  7. <view class="zdyNavLeft">
  8. <image src="../../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback">
  9. </image>
  10. </view>
  11. <view class="zdyNavTitle">车型件</view>
  12. <!-- <view class="zdyNavRight"></view> -->
  13. <view style="width: 50px;"></view>
  14. </view>
  15. </view>
  16. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  17. <view style="height: 44px;"></view>
  18. <view class="mainBox">
  19. <image class="barner" src="../../static/img/banner_chexingjian.png" mode=""></image>
  20. <image @click="goIndex()" class="searchBtn" src="../../static/img/button_search.png" mode=""></image>
  21. <image class="title" src="../../static/img/text_zhongjian.png" mode=""></image>
  22. <image class="content" src="../../static/img/text_shuoming.png" mode=""></image>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import searchBox from '@/components/searchBox/searchBox.vue'
  28. export default {
  29. components: {
  30. searchBox
  31. },
  32. data() {
  33. return {
  34. iStatusBarHeight: '',
  35. searchValue: '',
  36. }
  37. },
  38. onLoad() {
  39. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  40. },
  41. methods: {
  42. search(val) {
  43. // console.log(val);
  44. this.searchValue = val
  45. },
  46. goIndex() {
  47. uni.navigateTo({
  48. url: 'index'
  49. })
  50. },
  51. goback() {
  52. console.log('返回');
  53. // uni.navigateBack({})
  54. //app交互
  55. var standalone = window.navigator.standalone
  56. var userAgent = window.navigator.userAgent.toLowerCase()
  57. var safari = /safari/.test(userAgent)
  58. var ios = /iphone|ipod|ipad|mac/.test(userAgent)
  59. var android = /android/.test(userAgent)
  60. if (ios) {
  61. if ( true) {//!standalone&& !safari
  62. window.webkit.messageHandlers.goMyNav.postMessage(null)
  63. }
  64. } else if (android) {
  65. window.android.postMessage()
  66. }
  67. },
  68. }
  69. }
  70. </script>
  71. <style>
  72. .box {
  73. min-height: 100vh;
  74. background: #ffffff;
  75. }
  76. .zdyNavBox {
  77. width: 100vw;
  78. background: #FFFFFF;
  79. position: fixed;
  80. top: 0;
  81. left: 0;
  82. z-index: 9999999;
  83. }
  84. .zdyNav {
  85. height: 44px;
  86. display: flex;
  87. justify-content: space-between;
  88. align-items: center;
  89. }
  90. .backImg {
  91. width: 44rpx;
  92. height: 44rpx;
  93. margin-left: 10rpx;
  94. margin-right: 20rpx;
  95. }
  96. .homeImg {
  97. width: 44rpx;
  98. height: 44rpx;
  99. }
  100. .zdyNavLeft {
  101. display: flex;
  102. align-items: center;
  103. }
  104. .zdyNavTitle {
  105. height: 44px;
  106. background: #FFFFFF;
  107. text-align: center;
  108. font-size: 34rpx;
  109. line-height: 44px;
  110. }
  111. .zdyNavRight {
  112. height: 44px;
  113. background: #FFFFFF;
  114. text-align: center;
  115. font-size: 28rpx;
  116. line-height: 44px;
  117. color: #3F90F7;
  118. margin-right: 24rpx;
  119. }
  120. .mainBox {
  121. background: #FFFFFF;
  122. min-height: 100vh;
  123. width: 100vw;
  124. }
  125. .barner{
  126. height: 300rpx;
  127. width: 100%;
  128. }
  129. .searchBtn{
  130. padding: 30rpx 24rpx 0;
  131. width: calc(100vw - 48rpx);
  132. height: 92rpx;
  133. }
  134. .centerBox{
  135. margin-top: 140rpx;
  136. margin-bottom: 100rpx;
  137. display: flex;
  138. justify-content: center;
  139. align-items: center;
  140. }
  141. .title{
  142. padding: 142rpx 116rpx 100rpx;
  143. width: calc(100vw - 232rpx);
  144. height: 40rpx;
  145. }
  146. .content{
  147. padding: 0 47rpx;
  148. width: calc(100vw - 94rpx);
  149. height: 224rpx;
  150. }
  151. </style>