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.

App.vue 11 KiB

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