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.

2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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. border-bottom: 1rpx solid #E0E0E0;
  216. display: flex;
  217. .title1 {
  218. flex: 2;
  219. font-size: 30rpx;
  220. font-weight: 600;
  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. .title3-box {
  232. display: flex;
  233. align-items: center;
  234. width: 25%;
  235. justify-content: center;
  236. .activecltab {
  237. border-bottom: 2px solid #2671E2;
  238. }
  239. }
  240. }
  241. .title2 {
  242. flex: 3;
  243. height: 90rpx;
  244. display: flex;
  245. align-items: center;
  246. .title2-che {
  247. width: 178rpx;
  248. height: 48rpx;
  249. background: #FFFFFF;
  250. border-radius: 6rpx;
  251. border: 1px solid #E0E0E0;
  252. line-height: 48rpx;
  253. font-size: 28rpx;
  254. font-weight: 400;
  255. color: #666666;
  256. text-indent: 12rpx;
  257. margin-left: 35rpx;
  258. position: relative;
  259. .righttochoose {
  260. width: 18rpx;
  261. height: 24rpx;
  262. position: absolute;
  263. top: 12rpx;
  264. right: 12rpx;
  265. }
  266. }
  267. }
  268. }
  269. .swiper-box {
  270. width: 97%;
  271. margin: 0 auto;
  272. }
  273. .hejibox {
  274. width: 100%;
  275. height: 80rpx;
  276. display: flex;
  277. .heji {
  278. width: 50%;
  279. height: 100%;
  280. font-size: 28rpx;
  281. font-weight: 400;
  282. color: #666666;
  283. line-height: 80rpx;
  284. text-indent: 30rpx;
  285. }
  286. }
  287. .danwei {
  288. width: 100%;
  289. height: 40rpx;
  290. font-size: 24rpx;
  291. font-weight: 400;
  292. color: #999999;
  293. line-height: 40rpx;
  294. text-indent: 30rpx;
  295. }
  296. .uchaserbox {
  297. width: 95%;
  298. height: 470rpx;
  299. }
  300. .jindu {
  301. width: 100%;
  302. height: 300rpx;
  303. .jindu-box {
  304. width: 100%;
  305. padding-left: 30rpx;
  306. padding-right: 30rpx;
  307. .jindu-boxche {
  308. width: 100%;
  309. height: 46rpx;
  310. display: flex;
  311. align-items: center;
  312. height: 50rpx;
  313. .jindu-name {
  314. width: 120rpx;
  315. font-size: 28rpx;
  316. color: #666666;
  317. }
  318. .jindu-zxl {
  319. width: 120rpx;
  320. font-size: 26rpx;
  321. margin-left: 16rpx;
  322. color: #666666;
  323. text-align: center;
  324. }
  325. }
  326. }
  327. }
  328. }
  329. //时间切换的样式
  330. .boxtittab {
  331. width: 100;
  332. height: 92rpx;
  333. background: #FFFFFF;
  334. border: 1px solid #E0E0E0;
  335. display: flex;
  336. align-items: center;
  337. .tabbox {
  338. flex: 1;
  339. height: 100%;
  340. text-align: center;
  341. line-height: 92rpx;
  342. color: #666666;
  343. font-size: 28rpx;
  344. display: flex;
  345. justify-content: center;
  346. .activecllasscet {
  347. width: 96rpx;
  348. border-bottom: 2px solid #2671E2;
  349. }
  350. }
  351. }
  352. //多个格子的样式
  353. .boxzonglan {
  354. width: 100%;
  355. min-height: 496rpx;
  356. background: #FFFFFF;
  357. padding: 30rpx 30rpx 30rpx 30rpx;
  358. .zonglantit {
  359. font-size: 30rpx;
  360. color: #333333;
  361. font-family: PingFangSC-Semibold, PingFang SC;
  362. font-weight: 600;
  363. }
  364. .zonglanbox {
  365. width: 100%;
  366. display: flex;
  367. flex-wrap: wrap;
  368. margin-top: 24rpx;
  369. .grid {
  370. width: 50%;
  371. height: 128rpx;
  372. border: 1px solid #E0E0E0;
  373. .audonum {
  374. color: #666666;
  375. text-indent: 40rpx;
  376. font-size: 26rpx;
  377. margin-top: 20rpx;
  378. }
  379. .num {
  380. color: #333333;
  381. text-indent: 40rpx;
  382. font-size: 32rpx;
  383. font-weight: 600;
  384. margin-top: 10rpx;
  385. }
  386. }
  387. }
  388. }
  389. </style>