patientxq.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <view style="width: 100%;height: 100%;">
  3. <!-- 表单弹窗 -->
  4. <u-popup v-model="formshow" mode="center" border-radius="14" :closeable="false">
  5. <view style="width: 75vw;height: auto;margin: 30rpx 0;height: 50vh;">
  6. <view class="flex justify-center align-center"
  7. style=";font-size: 34rpx;font-weight: bold;margin-bottom:80rpx ;">修改备注</view>
  8. <view style="padding: 0 40rpx;margin-bottom: 40rpx;height: 60%;">
  9. <!-- 病症 -->
  10. <view style="margin-bottom: 20rpx;font-weight: 500;font-size: 28rpx;">备注:</view>
  11. <view
  12. style="border: 1rpx solid #C0C0C0;margin-bottom: 20rpx;height: 240rpx;border-radius: 12rpx;padding: 15rpx;">
  13. <input placeholder="请填写备注" @input="bzblur" />
  14. </view>
  15. </view>
  16. <!-- 两个按钮 -->
  17. <view style="display: flex;justify-content: center;align-items: center">
  18. <view style="display:flex;justify-content: center;align-items: center;width: 50%;">
  19. <u-button shape="shape" size="medium" @click="formshow = false">取消</u-button>
  20. </view>
  21. <view style="display:flex;justify-content: center;align-items: center ;width: 50%;">
  22. <u-button shape="shape" size="medium" type="primary" @click="qr">确认</u-button>
  23. </view>
  24. </view>
  25. </view>
  26. </u-popup>
  27. <view class="header-content">
  28. <image src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/mybanner.png"
  29. style="width:100%;height:260rpx;"></image>
  30. </view>
  31. <view style="padding: 50rpx 30rpx;">
  32. <!-- 头像 名字 按钮 -->
  33. <view class="flex" style="margin-bottom: 50rpx;">
  34. <!-- 头像 -->
  35. <view style="width: 20%;display: flex;align-items: center;">
  36. <image :src="img" mode="aspectFit" style="height: 100rpx;width: 100rpx;border-radius: 50%;"></image>
  37. </view>
  38. <!-- 名字 -->
  39. <view style="width: 52%;color: #FFFFFF;display: grid;align-items: center;">
  40. <view style="font-weight: bold;font-size: 36rpx;">{{name}}</view>
  41. <view style="font-size: 26rpx;">{{bz}}</view>
  42. </view>
  43. <!-- 按钮 -->
  44. <view style="width: 25%;display: flex;align-items: center;">
  45. <u-button shape="circle" :custom-style="customStyle" :hair-line="false" @click="formshow = true">
  46. 设置备注</u-button>
  47. </view>
  48. </view>
  49. <!-- 用户资料 -->
  50. <view class="zl">
  51. <view>
  52. <view class="flex justify-center" style="font-size: 36rpx;font-weight: 600;margin-bottom: 20rpx;">
  53. <text>{{fwb}}</text>
  54. </view>
  55. <view>服务包数量</view>
  56. </view>
  57. <view>
  58. <view class="flex justify-center" style="font-size: 36rpx;font-weight: 600;margin-bottom: 20rpx;">
  59. <text>{{dd}}</text>
  60. </view>
  61. <view>订单数量</view>
  62. </view>
  63. <view>
  64. <view class="flex justify-center" style="font-size: 36rpx;font-weight: 600;margin-bottom: 20rpx;">
  65. <text>{{da}}</text>
  66. </view>
  67. <view>档案数量</view>
  68. </view>
  69. </view>
  70. <!-- 已购服务 -->
  71. <view>
  72. <view style="font-size: 30rpx;font-weight: bold;margin-bottom: 20rpx;">已购服务</view>
  73. <view v-for="(item,index) in tclist" :key="index" style="margin-bottom: 20rpx;">
  74. <view class="taocan">
  75. <view class="tc_left">
  76. {{item.pack_name}}
  77. </view>
  78. <view class="tc_right">
  79. <view>
  80. <view style="margin-bottom: 20rpx;">{{item.pack_intro}}</view>
  81. <!-- <view style="margin-bottom: 30rpx;">{{item.dd}}</view> -->
  82. <view>有效期:{{item.start_time}}至{{item.end_time}}</view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- 历史问诊 -->
  89. <view style="margin-bottom: 50rpx;">
  90. <!-- 标题 -->
  91. <view style="font-size: 30rpx;font-weight: bold;margin-bottom: 20rpx;">历史问诊</view>
  92. <!-- 卡片 -->
  93. <view class="lswz_card" v-for="(ritem,index) in recordlist" :key="index" @click="gotoinfo(ritem)">
  94. <!-- 上部分 完成 问诊渠道-->
  95. <view style="display: flex;margin-bottom: 25rpx;">
  96. <view style="width: 70%;display: flex;color: #666666;align-items:center;">
  97. <!-- 小点 -->
  98. <view
  99. style="height: 12rpx;width: 12rpx;background-color: #666666;border-radius: 50%;margin: 0 10rpx;">
  100. </view>
  101. <!-- true为已完成 false未完成 -->
  102. <text v-if="ritem.order_status==1">未支付</text>
  103. <text v-else-if="ritem.order_status==2">待接单</text>
  104. <text v-else-if="ritem.order_status==3">进行中</text>
  105. <text v-else-if="ritem.order_status==4">已完成</text>
  106. <text v-else>已取消</text>
  107. </view>
  108. <view style="width: 30%;display: flex;align-items: center;justify-content: center;">
  109. <u-button size="mini" shape="circle" v-if="ritem.product_type == 1">电话咨询</u-button>
  110. <u-button size="mini" shape="circle" v-else-if="ritem.product_type == 2">图文咨询</u-button>
  111. <u-button size="mini" shape="circle" v-else-if="ritem.product_type == 3">门诊预约</u-button>
  112. <u-button size="mini" shape="circle" v-else-if="ritem.product_type == 4">疫苗接种预约</u-button>
  113. <u-button size="mini" shape="circle" v-else-if="ritem.product_type == 5">儿保预约</u-button>
  114. <u-button size="mini" shape="circle" v-else-if="ritem.product_type == 6">服务包</u-button>
  115. <u-button size="mini" shape="circle" v-else>充值</u-button>
  116. </view>
  117. </view>
  118. <u-line color="#EFEFEF" />
  119. <!-- 下部分 资料 -->
  120. <view style="margin-top: 15rpx;">
  121. <view style="font-size: 26rpx;">
  122. <view style="margin-bottom: 10rpx;display: flex;">
  123. <view style="width: 20%;color: #666666;">患者:</view>
  124. <view style="width: 80%;">{{ritem.name}}</view>
  125. </view>
  126. <view style="margin-bottom: 10rpx;display: flex;">
  127. <view style="width: 20%;color: #666666;">年龄:</view>
  128. <view style="width: 80%;">{{ritem.birthday}}</view>
  129. </view>
  130. <view style="margin-bottom: 10rpx;display: flex;">
  131. <view style="width: 20%;color: #666666;">订单号:</view>
  132. <view style="width: 80%;">{{ritem.order_sn}}</view>
  133. </view>
  134. <view style="margin-bottom: 10rpx;display: flex;">
  135. <view style="width: 20%;color: #666666;">下单时间:</view>
  136. <view style="width: 80%;">{{ritem.created_at}}</view>
  137. </view>
  138. <view style="margin-bottom: 10rpx;display: flex;">
  139. <view style="width: 20%;color: #666666;">结束时间:</view>
  140. <view style="width: 80%;">{{ritem.outtime}}</view>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <!-- 患者档案 -->
  147. <view style="margin-bottom: 200rpx;">
  148. <!-- 标题 -->
  149. <view style="font-size: 30rpx;font-weight: bold;margin-bottom: 20rpx;">患者档案</view>
  150. <!-- 列表 -->
  151. <view class="hzda_list" v-for="(ditem,index) in dalist" @click="clickda" :id='ditem.id' :key='index'
  152. :data-index="index">
  153. <!-- 头像 -->
  154. <view class="flex align-center justify-start " style="width: 18%;">
  155. <image :src="ditem.avatar" style="height: 72rpx;width: 72rpx;border-radius: 50%;"></image>
  156. </view>
  157. <!-- 信息 -->
  158. <view style="width: 70%">
  159. <view style="font-size: 30rpx;color: #333333;font-weight: bold;">{{ditem.name}}</view>
  160. <view style="color: #999999;font-size: 26rpx;">
  161. <text style="margin-right: 20rpx;">{{ditem.sex}}</text>
  162. <text>{{ditem.age}}</text>
  163. </view>
  164. </view>
  165. <!-- 箭头 -->
  166. <view class="flex align-center justify-end" style="width: 10%;">
  167. <u-icon name="arrow-right" color="#C0C0C0"></u-icon>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. <!-- 按钮 -->
  173. <view class="bottomButton">
  174. <view class="b">
  175. <u-button shape="circle" :custom-style="bStyle" @click="phone">电话随访</u-button>
  176. </view>
  177. <view class="b">
  178. <u-button shape="circle" :custom-style="btStyle" v-if="!guanzhu" @click="gzclick">关注</u-button>
  179. <u-button shape="circle" :custom-style="bfStyle" v-else @click="gzclick">已关注</u-button>
  180. </view>
  181. </view>
  182. </view>
  183. </template>
  184. <script>
  185. export default {
  186. data() {
  187. return {
  188. guanzhu: false,
  189. //底部按钮样式
  190. bStyle: {
  191. width: '100%',
  192. height: '100%',
  193. fontSize: '28rpx',
  194. },
  195. btStyle: {
  196. width: '100%',
  197. height: '100%',
  198. fontSize: '28rpx',
  199. color: '#0B73B9',
  200. backgroundColor: '#FFFFFF'
  201. },
  202. bfStyle: {
  203. width: '100%',
  204. height: '100%',
  205. fontSize: '28rpx',
  206. color: '#ffffff',
  207. backgroundColor: '#0B73B9'
  208. },
  209. //收藏按钮样式
  210. customStyle: {
  211. width: '100%',
  212. height: '80rpx',
  213. backgroundColor: '#3a8fc5',
  214. color: '#FFFFFF',
  215. fontSize: '28rpx',
  216. display: 'flex',
  217. alignItems: 'center',
  218. justifyContent: 'center',
  219. border: '1rpx solid #3a8fc5'
  220. },
  221. //头像路径
  222. img: 'https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/头像.png',
  223. //名字
  224. name: '用户名',
  225. bz: '备注',
  226. user_id: 0,
  227. //已购服务
  228. tclist: [],
  229. //历史问诊
  230. recordlist: [],
  231. dalist: [],
  232. //列表
  233. fwb: '1', //服务包
  234. dd: '2', //订单
  235. da: '3', //档案
  236. //装设置备注值
  237. formshow: false,
  238. inputbz: ''
  239. }
  240. },
  241. onLoad(options) {
  242. console.log("ID", options.id);
  243. this.detailres(options.id)
  244. // this.getguanzhu();
  245. },
  246. mounted() {
  247. },
  248. methods: {
  249. gotoinfo(item) {
  250. if (item.product_type == 2 && item.order_status == 4) {
  251. uni.navigateTo({
  252. url: "./wechatrecord?id=" + item.id
  253. })
  254. }
  255. },
  256. phone: async function() {
  257. //打电话
  258. let res = await this.$request.post("patient/callPhoneSure", {
  259. 'user_id': this.user_id
  260. });
  261. if (res.status == 0) {
  262. let phone = res.data;
  263. // 去拨打电话即可
  264. uni.makePhoneCall({
  265. // 手机号
  266. phoneNumber: phone,
  267. // 成功回调
  268. success: (res) => {
  269. console.log('调用成功!')
  270. },
  271. // 失败回调
  272. fail: (res) => {
  273. uni.showModal({
  274. title: "拨打电话调用失败",
  275. })
  276. }
  277. });
  278. } else {
  279. uni.showToast({
  280. title: res.message,
  281. icon: 'none',
  282. duration: 3000
  283. })
  284. }
  285. },
  286. //点击档案
  287. clickda(e) {
  288. console.log(this.dalist[e.currentTarget.dataset.index])
  289. let idda = e.currentTarget.id
  290. uni.navigateTo({
  291. url: 'patientda?id=' + idda
  292. })
  293. },
  294. //点击关注
  295. gzclick: async function(e) {
  296. if (this.guanzhu) {
  297. console.log('取消关注')
  298. let res = await this.$request.post("doctor/userFollow", {
  299. 'user_id': this.user_id,
  300. 'is_ley': 1
  301. })
  302. this.guanzhu = false
  303. } else {
  304. let res = await this.$request.post("doctor/userFollow", {
  305. 'user_id': this.user_id,
  306. 'is_ley': 2
  307. })
  308. this.guanzhu = true
  309. }
  310. },
  311. detailres: async function(e) {
  312. let idXq = e
  313. console.log("给接口的ID", e)
  314. let res = await this.$request.post("doctor/userListDetile", {
  315. user_id: idXq
  316. })
  317. console.log("请求接口后数据", res)
  318. if (res.status == 0) {
  319. let user_arr = res.data.user_arr
  320. this.user_id = user_arr.id
  321. this.img = user_arr.avatar
  322. this.name = user_arr.nickname
  323. this.bz = user_arr.remark
  324. this.recordlist = res.data.order_arr //历史问诊
  325. this.dalist = res.data.patients_arr //患者档案
  326. this.getguanzhu(user_arr.id);
  327. this.fwb = res.data.nums.fuwu_num;
  328. this.dd = res.data.nums.order_num;
  329. this.da = res.data.nums.pati_num;
  330. // tclist渲染服务包
  331. this.tclist = res.data.fuwu_arr
  332. } else {
  333. uni.showToast({
  334. title: "请求失败",
  335. icon: 'none'
  336. })
  337. }
  338. },
  339. getguanzhu: async function(id) {
  340. let res = await this.$request.post('doctor/getFollows', {
  341. 'user_id': id
  342. });
  343. if (res.status == 0) {
  344. this.guanzhu = res.data
  345. }
  346. },
  347. bzblur(e) {
  348. this.inputbz = e.detail.value
  349. },
  350. qr: async function(e) {
  351. if (this.inputbz != '') {
  352. let res = await this.$request.post("doctor/remacks", {
  353. 'id': this.user_id,
  354. 'remak': this.inputbz
  355. });
  356. if (res.status == 0) {
  357. uni.showToast({
  358. title: '设置成功!'
  359. })
  360. this.bz = this.inputbz
  361. this.formshow = false
  362. } else {
  363. uni.showToast({
  364. title: '设置失败!',
  365. icon: "none"
  366. })
  367. }
  368. } else {
  369. uni.showToast({
  370. title: '请填写备注',
  371. icon: 'none'
  372. })
  373. }
  374. }
  375. }
  376. };
  377. </script>
  378. <style scoped lang="scss">
  379. .header-content {
  380. position: absolute;
  381. top: 0;
  382. right: 0;
  383. bottom: 0;
  384. left: 0;
  385. width: 100%;
  386. z-index: -1;
  387. overflow: hidden;
  388. box-sizing: border-box;
  389. }
  390. .custom-style {
  391. width: 100%;
  392. height: 80rpx;
  393. backgroundolor: #3a8fc5;
  394. color: #FFFFFF;
  395. font-size: 28rpx;
  396. border-radius: 10%;
  397. display: flex;
  398. align-items: center;
  399. justify-content: center;
  400. }
  401. // 资料
  402. .zl {
  403. display: flex;
  404. align-items: center;
  405. justify-content: space-around;
  406. padding: 34rpx 28rpx;
  407. background-color: #ffffff;
  408. border-radius: 10rpx;
  409. text-indent: 2em;
  410. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
  411. margin-bottom: 30rpx;
  412. font-size: 26rpx;
  413. }
  414. // 套餐
  415. .taocan {
  416. width: 710rpx;
  417. height: 230rpx;
  418. position: relative;
  419. display: flex;
  420. border-radius: 10rpx;
  421. background: radial-gradient(circle at right top, transparent 15rpx, #ffffff 0) top left / 152rpx 51% no-repeat,
  422. radial-gradient(circle at right bottom, transparent 15rpx, #ffffff 0) bottom left /152rpx 51% no-repeat,
  423. radial-gradient(circle at left top, transparent 15rpx, #ffffff 0) top right /560rpx 51% no-repeat,
  424. radial-gradient(circle at left bottom, transparent 15rpx, #ffffff 0) bottom right /560rpx 51% no-repeat;
  425. filter: drop-shadow(0rpx 2rpx 12rpx 0rpx rgba(0, 0, 0, 0.04));
  426. }
  427. //套餐左
  428. .tc_left {
  429. display: flex;
  430. justify-content: center;
  431. align-items: center;
  432. width: 151rpx;
  433. font-size: 30rpx;
  434. font-weight: bold;
  435. border-right: 1rpx dashed #f6f6f6;
  436. }
  437. // 套餐右
  438. .tc_right {
  439. display: flex;
  440. align-items: center;
  441. width: 550rpx;
  442. padding: 30rpx 20rpx;
  443. font-size: 20rpx;
  444. }
  445. //lswz_card历史问诊的卡片
  446. .lswz_card {
  447. width: 100%;
  448. background-color: #FFFFFF;
  449. border-radius: 15rpx;
  450. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
  451. padding: 30rpx;
  452. margin-bottom: 20rpx;
  453. }
  454. //hzda_list患者档案的列表
  455. .hzda_list {
  456. background-color: #FFFFFF;
  457. display: flex;
  458. border-radius: 10rpx;
  459. padding: 30rpx;
  460. margin-bottom: 20rpx;
  461. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
  462. }
  463. //底部按钮
  464. .bottomButton {
  465. position: fixed;
  466. bottom: 0;
  467. left: 0;
  468. width: 100%;
  469. height: 100rpx;
  470. display: flex;
  471. align-items: center;
  472. justify-content: flex-end;
  473. background-color: #FFFFFF;
  474. z-index: 1;
  475. .b {
  476. margin-right: 30rpx;
  477. padding: 20rpx 0rpx;
  478. height: 100%;
  479. width: 150rpx;
  480. }
  481. }
  482. </style>