personInfo.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="content">
  3. <view class="info-item">
  4. <view class="label">姓名</view>
  5. <view class="right">
  6. {{user.doctorName||'-'}}
  7. </view>
  8. </view>
  9. <view class="info-item">
  10. <view class="label">账号身份</view>
  11. <view class="right">
  12. <template v-if="user.accountType">
  13. {{ user.accountType === '1' ? '医生' : user.accountType === '2' ? '药剂师' : '-' }}
  14. </template>
  15. <template v-else>-</template>
  16. </view>
  17. </view>
  18. <view class="info-item">
  19. <view class="label">是否认证</view>
  20. <view class="right">{{user.status==1?'是':'否'}}</view>
  21. </view>
  22. <view class="info-item">
  23. <view class="label">手机号</view>
  24. <view class="right" v-if="user.mobile!=null">{{user.mobile}}</view>
  25. </view>
  26. <view class="info-item">
  27. <view class="label">职称</view>
  28. <view class="right">{{ user.jobTitle || '-' }}</view>
  29. </view>
  30. <view class="info-item">
  31. <view class="label">科室</view>
  32. <view class="right">{{ user.department || '-' }}</view>
  33. </view>
  34. <view class="info-item">
  35. <view class="label">机构</view>
  36. <view class="right">{{ user.institution || '-' }}</view>
  37. </view>
  38. <view class="info-item">
  39. <view class="label">公司名称</view>
  40. <view class="right">{{ user.companyName || '-' }}</view>
  41. </view>
  42. <view class="info-item">
  43. <view class="label">开户银行</view>
  44. <view class="right">{{ user.bankName || '-' }}</view>
  45. </view>
  46. <view class="info-item">
  47. <view class="label">银行卡号</view>
  48. <view class="right">{{ user.idCard ? formatBankCard(user.idCard) : '-' }}</view>
  49. </view>
  50. <view class="info-item">
  51. <view class="label">执业证</view>
  52. <view class="right">
  53. <image class="w300 h150" :src="user.licenseImage" mode="aspectFill"></image>
  54. </view>
  55. </view>
  56. <view class="info-item">
  57. <view class="label">职称证/工牌</view>
  58. <view class="right">
  59. <image class="w300 h150" :src="user.titleCertImage" mode="aspectFill"></image>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import {getUserInfo,editUser} from '@/api/user'
  66. export default {
  67. data() {
  68. return {
  69. user: null
  70. }
  71. },
  72. onLoad() {
  73. this.getUserInfo()
  74. },
  75. methods: {
  76. formatBankCard(cardNo) {
  77. if (!cardNo || cardNo.length < 8) return cardNo;
  78. const prefix = cardNo.substring(0, 4);
  79. const suffix = cardNo.substring(cardNo.length - 4);
  80. return `${prefix}****${suffix}`;
  81. },
  82. bindblur(e) {
  83. this.user.nickname = e.detail.value; // 获取微信昵称
  84. },
  85. bindinput(e){
  86. this.user.nickname = e.detail.value; //这里要注意如果只用blur方法的话用户在输入玩昵称后直接点击保存按钮,会出现修改不成功的情况。
  87. },
  88. onChooseAvatar(e){
  89. let {
  90. avatarUrl
  91. } = e.detail;
  92. uni.uploadFile({
  93. url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', //仅为示例,非真实的接口地址
  94. filePath: avatarUrl,
  95. name: 'file',
  96. formData: {
  97. 'user': 'test' // 上传附带参数
  98. },
  99. success: (uploadFileRes) => {
  100. this.user.avatar =JSON.parse(uploadFileRes.data).url
  101. }
  102. });
  103. },
  104. getUserInfo(){
  105. getUserInfo().then(
  106. res => {
  107. if(res.code==200){
  108. this.user=res.data;
  109. }else{
  110. uni.showToast({
  111. icon:'none',
  112. title: "请求失败",
  113. });
  114. }
  115. },
  116. rej => {}
  117. );
  118. }
  119. }
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. .content{
  124. // padding-top: 20rpx;
  125. }
  126. .info-item{
  127. min-height: 104upx;
  128. background: #FFFFFF;
  129. padding: 0 30upx;
  130. display: flex;
  131. align-items: center;
  132. justify-content: space-between;
  133. border-bottom: 1px solid #F5F6FA;
  134. &:last-child{
  135. border-bottom: none;
  136. }
  137. .label{
  138. font-size: 30upx;
  139. font-family: PingFang SC;
  140. font-weight: 400;
  141. color: #0F1826;
  142. }
  143. .right{
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. position: relative;
  148. .wx-head{
  149. position: absolute;
  150. width: 80upx;
  151. height: 80upx;
  152. opacity: 0;
  153. }
  154. .text{
  155. font-size: 30upx;
  156. font-family: PingFang SC;
  157. font-weight: 400;
  158. color: #0F1826;
  159. }
  160. .head{
  161. border-radius: 50%;
  162. width: 80upx;
  163. height: 80upx;
  164. }
  165. .input{
  166. text-align: right;
  167. font-size: 30upx;
  168. font-family: PingFang SC;
  169. font-weight: 400;
  170. color: #0F1826;
  171. }
  172. image{
  173. padding: 20rpx 0;
  174. }
  175. }
  176. }
  177. .btn-box{
  178. margin-top: 20rpx;
  179. height: 120upx;
  180. padding: 0 30upx;
  181. display: flex;
  182. align-items: center;
  183. justify-content: center;
  184. .sub-btn{
  185. width: 100%;
  186. height: 88upx;
  187. line-height: 88upx;
  188. text-align: center;
  189. font-size: 30upx;
  190. font-family: PingFang SC;
  191. font-weight: bold;
  192. color: #FFFFFF;
  193. background: #0bb3f2;
  194. border-radius: 44upx;
  195. }
  196. }
  197. </style>