index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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. console.log('params=======',params)
  132. downloadApkWithJsonPost(url, params)
  133. },
  134. meunClick() {
  135. if(!this.isLogin) {
  136. uni.$u.toast("请先登录!");
  137. setTimeout(()=>{
  138. uni.redirectTo({
  139. url:'/pages/login/login'
  140. })
  141. },1500)
  142. }else{
  143. this.meunShow = true
  144. }
  145. },
  146. operateClick(item) {
  147. uni.navigateTo({
  148. url:item.url
  149. })
  150. },
  151. noticeClick() {
  152. uni.navigateTo({
  153. url:'/pages/index/notice-page'
  154. })
  155. }
  156. }
  157. }
  158. </script>
  159. <style lang="scss" scoped>
  160. .btn-left {
  161. image {
  162. width: 48rpx;
  163. height: 48rpx;
  164. }
  165. }
  166. .btn-right {
  167. position: relative;
  168. image {
  169. width: 40rpx;
  170. height: 44rpx;
  171. }
  172. }
  173. .container_box {
  174. .container_main {
  175. .header-box {
  176. position: relative;
  177. height: 375rpx;
  178. .header-bg {
  179. width: 100%;
  180. height: 375rpx;
  181. }
  182. }
  183. .user-content-box {
  184. position: absolute;
  185. bottom: 32rpx;
  186. left: 32rpx;
  187. z-index: 99;
  188. .user-info-box{
  189. display: flex;
  190. image{
  191. width: 80rpx;
  192. height: 80rpx;
  193. margin-right: 20rpx;
  194. }
  195. .user-name{
  196. font-family: PingFang SC;
  197. font-weight: 500;
  198. font-size: 32rpx;
  199. color: #0F1828;
  200. }
  201. .user-phone{
  202. font-family: PingFang SC;
  203. font-weight: 400;
  204. font-size: 24rpx;
  205. color: #666666;
  206. }
  207. }
  208. .user-txt{
  209. margin-top: 20rpx;
  210. width: 350rpx;
  211. height: 44rpx;
  212. padding: 0 26rpx;
  213. border-radius: 64rpx;
  214. background: linear-gradient(90deg, #5CC4E8 0%, #0256FF 100%);
  215. font-family: PingFang SC;
  216. font-weight: 500;
  217. font-size: 24rpx;
  218. letter-spacing: 2;
  219. text-align-last: justify;
  220. line-height: 44rpx;
  221. color: #FFFFFF;
  222. }
  223. }
  224. }
  225. .container_cont {
  226. padding: 32rpx;
  227. display: flex;
  228. align-items: center;
  229. justify-content: space-between;
  230. flex-wrap: wrap;
  231. .operate-item {
  232. width: 326rpx;
  233. height: 262rpx;
  234. border-radius: 16rpx;
  235. background: #FFF;
  236. display: flex;
  237. flex-direction: column;
  238. align-items: center;
  239. justify-content: center;
  240. margin-bottom: 32rpx;
  241. .operate-img {
  242. position: relative;
  243. image {
  244. width: 128rpx;
  245. height: 128rpx;
  246. }
  247. }
  248. .operate-text {
  249. color: #333;
  250. font-family: "PingFang SC";
  251. font-size: 32rpx;
  252. font-weight: 500;
  253. margin-top: 20rpx;
  254. }
  255. }
  256. }
  257. }
  258. .reason-box {
  259. width: 700rpx;
  260. background: url('https://qiuyu-shuzhi.oss-cn-beijing.aliyuncs.com/image/task-pop-bg.png') no-repeat;
  261. background-size: 100% 100%;
  262. padding: 0 60rpx 46rpx;
  263. box-sizing: border-box;
  264. .icon-img {
  265. width: 200rpx;
  266. height: 200rpx;
  267. border-radius: 50%;
  268. position: absolute;
  269. top: -100rpx;
  270. left: 50%;
  271. transform: translateX(-50%);
  272. }
  273. .reason-box-title {
  274. padding-top: 150rpx;
  275. color: #1D212A;
  276. font-family: "PingFang SC";
  277. font-size: 32rpx;
  278. font-weight: bold;
  279. text-align: center;
  280. }
  281. .btn-box {
  282. display: flex;
  283. align-items: center;
  284. justify-content: space-between;
  285. margin-top: 60rpx;
  286. .cancel-btn,
  287. .confirm-btn {
  288. width: 244rpx;
  289. height: 80rpx;
  290. border-radius: 16rpx;
  291. font-size: 32rpx;
  292. }
  293. .cancel-btn {
  294. border: 1px solid #BFC8DB;
  295. color: #86909C;
  296. }
  297. .confirm-btn {
  298. background: #0256FF;
  299. color: #FFF;
  300. font-weight: 500;
  301. }
  302. }
  303. }
  304. </style>