AI销管
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

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