Skip to content

Commit 1e6926d

Browse files
committed
Merge branch 'dev'
2 parents a593d04 + 5b1724a commit 1e6926d

File tree

36 files changed

+521
-203
lines changed

36 files changed

+521
-203
lines changed

common/uni.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
font-family: uniicons;
33
font-weight: normal;
44
font-style: normal;
5-
src: url('./static/uni.ttf') format('truetype');
5+
src: url('~@/static/uni.ttf') format('truetype');
66
}
77

88
/*通用 */

components/u-charts/u-charts.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
* uni-app平台高性能跨全端图表,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360)
44
* Copyright (c) 2019 QIUN秋云 https://www.ucharts.cn All rights reserved.
55
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
6-
*
6+
*
77
* uCharts官方网站
88
* https://www.uCharts.cn
9-
*
9+
*
1010
* 开源地址:
1111
* https://gitee.com/uCharts/uCharts
12-
*
12+
*
1313
* uni-app插件市场地址:
1414
* http://ext.dcloud.net.cn/plugin?id=271
15-
*
15+
*
1616
*/
1717

1818
'use strict';
@@ -1046,11 +1046,11 @@ function getRoseDataPoints(series, type, minRadius, radius) {
10461046
count += item.data;
10471047
dataArr.push(item.data);
10481048
}
1049-
1049+
10501050
var minData = Math.min.apply(null, dataArr);
10511051
var maxData = Math.max.apply(null, dataArr);
10521052
var radiusLength = radius - minRadius;
1053-
1053+
10541054
for (let i = 0; i < series.length; i++) {
10551055
let item = series[i];
10561056
item.data = item.data === null ? 0 : item.data;
@@ -1347,7 +1347,7 @@ function getYAxisTextList(series, opts, config, stack) {
13471347
data = data.filter(function(item) {
13481348
//return item !== null;
13491349
if (typeof item === 'object' && item !== null) {
1350-
if (item.constructor == Array) {
1350+
if (Array.isArray(item)) {
13511351
return item !== null;
13521352
} else {
13531353
return item.value !== null;
@@ -1358,7 +1358,7 @@ function getYAxisTextList(series, opts, config, stack) {
13581358
});
13591359
data.map(function(item) {
13601360
if (typeof item === 'object') {
1361-
if (item.constructor == Array) {
1361+
if (Array.isArray(item)) {
13621362
item.map(function(subitem) {
13631363
sorted.push(subitem);
13641364
})
@@ -2791,7 +2791,7 @@ function drawXAxis(categories, opts, config, context) {
27912791
}
27922792
context.setLineDash([]);
27932793
}
2794-
2794+
27952795

27962796
//不绘制X轴
27972797
if (opts.xAxis.disabled !== true) {
@@ -3423,9 +3423,9 @@ function drawRadarDataPoints(series, opts, config, context) {
34233423
labelColor: '#666666',
34243424
opacity: 0.2
34253425
},opts.extra.radar);
3426-
3426+
34273427
var coordinateAngle = getRadarCoordinateSeries(opts.categories.length);
3428-
3428+
34293429
var centerPosition = {
34303430
x: opts.area[3] + (opts.width - opts.area[1] - opts.area[3]) / 2,
34313431
y: opts.area[0] + (opts.height - opts.area[0] - opts.area[2]) / 2
@@ -3513,7 +3513,7 @@ function normalInt(min, max, iter) {
35133513
for (var i = 0; i < iter; i++) {
35143514
arr[i] = Math.random();
35153515
};
3516-
return Math.floor(arr.reduce(function(i,j){return i+j})/iter*(max-min))+min;
3516+
return Math.floor(arr.reduce(function(i,j){return i+j})/iter*(max-min))+min;
35173517
};
35183518

35193519
function collisionNew(area,points,width,height){
@@ -3553,8 +3553,8 @@ function getBoundingBox(data) {
35533553
var longitude = coords[j][0];
35543554
var latitude = coords[j][1];
35553555
var point = {
3556-
x: longitude,
3557-
y: latitude
3556+
x: longitude,
3557+
y: latitude
35583558
}
35593559
bounds.xMin = bounds.xMin < point.x ? bounds.xMin : point.x;
35603560
bounds.xMax = bounds.xMax > point.x ? bounds.xMax : point.x;
@@ -3581,19 +3581,19 @@ function pointToCoordinate(pointY, pointX,bounds,scale,xoffset,yoffset) {
35813581
}
35823582

35833583
function isRayIntersectsSegment(poi,s_poi,e_poi){
3584-
if (s_poi[1]==e_poi[1]){return false;}
3584+
if (s_poi[1]==e_poi[1]){return false;}
35853585
if (s_poi[1]>poi[1] && e_poi[1]>poi[1]){return false;}
35863586
if (s_poi[1]<poi[1] && e_poi[1]<poi[1]){return false;}
35873587
if (s_poi[1]==poi[1] && e_poi[1]>poi[1]){return false;}
35883588
if (e_poi[1]==poi[1] && s_poi[1]>poi[1]){return false;}
35893589
if (s_poi[0]<poi[0] && e_poi[1]<poi[1]){return false;}
3590-
let xseg=e_poi[0]-(e_poi[0]-s_poi[0])*(e_poi[1]-poi[1])/(e_poi[1]-s_poi[1]);
3590+
let xseg=e_poi[0]-(e_poi[0]-s_poi[0])*(e_poi[1]-poi[1])/(e_poi[1]-s_poi[1]);
35913591
if (xseg<poi[0]){
35923592
return false;
35933593
}else{
35943594
return true;
35953595
}
3596-
}
3596+
}
35973597

35983598
function isPoiWithinPoly(poi,poly){
35993599
let sinsc=0;
@@ -3610,7 +3610,7 @@ function isPoiWithinPoly(poi,poly){
36103610
}
36113611
}
36123612
}
3613-
3613+
36143614
if(sinsc%2==1){
36153615
return true;
36163616
}else{
@@ -3731,11 +3731,11 @@ function getWordCloudPoint(opts,type){
37313731
return true;
37323732
}else {return false};
37333733
};
3734-
for (let i = 0; i < points.length; i++) {
3734+
for (let i = 0; i < points.length; i++) {
37353735
let text = points[i].name;
37363736
let tHeight = points[i].textSize;
37373737
let tWidth = measureText(text,tHeight);
3738-
let isSpin = Spin();
3738+
let isSpin = Spin();
37393739
let x,y,area,areav;
37403740
let breaknum=0;
37413741
while(true) {
@@ -3752,7 +3752,7 @@ function getWordCloudPoint(opts,type){
37523752
y = normalInt(-opts.height/2, opts.height/2,5)+tHeight/2;
37533753
area=[x-5+opts.width/2,y-5-tHeight+opts.height/2,x+tWidth+5+opts.width/2,y+5+opts.height/2];
37543754
isCollision = collisionNew(area,points,opts.width,opts.height);
3755-
}
3755+
}
37563756
if (!isCollision) break;
37573757
if (breaknum==1000){
37583758
area=[-1000,-1000,-1000,-1000];
@@ -3779,15 +3779,15 @@ function drawWordCloudDataPoints(series, opts, config, context) {
37793779
type: 'normal',
37803780
autoColors: true
37813781
},opts.extra.word);
3782-
3782+
37833783
context.beginPath();
37843784
context.setFillStyle(opts.background||'#FFFFFF');
37853785
context.rect(0,0,opts.width,opts.height);
37863786
context.fill();
37873787
context.save();
37883788
let points = opts.chartData.wordCloudData;
37893789
context.translate(opts.width/2,opts.height/2);
3790-
3790+
37913791
for(let i=0;i<points.length;i++){
37923792
context.save();
37933793
if(points[i].rotate){
@@ -3810,7 +3810,7 @@ function drawWordCloudDataPoints(series, opts, config, context) {
38103810
}
38113811
}else{
38123812
context.fillText(text,(points[i].areav[0]+5-opts.width/2)*process-tWidth*(1-process)/2,(points[i].areav[1]+5+tHeight-opts.height/2)*process);
3813-
}
3813+
}
38143814
}
38153815
}else{
38163816
if(points[i].area[0]>0){
@@ -3823,10 +3823,10 @@ function drawWordCloudDataPoints(series, opts, config, context) {
38233823
}else{
38243824
context.fillText(text,(points[i].area[0]+5-opts.width/2)*process-tWidth*(1-process)/2,(points[i].area[1]+5+tHeight-opts.height/2)*process);
38253825
}
3826-
3826+
38273827
}
38283828
}
3829-
3829+
38303830
context.stroke();
38313831
context.restore();
38323832
}
@@ -3920,11 +3920,11 @@ function drawFunnelDataPoints(series, opts, config, context) {
39203920
context.translate(0,-eachSpacing)
39213921
}
39223922
context.restore();
3923-
3923+
39243924
if (opts.dataLabel !== false && process === 1) {
39253925
drawFunnelText(series, opts, context, eachSpacing, funnelOption.labelAlign, activeWidth, centerPosition);
39263926
}
3927-
3927+
39283928
return {
39293929
center: centerPosition,
39303930
radius: radius,
@@ -3996,7 +3996,7 @@ function drawFunnelText(series, opts, context, eachSpacing, labelAlign,activeWid
39963996
context.stroke();
39973997
context.closePath();
39983998
}
3999-
3999+
40004000
}
40014001
}
40024002

@@ -4603,7 +4603,7 @@ var Charts = function Charts(opts) {
46034603
config$$1.toolTipLineHeight = config.toolTipLineHeight * opts.pixelRatio;
46044604
config$$1.columePadding = config.columePadding * opts.pixelRatio;
46054605
opts.$this = opts.$this ? opts.$this : this;
4606-
4606+
46074607
this.context = uni.createCanvasContext(opts.canvasId, opts.$this);
46084608
/* 兼容原生H5
46094609
this.context = document.getElementById(opts.canvasId).getContext("2d");

components/uni-goods-nav/uni-goods-nav.vue

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- 底部占位 -->
44
<view class="uni-tab__seat" />
55
<view class="uni-tab__cart-box flex">
6-
<view class="flex uni-tab__cart-sub-box">
6+
<view class="flex uni-tab__cart-sub-left">
77
<view v-for="(item,index) in options" :key="index" class="flex uni-tab__cart-button-left uni-tab__shop-cart" @click="onClick(index,item)">
88
<view class="uni-tab__icon">
99
<image class="image" :src="item.icon" mode="widthFix" />
@@ -14,7 +14,7 @@
1414
</view>
1515
</view>
1616
</view>
17-
<view :class="{'uni-tab__right':fill}" class="flex uni-tab__cart-sub-box ">
17+
<view :class="{'uni-tab__right':fill}" class="flex uni-tab__cart-sub-right ">
1818
<view v-for="(item,index) in buttonGroup" :key="index" :style="{backgroundColor:item.backgroundColor,color:item.color}" class="flex uni-tab__cart-button-right" @click="buttonClick(index,item)"><text class="uni-tab__cart-button-right-text">{{ item.text }}</text></view>
1919
<!-- <view class="flex uni-tab__cart-button-right uni-tab__color-y ">立即购买</view> -->
2020
</view>
@@ -54,12 +54,12 @@
5454
default () {
5555
return [{
5656
text: '加入购物车',
57-
backgroundColor: '#ff0000',
57+
backgroundColor: '#ffa200',
5858
color: '#fff'
5959
},
6060
{
6161
text: '立即购买',
62-
backgroundColor: '#ffa200',
62+
backgroundColor: '#ff0000',
6363
color: '#fff'
6464
}
6565
]
@@ -74,7 +74,8 @@
7474
onClick(index, item) {
7575
this.$emit('click', {
7676
index,
77-
content: item
77+
content: item,
78+
7879
})
7980
},
8081
buttonClick(index, item) {
@@ -108,12 +109,16 @@
108109
109110
.uni-tab__cart-box {
110111
flex: 1;
111-
height: 100rpx;
112+
height: 50px;
112113
background-color: #fff;
113114
z-index: 900;
114115
}
115116
116-
.uni-tab__cart-sub-box {
117+
.uni-tab__cart-sub-left {
118+
padding: 0 5px;
119+
}
120+
121+
.uni-tab__cart-sub-right {
117122
flex: 1;
118123
}
119124
@@ -128,27 +133,29 @@
128133
/* #ifndef APP-NVUE */
129134
display: flex;
130135
/* #endif */
131-
flex: 1;
136+
/* flex: 1;
137+
*/
132138
position: relative;
133139
justify-content: center;
134140
align-items: center;
135141
flex-direction: column;
142+
margin: 0 10px;
136143
}
137144
138145
.uni-tab__icon {
139-
width: 20px;
140-
height: 20px;
146+
width: 18px;
147+
height: 18px;
141148
}
142149
143150
.image {
144-
width: 20px;
145-
height: 20px;
151+
width: 18px;
152+
height: 18px;
146153
}
147154
148155
.uni-tab__text {
149156
margin-top: 3px;
150157
font-size: 24rpx;
151-
color: #666;
158+
color: #646566;
152159
}
153160
154161
.uni-tab__cart-button-right {
@@ -176,8 +183,8 @@
176183
flex-direction: column;
177184
/* #endif */
178185
position: absolute;
179-
right: 12px;
180-
top: 4px;
186+
right: -2px;
187+
top: 2px;
181188
justify-content: center;
182189
align-items: center;
183190
/* width: 0;

components/uni-icons/uni-icons.vue

Lines changed: 10 additions & 0 deletions
Large diffs are not rendered by default.

components/uni-indexed-list/uni-indexed-list.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@
6969
}
7070
const throttleTouchMove = throttle(touchMove, 40)
7171
// #endif
72+
73+
/**
74+
* IndexedList 索引列表
75+
* @description 用于展示索引列表
76+
* @tutorial https://ext.dcloud.net.cn/plugin?id=375
77+
* @property {Boolean} showSelect = [true|false] 展示模式
78+
* @value true 展示模式
79+
* @value false 选择模式
80+
* @property {Object} options 索引列表需要的数据对象
81+
* @event {Function} click 点击列表事件 ,返回当前选择项的事件对象
82+
* @example <uni-indexed-list options="" showSelect="false" @click=""></uni-indexed-list>
83+
*/
7284
export default {
7385
name: 'UniIndexedList',
7486
components: {

components/uni-list-item/uni-list-item.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,28 @@
3131
<script>
3232
import uniIcons from '../uni-icons/uni-icons.vue'
3333
import uniBadge from '../uni-badge/uni-badge.vue'
34+
35+
/**
36+
* ListItem 列表子组件
37+
* @description 列表子组件
38+
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
39+
* @property {String} title 标题
40+
* @property {String} note 描述
41+
* @property {String} thumb 左侧缩略图,若thumb有值,则不会显示扩展图标
42+
* @property {String} badgeText 数字角标内容
43+
* @property {String} badgeType 数字角标类型,参考[uni-icons](https://ext.dcloud.net.cn/plugin?id=21)
44+
* @property {String} rightText 右侧文字内容
45+
* @property {Boolean} disabled = [true|false]是否禁用
46+
* @property {Boolean} showArrow = [true|false] 是否显示箭头图标
47+
* @property {Boolean} showBadge = [true|false] 是否显示数字角标
48+
* @property {Boolean} showSwitch = [true|false] 是否显示Switch
49+
* @property {Boolean} switchChecked = [true|false] Switch是否被选中
50+
* @property {Boolean} showExtraIcon = [true|false] 左侧是否显示扩展图标
51+
* @property {Boolean} scrollY = [true|false] 允许纵向滚动,需要显式的设置其宽高
52+
* @property {Object} extraIcon 扩展图标参数,格式为 {color: '#4cd964',size: '22',type: 'spinner'}
53+
* @event {Function} click 点击 uniListItem 触发事件
54+
* @event {Function} switchChange 点击切换 Switch 时触发
55+
*/
3456
export default {
3557
name: 'UniListItem',
3658
components: {

components/uni-list/uni-list.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
</template>
1313

1414
<script>
15+
/**
16+
* List 列表
17+
* @description 列表组件
18+
* @tutorial https://ext.dcloud.net.cn/plugin?id=24
19+
*/
1520
export default {
1621
name: 'UniList',
1722
'mp-weixin': {

0 commit comments

Comments
 (0)