index.vue 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588
  1. <template>
  2. <view class="border-box">
  3. <view class="content">
  4. <view class="top-box">
  5. <view class="back-box x-f">
  6. <image src="/static/image/device/back_icon32.png"></image>
  7. <view @click="goBack()">返回</view>
  8. </view>
  9. <view class="title">体质辨识</view>
  10. <view class="select" @click="onOpenList">
  11. <view class="date x-bc">
  12. <image src="/static/image/device/user_icon32.png"></image>
  13. <text class="text">
  14. {{selectUser!==null?selectUser.nickName:'选择用户'}}
  15. </text>
  16. <image src="/static/image/device/arrow_icon16.png"></image>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="list">
  21. <view class="tab-box">
  22. <view class="tabs">
  23. <view class="item active">
  24. <image src="/static/image/device/tongue_on_icon68.png"></image>
  25. <view class="title">舌面诊</view>
  26. </view>
  27. <view class="item" @click="navTo('/pages/device/pulse/index')">
  28. <image src="/static/image/device/pulse_diagnosis_icon68.png"></image>
  29. <view class="title">脉诊</view>
  30. </view>
  31. </view>
  32. <view class="test-box">
  33. <view class="note">请按照图片指识,点击上传相应的清晰照片为获取准确的结果</view>
  34. <view class="note1">请您在光线充足环境下测试,尽量拉近面部与屏幕距离</view>
  35. <view class="img-box" :class="{ 'flex-box': width < height }">
  36. <view class="left" @click="goCamera">
  37. <view class="bg"
  38. :style="{backgroundImage:leftImg==null?'url(/static/image/device/tongue_photo_img.png)':''}">
  39. <image v-if="leftImg==null" src="/static/image/device/add_icon68.png"></image>
  40. </view>
  41. <view v-if="leftImg!==null" class="delImg" @click.stop="delImg('left')">
  42. <image src="/static/image/device/close_icon33.png"></image>
  43. </view>
  44. <view v-if="leftImg!==null" class="upImg">
  45. <image :src='leftImg' mode="aspectFill"></image>
  46. </view>
  47. <view v-if="leftImg==null" class="btn">
  48. 添加舌面照
  49. </view>
  50. </view>
  51. <view class="right" @click="goCameraFace">
  52. <view class="bg"
  53. :style="{backgroundImage:rightImg==null?'url(/static/image/device/facial_photo_img.png)':''}">
  54. <image v-if="rightImg==null" src="/static/image/device/add_icon68.png"></image>
  55. </view>
  56. <view v-if="rightImg!==null" class="delImg" @click.stop="delImg('right')">
  57. <image src="/static/image/device/close_icon33.png"></image>
  58. </view>
  59. <view v-if="rightImg!==null" class="upImg">
  60. <image :src='rightImg' mode="aspectFill"></image>
  61. </view>
  62. <view v-if="rightImg==null" class="btn">
  63. 添加面部照
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. <view v-if="isResult" class="mask">
  71. <view class="popup-container2">
  72. <view class="title-t">上传成功</view>
  73. <view v-if="isIndex==0" class="title-r">请继续进行面诊检测</view>
  74. <view v-if="isIndex==1" class="title-r">请继续进行脉诊检测</view>
  75. <!-- <view class="title-r">{{isIndex==0?'舌诊':'面诊'}}结果请下载芳华未来APP查看</view> -->
  76. <view class="btn-r" @click="closeP">确认</view>
  77. </view>
  78. </view>
  79. <view v-if="showList" class="mask">
  80. <!-- 弹窗内容 -->
  81. <view class="popup-container">
  82. <!-- 弹窗头部 -->
  83. <view class="popup-header">
  84. <text class="popup-title">选择用户</text>
  85. <view class="close-btn" @click="onCloseList">
  86. <image src="/static/image/device/close_icon32.png"></image>
  87. </view>
  88. </view>
  89. <!-- 弹窗主体内容 -->
  90. <view class="popup-content">
  91. <view class="search-cont">
  92. <input type="text" v-model="keyword" class="form-input" placeholder="请输入用户姓名或者手机号"
  93. placeholder-class="text-input" />
  94. <view class="search-btn" @click="doSearch">
  95. <image src="/static/image/device/search_icon24.png"></image>
  96. <text>搜索</text>
  97. </view>
  98. </view>
  99. <view class="userList-box">
  100. <view class="userList" v-if="dataList.length>0">
  101. <view class="item" v-for="(item,index) in dataList" :key="index">
  102. <view class="title">{{item.nickName||''}}-{{item.phone||''}}</view>
  103. <view class="right-box">
  104. <view class="rest" @click="onOpenDetail(item)">
  105. 查看
  106. </view>
  107. <view class="rest" @click="editDetail(item)">
  108. 编辑
  109. </view>
  110. <view :class="item.userId==aIndex?'select active':'select'" @click="select(item)">
  111. 选择
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <view v-if="dataList.length==0" class="isNull">暂无数据</view>
  118. </view>
  119. <!-- 弹窗底部按钮 -->
  120. <view class="popup-footer">
  121. <view class="btn2 confirm-btn" @click="onOpen">
  122. <image src="/static/image/device/add_icon32.png"></image>
  123. <text>新建用户</text>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. <user-card :show="show" :initial-form="initData" @close="onClose" @confirm="onConfirm" @update="onEdit"></user-card>
  129. <view v-if="showDetail" class="mask">
  130. <!-- 弹窗内容 -->
  131. <view class="popup-container">
  132. <!-- 弹窗头部 -->
  133. <view class="popup-header">
  134. <view class="goback" @click="onOpenList">返回</view>
  135. <text class="popup-title">选择用户</text>
  136. <view class="close-btn" @click="onCloseDetail">
  137. <image src="/static/image/device/close_icon32.png"></image>
  138. </view>
  139. </view>
  140. <!-- 弹窗主体内容 -->
  141. <view class="popup-content">
  142. <view class="userDetail">
  143. <view class="item">
  144. <view class="label">姓名:</view>
  145. <text>{{detail.username||'-'}}</text>
  146. </view>
  147. <view class="item">
  148. <view class="label">手机号:</view>
  149. <text>{{detail.phone||'-'}}</text>
  150. </view>
  151. <view class="item">
  152. <view class="label">性别:</view>
  153. <text>{{detail.sex==1?"男":"女"}}</text>
  154. </view>
  155. <view class="item">
  156. <view class="label">年龄:</view>
  157. <text>{{detail.age||'-'}}岁</text>
  158. </view>
  159. <view class="item">
  160. <view class="label">身高:</view>
  161. <text>{{detail.height||'-'}}cm</text>
  162. </view>
  163. <view class="item">
  164. <view class="label">体重:</view>
  165. <text>{{detail.weight||'-'}}kg</text>
  166. </view>
  167. <view class="item" >
  168. <view class="label">既往病史:</view>
  169. <text>{{detail.previousMedicalHistory||'-'}}</text>
  170. </view>
  171. <view class="item" >
  172. <view class="label">过敏史:</view>
  173. <text>{{detail.historyOfAllergies||'-'}}</text>
  174. </view>
  175. <view v-if="detail.habitList.length>0" class="item" v-for="item in detail.habitList" :key="item.optionId">
  176. <view class="label">{{item.typeName ||'-'}}:</view>
  177. <text>{{item.optionName||'-'}}</text>
  178. </view>
  179. </view>
  180. </view>
  181. <!-- 弹窗底部按钮 -->
  182. <view class="popup-footer">
  183. <view class="btn2 confirm-btn" @click="selectBtn(detail)">
  184. <text>选择该用户</text>
  185. </view>
  186. </view>
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. </template>
  192. <script>
  193. import {
  194. selectUsernameOrPhoneOrTime,
  195. addUser,
  196. editUser,
  197. selectQueryFsUser
  198. } from '@/api/user.js'
  199. import {getCount,add,addFace} from '@/api/healthTongue.js'
  200. import {
  201. getDictByKey
  202. } from '@/api/common.js'
  203. import {
  204. el,
  205. tr
  206. } from "date-fns/locale";
  207. import userCard from "@/components/userCard.vue"
  208. export default {
  209. components: {
  210. userCard
  211. },
  212. data() {
  213. return {
  214. height: uni.getSystemInfoSync().screenHeight,
  215. width: uni.getSystemInfoSync().screenWidth,
  216. isIndex:0,
  217. isResult:false,
  218. msgType: 'success',
  219. selectedDate: "",
  220. selectUser: null,
  221. show: false,
  222. showList: false,
  223. showDetail: false,
  224. total: 0,
  225. aIndex: '',
  226. createTimes: null,
  227. keyword: '',
  228. type: 0,
  229. leftImg: null,
  230. rightImg: null,
  231. dataList: [],
  232. detail: {},
  233. agree: false,
  234. flag:true,
  235. errMsg:"",
  236. form: {
  237. sex: 1
  238. },
  239. initData:{}
  240. }
  241. },
  242. onLoad(options) {
  243. this.userId = options.userId
  244. this.selectUser=uni.getStorageSync('selectUser')||null;
  245. this.leftImg=null
  246. this.rightImg=null
  247. let left=options.leftUrl
  248. let right=options.rightUrl
  249. console.log('===',options.leftUrl,options.rightUrl)
  250. if(left){
  251. this.leftImg=left
  252. this.startDetection()
  253. }
  254. if(right){
  255. this.rightImg=right
  256. this.startDetectionFace()
  257. }
  258. },
  259. onShow(){
  260. //this.leftImg=null;
  261. //this.rightImg=null;
  262. },
  263. methods: {
  264. goBack() {
  265. uni.navigateBack({
  266. delta:1
  267. })
  268. },
  269. doSearch() {
  270. console.log(this.keyword, '---')
  271. // if(this.keyword!==''){
  272. this.selectUsernameOrPhoneOrTime()
  273. // }
  274. },
  275. select(item) {
  276. this.aIndex = item.userId
  277. this.selectUser = item
  278. uni.setStorageSync("selectUser",item)
  279. this.showList = false
  280. },
  281. selectBtn(item) {
  282. if(item.id==null){
  283. uni.showToast({
  284. title: '请先完善用户基本信息',
  285. icon: 'none'
  286. });
  287. return;
  288. }
  289. this.selectUser = this.dataList.find(it => it.userId === item.fsUserId);
  290. uni.setStorageSync("selectUser", this.selectUser)
  291. this.show = false
  292. this.showList = false
  293. this.showDetail = false
  294. },
  295. createTimesChange(e) {
  296. this.selectedDate = e.detail.value; // 例如:"2025-09-17"
  297. this.form.birthday = this.selectedDate.replace(/-/g, ""); // 去除 "-"
  298. },
  299. genderChange(type) {
  300. this.form.sex = type
  301. },
  302. onOpen() {
  303. this.show = true
  304. this.showList = false
  305. },
  306. onOpenList() {
  307. this.selectUsernameOrPhoneOrTime()
  308. this.showList = true
  309. this.showDetail = false
  310. },
  311. onOpenDetail(item) {
  312. this.showDetail = true
  313. this.showList = false
  314. this.detail={}
  315. this.selectQueryFsUser(item.userId)
  316. },
  317. editDetail(item){
  318. this.show = true
  319. this.showList = false
  320. this.selectQueryFsUser(item.userId,'edit')
  321. },
  322. // 关闭弹窗
  323. onClose() {
  324. this.show = false
  325. },
  326. onCloseList() {
  327. this.showList = false
  328. this.keyword=''
  329. },
  330. onCloseDetail() {
  331. this.showDetail = false
  332. },
  333. closeP(){
  334. this.isResult=false
  335. this.leftImg=null
  336. this.rightImg=null
  337. this.flag = true
  338. },
  339. // 点击确认按钮
  340. onConfirm(data) {
  341. // var data = form
  342. uni.showLoading({
  343. title:"处理中...",
  344. mask:true
  345. })
  346. addUser(data).then(res => {
  347. if (res.code == 200) {
  348. setTimeout(()=>{
  349. uni.showToast({
  350. icon: 'success',
  351. title: "创建成功",
  352. });
  353. },200)
  354. uni.hideLoading();
  355. this.show = false
  356. this.showList=true
  357. this.form = {
  358. sex: 0
  359. }
  360. this.selectUsernameOrPhoneOrTime()
  361. } else {
  362. uni.showToast({
  363. title: res.msg,
  364. icon: 'none'
  365. });
  366. }
  367. },
  368. rej => {}
  369. );
  370. },
  371. // 点击确认按钮
  372. onEdit(data) {
  373. // var data=this.form
  374. //var data = this.form
  375. uni.showLoading({
  376. title: "处理中...",
  377. mask: true
  378. })
  379. data.userId=this.initData.userId
  380. data.fsUserId=this.initData.userId
  381. editUser(data).then(res => {
  382. if (res.code == 200) {
  383. setTimeout(() => {
  384. uni.showToast({
  385. icon: 'success',
  386. title: "修改成功",
  387. });
  388. }, 200)
  389. uni.hideLoading();
  390. this.show = false
  391. this.showList = true
  392. this.form = {
  393. sex: 1
  394. }
  395. this.selectUsernameOrPhoneOrTime()
  396. } else {
  397. uni.showToast({
  398. title: res.msg,
  399. icon: 'none'
  400. });
  401. }
  402. },
  403. rej => {}
  404. );
  405. },
  406. selectUsernameOrPhoneOrTime() {
  407. var data = {
  408. nickName: this.keyword,
  409. phone: this.keyword
  410. }
  411. uni.showLoading({
  412. title:"加载中..."
  413. })
  414. // var user=uni.getStorageSync('userInfo');
  415. selectUsernameOrPhoneOrTime(data).then(res => {
  416. if (res.code == 200) {
  417. uni.hideLoading();
  418. this.dataList = res.data
  419. this.total = res.data.total || 0
  420. } else {
  421. uni.hideLoading();
  422. uni.showToast({
  423. title: res.msg,
  424. icon: 'none'
  425. });
  426. }
  427. },
  428. rej => {}
  429. );
  430. },
  431. selectQueryFsUser(id,val) {
  432. selectQueryFsUser({
  433. userId: id
  434. }).then(res => {
  435. if (res.code == 200) {
  436. this.detail = res.data
  437. if(val=='edit'){
  438. this.initData=res.data
  439. this.initData.userId=id
  440. }
  441. } else {
  442. uni.showToast({
  443. title: res.msg,
  444. icon: 'none'
  445. });
  446. }
  447. },
  448. rej => {}
  449. );
  450. },
  451. goCamera(){
  452. var that = this;
  453. if(this.$isEmpty(this.selectUser)){
  454. uni.showToast({
  455. title: '请先选择就诊人',
  456. icon: 'none'
  457. });
  458. return;
  459. }
  460. uni.navigateTo({
  461. url:"/pages/device/tongue/indexOld"
  462. });
  463. },
  464. goCameraFace(){
  465. var that = this;
  466. if(this.$isEmpty(this.selectUser)){
  467. uni.showToast({
  468. title: '请先选择就诊人',
  469. icon: 'none'
  470. });
  471. return;
  472. }
  473. uni.navigateTo({
  474. url:"/pages/device/tongue/facePhoto"
  475. })
  476. },
  477. // 选择上传的图片
  478. chooseImage(val) {
  479. // console.log('图片')
  480. var that = this;
  481. if(this.selectUser==null||this.selectUser==''){
  482. uni.showToast({
  483. icon:'none',
  484. title: "请选择就诊人",
  485. });
  486. return;
  487. }
  488. uni.showActionSheet({
  489. itemList: ['相册', '拍照'],
  490. success: function(res) {
  491. if (res.tapIndex == 0) {
  492. //从相册选择
  493. that.chooseImageFunction('album', val)
  494. } else if (res.tapIndex == 1) {
  495. //拍照
  496. that.chooseImageFunction('camera', val)
  497. // uni.navigateTo({
  498. // url:"/pages/device/tongue/indexOld"
  499. // });
  500. }
  501. },
  502. fail: function(res) {
  503. }
  504. });
  505. },
  506. chooseImageFunction: function(type, val) {
  507. var that = this;
  508. uni.chooseImage({
  509. count: 1, // 默认9
  510. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  511. sourceType: [type],
  512. success: (res) => {
  513. uni.showLoading({
  514. title: '图片上传中'
  515. })
  516. uni.uploadFile({
  517. url: uni.getStorageSync('requestPath') +
  518. '/app/common/uploadOSS', //仅为示例,非真实的接口地址
  519. filePath: res.tempFilePaths[0],
  520. name: 'file',
  521. formData: {
  522. 'user': 'test' // 上传附带参数
  523. },
  524. success: (uploadFileRes) => {
  525. uni.hideLoading();
  526. console.log('图片',uploadFileRes)
  527. // if (val == 1) {
  528. // // uni.setStorageSync("tongueUrl",res.tempFilePaths[0])
  529. // this.leftImg = res.tempFilePaths[0]
  530. // //JSON.parse(uploadFileRes.data).url
  531. // this.startDetection()
  532. // } else {
  533. this.rightImg = res.tempFilePaths[0]
  534. this.startDetectionFace()
  535. // }
  536. },
  537. fail: (err) => {
  538. uni.hideLoading();
  539. uni.showToast({
  540. title: '上传失败,请重试',
  541. icon: 'none'
  542. });
  543. console.error('上传失败:', err);
  544. }
  545. });
  546. }
  547. });
  548. },
  549. // 查看图片
  550. viewImage(e) {
  551. uni.previewImage({
  552. urls: this.imgList,
  553. current: e.currentTarget.dataset.url
  554. });
  555. },
  556. // 删除上传的图片
  557. delImg(e) {
  558. if (e == 'left') {
  559. this.leftImg = null
  560. } else if (e == 'right') {
  561. this.rightImg = null
  562. }
  563. // var that = this;
  564. // uni.showModal({
  565. // title: '提示',
  566. // content: '确定要删除照片吗?',
  567. // cancelText: '取消',
  568. // confirmText: '确定',
  569. // success: res => {
  570. // if (res.confirm) {
  571. // that.imgList.splice(e.currentTarget.dataset.index, 1)
  572. // this.photos.splice(e.currentTarget.dataset.index, 1);
  573. // }
  574. // },
  575. // })
  576. },
  577. //舌诊
  578. startDetection(){
  579. this.isIndex=0
  580. if(!this.flag){
  581. if(!this.$isEmpty(this.errMsg)){
  582. uni.showToast({icon:'none',title: this.errMsg});
  583. }
  584. return;
  585. }
  586. this.flag=false;
  587. uni.uploadFile({
  588. url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', //仅为示例,非真实的接口地址
  589. filePath: this.leftImg,
  590. name: 'file',
  591. formData: {
  592. 'user': 'test' // 上传附带参数
  593. },
  594. success: (uploadFileRes) => {
  595. console.log('---',uploadFileRes)
  596. // console.log('---',JSON.parse(uploadFileRes.data).url)
  597. var data={
  598. userId:this.selectUser.userId,
  599. patientId:this.selectUser.userId,
  600. sex:this.selectUser.sex,
  601. name:this.selectUser.nickName,
  602. tongueUrl:JSON.parse(uploadFileRes.data).url,
  603. }
  604. uni.showLoading({
  605. title:"处理中...",
  606. mask:true
  607. })
  608. add(data).then(res => {
  609. console.log('zaizz',data,res)
  610. if(res.code==200){
  611. uni.hideLoading();
  612. // uni.setStorageSync("tongueResult",JSON.stringify(res.data))
  613. this.isResult=true
  614. }else{
  615. uni.hideLoading();
  616. this.errMsg= res.msg;
  617. // this.leftImg=null;
  618. uni.showToast({
  619. icon:'none',
  620. title: res.msg,
  621. });
  622. }
  623. },
  624. rej => {}
  625. );
  626. },fail: (err) => {
  627. uni.showToast({
  628. title: '上传失败,请重试',
  629. icon: 'none'
  630. });
  631. uni.hideLoading();
  632. console.error('上传失败:', err);
  633. }
  634. });
  635. },
  636. //面诊
  637. startDetectionFace(){
  638. this.isIndex=1
  639. console.log('333')
  640. if(!this.flag){
  641. if(!this.$isEmpty(this.errMsg)){
  642. uni.showToast({icon:'none',title: this.errMsg});
  643. }
  644. return;
  645. }
  646. if(this.selectUser==null||this.selectUser==''){
  647. uni.showToast({
  648. icon:'none',
  649. title: "请选择就诊人",
  650. });
  651. return;
  652. }
  653. this.flag=false;
  654. uni.uploadFile({
  655. url: uni.getStorageSync('requestPath')+'/app/common/uploadOSS', //仅为示例,非真实的接口地址
  656. filePath: this.rightImg,
  657. name: 'file',
  658. formData: {
  659. 'user': 'test' // 上传附带参数
  660. },
  661. success: (uploadFileRes) => {
  662. console.log('---',uploadFileRes)
  663. // console.log('---',JSON.parse(uploadFileRes.data).url)
  664. var data={
  665. userId:this.selectUser.userId,
  666. sex:this.selectUser.sex,
  667. name:this.selectUser.nickName,
  668. surfaceUrl:JSON.parse(uploadFileRes.data).url,
  669. }
  670. uni.showLoading({
  671. title:"处理中...",
  672. mask:true
  673. })
  674. addFace(data).then(res => {
  675. console.log('zaiFC',data,res)
  676. if(res.code==200){
  677. uni.hideLoading();
  678. // uni.setStorageSync("tongueResult",JSON.stringify(res.data))
  679. this.isResult=true
  680. // uni.redirectTo({
  681. // url:"/pages/device/tongue/report?id="+res.data.id
  682. // });
  683. }else{
  684. uni.hideLoading();
  685. this.errMsg= res.msg;
  686. // this.rightImg=null;
  687. uni.showToast({
  688. icon:'none',
  689. title: res.msg,
  690. });
  691. }
  692. },
  693. rej => {}
  694. );
  695. },fail: (err) => {
  696. uni.hideLoading();
  697. uni.showToast({
  698. title: '上传失败,请重试',
  699. icon: 'none'
  700. });
  701. console.error('上传失败:', err);
  702. }
  703. });
  704. },
  705. getDictByKey(key) {
  706. var data = {
  707. key: key
  708. }
  709. getDictByKey(data).then(
  710. res => {
  711. if (res.code == 200) {
  712. if (key == "sys_hospital_level") {
  713. this.hosLevelOptions = res.data;
  714. }
  715. }
  716. },
  717. err => {}
  718. );
  719. },
  720. navTo(url) {
  721. uni.redirectTo({
  722. url: url + '?userId=' + this.userId
  723. })
  724. },
  725. }
  726. }
  727. </script>
  728. <style lang="scss" scoped>
  729. page {
  730. height: 100%;
  731. background: #f6f6f6;
  732. }
  733. </style>
  734. <style scoped lang="scss">
  735. .border-box {
  736. width: 100vw;
  737. height: 100vh;
  738. background-image: url(/static/image/device/ipad_yjf_boder.png);
  739. background-repeat: no-repeat;
  740. position: relative;
  741. background-size: 100% 100%;
  742. box-sizing: border-box;
  743. padding: 12px;
  744. }
  745. .content {
  746. // height: 100%;
  747. width: 100%;
  748. height: 100%;
  749. background-image: url(/static/image/device/inner_page_bg.png);
  750. background-repeat: no-repeat;
  751. background-size: 100% 100%;
  752. position: relative;
  753. padding: 30px;
  754. .top-box {
  755. width: 100%;
  756. display: flex;
  757. align-items: center;
  758. justify-content: space-between;
  759. margin-bottom: 30px;
  760. .title {
  761. font-family: Source Han Serif CN, Source Han Serif CN;
  762. font-weight: bold;
  763. font-size:30px;
  764. color: #8F6726;
  765. text-align: center;
  766. }
  767. .back-box {
  768. width: 102px;
  769. height: 47px;
  770. background: #FFFFFF;
  771. border-radius: 6px 6px 6px 6px;
  772. border: 1px solid #8F6726;
  773. // padding: 12px 8px;
  774. justify-content: center;
  775. view {
  776. font-family: PingFang SC, PingFang SC;
  777. font-weight: 400;
  778. font-size: 18px;
  779. color: #8F6726;
  780. text-align: center;
  781. margin-left: 10px;
  782. }
  783. // position: absolute;
  784. // left: 30px;
  785. image {
  786. width: 24px;
  787. height: 24px;
  788. }
  789. }
  790. .select {
  791. min-width: 160px;
  792. height: 47px;
  793. background: #FFFFFF;
  794. border-radius: 6px 6px 6px 6px;
  795. border: 1px solid #8F6726;
  796. padding: 12px;
  797. display: flex;
  798. align-items: center;
  799. justify-content: center;
  800. image {
  801. width: 24px;
  802. height: 24px;
  803. &:last-child {
  804. width: 12px;
  805. height:12px;
  806. }
  807. }
  808. .date {
  809. width: 100%;
  810. display: flex;
  811. align-items: center;
  812. justify-content: space-between;
  813. }
  814. .text {
  815. margin-left: 10px;
  816. margin-right: 10px;
  817. font-family: PingFang SC, PingFang SC;
  818. font-weight: 400;
  819. font-size: 18px;
  820. color: #8F6726;
  821. text-align: center;
  822. }
  823. }
  824. }
  825. .list {
  826. width: 100%;
  827. height: calc(100% - 76px);
  828. display: flex;
  829. align-items: center;
  830. justify-content: center;
  831. }
  832. .tab-box {
  833. width: 100%;
  834. height: 100%;
  835. // margin-top: 40px;
  836. display: flex;
  837. align-items: center;
  838. // justify-content: center;
  839. .tabs {
  840. display: flex;
  841. flex-direction: column;
  842. align-items: center;
  843. justify-content: flex-start;
  844. .item {
  845. // padding:40px;
  846. display: flex;
  847. flex-direction: column;
  848. align-items: center;
  849. justify-content: center;
  850. width: 113px;
  851. height: 163px;
  852. background: #FBF4EE;
  853. border-radius: 18px 0px 0px 18px;
  854. border: 2px solid rgba(143, 103, 38, 0.3);
  855. &:last-child {
  856. margin-top: 30px;
  857. }
  858. image {
  859. width: 50px;
  860. height: 50px;
  861. margin-bottom: 12px;
  862. }
  863. .title {
  864. font-family: PingFang SC, PingFang SC;
  865. font-weight: 600;
  866. font-size: 24px;
  867. color: #8F6726;
  868. text-align: center;
  869. }
  870. &.active {
  871. background: linear-gradient(180deg, #E3B379 0%, #8F6726 100%);
  872. border: 2px solid #8F6726;
  873. .title {
  874. color: #fff;
  875. }
  876. }
  877. }
  878. }
  879. }
  880. .test-box {
  881. flex: 1;
  882. height: 100%;
  883. // width: 1460px;
  884. // height: 862px;
  885. border-radius: 15px;
  886. display: flex;
  887. flex-direction: column;
  888. align-items: center;
  889. justify-content: center;
  890. padding: 80px 20px;
  891. background: #FFFFFF;
  892. border: 2px solid #8F6726;
  893. .note,.note1 {
  894. width: 100%;
  895. font-family: PingFang SC, PingFang SC;
  896. font-weight: 500;
  897. font-size: 18px;
  898. color: #8F6726;
  899. text-align: center;
  900. margin-bottom: 10px;
  901. }
  902. .note1 {
  903. margin-bottom: 40px;
  904. }
  905. .img-box {
  906. display: flex;
  907. align-items: center;
  908. justify-content: center;
  909. &.flex-box{
  910. flex-direction: column;
  911. .left{
  912. margin-right: 0;
  913. margin-bottom: 44rpx;
  914. }
  915. }
  916. }
  917. .left {
  918. width: 237px;
  919. height: 296px;
  920. background: #FBF4EE;
  921. border-radius: 16px;
  922. border: 1px solid #8F6726;
  923. // overflow: hidden;
  924. margin-right: 44px;
  925. position: relative;
  926. .delImg {
  927. top: -30px;
  928. right: -20px;
  929. position: absolute;
  930. z-index: 999;
  931. width: 40px;
  932. height: 40px;
  933. display: flex;
  934. align-items: center;
  935. justify-content: center;
  936. background: #8F6726;
  937. border-radius: 50%;
  938. image{
  939. width: 24px;
  940. height: 24px;
  941. transform: rotate(90deg);
  942. }
  943. }
  944. .upImg {
  945. top: 0;
  946. left: 0;
  947. position: absolute;
  948. z-index: 99;
  949. width: 100%;
  950. height: 100%;
  951. border-radius: 12px;
  952. overflow: hidden;
  953. image {
  954. width: 100%;
  955. height: 100%;
  956. }
  957. }
  958. .bg {
  959. width: 100%;
  960. height: 237px;
  961. border-radius: 12px 12px 0 0;
  962. // background-image: url(/static/image/device/tongue_photo_img.png);
  963. background-repeat: no-repeat;
  964. background-size: 100% 100%;
  965. display: flex;
  966. align-items: center;
  967. justify-content: center;
  968. image {
  969. width: 50px;
  970. height: 50px;
  971. }
  972. }
  973. .btn {
  974. width: 100%;
  975. line-height: 60px;
  976. font-family: PingFang SC, PingFang SC;
  977. font-weight: 500;
  978. font-size: 18px;
  979. color: #8F6726;
  980. text-align: center;
  981. }
  982. }
  983. .right {
  984. width: 237px;
  985. height: 296px;
  986. background: #FBF4EE;
  987. border-radius: 16px;
  988. // overflow: hidden;
  989. border: 1px solid #8F6726;
  990. position: relative;
  991. .delImg {
  992. top: -30px;
  993. right: -20px;
  994. position: absolute;
  995. z-index: 999;
  996. width: 40px;
  997. height: 40px;
  998. display: flex;
  999. align-items: center;
  1000. justify-content: center;
  1001. background: #8F6726;
  1002. border-radius: 50%;
  1003. image{
  1004. width: 24px;
  1005. height: 24px;
  1006. transform: rotate(90deg);
  1007. }
  1008. }
  1009. .upImg {
  1010. top: 0;
  1011. left: 0;
  1012. position: absolute;
  1013. z-index: 99;
  1014. width: 100%;
  1015. height: 100%;
  1016. overflow: hidden;
  1017. border-radius: 12px;
  1018. image {
  1019. width: 100%;
  1020. height: 100%;
  1021. }
  1022. }
  1023. .bg {
  1024. width: 100%;
  1025. height: 237px;
  1026. border-radius: 12px 12px 0 0;
  1027. // background-image: url(/static/image/device/facial_photo_img.png);
  1028. background-repeat: no-repeat;
  1029. background-size: 100% 100%;
  1030. display: flex;
  1031. align-items: center;
  1032. justify-content: center;
  1033. image {
  1034. width: 50px;
  1035. height: 50px;
  1036. }
  1037. }
  1038. .btn {
  1039. line-height: 60px;
  1040. font-family: PingFang SC, PingFang SC;
  1041. font-weight: 500;
  1042. font-size: 18px;
  1043. color: #8F6726;
  1044. text-align: center;
  1045. }
  1046. }
  1047. }
  1048. }
  1049. /* 遮罩层样式 */
  1050. .mask {
  1051. position: fixed;
  1052. top: 0;
  1053. left: 0;
  1054. right: 0;
  1055. bottom: 0;
  1056. background-color: rgba(0, 0, 0, 0.5);
  1057. display: flex;
  1058. justify-content: center;
  1059. align-items: center;
  1060. z-index: 999;
  1061. animation: fadeIn 0.3s ease;
  1062. }
  1063. /* 弹窗容器样式 */
  1064. .popup-container2 {
  1065. //width: 50%;
  1066. height: 250px;
  1067. background: #FBF4EE;
  1068. border-radius: 12px;
  1069. box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  1070. animation: scaleIn 0.3s ease;
  1071. overflow: hidden;
  1072. display: flex;
  1073. flex-direction: column;
  1074. align-items: center;
  1075. justify-content: space-between;
  1076. padding: 30px 50px;
  1077. .title-t {
  1078. font-size: 24px;
  1079. font-weight: bold;
  1080. color: #8F6726;
  1081. text-align: center;
  1082. }
  1083. .title-r {
  1084. font-size: 20px;
  1085. color: #8F6726;
  1086. text-align: center;
  1087. }
  1088. .btn-r {
  1089. text-align: center;
  1090. background: #8F6726;
  1091. font-size: 20px;
  1092. color: #FBF4EE;
  1093. border-radius: 12px;
  1094. width: 60%;
  1095. height: 50px;
  1096. line-height: 50px;
  1097. }
  1098. }
  1099. /* 弹窗容器样式 */
  1100. .popup-container {
  1101. width: 80%;
  1102. // min-width: 840px;
  1103. background: #FBF4EE;
  1104. border-radius: 12px;
  1105. box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  1106. animation: scaleIn 0.3s ease;
  1107. overflow: hidden;
  1108. }
  1109. /* 弹窗头部样式 */
  1110. .popup-header {
  1111. padding: 20px;
  1112. display: flex;
  1113. justify-content: space-between;
  1114. align-items: center;
  1115. background: #E9DDCD;
  1116. .goback {
  1117. background: #FFFFFF;
  1118. border-radius: 4px;
  1119. border: 1px solid #8F6726;
  1120. padding: 8px 16px;
  1121. font-size: 16px;
  1122. color: #8F6726;
  1123. text-align: center;
  1124. }
  1125. }
  1126. .popup-title {
  1127. flex: 1;
  1128. font-family: Source Han Serif CN, Source Han Serif CN;
  1129. font-weight: bold;
  1130. font-size: 24px;
  1131. color: #8F6726;
  1132. text-align: center;
  1133. }
  1134. .close-btn {
  1135. display: flex;
  1136. justify-content: center;
  1137. align-items: center;
  1138. transition: all 0.2s ease;
  1139. image {
  1140. width: 24px;
  1141. height: 24px;
  1142. }
  1143. }
  1144. /* 弹窗内容样式 */
  1145. .popup-content {
  1146. width: 90%;
  1147. padding: 40px 30px;
  1148. font-size: 20px;
  1149. color: #666;
  1150. line-height: 1.6;
  1151. background: #FBF4EE;
  1152. display: flex;
  1153. flex-direction: column;
  1154. align-items: center;
  1155. margin: auto;
  1156. .form-item {
  1157. display: flex;
  1158. align-items: center;
  1159. margin-bottom: 20px;
  1160. .label {
  1161. width: 100px;
  1162. font-family: PingFang SC, PingFang SC;
  1163. font-weight: 500;
  1164. font-size: 20px;
  1165. color: #8F6726;
  1166. text-align: right;
  1167. }
  1168. .form-input {
  1169. width: 400px;
  1170. height: 47px;
  1171. box-sizing: border-box;
  1172. background: #FFFFFF;
  1173. border-radius: 6px;
  1174. border: 1px solid #8F6726;
  1175. padding: 15px 26px;
  1176. }
  1177. .text-input {
  1178. font-family: PingFang SC, PingFang SC;
  1179. font-weight: 400;
  1180. font-size: 18px;
  1181. color: #9B9B9B;
  1182. text-align: left;
  1183. }
  1184. .r-box {
  1185. width: 400px;
  1186. height: 47px;
  1187. }
  1188. .picker-box {
  1189. // width: 540px;
  1190. // height: 64px;
  1191. // box-sizing: border-box;
  1192. // background: #FFFFFF;
  1193. // border-radius: 8px;
  1194. // border: 2px solid #8F6726;
  1195. // padding: 15px 26px;
  1196. .date {
  1197. image {
  1198. width: 32px;
  1199. height: 32px;
  1200. }
  1201. }
  1202. }
  1203. &:last-child{
  1204. margin-bottom: 0;
  1205. }
  1206. }
  1207. .form-item2 {
  1208. display: flex;
  1209. align-items: center;
  1210. margin-bottom: 20px;
  1211. .label {
  1212. width: 120px;
  1213. font-family: PingFang SC, PingFang SC;
  1214. font-weight: 500;
  1215. font-size: 20px;
  1216. color: #8F6726;
  1217. text-align: right;
  1218. }
  1219. .form-input {
  1220. width: 150px;
  1221. height: 47px;
  1222. box-sizing: border-box;
  1223. background: #FFFFFF;
  1224. border-radius: 6px;
  1225. border: 1px solid #8F6726;
  1226. padding: 15px 26px;
  1227. }
  1228. .text-input {
  1229. font-family: PingFang SC, PingFang SC;
  1230. font-weight: 400;
  1231. font-size: 18px;
  1232. color: #9B9B9B;
  1233. text-align: left;
  1234. }
  1235. .r-box {
  1236. width: 400px;
  1237. height: 47px;
  1238. }
  1239. .picker-box {
  1240. // width: 540px;
  1241. // height: 64px;
  1242. // box-sizing: border-box;
  1243. // background: #FFFFFF;
  1244. // border-radius: 8px;
  1245. // border: 2px solid #8F6726;
  1246. // padding: 15px 26px;
  1247. .date {
  1248. image {
  1249. width: 32px;
  1250. height: 32px;
  1251. }
  1252. }
  1253. }
  1254. }
  1255. }
  1256. .search-cont {
  1257. width: 100%;
  1258. display: flex;
  1259. align-items: center;
  1260. justify-content: space-between;
  1261. .form-input {
  1262. flex: 1;
  1263. height: 47px;
  1264. margin-right: 15px;
  1265. box-sizing: border-box;
  1266. background: #FFFFFF;
  1267. border-radius: 8px;
  1268. border: 1px solid #8F6726;
  1269. padding: 11px 20px;
  1270. }
  1271. .text-input {
  1272. font-family: PingFang SC, PingFang SC;
  1273. font-weight: 400;
  1274. font-size: 18px;
  1275. color: #9B9B9B;
  1276. text-align: left;
  1277. }
  1278. .search-btn {
  1279. width: 108px;
  1280. height: 47px;
  1281. background: #8F6726;
  1282. border-radius: 6px 6px 6px 6px;
  1283. display: flex;
  1284. align-items: center;
  1285. justify-content: center;
  1286. image {
  1287. width: 18px;
  1288. height: 18px;
  1289. margin-right: 5px;
  1290. }
  1291. text {
  1292. font-family: PingFang SC, PingFang SC;
  1293. font-weight: 400;
  1294. font-size: 18px;
  1295. color: #FFFFFF;
  1296. text-align: center;
  1297. }
  1298. }
  1299. }
  1300. .isNull {
  1301. text-align: center;
  1302. color: #8F6726;
  1303. }
  1304. .userList-box {
  1305. margin-top: 30px;
  1306. width: 100%;
  1307. background: #FFFFFF;
  1308. border-radius: 12px;
  1309. overflow: hidden;
  1310. }
  1311. .userList {
  1312. width: 100%;
  1313. height: 330px;
  1314. overflow-y: auto;
  1315. &::-webkit-scrollbar {
  1316. display: block !important;
  1317. width: 10px !important;
  1318. /* 滚动条宽度 */
  1319. }
  1320. &::-webkit-scrollbar-thumb {
  1321. background: #8F6726 !important;
  1322. /* 滚动条滑块颜色 */
  1323. border-radius: 5px !important;
  1324. /* 滑块圆角 */
  1325. }
  1326. .item {
  1327. width: 100%;
  1328. padding: 17px 22px;
  1329. display: flex;
  1330. align-items: center;
  1331. justify-content: space-between;
  1332. .title {
  1333. flex: 1;
  1334. font-family: PingFang SC, PingFang SC;
  1335. font-weight: 400;
  1336. font-size: 18px;
  1337. color: #8F6726;
  1338. text-align: left;
  1339. }
  1340. .right-box {
  1341. display: flex;
  1342. align-items: center;
  1343. justify-content: space-between;
  1344. .rest {
  1345. display: flex;
  1346. align-items: center;
  1347. justify-content: center;
  1348. width: 59px;
  1349. height: 33px;
  1350. border-radius: 6px 6px 6px 6px;
  1351. border: 1px solid #8F6726;
  1352. font-family: PingFang SC, PingFang SC;
  1353. font-weight: 400;
  1354. font-size: 16px;
  1355. color: #8F6726;
  1356. margin-right: 16px;
  1357. }
  1358. .select {
  1359. display: flex;
  1360. align-items: center;
  1361. justify-content: center;
  1362. width: 59px;
  1363. height: 33px;
  1364. border-radius: 6px 6px 6px 6px;
  1365. border: 1px solid #8F6726;
  1366. font-family: PingFang SC, PingFang SC;
  1367. font-weight: 400;
  1368. font-size: 16px;
  1369. color: #8F6726;
  1370. &.active {
  1371. background: #8F6726;
  1372. color: #fff;
  1373. }
  1374. }
  1375. }
  1376. }
  1377. }
  1378. .userDetail {
  1379. // margin-top: 30px;
  1380. width: 100%;
  1381. background: #FFFFFF;
  1382. border-radius: 12px;
  1383. padding: 0 30px;
  1384. height: 50vh;
  1385. overflow-y: auto;
  1386. &::-webkit-scrollbar {
  1387. display: block !important;
  1388. width: 10px !important;
  1389. /* 滚动条宽度 */
  1390. }
  1391. &::-webkit-scrollbar-thumb {
  1392. background: #8F6726 !important;
  1393. /* 滚动条滑块颜色 */
  1394. border-radius: 5px !important;
  1395. /* 滑块圆角 */
  1396. }
  1397. .item {
  1398. width: 100%;
  1399. padding: 15px 0px;
  1400. display: flex;
  1401. align-items: center;
  1402. justify-content: space-between;
  1403. font-family: PingFang SC, PingFang SC;
  1404. font-weight: 400;
  1405. font-size: 20px;
  1406. color: #8F6726;
  1407. border-bottom: 1px dashed #8F6726;
  1408. text{
  1409. flex:1
  1410. }
  1411. &:last-child {
  1412. border: 0;
  1413. }
  1414. }
  1415. }
  1416. /* 弹窗底部样式 */
  1417. .popup-footer {
  1418. display: flex;
  1419. align-items: center;
  1420. justify-content: center;
  1421. margin-bottom: 30px;
  1422. // background: #FBF4EE;
  1423. // border-top: 1px solid #eee;
  1424. }
  1425. .btn2 {
  1426. // flex: 1;
  1427. padding: 26px 0;
  1428. text-align: center;
  1429. font-size: 20px;
  1430. transition: all 0.2s ease;
  1431. }
  1432. .confirm-btn {
  1433. width: 185px;
  1434. height: 53px;
  1435. background: #8F6726;
  1436. border-radius: 12px 12px 12px 12px;
  1437. display: flex;
  1438. align-items: center;
  1439. justify-content: center;
  1440. text {
  1441. font-family: PingFang SC, PingFang SC;
  1442. font-weight: 400;
  1443. font-size: 20px;
  1444. color: #FFFFFF;
  1445. text-align: center;
  1446. }
  1447. image {
  1448. width: 24px;
  1449. height: 24px;
  1450. margin-right: 10px;
  1451. }
  1452. }
  1453. .confirm-btn2 {
  1454. width: 113px;
  1455. height: 53px;
  1456. background: #8F6726;
  1457. border-radius: 12px;
  1458. display: flex;
  1459. align-items: center;
  1460. justify-content: center;
  1461. text {
  1462. font-family: PingFang SC, PingFang SC;
  1463. font-weight: 400;
  1464. font-size: 20px;
  1465. color: #FFFFFF;
  1466. text-align: center;
  1467. }
  1468. }
  1469. /* 动画效果 */
  1470. @keyframes fadeIn {
  1471. from {
  1472. opacity: 0;
  1473. }
  1474. to {
  1475. opacity: 1;
  1476. }
  1477. }
  1478. @keyframes scaleIn {
  1479. from {
  1480. transform: scale(0.9);
  1481. opacity: 0;
  1482. }
  1483. to {
  1484. transform: scale(1);
  1485. opacity: 1;
  1486. }
  1487. }
  1488. </style>