index.vue 6.1 KB

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