ConsultationDetails.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <view>
  3. <u-alert type="warning" :description='description'></u-alert>
  4. <view class="p20 column">
  5. <view class="bg-white p30 radius16">
  6. <view class="justify-between align-center">
  7. <view class="bold">咨询人<text class="color-price">*</text></view>
  8. <view class="justify-start align-center">
  9. <image src="/static/images/health/add_modify.png" class="w24 h24"></image>
  10. <view class="fs24 ml8">添加/修改</view>
  11. </view>
  12. </view>
  13. <scroll-view :scroll-x="true" class="peoplebox">
  14. <view class="scroll-content ">
  15. <view v-for="(item,index) in peoplelist" :key="index" @click="actpeople(item,index)"
  16. :class="actitem==index?'act-box':'noact-box'" class="item-list ">
  17. <image :src="item.sex=='男'?maleurl:famaleurl" class="w72 h72 radius36 "></image>
  18. <view class="ml12">
  19. <view class="fs26 bold">{{item.name}}</view>
  20. <view class="justify-start align-center color-text2 fs24">
  21. <text>{{item.sex}}</text>
  22. <text class="ml4">{{item.age}}岁</text>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </scroll-view>
  28. <view class="justify-start align-center center ptb20" v-if="peoplelist.length==0">
  29. <u-icon name="plus-circle"></u-icon>
  30. <text class="fs28 color-text1">用药人列表为空,请添加</text>
  31. </view>
  32. </view>
  33. <view class="bg-white p30 radius16 mt30">
  34. <view class="bold">您最想咨询的问题是什么<text class="color-price">*</text></view>
  35. <view class="textinput">
  36. <textarea auto-height maxlength='500' placeholder="请输入内容" :value='consulting' @input='lookvalue'/>
  37. </view>
  38. <view class="justify-between align-center">
  39. <image src="/static/images/health/voice_icon.png" class="w48 h48"></image>
  40. <text class="fs24 color-text1">{{consultingNum}}/500</text>
  41. </view>
  42. </view>
  43. <view class="bg-white p30 radius16 mt30">
  44. <view class="bold">此次病情是否去线下就诊过<text class="color-price">*</text></view>
  45. <view class="justify-start align-center mt20">
  46. <view v-for="(item,index) in seedoctor" :key="index" :class="actsee==index?'bg-color color-white':'bg-light'"
  47. @click="selectsee(item,index)" class="ptb20 plr30 mr20 radius12" >{{item.name}}</view>
  48. </view>
  49. </view>
  50. <view class="bg-white p30 radius16 mt30">
  51. <view class="bold">上传检测报告或患处照片<text class="color-price">*</text></view>
  52. <view class="justify-start align-center mt20" @click="showImg()">
  53. <view v-for="(item,index) in imagelist" :key="index" @click="actpeople"
  54. class="justify-start align-center ml20">
  55. <image :src="item" class="w120 h120 radius8 " mode="aspectFill" @click="showImg(item)"></image>
  56. </view>
  57. <view class="column align-center bg-light w120 h120 radius8 center" v-if="imagelist.length<=4">
  58. <u-icon name="plus" ></u-icon>
  59. <view class="fs24">上传报告</view>
  60. </view>
  61. </view>
  62. <view class="justify-between fs24 color-text1 mt20">
  63. <view>最多上传4张图片</view>
  64. <view><text>0</text>/4</view>
  65. </view>
  66. </view>
  67. <view class="h200"></view>
  68. </view>
  69. <view class="footer center">
  70. <view class="bg-color radius44 color-white h88 lh88 center" style="width: 90%;"
  71. @click="submit">生成方案</view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import {getuserlist,submitconsult} from '@/api/health.js'
  77. export default {
  78. data() {
  79. return {
  80. description:'为了您的健康,请认真填写以下内容,以便药师为您更好的分析,提供患有针对性的解决方案!',
  81. peoplelist:[
  82. {
  83. name:'任继峰',
  84. sex:'男',
  85. age:'55',
  86. id:0
  87. },
  88. {
  89. name:'任继峰',
  90. sex:'男',
  91. age:'55',
  92. id:1
  93. },
  94. {
  95. name:'朱丽君',
  96. sex:'女',
  97. age:'55',
  98. id:2
  99. },
  100. {
  101. name:'朱丽君',
  102. sex:'女',
  103. age:'55',
  104. id:3
  105. }
  106. ],
  107. famaleurl:"/static/images/health/female_profile.png",
  108. maleurl:"/static/images/health/male_profile.png",
  109. actitem:null,
  110. userid:null,
  111. consulting:null,
  112. consultingNum:0,
  113. seedoctor:[
  114. {
  115. name:'就诊过',
  116. value:0
  117. },
  118. {
  119. name:'未就诊',
  120. value:1
  121. }
  122. ],
  123. actsee:null,
  124. imagelist:[]
  125. }
  126. },
  127. methods: {
  128. submit(){
  129. if(this.userid==null){
  130. uni.showToast({
  131. icon:'none',
  132. title:'请选择咨询人!',
  133. });
  134. return
  135. }
  136. if(this.consulting==null){
  137. uni.showToast({
  138. icon:'none',
  139. title:'请输入咨询内容!',
  140. });
  141. return
  142. }
  143. if(this.actsee==null){
  144. uni.showToast({
  145. icon:'none',
  146. title:'请选择是否线下就诊过!',
  147. });
  148. return
  149. }
  150. if(this.actsee==0){
  151. if(this.imagelist.length==0){
  152. uni.showToast({
  153. icon:'none',
  154. title:'如果在线下就诊过,请上传检测报告!',
  155. });
  156. return
  157. }
  158. }
  159. const data={
  160. id:this.userid,
  161. doctor:this.actsee,
  162. imgurl:this.imagelist
  163. }
  164. submitconsult().then(res=>{
  165. if(res.code==200){
  166. uni.showToast({
  167. icon:'none',
  168. title:'提交成功',
  169. });
  170. }else{
  171. uni.showToast({
  172. icon:'none',
  173. title:res.msg,
  174. });
  175. }
  176. })
  177. },
  178. actpeople(item,index){
  179. this.actitem=index
  180. this.userid=item.id
  181. },
  182. lookvalue(e){
  183. this.consulting=e.detail.value
  184. this.consultingNum=e.detail.cursor
  185. if(this.consultingNum==500){
  186. uni.showToast({
  187. icon:'none',
  188. title:'最大输入500字符!',
  189. });
  190. }
  191. },
  192. selectsee(item,index){
  193. this.actsee=item.value
  194. },
  195. showImg(img) {
  196. if(img!=null){
  197. var imgs=[];
  198. imgs.push(img)
  199. //预览图片
  200. uni.previewImage({
  201. urls: imgs,
  202. current: imgs[0]
  203. });
  204. }
  205. else{
  206. //预览图片
  207. uni.previewImage({
  208. urls: this.imagelist,
  209. current: this.imagelist[0]
  210. });
  211. }
  212. },
  213. }
  214. }
  215. </script>
  216. <style scoped lang="scss">
  217. .peoplebox{
  218. white-space: nowrap;
  219. margin-top: 30rpx;
  220. ::-webkit-scrollbar {
  221. display: none;
  222. }
  223. .scroll-content{
  224. display: flex;
  225. flex-wrap: nowrap;
  226. }
  227. .item-list{
  228. padding: 20rpx 28rpx;
  229. width: fit-content;
  230. display: flex;
  231. justify-content: start;
  232. border-radius: 12rpx;
  233. margin-right: 20rpx;
  234. }
  235. .noact-box{
  236. background-color: #F5F7FA;
  237. }
  238. .act-box{
  239. background-color: #F0FAFF;
  240. border: 2rpx solid #008FD3;
  241. }
  242. }
  243. .textinput{
  244. margin-top: 30rpx;
  245. height:200rpx;
  246. overflow-y: scroll;
  247. }
  248. .footer{
  249. padding: 40rpx 0;
  250. width: 100%;
  251. position: fixed;
  252. bottom: 0;
  253. background-color: #fff;
  254. }
  255. </style>