Explorar el Código

优化客服组件的rpx计算

萤火科技 hace 4 años
padre
commit
e61cbbdb29
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  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)
       }
     },