index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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. <!-- 今日任务有未读 -->
  29. <u-popup :show="updateShow" :closeOnClickOverlay="false" :safeAreaInsetBottom="false" mode="center" :round="16" @close="state.taskNumShow = false">
  30. <view class="reason-box">
  31. <image class="icon-img" src="https://qiuyu-shuzhi.oss-cn-beijing.aliyuncs.com/image/task-pop-img.png" mode=""></image>
  32. <view class="reason-box-title">象力WMS邀请你升级至新版本</view>
  33. <view class="btn-box">
  34. <button class="reset-button cancel-btn" @click="updateShow = false">稍后再说</button>
  35. <button class="reset-button confirm-btn" @click="toUpdate">下载更新</button>
  36. </view>
  37. </view>
  38. </u-popup>
  39. </view>
  40. </template>
  41. <script>
  42. import usePop from './components/use-pop.vue'
  43. import { downloadApk } from '@/common/request/apis/index'
  44. // const Base64 = require('js-base64').Base64
  45. import {
  46. mapGetters
  47. } from 'vuex'
  48. export default {
  49. components:{
  50. usePop
  51. },
  52. data() {
  53. return {
  54. operateList:[
  55. {
  56. src:require('@/static/image/home/icon-jhrw.png'),
  57. text:'拣货任务',
  58. num:0,
  59. url:'/pages/picking-task/index'
  60. },
  61. {
  62. src:require('@/static/image/home/icon-cgrk.png'),
  63. text:'采购入库',
  64. num:0,
  65. url:'/pages/purchase/index'
  66. },
  67. {
  68. src:require('@/static/image/home/icon-chcx.png'),
  69. text:'存货查询',
  70. num:0,
  71. url:'/pages/inventory-inquiry/index'
  72. },
  73. {
  74. src:require('@/static/image/home/icon-pdrw.png'),
  75. text:'盘点任务',
  76. num:0,
  77. url:'/pages/inventory-task/index'
  78. }
  79. ],
  80. meunShow:false,
  81. noticeShow:true,
  82. updateShow:true
  83. }
  84. },
  85. onLoad() {
  86. // JSON.parse(Base64.decode(that.$Route.query.classData))
  87. },
  88. onShow() {
  89. if(this.$store.state.update.update) {
  90. console.log('需要更新')
  91. this.updateShow = true
  92. }
  93. if(!this.isLogin) {
  94. uni.$u.toast("请先登录!");
  95. setTimeout(()=>{
  96. uni.redirectTo({
  97. url:'/pages/login/login'
  98. })
  99. },1500)
  100. }
  101. },
  102. computed: {
  103. ...mapGetters(['isLogin','userInfo'])
  104. },
  105. watch: {
  106. },
  107. methods: {
  108. toUpdate() {
  109. },
  110. meunClick() {
  111. if(!this.isLogin) {
  112. uni.$u.toast("请先登录!");
  113. setTimeout(()=>{
  114. uni.redirectTo({
  115. url:'/pages/login/login'
  116. })
  117. },1500)
  118. }else{
  119. this.meunShow = true
  120. }
  121. },
  122. operateClick(item) {
  123. uni.navigateTo({
  124. url:item.url
  125. })
  126. },
  127. noticeClick() {
  128. uni.navigateTo({
  129. url:'/pages/index/notice-page'
  130. })
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. .btn-left {
  137. image {
  138. width: 48rpx;
  139. height: 48rpx;
  140. }
  141. }
  142. .btn-right {
  143. position: relative;
  144. image {
  145. width: 40rpx;
  146. height: 44rpx;
  147. }
  148. }
  149. .container_box {
  150. .container_main {
  151. .header-box {
  152. image {
  153. width: 100%;
  154. height: 375rpx;
  155. }
  156. }
  157. }
  158. .container_cont {
  159. padding: 32rpx;
  160. display: flex;
  161. align-items: center;
  162. justify-content: space-between;
  163. flex-wrap: wrap;
  164. .operate-item {
  165. width: 326rpx;
  166. height: 262rpx;
  167. border-radius: 16rpx;
  168. background: #FFF;
  169. display: flex;
  170. flex-direction: column;
  171. align-items: center;
  172. justify-content: center;
  173. margin-bottom: 32rpx;
  174. .operate-img {
  175. position: relative;
  176. image {
  177. width: 128rpx;
  178. height: 128rpx;
  179. }
  180. }
  181. .operate-text {
  182. color: #333;
  183. font-family: "PingFang SC";
  184. font-size: 32rpx;
  185. font-weight: 500;
  186. margin-top: 20rpx;
  187. }
  188. }
  189. }
  190. }
  191. .reason-box {
  192. width: 700rpx;
  193. background: url('https://qiuyu-shuzhi.oss-cn-beijing.aliyuncs.com/image/task-pop-bg.png') no-repeat;
  194. background-size: 100% 100%;
  195. padding: 0 60rpx 46rpx;
  196. box-sizing: border-box;
  197. .icon-img {
  198. width: 200rpx;
  199. height: 200rpx;
  200. border-radius: 50%;
  201. position: absolute;
  202. top: -100rpx;
  203. left: 50%;
  204. transform: translateX(-50%);
  205. }
  206. .reason-box-title {
  207. padding-top: 150rpx;
  208. color: #1D212A;
  209. font-family: "PingFang SC";
  210. font-size: 32rpx;
  211. font-weight: bold;
  212. text-align: center;
  213. }
  214. .btn-box {
  215. display: flex;
  216. align-items: center;
  217. justify-content: space-between;
  218. margin-top: 60rpx;
  219. .cancel-btn,
  220. .confirm-btn {
  221. width: 244rpx;
  222. height: 80rpx;
  223. border-radius: 16rpx;
  224. font-size: 32rpx;
  225. }
  226. .cancel-btn {
  227. border: 1px solid #BFC8DB;
  228. color: #86909C;
  229. }
  230. .confirm-btn {
  231. background: #0256FF;
  232. color: #FFF;
  233. font-weight: 500;
  234. }
  235. }
  236. }
  237. </style>