index.vue 6.9 KB

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