全站替换成鸿蒙字体,去掉其他字体

master
yujialong 4 months ago
parent f60718eae3
commit 949c57d32c
  1. 20
      public/styles/css/editor.css
  2. BIN
      public/styles/font/HarmonyOS_SansSC_Light.ttf
  3. BIN
      public/styles/font/PingFang-Regular.otf
  4. BIN
      public/styles/font/ProximaNova-Regular.otf
  5. BIN
      public/styles/font/SF-Pro-Display-Regular.otf
  6. BIN
      public/styles/font/SourceHanSansCN-VF-2.otf
  7. 14
      src/components/editor.js
  8. 3
      src/mixins/page/index.js
  9. 46
      src/pages/article/add/editor.js
  10. 36
      src/pages/column/page/devHistory.vue
  11. 4
      src/setting.js
  12. 33
      src/styles/common.scss
  13. BIN
      src/styles/font/HarmonyOS_SansSC_Light.ttf
  14. BIN
      src/styles/font/PingFang-Regular.otf
  15. BIN
      src/styles/font/PingFangSC-Medium.otf
  16. BIN
      src/styles/font/PingFangTC-Semibold.ttf
  17. BIN
      src/styles/font/ProximaNova-Regular.otf
  18. BIN
      src/styles/font/SF-Pro-Display-Bold.otf
  19. BIN
      src/styles/font/SF-Pro-Display-Regular.otf
  20. BIN
      src/styles/font/SourceHanSansCN-VF-2.otf
  21. BIN
      src/styles/font/toppan.otf
  22. 2
      src/styles/layout/index.scss
  23. 2
      src/styles/lib/_style.scss
  24. 3
      src/styles/page/page.scss

@ -1,18 +1,10 @@
@font-face { @font-face {
font-family: SFProDisplay; font-family: Harmony;
src: url('./styles/font/SF-Pro-Display-Regular.otf'); src: url('./styles/font/HarmonyOS_SansSC_Light.ttf');
} }
@font-face { @font-face {
font-family: ProximaNova; font-family: siyuan;
src: url('./styles/font/ProximaNova-Regular.otf'); src: url('./styles/font/SourceHanSansCN-VF-2.otf');
}
@font-face {
font-family: PingFang;
src: url('./styles/font/PingFang-Regular.otf');
}
@font-face {
font-family: PingFang SC;
src: url('./styles/font/PingFang-Regular.otf');
} }
.mce-content-body:not([dir='rtl']) blockquote { .mce-content-body:not([dir='rtl']) blockquote {
padding: 8px 15px; padding: 8px 15px;
@ -48,7 +40,6 @@
.tiny-wrap .block p { .tiny-wrap .block p {
margin: 0 0 10px; margin: 0 0 10px;
font-size: 19px; font-size: 19px;
font-family: SFProDisplay;
font-weight: 400; font-weight: 400;
color: #101010; color: #101010;
line-height: 32px; line-height: 32px;
@ -56,14 +47,12 @@
} }
.tiny-wrap .en-block p, .tiny-wrap .en-block p,
.tiny-wrap .en-block .img-des { .tiny-wrap .en-block .img-des {
font-family: ProximaNova;
letter-spacing: -0.0135em; letter-spacing: -0.0135em;
line-height: 1.5em; line-height: 1.5em;
} }
.tiny-wrap .block .tiny-title { .tiny-wrap .block .tiny-title {
margin: 10px 0; margin: 10px 0;
font-size: 24px; font-size: 24px;
font-family: SFProDisplay;
font-weight: 500; font-weight: 500;
color: #101010; color: #101010;
line-height: 32px; line-height: 32px;
@ -106,7 +95,6 @@
} }
.tiny-wrap .people h6 { .tiny-wrap .people h6 {
font-size: 24px; font-size: 24px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
} }

@ -184,7 +184,7 @@ export default {
], ],
// content_style: Style, // content_style: Style,
fontsize_formats: '12px 14px 16px 18px 19px 22px 24px 36px 48px 56px 72px', fontsize_formats: '12px 14px 16px 18px 19px 22px 24px 36px 48px 56px 72px',
font_formats: '苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif', font_formats: '鸿蒙=Harmony;思源=siyuan;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif',
link_list: [ link_list: [
{ title: '预置链接1', value: 'http://www.tinymce.com' }, { title: '预置链接1', value: 'http://www.tinymce.com' },
{ title: '预置链接2', value: 'http://tinymce.ax-z.cn' } { title: '预置链接2', value: 'http://tinymce.ax-z.cn' }
@ -212,7 +212,8 @@ export default {
}, },
//为内容模板插件提供预置模板 //为内容模板插件提供预置模板
templates: [ templates: [
{ title: '中文文章模板1', description: '图片文字流', content: ` {
title: '中文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block"> <div class="block">
<div class="fl"> <div class="fl">
@ -237,7 +238,8 @@ export default {
</div> </div>
` `
}, },
{ title: '英文文章模板1', description: '图片文字流', content: ` {
title: '英文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block en-block"> <div class="block en-block">
<div class="fr"> <div class="fr">
@ -256,7 +258,8 @@ export default {
</div> </div>
` `
}, },
{ title: '新闻模板', description: '', content: ` {
title: '新闻模板', description: '', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block" style="margin-bottom: 70px;"> <div class="block" style="margin-bottom: 70px;">
<div class="fr"> <div class="fr">
@ -286,7 +289,8 @@ export default {
</div> </div>
` `
}, },
{ title: '图片描述', description: '', content: ` {
title: '图片描述', description: '', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block"> <div class="block">
<div class="img-wrap"> <div class="img-wrap">

@ -71,6 +71,7 @@ export default {
this.id = json.id this.id = json.id
const str = json[json.state ? 'theEditedJson' : 'jsonBeforeEditing'] const str = json[json.state ? 'theEditedJson' : 'jsonBeforeEditing']
const list = JSON.parse(str) const list = JSON.parse(str)
console.log("🚀 ~ this.$post ~ list:", list, json.theEditedJson)
this.modules.map((e, i) => { this.modules.map((e, i) => {
e.form = list[i].form e.form = list[i].form
@ -80,7 +81,7 @@ export default {
} }
}) })
this.originModules = JSON.stringify(this.modules) // 原始json,用以页面离开的时候判断是否需要提示保存 this.originModules = JSON.stringify(this.modules) // 原始json,用以页面离开的时候判断是否需要提示保存
console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", this.modules) console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", this.modules[0])
} }
}).catch(err => { }) }).catch(err => { })
}, },

@ -2,6 +2,8 @@ import Axios from 'axios'
import Api from '@/api' import Api from '@/api'
import Setting from '@/setting' import Setting from '@/setting'
import Util from '@/libs/util' import Util from '@/libs/util'
import store from '@/store'
import { Loading } from 'element-ui'
export default { export default {
//skin:'oxide-dark', //skin:'oxide-dark',
language: 'zh_CN', language: 'zh_CN',
@ -186,7 +188,7 @@ export default {
], ],
// content_style: Style, // content_style: Style,
fontsize_formats: '12px 14px 16px 18px 19px 22px 24px 36px 48px 56px 72px', fontsize_formats: '12px 14px 16px 18px 19px 22px 24px 36px 48px 56px 72px',
font_formats: '苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif', font_formats: '鸿蒙=Harmony;思源=siyuan;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif',
link_list: [ link_list: [
{ title: '预置链接1', value: 'http://www.tinymce.com' }, { title: '预置链接1', value: 'http://www.tinymce.com' },
{ title: '预置链接2', value: 'http://tinymce.ax-z.cn' } { title: '预置链接2', value: 'http://tinymce.ax-z.cn' }
@ -214,7 +216,8 @@ export default {
}, },
//为内容模板插件提供预置模板 //为内容模板插件提供预置模板
templates: [ templates: [
{ title: '中文文章模板1', description: '图片文字流', content: ` {
title: '中文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block"> <div class="block">
<div class="fl"> <div class="fl">
@ -239,7 +242,8 @@ export default {
</div> </div>
` `
}, },
{ title: '英文文章模板1', description: '图片文字流', content: ` {
title: '英文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block en-block"> <div class="block en-block">
<div class="fr"> <div class="fr">
@ -258,7 +262,8 @@ export default {
</div> </div>
` `
}, },
{ title: '新闻模板', description: '', content: ` {
title: '新闻模板', description: '', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block" style="margin-bottom: 70px;"> <div class="block" style="margin-bottom: 70px;">
<div class="fr"> <div class="fr">
@ -288,7 +293,8 @@ export default {
</div> </div>
` `
}, },
{ title: '图片描述', description: '', content: ` {
title: '图片描述', description: '', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block"> <div class="block">
<div class="img-wrap"> <div class="img-wrap">
@ -299,7 +305,8 @@ export default {
</div> </div>
` `
}, },
{ title: '人物详情', description: '', content: ` {
title: '人物详情', description: '', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="people"> <div class="people">
<img class="pic" src="https://new.iasf.ac.cn/images/team/5.png"/> <img class="pic" src="https://new.iasf.ac.cn/images/team/5.png"/>
@ -424,6 +431,14 @@ export default {
let file = this.files[0]; let file = this.files[0];
let fd = new FormData(); let fd = new FormData();
fd.append("file", file); fd.append("file", file);
const load = Loading.service({
lock: true,
text: '正在上传',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
zIndex: 30000,
customClass: 'tinymce-load'
})
Axios({ Axios({
method: 'post', method: 'post',
url: Api.upload, url: Api.upload,
@ -433,13 +448,18 @@ export default {
token: Util.local.get(Setting.tokenKey) token: Util.local.get(Setting.tokenKey)
}, },
}).then(({ data }) => { }).then(({ data }) => {
if (data.code === 401) {
Util.errorMsg(data.msg)
setTimeout(() => {
store.dispatch('user/logout')
}, 1000)
return false
}
load.close()
callback(data.url) callback(data.url)
// if (data.code === 200) { }).catch(res => {
// callback(data.url) load.close()
// } else { })
// Util.errorMsg(data.msg)
// }
}).catch(res => {})
} }
//触发点击 //触发点击
input.click(); input.click();
@ -451,7 +471,7 @@ export default {
editor.on('init', function (ed) { editor.on('init', function (ed) {
// 设置默认字体(新增才需要设置) // 设置默认字体(新增才需要设置)
if (editor.iframeElement.contentWindow.document.body.innerText === '\n') { if (editor.iframeElement.contentWindow.document.body.innerText === '\n') {
ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei") ed.target.editorCommands.execCommand("fontName", false, "Harmony")
ed.target.editorCommands.execCommand("fontSize", false, "19px") ed.target.editorCommands.execCommand("fontSize", false, "19px")
ed.target.editorCommands.execCommand("lineHeight", false, "1") ed.target.editorCommands.execCommand("lineHeight", false, "1")
} }

@ -3,11 +3,9 @@
<div class="actions"> <div class="actions">
<p class="page-name">页面设置/关于IASF-发展历程</p> <p class="page-name">页面设置/关于IASF-发展历程</p>
<div> <div>
<el-button type="primary" <el-button type="primary" @click="preview">预览</el-button>
@click="preview">预览</el-button>
<el-button @click="save(0)">保存为草稿</el-button> <el-button @click="save(0)">保存为草稿</el-button>
<el-button type="primary" <el-button type="primary" @click="save(1)">发布</el-button>
@click="save(1)">发布</el-button>
<el-button @click="back">放弃编辑</el-button> <el-button @click="back">放弃编辑</el-button>
</div> </div>
</div> </div>
@ -15,15 +13,12 @@
<div class="modules"> <div class="modules">
<div class="relative"> <div class="relative">
<div class="single-banner"> <div class="single-banner">
<img class="banner-img" <img class="banner-img" :src="modules[0].form.pic" alt="" />
:src="modules[0].form.pic"
alt="" />
<div class="texts"> <div class="texts">
<h6 class="banner-title">{{ modules[0].form.title }}</h6> <h6 class="banner-title">{{ modules[0].form.title }}</h6>
</div> </div>
</div> </div>
<div class="cover" <div class="cover" @click="toSet(0)">点击更换banner与链接</div>
@click="toSet(0)">点击更换banner与链接</div>
</div> </div>
<div class="block history"> <div class="block history">
@ -31,29 +26,21 @@
<div class="c-wrap"> <div class="c-wrap">
<h6 v-html="modules[1].form.title"></h6> <h6 v-html="modules[1].form.title"></h6>
<p class="en">{{ modules[1].form.subTitle }}</p> <p class="en">{{ modules[1].form.subTitle }}</p>
<div class="text" <div class="text" v-html="modules[1].form.des"></div>
v-html="modules[1].form.des"></div> <div class="cover" @click="toSet(1)">点击更换标题小标题与概述</div>
<div class="cover"
@click="toSet(1)">点击更换标题小标题与概述</div>
</div> </div>
<div class="c-wrap"> <div class="c-wrap">
<h6 style="font-size: 1.6rem">{{ modules[2].form.title }}</h6> <h6 style="font-size: 1.6rem">{{ modules[2].form.title }}</h6>
<p class="en" <p class="en" style="margin-top: -15px;font-size: 1.6rem">{{ modules[2].form.subTitle }}</p>
style="margin-top: -15px;font-size: 1.6rem">{{ modules[2].form.subTitle }}</p> <div class="text" v-html="modules[2].form.des"></div>
<div class="text" <div class="cover" @click="toSet(2)">点击更换标题小标题与概述</div>
v-html="modules[2].form.des"></div>
<div class="cover"
@click="toSet(2)">点击更换标题小标题与概述</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<Module ref="module" <Module ref="module" :data.sync="curData" :visible.sync="diaVisible" @moduleSubmit="moduleSubmit" />
:data.sync="curData"
:visible.sync="diaVisible"
@moduleSubmit="moduleSubmit" />
</div> </div>
</template> </template>
@ -94,6 +81,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../styles/page/page.scss'; @import '../../../styles/page/page.scss';
.history { .history {
h6 { h6 {
position: relative; position: relative;
@ -102,6 +90,7 @@ export default {
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
} }
.en { .en {
margin-top: -25px; margin-top: -25px;
font-size: 2.4rem; font-size: 2.4rem;
@ -109,6 +98,7 @@ export default {
font-weight: 300; font-weight: 300;
color: #e3e3e3; color: #e3e3e3;
} }
.text { .text {
max-width: 1200px; max-width: 1200px;
margin: 30px 0; margin: 30px 0;

@ -3,7 +3,9 @@
* */ * */
const isDev = process.env.NODE_ENV === 'development' // 开发环境 const isDev = process.env.NODE_ENV === 'development' // 开发环境
let host = `${location.origin}/` let host = `${location.origin}/`
if (isDev) {
host = 'http://192.168.31.51:10000/'
}
const Setting = { const Setting = {
/** /**
* 基础配置 * 基础配置

@ -1,32 +1,12 @@
@import "./default/index.scss"; @import "./default/index.scss";
@font-face { @font-face {
font-family: PingFang; font-family: Harmony;
src: url('font/PingFang-Regular.otf'); src: url('font/HarmonyOS_SansSC_Light.ttf');
} }
@font-face { @font-face {
font-family: PingFangSC-Medium; font-family: siyuan;
src: url('font/PingFangSC-Medium.otf'); src: url('font/SourceHanSansCN-VF-2.otf');
}
@font-face {
font-family: PingFangSC-Semibold;
src: url('font/PingFangTC-Semibold.ttf');
}
@font-face {
font-family: SFProDisplay-Bold;
src: url('font/SF-Pro-Display-Bold.otf');
}
@font-face {
font-family: SFProDisplay;
src: url('font/SF-Pro-Display-Regular.otf');
}
@font-face {
font-family: toppan;
src: url('font/toppan.otf');
}
@font-face {
font-family: ProximaNova;
src: url('font/ProximaNova-Regular.otf');
} }
[v-cloak] { [v-cloak] {
display: none; display: none;
@ -208,7 +188,6 @@
.cell { .cell {
font-size: 12px; font-size: 12px;
color: #333; color: #333;
font-family: PingFangSC-Regular, PingFang SC;
} }
} }
th { th {
@ -218,7 +197,6 @@
color: #323232; color: #323232;
font-size: 12px; font-size: 12px;
font-weight: 500; font-weight: 500;
font-family: PingFangSC-Medium, PingFang SC;
} }
} }
} }
@ -439,3 +417,6 @@
.tox-tinymce-aux { .tox-tinymce-aux {
z-index: 2500 !important; z-index: 2500 !important;
} }
.tinymce-load {
z-index: 3000 !important;
}

Binary file not shown.

@ -11,7 +11,7 @@ body,
body { body {
min-width: 1280px; min-width: 1280px;
font-family: PingFang, PingFang SC, "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; font-family: Harmony, STHeiTi, sans-serif;
font-size: 14px; font-size: 14px;
background: #F0F2F5; background: #F0F2F5;
} }

@ -1,3 +1,3 @@
html { html {
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; font-family: Harmony, STHeiTi, sans-serif;
} }

@ -4,7 +4,6 @@
position: relative; position: relative;
margin-bottom: 50px; margin-bottom: 50px;
font-size: 50px; font-size: 50px;
font-family: SFProDisplay-Bold, SFProDisplay;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
line-height: 60px; line-height: 60px;
@ -63,11 +62,9 @@
.banner-title { .banner-title {
margin-bottom: 19px; margin-bottom: 19px;
font-size: 48px; font-size: 48px;
font-family: PingFangSC-Medium, PingFang SC;
} }
.banner-des { .banner-des {
font-size: 24px; font-size: 24px;
font-family: PingFangSC-Medium, PingFang SC;
} }
} }
.gray { .gray {

Loading…
Cancel
Save