uni-modules组件升级,u-icon组件替换uni-icons,前面的那个网络不好的时候加载不出来
This commit is contained in:
@@ -18,9 +18,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="loadmore">
|
<view class="loadmore" @click="loadMore" v-if="members > users.length">
|
||||||
<u-icon name="arrow-right" @click="loadMore" v-if="members > users.length" color="#999" labelColor="#999"
|
查看更多群成员 <uni-icons size="30rpx" type="right"></uni-icons>
|
||||||
label="查看更多群成员" labelPos="left" :labelSize="labelSize" :size="iconSize" />
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-action-sheet :actions="actionMap" :title="actionTitle" cancelText="取消" @close="hideAction"
|
<u-action-sheet :actions="actionMap" :title="actionTitle" cancelText="取消" @close="hideAction"
|
||||||
@@ -38,11 +37,11 @@
|
|||||||
transferGroupOwner
|
transferGroupOwner
|
||||||
} from '@/apis/interfaces/im.js'
|
} from '@/apis/interfaces/im.js'
|
||||||
import utils from '@/utils/index.js'
|
import utils from '@/utils/index.js'
|
||||||
import imBase from '../mixins/imBase.js'
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [
|
mixins: [
|
||||||
imBase
|
imBase
|
||||||
],
|
],
|
||||||
props: {
|
props: {
|
||||||
targetId: {
|
targetId: {
|
||||||
@@ -71,7 +70,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.labelSize = utils.rpx2px(24)
|
|
||||||
this.iconSize = utils.rpx2px(26)
|
this.iconSize = utils.rpx2px(26)
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -102,10 +100,10 @@
|
|||||||
hideAction(item) {
|
hideAction(item) {
|
||||||
this.actionShow = false
|
this.actionShow = false
|
||||||
},
|
},
|
||||||
showAction(item) {
|
showAction(item) {
|
||||||
if (item.is_admin == 2) {
|
if (item.is_admin == 2) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.currentUser = item
|
this.currentUser = item
|
||||||
this.actionTitle = item.name
|
this.actionTitle = item.name
|
||||||
// 只有管理员以上才会弹窗
|
// 只有管理员以上才会弹窗
|
||||||
@@ -322,12 +320,16 @@
|
|||||||
|
|
||||||
.loadmore {
|
.loadmore {
|
||||||
font-size: 26rpx;
|
font-size: 26rpx;
|
||||||
color: $text-gray-m;
|
color: $text-gray-m !important;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.uni-icons {
|
||||||
|
color: $text-gray-m !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,19 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<view v-if="!isRemote">
|
<view v-if="!isRemote">
|
||||||
<view class="state" v-if="isGroup">
|
<view class="state" v-if="isGroup">
|
||||||
<!-- 已发送 -->
|
<!-- 已发送 -->
|
||||||
<u-icon name="checkbox-mark" :size="iconSize" class="sent"
|
<uni-icons class="sent" type="checkmarkempty" size="28rpx" :color="message.sentStatus >= 30 ? '#34CE98' : '#999999'" />
|
||||||
:color="message.sentStatus >= 30 ? '#34CE98' : '#999999' " />
|
|
||||||
<!-- 已阅读 -->
|
|
||||||
<text class="readers">{{ readers }}</text>
|
<text class="readers">{{ readers }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="state" v-else>
|
<view class="state" v-else>
|
||||||
<!-- 已发送 -->
|
<uni-icons class="sent" type="checkmarkempty" size="28rpx" :color="message.sentStatus >= 30 ? '#34CE98' : '#999999'" />
|
||||||
<u-icon name="checkbox-mark" :size="iconSize" class="sent"
|
<uni-icons class="receive" type="checkmarkempty" size="28rpx" :color="message.sentStatus >= 50 ? '#34CE98' : '#999999'" />
|
||||||
:color="message.sentStatus >= 30 ? '#34CE98' : '#999999' " />
|
|
||||||
<!-- 已阅读 -->
|
|
||||||
<u-icon name="checkbox-mark" :size="iconSize" class="receive"
|
|
||||||
:color="message.sentStatus >= 50 ? '#34CE98' : '#999999' " />
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="msg--call">
|
<view class="msg--call">
|
||||||
<view class="name" v-if="isGroup && isRemote">{{ contact(message.senderUserId).name }}</view>
|
<view class="name" v-if="isGroup && isRemote">{{ contact(message.senderUserId).name }}</view>
|
||||||
<view class="im--text" :class="isRemote ? 'left': 'right'">
|
<view class="im--text" :class="isRemote ? 'left': 'right'">
|
||||||
<u-icon name="camera" size="22" v-if="msg.mediaType == 1" :label="label" />
|
<uni-icons type="videocam" size="44rpx" v-if="msg.mediaType == 1" />
|
||||||
<u-icon name="phone" size="22" v-else :label="label" />
|
<uni-icons type="phone" size="40rpx" v-else />
|
||||||
|
{{ label }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -68,7 +69,8 @@
|
|||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: $text-color;
|
color: $text-color;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
&.left {
|
&.left {
|
||||||
border-radius: 0 20rpx 20rpx 20rpx;
|
border-radius: 0 20rpx 20rpx 20rpx;
|
||||||
@@ -80,8 +82,8 @@
|
|||||||
background: $main-color;
|
background: $main-color;
|
||||||
color: white;
|
color: white;
|
||||||
|
|
||||||
.u-icon {
|
.uni-icons {
|
||||||
color: white;
|
color: white !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
## 2.1.0(2022-01-14)
|
## 2.2.2(2022-02-18)
|
||||||
1. 新增了添加多个数据的事件选项(options, index)(感谢`@风扬`)
|
1. 解决了自增约束的部分bug
|
||||||
## 2.1.2(2022-01-14)
|
2. 解决了处理类型的问题
|
||||||
1. 新增了添加多个数据的事件选项(options, index)(感谢`@风扬`)
|
## 2.2.0(2022-02-16)
|
||||||
|
1. 重新处理了判断类型的方法
|
||||||
|
2. 解决了`no connect`的问题
|
||||||
|
3. 新增了自增约束,需要为数字类型
|
||||||
## 2.1.0(2022-01-14)
|
## 2.1.0(2022-01-14)
|
||||||
1. 新增了添加多个数据的事件选项(options, index)(感谢`@风扬`)
|
1. 新增了添加多个数据的事件选项(options, index)(感谢`@风扬`)
|
||||||
## 2.0.2(2022-01-05)
|
## 2.0.2(2022-01-05)
|
||||||
|
|||||||
@@ -37,10 +37,13 @@ class Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils.log(primaryKeyArr.length);
|
Utils.log(primaryKeyArr.length);
|
||||||
if (primaryKeyArr.length>=1) {
|
if (primaryKeyArr.length>1) {
|
||||||
sql = `CREATE TABLE '${name}' (${sqlArr.join(', ')}, PRIMARY KEY (${primaryKeyArr.join()}))`;
|
|
||||||
}else{
|
sql = `CREATE TABLE '${name}' (${sqlArr.join(', ').replaceAll(' PRIMARY KEY','')}, PRIMARY KEY (${primaryKeyArr.join()}))`;
|
||||||
|
}
|
||||||
|
else{
|
||||||
sql = `CREATE TABLE '${name}' (${sqlArr.join(', ')})`;
|
sql = `CREATE TABLE '${name}' (${sqlArr.join(', ')})`;
|
||||||
}
|
}
|
||||||
Utils.log(`modelSql :${sql}`);
|
Utils.log(`modelSql :${sql}`);
|
||||||
@@ -59,6 +62,22 @@ class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
restrainArray.push(Utils.toType(options.type));
|
restrainArray.push(Utils.toType(options.type));
|
||||||
|
|
||||||
|
// 主键
|
||||||
|
if (options.primaryKey == true) {
|
||||||
|
if(options.autoIncrement != true){
|
||||||
|
restrainArray.push('PRIMARY KEY');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 自增
|
||||||
|
if (Utils.isNumber(options.type)&&options.autoIncrement == true) {
|
||||||
|
restrainArray.pop();
|
||||||
|
restrainArray.push('INTEGER');
|
||||||
|
restrainArray.push('PRIMARY KEY');
|
||||||
|
restrainArray.push('AUTOINCREMENT');
|
||||||
|
}
|
||||||
|
|
||||||
// 非空
|
// 非空
|
||||||
if (options.notNull == true) {
|
if (options.notNull == true) {
|
||||||
restrainArray.push('NOT NULL');
|
restrainArray.push('NOT NULL');
|
||||||
@@ -74,10 +93,6 @@ class Utils {
|
|||||||
restrainArray.push('UNIQUE');
|
restrainArray.push('UNIQUE');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 主键
|
|
||||||
// if (options.primaryKey === true) {
|
|
||||||
// restrainArray.push('PRIMARY KEY');
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 检查
|
// 检查
|
||||||
if (options.check) {
|
if (options.check) {
|
||||||
@@ -87,27 +102,44 @@ class Utils {
|
|||||||
return restrainArray.join(' ');
|
return restrainArray.join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 联合主键
|
|
||||||
static getUnionPrimaryKey() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static toType(jsType) {
|
static toType(jsType) {
|
||||||
let sqliteType = '';
|
let sqliteType = '';
|
||||||
if (jsType == Number) {
|
if (Utils.isNumber(jsType)) {
|
||||||
sqliteType = 'numeric';
|
sqliteType = 'numeric';
|
||||||
} else if (jsType == Date) {
|
} else if (Utils.isDate(jsType)) {
|
||||||
sqliteType = 'timestamp';
|
sqliteType = 'timestamp';
|
||||||
} else {
|
} else {
|
||||||
sqliteType = 'varchar';
|
sqliteType = 'varchar';
|
||||||
}
|
}
|
||||||
return sqliteType;
|
return sqliteType;
|
||||||
}
|
}
|
||||||
|
|
||||||
static log() {
|
static log() {
|
||||||
if (config.deBug) {
|
if (config.deBug) {
|
||||||
console.log.apply(null, arguments);
|
console.log.apply(null, arguments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static warn() {
|
||||||
|
if (config.deBug) {
|
||||||
|
console.warn.apply(null, arguments);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static error() {
|
||||||
|
console.error.apply(null, arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
static isArray(value){ return Object.prototype.toString.call(value) === '[object Array]'}
|
||||||
|
static isObject(value){ return Object.prototype.toString.call(value) === '[object Object]'}
|
||||||
|
static isString(value){ return Object.prototype.toString.call(value) === '[object String]'}
|
||||||
|
static isFunction(value){ return (value === Function || Object.prototype.toString.call(value) === '[object Function]')}
|
||||||
|
static isNumber(value){ return (value === Number || Object.prototype.toString.call(value) === '[object Number]')}
|
||||||
|
static isNaN(value){ return (Object.prototype.toString.call(value) === '[object Number]' && isNaN(value))}
|
||||||
|
static isBoolean(value){ return Object.prototype.toString.call(value) === '[object Boolean]'}
|
||||||
|
static isUndefined(value){ return Object.prototype.toString.call(value) === '[object Undefined]'}
|
||||||
|
static isModel(value){ return Object.prototype.toString.call(value) === '[object Model]'}
|
||||||
|
static isDate(value){ return (value === Date||Object.prototype.toString.call(value) === '[object Date]')}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -118,7 +150,7 @@ class Model {
|
|||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param {String} name 数据库表名
|
* @param {String} name 数据库表名
|
||||||
* @param {Object} options 数据表列对象
|
* @param {} options 数据表列对象
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
constructor(name, options) {
|
constructor(name, options) {
|
||||||
@@ -129,7 +161,10 @@ class Model {
|
|||||||
if (config.isConnect) {
|
if (config.isConnect) {
|
||||||
self.repair();
|
self.repair();
|
||||||
} else {
|
} else {
|
||||||
console.error('no connect');
|
if(!config.name||!config.path){
|
||||||
|
console.error('"config.name" or "config.path" is empty');
|
||||||
|
}
|
||||||
|
usqlite.connect(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,21 +173,27 @@ class Model {
|
|||||||
* @param {String|Array} options
|
* @param {String|Array} options
|
||||||
* - String WHERE 内容
|
* - String WHERE 内容
|
||||||
* - Array 需要查询的列
|
* - Array 需要查询的列
|
||||||
* @param {*} callback
|
* @param {Function} callback
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
find(options, callback) {
|
find(options, callback) {
|
||||||
let sql = '';
|
let sql = '';
|
||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
if (!callback) {
|
if(!(Utils.isString(options)||Utils.isArray(options)||Utils.isFunction(options))) {
|
||||||
|
Utils.error('The first parameter of Model.find should be "Array", "String" or "Function" (when there is only one parameter).')
|
||||||
|
}
|
||||||
|
if(!callback&&!(Utils.isFunction(options))) {
|
||||||
|
Utils.error('The second parameter of Model.find should be "Function".')
|
||||||
|
}
|
||||||
|
if (!callback&&Utils.isFunction(options)) {
|
||||||
sql = `SELECT * FROM '${this.name}'`; // 查找全部
|
sql = `SELECT * FROM '${this.name}'`; // 查找全部
|
||||||
callback = options;
|
callback = options;
|
||||||
} else if (options.constructor == Array) {
|
} else if (Utils.isArray(options)) {
|
||||||
sql = `SELECT ${options.join()} FROM '${this.name}'`; // 查找制定列
|
sql = `SELECT ${options.join()} FROM '${this.name}'`; // 查找制定列
|
||||||
} else if (options.constructor == String) {
|
} else if (Utils.isString(options)) {
|
||||||
sql = `SELECT * FROM '${this.name}' WHERE ${options}`; // 制定条件查询
|
sql = `SELECT * FROM '${this.name}' WHERE ${options}`; // 制定条件查询
|
||||||
};
|
}
|
||||||
|
|
||||||
Utils.log(`find: ${sql}`);
|
Utils.log(`find: ${sql}`);
|
||||||
|
|
||||||
@@ -180,7 +221,13 @@ class Model {
|
|||||||
let sql = '';
|
let sql = '';
|
||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
|
if(!Utils.isObject(options)){
|
||||||
|
Utils.error('The first parameter of Model.limit should be "Object".')
|
||||||
|
}
|
||||||
|
if(!Utils.isFunction(callback)){
|
||||||
|
Utils.error('The second parameter of Model.limit should be "Function".')
|
||||||
|
}
|
||||||
|
|
||||||
if (!options.where) {
|
if (!options.where) {
|
||||||
// 不存在 where
|
// 不存在 where
|
||||||
sql =
|
sql =
|
||||||
@@ -215,12 +262,19 @@ class Model {
|
|||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
|
|
||||||
|
if(!(Utils.isObject(options)||Util.isArray(options))){
|
||||||
|
Utils.error('The first parameter of Model.insert should be "Object" or "Array".')
|
||||||
|
}
|
||||||
|
if(!Utils.isFunction(callback)){
|
||||||
|
Utils.error('The second parameter of Model.insert should be "Function".')
|
||||||
|
}
|
||||||
|
|
||||||
if (config.isConnect) {
|
if (config.isConnect) {
|
||||||
if (options.constructor == Array) {
|
if (Utils.isArray(options)) {
|
||||||
for (var i = 0; i < options.length; i++) {
|
for (var i = 0; i < options.length; i++) {
|
||||||
this.insert(options[i], callback, i);
|
this.insert(options[i], callback, i);
|
||||||
}
|
}
|
||||||
} else if (options.constructor == Object) {
|
} else if (Utils.isObject(options)) {
|
||||||
let keys = [];
|
let keys = [];
|
||||||
let values = [];
|
let values = [];
|
||||||
let index = arguments[3]??null;
|
let index = arguments[3]??null;
|
||||||
@@ -255,7 +309,7 @@ class Model {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 更新数据
|
* @description 更新数据
|
||||||
* @param {Object} options:可选参数 更新条件
|
* @param {String} options:可选参数 更新条件
|
||||||
* @param {Object} obj: 修改后的数据
|
* @param {Object} obj: 修改后的数据
|
||||||
* @param {Function} callback :(err,results)=>{}
|
* @param {Function} callback :(err,results)=>{}
|
||||||
*/
|
*/
|
||||||
@@ -264,7 +318,14 @@ class Model {
|
|||||||
let self = this;
|
let self = this;
|
||||||
let items = [];
|
let items = [];
|
||||||
self.repair();
|
self.repair();
|
||||||
|
|
||||||
|
if(!(Utils.isObject(options)||Utils.isString(options))){
|
||||||
|
Utils.error('The first parameter of Model.update should be "Object" or "String".')
|
||||||
|
}
|
||||||
|
if(!(Utils.isObject(obj)||Utils.isFunction(obj))){
|
||||||
|
Utils.error('The second parameter of Model.update should be "Objrct" or "Function".')
|
||||||
|
}
|
||||||
|
|
||||||
if (!callback) {
|
if (!callback) {
|
||||||
// 不存在options
|
// 不存在options
|
||||||
callback = obj;
|
callback = obj;
|
||||||
@@ -298,13 +359,20 @@ class Model {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 删除数据
|
* @description 删除数据
|
||||||
* @param {Object} options :可选参数 删除条件
|
* @param {String} options :可选参数 删除条件
|
||||||
* @param {Function} callback :(err,results)=>{}
|
* @param {Function} callback :(err,results)=>{}
|
||||||
*/
|
*/
|
||||||
delete(options, callback) {
|
delete(options, callback) {
|
||||||
var sql = '';
|
var sql = '';
|
||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
|
|
||||||
|
if(!(Utils.isString(options)||Utils.isFunction(options))){
|
||||||
|
Utils.error('The first parameter of Model.delete should be "Object" or "Function".')
|
||||||
|
}
|
||||||
|
if(callback&&!Utils.isFunction(callback)){
|
||||||
|
Utils.error('The second parameter of Model.delete should be "Function".')
|
||||||
|
}
|
||||||
|
|
||||||
if (!callback) {
|
if (!callback) {
|
||||||
sql = `DELETE FROM '${this.name}'`;
|
sql = `DELETE FROM '${this.name}'`;
|
||||||
@@ -330,7 +398,7 @@ class Model {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 重命名或者新增列
|
* @description 重命名或者新增列
|
||||||
* @param {Object} options 参数 数组为新增多列 对象为新增单列{aa} 字符串重命名
|
* @param {Object|Array|String} options 参数 数组为新增多列 对象为新增单列{aa} 字符串重命名
|
||||||
* @param {Function} callback :(err,results)=>{}
|
* @param {Function} callback :(err,results)=>{}
|
||||||
* @return:
|
* @return:
|
||||||
*/
|
*/
|
||||||
@@ -338,12 +406,18 @@ class Model {
|
|||||||
let self = this;
|
let self = this;
|
||||||
let sql = '';
|
let sql = '';
|
||||||
self.repair();
|
self.repair();
|
||||||
|
if(!(Utils.isObject(options)||Utils.isArray(options)||Utils.isString(options))){
|
||||||
if (options.constructor == Array) { // 新增多列
|
Utils.error('The first parameter of Model.alter should be "Object", "Array" or "String".')
|
||||||
|
}
|
||||||
|
if(!Utils.isFunction(callback)){
|
||||||
|
Utils.error('The second parameter of Model.alter should be "Function".')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Utils.isArray(options)) { // 新增多列
|
||||||
for (let i = 0; i < options.length; i++) {
|
for (let i = 0; i < options.length; i++) {
|
||||||
self.alter(options[i], callback);
|
self.alter(options[i], callback);
|
||||||
}
|
}
|
||||||
} else if (options.constructor == Object) { // 新增单列
|
} else if (Utils.isObject(options)) { // 新增单列
|
||||||
let column = Utils.restrain(options.name, options.option);
|
let column = Utils.restrain(options.name, options.option);
|
||||||
sql = `ALTER TABLE '${this.name}' ADD COLUMN ${column}`
|
sql = `ALTER TABLE '${this.name}' ADD COLUMN ${column}`
|
||||||
} else if (options.constructor == String) { // 重命名
|
} else if (options.constructor == String) { // 重命名
|
||||||
@@ -374,13 +448,13 @@ class Model {
|
|||||||
*/
|
*/
|
||||||
join(model, options, callback) {
|
join(model, options, callback) {
|
||||||
if (!model) {
|
if (!model) {
|
||||||
console.error('"model" cannot be empty.');
|
Utils.error('"model" cannot be empty.');
|
||||||
}
|
}
|
||||||
if (options.constructor != Object) {
|
if (!Utils.isObject(options)) {
|
||||||
console.error('The type of "options" is wrong, it should be "Object".');
|
Utils.error('The type of "options" is wrong, it should be "Object".');
|
||||||
}
|
}
|
||||||
if (!options.type || !options.predicate) {
|
if (!options.type || !options.predicate) {
|
||||||
console.error('Missing required parameters');
|
Utils.error('Missing required parameters');
|
||||||
}
|
}
|
||||||
|
|
||||||
let leftName = this.name;
|
let leftName = this.name;
|
||||||
@@ -427,6 +501,13 @@ class Model {
|
|||||||
* @param {Function} callback :(err,results)=>{}
|
* @param {Function} callback :(err,results)=>{}
|
||||||
*/
|
*/
|
||||||
sql(sql, callback) {
|
sql(sql, callback) {
|
||||||
|
if (!Utils.isString(sql)) {
|
||||||
|
Utils.error('"The type of "sql" is wrong, it should be "String".');
|
||||||
|
}
|
||||||
|
if (callback&&!Utils.isFunction(callback)) {
|
||||||
|
Utils.error('The type of "callback" is wrong, it should be "Function".');
|
||||||
|
}
|
||||||
|
|
||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
|
|
||||||
@@ -449,6 +530,10 @@ class Model {
|
|||||||
* @param {Function} callback
|
* @param {Function} callback
|
||||||
*/
|
*/
|
||||||
isExist(callback) {
|
isExist(callback) {
|
||||||
|
if (callback&&!Utils.isFunction(callback)) {
|
||||||
|
Utils.error('The type of "callback" is wrong, it should be "Function".');
|
||||||
|
}
|
||||||
|
|
||||||
let sql = `SELECT count(*) AS isExist FROM sqlite_master WHERE type='table' AND name='${this.name}'`;
|
let sql = `SELECT count(*) AS isExist FROM sqlite_master WHERE type='table' AND name='${this.name}'`;
|
||||||
let self = this;
|
let self = this;
|
||||||
Utils.log(`isExist: ${sql}`);
|
Utils.log(`isExist: ${sql}`);
|
||||||
@@ -470,6 +555,10 @@ class Model {
|
|||||||
* @param {Function} callback
|
* @param {Function} callback
|
||||||
*/
|
*/
|
||||||
drop(callback) {
|
drop(callback) {
|
||||||
|
if (callback&&!Utils.isFunction(callback)) {
|
||||||
|
Utils.error('The type of "callback" is wrong, it should be "Function".');
|
||||||
|
}
|
||||||
|
|
||||||
var sql = `DROP TABLE '${this.name}'`;
|
var sql = `DROP TABLE '${this.name}'`;
|
||||||
let self = this;
|
let self = this;
|
||||||
self.repair();
|
self.repair();
|
||||||
@@ -493,6 +582,10 @@ class Model {
|
|||||||
* @param {Function} callback
|
* @param {Function} callback
|
||||||
*/
|
*/
|
||||||
create(callback) {
|
create(callback) {
|
||||||
|
if (callback&&!Utils.isFunction(callback)) {
|
||||||
|
Utils.error('The type of "callback" is wrong, it should be "Function".');
|
||||||
|
}
|
||||||
|
|
||||||
let self = this;
|
let self = this;
|
||||||
let sql = Utils.modelSql(self.name, self.options);
|
let sql = Utils.modelSql(self.name, self.options);
|
||||||
Utils.log(`create: ${sql}`);
|
Utils.log(`create: ${sql}`);
|
||||||
@@ -574,6 +667,7 @@ export class usqlite {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 断开数据库
|
* @description 断开数据库
|
||||||
* @param {*} callback
|
* @param {*} callback
|
||||||
@@ -591,6 +685,19 @@ export class usqlite {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
static closeAsync(options){
|
||||||
|
plus.sqlite.closeDatabase({
|
||||||
|
name: config.name, //数据库名称
|
||||||
|
path: config.path, //数据库地址
|
||||||
|
success(e) {
|
||||||
|
config.isConnect = false;
|
||||||
|
callback(null, e);
|
||||||
|
},
|
||||||
|
fail(e) {
|
||||||
|
callback(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @description 创建 Model 对象
|
* @description 创建 Model 对象
|
||||||
* @example
|
* @example
|
||||||
|
|||||||
BIN
uni_modules/onemue-USQLite/js_sdk/usqlite.js.zip
Normal file
BIN
uni_modules/onemue-USQLite/js_sdk/usqlite.js.zip
Normal file
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "onemue-USQLite",
|
"id": "onemue-USQLite",
|
||||||
"displayName": "u-SQLite V2",
|
"displayName": "u-SQLite V2",
|
||||||
"version": "2.1.0",
|
"version": "2.2.2",
|
||||||
"description": "基于ORM技术,使用对象的方式来操作sqlite数据库,而无需编写任何sql语句.",
|
"description": "基于ORM技术,使用对象的方式来操作sqlite数据库,而无需编写任何sql语句.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"USQLite,数据库操作,缓存,大数据缓存,sqlite,sql,orm"
|
"USQLite,数据库操作,缓存,大数据缓存,sqlite,sql,orm"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<h2>onemue-USQLite</h2>
|
<h2>onemue-USQLite</h2><h2>onemue-USQLite</h2>
|
||||||
|
|
||||||
|
<h2 style="color:red">没有特别说明,均为异步函数</h2>
|
||||||
> u-SQLite 交流群:643867519
|
> u-SQLite 交流群:643867519
|
||||||
> 如果觉的当前插件对你有帮助可以前往 [github](https://github.com/onemue/u-sqlite) 点 star!
|
> 如果觉的当前插件对你有帮助可以前往 [github](https://github.com/onemue/u-sqlite) 点 star!
|
||||||
|
|
||||||
@@ -49,6 +50,7 @@ let studentModel = uni.$sql.model('student',{
|
|||||||
- unique UNIQUE 不重复
|
- unique UNIQUE 不重复
|
||||||
- default DEFAULT 默认值
|
- default DEFAULT 默认值
|
||||||
- notNull NOT NULL 非空
|
- notNull NOT NULL 非空
|
||||||
|
- autoIncrement AUTOINCREMENT 非空
|
||||||
|
|
||||||
**联合主键**
|
**联合主键**
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
## 1.3.5(2022-01-24)
|
||||||
|
- 优化 size 属性可以传入不带单位的字符串数值
|
||||||
|
## 1.3.4(2022-01-24)
|
||||||
|
- 优化 size 支持其他单位
|
||||||
|
## 1.3.3(2022-01-17)
|
||||||
|
- 修复 nvue 有些图标不显示的bug,兼容老版本图标
|
||||||
## 1.3.2(2021-12-01)
|
## 1.3.2(2021-12-01)
|
||||||
- 优化 示例可复制图标名称
|
- 优化 示例可复制图标名称
|
||||||
## 1.3.1(2021-11-23)
|
## 1.3.1(2021-11-23)
|
||||||
|
|||||||
@@ -173,6 +173,13 @@ export default {
|
|||||||
"unicode": "e6bb",
|
"unicode": "e6bb",
|
||||||
"unicode_decimal": 59067
|
"unicode_decimal": 59067
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923353",
|
||||||
|
"name": "arrowthinright",
|
||||||
|
"font_class": "arrowthinright",
|
||||||
|
"unicode": "e6bb",
|
||||||
|
"unicode_decimal": 59067
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923354",
|
"icon_id": "24923354",
|
||||||
"name": "arrowthinleft",
|
"name": "arrowthinleft",
|
||||||
@@ -180,6 +187,13 @@ export default {
|
|||||||
"unicode": "e6bc",
|
"unicode": "e6bc",
|
||||||
"unicode_decimal": 59068
|
"unicode_decimal": 59068
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923354",
|
||||||
|
"name": "arrowthinleft",
|
||||||
|
"font_class": "arrowthinleft",
|
||||||
|
"unicode": "e6bc",
|
||||||
|
"unicode_decimal": 59068
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923355",
|
"icon_id": "24923355",
|
||||||
"name": "arrowthinup",
|
"name": "arrowthinup",
|
||||||
@@ -187,12 +201,25 @@ export default {
|
|||||||
"unicode": "e6bd",
|
"unicode": "e6bd",
|
||||||
"unicode_decimal": 59069
|
"unicode_decimal": 59069
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923355",
|
||||||
|
"name": "arrowthinup",
|
||||||
|
"font_class": "arrowthinup",
|
||||||
|
"unicode": "e6bd",
|
||||||
|
"unicode_decimal": 59069
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923356",
|
"icon_id": "24923356",
|
||||||
"name": "arrowthindown",
|
"name": "arrowthindown",
|
||||||
"font_class": "arrow-down",
|
"font_class": "arrow-down",
|
||||||
"unicode": "e6be",
|
"unicode": "e6be",
|
||||||
"unicode_decimal": 59070
|
"unicode_decimal": 59070
|
||||||
|
},{
|
||||||
|
"icon_id": "24923356",
|
||||||
|
"name": "arrowthindown",
|
||||||
|
"font_class": "arrowthindown",
|
||||||
|
"unicode": "e6be",
|
||||||
|
"unicode_decimal": 59070
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923349",
|
"icon_id": "24923349",
|
||||||
@@ -200,6 +227,12 @@ export default {
|
|||||||
"font_class": "bottom",
|
"font_class": "bottom",
|
||||||
"unicode": "e6b8",
|
"unicode": "e6b8",
|
||||||
"unicode_decimal": 59064
|
"unicode_decimal": 59064
|
||||||
|
},{
|
||||||
|
"icon_id": "24923349",
|
||||||
|
"name": "arrowdown",
|
||||||
|
"font_class": "arrowdown",
|
||||||
|
"unicode": "e6b8",
|
||||||
|
"unicode_decimal": 59064
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923346",
|
"icon_id": "24923346",
|
||||||
@@ -208,6 +241,13 @@ export default {
|
|||||||
"unicode": "e6b5",
|
"unicode": "e6b5",
|
||||||
"unicode_decimal": 59061
|
"unicode_decimal": 59061
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923346",
|
||||||
|
"name": "arrowright",
|
||||||
|
"font_class": "arrowright",
|
||||||
|
"unicode": "e6b5",
|
||||||
|
"unicode_decimal": 59061
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923347",
|
"icon_id": "24923347",
|
||||||
"name": "arrowup",
|
"name": "arrowup",
|
||||||
@@ -215,6 +255,13 @@ export default {
|
|||||||
"unicode": "e6b6",
|
"unicode": "e6b6",
|
||||||
"unicode_decimal": 59062
|
"unicode_decimal": 59062
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923347",
|
||||||
|
"name": "arrowup",
|
||||||
|
"font_class": "arrowup",
|
||||||
|
"unicode": "e6b6",
|
||||||
|
"unicode_decimal": 59062
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923348",
|
"icon_id": "24923348",
|
||||||
"name": "arrowleft",
|
"name": "arrowleft",
|
||||||
@@ -222,6 +269,13 @@ export default {
|
|||||||
"unicode": "e6b7",
|
"unicode": "e6b7",
|
||||||
"unicode_decimal": 59063
|
"unicode_decimal": 59063
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"icon_id": "24923348",
|
||||||
|
"name": "arrowleft",
|
||||||
|
"font_class": "arrowleft",
|
||||||
|
"unicode": "e6b7",
|
||||||
|
"unicode_decimal": 59063
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"icon_id": "24923334",
|
"icon_id": "24923334",
|
||||||
"name": "eye",
|
"name": "eye",
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- #ifdef APP-NVUE -->
|
<!-- #ifdef APP-NVUE -->
|
||||||
<text :style="{ color: color, 'font-size': size + 'px' }" class="uni-icons" @click="_onClick">{{unicode}}</text>
|
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" @click="_onClick">{{unicode}}</text>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifndef APP-NVUE -->
|
<!-- #ifndef APP-NVUE -->
|
||||||
<text :style="{ color: color, 'font-size': size + 'px' }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
|
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import icons from './icons.js';
|
import icons from './icons.js';
|
||||||
|
const getVal = (val) => {
|
||||||
|
const reg = /^[0-9]*$/g
|
||||||
|
return (typeof val === 'number' || reg.test(val) )? val + 'px' : val;
|
||||||
|
}
|
||||||
// #ifdef APP-NVUE
|
// #ifdef APP-NVUE
|
||||||
var domModule = weex.requireModule('dom');
|
var domModule = weex.requireModule('dom');
|
||||||
import iconUrl from './uniicons.ttf'
|
import iconUrl from './uniicons.ttf'
|
||||||
@@ -61,6 +65,9 @@
|
|||||||
return unescape(`%u${code.unicode}`)
|
return unescape(`%u${code.unicode}`)
|
||||||
}
|
}
|
||||||
return ''
|
return ''
|
||||||
|
},
|
||||||
|
iconSize(){
|
||||||
|
return getVal(this.size)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "uni-icons",
|
"id": "uni-icons",
|
||||||
"displayName": "uni-icons 图标",
|
"displayName": "uni-icons 图标",
|
||||||
"version": "1.3.2",
|
"version": "1.3.5",
|
||||||
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
|
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"uni-ui",
|
"uni-ui",
|
||||||
|
|||||||
@@ -1,3 +1,13 @@
|
|||||||
|
## 3.3.12(2022-01-15)
|
||||||
|
- 新增 preferedAppPlatform 配置用于解决uni-app vue2版本vue3版本获取platform不一致的问题 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=prefered-app-platform)
|
||||||
|
- 修复 checkToken 未返回自定义token内容的Bug
|
||||||
|
## 3.3.11(2022-01-11)
|
||||||
|
- 修复用户名密码登录时多个应用出现重复用户名登录报错的Bug
|
||||||
|
## 3.3.10(2022-01-07)
|
||||||
|
- 新增 自定义国际化语言支持 [详情](https://uniapp.dcloud.net.cn/uniCloud/uni-id?id=custom-i8n)
|
||||||
|
- 修复 一键登录时未校验重复手机号是否已验证的Bug
|
||||||
|
- 修复 Apple登录时用户邮箱为空时报错的Bug
|
||||||
|
- 修复 登录接口未传username时错误提示不正确的Bug
|
||||||
## 3.3.9(2021-11-09)
|
## 3.3.9(2021-11-09)
|
||||||
- 去除重复的context.xxx未找到的提示语
|
- 去除重复的context.xxx未找到的提示语
|
||||||
## 3.3.8(2021-10-28)
|
## 3.3.8(2021-10-28)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "uni-id",
|
"id": "uni-id",
|
||||||
"displayName": "uni-id",
|
"displayName": "uni-id",
|
||||||
"version": "3.3.9",
|
"version": "3.3.12",
|
||||||
"description": "简单、统一、可扩展的用户中心",
|
"description": "简单、统一、可扩展的用户中心",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"uniid",
|
"uniid",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "uni-id",
|
"name": "uni-id",
|
||||||
"version": "3.3.5",
|
"version": "3.3.12",
|
||||||
"description": "uni-id for uniCloud",
|
"description": "uni-id for uniCloud",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
|
"homepage": "https://uniapp.dcloud.io/uniCloud/uni-id",
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
## 1.0.3(2022-01-21)
|
||||||
|
- 优化 组件示例
|
||||||
## 1.0.2(2021-11-22)
|
## 1.0.2(2021-11-22)
|
||||||
- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题
|
- 修复 / 符号在 vue 不同版本兼容问题引起的报错问题
|
||||||
## 1.0.1(2021-11-22)
|
## 1.0.1(2021-11-22)
|
||||||
- 修复 vue3中scss语法兼容问题
|
- 修复 vue3中scss语法兼容问题
|
||||||
## 1.0.0(2021-11-18)
|
## 1.0.0(2021-11-18)
|
||||||
- init
|
- init
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
@import './styles/index.scss';
|
@import './styles/index.scss';
|
||||||
|
|||||||
@@ -1,82 +1,82 @@
|
|||||||
{
|
{
|
||||||
"id": "uni-scss",
|
"id": "uni-scss",
|
||||||
"displayName": "uni-scss 辅助样式",
|
"displayName": "uni-scss 辅助样式",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。",
|
"description": "uni-sass是uni-ui提供的一套全局样式 ,通过一些简单的类名和sass变量,实现简单的页面布局操作,比如颜色、边距、圆角等。",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"uni-scss",
|
"uni-scss",
|
||||||
"uni-ui",
|
"uni-ui",
|
||||||
"辅助样式"
|
"辅助样式"
|
||||||
],
|
],
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
"repository": "https://github.com/dcloudio/uni-ui",
|
||||||
"engines": {
|
"engines": {
|
||||||
"HBuilderX": "^3.1.0"
|
"HBuilderX": "^3.1.0"
|
||||||
},
|
},
|
||||||
"dcloudext": {
|
"dcloudext": {
|
||||||
"category": [
|
"category": [
|
||||||
"uni-app前端模板",
|
"JS SDK",
|
||||||
"前端页面模板"
|
"通用 SDK"
|
||||||
],
|
],
|
||||||
"sale": {
|
"sale": {
|
||||||
"regular": {
|
"regular": {
|
||||||
"price": "0.00"
|
"price": "0.00"
|
||||||
},
|
},
|
||||||
"sourcecode": {
|
"sourcecode": {
|
||||||
"price": "0.00"
|
"price": "0.00"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"contact": {
|
"contact": {
|
||||||
"qq": ""
|
"qq": ""
|
||||||
},
|
},
|
||||||
"declaration": {
|
"declaration": {
|
||||||
"ads": "无",
|
"ads": "无",
|
||||||
"data": "无",
|
"data": "无",
|
||||||
"permissions": "无"
|
"permissions": "无"
|
||||||
},
|
},
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
||||||
},
|
},
|
||||||
"uni_modules": {
|
"uni_modules": {
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"encrypt": [],
|
"encrypt": [],
|
||||||
"platforms": {
|
"platforms": {
|
||||||
"cloud": {
|
"cloud": {
|
||||||
"tcb": "y",
|
"tcb": "y",
|
||||||
"aliyun": "y"
|
"aliyun": "y"
|
||||||
},
|
},
|
||||||
"client": {
|
"client": {
|
||||||
"App": {
|
"App": {
|
||||||
"app-vue": "y",
|
"app-vue": "y",
|
||||||
"app-nvue": "u"
|
"app-nvue": "u"
|
||||||
},
|
},
|
||||||
"H5-mobile": {
|
"H5-mobile": {
|
||||||
"Safari": "y",
|
"Safari": "y",
|
||||||
"Android Browser": "y",
|
"Android Browser": "y",
|
||||||
"微信浏览器(Android)": "y",
|
"微信浏览器(Android)": "y",
|
||||||
"QQ浏览器(Android)": "y"
|
"QQ浏览器(Android)": "y"
|
||||||
},
|
},
|
||||||
"H5-pc": {
|
"H5-pc": {
|
||||||
"Chrome": "y",
|
"Chrome": "y",
|
||||||
"IE": "y",
|
"IE": "y",
|
||||||
"Edge": "y",
|
"Edge": "y",
|
||||||
"Firefox": "y",
|
"Firefox": "y",
|
||||||
"Safari": "y"
|
"Safari": "y"
|
||||||
},
|
},
|
||||||
"小程序": {
|
"小程序": {
|
||||||
"微信": "y",
|
"微信": "y",
|
||||||
"阿里": "y",
|
"阿里": "y",
|
||||||
"百度": "y",
|
"百度": "y",
|
||||||
"字节跳动": "y",
|
"字节跳动": "y",
|
||||||
"QQ": "y"
|
"QQ": "y"
|
||||||
},
|
},
|
||||||
"快应用": {
|
"快应用": {
|
||||||
"华为": "n",
|
"华为": "n",
|
||||||
"联盟": "n"
|
"联盟": "n"
|
||||||
},
|
},
|
||||||
"Vue": {
|
"Vue": {
|
||||||
"vue2": "y",
|
"vue2": "y",
|
||||||
"vue3": "y"
|
"vue3": "y"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@import './setting/_variables.scss';
|
@import './setting/_variables.scss';
|
||||||
@import './setting/_border.scss';
|
@import './setting/_border.scss';
|
||||||
@import './setting/_color.scss';
|
@import './setting/_color.scss';
|
||||||
@import './setting/_space.scss';
|
@import './setting/_space.scss';
|
||||||
@import './setting/_radius.scss';
|
@import './setting/_radius.scss';
|
||||||
@import './setting/_text.scss';
|
@import './setting/_text.scss';
|
||||||
@import './setting/_styles.scss';
|
@import './setting/_styles.scss';
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
.uni-border {
|
.uni-border {
|
||||||
border: 1px $uni-border-1 solid;
|
border: 1px $uni-border-1 solid;
|
||||||
}
|
}
|
||||||
@@ -1,66 +1,66 @@
|
|||||||
|
|
||||||
// TODO 暂时不需要 class ,需要用户使用变量实现 ,如果使用类名其实并不推荐
|
// TODO 暂时不需要 class ,需要用户使用变量实现 ,如果使用类名其实并不推荐
|
||||||
// @mixin get-styles($k,$c) {
|
// @mixin get-styles($k,$c) {
|
||||||
// @if $k == size or $k == weight{
|
// @if $k == size or $k == weight{
|
||||||
// font-#{$k}:#{$c}
|
// font-#{$k}:#{$c}
|
||||||
// }@else{
|
// }@else{
|
||||||
// #{$k}:#{$c}
|
// #{$k}:#{$c}
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
$uni-ui-color:(
|
$uni-ui-color:(
|
||||||
// 主色
|
// 主色
|
||||||
primary: $uni-primary,
|
primary: $uni-primary,
|
||||||
primary-disable: $uni-primary-disable,
|
primary-disable: $uni-primary-disable,
|
||||||
primary-light: $uni-primary-light,
|
primary-light: $uni-primary-light,
|
||||||
// 辅助色
|
// 辅助色
|
||||||
success: $uni-success,
|
success: $uni-success,
|
||||||
success-disable: $uni-success-disable,
|
success-disable: $uni-success-disable,
|
||||||
success-light: $uni-success-light,
|
success-light: $uni-success-light,
|
||||||
warning: $uni-warning,
|
warning: $uni-warning,
|
||||||
warning-disable: $uni-warning-disable,
|
warning-disable: $uni-warning-disable,
|
||||||
warning-light: $uni-warning-light,
|
warning-light: $uni-warning-light,
|
||||||
error: $uni-error,
|
error: $uni-error,
|
||||||
error-disable: $uni-error-disable,
|
error-disable: $uni-error-disable,
|
||||||
error-light: $uni-error-light,
|
error-light: $uni-error-light,
|
||||||
info: $uni-info,
|
info: $uni-info,
|
||||||
info-disable: $uni-info-disable,
|
info-disable: $uni-info-disable,
|
||||||
info-light: $uni-info-light,
|
info-light: $uni-info-light,
|
||||||
// 中性色
|
// 中性色
|
||||||
main-color: $uni-main-color,
|
main-color: $uni-main-color,
|
||||||
base-color: $uni-base-color,
|
base-color: $uni-base-color,
|
||||||
secondary-color: $uni-secondary-color,
|
secondary-color: $uni-secondary-color,
|
||||||
extra-color: $uni-extra-color,
|
extra-color: $uni-extra-color,
|
||||||
// 背景色
|
// 背景色
|
||||||
bg-color: $uni-bg-color,
|
bg-color: $uni-bg-color,
|
||||||
// 边框颜色
|
// 边框颜色
|
||||||
border-1: $uni-border-1,
|
border-1: $uni-border-1,
|
||||||
border-2: $uni-border-2,
|
border-2: $uni-border-2,
|
||||||
border-3: $uni-border-3,
|
border-3: $uni-border-3,
|
||||||
border-4: $uni-border-4,
|
border-4: $uni-border-4,
|
||||||
// 黑色
|
// 黑色
|
||||||
black:$uni-black,
|
black:$uni-black,
|
||||||
// 白色
|
// 白色
|
||||||
white:$uni-white,
|
white:$uni-white,
|
||||||
// 透明
|
// 透明
|
||||||
transparent:$uni-transparent
|
transparent:$uni-transparent
|
||||||
) !default;
|
) !default;
|
||||||
@each $key, $child in $uni-ui-color {
|
@each $key, $child in $uni-ui-color {
|
||||||
.uni-#{"" + $key} {
|
.uni-#{"" + $key} {
|
||||||
color: $child;
|
color: $child;
|
||||||
}
|
}
|
||||||
.uni-#{"" + $key}-bg {
|
.uni-#{"" + $key}-bg {
|
||||||
background-color: $child;
|
background-color: $child;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.uni-shadow-sm {
|
.uni-shadow-sm {
|
||||||
box-shadow: $uni-shadow-sm;
|
box-shadow: $uni-shadow-sm;
|
||||||
}
|
}
|
||||||
.uni-shadow-base {
|
.uni-shadow-base {
|
||||||
box-shadow: $uni-shadow-base;
|
box-shadow: $uni-shadow-base;
|
||||||
}
|
}
|
||||||
.uni-shadow-lg {
|
.uni-shadow-lg {
|
||||||
box-shadow: $uni-shadow-lg;
|
box-shadow: $uni-shadow-lg;
|
||||||
}
|
}
|
||||||
.uni-mask {
|
.uni-mask {
|
||||||
background-color:$uni-mask;
|
background-color:$uni-mask;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,55 +1,55 @@
|
|||||||
@mixin radius($r,$d:null ,$important: false){
|
@mixin radius($r,$d:null ,$important: false){
|
||||||
$radius-value:map-get($uni-radius, $r) if($important, !important, null);
|
$radius-value:map-get($uni-radius, $r) if($important, !important, null);
|
||||||
// Key exists within the $uni-radius variable
|
// Key exists within the $uni-radius variable
|
||||||
@if (map-has-key($uni-radius, $r) and $d){
|
@if (map-has-key($uni-radius, $r) and $d){
|
||||||
@if $d == t {
|
@if $d == t {
|
||||||
border-top-left-radius:$radius-value;
|
border-top-left-radius:$radius-value;
|
||||||
border-top-right-radius:$radius-value;
|
border-top-right-radius:$radius-value;
|
||||||
}@else if $d == r {
|
}@else if $d == r {
|
||||||
border-top-right-radius:$radius-value;
|
border-top-right-radius:$radius-value;
|
||||||
border-bottom-right-radius:$radius-value;
|
border-bottom-right-radius:$radius-value;
|
||||||
}@else if $d == b {
|
}@else if $d == b {
|
||||||
border-bottom-left-radius:$radius-value;
|
border-bottom-left-radius:$radius-value;
|
||||||
border-bottom-right-radius:$radius-value;
|
border-bottom-right-radius:$radius-value;
|
||||||
}@else if $d == l {
|
}@else if $d == l {
|
||||||
border-top-left-radius:$radius-value;
|
border-top-left-radius:$radius-value;
|
||||||
border-bottom-left-radius:$radius-value;
|
border-bottom-left-radius:$radius-value;
|
||||||
}@else if $d == tl {
|
}@else if $d == tl {
|
||||||
border-top-left-radius:$radius-value;
|
border-top-left-radius:$radius-value;
|
||||||
}@else if $d == tr {
|
}@else if $d == tr {
|
||||||
border-top-right-radius:$radius-value;
|
border-top-right-radius:$radius-value;
|
||||||
}@else if $d == br {
|
}@else if $d == br {
|
||||||
border-bottom-right-radius:$radius-value;
|
border-bottom-right-radius:$radius-value;
|
||||||
}@else if $d == bl {
|
}@else if $d == bl {
|
||||||
border-bottom-left-radius:$radius-value;
|
border-bottom-left-radius:$radius-value;
|
||||||
}
|
}
|
||||||
}@else{
|
}@else{
|
||||||
border-radius:$radius-value;
|
border-radius:$radius-value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@each $key, $child in $uni-radius {
|
@each $key, $child in $uni-radius {
|
||||||
@if($key){
|
@if($key){
|
||||||
.uni-radius-#{"" + $key} {
|
.uni-radius-#{"" + $key} {
|
||||||
@include radius($key)
|
@include radius($key)
|
||||||
}
|
}
|
||||||
}@else{
|
}@else{
|
||||||
.uni-radius {
|
.uni-radius {
|
||||||
@include radius($key)
|
@include radius($key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@each $direction in t, r, b, l,tl, tr, br, bl {
|
@each $direction in t, r, b, l,tl, tr, br, bl {
|
||||||
@each $key, $child in $uni-radius {
|
@each $key, $child in $uni-radius {
|
||||||
@if($key){
|
@if($key){
|
||||||
.uni-radius-#{"" + $direction}-#{"" + $key} {
|
.uni-radius-#{"" + $direction}-#{"" + $key} {
|
||||||
@include radius($key,$direction,false)
|
@include radius($key,$direction,false)
|
||||||
}
|
}
|
||||||
}@else{
|
}@else{
|
||||||
.uni-radius-#{$direction} {
|
.uni-radius-#{$direction} {
|
||||||
@include radius($key,$direction,false)
|
@include radius($key,$direction,false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,56 +1,56 @@
|
|||||||
|
|
||||||
@mixin fn($space,$direction,$size,$n) {
|
@mixin fn($space,$direction,$size,$n) {
|
||||||
@if $n {
|
@if $n {
|
||||||
#{$space}-#{$direction}: #{$size*$uni-space-root}px
|
#{$space}-#{$direction}: #{$size*$uni-space-root}px
|
||||||
} @else {
|
} @else {
|
||||||
#{$space}-#{$direction}: #{-$size*$uni-space-root}px
|
#{$space}-#{$direction}: #{-$size*$uni-space-root}px
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@mixin get-styles($direction,$i,$space,$n){
|
@mixin get-styles($direction,$i,$space,$n){
|
||||||
@if $direction == t {
|
@if $direction == t {
|
||||||
@include fn($space, top,$i,$n);
|
@include fn($space, top,$i,$n);
|
||||||
}
|
}
|
||||||
@if $direction == r {
|
@if $direction == r {
|
||||||
@include fn($space, right,$i,$n);
|
@include fn($space, right,$i,$n);
|
||||||
}
|
}
|
||||||
@if $direction == b {
|
@if $direction == b {
|
||||||
@include fn($space, bottom,$i,$n);
|
@include fn($space, bottom,$i,$n);
|
||||||
}
|
}
|
||||||
@if $direction == l {
|
@if $direction == l {
|
||||||
@include fn($space, left,$i,$n);
|
@include fn($space, left,$i,$n);
|
||||||
}
|
}
|
||||||
@if $direction == x {
|
@if $direction == x {
|
||||||
@include fn($space, left,$i,$n);
|
@include fn($space, left,$i,$n);
|
||||||
@include fn($space, right,$i,$n);
|
@include fn($space, right,$i,$n);
|
||||||
}
|
}
|
||||||
@if $direction == y {
|
@if $direction == y {
|
||||||
@include fn($space, top,$i,$n);
|
@include fn($space, top,$i,$n);
|
||||||
@include fn($space, bottom,$i,$n);
|
@include fn($space, bottom,$i,$n);
|
||||||
}
|
}
|
||||||
@if $direction == a {
|
@if $direction == a {
|
||||||
@if $n {
|
@if $n {
|
||||||
#{$space}:#{$i*$uni-space-root}px;
|
#{$space}:#{$i*$uni-space-root}px;
|
||||||
} @else {
|
} @else {
|
||||||
#{$space}:#{-$i*$uni-space-root}px;
|
#{$space}:#{-$i*$uni-space-root}px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@each $orientation in m,p {
|
@each $orientation in m,p {
|
||||||
$space: margin;
|
$space: margin;
|
||||||
@if $orientation == m {
|
@if $orientation == m {
|
||||||
$space: margin;
|
$space: margin;
|
||||||
} @else {
|
} @else {
|
||||||
$space: padding;
|
$space: padding;
|
||||||
}
|
}
|
||||||
@for $i from 0 through 16 {
|
@for $i from 0 through 16 {
|
||||||
@each $direction in t, r, b, l, x, y, a {
|
@each $direction in t, r, b, l, x, y, a {
|
||||||
.uni-#{$orientation}#{$direction}-#{$i} {
|
.uni-#{$orientation}#{$direction}-#{$i} {
|
||||||
@include get-styles($direction,$i,$space,true);
|
@include get-styles($direction,$i,$space,true);
|
||||||
}
|
}
|
||||||
.uni-#{$orientation}#{$direction}-n#{$i} {
|
.uni-#{$orientation}#{$direction}-n#{$i} {
|
||||||
@include get-styles($direction,$i,$space,false);
|
@include get-styles($direction,$i,$space,false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,167 +1,167 @@
|
|||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
|
|
||||||
$-color-white:#fff;
|
$-color-white:#fff;
|
||||||
$-color-black:#000;
|
$-color-black:#000;
|
||||||
@mixin base-style($color) {
|
@mixin base-style($color) {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: $color;
|
background-color: $color;
|
||||||
border-color: mix($-color-black, $color, 8%);
|
border-color: mix($-color-black, $color, 8%);
|
||||||
&:not([hover-class]):active {
|
&:not([hover-class]):active {
|
||||||
background: mix($-color-black, $color, 10%);
|
background: mix($-color-black, $color, 10%);
|
||||||
border-color: mix($-color-black, $color, 20%);
|
border-color: mix($-color-black, $color, 20%);
|
||||||
color: $-color-white;
|
color: $-color-white;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@mixin is-color($color) {
|
@mixin is-color($color) {
|
||||||
@include base-style($color);
|
@include base-style($color);
|
||||||
&[loading] {
|
&[loading] {
|
||||||
@include base-style($color);
|
@include base-style($color);
|
||||||
&::before {
|
&::before {
|
||||||
margin-right:5px;
|
margin-right:5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&[disabled] {
|
&[disabled] {
|
||||||
&,
|
&,
|
||||||
&[loading],
|
&[loading],
|
||||||
&:not([hover-class]):active {
|
&:not([hover-class]):active {
|
||||||
color: $-color-white;
|
color: $-color-white;
|
||||||
border-color: mix(darken($color,10%), $-color-white);
|
border-color: mix(darken($color,10%), $-color-white);
|
||||||
background-color: mix($color, $-color-white);
|
background-color: mix($color, $-color-white);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@mixin base-plain-style($color) {
|
@mixin base-plain-style($color) {
|
||||||
color:$color;
|
color:$color;
|
||||||
background-color: mix($-color-white, $color, 90%);
|
background-color: mix($-color-white, $color, 90%);
|
||||||
border-color: mix($-color-white, $color, 70%);
|
border-color: mix($-color-white, $color, 70%);
|
||||||
&:not([hover-class]):active {
|
&:not([hover-class]):active {
|
||||||
background: mix($-color-white, $color, 80%);
|
background: mix($-color-white, $color, 80%);
|
||||||
color: $color;
|
color: $color;
|
||||||
outline: none;
|
outline: none;
|
||||||
border-color: mix($-color-white, $color, 50%);
|
border-color: mix($-color-white, $color, 50%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@mixin is-plain($color){
|
@mixin is-plain($color){
|
||||||
&[plain] {
|
&[plain] {
|
||||||
@include base-plain-style($color);
|
@include base-plain-style($color);
|
||||||
&[loading] {
|
&[loading] {
|
||||||
@include base-plain-style($color);
|
@include base-plain-style($color);
|
||||||
&::before {
|
&::before {
|
||||||
margin-right:5px;
|
margin-right:5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&[disabled] {
|
&[disabled] {
|
||||||
&,
|
&,
|
||||||
&:active {
|
&:active {
|
||||||
color: mix($-color-white, $color, 40%);
|
color: mix($-color-white, $color, 40%);
|
||||||
background-color: mix($-color-white, $color, 90%);
|
background-color: mix($-color-white, $color, 90%);
|
||||||
border-color: mix($-color-white, $color, 80%);
|
border-color: mix($-color-white, $color, 80%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.uni-btn {
|
.uni-btn {
|
||||||
margin: 5px;
|
margin: 5px;
|
||||||
color: #393939;
|
color: #393939;
|
||||||
border:1px solid #ccc;
|
border:1px solid #ccc;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 200;
|
font-weight: 200;
|
||||||
background-color: #F9F9F9;
|
background-color: #F9F9F9;
|
||||||
// TODO 暂时处理边框隐藏一边的问题
|
// TODO 暂时处理边框隐藏一边的问题
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
&::after{
|
&::after{
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not([type]),&[type=default] {
|
&:not([type]),&[type=default] {
|
||||||
color: #999;
|
color: #999;
|
||||||
&[loading] {
|
&[loading] {
|
||||||
background: none;
|
background: none;
|
||||||
&::before {
|
&::before {
|
||||||
margin-right:5px;
|
margin-right:5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
&[disabled]{
|
&[disabled]{
|
||||||
color: mix($-color-white, #999, 60%);
|
color: mix($-color-white, #999, 60%);
|
||||||
&,
|
&,
|
||||||
&[loading],
|
&[loading],
|
||||||
&:active {
|
&:active {
|
||||||
color: mix($-color-white, #999, 60%);
|
color: mix($-color-white, #999, 60%);
|
||||||
background-color: mix($-color-white,$-color-black , 98%);
|
background-color: mix($-color-white,$-color-black , 98%);
|
||||||
border-color: mix($-color-white, #999, 85%);
|
border-color: mix($-color-white, #999, 85%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&[plain] {
|
&[plain] {
|
||||||
color: #999;
|
color: #999;
|
||||||
background: none;
|
background: none;
|
||||||
border-color: $uni-border-1;
|
border-color: $uni-border-1;
|
||||||
&:not([hover-class]):active {
|
&:not([hover-class]):active {
|
||||||
background: none;
|
background: none;
|
||||||
color: mix($-color-white, $-color-black, 80%);
|
color: mix($-color-white, $-color-black, 80%);
|
||||||
border-color: mix($-color-white, $-color-black, 90%);
|
border-color: mix($-color-white, $-color-black, 90%);
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
&[disabled]{
|
&[disabled]{
|
||||||
&,
|
&,
|
||||||
&[loading],
|
&[loading],
|
||||||
&:active {
|
&:active {
|
||||||
background: none;
|
background: none;
|
||||||
color: mix($-color-white, #999, 60%);
|
color: mix($-color-white, #999, 60%);
|
||||||
border-color: mix($-color-white, #999, 85%);
|
border-color: mix($-color-white, #999, 85%);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not([hover-class]):active {
|
&:not([hover-class]):active {
|
||||||
color: mix($-color-white, $-color-black, 50%);
|
color: mix($-color-white, $-color-black, 50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
&[size=mini] {
|
&[size=mini] {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: 200;
|
font-weight: 200;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
&.uni-btn-small {
|
&.uni-btn-small {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
&.uni-btn-mini {
|
&.uni-btn-mini {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.uni-btn-radius {
|
&.uni-btn-radius {
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
}
|
}
|
||||||
&[type=primary] {
|
&[type=primary] {
|
||||||
@include is-color($uni-primary);
|
@include is-color($uni-primary);
|
||||||
@include is-plain($uni-primary)
|
@include is-plain($uni-primary)
|
||||||
}
|
}
|
||||||
&[type=success] {
|
&[type=success] {
|
||||||
@include is-color($uni-success);
|
@include is-color($uni-success);
|
||||||
@include is-plain($uni-success)
|
@include is-plain($uni-success)
|
||||||
}
|
}
|
||||||
&[type=error] {
|
&[type=error] {
|
||||||
@include is-color($uni-error);
|
@include is-color($uni-error);
|
||||||
@include is-plain($uni-error)
|
@include is-plain($uni-error)
|
||||||
}
|
}
|
||||||
&[type=warning] {
|
&[type=warning] {
|
||||||
@include is-color($uni-warning);
|
@include is-color($uni-warning);
|
||||||
@include is-plain($uni-warning)
|
@include is-plain($uni-warning)
|
||||||
}
|
}
|
||||||
&[type=info] {
|
&[type=info] {
|
||||||
@include is-color($uni-info);
|
@include is-color($uni-info);
|
||||||
@include is-plain($uni-info)
|
@include is-plain($uni-info)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* #endif */
|
/* #endif */
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
@mixin get-styles($k,$c) {
|
@mixin get-styles($k,$c) {
|
||||||
@if $k == size or $k == weight{
|
@if $k == size or $k == weight{
|
||||||
font-#{$k}:#{$c}
|
font-#{$k}:#{$c}
|
||||||
}@else{
|
}@else{
|
||||||
#{$k}:#{$c}
|
#{$k}:#{$c}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@each $key, $child in $uni-headings {
|
@each $key, $child in $uni-headings {
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
.uni-#{$key} {
|
.uni-#{$key} {
|
||||||
@each $k, $c in $child {
|
@each $k, $c in $child {
|
||||||
@include get-styles($k,$c)
|
@include get-styles($k,$c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* #endif */
|
/* #endif */
|
||||||
/* #ifdef APP-NVUE */
|
/* #ifdef APP-NVUE */
|
||||||
.container .uni-#{$key} {
|
.container .uni-#{$key} {
|
||||||
@each $k, $c in $child {
|
@each $k, $c in $child {
|
||||||
@include get-styles($k,$c)
|
@include get-styles($k,$c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,146 +1,146 @@
|
|||||||
// @use "sass:math";
|
// @use "sass:math";
|
||||||
@import '../tools/functions.scss';
|
@import '../tools/functions.scss';
|
||||||
// 间距基础倍数
|
// 间距基础倍数
|
||||||
$uni-space-root: 2 !default;
|
$uni-space-root: 2 !default;
|
||||||
// 边框半径默认值
|
// 边框半径默认值
|
||||||
$uni-radius-root:5px !default;
|
$uni-radius-root:5px !default;
|
||||||
$uni-radius: () !default;
|
$uni-radius: () !default;
|
||||||
// 边框半径断点
|
// 边框半径断点
|
||||||
$uni-radius: map-deep-merge(
|
$uni-radius: map-deep-merge(
|
||||||
(
|
(
|
||||||
0: 0,
|
0: 0,
|
||||||
// TODO 当前版本暂时不支持 sm 属性
|
// TODO 当前版本暂时不支持 sm 属性
|
||||||
// 'sm': math.div($uni-radius-root, 2),
|
// 'sm': math.div($uni-radius-root, 2),
|
||||||
null: $uni-radius-root,
|
null: $uni-radius-root,
|
||||||
'lg': $uni-radius-root * 2,
|
'lg': $uni-radius-root * 2,
|
||||||
'xl': $uni-radius-root * 6,
|
'xl': $uni-radius-root * 6,
|
||||||
'pill': 9999px,
|
'pill': 9999px,
|
||||||
'circle': 50%
|
'circle': 50%
|
||||||
),
|
),
|
||||||
$uni-radius
|
$uni-radius
|
||||||
);
|
);
|
||||||
// 字体家族
|
// 字体家族
|
||||||
$body-font-family: 'Roboto', sans-serif !default;
|
$body-font-family: 'Roboto', sans-serif !default;
|
||||||
// 文本
|
// 文本
|
||||||
$heading-font-family: $body-font-family !default;
|
$heading-font-family: $body-font-family !default;
|
||||||
$uni-headings: () !default;
|
$uni-headings: () !default;
|
||||||
$letterSpacing: -0.01562em;
|
$letterSpacing: -0.01562em;
|
||||||
$uni-headings: map-deep-merge(
|
$uni-headings: map-deep-merge(
|
||||||
(
|
(
|
||||||
'h1': (
|
'h1': (
|
||||||
size: 32px,
|
size: 32px,
|
||||||
weight: 300,
|
weight: 300,
|
||||||
line-height: 50px,
|
line-height: 50px,
|
||||||
// letter-spacing:-0.01562em
|
// letter-spacing:-0.01562em
|
||||||
),
|
),
|
||||||
'h2': (
|
'h2': (
|
||||||
size: 28px,
|
size: 28px,
|
||||||
weight: 300,
|
weight: 300,
|
||||||
line-height: 40px,
|
line-height: 40px,
|
||||||
// letter-spacing: -0.00833em
|
// letter-spacing: -0.00833em
|
||||||
),
|
),
|
||||||
'h3': (
|
'h3': (
|
||||||
size: 24px,
|
size: 24px,
|
||||||
weight: 400,
|
weight: 400,
|
||||||
line-height: 32px,
|
line-height: 32px,
|
||||||
// letter-spacing: normal
|
// letter-spacing: normal
|
||||||
),
|
),
|
||||||
'h4': (
|
'h4': (
|
||||||
size: 20px,
|
size: 20px,
|
||||||
weight: 400,
|
weight: 400,
|
||||||
line-height: 30px,
|
line-height: 30px,
|
||||||
// letter-spacing: 0.00735em
|
// letter-spacing: 0.00735em
|
||||||
),
|
),
|
||||||
'h5': (
|
'h5': (
|
||||||
size: 16px,
|
size: 16px,
|
||||||
weight: 400,
|
weight: 400,
|
||||||
line-height: 24px,
|
line-height: 24px,
|
||||||
// letter-spacing: normal
|
// letter-spacing: normal
|
||||||
),
|
),
|
||||||
'h6': (
|
'h6': (
|
||||||
size: 14px,
|
size: 14px,
|
||||||
weight: 500,
|
weight: 500,
|
||||||
line-height: 18px,
|
line-height: 18px,
|
||||||
// letter-spacing: 0.0125em
|
// letter-spacing: 0.0125em
|
||||||
),
|
),
|
||||||
'subtitle': (
|
'subtitle': (
|
||||||
size: 12px,
|
size: 12px,
|
||||||
weight: 400,
|
weight: 400,
|
||||||
line-height: 20px,
|
line-height: 20px,
|
||||||
// letter-spacing: 0.00937em
|
// letter-spacing: 0.00937em
|
||||||
),
|
),
|
||||||
'body': (
|
'body': (
|
||||||
font-size: 14px,
|
font-size: 14px,
|
||||||
font-weight: 400,
|
font-weight: 400,
|
||||||
line-height: 22px,
|
line-height: 22px,
|
||||||
// letter-spacing: 0.03125em
|
// letter-spacing: 0.03125em
|
||||||
),
|
),
|
||||||
'caption': (
|
'caption': (
|
||||||
'size': 12px,
|
'size': 12px,
|
||||||
'weight': 400,
|
'weight': 400,
|
||||||
'line-height': 20px,
|
'line-height': 20px,
|
||||||
// 'letter-spacing': 0.03333em,
|
// 'letter-spacing': 0.03333em,
|
||||||
// 'text-transform': false
|
// 'text-transform': false
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
$uni-headings
|
$uni-headings
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 主色
|
// 主色
|
||||||
$uni-primary: #2979ff !default;
|
$uni-primary: #2979ff !default;
|
||||||
$uni-primary-disable:lighten($uni-primary,20%) !default;
|
$uni-primary-disable:lighten($uni-primary,20%) !default;
|
||||||
$uni-primary-light: lighten($uni-primary,25%) !default;
|
$uni-primary-light: lighten($uni-primary,25%) !default;
|
||||||
|
|
||||||
// 辅助色
|
// 辅助色
|
||||||
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
|
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
|
||||||
$uni-success: #18bc37 !default;
|
$uni-success: #18bc37 !default;
|
||||||
$uni-success-disable:lighten($uni-success,20%) !default;
|
$uni-success-disable:lighten($uni-success,20%) !default;
|
||||||
$uni-success-light: lighten($uni-success,25%) !default;
|
$uni-success-light: lighten($uni-success,25%) !default;
|
||||||
|
|
||||||
$uni-warning: #f3a73f !default;
|
$uni-warning: #f3a73f !default;
|
||||||
$uni-warning-disable:lighten($uni-warning,20%) !default;
|
$uni-warning-disable:lighten($uni-warning,20%) !default;
|
||||||
$uni-warning-light: lighten($uni-warning,25%) !default;
|
$uni-warning-light: lighten($uni-warning,25%) !default;
|
||||||
|
|
||||||
$uni-error: #e43d33 !default;
|
$uni-error: #e43d33 !default;
|
||||||
$uni-error-disable:lighten($uni-error,20%) !default;
|
$uni-error-disable:lighten($uni-error,20%) !default;
|
||||||
$uni-error-light: lighten($uni-error,25%) !default;
|
$uni-error-light: lighten($uni-error,25%) !default;
|
||||||
|
|
||||||
$uni-info: #8f939c !default;
|
$uni-info: #8f939c !default;
|
||||||
$uni-info-disable:lighten($uni-info,20%) !default;
|
$uni-info-disable:lighten($uni-info,20%) !default;
|
||||||
$uni-info-light: lighten($uni-info,25%) !default;
|
$uni-info-light: lighten($uni-info,25%) !default;
|
||||||
|
|
||||||
// 中性色
|
// 中性色
|
||||||
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
|
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
|
||||||
$uni-main-color: #3a3a3a !default; // 主要文字
|
$uni-main-color: #3a3a3a !default; // 主要文字
|
||||||
$uni-base-color: #6a6a6a !default; // 常规文字
|
$uni-base-color: #6a6a6a !default; // 常规文字
|
||||||
$uni-secondary-color: #909399 !default; // 次要文字
|
$uni-secondary-color: #909399 !default; // 次要文字
|
||||||
$uni-extra-color: #c7c7c7 !default; // 辅助说明
|
$uni-extra-color: #c7c7c7 !default; // 辅助说明
|
||||||
|
|
||||||
// 边框颜色
|
// 边框颜色
|
||||||
$uni-border-1: #F0F0F0 !default;
|
$uni-border-1: #F0F0F0 !default;
|
||||||
$uni-border-2: #EDEDED !default;
|
$uni-border-2: #EDEDED !default;
|
||||||
$uni-border-3: #DCDCDC !default;
|
$uni-border-3: #DCDCDC !default;
|
||||||
$uni-border-4: #B9B9B9 !default;
|
$uni-border-4: #B9B9B9 !default;
|
||||||
|
|
||||||
// 常规色
|
// 常规色
|
||||||
$uni-black: #000000 !default;
|
$uni-black: #000000 !default;
|
||||||
$uni-white: #ffffff !default;
|
$uni-white: #ffffff !default;
|
||||||
$uni-transparent: rgba($color: #000000, $alpha: 0) !default;
|
$uni-transparent: rgba($color: #000000, $alpha: 0) !default;
|
||||||
|
|
||||||
// 背景色
|
// 背景色
|
||||||
$uni-bg-color: #f7f7f7 !default;
|
$uni-bg-color: #f7f7f7 !default;
|
||||||
|
|
||||||
/* 水平间距 */
|
/* 水平间距 */
|
||||||
$uni-spacing-sm: 8px !default;
|
$uni-spacing-sm: 8px !default;
|
||||||
$uni-spacing-base: 15px !default;
|
$uni-spacing-base: 15px !default;
|
||||||
$uni-spacing-lg: 30px !default;
|
$uni-spacing-lg: 30px !default;
|
||||||
|
|
||||||
// 阴影
|
// 阴影
|
||||||
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5) !default;
|
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5) !default;
|
||||||
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2) !default;
|
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2) !default;
|
||||||
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5) !default;
|
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5) !default;
|
||||||
|
|
||||||
// 蒙版
|
// 蒙版
|
||||||
$uni-mask: rgba($color: #000000, $alpha: 0.4) !default;
|
$uni-mask: rgba($color: #000000, $alpha: 0.4) !default;
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
// 合并 map
|
// 合并 map
|
||||||
@function map-deep-merge($parent-map, $child-map){
|
@function map-deep-merge($parent-map, $child-map){
|
||||||
$result: $parent-map;
|
$result: $parent-map;
|
||||||
@each $key, $child in $child-map {
|
@each $key, $child in $child-map {
|
||||||
$parent-has-key: map-has-key($result, $key);
|
$parent-has-key: map-has-key($result, $key);
|
||||||
$parent-value: map-get($result, $key);
|
$parent-value: map-get($result, $key);
|
||||||
$parent-type: type-of($parent-value);
|
$parent-type: type-of($parent-value);
|
||||||
$child-type: type-of($child);
|
$child-type: type-of($child);
|
||||||
$parent-is-map: $parent-type == map;
|
$parent-is-map: $parent-type == map;
|
||||||
$child-is-map: $child-type == map;
|
$child-is-map: $child-type == map;
|
||||||
|
|
||||||
@if (not $parent-has-key) or ($parent-type != $child-type) or (not ($parent-is-map and $child-is-map)){
|
@if (not $parent-has-key) or ($parent-type != $child-type) or (not ($parent-is-map and $child-is-map)){
|
||||||
$result: map-merge($result, ( $key: $child ));
|
$result: map-merge($result, ( $key: $child ));
|
||||||
}@else {
|
}@else {
|
||||||
$result: map-merge($result, ( $key: map-deep-merge($parent-value, $child) ));
|
$result: map-merge($result, ( $key: map-deep-merge($parent-value, $child) ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@return $result;
|
@return $result;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
// 间距基础倍数
|
// 间距基础倍数
|
||||||
$uni-space-root: 2;
|
$uni-space-root: 2;
|
||||||
// 边框半径默认值
|
// 边框半径默认值
|
||||||
$uni-radius-root:5px;
|
$uni-radius-root:5px;
|
||||||
// 主色
|
// 主色
|
||||||
$uni-primary: #2979ff;
|
$uni-primary: #2979ff;
|
||||||
// 辅助色
|
// 辅助色
|
||||||
$uni-success: #4cd964;
|
$uni-success: #4cd964;
|
||||||
// 警告色
|
// 警告色
|
||||||
$uni-warning: #f0ad4e;
|
$uni-warning: #f0ad4e;
|
||||||
// 错误色
|
// 错误色
|
||||||
$uni-error: #dd524d;
|
$uni-error: #dd524d;
|
||||||
// 描述色
|
// 描述色
|
||||||
$uni-info: #909399;
|
$uni-info: #909399;
|
||||||
// 中性色
|
// 中性色
|
||||||
$uni-main-color: #303133;
|
$uni-main-color: #303133;
|
||||||
$uni-base-color: #606266;
|
$uni-base-color: #606266;
|
||||||
$uni-secondary-color: #909399;
|
$uni-secondary-color: #909399;
|
||||||
$uni-extra-color: #C0C4CC;
|
$uni-extra-color: #C0C4CC;
|
||||||
// 背景色
|
// 背景色
|
||||||
$uni-bg-color: #f5f5f5;
|
$uni-bg-color: #f5f5f5;
|
||||||
// 边框颜色
|
// 边框颜色
|
||||||
$uni-border-1: #DCDFE6;
|
$uni-border-1: #DCDFE6;
|
||||||
$uni-border-2: #E4E7ED;
|
$uni-border-2: #E4E7ED;
|
||||||
$uni-border-3: #EBEEF5;
|
$uni-border-3: #EBEEF5;
|
||||||
$uni-border-4: #F2F6FC;
|
$uni-border-4: #F2F6FC;
|
||||||
|
|
||||||
// 常规色
|
// 常规色
|
||||||
$uni-black: #000000;
|
$uni-black: #000000;
|
||||||
$uni-white: #ffffff;
|
$uni-white: #ffffff;
|
||||||
$uni-transparent: rgba($color: #000000, $alpha: 0);
|
$uni-transparent: rgba($color: #000000, $alpha: 0);
|
||||||
|
|||||||
@@ -1,62 +1,62 @@
|
|||||||
@import './styles/setting/_variables.scss';
|
@import './styles/setting/_variables.scss';
|
||||||
// 间距基础倍数
|
// 间距基础倍数
|
||||||
$uni-space-root: 2;
|
$uni-space-root: 2;
|
||||||
// 边框半径默认值
|
// 边框半径默认值
|
||||||
$uni-radius-root:5px;
|
$uni-radius-root:5px;
|
||||||
|
|
||||||
// 主色
|
// 主色
|
||||||
$uni-primary: #2979ff;
|
$uni-primary: #2979ff;
|
||||||
$uni-primary-disable:mix(#fff,$uni-primary,50%);
|
$uni-primary-disable:mix(#fff,$uni-primary,50%);
|
||||||
$uni-primary-light: mix(#fff,$uni-primary,80%);
|
$uni-primary-light: mix(#fff,$uni-primary,80%);
|
||||||
|
|
||||||
// 辅助色
|
// 辅助色
|
||||||
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
|
// 除了主色外的场景色,需要在不同的场景中使用(例如危险色表示危险的操作)。
|
||||||
$uni-success: #18bc37;
|
$uni-success: #18bc37;
|
||||||
$uni-success-disable:mix(#fff,$uni-success,50%);
|
$uni-success-disable:mix(#fff,$uni-success,50%);
|
||||||
$uni-success-light: mix(#fff,$uni-success,80%);
|
$uni-success-light: mix(#fff,$uni-success,80%);
|
||||||
|
|
||||||
$uni-warning: #f3a73f;
|
$uni-warning: #f3a73f;
|
||||||
$uni-warning-disable:mix(#fff,$uni-warning,50%);
|
$uni-warning-disable:mix(#fff,$uni-warning,50%);
|
||||||
$uni-warning-light: mix(#fff,$uni-warning,80%);
|
$uni-warning-light: mix(#fff,$uni-warning,80%);
|
||||||
|
|
||||||
$uni-error: #e43d33;
|
$uni-error: #e43d33;
|
||||||
$uni-error-disable:mix(#fff,$uni-error,50%);
|
$uni-error-disable:mix(#fff,$uni-error,50%);
|
||||||
$uni-error-light: mix(#fff,$uni-error,80%);
|
$uni-error-light: mix(#fff,$uni-error,80%);
|
||||||
|
|
||||||
$uni-info: #8f939c;
|
$uni-info: #8f939c;
|
||||||
$uni-info-disable:mix(#fff,$uni-info,50%);
|
$uni-info-disable:mix(#fff,$uni-info,50%);
|
||||||
$uni-info-light: mix(#fff,$uni-info,80%);
|
$uni-info-light: mix(#fff,$uni-info,80%);
|
||||||
|
|
||||||
// 中性色
|
// 中性色
|
||||||
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
|
// 中性色用于文本、背景和边框颜色。通过运用不同的中性色,来表现层次结构。
|
||||||
$uni-main-color: #3a3a3a; // 主要文字
|
$uni-main-color: #3a3a3a; // 主要文字
|
||||||
$uni-base-color: #6a6a6a; // 常规文字
|
$uni-base-color: #6a6a6a; // 常规文字
|
||||||
$uni-secondary-color: #909399; // 次要文字
|
$uni-secondary-color: #909399; // 次要文字
|
||||||
$uni-extra-color: #c7c7c7; // 辅助说明
|
$uni-extra-color: #c7c7c7; // 辅助说明
|
||||||
|
|
||||||
// 边框颜色
|
// 边框颜色
|
||||||
$uni-border-1: #F0F0F0;
|
$uni-border-1: #F0F0F0;
|
||||||
$uni-border-2: #EDEDED;
|
$uni-border-2: #EDEDED;
|
||||||
$uni-border-3: #DCDCDC;
|
$uni-border-3: #DCDCDC;
|
||||||
$uni-border-4: #B9B9B9;
|
$uni-border-4: #B9B9B9;
|
||||||
|
|
||||||
// 常规色
|
// 常规色
|
||||||
$uni-black: #000000;
|
$uni-black: #000000;
|
||||||
$uni-white: #ffffff;
|
$uni-white: #ffffff;
|
||||||
$uni-transparent: rgba($color: #000000, $alpha: 0);
|
$uni-transparent: rgba($color: #000000, $alpha: 0);
|
||||||
|
|
||||||
// 背景色
|
// 背景色
|
||||||
$uni-bg-color: #f7f7f7;
|
$uni-bg-color: #f7f7f7;
|
||||||
|
|
||||||
/* 水平间距 */
|
/* 水平间距 */
|
||||||
$uni-spacing-sm: 8px;
|
$uni-spacing-sm: 8px;
|
||||||
$uni-spacing-base: 15px;
|
$uni-spacing-base: 15px;
|
||||||
$uni-spacing-lg: 30px;
|
$uni-spacing-lg: 30px;
|
||||||
|
|
||||||
// 阴影
|
// 阴影
|
||||||
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5);
|
$uni-shadow-sm:0 0 5px rgba($color: #d8d8d8, $alpha: 0.5);
|
||||||
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2);
|
$uni-shadow-base:0 1px 8px 1px rgba($color: #a5a5a5, $alpha: 0.2);
|
||||||
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5);
|
$uni-shadow-lg:0px 1px 10px 2px rgba($color: #a5a4a4, $alpha: 0.5);
|
||||||
|
|
||||||
// 蒙版
|
// 蒙版
|
||||||
$uni-mask: rgba($color: #000000, $alpha: 0.4);
|
$uni-mask: rgba($color: #000000, $alpha: 0.4);
|
||||||
|
|||||||
Reference in New Issue
Block a user