人民医院前端

dingdingAdd.vue 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="wrap">
  3. <view></view>
  4. <view class="header">
  5. <view>
  6. <image @click="logShow" src="/static/login-icon.png"></image>
  7. </view>
  8. <view style="margin-top: 40px;">郑州人民医院综合服务保障调度平台</view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import { getCode } from '@/utils/dd'
  14. import { getToken } from '@/utils/auth'
  15. import { http } from '@/utils/request';
  16. //#ifdef H5
  17. import VConsole from 'vconsole'
  18. //#endif
  19. export default {
  20. data() {
  21. return {
  22. isAllow:"",
  23. type: -1,
  24. wid: '',
  25. sms_id: '',
  26. orderId: '',
  27. segmenter: 0,
  28. logoImage: '/static/login-icon.png',
  29. bannnerData: [],
  30. }
  31. },
  32. onLoad(optioin) {
  33. //#ifdef H5
  34. const deBug = localStorage.getItem('isDeBug');
  35. if(deBug === 'true'){
  36. const vConsole = new VConsole();
  37. }
  38. //#endif
  39. this.init(optioin)
  40. },
  41. methods: {
  42. init() {
  43. // 钉钉免登录
  44. getCode((type,code) => {
  45. console.log(type,code)
  46. if(type == 'H5' && code === 'fail' ){
  47. const userInfo = {code: code,loginway:"phoneDing"}
  48. uni.showLoading()
  49. http.post("Home/DingNewlogin", userInfo).then((response) => {
  50. // uni.setStorageSync('token', response.data)
  51. console.log(response.data)
  52. setToken(response.data)
  53. uni.setStorageSync('loginway','phoneDing')
  54. this.$mStore.dispatch("GetInfo").then((e)=>{
  55. uni.setStorageSync('roleCode', e.data.Role.F_RoleCode)
  56. uni.setStorageSync('userName', e.data.User.F_UserName)
  57. uni.setStorageSync('userId', e.data.User.F_UserId.toString())
  58. if(e.data.Dept){
  59. uni.setStorageSync('deptId', e.data.Dept.F_DeptId)
  60. uni.setStorageSync('deptName', e.data.Dept.F_DeptName)
  61. }
  62. uni.setStorageSync('userCode', e.data.User.F_UserCode)
  63. uni.setStorageSync('storageAllowUserDept', e.data.User.F_AllowDepartment)
  64. if(e.data.User.F_AllowDepartment.indexOf(",") >= 0){
  65. this.isAllow = "1"
  66. }else{
  67. this.isAllow = "0"
  68. }
  69. uni.setStorageSync('isAllow', this.isAllow)
  70. const code = uni.getStorageSync("roleCode");
  71. uni.reLaunch({
  72. url: '/pages/dingidngRepair/dingidngRepair?orderType='+ option.orderType
  73. });
  74. })
  75. })
  76. .catch((e) => {
  77. reject(e)
  78. })
  79. } else {
  80. uni.reLaunch({
  81. url: '/pages/noDing/noDing'
  82. });
  83. }
  84. })
  85. },
  86. logShow(){
  87. if(this.logShow.index){
  88. this.logShow.index += 1;
  89. }else{
  90. this.logShow.index = 1;
  91. }
  92. clearTimeout(this.logShow.timeOut)
  93. this.logShow.timeOut = setTimeout(()=>{
  94. this.logShow.index = 0;
  95. console.log(this.logShow.index)
  96. },1000)
  97. if(this.logShow.index >= 5){
  98. //#ifdef H5
  99. localStorage.setItem('isDeBug' , 'true');
  100. const vConsole = new VConsole();
  101. //#endif
  102. }
  103. }
  104. },
  105. }
  106. </script>
  107. <style lang="scss">
  108. .wrap{
  109. width: 100%;
  110. height: 100vh;
  111. // background-color: #fff;
  112. // background-image: url('/static/home.png');
  113. }
  114. .header{
  115. // position: absolute;
  116. // left: 36%;
  117. // top: 25%;
  118. text-align: center;
  119. padding-top: 150px;
  120. // color: #fff;
  121. font-family: cursive;
  122. font-size: 21px;
  123. }
  124. .header image{
  125. width:340rpx;
  126. height:340rpx;
  127. // margin-bottom: 40px;
  128. /* border-radius:50%; */
  129. }
  130. .title{
  131. width: 20px;
  132. position: absolute;
  133. top: 15%;
  134. left: 18%;
  135. font-family: cursive;
  136. font-size: 19px;
  137. }
  138. </style>