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 9.7 KiB

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
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  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: 32rpx;
  220. font-weight: 500;
  221. color: #333333;
  222. line-height: 90rpx;
  223. text-indent: 30rpx;
  224. }
  225. .title3 {
  226. flex: 3;
  227. height: 90rpx;
  228. display: flex;
  229. align-items: center;
  230. justify-content: flex-end;
  231. padding-right: 30rpx;
  232. .title3-box {
  233. display: flex;
  234. align-items: center;
  235. width: 25%;
  236. justify-content: center;
  237. .activecltab {
  238. color: #2671E2;
  239. border-bottom: 4rpx solid #2671E2;
  240. }
  241. }
  242. }
  243. .title2 {
  244. flex: 2;
  245. display: flex;
  246. justify-content: flex-end;
  247. align-items: center;
  248. height: 42rpx;
  249. font-size: 30rpx;
  250. font-family: PingFangSC-Regular, PingFang SC;
  251. font-weight: 400;
  252. color: #333333;
  253. line-height: 42rpx;
  254. margin-right: 30rpx;
  255. .righttochoose {
  256. width: 24rpx;
  257. height: 12rpx;
  258. margin-left: 12rpx;
  259. }
  260. }
  261. }
  262. .swiper-box {
  263. width: 97%;
  264. margin: 0 auto 38rpx;
  265. }
  266. .hejibox {
  267. width: 100%;
  268. height: 80rpx;
  269. display: flex;
  270. .heji {
  271. width: 50%;
  272. height: 100%;
  273. font-size: 28rpx;
  274. font-weight: 400;
  275. color: #666666;
  276. line-height: 80rpx;
  277. text-indent: 30rpx;
  278. }
  279. }
  280. .danwei {
  281. width: 100%;
  282. height: 40rpx;
  283. font-size: 24rpx;
  284. font-weight: 400;
  285. color: #999999;
  286. line-height: 40rpx;
  287. text-indent: 30rpx;
  288. }
  289. .uchaserbox {
  290. width: 95%;
  291. height: 470rpx;
  292. }
  293. .jindu {
  294. width: 100%;
  295. height: 300rpx;
  296. .jindu-box {
  297. width: 100%;
  298. padding: 0 30rpx;
  299. .jindu-boxche {
  300. width: 100%;
  301. height: 40rpx;
  302. display: flex;
  303. align-items: center;
  304. margin-bottom: 38rpx;
  305. .jindu-name {
  306. width: 120rpx;
  307. font-size: 28rpx;
  308. font-family: PingFangSC-Regular, PingFang SC;
  309. font-weight: 400;
  310. color: #333333;
  311. line-height: 40rpx;
  312. }
  313. .progress-cus{
  314. flex: 1;
  315. height: 30rpx;
  316. margin-left: 10rpx;
  317. background: #F0F1F2;
  318. .color{
  319. height: 30rpx;
  320. background: linear-gradient(90deg, #3A82EF 0%, #7EB2FF 100%);
  321. }
  322. .color4{
  323. height: 30rpx;
  324. background: linear-gradient(270deg, #6DC5B8 0%, #07B79D 100%);
  325. }
  326. .color1{
  327. height: 30rpx;
  328. background: linear-gradient(270deg, #F88881 0%, #E6625B 100%);//1
  329. }
  330. .color2{
  331. height: 30rpx;
  332. background: linear-gradient(270deg, #FFC940 0%, #FF981E 100%);//2
  333. }
  334. .color3{
  335. height: 30rpx;
  336. background: linear-gradient(270deg, #FFE800 0%, #FFCC00 100%); //3
  337. }
  338. }
  339. .jindu-zxl {
  340. width: 120rpx;
  341. font-size: 28rpx;
  342. margin-left: 12rpx;
  343. color: #333;
  344. text-align: left;
  345. line-height: 40rpx;
  346. }
  347. }
  348. }
  349. }
  350. }
  351. //时间切换的样式
  352. .boxtittab {
  353. width: 100;
  354. height: 92rpx;
  355. background: #FFFFFF;
  356. display: flex;
  357. align-items: center;
  358. .tabbox {
  359. flex: 1;
  360. height: 100%;
  361. text-align: center;
  362. line-height: 92rpx;
  363. color: #666666;
  364. font-size: 28rpx;
  365. display: flex;
  366. justify-content: center;
  367. .activecllasscet {
  368. width: 96rpx;
  369. color: #2671E2;
  370. border-bottom: 4rpx solid #2671E2;
  371. }
  372. }
  373. }
  374. //多个格子的样式
  375. .boxzonglan {
  376. width: 100%;
  377. min-height: 496rpx;
  378. background: #FFFFFF;
  379. padding: 30rpx 30rpx 30rpx 30rpx;
  380. .zonglantit {
  381. font-size: 30rpx;
  382. color: #333333;
  383. font-family: PingFangSC-Semibold, PingFang SC;
  384. font-weight: 500;
  385. }
  386. .zonglanbox {
  387. width: 100%;
  388. display: flex;
  389. flex-wrap: wrap;
  390. margin-top: 24rpx;
  391. box-shadow: 0px 0px 12rpx 0px rgba(38, 113, 226, 0.1);
  392. border-radius: 12rpx;
  393. .grid {
  394. width: 50%;
  395. // height: 128rpx;
  396. padding-bottom: 24rpx;
  397. // border: 1rpx solid #E0E0E0;
  398. .audonum {
  399. color: #666666;
  400. text-indent: 40rpx;
  401. font-size: 28rpx;
  402. margin-top: 20rpx;
  403. line-height: 40rpx;
  404. display: flex;
  405. align-items: center;
  406. .circle{
  407. width: 20rpx;
  408. height: 20rpx;
  409. background: #FFFFFF;
  410. border: 6rpx solid #2671E2;
  411. margin-right: 12rpx;
  412. margin-left: 30rpx;
  413. border-radius: 50%;
  414. }
  415. }
  416. .num {
  417. color: #333333;
  418. text-indent: 40rpx;
  419. font-size: 44rpx;
  420. font-weight: 600;
  421. line-height: 50rpx;
  422. margin-top: 18rpx;
  423. }
  424. }
  425. }
  426. }
  427. </style>