index.vue 33 KB

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