App.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <script>
  2. import { getDictByKey, getAppVersion, getRealLinkDomainName,getAppPageConfig } from '@/api/common.js';
  3. import { getUserInfo, getPushLogRead } from '@/api/user';
  4. import { getUserLiveInfo } from '@/api/living.js'
  5. import { mapGetters, mapActions } from 'vuex';
  6. import { config } from '@/pages_im/common/config';
  7. let pausing = false;
  8. let innerAudioContext;
  9. let connectStart=0;
  10. // #ifdef APP-PLUS
  11. import permision1 from '@/utils/permission.js';
  12. // notification = uni.requireNativePlugin('Tuoyun-OpenIMSDK-Notification');
  13. // #endif
  14. import { qconfig } from './utils/config';
  15. import { premissionCheck } from '@/js_sdk/wa-permission/permission.js';
  16. let healthTimer = null;
  17. let tSeconds = 0;
  18. const healthSeconds = 180;
  19. let offlineMsg=null;
  20. let offlineHandleNewMsg=null;
  21. let failImConnTime=0;
  22. // #ifdef APP-PLUS
  23. let complaintView = null; // 悬浮窗视图(主图标)
  24. let complaintCloseView = null; // 关闭按钮视图
  25. let viewLeft = 0;
  26. let viewTop = 0;
  27. let complaintPositionTimer = null; // 位置检查定时器
  28. let lastRoute = ''; // 上次的路由
  29. // #endif
  30. export default {
  31. globalData: {
  32. wsUrl: 'ws://doctor.ai.cdwjyyh.com',
  33. danmuWSUrl:'wss://websocket.cdwjyyh.com',
  34. aiWSUrl:'ws://doctor.ai.cdwjyyh.com',
  35. kfurl: 'https://work.weixin.qq.com/kfid/kfc3731c5008ebd8906', //企业微信客服链接
  36. corpId: 'ww70ac72e824957fc9', //客服企业id
  37. miniprogamId:"gh_feb7753a310b", //gh_7a6a32e5ef61 御君方互医
  38. shareCorpId: '', // 分享企业id
  39. shareSchema:"", // 应用跳转标识,显示在具体应用下的 Schema字段
  40. shareAgentid:"", // 企业微信管理后台 应用唯一标识。显示在具体应用下的 AgentId字段
  41. shareAppid_gh:"", // 必须是应用关联的小程序,注意要有@app后缀
  42. },
  43. onLaunch: function (options) {
  44. },
  45. onLoad() {
  46. },
  47. onShow() {
  48. this.getDictByKeyFun()
  49. // var that = this;
  50. // var args= plus.runtime.arguments;
  51. // uni.setStorageSync("appIsOnShow",1);
  52. },
  53. onHide() {
  54. },
  55. computed: {
  56. },
  57. methods: {
  58. async getDictByKeyFun() {
  59. let data = {
  60. key: 'app_pay_config'
  61. }
  62. const res = await getDictByKey(data)
  63. if (res.code == 200 && res.data && res.data.length > 0 && res.data[0].dictValue) {
  64. getApp().globalData.miniprogamId = res.data[0].dictValue
  65. }
  66. },
  67. getAppPageConfig() {
  68. getAppPageConfig().then(res=>{
  69. if(res.code == 200) {
  70. uni.setStorageSync('appPageConfig',JSON.stringify(res.appPageConfig))
  71. }
  72. })
  73. },
  74. getUserInfo(healthButler) {
  75. getUserInfo().then((res) => {
  76. if (res.code == 200) {
  77. if (res.user != null) {
  78. let registrationID=uni.getStorageSync("registrationID");
  79. let userInfo = res.user;
  80. uni.setStorageSync('userInfo', JSON.stringify(res.user));
  81. if(!userInfo.jpushId || registrationID!=userInfo.jpushId){
  82. uni.setStorageSync("registrationID","");
  83. }
  84. if(!!healthButler){
  85. healthButler.isAddQw = userInfo.isAddQw;
  86. uni.setStorageSync('healthButler', JSON.stringify(healthButler));
  87. }
  88. }
  89. }else if(res.code == 500){
  90. uni.showToast({
  91. title:"当前用户被禁用",
  92. icon:"none",
  93. duration:5000
  94. });
  95. setTimeout(()=>{
  96. uni.$emit('loginOut');
  97. },5500);
  98. }
  99. },
  100. (rej) => {}
  101. );
  102. },
  103. geth5Path() {
  104. getRealLinkDomainName().then((res) => {
  105. if (res.code == 200) {
  106. uni.setStorageSync('h5Path', res.data);
  107. }
  108. });
  109. },
  110. },
  111. };
  112. </script>
  113. <style lang="scss">
  114. /*每个页面公共css */
  115. @import '@/uni_modules/uview-plus/index.scss';
  116. /*#ifndef APP-NVUE*/
  117. view {
  118. box-sizing: border-box;
  119. }
  120. .ellipsis {
  121. overflow: hidden;
  122. text-overflow: ellipsis;
  123. white-space: nowrap;
  124. }
  125. .ellipsis2 {
  126. overflow: hidden;
  127. text-overflow: ellipsis;
  128. display: -webkit-box;
  129. -webkit-box-orient: vertical;
  130. -webkit-line-clamp: 2;
  131. }
  132. uni-modal {
  133. z-index: 1100;
  134. }
  135. // 猜你喜欢样式
  136. .like-box {
  137. display: flex;
  138. align-items: center;
  139. justify-content: center;
  140. image {
  141. height: 40upx;
  142. width: 40upx;
  143. }
  144. .text {
  145. font-size: 28upx;
  146. color: #000;
  147. font-weight: bold;
  148. margin: 0 10upx;
  149. }
  150. }
  151. .no-data-box {
  152. height: 100%;
  153. width: 100%;
  154. display: flex;
  155. justify-content: center;
  156. align-items: center;
  157. flex-direction: column;
  158. image {
  159. width: 264upx;
  160. height: 212upx;
  161. }
  162. .empty-title {
  163. margin-top: 20rpx;
  164. font-size: 28rpx;
  165. color: gray;
  166. }
  167. }
  168. .doctor-box {
  169. margin-top: 15rpx;
  170. padding: 20rpx 0rpx 0rpx;
  171. display: flex;
  172. flex-direction: column;
  173. align-items: flex-start;
  174. justify-content: flex-start;
  175. .doctor {
  176. width: 100%;
  177. margin-bottom: 15rpx;
  178. background: #f9f8fe;
  179. padding: 15rpx;
  180. display: flex;
  181. flex-direction: column;
  182. align-items: flex-start;
  183. justify-content: flex-start;
  184. &:last-child {
  185. margin-bottom: 0rpx;
  186. }
  187. .item {
  188. width: 100%;
  189. display: flex;
  190. align-items: flex-start;
  191. justify-content: flex-start;
  192. .left {
  193. .head-box {
  194. width: 92rpx;
  195. height: 92rpx;
  196. position: relative;
  197. .isline {
  198. width: 92rpx;
  199. height: 92rpx;
  200. border-radius: 50%;
  201. border: 2rpx solid #e69a22;
  202. display: flex;
  203. align-items: center;
  204. justify-content: center;
  205. position: absolute;
  206. bottom: 0rpx;
  207. .img {
  208. position: absolute;
  209. bottom: 1rpx;
  210. width: 75rpx;
  211. height: 35rpx;
  212. image {
  213. width: 75rpx;
  214. height: 35rpx;
  215. }
  216. .name {
  217. width: 75rpx;
  218. height: 35rpx;
  219. bottom: -3rpx;
  220. text-align: center;
  221. position: absolute;
  222. font-size: 16upx;
  223. font-family: PingFang SC;
  224. font-weight: bold;
  225. color: #ffffff;
  226. }
  227. }
  228. }
  229. .doc-img {
  230. border-radius: 50%;
  231. width: 100%;
  232. height: 100%;
  233. }
  234. }
  235. }
  236. .right {
  237. width: calc(100% - 100rpx);
  238. margin-left: 20rpx;
  239. display: flex;
  240. flex-direction: column;
  241. align-items: flex-start;
  242. justify-content: flex-start;
  243. .doc-box {
  244. display: flex;
  245. align-items: center;
  246. justify-content: space-between;
  247. .doc-name {
  248. font-size: 32upx;
  249. font-family: PingFang SC;
  250. font-weight: bold;
  251. color: #111111;
  252. }
  253. .doc-position {
  254. margin-left: 16rpx;
  255. font-size: 26upx;
  256. font-weight: bold;
  257. font-family: PingFang SC;
  258. color: #2a2b2e;
  259. }
  260. .doc-dept {
  261. margin-left: 16rpx;
  262. font-size: 26upx;
  263. font-weight: bold;
  264. font-family: PingFang SC;
  265. color: #2a2b2e;
  266. }
  267. }
  268. .hospital-box {
  269. display: flex;
  270. align-items: center;
  271. justify-content: flex-start;
  272. margin-top: 10rpx;
  273. .tag {
  274. display: flex;
  275. align-items: center;
  276. justify-content: center;
  277. background-color: #4fc06b;
  278. border-radius: 10rpx;
  279. padding: 5rpx 10rpx;
  280. font-size: 20upx;
  281. font-weight: bold;
  282. font-family: PingFang SC;
  283. color: #ffffff;
  284. }
  285. .name {
  286. margin-left: 6rpx;
  287. font-size: 26upx;
  288. font-weight: bold;
  289. font-family: PingFang SC;
  290. color: #2a2b2e;
  291. }
  292. }
  293. .doc-spec {
  294. width: 100%;
  295. display: flex;
  296. align-items: center;
  297. justify-content: flex-start;
  298. margin-top: 15rpx;
  299. .spec {
  300. font-size: 26upx;
  301. font-family: PingFang SC;
  302. color: #626468;
  303. }
  304. }
  305. .doc-count {
  306. margin-top: 15rpx;
  307. display: flex;
  308. align-items: center;
  309. justify-content: flex-start;
  310. .name {
  311. font-size: 24upx;
  312. font-family: PingFang SC;
  313. color: #9b9b9b;
  314. }
  315. .count {
  316. margin: 0rpx 5rpx;
  317. font-size: 24upx;
  318. font-family: PingFang SC;
  319. color: #2a2b2e;
  320. }
  321. }
  322. .doc-price {
  323. width: 100%;
  324. margin-top: 15rpx;
  325. display: flex;
  326. align-items: center;
  327. justify-content: flex-start;
  328. .btn {
  329. display: flex;
  330. align-items: center;
  331. justify-content: center;
  332. background-color: #feefd7;
  333. padding: 15rpx 30rpx;
  334. border-radius: 30rpx;
  335. font-size: 26upx;
  336. font-family: PingFang SC;
  337. color: #e69a22;
  338. }
  339. }
  340. }
  341. }
  342. }
  343. }
  344. /*#endif*/
  345. </style>
  346. <style lang="less">
  347. /*每个页面公共css */
  348. // @import './assets/iconfont/iconfont.css';
  349. @import './assets/css/common.less';
  350. /* 全局flex样式 */
  351. @import './common/css/flexCommon.css';
  352. /*引入全局补充样式*/
  353. @import './assets/css/czy/es.1.base.css';
  354. @import './assets/css/czy/es.2.color.css';
  355. @import './assets/css/czy/es.3.icon.css';
  356. @import './assets/css/czy/es.4.view.css';
  357. .textOne {
  358. overflow: hidden;
  359. white-space: nowrap;
  360. text-overflow: ellipsis;
  361. }
  362. .textTwo {
  363. overflow: hidden;
  364. text-overflow: ellipsis;
  365. display: -webkit-box;
  366. -webkit-line-clamp: 2;
  367. -webkit-box-orient: vertical;
  368. }
  369. </style>