info_write.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  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. </view>
  178. </template>
  179. <script>
  180. import store from '@/store'
  181. export default {
  182. onLoad(options) {
  183. this.phoneList[0].num = store.getters['getusers'].phone
  184. this.phonenum = this.phoneList[0].num
  185. this.doctor = JSON.parse(options.doctor)
  186. this.type = options.type
  187. this.time=options.time
  188. this.hospital = options.hospital
  189. this.jigouid = options.jigou
  190. this.year = options.year
  191. this.yearid = options.yearid
  192. if(options.type==1){
  193. this.price = this.doctor.phone_price
  194. }else if(options.type==2){
  195. this.price = this.doctor.chat_price
  196. }else{
  197. this.price = this.doctor.appoint_price
  198. }
  199. },
  200. onShow() {
  201. this.getarchives()
  202. },
  203. data() {
  204. return {
  205. /* 就诊人 */
  206. showpeople: false,
  207. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  208. value: '',
  209. /* 接听号码 */
  210. showphone: false,
  211. phoneList: [{
  212. name: '默认手机号',
  213. id: '0',
  214. num: '',
  215. disabled: false
  216. },
  217. {
  218. name: '其他手机号',
  219. id: '1',
  220. num: '',
  221. disabled: false
  222. }
  223. ],
  224. idcrad:"",//身份证
  225. zhengzhuang:"", //症状
  226. phoneValue: '',
  227. showinput: '其他手机号',
  228. phonenum: "",
  229. phonedata: "",
  230. patientList: [],
  231. doctor: {},
  232. imgList:[],
  233. type:"",//咨询状态
  234. time:"",
  235. huanzheID:"",
  236. price:"",
  237. hospital:"",
  238. jigouid:"",
  239. year:"",
  240. yearid:""
  241. }
  242. },
  243. methods: {
  244. //点击咨询患者
  245. openhuanzhe() {
  246. this.showpeople = true
  247. },
  248. //点击联系号码
  249. openphone() {
  250. this.showphone = true
  251. },
  252. // 选中某个单选框时,由radio时触发
  253. peopleRadioChange(e) {
  254. console.log(e);
  255. },
  256. phoneRadioChange(e) {
  257. console.log(e);
  258. },
  259. xuanzephone(item){
  260. this.phoneValue=item.name
  261. this.phonenum = item.num
  262. },
  263. xuanzehuanzhe(item){
  264. this.huanzheID = item.id
  265. this.value=item.name
  266. this.showpeople=false
  267. },
  268. //添加就诊人
  269. addPeople(e) {
  270. uni.navigateTo({
  271. url:"../archives/add_archives"
  272. })
  273. },
  274. confirmphone() {
  275. if(this.phoneValue=="其他手机号"){
  276. this.phonenum = this.phonedata
  277. }else{
  278. this.phonedata = ""
  279. }
  280. this.showphone = !this.showphone
  281. },
  282. getarchives: async function() {
  283. let res = await this.$request.post("/api/v1/patient/patientList")
  284. if (res.status == 0) {
  285. this.patientList = res.data.data
  286. }
  287. },
  288. gotopay:async function() {
  289. if(this.type==1){
  290. if(this.value!=""&&this.phonenum!=""&&this.$util.isPhoneNumber(this.phonenum)){
  291. let obj={
  292. doctorname:this.doctor.name,
  293. product_type:this.type,
  294. docter_id:this.doctor.id,
  295. patient_id:this.huanzheID,
  296. total_amount:this.price/100,
  297. phone:this.phonenum,
  298. phone_minutes:this.doctor.phone_minutes,
  299. payment_type:2
  300. }
  301. uni.navigateTo({
  302. url:"../order/payment?data="+JSON.stringify(obj)
  303. })
  304. }else{
  305. uni.showToast({
  306. title:"请选择完整",
  307. icon:"none"
  308. })
  309. }
  310. }else if(this.type==2){
  311. if(this.value!=""&&this.zhengzhuang!=""&&this.imgList.length!=0){
  312. let obj={
  313. doctorname:this.doctor.name,
  314. product_type:this.type,
  315. docter_id:this.doctor.id,
  316. patient_id:this.huanzheID,
  317. total_amount:this.price/100,
  318. symptoms:this.zhengzhuang,
  319. medical_imgs:this.imgList,
  320. payment_type:2
  321. }
  322. uni.navigateTo({
  323. url:"../order/payment?data="+JSON.stringify(obj)
  324. })
  325. }else{
  326. uni.showToast({
  327. title:"请选择完整",
  328. icon:"none"
  329. })
  330. }
  331. }else if(this.type==3){
  332. if(this.value!=""&&this.idcrad!=""){
  333. let obj={
  334. doctorname:this.doctor.name,
  335. product_type:this.type,
  336. docter_id:this.doctor.id,
  337. patient_id:this.huanzheID,
  338. total_amount:this.price/100,
  339. organization_id:this.jigouid,
  340. schedule_date:this.year,
  341. time_period_id:this.yearid,
  342. payment_type:2
  343. }
  344. uni.navigateTo({
  345. url:"../order/payment?data="+JSON.stringify(obj)
  346. })
  347. }else{
  348. uni.showToast({
  349. title:"请选择完整",
  350. icon:"none"
  351. })
  352. }
  353. }
  354. },
  355. ChooseImage() {
  356. uni.chooseImage({
  357. count: 4, //默认9
  358. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  359. sourceType: ['album', 'camera'], //从相册选择
  360. success: async (res) => {
  361. if (this.imgList.length != 0) {
  362. this.imgList = this.imgList.concat(res.tempFilePaths)
  363. } else {
  364. this.imgList = res.tempFilePaths
  365. }
  366. }
  367. });
  368. },
  369. DelImg(e) {
  370. uni.showModal({
  371. title: '提示',
  372. content: '确定要删除吗?',
  373. cancelText: '再想想',
  374. confirmText: '删除',
  375. success: res => {
  376. if (res.confirm) {
  377. this.imgList.splice(e.currentTarget.dataset.index, 1);
  378. this.imgList = this.imgList
  379. }
  380. }
  381. })
  382. }
  383. }
  384. };
  385. </script>
  386. <style scoped lang="scss">
  387. .main {}
  388. .popup_title {
  389. height: 15%;
  390. width: 100%;
  391. display: flex;
  392. justify-content: center;
  393. align-items: center;
  394. border-bottom: 1rpx solid #f9f9f9;
  395. }
  396. .textareasty{
  397. background-color: white;
  398. border: 1px solid #efefef;
  399. border-radius: 16rpx;
  400. padding: 15rpx;
  401. margin: 15rpx auto;
  402. }
  403. .popup_title_text {
  404. width: auto;
  405. height: auto;
  406. font-size: 34rpx;
  407. font-weight: 540;
  408. }
  409. .popup_list {
  410. display: flex;
  411. height: 10vh;
  412. width: auto;
  413. border-bottom: 1rpx solid #f9f9f9;
  414. }
  415. .popup_list_title {
  416. height: 100%;
  417. width: 90%;
  418. display: inline-block;
  419. padding: 0 0 0 30rpx;
  420. .title {
  421. height: 50%;
  422. width: auto;
  423. font-size: 32rpx;
  424. font-weight: 500;
  425. padding: 20rpx 0 0 0;
  426. }
  427. .body {
  428. height: 50%;
  429. color: #a1a1a1;
  430. height: auto;
  431. width: auto;
  432. font-size: 30rpx;
  433. padding: 10rpx 0 0 0;
  434. }
  435. }
  436. .popup_button {
  437. height: 80rpx;
  438. width: 100%;
  439. display: flex;
  440. justify-content: center;
  441. align-items: center;
  442. view {
  443. color: #0b73ba;
  444. font-weight: 500;
  445. }
  446. }
  447. /**选择号码的样式和选择患者不同
  448. 需要更改样式*/
  449. .phone {
  450. height: 20%;
  451. width: 100%;
  452. .list {
  453. height: 100%;
  454. width: 100%;
  455. display: flex;
  456. padding: 0 10rpx 0 30rpx;
  457. .title {
  458. height: 100%;
  459. width: 65%;
  460. font-size: 32rpx;
  461. color: #7d7d7d;
  462. display: flex;
  463. align-items: center;
  464. }
  465. .phone {
  466. height: 100%;
  467. width: 30%;
  468. font-size: 32rpx;
  469. font-weight: 500;
  470. display: flex;
  471. justify-content: center;
  472. align-items: center;
  473. }
  474. .button {
  475. height: 100%;
  476. width: 5%;
  477. display: flex;
  478. justify-content: center;
  479. align-items: center;
  480. }
  481. }
  482. }
  483. </style>