人民医院前端

myTask.vue 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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. uni.setStorageSync('deptTreeData',JSON.stringify(res))
  103. uni.setStorageSync('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=1;
  142. }else{
  143. typeUp=0;
  144. }
  145. const params = {
  146. type:typeUp,
  147. isNew: true,
  148. }
  149. this.$http.get('/ApplicationsVersion/GetAndroid', params).then((response) => {
  150. if (response.state == "success") {
  151. let data = response.data
  152. console.log(data)
  153. //NewCode_ = data.data.F_VersionCode;
  154. const nowVersionCode = uni.getStorageSync('versionCode')
  155. const serveVersionCode = data.F_VersionCode
  156. console.log(nowVersionCode + "---" +serveVersionCode)
  157. if (nowVersionCode !== serveVersionCode) {
  158. if(typeUp === 0){
  159. uni.showModal({
  160. title: '更新',
  161. content: '是否更新',
  162. success: function (res) {
  163. if (res.confirm) {
  164. console.log(data.F_FileUrl)
  165. plus.runtime.openURL(data.FileUrl[0].F_FileUrl);
  166. } else if (res.cancel) {
  167. this.$mHelper.toast("取消更新");
  168. }
  169. }
  170. });
  171. }else if(typeUp === 1){
  172. uni.showModal({
  173. title: '更新',
  174. content: '是否更新',
  175. success: function (res) {
  176. if (res.confirm) {
  177. plus.runtime.openURL(data.F_Url);
  178. } else if (res.cancel) {
  179. this.$mHelper.toast("取消更新");
  180. }
  181. }
  182. });
  183. }
  184. }
  185. }
  186. }).catch((e) => {
  187. console.log(e);
  188. })
  189. },
  190. getMenuPermissions() {
  191. let code = uni.getStorageSync("roleCode")
  192. this.$http.get("InternalMessages/GetCount").then((response) => {
  193. if (response.state.toLowerCase() === "success") {
  194. if(response.IsRead == 1) {
  195. uni.showTabBarRedDot({
  196. index: 2
  197. })
  198. }else{
  199. uni.hideTabBarRedDot({
  200. index: 2
  201. })
  202. }
  203. }
  204. })
  205. .catch((e) => {
  206. console.log(e)
  207. })
  208. /*
  209. GLY:管理员
  210. */
  211. if ( code === 'WXY' || code === 'WXBZZ') {
  212. this.orderListData = this.$mConstDataConfig.roleListData.UnitList
  213. }else if(code === "DDZX" ) {
  214. this.orderListData = this.$mConstDataConfig.roleListData.dispatchList
  215. }else if(code === "GQY" ) {
  216. this.orderListData = this.$mConstDataConfig.roleListData.AttendantList
  217. }else if(code === "SJ" ){
  218. this.orderListData = this.$mConstDataConfig.roleListData.driverList
  219. }else if(code === 'jcgn'){
  220. this.orderListData = this.$mConstDataConfig.roleListData.applyRepairList
  221. }else if(code === 'APRY'){
  222. this.orderListData = this.$mConstDataConfig.roleListData.driverList
  223. }else if( code === 'BMXG'){
  224. this.orderListData = this.$mConstDataConfig.roleListData.applyRepairList
  225. }else if( code === 'GLY'){
  226. this.orderListData = this.$mConstDataConfig.roleListData.applyRepairList
  227. }
  228. },
  229. },
  230. }
  231. </script>
  232. <style lang="scss">
  233. .uni-margin-wrap {
  234. width: 690rpx;
  235. width: 100%;
  236. }
  237. .swiper {
  238. height: 225px;
  239. image {
  240. width: 100%;
  241. height: 100%;
  242. }
  243. }
  244. .orderManage {
  245. .orderTit {
  246. margin-top: 15rpx;
  247. width: 100%;
  248. height: 80rpx;
  249. line-height: 80rpx;
  250. background: #ffffff;
  251. display: flex;
  252. border-bottom: 1rpx solid #eeeeee;
  253. text {
  254. font-size: 1rem;
  255. }
  256. image {
  257. width: 24rpx;
  258. height: 24rpx;
  259. padding: 8rpx;
  260. border-radius: 12px;
  261. background: #1972c2;
  262. margin: 20rpx 10rpx 20rpx 26rpx;
  263. }
  264. }
  265. .orderCon {
  266. background: #ffffff;
  267. display: flex;
  268. flex-wrap: wrap;
  269. .orderList {
  270. width: 186rpx;
  271. height: 206rpx;
  272. text-align: center;
  273. border-right: 2rpx solid #eeeeee;
  274. border-bottom: 2rpx solid #eeeeee;
  275. image {
  276. width: 40rpx;
  277. height: 40rpx;
  278. margin: 0 auto;
  279. display: block;
  280. border-radius: 35rpx;
  281. padding: 15rpx;
  282. margin-top: 45rpx;
  283. }
  284. text {
  285. line-height: 60rpx;
  286. }
  287. }
  288. .orderList:nth-child(4n + 4) {
  289. border-right: none;
  290. }
  291. .orderList:last-child {
  292. border-right: none;
  293. }
  294. }
  295. .notification {
  296. background: #ffffff;
  297. margin-bottom: 100rpx;
  298. display: flex;
  299. flex-wrap: wrap;
  300. border-bottom: 1rpx solid #eeeeee;
  301. .notifiList {
  302. width: 375rpx;
  303. height: 172rpx;
  304. padding: 46rpx 30rpx 46rpx 30rpx;
  305. text-align: left;
  306. border-right: 1rpx solid #eeeeee;
  307. border-bottom: 1rpx solid #eeeeee;
  308. box-sizing: border-box;
  309. display: flex;
  310. image {
  311. width: 48rpx;
  312. height: 48rpx;
  313. box-sizing: border-box;
  314. border-radius: 24rpx;
  315. padding: 10rpx;
  316. margin: 19rpx;
  317. }
  318. text {
  319. font-size: 24rpx;
  320. line-height: 30rpx;
  321. }
  322. }
  323. .notifiList:nth-child(2n + 2) {
  324. border-right: none;
  325. }
  326. }
  327. }
  328. </style>