提交 d932dd0b 作者: 方治民

feat: firstui 更新到 v1.9.0

上级 28af3870
...@@ -214,7 +214,8 @@ ...@@ -214,7 +214,8 @@
let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax', let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax',
'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini', 'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini',
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini', 'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini',
'iphone14pro', 'iphone14promax' 'iphone14pro', 'iphone14promax', 'iphone15', 'iphone15mini',
'iphone15pro', 'iphone15promax'
] ]
const model = res.model.replace(/\s/g, "").toLowerCase() const model = res.model.replace(/\s/g, "").toLowerCase()
const newModel = model.split('<')[0] const newModel = model.split('<')[0]
...@@ -305,11 +306,12 @@ ...@@ -305,11 +306,12 @@
.fui-actionsheet__btn { .fui-actionsheet__btn {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
width: 100%; width: 100%;
box-sizing: content-box;
/* #endif */ /* #endif */
flex: 1;
height: 100rpx; height: 100rpx;
/* #ifdef APP-NVUE */ /* #ifdef APP-NVUE */
line-height: 100rpx; line-height: 100rpx;
flex: 1;
/* #endif */ /* #endif */
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
......
...@@ -7,13 +7,19 @@ ...@@ -7,13 +7,19 @@
</gcanvas> </gcanvas>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef APP-NVUE || MP-TOUTIAO--> <!-- #ifndef APP-NVUE || MP-TOUTIAO || MP-QQ-->
<canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart" <canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart"
@touchmove="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel" @touchmove="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
:style="{width:w+'px',height:h+'px'}" @mousedown="mousedown" @mousemove="mousemove" @mouseup="mouseup" :style="{width:w+'px',height:h+'px'}" @mousedown="mousedown" @mousemove="mousemove" @mouseup="mouseup"
@mouseleave="mouseleave"></canvas> @mouseleave="mouseleave"></canvas>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-QQ -->
<canvas :disable-scroll="!completed" canvas-id="canvas_autograph" @touchstart="onTouchstart"
@touchmove="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
:style="{width:w+'px',height:h+'px'}" ></canvas>
<!-- #endif -->
<!-- #ifdef MP-TOUTIAO --> <!-- #ifdef MP-TOUTIAO -->
<canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart" <canvas :disable-scroll="!completed" :canvas-id="canvasId" :id="canvasId" @touchstart="onTouchstart"
@touchmove.stop.prevent="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel" @touchmove.stop.prevent="onTouchmove" @touchend="onTouchend" @touchcancel="onTouchCancel"
...@@ -76,16 +82,19 @@ ...@@ -76,16 +82,19 @@
} }
}, },
data() { data() {
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN || MP-QQ
const canvasId = `fui_ag_${Math.ceil(Math.random() * 10e5).toString(36)}` const canvasId = `fui_ag_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif // #endif
// #ifdef MP-QQ
const canvasId = 'canvas_autograph'
// #endif
return { return {
// #ifdef APP-NVUE // #ifdef APP-NVUE
isAndroid: true, isAndroid: true,
nTop: 0, nTop: 0,
nLeft: 0, nLeft: 0,
// #endif // #endif
canvasId:canvasId, canvasId: canvasId,
w: 300, w: 300,
h: 200, h: 200,
completed: false, completed: false,
......
...@@ -165,6 +165,8 @@ ...@@ -165,6 +165,8 @@
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: inline-flex; display: inline-flex;
overflow: hidden; overflow: hidden;
flex-shrink: 0;
z-index: 3;
/* #endif */ /* #endif */
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
......
...@@ -5,10 +5,15 @@ ...@@ -5,10 +5,15 @@
</gcanvas> </gcanvas>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE || MP-QQ -->
<canvas :canvas-id="canvasId" :id="canvasId" :style="{width:w+'px',height:h+'px'}" @longtap="longtap" <canvas :canvas-id="canvasId" :id="canvasId" :style="{width:w+'px',height:h+'px'}" @longtap="longtap"
@touchstart="touchstart" @touchend="touchend"></canvas> @touchstart="touchstart" @touchend="touchend"></canvas>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-QQ -->
<canvas canvas-id="canvas_barcode" :style="{width:w+'px',height:h+'px'}" @longtap="longtap"
@touchstart="touchstart" @touchend="touchend"></canvas>
<!-- #endif -->
</template> </template>
<script> <script>
...@@ -33,6 +38,10 @@ ...@@ -33,6 +38,10 @@
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
const canvasId = `fui_bc_${Math.ceil(Math.random() * 10e5).toString(36)}` const canvasId = `fui_bc_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif // #endif
// #ifdef MP-QQ
const canvasId = 'canvas_barcode'
// #endif
export default { export default {
name: "fui-barcode", name: "fui-barcode",
emits: ['ready', 'longclick', 'touchStart', 'touchEnd'], emits: ['ready', 'longclick', 'touchStart', 'touchEnd'],
...@@ -51,7 +60,7 @@ ...@@ -51,7 +60,7 @@
} }
}, },
data() { data() {
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN || MP-QQ
const canvasId = `fui_bc_${Math.ceil(Math.random() * 10e5).toString(36)}` const canvasId = `fui_bc_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif // #endif
return { return {
......
class FillStylePattern { class FillStylePattern {
constructor(img, pattern) {// 新特性待增加 constructor(img, pattern) {
this._style = pattern;// todo: 待修改 this._style = pattern;
this._img = img;// 新特性待增加 this._img = img;
}// todo: 待修改 }
} }
// todo: 待修改
export default FillStylePattern; export default FillStylePattern;
...@@ -316,6 +316,7 @@ ...@@ -316,6 +316,7 @@
position: relative; position: relative;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
background: transparent !important; background: transparent !important;
flex-direction: row;
/* #endif */ /* #endif */
} }
......
...@@ -210,6 +210,7 @@ ...@@ -210,6 +210,7 @@
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: none; -moz-appearance: none;
appearance: none; appearance: none;
pointer-events: none;
/* #endif */ /* #endif */
/* #ifdef APP-NVUE */ /* #ifdef APP-NVUE */
width: 100wx; width: 100wx;
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
}, },
minDate: { minDate: {
type: String, type: String,
default: '2010-01-01' default: '2020-01-01'
}, },
maxDate: { maxDate: {
type: String, type: String,
...@@ -957,7 +957,6 @@ ...@@ -957,7 +957,6 @@
}, 80) }, 80)
}, },
pickerChange(e) { pickerChange(e) {
if (!this.show) return;
let value = e.detail.value; let value = e.detail.value;
let type = Number(this.type) let type = Number(this.type)
if (type > 1 && type < 6) { if (type > 1 && type < 6) {
......
...@@ -36,6 +36,10 @@ ...@@ -36,6 +36,10 @@
return [] return []
} }
}, },
coexist: {
type: Boolean,
default: false
},
height: { height: {
type: [Number, String], type: [Number, String],
default: 88 default: 88
...@@ -97,12 +101,22 @@ ...@@ -97,12 +101,22 @@
let type = item.type; let type = item.type;
if (type === 'dropdown') { if (type === 'dropdown') {
this.$set(item, 'active', !item.active); this.$set(item, 'active', !item.active);
item.value && this.handleData(index); item.value && !this.coexist && this.handleData(index);
} else if (type === 'text') { } else if (type === 'text') {
if (item.active) return; if (!this.coexist) {
this.$set(item, 'active', true); if (item.active) return;
this.$set(item, 'value', item.text); this.$set(item, 'active', true);
this.handleData(index); this.$set(item, 'value', item.text);
this.handleData(index);
} else {
if (item.active) {
this.$set(item, 'active', false);
this.$set(item, 'value', '');
} else {
this.$set(item, 'active', true);
this.$set(item, 'value', item.text);
}
}
} else if (type === 'switch') { } else if (type === 'switch') {
this.$set(item, 'switch', item.switch === 2 ? 1 : 2); this.$set(item, 'switch', item.switch === 2 ? 1 : 2);
this.$set(item, 'active', false); this.$set(item, 'active', false);
...@@ -114,7 +128,7 @@ ...@@ -114,7 +128,7 @@
this.$set(item, 'sort', 1); this.$set(item, 'sort', 1);
} }
this.$set(item, 'value', item.sort === 1 ? 'asc' : 'desc'); this.$set(item, 'value', item.sort === 1 ? 'asc' : 'desc');
this.handleData(index); !this.coexist && this.handleData(index);
} }
setTimeout(() => { setTimeout(() => {
this.$emit('change', { this.$emit('change', {
......
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE -->
<view class="fui-form__asterisk" v-if="asterisk" :style="{color:asteriskColor || akColor || '#FF2B2B'}">*</view> <view class="fui-form__asterisk" v-if="asterisk"
:style="{color:asteriskColor || akColor || '#FF2B2B',left:getAkPosi}">*</view>
<!-- #endif --> <!-- #endif -->
<text :style="{width:getLabelWidth,fontSize:getLabelSize,color:labelColor || lColor || '#333',paddingRight:getLabelRight}" <text class="fui-form__item-sizing"
:style="{width:getLabelWidth,fontSize:getLabelSize,color:labelColor || lColor || '#333',paddingRight:getLabelRight,textAlign:getLabelAlign}"
v-if="label">{{label}}</text> v-if="label">{{label}}</text>
<view class="fui-form__item-content"> <view class="fui-form__item-content">
<slot></slot> <slot></slot>
...@@ -70,6 +72,11 @@ ...@@ -70,6 +72,11 @@
type: [Number, String], type: [Number, String],
default: 0 default: 0
}, },
//label 对齐方式:left,right
labelAlign: {
type: String,
default: ''
},
//是否显示必填的红色星号 //是否显示必填的红色星号
asterisk: { asterisk: {
type: Boolean, type: Boolean,
...@@ -79,6 +86,11 @@ ...@@ -79,6 +86,11 @@
type: String, type: String,
default: '' default: ''
}, },
//left,right
asteriskPosition: {
type: String,
default: ''
},
background: { background: {
type: String, type: String,
default: '#fff' default: '#fff'
...@@ -135,6 +147,19 @@ ...@@ -135,6 +147,19 @@
getLabelRight() { getLabelRight() {
const labelRight = (uni.$fui && uni.$fui.fuiFormItem && uni.$fui.fuiFormItem.labelRight) || 16 const labelRight = (uni.$fui && uni.$fui.fuiFormItem && uni.$fui.fuiFormItem.labelRight) || 16
return `${this.labelRight || labelRight}rpx` return `${this.labelRight || labelRight}rpx`
},
getLabelAlign() {
const labelAlign = (uni.$fui && uni.$fui.fuiFormItem && uni.$fui.fuiFormItem.labelAlign) || 'left'
return this.labelAlign || this.lAlign || labelAlign
},
getAkPosi() {
const akPosi = (uni.$fui && uni.$fui.fuiFormItem && uni.$fui.fuiFormItem.asteriskPosition) || 'left'
const position = this.asteriskPosition || this.akPosi || akPosi
const lWidth = this.getLabelWidth.replace('rpx', '')
const lRight = this.getLabelRight.replace('rpx', '')
const pr = this.padding[1]
const pdr = pr ? pr.replace('rpx', '').replace('px', '') : 0;
return position === 'right' ? `${Number(lWidth) + Number(pdr || 0) - Number(lRight || 0)}rpx` : '12rpx'
} }
}, },
data() { data() {
...@@ -142,7 +167,9 @@ ...@@ -142,7 +167,9 @@
lSize: 0, lSize: 0,
lColor: '', lColor: '',
lWidth: 0, lWidth: 0,
akColor: '' lAlign: '',
akColor: '',
akPosi: ''
} }
}, },
created() { created() {
...@@ -155,7 +182,9 @@ ...@@ -155,7 +182,9 @@
this.lSize = this.form.labelSize; this.lSize = this.form.labelSize;
this.lColor = this.form.labelColor; this.lColor = this.form.labelColor;
this.lWidth = this.form.labelWidth; this.lWidth = this.form.labelWidth;
this.lAlign = this.form.labelAlign;
this.akColor = this.form.asteriskColor; this.akColor = this.form.asteriskColor;
this.akPosi = this.form.asteriskPosition;
} }
}, },
handleClick() { handleClick() {
...@@ -215,6 +244,13 @@ ...@@ -215,6 +244,13 @@
/* #endif */ /* #endif */
} }
/* #ifndef APP-NVUE */
.fui-form__item-sizing {
box-sizing: border-box;
}
/* #endif */
.fui-form__item-content { .fui-form__item-content {
flex: 1; flex: 1;
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:style="{paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0}"> :style="{paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0}">
<slot></slot> <slot></slot>
<view class="fui-form__msg-wrap" <view class="fui-form__msg-wrap"
:style="{top:top+'px',left:left+'rpx',right:right+'rpx',background:background,borderRadius:ridus+'rpx'}" :style="{top:top+'px',left:left+'rpx',right:right+'rpx',background:background,borderRadius:radius+'rpx'}"
v-if="show" :class="{'fui-form__msg-bg':!background,'fui-form__msg-show':errorMsg}"><text v-if="show" :class="{'fui-form__msg-bg':!background,'fui-form__msg-show':errorMsg}"><text
class="fui-form__text" :style="{fontSize:size+'rpx',color:color}">{{errorMsg}}</text></view> class="fui-form__text" :style="{fontSize:size+'rpx',color:color}">{{errorMsg}}</text></view>
<view class="fui-form__mask" v-if="disabled"></view> <view class="fui-form__mask" v-if="disabled"></view>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
default: '#fff' default: '#fff'
}, },
//错误提示框圆角值 //错误提示框圆角值
ridus: { radius: {
type: [Number, String], type: [Number, String],
default: 16 default: 16
}, },
...@@ -94,10 +94,20 @@ ...@@ -94,10 +94,20 @@
type: [Number, String], type: [Number, String],
default: 0 default: 0
}, },
//label 对齐方式:left,right
labelAlign:{
type: String,
default: 'left'
},
// form-item 必填项星号颜色 // form-item 必填项星号颜色
asteriskColor: { asteriskColor: {
type: String, type: String,
default: '#FF2B2B' default: '#FF2B2B'
},
//left,right
asteriskPosition:{
type: String,
default: ''
} }
}, },
provide() { provide() {
......
...@@ -6,60 +6,93 @@ ...@@ -6,60 +6,93 @@
<slot></slot> <slot></slot>
</cell> </cell>
<!-- #ifdef VUE2 -->
<template v-for="(list, idx) in lists"> <template v-for="(list, idx) in lists">
<header :ref="'fui_il_letter_' + idx"> <!-- #endif -->
<view class="fui-index__list-letter" :class="{'fui-il__key-bg':!background}" <!-- #ifdef VUE3 -->
:style="{background:background}"> <template v-for="(list, idx) in lists" :key="list.key">
<text class="fui-il__letter-text" :style="{color:color}">{{list.descr || list.letter}}</text>
</view>
</header>
<cell :key="list.key">
<!-- #endif --> <!-- #endif -->
<!-- #ifndef APP-NVUE --> <header :ref="'fui_il_letter_' + idx">
<scroll-view class="fui-index__list-sv" scroll-y :scroll-into-view="scrollViewId"> <view class="fui-index__list-letter" :class="{'fui-il__key-bg':!background}"
<slot></slot> :style="{background:background}">
<view :id="'fui_il_letter_'+idx" v-for="(list, idx) in lists" :key="list.key"> <text class="fui-il__letter-text"
:style="{color:color}">{{list.descr || list.letter}}</text>
</view>
</header>
<!-- #ifdef VUE2 -->
<cell :key="list.key">
<!-- #endif -->
<!-- #ifdef VUE3 -->
<cell>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef APP-NVUE -->
<view class="fui-index__list-letter" :class="{'fui-il__key-bg':!background}"
:style="{background:background}">
<text class="fui-il__letter-text"
:style="{color:color}">{{list.descr || list.letter}}</text>
</view>
<!-- #endif --> <!-- #endif -->
<!-- 解构插槽 item项样式内容自定义 -->
<view v-if="custom">
<view v-for="(model,index) in list.data" :key="index" @tap="onTap(idx,index)">
<slot name="item" :model="model" :idx="idx" :index="index"
:last="list.data.length-1===index" :isSelect="isSelect" :isSrc="isSrc"
:subRight="subRight"></slot>
</view>
</view>
<view v-else>
<f-index-list-item @itemClick="onClick" :model="model" :idx="idx" :index="index"
:last="list.data.length-1===index" :isSelect="isSelect" :borderColor="borderColor"
:selectedColor="selectedColor" :isSrc="isSrc" :subRight="subRight"
v-for="(model,index) in list.data" :key="index">
</f-index-list-item>
</view>
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE -->
</view> <scroll-view class="fui-index__list-sv" scroll-y :scroll-into-view="scrollViewId">
<slot name="footer"></slot> <slot></slot>
</scroll-view> <view :id="'fui_il_letter_'+idx" v-for="(list, idx) in lists" :key="list.key">
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-NVUE --> <!-- #ifndef APP-NVUE -->
<view class="fui-index__list-letter" :class="{'fui-il__key-bg':!background}"
:style="{background:background}">
<text class="fui-il__letter-text"
:style="{color:color}">{{list.descr || list.letter}}</text>
</view>
<!-- #endif -->
<!-- 解构插槽 item项样式内容自定义 -->
<view v-if="custom">
<view v-for="(model,index) in list.data" :key="index" @tap="onTap(idx,index)">
<slot name="item" :model="model" :idx="idx" :index="index"
:last="list.data.length-1===index" :isSelect="isSelect" :isSrc="isSrc"
:subRight="subRight"></slot>
</view>
</view>
<view v-else>
<f-index-list-item @itemClick="onClick" :model="model" :idx="idx" :index="index"
:last="list.data.length-1===index" :isSelect="isSelect"
:borderColor="borderColor" :selectedColor="selectedColor" :isSrc="isSrc"
:subRight="subRight" v-for="(model,index) in list.data" :key="index">
</f-index-list-item>
</view>
<!-- #ifndef APP-NVUE -->
</view>
<slot name="footer"></slot>
</scroll-view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
</cell>
</template>
<cell>
<slot name="footer"></slot>
</cell> </cell>
</template>
<cell>
<slot name="footer"></slot>
</cell>
</list> </list>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef VUE3 -->
<view class="fui-il__indicator" :class="{'fui-il__nvue-android':nvueAndroid}" <view class="fui-il__indicator" :class="{'fui-il__nvue-android':nvueAndroid}"
:style="{ top: indicators[touchmoveIndex] + 'px' }" v-if="touching && touchmoveIndex!==-1"> :style="{ top: indicators[touchmoveIndex] + 'px' }" v-if="touching && touchmoveIndex!==-1">
<view class="fui-il__indicator-after"></view> <view class="fui-il__indicator-after"></view>
<text class="fui-il__indicator-text">{{ lists[touchmoveIndex] && lists[touchmoveIndex].letter }}</text> <text class="fui-il__indicator-text">{{ lists[touchmoveIndex] && lists[touchmoveIndex].letter }}</text>
</view> </view>
<!-- #endif -->
<!-- #ifdef VUE3 -->
<!-- #ifndef APP-NVUE -->
<view class="fui-il__indicator" :class="{'fui-il__nvue-android':nvueAndroid}"
:style="{ top: indicators[touchmoveIndex] + 'px' }" v-if="touching && touchmoveIndex!==-1">
<view class="fui-il__indicator-after"></view>
<text class="fui-il__indicator-text">{{ lists[touchmoveIndex] && lists[touchmoveIndex].letter }}</text>
</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<view class="fui-il__indicator" :class="{'fui-il__nvue-android':nvueAndroid}"
:style="{ top: idtHeight/2 + 'px' }" v-if="touching && touchmoveIndex!==-1">
<view class="fui-il__indicator-after"></view>
<text class="fui-il__indicator-text">{{ lists[touchmoveIndex] && lists[touchmoveIndex].letter }}</text>
</view>
<!-- #endif -->
<!-- #endif -->
<view class="fui-index__letter" :style="styles" @touchstart="touchStart" @touchmove.stop.prevent="touchMove" <view class="fui-index__letter" :style="styles" @touchstart="touchStart" @touchmove.stop.prevent="touchMove"
@touchend="touchEnd" @mousedown.stop="mousedown" @mousemove.stop.prevent="mousemove" @touchend="touchEnd" @mousedown.stop="mousedown" @mousemove.stop.prevent="mousemove"
@mouseleave.stop="mouseleave" v-if="!isNvue || styles"> @mouseleave.stop="mouseleave" v-if="!isNvue || styles">
...@@ -282,7 +315,13 @@ ...@@ -282,7 +315,13 @@
} }
this.idtHeight = height; this.idtHeight = height;
this.styles = `height:${height}rpx;`; this.styles = `height:${height}rpx;`;
//nvue vue3 rpx 失效
// #ifdef APP-NVUE
// #ifdef VUE3
this.idtHeight = uni.upx2px(height)
this.styles = `height:${this.idtHeight}px;`;
// #endif
// #endif
this.lists = lists; this.lists = lists;
// #ifndef APP-NVUE // #ifndef APP-NVUE
uni.createSelectorQuery() uni.createSelectorQuery()
...@@ -310,8 +349,15 @@ ...@@ -310,8 +349,15 @@
}, },
setStyles() { setStyles() {
this.indicators = [] this.indicators = []
this.styles = this.styles =
`height:${this.idtHeight}rpx;top:${this.winHeight / 2}px;-webkit-transform: translateY(-${this.idtHeight/2}rpx);transform: translateY(-${this.idtHeight/2}rpx)` `height:${this.idtHeight}rpx;top:${this.winHeight / 2}px;-webkit-transform: translateY(-${this.idtHeight/2}rpx);transform: translateY(-${this.idtHeight/2}rpx)`
// #ifdef APP-NVUE
// #ifdef VUE3
this.styles =
`height:${this.idtHeight}px;top:${this.winHeight / 2}px;-webkit-transform: translateY(-${this.idtHeight/2}px);transform: translateY(-${this.idtHeight/2}px)`
// #endif
// #endif
let start = this.winHeight / 2 - uni.upx2px(this.idtHeight) / 2 let start = this.winHeight / 2 - uni.upx2px(this.idtHeight) / 2
this.start = start; this.start = start;
this.lists.forEach((item, index) => { this.lists.forEach((item, index) => {
......
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
default: false default: false
}, },
value: { value: {
type: [Array, String], type: [Array, String, Number],
default () { default () {
return [] return []
} }
...@@ -536,10 +536,10 @@ ...@@ -536,10 +536,10 @@
vals.push(this.fourthArr.indexOf(values[i])) vals.push(this.fourthArr.indexOf(values[i]))
} }
} }
this.$nextTick(()=>{ this.$nextTick(() => {
setTimeout(()=>{ setTimeout(() => {
this.vals = vals; this.vals = vals;
},20) }, 20)
}) })
} else { } else {
this.reset() this.reset()
......
...@@ -9,8 +9,8 @@ class GImage { ...@@ -9,8 +9,8 @@ class GImage {
constructor() { constructor() {
this._id = incId++; this._id = incId++;
this._width = 0; this._width = 0;
this._height = 0;// echo建议 this._height = 0;
this._src = undefined;// 功能需要优化 this._src = undefined;
this._onload = noop; this._onload = noop;
this._onerror = noop; this._onerror = noop;
this.complete = false; this.complete = false;
...@@ -41,10 +41,10 @@ class GImage { ...@@ -41,10 +41,10 @@ class GImage {
v = 'http:' + v; v = 'http:' + v;
} }
this._src = v;// 新特性待增加 this._src = v;
// 功能需要优化
GImage.GBridge.perloadImage([this._src, this._id], (data) => { GImage.GBridge.perloadImage([this._src, this._id], (data) => {
if (typeof data === 'string') {// echo建议 if (typeof data === 'string') {
data = JSON.parse(data); data = JSON.parse(data);
} }
if (data.error) { if (data.error) {
......
<template> <template>
<!-- #ifndef MP-QQ -->
<canvas :style="{ width: w + 'px', height: h + 'px' }" :canvas-id="canvasId" :id="canvasId" <canvas :style="{ width: w + 'px', height: h + 'px' }" :canvas-id="canvasId" :id="canvasId"
class="fui-poster__canvas"></canvas> class="fui-poster__canvas"></canvas>
<!-- #endif -->
<!-- #ifdef MP-QQ -->
<canvas :style="{ width: w + 'px', height: h + 'px' }" canvas-id="canvas_poster"
class="fui-poster__canvas"></canvas>
<!-- #endif -->
</template> </template>
<script> <script>
//注意:h5、app-vue 中单个尺寸过大的 canvas 在 iOS/Safari 无法绘制(具体限制尺寸未公布)
import poster from './index.js';
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
const canvasId = `fui_${Math.ceil(Math.random() * 10e5).toString(36)}` const canvasId = `fui_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif // #endif
//注意:h5、app-vue 中单个尺寸过大的 canvas 在 iOS/Safari 无法绘制(具体限制尺寸未公布)
import poster from './index.js';
export default { export default {
name: "fui-poster", name: "fui-poster",
emits: ['ready'], emits: ['ready'],
...@@ -36,9 +43,13 @@ ...@@ -36,9 +43,13 @@
}, },
data() { data() {
//如果小程序端无法识别,则使用固定值 //如果小程序端无法识别,则使用固定值
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN || MP-QQ
const canvasId = `fui_${Math.ceil(Math.random() * 10e5).toString(36)}` const canvasId = `fui_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif // #endif
//vue3下QQ小程序无法使用动态id
// #ifdef MP-QQ
const canvasId = 'canvas_poster'
// #endif
return { return {
canvasId, canvasId,
w: 375, w: 375,
......
/*! /*!
* 生成海报 * 生成海报
* poster - v1.0.0 (2021/7/19, 16:52:14 PM) * poster - v1.8.0 (2023/02/02, 16:52:14 PM)
*
* *
* 官网地址:https://firstui.cn/ * 官网地址:https://firstui.cn/
* 文档地址:https://doc.firstui.cn/ * 文档地址:https://doc.firstui.cn/
......
...@@ -5,10 +5,15 @@ ...@@ -5,10 +5,15 @@
</gcanvas> </gcanvas>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE || MP-QQ -->
<canvas :canvas-id="canvasId" :id="canvasId" :style="{width:w+'px',height:h+'px'}" @longtap="longtap" <canvas :canvas-id="canvasId" :id="canvasId" :style="{width:w+'px',height:h+'px'}" @longtap="longtap"
@touchstart="touchstart" @touchend="touchend"></canvas> @touchstart="touchstart" @touchend="touchend"></canvas>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-QQ -->
<canvas canvas-id="canvas_qrcode" :style="{width:w+'px',height:h+'px'}" @longtap="longtap" @touchstart="touchstart"
@touchend="touchend"></canvas>
<!-- #endif -->
</template> </template>
<script> <script>
...@@ -45,6 +50,10 @@ ...@@ -45,6 +50,10 @@
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
const canvasId = `fui_qr_${Math.ceil(Math.random() * 10e5).toString(36)}` const canvasId = `fui_qr_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif // #endif
// #ifdef MP-QQ
const canvasId = 'canvas_qrcode'
// #endif
export default { export default {
name: "fui-qrcode", name: "fui-qrcode",
emits: ['ready', 'longclick', 'touchStart', 'touchEnd'], emits: ['ready', 'longclick', 'touchStart', 'touchEnd'],
...@@ -71,7 +80,7 @@ ...@@ -71,7 +80,7 @@
} }
}, },
data() { data() {
// #ifndef MP-WEIXIN // #ifndef MP-WEIXIN || MP-QQ
const canvasId = `fui_qr_${Math.ceil(Math.random() * 10e5).toString(36)}` const canvasId = `fui_qr_${Math.ceil(Math.random() * 10e5).toString(36)}`
// #endif // #endif
return { return {
......
...@@ -207,6 +207,7 @@ ...@@ -207,6 +207,7 @@
-webkit-appearance: none; -webkit-appearance: none;
-moz-appearance: none; -moz-appearance: none;
appearance: none; appearance: none;
pointer-events: none;
/* #endif */ /* #endif */
/* #ifdef APP-NVUE */ /* #ifdef APP-NVUE */
width: 100wx; width: 100wx;
......
...@@ -131,9 +131,11 @@ ...@@ -131,9 +131,11 @@
align-items: flex-end; align-items: flex-end;
} }
/* #ifndef APP-NVUE */
.fui-row__before { .fui-row__before {
display: table display: table
} }
/* #endif */
.fui-row__end { .fui-row__end {
justify-content: flex-end; justify-content: flex-end;
......
...@@ -17,9 +17,16 @@ ...@@ -17,9 +17,16 @@
</view> </view>
</view> </view>
</view> </view>
<input :value="val" :password="password" :type="type" class="fui-sinput__hidden" <!-- #ifdef APP-NVUE -->
<input ref="inputRef" :value="val" :password="password" :type="type" class="fui-sinput__hidden"
:class="{'fui-sinput__alizero':aliZero}" @input="onInput" @blur="onBlur" :maxlength="length"
v-if="native" :disabled="disabled" @confirm="onConfirm" @focus="onTap" />
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<input ref="inputRef" :value="val" :password="password" :type="type" class="fui-sinput__hidden"
:class="{'fui-sinput__alizero':aliZero}" @input="onInput" @blur="onBlur" :focus="focus" :maxlength="length" :class="{'fui-sinput__alizero':aliZero}" @input="onInput" @blur="onBlur" :focus="focus" :maxlength="length"
v-if="native" :disabled="disabled" @confirm="onConfirm" @focus="onTap" /> v-if="native" :disabled="disabled" @confirm="onConfirm" @focus="onTap" />
<!-- #endif -->
</view> </view>
</template> </template>
...@@ -195,6 +202,13 @@ ...@@ -195,6 +202,13 @@
this._animation(ref) this._animation(ref)
} }
}, },
focus(val){
if(val){
this.$refs.inputRef.focus()
}else{
this.$refs.inputRef.blur()
}
},
// #endif // #endif
isFocus(val) { isFocus(val) {
this.initFocus(val) this.initFocus(val)
......
...@@ -9,10 +9,12 @@ ...@@ -9,10 +9,12 @@
<view class="fui-tabs__text-wrap" <view class="fui-tabs__text-wrap"
:class="{'fui-tabs__wrap-disabled':tab.disabled,'fui-tabs__item-column':direction==='column' && tab.icon}" :class="{'fui-tabs__wrap-disabled':tab.disabled,'fui-tabs__item-column':direction==='column' && tab.icon}"
:style="{height:height+'rpx'}"> :style="{height:height+'rpx'}">
<view class="fui-tabs__ac-line" <view class="fui-tabs__line-wrap" :class="{'fui-tabs__line-center':center}"
:class="{'fui-tabs__line-short':short,'fui-tabs__slider-color':!sliderBackground}" :style="{bottom:bottom +'rpx',left:`-${padding}rpx`,right:`-${padding}rpx`}" v-if="isSlider">
:style="{height:sliderHeight+'rpx',background:sliderBackground,borderRadius:sliderRadius==-1?sliderHeight+'rpx':sliderRadius+'rpx',bottom:bottom +'rpx',left:`-${padding}rpx`,right:`-${padding}rpx`,transform: `scale(${tabIndex===index?(isNvue?1:scale):(isNvue?0.00001:0)})`}" <view class="fui-tabs__ac-line"
v-if="isSlider"> :class="{'fui-tabs__line-short':short,'fui-tabs__full':!short,'fui-tabs__slider-color':!sliderBackground}"
:style="{height:sliderHeight+'rpx',background:sliderBackground,borderRadius:sliderRadius==-1?sliderHeight+'rpx':sliderRadius+'rpx',transform: `scale(${tabIndex===index?(isNvue?1:scale):(isNvue?0.00001:0)})`}">
</view>
</view> </view>
<image class="fui-tabs__icon" :class="{'fui-tabs__icon-column':direction==='column'}" <image class="fui-tabs__icon" :class="{'fui-tabs__icon-column':direction==='column'}"
:src="tabIndex===index && tab.selectedIcon?tab.selectedIcon:tab.icon" v-if="tab.icon"> :src="tabIndex===index && tab.selectedIcon?tab.selectedIcon:tab.icon" v-if="tab.icon">
...@@ -196,6 +198,11 @@ ...@@ -196,6 +198,11 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
//滑块是否居中显示
center: {
type: Boolean,
default: false
},
//是否固定 //是否固定
isFixed: { isFixed: {
type: Boolean, type: Boolean,
...@@ -235,7 +242,7 @@ ...@@ -235,7 +242,7 @@
} }
}, },
watch: { watch: {
tabs(vals){ tabs(vals) {
this.initData(vals) this.initData(vals)
}, },
current(newVal, oldVal) { current(newVal, oldVal) {
...@@ -462,10 +469,22 @@ ...@@ -462,10 +469,22 @@
z-index: 10; z-index: 10;
} }
.fui-tabs__ac-line { .fui-tabs__line-wrap {
position: absolute; position: absolute;
border-radius: 2px; border-radius: 2px;
z-index: 2; z-index: 2;
flex: 1;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
}
.fui-tabs__line-center {
justify-content: center;
}
.fui-tabs__ac-line {
transition: transform 0.2s linear; transition: transform 0.2s linear;
} }
...@@ -473,6 +492,10 @@ ...@@ -473,6 +492,10 @@
width: 45rpx !important; width: 45rpx !important;
} }
.fui-tabs__line-center {
left: 0;
}
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
.fui-tabs__selected-color { .fui-tabs__selected-color {
color: var(--fui-color-primary, #465CFF) !important; color: var(--fui-color-primary, #465CFF) !important;
......
<template> <template>
<view :class="{'fui-textarea__border':textareaBorder}" :style="{marginTop:marginTop+'rpx',borderColor:borderColor}" <view :class="{'fui-textarea__border':textareaBorder && !isRadius}"
@tap="fieldClick"> :style="{marginTop:marginTop+'rpx',borderColor:borderColor}" @tap="fieldClick">
<view class="fui-textarea__wrap" :class="{'fui-textarea__flex-start':flexStart}" <view class="fui-textarea__wrap" :class="{'fui-textarea__flex-start':flexStart}"
:style="{paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,backgroundColor:backgroundColor}"> :style="{paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,backgroundColor:backgroundColor,borderRadius:radius+'rpx'}">
<view v-if="borderTop && !textareaBorder" <view v-if="borderTop && !textareaBorder && !isRadius"
:style="{background:borderColor,left:topLeft+'rpx',right:topRight+'rpx'}" :style="{background:borderColor,left:topLeft+'rpx',right:topRight+'rpx'}"
class="fui-textarea__border-top"> class="fui-textarea__border-top">
</view> </view>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</view> </view>
</view> </view>
<slot></slot> <slot></slot>
<view v-if="borderBottom && !textareaBorder" <view v-if="borderBottom && !textareaBorder && !isRadius"
:style="{background:borderColor,left:bottomLeft+'rpx',right:bottomRight+'rpx'}" :style="{background:borderColor,left:bottomLeft+'rpx',right:bottomRight+'rpx'}"
class="fui-textarea__border-bottom"></view> class="fui-textarea__border-bottom"></view>
</view> </view>
...@@ -240,6 +240,10 @@ ...@@ -240,6 +240,10 @@
type: String, type: String,
default: '#eaeef1' default: '#eaeef1'
}, },
radius: {
type: [String, Number],
default: 0
},
// 是否自动去除两端的空格 // 是否自动去除两端的空格
trim: { trim: {
type: Boolean, type: Boolean,
...@@ -287,7 +291,8 @@ ...@@ -287,7 +291,8 @@
placeholderStyl: '', placeholderStyl: '',
count: 0, count: 0,
focused: false, focused: false,
val: '' val: '',
isRadius: false
}; };
}, },
watch: { watch: {
...@@ -308,6 +313,13 @@ ...@@ -308,6 +313,13 @@
value(newVal) { value(newVal) {
this.val = this.getVal(newVal) this.val = this.getVal(newVal)
this.count = this.getCount(String(this.val).length) this.count = this.getCount(String(this.val).length)
},
radius(val) {
if (this.radius && this.radius !== true && Number(this.radius) > 0) {
this.isRadius = true
} else {
this.isRadius = false
}
} }
}, },
created() { created() {
...@@ -326,6 +338,9 @@ ...@@ -326,6 +338,9 @@
this.fieldPlaceholderStyle() this.fieldPlaceholderStyle()
}, },
mounted() { mounted() {
if (this.radius && this.radius !== true && Number(this.radius) > 0) {
this.isRadius = true
}
this.$nextTick(() => { this.$nextTick(() => {
this.focused = this.focus this.focused = this.focus
}) })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论