| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <template>
- <view>
- <view class="cell-infos ddflex">
- <view class="cell">
- <image src="../../static/pages/images/cell.png" class="cell-bg"></image>
- <view class="cell-q">
- <view :class="'cell-qs'+(soc>50?' full':'')" :style="'height:'+ soc+'%'"></view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- const app = getApp();
- const req = require("../../utils/request.js");
- export default {
- components: {},
- props: {
- soc:{
- type:Number,
- default:0
- }
- },
- data() {
- return {
- systems: {},
- isTop: 0,
- }
- },
- onLoad(options) {
- },
- onShow() {
- },
- methods: {
- },
- mounted() {
- const systemInfo = uni.getSystemInfoSync();
- // px转换到rpx的比例
- let pxToRpxScale = 750 / systemInfo.windowWidth;
- let systems = {
- ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
- navigationHeight: 44 * pxToRpxScale // 导航栏的高度
- };
- systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
- this.systems = systems;
- },
- onPageScroll: function(e) {
- if (e.scrollTop > this.systems.barHeight) {
- this.isTop = 1;
- } else {
- this.isTop = 0;
- }
- }
- }
- </script>
- <style>
- @import "./index.css";
- </style>
|