index.vue 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350
  1. <template>
  2. <scroll-view @scrolltolower="scrollTolower" :scroll-top="userScrollTop" scroll-y="true" class="container"
  3. @scroll="userScroll">
  4. <view class="top-cont">
  5. <view :class="fixedTop?'inner fixed':'inner'">
  6. <!-- 状态栏 -->
  7. <view :class="fixedTop?'status-bar es-bc-theme':'status-bar'" :style="{ background:headerBG }"></view>
  8. <view class="top-title-box show" :style="{ background:headerBG }">
  9. <!-- <view>个人中心</view> -->
  10. </view>
  11. </view>
  12. <view class="my-header-right inner fixed" style="justify-content: space-between;">
  13. <image style="margin-right: 10px;" src="@/static/image/home1/scancode_black.png" mode="aspectFill"
  14. @tap="handleScan()"></image>
  15. <view style="display: flex; align-items: center;">
  16. <image src="@/static/image/my/set_icon.png" mode="aspectFill" @tap="navTo('./about')"></image>
  17. <image :class="isNew ? 'badge':''" @tap="goToMsg()" src="@/static/image/hall/new_hall_icon.png"
  18. mode="aspectFill"></image>
  19. </view>
  20. </view>
  21. <!-- 用于顶部固定定位后占位 -->
  22. <view :class="fixedTop?'seat show':'seat'"></view>
  23. <view class="mybox">
  24. <view class="mybox-info">
  25. <image class="heads es-br-ban" @tap="navToUserInfo('./userInfo')"
  26. :src="!$isEmpty(user.avatar)?user.avatar:defUser.avatar" mode="aspectFill"></image>
  27. <view>
  28. <view class="flex-center" @tap="navToUserInfo('./userInfo')">
  29. <text class="mybox-info-name">{{ isLogin&&user&&user.nickName || '请登录' }}</text>
  30. <image class="arrow_black" src="@/static/image/my/right_arrow_black_icon.png"
  31. mode="aspectFill"></image>
  32. </view>
  33. <view class="flex-center" style="margin-top: 22rpx;">
  34. <view class="flex-center vipbox es-mr-10" v-if="user.isVip==1&&(!$isIos())"
  35. @click="loginNavTo('/pages/course/vipBuy')">
  36. <image class="arrow_black" src="@/static/image/my/lv_icon.png" mode="aspectFill">
  37. </image>
  38. <text>会员</text>
  39. </view>
  40. <view class="" v-if="user.userId">
  41. 企业号:{{user.userId}}
  42. </view>
  43. <!-- <view class="flex-center vipbox" style="margin-left: 16rpx;">
  44. <image class="arrow_black" src="@/static/image/my/lv_icon.png" mode="aspectFill"></image>
  45. <text>LV.{{user.vipLevel}}</text>
  46. </view> -->
  47. </view>
  48. </view>
  49. </view>
  50. <!-- 健康币,币,券信息 -->
  51. <view class="mybox-integral" v-if="!this.userIsDel()">
  52. <view class="mybox-integral-item" @click="loginNavTo('/pages/user/wallet/index')">
  53. <view class="num">{{ this.userIsDel()?0:user.mayWithdraw}}</view>
  54. <view>钱包</view>
  55. </view>
  56. <view class="mybox-integral-item" @click="loginNavTo('/pages/user/integral/points')">
  57. <view class="num">{{ this.userIsDel()?0:user.integral}}</view>
  58. <view>健康币</view>
  59. </view>
  60. <view class="mybox-integral-item" @click="loginNavTo('/pages/user/coupon/myCouponList?type=0')">
  61. <view class="num">{{ this.userIsDel()?0:coupons.notUsedCount}}</view>
  62. <view>待用券</view>
  63. </view>
  64. <view class="mybox-integral-item" @click="loginNavTo('/pages/user/coupon/myCouponList?type=1')">
  65. <view class="num">{{ this.userIsDel()?0:coupons.usedCount}}</view>
  66. <view>已用券</view>
  67. </view>
  68. <view class="mybox-integral-item" @click="loginNavTo('/pages/user/coupon/myCouponList?type=2')">
  69. <view class="num">{{ this.userIsDel()?0:coupons.expiredCount}}</view>
  70. <view>过期券</view>
  71. </view>
  72. </view>
  73. <!-- vip会员 -->
  74. <!-- <view class="vip-card" v-if="user.userId&&(!$isIos())&&!this.userIsDel() ">
  75. <view>
  76. <view class="flex-center vip-card-info">
  77. <image src="@/static/image/my/VIP_member.png" mode="aspectFill"></image>
  78. <text>{{getDayMix(user.vipEndDate)}}</text>
  79. </view>
  80. <view class="flex-center vip-card-price">续费享季卡会员约<text>6.5</text>折</view>
  81. </view>
  82. <view class="buyvip" @click="loginNavTo('/pages/course/vipBuy')" >立即续费</view>
  83. </view> -->
  84. <!-- <view style="height: 172rpx;margin-top: 28rpx;width: 100%;" v-if="user.userId&&!this.userIsDel()" @click="loginNavTo('/pages/user/integral/integralGoodsList')">
  85. <image style="width: 100%;height: 100%;" src="@/static/images/ad/2.png" mode="aspectFill"></image>
  86. </view> -->
  87. <view class="activity-area">
  88. <view class="activity-item vip-bg" @click="loginNavTo('/pages/course/vipBuy')">
  89. <view class="title-row">
  90. <image style="width: 160rpx;" src="/static/image/my/vip_img.png" mode="widthFix"></image>
  91. <view class="desc">续费享约<text class="highlight">6.5</text>折</view>
  92. </view>
  93. <view class="action-btn">立即续费</view>
  94. </view>
  95. <view class="activity-item coin-bg" @click="loginNavTo('/pages/user/integral/integralGoodsList')">
  96. <view class="title-row">
  97. <image style="width: 178rpx;" src="/static/image/my/fanghua_icon.png" mode="widthFix">
  98. </image>
  99. <view class="desc"><text class="highlight">0</text>元好物任性换</view>
  100. </view>
  101. <view class="action-btn">立即兑换</view>
  102. </view>
  103. </view>
  104. <!-- 我的订单 医疗服务等 -->
  105. <view class="mybox-menu" v-for="(item, index) in menuList" :key="index" v-show="item.showMenu">
  106. <view class="mybox-menu-title">{{item.menuTitle}}</view>
  107. <view class="mybox-menu-box">
  108. <view class="mybox-menu-item" v-for="(menu, idx) in item.menus" :key="idx" v-show="menu.isShow"
  109. @click="handleMenu(menu)">
  110. <image :src="menu.icon" mode="aspectFill"></image>
  111. <text>{{menu.name}}</text>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. <view class="btns" v-if="isLogin">
  117. <view class="login-btn" @click="showLogout">退出登录</view>
  118. </view>
  119. <u-modal :show="showCustomModal" title="系统提醒" content="当前账户已注销部分功能禁用,医疗行业受法律监管用户问诊订单/病历等数据必须保留15年以上不可删除"
  120. :show-cancel-button="false" confirm-text="确定" @confirm="showCustomModal = false">
  121. </u-modal>
  122. </view>
  123. </scroll-view>
  124. </template>
  125. <script>
  126. import {
  127. getIOSPayStatus
  128. } from '@/api/common.js';
  129. import {
  130. startDrugReport,
  131. getUserFollowDoctor
  132. } from '@/api/drugReport';
  133. import {
  134. getUserInfo,
  135. getMyCouponCount
  136. } from '@/api/user'
  137. // #ifdef APP-PLUS
  138. import permision1 from "@/utils/permission.js"
  139. // #endif
  140. const avatar = "/static/image/hall/my_heads_icon.png";
  141. import IMSDK, {
  142. SessionType
  143. } from "openim-uniapp-polyfill";
  144. import {
  145. navigateToDesignatedConversation,
  146. callingModule,
  147. meetingModule,
  148. setConversation
  149. } from "@/pages_im/util/imCommon";
  150. import {
  151. Igexin
  152. } from '@/pages_im/util/common.js';
  153. import {
  154. isIos
  155. } from '../../utils/common';
  156. export default {
  157. data() {
  158. return {
  159. isLogin: false,
  160. coupons: {
  161. expiredCount: 0,
  162. notUsedCount: 0,
  163. usedCount: 0
  164. },
  165. show: false,
  166. defUser: {
  167. avatar: avatar,
  168. nickName: "请登录",
  169. userName: "请登录",
  170. phone: "",
  171. integral: 0,
  172. balance: 0
  173. },
  174. user: {
  175. avatar: "/static/image/hall/my_heads_icon.png",
  176. userName: "",
  177. phone: "",
  178. nickName: "",
  179. integral: 0,
  180. balance: 0,
  181. userId: null,
  182. isDel: 0,
  183. status: 1
  184. },
  185. isNew: false,
  186. top: 0,
  187. userScrollTop: 0,
  188. fixedTop: false, // 是否固定头部
  189. statusBarHeight: uni.getStorageSync('statusBarHeight'),
  190. menuList: [],
  191. isIos: false,
  192. showIOSPay: 0,
  193. showManageCts: false,
  194. showCustomModal: false,
  195. showRemove: false,
  196. hasOpenCustomBox: false,
  197. registrationID: ''
  198. }
  199. },
  200. onLoad() {
  201. let that = this;
  202. uni.$on('refreshUserInfo', function() {
  203. if (that.$isLogin()) {
  204. that.$updateMsgDot()
  205. } else {
  206. that.isLogin = that.$isLogin()
  207. }
  208. });
  209. uni.$on('loginOut', function() {
  210. if (that.$isLogin()) {
  211. that.logout();
  212. }
  213. });
  214. if (!this.$qconfig.isAppStore) { //应用市场版本隐藏健康币商城
  215. let integralMenus = (this.menuList[2]).menus;
  216. let integralSubMenu = {
  217. name: '健康币商城',
  218. icon: "../../static/image/my/my_points_icon.png",
  219. pageUrl: "/pages/user/integral/integralGoodsList"
  220. };
  221. integralMenus.splice(2, 0, integralSubMenu);
  222. }
  223. // #ifdef APP-PLUS
  224. permision1.checkPush();
  225. // #endif
  226. },
  227. onUnload() {
  228. uni.$off('refreshUserInfo');
  229. },
  230. onShow() {
  231. this.isLogin = this.$isLogin()
  232. let token = uni.getStorageSync('AppToken');
  233. if (this.$isLogin()) {
  234. this.getUserInfo();
  235. this.getMyCouponCount();
  236. this.$updateMsgDot()
  237. } else {
  238. this.user = this.defUser;
  239. uni.navigateTo({
  240. url: '/pages/auth/loginIndex'
  241. })
  242. return;
  243. }
  244. // #ifdef APP-PLUS
  245. this.isIos = (plus.os.name == "iOS")
  246. //if(this.$isIos()) {
  247. this.getIOSPayStatusFun();
  248. //}
  249. // #endif
  250. },
  251. created() {
  252. this.initMenu();
  253. },
  254. methods: {
  255. initMenu() {
  256. this.menuList = [{
  257. menuTitle: "我的订单",
  258. showMenu: true,
  259. menus: [
  260. {
  261. name: '待付款',
  262. icon: "../../static/image/my/obligation_icon.png",
  263. pageUrl: "/pages/user/integral/integralOrderList?status=0",
  264. isShow: true
  265. },
  266. {
  267. name: '待发货',
  268. icon: "../../static/image/my/pending_shipment_icon.png",
  269. pageUrl: "/pages/user/integral/integralOrderList?status=0",
  270. isShow: true
  271. },
  272. {
  273. name: '待收货',
  274. icon: "../../static/image/my/dai_shouhuo_icon.png",
  275. pageUrl: "/pages/user/integral/integralOrderList?status=0",
  276. isShow: true
  277. },
  278. {
  279. name: '已完成',
  280. icon: "../../static/image/my/completed_icon.png",
  281. pageUrl: "/pages/user/integral/integralOrderList?status=0",
  282. isShow: true
  283. },
  284. {
  285. name: '售后/退款',
  286. icon: "../../static/image/my/after_sales_icon.png",
  287. pageUrl: "/pages/user/integral/integralOrderList?status=0",
  288. isShow: true
  289. },
  290. // {
  291. // name: '中奖记录',
  292. // icon: "../../static/image/my/my_order_icon.png",
  293. // pageUrl: "/pages/courseAnswer/winningRecord",
  294. // isShow: true
  295. // },
  296. // {
  297. // name: '直播订单',
  298. // icon: "../../static/image/my/my_cforder_icon.png",
  299. // pageUrl: "/pages_live/shopping/order",
  300. // isShow: true
  301. // },
  302. // {
  303. // name: '直播售后',
  304. // icon: "../../static/image/my/my_cforder_icon.png",
  305. // pageUrl: "/pages_live/shopping/storeOrderRefundList",
  306. // isShow: true
  307. // },
  308. ]
  309. }, {
  310. menuTitle: "问诊订单",
  311. showMenu: true,
  312. menus: [{
  313. name: '问诊订单',
  314. icon: "../../static/image/my/my_order_icon.png",
  315. pageUrl: "/pages/store/inquiryOrderList",
  316. isShow: true
  317. }, {
  318. name: '处方订单',
  319. icon: "../../static/image/my/my_cforder_icon.png",
  320. pageUrl: "/pages/store/storeOrderList",
  321. isShow: true
  322. }, {
  323. name: '健康疗法',
  324. icon: "../../static/image/my/my_health_therapy_icon.png",
  325. pageUrl: "/pages/store/packageOrderList",
  326. isShow: true
  327. }, {
  328. name: '售后服务',
  329. icon: "../../static/image/my/my_service_icon.png",
  330. pageUrl: "/pages/store/storeOrderRefundList",
  331. isShow: true
  332. }
  333. // , {
  334. // name: '健康币订单',
  335. // icon: "../../static/image/my/my_cforder_icon.png",
  336. // pageUrl: "/pages/user/integral/integralOrderList",
  337. // isShow: true
  338. // },
  339. // {
  340. // name: '中奖记录',
  341. // icon: "../../static/image/my/my_order_icon.png",
  342. // pageUrl: "/pages/courseAnswer/winningRecord",
  343. // isShow: true
  344. // },
  345. // {
  346. // name: '直播订单',
  347. // icon: "../../static/image/my/my_cforder_icon.png",
  348. // pageUrl: "/pages_live/shopping/order",
  349. // isShow: true
  350. // },
  351. // {
  352. // name: '直播售后',
  353. // icon: "../../static/image/my/my_cforder_icon.png",
  354. // pageUrl: "/pages_live/shopping/storeOrderRefundList",
  355. // isShow: true
  356. // },
  357. ]
  358. },
  359. {
  360. menuTitle: "医疗服务",
  361. showMenu: true,
  362. menus: [
  363. // {
  364. // name: '血糖血压仪',
  365. // icon: "../../static/image/my/my_points_icon.png",
  366. // pageUrl:"/pages_bluetooth/healthMeter",
  367. // isShow:true
  368. // },
  369. {
  370. name: '我的处方',
  371. icon: "../../static/image/my/my_prescription_icon.png",
  372. pageUrl: "/pages/store/prescribeList",
  373. isShow: true
  374. }, {
  375. name: '我的医生',
  376. icon: "../../static/image/my/my_doctor_icon.png",
  377. pageUrl: "./myDoctorList",
  378. isShow: true
  379. }, {
  380. name: '随访服务',
  381. icon: "../../static/image/my/follow_up_icon.png",
  382. pageUrl: "/pages/user/followList",
  383. isShow: true
  384. }, {
  385. name: '用药咨询',
  386. icon: "../../static/image/my/medical_consultation_icon.png",
  387. pageUrl: "/pages/store/inquiryOrderList",
  388. isIm: true,
  389. isShow: true
  390. }, {
  391. name: '用药报告',
  392. icon: "../../static/image/my/medication_report_icon.png",
  393. pageUrl: "/pages/user/drugReportList",
  394. isShow: true
  395. }
  396. ]
  397. },
  398. {
  399. menuTitle: "我的应用",
  400. showMenu: !this.userIsDel(),
  401. menus: [{
  402. name: '就诊管理',
  403. icon: "../../static/image/my/visit_icon.png",
  404. pageUrl: "./patient",
  405. isShow: true
  406. }, {
  407. name: '地址管理',
  408. icon: "../../static/image/my/address_management_icon.png",
  409. pageUrl: "./address",
  410. isShow: true
  411. }
  412. // , {
  413. // name: '直播',
  414. // icon: "../../static/image/my/live.png",
  415. // pageUrl: "/pages_live/livingList",
  416. // isShow: true
  417. // }
  418. //
  419. ,{
  420. name: '积分商城',
  421. icon: "../../static/image/my/my_points_icon.png",
  422. pageUrl:"/pages/user/integral/integralGoodsList",
  423. isShow: true,
  424. }
  425. , {
  426. name: '客服中心',
  427. icon: "../../static/image/my/service_center_icon.png",
  428. pageUrl: "",
  429. isShow: true,
  430. },{
  431. name: '会员中心',
  432. icon: "../../static/image/my/member_icon.png",
  433. isUserService: true,
  434. pageUrl: "",
  435. isShow: !isIos()
  436. }, {
  437. name: '投诉建议',
  438. icon: "../../static/image/my/complaints_and_suggestions_icon.png",
  439. pageUrl: "/pages/user/feedback",
  440. isShow: true
  441. }
  442. // , {
  443. // name: '舌苔报告',
  444. // icon: "../../static/image/my/shetai.png",
  445. // pageUrl: "/pages/user/tongue/tongueList",
  446. // isShow: !isIos()
  447. // }
  448. // ,{
  449. // name: '健康管家',
  450. // icon: "../../static/image/my/my_doctor_icon.png",
  451. // pageUrl: "/pages/user/addHealthButler"
  452. // }
  453. // , {
  454. // name: '看课通知',
  455. // icon: "../../static/image/my/my_order_icon.png",
  456. // pageUrl: "/pages/courseAnswer/list",
  457. // isShow: true
  458. // }
  459. , {
  460. name: '领券中心',
  461. icon: "../../static/image/my/coupon_collection.png",
  462. pageUrl: "/pages/company/couponList?couponType=6",
  463. isShow: true
  464. },
  465. // {
  466. // name: '健康档案',
  467. // icon: "../../static/image/my/my_order_icon.png",
  468. // pageUrl: "/pages/user/healthRecords/index",
  469. // isShow: true
  470. // },
  471. {
  472. name: '健康周报',
  473. icon: "../../static/image/my/health_report_icon.png",
  474. pageUrl: "/pages_watch/health/healthWeekReport?selectUser=0",
  475. isShow: true
  476. }, {
  477. name: '资质证书',
  478. icon: "../../static/image/my/qualifications_icon.png",
  479. pageUrl: "/pages/user/cert",
  480. isShow: true
  481. }
  482. ]
  483. },
  484. {
  485. menuTitle: "我的视频",
  486. showMenu: !this.userIsDel(),
  487. menus: [{
  488. name: '我的收藏',
  489. icon: "../../static/image/my/collect_icon.png",
  490. pageUrl: "./myFavoriteVideo",
  491. isShow: true
  492. }
  493. ,{
  494. name: '我的评论',
  495. icon: "../../static/image/my/evaluate_icon.png",
  496. pageUrl:"/pages/store/inquiryOrderPingList",
  497. isShow: true
  498. }
  499. ]
  500. },
  501. {
  502. menuTitle: "管理应用",
  503. showMenu: !this.userIsDel(),
  504. menus: [{
  505. name: '医生入驻',
  506. icon: "../../static/image/my/doctor_entrance_icon.png",
  507. pageUrl: "/pages/user/registerDoctor?type=1",
  508. isShow: true
  509. }, {
  510. name: '药师入驻',
  511. icon: "../../static/image/my/pharmacist_entrance_icon.png",
  512. pageUrl: "/pages/user/registerDoctor?type=2",
  513. isShow: true
  514. }, {
  515. name: '达人主页',
  516. icon: "../../static/image/my/drzy_icon.png",
  517. pageUrl: "/pages/expert/index",
  518. isShow: true
  519. }, {
  520. name: '客服登录',
  521. icon: "../../static/image/my/login_icon.png",
  522. isService: true,
  523. pageUrl: "",
  524. isShow: this.manageSaleShow()
  525. }, {
  526. name: '关于我们',
  527. icon: "../../static/image/my/feedback_icon.png",
  528. pageUrl: "./about",
  529. isShow: true
  530. }, {
  531. name: '开票历史',
  532. icon: "../../static/image/my/invoicing_icon.png",
  533. pageUrl: "/pages/store/invoice/invoiceList",
  534. isShow: true
  535. }]
  536. }
  537. ];
  538. },
  539. getIOSPayStatusFun() {
  540. getIOSPayStatus().then(res => {
  541. if (res.code == 200) {
  542. //console.log("qxj getIOSPayStatus res",res);
  543. this.showIOSPay = parseInt(res.iosPayStatus);
  544. this.showManageCts = parseInt(res.showManageCts) || false;
  545. this.showRemove = parseInt(res.showRemove);
  546. uni.setStorageSync("showManageCts", this.showManageCts);
  547. uni.setStorageSync("showIOSPay", this.showIOSPay);
  548. uni.setStorageSync("showRemove", this.showRemove);
  549. this.updateMenuVisibility();
  550. }
  551. })
  552. },
  553. doIM() {
  554. uni.showLoading({
  555. title: "处理中..."
  556. });
  557. getUserFollowDoctor().then(res => {
  558. if (res.code == 200) {
  559. if (res.data != null) {
  560. let data = res.data;
  561. var params = {
  562. followId: data.followId
  563. };
  564. console.log(data);
  565. startDrugReport(params).then(res => {
  566. uni.hideLoading();
  567. var that = this;
  568. var user = JSON.parse(uni.getStorageSync('userInfo'));
  569. var uid = 'U' + user.userId;
  570. var did = 'D' + data.followDoctorId;
  571. var conversationID = `si_${did}_${uid}`;
  572. this.$store.commit("timStore/setOrderId", data.orderId);
  573. this.$store.commit("timStore/setFollowId", data.followId);
  574. this.$store.commit("timStore/setImType", 2);
  575. this.$store.commit("timStore/setConversationID", conversationID);
  576. navigateToDesignatedConversation(did, SessionType.Single, false).then((
  577. res) => {
  578. // setConversation(conversationID,JSON.stringify(ex)).then(() => {
  579. // console.log("qxj setConversation ex:"+JSON.stringify(ex));
  580. // }).catch(() => {});
  581. }).catch(() => uni.$u.toast("操作失败"));
  582. },
  583. rej => {}
  584. );
  585. } else {
  586. uni.hideLoading()
  587. uni.showToast({
  588. icon: 'none',
  589. title: "当前没有药师为您服务",
  590. });
  591. }
  592. } else {
  593. uni.showToast({
  594. icon: 'none',
  595. title: "请求失败",
  596. });
  597. }
  598. },
  599. rej => {}
  600. );
  601. },
  602. toIM() {
  603. if (this.$isLogin()) {
  604. this.doIM();
  605. } else {
  606. this.$showLoginPage();
  607. }
  608. },
  609. toCompany() {
  610. if (this.$isLogin()) {
  611. var token = uni.getStorageSync('CompanyUserToken');
  612. if (token) {
  613. uni.navigateTo({
  614. url: '/pages/company/index'
  615. })
  616. } else {
  617. uni.navigateTo({
  618. url: '/pages/company/login'
  619. })
  620. }
  621. } else {
  622. this.$showLoginPage();
  623. }
  624. },
  625. showLogout() {
  626. //this.show=true;
  627. let that = this;
  628. uni.showActionSheet({
  629. title: "确认退出吗",
  630. itemList: ["确定"],
  631. success: function(res) {
  632. that.logout();
  633. that.isLogin = that.$isLogin()
  634. // uni.navigateTo({
  635. // url: '/pages/auth/loginIndex'
  636. // })
  637. }
  638. });
  639. },
  640. hideLogout() {
  641. this.show = false;
  642. },
  643. logout() {
  644. uni.removeStorageSync('sendCourseQiWeiData')
  645. this.$logout();
  646. this.$clearVideoCacheOnLogout();
  647. let IMUserID = uni.getStorageSync('IMUserID');
  648. IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid()).then(() => {
  649. callingModule?.endCall();
  650. meetingModule?.endCall();
  651. }).catch((err) => console.log(err))
  652. .finally(() => {
  653. Igexin.unbindAlias(IMUserID);
  654. uni.removeStorage({
  655. key: "IMToken"
  656. });
  657. uni.removeStorage({
  658. key: "IMUserID"
  659. });
  660. uni.removeStorage({
  661. key: "IMHasLogin"
  662. });
  663. });
  664. this.user = this.defUser;
  665. this.coupons.expiredCount = 0;
  666. this.coupons.notUsedCount = 0;
  667. this.coupons.usedCount = 0;
  668. },
  669. handleMenu(item) {
  670. if (item.isIm != undefined && item.isIm) {
  671. this.toIM();
  672. } else if (item.isService != undefined && item.isService) {
  673. this.toCompany();
  674. } else if (item.isUserService != undefined && item.isUserService) {
  675. this.loginNavTo('/pages/course/vipBuy')
  676. } else if (item.isServerCenter != undefined && item.isServerCenter) {
  677. this.gotoMiniProgram("/page_user/service");
  678. } else if (item.name == '客服中心') {
  679. const url = getApp().globalData.kfurl //企业微信客服链接
  680. const corpId = getApp().globalData.corpId //企业id
  681. this.openCustomerServiceChat(url, corpId)
  682. } else {
  683. this.loginNavTo(item.pageUrl)
  684. }
  685. },
  686. navTo(url) {
  687. console.log("qxj url", url);
  688. uni.navigateTo({
  689. url: url
  690. });
  691. },
  692. loginNavTo(url) {
  693. if (!this.$isLogin()) {
  694. this.$showLoginPage();
  695. return;
  696. }
  697. uni.navigateTo({
  698. url: url
  699. });
  700. },
  701. navToUserInfo(url) {
  702. if (!this.$isLogin()) {
  703. this.$showLoginPage();
  704. return;
  705. }
  706. uni.navigateTo({
  707. url: "./userInfo?userId=" + this.user.userId
  708. });
  709. },
  710. navToServerCenter() {
  711. if (!this.$isLogin()) {
  712. this.$showLoginPage();
  713. return;
  714. }
  715. },
  716. getUserInfo() {
  717. let that = this;
  718. getUserInfo().then(res => {
  719. if (res.code == 200) {
  720. if (res.user != null) {
  721. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  722. this.user = res.user;
  723. this.registrationID = uni.getStorageSync("registrationID");
  724. if (!this.user.jpushId || this.registrationID != this.user.jpushId) {
  725. uni.setStorageSync("registrationID", "");
  726. this.$getRegistrationID('update');
  727. }
  728. if (this.userIsDel() && !this.hasOpenCustomBox) {
  729. this.initMenu();
  730. this.showCustomModal = true;
  731. this.hasOpenCustomBox = true;
  732. }
  733. } else {
  734. uni.showToast({
  735. icon: 'none',
  736. title: res.msg,
  737. });
  738. }
  739. }
  740. },
  741. rej => {}
  742. );
  743. },
  744. getMyCouponCount() {
  745. let that = this;
  746. getMyCouponCount().then(res => {
  747. if (res.code == 200) {
  748. this.coupons = res.data;
  749. }
  750. },
  751. rej => {}
  752. );
  753. },
  754. getUserNickName() {
  755. let nickName = "";
  756. if (!this.$isLogin()) { //已登录
  757. nickName = "请登录";
  758. return nickName;
  759. }
  760. nickName = this.$isEmpty(this.user.nickName) ? "请登录" : this.user.nickName;
  761. return nickName;
  762. },
  763. userScroll(e) {
  764. if (e.detail.scrollTop >= 50) {
  765. this.fixedTop = true
  766. } else {
  767. this.fixedTop = false
  768. }
  769. this.top = e.detail.scrollTop;
  770. },
  771. scrollTolower() {
  772. },
  773. getDayMix(vipEndDate) {
  774. // 假设 vipEndDate 字符串
  775. //let vipEndDate = "2024-09-06T14:43:36.000+0800";
  776. // 将 vipEndDate 解析为日期对象
  777. let endDate = new Date(vipEndDate);
  778. // 获取当前日期
  779. let currentDate = new Date();
  780. // 计算时间差(毫秒)
  781. let timeDiff = endDate - currentDate;
  782. // 计算天数差
  783. let dayDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
  784. let dayStr = "";
  785. // 输出结果
  786. if (dayDiff > 0) {
  787. dayStr = `VIP到期还有${dayDiff}天`;
  788. } else if (dayDiff === 0) {
  789. dayStr = "今天是VIP到期日";
  790. } else {
  791. dayStr = `VIP已过期${Math.abs(dayDiff)}天`;
  792. }
  793. return dayStr;
  794. },
  795. goToMsg() {
  796. uni.switchTab({
  797. url: '/pages_im/pages/conversation/conversationList/index'
  798. });
  799. },
  800. async openCustomerServiceChat(url, corpId) {
  801. // #ifdef H5
  802. window.location.href = url
  803. // #endif
  804. // #ifdef MP-WEIXIN
  805. wx.openCustomerServiceChat({
  806. extInfo: {
  807. url
  808. },
  809. corpId,
  810. success(res) {
  811. console.log('成功');
  812. },
  813. fail(err) {
  814. console.log(err, '报错');
  815. }
  816. })
  817. // #endif
  818. // #ifdef APP-PLUS
  819. let shares = await this.getAppShare().catch(err => {
  820. throw Error(err)
  821. });
  822. shares['weixin'].openCustomerServiceChat({
  823. corpid: corpId,
  824. url
  825. }, suc => {
  826. console.log("客服打开成功", JSON.stringify(res))
  827. }, err => {
  828. console.log("error", JSON.stringify(err))
  829. })
  830. // #endif
  831. },
  832. getAppShare() {
  833. // #ifdef APP-PLUS
  834. return new Promise((re, rj) => {
  835. let shares = null;
  836. var pusher = plus.share.getServices(function(s) {
  837. shares = {};
  838. s.forEach(e => shares[e.id] = e);
  839. re(shares)
  840. }, function(e) {
  841. rj(e);
  842. });
  843. });
  844. // #endif
  845. },
  846. gotoMiniProgram(pageUrl) {
  847. plus.share.getServices(function(res) {
  848. var sweixin = null;
  849. for (var i = 0; i < res.length; i++) {
  850. var t = res[i];
  851. if (t.id == 'weixin') {
  852. sweixin = t;
  853. }
  854. }
  855. if (sweixin) {
  856. //唤起微信跳转小程序
  857. sweixin.launchMiniProgram({
  858. id: "gh_feb7753a310b", //gh_7a6a32e5ef61 御君方互医
  859. path: pageUrl,
  860. type: 0
  861. }, function() {
  862. console.log("微信唤起成功");
  863. return true;
  864. }, function(e) {
  865. console.log("微信唤起失败", e);
  866. uni.showToast({
  867. title: '微信唤起失败,请检查是否有微信应用',
  868. icon: 'none'
  869. })
  870. return false;
  871. })
  872. } else {
  873. uni.showToast({
  874. title: '微信唤起失败,请检查是否有微信应用',
  875. icon: 'none',
  876. duration: 3000
  877. })
  878. return false;
  879. }
  880. }, function(res) {
  881. });
  882. },
  883. userIsDel() {
  884. return this.user.status == 0;
  885. },
  886. updateMenuVisibility() {
  887. // 找到管理应用菜单
  888. const manageAppMenu = this.menuList.find(menu => menu.menuTitle === "管理应用");
  889. if (manageAppMenu) {
  890. // 找到客服登录菜单项
  891. const customerServiceItem = manageAppMenu.menus.find(item => item.name === "客服登录");
  892. if (customerServiceItem) {
  893. // 根据showManageCts设置显示状态
  894. customerServiceItem.isShow = this.manageSaleShow();
  895. }
  896. }
  897. },
  898. manageSaleShow() {
  899. return true;
  900. //return (!isIos() || (isIos() && this.showManageCts));
  901. },
  902. handleScan() {
  903. console.log("qxj handleScan");
  904. this.navTo('/pages_watch/healthMonitoring/scanCode?typeFun=getScanCodeInfo');
  905. }
  906. },
  907. computed: {
  908. // 计算属性的 getter
  909. headerBG: function() {
  910. var top = this.top / 88;
  911. return 'rgba(253,224,204, ' + top + ')';
  912. },
  913. }
  914. }
  915. </script>
  916. <style scoped lang="scss">
  917. page {
  918. height: 100%;
  919. background: #f7f7f7;
  920. }
  921. .top-cont {
  922. // height: 370rpx;
  923. position: relative;
  924. &::after {
  925. content: '';
  926. width: 100%;
  927. height: 370rpx;
  928. position: absolute;
  929. z-index: -1;
  930. left: 0;
  931. top: 0;
  932. border-radius: 0 0 50rpx 50rpx;
  933. }
  934. .inner.fixed {
  935. width: 100%;
  936. position: fixed;
  937. top: 0;
  938. left: 0;
  939. z-index: 999;
  940. }
  941. .seat {
  942. display: none;
  943. height: var(--status-bar-height);
  944. &.show {
  945. display: block;
  946. }
  947. }
  948. .status-bar {
  949. background-color:#CDE6FE;
  950. height: var(--status-bar-height);
  951. }
  952. .status-bar.main-bg {
  953. background-color: #fff;
  954. }
  955. .top-title-box {
  956. height: 88rpx;
  957. line-height: 88rpx;
  958. text-align: center;
  959. background-color: #fff;
  960. font-size: 18px;
  961. color: #333;
  962. font-weight: 550;
  963. display: none;
  964. &.show {
  965. display: block;
  966. }
  967. }
  968. }
  969. .top-section {
  970. .bg-img {
  971. position: fixed;
  972. width: 100%;
  973. top: 0;
  974. left: 0;
  975. right: 0;
  976. height: 524rpx;
  977. z-index: 0;
  978. }
  979. }
  980. @mixin u-flex($flexD, $alignI, $justifyC) {
  981. display: flex;
  982. flex-direction: $flexD;
  983. align-items: $alignI;
  984. justify-content: $justifyC;
  985. }
  986. .flex-center {
  987. @include u-flex(row, center, flex-start);
  988. }
  989. .container {
  990. background-image: url("@/static/image/hall/purple_mine_top_bg.png");
  991. background-repeat: no-repeat;
  992. background-size: 100%;
  993. font-family: PingFang SC, PingFang SC;
  994. // padding-top: var(--status-bar-height);
  995. padding-bottom: 20rpx;
  996. height: 100%;
  997. }
  998. .my-header-right {
  999. height: 88rpx;
  1000. padding-right: 28rpx;
  1001. margin-top: var(--status-bar-height);
  1002. @include u-flex(row, center, flex-end);
  1003. image {
  1004. margin-left: 32rpx;
  1005. width: 48rpx;
  1006. height: 48rpx;
  1007. position: relative;
  1008. }
  1009. .badge::after {
  1010. content: "";
  1011. width: 16rpx;
  1012. height: 16rpx;
  1013. background: #2583EB;
  1014. border-radius: 50%;
  1015. position: absolute;
  1016. right: 0;
  1017. top: 0;
  1018. }
  1019. }
  1020. .mybox {
  1021. padding: 12rpx 24rpx;
  1022. &-info {
  1023. @include u-flex(row, center, flex-start);
  1024. &-name {
  1025. font-weight: 600;
  1026. font-size: 40rpx;
  1027. color: #222222;
  1028. }
  1029. .heads {
  1030. width: 128rpx;
  1031. height: 128rpx;
  1032. border-radius: 50%;
  1033. margin-right: 16rpx;
  1034. }
  1035. .arrow_black {
  1036. width: 48rpx;
  1037. height: 48rpx;
  1038. }
  1039. .vipbox {
  1040. background: linear-gradient(90deg, #F26F00 0%, #FF9D1F 100%);
  1041. border-radius: 20rpx 20rpx 20rpx 20rpx;
  1042. border: 1rpx solid #FEDDB9;
  1043. font-weight: 500;
  1044. font-size: 22rpx;
  1045. color: #FEF5EA;
  1046. padding: 0 22rpx 0 12rpx;
  1047. }
  1048. }
  1049. &-integral {
  1050. margin-top: 48rpx;
  1051. @include u-flex(row, center, flex-start);
  1052. &-item {
  1053. width: 25%;
  1054. text-align: center;
  1055. font-weight: 400;
  1056. font-size: 24rpx;
  1057. color: #757575;
  1058. }
  1059. .num {
  1060. margin-bottom: 12rpx;
  1061. font-family: DIN, DIN;
  1062. font-weight: 500;
  1063. font-size: 40rpx;
  1064. color: #313131;
  1065. }
  1066. }
  1067. &-menu {
  1068. background: #FFFFFF;
  1069. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1070. padding: 32rpx 32rpx 36rpx 32rpx;
  1071. margin: 20rpx 0;
  1072. &-title {
  1073. font-weight: 600;
  1074. font-size: 36rpx;
  1075. color: #222222;
  1076. margin-bottom: 42rpx;
  1077. }
  1078. &-box {
  1079. @include u-flex(row, center, flex-start);
  1080. margin-bottom: -40rpx;
  1081. flex-wrap: wrap;
  1082. }
  1083. &-item {
  1084. width: 25%;
  1085. margin-bottom: 40rpx;
  1086. @include u-flex(column, center, center);
  1087. font-weight: 400;
  1088. font-size: 24rpx;
  1089. color: #222222;
  1090. image {
  1091. height: 48rpx;
  1092. width: 48rpx;
  1093. margin-bottom: 10rpx;
  1094. }
  1095. }
  1096. }
  1097. }
  1098. .vip-card {
  1099. height: 172rpx;
  1100. margin-top: 28rpx;
  1101. background: url("@/static/image/my/vip_bg_left.png") no-repeat left / 128rpx 172rpx,
  1102. url("@/static/image/my/vip_bg_right.png") no-repeat right / 324rpx 172rpx,
  1103. linear-gradient(90deg, #FFF3DF 0%, #FADBA9 100%);
  1104. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1105. padding: 0 32rpx;
  1106. box-sizing: border-box;
  1107. @include u-flex(row, center, space-between);
  1108. &-info {
  1109. font-weight: 400;
  1110. font-size: 24rpx;
  1111. color: #834F00;
  1112. margin-bottom: 26rpx;
  1113. image {
  1114. width: 126rpx;
  1115. height: 30rpx;
  1116. margin-right: 34rpx;
  1117. }
  1118. }
  1119. &-price {
  1120. font-weight: 500;
  1121. font-size: 32rpx;
  1122. color: #885201;
  1123. line-height: 38rpx;
  1124. text {
  1125. font-family: Roboto, Roboto;
  1126. font-weight: bold;
  1127. font-size: 40rpx;
  1128. color: #EA8F07;
  1129. margin: 0 8rpx;
  1130. }
  1131. }
  1132. .buyvip {
  1133. height: 72rpx;
  1134. background: #885201;
  1135. border-radius: 36rpx 36rpx 36rpx 36rpx;
  1136. font-weight: 600;
  1137. font-size: 28rpx;
  1138. color: #FFF6E7;
  1139. line-height: 72rpx;
  1140. padding: 0 32rpx;
  1141. display: inline-block;
  1142. }
  1143. }
  1144. .vip-card {
  1145. height: 172rpx;
  1146. margin-top: 28rpx;
  1147. background: url("@/static/image/my/vip_bg_left.png") no-repeat left / 128rpx 172rpx,
  1148. url("@/static/image/my/vip_bg_right.png") no-repeat right / 324rpx 172rpx,
  1149. linear-gradient(90deg, #FFF3DF 0%, #FADBA9 100%);
  1150. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1151. padding: 0 32rpx;
  1152. box-sizing: border-box;
  1153. @include u-flex(row, center, space-between);
  1154. &-info {
  1155. font-weight: 400;
  1156. font-size: 24rpx;
  1157. color: #834F00;
  1158. margin-bottom: 26rpx;
  1159. image {
  1160. width: 126rpx;
  1161. height: 30rpx;
  1162. margin-right: 34rpx;
  1163. }
  1164. }
  1165. &-price {
  1166. font-weight: 500;
  1167. font-size: 32rpx;
  1168. color: #885201;
  1169. line-height: 38rpx;
  1170. text {
  1171. font-family: Roboto, Roboto;
  1172. font-weight: bold;
  1173. font-size: 40rpx;
  1174. color: #EA8F07;
  1175. margin: 0 8rpx;
  1176. }
  1177. }
  1178. .buyvip {
  1179. height: 72rpx;
  1180. background: #885201;
  1181. border-radius: 36rpx 36rpx 36rpx 36rpx;
  1182. font-weight: 600;
  1183. font-size: 28rpx;
  1184. color: #FFF6E7;
  1185. line-height: 72rpx;
  1186. padding: 0 32rpx;
  1187. display: inline-block;
  1188. }
  1189. }
  1190. .btns {
  1191. height: 110rpx;
  1192. }
  1193. .login-btn {
  1194. display: flex;
  1195. align-items: center;
  1196. justify-content: center;
  1197. flex: 1;
  1198. margin: 0 30rpx;
  1199. height: 80rpx;
  1200. background: #fff;
  1201. // box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
  1202. border-radius: 40rpx;
  1203. font-size: 30rpx;
  1204. font-family: PingFang SC;
  1205. font-weight: 500;
  1206. color: #333;
  1207. }
  1208. .activity-area {
  1209. display: flex;
  1210. justify-content: space-between;
  1211. margin-top: 20rpx;
  1212. }
  1213. .activity-item {
  1214. width: 48.5%;
  1215. height: 160rpx;
  1216. border-radius: 16rpx;
  1217. padding: 12rpx;
  1218. box-sizing: border-box;
  1219. position: relative;
  1220. display: flex;
  1221. align-items: center;
  1222. overflow: hidden;
  1223. }
  1224. .vip-bg {
  1225. background-image: url('/static/image/my/vip_bg.png');
  1226. background-repeat: no-repeat;
  1227. background-size: 100% 100%;
  1228. }
  1229. .coin-bg {
  1230. background-image: url('/static/image/my/fanghua_icon_bg.png');
  1231. background-repeat: no-repeat;
  1232. background-size: 100% 100%;
  1233. }
  1234. .desc {
  1235. font-family: PingFang SC, PingFang SC;
  1236. font-weight: 400;
  1237. font-size: 20rpx;
  1238. color: #995316;
  1239. .highlight {
  1240. font-family: Roboto, Roboto;
  1241. font-weight: bold;
  1242. font-size: 28rpx;
  1243. color: #995316;
  1244. margin: 0 4rpx;
  1245. }
  1246. }
  1247. .action-btn {
  1248. position: absolute;
  1249. right: 12rpx;
  1250. top: 50%;
  1251. transform: translateY(-50%);
  1252. background: #fff;
  1253. font-size: 24rpx;
  1254. padding: 10rpx 20rpx;
  1255. border-radius: 30rpx;
  1256. font-family: PingFang SC, PingFang SC;
  1257. font-weight: 400;
  1258. font-size: 20rpx;
  1259. }
  1260. .vip-bg .action-btn {
  1261. color: #B47000;
  1262. }
  1263. .coin-bg .action-btn {
  1264. color: #DF4E00;
  1265. }
  1266. </style>