index.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241
  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 v-if="!$isIos()" 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" :class="{'activity-item1':$isIos() }" @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. name: '省钱订单',
  285. icon: "../../static/image/my/savemoney_icon.png",
  286. pageUrl:"/pages/points/shopOrder",
  287. isShow:true
  288. }
  289. ]
  290. },
  291. {
  292. menuTitle: "医疗服务",
  293. showMenu:true,
  294. menus: [
  295. // {
  296. // name: '血糖血压仪',
  297. // icon: "../../static/image/my/my_points_icon.png",
  298. // pageUrl:"/pages_bluetooth/healthMeter",
  299. // isShow:true
  300. // },
  301. {
  302. name: '我的处方',
  303. icon: "../../static/image/my/my_prescription_icon.png",
  304. pageUrl:"/pages/store/prescribeList",
  305. isShow:true
  306. },{
  307. name: '我的医生',
  308. icon: "../../static/image/my/my_doctor_icon.png",
  309. pageUrl:"./myDoctorList",
  310. isShow:true
  311. },{
  312. name: '随访服务',
  313. icon: "../../static/image/my/follow_up_icon.png",
  314. pageUrl:"/pages/user/followList",
  315. isShow:true
  316. },{
  317. name: '用药咨询',
  318. icon: "../../static/image/my/medical_consultation_icon.png",
  319. pageUrl:"/pages/store/inquiryOrderList",
  320. isIm:true,
  321. isShow:true
  322. },{
  323. name: '用药报告',
  324. icon: "../../static/image/my/medication_report_icon.png",
  325. pageUrl:"/pages/user/drugReportList",
  326. isShow:true
  327. }
  328. ,{
  329. name: '健康档案',
  330. icon: "../../static/image/my/my_order_icon.png",
  331. pageUrl: "/pages/user/healthRecords/index",
  332. isShow:true
  333. },
  334. {
  335. name: '健康周报',
  336. icon: "../../static/image/my/health_report_icon.png",
  337. pageUrl: "/pages_watch/health/healthWeekReport?selectUser=0",
  338. isShow:true
  339. }
  340. ]
  341. },
  342. {
  343. menuTitle: "我的应用",
  344. showMenu:!this.userIsDel(),
  345. menus: [
  346. {
  347. name: '就诊管理',
  348. icon: "../../static/image/my/visit_icon.png",
  349. pageUrl:"./patient",
  350. isShow:true
  351. }
  352. ,{
  353. name: '地址管理',
  354. icon: "../../static/image/my/address_management_icon.png",
  355. pageUrl:"./address",
  356. isShow:true
  357. },{
  358. name: '领券中心',
  359. icon: "../../static/image/my/coupon_collection.png",
  360. pageUrl:"/pages/company/couponList?couponType=6",
  361. isShow:true
  362. },{
  363. name: '直播',
  364. icon: "../../static/image/my/live.png",
  365. pageUrl:"/pages_live/livingList",
  366. isShow:true
  367. }
  368. // ,{
  369. // name: '芳华币商城',
  370. // icon: "../../static/image/my/my_points_icon.png",
  371. // pageUrl:"/pages/user/integral/integralGoodsList"
  372. // }
  373. ,{
  374. name: '会员中心',
  375. icon: "../../static/image/my/member_icon.png",
  376. isUserService:true,
  377. pageUrl:"",
  378. isShow:!isIos()
  379. }
  380. ,{
  381. name: '舌苔报告',
  382. icon: "../../static/image/my/shetai.png",
  383. pageUrl: "/pages/user/tongue/tongueList",
  384. isShow:!isIos()
  385. }
  386. // ,{
  387. // name: '健康管家',
  388. // icon: "../../static/image/my/my_doctor_icon.png",
  389. // pageUrl: "/pages/user/addHealthButler"
  390. // }
  391. ,{
  392. name: '开票历史',
  393. icon: "../../static/image/my/invoicing_icon.png",
  394. pageUrl:"/pages/store/invoice/invoiceList",
  395. isShow:true
  396. },{
  397. name: '客服中心',
  398. icon: "../../static/image/my/service_center_icon.png",
  399. pageUrl:"",
  400. isShow:true,
  401. },{
  402. name: '看课通知',
  403. icon: "../../static/image/my/my_order_icon.png",
  404. pageUrl: "/pages/courseAnswer/list",
  405. isShow:true
  406. },{
  407. name: '投诉建议',
  408. icon: "../../static/image/my/tsjy.png",
  409. pageUrl: "/pages/user/feedback",
  410. isShow:true
  411. },{
  412. name: '资质证书',
  413. icon: "../../static/image/my/qualifications_icon.png",
  414. pageUrl: "/pages/user/cert",
  415. isShow:true
  416. }
  417. ]
  418. },
  419. {
  420. menuTitle: "我的视频",
  421. showMenu:!this.userIsDel(),
  422. menus: [
  423. {
  424. name: '我的收藏',
  425. icon: "../../static/image/my/collect_icon.png",
  426. pageUrl:"./myFavoriteVideo",
  427. isShow:true
  428. }
  429. // ,{
  430. // name: '我的评论',
  431. // icon: "../../static/image/my/evaluate_icon.png",
  432. // pageUrl:"/pages/store/inquiryOrderPingList"
  433. // }
  434. ]
  435. },
  436. {
  437. menuTitle: "管理应用",
  438. showMenu:!this.userIsDel(),
  439. menus: [
  440. {
  441. name: '医生入驻',
  442. icon: "../../static/image/my/doctor_entrance_icon.png",
  443. pageUrl:"/pages/user/registerDoctor?type=1",
  444. isShow:true
  445. },{
  446. name: '药师入驻',
  447. icon: "../../static/image/my/pharmacist_entrance_icon.png",
  448. pageUrl:"/pages/user/registerDoctor?type=2",
  449. isShow:true
  450. }
  451. ,{
  452. name: '达人主页',
  453. icon: "../../static/image/my/drzy_icon.png",
  454. pageUrl:"/pages/expert/index",
  455. isShow:true
  456. }
  457. ,{
  458. name: '客服登录',
  459. icon: "../../static/image/my/login_icon.png",
  460. isService:true,
  461. pageUrl:"",
  462. isShow:this.manageSaleShow()
  463. },{
  464. name: '关于我们',
  465. icon: "../../static/image/my/feedback_icon.png",
  466. pageUrl:"./about",
  467. isShow:true
  468. }
  469. ]
  470. }
  471. ];
  472. },
  473. getIOSPayStatusFun() {
  474. getIOSPayStatus().then(res=>{
  475. if(res.code == 200) {
  476. //console.log("qxj getIOSPayStatus res",res);
  477. this.showIOSPay = parseInt(res.iosPayStatus);
  478. this.showManageCts=parseInt(res.showManageCts) || false;
  479. this.showRemove=parseInt(res.showRemove);
  480. uni.setStorageSync("showManageCts",this.showManageCts);
  481. uni.setStorageSync("showIOSPay",this.showIOSPay);
  482. uni.setStorageSync("showRemove",this.showRemove);
  483. this.updateMenuVisibility();
  484. }
  485. })
  486. },
  487. doIM(){
  488. uni.showLoading({
  489. title:"处理中..."
  490. });
  491. getUserFollowDoctor().then(res => {
  492. if(res.code==200){
  493. if(res.data!=null){
  494. let data=res.data;
  495. var params={followId:data.followId};
  496. console.log(data);
  497. startDrugReport(params).then(res => {
  498. uni.hideLoading();
  499. var that=this;
  500. var user = JSON.parse(uni.getStorageSync('userInfo'));
  501. var uid = 'U' + user.userId;
  502. var did='D' + data.followDoctorId;
  503. var conversationID=`si_${did}_${uid}`;
  504. this.$store.commit("timStore/setOrderId",data.orderId);
  505. this.$store.commit("timStore/setFollowId",data.followId);
  506. this.$store.commit("timStore/setImType", 2);
  507. this.$store.commit("timStore/setConversationID", conversationID);
  508. navigateToDesignatedConversation(did,SessionType.Single,false).then((res) => {
  509. // setConversation(conversationID,JSON.stringify(ex)).then(() => {
  510. // console.log("qxj setConversation ex:"+JSON.stringify(ex));
  511. // }).catch(() => {});
  512. }).catch(() => uni.$u.toast("操作失败") );
  513. },
  514. rej => {}
  515. );
  516. }
  517. else{
  518. uni.hideLoading()
  519. uni.showToast({
  520. icon:'none',
  521. title: "当前没有药师为您服务",
  522. });
  523. }
  524. }else{
  525. uni.showToast({
  526. icon:'none',
  527. title: "请求失败",
  528. });
  529. }
  530. },
  531. rej => {}
  532. );
  533. },
  534. toIM(){
  535. if(this.$isLogin()){
  536. this.doIM();
  537. }
  538. else{
  539. this.$showLoginPage();
  540. }
  541. },
  542. toCompany(){
  543. if(this.$isLogin()){
  544. var token = uni.getStorageSync('CompanyUserToken');
  545. if (token) {
  546. uni.navigateTo({
  547. url: '/pages/company/index'
  548. })
  549. } else {
  550. uni.navigateTo({
  551. url: '/pages/company/login'
  552. })
  553. }
  554. }else{
  555. this.$showLoginPage();
  556. }
  557. },
  558. showLogout(){
  559. //this.show=true;
  560. let that = this;
  561. uni.showActionSheet({
  562. title:"确认退出吗",
  563. itemList: ["确定"],
  564. success: function(res) {
  565. that.logout();
  566. that.isLogin = that.$isLogin()
  567. // uni.navigateTo({
  568. // url: '/pages/auth/loginIndex'
  569. // })
  570. }
  571. });
  572. },
  573. hideLogout(){
  574. this.show=false;
  575. },
  576. logout(){
  577. uni.removeStorageSync('sendCourseQiWeiData')
  578. this.$logout();
  579. this.$clearVideoCacheOnLogout();
  580. let IMUserID = uni.getStorageSync('IMUserID');
  581. IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid()).then(() => {
  582. callingModule?.endCall();
  583. meetingModule?.endCall();
  584. }).catch((err) => console.log(err))
  585. .finally(() => {
  586. Igexin.unbindAlias(IMUserID);
  587. uni.removeStorage({key: "IMToken"});
  588. uni.removeStorage({key: "IMUserID"});
  589. uni.removeStorage({key: "IMHasLogin"});
  590. });
  591. this.user=this.defUser;
  592. this.coupons.expiredCount=0;
  593. this.coupons.notUsedCount=0;
  594. this.coupons.usedCount=0;
  595. },
  596. handleMenu(item) {
  597. if(item.isIm!=undefined && item.isIm){
  598. this.toIM();
  599. }
  600. else if(item.isService!=undefined && item.isService){
  601. this.toCompany();
  602. }
  603. else if(item.isUserService!=undefined && item.isUserService){
  604. this.loginNavTo('/pages/course/vipBuy')
  605. }
  606. else if(item.isServerCenter!=undefined && item.isServerCenter){
  607. this.gotoMiniProgram("/page_user/service");
  608. } else if(item.name == '客服中心') {
  609. const url = getApp().globalData.kfurl //企业微信客服链接
  610. const corpId = getApp().globalData.corpId //企业id
  611. this.openCustomerServiceChat(url,corpId)
  612. } else{
  613. this.loginNavTo(item.pageUrl)
  614. }
  615. },
  616. navTo(url){
  617. console.log("qxj url",url);
  618. uni.navigateTo({
  619. url: url
  620. });
  621. },
  622. loginNavTo(url){
  623. if(!this.$isLogin()){
  624. this.$showLoginPage();
  625. return;
  626. }
  627. uni.navigateTo({
  628. url: url
  629. });
  630. },
  631. navToUserInfo(url){
  632. if(!this.$isLogin()){
  633. this.$showLoginPage();
  634. return;
  635. }
  636. uni.navigateTo({
  637. url: "./userInfo?userId="+this.user.userId
  638. });
  639. },
  640. navToServerCenter(){
  641. if(!this.$isLogin()){
  642. this.$showLoginPage();
  643. return;
  644. }
  645. },
  646. getUserInfo(){
  647. let that=this;
  648. getUserInfo().then(res => {
  649. if(res.code==200){
  650. if(res.user!=null){
  651. uni.setStorageSync('userInfo',JSON.stringify(res.user));
  652. this.user=res.user;
  653. this.registrationID = uni.getStorageSync("registrationID");
  654. if(!this.user.jpushId || this.registrationID!=this.user.jpushId){
  655. uni.setStorageSync("registrationID","");
  656. this.$getRegistrationID('update');
  657. }
  658. if(this.userIsDel() && !this.hasOpenCustomBox){
  659. this.initMenu();
  660. this.showCustomModal=true;
  661. this.hasOpenCustomBox=true;
  662. }
  663. }
  664. else{
  665. uni.showToast({
  666. icon:'none',
  667. title: res.msg,
  668. });
  669. }
  670. }
  671. },
  672. rej => {}
  673. );
  674. },
  675. getMyCouponCount(){
  676. let that=this;
  677. getMyCouponCount().then(res => {
  678. if(res.code==200){
  679. this.coupons=res.data;
  680. }
  681. },
  682. rej => {}
  683. );
  684. },
  685. getUserNickName(){
  686. let nickName="";
  687. if(!this.$isLogin()){ //已登录
  688. nickName="请登录";
  689. return nickName;
  690. }
  691. nickName=this.$isEmpty(this.user.nickName)?"请登录":this.user.nickName;
  692. return nickName;
  693. },
  694. userScroll(e) {
  695. if(e.detail.scrollTop >= 50) {
  696. this.fixedTop = true
  697. } else {
  698. this.fixedTop = false
  699. }
  700. this.top=e.detail.scrollTop;
  701. },
  702. scrollTolower(){
  703. },
  704. getDayMix(vipEndDate){
  705. // 假设 vipEndDate 字符串
  706. //let vipEndDate = "2024-09-06T14:43:36.000+0800";
  707. // 将 vipEndDate 解析为日期对象
  708. let endDate = new Date(vipEndDate);
  709. // 获取当前日期
  710. let currentDate = new Date();
  711. // 计算时间差(毫秒)
  712. let timeDiff = endDate - currentDate;
  713. // 计算天数差
  714. let dayDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
  715. let dayStr="";
  716. // 输出结果
  717. if (dayDiff > 0) {
  718. dayStr=`VIP到期还有${dayDiff}天`;
  719. } else if (dayDiff === 0) {
  720. dayStr="今天是VIP到期日";
  721. } else {
  722. dayStr=`VIP已过期${Math.abs(dayDiff)}天`;
  723. }
  724. return dayStr;
  725. },
  726. goToMsg(){
  727. uni.switchTab({
  728. url: '/pages_im/pages/conversation/conversationList/index'
  729. });
  730. },
  731. async openCustomerServiceChat(url,corpId) {
  732. // #ifdef H5
  733. window.location.href = url
  734. // #endif
  735. // #ifdef MP-WEIXIN
  736. wx.openCustomerServiceChat({
  737. extInfo: {
  738. url
  739. },
  740. corpId,
  741. success(res) {
  742. console.log('成功');
  743. },
  744. fail(err) {
  745. console.log(err, '报错');
  746. }
  747. })
  748. // #endif
  749. // #ifdef APP-PLUS
  750. let shares = await this.getAppShare().catch(err => {
  751. throw Error(err)
  752. });
  753. shares['weixin'].openCustomerServiceChat({
  754. corpid: corpId,
  755. url
  756. }, suc => {
  757. console.log("客服打开成功", JSON.stringify(res))
  758. }, err => {
  759. console.log("error", JSON.stringify(err))
  760. })
  761. // #endif
  762. },
  763. getAppShare() {
  764. // #ifdef APP-PLUS
  765. return new Promise((re, rj) => {
  766. let shares = null;
  767. var pusher = plus.share.getServices(function(s) {
  768. shares = {};
  769. s.forEach(e => shares[e.id] = e);
  770. re(shares)
  771. }, function(e) {
  772. rj(e);
  773. });
  774. });
  775. // #endif
  776. },
  777. gotoMiniProgram(pageUrl){
  778. plus.share.getServices(function(res){
  779. var sweixin = null;
  780. for(var i=0;i<res.length;i++){
  781. var t = res[i];
  782. if(t.id == 'weixin'){
  783. sweixin = t;
  784. }
  785. }
  786. if(sweixin){
  787. //唤起微信跳转小程序
  788. sweixin.launchMiniProgram({
  789. id:"gh_feb7753a310b",//gh_7a6a32e5ef61 御君方互医
  790. path:pageUrl,
  791. type:0
  792. },function(){
  793. console.log("微信唤起成功");
  794. return true;
  795. },function(e){
  796. console.log("微信唤起失败",e);
  797. uni.showToast({
  798. title:'微信唤起失败,请检查是否有微信应用',
  799. icon:'none'
  800. })
  801. return false;
  802. })
  803. }
  804. else{
  805. uni.showToast({
  806. title:'微信唤起失败,请检查是否有微信应用',
  807. icon:'none',
  808. duration:3000
  809. })
  810. return false;
  811. }
  812. },function(res){
  813. });
  814. },
  815. userIsDel(){
  816. return this.user.status==0;
  817. },
  818. updateMenuVisibility() {
  819. // 找到管理应用菜单
  820. const manageAppMenu = this.menuList.find(menu => menu.menuTitle === "管理应用");
  821. if (manageAppMenu) {
  822. // 找到客服登录菜单项
  823. const customerServiceItem = manageAppMenu.menus.find(item => item.name === "客服登录");
  824. if (customerServiceItem) {
  825. // 根据showManageCts设置显示状态
  826. customerServiceItem.isShow = this.manageSaleShow();
  827. }
  828. }
  829. },
  830. manageSaleShow(){
  831. return true;
  832. //return (!isIos() || (isIos() && this.showManageCts));
  833. },
  834. handleScan(){
  835. console.log("qxj handleScan");
  836. this.navTo('/pages_watch/healthMonitoring/scanCode?typeFun=getScanCodeInfo');
  837. }
  838. },
  839. computed: {
  840. // 计算属性的 getter
  841. headerBG:function() {
  842. var top=this.top/88;
  843. return 'rgba(253,224,204, ' + top + ')';
  844. },
  845. }
  846. }
  847. </script>
  848. <style scoped lang="scss">
  849. page{
  850. height: 100%;
  851. background: #f7f7f7;
  852. }
  853. .top-cont{
  854. // height: 370rpx;
  855. position: relative;
  856. &::after{
  857. content: '';
  858. width: 100%;
  859. height: 370rpx;
  860. position: absolute;
  861. z-index: -1;
  862. left: 0;
  863. top: 0;
  864. border-radius: 0 0 50rpx 50rpx;
  865. }
  866. .inner.fixed{
  867. width: 100%;
  868. position: fixed;
  869. top: 0;
  870. left: 0;
  871. z-index: 999;
  872. }
  873. .seat{
  874. display: none;
  875. height: var(--status-bar-height);
  876. &.show{
  877. display: block;
  878. }
  879. }
  880. .status-bar{
  881. background-color:rgba(253,224,204,1) ;
  882. height: var(--status-bar-height);
  883. }
  884. .status-bar.main-bg {
  885. background-color: #fff;
  886. }
  887. .top-title-box{
  888. height: 88rpx;
  889. line-height: 88rpx;
  890. text-align: center;
  891. background-color: #fff;
  892. font-size: 18px;
  893. color: #333;
  894. font-weight: 550;
  895. display: none;
  896. &.show{
  897. display: block;
  898. }
  899. }
  900. }
  901. .top-section{
  902. .bg-img{
  903. position: fixed;
  904. width: 100%;
  905. top: 0;
  906. left: 0;
  907. right: 0;
  908. height: 524rpx;
  909. z-index: 0;
  910. }
  911. }
  912. @mixin u-flex($flexD, $alignI, $justifyC) {
  913. display: flex;
  914. flex-direction: $flexD;
  915. align-items: $alignI;
  916. justify-content: $justifyC;
  917. }
  918. .flex-center {
  919. @include u-flex(row, center, flex-start);
  920. }
  921. .container {
  922. background-image: url("@/static/image/hall/home_top_bg.png");
  923. background-repeat: no-repeat;
  924. background-size: 100%;
  925. font-family: PingFang SC, PingFang SC;
  926. // padding-top: var(--status-bar-height);
  927. padding-bottom: 20rpx;
  928. height: 100%;
  929. }
  930. .my-header-right {
  931. height: 88rpx;
  932. padding-right: 28rpx;
  933. margin-top: var(--status-bar-height);
  934. @include u-flex(row,center, flex-end);
  935. image {
  936. margin-left: 32rpx;
  937. width: 48rpx;
  938. height: 48rpx;
  939. position: relative;
  940. }
  941. .badge::after {
  942. content: "";
  943. width: 16rpx;
  944. height: 16rpx;
  945. background: #FF5C03;
  946. border-radius: 50%;
  947. position: absolute;
  948. right: 0;
  949. top: 0;
  950. }
  951. }
  952. .mybox {
  953. padding: 12rpx 24rpx;
  954. &-info {
  955. @include u-flex(row, center, flex-start);
  956. &-name {
  957. font-weight: 600;
  958. font-size: 40rpx;
  959. color: #222222;
  960. }
  961. .heads {
  962. width: 128rpx;
  963. height: 128rpx;
  964. border-radius: 50%;
  965. margin-right: 16rpx;
  966. }
  967. .arrow_black {
  968. width: 48rpx;
  969. height: 48rpx;
  970. }
  971. .vipbox {
  972. background: linear-gradient( 90deg, #F26F00 0%, #FF9D1F 100%);
  973. border-radius: 20rpx 20rpx 20rpx 20rpx;
  974. border: 1rpx solid #FEDDB9;
  975. font-weight: 500;
  976. font-size: 22rpx;
  977. color: #FEF5EA;
  978. padding: 0 22rpx 0 12rpx;
  979. }
  980. }
  981. &-integral {
  982. margin-top: 48rpx;
  983. @include u-flex(row, center, flex-start);
  984. &-item {
  985. width: 25%;
  986. text-align: center;
  987. font-weight: 400;
  988. font-size: 24rpx;
  989. color: #757575;
  990. }
  991. .num {
  992. margin-bottom: 12rpx;
  993. font-family: DIN, DIN;
  994. font-weight: 500;
  995. font-size: 40rpx;
  996. color: #313131;
  997. }
  998. }
  999. &-menu {
  1000. background: #FFFFFF;
  1001. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1002. padding: 32rpx 32rpx 36rpx 32rpx;
  1003. margin: 20rpx 0;
  1004. &-title {
  1005. font-weight: 600;
  1006. font-size: 36rpx;
  1007. color: #222222;
  1008. margin-bottom: 42rpx;
  1009. }
  1010. &-box {
  1011. @include u-flex(row, center, flex-start);
  1012. margin-bottom: -40rpx;
  1013. flex-wrap: wrap;
  1014. }
  1015. &-item {
  1016. width: 25%;
  1017. margin-bottom: 40rpx;
  1018. @include u-flex(column, center, center);
  1019. font-weight: 400;
  1020. font-size: 24rpx;
  1021. color: #222222;
  1022. image {
  1023. height: 48rpx;
  1024. width: 48rpx;
  1025. margin-bottom: 10rpx;
  1026. }
  1027. }
  1028. }
  1029. }
  1030. .vip-card {
  1031. height: 172rpx;
  1032. margin-top: 28rpx;
  1033. background: url("@/static/image/my/vip_bg_left.png") no-repeat left / 128rpx 172rpx,
  1034. url("@/static/image/my/vip_bg_right.png") no-repeat right / 324rpx 172rpx,
  1035. linear-gradient( 90deg, #FFF3DF 0%, #FADBA9 100%);
  1036. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1037. padding: 0 32rpx;
  1038. box-sizing: border-box;
  1039. @include u-flex(row, center, space-between);
  1040. &-info {
  1041. font-weight: 400;
  1042. font-size: 24rpx;
  1043. color: #834F00;
  1044. margin-bottom: 26rpx;
  1045. image {
  1046. width: 126rpx;
  1047. height: 30rpx;
  1048. margin-right: 34rpx;
  1049. }
  1050. }
  1051. &-price {
  1052. font-weight: 500;
  1053. font-size: 32rpx;
  1054. color: #885201;
  1055. line-height: 38rpx;
  1056. text {
  1057. font-family: Roboto, Roboto;
  1058. font-weight: bold;
  1059. font-size: 40rpx;
  1060. color: #EA8F07;
  1061. margin: 0 8rpx;
  1062. }
  1063. }
  1064. .buyvip {
  1065. height: 72rpx;
  1066. background: #885201;
  1067. border-radius: 36rpx 36rpx 36rpx 36rpx;
  1068. font-weight: 600;
  1069. font-size: 28rpx;
  1070. color: #FFF6E7;
  1071. line-height: 72rpx;
  1072. padding: 0 32rpx;
  1073. display: inline-block;
  1074. }
  1075. }
  1076. .vip-card {
  1077. height: 172rpx;
  1078. margin-top: 28rpx;
  1079. background: url("@/static/image/my/vip_bg_left.png") no-repeat left / 128rpx 172rpx,
  1080. url("@/static/image/my/vip_bg_right.png") no-repeat right / 324rpx 172rpx,
  1081. linear-gradient( 90deg, #FFF3DF 0%, #FADBA9 100%);
  1082. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1083. padding: 0 32rpx;
  1084. box-sizing: border-box;
  1085. @include u-flex(row, center, space-between);
  1086. &-info {
  1087. font-weight: 400;
  1088. font-size: 24rpx;
  1089. color: #834F00;
  1090. margin-bottom: 26rpx;
  1091. image {
  1092. width: 126rpx;
  1093. height: 30rpx;
  1094. margin-right: 34rpx;
  1095. }
  1096. }
  1097. &-price {
  1098. font-weight: 500;
  1099. font-size: 32rpx;
  1100. color: #885201;
  1101. line-height: 38rpx;
  1102. text {
  1103. font-family: Roboto, Roboto;
  1104. font-weight: bold;
  1105. font-size: 40rpx;
  1106. color: #EA8F07;
  1107. margin: 0 8rpx;
  1108. }
  1109. }
  1110. .buyvip {
  1111. height: 72rpx;
  1112. background: #885201;
  1113. border-radius: 36rpx 36rpx 36rpx 36rpx;
  1114. font-weight: 600;
  1115. font-size: 28rpx;
  1116. color: #FFF6E7;
  1117. line-height: 72rpx;
  1118. padding: 0 32rpx;
  1119. display: inline-block;
  1120. }
  1121. }
  1122. .btns{
  1123. height: 110rpx;
  1124. }
  1125. .login-btn {
  1126. display: flex;
  1127. align-items: center;
  1128. justify-content: center;
  1129. flex: 1;
  1130. margin:0 30rpx;
  1131. height: 80rpx;
  1132. background: #fff;
  1133. // box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
  1134. border-radius: 40rpx;
  1135. font-size: 30rpx;
  1136. font-family: PingFang SC;
  1137. font-weight: 500;
  1138. color: #333;
  1139. }
  1140. .activity-area {
  1141. display: flex;
  1142. justify-content: space-between;
  1143. margin-top: 20rpx;
  1144. }
  1145. .activity-item {
  1146. width: 48.5%;
  1147. height: 160rpx;
  1148. border-radius: 16rpx;
  1149. padding: 12rpx;
  1150. box-sizing: border-box;
  1151. position: relative;
  1152. display: flex;
  1153. align-items: center;
  1154. overflow: hidden;
  1155. }
  1156. .activity-item1 {
  1157. width: 99% !important;
  1158. }
  1159. .vip-bg {
  1160. background-image: url('/static/image/my/vip_bg.png');
  1161. background-repeat: no-repeat;
  1162. background-size: 100% 100%;
  1163. }
  1164. .coin-bg {
  1165. background-image: url('/static/image/my/fanghua_icon_bg.png');
  1166. background-repeat: no-repeat;
  1167. background-size: 100% 100%;
  1168. }
  1169. .desc {
  1170. font-family: PingFang SC, PingFang SC;
  1171. font-weight: 400;
  1172. font-size: 20rpx;
  1173. color: #995316;
  1174. .highlight {
  1175. font-family: Roboto, Roboto;
  1176. font-weight: bold;
  1177. font-size: 28rpx;
  1178. color: #995316;
  1179. margin: 0 4rpx;
  1180. }
  1181. }
  1182. .action-btn {
  1183. position: absolute;
  1184. right: 12rpx;
  1185. top: 50%;
  1186. transform: translateY(-50%);
  1187. background: #fff;
  1188. font-size: 24rpx;
  1189. padding: 10rpx 20rpx;
  1190. border-radius: 30rpx;
  1191. font-family: PingFang SC, PingFang SC;
  1192. font-weight: 400;
  1193. font-size: 20rpx;
  1194. }
  1195. .vip-bg .action-btn {
  1196. color: #B47000;
  1197. }
  1198. .coin-bg .action-btn {
  1199. color: #DF4E00;
  1200. }
  1201. </style>