index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <view class="">
  3. <view class="header-wrap">
  4. <view class="header f-padding">
  5. <view class="header-item header-title">
  6. 欢迎登录
  7. <view class="message" @click="openPage('pages/center/message/message')">
  8. <u-icon name="bell"></u-icon>
  9. <u-badge type="error" class="badge" :count="newsTotal" :offset='[-10,-10]'></u-badge>
  10. </view>
  11. </view>
  12. <!-- <view class="header-item header-con">{{vuex_user.userName}} / {{vuex_user.userPost}}</view> -->
  13. <view class="u-rela u-m-t-30 u-m-b-24">
  14. <u-row justify="center">
  15. <u-col span="4" text-align="center" @click="openPage('pages/apply/apply','')">
  16. <u-icon size="90" name="../../static/img/apply.png"></u-icon>
  17. <view class="name">申请物资</view>
  18. </u-col>
  19. <u-col span="4" text-align="center" @click="openPage()">
  20. <u-icon size="90" name="../../static/img/signin.png"></u-icon>
  21. <view class="name">领取签到</view>
  22. </u-col>
  23. <u-col span="4" text-align="center" @click="openPage('pages/apply/applylist/applylist','0')">
  24. <u-icon size="90" name="../../static/img/query.png"></u-icon>
  25. <view class="name">申请记录</view>
  26. </u-col>
  27. </u-row>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="statistics">
  32. <!-- 设备状态 1-已离线 2-运行中 4-保养中 -->
  33. <u-row justify="center">
  34. <u-col span="4" text-align="center" @click="openPage('pages/equipmentList/equipmentList','')">
  35. <view class="count">{{deviceStatisData.totalCount||"-"}}</view>
  36. <view class="name">申请中</view>
  37. </u-col>
  38. <u-col span="4" text-align="center" @click="openPage('pages/equipmentList/equipmentList','1')">
  39. <view class="count">{{deviceStatisData.offlineCount||"-"}}</view>
  40. <view class="name">已驳回</view>
  41. </u-col>
  42. <u-col span="4" text-align="center" @click="openPage('pages/equipmentList/equipmentList','4')">
  43. <view class="count">{{deviceStatisData.repairCount||"-"}}</view>
  44. <view class="name">已领取</view>
  45. </u-col>
  46. </u-row>
  47. </view>
  48. <view class="block-wrap">
  49. <view class="title">其他</view>
  50. <view class="menu-list u-flex u-flex-wrap u-row-left">
  51. <view class="menu-item" @click="menuClick(item)" v-for="(item,index) in storeMenuList" :key="index">
  52. <u-icon :name="item.name" custom-prefix="custom-icon" size="60" color="#333"></u-icon>
  53. <view class="text">{{item.text}}</view>
  54. <u-badge v-if="item.badge" class="badge" :offset="[0,0]" :count="item.badge" type="success"></u-badge>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. export default {
  62. data() {
  63. return {
  64. newsTotal:'',
  65. noticeList:[],
  66. deviceStatisData:[],
  67. storeMenuList:[
  68. {name:'danweixinxi',text:'机构信息',url:'pages/center/organInfo/organInfo'},
  69. // {name:'essential-information',text:'个人信息',url:'pages/putout/putout'},
  70. {name:'xiugaimima',text:'修改密码',url:'pages/changepass/changepass'},
  71. ],
  72. }
  73. },
  74. onLoad() {
  75. },
  76. onShow() {
  77. // this.getUnreadTotal();
  78. // this.recordDeviceList();
  79. },
  80. methods: {
  81. openPage(path,param) {
  82. if(!path){
  83. uni.showToast({
  84. title:'暂未开放',
  85. icon:'none'
  86. })
  87. }
  88. this.$u.route({
  89. url: path,
  90. params:{
  91. param:param
  92. }
  93. })
  94. },
  95. deviceTypeList(){
  96. this.$u.api.getDeviceTypeList().then(res=>{
  97. if(res.code==200){
  98. this.deviceTypeListData = res.data;
  99. // console.log('getDeviceStatis',res);
  100. }else{
  101. uni.showToast({
  102. icon:'none',
  103. title:res.msg
  104. })
  105. }
  106. console.log('res',res);
  107. }).catch(err=>{
  108. console.log('err',err);
  109. })
  110. },
  111. getUnreadTotal(){
  112. let that = this;
  113. this.$u.api.unreadTotal().then(res=>{
  114. if(res.code==200){
  115. this.newsTotal = res.data.noReadCount;
  116. }else{
  117. uni.showToast({
  118. icon:'none',
  119. title:res.msg
  120. })
  121. }
  122. console.log('res',res);
  123. }).catch(err=>{
  124. console.log('err',err);
  125. })
  126. },
  127. noticeClick(e){
  128. console.log('e',e);
  129. // console.log('this.devicemsg[e]',this.devicemsg[e]);
  130. // 消息类型 1-维保通知 2-预警通知 3-确认通知
  131. // console.log('this.devicemsg',this.devicemsg);
  132. // console.log('this.devicemsg[e]',this.devicemsg[e]);
  133. // console.log('this.devicemsg[e].msgType',this.devicemsg[e].msgType);
  134. if(this.devicemsg[e].msgType=='1'){
  135. uni.switchTab({
  136. url: '/pages/maintenanceCenter/maintenanceCenter',
  137. fail(e) {
  138. console.log('',e);
  139. }
  140. })
  141. }else if(this.devicemsg[e].msgType=='2'){
  142. uni.switchTab({
  143. url: '/pages/warningCenter/warningCenter'
  144. })
  145. }else if(this.devicemsg[e].msgType=='3'){
  146. uni.navigateTo({
  147. url: '/pages/center/mywork/mywork'
  148. })
  149. }
  150. },
  151. menuClick(item){
  152. if(!item.url){
  153. this.$refs.uToast.show({
  154. title: '暂未开放',
  155. type: 'error',
  156. })
  157. };
  158. this.$u.route({
  159. url: item.url
  160. })
  161. }
  162. }
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. page{background-color: #F6F6F6;}
  167. .header-wrap{
  168. overflow: hidden;
  169. .header{
  170. position: relative;
  171. box-sizing: border-box;
  172. // height: 260rpx;
  173. padding: 48rpx 24rpx 98rpx;
  174. color: #fff;
  175. border-radius: 0 0 50% 50%;
  176. &::before{
  177. width: 140%; height: 100%; position: absolute; left: -20%; top: 0; content: ''; border-radius: 0 0 50% 50%; background: linear-gradient(180deg, #003bff 0%, #597aff 100%);
  178. }
  179. .header-title{
  180. font-size: 50rpx;
  181. font-weight: 400;
  182. color: #FFFFFF;
  183. line-height: 70rpx;
  184. letter-spacing: 2rpx;
  185. margin-bottom: 8vh;
  186. .message{
  187. position: relative;
  188. float: right;
  189. cursor: pointer;
  190. .badge{
  191. }
  192. }
  193. }
  194. .header-con{
  195. font-size: 28rpx;
  196. font-weight: 400;
  197. color: #FFFFFF;
  198. line-height: 40rpx;
  199. letter-spacing: 1rpx;
  200. }
  201. .header-item{
  202. position: relative;
  203. }
  204. }
  205. }
  206. .statistics{
  207. position: relative;
  208. margin: -80rpx 24rpx 24rpx;
  209. padding: 43rpx 30rpx 43rpx;
  210. border-radius: 10rpx;
  211. background-color: #fff;
  212. .count{
  213. font-size: 86rpx;
  214. font-weight: 400;
  215. color: var(--main-color);
  216. line-height: 100rpx;
  217. letter-spacing: 3rpx;
  218. }
  219. .name{
  220. font-size: 26rpx;
  221. font-weight: 400;
  222. color: #7D7D7D;
  223. line-height: 37rpx;
  224. letter-spacing: 1px;
  225. }
  226. }
  227. .notice{
  228. margin: 20rpx 0;
  229. padding: 0 30rpx;
  230. background-color: #fff;
  231. }
  232. .block-wrap{
  233. background: #fff;
  234. margin: 24rpx;
  235. border-radius: 12rpx;
  236. }
  237. .title{
  238. font-size: 30rpx;
  239. padding: 24rpx;
  240. font-weight: bold;
  241. }
  242. .menu-list{
  243. padding: 24rpx;
  244. text-align: center;
  245. .menu-item{
  246. gap: 20rpx;
  247. width: 33.33%;
  248. position: relative;
  249. margin-bottom: 34rpx;
  250. .text{
  251. margin-top: 10rpx;
  252. }
  253. }
  254. }
  255. </style>