AI销管
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

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