人民医院前端

myTask.vue 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view>
  3. <view class="uni-margin-wrap">
  4. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
  5. :duration="duration">
  6. <swiper-item v-for="item in bannnerData" :key="item.id">
  7. <image :src="item.imgPath" mode=""></image>
  8. </swiper-item>
  9. </swiper>
  10. </view>
  11. <view class="orderManage">
  12. <view class="orderTit" style="padding-left: 15px;color: rgb(126, 131, 125);">
  13. <text style="width: 4px;background-color: rgb(26, 188, 156);height: 20px;margin-top: 10px;margin-right: 5px;"></text>
  14. <text style="font-size: 14px;">工单模块</text>
  15. </view>
  16. <view class="orderCon">
  17. <view class="orderList" v-for="item in orderListData" :key="item.id" @click="workOrderListClick(item)">
  18. <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
  19. <text>{{ item.text }}</text>
  20. </view>
  21. </view>
  22. <view class="orderTit" @click="changeStore" v-if="noticState">
  23. <image style="background: #ff9600" src="/static/icon_noticefi.png"></image>
  24. <text>公告通知</text>
  25. </view>
  26. <view class="notification">
  27. <view class="notifiList" v-for="item in noticListData" :key="item.id">
  28. <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
  29. <view class="">
  30. <text>{{ item.textTit }}</text>
  31. <text>{{ item.textCon }}</text>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import { mapGetters } from "vuex"
  40. import store from '@/store';
  41. import { getToken } from '@/utils/auth'
  42. export default {
  43. data() {
  44. return {
  45. indicatorDots: true,
  46. autoplay: true,
  47. interval: 2000,
  48. noticState: false,
  49. duration: 500,
  50. bannnerData: [],
  51. orderListData: [],
  52. noticListData: [],
  53. }
  54. },
  55. computed: {
  56. ...mapGetters(["State"]),
  57. },
  58. onLoad() {
  59. this.init()
  60. },
  61. methods: {
  62. init() {
  63. // #ifdef APP-PLUS
  64. let timer
  65. timer = setInterval(() => {
  66. plus.push.getClientInfoAsync((info) => {
  67. let cid = info["clientid"];
  68. if (cid) {
  69. clearInterval(timer)
  70. this.clienGet(cid) //获取cid
  71. }
  72. });
  73. }, 5000)
  74. // #endif
  75. if (!getToken()) {
  76. uni.reLaunch({
  77. url: '/pages/login/login'
  78. });
  79. } else {
  80. //banner数据
  81. this.bannnerData = this.$mConstDataConfig.bannnerData
  82. this.getMenuPermissions() //获取用户权限
  83. // 公告数据
  84. //this.noticListData = this.$mConstDataConfig.noticListData
  85. }
  86. },
  87. changeStore() {
  88. this.$mStore.dispatch("STATE", 3)
  89. },
  90. workOrderListClick(item) {
  91. uni.navigateTo({
  92. url: item.navigateToUrl,
  93. })
  94. },
  95. clienGet(cid) {
  96. let apptype
  97. if (plus.device.model.indexOf('iPhone') > -1) {
  98. apptype = 2;
  99. } else {
  100. apptype = 1;
  101. }
  102. const params = {
  103. apptype: apptype,
  104. clientid: cid,
  105. token: uni.getStorageSync("token"),
  106. }
  107. this.$http.get("PushMessage/PutAppClientIdAsync", params).then((response) => {
  108. if (response.state.toLowerCase() === "success") {
  109. let data = response.message
  110. }
  111. })
  112. .catch((e) => {
  113. console.log(e)
  114. })
  115. },
  116. getMenuPermissions() {
  117. let code = uni.getStorageSync("roleCode")
  118. this.$http.get("InternalMessages/GetCount").then((response) => {
  119. if (response.state.toLowerCase() === "success") {
  120. if(response.IsRead == 1) {
  121. uni.showTabBarRedDot({
  122. index: 2
  123. })
  124. }else{
  125. uni.hideTabBarRedDot({
  126. index: 2
  127. })
  128. }
  129. }
  130. })
  131. .catch((e) => {
  132. console.log(e)
  133. })
  134. /*
  135. GLY:管理员
  136. */
  137. if ( code === 'WXY') {
  138. this.orderListData = this.$mConstDataConfig.roleListData.UnitList
  139. }else if(code === "GLY") {
  140. this.orderListData = this.$mConstDataConfig.roleListData.administratorList
  141. }else if(code === "BXY" || code === 'CK_GLY') {
  142. this.orderListData = this.$mConstDataConfig.roleListData.applyRepairList
  143. }else if(code === "DDZX" ) {
  144. this.orderListData = this.$mConstDataConfig.roleListData.dispatchList
  145. }else if(code === "GQY" ) {
  146. this.orderListData = this.$mConstDataConfig.roleListData.AttendantList
  147. }else if(code === "SJ" ){
  148. this.orderListData = this.$mConstDataConfig.roleListData.driverList
  149. }else {
  150. this.orderListData = this.$mConstDataConfig.roleListData.applyRepairList
  151. }
  152. },
  153. },
  154. }
  155. </script>
  156. <style lang="scss">
  157. .uni-margin-wrap {
  158. width: 690rpx;
  159. width: 100%;
  160. }
  161. .swiper {
  162. height: 225px;
  163. image {
  164. width: 100%;
  165. height: 100%;
  166. }
  167. }
  168. .orderManage {
  169. .orderTit {
  170. margin-top: 15rpx;
  171. width: 100%;
  172. height: 80rpx;
  173. line-height: 80rpx;
  174. background: #ffffff;
  175. display: flex;
  176. border-bottom: 1rpx solid #eeeeee;
  177. text {
  178. font-size: 32rpx;
  179. }
  180. image {
  181. width: 24rpx;
  182. height: 24rpx;
  183. padding: 8rpx;
  184. border-radius: 12px;
  185. background: #1972c2;
  186. margin: 20rpx 10rpx 20rpx 26rpx;
  187. }
  188. }
  189. .orderCon {
  190. background: #ffffff;
  191. display: flex;
  192. flex-wrap: wrap;
  193. .orderList {
  194. width: 186rpx;
  195. height: 206rpx;
  196. text-align: center;
  197. border-right: 2rpx solid #eeeeee;
  198. border-bottom: 2rpx solid #eeeeee;
  199. image {
  200. width: 40rpx;
  201. height: 40rpx;
  202. margin: 0 auto;
  203. display: block;
  204. border-radius: 35rpx;
  205. padding: 15rpx;
  206. margin-top: 45rpx;
  207. }
  208. text {
  209. font-size: 24rpx;
  210. line-height: 60rpx;
  211. }
  212. }
  213. .orderList:nth-child(4n + 4) {
  214. border-right: none;
  215. }
  216. .orderList:last-child {
  217. border-right: none;
  218. }
  219. }
  220. .notification {
  221. background: #ffffff;
  222. margin-bottom: 100rpx;
  223. display: flex;
  224. flex-wrap: wrap;
  225. border-bottom: 1rpx solid #eeeeee;
  226. .notifiList {
  227. width: 375rpx;
  228. height: 172rpx;
  229. padding: 46rpx 30rpx 46rpx 30rpx;
  230. text-align: left;
  231. border-right: 1rpx solid #eeeeee;
  232. border-bottom: 1rpx solid #eeeeee;
  233. box-sizing: border-box;
  234. display: flex;
  235. image {
  236. width: 48rpx;
  237. height: 48rpx;
  238. box-sizing: border-box;
  239. border-radius: 24rpx;
  240. padding: 10rpx;
  241. margin: 19rpx;
  242. }
  243. text {
  244. font-size: 24rpx;
  245. line-height: 30rpx;
  246. }
  247. }
  248. .notifiList:nth-child(2n + 2) {
  249. border-right: none;
  250. }
  251. }
  252. }
  253. </style>