| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384 |
- <template>
- <view class="top-cont">
- <view class="content">
- <view class="user-info">
- <view class="left">
- <view class="name-phone">
- <view class="name" v-if="user != null">{{ user.nickName }}</view>
- <view class="phone" v-if="user != null">{{ $parsePhone(user.phonenumber) }}</view>
- </view>
- </view>
- <view class="msg-box" v-if="user != null">
- {{ user.deptName }}
- </view>
- </view>
- <!-- 常用工具 -->
- <view class="used-tools">
- <view class="title">常用工具</view>
- <view class="tools-list">
- <view class="item" @click="navTo('/pages/company/couponList?isShare=1&couponType=5')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">私域疗法券</text>
- </view>
- <view class="item" @click="navTo('/pages/company/couponList?isShare=1&couponType=2')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">中药免单券</text>
- </view>
- <view class="item" @click="navTo('/pages/company/couponList?isShare=1&couponType=4')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">中药打折券</text>
- </view>
- <view class="item" @click="navTo('/pages/company/packageList')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">疗法</text>
- </view>
- <view class="item" @click="navTo('/pages/store/inquirySelectType?companyId=' + companyId + '&companyUserId=' + companyUserId + '&isShare=1')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">会诊</text>
- </view>
- <view class="item" @click="navTo('/pages/store/inquirySelect?inquiryType=3&companyId=' + companyId + '&companyUserId=' + companyUserId + '&isShare=1')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">按方开药</text>
- </view>
- <view class="item" @click="navTo('/pages/company/packageOrderList')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">疗法订单</text>
- </view>
- <view class="item" @click="navTo('/pages/company/inquiryOrderList')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">问诊订单</text>
- </view>
- <view class="item" @click="navTo('/pages/company/storeOrderList')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">处方订单</text>
- </view>
- <view class="item" @click="doShare('问诊')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">问诊分享</text>
- <button class="share-btn" open-type="share"></button>
- </view>
- <view class="item" @click="doShare('健康档案')">
- <image src="/static/image/my/my_order_icon.png" mode=""></image>
- <text class="text">健康档案分享</text>
- <button class="share-btn" open-type="share"></button>
- </view>
- <view class="item" @click="navTo('/pages/company/bindInfo')">
- <image src="/static/image/my/my_order_icon.png" mode=""></image>
- <text class="text">公司码</text>
- <button class="share-btn" open-type="share"></button>
- </view>
- <view class="item" v-if="showManageCts" @click="navTo('/pages/ai/index')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">智能客服</text>
- <button class="share-btn" open-type="share"></button>
- </view>
- <view class="item" v-if="showManageCts" @click="navTo('/pages/company/voice')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">声音采集</text>
- </view>
- <view class="item" v-if="showManageCts" @click="navTo('/pages/company/voiceList')">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">声音录制</text>
- </view>
- <view class="item" @click="navTo(`/pages/doctor/doctorList?companyId=${companyId}&companyUserId=${companyUserId}&isShare=1`)">
- <image src="/static/images/icon_company_3.png" mode=""></image>
- <text class="text">预约挂号</text>
- </view>
- </view>
- </view>
- <!-- 退出登录按钮 -->
- <view class="logout" :style="{ opacity: isLoading ? 0.6 : 1 }" @click="logout">{{ isLoading ? '退出中...' : '退出登录' }}</view>
- </view>
- <!-- 分享弹窗 -->
- <u-popup :show="showShare" @close="showShare = false">
- <share-box :shareItem="shareItem" :showCopy="false" @closeShare="showShare = false"></share-box>
- </u-popup>
- </view>
- </template>
- <script>
- import { getUserInfo, getQrImg, companyJpushLoginout } from '@/api/companyUser';
- import IMSDK from 'openim-uniapp-polyfill';
- import { callingModule, meetingModule } from '@/pages_im/util/imCommon';
- export default {
- data() {
- return {
- companyId: null,
- companyUserId: null,
- user: null,
- showShare: false,
- showManageCts: false,
- showRemove: false,
- shareItem: { imageUrl: '', title: '', path: '', isMini: true },
- isLoading: false
- };
- },
- onLoad() {
- // #ifdef APP-PLUS
- let that = this;
- if (this.$isIos()) {
- this.showManageCts = uni.getStorageSync('showIOSPay');
- return;
- }
- if (this.$isAgreePrivacy()) {
- plus.runtime.getProperty(plus.runtime.appid, function (widgetinfo) {
- let platform = uni.getSystemInfoSync().platform;
- let srcData = JSON.parse(uni.getStorageSync('aVersion'));
- let data = srcData.data;
- let version = widgetinfo.versionCode; //app本地版本
- let serverVersion = data.versionCode; //升级包版本
- if (version == serverVersion) {
- that.showManageCts = uni.getStorageSync('showManageCts');
- } else {
- that.showManageCts = true;
- }
- });
- }
- // #endif
- },
- onShow() {
- this.companyId = uni.getStorageSync('companyId');
- this.companyUserId = uni.getStorageSync('companyUserId');
- this.getUserInfo();
- },
- onShareAppMessage(res) {
- return {
- title: '问诊',
- path: '/pages/TUIKit/TUIPages/TUIConversation/index',
- imageUrl: 'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
- };
- },
- methods: {
- doShare(type) {
- // #ifdef APP-PLUS
- if (type == '问诊') {
- this.shareItem.title = '问诊';
- this.shareItem.imageUrl = 'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png';
- this.shareItem.compressImage = 1;
- this.shareItem.isMini = true;
- this.shareItem.path = '/pages/TUIKit/TUIPages/TUIConversation/index';
- let cdn = uni.getStorageSync('h5Path');
- this.shareItem.url = cdn + this.shareItem.path;
- this.showShare = true;
- } else if (type == '健康档案') {
- this.shareItem.title = '健康档案';
- this.shareItem.imageUrl = 'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png';
- this.shareItem.compressImage = 1;
- this.shareItem.isMini = true;
- this.shareItem.path = '/pages_user/healthRecords/index';
- let cdn = uni.getStorageSync('h5Path');
- this.shareItem.url = cdn + '/pages/user/healthRecords/index';
- this.showShare = true;
- }
- // #endif
- },
- navTo(url) {
- uni.navigateTo({
- url: url
- });
- },
- getUserInfo() {
- var data = {};
- getUserInfo(data).then(
- (res) => {
- if (res.code == 200) {
- this.user = res.data;
- } else {
- uni.setStorageSync('CompanyUserToken', null);
- uni.showToast({
- icon: 'none',
- title: res.msg
- });
- uni.navigateBack({
- delta: -1
- });
- }
- },
- (rej) => {}
- );
- },
- async logout() {
- if (this.isLoading) return;
- uni.showModal({
- title: '提示',
- content: '确认退出登录吗?',
- showCancel: true,
- cancelText: '取消',
- confirmText: '确定',
- success: async (res) => {
- if (res.confirm) {
- this.isLoading = true;
- uni.showLoading({title: '退出中..',mask: true});
- // #ifdef APP-PLUS
- try {
- await companyJpushLoginout();
- } catch (e) {
- console.error('JPush logout failed', e);
- }
- // #endif
- uni.removeStorageSync('CompanyUserToken');
- uni.removeStorageSync('companyUser');
- uni.removeStorageSync('companyId');
- uni.removeStorageSync('companyUserId');
- IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid())
- .then(() => {
- callingModule?.endCall();
- meetingModule?.endCall();
- uni.removeStorage({key: 'IMToken'});
- uni.removeStorage({key: 'IMUserID'});
- uni.removeStorage({key: 'IMHasLogin'});
- setTimeout(() => {
- uni.$emit('refreshIM');
- }, 500);
- })
- .catch((err) => console.log(err))
- .finally(() => {
- uni.hideLoading();
- this.isLoading = false;
- uni.$emit('refreshIMMenu');
- uni.redirectTo({
- url: '/pages/company/login'
- });
- });
- }
- }
- });
- },
- // 跳转页面
- navgetTo(url) {
- this.$isLogin().then((res) => {
- if (res) {
- uni.navigateTo({
- url: url
- });
- }
- });
- }
- }
- };
- </script>
- <style lang="scss">
- .content {
- padding: 20upx;
- .user-info {
- padding: 30upx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .left {
- position: relative;
- display: flex;
- .head-img {
- width: 120upx;
- height: 120upx;
- border-radius: 50%;
- overflow: hidden;
- margin-right: 30upx;
- border: 4upx solid #ffffff;
- box-shadow: 0px 5px 15px 2px rgba(0, 0, 0, 0.1);
- image {
- width: 100%;
- height: 100%;
- }
- }
- .name-phone {
- padding-top: 15upx;
- .name {
- font-size: 36upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #111111;
- line-height: 1;
- }
- .phone {
- font-size: 28upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- line-height: 1;
- margin-top: 30upx;
- }
- }
- }
- .msg-box {
- padding: 10rpx 20upx;
- font-size: 28upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- border-radius: 8rpx;
- background-color: #FF5030;
- }
- }
- .used-tools {
- box-sizing: border-box;
- background: #ffffff;
- border-radius: 16upx;
- padding: 40upx 30upx;
- .title {
- font-size: 32upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #222222;
- line-height: 1;
- }
- .tools-list {
- margin-top: 50upx;
- display: flex;
- flex-wrap: wrap;
- width: 100%;
- .item {
- box-sizing: border-box;
- width: 25%;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- margin-bottom: 50upx;
- position: relative;
- image {
- width: 44upx;
- height: 44upx;
- }
- .text {
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- line-height: 1;
- margin-top: 20upx;
- }
- .share-btn {
- display: inline-block;
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- opacity: 0;
- }
- }
- }
- }
- .logout {
- height: 80upx;
- line-height: 80upx;
- text-align: center;
- font-size: 26upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- background: #ffffff;
- border-radius: 16upx;
- margin-top: 20upx;
- }
- }
- </style>
|