index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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. <view class="user-content-box">
  15. <view class="user-info-box">
  16. <image src="@/static/image/home/avatar.png" mode=""></image>
  17. <view class="user-info-content">
  18. <view class="user-name">
  19. {{userInfo.username}}
  20. </view>
  21. <view class="user-phone">
  22. {{userInfo.phonenum}}
  23. </view>
  24. </view>
  25. </view>
  26. <view class="user-txt">
  27. 您的移动仓库管家
  28. </view>
  29. </view>
  30. <image src="@/static/image/home/home-top-img.png" class="header-bg" mode=""></image>
  31. </view>
  32. <view class="container_cont">
  33. <view class="operate-item" v-for="(item,i) in operateList" :key="i" @click="operateClick(item)">
  34. <view class="operate-img">
  35. <image :src="item.src" mode=""></image>
  36. <u-badge type="error" absolute max="99" :value="item.num" :offset="[-5,-5]"></u-badge>
  37. </view>
  38. <view class="operate-text">{{item.text}}</view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 菜单弹框 -->
  43. <use-pop :userInfo="userInfo" v-model="meunShow" @close="meunShow = false"></use-pop>
  44. <!-- 今日任务有未读 -->
  45. <u-popup :show="showUpdatePop" :closeOnClickOverlay="false" :safeAreaInsetBottom="false" mode="center" :round="16" @close="state.taskNumShow = false">
  46. <view class="reason-box">
  47. <image class="icon-img" src="https://qiuyu-shuzhi.oss-cn-beijing.aliyuncs.com/image/task-pop-img.png" mode=""></image>
  48. <view class="reason-box-title">象力WMS邀请你升级至新版本</view>
  49. <view class="btn-box">
  50. <button class="reset-button cancel-btn" @click="updateShow = false">稍后再说</button>
  51. <button class="reset-button confirm-btn" @click="toUpdate">下载更新</button>
  52. </view>
  53. </view>
  54. </u-popup>
  55. </view>
  56. </template>
  57. <script>
  58. import usePop from './components/use-pop.vue'
  59. import { downloadApkWithJsonPost } from '@/common/utils/app-update.js'
  60. // const Base64 = require('js-base64').Base64
  61. import {
  62. mapGetters
  63. } from 'vuex'
  64. export default {
  65. components:{
  66. usePop
  67. },
  68. data() {
  69. return {
  70. operateList:[
  71. {
  72. src:require('@/static/image/home/icon-jhrw.png'),
  73. text:'拣货任务',
  74. num:0,
  75. url:'/pages/picking-task/index'
  76. },
  77. {
  78. src:require('@/static/image/home/icon-cgrk.png'),
  79. text:'采购入库',
  80. num:0,
  81. url:'/pages/purchase/index'
  82. },
  83. {
  84. src:require('@/static/image/home/icon-chcx.png'),
  85. text:'存货查询',
  86. num:0,
  87. url:'/pages/inventory-inquiry/index'
  88. },
  89. {
  90. src:require('@/static/image/home/icon-pdrw.png'),
  91. text:'盘点任务',
  92. num:0,
  93. url:'/pages/inventory-task/index'
  94. }
  95. ],
  96. meunShow:false,
  97. noticeShow:true,
  98. updateShow:true
  99. }
  100. },
  101. onLoad() {
  102. // JSON.parse(Base64.decode(that.$Route.query.classData))
  103. },
  104. onShow() {
  105. // if(this.$store.state.update.update) {
  106. // console.log('需要更新')
  107. // this.updateShow = true
  108. // }
  109. if(!this.isLogin) {
  110. uni.$u.toast("请先登录!");
  111. setTimeout(()=>{
  112. uni.redirectTo({
  113. url:'/pages/login/login'
  114. })
  115. },1500)
  116. }
  117. },
  118. computed: {
  119. ...mapGetters(['isLogin','userInfo']),
  120. showUpdatePop(){
  121. return this.$store.state.update.update&&this.updateShow
  122. }
  123. },
  124. watch: {
  125. },
  126. methods: {
  127. toUpdate() {
  128. const params = this.$store.state.update.downloadApkParams
  129. const url = this.$BASE_URL + '/pda/downloadApk'
  130. console.log(url,'url')
  131. downloadApkWithJsonPost(url, params)
  132. },
  133. meunClick() {
  134. if(!this.isLogin) {
  135. uni.$u.toast("请先登录!");
  136. setTimeout(()=>{
  137. uni.redirectTo({
  138. url:'/pages/login/login'
  139. })
  140. },1500)
  141. }else{
  142. this.meunShow = true
  143. }
  144. },
  145. operateClick(item) {
  146. uni.navigateTo({
  147. url:item.url
  148. })
  149. },
  150. noticeClick() {
  151. uni.navigateTo({
  152. url:'/pages/index/notice-page'
  153. })
  154. }
  155. }
  156. }
  157. </script>
  158. <style lang="scss" scoped>
  159. .btn-left {
  160. image {
  161. width: 48rpx;
  162. height: 48rpx;
  163. }
  164. }
  165. .btn-right {
  166. position: relative;
  167. image {
  168. width: 40rpx;
  169. height: 44rpx;
  170. }
  171. }
  172. .container_box {
  173. .container_main {
  174. .header-box {
  175. position: relative;
  176. height: 375rpx;
  177. .header-bg {
  178. width: 100%;
  179. height: 375rpx;
  180. }
  181. }
  182. .user-content-box {
  183. position: absolute;
  184. bottom: 32rpx;
  185. left: 32rpx;
  186. z-index: 99;
  187. .user-info-box{
  188. display: flex;
  189. image{
  190. width: 80rpx;
  191. height: 80rpx;
  192. margin-right: 20rpx;
  193. }
  194. .user-name{
  195. font-family: PingFang SC;
  196. font-weight: 500;
  197. font-size: 32rpx;
  198. color: #0F1828;
  199. }
  200. .user-phone{
  201. font-family: PingFang SC;
  202. font-weight: 400;
  203. font-size: 24rpx;
  204. color: #666666;
  205. }
  206. }
  207. .user-txt{
  208. margin-top: 20rpx;
  209. width: 350rpx;
  210. height: 44rpx;
  211. padding: 0 26rpx;
  212. border-radius: 64rpx;
  213. background: linear-gradient(90deg, #5CC4E8 0%, #0256FF 100%);
  214. font-family: PingFang SC;
  215. font-weight: 500;
  216. font-size: 24rpx;
  217. letter-spacing: 2;
  218. text-align-last: justify;
  219. line-height: 44rpx;
  220. color: #FFFFFF;
  221. }
  222. }
  223. }
  224. .container_cont {
  225. padding: 32rpx;
  226. display: flex;
  227. align-items: center;
  228. justify-content: space-between;
  229. flex-wrap: wrap;
  230. .operate-item {
  231. width: 326rpx;
  232. height: 262rpx;
  233. border-radius: 16rpx;
  234. background: #FFF;
  235. display: flex;
  236. flex-direction: column;
  237. align-items: center;
  238. justify-content: center;
  239. margin-bottom: 32rpx;
  240. .operate-img {
  241. position: relative;
  242. image {
  243. width: 128rpx;
  244. height: 128rpx;
  245. }
  246. }
  247. .operate-text {
  248. color: #333;
  249. font-family: "PingFang SC";
  250. font-size: 32rpx;
  251. font-weight: 500;
  252. margin-top: 20rpx;
  253. }
  254. }
  255. }
  256. }
  257. .reason-box {
  258. width: 700rpx;
  259. background: url('https://qiuyu-shuzhi.oss-cn-beijing.aliyuncs.com/image/task-pop-bg.png') no-repeat;
  260. background-size: 100% 100%;
  261. padding: 0 60rpx 46rpx;
  262. box-sizing: border-box;
  263. .icon-img {
  264. width: 200rpx;
  265. height: 200rpx;
  266. border-radius: 50%;
  267. position: absolute;
  268. top: -100rpx;
  269. left: 50%;
  270. transform: translateX(-50%);
  271. }
  272. .reason-box-title {
  273. padding-top: 150rpx;
  274. color: #1D212A;
  275. font-family: "PingFang SC";
  276. font-size: 32rpx;
  277. font-weight: bold;
  278. text-align: center;
  279. }
  280. .btn-box {
  281. display: flex;
  282. align-items: center;
  283. justify-content: space-between;
  284. margin-top: 60rpx;
  285. .cancel-btn,
  286. .confirm-btn {
  287. width: 244rpx;
  288. height: 80rpx;
  289. border-radius: 16rpx;
  290. font-size: 32rpx;
  291. }
  292. .cancel-btn {
  293. border: 1px solid #BFC8DB;
  294. color: #86909C;
  295. }
  296. .confirm-btn {
  297. background: #0256FF;
  298. color: #FFF;
  299. font-weight: 500;
  300. }
  301. }
  302. }
  303. </style>