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