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.
 
 
 
 

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