AI销管
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

494 satır
10 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. console.log(e, 'adjsakljdklasjdklsakjdslakjd')
  10. // #ifdef MP-WEIXIN
  11. Vue.prototype.StatusBar = e.statusBarHeight;
  12. let custom = wx.getMenuButtonBoundingClientRect();
  13. Vue.prototype.Custom = custom;
  14. Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
  15. Vue.prototype.windowHeight = e.safeArea.height
  16. // #endif
  17. Vue.mixin({
  18. data() {
  19. return {
  20. StatusBar: Vue.prototype.StatusBar,
  21. CustomBar: Vue.prototype.CustomBar,
  22. windowHeight: Vue.prototype.windowHeight,
  23. LOADING: false
  24. };
  25. },
  26. methods: {
  27. // 时分秒转换为秒
  28. TIMEEVENT(e) {
  29. var time = e;
  30. var len = time.split(':')
  31. if (len.length == 3) {
  32. var hour = time.split(':')[0];
  33. var min = time.split(':')[1];
  34. var sec = time.split(':')[2];
  35. return Number(hour * 3600) + Number(min * 60) + Number(sec);
  36. }
  37. if (len.length == 2) {
  38. var min = time.split(':')[0];
  39. var sec = time.split(':')[1];
  40. return Number(min * 60) + Number(sec);
  41. }
  42. if (len.length == 1) {
  43. var sec = time.split(':')[0];
  44. return Number(sec);
  45. }
  46. },
  47. // 目前使用页面为录音页面
  48. SPEAKERSTYLE(index) {
  49. let obj = {
  50. color: '',
  51. }
  52. switch (index) {
  53. case 1:
  54. obj.color = '#60CBEC';
  55. break;
  56. case 2:
  57. obj.color = '#EC8B47';
  58. break;
  59. case 3:
  60. obj.color = '#4F861E';
  61. break;
  62. case 5:
  63. obj.color = '#4980C8';
  64. break;
  65. case 6:
  66. obj.color = '#60CBEC';
  67. break;
  68. case 7:
  69. obj.color = '#EC8B47';
  70. break;
  71. case 8:
  72. obj.color = '#4F861E';
  73. break;
  74. default:
  75. obj.color = '#9F61C8';
  76. break;
  77. }
  78. return obj
  79. },
  80. // 检测权限 返回 Boolean类型
  81. CHECKAUTHORITY(name = '') {
  82. let menu = uni.getStorageSync('weapp_session_Menu_data')
  83. return menu[name] === undefined ? false : menu[name]
  84. },
  85. },
  86. filters: {
  87. // ASCII码转换 大写字母A是65 演讲人是从1开始所以num+64
  88. toCapital(num) {
  89. let str = ''
  90. if (num) {
  91. str = String.fromCharCode(num + 64)
  92. }
  93. return str
  94. }
  95. }
  96. });
  97. }
  98. });
  99. if (wx.canIUse('getUpdateManager')) {
  100. const updateManager = wx.getUpdateManager()
  101. updateManager.onCheckForUpdate(function(res) {
  102. if (res.hasUpdate) {
  103. updateManager.onUpdateReady(function() {
  104. uni.showModal({
  105. title: '更新提示',
  106. cancelColor: "#999999",
  107. content: '新版本已经准备好,是否重启应用?',
  108. success: function(res) {
  109. if (res.confirm) {
  110. updateManager.applyUpdate()
  111. }
  112. }
  113. })
  114. })
  115. updateManager.onUpdateFailed(function() {
  116. uni.showModal({
  117. title: '已经有新版本了哟~',
  118. cancelColor: "#999999",
  119. content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
  120. })
  121. })
  122. }
  123. })
  124. } else {
  125. uni.showModal({
  126. title: '提示',
  127. cancelColor: "#999999",
  128. content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
  129. })
  130. }
  131. const token = uni.getStorageSync("weapp_session_login_data")
  132. if (typeof token.token != "string") {
  133. return
  134. }
  135. uni.request({
  136. url: config.service.getUser,
  137. method: "GET",
  138. header: {
  139. 'content-type': 'application/json',
  140. 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
  141. },
  142. success: (res) => {
  143. let rescor = res.data.data;
  144. console.log(res, '数据', rescor)
  145. // return
  146. if (res.statusCode == 401) {
  147. uni.showToast({
  148. title: '登录过期请重新登录',
  149. icon: "none",
  150. duration: 2000,
  151. })
  152. uni.navigateTo({
  153. url: `/pages/login/index`
  154. })
  155. return
  156. }
  157. if (rescor.user.total == 0) {
  158. uni.showToast({
  159. title: '暂无绑定项目',
  160. duration: 2000,
  161. icon: "none"
  162. });
  163. return
  164. } else {
  165. let lopan = {
  166. id: rescor.houseList[0].id,
  167. name: rescor.houseList[0].propertyName
  168. }
  169. let users = rescor.user
  170. users.zkProperties = rescor.houseList
  171. console.log(users, '角色数据')
  172. uni.setStorageSync("weapp_session_userInfo_data", users); //写入缓存
  173. }
  174. }
  175. })
  176. this.$u.get(config.service.notReadNum, {
  177. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  178. projectId: uni.getStorageSync('buildingID').id
  179. }).then(res => {
  180. console.log(res)
  181. if (res > 0) {
  182. uni.setTabBarBadge({ //显示数字
  183. index: 4, //tabbar下标
  184. text: res || 0 //数字
  185. })
  186. } else {
  187. uni.removeTabBarBadge({
  188. index: 4
  189. })
  190. }
  191. }).catch(e => {
  192. uni.removeTabBarBadge({
  193. index: 4
  194. })
  195. })
  196. // this.$u.get("/user/getUser")
  197. // .then(data => {
  198. // if (data.user.total==0) {
  199. // uni.showToast({
  200. // title: '暂无绑定项目',
  201. // duration: 2000,
  202. // icon:"none"
  203. // });
  204. // return
  205. // } else {
  206. // let lopan = {
  207. // id: data.houseList[0].id,
  208. // name: data.houseList[0].propertyName
  209. // }
  210. // let users=data.user
  211. // users.zkProperties=data.houseList
  212. // uni.setStorageSync("weapp_session_userInfo_data",users); //写入缓存
  213. // }
  214. // })
  215. wx.setInnerAudioOption({
  216. obeyMuteSwitch: false
  217. });
  218. },
  219. onShow(options) {
  220. const token = uni.getStorageSync("weapp_session_login_data")
  221. if (typeof token.token != "string") {
  222. console.log("没有")
  223. return
  224. } else {}
  225. }
  226. };
  227. </script>
  228. <style>
  229. @import "./app.css";
  230. </style>
  231. <style lang="scss">
  232. @import "uview-ui/index.scss";
  233. /*每个页面公共css */
  234. //图表样式等
  235. .single {
  236. width: 100%;
  237. background: #FFFFFF;
  238. .title {
  239. width: 100%;
  240. height: 80rpx;
  241. display: flex;
  242. align-items: center;
  243. .title1 {
  244. flex: 2;
  245. font-size: 30rpx;
  246. font-weight: 500;
  247. color: #333333;
  248. line-height: 80rpx;
  249. padding-left: 30rpx;
  250. font-family: PingFangSC-Medium, PingFang SC;
  251. }
  252. .title3 {
  253. flex: 3;
  254. height: 90rpx;
  255. display: flex;
  256. align-items: center;
  257. justify-content: flex-end;
  258. padding-right: 30rpx;
  259. .title3-box {
  260. display: flex;
  261. align-items: center;
  262. width: 25%;
  263. justify-content: center;
  264. .activecltab {
  265. color: #2671E2;
  266. border-bottom: 4rpx solid #2671E2;
  267. }
  268. }
  269. }
  270. .title2 {
  271. flex: 2;
  272. display: flex;
  273. justify-content: flex-end;
  274. align-items: center;
  275. height: 42rpx;
  276. font-size: 30rpx;
  277. font-family: PingFangSC-Regular, PingFang SC;
  278. font-weight: 400;
  279. color: #333333;
  280. line-height: 42rpx;
  281. margin-right: 30rpx;
  282. .righttochoose {
  283. width: 24rpx;
  284. height: 12rpx;
  285. margin-left: 12rpx;
  286. }
  287. }
  288. }
  289. .swiper-box {
  290. width: 97%;
  291. margin: 0 auto 26rpx;
  292. }
  293. .hejibox {
  294. width: 100%;
  295. height: 80rpx;
  296. display: flex;
  297. .heji {
  298. width: 50%;
  299. height: 100%;
  300. font-size: 28rpx;
  301. font-weight: 400;
  302. color: #666666;
  303. line-height: 80rpx;
  304. text-indent: 30rpx;
  305. }
  306. }
  307. .danwei {
  308. width: 100%;
  309. height: 40rpx;
  310. font-size: 24rpx;
  311. font-weight: 400;
  312. color: #999999;
  313. line-height: 40rpx;
  314. text-indent: 30rpx;
  315. }
  316. .uchaserbox {
  317. width: 95%;
  318. height: 470rpx;
  319. }
  320. .jindu {
  321. width: 100%;
  322. min-height: 400rpx;
  323. .jindu-box {
  324. width: 100%;
  325. padding: 0 30rpx;
  326. .jindu-boxche {
  327. width: 100%;
  328. height: 40rpx;
  329. display: flex;
  330. align-items: center;
  331. margin-bottom: 38rpx;
  332. .jindu-name {
  333. width: 120rpx;
  334. font-size: 28rpx;
  335. font-family: PingFangSC-Regular, PingFang SC;
  336. font-weight: 400;
  337. color: #333333;
  338. line-height: 40rpx;
  339. }
  340. .progress-cus{
  341. flex: 1;
  342. height: 30rpx;
  343. margin-left: 10rpx;
  344. background: #F0F1F2;
  345. .color{
  346. height: 30rpx;
  347. background: linear-gradient(90deg, #3A82EF 0%, #7EB2FF 100%);
  348. }
  349. .color4{
  350. height: 30rpx;
  351. background: linear-gradient(270deg, #6DC5B8 0%, #07B79D 100%);
  352. }
  353. .color1{
  354. height: 30rpx;
  355. background: linear-gradient(270deg, #F88881 0%, #E6625B 100%);//1
  356. }
  357. .color2{
  358. height: 30rpx;
  359. background: linear-gradient(270deg, #FFC940 0%, #FF981E 100%);//2
  360. }
  361. .color3{
  362. height: 30rpx;
  363. background: linear-gradient(270deg, #FFE800 0%, #FFCC00 100%); //3
  364. }
  365. }
  366. .jindu-zxl {
  367. width: 120rpx;
  368. font-size: 28rpx;
  369. margin-left: 12rpx;
  370. color: #333;
  371. text-align: left;
  372. line-height: 40rpx;
  373. }
  374. }
  375. }
  376. }
  377. }
  378. //时间切换的样式
  379. .boxtittab {
  380. width: 100;
  381. height: 92rpx;
  382. background: #FFFFFF;
  383. display: flex;
  384. align-items: center;
  385. .tabbox {
  386. flex: 1;
  387. height: 100%;
  388. text-align: center;
  389. line-height: 92rpx;
  390. color: #666666;
  391. font-size: 28rpx;
  392. font-weight: 400;
  393. display: flex;
  394. justify-content: center;
  395. .activecllasscet {
  396. width: 96rpx;
  397. color: #2671E2;
  398. font-weight: 600;
  399. border-bottom: 4rpx solid #2671E2;
  400. }
  401. }
  402. }
  403. //多个格子的样式
  404. .boxzonglan {
  405. width: 100%;
  406. min-height: 496rpx;
  407. background: #FFFFFF;
  408. padding: 30rpx 30rpx 30rpx 30rpx;
  409. .zonglantit {
  410. font-size: 30rpx;
  411. color: #333333;
  412. font-family: PingFangSC-Semibold, PingFang SC;
  413. font-weight: 500;
  414. }
  415. .zonglanbox {
  416. width: 100%;
  417. display: flex;
  418. flex-wrap: wrap;
  419. margin-top: 24rpx;
  420. box-shadow: 0px 0px 12rpx 0px rgba(38, 113, 226, 0.1);
  421. border-radius: 12rpx;
  422. .grid {
  423. width: 50%;
  424. // height: 128rpx;
  425. padding-bottom: 24rpx;
  426. // border: 1rpx solid #E0E0E0;
  427. .audonum {
  428. color: #666666;
  429. text-indent: 40rpx;
  430. font-size: 28rpx;
  431. margin-top: 20rpx;
  432. line-height: 40rpx;
  433. display: flex;
  434. align-items: center;
  435. .circle{
  436. width: 20rpx;
  437. height: 20rpx;
  438. background: #FFFFFF;
  439. border: 6rpx solid #2671E2;
  440. margin-right: 12rpx;
  441. margin-left: 30rpx;
  442. border-radius: 50%;
  443. }
  444. }
  445. .num {
  446. color: #333333;
  447. text-indent: 40rpx;
  448. font-size: 44rpx;
  449. font-weight: 600;
  450. line-height: 50rpx;
  451. margin-top: 18rpx;
  452. }
  453. }
  454. }
  455. }
  456. </style>