AI销管
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

465 wiersze
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. 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("/user/getUser")
  172. // .then(data => {
  173. // if (data.user.total==0) {
  174. // uni.showToast({
  175. // title: '暂无绑定项目',
  176. // duration: 2000,
  177. // icon:"none"
  178. // });
  179. // return
  180. // } else {
  181. // let lopan = {
  182. // id: data.houseList[0].id,
  183. // name: data.houseList[0].propertyName
  184. // }
  185. // let users=data.user
  186. // users.zkProperties=data.houseList
  187. // uni.setStorageSync("weapp_session_userInfo_data",users); //写入缓存
  188. // }
  189. // })
  190. wx.setInnerAudioOption({
  191. obeyMuteSwitch: false
  192. });
  193. },
  194. onShow(options) {
  195. const token = uni.getStorageSync("weapp_session_login_data")
  196. if (typeof token.token != "string") {
  197. console.log("没有")
  198. return
  199. } else {}
  200. }
  201. };
  202. </script>
  203. <style>
  204. @import "./app.css";
  205. </style>
  206. <style lang="scss">
  207. @import "uview-ui/index.scss";
  208. /*每个页面公共css */
  209. //图表样式等
  210. .single {
  211. width: 100%;
  212. background: #FFFFFF;
  213. .title {
  214. width: 100%;
  215. height: 80rpx;
  216. display: flex;
  217. align-items: center;
  218. .title1 {
  219. flex: 2;
  220. font-size: 30rpx;
  221. font-weight: 500;
  222. color: #333333;
  223. line-height: 80rpx;
  224. padding-left: 30rpx;
  225. font-family: PingFangSC-Medium, PingFang SC;
  226. }
  227. .title3 {
  228. flex: 3;
  229. height: 90rpx;
  230. display: flex;
  231. align-items: center;
  232. justify-content: flex-end;
  233. padding-right: 30rpx;
  234. .title3-box {
  235. display: flex;
  236. align-items: center;
  237. width: 25%;
  238. justify-content: center;
  239. .activecltab {
  240. color: #2671E2;
  241. border-bottom: 4rpx solid #2671E2;
  242. }
  243. }
  244. }
  245. .title2 {
  246. flex: 2;
  247. display: flex;
  248. justify-content: flex-end;
  249. align-items: center;
  250. height: 42rpx;
  251. font-size: 30rpx;
  252. font-family: PingFangSC-Regular, PingFang SC;
  253. font-weight: 400;
  254. color: #333333;
  255. line-height: 42rpx;
  256. margin-right: 30rpx;
  257. .righttochoose {
  258. width: 24rpx;
  259. height: 12rpx;
  260. margin-left: 12rpx;
  261. }
  262. }
  263. }
  264. .swiper-box {
  265. width: 97%;
  266. margin: 0 auto 26rpx;
  267. }
  268. .hejibox {
  269. width: 100%;
  270. height: 80rpx;
  271. display: flex;
  272. .heji {
  273. width: 50%;
  274. height: 100%;
  275. font-size: 28rpx;
  276. font-weight: 400;
  277. color: #666666;
  278. line-height: 80rpx;
  279. text-indent: 30rpx;
  280. }
  281. }
  282. .danwei {
  283. width: 100%;
  284. height: 40rpx;
  285. font-size: 24rpx;
  286. font-weight: 400;
  287. color: #999999;
  288. line-height: 40rpx;
  289. text-indent: 30rpx;
  290. }
  291. .uchaserbox {
  292. width: 95%;
  293. height: 470rpx;
  294. }
  295. .jindu {
  296. width: 100%;
  297. min-height: 400rpx;
  298. .jindu-box {
  299. width: 100%;
  300. padding: 0 30rpx;
  301. .jindu-boxche {
  302. width: 100%;
  303. height: 40rpx;
  304. display: flex;
  305. align-items: center;
  306. margin-bottom: 38rpx;
  307. .jindu-name {
  308. width: 120rpx;
  309. font-size: 28rpx;
  310. font-family: PingFangSC-Regular, PingFang SC;
  311. font-weight: 400;
  312. color: #333333;
  313. line-height: 40rpx;
  314. }
  315. .progress-cus{
  316. flex: 1;
  317. height: 30rpx;
  318. margin-left: 10rpx;
  319. background: #F0F1F2;
  320. .color{
  321. height: 30rpx;
  322. background: linear-gradient(90deg, #3A82EF 0%, #7EB2FF 100%);
  323. }
  324. .color4{
  325. height: 30rpx;
  326. background: linear-gradient(270deg, #6DC5B8 0%, #07B79D 100%);
  327. }
  328. .color1{
  329. height: 30rpx;
  330. background: linear-gradient(270deg, #F88881 0%, #E6625B 100%);//1
  331. }
  332. .color2{
  333. height: 30rpx;
  334. background: linear-gradient(270deg, #FFC940 0%, #FF981E 100%);//2
  335. }
  336. .color3{
  337. height: 30rpx;
  338. background: linear-gradient(270deg, #FFE800 0%, #FFCC00 100%); //3
  339. }
  340. }
  341. .jindu-zxl {
  342. width: 120rpx;
  343. font-size: 28rpx;
  344. margin-left: 12rpx;
  345. color: #333;
  346. text-align: left;
  347. line-height: 40rpx;
  348. }
  349. }
  350. }
  351. }
  352. }
  353. //时间切换的样式
  354. .boxtittab {
  355. width: 100;
  356. height: 92rpx;
  357. background: #FFFFFF;
  358. display: flex;
  359. align-items: center;
  360. .tabbox {
  361. flex: 1;
  362. height: 100%;
  363. text-align: center;
  364. line-height: 92rpx;
  365. color: #666666;
  366. font-size: 28rpx;
  367. font-weight: 400;
  368. display: flex;
  369. justify-content: center;
  370. .activecllasscet {
  371. width: 96rpx;
  372. color: #2671E2;
  373. font-weight: 600;
  374. border-bottom: 4rpx solid #2671E2;
  375. }
  376. }
  377. }
  378. //多个格子的样式
  379. .boxzonglan {
  380. width: 100%;
  381. min-height: 496rpx;
  382. background: #FFFFFF;
  383. padding: 30rpx 30rpx 30rpx 30rpx;
  384. .zonglantit {
  385. font-size: 30rpx;
  386. color: #333333;
  387. font-family: PingFangSC-Semibold, PingFang SC;
  388. font-weight: 500;
  389. }
  390. .zonglanbox {
  391. width: 100%;
  392. display: flex;
  393. flex-wrap: wrap;
  394. margin-top: 24rpx;
  395. box-shadow: 0px 0px 12rpx 0px rgba(38, 113, 226, 0.1);
  396. border-radius: 12rpx;
  397. .grid {
  398. width: 50%;
  399. // height: 128rpx;
  400. padding-bottom: 24rpx;
  401. // border: 1rpx solid #E0E0E0;
  402. .audonum {
  403. color: #666666;
  404. text-indent: 40rpx;
  405. font-size: 28rpx;
  406. margin-top: 20rpx;
  407. line-height: 40rpx;
  408. display: flex;
  409. align-items: center;
  410. .circle{
  411. width: 20rpx;
  412. height: 20rpx;
  413. background: #FFFFFF;
  414. border: 6rpx solid #2671E2;
  415. margin-right: 12rpx;
  416. margin-left: 30rpx;
  417. border-radius: 50%;
  418. }
  419. }
  420. .num {
  421. color: #333333;
  422. text-indent: 40rpx;
  423. font-size: 44rpx;
  424. font-weight: 600;
  425. line-height: 50rpx;
  426. margin-top: 18rpx;
  427. }
  428. }
  429. }
  430. }
  431. </style>