info_write.vue 12 KB

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