Skip to content

Commit 427ef7f

Browse files
committed
Merge branch 'dev'
2 parents a8e8f5b + ec08ebf commit 427ef7f

File tree

15 files changed

+192
-110
lines changed

15 files changed

+192
-110
lines changed

App.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
// 注意,需要在/main.js中实例化Vue之后引入如下(详见文档说明):
1010
// import httpInterceptor from '@/common/http.interceptor.js'
1111
// Vue.use(httpInterceptor, app)
12+
// process.env.VUE_APP_PLATFORM 为通过js判断平台名称的方法,结果分别如下:
13+
/**
14+
* h5,app-plus(nvue下也为app-plus),mp-weixin,mp-alipay......
15+
*/
1216
},
1317
}
1418
</script>

main.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
import Vue from 'vue'
2-
import App from './App'
1+
import Vue from 'vue';
2+
import App from './App';
33

4-
Vue.config.productionTip = false
4+
Vue.config.productionTip = false;
55

6-
App.mpType = 'app'
6+
App.mpType = 'app';
77

88
// 此处为演示Vue.prototype使用,非uView的功能部分
9-
Vue.prototype.vuePrototype = '枣红'
9+
Vue.prototype.vuePrototype = '枣红';
1010

1111
// 引入全局uView
12-
import uView from 'uview-ui'
13-
Vue.use(uView)
12+
import uView from 'uview-ui';
13+
Vue.use(uView);
1414

1515
// 此处为演示vuex使用,非uView的功能部分
16-
import store from '@/store'
16+
import store from '@/store';
1717

1818
// 引入uView提供的对vuex的简写法文件
19-
let vuexStore = require('@/store/$u.mixin.js')
20-
Vue.mixin(vuexStore)
19+
let vuexStore = require('@/store/$u.mixin.js');
20+
Vue.mixin(vuexStore);
2121

2222
// 引入uView对小程序分享的mixin封装
2323
let mpShare = require('uview-ui/libs/mixin/mpShare.js');
24-
Vue.mixin(mpShare)
24+
Vue.mixin(mpShare);
2525

2626
// i18n部分的配置
2727
// 引入语言包,注意路径
2828
import Chinese from '@/common/locales/zh.js';
2929
import English from '@/common/locales/en.js';
3030

3131
// VueI18n
32-
import VueI18n from '@/common/vue-i18n.min.js'
32+
import VueI18n from '@/common/vue-i18n.min.js';
3333

3434
// VueI18n
35-
Vue.use(VueI18n)
35+
Vue.use(VueI18n);
3636

3737
const i18n = new VueI18n({
3838
// 默认语言
@@ -42,23 +42,23 @@ const i18n = new VueI18n({
4242
'zh': Chinese,
4343
'en': English,
4444
}
45-
})
45+
});
4646

4747
// 由于微信小程序的运行机制问题,需声明如下一行,H5和APP非必填
48-
Vue.prototype._i18n = i18n
48+
Vue.prototype._i18n = i18n;
4949

5050
const app = new Vue({
5151
i18n,
5252
store,
5353
...App
54-
})
54+
});
5555

5656
// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
57-
import httpInterceptor from '@/common/http.interceptor.js'
58-
Vue.use(httpInterceptor, app)
57+
import httpInterceptor from '@/common/http.interceptor.js';
58+
Vue.use(httpInterceptor, app);
5959

6060
// http接口API抽离,免于写url或者一些固定的参数
61-
import httpApi from '@/common/http.api.js'
62-
Vue.use(httpApi, app)
61+
import httpApi from '@/common/http.api.js';
62+
Vue.use(httpApi, app);
6363

64-
app.$mount()
64+
app.$mount();

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name" : "uView",
33
"appid" : "__UNI__60F4B81",
44
"description" : "多平台快速开发的UI框架",
5-
"versionName" : "1.7.8",
5+
"versionName" : "1.7.9",
66
"versionCode" : "100",
77
"transformPx" : false,
88
"app-plus" : {

pages/componentsB/upload/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
export default {
5454
data() {
5555
return {
56-
action: 'http://www.tp5.com',
56+
action: 'http://127.0.0.1:7001/upload',
5757
// 预置上传列表
5858
fileList: [],
5959
// fileList: [{

pages/library/timeFormat/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<view class="u-demo-wrap">
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area">
6-
<view class="u-no-demo-here">时间戳为:{{timestamp}}</view>
6+
<view class="u-no-demo-here">输入时间:{{timestamp}}</view>
77
<view class="u-demo-result-line">
88
{{result}}
99
</view>
@@ -28,7 +28,7 @@
2828
export default {
2929
data() {
3030
return {
31-
timestamp: '1582711721',
31+
timestamp: '2020-11-02T02:59:24.732Z',
3232
result: null
3333
}
3434
},

uview-ui/components/u-card/u-card.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ export default {
262262
// 如果是与屏幕之间不留空隙,应该设置左右边距为0
263263
margin-left: 0 !important;
264264
margin-right: 0 !important;
265+
width: 100%;
265266
}
266267
267268
&--border:after {

uview-ui/components/u-mask/u-mask.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @property {String Number} z-index z-index 层级(默认1070)
1717
* @property {Object} custom-style 自定义样式对象,见上方说明
1818
* @property {String Number} duration 动画时长,单位毫秒(默认300)
19-
* @property {Boolean} zoom 是否使用scale对这招进行缩放(默认true)
19+
* @property {Boolean} zoom 是否使用scale对遮罩进行缩放(默认true)
2020
* @property {Boolean} mask-click-able 遮罩是否可点击,为false时点击不会发送click事件(默认true)
2121
* @event {Function} click mask-click-able为true时,点击遮罩发送此事件
2222
* @example <u-mask :show="show" @click="show = false"></u-mask>

uview-ui/components/u-upload/u-upload.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ export default {
246246
limitType:{
247247
type: Array,
248248
default() {
249-
return ['png', 'jpg', 'jpeg', 'webp', 'gif'];
249+
// 支付宝小程序真机选择图片的后缀为"image"
250+
// https://opendocs.alipay.com/mini/api/media-image
251+
return ['png', 'jpg', 'jpeg', 'webp', 'gif', 'image'];
250252
}
251253
},
252254
// 在各个回调事件中的最后一个参数返回,用于区别是哪一个组件的事件

uview-ui/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const $u = {
8282
date: timeFormat, // 另名date
8383
timeFrom,
8484
colorGradient: colorGradient.colorGradient,
85+
colorToRgba: colorGradient.colorToRgba,
8586
guid,
8687
color,
8788
sys,
@@ -112,6 +113,9 @@ const $u = {
112113
throttle,
113114
}
114115

116+
// $u挂载到uni对象上
117+
uni.$u = $u
118+
115119
const install = Vue => {
116120
Vue.mixin(mixin)
117121
if (Vue.prototype.openShare) {

uview-ui/libs/config/config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// 此版本发布于2020-10-31
2-
let version = '1.7.8';
1+
// 此版本发布于2020-11-10
2+
let version = '1.7.9';
33

44
export default {
55
v: version,

uview-ui/libs/function/colorGradient.js

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,42 @@ function rgbToHex(rgb) {
9393
}
9494
}
9595

96+
97+
/**
98+
* JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
99+
* sHex为传入的十六进制的色值
100+
* alpha为rgba的透明度
101+
*/
102+
function colorToRgba(color, alpha = 0.3) {
103+
color = rgbToHex(color)
104+
// 十六进制颜色值的正则表达式
105+
var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
106+
/* 16进制颜色转为RGB格式 */
107+
let sColor = color.toLowerCase()
108+
if (sColor && reg.test(sColor)) {
109+
if (sColor.length === 4) {
110+
var sColorNew = '#'
111+
for (let i = 1; i < 4; i += 1) {
112+
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1))
113+
}
114+
sColor = sColorNew
115+
}
116+
// 处理六位的颜色值
117+
var sColorChange = []
118+
for (let i = 1; i < 7; i += 2) {
119+
sColorChange.push(parseInt('0x' + sColor.slice(i, i + 2)))
120+
}
121+
// return sColorChange.join(',')
122+
return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')'
123+
}
124+
else {
125+
return sColor
126+
}
127+
}
128+
96129
export default {
97130
colorGradient,
98131
hexToRgb,
99-
rgbToHex
132+
rgbToHex,
133+
colorToRgba
100134
}

0 commit comments

Comments
 (0)