index.vue 33 KB

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