AI销管
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

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