人民医院前端

myTask.vue 8.1KB

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