| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350 |
- <template>
- <scroll-view @scrolltolower="scrollTolower" :scroll-top="userScrollTop" scroll-y="true" class="container"
- @scroll="userScroll">
- <view class="top-cont">
- <view :class="fixedTop?'inner fixed':'inner'">
- <!-- 状态栏 -->
- <view :class="fixedTop?'status-bar es-bc-theme':'status-bar'" :style="{ background:headerBG }"></view>
- <view class="top-title-box show" :style="{ background:headerBG }">
- <!-- <view>个人中心</view> -->
- </view>
- </view>
- <view class="my-header-right inner fixed" style="justify-content: space-between;">
- <image style="margin-right: 10px;" src="@/static/image/home1/scancode_black.png" mode="aspectFill"
- @tap="handleScan()"></image>
- <view style="display: flex; align-items: center;">
- <image src="@/static/image/my/set_icon.png" mode="aspectFill" @tap="navTo('./about')"></image>
- <image :class="isNew ? 'badge':''" @tap="goToMsg()" src="@/static/image/hall/new_hall_icon.png"
- mode="aspectFill"></image>
- </view>
- </view>
- <!-- 用于顶部固定定位后占位 -->
- <view :class="fixedTop?'seat show':'seat'"></view>
- <view class="mybox">
- <view class="mybox-info">
- <image class="heads es-br-ban" @tap="navToUserInfo('./userInfo')"
- :src="!$isEmpty(user.avatar)?user.avatar:defUser.avatar" mode="aspectFill"></image>
- <view>
- <view class="flex-center" @tap="navToUserInfo('./userInfo')">
- <text class="mybox-info-name">{{ isLogin&&user&&user.nickName || '请登录' }}</text>
- <image class="arrow_black" src="@/static/image/my/right_arrow_black_icon.png"
- mode="aspectFill"></image>
- </view>
- <view class="flex-center" style="margin-top: 22rpx;">
- <view class="flex-center vipbox es-mr-10" v-if="user.isVip==1&&(!$isIos())"
- @click="loginNavTo('/pages/course/vipBuy')">
- <image class="arrow_black" src="@/static/image/my/lv_icon.png" mode="aspectFill">
- </image>
- <text>会员</text>
- </view>
- <view class="" v-if="user.userId">
- 企业号:{{user.userId}}
- </view>
- <!-- <view class="flex-center vipbox" style="margin-left: 16rpx;">
- <image class="arrow_black" src="@/static/image/my/lv_icon.png" mode="aspectFill"></image>
- <text>LV.{{user.vipLevel}}</text>
- </view> -->
- </view>
- </view>
- </view>
- <!-- 健康币,币,券信息 -->
- <view class="mybox-integral" v-if="!this.userIsDel()">
- <view class="mybox-integral-item" @click="loginNavTo('/pages/user/wallet/index')">
- <view class="num">{{ this.userIsDel()?0:user.mayWithdraw}}</view>
- <view>钱包</view>
- </view>
- <view class="mybox-integral-item" @click="loginNavTo('/pages/user/integral/points')">
- <view class="num">{{ this.userIsDel()?0:user.integral}}</view>
- <view>健康币</view>
- </view>
- <view class="mybox-integral-item" @click="loginNavTo('/pages/user/coupon/myCouponList?type=0')">
- <view class="num">{{ this.userIsDel()?0:coupons.notUsedCount}}</view>
- <view>待用券</view>
- </view>
- <view class="mybox-integral-item" @click="loginNavTo('/pages/user/coupon/myCouponList?type=1')">
- <view class="num">{{ this.userIsDel()?0:coupons.usedCount}}</view>
- <view>已用券</view>
- </view>
- <view class="mybox-integral-item" @click="loginNavTo('/pages/user/coupon/myCouponList?type=2')">
- <view class="num">{{ this.userIsDel()?0:coupons.expiredCount}}</view>
- <view>过期券</view>
- </view>
- </view>
- <!-- vip会员 -->
- <!-- <view class="vip-card" v-if="user.userId&&(!$isIos())&&!this.userIsDel() ">
- <view>
- <view class="flex-center vip-card-info">
- <image src="@/static/image/my/VIP_member.png" mode="aspectFill"></image>
- <text>{{getDayMix(user.vipEndDate)}}</text>
- </view>
- <view class="flex-center vip-card-price">续费享季卡会员约<text>6.5</text>折</view>
- </view>
- <view class="buyvip" @click="loginNavTo('/pages/course/vipBuy')" >立即续费</view>
- </view> -->
- <!-- <view style="height: 172rpx;margin-top: 28rpx;width: 100%;" v-if="user.userId&&!this.userIsDel()" @click="loginNavTo('/pages/user/integral/integralGoodsList')">
- <image style="width: 100%;height: 100%;" src="@/static/images/ad/2.png" mode="aspectFill"></image>
- </view> -->
- <view class="activity-area">
- <view class="activity-item vip-bg" @click="loginNavTo('/pages/course/vipBuy')">
- <view class="title-row">
- <image style="width: 160rpx;" src="/static/image/my/vip_img.png" mode="widthFix"></image>
- <view class="desc">续费享约<text class="highlight">6.5</text>折</view>
- </view>
- <view class="action-btn">立即续费</view>
- </view>
- <view class="activity-item coin-bg" @click="loginNavTo('/pages/user/integral/integralGoodsList')">
- <view class="title-row">
- <image style="width: 178rpx;" src="/static/image/my/fanghua_icon.png" mode="widthFix">
- </image>
- <view class="desc"><text class="highlight">0</text>元好物任性换</view>
- </view>
- <view class="action-btn">立即兑换</view>
- </view>
- </view>
- <!-- 我的订单 医疗服务等 -->
- <view class="mybox-menu" v-for="(item, index) in menuList" :key="index" v-show="item.showMenu">
- <view class="mybox-menu-title">{{item.menuTitle}}</view>
- <view class="mybox-menu-box">
- <view class="mybox-menu-item" v-for="(menu, idx) in item.menus" :key="idx" v-show="menu.isShow"
- @click="handleMenu(menu)">
- <image :src="menu.icon" mode="aspectFill"></image>
- <text>{{menu.name}}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="btns" v-if="isLogin">
- <view class="login-btn" @click="showLogout">退出登录</view>
- </view>
- <u-modal :show="showCustomModal" title="系统提醒" content="当前账户已注销部分功能禁用,医疗行业受法律监管用户问诊订单/病历等数据必须保留15年以上不可删除"
- :show-cancel-button="false" confirm-text="确定" @confirm="showCustomModal = false">
- </u-modal>
- </view>
- </scroll-view>
- </template>
- <script>
- import {
- getIOSPayStatus
- } from '@/api/common.js';
- import {
- startDrugReport,
- getUserFollowDoctor
- } from '@/api/drugReport';
- import {
- getUserInfo,
- getMyCouponCount
- } from '@/api/user'
- // #ifdef APP-PLUS
- import permision1 from "@/utils/permission.js"
- // #endif
- const avatar = "/static/image/hall/my_heads_icon.png";
- import IMSDK, {
- SessionType
- } from "openim-uniapp-polyfill";
- import {
- navigateToDesignatedConversation,
- callingModule,
- meetingModule,
- setConversation
- } from "@/pages_im/util/imCommon";
- import {
- Igexin
- } from '@/pages_im/util/common.js';
- import {
- isIos
- } from '../../utils/common';
- export default {
- data() {
- return {
- isLogin: false,
- coupons: {
- expiredCount: 0,
- notUsedCount: 0,
- usedCount: 0
- },
- show: false,
- defUser: {
- avatar: avatar,
- nickName: "请登录",
- userName: "请登录",
- phone: "",
- integral: 0,
- balance: 0
- },
- user: {
- avatar: "/static/image/hall/my_heads_icon.png",
- userName: "",
- phone: "",
- nickName: "",
- integral: 0,
- balance: 0,
- userId: null,
- isDel: 0,
- status: 1
- },
- isNew: false,
- top: 0,
- userScrollTop: 0,
- fixedTop: false, // 是否固定头部
- statusBarHeight: uni.getStorageSync('statusBarHeight'),
- menuList: [],
- isIos: false,
- showIOSPay: 0,
- showManageCts: false,
- showCustomModal: false,
- showRemove: false,
- hasOpenCustomBox: false,
- registrationID: ''
- }
- },
- onLoad() {
- let that = this;
- uni.$on('refreshUserInfo', function() {
- if (that.$isLogin()) {
- that.$updateMsgDot()
- } else {
- that.isLogin = that.$isLogin()
- }
- });
- uni.$on('loginOut', function() {
- if (that.$isLogin()) {
- that.logout();
- }
- });
- if (!this.$qconfig.isAppStore) { //应用市场版本隐藏健康币商城
- let integralMenus = (this.menuList[2]).menus;
- let integralSubMenu = {
- name: '健康币商城',
- icon: "../../static/image/my/my_points_icon.png",
- pageUrl: "/pages/user/integral/integralGoodsList"
- };
- integralMenus.splice(2, 0, integralSubMenu);
- }
- // #ifdef APP-PLUS
- permision1.checkPush();
- // #endif
- },
- onUnload() {
- uni.$off('refreshUserInfo');
- },
- onShow() {
- this.isLogin = this.$isLogin()
- let token = uni.getStorageSync('AppToken');
- if (this.$isLogin()) {
- this.getUserInfo();
- this.getMyCouponCount();
- this.$updateMsgDot()
- } else {
- this.user = this.defUser;
- uni.navigateTo({
- url: '/pages/auth/loginIndex'
- })
- return;
- }
- // #ifdef APP-PLUS
- this.isIos = (plus.os.name == "iOS")
- //if(this.$isIos()) {
- this.getIOSPayStatusFun();
- //}
- // #endif
- },
- created() {
- this.initMenu();
- },
- methods: {
- initMenu() {
- this.menuList = [{
- menuTitle: "我的订单",
- showMenu: true,
- menus: [
- {
- name: '待付款',
- icon: "../../static/image/my/obligation_icon.png",
- pageUrl: "/pages/user/integral/integralOrderList?status=0",
- isShow: true
- },
- {
- name: '待发货',
- icon: "../../static/image/my/pending_shipment_icon.png",
- pageUrl: "/pages/user/integral/integralOrderList?status=0",
- isShow: true
- },
- {
- name: '待收货',
- icon: "../../static/image/my/dai_shouhuo_icon.png",
- pageUrl: "/pages/user/integral/integralOrderList?status=0",
- isShow: true
- },
- {
- name: '已完成',
- icon: "../../static/image/my/completed_icon.png",
- pageUrl: "/pages/user/integral/integralOrderList?status=0",
- isShow: true
- },
- {
- name: '售后/退款',
- icon: "../../static/image/my/after_sales_icon.png",
- pageUrl: "/pages/user/integral/integralOrderList?status=0",
- isShow: true
- },
- // {
- // name: '中奖记录',
- // icon: "../../static/image/my/my_order_icon.png",
- // pageUrl: "/pages/courseAnswer/winningRecord",
- // isShow: true
- // },
- // {
- // name: '直播订单',
- // icon: "../../static/image/my/my_cforder_icon.png",
- // pageUrl: "/pages_live/shopping/order",
- // isShow: true
- // },
- // {
- // name: '直播售后',
- // icon: "../../static/image/my/my_cforder_icon.png",
- // pageUrl: "/pages_live/shopping/storeOrderRefundList",
- // isShow: true
- // },
- ]
- }, {
- menuTitle: "问诊订单",
- showMenu: true,
- menus: [{
- name: '问诊订单',
- icon: "../../static/image/my/my_order_icon.png",
- pageUrl: "/pages/store/inquiryOrderList",
- isShow: true
- }, {
- name: '处方订单',
- icon: "../../static/image/my/my_cforder_icon.png",
- pageUrl: "/pages/store/storeOrderList",
- isShow: true
- }, {
- name: '健康疗法',
- icon: "../../static/image/my/my_health_therapy_icon.png",
- pageUrl: "/pages/store/packageOrderList",
- isShow: true
- }, {
- name: '售后服务',
- icon: "../../static/image/my/my_service_icon.png",
- pageUrl: "/pages/store/storeOrderRefundList",
- isShow: true
- }
- // , {
- // name: '健康币订单',
- // icon: "../../static/image/my/my_cforder_icon.png",
- // pageUrl: "/pages/user/integral/integralOrderList",
- // isShow: true
- // },
- // {
- // name: '中奖记录',
- // icon: "../../static/image/my/my_order_icon.png",
- // pageUrl: "/pages/courseAnswer/winningRecord",
- // isShow: true
- // },
- // {
- // name: '直播订单',
- // icon: "../../static/image/my/my_cforder_icon.png",
- // pageUrl: "/pages_live/shopping/order",
- // isShow: true
- // },
- // {
- // name: '直播售后',
- // icon: "../../static/image/my/my_cforder_icon.png",
- // pageUrl: "/pages_live/shopping/storeOrderRefundList",
- // isShow: true
- // },
- ]
- },
- {
- menuTitle: "医疗服务",
- showMenu: true,
- menus: [
- // {
- // name: '血糖血压仪',
- // icon: "../../static/image/my/my_points_icon.png",
- // pageUrl:"/pages_bluetooth/healthMeter",
- // isShow:true
- // },
- {
- name: '我的处方',
- icon: "../../static/image/my/my_prescription_icon.png",
- pageUrl: "/pages/store/prescribeList",
- isShow: true
- }, {
- name: '我的医生',
- icon: "../../static/image/my/my_doctor_icon.png",
- pageUrl: "./myDoctorList",
- isShow: true
- }, {
- name: '随访服务',
- icon: "../../static/image/my/follow_up_icon.png",
- pageUrl: "/pages/user/followList",
- isShow: true
- }, {
- name: '用药咨询',
- icon: "../../static/image/my/medical_consultation_icon.png",
- pageUrl: "/pages/store/inquiryOrderList",
- isIm: true,
- isShow: true
- }, {
- name: '用药报告',
- icon: "../../static/image/my/medication_report_icon.png",
- pageUrl: "/pages/user/drugReportList",
- isShow: true
- }
- ]
- },
- {
- menuTitle: "我的应用",
- showMenu: !this.userIsDel(),
- menus: [{
- name: '就诊管理',
- icon: "../../static/image/my/visit_icon.png",
- pageUrl: "./patient",
- isShow: true
- }, {
- name: '地址管理',
- icon: "../../static/image/my/address_management_icon.png",
- pageUrl: "./address",
- isShow: true
- }
- // , {
- // name: '直播',
- // icon: "../../static/image/my/live.png",
- // pageUrl: "/pages_live/livingList",
- // isShow: true
- // }
- //
- ,{
- name: '积分商城',
- icon: "../../static/image/my/my_points_icon.png",
- pageUrl:"/pages/user/integral/integralGoodsList",
- isShow: true,
- }
- , {
- name: '客服中心',
- icon: "../../static/image/my/service_center_icon.png",
- pageUrl: "",
- isShow: true,
- },{
- name: '会员中心',
- icon: "../../static/image/my/member_icon.png",
- isUserService: true,
- pageUrl: "",
- isShow: !isIos()
- }, {
- name: '投诉建议',
- icon: "../../static/image/my/complaints_and_suggestions_icon.png",
- pageUrl: "/pages/user/feedback",
- isShow: true
- }
- // , {
- // name: '舌苔报告',
- // icon: "../../static/image/my/shetai.png",
- // pageUrl: "/pages/user/tongue/tongueList",
- // isShow: !isIos()
- // }
- // ,{
- // name: '健康管家',
- // icon: "../../static/image/my/my_doctor_icon.png",
- // pageUrl: "/pages/user/addHealthButler"
- // }
- // , {
- // name: '看课通知',
- // icon: "../../static/image/my/my_order_icon.png",
- // pageUrl: "/pages/courseAnswer/list",
- // isShow: true
- // }
- , {
- name: '领券中心',
- icon: "../../static/image/my/coupon_collection.png",
- pageUrl: "/pages/company/couponList?couponType=6",
- isShow: true
- },
- // {
- // name: '健康档案',
- // icon: "../../static/image/my/my_order_icon.png",
- // pageUrl: "/pages/user/healthRecords/index",
- // isShow: true
- // },
- {
- name: '健康周报',
- icon: "../../static/image/my/health_report_icon.png",
- pageUrl: "/pages_watch/health/healthWeekReport?selectUser=0",
- isShow: true
- }, {
- name: '资质证书',
- icon: "../../static/image/my/qualifications_icon.png",
- pageUrl: "/pages/user/cert",
- isShow: true
- }
- ]
- },
- {
- menuTitle: "我的视频",
- showMenu: !this.userIsDel(),
- menus: [{
- name: '我的收藏',
- icon: "../../static/image/my/collect_icon.png",
- pageUrl: "./myFavoriteVideo",
- isShow: true
- }
- ,{
- name: '我的评论',
- icon: "../../static/image/my/evaluate_icon.png",
- pageUrl:"/pages/store/inquiryOrderPingList",
- isShow: true
- }
- ]
- },
- {
- menuTitle: "管理应用",
- showMenu: !this.userIsDel(),
- menus: [{
- name: '医生入驻',
- icon: "../../static/image/my/doctor_entrance_icon.png",
- pageUrl: "/pages/user/registerDoctor?type=1",
- isShow: true
- }, {
- name: '药师入驻',
- icon: "../../static/image/my/pharmacist_entrance_icon.png",
- pageUrl: "/pages/user/registerDoctor?type=2",
- isShow: true
- }, {
- name: '达人主页',
- icon: "../../static/image/my/drzy_icon.png",
- pageUrl: "/pages/expert/index",
- isShow: true
- }, {
- name: '客服登录',
- icon: "../../static/image/my/login_icon.png",
- isService: true,
- pageUrl: "",
- isShow: this.manageSaleShow()
- }, {
- name: '关于我们',
- icon: "../../static/image/my/feedback_icon.png",
- pageUrl: "./about",
- isShow: true
- }, {
- name: '开票历史',
- icon: "../../static/image/my/invoicing_icon.png",
- pageUrl: "/pages/store/invoice/invoiceList",
- isShow: true
- }]
- }
- ];
- },
- getIOSPayStatusFun() {
- getIOSPayStatus().then(res => {
- if (res.code == 200) {
- //console.log("qxj getIOSPayStatus res",res);
- this.showIOSPay = parseInt(res.iosPayStatus);
- this.showManageCts = parseInt(res.showManageCts) || false;
- this.showRemove = parseInt(res.showRemove);
- uni.setStorageSync("showManageCts", this.showManageCts);
- uni.setStorageSync("showIOSPay", this.showIOSPay);
- uni.setStorageSync("showRemove", this.showRemove);
- this.updateMenuVisibility();
- }
- })
- },
- doIM() {
- uni.showLoading({
- title: "处理中..."
- });
- getUserFollowDoctor().then(res => {
- if (res.code == 200) {
- if (res.data != null) {
- let data = res.data;
- var params = {
- followId: data.followId
- };
- console.log(data);
- startDrugReport(params).then(res => {
- uni.hideLoading();
- var that = this;
- var user = JSON.parse(uni.getStorageSync('userInfo'));
- var uid = 'U' + user.userId;
- var did = 'D' + data.followDoctorId;
- var conversationID = `si_${did}_${uid}`;
- this.$store.commit("timStore/setOrderId", data.orderId);
- this.$store.commit("timStore/setFollowId", data.followId);
- this.$store.commit("timStore/setImType", 2);
- this.$store.commit("timStore/setConversationID", conversationID);
- navigateToDesignatedConversation(did, SessionType.Single, false).then((
- res) => {
- // setConversation(conversationID,JSON.stringify(ex)).then(() => {
- // console.log("qxj setConversation ex:"+JSON.stringify(ex));
- // }).catch(() => {});
- }).catch(() => uni.$u.toast("操作失败"));
- },
- rej => {}
- );
- } else {
- uni.hideLoading()
- uni.showToast({
- icon: 'none',
- title: "当前没有药师为您服务",
- });
- }
- } else {
- uni.showToast({
- icon: 'none',
- title: "请求失败",
- });
- }
- },
- rej => {}
- );
- },
- toIM() {
- if (this.$isLogin()) {
- this.doIM();
- } else {
- this.$showLoginPage();
- }
- },
- toCompany() {
- if (this.$isLogin()) {
- var token = uni.getStorageSync('CompanyUserToken');
- if (token) {
- uni.navigateTo({
- url: '/pages/company/index'
- })
- } else {
- uni.navigateTo({
- url: '/pages/company/login'
- })
- }
- } else {
- this.$showLoginPage();
- }
- },
- showLogout() {
- //this.show=true;
- let that = this;
- uni.showActionSheet({
- title: "确认退出吗",
- itemList: ["确定"],
- success: function(res) {
- that.logout();
- that.isLogin = that.$isLogin()
- // uni.navigateTo({
- // url: '/pages/auth/loginIndex'
- // })
- }
- });
- },
- hideLogout() {
- this.show = false;
- },
- logout() {
- uni.removeStorageSync('sendCourseQiWeiData')
- this.$logout();
- this.$clearVideoCacheOnLogout();
- let IMUserID = uni.getStorageSync('IMUserID');
- IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid()).then(() => {
- callingModule?.endCall();
- meetingModule?.endCall();
- }).catch((err) => console.log(err))
- .finally(() => {
- Igexin.unbindAlias(IMUserID);
- uni.removeStorage({
- key: "IMToken"
- });
- uni.removeStorage({
- key: "IMUserID"
- });
- uni.removeStorage({
- key: "IMHasLogin"
- });
- });
- this.user = this.defUser;
- this.coupons.expiredCount = 0;
- this.coupons.notUsedCount = 0;
- this.coupons.usedCount = 0;
- },
- handleMenu(item) {
- if (item.isIm != undefined && item.isIm) {
- this.toIM();
- } else if (item.isService != undefined && item.isService) {
- this.toCompany();
- } else if (item.isUserService != undefined && item.isUserService) {
- this.loginNavTo('/pages/course/vipBuy')
- } else if (item.isServerCenter != undefined && item.isServerCenter) {
- this.gotoMiniProgram("/page_user/service");
- } else if (item.name == '客服中心') {
- const url = getApp().globalData.kfurl //企业微信客服链接
- const corpId = getApp().globalData.corpId //企业id
- this.openCustomerServiceChat(url, corpId)
- } else {
- this.loginNavTo(item.pageUrl)
- }
- },
- navTo(url) {
- console.log("qxj url", url);
- uni.navigateTo({
- url: url
- });
- },
- loginNavTo(url) {
- if (!this.$isLogin()) {
- this.$showLoginPage();
- return;
- }
- uni.navigateTo({
- url: url
- });
- },
- navToUserInfo(url) {
- if (!this.$isLogin()) {
- this.$showLoginPage();
- return;
- }
- uni.navigateTo({
- url: "./userInfo?userId=" + this.user.userId
- });
- },
- navToServerCenter() {
- if (!this.$isLogin()) {
- this.$showLoginPage();
- return;
- }
- },
- getUserInfo() {
- let that = this;
- getUserInfo().then(res => {
- if (res.code == 200) {
- if (res.user != null) {
- uni.setStorageSync('userInfo', JSON.stringify(res.user));
- this.user = res.user;
- this.registrationID = uni.getStorageSync("registrationID");
- if (!this.user.jpushId || this.registrationID != this.user.jpushId) {
- uni.setStorageSync("registrationID", "");
- this.$getRegistrationID('update');
- }
- if (this.userIsDel() && !this.hasOpenCustomBox) {
- this.initMenu();
- this.showCustomModal = true;
- this.hasOpenCustomBox = true;
- }
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg,
- });
- }
- }
- },
- rej => {}
- );
- },
- getMyCouponCount() {
- let that = this;
- getMyCouponCount().then(res => {
- if (res.code == 200) {
- this.coupons = res.data;
- }
- },
- rej => {}
- );
- },
- getUserNickName() {
- let nickName = "";
- if (!this.$isLogin()) { //已登录
- nickName = "请登录";
- return nickName;
- }
- nickName = this.$isEmpty(this.user.nickName) ? "请登录" : this.user.nickName;
- return nickName;
- },
- userScroll(e) {
- if (e.detail.scrollTop >= 50) {
- this.fixedTop = true
- } else {
- this.fixedTop = false
- }
- this.top = e.detail.scrollTop;
- },
- scrollTolower() {
- },
- getDayMix(vipEndDate) {
- // 假设 vipEndDate 字符串
- //let vipEndDate = "2024-09-06T14:43:36.000+0800";
- // 将 vipEndDate 解析为日期对象
- let endDate = new Date(vipEndDate);
- // 获取当前日期
- let currentDate = new Date();
- // 计算时间差(毫秒)
- let timeDiff = endDate - currentDate;
- // 计算天数差
- let dayDiff = Math.ceil(timeDiff / (1000 * 3600 * 24));
- let dayStr = "";
- // 输出结果
- if (dayDiff > 0) {
- dayStr = `VIP到期还有${dayDiff}天`;
- } else if (dayDiff === 0) {
- dayStr = "今天是VIP到期日";
- } else {
- dayStr = `VIP已过期${Math.abs(dayDiff)}天`;
- }
- return dayStr;
- },
- goToMsg() {
- uni.switchTab({
- url: '/pages_im/pages/conversation/conversationList/index'
- });
- },
- async openCustomerServiceChat(url, corpId) {
- // #ifdef H5
- window.location.href = url
- // #endif
- // #ifdef MP-WEIXIN
- wx.openCustomerServiceChat({
- extInfo: {
- url
- },
- corpId,
- success(res) {
- console.log('成功');
- },
- fail(err) {
- console.log(err, '报错');
- }
- })
- // #endif
- // #ifdef APP-PLUS
- let shares = await this.getAppShare().catch(err => {
- throw Error(err)
- });
- shares['weixin'].openCustomerServiceChat({
- corpid: corpId,
- url
- }, suc => {
- console.log("客服打开成功", JSON.stringify(res))
- }, err => {
- console.log("error", JSON.stringify(err))
- })
- // #endif
- },
- getAppShare() {
- // #ifdef APP-PLUS
- return new Promise((re, rj) => {
- let shares = null;
- var pusher = plus.share.getServices(function(s) {
- shares = {};
- s.forEach(e => shares[e.id] = e);
- re(shares)
- }, function(e) {
- rj(e);
- });
- });
- // #endif
- },
- gotoMiniProgram(pageUrl) {
- plus.share.getServices(function(res) {
- var sweixin = null;
- for (var i = 0; i < res.length; i++) {
- var t = res[i];
- if (t.id == 'weixin') {
- sweixin = t;
- }
- }
- if (sweixin) {
- //唤起微信跳转小程序
- sweixin.launchMiniProgram({
- id: "gh_feb7753a310b", //gh_7a6a32e5ef61 御君方互医
- path: pageUrl,
- type: 0
- }, function() {
- console.log("微信唤起成功");
- return true;
- }, function(e) {
- console.log("微信唤起失败", e);
- uni.showToast({
- title: '微信唤起失败,请检查是否有微信应用',
- icon: 'none'
- })
- return false;
- })
- } else {
- uni.showToast({
- title: '微信唤起失败,请检查是否有微信应用',
- icon: 'none',
- duration: 3000
- })
- return false;
- }
- }, function(res) {
- });
- },
- userIsDel() {
- return this.user.status == 0;
- },
- updateMenuVisibility() {
- // 找到管理应用菜单
- const manageAppMenu = this.menuList.find(menu => menu.menuTitle === "管理应用");
- if (manageAppMenu) {
- // 找到客服登录菜单项
- const customerServiceItem = manageAppMenu.menus.find(item => item.name === "客服登录");
- if (customerServiceItem) {
- // 根据showManageCts设置显示状态
- customerServiceItem.isShow = this.manageSaleShow();
- }
- }
- },
- manageSaleShow() {
- return true;
- //return (!isIos() || (isIos() && this.showManageCts));
- },
- handleScan() {
- console.log("qxj handleScan");
- this.navTo('/pages_watch/healthMonitoring/scanCode?typeFun=getScanCodeInfo');
- }
- },
- computed: {
- // 计算属性的 getter
- headerBG: function() {
- var top = this.top / 88;
- return 'rgba(253,224,204, ' + top + ')';
- },
- }
- }
- </script>
- <style scoped lang="scss">
- page {
- height: 100%;
- background: #f7f7f7;
- }
- .top-cont {
- // height: 370rpx;
- position: relative;
- &::after {
- content: '';
- width: 100%;
- height: 370rpx;
- position: absolute;
- z-index: -1;
- left: 0;
- top: 0;
- border-radius: 0 0 50rpx 50rpx;
- }
- .inner.fixed {
- width: 100%;
- position: fixed;
- top: 0;
- left: 0;
- z-index: 999;
- }
- .seat {
- display: none;
- height: var(--status-bar-height);
- &.show {
- display: block;
- }
- }
- .status-bar {
- background-color:#CDE6FE;
- height: var(--status-bar-height);
- }
- .status-bar.main-bg {
- background-color: #fff;
- }
- .top-title-box {
- height: 88rpx;
- line-height: 88rpx;
- text-align: center;
- background-color: #fff;
- font-size: 18px;
- color: #333;
- font-weight: 550;
- display: none;
- &.show {
- display: block;
- }
- }
- }
- .top-section {
- .bg-img {
- position: fixed;
- width: 100%;
- top: 0;
- left: 0;
- right: 0;
- height: 524rpx;
- z-index: 0;
- }
- }
- @mixin u-flex($flexD, $alignI, $justifyC) {
- display: flex;
- flex-direction: $flexD;
- align-items: $alignI;
- justify-content: $justifyC;
- }
- .flex-center {
- @include u-flex(row, center, flex-start);
- }
- .container {
- background-image: url("@/static/image/hall/purple_mine_top_bg.png");
- background-repeat: no-repeat;
- background-size: 100%;
- font-family: PingFang SC, PingFang SC;
- // padding-top: var(--status-bar-height);
- padding-bottom: 20rpx;
- height: 100%;
- }
- .my-header-right {
- height: 88rpx;
- padding-right: 28rpx;
- margin-top: var(--status-bar-height);
- @include u-flex(row, center, flex-end);
- image {
- margin-left: 32rpx;
- width: 48rpx;
- height: 48rpx;
- position: relative;
- }
- .badge::after {
- content: "";
- width: 16rpx;
- height: 16rpx;
- background: #2583EB;
- border-radius: 50%;
- position: absolute;
- right: 0;
- top: 0;
- }
- }
- .mybox {
- padding: 12rpx 24rpx;
- &-info {
- @include u-flex(row, center, flex-start);
- &-name {
- font-weight: 600;
- font-size: 40rpx;
- color: #222222;
- }
- .heads {
- width: 128rpx;
- height: 128rpx;
- border-radius: 50%;
- margin-right: 16rpx;
- }
- .arrow_black {
- width: 48rpx;
- height: 48rpx;
- }
- .vipbox {
- background: linear-gradient(90deg, #F26F00 0%, #FF9D1F 100%);
- border-radius: 20rpx 20rpx 20rpx 20rpx;
- border: 1rpx solid #FEDDB9;
- font-weight: 500;
- font-size: 22rpx;
- color: #FEF5EA;
- padding: 0 22rpx 0 12rpx;
- }
- }
- &-integral {
- margin-top: 48rpx;
- @include u-flex(row, center, flex-start);
- &-item {
- width: 25%;
- text-align: center;
- font-weight: 400;
- font-size: 24rpx;
- color: #757575;
- }
- .num {
- margin-bottom: 12rpx;
- font-family: DIN, DIN;
- font-weight: 500;
- font-size: 40rpx;
- color: #313131;
- }
- }
- &-menu {
- background: #FFFFFF;
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- padding: 32rpx 32rpx 36rpx 32rpx;
- margin: 20rpx 0;
- &-title {
- font-weight: 600;
- font-size: 36rpx;
- color: #222222;
- margin-bottom: 42rpx;
- }
- &-box {
- @include u-flex(row, center, flex-start);
- margin-bottom: -40rpx;
- flex-wrap: wrap;
- }
- &-item {
- width: 25%;
- margin-bottom: 40rpx;
- @include u-flex(column, center, center);
- font-weight: 400;
- font-size: 24rpx;
- color: #222222;
- image {
- height: 48rpx;
- width: 48rpx;
- margin-bottom: 10rpx;
- }
- }
- }
- }
- .vip-card {
- height: 172rpx;
- margin-top: 28rpx;
- background: url("@/static/image/my/vip_bg_left.png") no-repeat left / 128rpx 172rpx,
- url("@/static/image/my/vip_bg_right.png") no-repeat right / 324rpx 172rpx,
- linear-gradient(90deg, #FFF3DF 0%, #FADBA9 100%);
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- padding: 0 32rpx;
- box-sizing: border-box;
- @include u-flex(row, center, space-between);
- &-info {
- font-weight: 400;
- font-size: 24rpx;
- color: #834F00;
- margin-bottom: 26rpx;
- image {
- width: 126rpx;
- height: 30rpx;
- margin-right: 34rpx;
- }
- }
- &-price {
- font-weight: 500;
- font-size: 32rpx;
- color: #885201;
- line-height: 38rpx;
- text {
- font-family: Roboto, Roboto;
- font-weight: bold;
- font-size: 40rpx;
- color: #EA8F07;
- margin: 0 8rpx;
- }
- }
- .buyvip {
- height: 72rpx;
- background: #885201;
- border-radius: 36rpx 36rpx 36rpx 36rpx;
- font-weight: 600;
- font-size: 28rpx;
- color: #FFF6E7;
- line-height: 72rpx;
- padding: 0 32rpx;
- display: inline-block;
- }
- }
- .vip-card {
- height: 172rpx;
- margin-top: 28rpx;
- background: url("@/static/image/my/vip_bg_left.png") no-repeat left / 128rpx 172rpx,
- url("@/static/image/my/vip_bg_right.png") no-repeat right / 324rpx 172rpx,
- linear-gradient(90deg, #FFF3DF 0%, #FADBA9 100%);
- border-radius: 16rpx 16rpx 16rpx 16rpx;
- padding: 0 32rpx;
- box-sizing: border-box;
- @include u-flex(row, center, space-between);
- &-info {
- font-weight: 400;
- font-size: 24rpx;
- color: #834F00;
- margin-bottom: 26rpx;
- image {
- width: 126rpx;
- height: 30rpx;
- margin-right: 34rpx;
- }
- }
- &-price {
- font-weight: 500;
- font-size: 32rpx;
- color: #885201;
- line-height: 38rpx;
- text {
- font-family: Roboto, Roboto;
- font-weight: bold;
- font-size: 40rpx;
- color: #EA8F07;
- margin: 0 8rpx;
- }
- }
- .buyvip {
- height: 72rpx;
- background: #885201;
- border-radius: 36rpx 36rpx 36rpx 36rpx;
- font-weight: 600;
- font-size: 28rpx;
- color: #FFF6E7;
- line-height: 72rpx;
- padding: 0 32rpx;
- display: inline-block;
- }
- }
- .btns {
- height: 110rpx;
- }
- .login-btn {
- display: flex;
- align-items: center;
- justify-content: center;
- flex: 1;
- margin: 0 30rpx;
- height: 80rpx;
- background: #fff;
- // box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
- border-radius: 40rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333;
- }
- .activity-area {
- display: flex;
- justify-content: space-between;
- margin-top: 20rpx;
- }
- .activity-item {
- width: 48.5%;
- height: 160rpx;
- border-radius: 16rpx;
- padding: 12rpx;
- box-sizing: border-box;
- position: relative;
- display: flex;
- align-items: center;
- overflow: hidden;
- }
- .vip-bg {
- background-image: url('/static/image/my/vip_bg.png');
- background-repeat: no-repeat;
- background-size: 100% 100%;
- }
- .coin-bg {
- background-image: url('/static/image/my/fanghua_icon_bg.png');
- background-repeat: no-repeat;
- background-size: 100% 100%;
- }
- .desc {
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 20rpx;
- color: #995316;
- .highlight {
- font-family: Roboto, Roboto;
- font-weight: bold;
- font-size: 28rpx;
- color: #995316;
- margin: 0 4rpx;
- }
- }
- .action-btn {
- position: absolute;
- right: 12rpx;
- top: 50%;
- transform: translateY(-50%);
- background: #fff;
- font-size: 24rpx;
- padding: 10rpx 20rpx;
- border-radius: 30rpx;
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 20rpx;
- }
- .vip-bg .action-btn {
- color: #B47000;
- }
- .coin-bg .action-btn {
- color: #DF4E00;
- }
- </style>
|