index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <template>
  2. <view class="container">
  3. <view class="doctor-info">
  4. <image :src="bg" class="bg"></image>
  5. <view class="user">
  6. <view class="info">
  7. <view class="name">{{user.userName}}</view>
  8. <view class="group">{{user.groupName}}</view>
  9. <view class="ocName">{{user.ocName||user.positionName}}</view>
  10. </view>
  11. <template v-if="user.type<4">
  12. <image class="avatar radius" src="/static/index/piont.png"></image>
  13. </template>
  14. <template v-else>
  15. <image :src="user.userAvatar" class="avatar" @error="avatarError" v-if="user.userAvatar"></image>
  16. <image :src="defAvatar" class="avatar" v-else></image>
  17. </template>
  18. </view>
  19. <view class="introduce" v-if="user.userIntro">{{user.userIntro}}</view>
  20. </view>
  21. <view class="app-container">
  22. <view class="app-title">常规操作</view>
  23. <view class="app-list">
  24. <view class="app-item" v-for="(item,index) in actionList" :key="index" @click="handle(item)">
  25. <image class="logo" :src="item.miniLogo" ></image>
  26. <view class="app-cont">
  27. <view class="name">{{item.miniTitle}}</view>
  28. <view class="desc" v-if="item.miniDesc">{{item.miniDesc}}</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import defAvatar from '@/static/avatar.png'
  37. import {getByQr,getApps} from '@/api/system/scan.js'
  38. import {getQueryParams} from '@/utils/index.js'
  39. import {setToken} from '@/utils/auth.js';
  40. export default {
  41. data() {
  42. return {
  43. actionList:[],
  44. defAvatar:defAvatar,
  45. bg:'',
  46. user:{
  47. userAvatar:""
  48. }
  49. }
  50. },
  51. onLoad(options){
  52. this.init(options)
  53. },
  54. methods: {
  55. async init(options){
  56. if(options && options.hasOwnProperty('q') ){
  57. let URL = decodeURIComponent(options.q);
  58. options=getQueryParams(URL)
  59. }
  60. if(options.token){
  61. setToken(options.token)
  62. }
  63. uni.getStorageSync('isLogin',true)
  64. this.getData(options)
  65. },
  66. getData({ocId, code}){
  67. if(!ocId){
  68. let qrcode=uni.getStorageSync('qrcode')
  69. if(!qrcode){return}
  70. ocId=qrcode.ocId
  71. code=qrcode.code
  72. }
  73. uni.setStorageSync('qrcode',{ocId,code})
  74. getByQr(ocId, code).then((res)=>{
  75. let type=res.data.targetType
  76. uni.setStorageSync('qrcode',{
  77. ...res.data.target,
  78. targetId:res.data.targetId,
  79. targetType:res.data.targetType,
  80. targetTitle:res.data.targetTitle,
  81. ocId,
  82. code
  83. })
  84. uni.setStorageSync('userId',res.data.target.accountId)
  85. let desc="";
  86. if(type===1){desc=res.data.target.riskPointDesc}
  87. if(type===2){
  88. desc=res.data.target.gridDesc
  89. res.data.target.positionName=res.data.target.gridCatTitle
  90. }
  91. if(type===3){
  92. desc=res.data.target.equipDesc;
  93. res.data.target.positionName=res.data.target.equipCatTitle
  94. }
  95. if(type===4){desc=res.data.target.doctorDesc}
  96. if(type===5){desc=res.data.target.doctorResume}
  97. this.user={
  98. type:res.data.targetType,
  99. userName:res.data.targetTitle,
  100. groupName:res.data.targetGroupName,
  101. userAvatar:res.data.target.doctorAvatar,
  102. positionName:res.data.target.positionName,
  103. userIntro:desc,
  104. }
  105. if(type>3){
  106. this.bg='/static/index/bg.png'
  107. }else{
  108. this.bg=type===1?'/static/index/riskBg.png':(type===2?'/static/index/areaBg.png':'/static/index/eqBg.png')
  109. }
  110. getApps(res.data.targetId).then((res)=>{
  111. this.actionList=res.data.miniList
  112. uni.setStorageSync('isAccount',res.data.isAccount)
  113. })
  114. })
  115. },
  116. avatarError(){
  117. this.user.userAvatar=defAvatar
  118. },
  119. handle(item){
  120. if(item.miniCode==='danger-submit'){ //隐患登记
  121. uni.navigateTo({url:'/pages/app_views/danger/submit/submit'})
  122. }
  123. if(item.miniCode==='checklist_point'){// 清单
  124. uni.navigateTo({url:'/pages/app_views/checkList/index/index?type=app&id='+item.checklistId})
  125. }
  126. if(item.miniCode==='checklist_score'){// 满意度
  127. uni.navigateTo({url:'/pages/app_views/satisfaction_evaluation/satisfaction_evaluation?type=app&id='+item.checklistId})
  128. }
  129. if(item.miniCode==='checklist_hazard'){// 危险源
  130. uni.navigateTo({url:'/pages/app_views/hazard/index/index?type=app&id='+item.checklistId})
  131. }
  132. if(item.miniCode==='app-snapshot'){ //问题反馈
  133. uni.navigateTo({url:'/pages/app_views/problem_feedback/problem_feedback'})
  134. }
  135. if(item.miniCode==='mini_check_in'){//打卡
  136. uni.navigateTo({url:'/pages/app_views/clockIn/index'})
  137. }
  138. },
  139. isNull(val){
  140. if(val===undefined||val==="undefined"||val===""||val===null){
  141. return true
  142. }
  143. return false
  144. }
  145. },
  146. onShareAppMessage() {
  147. }
  148. }
  149. </script>
  150. <style lang="scss" scoped>
  151. .container {
  152. min-height: 100vh;
  153. padding: 48rpx 36rpx;
  154. font-size: 14px;
  155. line-height: 24px;
  156. background-color:rgba(245,246,248,1);
  157. box-sizing: border-box;
  158. .doctor-info{
  159. background-image: url('~@/static/index/bg.png');
  160. background-repeat: no-repeat;
  161. background-size: 100% 100%;
  162. padding: 30rpx 48rpx 48rpx 48rpx;
  163. box-sizing: border-box;
  164. color: #fff;
  165. position: relative;
  166. .bg{
  167. display: block;
  168. width: 100%;
  169. height: 100%;
  170. position: absolute;
  171. left: 0;
  172. top: 0;
  173. z-index: -1;
  174. }
  175. .user{
  176. display: flex;
  177. justify-content: space-between;
  178. align-items: center;
  179. .info{
  180. position: relative;
  181. padding-left: 20rpx;
  182. .name{
  183. font-size: 32rpx;
  184. font-weight: 700;
  185. line-height: 1;
  186. }
  187. .group{
  188. font-size: 24rpx;
  189. font-weight: 400;
  190. line-height: 1;
  191. margin-top: 16rpx;
  192. }
  193. .ocName{
  194. font-size: 24rpx;
  195. font-weight: 400;
  196. line-height: 1;
  197. margin-top: 16rpx;
  198. }
  199. &::after{
  200. width: 1px;
  201. height: 100%;
  202. display: block;
  203. content: "";
  204. position: absolute;
  205. border-radius: 10px;
  206. top: 0;
  207. left: 0;
  208. background-color: #83D047;
  209. }
  210. }
  211. .avatar{
  212. display: block;
  213. width: 140rpx;
  214. height: 140rpx;
  215. border-radius: 50%;
  216. &.radius{
  217. border-radius:34rpx;
  218. }
  219. }
  220. }
  221. .introduce{
  222. padding-top: 30rpx;
  223. max-height: 318rpx;
  224. font-family: SF Pro Text;
  225. font-size: 30rpx;
  226. font-weight: 400;
  227. line-height: 44rpx;
  228. color: #fff;
  229. overflow: hidden;
  230. text-overflow: ellipsis;
  231. display: -webkit-box;
  232. -webkit-line-clamp: 7;
  233. -webkit-box-orient: vertical;
  234. text-align: justify;
  235. word-break: break-all;
  236. }
  237. }
  238. .app-container{
  239. .app-title{
  240. font-size: 34rpx;
  241. color: #000;
  242. line-height: 1;
  243. padding: 40rpx 0;
  244. font-weight: 600;
  245. }
  246. .app-list{
  247. display: flex;
  248. justify-content: space-between;
  249. flex-wrap: wrap;
  250. .app-item{
  251. display: flex;
  252. align-items: center;
  253. width: 330rpx;
  254. height: 160rpx;
  255. padding: 20rpx;
  256. box-sizing: border-box;
  257. border-left: 0;
  258. background-color: #fff;
  259. margin-bottom: 18rpx;
  260. border-radius: 20rpx;
  261. .logo{
  262. display: block;
  263. width: 66rpx;
  264. height: 66rpx;
  265. border: 1px solid #efe3e3;
  266. border-radius: 50%;
  267. overflow: hidden;
  268. }
  269. .app-cont{
  270. flex: 1;
  271. margin-left: 14rpx;
  272. .name{
  273. width: 100%;
  274. color: #222222;
  275. font-size: 32rpx;
  276. line-height: 1;
  277. margin-bottom: 20rpx;
  278. text-overflow: ellipsis;
  279. word-break: break-all;
  280. overflow: hidden;
  281. white-space: nowrap;
  282. }
  283. .desc{
  284. width: 203rpx;
  285. height: 48rpx;
  286. background: linear-gradient(128.57deg, rgba(253, 198, 48, 0.1), rgba(244, 125, 52, 0.1));
  287. color: #FFAB08;
  288. font-size: 24rpx;
  289. line-height: 48rpx;
  290. padding-left: 16rpx;
  291. box-sizing: border-box;
  292. }
  293. }
  294. }
  295. }
  296. }
  297. }
  298. </style>