You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. <script>
  2. import Vue from 'vue'
  3. //app.js
  4. var config = require("./config");
  5. export default {
  6. onLaunch(options) {
  7. uni.getSystemInfo({
  8. success: function(e) {
  9. // #ifdef MP-WEIXIN
  10. Vue.prototype.StatusBar = e.statusBarHeight;
  11. let custom = wx.getMenuButtonBoundingClientRect();
  12. Vue.prototype.Custom = custom;
  13. Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
  14. Vue.prototype.windowHeight = e.safeArea.height
  15. // #endif
  16. Vue.mixin({
  17. data() {
  18. return {
  19. StatusBar: Vue.prototype.StatusBar,
  20. CustomBar: Vue.prototype.CustomBar,
  21. windowHeight: Vue.prototype.windowHeight,
  22. LOADING: false
  23. };
  24. },
  25. methods: {
  26. // 时分秒转换为秒
  27. TIMEEVENT(e) {
  28. var time = e;
  29. var len = time.split(':')
  30. if (len.length == 3) {
  31. var hour = time.split(':')[0];
  32. var min = time.split(':')[1];
  33. var sec = time.split(':')[2];
  34. return Number(hour * 3600) + Number(min * 60) + Number(sec);
  35. }
  36. if (len.length == 2) {
  37. var min = time.split(':')[0];
  38. var sec = time.split(':')[1];
  39. return Number(min * 60) + Number(sec);
  40. }
  41. if (len.length == 1) {
  42. var sec = time.split(':')[0];
  43. return Number(sec);
  44. }
  45. },
  46. // 目前使用页面为录音页面
  47. SPEAKERSTYLE(index) {
  48. let obj = {
  49. color: '',
  50. }
  51. switch (index) {
  52. case 1:
  53. obj.color = '#60CBEC';
  54. break;
  55. case 2:
  56. obj.color = '#EC8B47';
  57. break;
  58. case 3:
  59. obj.color = '#4F861E';
  60. break;
  61. case 5:
  62. obj.color = '#4980C8';
  63. break;
  64. case 6:
  65. obj.color = '#60CBEC';
  66. break;
  67. case 7:
  68. obj.color = '#EC8B47';
  69. break;
  70. case 8:
  71. obj.color = '#4F861E';
  72. break;
  73. default:
  74. obj.color = '#9F61C8';
  75. break;
  76. }
  77. return obj
  78. },
  79. // 检测权限
  80. checkAuthority(name = '') {
  81. let menu = uni.getStorageSync('weapp_session_Menu_data')
  82. return menu.findIndex(item => item.name == name) != -1
  83. },
  84. },
  85. filters: {
  86. // ASCII码转换 大写字母A是65 演讲人是从1开始所以num+64
  87. toCapital(num) {
  88. let str = ''
  89. str = String.fromCharCode(Number(num) + 64)
  90. return str
  91. },
  92. }
  93. });
  94. }
  95. });
  96. if (wx.canIUse('getUpdateManager')) {
  97. const updateManager = wx.getUpdateManager()
  98. updateManager.onCheckForUpdate(function(res) {
  99. if (res.hasUpdate) {
  100. updateManager.onUpdateReady(function() {
  101. uni.showModal({
  102. title: '更新提示',
  103. cancelColor: "#999999",
  104. content: '新版本已经准备好,是否重启应用?',
  105. success: function(res) {
  106. if (res.confirm) {
  107. updateManager.applyUpdate()
  108. }
  109. }
  110. })
  111. })
  112. updateManager.onUpdateFailed(function() {
  113. uni.showModal({
  114. title: '已经有新版本了哟~',
  115. cancelColor: "#999999",
  116. content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
  117. })
  118. })
  119. }
  120. })
  121. } else {
  122. uni.showModal({
  123. title: '提示',
  124. cancelColor: "#999999",
  125. content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
  126. })
  127. }
  128. const token = uni.getStorageSync("weapp_session_login_data")
  129. if (typeof token.token != "string") {
  130. return
  131. }
  132. this.$u.get("/user/getUser").then(data => {
  133. uni.setStorageSync("weapp_session_userInfo_data", data)
  134. })
  135. this.$u.get("/user/getMenu").then(data => {
  136. uni.setStorageSync("weapp_session_Menu_data", data)
  137. })
  138. wx.setInnerAudioOption({
  139. obeyMuteSwitch: false
  140. });
  141. },
  142. onShow(options) {
  143. const token = uni.getStorageSync("weapp_session_login_data")
  144. if (typeof token.token != "string") {
  145. console.log("没有")
  146. return
  147. } else {
  148. this.infoscoket()
  149. }
  150. },
  151. onHide() {},
  152. methods: {
  153. infoscoket() {
  154. let pushon = uni.getStorageSync('weapp_session_userInfo_data').loginName
  155. uni.connectSocket({
  156. url: 'wss://hfju.com/ws?uid=' + pushon + '_applets',
  157. header: {
  158. "content-type": "application/json",
  159. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  160. }
  161. });
  162. uni.onSocketOpen(function(res) {
  163. console.log('WebSocket连接已打开!');
  164. });
  165. uni.onSocketError(function(res) {
  166. console.log('WebSocket连接打开失败,请检查!');
  167. });
  168. uni.onSocketMessage(function(res) {
  169. console.log('收到服务器内容:' + res.data);
  170. let cedata = JSON.stringify(res);
  171. let data = JSON.parse(cedata);
  172. let zdata = JSON.parse(data.data)
  173. if (zdata.to == "recCmd") {
  174. uni.$emit('update', {
  175. msg: '页面更新'
  176. })
  177. return
  178. }
  179. uni.showModal({
  180. title: '提示',
  181. content: zdata.to + '的设备电量过低请检查!',
  182. cancelText: "取消", // 取消按钮的文字
  183. confirmText: "查看", // 确认按钮文字
  184. success: function(res) {
  185. if (res.confirm) {
  186. console.log('用户点击确定');
  187. uni.navigateTo({
  188. url: `/pages/main/toviewtherecording/index?jump=` + "jump"
  189. })
  190. } else if (res.cancel) {
  191. console.log('用户点击取消');
  192. }
  193. }
  194. });
  195. });
  196. },
  197. Closewebsocke() {
  198. uni.closeSocket();
  199. uni.onSocketClose(function(res) {
  200. console.log('WebSocket 已关闭!');
  201. });
  202. },
  203. }
  204. };
  205. </script>
  206. <style>
  207. @import "./app.css";
  208. </style>
  209. <style lang="scss">
  210. @import "uview-ui/index.scss";
  211. /*每个页面公共css */
  212. //图表样式等
  213. .single {
  214. width: 100%;
  215. background: #FFFFFF;
  216. .title {
  217. width: 100%;
  218. height: 90rpx;
  219. border-bottom: 1rpx solid #E0E0E0;
  220. display: flex;
  221. .title1 {
  222. flex: 2;
  223. font-size: 30rpx;
  224. font-weight: 600;
  225. color: #333333;
  226. line-height: 90rpx;
  227. text-indent: 30rpx;
  228. }
  229. .title3 {
  230. flex: 3;
  231. height: 90rpx;
  232. display: flex;
  233. align-items: center;
  234. justify-content: flex-end;
  235. .title3-box {
  236. display: flex;
  237. align-items: center;
  238. width: 25%;
  239. justify-content: center;
  240. .activecltab {
  241. border-bottom: 2px solid #2671E2;
  242. }
  243. }
  244. }
  245. .title2 {
  246. flex: 3;
  247. height: 90rpx;
  248. display: flex;
  249. align-items: center;
  250. .title2-che {
  251. width: 178rpx;
  252. height: 48rpx;
  253. background: #FFFFFF;
  254. border-radius: 6rpx;
  255. border: 1px solid #E0E0E0;
  256. line-height: 48rpx;
  257. font-size: 28rpx;
  258. font-weight: 400;
  259. color: #666666;
  260. text-indent: 12rpx;
  261. margin-left: 35rpx;
  262. position: relative;
  263. .righttochoose {
  264. width: 18rpx;
  265. height: 24rpx;
  266. position: absolute;
  267. top: 12rpx;
  268. right: 12rpx;
  269. }
  270. }
  271. }
  272. }
  273. .swiper-box {
  274. width: 97%;
  275. margin: 0 auto;
  276. }
  277. .hejibox {
  278. width: 100%;
  279. height: 80rpx;
  280. display: flex;
  281. .heji {
  282. width: 50%;
  283. height: 100%;
  284. font-size: 28rpx;
  285. font-weight: 400;
  286. color: #666666;
  287. line-height: 80rpx;
  288. text-indent: 30rpx;
  289. }
  290. }
  291. .danwei {
  292. width: 100%;
  293. height: 40rpx;
  294. font-size: 24rpx;
  295. font-weight: 400;
  296. color: #999999;
  297. line-height: 40rpx;
  298. text-indent: 30rpx;
  299. }
  300. .uchaserbox {
  301. width: 95%;
  302. height: 470rpx;
  303. }
  304. .jindu {
  305. width: 100%;
  306. height: 300rpx;
  307. .jindu-box {
  308. width: 100%;
  309. padding-left: 30rpx;
  310. padding-right: 30rpx;
  311. .jindu-boxche {
  312. width: 100%;
  313. height: 46rpx;
  314. display: flex;
  315. align-items: center;
  316. height: 50rpx;
  317. .jindu-name {
  318. width: 120rpx;
  319. font-size: 28rpx;
  320. color: #666666;
  321. }
  322. .jindu-zxl {
  323. width: 120rpx;
  324. font-size: 26rpx;
  325. margin-left: 16rpx;
  326. color: #666666;
  327. text-align: center;
  328. }
  329. }
  330. }
  331. }
  332. }
  333. //时间切换的样式
  334. .boxtittab {
  335. width: 100;
  336. height: 92rpx;
  337. background: #FFFFFF;
  338. border: 1px solid #E0E0E0;
  339. display: flex;
  340. align-items: center;
  341. .tabbox {
  342. flex: 1;
  343. height: 100%;
  344. text-align: center;
  345. line-height: 92rpx;
  346. color: #666666;
  347. font-size: 28rpx;
  348. display: flex;
  349. justify-content: center;
  350. .activecllasscet {
  351. width: 96rpx;
  352. border-bottom: 2px solid #2671E2;
  353. }
  354. }
  355. }
  356. //多个格子的样式
  357. .boxzonglan {
  358. width: 100%;
  359. min-height: 496rpx;
  360. background: #FFFFFF;
  361. padding: 30rpx 30rpx 30rpx 30rpx;
  362. .zonglantit {
  363. font-size: 30rpx;
  364. color: #333333;
  365. font-family: PingFangSC-Semibold, PingFang SC;
  366. font-weight: 600;
  367. }
  368. .zonglanbox {
  369. width: 100%;
  370. display: flex;
  371. flex-wrap: wrap;
  372. margin-top: 24rpx;
  373. .grid {
  374. width: 50%;
  375. height: 128rpx;
  376. border: 1px solid #E0E0E0;
  377. .audonum {
  378. color: #666666;
  379. text-indent: 40rpx;
  380. font-size: 26rpx;
  381. margin-top: 20rpx;
  382. }
  383. .num {
  384. color: #333333;
  385. text-indent: 40rpx;
  386. font-size: 32rpx;
  387. font-weight: 600;
  388. margin-top: 10rpx;
  389. }
  390. }
  391. }
  392. }
  393. </style>