index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view class="container_box">
  3. <u-navbar height="40px" title=" " bgColor="transparent">
  4. <view class="u-nav-slot btn-left" slot="left" @click="meunClick">
  5. <image src="@/static/image/home/bulletpoint.png" mode=""></image>
  6. </view>
  7. <view class="u-nav-slot btn-right" slot="right" @click="noticeClick">
  8. <image src="@/static/image/home/notice-icon.png" mode=""></image>
  9. <u-badge type="error" :isDot="true" :show="noticeShow" :absolute="true" :offset="[-2,1]"></u-badge>
  10. </view>
  11. </u-navbar>
  12. <view class="container_main">
  13. <view class="header-box">
  14. <image src="@/static/image/home/home-top-img.png" mode=""></image>
  15. </view>
  16. <view class="container_cont">
  17. <view class="operate-item" v-for="(item,i) in operateList" :key="i" @click="operateClick(item)">
  18. <view class="operate-img">
  19. <image :src="item.src" mode=""></image>
  20. <u-badge type="error" absolute max="99" :value="item.num" :offset="[-5,-5]"></u-badge>
  21. </view>
  22. <view class="operate-text">{{item.text}}</view>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 菜单弹框 -->
  27. <use-pop :userInfo="userInfo" v-model="meunShow" @close="meunShow = false"></use-pop>
  28. </view>
  29. </template>
  30. <script>
  31. import usePop from './components/use-pop.vue'
  32. // const Base64 = require('js-base64').Base64
  33. import {
  34. mapGetters
  35. } from 'vuex'
  36. export default {
  37. components:{
  38. usePop
  39. },
  40. data() {
  41. return {
  42. operateList:[
  43. {
  44. src:require('@/static/image/home/icon-jhrw.png'),
  45. text:'拣货任务',
  46. num:0,
  47. url:'/pages/picking-task/index'
  48. },
  49. {
  50. src:require('@/static/image/home/icon-cgrk.png'),
  51. text:'采购入库',
  52. num:0,
  53. url:'/pages/purchase/index'
  54. },
  55. {
  56. src:require('@/static/image/home/icon-chcx.png'),
  57. text:'存货查询',
  58. num:0,
  59. url:'/pages/inventory-inquiry/index'
  60. },
  61. {
  62. src:require('@/static/image/home/icon-pdrw.png'),
  63. text:'盘点任务',
  64. num:0,
  65. url:'/pages/check/index'
  66. }
  67. ],
  68. meunShow:false,
  69. noticeShow:true
  70. }
  71. },
  72. onLoad() {
  73. // JSON.parse(Base64.decode(that.$Route.query.classData))
  74. },
  75. onShow() {
  76. if(!this.isLogin) {
  77. uni.$u.toast("请先登录!");
  78. setTimeout(()=>{
  79. uni.redirectTo({
  80. url:'/pages/login/login'
  81. })
  82. },1500)
  83. }
  84. },
  85. computed: {
  86. ...mapGetters(['isLogin','userInfo'])
  87. },
  88. methods: {
  89. meunClick() {
  90. if(!this.isLogin) {
  91. uni.$u.toast("请先登录!");
  92. setTimeout(()=>{
  93. uni.redirectTo({
  94. url:'/pages/login/login'
  95. })
  96. },1500)
  97. }else{
  98. this.meunShow = true
  99. }
  100. },
  101. operateClick(item) {
  102. uni.navigateTo({
  103. url:item.url
  104. })
  105. },
  106. noticeClick() {
  107. uni.navigateTo({
  108. url:'/pages/index/notice-page'
  109. })
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .btn-left {
  116. image {
  117. width: 48rpx;
  118. height: 48rpx;
  119. }
  120. }
  121. .btn-right {
  122. position: relative;
  123. image {
  124. width: 40rpx;
  125. height: 44rpx;
  126. }
  127. }
  128. .container_box {
  129. .container_main {
  130. .header-box {
  131. image {
  132. width: 100%;
  133. height: 375rpx;
  134. }
  135. }
  136. }
  137. .container_cont {
  138. padding: 32rpx;
  139. display: flex;
  140. align-items: center;
  141. justify-content: space-between;
  142. flex-wrap: wrap;
  143. .operate-item {
  144. width: 326rpx;
  145. height: 262rpx;
  146. border-radius: 16rpx;
  147. background: #FFF;
  148. display: flex;
  149. flex-direction: column;
  150. align-items: center;
  151. justify-content: center;
  152. margin-bottom: 32rpx;
  153. .operate-img {
  154. position: relative;
  155. image {
  156. width: 128rpx;
  157. height: 128rpx;
  158. }
  159. }
  160. .operate-text {
  161. color: #333;
  162. font-family: "PingFang SC";
  163. font-size: 32rpx;
  164. font-weight: 500;
  165. margin-top: 20rpx;
  166. }
  167. }
  168. }
  169. }
  170. </style>