index.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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_my_coupon.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_my_coupon.png" mode=""></image>
  25. <text class="text">中药免单券</text>
  26. </view>
  27. <view class="item" @click="navTo('/pages_company/packageList')">
  28. <image src="/static/images/icon_company_2.png" mode=""></image>
  29. <text class="text">疗法</text>
  30. </view>
  31. <view class="item" @click="navTo('/pages_order/inquirySelectType?companyId='+companyId+'&companyUserId='+companyUserId+'&isShare=1')">
  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_order/inquirySelect?inquiryType=3&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_company/packageOrderList')">
  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/inquiryOrderList')">
  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/storeOrderList')">
  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_user/healthRecords/index')">
  52. <image src="../static/images/icon_company_3.png" mode=""></image>
  53. <view class="text">健康档案</view>
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 退出登录按钮 -->
  58. <view class="logout" @click="logout">退出登录</view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import {getUserInfo,getQrImg} from '@/api/companyUser'
  64. export default {
  65. data() {
  66. return {
  67. companyId:null,
  68. companyUserId:null,
  69. user:null,
  70. };
  71. },
  72. onLoad() {
  73. },
  74. onShow() {
  75. this.companyId=uni.getStorageSync('companyId');
  76. this.companyUserId=uni.getStorageSync('companyUserId');
  77. console.log(this.companyUserId)
  78. this.getUserInfo()
  79. },
  80. onShareAppMessage(res) {
  81. return {
  82. title: "问诊",
  83. path: '/pages/TUIKit/TUIPages/TUIConversation/index',
  84. imageUrl: 'https://hos-1309931967.cos.ap-chongqing.myqcloud.com/fs/20230106/6b459adfb1004c1a96219bcdf07e337c.png' //分享图标,路径可以是本地文件路径、代码包文件路径或者网络图片路径.支持PNG及JPG。显示图片长宽比是 5:4
  85. }
  86. },
  87. methods: {
  88. navTo(url){
  89. uni.navigateTo({
  90. url: url
  91. })
  92. },
  93. getUserInfo(){
  94. var data={}
  95. getUserInfo(data).then(
  96. res => {
  97. if(res.code==200){
  98. this.user=res.data;
  99. }
  100. else{
  101. uni.setStorageSync('CompanyUserToken',null);
  102. uni.showToast({
  103. icon:'none',
  104. title: res.msg,
  105. });
  106. uni.navigateBack({
  107. delta:-1
  108. })
  109. }
  110. },
  111. rej => {}
  112. );
  113. },
  114. logout(){
  115. uni.showModal({
  116. title:"提示",
  117. content:"确认退出登录吗?",
  118. showCancel:true,
  119. cancelText:'取消',
  120. confirmText:'确定',
  121. success:res=>{
  122. if(res.confirm){
  123. uni.setStorageSync('CompanyUserToken',null);
  124. uni.navigateBack({
  125. delta:-1
  126. })
  127. }else{
  128. }
  129. }
  130. })
  131. },
  132. // 跳转页面
  133. navgetTo(url) {
  134. this.$isLogin().then(res => {
  135. if(res){
  136. uni.navigateTo({
  137. url: url
  138. })
  139. }
  140. })
  141. },
  142. }
  143. }
  144. </script>
  145. <style lang="scss">
  146. .content{
  147. padding: 20upx;
  148. .user-info{
  149. padding: 30upx;
  150. display: flex;
  151. align-items: center;
  152. justify-content: space-between;
  153. .left{
  154. position: relative;
  155. display: flex;
  156. .head-img{
  157. width: 120upx;
  158. height: 120upx;
  159. border-radius: 50%;
  160. overflow: hidden;
  161. margin-right: 30upx;
  162. border: 4upx solid #FFFFFF;
  163. box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
  164. image{
  165. width: 100%;
  166. height: 100%;
  167. }
  168. }
  169. .name-phone{
  170. padding-top: 15upx;
  171. .name{
  172. font-size: 36upx;
  173. font-family: PingFang SC;
  174. font-weight: bold;
  175. color: #111111;
  176. line-height: 1;
  177. }
  178. .phone{
  179. font-size: 28upx;
  180. font-family: PingFang SC;
  181. font-weight: 500;
  182. color: #666666;
  183. line-height: 1;
  184. margin-top: 30upx;
  185. }
  186. }
  187. }
  188. .msg-box{
  189. padding: 10rpx 20upx;
  190. font-size: 28upx;
  191. font-family: PingFang SC;
  192. font-weight: 500;
  193. color: #FFFFFF;
  194. border-radius: 8rpx;
  195. background-color: #C39A58;
  196. }
  197. }
  198. .used-tools{
  199. box-sizing: border-box;
  200. background: #FFFFFF;
  201. border-radius: 16upx;
  202. padding: 40upx 30upx;
  203. .title{
  204. font-size: 32upx;
  205. font-family: PingFang SC;
  206. font-weight: bold;
  207. color: #222222;
  208. line-height: 1;
  209. }
  210. .tools-list{
  211. margin-top: 50upx;
  212. display: flex;
  213. flex-wrap: wrap;
  214. width: 100%;
  215. .item{
  216. box-sizing: border-box;
  217. width: 25%;
  218. display: flex;
  219. flex-direction: column;
  220. align-items: center;
  221. justify-content: center;
  222. margin-bottom: 50upx;
  223. position: relative;
  224. image{
  225. width: 44upx;
  226. height: 44upx;
  227. }
  228. .text{
  229. font-size: 24upx;
  230. font-family: PingFang SC;
  231. font-weight: 500;
  232. color: #111111;
  233. line-height: 1;
  234. margin-top: 20upx;
  235. }
  236. .share-btn{
  237. display: inline-block;
  238. position: absolute;
  239. top: 0;
  240. left: 0;
  241. width: 100%;
  242. height: 100%;
  243. opacity: 0;
  244. }
  245. }
  246. }
  247. }
  248. .logout{
  249. height: 80upx;
  250. line-height: 80upx;
  251. text-align: center;
  252. font-size: 26upx;
  253. font-family: PingFang SC;
  254. font-weight: 500;
  255. color: #666666;
  256. background: #FFFFFF;
  257. border-radius: 16upx;
  258. margin-top: 20upx;
  259. }
  260. }
  261. </style>