tabbar.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="wh100 fixed" :style="{'padding-bottom':wagesheight+'rpx'}">
  3. <view class="tabbar-box">
  4. <view class="item" @tap="goPage('/pages/index/index','home')">
  5. <view class="icon-box">
  6. <image src="/static/icon/home.png" mode="aspectFit" v-if="checked!=='home'"></image>
  7. <image src="/static/icon/achome.png" mode="aspectFit" v-if="checked=='home'"></image>
  8. </view>
  9. <text :class="checked=='home' ? 'active' : 'nomal'">合同列表</text>
  10. </view>
  11. <view class="item" @tap="goPage('/pages/acceptor/acceptor','acceptor')" v-if="state==0">
  12. <view class="icon-box">
  13. <image src="/static/icon/per.png" mode="aspectFit" v-if="checked!='acceptor'"></image>
  14. <image src="/static/icon/out.png" mode="aspectFit" v-if="checked=='acceptor'"></image>
  15. </view>
  16. <text :class="checked=='acceptor' ? 'active' : 'nomal'">承兑人</text>
  17. </view>
  18. <view class="item" @tap="goPage('/pages/drawer/drawer','drawer')" v-if="state==0">
  19. <view class="icon-box">
  20. <image src="/static/icon/acsip.png" mode="aspectFit" v-if="checked!='drawer'"></image>
  21. <image src="/static/icon/biao.png" mode="aspectFit" v-if="checked=='drawer'"></image>
  22. </view>
  23. <text :class="checked=='drawer' ? 'active' : 'nomal'">出票人</text>
  24. </view>
  25. <view class="item" @tap="goPage('/pages/supplier/supplier','supplier')" v-if="state==0">
  26. <view class="icon-box">
  27. <image src="/static/icon/acsup.png" mode="aspectFit" v-if="checked!='supplier'"></image>
  28. <image src="/static/icon/sup.png" mode="aspectFit" v-if="checked=='supplier'"></image>
  29. </view>
  30. <text :class="checked=='supplier' ? 'active' : 'nomal'">供应商</text>
  31. </view>
  32. <view class="iconas" @tap="goContract('/pages/alldeatil/upcontract','upcontract')" v-if="state==1" >
  33. <view class="plusicon" :style="{'bottom':wagesheight+'rpx'}">
  34. </view>
  35. </view>
  36. <view class="item" @tap="goPage('/pages/mine/mine','my')">
  37. <view class="icon-box2">
  38. <image src="/static/icon/my.png" mode="aspectFit" v-if="checked!='my'"></image>
  39. <image src="/static/icon/acmy.png" mode="aspectFit" v-if="checked=='my'"></image>
  40. </view>
  41. <text :class="checked=='my' ? 'active' : 'nomal'">我的</text>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. let that
  48. export default {
  49. name: 'tabbar',
  50. data() {
  51. return {
  52. state: 0,
  53. wagesheight:''
  54. };
  55. },
  56. props: {
  57. checked: {
  58. type: String,
  59. default: 'home'
  60. }
  61. },
  62. mounted() {
  63. that=this
  64. that.state=that.$store.state.admin
  65. console.log(that.state,888)
  66. uni.getSystemInfo({
  67. success: function(res) {
  68. let bottom= res.safeArea.bottom
  69. let height= res.safeArea.height
  70. let cacl=bottom-height
  71. that.wagesheight =cacl
  72. }
  73. })
  74. },
  75. methods: {
  76. goContract(url, tab) {
  77. if (this.checked == tab) return;
  78. uni.navigateTo({
  79. url: url,
  80. animationType: 'slide-out-right',
  81. })
  82. },
  83. goPage(url, tab) {
  84. if (this.checked == tab) return;
  85. uni.reLaunch({
  86. url: url,
  87. animationType: 'slide-out-right',
  88. })
  89. }
  90. }
  91. };
  92. </script>
  93. <style lang="scss" scoped>
  94. .status_height {
  95. padding-bottom: 80rpx;
  96. // padding-bottom: env(safe-area-inset-bottom);
  97. width: 100%;
  98. }
  99. .wh100 {
  100. width: 100%;
  101. height: 50px;
  102. // padding-bottom:44rpx;
  103. background-color: #fff;
  104. // margin-bottom: 80rpx;
  105. // background: url("@/static/img/tababr.png");
  106. background-size: 100%;
  107. // box-shadow: 0px -2px 10rpx 0px rgba(181, 181, 181, 0.5);
  108. }
  109. .fixed {
  110. position: fixed;
  111. z-index: 999;
  112. bottom: 0;
  113. }
  114. .tabbar-box {
  115. height: 100%;
  116. display: flex;
  117. flex-direction: row;
  118. align-items: center;
  119. background-color: #fff;
  120. border-top: solid 1px #f5f5f5;
  121. .item {
  122. flex: 1;
  123. font-size: 12px;
  124. display: flex;
  125. flex-direction: column;
  126. justify-content: center;
  127. align-items: center;
  128. height: 100%;
  129. text-align: center;
  130. .icon-box {
  131. width: 24px;
  132. height: 24px;
  133. image {
  134. width: 100%;
  135. height: 100%;
  136. }
  137. }
  138. .icon-box2 {
  139. width: 20px;
  140. height: 20px;
  141. image {
  142. width: 100%;
  143. height: 100%;
  144. }
  145. }
  146. .active {
  147. font-weight: bold;
  148. color: $theme-color;
  149. }
  150. .nomal {
  151. font-weight: 500;
  152. color: #393939;
  153. }
  154. }
  155. .jy {
  156. // margin-bottom: 20px;
  157. .icon-box {
  158. width: 40px;
  159. height: 40px;
  160. // background: #fff;
  161. border-radius: 50%;
  162. line-height: 40px;
  163. display: flex;
  164. align-items: center;
  165. justify-content: center;
  166. padding: 8rpx;
  167. box-sizing: border-box;
  168. // box-shadow: 0px -2px 10rpx 0px rgba(181, 181, 181, 0.5);
  169. // box-shadow: 0px -2px 20px 0px rgba(181, 181, 181, 0.5);
  170. image {
  171. width: 40px;
  172. height: 40px;
  173. }
  174. }
  175. }
  176. }
  177. .iconas{
  178. width: 180rpx;
  179. }
  180. .plusicon{
  181. position: fixed;
  182. left: 0;
  183. right: 0;
  184. margin: 0 auto;
  185. bottom:-20rpx;
  186. width: 150rpx;
  187. height: 150rpx;
  188. background: url("@/static/img/plusicon.png") no-repeat;
  189. background-size: 100%;
  190. }
  191. </style>