user.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="top-bg">
  5. <image src="../../static/img/userBg.png" mode=""></image>
  6. </view>
  7. <view class="userInfo">
  8. <view class="avatar">
  9. <image src="../../static/img/avatar.png" mode=""></image>
  10. </view>
  11. <view class="user">
  12. <view class="userbox">
  13. <view class="name">
  14. 海儿
  15. </view>
  16. <view class="post">
  17. 部门管理
  18. </view>
  19. </view>
  20. <view class="phone">
  21. 137****1523
  22. </view>
  23. </view>
  24. </view>
  25. <view class="tz">
  26. <view class="tzimage">
  27. <image src="../../static/img/tong.png" mode=""></image>
  28. </view>
  29. <u-notice-bar class="tz-main" :text="text1" direction="column" :icon="false" bgColor="#ffffff"
  30. color="#000000" fontSize="25rpx"></u-notice-bar>
  31. </view>
  32. </view>
  33. <view class="main">
  34. <view class="main-item" v-for="(item,index) in list" @click="navTo(item)">
  35. <view class="main-bg">
  36. <image :src="item.bg" mode=""></image>
  37. </view>
  38. <view class="main-info" v-if="item.num">
  39. <view class="main-info-bg">
  40. <image src="../../static/img/infoBg.png" mode=""></image>
  41. </view>
  42. <view class="main-info-name">
  43. {{item.num}}条未读
  44. </view>
  45. </view>
  46. <view class="main-icon">
  47. <image :src="item.icon" mode="heightFix"></image>
  48. </view>
  49. <view class="main-name">
  50. {{item.name}}
  51. </view>
  52. <view class="main-tip">
  53. {{item.tip}}
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import {
  61. mapState,
  62. mapMutations
  63. } from 'vuex';
  64. import {
  65. orderData,
  66. getUserInfo
  67. } from '@/api/user.js';
  68. export default {
  69. data() {
  70. return {
  71. text1: ['123456', '654321'],
  72. list: [{
  73. icon: '../../static/icon/u1.png',
  74. name: '领单',
  75. tip: '领取新订单',
  76. bg: '../../static/img/user-item1.png',
  77. src: '/pages/leader/porder'
  78. },
  79. {
  80. icon: '../../static/icon/u2.png',
  81. name: '待检验订单',
  82. tip: '检验 | 添加记录',
  83. bg: '../../static/img/user-item2.png',
  84. src: '/pages/order/Inspection'
  85. },
  86. {
  87. icon: '../../static/icon/u3.png',
  88. name: '外发检验订单',
  89. tip: '订单外发处理',
  90. bg: '../../static/img/user-item1.png',
  91. src: '/pages/foreign/foreignOrder'
  92. },
  93. {
  94. icon: '../../static/icon/u4.png',
  95. name: '我的订单',
  96. tip: '订单列表 | 提交记录',
  97. bg: '../../static/img/user-item2.png',
  98. src: '/pages/user/myorder'
  99. },
  100. {
  101. icon: '../../static/icon/u5.png',
  102. name: '工资记录',
  103. tip: '历月工资详情',
  104. bg: '../../static/img/user-item1.png',
  105. src: '/pages/salary/mySalary'
  106. },
  107. {
  108. icon: '../../static/icon/u6.png',
  109. name: '打卡记录',
  110. tip: '上班 | 迟到记录',
  111. bg: '../../static/img/user-item2.png',
  112. src: '/pages/user/dkdetail'
  113. },
  114. {
  115. icon: '../../static/icon/u7.png',
  116. name: '奖罚记录',
  117. tip: '奖励 | 处罚记录',
  118. bg: '../../static/img/user-item2.png',
  119. src: '/pages/user/sfjl'
  120. },
  121. {
  122. icon: '../../static/icon/u8.png',
  123. name: '订单监管',
  124. tip: '订单详情',
  125. bg: '../../static/img/user-item2.png',
  126. src: '/pages/leader/supervise'
  127. },
  128. {
  129. icon: '../../static/icon/u9.png',
  130. name: '待处理办件',
  131. tip: '处罚 | 报废返工处理',
  132. bg: '../../static/img/user-item1.png',
  133. num: 2,
  134. src: '/pages/leader/pending'
  135. },
  136. {
  137. icon: '../../static/icon/u10.png',
  138. name: '外发不合格处理',
  139. tip: '订单外发处理',
  140. bg: '../../static/img/user-item2.png',
  141. src: '/pages/foreign/forOrder',
  142. num: 2
  143. },
  144. {
  145. icon: '../../static/icon/u11.png',
  146. name: '处罚管理',
  147. tip: '奖励 | 处罚记录',
  148. bg: '../../static/img/user-item1.png',
  149. src: '/pages/leader/punish',
  150. num: 2
  151. },
  152. {
  153. icon: '../../static/icon/u12.png',
  154. name: '报废返工处理',
  155. tip: '提交报废返工的数量',
  156. bg: '../../static/img/user-item1.png',
  157. src: '/pages/scrap/scrap',
  158. num: 2
  159. },
  160. {
  161. icon: '../../static/icon/u13.png',
  162. name: '外发订单管理',
  163. tip: '提交检验 | 检验记录',
  164. bg: '../../static/img/user-item2.png',
  165. src: '/pages/foreign/administration'
  166. },
  167. {
  168. icon: '../../static/icon/u14.png',
  169. name: '外发不合格通知',
  170. tip: '外发不合格消息',
  171. bg: '../../static/img/user-item2.png',
  172. src: '/pages/inform/wp',
  173. num: 2
  174. },
  175. {
  176. icon: '../../static/icon/u15.png',
  177. name: '订单状态预警',
  178. tip: '订单到期时间预警',
  179. bg: '../../static/img/user-item1.png',
  180. src: '/pages/inform/dd',
  181. num: 2
  182. },
  183. {
  184. icon: '../../static/icon/u16.png',
  185. name: '材料未到通知',
  186. tip: '材料未到预警',
  187. bg: '../../static/img/user-item1.png',
  188. src: '/pages/inform/cl',
  189. num: 2
  190. },
  191. {
  192. icon: '../../static/icon/u17.png',
  193. name: '外发未到通知',
  194. tip: '外发时间到期预警',
  195. bg: '../../static/img/user-item2.png',
  196. src: '/pages/inform/wpwd',
  197. num: 2
  198. },
  199. {
  200. icon: '../../static/icon/u18.png',
  201. name: '订单外发',
  202. tip: '订单外发给合作公司',
  203. bg: '../../static/img/user-item2.png',
  204. src: '/pages/leader/outgoing',
  205. num: 2
  206. },
  207. {
  208. icon: '../../static/icon/u19.png',
  209. name: '订单抽检',
  210. tip: '订单抽取检验',
  211. bg: '../../static/img/user-item1.png',
  212. src: '/pages/leader/spot',
  213. },
  214. ]
  215. };
  216. },
  217. computed: {
  218. ...mapState('user', ['hasLogin']),
  219. },
  220. onShow() {
  221. // 判断是否已经登录
  222. // this.loadBaseData();
  223. },
  224. methods: {
  225. toJSON() {
  226. return this;
  227. },
  228. ...mapMutations('user', ['setUserInfo', 'setOrderInfo']),
  229. navTo(item) {
  230. if (item.src) {
  231. console.log(item.src);
  232. uni.navigateTo({
  233. url: item.src
  234. })
  235. }
  236. },
  237. // 加载初始数据
  238. loadBaseData() {
  239. getUserInfo({})
  240. .then(({
  241. data
  242. }) => {
  243. this.setUserInfo(data);
  244. // 获取用户数据完毕后在获取订单数据防止多次跳转到登录页
  245. orderData({})
  246. .then(({
  247. data
  248. }) => {
  249. this.setOrderInfo(data);
  250. })
  251. .catch(e => {
  252. this.setOrderInfo({
  253. complete_count: 0, //完成
  254. received_count: 0, //待收货
  255. unshipped_count: 0, //待发货
  256. order_count: 0, //订单总数
  257. unpaid_count: 0 //待付款
  258. });
  259. });
  260. })
  261. .catch(e => {
  262. console.log(e);
  263. });
  264. },
  265. /**
  266. * 统一跳转接口,拦截未登录路由
  267. * navigator标签现在默认没有转场动画,所以用view
  268. */
  269. }
  270. };
  271. </script>
  272. <style lang="scss">
  273. .content,
  274. page {
  275. height: auto;
  276. min-height: 100%;
  277. background: #ffffff;
  278. }
  279. .top {
  280. position: relative;
  281. image {
  282. width: 100%;
  283. height: 100%;
  284. }
  285. .top-bg {
  286. position: absolute;
  287. top: 0;
  288. left: 0;
  289. right: 0;
  290. width: 750rpx;
  291. height: 490rpx;
  292. }
  293. .userInfo {
  294. display: flex;
  295. align-items: center;
  296. padding: 126rpx 20rpx 0;
  297. .avatar {
  298. width: 126rpx;
  299. height: 126rpx;
  300. border-radius: 50%;
  301. image {
  302. border-radius: 50%;
  303. }
  304. }
  305. .user {
  306. position: relative;
  307. z-index: 2;
  308. padding-left: 10rpx;
  309. line-height: 1;
  310. .userbox {
  311. display: flex;
  312. .name {
  313. font-size: 36rpx;
  314. font-family: PingFang SC;
  315. font-weight: bold;
  316. color: #FFFFFF;
  317. }
  318. .post {
  319. margin-left: 10rpx;
  320. border: 1rpx solid #FFFFFF;
  321. border-radius: 10rpx;
  322. padding: 4rpx 8rpx;
  323. font-size: 24rpx;
  324. font-family: PingFang SC;
  325. font-weight: 500;
  326. color: #FFFFFF;
  327. }
  328. }
  329. .phone {
  330. margin-top: 20rpx;
  331. font-size: 24rpx;
  332. font-family: PingFang SC;
  333. font-weight: 500;
  334. color: #FFFFFF;
  335. }
  336. }
  337. }
  338. .tz {
  339. position: relative;
  340. z-index: 2;
  341. padding: 20rpx 30rpx 0;
  342. display: flex;
  343. align-items: center;
  344. .tzimage {
  345. width: 90rpx;
  346. height: 90rpx;
  347. image {
  348. border-radius: 50%;
  349. }
  350. }
  351. .tz-main {
  352. margin-left: -45rpx;
  353. padding-left: 55rpx;
  354. border-radius: 0px 29rpx 29rpx 0px;
  355. }
  356. }
  357. }
  358. .main {
  359. padding: 50rpx 10rpx;
  360. display: flex;
  361. flex-wrap: wrap;
  362. .main-item {
  363. padding: 26rpx 36rpx 34rpx;
  364. width: 46%;
  365. height: 220rpx;
  366. box-shadow: 0px 7rpx 20rpx 0px rgba(50, 50, 52, 0.09);
  367. border-radius: 15rpx;
  368. margin: 0 10rpx 30rpx;
  369. position: relative;
  370. line-height: 1;
  371. image {
  372. width: 100%;
  373. height: 100%;
  374. }
  375. .main-bg {
  376. position: absolute;
  377. top: 0;
  378. left: 0;
  379. right: 0;
  380. width: 100%;
  381. height: 220rpx;
  382. }
  383. .main-info {
  384. position: absolute;
  385. z-index: 3;
  386. right: 0;
  387. top: 0;
  388. width: 120rpx;
  389. height: 38rpx;
  390. display: flex;
  391. justify-content: center;
  392. align-items: center;
  393. .main-info-bg {
  394. position: absolute;
  395. left: 0;
  396. right: 0;
  397. top: 0;
  398. width: 120rpx;
  399. height: 38rpx;
  400. }
  401. .main-info-name {
  402. position: relative;
  403. z-index: 4;
  404. font-size: 22rpx;
  405. font-family: PingFang SC;
  406. font-weight: 500;
  407. color: #FFFFFF;
  408. }
  409. }
  410. .main-icon {
  411. position: relative;
  412. z-index: 2;
  413. height: 50rpx;
  414. }
  415. .main-name {
  416. position: relative;
  417. z-index: 2;
  418. margin-top: 26rpx;
  419. font-size: 36rpx;
  420. font-family: PingFang SC;
  421. font-weight: bold;
  422. color: #3F3F3F;
  423. }
  424. .main-tip {
  425. font-size: 24rpx;
  426. font-family: PingFang SC;
  427. font-weight: 500;
  428. color: #8C8C8C;
  429. position: relative;
  430. z-index: 2;
  431. margin-top: 14rpx;
  432. }
  433. }
  434. }
  435. </style>