首页 > 其他分享 >uniapp Watch() 数据监控完成升级

uniapp Watch() 数据监控完成升级

时间:2023-12-17 18:05:05浏览次数:33  
标签:uniapp https Watch E7% ranktitle 监控 allquestions 100 com

handleDataChange() {
				if (this.allquestions < 50) {
					this.rank = 1
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/11.png'
					this.rankrate = Number(this.allquestions) / 50 * 100
					console.log('进入1')
					this.ranktitle = '刷题萌新'
				} else if (this.allquestions > 51 && this.allquestions < 100) {
					console.log('进入2')
					this.rank = 2
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/21.png'
					this.rankrate = Number(this.allquestions) / 100 * 100
					this.ranktitle = '刷题能手'
				} else if (this.allquestions > 101 && this.allquestions < 150) {
					console.log('进入3')
					this.rank = 3
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/31.png'
					this.rankrate = Number(this.allquestions) / 150 * 100
					this.ranktitle = '刷题达人'
				} else if (this.allquestions > 151 && this.allquestions < 200) {
					console.log('进入4')
					this.rank = 4
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/41.png'
					this.rankrate = Number(this.allquestions) / 200 * 100
					this.ranktitle = '刷题狂人'
				} else if (this.allquestions > 201 && this.allquestions < 300) {
					this.rank = 5
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/51.png'
					this.rankrate = Number(this.allquestions) / 300 * 100
					this.ranktitle = '刷题大亨'
				} else if (this.allquestions > 301 && this.allquestions < 400) {
					this.rank = 6
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/61.png'
					this.rankrate = Number(this.allquestions) / 400 * 100
					this.ranktitle = '刷题战神'
				} else if (this.allquestions > 401 && this.allquestions < 500) {
					this.rank = 7
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/71.png'
					this.rankrate = Number(this.allquestions) / 500 * 100
					this.ranktitle = '刷题魔王'
				} else if (this.allquestions > 501 && this.allquestions < 600) {
					this.rank = 8
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/81.png'
					this.rankrate = Number(this.allquestions) / 600 * 100
					this.ranktitle = '刷题狂魔'
				} else if (this.allquestions > 601 && this.allquestions < 700) {
					this.rank = 9
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/91.png'
					this.rankrate = Number(this.allquestions) / 700 * 100
					this.ranktitle = '刷题大师'
				} else if (this.allquestions > 701 && this.allquestions < 800) {
					this.rank = 10
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/101.png'
					this.rankrate = Number(this.allquestions) / 800 * 100
					this.ranktitle = '刷题宗师'
				} else if (this.allquestions > 801 && this.allquestions < 1000) {
					this.rank = 11
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/111.png'
					this.rankrate = Number(this.allquestions) / 1000 * 100
					this.ranktitle = '刷题尊者'
				} else if (this.allquestions > 1001 && this.allquestions < 1200) {
					this.rank = 12
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/121.png'
					this.rankrate = Number(this.allquestions) / 1200 * 100
					this.ranktitle = '刷题仙人'
				} else if (this.allquestions > 1201 && this.allquestions < 1400) {
					this.rank = 13
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/131.png'
					this.rankrate = Number(this.allquestions) / 1400 * 100
					this.ranktitle = '刷题大神'
				} else if (this.allquestions > 1401 && this.allquestions < 1600) {
					this.rank = 14
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/141.png'
					this.rankrate = Number(this.allquestions) / 1600 * 100
					this.ranktitle = '刷题大神'
				} else if (this.allquestions > 1601 && this.allquestions < 1800) {
					this.rank = 15
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/151.png'
					this.rankrate = Number(this.allquestions) / 1800 * 100
					this.ranktitle = '藐视万题'
				} else if (this.allquestions > 1801 && this.allquestions < 2000) {
					this.rank = 16
					this.rankpic = 'https://imgs.91yuwen.com/resouse/%E5%BE%BD%E7%AB%A0/161.png'
					this.rankrate = Number(this.allquestions) / 2000 * 100
					this.ranktitle = '刷题界传说'
				} else {
					console.log(1)
				}
			
			},

WATCH里数据检测

watch: {
			allquestions(newValue, oldValue) {
				this.handleDataChange();
			}
		},

数据传值

getmypersonaldata() {
				
				var that = this
				uni.request({
			
					url: 'https://xxx.xxx.com/xxx/getdata/',
			
					method: "POST",
			
					data: {
						grade: that.lessonName,
					},
			
			
					success(res) {
					
						that.handleDataChange();
					}
				})
			},

标签:uniapp,https,Watch,E7%,ranktitle,监控,allquestions,100,com
From: https://blog.51cto.com/u_15813778/8862412

相关文章

  • 【UniApp】-uni-app-数据传递补充
    前言好,经过上个章节的介绍完毕之后,了解了一下uni-app-CompositionAPI传递数据那么了解完了uni-app-CompositionAPI传递数据之后,这篇文章来给大家介绍一下uni-app-数据传递补充(也就是在补充一点内容给到大家)先主要介绍逆向传递数据,逆向传递数据除了使用事件通道之外,还可以通......
  • Java医院3D人体智能导诊系统源码 Uniapp+springboot
    “智能导诊”以人工智能手段为依托,为人们提供智能分诊、问病信息等服务,在一定程度上满足了人们自我健康管理、精准挂号等需求。智能导诊可根据描述的部位和病症,给出适合病症的科室参考。智慧导诊页面会显示男性或女性的身体结构图,可切换正面/背面。通过点击部位选项,选择自己身体不......
  • 监控易管理平台7.0助力解决IT故障监控与告警问题
    一、背景介绍  随着信息技术的不断发展,大数据中心在各行业中的地位日益重要。作为支撑企业业务发展的重要基础设施,大数据中心的稳定运行和高效管理至关重要。某电力大数据中心面临着众多的IT设备和技术,如何确保这些设备的稳定运行,以及如何及时发现和解决潜在问题,是该中心面临的......
  • 使用 Prometheus 监控 Memcached 最佳实践
    监控Memcached监控Memcached的重要性无法忽视。通过监控Memcached,我们可以及时了解到系统中的缓存命中率、缓存使用量和缓存访问频率等关键指标,从而更好地优化系统性能。同时,监控Memcached还可以帮助我们发现潜在的性能问题和内存泄漏,及时采取措施进行修复,保障系统的稳定运行。在......
  • AWS CloudWatch监控
    基于前一篇post,测试如何在AWS上进行日志监控https://www.cnblogs.com/Andy1982/p/17894837.html在app.js中加入console.info('helloworld');重新执行serverlessdeploy找到APIGateway->找到对应的资源->菜单项:阶段->URL调用测试:https://l9dhk7bna8.execute-api.cn-......
  • uniapp生成带有产品和二维码信息的海报
    需求:后端返回产品图片和个人信息,前端根据产品链接生成二维码,然后将产品图片、用户信息、二维码生成海报,并点击下载。这里使用了qrcodejs2、html2canvas、file-saver插件,使用前分别进行安装。点击海报列表在弹层中显示对应的海报产品,并且生成组合的图片供用户下载。<u-......
  • uniapp的editor组件在H5上无法点击的问题处理
    uniapp开发的移动端H5和小程序,富文本框输入框使用了editor的组件在小程序端是运行正常的,但是在H5端出现了无法点击的情况,是好时坏原因是H5端依赖远端的quill.min.js组件,该远端的组件偶尔会出现访问的情况文档上写的比较清楚,但是具体怎么写没有写的写的很具体  经常尝试,搞定......
  • 【UniApp】-uni-app-传递数据
    前言好,经过上个章节的介绍完毕之后,了解了一下uni-app-路由那么了解完了uni-app-路由之后,这篇文章来给大家介绍一下uni-app-路由传递数据路由传参怎么传,是不是可以从A页面传递给B页面,然后B页面再传递给C页面,也可以从C页面传递给B页面,然后B页面再传递给A......
  • 大华摄像头应用opencvsharp进行实时监控、监控录像保存和播放
    1.配置大华摄像机参数 检查RTSP端口号 修改分辨率,在这里我们主要设置【辅码流】大华RTSP协议解释访问主码流rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0访问辅码流rtsp://admin:[email protected]:554/cam/realmonitor?cha......
  • 【UniApp】-uni-app-路由
    前言好,经过上个章节的介绍完毕之后,了解了一下uni-app-CompositionAPI应用生命周期和页面生命周期那么了解完了uni-app-CompositionAPI应用生命周期和页面生命周期之后,这篇文章来给大家介绍一下uni-app-路由前面我还说过,除了有应用程序的生命周期和页面的生命周期以外,其......