info_write.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  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="cu-bar bg-white tabbar" style="position: fixed;bottom: 0;width: 100%;">
  115. <view class="submit" style="background-color: #0B73B9;color: white;" @click="gotopay">
  116. 立即咨询
  117. </view>
  118. </view>
  119. <!-- 选择就诊人 -->
  120. <!-- model控制开关 mode控制显示方向-->
  121. <u-popup v-model="showpeople" mode="bottom" border-radius="14" length="50%">
  122. <view class="popup_title">
  123. <view class="popup_title_text">选择就诊人</view>
  124. </view>
  125. <scroll-view style="height: 70%;" scroll-y="true">
  126. <view class="popup_list" v-for="(item, index) in patientList" :key="index" :data-index="index" @click="xuanzehuanzhe(item)">
  127. <view class="popup_list_title">
  128. <view class="title">{{item.name}}</view>
  129. <view class="body">
  130. {{item.sex==1?'男':'女'}}
  131. </view>
  132. </view>
  133. <view class="popup_list_button flex align-center">
  134. <u-radio-group v-model="value">
  135. <u-radio @change="peopleRadioChange" :key="index" :name="item.name">
  136. </u-radio>
  137. </u-radio-group>
  138. </view>
  139. </view>
  140. </scroll-view>
  141. <u-gap height="10" bg-color="#f9f9f9"></u-gap>
  142. <view class="popup_button">
  143. <image style="width: 32rpx;height: 32rpx;margin-right: 15rpx;" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/addjiu.png"
  144. mode=""></image>
  145. <view class="" @click="addPeople">
  146. 添加就诊人档案
  147. </view>
  148. </view>
  149. </u-popup>
  150. <!-- 选择手机号 -->
  151. <u-popup v-model="showphone" mode="bottom" border-radius="14" length="50%">
  152. <view class="popup_title">
  153. <view class="popup_title_text">选择接听号码</view>
  154. </view>
  155. <scroll-view style="height: 70%;" scroll-y="true">
  156. <view class="phone" v-for="(item, index) in phoneList">
  157. <view class="list" @click="xuanzephone(item)">
  158. <view class="title">{{item.name}}</view>
  159. <view class="phone">{{item.num}}</view>
  160. <view class="button">
  161. <u-radio-group v-model="phoneValue">
  162. <u-radio @change="phoneRadioChange" :key="index" :name="item.name" :disabled="item.disabled">
  163. </u-radio>
  164. </u-radio-group>
  165. </view>
  166. </view>
  167. </view>
  168. <view style="padding: 0 50rpx;">
  169. <input class="padding-lr-sm" v-model="phonedata" style="border: 2rpx solid #efefef; height:90rpx;" v-if="phoneValue==showinput"
  170. type="number" placeholder="请输入手机号" />
  171. </view>
  172. </scroll-view>
  173. <u-gap height="10" bg-color="#f9f9f9"></u-gap>
  174. <view style="padding: 0 10%; height: 100rpx; ">
  175. <u-button type="primary" shape="circle" @click="confirmphone">确认</u-button>
  176. </view>
  177. </u-popup>
  178. <view class="cu-tabbar-height"></view>
  179. <view class="cu-tabbar-height"></view>
  180. <u-no-network></u-no-network>
  181. </view>
  182. </template>
  183. <script>
  184. import store from '@/store'
  185. export default {
  186. onLoad(options) {
  187. console.log(options)
  188. this.phoneList[0].num = uni.getStorageSync('phone')
  189. this.phonenum = this.phoneList[0].num
  190. this.doctor = JSON.parse(options.doctor)
  191. this.type = options.type
  192. this.time=options.time
  193. this.hospital = options.hospital
  194. this.jigouid = options.jigou
  195. this.year = options.year
  196. this.yearid = options.yearid
  197. if(options.type==1){
  198. this.price = this.doctor.phone_price
  199. }else if(options.type==2){
  200. this.price = this.doctor.chat_price
  201. }else{
  202. this.price = this.doctor.appoint_price
  203. }
  204. },
  205. onShow() {
  206. this.getarchives()
  207. },
  208. data() {
  209. return {
  210. /* 就诊人 */
  211. showpeople: false,
  212. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  213. value: '',
  214. /* 接听号码 */
  215. showphone: false,
  216. phoneList: [{
  217. name: '默认手机号',
  218. id: '0',
  219. num: '',
  220. disabled: false
  221. },
  222. {
  223. name: '其他手机号',
  224. id: '1',
  225. num: '',
  226. disabled: false
  227. }
  228. ],
  229. idcrad:"",//身份证
  230. zhengzhuang:"", //症状
  231. phoneValue: '',
  232. showinput: '其他手机号',
  233. phonenum: "",
  234. phonedata: "",
  235. patientList: [],
  236. doctor: {},
  237. imgList:[],
  238. type:"",//咨询状态
  239. time:"",
  240. huanzheID:"",
  241. price:"",
  242. hospital:"",
  243. jigouid:"",
  244. year:"",
  245. yearid:"",
  246. upimg:[],
  247. isdescribe:false,
  248. }
  249. },
  250. methods: {
  251. //点击咨询患者
  252. openhuanzhe() {
  253. this.showpeople = true
  254. },
  255. //点击联系号码
  256. openphone() {
  257. this.showphone = true
  258. },
  259. // 选中某个单选框时,由radio时触发
  260. peopleRadioChange(e) {
  261. console.log(e);
  262. },
  263. phoneRadioChange(e) {
  264. console.log(e);
  265. },
  266. xuanzephone(item){
  267. this.phoneValue=item.name
  268. this.phonenum = item.num
  269. },
  270. xuanzehuanzhe(item){
  271. this.huanzheID = item.id
  272. this.value=item.name
  273. this.showpeople=false
  274. },
  275. //添加就诊人
  276. addPeople(e) {
  277. uni.navigateTo({
  278. url:"../archives/add_archives"
  279. })
  280. },
  281. confirmphone() {
  282. if(this.phoneValue=="其他手机号"){
  283. this.phonenum = this.phonedata
  284. }else{
  285. this.phonedata = ""
  286. }
  287. this.showphone = !this.showphone
  288. },
  289. getarchives: async function() {
  290. let res = await this.$request.post("/api/v1/patient/patientList")
  291. if (res.status == 0) {
  292. this.patientList = res.data.data
  293. this.huanzheID = this.patientList[0].id
  294. this.value=this.patientList[0].name
  295. }
  296. },
  297. gotopay:async function() {
  298. if(this.type==1){
  299. if(this.value == ""){
  300. uni.showToast({
  301. title:"请选择患者",
  302. icon:"none"
  303. })
  304. return false
  305. }
  306. if(!this.$util.isPhoneNumber(this.phonenum)){
  307. uni.showToast({
  308. title:"请选择或填写手机号",
  309. icon:"none"
  310. })
  311. return false
  312. }
  313. let obj={
  314. doctorname:this.doctor.name,
  315. product_type:this.type,
  316. docter_id:this.doctor.id,
  317. patient_id:this.huanzheID,
  318. total_amount:this.price/100,
  319. phone:this.phonenum,
  320. phone_minutes:this.doctor.phone_minutes
  321. }
  322. if((this.price/100) == 0){
  323. let res = await this.$request.post("/api/v1/order/consultPlaceOrder", {
  324. product_type: obj.product_type,
  325. docter_id: obj.docter_id,
  326. patient_id: obj.patient_id,
  327. total_amount: obj.total_amount*100,
  328. phone: obj.phone,
  329. phone_minutes: obj.phone_minutes,
  330. payment_type:2
  331. })
  332. if (res.status == 0) {
  333. uni.showToast({
  334. title: "提交成功!",
  335. icon: "none",
  336. duration: 1000
  337. })
  338. setTimeout(() => {
  339. uni.redirectTo({
  340. url: "../order/order?type=" + obj.product_type
  341. })
  342. }, 1000)
  343. }
  344. }else{
  345. uni.redirectTo({
  346. url:"../order/payment?data="+JSON.stringify(obj)
  347. })
  348. }
  349. }else if(this.type==2){
  350. if(this.value == ""){
  351. uni.showToast({
  352. title:"请选择患者",
  353. icon:"none"
  354. })
  355. return false
  356. }
  357. if(this.zhengzhuang == ""){
  358. uni.showToast({
  359. title:"请填写症状",
  360. icon:"none"
  361. })
  362. return false
  363. }
  364. // if(this.imgList.length == 0){
  365. // uni.showToast({
  366. // title:"请上传病情照片",
  367. // icon:"none"
  368. // })
  369. // return false
  370. // }
  371. let obj={
  372. doctorname:this.doctor.name,
  373. product_type:this.type,
  374. docter_id:this.doctor.id,
  375. patient_id:this.huanzheID,
  376. total_amount:this.price/100,
  377. symptoms:this.zhengzhuang,
  378. medical_imgs:JSON.stringify(this.upimg),
  379. }
  380. if((this.price/100) == 0){
  381. let res = await this.$request.post("/api/v1/order/consultPlaceOrder", {
  382. product_type: obj.product_type,
  383. docter_id: obj.docter_id,
  384. patient_id: obj.patient_id,
  385. total_amount: obj.total_amount*100,
  386. symptoms: obj.symptoms,
  387. medical_imgs: obj.medical_imgs,
  388. payment_type:2
  389. })
  390. if (res.status == 0) {
  391. uni.showToast({
  392. title: "提交成功!",
  393. icon: "none",
  394. duration: 1000
  395. })
  396. setTimeout(() => {
  397. uni.redirectTo({
  398. url: "../order/order?type=" + obj.product_type
  399. })
  400. }, 1000)
  401. }
  402. }else{
  403. uni.redirectTo({
  404. url:"../order/payment?data="+JSON.stringify(obj)
  405. })
  406. }
  407. }else if(this.type==3){
  408. if(this.value == ""){
  409. uni.showToast({
  410. title:"请选择患者",
  411. icon:"none"
  412. })
  413. return false
  414. }
  415. if(this.idcrad == ""&&this.$util.isIdCard(this.idcrad)){
  416. uni.showToast({
  417. title:"请填写正确身份证号",
  418. icon:"none"
  419. })
  420. return false
  421. }
  422. let obj={
  423. doctorname:this.doctor.name,
  424. product_type:this.type,
  425. docter_id:this.doctor.id,
  426. patient_id:this.huanzheID,
  427. total_amount:this.price/100,
  428. organization_id:this.jigouid,
  429. schedule_date:this.year,
  430. time_period_id:this.yearid,
  431. }
  432. if((this.price/100) == 0){
  433. let res = await this.$request.post("/api/v1/order/appointPlaceOrder", {
  434. product_type: obj.product_type,
  435. docter_id: obj.docter_id,
  436. patient_id: obj.patient_id,
  437. total_amount: obj.total_amount *100,
  438. organization_id: obj.organization_id,
  439. schedule_date:obj.schedule_date,
  440. time_period_id: obj.time_period_id,
  441. payment_type:2
  442. })
  443. if (res.status == 0) {
  444. uni.showToast({
  445. title: "提交成功!",
  446. icon: "none",
  447. duration: 1000
  448. })
  449. setTimeout(() => {
  450. uni.redirectTo({
  451. url: "../order/order?type=" + obj.product_type
  452. })
  453. }, 1000)
  454. }
  455. }else{
  456. uni.redirectTo({
  457. url:"../order/payment?data="+JSON.stringify(obj)
  458. })
  459. }
  460. }
  461. },
  462. ChooseImage() {
  463. uni.chooseImage({
  464. count: 4, //默认9
  465. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  466. sourceType: ['album', 'camera'], //从相册选择
  467. success: (res) => {
  468. if (this.imgList.length != 0) {
  469. this.imgList = this.imgList.concat(res.tempFilePaths)
  470. this.imgList.forEach(item=>{
  471. this.$request.upload("/api/v1/common/uploadFile",item).then(re=>{
  472. this.upimg.push(JSON.parse(re).data.url)
  473. console.log(this.upimg)
  474. })
  475. })
  476. } else {
  477. this.imgList = res.tempFilePaths
  478. this.imgList.forEach(item=>{
  479. this.$request.upload("/api/v1/common/uploadFile",item).then(re=>{
  480. this.upimg.push(JSON.parse(re).data.url)
  481. })
  482. })
  483. }
  484. }
  485. });
  486. },
  487. DelImg(e) {
  488. uni.showModal({
  489. title: '提示',
  490. content: '确定要删除吗?',
  491. cancelText: '再想想',
  492. confirmText: '删除',
  493. success: res => {
  494. if (res.confirm) {
  495. this.imgList.splice(e.currentTarget.dataset.index, 1);
  496. this.imgList = this.imgList
  497. }
  498. }
  499. })
  500. }
  501. }
  502. };
  503. </script>
  504. <style scoped lang="scss">
  505. .main {}
  506. .popup_title {
  507. height: 15%;
  508. width: 100%;
  509. display: flex;
  510. justify-content: center;
  511. align-items: center;
  512. border-bottom: 1rpx solid #f9f9f9;
  513. }
  514. .textareasty{
  515. background-color: white;
  516. border: 1px solid #efefef;
  517. border-radius: 16rpx;
  518. padding: 15rpx;
  519. margin: 15rpx 15rpx;
  520. width: 100%;
  521. }
  522. .popup_title_text {
  523. width: auto;
  524. height: auto;
  525. font-size: 34rpx;
  526. font-weight: 540;
  527. }
  528. .popup_list {
  529. display: flex;
  530. height: 10vh;
  531. width: auto;
  532. border-bottom: 1rpx solid #f9f9f9;
  533. }
  534. .popup_list_title {
  535. height: 100%;
  536. width: 90%;
  537. display: inline-block;
  538. padding: 0 0 0 30rpx;
  539. .title {
  540. height: 50%;
  541. width: auto;
  542. font-size: 32rpx;
  543. font-weight: 500;
  544. padding: 20rpx 0 0 0;
  545. }
  546. .body {
  547. height: 50%;
  548. color: #a1a1a1;
  549. height: auto;
  550. width: auto;
  551. font-size: 30rpx;
  552. padding: 10rpx 0 0 0;
  553. }
  554. }
  555. .popup_button {
  556. height: 80rpx;
  557. width: 100%;
  558. display: flex;
  559. justify-content: center;
  560. align-items: center;
  561. view {
  562. color: #0b73ba;
  563. font-weight: 500;
  564. }
  565. }
  566. /**选择号码的样式和选择患者不同
  567. 需要更改样式*/
  568. .phone {
  569. height: 20%;
  570. width: 100%;
  571. .list {
  572. height: 100%;
  573. width: 100%;
  574. display: flex;
  575. padding: 0 10rpx 0 30rpx;
  576. .title {
  577. height: 100%;
  578. width: 65%;
  579. font-size: 32rpx;
  580. color: #7d7d7d;
  581. display: flex;
  582. align-items: center;
  583. }
  584. .phone {
  585. height: 100%;
  586. font-size: 32rpx;
  587. font-weight: 500;
  588. display: flex;
  589. justify-content: center;
  590. align-items: center;
  591. }
  592. .button {
  593. height: 100%;
  594. width: 5%;
  595. display: flex;
  596. justify-content: center;
  597. align-items: center;
  598. }
  599. }
  600. }
  601. </style>