人民医院前端

myTask.vue 8.7KB

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