info_write.vue 16 KB

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