index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666
  1. <template>
  2. <view class="content">
  3. <view class="cont">
  4. <view class="bg">
  5. <image src="https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/bbe743373f4d4b78852ea5fd9824ade4.png"></image>
  6. </view>
  7. <view class="cont-box">
  8. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  9. <view class="top-title">
  10. </view>
  11. <view class="user" @click.stop="loginNavTo('/pages_user/personInfo')">
  12. <view class="left" >
  13. <image :src="user.avatar==null?'https://fs-1319721001.cos.ap-chongqing.myqcloud.com/fs/20240229/90d9eb0f8f87482b977611eb36b66d82.jpg':user.avatar"></image>
  14. </view>
  15. <view class="right" >
  16. <view class="name-box" >
  17. <view class="name">{{user.nickName}}</view>
  18. <view class="btns" >
  19. <image src="../../static/images/icon_set.png"></image>
  20. </view>
  21. </view>
  22. <view class="phone" v-if="user.phone!=''">{{$parsePhone(user.phone)}}</view>
  23. <view class="counts">
  24. <view class="count" @click="loginNavTo('/pages_user/integral')">芳华币 {{user.integral}}</view>
  25. <!-- <view class="count">我的健康金 {{user.balance}}</view> -->
  26. </view>
  27. </view>
  28. </view>
  29. <view class="menus">
  30. <view class="title-box" >
  31. <view class="line"></view>
  32. <view class="title">我的订单</view>
  33. </view>
  34. <view class="menu-box">
  35. <view class="menu" @click="loginNavTo('/pages_order/inquiryOrderList')">
  36. <image src="https://cos.his.cdwjyyh.com/fs/20250417/5e1436cf517d4e31998caf4b57453376.png"></image>
  37. <view class="title">咨询订单</view>
  38. </view>
  39. <view class="menu" @click="loginNavTo('/pages_order/storeOrderList')">
  40. <image src="https://cos.his.cdwjyyh.com/fs/20250417/a2364a0392134b7785aae90a77b76ec1.png"></image>
  41. <view class="title">处方订单</view>
  42. </view>
  43. <view class="menu" @click="loginNavTo('/pages_order/packageOrderList')">
  44. <image src="https://cos.his.cdwjyyh.com/fs/20250417/ae61bf7490d34541bc41b707e88b3ffb.png"></image>
  45. <view class="title">服务包</view>
  46. </view>
  47. <view class="menu" @click="loginNavTo('/pages_order/storeOrderRefundList')">
  48. <image src="https://cos.his.cdwjyyh.com/fs/20250417/e59fc9a1d049462a8f804c4168ee55ce.png"></image>
  49. <view class="title">售后服务</view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="menus">
  54. <view class="title-box">
  55. <view class="line"></view>
  56. <view class="title">医疗服务</view>
  57. </view>
  58. <view class="menu-box">
  59. <view class="menu" @click="loginNavTo('/pages_user/myDoctorList')">
  60. <image src="https://cos.his.cdwjyyh.com/fs/20250417/0eeec4b825534bfa8833eaf212cf803c.png"></image>
  61. <view class="title">我的医生</view>
  62. </view>
  63. <view class="menu" @click="loginNavTo('/pages_order/prescribeList')">
  64. <image src="https://cos.his.cdwjyyh.com/fs/20250417/586ec2eec9434f80a814acdaa117130d.png"></image>
  65. <view class="title">我的处方</view>
  66. </view>
  67. <view class="menu" @click="loginNavTo('/pages_user/followList')">
  68. <image src="https://cos.his.cdwjyyh.com/fs/20250417/b18b26fcee394213aa736ddbf7c746af.png"></image>
  69. <view class="title">我的随访</view>
  70. </view>
  71. <!-- <view class="menu" @click="toIM()">
  72. <image src="https://cos.his.cdwjyyh.com/fs/20240429/6e68b42d9d824532945a1dda73350576.png"></image>
  73. <view class="title">用药咨询</view>
  74. </view> -->
  75. <view class="menu" @click="navTo('/pages_user/drugReportList')" >
  76. <image src="https://cos.his.cdwjyyh.com/fs/20240429/6b9f340b16e74fa2bc095265d525769e.png"></image>
  77. <view class="title">用药报告</view>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="menus">
  82. <view class="title-box">
  83. <view class="line"></view>
  84. <view class="title">常用应用</view>
  85. </view>
  86. <view class="menu-box">
  87. <view class="menu" @click="loginNavTo('/pages_user/patient')">
  88. <image class="min-image" src="../../static/images/icon_visitor_management.png"></image>
  89. <view class="title">就诊管理</view>
  90. </view>
  91. <view class="menu" @click="loginNavTo('/pages_user/address')">
  92. <image class="min-image" src="../../static/images/icon_address_management.png"></image>
  93. <view class="title">地址管理</view>
  94. </view>
  95. <view class="menu" @click="loginNavTo('/pages_user/healthRecords/index')">
  96. <image class="min-image" src="../../static/images/icon_visitor_management.png"></image>
  97. <view class="title">健康档案</view>
  98. </view>
  99. <view class="menu" @click="loginNavTo('/pages_user/tongue/tongueList')">
  100. <image class="min-image" src="../../static/images/icon_company_3.png"></image>
  101. <view class="title">舌苔报告</view>
  102. </view>
  103. <view class="menu" @click="loginNavTo('/pages_user/addHealthButler')">
  104. <image class="min-image" src="https://cos.his.cdwjyyh.com/fs/20250417/0eeec4b825534bfa8833eaf212cf803c.png"></image>
  105. <view class="title">健康管家</view>
  106. </view>
  107. <view class="menu" @click="loginNavTo('/pages_user/myCouponList')">
  108. <image class="min-image" src="../../static/images/icon_my_coupon.png"></image>
  109. <view class="title">我的优惠卷</view>
  110. </view>
  111. <view class="menu" @click="loginNavTo('/pages_company/couponList?couponType=6')">
  112. <image class="min-image" src="../../static/images/icon_coupon.png"></image>
  113. <view class="title">领券中心</view>
  114. </view>
  115. <view class="menu" @click="loginNavTo('/pages_user/cert')">
  116. <image class="min-image" src="../../static/images/cert.png"></image>
  117. <view class="title">资质证书</view>
  118. </view>
  119. <view class="menu" @click="loginNavTo('/pages_user/price')">
  120. <image class="min-image" src="https://cos.his.cdwjyyh.com/fs/20240808/415e1a6a58ec49ffaa1bb62cb376d4e8.png"></image>
  121. <view class="title">价格公示</view>
  122. </view>
  123. </view>
  124. <view class="menu-box">
  125. <view class="menu" >
  126. <image class="min-image" src="../../static/images/icon_service_center.png"></image>
  127. <view class="title">客服中心</view>
  128. <button class='contact-btn' open-type="contact">
  129. </button>
  130. </view>
  131. <view class="menu" @click="navTo('/pages_user/about')">
  132. <image class="min-image" src="../../static/images/icon_feedback.png"></image>
  133. <view class="title">关于我们</view>
  134. </view>
  135. </view>
  136. </view>
  137. <view class="menus">
  138. <view class="title-box">
  139. <view class="line"></view>
  140. <view class="title">管理端</view>
  141. </view>
  142. <view class="menu-box">
  143. <view class="menu" @click="loginNavTo('/pages_user/registerDoctor?type=1')">
  144. <image class="min-image" src="/static/images/doctor_reg.png"></image>
  145. <view class="title">医生入驻</view>
  146. </view>
  147. <view class="menu" @click="loginNavTo('/pages_user/registerDoctor?type=2')">
  148. <image class="min-image" src="/static/images/doctor_reg.png"></image>
  149. <view class="title">药师入驻</view>
  150. </view>
  151. <view class="menu" @click="toCompany()">
  152. <image class="min-image" src="/static/images/sales.png"></image>
  153. <view class="title">客服登录</view>
  154. </view>
  155. </view>
  156. </view>
  157. <view class="btn-box" v-if="isLogin">
  158. <view class="sub-btn" @click="showLogout()">退出登录</view>
  159. </view>
  160. <view class="tip" >
  161. <view class="title">技术支持 重庆云联融智科技有限公司 </view>
  162. <!-- <view class="tel">联系电话 18696558100 </view> -->
  163. </view>
  164. </view>
  165. </view>
  166. <u-popup bgColor="#f6f6f6" :safeAreaInsetBottom="false" :round="15" mode="bottom" :show="wxShow" @close="wxAuthClose" @open="wxAuthOpen">
  167. <view class="wxAuth">
  168. <view class="title">编辑头像和昵称</view>
  169. <wx-auth class="wx-box" @updateUser="updateUser()" ref="wxauth" ></wx-auth>
  170. </view>
  171. </u-popup>
  172. <u-modal :show="show" title="提示" :showCancelButton="true" @cancel="hideLogout()" @confirm="logout()" content='确认退出吗?'></u-modal>
  173. </view>
  174. </template>
  175. <script>
  176. import {getUserInfo} from '@/api/user.js'
  177. import store from "@/store";
  178. import {wxAuth} from '../components/wxAuth.vue';
  179. import {startDrugReport,getUserFollowDoctor} from '@/api/drugReport';
  180. export default {
  181. components:{
  182. wxAuth
  183. },
  184. data() {
  185. return {
  186. baseUrl:uni.getStorageSync('requestPath'),
  187. wxShow:false,
  188. isLogin:false,
  189. show:false,
  190. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  191. user:{
  192. nickName:"登录/注册",
  193. phone:"",
  194. integral:0,
  195. balance:0.00
  196. }
  197. }
  198. },
  199. onLoad() {
  200. var that=this;
  201. },
  202. onShow() {
  203. var that=this;
  204. this.$isLogin().then(
  205. res => {
  206. if(res){
  207. // uni.$emit('refreshIM')
  208. this.getUserInfo();
  209. }
  210. },
  211. rej => {}
  212. );
  213. },
  214. onReachBottom() {
  215. },
  216. onPageScroll(e){
  217. },
  218. methods: {
  219. updateUser(){
  220. this.wxShow=false;
  221. this.getUserInfo()
  222. },
  223. wxAuthOpen(){
  224. this.wxShow=true;
  225. var that=this;
  226. setTimeout(function(){
  227. that.$refs.wxauth.getUserInfo();
  228. })
  229. },
  230. wxAuthClose(){
  231. this.wxShow=false;
  232. },
  233. doIM(){
  234. console.log(110)
  235. uni.showLoading({
  236. title:"处理中..."
  237. })
  238. getUserFollowDoctor().then(
  239. res => {
  240. if(res.code==200){
  241. if(res.data!=null){
  242. var data=res.data;
  243. var param={followId:res.data.followId};
  244. startDrugReport(param).then(
  245. res => {
  246. uni.hideLoading();
  247. //
  248. // uni.switchTab({
  249. // url:"/pages/TUIKit/TUIPages/TUIConversation/index"
  250. // })
  251. var id="C2CD-"+data.followDoctorId;
  252. store.commit("timStore/setOrderId",data.orderId);
  253. store.commit("timStore/setFollowId",data.followId);
  254. store.commit("timStore/setImType", 2);
  255. store.commit("timStore/setConversationID", id);
  256. //uni.$TUIKit.TUIChatServer.updateStore(conversationId)
  257. uni.$TUIKit.TUIConversationServer.setMessageRead(id);
  258. uni.$TUIKit.TUIConversationServer.getConversationProfile(id)
  259. .then((res) => {
  260. console.log(res)
  261. // uni.$TUIKit.TUIConversationServer.setConversationValue(id,that.orderId.toString())
  262. // .then((res) => {
  263. // console.log("更新order")
  264. // })
  265. // .catch((err) => {
  266. // });
  267. //通知 TUIChat 关闭当前会话
  268. const { conversation } = res.data;
  269. store.commit("timStore/setConversation", conversation);
  270. let url = "/pages/TUIKit/TUIPages/TUIChat/index";
  271. const { nick: name } = conversation.userProfile;
  272. url = `${url}?conversationName=${
  273. conversation.userProfile.nick?.nick ||
  274. conversation.userProfile.userID
  275. }`;
  276. uni.redirectTo({ url });
  277. })
  278. .catch((err) => {
  279. uni.hideLoading()
  280. console.warn("获取 group profile 异常 = ", err);
  281. });
  282. },
  283. rej => {}
  284. );
  285. }
  286. else{
  287. uni.hideLoading()
  288. uni.showToast({
  289. icon:'none',
  290. title: "当前没有药师为您服务",
  291. });
  292. }
  293. }else{
  294. uni.hideLoading()
  295. uni.showToast({
  296. icon:'none',
  297. title: "请求失败",
  298. });
  299. }
  300. },
  301. rej => {}
  302. );
  303. },
  304. toIM(){
  305. var that=this;
  306. this.$isLogin().then(
  307. res => {
  308. console.log(res)
  309. if(res){
  310. that.doIM()
  311. }
  312. else{
  313. uni.navigateTo({
  314. url:'/pages/auth/login'
  315. })
  316. }
  317. }
  318. );
  319. },
  320. callPhone(){
  321. uni.makePhoneCall({
  322. phoneNumber: "18696558100"
  323. })
  324. },
  325. toCompany(){
  326. this.$isLogin().then(
  327. res => {
  328. console.log(res)
  329. if(res){
  330. var token = uni.getStorageSync('CompanyUserToken');
  331. if (token ) {
  332. uni.navigateTo({
  333. url: '/pages_company/index'
  334. })
  335. } else {
  336. uni.navigateTo({
  337. url: '/pages_company/login'
  338. })
  339. }
  340. }
  341. else{
  342. uni.navigateTo({
  343. url:'/pages/auth/login'
  344. })
  345. }
  346. }
  347. );
  348. },
  349. showLogout(){
  350. this.show=true;
  351. },
  352. hideLogout(){
  353. this.show=false;
  354. },
  355. logout(){
  356. this.$logout();
  357. // uni.$TUIKit.logout();
  358. // if(uni.$TUICallKit!=null){
  359. // uni.$TUICallKit.logout();
  360. // }
  361. uni.reLaunch({
  362. url: '/pages/index/index',
  363. animationType: 'pop-in',
  364. animationDuration: 100
  365. })
  366. this.isLogin=false;
  367. },
  368. getUserInfo(){
  369. getUserInfo().then(
  370. res => {
  371. if(res.code==200){
  372. if(res.user!=null){
  373. this.isLogin=true;
  374. this.user=res.user;
  375. console.log(this.user.nickName.substr(0,4));
  376. if(this.user.isWeixinAuth==0){
  377. this.wxAuthOpen()
  378. }
  379. }
  380. }else{
  381. uni.showToast({
  382. icon:'none',
  383. title: "请求失败",
  384. });
  385. }
  386. },
  387. rej => {}
  388. );
  389. },
  390. navTo(url){
  391. uni.navigateTo({
  392. url: url
  393. })
  394. },
  395. loginNavTo(url){
  396. this.$isLogin().then(
  397. res => {
  398. console.log(res)
  399. if(res){
  400. uni.navigateTo({
  401. url: url
  402. })
  403. }
  404. else{
  405. uni.navigateTo({
  406. url:'/pages/auth/login'
  407. })
  408. }
  409. }
  410. );
  411. }
  412. }
  413. }
  414. </script>
  415. <style scoped lang="scss">
  416. .content{
  417. height: 100%;
  418. .cont{
  419. position: relative;
  420. width: 100%;
  421. display: flex;
  422. flex-direction: column;
  423. .bg{
  424. width: 100%;
  425. height:450rpx;
  426. // background-color: #2BC7B9;
  427. // background: linear-gradient(#2BC7B9, #88e2da);
  428. position: fixed;
  429. image{
  430. border-radius: 0rpx 0rpx 50rpx 50rpx;
  431. width: 100%;
  432. height:100%;
  433. }
  434. }
  435. .cont-box{
  436. z-index: 1000;
  437. .top-title{
  438. height: 88upx;
  439. line-height: 88upx;
  440. }
  441. .user{
  442. margin: 0rpx 30rpx 30rpx;
  443. z-index: 101;
  444. display: flex;
  445. align-items: flex-start;
  446. justify-content: flex-start;
  447. .left{
  448. image{
  449. width:100rpx;
  450. height:100rpx;
  451. border-radius: 50%;
  452. }
  453. }
  454. .right{
  455. flex: 1;
  456. margin-left: 30rpx;
  457. display: flex;
  458. flex-direction: column;
  459. align-items: flex-start;
  460. justify-content: flex-start;
  461. .name-box{
  462. width: 100%;
  463. display: flex;
  464. align-items: center;
  465. justify-content: space-between;
  466. .name{
  467. font-size: 38rpx;
  468. font-family: PingFang SC;
  469. font-weight: bold;
  470. color: #111111;
  471. }
  472. .btns{
  473. image{
  474. width: 50rpx;
  475. height:50rpx;
  476. }
  477. }
  478. }
  479. .phone{
  480. margin-top:10rpx ;
  481. font-size: 32rpx;
  482. font-family: PingFang SC;
  483. color: #111111;
  484. }
  485. .counts{
  486. margin-top:10rpx ;
  487. display: flex;
  488. align-items: center;
  489. justify-content: flex-start;
  490. .count{
  491. margin-right: 10rpx;
  492. background-color: #E2C99E;
  493. padding: 5rpx 15rpx;
  494. border-radius: 20rpx;
  495. font-size: 24rpx;
  496. font-family: PingFang SC;
  497. color: #ffffff;
  498. }
  499. }
  500. }
  501. }
  502. .menus{
  503. z-index: 101;
  504. margin: 0rpx 30rpx 20rpx;
  505. padding: 15rpx;
  506. display: flex;
  507. flex-direction: column;
  508. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  509. background-color: #fff;
  510. border-radius: 15rpx;
  511. .title-box{
  512. display: flex;
  513. flex-direction: row;
  514. align-items: center;
  515. justify-content: flex-start;
  516. .title{
  517. font-size: 32upx;
  518. font-family: PingFang SC;
  519. font-weight: bold;
  520. color: #111111;
  521. }
  522. .line{
  523. margin-right: 15rpx;
  524. height: 30rpx;
  525. width: 6rpx;
  526. background-color: #C39A58;
  527. }
  528. }
  529. .menu-box{
  530. display: flex;
  531. align-items: center;
  532. justify-content: flex-start;
  533. flex-wrap: wrap;
  534. .menu{
  535. padding: 15rpx;
  536. width:25%;
  537. min-width: 25%;
  538. display: flex;
  539. flex-direction: column;
  540. align-items: center;
  541. justify-content: center;
  542. position: relative;
  543. image{
  544. width:58rpx;
  545. height:58rpx;
  546. }
  547. .min-image{
  548. width:40rpx;
  549. height:40rpx;
  550. }
  551. .title{
  552. margin-top: 10rpx;
  553. font-size: 24upx;
  554. font-family: PingFang SC;
  555. font-weight: 500;
  556. color: #111111;
  557. }
  558. .contact-btn {
  559. position: absolute;
  560. width:80rpx;
  561. height:80rpx;
  562. display: flex;
  563. opacity: 0;
  564. }
  565. }
  566. }
  567. }
  568. .btn-box{
  569. margin: 30rpx;
  570. display: flex;
  571. align-items: center;
  572. justify-content: center;
  573. .sub-btn{
  574. // box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  575. border: 1rpx solid #f8f8f8;
  576. background: #FFFFFF;
  577. width: 100%;
  578. height: 88upx;
  579. line-height: 88upx;
  580. text-align: center;
  581. font-size: 30upx;
  582. font-family: PingFang SC;
  583. color: #111;
  584. }
  585. }
  586. }
  587. }
  588. }
  589. .tip{
  590. margin: 30rpx 0rpx;
  591. display: flex;
  592. flex-direction: column;
  593. align-items: center;
  594. justify-content: center;
  595. .title{
  596. font-size: 24rpx;
  597. color: #b5b5b5;
  598. font-weight: bold;
  599. }
  600. .tel{
  601. margin-top: 15rpx;
  602. font-size: 24rpx;
  603. color: #b5b5b5;
  604. }
  605. }
  606. .wxAuth{
  607. border-radius: 30rpx;
  608. width: 100%;
  609. padding: 15rpx;
  610. display: flex;
  611. flex-direction: column;
  612. align-items: center;
  613. justify-content: center;
  614. background-color: #FFFFFF;
  615. .title{
  616. font-size: 32rpx;
  617. margin: 10rpx 0rpx;
  618. font-weight: bold;
  619. text-align: center;
  620. }
  621. .wx-box{
  622. width: 100%;
  623. padding: 0rpx 30rpx;
  624. }
  625. }
  626. </style>