| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439 |
- <template>
- <view class="container">
- <!-- <scroll-view @scrolltolower="scrollTolower" :scroll-top="userScrollTop" scroll-y="true" class="container"
- @scroll="userScroll"> -->
- <view class="top-cont u-f es-ver">
- <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">
- <image :class="isNew ? 'badge':''" @tap="goToMsg()" src="@/static/image/hall/new_hall_icon.png"
- mode="aspectFill"></image>
- </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="user&&user.avatar||avatar"
- mode="aspectFill"></image>
- <view>
- <view class="flexBetween">
- <view class="flex-center es-c-22 fs20" @tap="navToUserInfo('./userInfo')">
- <text
- class="mybox-info-name ellipsis2">{{ isLogin&&user&&user.nickName || '请登录' }}</text>
- <!-- <image class="arrow_black" src="@/static/image/my/right_arrow_black_icon.png"
- mode="aspectFill"></image> -->
- </view>
- <!-- <image v-if="isOpen" class="es-w-40 es-h-40 es-mr-10" src="@/static/svg/code_icon20.svg"
- @tap="toSelfQr()" mode="aspectFill"></image> -->
- </view>
- <view class="flexBetween es-mt-20" @tap="toSelfQr()" v-if="isOpen">
- <view class="qyh es-c-75">
- ID:U{{user.userId}}
- </view>
- <!-- <image class="arrow_black" src="@/static/image/my/right_arrow_black_icon.png"
- mode="aspectFill"></image> -->
- </view>
- <view class="flex-center" style="margin-top: 14rpx;" v-if="false">
- <view class="flex-center vipbox" v-if="user.isVip==1&&(!isIos || (isIos&&showIOSPay==1))"
- @click="loginNavTo('/pages/course/vipBuy')">
- <image class="arrow_black" src="@/static/image/my/lv_icon.png" mode="aspectFill">
- </image>
- <text class="es-c-FEF5EA">会员</text>
- </view>
- <view class="flex-center vipbox intelligentBox" style="margin-left: 16rpx;"
- v-if="user.vipLevel">
- <image class="arrow_black" src="@/static/image/my/intelligent_icon.png"
- mode="aspectFill">
- </image>
- <text class="es-c-FEF5EA">LV.{{user.vipLevel}}</text>
- </view>
- </view>
- </view>
- </view>
- <!-- 福币,币,券信息 -->
- <view class="mybox-integral" v-if="false">
- <view class="mybox-integral-item" @click="loginNavTo('/pages/user/integral/points')">
- <view class="num">{{user.integral}}</view>
- <view>福币</view>
- </view>
- <view class="mybox-integral-item" @click="loginNavTo('/pages/user/coupon/myCouponList?type=0')">
- <view class="num">{{coupons.notUsedCount}}</view>
- <view>待用券</view>
- </view>
- <view class="mybox-integral-item" @click="loginNavTo('/pages/user/coupon/myCouponList?type=1')">
- <view class="num">{{coupons.usedCount}}</view>
- <view>已用券</view>
- </view>
- <view class="mybox-integral-item" @click="loginNavTo('/pages/user/coupon/myCouponList?type=2')">
- <view class="num">{{coupons.expiredCount}}</view>
- <view>过期券</view>
- </view>
- </view>
- <!-- vip会员 -->
- <!-- <view class="vip-card" v-if="false && user.userId&&(!isIos || (isIos&&showIOSPay==1))">
- <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 class="menuBox">
- <view class="mybox-menu" v-for="(item, index) in menuList" :key="index"
- :style="{marginTop:index === 0 ? '40rpx':'30rpx'}">
- <view class="u-f-jsb u-f" style="margin-bottom: 36rpx;">
- <view class="mybox-menu-title">{{item.menuTitle}}</view>
- <navigator url="/pages_user/user/storeOrder" v-if="index==0" class="u-f-ajc">
- <text class="allOrderTextClass">全部订单</text>
- <u-icon name="arrow-right" size="26rpx" color="#00000073"></u-icon>
- </navigator>
- <!-- <view class="es-c-99 es-fs-24 u-f-ajc" v-if="index==0" @tap="myOrderFun">
- <view class="es-mr-10">我的订单</view>
- <view class="u-f-ajc">
- <u-icon name="arrow-right" size="24rpx" color="#999999"></u-icon>
- </view>
- </view> -->
- </view>
- <view class="mybox-menu-box">
- <!-- :class="[index==0?'w20':'']" -->
- <view class="mybox-menu-item" v-for="(menu, idx) in item.menus" :key="idx"
- @click="handleMenu(menu)">
- <view class="mybox-menu-itemImage">
- <image :src="menu.icon" mode="aspectFill"></image>
- <view v-if="index==0 && 0" class="numBox es-c-white es-fs-20">8</view>
- </view>
- <text>{{menu.name}}</text>
- </view>
- </view>
- </view>
- <view class="mybox-menu" v-for="(item, index) in menuToolList" :key="index"
- style="margin-top: 30rpx;">
- <view class="u-f-jsb u-f" style="margin-bottom: 36rpx;">
- <view class="mybox-menu-title">{{item.menuTitle}}</view>
- </view>
- <view class="mybox-menu-box-tool">
- <view class="myboxToolMenuItem" v-for="(menu, idx) in item.menus" :key="idx"
- @click="handleMenu(menu)">
- <view class="myboxToolMenuItemLeft">
- <image :src="menu.icon" mode="aspectFill"></image>
- <text>{{menu.name}}</text>
- </view>
- <u-icon name="arrow-right" size="28rpx" color="#000000A6"></u-icon>
- </view>
- </view>
- </view>
- </view>
- <view class="btns es-mt-40" v-if="isLogin">
- <view class="login-btn" @click="showLogout">退出登录</view>
- </view>
- </view>
- </view>
- <u-popup :show="inviteShow" @close="inviteShow=false" round="32rpx">
- <view class="popupBox">
- <view class="u-f-ajc u-f-jsb">
- <view class="es-fs-36 es-c-00 es-fw-500">
- 填写朋友邀请码
- </view>
- <view class="" @tap="scanCodeFun">
- <image class="es-icon-48" src="/static/img/scan_icon24.eb4f6feb.svg" mode=""></image>
- </view>
- </view>
- <input type="text" v-model="inviteCode" class="es-mt-42 es-fs-32" placeholder="请输入邀请码"
- placeholder-style="{color: #B2B2B2;}" />
- <view class="u-f-ajc es-mt-56">
- <view class="popupBox-btn es-mr-32 u-f-ajc colorE62129" @tap="inviteShow=false">
- 取消
- </view>
- <view class="popupBox-btn u-f-ajc bgE62129 es-c-white" @tap="invitationCodeFun">
- 确认
- </view>
- </view>
- </view>
- </u-popup>
- <!-- </scroll-view> -->
- </view>
- </template>
- <script>
- import {
- getConfigByKey,
- getIOSPayStatus
- } from '@/api/common.js';
- import {
- startDrugReport,
- getUserFollowDoctor
- } from '@/api/drugReport';
- import {
- getUserInfo,
- bindSales,
- 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 {
- isMiOpen
- } from '@/api/common.js';
- export default {
- data() {
- return {
- inviteCode: '',
- inviteShow: false,
- isLogin: false,
- coupons: {
- expiredCount: 0,
- notUsedCount: 0,
- usedCount: 0
- },
- show: false,
- avatar: avatar,
- 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
- },
- isNew: false,
- top: 0,
- userScrollTop: 0,
- isOpen: true,
- fixedTop: false, // 是否固定头部
- statusBarHeight: uni.getStorageSync('statusBarHeight'),
- menuList: [],
- menuToolList: [{
- menuTitle: "常用工具",
- menus: [{
- name: '地址管理',
- icon: "/static/image/my/address_management_icon.png",
- pageUrl: "/pages/user/address"
- },
- {
- name: '优惠券',
- icon: "/static/image/my/coupon_collection.png",
- pageUrl: "/pages_shopping/shopping/myCoupon"
- },
- {
- name: '关于我们',
- icon: "/static/image/my/feedback_icon.png",
- pageUrl: "/pages/user/about"
- }
- ]
- }],
- isIos: false,
- showIOSPay: 0
- }
- },
- onLoad() {
- let that = this;
- uni.$on('refreshUserInfo', function() {
- if (that.$isLogin()) {
- that.getUserInfo();
- that.$updateMsgDot()
- } else {
- that.isLogin = that.$isLogin()
- }
- });
- 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();
- this.isIos = (plus.os.name == "iOS")
- if (this.isIos) {
- this.getIOSPayStatusFun()
- }
- // #endif
- },
- onUnload() {
- uni.$off('refreshUserInfo');
- },
- onShow() {
- uni.showTabBar();
- 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;
- }
- },
- created() {
- this.initMenu();
- },
- methods: {
- async initMenu() {
- this.menuList = [{
- menuTitle: "我的订单",
- menus: [{
- name: '待付款',
- icon: "/static/image/mall/payment.png",
- myOrder: true
- }, {
- name: '待发货',
- icon: "/static/image/mall/send_goods.png",
- myOrder: true
- }, {
- name: '待收货',
- icon: "/static/image/mall/sou_goods.png",
- myOrder: true
- }, {
- name: '已完成',
- icon: "/static/image/mall/completed.png",
- myOrder: true
- }, {
- name: '售后退款',
- icon: "/static/image/mall/after_sales.png",
- pageUrl: "/pages_user/user/refundOrderList"
- }]
- },
- // {
- // menuTitle: "医疗服务",
- // menus: [
- // {
- // name: '我的处方',
- // icon: "../../static/image/my/my_prescription_icon.png",
- // pageUrl:"/pages/store/prescribeList"
- // },{
- // name: '我的医生',
- // icon: "../../static/image/my/my_doctor_icon.png",
- // pageUrl:"./myDoctorList"
- // },{
- // name: '随访服务',
- // icon: "../../static/image/my/follow_up_icon.png",
- // pageUrl:"/pages/user/followList"
- // },{
- // name: '用药咨询',
- // icon: "../../static/image/my/medical_consultation_icon.png",
- // pageUrl:"/pages/store/inquiryOrderList",
- // isIm:true
- // },{
- // name: '用药报告',
- // icon: "../../static/image/my/medication_report_icon.png",
- // pageUrl:"/pages/user/drugReportList"
- // }
- // ]
- // },
- // {
- // menuTitle: "我的应用",
- // menus: [
- // // {
- // // name: '健康档案',
- // // icon: "../../static/image/my/my_order_icon.png",
- // // pageUrl: "/pages/user/healthRecords/index"
- // // }
- // // ,{
- // // name: '就诊管理',
- // // icon: "../../static/image/my/visit_icon.png",
- // // pageUrl:"./patient"
- // // },
- // {
- // name: '地址管理',
- // icon: "../../static/image/my/address_management_icon.png",
- // pageUrl: "./address"
- // },
- // // {
- // // name: '福币管理',
- // // icon: "/static/image/my/my_points_icon.png",
- // // pageUrl: "/pages_user/user/integral"
- // // },
- // {
- // name: '优惠券',
- // icon: "../../static/image/my/coupon_collection.png",
- // pageUrl: "/pages_shopping/shopping/myCoupon"
- // },
- // // {
- // // name: '购物车',
- // // icon: "/static/image/mall/cart.png",
- // // pageUrl: "/pages/shopping/cart"
- // // },
- // // {
- // // name: '我的足迹',
- // // icon: "/static/image/mall/footprint.png",
- // // pageUrl: "/pages_user/user/storeProductRelation"
- // // },
- // // {
- // // name: '制单管理',
- // // icon: "/static/image/my/my_cforder_icon.png",
- // // documentPreparation: true
- // // }
- // // {
- // // name: '专属客服',
- // // icon: "/static/image/my/drzy_icon.png",
- // // isService: true
- // // },
- // // {
- // // name: '领券中心',
- // // icon: "../../static/image/my/coupon_collection.png",
- // // pageUrl: "/pages/company/couponList?couponType=6"
- // // }
- // // ,{
- // // name: '健康产品',
- // // icon: "../../static/image/my/my_points_icon.png",
- // // pageUrl:"/pages/shopping/index"
- // // }
- // // ,{
- // // name: '会员中心',
- // // icon: "../../static/image/my/member_icon.png",
- // // isUserService:true,
- // // pageUrl:""
- // // }
- // // ,{
- // // name: '健康管家',
- // // icon: "../../static/image/my/my_doctor_icon.png",
- // // pageUrl: "/pages/user/addHealthButler"
- // // }
- // // ,{
- // // name: '开票历史',
- // // icon: "../../static/image/my/invoicing_icon.png",
- // // pageUrl:"/pages/store/invoice/invoiceList",
- // // }
- // // ,{
- // // name: '客服中心',
- // // icon: "../../static/image/my/service_center_icon.png",
- // // pageUrl:""
- // // },
- // {
- // name: '看课通知',
- // icon: "../../static/image/my/my_order_icon.png",
- // pageUrl: "/pages/courseAnswer/list"
- // }, {
- // name: '投诉建议',
- // icon: "../../static/image/my/tsjy.png",
- // pageUrl: "/pages/user/feedback"
- // },
- // {
- // name: '直播',
- // icon: "/static/images/live/live.png",
- // pageUrl: "/pages_live/livingList",
- // isShow: true
- // },
- // {
- // name: '直播订单',
- // icon: "../../static/image/my/my_cforder_icon.png",
- // pageUrl: "/pages_live/shopping/order",
- // isShow: true
- // },
- // {
- // name: '直播售后',
- // icon: "../../static/images/live/live_sale.png",
- // pageUrl: "/pages_live/shopping/storeOrderRefundList",
- // isShow: true
- // },
- // {
- // name: '商城订单',
- // icon: "../../static/image/my/my_cforder_icon.png",
- // pageUrl: "/pages_user/user/storeOrder?status=",
- // isShow: true
- // },
- // {
- // name: '商城售后',
- // icon: "../../static/images/live/live_sale.png",
- // pageUrl: "/pages_user/user/refundOrderList",
- // isShow: true
- // },
- // ]
- // },
- // {
- // menuTitle: "我的视频",
- // menus: [{
- // name: '我的收藏',
- // icon: "../../static/image/my/collect_icon.png",
- // pageUrl: "./myFavoriteVideo"
- // }, {
- // name: '我的评论',
- // icon: "../../static/image/my/evaluate_icon.png",
- // pageUrl: "/pages/store/inquiryOrderPingList"
- // }]
- // },
- // {
- // menuTitle: "管理应用",
- // menus: [
- // // {
- // // name: '医生入驻',
- // // icon: "../../static/image/my/doctor_entrance_icon.png",
- // // pageUrl:"/pages/user/registerDoctor?type=1"
- // // },{
- // // name: '药师入驻',
- // // icon: "../../static/image/my/pharmacist_entrance_icon.png",
- // // pageUrl:"/pages/user/registerDoctor?type=2"
- // // },
- // {
- // name: '达人主页',
- // icon: "../../static/image/my/drzy_icon.png",
- // pageUrl: "/pages/expert/index"
- // },
- // // {
- // // name: '销售登录',
- // // icon: "../../static/image/my/login_icon.png",
- // // isSale: true,
- // // pageUrl: "",
- // // },
- // // {
- // // name: '客服登录',
- // // icon: "../../static/image/my/login_icon.png",
- // // isService: true,
- // // pageUrl: "",
- // // },
- // {
- // name: '关于我们',
- // icon: "../../static/image/my/feedback_icon.png",
- // pageUrl: "./about"
- // }
- // ]
- // }
- ]
- let param = {
- key: "app.config"
- };
- let result = await getConfigByKey(param)
- result = result.data && JSON.parse(result.data)
- if (result.tongueFlag && result.tongueFlag != '0') {
- const menuExists3 = this.menuList[0].menus.some(menu => menu.name === '舌苔报告');
- if (!menuExists3) {
- this.menuList[0].menus.push({
- name: '舌苔报告',
- icon: "../../static/image/my/shetai.png",
- pageUrl: "/pages/user/tongue/tongueList"
- })
- }
- const menuExists4 = this.menuList[0].menus.some(menu => menu.name === 'AI舌诊');
- if (!menuExists4) {
- this.menuList[0].menus.push({
- name: 'AI舌诊',
- icon: "/static/image/my/tongue.png",
- pageUrl: "/pages/user/tongue/index"
- })
- }
- }
- if (false && this.user && !this.user.invitedBySalesId) {
- const isExist = this.menuList.some(item => item.name === '填写邀请码');
- if (!isExist) {
- this.menuList[2].menus.push({
- name: '填写邀请码',
- icon: "../../static/image/my/my_cforder_icon.png",
- isIinvitation: true
- })
- }
- }
- if (false &&this.user && this.user.isCompanyUser) {
- const menuExists = this.menuList[2].menus.some(menu => menu.name === '客服登录');
- if (!menuExists) {
- this.menuList[2].menus.push({
- name: '客服登录',
- icon: "../../static/image/my/login_icon.png",
- isService: true,
- pageUrl: "",
- })
- }
- const menuExists1 = this.menuList[2].menus.some(menu => menu.name === '销售登录');
- if (!menuExists1) {
- this.menuList[2].menus.push({
- name: '销售登录',
- icon: "../../static/image/my/login_icon.png",
- isSale: true,
- pageUrl: "",
- })
- }
- }
- },
- scanCodeFun() {
- let that = this
- uni.scanCode({
- onlyFromCamera: true,
- success: function(res) {
- console.log('条码内容:' + res.result);
- const uIndex = res.result.indexOf('U');
- that.inviteCode = uIndex !== -1 ? res.result.slice(uIndex + 1) : res.result;
- that.invitationCodeFun()
- }
- });
- },
- async invitationCodeFun() {
- let params = {
- userId: this.user.userId,
- inviteCode: this.inviteCode
- }
- const res = await bindSales(params)
- if (res.code == 200) {
- uni.showToast({
- icon: 'none',
- title: '绑定成功!'
- })
- this.inviteShow = false
- this.getUserInfo()
- this.menuList[2].menus.pop();
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg
- })
- }
- },
- getIOSPayStatusFun() {
- getIOSPayStatus().then(res => {
- if (res.code == 200) {
- this.showIOSPay = res.iosPayStatus
- }
- })
- },
- 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.clearStorage()
- this.$logout();
- 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;
- },
- toSale() {
- if (this.$isLogin()) {
- var token = uni.getStorageSync('ManageToken');
- if (token) {
- uni.navigateTo({
- url: '/pages_manage/index'
- })
- } else {
- uni.navigateTo({
- url: '/pages_manage/login'
- });
- }
- } else {
- this.$showLoginPage();
- }
- },
- documentPreparationFun() {
- if (this.$checkCompanyUserLoginState()) {
- uni.navigateTo({
- url: '/pages_company/index'
- })
- } else {
- uni.navigateTo({
- url: '/pages_company/auth/login'
- })
- }
- },
- myOrderFun(item) {
- const arr = ['待付款', '待发货', '待收货', '已完成']
- let status = ''
- if (item.name) {
- status = arr.indexOf(item.name)
- }
- uni.navigateTo({
- url: '/pages_user/user/storeOrder?status=' + status
- })
- },
- handleMenu(item) {
- if (item.isIm != undefined && item.isIm) {
- this.toIM();
- } else if (item.isIinvitation != undefined && item.isIinvitation) {
- this.inviteShow = true
- } else if (item.documentPreparation != undefined && item.documentPreparation) {
- this.documentPreparationFun();
- } else if (item.myOrder != undefined && item.myOrder) {
- this.myOrderFun(item);
- } else if (item.isService != undefined && item.isService) {
- this.toCompany();
- } else if (item.isSale != undefined && item.isSale) {
- this.toSale();
- } 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(url);
- uni.navigateTo({
- url: url
- });
- },
- loginNavTo(url) {
- if (!this.$isLogin()) {
- this.$showLoginPage();
- return;
- }
- uni.navigateTo({
- url: url
- });
- },
- navToUserInfo(url) {
- if (!this.$isLogin() || !this.user.userId) {
- 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.initMenu()
- } 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: getApp().globalData.miniprogamId,
- 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) {
- });
- },
- toSelfQr() {
- uni.navigateTo({
- url: '/pages_im/pages/common/userOrGroupQrCode/index',
- });
- },
- userIsDel() {
- return this.user.status == 0;
- },
- isMiOpen() {
- isMiOpen().then((res) => {
- if (res.code == 200) {
- uni.setStorageSync('isOpen', res.data);
- this.isOpen = res.data;
- }
- });
- },
- },
- computed: {
- // 计算属性的 getter
- headerBG: function() {
- var top = this.top / 88;
- return 'rgba(253,224,204, ' + top + ')';
- },
- }
- }
- </script>
- <style scoped lang="scss">
- page {
- height: 100%;
- background: #F4F6F7;
- }
- .top-cont {
- height: 100vh;
- // overflow: hidden;
- // height: 370rpx;
- position: relative;
- display: flex;
- flex-direction: column;
- &::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: rgba(253, 224, 204, 1);
- 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: 34rpx;
- color: #070707;
- 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);
- }
- .flexBetween {
- width: calc(100vw - 240rpx);
- @include u-flex(row, center, space-between);
- }
- .container {
- background-image: url("@/static/images/bg.png");
- background-size: contain;
- background-repeat: no-repeat;
- background-position: top;
- 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: #FF233C;
- border-radius: 50%;
- position: absolute;
- right: 0;
- top: 0;
- }
- }
- .mybox {
- flex: 1;
- overflow-y: auto;
- overflow-x: hidden;
- padding: 12rpx 24rpx;
- &-info {
- padding: 0 16rpx;
- @include u-flex(row, flex-start, flex-start);
- &-name {
- font-weight: 600;
- font-size: 40rpx;
- color: #000000;
- }
- .heads {
- width: 150rpx;
- height: 150rpx;
- border: 4rpx solid #FFFFFF;
- border-radius: 50%;
- margin-right: 20rpx;
- }
- .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;
- padding: 30rpx 30rpx 40rpx 24rpx;
- margin: 20rpx 0;
- &-title {
- font-weight: 600;
- font-size: 40rpx;
- color: rgba(0, 0, 0, 0.85);
- }
- &-box {
- @include u-flex(row, center, flex-start);
- margin-bottom: -40rpx;
- flex-wrap: wrap;
- }
- .mybox-menu-box-tool {
- @include u-flex(column, center, center);
- padding: 2rpx 16rpx;
- .myboxToolMenuItem {
- @include u-flex(row, center, space-between);
- width: 100%;
- padding-bottom: 44rpx;
- margin-bottom: 38rpx;
- border-bottom: 2rpx solid #D8D8D8;
- .myboxToolMenuItemLeft {
- @include u-flex(row, center, center);
- image {
- width: 50rpx;
- height: 50rpx;
- }
- text {
- font-weight: 400;
- font-size: 36rpx;
- color: rgba(0, 0, 0, 0.85);
- margin-left: 42rpx;
- }
- }
- }
- .myboxToolMenuItem:last-child {
- border-bottom: none;
- padding-bottom: 0;
- margin-bottom: 0;
- }
- }
- .w20 {
- width: 20% !important;
- }
- &-item {
- width: 33.3%;
- margin-bottom: 34rpx;
- @include u-flex(column, center, center);
- font-weight: 400;
- font-size: 36rpx;
- color: rgba(0, 0, 0, 0.85);
- .mybox-menu-itemImage {
- position: relative;
- margin-bottom: 10rpx;
- .numBox {
- position: absolute;
- top: -16rpx;
- right: -16rpx;
- border-radius: 50%;
- padding: 8rpx;
- background: #FF7163;
- }
- image {
- height: 60rpx;
- width: 60rpx;
- }
- }
- }
- }
- }
- .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;
- padding-bottom: 88rpx;
- }
- .login-btn {
- display: flex;
- align-items: center;
- justify-content: center;
- flex: 1;
- height: 110rpx;
- background: #fff;
- // box-shadow: 0px 7rpx 6rpx 0px rgba(229, 138, 0, 0.22);
- border-radius: 24rpx;
- font-family: PingFang SC;
- font-weight: 400;
- font-size: 36rpx;
- color: rgba(0,0,0,0.65);
- }
- .popupBox {
- padding: 36rpx 40rpx;
- input {
- padding: 30rpx 0;
- border-bottom: 1rpx solid #EAEAEA;
- margin-top: 42rpx;
- }
- .es-mt-56 {
- margin-top: 56rpx;
- }
- .popupBox-btn {
- width: 282rpx;
- height: 104rpx;
- border-radius: 12rpx;
- background: #F2F2F2;
- }
- .colorE62129 {
- color: #E62129;
- }
- .bgE62129 {
- background: #E62129;
- }
- }
- .menuBox {
- // flex: 1;
- // overflow-y: scroll;
- // overflow-x: hidden;
- }
- .qyh {
- font-size: 32rpx !important;
- color: rgba(0, 0, 0, 0.85) !important;
- }
- .allOrderTextClass {
- font-weight: 400;
- font-size: 32rpx;
- color: #00000073;
- margin-right: 10rpx;
- }
- </style>
|