index.vue 5.8 KB

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