index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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/voiceList')">
  80. <image src="/static/images/icon_company_3.png" mode=""></image>
  81. <text class="text">声音采集</text>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 退出登录按钮 -->
  86. <view class="logout" @click="logout">退出登录</view>
  87. </view>
  88. <!-- 分享弹窗 -->
  89. <u-popup :show="showShare" @close="showShare = false" >
  90. <share-box :shareItem="shareItem" :showCopy="false" @closeShare='showShare = false' ></share-box>
  91. </u-popup>
  92. </view>
  93. </template>
  94. <script>
  95. import {getUserInfo,getQrImg} from '@/api/companyUser'
  96. export default {
  97. data() {
  98. return {
  99. companyId:null,
  100. companyUserId:null,
  101. user:null,
  102. showShare:false,
  103. shareItem:{ imageUrl:"",title:"",path:"",isMini:true },
  104. };
  105. },
  106. onLoad() {
  107. },
  108. onShow() {
  109. this.companyId=uni.getStorageSync('companyId');
  110. this.companyUserId=uni.getStorageSync('companyUserId');
  111. this.getUserInfo()
  112. },
  113. onShareAppMessage(res) {
  114. return {
  115. title: "问诊",
  116. path: '/pages/TUIKit/TUIPages/TUIConversation/index',
  117. imageUrl: 'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  118. }
  119. },
  120. methods: {
  121. doShare(type){
  122. //#ifdef APP-PLUS
  123. if(type == '问诊') {
  124. this.shareItem.title= "问诊";
  125. this.shareItem.imageUrl='https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png';
  126. this.shareItem.compressImage = 1
  127. this.shareItem.isMini=true;
  128. this.shareItem.path='/pages/TUIKit/TUIPages/TUIConversation/index'
  129. let cdn=uni.getStorageSync('h5Path');
  130. this.shareItem.url=cdn+this.shareItem.path
  131. this.showShare=true;
  132. } else if(type == '健康档案') {
  133. this.shareItem.title= "健康档案";
  134. this.shareItem.imageUrl='https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png';
  135. this.shareItem.compressImage = 1
  136. this.shareItem.isMini=true;
  137. this.shareItem.path='/pages_user/healthRecords/index'
  138. let cdn=uni.getStorageSync('h5Path');
  139. this.shareItem.url=cdn+'/pages/user/healthRecords/index'
  140. this.showShare=true;
  141. }
  142. //#endif
  143. },
  144. navTo(url){
  145. uni.navigateTo({
  146. url: url
  147. })
  148. },
  149. getUserInfo(){
  150. var data={}
  151. getUserInfo(data).then(res => {
  152. if(res.code==200){
  153. this.user=res.data;
  154. }
  155. else{
  156. uni.setStorageSync('CompanyUserToken',null);
  157. uni.showToast({
  158. icon:'none',
  159. title: res.msg,
  160. });
  161. uni.navigateBack({
  162. delta:-1
  163. })
  164. }
  165. },
  166. rej => {}
  167. );
  168. },
  169. logout(){
  170. uni.showModal({
  171. title:"提示",
  172. content:"确认退出登录吗?",
  173. showCancel:true,
  174. cancelText:'取消',
  175. confirmText:'确定',
  176. success:res=>{
  177. if(res.confirm){
  178. uni.setStorageSync('CompanyUserToken',null);
  179. uni.navigateBack()
  180. }else{
  181. }
  182. }
  183. })
  184. },
  185. // 跳转页面
  186. navgetTo(url) {
  187. this.$isLogin().then(res => {
  188. if(res){
  189. uni.navigateTo({
  190. url: url
  191. })
  192. }
  193. })
  194. },
  195. }
  196. }
  197. </script>
  198. <style lang="scss">
  199. .content{
  200. padding: 20upx;
  201. .user-info{
  202. padding: 30upx;
  203. display: flex;
  204. align-items: center;
  205. justify-content: space-between;
  206. .left{
  207. position: relative;
  208. display: flex;
  209. .head-img{
  210. width: 120upx;
  211. height: 120upx;
  212. border-radius: 50%;
  213. overflow: hidden;
  214. margin-right: 30upx;
  215. border: 4upx solid #FFFFFF;
  216. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  217. image{
  218. width: 100%;
  219. height: 100%;
  220. }
  221. }
  222. .name-phone{
  223. padding-top: 15upx;
  224. .name{
  225. font-size: 36upx;
  226. font-family: PingFang SC;
  227. font-weight: bold;
  228. color: #111111;
  229. line-height: 1;
  230. }
  231. .phone{
  232. font-size: 28upx;
  233. font-family: PingFang SC;
  234. font-weight: 500;
  235. color: #666666;
  236. line-height: 1;
  237. margin-top: 30upx;
  238. }
  239. }
  240. }
  241. .msg-box{
  242. padding: 10rpx 20upx;
  243. font-size: 28upx;
  244. font-family: PingFang SC;
  245. font-weight: 500;
  246. color: #FFFFFF;
  247. border-radius: 8rpx;
  248. background-color: #FF5C03;
  249. }
  250. }
  251. .used-tools{
  252. box-sizing: border-box;
  253. background: #FFFFFF;
  254. border-radius: 16upx;
  255. padding: 40upx 30upx;
  256. .title{
  257. font-size: 32upx;
  258. font-family: PingFang SC;
  259. font-weight: bold;
  260. color: #222222;
  261. line-height: 1;
  262. }
  263. .tools-list{
  264. margin-top: 50upx;
  265. display: flex;
  266. flex-wrap: wrap;
  267. width: 100%;
  268. .item{
  269. box-sizing: border-box;
  270. width: 25%;
  271. display: flex;
  272. flex-direction: column;
  273. align-items: center;
  274. justify-content: center;
  275. margin-bottom: 50upx;
  276. position: relative;
  277. image{
  278. width: 44upx;
  279. height: 44upx;
  280. }
  281. .text{
  282. font-size: 24upx;
  283. font-family: PingFang SC;
  284. font-weight: 500;
  285. color: #111111;
  286. line-height: 1;
  287. margin-top: 20upx;
  288. }
  289. .share-btn{
  290. display: inline-block;
  291. position: absolute;
  292. top: 0;
  293. left: 0;
  294. width: 100%;
  295. height: 100%;
  296. opacity: 0;
  297. }
  298. }
  299. }
  300. }
  301. .logout{
  302. height: 80upx;
  303. line-height: 80upx;
  304. text-align: center;
  305. font-size: 26upx;
  306. font-family: PingFang SC;
  307. font-weight: 500;
  308. color: #666666;
  309. background: #FFFFFF;
  310. border-radius: 16upx;
  311. margin-top: 20upx;
  312. }
  313. }
  314. </style>