人民医院前端

myTask.vue 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <view style="overflow: hidden;">
  3. <page-meta :root-font-size="getFontSizeValue"></page-meta>
  4. <view class="uni-margin-wrap">
  5. <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
  6. :duration="duration">
  7. <swiper-item v-for="item in bannnerData" :key="item.id">
  8. <image :src="item.imgPath" mode=""></image>
  9. </swiper-item>
  10. </swiper>
  11. </view>
  12. <view class="orderManage">
  13. <view class="orderTit" style="padding-left: 15px;color: rgb(126, 131, 125);">
  14. <text style="width: 4px;background-color: rgb(26, 188, 156);height: 20px;margin-top: 10px;margin-right: 5px;"></text>
  15. <text>工单模块</text>
  16. </view>
  17. <view class="orderCon">
  18. <view class="orderList" v-for="item in orderListData" :key="item.id" @click="workOrderListClick(item)">
  19. <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
  20. <text>{{ item.text }}</text>
  21. </view>
  22. </view>
  23. <view class="orderTit" @click="changeStore" v-if="noticState">
  24. <image style="background: #ff9600" src="/static/icon_noticefi.png"></image>
  25. <text>公告通知</text>
  26. </view>
  27. <view class="notification">
  28. <view class="notifiList" v-for="item in noticListData" :key="item.id">
  29. <image :style="{ background: item.imageBg }" :src="item.imagePath" mode=""></image>
  30. <view class="">
  31. <text>{{ item.textTit }}</text>
  32. <text>{{ item.textCon }}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import { mapGetters } from "vuex"
  41. import store from '@/store';
  42. import { getToken } from '@/utils/auth'
  43. import pageData from '../myTask/repairList/addRepair/pageData.js'
  44. export default {
  45. data() {
  46. return {
  47. indicatorDots: true,
  48. getFontSizeValue:'1rem',
  49. autoplay: true,
  50. interval: 2000,
  51. noticState: false,
  52. duration: 500,
  53. bannnerData: [],
  54. orderListData: [],
  55. noticListData: [],
  56. }
  57. },
  58. computed: {
  59. ...mapGetters(["State"]),
  60. },
  61. onLoad() {
  62. this.init()
  63. this.saveDept()
  64. this.getFontSizeValue = uni.getStorageSync('fontSizeValue')+'rem'
  65. // this.getFontSizeValue = '1.5rem'
  66. if(uni.getStorageSync("roleCode") === "APRY"){
  67. uni.hideTabBar()
  68. }
  69. // uni.hideTabBar()
  70. },
  71. methods: {
  72. init() {
  73. // #ifdef APP-PLUS
  74. let timer
  75. timer = setInterval(() => {
  76. plus.push.getClientInfoAsync((info) => {
  77. let cid = info["clientid"];
  78. if (cid) {
  79. clearInterval(timer)
  80. this.clienGet(cid) //获取cid
  81. }
  82. });
  83. }, 5000)
  84. this.upData()
  85. // #endif
  86. this.bannnerData = this.$mConstDataConfig.bannnerData
  87. this.getMenuPermissions() //获取用户权限
  88. // if (!getToken()) {
  89. // uni.reLaunch({
  90. // url: '/pages/login/login'
  91. // });
  92. // } else {
  93. // //banner数据
  94. // this.bannnerData = this.$mConstDataConfig.bannnerData
  95. // this.getMenuPermissions() //获取用户权限
  96. // // 公告数据
  97. // //this.noticListData = this.$mConstDataConfig.noticListData
  98. // }
  99. },
  100. saveDept(){
  101. pageData.getDet((res, data) => {
  102. window.localStorage.setItem('deptTreeData',JSON.stringify(res))
  103. window.localStorage.setItem('deptAllList',JSON.stringify(data))
  104. })
  105. },
  106. changeStore() {
  107. this.$mStore.dispatch("STATE", 3)
  108. },
  109. workOrderListClick(item) {
  110. uni.navigateTo({
  111. url: item.navigateToUrl,
  112. })
  113. },
  114. clienGet(cid) {
  115. let apptype
  116. if (plus.device.model.indexOf('iPhone') > -1) {
  117. apptype = 2;
  118. } else {
  119. apptype = 1;
  120. }
  121. const params = {
  122. apptype: apptype,
  123. clientid: cid,
  124. token: uni.getStorageSync("token"),
  125. }
  126. this.$http.get("PushMessage/PutAppClientIdAsync", params).then((response) => {
  127. if (response.state.toLowerCase() === "success") {
  128. let data = response.message
  129. }
  130. })
  131. .catch((e) => {
  132. console.log(e)
  133. })
  134. },
  135. upData(){
  136. plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
  137. uni.setStorageSync('versionCode',wgtinfo.version)
  138. });
  139. let typeUp = ''
  140. if (plus.device.model.indexOf('iPhone') > -1) {
  141. typeUp='ios';
  142. }else{
  143. typeUp='android';
  144. }
  145. const params = {
  146. versionName: typeUp,
  147. }
  148. this.$http.get('/ApplicationsRefresh/GetAllList', params).then((response) => {
  149. if (response.rows.length > 0) {
  150. let data = response.rows
  151. const nowVersionCode = uni.getStorageSync('versionCode')
  152. const serveVersionCode = data[0].F_VersionCode
  153. console.log(nowVersionCode + "---" +serveVersionCode)
  154. if (nowVersionCode !== serveVersionCode) {
  155. if(typeUp === 'android'){
  156. uni.showModal({
  157. title: '更新',
  158. content: '是否更新',
  159. success: function (res) {
  160. if (res.confirm) {
  161. plus.runtime.openURL(data[0].F_DownUrl);
  162. } else if (res.cancel) {
  163. this.$mHelper.toast("取消更新");
  164. }
  165. }
  166. });
  167. }else if(typeUp === 'ios'){
  168. plus.runtime.openURL('https://apps.apple.com/cn/app/%E9%83%91%E5%B7%9E%E4%BA%BA%E6%B0%91%E5%8C%BB%E9%99%A2%E7%BB%BC%E5%90%88%E6%9C%8D%E5%8A%A1%E4%BF%9D%E9%9A%9C%E8%B0%83%E5%BA%A6%E5%B9%B3%E5%8F%B0/id6444557705');
  169. }
  170. }
  171. }
  172. }).catch((e) => {
  173. console.log(e);
  174. })
  175. },
  176. getMenuPermissions() {
  177. let code = uni.getStorageSync("roleCode")
  178. this.$http.get("InternalMessages/GetCount").then((response) => {
  179. if (response.state.toLowerCase() === "success") {
  180. if(response.IsRead == 1) {
  181. uni.showTabBarRedDot({
  182. index: 2
  183. })
  184. }else{
  185. uni.hideTabBarRedDot({
  186. index: 2
  187. })
  188. }
  189. }
  190. })
  191. .catch((e) => {
  192. console.log(e)
  193. })
  194. /*
  195. GLY:管理员
  196. */
  197. if ( code === 'WXY' || code === 'WXBZZ') {
  198. this.orderListData = this.$mConstDataConfig.roleListData.UnitList
  199. }else if(code === "DDZX" ) {
  200. this.orderListData = this.$mConstDataConfig.roleListData.dispatchList
  201. }else if(code === "GQY" ) {
  202. this.orderListData = this.$mConstDataConfig.roleListData.AttendantList
  203. }else if(code === "SJ" ){
  204. this.orderListData = this.$mConstDataConfig.roleListData.driverList
  205. }else if(code === 'jcgn'){
  206. this.orderListData = this.$mConstDataConfig.roleListData.applyRepairList
  207. }else if(code === 'APRY'){
  208. this.orderListData = this.$mConstDataConfig.roleListData.driverList
  209. }else if( code === 'BMXG'){
  210. this.orderListData = this.$mConstDataConfig.roleListData.applyRepairList
  211. }else if( code === 'GLY'){
  212. this.orderListData = this.$mConstDataConfig.roleListData.applyRepairList
  213. }
  214. },
  215. },
  216. }
  217. </script>
  218. <style lang="scss">
  219. .uni-margin-wrap {
  220. width: 690rpx;
  221. width: 100%;
  222. }
  223. .swiper {
  224. height: 225px;
  225. image {
  226. width: 100%;
  227. height: 100%;
  228. }
  229. }
  230. .orderManage {
  231. .orderTit {
  232. margin-top: 15rpx;
  233. width: 100%;
  234. height: 80rpx;
  235. line-height: 80rpx;
  236. background: #ffffff;
  237. display: flex;
  238. border-bottom: 1rpx solid #eeeeee;
  239. text {
  240. font-size: 1rem;
  241. }
  242. image {
  243. width: 24rpx;
  244. height: 24rpx;
  245. padding: 8rpx;
  246. border-radius: 12px;
  247. background: #1972c2;
  248. margin: 20rpx 10rpx 20rpx 26rpx;
  249. }
  250. }
  251. .orderCon {
  252. background: #ffffff;
  253. display: flex;
  254. flex-wrap: wrap;
  255. .orderList {
  256. width: 186rpx;
  257. height: 206rpx;
  258. text-align: center;
  259. border-right: 2rpx solid #eeeeee;
  260. border-bottom: 2rpx solid #eeeeee;
  261. image {
  262. width: 40rpx;
  263. height: 40rpx;
  264. margin: 0 auto;
  265. display: block;
  266. border-radius: 35rpx;
  267. padding: 15rpx;
  268. margin-top: 45rpx;
  269. }
  270. text {
  271. line-height: 60rpx;
  272. }
  273. }
  274. .orderList:nth-child(4n + 4) {
  275. border-right: none;
  276. }
  277. .orderList:last-child {
  278. border-right: none;
  279. }
  280. }
  281. .notification {
  282. background: #ffffff;
  283. margin-bottom: 100rpx;
  284. display: flex;
  285. flex-wrap: wrap;
  286. border-bottom: 1rpx solid #eeeeee;
  287. .notifiList {
  288. width: 375rpx;
  289. height: 172rpx;
  290. padding: 46rpx 30rpx 46rpx 30rpx;
  291. text-align: left;
  292. border-right: 1rpx solid #eeeeee;
  293. border-bottom: 1rpx solid #eeeeee;
  294. box-sizing: border-box;
  295. display: flex;
  296. image {
  297. width: 48rpx;
  298. height: 48rpx;
  299. box-sizing: border-box;
  300. border-radius: 24rpx;
  301. padding: 10rpx;
  302. margin: 19rpx;
  303. }
  304. text {
  305. font-size: 24rpx;
  306. line-height: 30rpx;
  307. }
  308. }
  309. .notifiList:nth-child(2n + 2) {
  310. border-right: none;
  311. }
  312. }
  313. }
  314. </style>