index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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="showUpdatePop" :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 { downloadApkWithJsonPost } from '@/common/utils/app-update.js'
  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. showUpdatePop(){
  105. return this.$store.state.update.update&&this.updateShow
  106. }
  107. },
  108. watch: {
  109. },
  110. methods: {
  111. toUpdate() {
  112. const params = this.$store.state.update.downloadApkParams
  113. const url = this.$BASE_URL + '/pda/downloadApk'
  114. downloadApkWithJsonPost(url, params)
  115. },
  116. meunClick() {
  117. if(!this.isLogin) {
  118. uni.$u.toast("请先登录!");
  119. setTimeout(()=>{
  120. uni.redirectTo({
  121. url:'/pages/login/login'
  122. })
  123. },1500)
  124. }else{
  125. this.meunShow = true
  126. }
  127. },
  128. operateClick(item) {
  129. uni.navigateTo({
  130. url:item.url
  131. })
  132. },
  133. noticeClick() {
  134. uni.navigateTo({
  135. url:'/pages/index/notice-page'
  136. })
  137. }
  138. }
  139. }
  140. </script>
  141. <style lang="scss" scoped>
  142. .btn-left {
  143. image {
  144. width: 48rpx;
  145. height: 48rpx;
  146. }
  147. }
  148. .btn-right {
  149. position: relative;
  150. image {
  151. width: 40rpx;
  152. height: 44rpx;
  153. }
  154. }
  155. .container_box {
  156. .container_main {
  157. .header-box {
  158. image {
  159. width: 100%;
  160. height: 375rpx;
  161. }
  162. }
  163. }
  164. .container_cont {
  165. padding: 32rpx;
  166. display: flex;
  167. align-items: center;
  168. justify-content: space-between;
  169. flex-wrap: wrap;
  170. .operate-item {
  171. width: 326rpx;
  172. height: 262rpx;
  173. border-radius: 16rpx;
  174. background: #FFF;
  175. display: flex;
  176. flex-direction: column;
  177. align-items: center;
  178. justify-content: center;
  179. margin-bottom: 32rpx;
  180. .operate-img {
  181. position: relative;
  182. image {
  183. width: 128rpx;
  184. height: 128rpx;
  185. }
  186. }
  187. .operate-text {
  188. color: #333;
  189. font-family: "PingFang SC";
  190. font-size: 32rpx;
  191. font-weight: 500;
  192. margin-top: 20rpx;
  193. }
  194. }
  195. }
  196. }
  197. .reason-box {
  198. width: 700rpx;
  199. background: url('https://qiuyu-shuzhi.oss-cn-beijing.aliyuncs.com/image/task-pop-bg.png') no-repeat;
  200. background-size: 100% 100%;
  201. padding: 0 60rpx 46rpx;
  202. box-sizing: border-box;
  203. .icon-img {
  204. width: 200rpx;
  205. height: 200rpx;
  206. border-radius: 50%;
  207. position: absolute;
  208. top: -100rpx;
  209. left: 50%;
  210. transform: translateX(-50%);
  211. }
  212. .reason-box-title {
  213. padding-top: 150rpx;
  214. color: #1D212A;
  215. font-family: "PingFang SC";
  216. font-size: 32rpx;
  217. font-weight: bold;
  218. text-align: center;
  219. }
  220. .btn-box {
  221. display: flex;
  222. align-items: center;
  223. justify-content: space-between;
  224. margin-top: 60rpx;
  225. .cancel-btn,
  226. .confirm-btn {
  227. width: 244rpx;
  228. height: 80rpx;
  229. border-radius: 16rpx;
  230. font-size: 32rpx;
  231. }
  232. .cancel-btn {
  233. border: 1px solid #BFC8DB;
  234. color: #86909C;
  235. }
  236. .confirm-btn {
  237. background: #0256FF;
  238. color: #FFF;
  239. font-weight: 500;
  240. }
  241. }
  242. }
  243. </style>