home.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <view class="home">
  3. <!-- <uni-notice-bar show-icon scrollable
  4. text="uni-app 版正式发布,开发一次,同时发布iOS、Android、H5、微信小程序、支付宝小程序、百度小程序、头条小程序等7大平台。" /> -->
  5. <!-- <uni-card v-for="i in userInfoData.menus" :key="i.id">
  6. <view class="title">
  7. {{i.name}}
  8. </view>
  9. <view class="menu-list-warp">
  10. <view class="menu-list-box" v-for="j in i.children" :key="j.id" @click="toRouter(j)">
  11. <image :src="'../static/' + j.icon" mode=""></image>
  12. <view class="">
  13. {{j.name}}
  14. </view>
  15. </view>
  16. </view>
  17. </uni-card> -->
  18. <uni-card>
  19. <view class="title">
  20. 库存
  21. </view>
  22. <view class="menu-list-warp">
  23. <view class="menu-list-box" @click="toRouter('/submit/submit')">
  24. <image :src="'../static/smck.png'" mode=""></image>
  25. <view class="">
  26. 异常上报
  27. </view>
  28. </view>
  29. <view class="menu-list-box" @click="toRouter('/usedTotal/usedTotal')" v-if="isRoom">
  30. <image :src="'../static/tj.png'" mode=""></image>
  31. <view class="">
  32. 库存统计
  33. </view>
  34. </view>
  35. </view>
  36. </uni-card>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. getInfo
  42. } from "@/util/api.js";
  43. import Vue from 'vue'
  44. export default {
  45. data() {
  46. return {
  47. userInfoData: [],
  48. notificationData:[],
  49. isRoom:false,
  50. }
  51. },
  52. onLoad() {
  53. const v = this
  54. if(
  55. Vue.prototype.$token.role_id == '1552548151620026370' ||
  56. Vue.prototype.$token.role_id == '1552550790307004417' ||
  57. Vue.prototype.$token.role_id == '1552550978346041346'){
  58. this.isRoom = true
  59. }
  60. // v.$post('/wx/login/getUserInfo').then(res => {
  61. // v.userInfoData = res.data
  62. // Vue.prototype.$userInfo = res.data
  63. // uni.setStorage({
  64. // key: "userInfo",
  65. // data: res.data,
  66. // success(res) {
  67. // },
  68. // fail(res) {}
  69. // })
  70. // })
  71. // v.$post('/wx/message/notification',{}).then(res=>{
  72. // v.notificationData = res.data
  73. // })
  74. },
  75. methods: {
  76. toRouter(j) {
  77. console.log(j)
  78. uni.navigateTo({
  79. url: '/pages' + j
  80. })
  81. },
  82. },
  83. }
  84. </script>
  85. <style lang="less">
  86. .menu-list-warp {
  87. .menu-list-box {
  88. width: 25%;
  89. text-align: center;
  90. float: left;
  91. padding: 20rpx;
  92. image {
  93. width: 100rpx;
  94. height: 100rpx;
  95. }
  96. }
  97. }
  98. </style>