index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  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_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="https://cos.his.cdwjyyh.com/fs/20250417/0eeec4b825534bfa8833eaf212cf803c.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. baseUrl:uni.getStorageSync('requestPath'),
  189. wxShow:false,
  190. isLogin:false,
  191. show:false,
  192. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  193. user:{
  194. nickName:"登录/注册",
  195. phone:"",
  196. integral:0,
  197. balance:0.00
  198. }
  199. }
  200. },
  201. onLoad() {
  202. var that=this;
  203. },
  204. onShow() {
  205. var that=this;
  206. this.$isLogin().then(
  207. res => {
  208. if(res){
  209. uni.$emit('refreshIM')
  210. this.getUserInfo();
  211. }
  212. },
  213. rej => {}
  214. );
  215. },
  216. onReachBottom() {
  217. },
  218. onPageScroll(e){
  219. },
  220. methods: {
  221. updateUser(){
  222. this.wxShow=false;
  223. this.getUserInfo()
  224. },
  225. wxAuthOpen(){
  226. this.wxShow=true;
  227. var that=this;
  228. setTimeout(function(){
  229. that.$refs.wxauth.getUserInfo();
  230. })
  231. },
  232. wxAuthClose(){
  233. this.wxShow=false;
  234. },
  235. doIM(){
  236. console.log(110)
  237. uni.showLoading({
  238. title:"处理中..."
  239. })
  240. getUserFollowDoctor().then(
  241. res => {
  242. if(res.code==200){
  243. if(res.data!=null){
  244. var data=res.data;
  245. var param={followId:res.data.followId};
  246. startDrugReport(param).then(
  247. res => {
  248. uni.hideLoading()
  249. //
  250. // uni.switchTab({
  251. // url:"/pages/TUIKit/TUIPages/TUIConversation/index"
  252. // })
  253. var id="C2CD-"+data.followDoctorId;
  254. store.commit("timStore/setOrderId",data.orderId);
  255. store.commit("timStore/setFollowId",data.followId);
  256. store.commit("timStore/setImType", 2);
  257. store.commit("timStore/setConversationID", id);
  258. //uni.$TUIKit.TUIChatServer.updateStore(conversationId)
  259. uni.$TUIKit.TUIConversationServer.setMessageRead(id);
  260. uni.$TUIKit.TUIConversationServer.getConversationProfile(id)
  261. .then((res) => {
  262. console.log(res)
  263. // uni.$TUIKit.TUIConversationServer.setConversationValue(id,that.orderId.toString())
  264. // .then((res) => {
  265. // console.log("更新order")
  266. // })
  267. // .catch((err) => {
  268. // });
  269. //通知 TUIChat 关闭当前会话
  270. const { conversation } = res.data;
  271. store.commit("timStore/setConversation", conversation);
  272. let url = "/pages/TUIKit/TUIPages/TUIChat/index";
  273. const { nick: name } = conversation.userProfile;
  274. url = `${url}?conversationName=${
  275. conversation.userProfile.nick?.nick ||
  276. conversation.userProfile.userID
  277. }`;
  278. uni.redirectTo({ url });
  279. })
  280. .catch((err) => {
  281. uni.hideLoading()
  282. console.warn("获取 group profile 异常 = ", err);
  283. });
  284. },
  285. rej => {}
  286. );
  287. }
  288. else{
  289. uni.hideLoading()
  290. uni.showToast({
  291. icon:'none',
  292. title: "当前没有药师为您服务",
  293. });
  294. }
  295. }else{
  296. uni.hideLoading()
  297. uni.showToast({
  298. icon:'none',
  299. title: "请求失败",
  300. });
  301. }
  302. },
  303. rej => {}
  304. );
  305. },
  306. toIM(){
  307. var that=this;
  308. this.$isLogin().then(
  309. res => {
  310. console.log(res)
  311. if(res){
  312. that.doIM()
  313. }
  314. else{
  315. uni.navigateTo({
  316. url:'/pages/auth/login'
  317. })
  318. }
  319. }
  320. );
  321. },
  322. callPhone(){
  323. uni.makePhoneCall({
  324. phoneNumber: "18696558100"
  325. })
  326. },
  327. toCompany(){
  328. this.$isLogin().then(
  329. res => {
  330. console.log(res)
  331. if(res){
  332. var token = uni.getStorageSync('CompanyUserToken');
  333. if (token ) {
  334. uni.navigateTo({
  335. url: '/pages_company/index'
  336. })
  337. } else {
  338. uni.navigateTo({
  339. url: '/pages_company/login'
  340. })
  341. }
  342. }
  343. else{
  344. uni.navigateTo({
  345. url:'/pages/auth/login'
  346. })
  347. }
  348. }
  349. );
  350. },
  351. showLogout(){
  352. this.show=true;
  353. },
  354. hideLogout(){
  355. this.show=false;
  356. },
  357. logout(){
  358. this.$logout();
  359. uni.$TUIKit.logout();
  360. if(uni.$TUICallKit!=null){
  361. uni.$TUICallKit.logout();
  362. }
  363. uni.reLaunch({
  364. url: '/pages/index/index',
  365. animationType: 'pop-in',
  366. animationDuration: 100
  367. })
  368. this.isLogin=false;
  369. },
  370. getUserInfo(){
  371. getUserInfo().then(
  372. res => {
  373. if(res.code==200){
  374. if(res.user!=null){
  375. this.isLogin=true;
  376. this.user=res.user;
  377. console.log(this.user.nickName.substr(0,4));
  378. if(this.user.isWeixinAuth==0){
  379. this.wxAuthOpen()
  380. }
  381. }
  382. }else{
  383. uni.showToast({
  384. icon:'none',
  385. title: "请求失败",
  386. });
  387. }
  388. },
  389. rej => {}
  390. );
  391. },
  392. navTo(url){
  393. uni.navigateTo({
  394. url: url
  395. })
  396. },
  397. loginNavTo(url){
  398. this.$isLogin().then(
  399. res => {
  400. console.log(res)
  401. if(res){
  402. uni.navigateTo({
  403. url: url
  404. })
  405. }
  406. else{
  407. uni.navigateTo({
  408. url:'/pages/auth/login'
  409. })
  410. }
  411. }
  412. );
  413. }
  414. }
  415. }
  416. </script>
  417. <style scoped lang="scss">
  418. .content{
  419. height: 100%;
  420. .cont{
  421. position: relative;
  422. width: 100%;
  423. display: flex;
  424. flex-direction: column;
  425. .bg{
  426. width: 100%;
  427. height:450rpx;
  428. // background-color: #2BC7B9;
  429. // background: linear-gradient(#2BC7B9, #88e2da);
  430. position: fixed;
  431. image{
  432. border-radius: 0rpx 0rpx 50rpx 50rpx;
  433. width: 100%;
  434. height:100%;
  435. }
  436. }
  437. .cont-box{
  438. z-index: 1000;
  439. .top-title{
  440. height: 88upx;
  441. line-height: 88upx;
  442. }
  443. .user{
  444. margin: 0rpx 30rpx 30rpx;
  445. z-index: 101;
  446. display: flex;
  447. align-items: flex-start;
  448. justify-content: flex-start;
  449. .left{
  450. image{
  451. width:100rpx;
  452. height:100rpx;
  453. border-radius: 50%;
  454. }
  455. }
  456. .right{
  457. flex: 1;
  458. margin-left: 30rpx;
  459. display: flex;
  460. flex-direction: column;
  461. align-items: flex-start;
  462. justify-content: flex-start;
  463. .name-box{
  464. width: 100%;
  465. display: flex;
  466. align-items: center;
  467. justify-content: space-between;
  468. .name{
  469. font-size: 38rpx;
  470. font-family: PingFang SC;
  471. font-weight: bold;
  472. color: #111111;
  473. }
  474. .btns{
  475. image{
  476. width: 50rpx;
  477. height:50rpx;
  478. }
  479. }
  480. }
  481. .phone{
  482. margin-top:10rpx ;
  483. font-size: 32rpx;
  484. font-family: PingFang SC;
  485. color: #111111;
  486. }
  487. .counts{
  488. margin-top:10rpx ;
  489. display: flex;
  490. align-items: center;
  491. justify-content: flex-start;
  492. .count{
  493. margin-right: 10rpx;
  494. background-color: #E2C99E;
  495. padding: 5rpx 15rpx;
  496. border-radius: 20rpx;
  497. font-size: 24rpx;
  498. font-family: PingFang SC;
  499. color: #ffffff;
  500. }
  501. }
  502. }
  503. }
  504. .menus{
  505. z-index: 101;
  506. margin: 0rpx 30rpx 20rpx;
  507. padding: 15rpx;
  508. display: flex;
  509. flex-direction: column;
  510. box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  511. background-color: #fff;
  512. border-radius: 15rpx;
  513. .title-box{
  514. display: flex;
  515. flex-direction: row;
  516. align-items: center;
  517. justify-content: flex-start;
  518. .title{
  519. font-size: 32upx;
  520. font-family: PingFang SC;
  521. font-weight: bold;
  522. color: #111111;
  523. }
  524. .line{
  525. margin-right: 15rpx;
  526. height: 30rpx;
  527. width: 6rpx;
  528. background-color: #C39A58;
  529. }
  530. }
  531. .menu-box{
  532. display: flex;
  533. align-items: center;
  534. justify-content: flex-start;
  535. flex-wrap: wrap;
  536. .menu{
  537. padding: 15rpx;
  538. width:25%;
  539. min-width: 25%;
  540. display: flex;
  541. flex-direction: column;
  542. align-items: center;
  543. justify-content: center;
  544. position: relative;
  545. image{
  546. width:58rpx;
  547. height:58rpx;
  548. }
  549. .min-image{
  550. width:40rpx;
  551. height:40rpx;
  552. }
  553. .title{
  554. margin-top: 10rpx;
  555. font-size: 24upx;
  556. font-family: PingFang SC;
  557. font-weight: 500;
  558. color: #111111;
  559. }
  560. .contact-btn {
  561. position: absolute;
  562. width:80rpx;
  563. height:80rpx;
  564. display: flex;
  565. opacity: 0;
  566. }
  567. }
  568. }
  569. }
  570. .btn-box{
  571. margin: 30rpx;
  572. display: flex;
  573. align-items: center;
  574. justify-content: center;
  575. .sub-btn{
  576. // box-shadow: 0px 0px 5px 2px rgba(0,0,0,0.05);
  577. border: 1rpx solid #f8f8f8;
  578. background: #FFFFFF;
  579. width: 100%;
  580. height: 88upx;
  581. line-height: 88upx;
  582. text-align: center;
  583. font-size: 30upx;
  584. font-family: PingFang SC;
  585. color: #111;
  586. }
  587. }
  588. }
  589. }
  590. }
  591. .tip{
  592. margin: 30rpx 0rpx;
  593. display: flex;
  594. flex-direction: column;
  595. align-items: center;
  596. justify-content: center;
  597. .title{
  598. font-size: 24rpx;
  599. color: #b5b5b5;
  600. font-weight: bold;
  601. }
  602. .tel{
  603. margin-top: 15rpx;
  604. font-size: 24rpx;
  605. color: #b5b5b5;
  606. }
  607. }
  608. .wxAuth{
  609. border-radius: 30rpx;
  610. width: 100%;
  611. padding: 15rpx;
  612. display: flex;
  613. flex-direction: column;
  614. align-items: center;
  615. justify-content: center;
  616. background-color: #FFFFFF;
  617. .title{
  618. font-size: 32rpx;
  619. margin: 10rpx 0rpx;
  620. font-weight: bold;
  621. text-align: center;
  622. }
  623. .wx-box{
  624. width: 100%;
  625. padding: 0rpx 30rpx;
  626. }
  627. }
  628. </style>