Commit 5a97d94b by zsh

更新基础框架

parent 63f54306
...@@ -84,7 +84,7 @@ module.exports = { ...@@ -84,7 +84,7 @@ module.exports = {
}, },
{ {
// iconfont字体文件 // iconfont字体文件
test: /\.(eot|ttf|svg|woff|woff2)(\?\S*)?$/, test: /\.(eot|ttf|TTF|svg|woff|woff2)(\?\S*)?$/,
// 处理test中的文件类型需要用到的loader类型(名称) // 处理test中的文件类型需要用到的loader类型(名称)
use: { use: {
loader: 'file-loader' loader: 'file-loader'
......
module.exports = { module.exports = {
plugins: [ plugins: [
require("autoprefixer")({ require('autoprefixer')({
overrideBrowserslist: ['last 2 version', '>1%', 'ios 7'] overrideBrowserslist: ['last 2 version', '>1%', 'ios 7']
}) })
] ]
}; }
/* 数字字体包 */ /* 数字字体包 */
@font-face { @font-face {
font-family: "CenturyGothic"; font-family: "CenturyGothic";
src: url('./CenturyGothic.ttf'); src: url('./CenturyGothic.TTF');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
/* UI文字字体包 */ /* UI文字字体包 */
@font-face { @font-face {
font-family: "Alibaba PuHuiTi35"; font-family: "Alibaba PuHuiTi35";
src: url('./AlibabaPuHuiTi-2-35-Thin.ttf'); src: url('./AlibabaPuHuiTi-2-35-Thin.TTF');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
@font-face { @font-face {
font-family: "Alibaba PuHuiTi45"; font-family: "Alibaba PuHuiTi45";
src: url('./AlibabaPuHuiTi-2-45-Light.ttf'); src: url('./AlibabaPuHuiTi-2-45-Light.TTF');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
@font-face { @font-face {
font-family: "Alibaba PuHuiTi55"; font-family: "Alibaba PuHuiTi55";
src: url('./AlibabaPuHuiTi-2-55-Regular.ttf'); src: url('./AlibabaPuHuiTi-2-55-Regular.TTF');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
@font-face { @font-face {
font-family: "Alibaba PuHuiTi65"; font-family: "Alibaba PuHuiTi65";
src: url('./AlibabaPuHuiTi-2-65-Medium.ttf'); src: url('./AlibabaPuHuiTi-2-65-Medium.TTF');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
@font-face { @font-face {
font-family: "Alibaba PuHuiTi75"; font-family: "Alibaba PuHuiTi75";
src: url('./AlibabaPuHuiTi-2-75-SemiBold.ttf'); src: url('./AlibabaPuHuiTi-2-75-SemiBold.TTF');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "DS-Digital-B";
src: url('./DS-DIGIB-2.TTF');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "DS-Digital-I";
src: url('./DS-DIGII-3.TTF');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "DS-Digital-T";
src: url('./DS-DIGIT-4.TTF');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
</div> </div>
<div <div
class="center" class="center"
:style="layoutSize.center"
ref="layoutCenter" ref="layoutCenter"
> >
<div class="content"> <div class="content">
...@@ -50,7 +51,9 @@ export default { ...@@ -50,7 +51,9 @@ export default {
layoutSize: { layoutSize: {
leftWidth: '2168px', leftWidth: '2168px',
rightWidth: '2168px', rightWidth: '2168px',
centerWidth: '100%' center: {
flex: 1
}
} }
} }
}, },
...@@ -70,6 +73,8 @@ export default { ...@@ -70,6 +73,8 @@ export default {
created () { created () {
window.vm = this window.vm = this
this.setPageSize()
}, },
methods: { methods: {
......
...@@ -3,14 +3,16 @@ ...@@ -3,14 +3,16 @@
* @method refreshScale 设置页面缩放比 * @method refreshScale 设置页面缩放比
* @param {Int|Number} designWidth 设计稿宽度, 默认: 1920 * @param {Int|Number} designWidth 设计稿宽度, 默认: 1920
* @param {Int|Number} designHeight 设计稿高度, 默认: 1080 * @param {Int|Number} designHeight 设计稿高度, 默认: 1080
* @param {Int|Number} designWidthRatio 设计宽度比,默认: 16
* @param {Int|Number} designHeightRatio 设计高度比,默认: 9
*/ */
export function refreshScale (designWidth = 1920, designHeight = 1080) { export function refreshScale (designWidth = 1920, designHeight = 1080, designWidthRatio = 16, designHeightRatio = 9) {
let baseWidth = document.documentElement.clientWidth let baseWidth = document.documentElement.clientWidth
let baseHeight = document.documentElement.clientHeight let baseHeight = document.documentElement.clientHeight
let appStyle = document.getElementById('app').style let appStyle = document.getElementById('app').style
let bodyStyle = document.body.style let bodyStyle = document.body.style
let realRatio = baseWidth / baseHeight let realRatio = baseWidth / baseHeight
let designRatio = 16 / 9 // 默认宽高比 let designRatio = designWidthRatio / designHeightRatio // 默认宽高比
let scaleRate = baseWidth / designWidth let scaleRate = baseWidth / designWidth
if (realRatio > designRatio) { if (realRatio > designRatio) {
scaleRate = baseHeight / designHeight scaleRate = baseHeight / designHeight
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment