index.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <template>
  2. <view class="top-cont">
  3. <view class="content">
  4. <view class="user-info">
  5. <view class="left">
  6. <view class="name-phone">
  7. <view class="name" v-if="user!=null">{{user.nickName}}</view>
  8. <view class="phone" v-if="user!=null">{{$parsePhone(user.phonenumber)}}</view>
  9. </view>
  10. </view>
  11. <view class="msg-box" v-if="user!=null" >
  12. {{user.deptName}}
  13. </view>
  14. </view>
  15. <!-- 常用工具 -->
  16. <view class="used-tools">
  17. <view class="title">常用工具</view>
  18. <view class="tools-list">
  19. <!-- <view class="item" @click="navTo('/pages/company/couponList?isShare=1&couponType=5')">
  20. <image src="/static/images/icon_company_3.png" mode=""></image>
  21. <text class="text">私域疗法券</text>
  22. </view>
  23. <view class="item" @click="navTo('/pages/company/couponList?isShare=1&couponType=2')">
  24. <image src="/static/images/icon_company_3.png" mode=""></image>
  25. <text class="text">中药免单券</text>
  26. </view>
  27. <view class="item" @click="navTo('/pages/company/couponList?isShare=1&couponType=4')">
  28. <image src="/static/images/icon_company_3.png" mode=""></image>
  29. <text class="text">中药打折券</text>
  30. </view>
  31. <view class="item" @click="navTo('/pages/company/packageList')">
  32. <image src="/static/images/icon_company_3.png" mode=""></image>
  33. <text class="text">疗法</text>
  34. </view>
  35. <view class="item" @click="navTo('/pages/store/inquirySelectType?companyId='+companyId+'&companyUserId='+companyUserId+'&isShare=1')">
  36. <image src="/static/images/icon_company_3.png" mode=""></image>
  37. <text class="text">会诊</text>
  38. </view>
  39. <view class="item" @click="navTo('/pages/store/inquirySelect?inquiryType=3&companyId='+companyId+'&companyUserId='+companyUserId+'&isShare=1')">
  40. <image src="/static/images/icon_company_3.png" mode=""></image>
  41. <text class="text">按方开药</text>
  42. </view>
  43. <view class="item" @click="navTo('/pages/company/packageOrderList')">
  44. <image src="/static/images/icon_company_3.png" mode=""></image>
  45. <text class="text">疗法订单</text>
  46. </view>
  47. <view class="item" @click="navTo('/pages/company/inquiryOrderList')">
  48. <image src="/static/images/icon_company_3.png" mode=""></image>
  49. <text class="text">问诊订单</text>
  50. </view>
  51. <view class="item" @click="navTo('/pages/company/storeOrderList')">
  52. <image src="/static/images/icon_company_3.png" mode=""></image>
  53. <text class="text">处方订单</text>
  54. </view>
  55. <view class="item" @click="doShare('问诊')">
  56. <image src="/static/images/icon_company_3.png" mode=""></image>
  57. <text class="text">问诊分享</text>
  58. <button class='share-btn' open-type="share">
  59. </button>
  60. </view> -->
  61. <!-- <view class="item" @click="doShare('健康档案')">
  62. <image src="/static/image/my/my_order_icon.png" mode=""></image>
  63. <text class="text">健康档案分享</text>
  64. <button class='share-btn' open-type="share">
  65. </button>
  66. </view> -->
  67. <view class="item" @click="navTo('/pages/company/bindInfo')">
  68. <image src="/static/image/my/my_order_icon.png" mode=""></image>
  69. <text class="text">公司码</text>
  70. <button class='share-btn' open-type="share">
  71. </button>
  72. </view>
  73. <!-- <view class="item" @click="navTo('/pages/ai/index')">
  74. <image src="/static/images/icon_company_3.png" mode=""></image>
  75. <text class="text">AI客服</text>
  76. <button class='share-btn' open-type="share">
  77. </button>
  78. </view>
  79. <view class="item" @click="navTo('/pages/company/voice')">
  80. <image src="/static/images/icon_company_3.png" mode=""></image>
  81. <text class="text">声音采集</text>
  82. </view>
  83. <view class="item" @click="navTo('/pages/company/voiceList')">
  84. <image src="/static/images/icon_company_3.png" mode=""></image>
  85. <text class="text">声音录制</text>
  86. </view> -->
  87. </view>
  88. </view>
  89. <!-- 退出登录按钮 -->
  90. <view class="logout" @click="logout">退出登录</view>
  91. </view>
  92. <!-- 分享弹窗 -->
  93. <u-popup :show="showShare" @close="showShare = false" >
  94. <share-box :shareItem="shareItem" :showCopy="false" @closeShare='showShare = false' ></share-box>
  95. </u-popup>
  96. </view>
  97. </template>
  98. <script>
  99. import {getUserInfo,getQrImg} from '@/api/companyUser'
  100. import IMSDK from "openim-uniapp-polyfill";
  101. import { callingModule, meetingModule } from "@/pages_im/util/imCommon";
  102. export default {
  103. data() {
  104. return {
  105. companyId:null,
  106. companyUserId:null,
  107. user:null,
  108. showShare:false,
  109. shareItem:{ imageUrl:"",title:"",path:"",isMini:true },
  110. };
  111. },
  112. onLoad() {
  113. },
  114. onShow() {
  115. this.companyId=uni.getStorageSync('companyId');
  116. this.companyUserId=uni.getStorageSync('companyUserId');
  117. this.getUserInfo()
  118. },
  119. onShareAppMessage(res) {
  120. return {
  121. title: "问诊",
  122. path: '/pages/TUIKit/TUIPages/TUIConversation/index',
  123. imageUrl: 'https://zkzh-2025.oss-cn-beijing.aliyuncs.com/appimgs/minilogo.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  124. }
  125. },
  126. methods: {
  127. doShare(type){
  128. //#ifdef APP-PLUS
  129. if(type == '问诊') {
  130. this.shareItem.title= "问诊";
  131. this.shareItem.imageUrl='https://zkzh-2025.oss-cn-beijing.aliyuncs.com/appimgs/minilogo.png';
  132. this.shareItem.compressImage = 1;
  133. this.shareItem.isMini=true;
  134. this.shareItem.path='/pages/TUIKit/TUIPages/TUIConversation/index'
  135. let cdn=uni.getStorageSync('h5Path');
  136. this.shareItem.url=cdn+this.shareItem.path
  137. this.showShare=true;
  138. } else if(type == '健康档案') {
  139. this.shareItem.title= "健康档案";
  140. this.shareItem.imageUrl='https://zkzh-2025.oss-cn-beijing.aliyuncs.com/appimgs/minilogo.png';
  141. this.shareItem.compressImage = 1;
  142. this.shareItem.isMini=true;
  143. this.shareItem.path='/pages_user/healthRecords/index'
  144. let cdn=uni.getStorageSync('h5Path');
  145. this.shareItem.url=cdn+'/pages/user/healthRecords/index'
  146. this.showShare=true;
  147. }
  148. //#endif
  149. },
  150. navTo(url){
  151. uni.navigateTo({
  152. url: url
  153. })
  154. },
  155. getUserInfo(){
  156. var data={}
  157. getUserInfo(data).then(res => {
  158. if(res.code==200){
  159. this.user=res.data;
  160. }
  161. else{
  162. uni.setStorageSync('CompanyUserToken',null);
  163. uni.showToast({
  164. icon:'none',
  165. title: res.msg,
  166. });
  167. uni.navigateBack({
  168. delta:-1
  169. })
  170. }
  171. },
  172. rej => {}
  173. );
  174. },
  175. logout(){
  176. uni.showModal({
  177. title:"提示",
  178. content:"确认退出登录吗?",
  179. showCancel:true,
  180. cancelText:'取消',
  181. confirmText:'确定',
  182. success:res=>{
  183. if(res.confirm){
  184. uni.removeStorageSync('ManageToken');
  185. uni.removeStorageSync('CompanyUserToken');
  186. uni.removeStorageSync('companyUser');
  187. uni.removeStorageSync('companyUserId')
  188. uni.removeStorageSync('companyUserInfo')
  189. IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid()).then(() => {
  190. callingModule?.endCall();
  191. meetingModule?.endCall();
  192. uni.removeStorage({ key: 'IMToken' });
  193. uni.removeStorage({ key: 'IMUserID' });
  194. uni.removeStorage({ key: "IMHasLogin" });
  195. setTimeout(()=>{
  196. uni.$emit('refreshIM');
  197. },500);
  198. }).catch((err) => console.log(err)).finally(() => {
  199. uni.$emit('refreshIMMenu');
  200. uni.navigateBack();
  201. });
  202. }else{
  203. }
  204. }
  205. })
  206. },
  207. // 跳转页面
  208. navgetTo(url) {
  209. this.$isLogin().then(res => {
  210. if(res){
  211. uni.navigateTo({
  212. url: url
  213. })
  214. }
  215. })
  216. },
  217. }
  218. }
  219. </script>
  220. <style lang="scss">
  221. .content{
  222. padding: 20upx;
  223. .user-info{
  224. padding: 30upx;
  225. display: flex;
  226. align-items: center;
  227. justify-content: space-between;
  228. .left{
  229. position: relative;
  230. display: flex;
  231. .head-img{
  232. width: 120upx;
  233. height: 120upx;
  234. border-radius: 50%;
  235. overflow: hidden;
  236. margin-right: 30upx;
  237. border: 4upx solid #FFFFFF;
  238. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  239. image{
  240. width: 100%;
  241. height: 100%;
  242. }
  243. }
  244. .name-phone{
  245. padding-top: 15upx;
  246. .name{
  247. font-size: 36upx;
  248. font-family: PingFang SC;
  249. font-weight: bold;
  250. color: #111111;
  251. line-height: 1;
  252. }
  253. .phone{
  254. font-size: 28upx;
  255. font-family: PingFang SC;
  256. font-weight: 500;
  257. color: #666666;
  258. line-height: 1;
  259. margin-top: 30upx;
  260. }
  261. }
  262. }
  263. .msg-box{
  264. padding: 10rpx 20upx;
  265. font-size: 28upx;
  266. font-family: PingFang SC;
  267. font-weight: 500;
  268. color: #FFFFFF;
  269. border-radius: 8rpx;
  270. background-color: #FF233C;
  271. }
  272. }
  273. .used-tools{
  274. box-sizing: border-box;
  275. background: #FFFFFF;
  276. border-radius: 16upx;
  277. padding: 40upx 30upx;
  278. .title{
  279. font-size: 32upx;
  280. font-family: PingFang SC;
  281. font-weight: bold;
  282. color: #222222;
  283. line-height: 1;
  284. }
  285. .tools-list{
  286. margin-top: 50upx;
  287. display: flex;
  288. flex-wrap: wrap;
  289. width: 100%;
  290. .item{
  291. box-sizing: border-box;
  292. width: 25%;
  293. display: flex;
  294. flex-direction: column;
  295. align-items: center;
  296. justify-content: center;
  297. margin-bottom: 50upx;
  298. position: relative;
  299. image{
  300. width: 44upx;
  301. height: 44upx;
  302. }
  303. .text{
  304. font-size: 24upx;
  305. font-family: PingFang SC;
  306. font-weight: 500;
  307. color: #111111;
  308. line-height: 1;
  309. margin-top: 20upx;
  310. }
  311. .share-btn{
  312. display: inline-block;
  313. position: absolute;
  314. top: 0;
  315. left: 0;
  316. width: 100%;
  317. height: 100%;
  318. opacity: 0;
  319. }
  320. }
  321. }
  322. }
  323. .logout{
  324. height: 80upx;
  325. line-height: 80upx;
  326. text-align: center;
  327. font-size: 26upx;
  328. font-family: PingFang SC;
  329. font-weight: 500;
  330. color: #666666;
  331. background: #FFFFFF;
  332. border-radius: 16upx;
  333. margin-top: 20upx;
  334. }
  335. }
  336. </style>