index.vue 5.8 KB

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