info_write.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  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" 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 = store.getters['getusers'].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. }
  289. },
  290. gotopay:async function() {
  291. if(this.type==1){
  292. if(this.value!=""&&this.phonenum!=""&&this.$util.isPhoneNumber(this.phonenum)){
  293. let obj={
  294. doctorname:this.doctor.name,
  295. product_type:this.type,
  296. docter_id:this.doctor.id,
  297. patient_id:this.huanzheID,
  298. total_amount:this.price/100,
  299. phone:this.phonenum,
  300. phone_minutes:this.doctor.phone_minutes,
  301. payment_type:2
  302. }
  303. uni.navigateTo({
  304. url:"../order/payment?data="+JSON.stringify(obj)
  305. })
  306. }else{
  307. uni.showToast({
  308. title:"请选择完整",
  309. icon:"none"
  310. })
  311. }
  312. }else if(this.type==2){
  313. if(this.value!=""&&this.zhengzhuang!=""&&this.imgList.length!=0){
  314. let obj={
  315. doctorname:this.doctor.name,
  316. product_type:this.type,
  317. docter_id:this.doctor.id,
  318. patient_id:this.huanzheID,
  319. total_amount:this.price/100,
  320. symptoms:this.zhengzhuang,
  321. medical_imgs:this.upimg,
  322. payment_type:2
  323. }
  324. uni.navigateTo({
  325. url:"../order/payment?data="+JSON.stringify(obj)
  326. })
  327. }else{
  328. uni.showToast({
  329. title:"请选择完整",
  330. icon:"none"
  331. })
  332. }
  333. }else if(this.type==3){
  334. if(this.value!=""&&this.idcrad!=""){
  335. let obj={
  336. doctorname:this.doctor.name,
  337. product_type:this.type,
  338. docter_id:this.doctor.id,
  339. patient_id:this.huanzheID,
  340. total_amount:this.price/100,
  341. organization_id:this.jigouid,
  342. schedule_date:this.year,
  343. time_period_id:this.yearid,
  344. payment_type:2
  345. }
  346. uni.navigateTo({
  347. url:"../order/payment?data="+JSON.stringify(obj)
  348. })
  349. }else{
  350. uni.showToast({
  351. title:"请选择完整",
  352. icon:"none"
  353. })
  354. }
  355. }
  356. },
  357. ChooseImage() {
  358. uni.chooseImage({
  359. count: 4, //默认9
  360. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  361. sourceType: ['album', 'camera'], //从相册选择
  362. success: (res) => {
  363. if (this.imgList.length != 0) {
  364. this.imgList = this.imgList.concat(res.tempFilePaths)
  365. this.$request.upload("/api/v1/common/uploadFile",this.imgList[this.imgList.length-1]).then(re=>{
  366. this.upimg.push(JSON.parse(re).data.url)
  367. console.log(this.upimg)
  368. }).catch(err=>{
  369. })
  370. } else {
  371. this.imgList = res.tempFilePaths
  372. this.$request.upload("/api/v1/common/uploadFile",this.imgList[this.imgList.length-1]).then(re=>{
  373. this.upimg.push(JSON.parse(re).data.url)
  374. }).catch(err=>{
  375. })
  376. }
  377. }
  378. });
  379. },
  380. DelImg(e) {
  381. uni.showModal({
  382. title: '提示',
  383. content: '确定要删除吗?',
  384. cancelText: '再想想',
  385. confirmText: '删除',
  386. success: res => {
  387. if (res.confirm) {
  388. this.imgList.splice(e.currentTarget.dataset.index, 1);
  389. this.imgList = this.imgList
  390. }
  391. }
  392. })
  393. }
  394. }
  395. };
  396. </script>
  397. <style scoped lang="scss">
  398. .main {}
  399. .popup_title {
  400. height: 15%;
  401. width: 100%;
  402. display: flex;
  403. justify-content: center;
  404. align-items: center;
  405. border-bottom: 1rpx solid #f9f9f9;
  406. }
  407. .textareasty{
  408. background-color: white;
  409. border: 1px solid #efefef;
  410. border-radius: 16rpx;
  411. padding: 15rpx;
  412. margin: 15rpx auto;
  413. }
  414. .popup_title_text {
  415. width: auto;
  416. height: auto;
  417. font-size: 34rpx;
  418. font-weight: 540;
  419. }
  420. .popup_list {
  421. display: flex;
  422. height: 10vh;
  423. width: auto;
  424. border-bottom: 1rpx solid #f9f9f9;
  425. }
  426. .popup_list_title {
  427. height: 100%;
  428. width: 90%;
  429. display: inline-block;
  430. padding: 0 0 0 30rpx;
  431. .title {
  432. height: 50%;
  433. width: auto;
  434. font-size: 32rpx;
  435. font-weight: 500;
  436. padding: 20rpx 0 0 0;
  437. }
  438. .body {
  439. height: 50%;
  440. color: #a1a1a1;
  441. height: auto;
  442. width: auto;
  443. font-size: 30rpx;
  444. padding: 10rpx 0 0 0;
  445. }
  446. }
  447. .popup_button {
  448. height: 80rpx;
  449. width: 100%;
  450. display: flex;
  451. justify-content: center;
  452. align-items: center;
  453. view {
  454. color: #0b73ba;
  455. font-weight: 500;
  456. }
  457. }
  458. /**选择号码的样式和选择患者不同
  459. 需要更改样式*/
  460. .phone {
  461. height: 20%;
  462. width: 100%;
  463. .list {
  464. height: 100%;
  465. width: 100%;
  466. display: flex;
  467. padding: 0 10rpx 0 30rpx;
  468. .title {
  469. height: 100%;
  470. width: 65%;
  471. font-size: 32rpx;
  472. color: #7d7d7d;
  473. display: flex;
  474. align-items: center;
  475. }
  476. .phone {
  477. height: 100%;
  478. font-size: 32rpx;
  479. font-weight: 500;
  480. display: flex;
  481. justify-content: center;
  482. align-items: center;
  483. }
  484. .button {
  485. height: 100%;
  486. width: 5%;
  487. display: flex;
  488. justify-content: center;
  489. align-items: center;
  490. }
  491. }
  492. }
  493. </style>