index.vue 17 KB

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