소스 검색

优化客服组件的rpx计算

萤火科技 4 년 전
부모
커밋
e61cbbdb29
1개의 변경된 파일과 3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      components/page/service/index.vue

+ 3 - 3
components/page/service/index.vue

@@ -19,7 +19,7 @@
 </template>
 
 <script>
-  const rpx = uni.getSystemInfoSync().windowWidth / 750
+  import { rpx2px } from '@/utils/util'
 
   export default {
 
@@ -44,10 +44,10 @@
     },
     computed: {
       right() {
-        return 2 * this.itemStyle.right * rpx
+        return rpx2px(2 * this.itemStyle.right)
       },
       bottom() {
-        return 2 * this.itemStyle.bottom * rpx
+        return rpx2px(2 * this.itemStyle.bottom)
       }
     },