- 新增大量图片资源,包括图标、背景图、海报等,用于页面展示 - 添加字体文件及样式配置,支持自定义字体 - 引入 uni-ui 组件库,包括图标、弹窗、日期选择器等常用组件 - 添加网络状态监听、加密工具等基础工具函数 - 配置 Vuex 状态管理,包括购物车数量、热门搜索词等 - 增加页面组件,如用户协议、分销信息、提现状态等 - 配置项目构建和忽略文件,优化开发体验
36 lines
789 B
JavaScript
36 lines
789 B
JavaScript
var inlineTags = {
|
|
abbr: 1,
|
|
b: 1,
|
|
big: 1,
|
|
code: 1,
|
|
del: 1,
|
|
em: 1,
|
|
i: 1,
|
|
ins: 1,
|
|
label: 1,
|
|
q: 1,
|
|
small: 1,
|
|
span: 1,
|
|
strong: 1
|
|
}
|
|
export default {
|
|
// 从顶层标签的样式中取出一些给 rich-text
|
|
getStyle: function(style) {
|
|
if (style) {
|
|
var i, j, res = '';
|
|
if ((i = style.indexOf('display')) != -1)
|
|
res = style.substring(i, (j = style.indexOf(';', i)) == -1 ? style.length : j);
|
|
if ((i = style.indexOf('float')) != -1)
|
|
res += ';' + style.substring(i, (j = style.indexOf(';', i)) == -1 ? style.length : j);
|
|
return res;
|
|
}
|
|
},
|
|
getNode: function(item) {
|
|
return [item];
|
|
},
|
|
// 是否通过 rich-text 显示
|
|
useRichText: function(item) {
|
|
return !item.c && !inlineTags[item.name] && (item.attrs.style || '').indexOf('display:inline') == -1;
|
|
}
|
|
}
|