info_write.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. <template>
  2. <view class="main">
  3. <view class="cu-list menu-avatar">
  4. <view class="cu-item">
  5. <view class="cu-avatar round lg" :style="'background-image:url('+doctor.avatar+');'"></view>
  6. <view class="content">
  7. <view class="text-grey">{{doctor.name}}</view>
  8. <view class="text-gray text-sm flex">
  9. <text class="text-cut">
  10. 科室:{{doctor.office.name||'暂无'}} {{doctor.qualification.name||'暂无'}}
  11. </text>
  12. </view>
  13. </view>
  14. <view class="action">
  15. </view>
  16. </view>
  17. </view>
  18. <view class="cu-list menu">
  19. <view class="cu-item arrow" v-if="type==1||type==2||type==3" @click="openhuanzhe">
  20. <view class="content">
  21. <text class="text-grey">{{type==3?'预约患者':'咨询患者'}}</text>
  22. </view>
  23. <view class="action">
  24. <text class="text-grey text-sm">{{value}}</text>
  25. </view>
  26. </view>
  27. <view class="cu-item arrow" v-if="type==1" @click="openphone">
  28. <view class="content">
  29. <text class="text-grey">接听号码</text>
  30. </view>
  31. <view class="action">
  32. <text class="text-grey text-sm">{{phonenum}}</text>
  33. </view>
  34. </view>
  35. <view class="cu-item" v-if="type==1">
  36. <view class="content">
  37. <text class="text-grey">咨询时间</text>
  38. </view>
  39. <view class="action">
  40. <text class="text-grey text-sm">{{doctor.phone_minutes}}分钟</text>
  41. </view>
  42. </view>
  43. <view class="cu-item" v-if="type==1||type==2">
  44. <view class="content">
  45. <text class="text-grey">咨询费用</text>
  46. </view>
  47. <view class="action">
  48. <text class="text-red text-sm">¥{{type==1?doctor.phone_price/100:type==2?doctor.chat_price/100:doctor.appoint_price/100}}元</text>
  49. </view>
  50. </view>
  51. <view class="cu-item" v-if="type==3">
  52. <view class="content">
  53. <text class="text-grey">门诊医院</text>
  54. </view>
  55. <view class="action">
  56. <text class="text-grey text-sm">{{hospital}}</text>
  57. </view>
  58. </view>
  59. <view class="cu-item" v-if="type==3">
  60. <view class="content">
  61. <text class="text-grey">预约时间</text>
  62. </view>
  63. <view class="action">
  64. <text class="text-grey text-sm">{{time}}</text>
  65. </view>
  66. </view>
  67. <view class="cu-item" v-if="type==3">
  68. <view class="content">
  69. <text class="text-grey">身份证</text>
  70. </view>
  71. <view class="action">
  72. <input type="text" v-model="idcrad" style="text-align: right;" placeholder="请输入身份证号码" placeholder-style="text-align:right" />
  73. </view>
  74. </view>
  75. <view class="cu-item" v-if="type==2">
  76. <view class="content">
  77. <text class="text-grey">症状描述</text>
  78. </view>
  79. <view class="action">
  80. <text class="text-blue text-sm" @click="isdescribe = !isdescribe">如何描述?</text>
  81. </view>
  82. </view>
  83. <view class="text-gray text-sm" style="margin: 25rpx 37rpx;line-height: 38rpx;" v-show="isdescribe">
  84. 例:宝宝18个月,脸上长了密密麻麻的疹子,如图。大概有一个星期了,孩子也不挠。每天清洗,涂了一些炉甘石洗剂,未见效,请问医生这是怎么回事?
  85. </view>
  86. <textarea v-if="type==2" v-model="zhengzhuang" value="" class="textareasty" placeholder="请描述你的疾病或症状、是否用药、需要我提供什么样的帮助." />
  87. </view>
  88. <view class="" v-if="type==2">
  89. <view class="cu-bar bg-white margin-top">
  90. <view class="action text-lg text-black text-bold">
  91. 病情照片
  92. </view>
  93. <view class="action">
  94. {{imgList.length}}/4
  95. </view>
  96. </view>
  97. <view class="bg-white padding-sm text-gray">
  98. 请上传病例照片,若是皮肤或外伤问题,请建议对准患处拍摄清晰照片(照片仅自己和医生可见)
  99. </view>
  100. <view class="cu-form-group">
  101. <view class="grid col-4 grid-square flex-sub">
  102. <view class="bg-img" v-for="(item,index) in imgList" :key="index" :data-url="imgList[index]">
  103. <image :src='imgList[index]' mode='aspectFill'></image>
  104. <view class="cu-tag bg-red" @click="DelImg" :data-index="index">
  105. <text class="cuIcon-close"></text>
  106. </view>
  107. </view>
  108. <view class="solids" @click="ChooseImage" v-if="imgList.length<4">
  109. <text class="cuIcon-cameraadd"></text>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <view class="text-gray text-sm" style="margin: 25rpx 37rpx;line-height: 38rpx;" v-if="type == 1">
  115. <rich-text :nodes="phone_notice"></rich-text>
  116. </view>
  117. <view class="text-gray text-sm" style="margin: 25rpx 37rpx;line-height: 38rpx;" v-else-if="type == 2">
  118. <rich-text :nodes="chat_notice"></rich-text>
  119. </view>
  120. <view class="text-gray text-sm" style="margin: 25rpx 37rpx;line-height: 38rpx;" v-else>
  121. <rich-text :nodes="clinic_notice"></rich-text>
  122. </view>
  123. <view class="cu-bar bg-white tabbar" style="position: fixed;bottom: 0;width: 100%;">
  124. <view class="submit" style="background-color: #0B73B9;color: white;" @click="gotopay">
  125. 立即咨询
  126. </view>
  127. </view>
  128. <!-- 选择就诊人 -->
  129. <!-- model控制开关 mode控制显示方向-->
  130. <u-popup v-model="showpeople" mode="bottom" border-radius="14" length="50%">
  131. <view class="popup_title">
  132. <view class="popup_title_text">选择就诊人</view>
  133. </view>
  134. <scroll-view style="height: 70%;" scroll-y="true">
  135. <view class="popup_list" v-for="(item, index) in patientList" :key="index" :data-index="index" @click="xuanzehuanzhe(item)">
  136. <view class="popup_list_title">
  137. <view class="title">{{item.name}}</view>
  138. <view class="body">
  139. {{item.sex==1?'男':'女'}}
  140. </view>
  141. </view>
  142. <view class="popup_list_button flex align-center">
  143. <u-radio-group v-model="value">
  144. <u-radio @change="peopleRadioChange" :key="index" :name="item.name">
  145. </u-radio>
  146. </u-radio-group>
  147. </view>
  148. </view>
  149. </scroll-view>
  150. <u-gap height="10" bg-color="#f9f9f9"></u-gap>
  151. <view class="popup_button">
  152. <image style="width: 32rpx;height: 32rpx;margin-right: 15rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/addjiu.png"
  153. mode=""></image>
  154. <view class="" @click="addPeople">
  155. 添加就诊人档案
  156. </view>
  157. </view>
  158. </u-popup>
  159. <!-- 选择手机号 -->
  160. <u-popup v-model="showphone" mode="bottom" border-radius="14" length="50%">
  161. <view class="popup_title">
  162. <view class="popup_title_text">选择接听号码</view>
  163. </view>
  164. <scroll-view style="height: 70%;" scroll-y="true">
  165. <view class="phone" v-for="(item, index) in phoneList">
  166. <view class="list" @click="xuanzephone(item)">
  167. <view class="title">{{item.name}}</view>
  168. <view class="phone">{{item.num}}</view>
  169. <view class="button">
  170. <u-radio-group v-model="phoneValue">
  171. <u-radio @change="phoneRadioChange" :key="index" :name="item.name" :disabled="item.disabled">
  172. </u-radio>
  173. </u-radio-group>
  174. </view>
  175. </view>
  176. </view>
  177. <view style="padding: 0 50rpx;">
  178. <input class="padding-lr-sm" v-model="phonedata" style="border: 2rpx solid #efefef; height:90rpx;" v-if="phoneValue==showinput"
  179. type="number" placeholder="请输入手机号" />
  180. </view>
  181. </scroll-view>
  182. <u-gap height="10" bg-color="#f9f9f9"></u-gap>
  183. <view style="padding: 0 10%; height: 100rpx; ">
  184. <u-button type="primary" shape="circle" @click="confirmphone">确认</u-button>
  185. </view>
  186. </u-popup>
  187. <view class="cu-tabbar-height"></view>
  188. <view class="cu-tabbar-height"></view>
  189. <u-no-network></u-no-network>
  190. </view>
  191. </template>
  192. <script>
  193. import store from '@/store'
  194. export default {
  195. onLoad(options) {
  196. console.log(options)
  197. this.phoneList[0].num = uni.getStorageSync('phone')
  198. this.phonenum = this.phoneList[0].num
  199. this.doctor = JSON.parse(options.doctor)
  200. this.type = options.type
  201. this.time=options.time
  202. this.hospital = options.hospital
  203. this.jigouid = options.jigou
  204. this.year = options.year
  205. this.yearid = options.yearid
  206. if(options.type==1){
  207. this.price = this.doctor.phone_price
  208. }else if(options.type==2){
  209. this.price = this.doctor.chat_price
  210. }else{
  211. this.price = this.doctor.appoint_price
  212. }
  213. this.$util.getAgreement().then(res => {
  214. this.phone_notice = res.data.phone_notice
  215. this.chat_notice = res.data.chat_notice
  216. this.clinic_notice = res.data.clinic_notice
  217. }).catch(err => {
  218. })
  219. },
  220. onShow() {
  221. this.getarchives()
  222. },
  223. data() {
  224. return {
  225. /* 就诊人 */
  226. showpeople: false,
  227. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  228. value: '',
  229. /* 接听号码 */
  230. showphone: false,
  231. phoneList: [{
  232. name: '默认手机号',
  233. id: '0',
  234. num: '',
  235. disabled: false
  236. },
  237. {
  238. name: '其他手机号',
  239. id: '1',
  240. num: '',
  241. disabled: false
  242. }
  243. ],
  244. idcrad:"",//身份证
  245. zhengzhuang:"", //症状
  246. phoneValue: '',
  247. showinput: '其他手机号',
  248. phonenum: "",
  249. phonedata: "",
  250. patientList: [],
  251. doctor: {},
  252. imgList:[],
  253. type:"",//咨询状态
  254. time:"",
  255. huanzheID:"",
  256. price:"",
  257. hospital:"",
  258. jigouid:"",
  259. year:"",
  260. yearid:"",
  261. upimg:[],
  262. isdescribe:false,
  263. phone_notice:"",
  264. chat_notice:"",
  265. clinic_notice:""
  266. }
  267. },
  268. methods: {
  269. //点击咨询患者
  270. openhuanzhe() {
  271. this.showpeople = true
  272. },
  273. //点击联系号码
  274. openphone() {
  275. this.showphone = true
  276. },
  277. // 选中某个单选框时,由radio时触发
  278. peopleRadioChange(e) {
  279. console.log(e);
  280. },
  281. phoneRadioChange(e) {
  282. console.log(e);
  283. },
  284. xuanzephone(item){
  285. this.phoneValue=item.name
  286. this.phonenum = item.num
  287. },
  288. xuanzehuanzhe(item){
  289. this.huanzheID = item.id
  290. this.value=item.name
  291. this.showpeople=false
  292. },
  293. //添加就诊人
  294. addPeople(e) {
  295. uni.navigateTo({
  296. url:"../archives/add_archives"
  297. })
  298. },
  299. confirmphone() {
  300. if(this.phoneValue=="其他手机号"){
  301. this.phonenum = this.phonedata
  302. }else{
  303. this.phonedata = ""
  304. }
  305. this.showphone = !this.showphone
  306. },
  307. getarchives: async function() {
  308. let res = await this.$request.post("/api/v1/patient/patientList")
  309. if (res.status == 0) {
  310. this.patientList = res.data.data
  311. this.huanzheID = this.patientList[0].id
  312. this.value=this.patientList[0].name
  313. }
  314. },
  315. gotopay:async function() {
  316. if(this.type==1){
  317. if(this.value == ""){
  318. uni.showToast({
  319. title:"请选择患者",
  320. icon:"none"
  321. })
  322. return false
  323. }
  324. if(!this.$util.isPhoneNumber(this.phonenum)){
  325. uni.showToast({
  326. title:"请选择或填写手机号",
  327. icon:"none"
  328. })
  329. return false
  330. }
  331. let obj={
  332. doctorname:this.doctor.name,
  333. product_type:this.type,
  334. docter_id:this.doctor.id,
  335. patient_id:this.huanzheID,
  336. total_amount:this.price/100,
  337. phone:this.phonenum,
  338. phone_minutes:this.doctor.phone_minutes
  339. }
  340. if((this.price/100) == 0){
  341. let res = await this.$request.post("/api/v1/order/consultPlaceOrder", {
  342. product_type: obj.product_type,
  343. docter_id: obj.docter_id,
  344. patient_id: obj.patient_id,
  345. total_amount: obj.total_amount*100,
  346. phone: obj.phone,
  347. phone_minutes: obj.phone_minutes,
  348. payment_type:2
  349. })
  350. if (res.status == 0) {
  351. uni.showToast({
  352. title: "提交成功!",
  353. icon: "none",
  354. duration: 1000
  355. })
  356. setTimeout(() => {
  357. uni.redirectTo({
  358. url: "../order/order?type=" + obj.product_type
  359. })
  360. }, 1000)
  361. }
  362. }else{
  363. uni.redirectTo({
  364. url:"../order/payment?data="+JSON.stringify(obj)
  365. })
  366. }
  367. }else if(this.type==2){
  368. if(this.value == ""){
  369. uni.showToast({
  370. title:"请选择患者",
  371. icon:"none"
  372. })
  373. return false
  374. }
  375. if(this.zhengzhuang == ""){
  376. uni.showToast({
  377. title:"请填写症状",
  378. icon:"none"
  379. })
  380. return false
  381. }
  382. // if(this.imgList.length == 0){
  383. // uni.showToast({
  384. // title:"请上传病情照片",
  385. // icon:"none"
  386. // })
  387. // return false
  388. // }
  389. let obj={
  390. doctorname:this.doctor.name,
  391. product_type:this.type,
  392. docter_id:this.doctor.id,
  393. patient_id:this.huanzheID,
  394. total_amount:this.price/100,
  395. symptoms:this.zhengzhuang,
  396. medical_imgs:JSON.stringify(this.upimg),
  397. }
  398. if((this.price/100) == 0){
  399. let res = await this.$request.post("/api/v1/order/consultPlaceOrder", {
  400. product_type: obj.product_type,
  401. docter_id: obj.docter_id,
  402. patient_id: obj.patient_id,
  403. total_amount: obj.total_amount*100,
  404. symptoms: obj.symptoms,
  405. medical_imgs: obj.medical_imgs,
  406. payment_type:2
  407. })
  408. if (res.status == 0) {
  409. uni.showToast({
  410. title: "提交成功!",
  411. icon: "none",
  412. duration: 1000
  413. })
  414. setTimeout(() => {
  415. uni.redirectTo({
  416. url: "../order/order?type=" + obj.product_type
  417. })
  418. }, 1000)
  419. }
  420. }else{
  421. uni.redirectTo({
  422. url:"../order/payment?data="+JSON.stringify(obj)
  423. })
  424. }
  425. }else if(this.type==3){
  426. if(this.value == ""){
  427. uni.showToast({
  428. title:"请选择患者",
  429. icon:"none"
  430. })
  431. return false
  432. }
  433. if(this.idcrad == ""&&this.$util.isIdCard(this.idcrad)){
  434. uni.showToast({
  435. title:"请填写正确身份证号",
  436. icon:"none"
  437. })
  438. return false
  439. }
  440. let obj={
  441. doctorname:this.doctor.name,
  442. product_type:this.type,
  443. docter_id:this.doctor.id,
  444. patient_id:this.huanzheID,
  445. total_amount:this.price/100,
  446. organization_id:this.jigouid,
  447. schedule_date:this.year,
  448. time_period_id:this.yearid,
  449. }
  450. if((this.price/100) == 0){
  451. let res = await this.$request.post("/api/v1/order/appointPlaceOrder", {
  452. product_type: obj.product_type,
  453. docter_id: obj.docter_id,
  454. patient_id: obj.patient_id,
  455. total_amount: obj.total_amount *100,
  456. organization_id: obj.organization_id,
  457. schedule_date:obj.schedule_date,
  458. time_period_id: obj.time_period_id,
  459. payment_type:2
  460. })
  461. if (res.status == 0) {
  462. uni.showToast({
  463. title: "提交成功!",
  464. icon: "none",
  465. duration: 1000
  466. })
  467. setTimeout(() => {
  468. uni.redirectTo({
  469. url: "../order/order?type=" + obj.product_type
  470. })
  471. }, 1000)
  472. }
  473. }else{
  474. uni.redirectTo({
  475. url:"../order/payment?data="+JSON.stringify(obj)
  476. })
  477. }
  478. }
  479. },
  480. ChooseImage() {
  481. uni.chooseImage({
  482. count: 4, //默认9
  483. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  484. sourceType: ['album', 'camera'], //从相册选择
  485. success: (res) => {
  486. if (this.imgList.length != 0) {
  487. this.imgList = this.imgList.concat(res.tempFilePaths)
  488. this.imgList.forEach(item=>{
  489. this.$request.upload("/api/v1/common/uploadFile",item).then(re=>{
  490. this.upimg.push(JSON.parse(re).data.url)
  491. console.log(this.upimg)
  492. })
  493. })
  494. } else {
  495. this.imgList = res.tempFilePaths
  496. this.imgList.forEach(item=>{
  497. this.$request.upload("/api/v1/common/uploadFile",item).then(re=>{
  498. this.upimg.push(JSON.parse(re).data.url)
  499. })
  500. })
  501. }
  502. }
  503. });
  504. },
  505. DelImg(e) {
  506. uni.showModal({
  507. title: '提示',
  508. content: '确定要删除吗?',
  509. cancelText: '再想想',
  510. confirmText: '删除',
  511. success: res => {
  512. if (res.confirm) {
  513. this.imgList.splice(e.currentTarget.dataset.index, 1);
  514. this.imgList = this.imgList
  515. }
  516. }
  517. })
  518. }
  519. }
  520. };
  521. </script>
  522. <style scoped lang="scss">
  523. .main {}
  524. .popup_title {
  525. height: 15%;
  526. width: 100%;
  527. display: flex;
  528. justify-content: center;
  529. align-items: center;
  530. border-bottom: 1rpx solid #f9f9f9;
  531. }
  532. .textareasty{
  533. background-color: white;
  534. border: 1px solid #efefef;
  535. border-radius: 16rpx;
  536. padding: 15rpx;
  537. margin: 15rpx 15rpx;
  538. width: 100%;
  539. }
  540. .popup_title_text {
  541. width: auto;
  542. height: auto;
  543. font-size: 34rpx;
  544. font-weight: 540;
  545. }
  546. .popup_list {
  547. display: flex;
  548. height: 10vh;
  549. width: auto;
  550. border-bottom: 1rpx solid #f9f9f9;
  551. }
  552. .popup_list_title {
  553. height: 100%;
  554. width: 90%;
  555. display: inline-block;
  556. padding: 0 0 0 30rpx;
  557. .title {
  558. height: 50%;
  559. width: auto;
  560. font-size: 32rpx;
  561. font-weight: 500;
  562. padding: 20rpx 0 0 0;
  563. }
  564. .body {
  565. height: 50%;
  566. color: #a1a1a1;
  567. height: auto;
  568. width: auto;
  569. font-size: 30rpx;
  570. padding: 10rpx 0 0 0;
  571. }
  572. }
  573. .popup_button {
  574. height: 80rpx;
  575. width: 100%;
  576. display: flex;
  577. justify-content: center;
  578. align-items: center;
  579. view {
  580. color: #0b73ba;
  581. font-weight: 500;
  582. }
  583. }
  584. /**选择号码的样式和选择患者不同
  585. 需要更改样式*/
  586. .phone {
  587. height: 20%;
  588. width: 100%;
  589. .list {
  590. height: 100%;
  591. width: 100%;
  592. display: flex;
  593. padding: 0 10rpx 0 30rpx;
  594. .title {
  595. height: 100%;
  596. width: 65%;
  597. font-size: 32rpx;
  598. color: #7d7d7d;
  599. display: flex;
  600. align-items: center;
  601. }
  602. .phone {
  603. height: 100%;
  604. font-size: 32rpx;
  605. font-weight: 500;
  606. display: flex;
  607. justify-content: center;
  608. align-items: center;
  609. }
  610. .button {
  611. height: 100%;
  612. width: 5%;
  613. display: flex;
  614. justify-content: center;
  615. align-items: center;
  616. }
  617. }
  618. }
  619. </style>