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.
 
 
 

390 rivejä
7.9 KiB

  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. bulidIngObj: uni.getStorageSync('buildingID'),
  24. };
  25. },
  26. methods: {
  27. upDateBulidIngObj() {
  28. this.bulidIngObj = uni.getStorageSync('buildingID')
  29. },
  30. addLookingCount(id) {
  31. this.$u.post('/user/addLookingCount', { houseId: uni.getStorageSync('buildingID').id, recordId: id })
  32. },
  33. // 时分秒转换为秒
  34. TIMEEVENT(e) {
  35. var time = e;
  36. var len = time.split(':')
  37. if (len.length == 3) {
  38. var hour = time.split(':')[0];
  39. var min = time.split(':')[1];
  40. var sec = time.split(':')[2];
  41. return Number(hour * 3600) + Number(min * 60) + Number(sec);
  42. }
  43. if (len.length == 2) {
  44. var min = time.split(':')[0];
  45. var sec = time.split(':')[1];
  46. return Number(min * 60) + Number(sec);
  47. }
  48. if (len.length == 1) {
  49. var sec = time.split(':')[0];
  50. return Number(sec);
  51. }
  52. },
  53. // 目前使用页面为录音页面
  54. SPEAKERSTYLE(index) {
  55. let obj = {
  56. color: '',
  57. }
  58. switch (index) {
  59. case 1:
  60. obj.color = '#60CBEC';
  61. break;
  62. case 2:
  63. obj.color = '#EC8B47';
  64. break;
  65. case 3:
  66. obj.color = '#4F861E';
  67. break;
  68. case 5:
  69. obj.color = '#4980C8';
  70. break;
  71. case 6:
  72. obj.color = '#60CBEC';
  73. break;
  74. case 7:
  75. obj.color = '#EC8B47';
  76. break;
  77. case 8:
  78. obj.color = '#4F861E';
  79. break;
  80. default:
  81. obj.color = '#9F61C8';
  82. break;
  83. }
  84. return obj
  85. },
  86. // 检测权限
  87. checkAuthority(name = '') {
  88. let menu = uni.getStorageSync('weapp_session_Menu_data')
  89. return menu.findIndex(item => item.name == name) != -1
  90. },
  91. },
  92. filters: {
  93. // ASCII码转换 大写字母A是65 演讲人是从1开始所以num+64
  94. toCapital(num) {
  95. let str = ''
  96. str = String.fromCharCode(Number(num) + 64)
  97. return str
  98. },
  99. }
  100. });
  101. }
  102. });
  103. if (wx.canIUse('getUpdateManager')) {
  104. const updateManager = wx.getUpdateManager()
  105. updateManager.onCheckForUpdate(function(res) {
  106. if (res.hasUpdate) {
  107. updateManager.onUpdateReady(function() {
  108. uni.showModal({
  109. title: '更新提示',
  110. cancelColor: "#999999",
  111. content: '新版本已经准备好,是否重启应用?',
  112. success: function(res) {
  113. if (res.confirm) {
  114. updateManager.applyUpdate()
  115. }
  116. }
  117. })
  118. })
  119. updateManager.onUpdateFailed(function() {
  120. uni.showModal({
  121. title: '已经有新版本了哟~',
  122. cancelColor: "#999999",
  123. content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
  124. })
  125. })
  126. }
  127. })
  128. } else {
  129. uni.showModal({
  130. title: '提示',
  131. cancelColor: "#999999",
  132. content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
  133. })
  134. }
  135. const token = uni.getStorageSync("weapp_session_login_data")
  136. if (typeof token.token != "string") {
  137. return
  138. }
  139. this.$u.get("/user/getUser").then(data => {
  140. uni.setStorageSync("weapp_session_userInfo_data", data)
  141. })
  142. this.$u.get("/user/getMenu").then(data => {
  143. uni.setStorageSync("weapp_session_Menu_data", data)
  144. })
  145. wx.setInnerAudioOption({
  146. obeyMuteSwitch: false
  147. });
  148. },
  149. onShow(options) {
  150. if (uni.getStorageSync('buildingID').id) {
  151. // 登录次数记录
  152. this.$u.post('/user/addLoginCount', {
  153. houseId: uni.getStorageSync('buildingID').id
  154. }).then(res=>{
  155. uni.setStorageSync("remind", 0);
  156. }).catch(e=>{})
  157. }
  158. const token = uni.getStorageSync("weapp_session_login_data")
  159. },
  160. onHide() {},
  161. methods: {},
  162. };
  163. </script>
  164. <style>
  165. @import "./app.css";
  166. </style>
  167. <style lang="scss">
  168. @import "uview-ui/index.scss";
  169. /*每个页面公共css */
  170. //图表样式等
  171. .single {
  172. width: 100%;
  173. background: #FFFFFF;
  174. .title {
  175. width: 100%;
  176. height: 90rpx;
  177. border-bottom: 1rpx solid #E0E0E0;
  178. display: flex;
  179. .title1 {
  180. flex: 2;
  181. font-size: 30rpx;
  182. font-weight: 600;
  183. color: #333333;
  184. line-height: 90rpx;
  185. text-indent: 30rpx;
  186. }
  187. .title3 {
  188. flex: 3;
  189. height: 90rpx;
  190. display: flex;
  191. align-items: center;
  192. justify-content: flex-end;
  193. .title3-box {
  194. display: flex;
  195. align-items: center;
  196. width: 25%;
  197. justify-content: center;
  198. .activecltab {
  199. border-bottom: 2px solid #2671E2;
  200. }
  201. }
  202. }
  203. .title2 {
  204. flex: 3;
  205. height: 90rpx;
  206. display: flex;
  207. align-items: center;
  208. .title2-che {
  209. width: 178rpx;
  210. height: 48rpx;
  211. background: #FFFFFF;
  212. border-radius: 6rpx;
  213. border: 1px solid #E0E0E0;
  214. line-height: 48rpx;
  215. font-size: 28rpx;
  216. font-weight: 400;
  217. color: #666666;
  218. text-indent: 12rpx;
  219. margin-left: 35rpx;
  220. position: relative;
  221. .righttochoose {
  222. width: 18rpx;
  223. height: 24rpx;
  224. position: absolute;
  225. top: 12rpx;
  226. right: 12rpx;
  227. }
  228. }
  229. }
  230. }
  231. .swiper-box {
  232. width: 97%;
  233. margin: 0 auto;
  234. }
  235. .hejibox {
  236. width: 100%;
  237. height: 80rpx;
  238. display: flex;
  239. .heji {
  240. width: 50%;
  241. height: 100%;
  242. font-size: 28rpx;
  243. font-weight: 400;
  244. color: #666666;
  245. line-height: 80rpx;
  246. text-indent: 30rpx;
  247. }
  248. }
  249. .danwei {
  250. width: 100%;
  251. height: 40rpx;
  252. font-size: 24rpx;
  253. font-weight: 400;
  254. color: #999999;
  255. line-height: 40rpx;
  256. text-indent: 30rpx;
  257. }
  258. .uchaserbox {
  259. width: 95%;
  260. height: 470rpx;
  261. }
  262. .jindu {
  263. width: 100%;
  264. height: 300rpx;
  265. .jindu-box {
  266. width: 100%;
  267. padding-left: 30rpx;
  268. padding-right: 30rpx;
  269. .jindu-boxche {
  270. width: 100%;
  271. height: 46rpx;
  272. display: flex;
  273. align-items: center;
  274. height: 50rpx;
  275. .jindu-name {
  276. width: 120rpx;
  277. font-size: 28rpx;
  278. color: #666666;
  279. }
  280. .jindu-zxl {
  281. width: 120rpx;
  282. font-size: 26rpx;
  283. margin-left: 16rpx;
  284. color: #666666;
  285. text-align: center;
  286. }
  287. }
  288. }
  289. }
  290. }
  291. //时间切换的样式
  292. .boxtittab {
  293. width: 100;
  294. height: 92rpx;
  295. background: #FFFFFF;
  296. border: 1px solid #E0E0E0;
  297. display: flex;
  298. align-items: center;
  299. .tabbox {
  300. flex: 1;
  301. height: 100%;
  302. text-align: center;
  303. line-height: 92rpx;
  304. color: #666666;
  305. font-size: 28rpx;
  306. display: flex;
  307. justify-content: center;
  308. .activecllasscet {
  309. width: 96rpx;
  310. border-bottom: 2px solid #2671E2;
  311. }
  312. }
  313. }
  314. //多个格子的样式
  315. .boxzonglan {
  316. width: 100%;
  317. min-height: 496rpx;
  318. background: #FFFFFF;
  319. padding: 30rpx 30rpx 30rpx 30rpx;
  320. .zonglantit {
  321. font-size: 30rpx;
  322. color: #333333;
  323. font-family: PingFangSC-Semibold, PingFang SC;
  324. font-weight: 600;
  325. }
  326. .zonglanbox {
  327. width: 100%;
  328. display: flex;
  329. flex-wrap: wrap;
  330. margin-top: 24rpx;
  331. .grid {
  332. width: 50%;
  333. height: 128rpx;
  334. border: 1px solid #E0E0E0;
  335. .audonum {
  336. color: #666666;
  337. text-indent: 40rpx;
  338. font-size: 26rpx;
  339. margin-top: 20rpx;
  340. }
  341. .num {
  342. color: #333333;
  343. text-indent: 40rpx;
  344. font-size: 32rpx;
  345. font-weight: 600;
  346. margin-top: 10rpx;
  347. }
  348. }
  349. }
  350. }
  351. </style>