提交 030f062c 作者: 方治民

合并分支 '3.x' 到 'main'

3.x

查看合并请求 !71
...@@ -103,17 +103,17 @@ ...@@ -103,17 +103,17 @@
"@antfu/eslint-config": "^0.43.1", "@antfu/eslint-config": "^0.43.1",
"@commitlint/cli": "^19.5.0", "@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0", "@commitlint/config-conventional": "^19.5.0",
"@dcloudio/types": "^3.4.12", "@dcloudio/types": "^3.4.14",
"@dcloudio/uni-automator": "3.0.0-4020920240930001", "@dcloudio/uni-automator": "3.0.0-4020920240930001",
"@dcloudio/uni-cli-shared": "3.0.0-4020920240930001", "@dcloudio/uni-cli-shared": "3.0.0-4020920240930001",
"@dcloudio/uni-helper-json": "^1.0.13", "@dcloudio/uni-helper-json": "^1.0.13",
"@dcloudio/uni-stacktracey": "3.0.0-4020920240930001", "@dcloudio/uni-stacktracey": "3.0.0-4020920240930001",
"@dcloudio/uni-uts-v1": "3.0.0-4020920240930001", "@dcloudio/uni-uts-v1": "3.0.0-4020920240930001",
"@dcloudio/vite-plugin-uni": "3.0.0-4020920240930001", "@dcloudio/vite-plugin-uni": "3.0.0-4020920240930001",
"@iconify/json": "^2.2.261", "@iconify/json": "^2.2.262",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/lodash-es": "^4.17.12", "@types/lodash-es": "^4.17.12",
"@types/node": "^20.16.12", "@types/node": "^20.16.13",
"@types/qs": "^6.9.16", "@types/qs": "^6.9.16",
"@types/stompjs": "^2.3.9", "@types/stompjs": "^2.3.9",
"@types/urijs": "^1.19.25", "@types/urijs": "^1.19.25",
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
"eslint": "^8.57.1", "eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1", "eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "^9.29.0", "eslint-plugin-vue": "^9.29.1",
"husky": "^8.0.3", "husky": "^8.0.3",
"jest": "27.0.4", "jest": "27.0.4",
"jest-environment-node": "27.5.1", "jest-environment-node": "27.5.1",
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
"postcss-less": "^6.0.0", "postcss-less": "^6.0.0",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"rimraf": "^6.0.1", "rimraf": "^6.0.1",
"sass": "^1.80.2", "sass": "^1.80.3",
"sort-package-json": "^2.10.1", "sort-package-json": "^2.10.1",
"stylelint": "^16.10.0", "stylelint": "^16.10.0",
"stylelint-config-html": "^1.1.0", "stylelint-config-html": "^1.1.0",
......
...@@ -171,3 +171,11 @@ page { ...@@ -171,3 +171,11 @@ page {
.fui-flex__1 { .fui-flex__1 {
flex: 1; flex: 1;
} }
.fui-full {
width: 750rpx;
}
.fui-relative {
position: relative;
}
...@@ -10,11 +10,11 @@ ...@@ -10,11 +10,11 @@
:style="{fontSize:size+'rpx',color:color}" v-if="tips">{{tips}}</text> :style="{fontSize:size+'rpx',color:color}" v-if="tips">{{tips}}</text>
<view :class="{'fui-actionsheet__operate-box':isCancel}"> <view :class="{'fui-actionsheet__operate-box':isCancel}">
<text class="fui-actionsheet__btn" <text class="fui-actionsheet__btn"
:style="{color:theme==='dark'?(item.darkColor || '#D1D1D1'):(item.color || '#181818'),fontSize:itemSize+'rpx'}" :style="{color:theme==='dark'?(item.darkColor || itemDarkColor):(item.color || itemColor),fontSize:(item.size || itemSize)+'rpx'}"
:class="{'fui-actionsheet__btn-last':!isCancel && index==vals.length-1,'fui-as__safe-weex':!isCancel && index==vals.length-1 && iphoneX && safeArea,'fui-actionsheet__radius':radius && !tips && index===0,'fui-as__divider-light':(index!==0 || tips) && theme==='light','fui-as__divider-dark':(index!==0 || tips) && theme==='dark' ,'fui-as__btn-light':theme==='light','fui-as__btn-dark':theme==='dark'}" :class="{'fui-actionsheet__btn-last':!isCancel && index==vals.length-1,'fui-as__safe-weex':!isCancel && index==vals.length-1 && iphoneX && safeArea,'fui-actionsheet__radius':radius && !tips && index===0,'fui-as__divider-light':(index!==0 || tips) && theme==='light','fui-as__divider-dark':(index!==0 || tips) && theme==='dark' ,'fui-as__btn-light':theme==='light','fui-as__btn-dark':theme==='dark'}"
v-for="(item,index) in vals" :key="index" @tap="handleClickItem(index)">{{item.text}}</text> v-for="(item,index) in vals" :key="index" @tap="handleClickItem(index)">{{item[textKey]}}</text>
</view> </view>
<text :style="{color:theme==='dark'?'#D1D1D1':'#181818',fontSize:itemSize+'rpx'}" <text :style="{color:theme==='dark'?itemDarkColor:itemColor,fontSize:(cancelSize || itemSize)+'rpx'}"
class="fui-actionsheet__btn fui-actionsheet__cancel" class="fui-actionsheet__btn fui-actionsheet__cancel"
:class="{'fui-as__safe-weex':iphoneX && safeArea,'fui-as__btn-light':theme==='light','fui-as__btn-dark':theme==='dark'}" :class="{'fui-as__safe-weex':iphoneX && safeArea,'fui-as__btn-light':theme==='light','fui-as__btn-dark':theme==='dark'}"
v-if="isCancel" @tap="handleClickCancel">取消</text> v-if="isCancel" @tap="handleClickCancel">取消</text>
...@@ -42,11 +42,25 @@ ...@@ -42,11 +42,25 @@
return [] return []
} }
}, },
textKey: {
type: String,
default: 'text'
},
//菜单按钮字体大小 rpx //菜单按钮字体大小 rpx
itemSize: { itemSize: {
type: [Number, String], type: [Number, String],
default: 32 default: 32
}, },
//v2.4.0+
itemColor: {
type: String,
default: '#181818'
},
//v2.4.0+
itemDarkColor: {
type: String,
default: '#D1D1D1'
},
//提示信息 //提示信息
tips: { tips: {
type: String, type: String,
...@@ -72,6 +86,11 @@ ...@@ -72,6 +86,11 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
//v2.4.0+
cancelSize: {
type: [Number, String],
default: 32
},
//light/dark //light/dark
theme: { theme: {
type: String, type: String,
...@@ -138,7 +157,7 @@ ...@@ -138,7 +157,7 @@
if (typeof vals[0] !== 'object') { if (typeof vals[0] !== 'object') {
vals = vals.map(item => { vals = vals.map(item => {
return { return {
text: item [this.textKey]: item
} }
}) })
} }
...@@ -210,12 +229,13 @@ ...@@ -210,12 +229,13 @@
//34px //34px
const res = uni.getSystemInfoSync(); const res = uni.getSystemInfoSync();
let iphonex = false; let iphonex = false;
let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax', let models = ['iphonex', 'iphonexr', 'iphonexsmax']
'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini', for (let i = 11; i < 20; i++) {
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini', models.push(`iphone${i}`)
'iphone14pro', 'iphone14promax', 'iphone15', 'iphone15mini', models.push(`iphone${i}mini`)
'iphone15pro', 'iphone15promax' models.push(`iphone${i}pro`)
] models.push(`iphone${i}promax`)
}
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]
if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets
......
...@@ -171,6 +171,7 @@ ...@@ -171,6 +171,7 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
vertical-align: middle;
} }
.fui-avatar__img { .fui-avatar__img {
......
<template>
<view class="fui-background__image-wrap"
:style="{position:absolute?'absolute':'fixed',background:background,zIndex:zIndex}">
<image :src="src" class="fui-background__image" :mode="aspectFill?'aspectFill':'scaleToFill'" v-if="src!=''">
</image>
<slot></slot>
</view>
</template>
<script>
export default {
name: "fui-background-image",
props: {
src: {
type: String,
default: ''
},
background: {
type: String,
default: 'transparent'
},
zIndex: {
type: [Number, String],
default: -1
},
aspectFill: {
type: Boolean,
default: true
},
absolute: {
type: Boolean,
default: false
}
}
}
</script>
<style>
.fui-background__image-wrap {
/* #ifndef APP-NVUE */
width: 100%;
height: 100%;
/* #endif */
left: 0;
top: 0;
right: 0;
bottom: 0;
}
.fui-background__image {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
/* #ifndef APP-NVUE */
width: 100%;
height: 100%;
display: block;
/* #endif */
}
</style>
...@@ -89,7 +89,13 @@ EAN13 = (function() { ...@@ -89,7 +89,13 @@ EAN13 = (function() {
if (this.ctx) { if (this.ctx) {
context = this.ctx; context = this.ctx;
this.clear(context); this.clear(context);
// #ifndef MP-WEIXIN
context.setFillStyle(this.settings.color); context.setFillStyle(this.settings.color);
// #endif
// #ifdef MP-WEIXIN
context.fillStyle = this.settings.color;
// #endif
left = this.settings.number && this.settings.prefix ? this.settings.width * layout.prefix_offset : 0; left = this.settings.number && this.settings.prefix ? this.settings.width * layout.prefix_offset : 0;
lines = code.split(""); lines = code.split("");
context.fillRect(left, 0, item_width, border_height); context.fillRect(left, 0, item_width, border_height);
...@@ -121,7 +127,12 @@ EAN13 = (function() { ...@@ -121,7 +127,12 @@ EAN13 = (function() {
left = left + item_width * 2; left = left + item_width * 2;
context.fillRect(left, 0, item_width, border_height); context.fillRect(left, 0, item_width, border_height);
if (this.settings.number) { if (this.settings.number) {
// #ifndef MP-WEIXIN
context.setFontSize(layout.font_size * height + "px monospace"); context.setFontSize(layout.font_size * height + "px monospace");
// #endif
// #ifdef MP-WEIXIN
context.font = layout.font_size * height + "px monospace"
// #endif
prefix = this.number.substr(0, 1); prefix = this.number.substr(0, 1);
if (this.settings.prefix) { if (this.settings.prefix) {
context.fillText(prefix, 0, border_height * layout.font_y); context.fillText(prefix, 0, border_height * layout.font_y);
...@@ -143,11 +154,19 @@ EAN13 = (function() { ...@@ -143,11 +154,19 @@ EAN13 = (function() {
for (x = _i = 0, _ref = item_width * 2; _ref > 0 ? _i <= width : _i >= width; x = _i += _ref) { for (x = _i = 0, _ref = item_width * 2; _ref > 0 ? _i <= width : _i >= width; x = _i += _ref) {
context.beginPath(); context.beginPath();
context.rect(x, height * 0.4, item_width, height * 0.1); context.rect(x, height * 0.4, item_width, height * 0.1);
// #ifndef MP-WEIXIN
context.setFillStyle('red'); context.setFillStyle('red');
// #endif
// #ifdef MP-WEIXIN
context.fillStyle = 'red';
// #endif
context.fill(); context.fill();
} }
} }
// #ifndef MP-WEIXIN
context.draw() context.draw()
// #endif
return this.settings.onSuccess.call(); return this.settings.onSuccess.call();
} else { } else {
return this.settings.onError.call(); return this.settings.onError.call();
......
...@@ -5,19 +5,30 @@ ...@@ -5,19 +5,30 @@
</gcanvas> </gcanvas>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef APP-NVUE || MP-QQ -->
<canvas :canvas-id="canvasId" :id="canvasId" :style="{width:w+'px',height:h+'px'}" @longtap="longtap"
@touchstart="touchstart" @touchend="touchend" v-if="canvasId"></canvas>
<!-- #endif -->
<!-- #ifdef MP-QQ --> <!-- #ifdef MP-QQ -->
<canvas canvas-id="canvas_barcode" :style="{width:w+'px',height:h+'px'}" @longtap="longtap" @touchstart="touchstart" <canvas canvas-id="canvas_barcode" :style="{width:w+'px',height:h+'px'}" @longtap="longtap" @touchstart="touchstart"
@touchend="touchend"></canvas> @touchend="touchend"></canvas>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<canvas type="2d" :canvas-id="canvasId" :id="canvasId" :style="{width:w+'px',height:h+'px'}" @longtap="longtap"
@touchstart="touchstart" @touchend="touchend" v-if="canvasId"></canvas>
<!-- #endif -->
<!-- #ifndef APP-NVUE || MP-QQ || MP-WEIXIN -->
<canvas :canvas-id="canvasId" :id="canvasId" :style="{width:w+'px',height:h+'px'}" @longtap="longtap"
@touchstart="touchstart" @touchend="touchend" v-if="canvasId"></canvas>
<!-- #endif -->
</template> </template>
<script> <script>
import barcode from './barcode.js' import barcode from './barcode.js'
import {
code128
} from './barcode-code128.js';
// #ifdef APP-NVUE // #ifdef APP-NVUE
import { import {
...@@ -57,6 +68,11 @@ ...@@ -57,6 +68,11 @@
value: { value: {
type: [Number, String], type: [Number, String],
default: '' default: ''
},
//条形码类型:1-EAN-13 2-Code 128
type: {
type: [Number, String],
default: 1
} }
}, },
data() { data() {
...@@ -79,8 +95,8 @@ ...@@ -79,8 +95,8 @@
} }
}, },
created() { created() {
this.w = uni.upx2px(this.width || 480) this.w = Math.round(uni.upx2px(this.width || 480))
this.h = uni.upx2px(this.height || 200) this.h = Math.round(uni.upx2px(this.height || 200))
this.ctx = null; this.ctx = null;
}, },
mounted() { mounted() {
...@@ -103,7 +119,31 @@ ...@@ -103,7 +119,31 @@
}, },
// #endif // #endif
methods: { methods: {
draw(options = {}) { // #ifdef MP-WEIXIN
getContext(callback) {
const query = uni.createSelectorQuery().in(this)
query.select(`#${this.canvasId}`)
.fields({
node: true,
size: true
})
.exec((res) => {
const canvas = res[0].node
const ctx = canvas.getContext('2d')
const dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = res[0].width * dpr
canvas.height = res[0].height * dpr
ctx.scale(dpr, dpr)
this.ctx = ctx;
callback && callback()
})
},
// #endif
drawBarcode(options) {
// #ifdef MP-WEIXIN
this.ctx.clearRect(0, 0, this.w, this.h);
// #endif
if (!this.ctx) { if (!this.ctx) {
// #ifdef APP-NVUE // #ifdef APP-NVUE
let ganvas = this.$refs[this.canvasId]; let ganvas = this.$refs[this.canvasId];
...@@ -115,15 +155,35 @@ ...@@ -115,15 +155,35 @@
this.ctx = canvasObj.getContext('2d'); this.ctx = canvasObj.getContext('2d');
// #endif // #endif
// #ifndef APP-NVUE // #ifndef APP-NVUE || MP-WEIXIN
this.ctx = uni.createCanvasContext(this.canvasId, this) this.ctx = uni.createCanvasContext(this.canvasId, this)
// #endif // #endif
} }
const opts = Object.assign({}, this.defalutOptions, options)
new barcode(String(this.value), Object.assign({ if (this.type == 1) {
width: this.w, const opts = Object.assign({}, this.defalutOptions, options)
height: this.h new barcode(String(this.value), Object.assign({
}, opts), this.ctx) width: this.w,
height: this.h
}, opts), this.ctx)
} else {
code128(this.ctx, String(this.value), this.w, this.h)
}
},
draw(options = {}) {
// #ifdef MP-WEIXIN
if (!this.ctx) {
this.getContext(() => {
this.drawBarcode(options)
})
} else {
this.drawBarcode(options)
}
// #endif
// #ifndef MP-WEIXIN
this.drawBarcode(options)
// #endif
}, },
longtap() { longtap() {
this.$emit('longclick', {}) this.$emit('longclick', {})
......
...@@ -6,13 +6,13 @@ class FillStyleLinearGradient { ...@@ -6,13 +6,13 @@ class FillStyleLinearGradient {
this._stop_count = 0; this._stop_count = 0;
this._stops = [0, 0, 0, 0, 0]; this._stops = [0, 0, 0, 0, 0];
} }
// 新特性待增加
addColorStop = function (pos, color) {// 2021-5-6变更 addColorStop = function (pos, color) {
if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) { if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) {
this._stops[this._stop_count] = { _pos: pos, _color: color }; this._stops[this._stop_count] = { _pos: pos, _color: color };
this._stop_count++;// echo建议 this._stop_count++;
}// todo: 待修改 }
} }
} }
// 2021-5-6变更
export default FillStyleLinearGradient; export default FillStyleLinearGradient;
...@@ -146,11 +146,13 @@ ...@@ -146,11 +146,13 @@
isPhoneX(res) { isPhoneX(res) {
if (!this.safeArea) return false; if (!this.safeArea) return false;
let iphonex = false; let iphonex = false;
let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax', let models = ['iphonex', 'iphonexr', 'iphonexsmax']
'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini', for (let i = 11; i < 20; i++) {
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini', models.push(`iphone${i}`)
'iphone14pro', 'iphone14promax', 'iphone15' models.push(`iphone${i}mini`)
] models.push(`iphone${i}pro`)
models.push(`iphone${i}promax`)
}
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]
if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets
......
<template> <template>
<view class="fui-bottom__popup-wrap" :class="{'fui-bottom__popwrap-show':show}" <view class="fui-bottom__popup-wrap" :class="{'fui-bottom__popwrap-show':show}"
:style="{ zIndex: zIndex,background:maskBackground}" @tap.stop="handleClose" @touchmove.stop.prevent="stop" :style="{ zIndex: zIndex,background:maskBackground}" @tap.stop="handleClose" v-if="isShow || !isNvue"
v-if="isShow || !isNvue" ref="fui_bp_mk_ani"> ref="fui_bp_mk_ani">
<!-- @touchmove.stop.prevent="stop" -->
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<view class="fui-bottom__popup-border" :style="{height:radius+'rpx',background: background}" v-if="radius"> <view class="fui-bottom__popup-border" :style="{height:radius+'rpx',background: background}" v-if="radius">
</view> </view>
...@@ -102,11 +103,13 @@ ...@@ -102,11 +103,13 @@
//34px //34px
const res = uni.getSystemInfoSync(); const res = uni.getSystemInfoSync();
let iphonex = false; let iphonex = false;
let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax', let models = ['iphonex', 'iphonexr', 'iphonexsmax']
'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini', for (let i = 11; i < 20; i++) {
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini', models.push(`iphone${i}`)
'iphone14pro', 'iphone14promax' models.push(`iphone${i}mini`)
] models.push(`iphone${i}pro`)
models.push(`iphone${i}promax`)
}
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]
if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets
......
...@@ -22,9 +22,16 @@ ...@@ -22,9 +22,16 @@
fontSize: getSize, fontSize: getSize,
color: getColor color: getColor
}" :loading="loading" :form-type="formType" :open-type="openType" :app-parameter="appParameter" }" :loading="loading" :form-type="formType" :open-type="openType" :app-parameter="appParameter"
@getuserinfo="bindgetuserinfo" @getphonenumber="bindgetphonenumber" @contact="bindcontact" :hoverStopPropagation="hoverStopPropagation" :lang="lang" :sessionFrom="sessionFrom"
@error="binderror" @opensetting="bindopensetting" @chooseavatar="bindchooseavatar" :sendMessageTitle="sendMessageTitle" :sendMessagePath="sendMessagePath" :sendMessageImg="sendMessageImg"
@launchapp="bindlaunchapp" :disabled="disabled" :scope="scope" @tap.stop="handleTap"> :showMessageCard="showMessageCard" :groupId="groupId" :guildId="guildId" :publicId="publicId"
:dataImId="dataImId" :dataImType="dataImType" :dataGoodsId="dataGoodsId" :dataOrderId="dataOrderId"
:dataBizLine="dataBizLine" :phoneNumberNoQuotaToast="phoneNumberNoQuotaToast" @getuserinfo="bindgetuserinfo"
@getphonenumber="bindgetphonenumber" @contact="bindcontact" @error="binderror"
@opensetting="bindopensetting" @chooseavatar="bindchooseavatar" @launchapp="bindlaunchapp"
@agreeprivacyauthorization="agreeprivacyauthorization" @addgroupapp="addgroupapp"
@chooseaddress="chooseaddress" @chooseinvoicetitle="chooseinvoicetitle" @subscribe="bindsubscribe"
@login="bindlogin" @im="bindim" :disabled="disabled" :scope="scope" @tap.stop="handleTap">
<text class="fui-button__text" <text class="fui-button__text"
:class="{'fui-btn__gray-color':!background && !disabledBackground && !plain && type==='gray' && color==='#fff','fui-text__bold':bold}" :class="{'fui-btn__gray-color':!background && !disabledBackground && !plain && type==='gray' && color==='#fff','fui-text__bold':bold}"
v-if="text" :style="{fontSize: getSize,lineHeight:getSize,color:getColor}">{{text}}</text> v-if="text" :style="{fontSize: getSize,lineHeight:getSize,color:getColor}">{{text}}</text>
...@@ -42,11 +49,20 @@ ...@@ -42,11 +49,20 @@
<script> <script>
export default { export default {
name: 'fui-button', name: 'fui-button',
emits: ['click', 'getuserinfo', 'contact', 'getphonenumber', 'error', 'opensetting','chooseavatar','launchapp'], emits: ['click', 'getuserinfo', 'contact', 'getphonenumber', 'error', 'opensetting', 'chooseavatar', 'launchapp',
'agreeprivacyauthorization', 'addgroupapp', 'chooseaddress', 'chooseinvoicetitle', 'subscribe', 'login',
'im'
],
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
behaviors: ['wx://form-field-button'], behaviors: ['wx://form-field-button'],
// #endif // #endif
// #ifdef MP-BAIDU || MP-QQ // #ifdef MP-BAIDU
behaviors: ['swan://form-field'],
// #endif
// #ifdef MP-QQ
behaviors: ['qq://form-field'],
// #endif
// #ifdef H5
behaviors: ['uni://form-field'], behaviors: ['uni://form-field'],
// #endif // #endif
props: { props: {
...@@ -162,6 +178,71 @@ ...@@ -162,6 +178,71 @@
type: String, type: String,
default: '' default: ''
}, },
//v2.3.0+
hoverStopPropagation: {
type: Boolean,
default: false
},
lang: {
type: String,
default: 'en'
},
sessionFrom: {
type: String,
default: ''
},
sendMessageTitle: {
type: String,
default: ''
},
sendMessagePath: {
type: String,
default: ''
},
sendMessageImg: {
type: String,
default: ''
},
showMessageCard: {
type: Boolean,
default: false
},
phoneNumberNoQuotaToast: {
type: Boolean,
default: true
},
groupId: {
type: String,
default: ''
},
guildId: {
type: String,
default: ''
},
publicId: {
type: String,
default: ''
},
dataImId: {
type: String,
default: ''
},
dataImType: {
type: String,
default: ''
},
dataGoodsId: {
type: String,
default: ''
},
dataOrderId: {
type: String,
default: ''
},
dataBizLine: {
type: String,
default: ''
},
index: { index: {
type: [Number, String], type: [Number, String],
default: 0 default: 0
...@@ -354,6 +435,28 @@ ...@@ -354,6 +435,28 @@
detail = {} detail = {}
} = {}) { } = {}) {
this.$emit('launchapp', detail); this.$emit('launchapp', detail);
},
//v2.3.0+
agreeprivacyauthorization(e) {
this.$emit('agreeprivacyauthorization', e);
},
addgroupapp(e) {
this.$emit('addgroupapp', e);
},
chooseaddress(e) {
this.$emit('chooseaddress', e);
},
chooseinvoicetitle(e) {
this.$emit('chooseinvoicetitle', e);
},
bindsubscribe(e) {
this.$emit('subscribe', e);
},
bindlogin(e) {
this.$emit('login', e);
},
bindim(e) {
this.$emit('im', e);
} }
} }
}; };
......
...@@ -540,10 +540,10 @@ ...@@ -540,10 +540,10 @@
value = [value[0], value[1]] value = [value[0], value[1]]
} }
def = this.initDate(value[len - 1]) || [-1, -1, -1] def = this.initDate(value[len - 1]) || [-1, -1, -1]
if (def[0] !== -1) { }
year = def[0] if (def[0] !== -1) {
month = def[1] year = def[0]
} month = def[1]
} }
value = value.map(item => { value = value.map(item => {
let arr = this.initDate(item) let arr = this.initDate(item)
...@@ -604,8 +604,13 @@ ...@@ -604,8 +604,13 @@
if (this.checkYear(year)) { if (this.checkYear(year)) {
this.year = year; this.year = year;
if (this.isMultiple) { if (this.isMultiple) {
this.month = 1; this.defCurrent = this.month - 1;
this.defCurrent = 0; this.$nextTick(() => {
setTimeout(() => {
this.month = 1;
this.defCurrent = 0;
}, 10)
})
} }
this.setTitle(); this.setTitle();
this.monthArr = this.getMonthsArr(year) this.monthArr = this.getMonthsArr(year)
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
//边框颜色,仅nvue下生效 //边框颜色,仅nvue下生效
borderColor: { borderColor: {
type: String, type: String,
default: 'red' default: '#EEEEEE'
}, },
headerBackground: { headerBackground: {
type: String, type: String,
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<view class="fui-cascader__header-item" :id="`fui_cr_${idx}`" v-for="(item, idx) in selectedArr" <view class="fui-cascader__header-item" :id="`fui_cr_${idx}`" v-for="(item, idx) in selectedArr"
:key="idx" @tap.stop="swichTabs(idx)"> :key="idx" @tap.stop="swichTabs(idx)">
<text class="fui-cascader__header-text" <text class="fui-cascader__header-text"
:class="{'fui-cascader__hi-width':item.text.length>6,'fui-cascader__color':idx === current && !getActiveColor}" :class="{'fui-cascader__hi-width':item[textKey].length>6,'fui-cascader__color':idx === current && !getActiveColor}"
:style="{ color: idx === current ? getActiveColor : color, fontSize: size + 'rpx',fontWeight:idx === current?'bold':'normal' }">{{ item.text }}</text> :style="{ color: idx === current ? getActiveColor : color, fontSize: size + 'rpx',fontWeight:idx === current?'bold':'normal' }">{{ item[textKey] }}</text>
<view class="fui-cascader__header-line" :class="{'fui-cascader__bg':!getActiveColor}" <view class="fui-cascader__header-line" :class="{'fui-cascader__bg':!getActiveColor}"
:style="{ background: getActiveColor }" v-if="idx === current && showLine"></view> :style="{ background: getActiveColor }" v-if="idx === current && showLine"></view>
</view> </view>
...@@ -20,11 +20,11 @@ ...@@ -20,11 +20,11 @@
<view :style="{ height: height+'rpx', background: background}"> <view :style="{ height: height+'rpx', background: background}">
<swiper class="fui-cascader__list" :current="defCurrent" :circular="false" :duration="300" <swiper class="fui-cascader__list" :current="defCurrent" :circular="false" :duration="300"
@change="switchTab" :style="{ height: height+'rpx', background: background}" v-if="isShow"> @change="switchTab" :style="{ height: height+'rpx', background: background}" v-if="isShow">
<!-- #endif --> <!-- #endif -->
<!-- #ifndef MP-TOUTIAO --> <!-- #ifndef MP-TOUTIAO -->
<swiper class="fui-cascader__list" :current="defCurrent" :circular="false" :duration="300" <swiper class="fui-cascader__list" :current="defCurrent" :circular="false" :duration="300"
@change="switchTab" :style="{ height: height+'rpx', background: background}"> @change="switchTab" :style="{ height: height+'rpx', background: background}">
<!-- #endif --> <!-- #endif -->
<swiper-item v-for="(item, index) in selectedArr" :key="index"> <swiper-item v-for="(item, index) in selectedArr" :key="index">
<scroll-view :show-scrollbar="false" scroll-y :scroll-into-view="item.scrollViewId" <scroll-view :show-scrollbar="false" scroll-y :scroll-into-view="item.scrollViewId"
class="fui-cascader__item-scroll" :style="{ height: height+'rpx', background: background }"> class="fui-cascader__item-scroll" :style="{ height: height+'rpx', background: background }">
...@@ -35,17 +35,17 @@ ...@@ -35,17 +35,17 @@
:class="{'fui-cascader__icon-border':!getActiveColor}" :class="{'fui-cascader__icon-border':!getActiveColor}"
:style="{borderBottomColor:checkMarkColor || getActiveColor,borderRightColor:checkMarkColor || getActiveColor}" :style="{borderBottomColor:checkMarkColor || getActiveColor,borderRightColor:checkMarkColor || getActiveColor}"
v-if="item.index === subi"></view> v-if="item.index === subi"></view>
<image :src="sub.src" v-if="sub.src" class="fui-cascader__img" <image :src="sub[srcKey]" v-if="sub[srcKey]" class="fui-cascader__img"
:style="{ width: imgWidth+'rpx', height: imgHeight+'rpx', borderRadius: radius+'rpx' }"> :style="{ width: imgWidth+'rpx', height: imgHeight+'rpx', borderRadius: radius+'rpx' }">
</image> </image>
<text class="fui-cascader__text" <text class="fui-cascader__text"
:style="{ color: item.index === subi ? textActiveColor : textColor, fontSize: textSize + 'rpx',fontWeight:item.index === subi?'bold':'normal' }">{{ sub.text }}</text> :style="{ color: item.index === subi ? textActiveColor : textColor, fontSize: textSize + 'rpx',fontWeight:item.index === subi?'bold':'normal' }">{{ sub[textKey] }}</text>
</view> </view>
<view class="fui-cascader__seat"></view> <view class="fui-cascader__seat"></view>
</scroll-view> </scroll-view>
</swiper-item> </swiper-item>
</swiper> </swiper>
<!-- #ifdef MP-TOUTIAO --> <!-- #ifdef MP-TOUTIAO -->
</view> </view>
<!-- #endif --> <!-- #endif -->
</view> </view>
...@@ -62,6 +62,22 @@ ...@@ -62,6 +62,22 @@
return [] return []
} }
}, },
textKey: {
type: String,
default: 'text'
},
valueKey: {
type: String,
default: 'value'
},
childrenKey: {
type: String,
default: 'children'
},
srcKey: {
type: String,
default: 'src'
},
value: { value: {
type: Array, type: Array,
default () { default () {
...@@ -178,6 +194,9 @@ ...@@ -178,6 +194,9 @@
}, },
value(vals) { value(vals) {
this.setDefaultOptions(vals) this.setDefaultOptions(vals)
},
selectedArr(val) {
console.log(val)
} }
}, },
created() { created() {
...@@ -218,9 +237,9 @@ ...@@ -218,9 +237,9 @@
let value = []; let value = [];
let src = []; let src = [];
result.map(item => { result.map(item => {
text.push(item.text); text.push(item[this.textKey]);
value.push(item.value) value.push(item[this.valueKey])
src.push(item.src) src.push(item[this.srcKey])
delete item['data']; delete item['data'];
delete item['index']; delete item['index'];
delete item['scrollViewId']; delete item['scrollViewId'];
...@@ -228,18 +247,18 @@ ...@@ -228,18 +247,18 @@
}); });
this.$emit('complete', { this.$emit('complete', {
result: result, result: result,
value: value, [this.valueKey]: value,
text: text, [this.textKey]: text,
src: src [this.srcKey]: src
}); });
setTimeout(() => { setTimeout(() => {
this.scrollViewId = `fui_cr_${layer}`; this.scrollViewId = `fui_cr_${layer}`;
}, 50) }, 50)
} else { } else {
let item = [{ let item = [{
text: this.text, [this.textKey]: this.text,
value: '', [this.valueKey]: this.text,
src: '', [this.srcKey]: '',
index: -1, index: -1,
scrollViewId: 'fui_c__0', scrollViewId: 'fui_c__0',
data data
...@@ -265,7 +284,7 @@ ...@@ -265,7 +284,7 @@
}, },
getDefaultIndex(arr, val) { getDefaultIndex(arr, val) {
if (!arr || arr.length === 0 || val === undefined) return -1; if (!arr || arr.length === 0 || val === undefined) return -1;
let key = this.defaultKey || 'value'; let key = this.defaultKey || this.valueKey;
let index = -1; let index = -1;
for (let i = 0, len = arr.length; i < len; i++) { for (let i = 0, len = arr.length; i < len; i++) {
if (arr[i][key] == val) { if (arr[i][key] == val) {
...@@ -277,7 +296,7 @@ ...@@ -277,7 +296,7 @@
}, },
removeChildren(data) { removeChildren(data) {
let list = data.map(item => { let list = data.map(item => {
delete item['children']; delete item[this.childrenKey];
return item; return item;
}); });
return list; return list;
...@@ -291,13 +310,13 @@ ...@@ -291,13 +310,13 @@
} else { } else {
let subi = selectedArr[0].index; let subi = selectedArr[0].index;
subi = subi === undefined || subi == -1 ? index : subi; subi = subi === undefined || subi == -1 ? index : subi;
if (arr[subi] && arr[subi].children) { if (arr[subi] && arr[subi][this.childrenKey]) {
list = arr[subi].children list = arr[subi][this.childrenKey]
} }
if (layer > 0) { if (layer > 0) {
for (let i = 1; i < layer + 1; i++) { for (let i = 1; i < layer + 1; i++) {
let val = layer === i ? index : selectedArr[i].index; let val = layer === i ? index : selectedArr[i].index;
list = val === -1 ? [] : (list[val].children || []); list = val === -1 ? [] : (list[val][this.childrenKey] || []);
if (list.length === 0) break; if (list.length === 0) break;
} }
} }
...@@ -317,9 +336,9 @@ ...@@ -317,9 +336,9 @@
let subi = this.getDefaultIndex(item, vals[index]) let subi = this.getDefaultIndex(item, vals[index])
let obj = item[subi] || {} let obj = item[subi] || {}
selectedArr.push({ selectedArr.push({
text: obj.text || this.text, [this.textKey]: obj[this.textKey] || this.text,
value: obj.value || '', [this.valueKey]: obj[this.valueKey] || '',
src: obj.src || '', [this.srcKey]: obj[this.srcKey] || '',
index: subi, index: subi,
scrollViewId: `fui_c_${subi}`, scrollViewId: `fui_c_${subi}`,
data: item data: item
...@@ -341,9 +360,9 @@ ...@@ -341,9 +360,9 @@
obj = list[subi] obj = list[subi]
} }
selectedArr.push({ selectedArr.push({
text: obj.text || this.text, [this.textKey]: obj[this.textKey] || this.text,
value: obj.value || '', [this.valueKey]: obj[this.valueKey] || '',
src: obj.src || '', [this.srcKey]: obj[this.srcKey] || '',
index: subi, index: subi,
scrollViewId: `fui_c_${subi}`, scrollViewId: `fui_c_${subi}`,
data: list data: list
...@@ -406,9 +425,9 @@ ...@@ -406,9 +425,9 @@
let item = this.selectedArr[index]; let item = this.selectedArr[index];
if (item.index == subi) return; if (item.index == subi) return;
item.index = subi; item.index = subi;
item.text = sub.text; item[this.textKey] = sub[this.textKey];
item.value = sub.value; item[this.valueKey] = sub[this.valueKey];
item.src = sub.src || ''; item[this.srcKey] = sub[this.srcKey] || '';
this.$emit('change', { this.$emit('change', {
layer: index, layer: index,
index: subi, index: subi,
......
<template>
<view>
</view>
</template>
<script>
export default {
name:"fui-charts-column",
data() {
return {
};
}
}
</script>
<style>
</style>
<template>
<view>
</view>
</template>
<script>
export default {
name:"fui-charts-line",
data() {
return {
};
}
}
</script>
<style>
</style>
<template>
<view class="fui-charts__pie-wrap">
<view class="fui-charts__pie-box" :style="{width:diam+'rpx',height:diam+'rpx',backgroundColor:backgroundColor}">
<view class="fui-charts__pie-inner"
:style="{width:(radius*2)+'px',height:(radius*2)+'px',background:item.angle>180?item.color:'transparent',zIndex:item.angle>180?10:'auto',clip:item.transformAngle>180?`rect(0, ${radius}px, ${radius*2}px, 0)`:'auto'}"
v-for="(item,index) in dataset" :key="index" @tap.stop="itemClick(index)">
<view class="fui-charts__pie-sector"
:style="{width:radius+'px',height:diam+'rpx',marginLeft:diam/2+'rpx','-webkit-transform': `rotate(${item.transformAngle}deg)`,'transform': `rotate(${item.transformAngle}deg)`,backgroundColor:item.color}">
</view>
</view>
<view class="fui-charts__pie-circle" v-if="ring"
:style="{width:cDiam+'px',height:cDiam+'px',background:background}">
</view>
</view>
</view>
</template>
<script>
export default {
name: "fui-charts-pie",
props: {
//半径,单位rpx
radius: {
type: [Number, String],
default: 200
},
//是否显示为环状
ring: {
type: Boolean,
default: false
},
//中心圆半径,仅ring为true时生效,单位rpx
centerRadius: {
type: [Number, String],
default: 120
},
//中心圆背景色,颜色应与背景色一致,仅ring为true时生效
background: {
type: String,
default: '#FFFFFF'
}
},
data() {
return {
pRadius: 100,
cDiam: 60,
dataset: null
};
},
computed: {
getRadius() {
return `${this.radius}_${this.centerRadius}`
}
},
watch: {
getRadius(val) {
this.setRadius()
}
},
created() {
this.setRadius()
},
methods: {
rpx2px(value) {
let px = uni.upx2px(Number(value))
px = px % 2 === 0 ? px : px + 1
return px;
},
setRadius() {
this.pRadius = this.rpx2px(this.radius)
this.cDiam = this.rpx2px(this.centerRadius) * 2
//重新绘制
if (this.dataset) {
}
}
},
}
</script>
<style scoped>
.fui-charts__pie-wrap {}
</style>
...@@ -19,7 +19,13 @@ ...@@ -19,7 +19,13 @@
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
behaviors: ['wx://form-field-group'], behaviors: ['wx://form-field-group'],
// #endif // #endif
// #ifdef MP-BAIDU || MP-QQ || H5 // #ifdef MP-BAIDU
behaviors: ['swan://form-field'],
// #endif
// #ifdef MP-QQ
behaviors: ['qq://form-field'],
// #endif
// #ifdef H5
behaviors: ['uni://form-field'], behaviors: ['uni://form-field'],
// #endif // #endif
props: { props: {
...@@ -35,12 +41,14 @@ ...@@ -35,12 +41,14 @@
} }
}, },
// #endif // #endif
// #ifdef VUE2
value: { value: {
type: Array, type: Array,
default () { default () {
return [] return []
} }
} }
// #endif
}, },
data() { data() {
return { return {
...@@ -53,9 +61,11 @@ ...@@ -53,9 +61,11 @@
this.modelChange(vals) this.modelChange(vals)
}, },
// #endif // #endif
// #ifdef VUE2
value(vals) { value(vals) {
this.modelChange(vals) this.modelChange(vals)
} }
// #endif
}, },
created() { created() {
this.childrens = [] this.childrens = []
...@@ -71,7 +81,7 @@ ...@@ -71,7 +81,7 @@
// #endif // #endif
}, },
changeValue(checked, target) { changeValue(checked, target) {
let vals = [] const vals = []
this.childrens.forEach(item => { this.childrens.forEach(item => {
if (item.val) { if (item.val) {
vals.push(item.value); vals.push(item.value);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<view class="fui-check__mark" :style="{borderBottomColor:checkMarkColor,borderRightColor:checkMarkColor}" <view class="fui-check__mark" :style="{borderBottomColor:checkMarkColor,borderRightColor:checkMarkColor}"
v-if="val"></view> v-if="val"></view>
<checkbox class="fui-checkbox__hidden" style="opacity: 0;position: absolute;" :color="getColor" <checkbox class="fui-checkbox__hidden" style="opacity: 0;position: absolute;" :color="getColor"
:disabled="disabled" :value="value" :checked="val"> :disabled="disabled" :value="getValue" :checked="val">
</checkbox> </checkbox>
</view> </view>
</template> </template>
...@@ -15,14 +15,10 @@ ...@@ -15,14 +15,10 @@
export default { export default {
name: "fui-checkbox", name: "fui-checkbox",
emits: ['change'], emits: ['change'],
// #ifdef MP-WEIXIN
options: {
virtualHost: true
},
// #endif
props: { props: {
//注意:返回值仍为string类型
value: { value: {
type: String, type: [String, Number],
default: '' default: ''
}, },
checked: { checked: {
...@@ -70,6 +66,16 @@ ...@@ -70,6 +66,16 @@
default: 1 default: 1
} }
}, },
// #ifndef VUE3
beforeDestroy() {
this.unInstall()
},
// #endif
// #ifdef VUE3
beforeUnmount() {
this.unInstall()
},
// #endif
created() { created() {
this.val = this.checked; this.val = this.checked;
this.group = this.getParent() this.group = this.getParent()
...@@ -109,6 +115,9 @@ ...@@ -109,6 +115,9 @@
} }
// #endif // #endif
return color; return color;
},
getValue() {
return String(this.value)
} }
}, },
data() { data() {
...@@ -122,6 +131,15 @@ ...@@ -122,6 +131,15 @@
}; };
}, },
methods: { methods: {
unInstall() {
if (this.group) {
this.group.childrens.forEach((item, index) => {
if (item === this) {
this.group.childrens.splice(index, 1)
}
})
}
},
getBackgroundColor(val, isCheckMark) { getBackgroundColor(val, isCheckMark) {
let color = val ? this.getColor : '#fff' let color = val ? this.getColor : '#fff'
if (isCheckMark) { if (isCheckMark) {
......
...@@ -18,7 +18,11 @@ ...@@ -18,7 +18,11 @@
<canvas class="fui-circle__canvas" :canvas-id="circleId" :id="circleId" <canvas class="fui-circle__canvas" :canvas-id="circleId" :id="circleId"
:style="{width: w*4 +'px',height:w*4 +'px'}"></canvas> :style="{width: w*4 +'px',height:w*4 +'px'}"></canvas>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef MP-ALIPAY --> <!-- #ifdef MP-WEIXIN -->
<canvas type="2d" class="fui-circle__canvas" :canvas-id="circleId" :id="circleId"
:style="{width: w +'px',height:w +'px'}" v-if="circleId"></canvas>
<!-- #endif -->
<!-- #ifndef MP-ALIPAY || MP-WEIXIN-->
<!-- 此处加v-if是因为vue3下编译到头条/抖音等小程序动态id失效,需等uni-app官方调整 --> <!-- 此处加v-if是因为vue3下编译到头条/抖音等小程序动态id失效,需等uni-app官方调整 -->
<canvas class="fui-circle__canvas" :canvas-id="circleId" :id="circleId" :style="{width: w +'px',height:w +'px'}" <canvas class="fui-circle__canvas" :canvas-id="circleId" :id="circleId" :style="{width: w +'px',height:w +'px'}"
v-if="circleId"></canvas> v-if="circleId"></canvas>
...@@ -164,6 +168,7 @@ ...@@ -164,6 +168,7 @@
// #endif // #endif
//注意:app-nvue端canvas性能不如app-vue //注意:app-nvue端canvas性能不如app-vue
import mpjs from './mpjs.js' import mpjs from './mpjs.js'
import mpwx from './mpwx.js'
import render from './render.js' import render from './render.js'
import nvue from './nvue.js' import nvue from './nvue.js'
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
...@@ -171,7 +176,7 @@ ...@@ -171,7 +176,7 @@
// #endif // #endif
export default { export default {
name: "fui-circle", name: "fui-circle",
mixins: [mpjs, render, nvue], mixins: [mpjs, mpwx, render, nvue],
emits: ['change', 'end'], emits: ['change', 'end'],
props: { props: {
//进度百分比 0~100 //进度百分比 0~100
......
// #ifdef MP // #ifdef MP
// #ifdef MP-WEIXIN
export default {}
// #endif
// #ifndef MP-WEIXIN
export default { export default {
data() { data() {
return { return {
...@@ -44,8 +49,14 @@ export default { ...@@ -44,8 +49,14 @@ export default {
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
sw = sw * 4 sw = sw * 4
// #endif // #endif
// #ifndef MP-KUAISHOU
ctx.setLineWidth(sw); ctx.setLineWidth(sw);
ctx.setStrokeStyle(this.background); ctx.setStrokeStyle(this.background);
// #endif
// #ifdef MP-KUAISHOU
ctx.lineWidth = sw;
ctx.strokeStyle = this.background;
// #endif
let eAngle = Math.PI * 2 + Number(this.sAngle) * Math.PI; let eAngle = Math.PI * 2 + Number(this.sAngle) * Math.PI;
this.drawArc(ctx, eAngle, true); this.drawArc(ctx, eAngle, true);
}, },
...@@ -61,16 +72,25 @@ export default { ...@@ -61,16 +72,25 @@ export default {
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
sw = sw * 4 sw = sw * 4
// #endif // #endif
ctx.setLineWidth(sw); // #ifdef MP-KUAISHOU
ctx.lineWidth = sw;
// #endif
let gradient = this.foreground || this.primaryColor; let gradient = this.foreground || this.primaryColor;
// #ifndef MP-KUAISHOU // #ifndef MP-KUAISHOU
ctx.setLineWidth(sw);
if (this.gradient) { if (this.gradient) {
gradient = ctx.createLinearGradient(0, 0, Number(this.w), 0); gradient = ctx.createLinearGradient(0, 0, Number(this.w), 0);
gradient.addColorStop(0, this.gradient); gradient.addColorStop(0, this.gradient);
gradient.addColorStop(1, this.foreground || this.primaryColor); gradient.addColorStop(1, this.foreground || this.primaryColor);
} }
// #endif
ctx.setStrokeStyle(gradient); ctx.setStrokeStyle(gradient);
// #endif
// #ifdef MP-KUAISHOU
ctx.strokeStyle = gradient;
// #endif
let percentage = Number(this.percent) let percentage = Number(this.percent)
if (percentage > 0) { if (percentage > 0) {
start += Number(this.speed); start += Number(this.speed);
...@@ -81,10 +101,18 @@ export default { ...@@ -81,10 +101,18 @@ export default {
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
si = si * 4 si = si * 4
// #endif // #endif
// #ifndef MP-KUAISHOU
ctx.setFontSize(si); ctx.setFontSize(si);
ctx.setFillStyle(this.color || this.primaryColor); ctx.setFillStyle(this.color || this.primaryColor);
ctx.setTextAlign('center'); ctx.setTextAlign('center');
ctx.setTextBaseline('middle'); ctx.setTextBaseline('middle');
// #endif
// #ifdef MP-KUAISHOU
ctx.fillStyle = this.color || this.primaryColor;
ctx.font = si + "px Arial";
ctx.textBaseline = 'middle';
ctx.textAlign = 'center';
// #endif
let percent = `${this.counterclockwise ? 100 - start : start}%`; let percent = `${this.counterclockwise ? 100 - start : start}%`;
let radius = this.w / 2 let radius = this.w / 2
// #ifdef MP-ALIPAY // #ifdef MP-ALIPAY
...@@ -119,7 +147,13 @@ export default { ...@@ -119,7 +147,13 @@ export default {
}, },
//创建弧线 //创建弧线
drawArc(ctx, eAngle, def) { drawArc(ctx, eAngle, def) {
// #ifndef MP-KUAISHOU
ctx.setLineCap(this.lineCap); ctx.setLineCap(this.lineCap);
// #endif
// #ifdef MP-KUAISHOU
ctx.lineCap = this.lineCap;
// #endif
ctx.beginPath(); ctx.beginPath();
let radius = this.w / 2; let radius = this.w / 2;
let sw = Number(this.strokeWidth); let sw = Number(this.strokeWidth);
...@@ -133,6 +167,7 @@ export default { ...@@ -133,6 +167,7 @@ export default {
} }
} }
} }
// #endif
// #endif // #endif
......
// #ifdef MP-WEIXIN
export default {
data() {
return {
start: 0,
isReady: false
}
},
created() {
this.context = null;
this.canvas = null;
},
watch: {
percent(val) {
setTimeout(() => {
this.isReady && this.initDraw()
}, 20)
},
w(val) {
setTimeout(() => {
this.isReady && this.initDraw()
}, 20)
},
strokeWidth(val) {
setTimeout(() => {
this.isReady && this.initDraw()
}, 20)
}
},
mounted() {
this.$nextTick(() => {
setTimeout(() => {
this.init();
}, 50)
})
},
methods: {
//初始化绘制
init() {
uni.createSelectorQuery().in(this)
.select(`#${this.circleId}`)
.fields({
node: true,
size: true,
})
.exec(this.initDraw.bind(this))
},
initDraw(res) {
this.isReady = true;
let start = this.activeMode === 'backwards' ? 0 : this.start;
start = start > this.percent ? 0 : start;
if (res) {
const width = res[0].width
const height = res[0].height
const canvas = res[0].node
const ctx = canvas.getContext('2d')
const dpr = uni.getSystemInfoSync().pixelRatio
canvas.width = width * dpr
canvas.height = height * dpr
ctx.scale(dpr, dpr)
this.context = ctx;
this.canvas = canvas
this.drawCircle(start, ctx, canvas);
} else {
this.drawCircle(start, this.context, this.canvas);
}
},
drawDefaultCircle(ctx, canvas) {
//终止弧度
let eAngle = Math.PI * 2 + Number(this.sAngle) * Math.PI;
this.drawArc(ctx, eAngle, this.background);
},
drawpercent(ctx, percent) {
ctx.save();
ctx.beginPath();
ctx.fillStyle = this.color || this.primaryColor;
ctx.font = this.size + "px Arial";
ctx.textAlign = "center";
ctx.textBaseline = "middle";
let radius = this.w / 2;
percent = this.counterclockwise ? 100 - percent : percent;
percent = percent.toFixed(0) + "%"
ctx.fillText(percent, radius, radius);
ctx.stroke();
ctx.restore();
},
drawCircle(start, ctx, canvas) {
if (!ctx || !canvas) return;
let that = this
let percent = that.percent;
let requestId = null
let renderLoop = () => {
drawFrame((res) => {
if (res) {
requestId = canvas.requestAnimationFrame(renderLoop)
} else {
canvas.cancelAnimationFrame(requestId)
requestId = null;
renderLoop = null;
}
})
}
requestId = canvas.requestAnimationFrame(renderLoop)
function drawFrame(callback) {
ctx.clearRect(0, 0, canvas.width, canvas.height);
if (that.defaultShow) {
that.drawDefaultCircle(ctx, canvas)
}
if (that.show) {
that.drawpercent(ctx, start);
}
let isEnd = (percent == 0 || (that.counterclockwise && start == 100));
if (!isEnd) {
let eAngle = ((2 * Math.PI) / 100) * start + Number(that.sAngle) * Math.PI;
let gradient = that.foreground || that.primaryColor;
if (that.gradient) {
gradient = ctx.createLinearGradient(0, 0, Number(that.w), 0);
gradient.addColorStop(0, that.gradient);
gradient.addColorStop(1, (that.foreground || that.primaryColor));
}
that.drawArc(ctx, eAngle, gradient);
}
that.$emit('change', {
percent: start
});
if (start >= percent) {
that.start = start
that.$emit('end', {
canvasId: that.circleId,
percent: percent
});
canvas.cancelAnimationFrame(requestId)
callback && callback(false)
return;
}
let num = start + that.speed
start = num > percent ? percent : num;
callback && callback(true)
}
},
drawArc(ctx, eAngle, strokeStyle) {
ctx.save();
ctx.beginPath();
let sw = Number(this.strokeWidth);
ctx.lineCap = this.lineCap;
ctx.lineWidth = sw;
ctx.strokeStyle = strokeStyle;
let radius = this.w / 2;
ctx.arc(radius, radius, radius - sw, Number(this.sAngle) * Math.PI, eAngle, this
.counterclockwise);
ctx.stroke();
ctx.closePath();
ctx.restore();
}
}
}
// #endif
// #ifndef MP-WEIXIN
export default {}
// #endif
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
updateNvueWidth(width) { updateNvueWidth(width) {
// 用于在nvue端,span,offset,pull,push的计算 // 用于在nvue端,span,offset,pull,push的计算
this.parentWidth = width; this.parentWidth = width;
['span', 'offset', 'pull', 'push'].forEach(size => { ['span', 'offset', 'pullRight', 'pushLeft'].forEach(size => {
const curSize = this[size]; const curSize = this[size];
if ((curSize || curSize === 0) && curSize !== -1) { if ((curSize || curSize === 0) && curSize !== -1) {
let RPX = 1 / 24 * curSize * width let RPX = 1 / 24 * curSize * width
...@@ -157,10 +157,10 @@ ...@@ -157,10 +157,10 @@
case 'offset': case 'offset':
this.marginLeft = RPX this.marginLeft = RPX
break; break;
case 'pull': case 'pullRight':
this.right = RPX this.right = RPX
break; break;
case 'push': case 'pushLeft':
this.left = RPX this.left = RPX
break; break;
} }
......
<template> <template>
<view class="fui-collapse__item"> <view class="fui-collapse__item" :style="{marginTop:marginTop+'rpx',marginBottom:marginBottom+'rpx'}">
<view @tap.stop="onClick(!isOpen)" class="fui-collapse-item__title" :class="{'fui-collapse__disabled':disabled}" <view @tap.stop="onClick(!isOpen)" class="fui-collapse-item__title" :class="{'fui-collapse__disabled':disabled}"
:style="{background:background}"> :style="{background:background}">
<view class="fui-collapse__title"> <view class="fui-collapse__title">
...@@ -90,7 +90,16 @@ ...@@ -90,7 +90,16 @@
contentBg: { contentBg: {
type: String, type: String,
default: '#fff' default: '#fff'
},
marginTop: {
type: [Number, String],
default: 0
},
marginBottom: {
type: [Number, String],
default: 0
} }
}, },
data() { data() {
const elId = `fui_${Math.ceil(Math.random() * 10e5).toString(36)}` const elId = `fui_${Math.ceil(Math.random() * 10e5).toString(36)}`
......
<template> <template>
<view class="fui-collapse__wrap"> <view class="fui-collapse__wrap" :style="{background:background}">
<slot></slot> <slot></slot>
</view> </view>
</template> </template>
...@@ -12,6 +12,10 @@ ...@@ -12,6 +12,10 @@
accordion: { accordion: {
type: Boolean, type: Boolean,
default: false default: false
},
background: {
type: String,
default: 'transparent'
} }
}, },
created() { created() {
...@@ -44,6 +48,5 @@ ...@@ -44,6 +48,5 @@
flex: 1; flex: 1;
/* #endif */ /* #endif */
flex-direction: column; flex-direction: column;
background: #fff;
} }
</style> </style>
/* /*
=========================================== ===========================================
当前组件库版本号为:V2.1.0 当前组件库版本号为:V2.3.0
如果与文档最新版本不一致,请更新至最新版本使用! 如果与文档最新版本不一致,请更新至最新版本使用!
=========================================== ===========================================
*/ */
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
/* /*
组件属性全局配置文件。优先级:全局配置文件props < 直接设置组件props 组件属性全局配置文件。优先级:全局配置文件props < 直接设置组件props
目前支持配置的组件:fui-button、fui-icon、fui-text、fui-input、fui-form-item、fui-list-cell 目前支持配置的组件:fui-button、fui-icon、fui-text、fui-input、fui-form-item、fui-list-cell
fui-section、fui-white-space、fui-wing-blank fui-section、fui-white-space、fui-wing-blank、fui-number
*/ */
// 主色(V1.9.8+),仅Nvue端以及无法使用css变量控制颜色的组件使用【保持与fui-theme中一致】 // 主色(V1.9.8+),仅Nvue端以及无法使用css变量控制颜色的组件使用【保持与fui-theme中一致】
...@@ -86,13 +86,18 @@ const fuiConfig = { ...@@ -86,13 +86,18 @@ const fuiConfig = {
//仅Nvue有效,black 默认颜色,V1.9.8+ //仅Nvue有效,black 默认颜色,V1.9.8+
color: '' color: ''
}, },
//v2.3.0+
fuiNumber: {
size: 32,
unit: 'rpx'
},
fuiInput: { fuiInput: {
labelSize: 32, labelSize: 32,
size: 32 size: 32
}, },
fuiFormItem: { fuiFormItem: {
labelSize: 32, labelSize: 32,
labelWidth: 170, labelWidth: 164,
labelRight: 30, labelRight: 30,
labelWeight: 400, labelWeight: 400,
labelAlign: 'left', labelAlign: 'left',
......
...@@ -5,19 +5,19 @@ ...@@ -5,19 +5,19 @@
v-if="isDays">{{ d }}</text> v-if="isDays">{{ d }}</text>
<text class="fui-count__down-colon" <text class="fui-count__down-colon"
:style="{ lineHeight: colonSize + 'rpx', fontSize: colonSize + 'rpx', color: colonColor }" :style="{ lineHeight: colonSize + 'rpx', fontSize: colonSize + 'rpx', color: colonColor }"
v-if="isDays">{{ isColon ? ':' : '天' }}</text> v-if="isDays">{{ isColon ? ':' : unitEn?'d':'天' }}</text>
<text class="fui-count__down-item" <text class="fui-count__down-item"
:style="{ background: background, borderColor: borderColor, width: getWidth(h, width) + 'rpx', height: height + 'rpx',fontSize: size + 'rpx', color: color }" :style="{ background: background, borderColor: borderColor, width: getWidth(h, width) + 'rpx', height: height + 'rpx',fontSize: size + 'rpx', color: color }"
v-if="isHours">{{ h }}</text> v-if="isHours">{{ h }}</text>
<text class="fui-count__down-colon" <text class="fui-count__down-colon"
:style="{ lineHeight: colonSize + 'rpx', fontSize: colonSize + 'rpx', color: colonColor }" :style="{ lineHeight: colonSize + 'rpx', fontSize: colonSize + 'rpx', color: colonColor }"
v-if="isHours">{{ isColon ? ':' : '时' }}</text> v-if="isHours">{{ isColon ? ':' : unitEn?'h':'时' }}</text>
<text class="fui-count__down-item" <text class="fui-count__down-item"
:style="{ background: background, borderColor: borderColor, width: getWidth(i, width) + 'rpx', height: height + 'rpx',fontSize: size + 'rpx', color: color }" :style="{ background: background, borderColor: borderColor, width: getWidth(i, width) + 'rpx', height: height + 'rpx',fontSize: size + 'rpx', color: color }"
v-if="isMinutes">{{ i }}</text> v-if="isMinutes">{{ i }}</text>
<text class="fui-count__down-colon" <text class="fui-count__down-colon"
:style="{ lineHeight: colonSize + 'rpx', fontSize: colonSize + 'rpx', color: colonColor }" :style="{ lineHeight: colonSize + 'rpx', fontSize: colonSize + 'rpx', color: colonColor }"
v-if="isMinutes">{{ isColon ? ':' : '分' }}</text> v-if="isMinutes">{{ isColon ? ':' : unitEn?'m':'分' }}</text>
<text class="fui-count__down-item" <text class="fui-count__down-item"
:style="{ background: background, borderColor: borderColor, width: getWidth(s, width) + 'rpx', height: height + 'rpx',fontSize: size + 'rpx', color: color }" :style="{ background: background, borderColor: borderColor, width: getWidth(s, width) + 'rpx', height: height + 'rpx',fontSize: size + 'rpx', color: color }"
v-if="isSeconds">{{ s }}</text> v-if="isSeconds">{{ s }}</text>
......
/*!
* common v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
/* ipx 底部安全区域 */
.fs-safe__area{
/* #ifdef APP-NVUE || MP-TOUTIAO */
padding-bottom: 34px;
/* #endif */
/* #ifndef APP-NVUE || MP-TOUTIAO */
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
/* #endif */
}
/* hover */
.fs-hover,
.fs-text__hover{
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.fs-hover:active{
background: $fv-bg-color-hover;
}
.fs-text__hover:active{
opacity: .5;
}
.fs-full{
/* #ifndef APP-NVUE */
width: 100%;
/* #endif */
/* #ifdef APP-NVUE */
width: 750rpx;
/* #endif */
}
.fs-disabled{
opacity: $fv-opacity-disabled;
/* #ifdef H5 */
cursor: not-allowed;
/* #endif */
}
/* thin 细边线 0.5px*/
.fs-cell__thin{
position: relative;
/* #ifdef APP-NVUE */
border-bottom: 0.5px solid $fv-color-border;
/* #endif */
}
/* #ifndef APP-NVUE */
.fs-cell__thin::after{
content: ' ';
position: absolute;
border-bottom: 1px solid $fv-color-border;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
bottom: 0;
left: 32rpx;
right: 0;
z-index: 1;
pointer-events: none;
}
/* #endif */
\ No newline at end of file
/*!
* firstui style v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
@import './variables/index.scss';
/* common */
@import './base/common.scss';
/* color */
@import './widget/color.scss';
/* font-size */
@import './widget/size.scss';
/* font-weight */
@import './widget/weight.scss';
/* align */
@import './widget/align.scss';
/* margin */
@import './widget/margin.scss';
/* padding */
@import './widget/padding.scss';
/* border */
@import './widget/border.scss';
/* border-radius */
@import './widget/radius.scss';
/* position */
@import './widget/position.scss';
/* flexbox */
@import './widget/flexbox.scss';
/* hide */
@import './widget/hide.scss';
\ No newline at end of file
/* fui-variables */
/* 行为相关颜色 */
$fv-color-primary: #465CFF !default;
$fv-color-success: #09BE4F !default;
$fv-color-warning: #FFB703 !default;
$fv-color-danger: #FF2B2B !default;
$fv-color-purple: #6831FF !default;
/* 文字基本颜色、其他辅助色 */
/* 用于重量级文字信息、标题 */
$fv-color-title: #181818 !default;
/* 用于普通级段落信息、引导词 */
$fv-color-section: #333333 !default;
/* 用于次要标题内容 */
$fv-color-subtitle: #7F7F7F !default;
/* 用于底部标签、描述、次要文字信息 */
$fv-color-label: #B2B2B2 !default;
/* 用于辅助、次要信息、禁用文字等。如:待输入状态描述文字,已点击按钮文字 */
$fv-color-minor: #CCCCCC !default;
$fv-color-white: #FFFFFF !default;
/* 链接颜色 */
$fv-color-link: #465CFF !default;
/* 背景颜色 */
$fv-bg-color: #ffffff !default;
/* 页面背景底色 */
$fv-bg-color-grey: #F1F4FA !default;
/* 内容模块底色 */
$fv-bg-color-content: #F8F8F8 !default;
/* 点击背景色 */
$fv-bg-color-hover: rgba(0, 0, 0, 0.2) !default;
/* 遮罩颜色 */
$fv-bg-color-mask: rgba(0, 0, 0, 0.6) !default;
/* 边框颜色 */
$fv-color-border: #EEEEEE !default;
/* 阴影颜色 */
$fv-color-shadow: rgba(2, 4, 38, 0.05) !default;
/*禁用态的透明度 */
$fv-opacity-disabled: 0.5 !default;
/* icon尺寸 */
$fv-icon-size: 64rpx !default;
/* Border Radius */
$fv-border-radius-sm: 16rpx !default;
$fv-border-radius-base: 24rpx !default;
$fv-border-radius-lg: 48rpx !default;
/* 水平间距 */
$fv-spacing-row-sm: 16rpx !default;
$fv-spacing-row-base: 24rpx !default;
$fv-spacing-row-lg: 32rpx !default;
/* 垂直间距 */
$fv-spacing-col-sm: 8rpx !default;
$fv-spacing-col-base: 16rpx !default;
$fv-spacing-col-lg: 24rpx !default;
/* 边框宽度 */
$fv-border-width:1px !default;
\ No newline at end of file
/*!
* text-align v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
.fs-align__left{
text-align: left;
}
.fs-align__center{
text-align: center;
}
.fs-align__right{
text-align: right;
}
/* #ifndef APP-NVUE */
.fs-align__justify{
text-align: justify;
}
.fs-align__start{
text-align: start;
}
.fs-align__end{
text-align: end;
}
/* #endif */
\ No newline at end of file
/*!
* border v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
.fs-border {
border-style: solid;
border-width: $fv-border-width;
}
.fs-border__none { border-width: 0 }
.fs-border__top {
border-top-style: solid;
border-top-width: $fv-border-width;
}
.fs-border__right {
border-right-style: solid;
border-right-width: $fv-border-width;
}
.fs-border__bottom {
border-bottom-style: solid;
border-bottom-width: $fv-border-width;
}
.fs-border__left {
border-left-style: solid;
border-left-width: $fv-border-width;
}
\ No newline at end of file
/*!
* color v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
/* color */
.fs-color__primary {
color: $fv-color-primary;
}
.fs-color__success {
color: $fv-color-success;
}
.fs-color__warning {
color: $fv-color-warning;
}
.fs-color__danger {
color: $fv-color-danger;
}
.fs-color__purple {
color: $fv-color-purple;
}
/* 用于重量级文字信息、标题 */
.fs-color__title {
color: $fv-color-title;
}
/* 用于普通级段落信息、引导词 */
.fs-color__section{
color: $fv-color-section;
}
/* 用于次要标题内容 */
.fs-color__subtitle{
color: $fv-color-subtitle
}
/* 用于底部标签、描述、次要文字信息 */
.fs-color__label{
color: $fv-color-label;
}
/* 用于辅助、次要信息、禁用文字等。如:待输入状态描述文字,已点击按钮文字 */
.fs-color__minor{
color: $fv-color-minor;
}
.fs-color__white{
color: $fv-color-white;
}
/* 链接颜色 */
.fs-color__link{
color: $fv-color-link;
}
/* bgckground-color */
.fs-bg__primary {
background: $fv-color-primary;
}
.fs-bg__success {
background: $fv-color-success;
}
.fs-bg__warning {
background: $fv-color-warning;
}
.fs-bg__danger {
background: $fv-color-danger;
}
.fs-bg__purple {
background: $fv-color-purple;
}
.fs-bg__white{
background: $fv-color-white;
}
/* 页面背景底色 */
.fs-bg__page{
background:$fv-bg-color-grey;
}
/* 内容模块底色 */
.fs-bg__content{
background:$fv-bg-color-content;
}
/* 点击背景颜色 */
.fs-bg__hover{
background:$fv-bg-color-hover;
}
/* 遮罩背景颜色 */
.fs-bg__mask{
background:$fv-bg-color-mask;
}
\ No newline at end of file
/*!
* flexbox v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
.fs-flex,
.fs-flex__row {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
}
.fs-flex__column {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
}
.fs-flex__wrap { flex-wrap: wrap }
.fs-items__start { align-items: flex-start }
.fs-items__end { align-items: flex-end }
.fs-items__center { align-items: center }
/* #ifndef APP-NVUE */
.fs-items__baseline { align-items: baseline }
/* #endif */
.fs-items__stretch { align-items: stretch }
/* #ifndef APP-NVUE */
.fs-self__start { align-self: flex-start }
.fs-self__end { align-self: flex-end }
.fs-self__center { align-self: center }
.fs-self__baseline { align-self: baseline }
.fs-self__stretch { align-self: stretch }
/* #endif */
.fs-justify__start { justify-content: flex-start }
.fs-justify__end { justify-content: flex-end }
.fs-justify__center { justify-content: center }
.fs-justify__between { justify-content: space-between }
.fs-justify__around { justify-content: space-around }
/* #ifndef APP-NVUE */
.fs-justify__evenly { justify-content: space-evenly }
/* #endif */
/* #ifndef APP-NVUE */
.fs-content__start { align-content: flex-start }
.fs-content__end { align-content: flex-end }
.fs-content__center { align-content: center }
.fs-content__between { align-content: space-between }
.fs-content__around { align-content: space-around }
.fs-content__stretch { align-content: stretch }
/* #endif */
/* #ifndef APP-NVUE */
.fs-order__0 { order: 0 }
.fs-order__1 { order: 1 }
.fs-order__2 { order: 2 }
.fs-order__3 { order: 3 }
.fs-order__last { order: 99999 }
/* #endif */
.fs-flex__center{
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
}
.fs-flex__between {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.fs-align__center {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
align-items: center;
flex-direction: row;
}
.fs-flex__reverse {
flex-direction: row-reverse;
}
.fs-flex__1,
.fs-flex1{
flex: 1;
}
\ No newline at end of file
/*!
* hide v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
.fs-hide{
position: absolute;
left: -6666px;
top: -6666px;
opacity: 0;
/* #ifndef APP-NVUE */
visibility: hidden;
z-index: -1;
/* #endif */
overflow: hidden;
}
/* #ifndef APP-NVUE */
.fs-display__none {
display: none !important
}
/* #endif */
.fs-ellipsis{
/* #ifndef APP-NVUE */
white-space: nowrap;
/* #endif */
overflow: hidden;
text-overflow: ellipsis;
/* #ifdef APP-NVUE */
lines:1;
/* #endif */
}
.fs-ellipsis__2{
/* #ifndef APP-NVUE */
word-break: break-all;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/* #endif */
overflow: hidden;
text-overflow: ellipsis;
/* #ifdef APP-NVUE */
lines:2;
/* #endif */
}
\ No newline at end of file
/*!
* margin v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
$fv-margin:0,2,4,8,10,12,16,20,24,28,30,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96;
@each $m in $fv-margin{
.fs-m#{$m} { margin: #{$m}rpx;}
.fs-mt#{$m} { margin-top: #{$m}rpx;}
.fs-mr#{$m} { margin-right: #{$m}rpx; }
.fs-mb#{$m} { margin-bottom: #{$m}rpx; }
.fs-ml#{$m} { margin-left: #{$m}rpx; }
.fs-mx#{$m} { margin-left: #{$m}rpx; margin-right: #{$m}rpx; }
.fs-my#{$m} { margin-top:#{$m}rpx; margin-bottom: #{$m}rpx; }
}
/* #ifndef APP-NVUE */
.fs-ml__auto { margin-left: auto; }
.fs-mr__auto { margin-right: auto; }
/* #endif */
\ No newline at end of file
/*!
* padding v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
$fv-padding:0,2,4,8,10,12,16,20,24,28,30,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,120,160,200;
@each $p in $fv-padding{
.fs-p#{$p} { padding: #{$p}rpx;}
.fs-pt#{$p} { padding-top: #{$p}rpx;}
.fs-pr#{$p} { padding-right: #{$p}rpx; }
.fs-pb#{$p} { padding-bottom: #{$p}rpx; }
.fs-pl#{$p} { padding-left: #{$p}rpx; }
.fs-px#{$p} { padding-left: #{$p}rpx; padding-right: #{$p}rpx; }
.fs-py#{$p} { padding-top:#{$p}rpx; padding-bottom: #{$p}rpx; }
}
/*!
* position v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
.fs-relative { position: relative }
.fs-absolute { position: absolute }
.fs-fixed { position: fixed }
.fs-sticky { position: sticky }
.fs-top0 { top: 0 }
.fs-right0 { right: 0 }
.fs-bottom0 { bottom: 0 }
.fs-left0 { left: 0 }
/* z-index */
@for $i from 1 through 9 {
.fs-z#{$i} { z-index: #{$i} }
}
\ No newline at end of file
/*!
* border-radius v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
$fv_radius:4,8,12,16,24,30,48,200;
@each $r in $fv_radius{
.fs-radius__#{$r} {
border-radius: #{$r}rpx;
overflow: hidden;
}
}
.fs-radius__sm{
border-radius: $fv-border-radius-sm;
overflow: hidden;
}
.fs-radius__base,
.fs-radius__md{
border-radius: $fv-border-radius-base;
overflow: hidden;
}
.fs-radius__lg{
border-radius: $fv-border-radius-lg;
overflow: hidden;
}
.fs-radius__circle{
/* #ifndef APP-NVUE */
border-radius: 50%;
/* #endif */
/* #ifdef APP-NVUE */
border-radius: 200px;
/* #endif */
overflow: hidden;
}
\ No newline at end of file
/*!
* font-size v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
/* 常用字体大小 单位rpx*/
.fs-size__h1 {
font-size: 44rpx;
font-weight: 500;
}
.fs-size__h2 {
font-size: 36rpx;
font-weight: 500;
}
.fs-size__h3 {
font-size: 32rpx;
font-weight: 400;
}
.fs-size__h4{
font-size: 28rpx;
font-weight: 400;
}
.fs-size__h5,
.fs-size__h6 {
font-size: 24rpx;
font-weight: 400;
}
/* 自定义字体大小 24~64 单位rpx*/
@for $i from 24 through 64 {
.fs-size__#{$i}{
font-size: #{$i}rpx;
}
}
\ No newline at end of file
/*!
* font-weight v1.0.0 (https://doc.firstui.cn)
* Copyright 2024 FirstUI.
* Licensed under the Apache license
*/
.fs-weight__400,
.fs-weight__normal{
font-weight: 400;
}
.fs-weight__500{
font-weight: 500;
}
.fs-weight__600{
font-weight: 600;
}
.fs-bold,
.fs-weight__bold,
.fs-weight__700,
.fs-weight__800,
.fs-weight__900{
font-weight: bold;
}
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="fui-data__tag-wrap" :class="[nowrap?'fui-data__tag-nowrap':'fui-data__tag-flexwrap']" <view class="fui-data__tag-wrap" :class="[nowrap?'fui-data__tag-nowrap':'fui-data__tag-flexwrap']"
:style="{marginBottom:'-'+gap+'rpx'}"> :style="{marginBottom:'-'+gap+'rpx'}">
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE -->
<view class="fui-data__tag-item" :class="{'fui-data__tag-disable':item.disable}" <view class="fui-data__tag-item" :class="{'fui-data__tag-disable':item[disableKey]}"
:style="{width:width?width+'rpx':'auto',height:height?height+'rpx':'auto',paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,borderRadius:radius+'rpx',marginRight:gap+'rpx',marginBottom:gap+'rpx',background:item.selected?activeBgColor:background,borderColor:item.selected?(borderColor || primaryColor):(defaultBorderColor || background)}" :style="{width:width?width+'rpx':'auto',height:height?height+'rpx':'auto',paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,borderRadius:radius+'rpx',marginRight:gap+'rpx',marginBottom:gap+'rpx',background:item.selected?activeBgColor:background,borderColor:item.selected?(borderColor || primaryColor):(defaultBorderColor || background)}"
v-for="(item,index) in dataList" :key="index"> v-for="(item,index) in dataList" :key="index">
<view class="fui-data__tag-inner" @tap.stop="handleClick(index)"> <view class="fui-data__tag-inner" @tap.stop="handleClick(index)">
...@@ -11,19 +11,19 @@ ...@@ -11,19 +11,19 @@
v-if="mark && item.selected">{{icon}}</text> v-if="mark && item.selected">{{icon}}</text>
</view> </view>
<text class="fui-data__tag-text" <text class="fui-data__tag-text"
:style="{fontSize:size+'rpx',color:item.selected?(activeColor || primaryColor):color}">{{item.text}}</text> :style="{fontSize:size+'rpx',color:item.selected?(activeColor || primaryColor):color}">{{item[textKey]}}</text>
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<view class="fui-data__tag-item" :class="{'fui-data__tag-disable':item.disable}" <view class="fui-data__tag-item" :class="{'fui-data__tag-disable':item[disableKey]}"
:style="{width:width?width+'rpx':'auto',height:height?height+'rpx':'auto',paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,borderRadius:radius+'rpx',marginRight:gap+'rpx',marginBottom:gap+'rpx',background:item.selected?activeBgColor:background,borderColor:item.selected?(borderColor || primaryColor):defaultBorderColor || background}" :style="{width:width?width+'rpx':'auto',height:height?height+'rpx':'auto',paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,borderRadius:radius+'rpx',marginRight:gap+'rpx',marginBottom:gap+'rpx',background:item.selected?activeBgColor:background,borderColor:item.selected?(borderColor || primaryColor):defaultBorderColor || background}"
v-for="(item,index) in dataList" :key="index" @tap.stop="handleClick(index)"> v-for="(item,index) in dataList" :key="index" @tap.stop="handleClick(index)">
<text class="fui-dt__icon" <text class="fui-dt__icon"
:style="{color:markColor || primaryColor,fontSize:markSize+'rpx',lineHeight:markSize+'rpx'}" :style="{color:markColor || primaryColor,fontSize:markSize+'rpx',lineHeight:markSize+'rpx'}"
v-if="mark && item.selected">{{icon}}</text> v-if="mark && item.selected">{{icon}}</text>
<text class="fui-data__tag-text" <text class="fui-data__tag-text"
:style="{fontSize:size+'rpx',lineHeight:size+'rpx',color:item.selected?(activeColor || primaryColor):color}">{{item.text}}</text> :style="{fontSize:size+'rpx',lineHeight:size+'rpx',color:item.selected?(activeColor || primaryColor):color}">{{item[textKey]}}</text>
</view> </view>
<!-- #endif --> <!-- #endif -->
</view> </view>
...@@ -47,6 +47,22 @@ ...@@ -47,6 +47,22 @@
return [] return []
} }
}, },
textKey: {
type: String,
default: 'text'
},
valueKey: {
type: String,
default: 'value'
},
isAllKey: {
type: String,
default: 'isAll'
},
disableKey: {
type: String,
default: 'disable'
},
// #ifdef VUE3 // #ifdef VUE3
modelValue: { modelValue: {
type: [Array, String, Number], type: [Array, String, Number],
...@@ -187,16 +203,16 @@ ...@@ -187,16 +203,16 @@
if (typeof vals[0] !== 'object') { if (typeof vals[0] !== 'object') {
vals = vals.map((item, index) => { vals = vals.map((item, index) => {
return { return {
text: item, [this.textKey]: item,
value: item, [this.valueKey]: item,
selected: false selected: false
} }
}) })
} else { } else {
vals.map((item, index) => { vals.map((item, index) => {
item.selected = false item.selected = item.selected || false;
if (item.value === undefined) { if (item[this.valueKey] === undefined) {
item.value = item.text item[this.valueKey] = item[this.textKey]
} }
}) })
} }
...@@ -219,14 +235,14 @@ ...@@ -219,14 +235,14 @@
}, },
radioChange(index, model) { radioChange(index, model) {
const min = Number(this.min) const min = Number(this.min)
if (this.val === model.value && min > 0) return; if (this.val === model[this.valueKey] && min > 0) return;
let val = ''; let val = '';
let i = index; let i = index;
let entity = {} let entity = {}
this.dataList.forEach((item, idx) => { this.dataList.forEach((item, idx) => {
if (idx === index) { if (idx === index) {
const bool = this.val === item.value && min <= 0 const bool = this.val === item[this.valueKey] && min <= 0
val = bool ? '' : item.value val = bool ? '' : item[this.valueKey]
i = bool ? -1 : index i = bool ? -1 : index
entity = bool ? {} : item entity = bool ? {} : item
item.selected = bool ? false : true item.selected = bool ? false : true
...@@ -254,18 +270,18 @@ ...@@ -254,18 +270,18 @@
const min = Number(this.multipleMin) const min = Number(this.multipleMin)
const max = Number(this.max) const max = Number(this.max)
let vals = this.vals let vals = this.vals
let i = vals.indexOf(model.value) let i = vals.indexOf(model[this.valueKey])
if (vals.length <= min && i !== -1) { if (vals.length <= min && i !== -1) {
this.toast(`至少选择${min}个选项`) this.toast(`至少选择${min}个选项`)
return return
} }
const isAllIndex = this.dataList.findIndex(item => item.isAll) const isAllIndex = this.dataList.findIndex(item => item[this.isAllKey])
let item = this.dataList[index] let item = this.dataList[index]
if (isAllIndex !== -1) { if (isAllIndex !== -1) {
if (model.isAll) { if (model[this.isAllKey]) {
item.selected = i !== -1 ? false : true item.selected = i !== -1 ? false : true
if (item.selected) { if (item.selected) {
vals = [model.value] vals = [model[this.valueKey]]
} else { } else {
vals.splice(i, 1) vals.splice(i, 1)
} }
...@@ -280,7 +296,7 @@ ...@@ -280,7 +296,7 @@
return return
} }
let entity = this.dataList[isAllIndex] let entity = this.dataList[isAllIndex]
const allI = vals.indexOf(entity.value) const allI = vals.indexOf(entity[this.valueKey])
if (allI !== -1) { if (allI !== -1) {
entity.selected = false; entity.selected = false;
vals.splice(allI, 1) vals.splice(allI, 1)
...@@ -289,7 +305,7 @@ ...@@ -289,7 +305,7 @@
if (index === idx) { if (index === idx) {
item.selected = i !== -1 ? false : true item.selected = i !== -1 ? false : true
if (item.selected) { if (item.selected) {
vals.push(item.value) vals.push(item[this.valueKey])
} else { } else {
vals.splice(i, 1) vals.splice(i, 1)
} }
...@@ -303,13 +319,13 @@ ...@@ -303,13 +319,13 @@
} }
item.selected = i !== -1 ? false : true item.selected = i !== -1 ? false : true
if (item.selected) { if (item.selected) {
vals.push(item.value) vals.push(item[this.valueKey])
} else { } else {
vals.splice(i, 1) vals.splice(i, 1)
} }
} }
this.vals = vals this.vals = vals
const entity = this.dataList.filter(item => vals.indexOf(item.value) != -1) const entity = this.dataList.filter(item => vals.indexOf(item[this.valueKey]) != -1)
let e = { let e = {
detail: { detail: {
value: vals, value: vals,
...@@ -321,7 +337,7 @@ ...@@ -321,7 +337,7 @@
modelChange(vals) { modelChange(vals) {
if (this.multiple) { if (this.multiple) {
this.dataList.forEach(item => { this.dataList.forEach(item => {
if (vals.includes(item.value)) { if (vals.includes(item[this.valueKey])) {
item.selected = true; item.selected = true;
} else { } else {
item.selected = false item.selected = false
...@@ -331,7 +347,7 @@ ...@@ -331,7 +347,7 @@
} else { } else {
this.dataList.forEach(item => { this.dataList.forEach(item => {
if (vals == item.value) { if (vals == item[this.valueKey]) {
item.selected = true; item.selected = true;
} else { } else {
item.selected = false item.selected = false
...@@ -342,7 +358,7 @@ ...@@ -342,7 +358,7 @@
}, },
handleClick(index) { handleClick(index) {
let item = this.dataList[index] let item = this.dataList[index]
if (item.disable) return; if (item[this.disableKey]) return;
if (this.multiple) { if (this.multiple) {
this.checkboxChange(index, item) this.checkboxChange(index, item)
} else { } else {
......
<template> <template>
<view @tap="maskClose" :style="{background:maskBackground}" class="fui-dialog__wrap" <view @tap="maskClose" :style="{background:maskBackground}" class="fui-dialog__wrap"
:class="{'fui-wrap__show':show}" @touchmove.stop.prevent="stop" v-if="visible || !isNvue" ref="fui_dialog_ani"> :class="{'fui-wrap__show':show}" v-if="visible || !isNvue" ref="fui_dialog_ani">
<!-- @touchmove.stop.prevent="stop" -->
<view class="fui-dialog__inner" :style="{background:background,borderRadius:radius+'rpx'}" @tap.stop="stop"> <view class="fui-dialog__inner" :style="{background:background,borderRadius:radius+'rpx'}" @tap.stop="stop">
<text class="fui-dialog__title" :style="{color:color}" v-if="title">{{title}}</text> <text class="fui-dialog__title" :style="{color:color}" v-if="title">{{title}}</text>
<view class="fui-dialog__body" :class="{'fui-dialog__mtop':!title}"> <view class="fui-dialog__body" :class="{'fui-dialog__mtop':!title}">
...@@ -31,7 +32,7 @@ ...@@ -31,7 +32,7 @@
}, },
title: { title: {
type: String, type: String,
default: '温馨提示' default: '提示'
}, },
color: { color: {
type: String, type: String,
......
...@@ -205,11 +205,13 @@ ...@@ -205,11 +205,13 @@
//34px //34px
const res = uni.getSystemInfoSync(); const res = uni.getSystemInfoSync();
let iphonex = false; let iphonex = false;
let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax', let models = ['iphonex', 'iphonexr', 'iphonexsmax']
'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini', for (let i = 11; i < 20; i++) {
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini', models.push(`iphone${i}`)
'iphone14pro', 'iphone14promax' models.push(`iphone${i}mini`)
] models.push(`iphone${i}pro`)
models.push(`iphone${i}promax`)
}
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]
if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
}, },
methods: { methods: {
initHeight(val) { initHeight(val) {
let height = Math.floor(uni.upx2px(val || 0)) let height = Math.floor(uni.upx2px(Number(val) || 0))
height = height % 2 === 0 ? height : height + 1 height = height % 2 === 0 ? height : height + 1
this.rollHeight = height this.rollHeight = height
}, },
...@@ -146,6 +146,9 @@ ...@@ -146,6 +146,9 @@
.fui-digital__roller { .fui-digital__roller {
overflow: hidden; overflow: hidden;
/* #ifndef APP-NVUE */
transform: translateZ(0);
/* #endif */
} }
.fui-digital__roller-column { .fui-digital__roller-column {
......
<template> <template>
<view class="fui-divider__wrap" :style="{ height: height + 'rpx' }"> <view class="fui-divider__wrap" :style="{ height: height + 'rpx' }">
<view class="fui-divider__line" :style="{ width: width, background: dividerColor,top:getTop}"> <view class="fui-divider__wrap" :style="{width:width, height: height + 'rpx' }">
</view> <view class="fui-divider__line" :style="{ background: dividerColor}">
<view class="fui-divider__text-box" :style="{backgroundColor: backgroundColor}"> </view>
<slot></slot> <view class="fui-divider__text-box">
<text class="fui-divider__text" <slot></slot>
:style="{fontWeight: fontWeight,color: color, fontSize: size + 'rpx',lineHeight: size + 'rpx'}" <text class="fui-divider__text"
v-if="text">{{text}}</text> :style="{fontWeight: fontWeight,color: color, fontSize: size + 'rpx',lineHeight: size + 'rpx'}"
v-if="text">{{text}}</text>
</view>
<view class="fui-divider__line" :style="{ background: dividerColor}">
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -47,16 +51,6 @@ ...@@ -47,16 +51,6 @@
fontWeight: { fontWeight: {
type: [Number, String], type: [Number, String],
default: 400 default: 400
},
//背景颜色,和当前页面背景色保持一致
backgroundColor: {
type: String,
default: '#F1F4FA'
}
},
computed: {
getTop() {
return Number(this.height) / 2 + 'rpx'
} }
} }
}; };
...@@ -69,7 +63,6 @@ ...@@ -69,7 +63,6 @@
display: flex; display: flex;
box-sizing: border-box; box-sizing: border-box;
/* #endif */ /* #endif */
position: relative;
text-align: center; text-align: center;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
...@@ -78,27 +71,26 @@ ...@@ -78,27 +71,26 @@
} }
.fui-divider__line { .fui-divider__line {
position: absolute;
/* #ifdef APP-NVUE */ /* #ifdef APP-NVUE */
height: 0.5px; height: 0.5px;
/* #endif */ /* #endif */
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
height: 1px; height: 1px;
top: 50%; -webkit-transform: scaleY(0.5) translateZ(0);
left: 50%; transform: scaleY(0.5) translateZ(0);
-webkit-transform: scaleY(0.5) translate3d(-50%, -50%, 0);
transform: scaleY(0.5) translate3d(-50%, -50%, 0);
/* #endif */ /* #endif */
flex: 1;
} }
.fui-divider__text-box { .fui-divider__text-box {
position: relative; position: relative;
text-align: center; text-align: center;
padding: 0 6rpx; padding: 0 8rpx;
z-index: 1; z-index: 1;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
flex-shrink: 0;
/* #endif */ /* #endif */
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
...@@ -106,6 +98,6 @@ ...@@ -106,6 +98,6 @@
} }
.fui-divider__text { .fui-divider__text {
padding: 0 12rpx; padding: 0 10rpx;
} }
</style> </style>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<text class="fui-drag__item-text" :style="{color:color,fontSize:size+'rpx'}" <text class="fui-drag__item-text" :style="{color:color,fontSize:size+'rpx'}"
v-if="text!='' && text!==true && type==2">{{text}}</text> v-if="text!='' && text!==true && type==2">{{text}}</text>
</view> </view>
<fui-icon v-if="type==2" name="menu" :size="48" :color="slideColor"></fui-icon> <fui-icon v-if="type==2 && isMenu" name="menu" :size="48" :color="slideColor"></fui-icon>
</view> </view>
</view> </view>
</template> </template>
...@@ -58,6 +58,10 @@ ...@@ -58,6 +58,10 @@
default () { default () {
return {} return {}
} }
},
isMenu: {
type: Boolean,
default: true
} }
}, },
data() { data() {
......
...@@ -3,70 +3,70 @@ ...@@ -3,70 +3,70 @@
<view class="fui-drag__wrap" ref="fui_drag" :id="elId" <view class="fui-drag__wrap" ref="fui_drag" :id="elId"
:style="{width:wrapWidth+'px',height:(rows * cellHeight)+'px'}" :style="{width:wrapWidth+'px',height:(rows * cellHeight)+'px'}"
:class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']"> :class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']">
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-VUE || MP-WEIXIN || H5 --> <!-- #ifdef APP-VUE || MP-WEIXIN || H5 -->
<!-- vue3下编译到小程序data数据与wxs混用中无法获取 $data数据无法直接应用到页面,uni-app官方编译bug--> <!-- vue3下编译到小程序data数据与wxs混用中无法获取 $data数据无法直接应用到页面,uni-app官方编译bug-->
<view class="fui-drag__wrap" :catch:touchmove="wxDrag?true:''" <view class="fui-drag__wrap" :catch:touchmove="wxDrag?true:''"
:class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']" ref="fui_drag" :id="elId" :class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']" ref="fui_drag" :id="elId"
:style="{width:wrapWidth+'px',height:(rows * cellHeight)+'px'}" :list="list" :style="{width:wrapWidth+'px',height:(rows * cellHeight)+'px'}" :list="list"
:change:list="handler.listChange" :param="param" :change:param="handler.paramChange"> :change:list="handler.listChange" :param="param" :change:param="handler.paramChange">
<view class="fui-drag-item__wrap" :style="{width:cellWidth+'px',height:cellHeight+'px'}" <view class="fui-drag-item__wrap" :style="{width:cellWidth+'px',height:cellHeight+'px'}"
v-for="(item, index) in list" :key="item.id" :data-index="index" @longpress="handler.longPress" v-for="(item, index) in list" :key="item.id" :data-index="index" @longpress="handler.longPress"
:data-param="param" :data-isdrag="isDrag && dragging?1:0" @touchstart="handler.touchStart" :data-param="param" :data-isdrag="isDrag && dragging?1:0" :data-app="isApp" @touchstart="handler.touchStart"
@touchmove="handler.touchMove" @touchend="handler.touchEnd" @mousedown="handler.mousedown" @touchmove="handler.touchMove" @touchend="handler.touchEnd" @mousedown="handler.mousedown"
@tap="itemClick(index)"> @tap="itemClick(index)">
<template v-if="custom"> <template v-if="custom">
<slot :model="item.entity" :width="cellWidth" :height="cellHeight" :index="index"></slot> <slot :model="item.entity" :width="cellWidth" :height="cellHeight" :index="index"></slot>
</template> </template>
<template v-else> <template v-else>
<f-drag-item @delete="deleteItem" :src="(item.entity && item.entity.src) || 'true'" <f-drag-item @delete="deleteItem" :src="(item.entity && item.entity[srcKey]) || 'true'"
:text="item.entity && item.entity.text" :width="cellWidth" :height="cellHeight" :text="item.entity && item.entity[textKey]" :width="cellWidth" :height="cellHeight" :isMenu="isMenu"
:styles="styles" :index="index"> :styles="styles" :index="index">
</f-drag-item> </f-drag-item>
</template> </template>
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<view fireEventSync="true" class="fui-drag-item__wrap" v-for="(item, index) in list" :key="item.id" <view fireEventSync="true" class="fui-drag-item__wrap" v-for="(item, index) in list" :key="item.id"
:style="{width:cellWidth+'px',height:cellHeight+'px'}" @touchstart="touchstart" :style="{width:cellWidth+'px',height:cellHeight+'px'}" @touchstart="touchstart" @touchmove="touchmove"
@touchmove="touchmove" @touchend="touchend" @longpress="longPress" :data-index="index" @touchend="touchend" @longpress="longPress" :data-index="index" :ref="'f_drag_'+index">
:ref="'f_drag_'+index"> <template v-if="custom">
<template v-if="custom"> <slot :model="item.entity" :width="cellWidth" :height="cellHeight" :index="index"></slot>
<slot :model="item.entity" :width="cellWidth" :height="cellHeight" :index="index"></slot> </template>
</template> <template v-else>
<template v-else> <f-drag-item @delete="deleteItem" :src="item.entity && item.entity[srcKey]"
<f-drag-item @delete="deleteItem" :src="item.entity && item.entity.src" :text="item.entity && item.entity[textKey]" :width="cellWidth" :height="cellHeight" :isMenu="isMenu"
:text="item.entity && item.entity.text" :width="cellWidth" :height="cellHeight" :styles="styles" :index="index">
:styles="styles" :index="index"> </f-drag-item>
</f-drag-item> </template>
</template> </view>
</view> <!-- #endif -->
<!-- #endif -->
<!-- #ifndef APP-PLUS || MP-WEIXIN || H5--> <!-- #ifndef APP-PLUS || MP-WEIXIN || H5-->
<view class="fui-drag-item__wrap" <view class="fui-drag-item__wrap"
:class="{'fui-drag__cur':current===index,'fui-drag__trans':current!==index}" :class="{'fui-drag__cur':current===index,'fui-drag__trans':current!==index}"
v-for="(item, index) in list" :key="item.id" v-for="(item, index) in list" :key="item.id"
:style="{width:cellWidth+'px',height:cellHeight+'px',transform: `translate3d(${index === current ? transX : item.transX}, ${index === current ? transY: item.transY}, 0px)`}" :style="{width:cellWidth+'px',height:cellHeight+'px',transform: `translate3d(${index === current ? transX : item.transX}, ${index === current ? transY: item.transY}, 0px)`}"
@touchstart="touchstart" @touchmove.stop.prevent="touchmove" @touchend="touchend" @touchstart="touchstart" @touchmove.stop.prevent="touchmove" @touchend="touchend" @longpress="longPress"
@longpress="longPress" :data-index="index"> :data-index="index">
<template v-if="custom"> <template v-if="custom">
<slot :model="item.entity" :width="cellWidth" :height="cellHeight" :index="index"></slot> <slot :model="item.entity" :width="cellWidth" :height="cellHeight" :index="index"></slot>
</template> </template>
<template v-else> <template v-else>
<f-drag-item @delete="deleteItem" :src="(item.entity && item.entity.src) || ''" <f-drag-item @delete="deleteItem" :src="(item.entity && item.entity[srcKey]) || ''"
:text="item.entity && item.entity.text" :width="cellWidth" :height="cellHeight" :text="item.entity && item.entity[textKey]" :width="cellWidth" :height="cellHeight" :styles="styles"
:styles="styles" :index="index"> :isMenu="isMenu" :index="index">
</f-drag-item> </f-drag-item>
</template> </template>
</view>
<!-- #endif -->
</view> </view>
<!-- #endif -->
</view>
</template> </template>
<!-- #ifdef APP-VUE || MP-WEIXIN || H5--> <!-- #ifdef APP-VUE || MP-WEIXIN || H5-->
<script src="./index.wxs" module="handler" lang="wxs"></script> <script src="./index.wxs" module="handler" lang="wxs"></script>
<!-- #endif --> <!-- #endif -->
<script> <script>
// #ifdef APP-NVUE // #ifdef APP-NVUE
const dom = uni.requireNativePlugin('dom'); const dom = uni.requireNativePlugin('dom');
...@@ -88,6 +88,14 @@ ...@@ -88,6 +88,14 @@
return []; return [];
} }
}, },
textKey: {
type: String,
default: 'text'
},
srcKey: {
type: String,
default: 'src'
},
width: { width: {
type: [Number, String], type: [Number, String],
default: 0 default: 0
...@@ -113,6 +121,10 @@ ...@@ -113,6 +121,10 @@
return {} return {}
} }
}, },
isMenu: {
type: Boolean,
default: true
},
// 页面滚动高度 // 页面滚动高度
scrollTop: { scrollTop: {
type: Number, type: Number,
...@@ -150,7 +162,12 @@ ...@@ -150,7 +162,12 @@
}, },
data() { data() {
const elId = `fui_${Math.ceil(Math.random() * 10e5).toString(36)}` const elId = `fui_${Math.ceil(Math.random() * 10e5).toString(36)}`
let isApp = 0;
// #ifdef APP
isApp = 1;
// #endif
return { return {
isApp,
elId, elId,
// #ifdef APP-VUE || MP-WEIXIN || H5 // #ifdef APP-VUE || MP-WEIXIN || H5
param: {}, param: {},
......
...@@ -87,6 +87,8 @@ function longPress(e, ownerInstance) { ...@@ -87,6 +87,8 @@ function longPress(e, ownerInstance) {
st.isDrag = +dataset.isdrag == 1 ? true : false st.isDrag = +dataset.isdrag == 1 ? true : false
if (!st.isDrag) return; if (!st.isDrag) return;
st.app = +dataset.app == 1 ? true : false;
if (!st.param || st.param == 'undefined') { if (!st.param || st.param == 'undefined') {
st.param = JSON.parse(dataset.param) st.param = JSON.parse(dataset.param)
} }
...@@ -101,11 +103,9 @@ function longPress(e, ownerInstance) { ...@@ -101,11 +103,9 @@ function longPress(e, ownerInstance) {
st.cur = +dataset.index; st.cur = +dataset.index;
if (st.dragging) return; if (st.dragging) return;
// #ifdef MP-WEIXIN
ownerInstance.callMethod("drag", { ownerInstance.callMethod("drag", {
wxdrag: true wxdrag: true
}); });
// #endif
st.transX = param.columns === 1 ? 0 : touch.pageX - (param.cellWidth / 2 + param.wrapLeft); st.transX = param.columns === 1 ? 0 : touch.pageX - (param.cellWidth / 2 + param.wrapLeft);
st.transY = touch.pageY - (param.cellHeight / 2 + param.wrapTop); st.transY = touch.pageY - (param.cellHeight / 2 + param.wrapTop);
st.sId = touch.identifier; st.sId = touch.identifier;
...@@ -133,21 +133,19 @@ function touchStart(e, ownerInstance) { ...@@ -133,21 +133,19 @@ function touchStart(e, ownerInstance) {
} }
var dataset = ins.getDataset() var dataset = ins.getDataset()
st.isDrag = +dataset.isdrag == 1 ? true : false st.isDrag = +dataset.isdrag == 1 ? true : false
// #ifdef MP-WEIXIN
ownerInstance.callMethod("drag", { ownerInstance.callMethod("drag", {
wxdrag: false wxdrag: false
}); });
// #endif
} }
function touchMove(e, ownerInstance, event) { function touchMove(e, ownerInstance, events) {
var st = {} var st = {}
var touch = null var touch = null
var ins = null var ins = null
if (isH5 && isPC()) { if (isH5 && isPC()) {
touch = e; touch = e;
st = event.instance.getState() st = events.instance.getState()
ins = event.instance; ins = events.instance;
} else { } else {
touch = e.changedTouches[0] || e.touches[0] touch = e.changedTouches[0] || e.touches[0]
st = e.instance.getState() st = e.instance.getState()
...@@ -156,6 +154,9 @@ function touchMove(e, ownerInstance, event) { ...@@ -156,6 +154,9 @@ function touchMove(e, ownerInstance, event) {
if (e.preventDefault && st.dragging) { if (e.preventDefault && st.dragging) {
e.preventDefault() e.preventDefault()
} }
if (st.app && st.dragging && event && event.preventDefault) {
event.preventDefault()
}
var param = st.param; var param = st.param;
if (!st.dragging || !st.isDrag) return; if (!st.dragging || !st.isDrag) return;
...@@ -225,11 +226,9 @@ function touchEnd(e, ownerInstance, event) { ...@@ -225,11 +226,9 @@ function touchEnd(e, ownerInstance, event) {
st.prevIns = ins st.prevIns = ins
st.preStartKey = -1; st.preStartKey = -1;
st.dragging = false; st.dragging = false;
// #ifdef MP-WEIXIN
ownerInstance.callMethod("drag", { ownerInstance.callMethod("drag", {
wxdrag: false wxdrag: false
}); });
// #endif
st.cur = -1; st.cur = -1;
st.transX = 0; st.transX = 0;
st.transY = 0; st.transY = 0;
...@@ -285,5 +284,5 @@ module.exports = { ...@@ -285,5 +284,5 @@ module.exports = {
paramChange: paramChange, paramChange: paramChange,
listChange: listChange, listChange: listChange,
mousedown: mousedown, mousedown: mousedown,
stopTouchMove:stopTouchMove stopTouchMove: stopTouchMove
} }
<template> <template>
<view class="fui-drawer__popup-wrap" :class="{'fui-drawer__wrap-show':show}" <view class="fui-drawer__popup-wrap" :class="{'fui-drawer__wrap-show':show}"
:style="{ zIndex: zIndex,background:maskBackground,alignItems:direction==='left'?'flex-start':'flex-end' }" :style="{ zIndex: zIndex,background:maskBackground,alignItems:direction==='left'?'flex-start':'flex-end' }"
@tap.stop="handleClose" @touchmove.stop.prevent="stop" v-if="isShow || !isNvue" ref="fui_dwr_mk_ani"> @tap.stop="handleClose" v-if="isShow || !isNvue" ref="fui_dwr_mk_ani">
<!-- @touchmove.stop.prevent="stop" -->
<view ref="fui_dwr_ani" class="fui-drawer__popup" :class="['fui-drawer_'+direction,show?'fui-drawer__show':'']" <view ref="fui_dwr_ani" class="fui-drawer__popup" :class="['fui-drawer_'+direction,show?'fui-drawer__show':'']"
:style="{background: background,borderTopLeftRadius:(direction==='right'? radius:0)+'rpx',borderBottomLeftRadius:(direction==='right'? radius:0)+'rpx',borderTopRightRadius:(direction==='left'? radius:0)+'rpx',borderBottomRightRadius:(direction==='left'? radius:0)+'rpx'}" :style="{background: background,borderTopLeftRadius:(direction==='right'? radius:0)+'rpx',borderBottomLeftRadius:(direction==='right'? radius:0)+'rpx',borderTopRightRadius:(direction==='left'? radius:0)+'rpx',borderBottomRightRadius:(direction==='left'? radius:0)+'rpx'}"
@tap.stop="stop($event,true)"> @tap.stop="stop($event,true)">
...@@ -91,7 +92,7 @@ ...@@ -91,7 +92,7 @@
}, },
// #ifdef H5 // #ifdef H5
updated() { updated() {
if(!this.isMounted && !this.width){ if (!this.isMounted && !this.width) {
setTimeout(() => { setTimeout(() => {
this._getSize((width) => { this._getSize((width) => {
this.width = width this.width = width
......
...@@ -2,36 +2,39 @@ ...@@ -2,36 +2,39 @@
<view class="fui-dropdown__list-wrap" :class="{'fui-dropdown__list-show':isShow}" <view class="fui-dropdown__list-wrap" :class="{'fui-dropdown__list-show':isShow}"
:style="{background:maskBackground,zIndex:zIndex}" v-if="isShow || !isNvue" ref="fui_ddl_ani" @tap="close(1)"> :style="{background:maskBackground,zIndex:zIndex}" v-if="isShow || !isNvue" ref="fui_ddl_ani" @tap="close(1)">
<view class="fui-dropdown__list" :style="{borderRadius:radius+'rpx',background:background}"> <view class="fui-dropdown__list" :style="{borderRadius:radius+'rpx',background:background}">
<scroll-view :show-scrollbar="false" class="fui-ddl__scroll" scroll-y :style="getStyles"> <scroll-view :show-scrollbar="false" class="fui-ddl__scroll" :scroll-y="true" :style="getStyles">
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<view> <view>
<!-- #endif --> <!-- #endif -->
<slot></slot>
<view class="fui-dropdown__list-item" <view class="fui-dropdown__list-item"
:style="{background:background,paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,borderBottomColor:lineColor}" :style="{background:background,paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,borderBottomColor:lineColor}"
:class="{'fui-ddl__reverse':isReverse,'fui-ddl__item-line':splitLine && itemList.length-1!==index}" :class="{'fui-ddl__reverse':isReverse,'fui-ddl__item-line':splitLine && itemList.length-1!==index}"
v-for="(model,index) in itemList" :key="index" @tap.stop.prevent="itemClick($event,index)"> v-for="(model,index) in itemList" :key="index" @tap.stop.prevent="itemClick($event,index)">
<view class="fui-ddl__checkbox" <view class="fui-ddl__checkbox"
:class="{'fui-is__checkmark':isCheckMark,'fui-ddl__checkbox-color':(!checkboxColor || checkboxColor===true) && model.checked && !isCheckMark}" :class="{'fui-is__checkmark':isCheckMark,'fui-ddl__checkbox-color':(!checkboxColor || checkboxColor===true) && model[checkedKey] && !isCheckMark}"
:style="{background:model.checked && !isCheckMark ?getChkColor:'transparent',borderColor:model.checked && !isCheckMark ?getChkColor:borderColor}" :style="{background:model[checkedKey] && !isCheckMark ?getChkColor:'transparent',borderColor:model[checkedKey] && !isCheckMark ?getChkColor:borderColor}"
v-if="isCheckbox"> v-if="isCheckbox">
<view class="fui-ddl__checkmark" <view class="fui-ddl__checkmark"
:style="{borderBottomColor:checkmarkColor,borderRightColor:checkmarkColor}" :style="{borderBottomColor:checkmarkColor,borderRightColor:checkmarkColor}"
v-if="model.checked"></view> v-if="model[checkedKey]"></view>
</view> </view>
<view class="fui-ddl__flex"> <view class="fui-ddl__flex">
<view class="fui-ddl__icon-box" <view class="fui-ddl__icon-box"
:class="{'fui-ddl__icon-ml':!isReverse && isCheckbox,'fui-ddl__icon-mr':isReverse}" :class="{'fui-ddl__icon-ml':!isReverse && isCheckbox,'fui-ddl__icon-mr':isReverse}"
:style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}" v-if="model.src"> :style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}" v-if="model[srcKey]">
<image :src="model.src" :style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}"></image> <image :src="model[srcKey]" :style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}">
</image>
</view> </view>
<text class="fui-ddl__item-text" <text class="fui-ddl__item-text"
:class="{'fui-ddl__text-pl':!isReverse && (isCheckbox || model.src),'fui-ddl__text-pr':isReverse && (isCheckbox || model.src)}" :class="{'fui-ddl__text-pl':!isReverse && (isCheckbox || model[srcKey]),'fui-ddl__text-pr':isReverse && (isCheckbox || model[srcKey])}"
:style="{fontSize:size+'rpx',color:selectedColor && model.checked?selectedColor:color}">{{model.text}}</text> :style="{fontSize:size+'rpx',color:selectedColor && model[checkedKey]?selectedColor:color}">{{model[textKey]}}</text>
</view> </view>
</view> </view>
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
</view> </view>
<!-- #endif --> <!-- #endif -->
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
...@@ -51,6 +54,18 @@ ...@@ -51,6 +54,18 @@
return [] return []
} }
}, },
textKey: {
type: String,
default: 'text'
},
srcKey: {
type: String,
default: 'src'
},
checkedKey: {
type: String,
default: 'checked'
},
height: { height: {
type: [Number, String], type: [Number, String],
default: 0 default: 0
...@@ -206,16 +221,18 @@ ...@@ -206,16 +221,18 @@
if (typeof vals[0] !== 'object') { if (typeof vals[0] !== 'object') {
vals = vals.map(item => { vals = vals.map(item => {
return { return {
text: item, [this.textKey]: item,
checked: false [this.checkedKey]: false
} }
}) })
} else { } else {
vals.map(item => { vals.map(item => {
item.checked = item.checked || false item[this.checkedKey] = item[this.checkedKey] || false
}) })
} }
this.itemList = vals; this.itemList = vals;
} else {
this.itemList = []
} }
}, },
itemClick(e, index) { itemClick(e, index) {
...@@ -226,9 +243,9 @@ ...@@ -226,9 +243,9 @@
let vals = [...this.itemList] let vals = [...this.itemList]
vals.forEach((item, idx) => { vals.forEach((item, idx) => {
if (index === idx) { if (index === idx) {
item.checked = true item[this.checkedKey] = true
} else { } else {
item.checked = false item[this.checkedKey] = false
} }
}) })
this.itemList = vals; this.itemList = vals;
......
...@@ -9,27 +9,29 @@ ...@@ -9,27 +9,29 @@
<scroll-view :show-scrollbar="false" class="fui-ddm__scroll" scroll-y <scroll-view :show-scrollbar="false" class="fui-ddm__scroll" scroll-y
:style="{height:isNvue?maxHeight+'rpx':'auto', maxHeight:maxHeight+'rpx',minWidth:minWidth+'rpx'}"> :style="{height:isNvue?maxHeight+'rpx':'auto', maxHeight:maxHeight+'rpx',minWidth:minWidth+'rpx'}">
<view> <view>
<slot name="item"></slot>
<view class="fui-dropdown__menu-item" <view class="fui-dropdown__menu-item"
:style="{background:background,padding:padding,borderBottomColor:splitLine && isNvue?lineColor:'transparent'}" :style="{background:background,padding:padding,borderBottomColor:splitLine && isNvue?lineColor:'transparent'}"
:class="{'fui-ddm__reverse':isReverse,'fui-ddm__item-line':splitLine && itemList.length-1!==index}" :class="{'fui-ddm__reverse':isReverse,'fui-ddm__item-line':splitLine && itemList.length-1!==index}"
v-for="(model,index) in itemList" :key="index" @tap.stop="itemClick(index)"> v-for="(model,index) in itemList" :key="index" @tap.stop="itemClick(index)">
<view class="fui-ddm__checkbox" <view class="fui-ddm__checkbox"
:class="{'fui-is__checkmark':isCheckMark,'fui-ddm__checkbox-color':(!checkboxColor || checkboxColor===true) && model.checked && !isCheckMark}" :class="{'fui-is__checkmark':isCheckMark,'fui-ddm__checkbox-color':(!checkboxColor || checkboxColor===true) && model[checkedKey] && !isCheckMark}"
:style="{background:model.checked && !isCheckMark ?getChkColor:'transparent',borderColor:model.checked && !isCheckMark ?getChkColor:borderColor}" :style="{background:model[checkedKey] && !isCheckMark ?getChkColor:'transparent',borderColor:model[checkedKey] && !isCheckMark ?getChkColor:borderColor}"
v-if="isCheckbox"> v-if="isCheckbox">
<view class="fui-ddm__checkmark" <view class="fui-ddm__checkmark"
:style="{borderBottomColor:checkmarkColor,borderRightColor:checkmarkColor}" :style="{borderBottomColor:checkmarkColor,borderRightColor:checkmarkColor}"
v-if="model.checked"></view> v-if="model[checkedKey]"></view>
</view> </view>
<view class="fui-ddm__flex"> <view class="fui-ddm__flex">
<view class="fui-ddm__icon-box" <view class="fui-ddm__icon-box"
:class="{'fui-ddm__icon-ml':!isReverse && isCheckbox,'fui-ddm__icon-mr':isReverse}" :class="{'fui-ddm__icon-ml':!isReverse && isCheckbox,'fui-ddm__icon-mr':isReverse}"
:style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}" v-if="model.src"> :style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}" v-if="model[srcKey]">
<image :src="model.src" :style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}"></image> <image :src="model[srcKey]" :style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}">
</image>
</view> </view>
<text class="fui-ddm__item-text" <text class="fui-ddm__item-text"
:class="{'fui-ddm__text-pl':!isReverse && (isCheckbox || model.src),'fui-ddm__text-pr':isReverse && (isCheckbox || model.src)}" :class="{'fui-ddm__text-pl':!isReverse && (isCheckbox || model[srcKey]),'fui-ddm__text-pr':isReverse && (isCheckbox || model[srcKey])}"
:style="{fontSize:size+'rpx',color:selectedColor && model.checked?selectedColor:color}">{{model.text}}</text> :style="{fontSize:size+'rpx',color:selectedColor && model[checkedKey]?selectedColor:color}">{{model[textKey]}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -53,6 +55,18 @@ ...@@ -53,6 +55,18 @@
return [] return []
} }
}, },
textKey: {
type: String,
default: 'text'
},
srcKey: {
type: String,
default: 'src'
},
checkedKey: {
type: String,
default: 'checked'
},
maxHeight: { maxHeight: {
type: [Number, String], type: [Number, String],
default: 400 default: 400
...@@ -280,16 +294,18 @@ ...@@ -280,16 +294,18 @@
if (typeof vals[0] !== 'object') { if (typeof vals[0] !== 'object') {
vals = vals.map(item => { vals = vals.map(item => {
return { return {
text: item, [this.textKey]: item,
checked: false [this.checkedKey]: false
} }
}) })
} else { } else {
vals.map(item => { vals.map(item => {
item.checked = item.checked || false item[this.checkedKey] = item[this.checkedKey] || false
}) })
} }
this.itemList = vals; this.itemList = vals;
} else {
this.itemList = []
} }
}, },
itemClick(index) { itemClick(index) {
...@@ -297,9 +313,9 @@ ...@@ -297,9 +313,9 @@
let vals = [...this.itemList] let vals = [...this.itemList]
vals.forEach((item, idx) => { vals.forEach((item, idx) => {
if (index === idx) { if (index === idx) {
item.checked = true item[this.checkedKey] = true
} else { } else {
item.checked = false item[this.checkedKey] = false
} }
}) })
this.itemList = vals; this.itemList = vals;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!-- #ifdef APP-VUE || MP-WEIXIN || H5--> <!-- #ifdef APP-VUE || MP-WEIXIN || H5-->
<view class="fui-fab__btn-wrap" :data-disabled="isDrag?0:1" :data-width="maxWidth" :data-height="maxHeight" <view class="fui-fab__btn-wrap" :data-disabled="isDrag?0:1" :data-width="maxWidth" :data-height="maxHeight"
:data-left="eLeft" :data-top="eTop" :prop="resetNum" :change:prop="handler.fabreset" :data-left="eLeft" :data-top="eTop" :data-app="isApp" :prop="resetNum" :change:prop="handler.fabreset"
@touchstart="handler.touchstart" @touchmove="handler.touchmove" @mousedown="handler.mousedown" @touchstart="handler.touchstart" @touchmove="handler.touchmove" @mousedown="handler.mousedown"
:class="[position==='left'?'fui-fab__wrap-left':'fui-fab__wrap-right']" :style="getStyles"> :class="[position==='left'?'fui-fab__wrap-left':'fui-fab__wrap-right']" :style="getStyles">
<view class="fui-fab__btn-list" <view class="fui-fab__btn-list"
...@@ -14,19 +14,26 @@ ...@@ -14,19 +14,26 @@
<view class="fui-fab__button-box" <view class="fui-fab__button-box"
:class="[position==='left'?'fui-fab__button-left':'fui-fab__button-right']" :class="[position==='left'?'fui-fab__button-left':'fui-fab__button-right']"
v-for="(btn,idx) in fabs" :key="idx" @tap.stop="handleClick($event,idx)"> v-for="(btn,idx) in fabs" :key="idx" @tap.stop="handleClick($event,idx)">
<text class="fui-fab__btn-text" v-if="btn.text" <text class="fui-fab__btn-text" v-if="btn[textKey]"
:style="{fontSize:(btn.size || 32)+'rpx',color:btn.color || '#fff',textAlign:position==='left'?'left':'right'}">{{btn.text}}</text> :style="{fontSize:(btn.size || 32)+'rpx',color:btn.color || '#fff',textAlign:position==='left'?'left':'right'}">{{btn[textKey]}}</text>
<view class="fui-fab__button" :class="{'fui-fab__btn-color':!getBgColor && !btn.background }" <view class="fui-fab__button" :class="{'fui-fab__btn-color':!getBgColor && !btn.background }"
:style="{width:width+'rpx',height:width+'rpx',background:btn.background || getBgColor}"> :style="{width:width+'rpx',height:width+'rpx',background:btn.background || getBgColor}">
<fui-icon :name="btn.name" v-if="btn.name" :color="btn.abbrColor || '#fff'" <fui-icon :name="btn[nameKey]" v-if="btn[nameKey]" :color="btn.abbrColor || '#fff'"
:size="btn.abbrSize || 64"></fui-icon> :size="btn.abbrSize || 64"></fui-icon>
<image :src="btn.src" <image :src="btn[srcKey]"
:style="{width:(btn.width || 56)+'rpx',height:(btn.height || 56)+'rpx',borderRadius:(btn.radius || 0)+'rpx'}" :style="{width:(btn.width || 56)+'rpx',height:(btn.height || 56)+'rpx',borderRadius:(btn.radius || 0)+'rpx'}"
v-if="!btn.name && btn.src" mode="widthFix"></image> v-if="!btn[nameKey] && btn[srcKey]" mode="widthFix"></image>
<text class="fui-fab__btn-abbr" <text class="fui-fab__btn-abbr"
:style="{fontSize:(btn.abbrSize || 36)+'rpx',lineHeight:(btn.abbrSize || 36)+'rpx',color:btn.abbrColor || '#fff'}" :style="{fontSize:(btn.abbrSize || 36)+'rpx',lineHeight:(btn.abbrSize || 36)+'rpx',color:btn.abbrColor || '#fff'}"
v-if="!btn.name && !btn.src && btn.abbr">{{btn.abbr}}</text> v-if="!btn[nameKey] && !btn[srcKey] && btn.abbr">{{btn.abbr}}</text>
</view> </view>
<!-- #ifndef H5 -->
<button class="fui-fab__opentype-btn" :open-type="btn.openType" :app-parameter="btn.appParameter"
:lang="btn.lang" :sessionFrom="btn.sessionFrom" :sendMessageTitle="btn.sendMessageTitle"
:sendMessagePath="btn.sendMessagePath" :sendMessageImg="btn.sendMessageImg"
:showMessageCard="btn.showMessageCard" @contact="bindcontact" @opensetting="bindopensetting"
@launchapp="bindlaunchapp" v-if="btn.openType"></button>
<!-- #endif -->
</view> </view>
</view> </view>
<view class="fui-fab__btn-main" :class="{'fui-fab__btn-color':!getBgColor}" <view class="fui-fab__btn-main" :class="{'fui-fab__btn-color':!getBgColor}"
...@@ -37,6 +44,12 @@ ...@@ -37,6 +44,12 @@
<fui-icon name="plus" :color="color" :size="80"></fui-icon> <fui-icon name="plus" :color="color" :size="80"></fui-icon>
</slot> </slot>
</view> </view>
<!-- #ifndef H5 -->
<button class="fui-fab__opentype-btn" :open-type="openType" :app-parameter="appParameter" :lang="lang"
:sessionFrom="sessionFrom" :sendMessageTitle="sendMessageTitle" :sendMessagePath="sendMessagePath"
:sendMessageImg="sendMessageImg" :showMessageCard="showMessageCard" @contact="bindcontact"
@opensetting="bindopensetting" @launchapp="bindlaunchapp" v-if="openType"></button>
<!-- #endif -->
</view> </view>
</view> </view>
<!-- #endif --> <!-- #endif -->
...@@ -51,18 +64,18 @@ ...@@ -51,18 +64,18 @@
<view class="fui-fab__button-box" <view class="fui-fab__button-box"
:class="[position==='left'?'fui-fab__button-left':'fui-fab__button-right']" :class="[position==='left'?'fui-fab__button-left':'fui-fab__button-right']"
v-for="(btn,idx) in fabs" :key="idx" @tap.stop="handleClick($event,idx)"> v-for="(btn,idx) in fabs" :key="idx" @tap.stop="handleClick($event,idx)">
<text class="fui-fab__btn-text" v-if="btn.text" <text class="fui-fab__btn-text" v-if="btn[textKey]"
:style="{fontSize:(btn.size || 32)+'rpx',color:btn.color || '#fff',textAlign:position==='left'?'left':'right'}">{{btn.text}}</text> :style="{fontSize:(btn.size || 32)+'rpx',color:btn.color || '#fff',textAlign:position==='left'?'left':'right'}">{{btn[textKey]}}</text>
<view class="fui-fab__button" :class="{'fui-fab__btn-color':!getBgColor && !btn.background }" <view class="fui-fab__button" :class="{'fui-fab__btn-color':!getBgColor && !btn.background }"
:style="{width:width+'rpx',height:width+'rpx',background:btn.background || getBgColor}"> :style="{width:width+'rpx',height:width+'rpx',background:btn.background || getBgColor}">
<fui-icon :name="btn.name" v-if="btn.name" :color="btn.abbrColor || '#fff'" <fui-icon :name="btn[nameKey]" v-if="btn[nameKey]" :color="btn.abbrColor || '#fff'"
:size="btn.abbrSize || 64"></fui-icon> :size="btn.abbrSize || 64"></fui-icon>
<image :src="btn.src" <image :src="btn[srcKey]"
:style="{width:(btn.width || 56)+'rpx',height:(btn.height || 56)+'rpx',borderRadius:(btn.radius || 0)+'rpx'}" :style="{width:(btn.width || 56)+'rpx',height:(btn.height || 56)+'rpx',borderRadius:(btn.radius || 0)+'rpx'}"
v-if="!btn.name && btn.src" mode="widthFix"></image> v-if="!btn[nameKey] && btn[srcKey]" mode="widthFix"></image>
<text class="fui-fab__btn-abbr" <text class="fui-fab__btn-abbr"
:style="{fontSize:(btn.abbrSize || 36)+'rpx',lineHeight:(btn.abbrSize || 36)+'rpx',color:btn.abbrColor || '#fff'}" :style="{fontSize:(btn.abbrSize || 36)+'rpx',lineHeight:(btn.abbrSize || 36)+'rpx',color:btn.abbrColor || '#fff'}"
v-if="!btn.name && !btn.src && btn.abbr">{{btn.abbr}}</text> v-if="!btn[nameKey] && !btn[srcKey] && btn.abbr">{{btn.abbr}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -87,18 +100,18 @@ ...@@ -87,18 +100,18 @@
<view class="fui-fab__button-box" <view class="fui-fab__button-box"
:class="[position==='left'?'fui-fab__button-left':'fui-fab__button-right']" :class="[position==='left'?'fui-fab__button-left':'fui-fab__button-right']"
v-for="(btn,idx) in fabs" :key="idx" @tap.stop="handleClick($event,idx)"> v-for="(btn,idx) in fabs" :key="idx" @tap.stop="handleClick($event,idx)">
<text class="fui-fab__btn-text" v-if="btn.text" <text class="fui-fab__btn-text" v-if="btn[textKey]"
:style="{fontSize:(btn.size || 32)+'rpx',color:btn.color || '#fff',textAlign:position==='left'?'left':'right'}">{{btn.text}}</text> :style="{fontSize:(btn.size || 32)+'rpx',color:btn.color || '#fff',textAlign:position==='left'?'left':'right'}">{{btn[textKey]}}</text>
<view class="fui-fab__button" :class="{'fui-fab__btn-color':!getBgColor && !btn.background }" <view class="fui-fab__button" :class="{'fui-fab__btn-color':!getBgColor && !btn.background }"
:style="{width:width+'rpx',height:width+'rpx',background:btn.background || getBgColor}"> :style="{width:width+'rpx',height:width+'rpx',background:btn.background || getBgColor}">
<fui-icon :name="btn.name" v-if="btn.name" :color="btn.abbrColor || '#fff'" <fui-icon :name="btn[nameKey]" v-if="btn[nameKey]" :color="btn.abbrColor || '#fff'"
:size="btn.abbrSize || 64"></fui-icon> :size="btn.abbrSize || 64"></fui-icon>
<image :src="btn.src" <image :src="btn[srcKey]"
:style="{width:(btn.width || 56)+'rpx',height:(btn.height || 56)+'rpx',borderRadius:(btn.radius || 0)+'rpx'}" :style="{width:(btn.width || 56)+'rpx',height:(btn.height || 56)+'rpx',borderRadius:(btn.radius || 0)+'rpx'}"
v-if="!btn.name && btn.src" mode="widthFix"></image> v-if="!btn[nameKey] && btn[srcKey]" mode="widthFix"></image>
<text class="fui-fab__btn-abbr" <text class="fui-fab__btn-abbr"
:style="{fontSize:(btn.abbrSize || 36)+'rpx',lineHeight:(btn.abbrSize || 36)+'rpx',color:btn.abbrColor || '#fff'}" :style="{fontSize:(btn.abbrSize || 36)+'rpx',lineHeight:(btn.abbrSize || 36)+'rpx',color:btn.abbrColor || '#fff'}"
v-if="!btn.name && !btn.src && btn.abbr">{{btn.abbr}}</text> v-if="!btn[nameKey] && !btn[srcKey] && btn.abbr">{{btn.abbr}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -131,7 +144,7 @@ ...@@ -131,7 +144,7 @@
export default { export default {
name: "fui-fab", name: "fui-fab",
mixins: [mpjs, bindingx], mixins: [mpjs, bindingx],
emits: ['click', 'change'], emits: ['click', 'change', 'opensetting', 'launchapp', 'contact'],
// components:{ // components:{
// fuiIcon // fuiIcon
// }, // },
...@@ -142,6 +155,18 @@ ...@@ -142,6 +155,18 @@
return [] return []
} }
}, },
nameKey: {
type: String,
default: 'name'
},
srcKey: {
type: String,
default: 'src'
},
textKey: {
type: String,
default: 'text'
},
position: { position: {
type: String, type: String,
default: 'right' default: 'right'
...@@ -186,6 +211,39 @@ ...@@ -186,6 +211,39 @@
isDrag: { isDrag: {
type: Boolean, type: Boolean,
default: false default: false
},
//v2.3.0+
openType: {
type: String,
default: ''
},
appParameter: {
type: String,
default: ''
},
lang: {
type: String,
default: 'en'
},
sessionFrom: {
type: String,
default: ''
},
sendMessageTitle: {
type: String,
default: ''
},
sendMessagePath: {
type: String,
default: ''
},
sendMessageImg: {
type: String,
default: ''
},
showMessageCard: {
type: Boolean,
default: false
} }
}, },
computed: { computed: {
...@@ -233,7 +291,12 @@ ...@@ -233,7 +291,12 @@
} }
}, },
data() { data() {
let isApp = 0;
// #ifdef APP
isApp = 1;
// #endif
return { return {
isApp,
isShow: false, isShow: false,
isHidden: true, isHidden: true,
timer: null, timer: null,
...@@ -419,6 +482,21 @@ ...@@ -419,6 +482,21 @@
this._animation(this.isShow) this._animation(this.isShow)
// #endif // #endif
},
bindopensetting({
detail = {}
} = {}) {
this.$emit('opensetting', detail);
},
bindlaunchapp({
detail = {}
} = {}) {
this.$emit('launchapp', detail);
},
bindcontact({
detail = {}
} = {}) {
this.$emit('contact', detail);
} }
} }
} }
...@@ -519,6 +597,7 @@ ...@@ -519,6 +597,7 @@
/* #ifdef H5 */ /* #ifdef H5 */
cursor: pointer; cursor: pointer;
/* #endif */ /* #endif */
position: relative;
} }
.fui-fab__button-left { .fui-fab__button-left {
...@@ -578,6 +657,7 @@ ...@@ -578,6 +657,7 @@
/* #ifdef H5 */ /* #ifdef H5 */
cursor: pointer; cursor: pointer;
/* #endif */ /* #endif */
position: relative;
} }
.fui-fab__btn-inner { .fui-fab__btn-inner {
...@@ -603,4 +683,25 @@ ...@@ -603,4 +683,25 @@
} }
/* #endif */ /* #endif */
.fui-fab__opentype-btn {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
border-width: 0;
background-color: rgba(0, 0, 0, 0);
opacity: 0;
/* #ifndef APP-NVUE */
z-index: 1;
/* #endif */
}
/* #ifndef APP-NVUE */
.fui-fab__opentype-btn::after {
border-width: 0;
}
/* #endif */
</style> </style>
...@@ -3,7 +3,8 @@ var movable = { ...@@ -3,7 +3,8 @@ var movable = {
height: 100, height: 100,
disabled: false, disabled: false,
left: 0, left: 0,
top: 0 top: 0,
app: false
} }
function isPC() { function isPC() {
...@@ -29,6 +30,7 @@ function setInitValue(dataset) { ...@@ -29,6 +30,7 @@ function setInitValue(dataset) {
movable.left = +dataset.left movable.left = +dataset.left
//H5获取bool值为undefined //H5获取bool值为undefined
movable.disabled = (+dataset.disabled) == 1 ? true : false movable.disabled = (+dataset.disabled) == 1 ? true : false
movable.app = (+dataset.app) == 1 ? true : false
} }
function touchstart(e, ins) { function touchstart(e, ins) {
...@@ -52,18 +54,20 @@ function styleChange(left, top, ins) { ...@@ -52,18 +54,20 @@ function styleChange(left, top, ins) {
}) })
} }
function touchmove(e, ins, event) { function touchmove(e, ins, events) {
if (movable.disabled) return; if (movable.disabled) return;
if (e.preventDefault) { if (e.preventDefault) {
// 阻止页面滚动
e.preventDefault() e.preventDefault()
} }
if (movable.app && event && event.preventDefault && event.cancelable) {
event.preventDefault()
}
var state = {} var state = {}
var touch = {} var touch = {}
if (isH5 && isPC()) { if (isH5 && isPC()) {
touch = e; touch = e;
if (event && event.instance) { if (events && events.instance) {
state = event.instance.getState() state = events.instance.getState()
} }
} else { } else {
touch = e.touches[0] || e.changedTouches[0] touch = e.touches[0] || e.changedTouches[0]
......
<template> <template>
<view class="fui-footer" :class="[isFixed?'fui-footer__fixed-bottom':'']" :style='{background:background}'> <view class="fui-footer" :class="[isFixed?'fui-footer__fixed-bottom':'']"
:style="{background:background,bottom:bottom+'rpx'}">
<view class="fui-footer__link" v-if="navigate.length>0"> <view class="fui-footer__link" v-if="navigate.length>0">
<navigator v-for="(item,index) in navigate" :key="index" class="fui-link__item" <navigator v-for="(item,index) in navigate" :key="index" class="fui-link__item" hover-class="fui-link-hover"
:class="{'fui-link__color':!item.color}" hover-class="fui-link-hover" hover-stop-propagation hover-stop-propagation :open-type="item.openType || 'navigate'" :url="item.url" :delta="item.delta">
:open-type="item.openType || 'navigate'" :url="item.url" :delta="item.delta"><text <text class="fui-link__text"
class="fui-link__text" :class="{'fui-link__text-border':index===navigate.length-1}" :class="{'fui-link__color':!item.color,'fui-link__text-border':index===navigate.length-1}"
:style="{color:item.color || linkColor,fontSize:(item.size || 28)+'rpx',borderColor:borderColor,lineHeight:(item.size || 28)+'rpx'}">{{item.text}}</text> :style="{color:item.color || linkColor,fontSize:(item.size || 28)+'rpx',borderColor:borderColor,lineHeight:(item.size || 28)+'rpx'}">{{item.text}}</text>
</navigator> </navigator>
</view> </view>
<view class="fui-footer__text" :class="{'fui-as__safe-weex':iphoneX && safeArea}" :style="{color:color,fontSize:size+'rpx'}"> <view class="fui-footer__text"
<slot name="text"></slot> :class="{'fui-as__safe-weex':iphoneX && safeArea,'fui-footer__safearea':safeArea}" :style="{color:color,fontSize:size+'rpx'}">
<slot name="text"></slot>
<text v-if="!$slots.text">{{text}}</text> <text v-if="!$slots.text">{{text}}</text>
</view> </view>
</view> </view>
...@@ -57,6 +59,10 @@ ...@@ -57,6 +59,10 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
bottom: {
type: [Number, String],
default: 0
},
//是否适配底部安全区 //是否适配底部安全区
safeArea: { safeArea: {
type: Boolean, type: Boolean,
...@@ -86,11 +92,13 @@ ...@@ -86,11 +92,13 @@
//34px //34px
const res = uni.getSystemInfoSync(); const res = uni.getSystemInfoSync();
let iphonex = false; let iphonex = false;
let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax', let models = ['iphonex', 'iphonexr', 'iphonexsmax']
'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini', for (let i = 11; i < 20; i++) {
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini', models.push(`iphone${i}`)
'iphone14pro', 'iphone14promax', 'iphone15' models.push(`iphone${i}mini`)
] models.push(`iphone${i}pro`)
models.push(`iphone${i}promax`)
}
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]
if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets
...@@ -122,15 +130,14 @@ ...@@ -122,15 +130,14 @@
.fui-footer__fixed-bottom { .fui-footer__fixed-bottom {
position: fixed; position: fixed;
z-index: 99; z-index: 99;
bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
/* left: constant(safe-area-inset-left); left: constant(safe-area-inset-left);
left: env(safe-area-inset-left); left: env(safe-area-inset-left);
right: constant(safe-area-inset-right); right: constant(safe-area-inset-right);
right: env(safe-area-inset-right) */ right: env(safe-area-inset-right)
/* #endif */ /* #endif */
} }
.fui-footer__link { .fui-footer__link {
...@@ -206,13 +213,17 @@ ...@@ -206,13 +213,17 @@
line-height: 1; line-height: 1;
text-align: center; text-align: center;
padding-top: 8rpx; padding-top: 8rpx;
/* #ifndef APP-NVUE || MP-TOUTIAO */ font-weight: 400;
}
/* #ifndef APP-NVUE || MP-TOUTIAO */
.fui-footer__safearea {
padding-bottom: constant(safe-area-inset-bottom); padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
/* #endif */
font-weight: 400;
} }
/* #endif */
/* #ifdef APP-NVUE || MP-TOUTIAO */ /* #ifdef APP-NVUE || MP-TOUTIAO */
.fui-as__safe-weex { .fui-as__safe-weex {
padding-bottom: 34px; padding-bottom: 34px;
......
...@@ -9,7 +9,18 @@ ...@@ -9,7 +9,18 @@
export default { export default {
emits: ['input', 'update:modelValue'], emits: ['input', 'update:modelValue'],
name: "fui-form-field", name: "fui-form-field",
// #ifdef MP-WEIXIN
behaviors: ['wx://form-field'],
// #endif
// #ifdef MP-BAIDU
behaviors: ['swan://form-field'],
// #endif
// #ifdef MP-QQ
behaviors: ['qq://form-field'],
// #endif
// #ifdef H5
behaviors: ['uni://form-field'], behaviors: ['uni://form-field'],
// #endif
props: { props: {
//是否为隐藏域 //是否为隐藏域
hidden: { hidden: {
......
...@@ -265,27 +265,29 @@ ...@@ -265,27 +265,29 @@
watch: { watch: {
prop: { prop: {
handler(val) { handler(val) {
const key = `form.model.${val || 'fui_unknown'}` setTimeout(() => {
if (val && val !== true && this.form && key != this.watchKey) { const key = `form.model.${val || 'fui_unknown'}`
this.watchKey = key if (val && val !== true && this.form && key != this.watchKey) {
this.$watch(key, (val) => { this.watchKey = key
if (this.isRealTime && this.prop && this.form) { this.$watch(key, (val) => {
this.form.realTimeValidator(this.prop).then(res => { if (this.isRealTime && this.prop && this.form) {
if (res.isPassed) { this.form.realTimeValidator(this.prop).then(res => {
if (res.isPassed) {
this.errorMsg = ''
} else {
this.errorMsg = res.errorMsg
}
}).catch(err => {
console.log(err.errorMsg)
})
} else {
if (this.showError && val != this.itemValue) {
this.errorMsg = '' this.errorMsg = ''
} else {
this.errorMsg = res.errorMsg
} }
}).catch(err => {
console.log(err.errorMsg)
})
} else {
if (this.showError && val != this.itemValue) {
this.errorMsg = ''
} }
} })
}) }
} }, 50)
}, },
immediate: true immediate: true
} }
......
...@@ -19,9 +19,10 @@ const form = { ...@@ -19,9 +19,10 @@ const form = {
const msgArr = item.msg || []; const msgArr = item.msg || [];
const ruleLen = rule.length; const ruleLen = rule.length;
const validatorLen = validator.length; const validatorLen = validator.length;
let itemVal = formData[key];
itemVal = (itemVal === null || itemVal === undefined ? '' : itemVal).toString();
if (!key || (ruleLen === 0 && validatorLen === 0) || (!~rule.indexOf("required") && if (!key || (ruleLen === 0 && validatorLen === 0) || (!~rule.indexOf("required") &&
formData[key].toString() itemVal.length === 0)) {
.length === 0)) {
continue; continue;
} }
if (ruleLen) { if (ruleLen) {
...@@ -159,7 +160,7 @@ const form = { ...@@ -159,7 +160,7 @@ const form = {
return (value === null || value === '' || value === undefined) ? true : false; return (value === null || value === '' || value === undefined) ? true : false;
}, },
_isMobile: function(value) { _isMobile: function(value) {
return /^(?:13\d|14\d|15\d|16\d|17\d|18\d|19\d)\d{5}(\d{3}|\*{3})$/.test(value); return /^(?:13\d|14\d|15\d|16\d|17\d|18\d|19\d)\d{5}(\d{3}|\*{3})$/.test(String(value));
}, },
_isEmail: function(value) { _isEmail: function(value) {
return /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(value); return /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(value);
...@@ -182,7 +183,7 @@ const form = { ...@@ -182,7 +183,7 @@ const form = {
_isIdCard: function(value) { _isIdCard: function(value) {
let idCard = value; let idCard = value;
if (idCard.length == 15) { if (idCard.length == 15) {
return this.__isValidityBrithBy15IdCard; return this.__isValidityBrithBy15IdCard(value);
} else if (idCard.length == 18) { } else if (idCard.length == 18) {
let arrIdCard = idCard.split(""); let arrIdCard = idCard.split("");
if (this.__isValidityBrithBy18IdCard(idCard) && this.__isTrueValidateCodeBy18IdCard(arrIdCard)) { if (this.__isValidityBrithBy18IdCard(idCard) && this.__isTrueValidateCodeBy18IdCard(arrIdCard)) {
...@@ -230,7 +231,7 @@ const form = { ...@@ -230,7 +231,7 @@ const form = {
let day = idCard15.substring(10, 12); let day = idCard15.substring(10, 12);
let temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day)); let temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
if (temp_date.getYear() != parseFloat(year) || temp_date.getMonth() != parseFloat(month) - 1 || if (temp_date.getFullYear() != parseFloat(year) || temp_date.getMonth() != parseFloat(month) - 1 ||
temp_date.getDate() != temp_date.getDate() !=
parseFloat(day)) { parseFloat(day)) {
return false; return false;
...@@ -240,11 +241,11 @@ const form = { ...@@ -240,11 +241,11 @@ const form = {
}, },
_isAmount: function(value) { _isAmount: function(value) {
//是否为金额,只允许保留两位小数 //是否为金额,只允许保留两位小数
return /^([0-9]*[.]?[0-9])[0-9]{0,1}$/.test(value); return /^([0-9]*[.]?[0-9])[0-9]{0,1}$/.test(String(value));
}, },
_isNumber: function(value) { _isNumber: function(value) {
//是否全为数字 //是否全为数字
return /^[0-9]+$/.test(value); return /^[0-9]+$/.test(String(value));
}, },
//是否全部为中文 //是否全部为中文
_isChinese: function(value) { _isChinese: function(value) {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
:current="defActive" :autoplay="false" :duration="500"> :current="defActive" :autoplay="false" :duration="500">
<swiper-item :style="{height:height+'px'}" v-for="(item,index) in imgUrls" :key="index"> <swiper-item :style="{height:height+'px'}" v-for="(item,index) in imgUrls" :key="index">
<view class="fui-gallery__swiper-item" :style="{height:height+'px'}"> <view class="fui-gallery__swiper-item" :style="{height:height+'px'}">
<image mode="aspectFit" class="fui-gallery__img" :style="{height:height+'px'}" :src="item.src" <image mode="aspectFit" class="fui-gallery__img" :style="{height:height+'px'}" :src="item[srcKey]"
@tap.stop="hideGallery"></image> @tap.stop="hideGallery"></image>
</view> </view>
</swiper-item> </swiper-item>
...@@ -30,6 +30,14 @@ ...@@ -30,6 +30,14 @@
return [] return []
} }
}, },
srcKey: {
type: String,
default: 'src'
},
descrKey: {
type: String,
default: 'descr'
},
show: { show: {
type: Boolean, type: Boolean,
default: false default: false
...@@ -99,7 +107,7 @@ ...@@ -99,7 +107,7 @@
if (typeof vals[0] === 'string') { if (typeof vals[0] === 'string') {
vals = vals.map(item => { vals = vals.map(item => {
return { return {
src: item [this.srcKey]: item
} }
}) })
} }
...@@ -121,7 +129,7 @@ ...@@ -121,7 +129,7 @@
getDescr(index) { getDescr(index) {
let item = this.imgUrls[index] let item = this.imgUrls[index]
if (item) { if (item) {
this.descr = item.descr || '' this.descr = item[this.descrKey] || ''
} }
}, },
// #ifdef APP-NVUE || MP-TOUTIAO // #ifdef APP-NVUE || MP-TOUTIAO
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="fui-horizontal__scroll" :style="{marginTop:marginTop+'rpx',marginBottom:marginBottom+'rpx'}" <view class="fui-horizontal__scroll" :style="{marginTop:marginTop+'rpx',marginBottom:marginBottom+'rpx'}"
ref="fui_horizontal__scroll"> ref="fui_horizontal__scroll">
<!-- #ifdef APP-VUE || MP-WEIXIN || H5--> <!-- #ifdef APP-VUE || MP-WEIXIN || H5-->
<scroll-view :show-scrollbar="false" scroll-x :upper-threshold="0" :lower-threshold="0" :data-width="width" :data-bgwidth="bgWidth" <scroll-view :show-scrollbar="false" :scroll-x="true" :upper-threshold="0" :lower-threshold="0" :data-width="width" :data-bgwidth="bgWidth"
:data-blockwidth="blockWidth" @scroll="handler.scroll" @scrolltoupper="handler.scrolltoupper" :data-blockwidth="blockWidth" @scroll="handler.scroll" @scrolltoupper="handler.scrolltoupper"
@scrolltolower="handler.scrolltolower" class="fui-hor__scroll-view"> @scrolltolower="handler.scrolltolower" class="fui-hor__scroll-view">
<view class="fui-hor__scroll-wrap"> <view class="fui-hor__scroll-wrap">
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<!-- #endif --> <!-- #endif -->
<!-- #ifndef APP-PLUS || MP-WEIXIN || H5--> <!-- #ifndef APP-PLUS || MP-WEIXIN || H5-->
<scroll-view :show-scrollbar="false" scroll-x :upper-threshold="0" :lower-threshold="0" class="fui-hor__scroll-view" <scroll-view :show-scrollbar="false" :scroll-x="true" :upper-threshold="0" :lower-threshold="0" class="fui-hor__scroll-view"
@scroll="scrollHandler" @scrolltoupper="scrolltoupper" @scrolltolower="scrolltolower"> @scroll="scrollHandler" @scrolltoupper="scrolltoupper" @scrolltolower="scrolltolower">
<view class="fui-hor__scroll-wrap"> <view class="fui-hor__scroll-wrap">
<slot></slot> <slot></slot>
......
<template> <template>
<view class="fui-image__cropper" @touchmove.stop.prevent="stop"> <view class="fui-image__cropper" :style="{zIndex:zIndex,background:background}" @touchmove.stop.prevent="stop">
<!-- #ifdef APP-VUE || MP-WEIXIN || H5 --> <!-- #ifdef APP-VUE || MP-WEIXIN || H5 -->
<image @touchstart="handler.touchstart" @touchmove="handler.touchmove" @touchend="handler.touchend" <image :data-app="isApp" @touchstart="handler.touchstart" @touchmove="handler.touchmove" @touchend="handler.touchend"
@mousedown="handler.mousedown" class="fui-cropper__img" @mousedown="handler.mousedown" class="fui-cropper__img"
:class="{'fui-cropper__img-hidden':!src || !initVal}" :src="src" :class="{'fui-cropper__img-hidden':!src || !initVal}" :src="src"
:style="{width: (imgWidth ? imgWidth : width) + 'px',height: imgHeight ? imgHeight + 'px' : 'auto',transitionDuration: ani ?'0.25s' : '0s'}" :style="{width: (imgWidth ? imgWidth : width) + 'px',height: imgHeight ? imgHeight + 'px' : 'auto',transitionDuration: ani ?'0.25s' : '0s'}"
...@@ -29,43 +29,37 @@ ...@@ -29,43 +29,37 @@
<view class="fui-cropper__right" :style="{width:(windowWidth-canvasWidth)/2+'px',height:height+'px'}"> <view class="fui-cropper__right" :style="{width:(windowWidth-canvasWidth)/2+'px',height:height+'px'}">
</view> </view>
<view class="fui-cropper__bottom" :style="{height:(windowHeight-canvasHeight)/2+'px'}"></view> <view class="fui-cropper__bottom" :style="{height:(windowHeight-canvasHeight)/2+'px'}"></view>
<!-- #endif --> <view class="fui-cropper__border"
<!-- #ifndef APP-NVUE --> :style="{width:width+'px',height:height+'px', borderRadius: round ? canvasWidth/2+'px' : '0',borderColor:borderColor}">
<view class="fui-cropper__mask"
:style="{ width: width + 'px', height: height + 'px', borderRadius: round ? '50%' : '0' }">
<!-- #endif -->
<!-- #ifdef APP-VUE || MP-WEIXIN || H5-->
<view class="fui-cropper__border" :change:prop="handler.valsChange" :prop="changeval"
:data-width="width" :data-height="height" :data-windowHeight="windowHeight"
:data-windowWidth="windowWidth" :data-imgWidth="imgWidth" :data-imgHeight="imgHeight"
:data-imgTop="imgTop" :data-angle="angle"
:style="{ borderRadius: round ? '50%' : '0',borderColor:borderColor}"></view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<view class="fui-cropper__border"
:style="{width:width+'px',height:height+'px', borderRadius: round ? canvasWidth/2+'px' : '0',borderColor:borderColor}">
</view>
<!-- #endif -->
<!-- #ifndef APP-PLUS || MP-WEIXIN || H5 -->
<view class="fui-cropper__border" :style="{ borderRadius: round ? '50%' : '0',borderColor:borderColor}">
</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<view class="fui-cropper__real-el"
:style="{width: (imgWidth ? imgWidth : width) + 'px',height: imgHeight ? imgHeight + 'px' : 'auto'}"
@touchstart="touchstart" @touchmove="touchmove" @touchend="touchend" ref="fui_cropper_real"></view>
<!-- #endif -->
</view> </view>
<view class="fui-cropper__real-el"
:style="{width: (imgWidth ? imgWidth : width) + 'px',height: imgHeight ? imgHeight + 'px' : 'auto'}"
@touchstart="touchstart" @touchmove="touchmove" @touchend="touchend" ref="fui_cropper_real"></view>
</view>
<!-- #endif -->
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE -->
<canvas canvas-id="fui_image_cropper" id="fui_image_cropper" :disable-scroll="true" <view class="fui-cropper__mask"
:style="{ width: nWidth * nScaleRatio + 'px', height: nWidth * nScaleRatio + 'px' }" :style="{ width: width + 'px', height: height + 'px', borderRadius: round ? '50%' : '0' }">
class="fui-cropper__canvas"></canvas> <!-- #ifdef APP-VUE || MP-WEIXIN || H5-->
<view class="fui-cropper__border" :change:prop="handler.valsChange" :prop="changeval" :data-width="width"
:data-height="height" :data-windowheight="windowHeight" :data-windowwidth="windowWidth"
:data-imgwidth="imgWidth" :data-imgheight="imgHeight" :data-imgtop="imgTop" :data-imgLeft="imgLeft"
:data-angle="angle" :style="{ borderRadius: round ? '50%' : '0',borderColor:borderColor}"></view>
<!-- #endif -->
<!-- #ifndef APP-PLUS || MP-WEIXIN || H5 -->
<view class="fui-cropper__border" :style="{ borderRadius: round ? '50%' : '0',borderColor:borderColor}">
</view>
<!-- #endif --> <!-- #endif -->
</view> </view>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<canvas canvas-id="fui_image_cropper" id="fui_image_cropper" :disable-scroll="true"
:style="{ width: nWidth * nScaleRatio + 'px', height: nHeight * nScaleRatio + 'px' }"
class="fui-cropper__canvas"></canvas>
<!-- #endif -->
</view>
</template> </template>
<!-- #ifdef APP-VUE || MP-WEIXIN || H5--> <!-- #ifdef APP-VUE || MP-WEIXIN || H5-->
...@@ -127,6 +121,18 @@ ...@@ -127,6 +121,18 @@
network: { network: {
type: Boolean, type: Boolean,
default: false default: false
},
background: {
type: String,
default: 'rgba(0,0,0,.6)'
},
zIndex: {
type: [Number, String],
default: 10
},
isNav: {
type: Boolean,
default: false
} }
}, },
watch: { watch: {
...@@ -146,13 +152,20 @@ ...@@ -146,13 +152,20 @@
}, },
width(val) { width(val) {
this.nWidth = Number(val) || 280 this.nWidth = Number(val) || 280
this.changeReset()
}, },
height(val) { height(val) {
this.nHeight = Number(val) || 280 this.nHeight = Number(val) || 280
this.changeReset()
} }
}, },
data() { data() {
let isApp = 0;
// #ifdef APP
isApp = 1;
// #endif
return { return {
isApp,
windowHeight: 600, windowHeight: 600,
windowWidth: 400, windowWidth: 400,
cutX: 0, cutX: 0,
...@@ -185,9 +198,16 @@ ...@@ -185,9 +198,16 @@
}, },
mounted() { mounted() {
let sys = uni.getSystemInfoSync(); let sys = uni.getSystemInfoSync();
this.windowHeight = sys.windowHeight let windowHeight = sys.windowHeight;
this.windowWidth = sys.windowWidth this.windowWidth = sys.windowWidth
this.imgTop = sys.windowHeight / 2; // #ifdef H5
if (this.isNav) {
//使用了自带导航栏
windowHeight += 44;
}
// #endif
this.windowHeight = windowHeight;
this.imgTop = windowHeight / 2;
this.imgLeft = sys.windowWidth / 2; this.imgLeft = sys.windowWidth / 2;
this.$nextTick(() => { this.$nextTick(() => {
// #ifndef APP-NVUE // #ifndef APP-NVUE
...@@ -219,10 +239,27 @@ ...@@ -219,10 +239,27 @@
this.scale = 1; this.scale = 1;
this.angle = 0; this.angle = 0;
let sys = uni.getSystemInfoSync(); let sys = uni.getSystemInfoSync();
this.imgTop = sys.windowHeight / 2; let windowHeight = sys.windowHeight;
// #ifdef H5
if (this.isNav) {
windowHeight += 44;
}
// #endif
this.imgTop = windowHeight / 2;
this.imgLeft = sys.windowWidth / 2; this.imgLeft = sys.windowWidth / 2;
this.changeval = `4_${this.getRandom()}`; this.changeval = `4_${this.getRandom()}`;
}, },
changeReset() {
this.reset()
this.$nextTick(() => {
setTimeout(() => {
this.changeval = `1_${this.getRandom()}`;
setTimeout(() => {
this.src && this.handleImage(this.src)
}, 50);
}, 50);
})
},
calcSize(width, height) { calcSize(width, height) {
let imgWidth = width, let imgWidth = width,
imgHeight = height; imgHeight = height;
...@@ -292,11 +329,11 @@ ...@@ -292,11 +329,11 @@
this.naturalHeight = height; this.naturalHeight = height;
let orientation = res.orientation; let orientation = res.orientation;
if (orientation && orientation != 'up') { if (orientation && orientation != 'up') {
//此处需要测试,可能导致裁剪出错
// #ifdef APP-NVUE
//宽高传值颠倒 //宽高传值颠倒
width = orientation == 'down' ? res.width : res.height; width = orientation == 'down' ? res.width : res.height;
height = orientation == 'down' ? res.height : res.width; height = orientation == 'down' ? res.height : res.width;
//此处需要测试,可能导致裁剪出错
// #ifdef APP-NVUE
this.compressImage(src, width, height, orientation); this.compressImage(src, width, height, orientation);
// #endif // #endif
} else { } else {
...@@ -568,7 +605,6 @@ ...@@ -568,7 +605,6 @@
<style scoped> <style scoped>
.fui-image__cropper { .fui-image__cropper {
background: rgba(0, 0, 0, 0.6);
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
...@@ -580,6 +616,7 @@ ...@@ -580,6 +616,7 @@
.fui-cropper__img, .fui-cropper__img,
.fui-cropper__real-el { .fui-cropper__real-el {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
-webkit-backface-visibility: hidden;
backface-visibility: hidden; backface-visibility: hidden;
/* #endif */ /* #endif */
position: absolute; position: absolute;
......
...@@ -11,8 +11,8 @@ function isPC() { ...@@ -11,8 +11,8 @@ function isPC() {
} }
return flag; return flag;
} }
var isH5 = false var isH5 = false;
if (typeof window === 'object') isH5 = true if (typeof window === 'object') isH5 = true;
var cropper = { var cropper = {
cutX: 0, cutX: 0,
cutY: 0, cutY: 0,
...@@ -32,7 +32,8 @@ var cropper = { ...@@ -32,7 +32,8 @@ var cropper = {
imgLeft: 0, imgLeft: 0,
windowHeight: 0, windowHeight: 0,
windowWidth: 0, windowWidth: 0,
init: true init: true,
app: false
} }
function touchstart(e, ins) { function touchstart(e, ins) {
...@@ -42,6 +43,8 @@ function touchstart(e, ins) { ...@@ -42,6 +43,8 @@ function touchstart(e, ins) {
} else { } else {
touch = e.touches || e.changedTouches touch = e.touches || e.changedTouches
} }
var dataset = e.instance.getDataset()
cropper.app = (+dataset.app) == 1 ? true : false;
cropper.flagEndTouch = false; cropper.flagEndTouch = false;
if (touch.length == 1) { if (touch.length == 1) {
cropper.touchRelative[0] = { cropper.touchRelative[0] = {
...@@ -91,6 +94,9 @@ function touchmove(e, ins) { ...@@ -91,6 +94,9 @@ function touchmove(e, ins) {
if (e.preventDefault) { if (e.preventDefault) {
e.preventDefault() e.preventDefault()
} }
if (cropper.app && event && event.preventDefault && event.cancelable) {
event.preventDefault()
}
var touch = null var touch = null
if (isH5 && isPC()) { if (isH5 && isPC()) {
touch = [e]; touch = [e];
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<!-- #endif --> <!-- #endif -->
<!-- #endif --> <!-- #endif -->
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE -->
<scroll-view class="fui-index__list-sv" scroll-y :scroll-into-view="scrollViewId" <scroll-view class="fui-index__list-sv" :scroll-y="true" :scroll-into-view="scrollViewId"
@scrolltolower="scrolltolower"> @scrolltolower="scrolltolower">
<slot></slot> <slot></slot>
<view :id="'fui_il_letter_'+idx" v-for="(list, idx) in lists" :key="list.key"> <view :id="'fui_il_letter_'+idx" v-for="(list, idx) in lists" :key="list.key">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</view> </view>
<slot></slot> <slot></slot>
</view> </view>
<input :type="type" v-model="inputValue" :disabled="disabled" @blur="blur" class="fui-number__input" <input :type="type" :value="inputValue" :disabled="disabled" @blur="blur" class="fui-number__input"
:style="{ color: color, fontSize: size + 'rpx', backgroundColor: backgroundColor, height: height + 'rpx', minHeight: height + 'rpx', width: width + 'rpx',borderRadius:radius+'rpx',marginLeft:margin+'rpx',marginRight:margin+'rpx' }" /> :style="{ color: color, fontSize: size + 'rpx', backgroundColor: backgroundColor, height: height + 'rpx', minHeight: height + 'rpx', width: width + 'rpx',borderRadius:radius+'rpx',marginLeft:margin+'rpx',marginRight:margin+'rpx' }" />
<view class="fui-number__plus" :style="{minWidth:signWidth+'rpx',minHeight:signWidth+'rpx'}" <view class="fui-number__plus" :style="{minWidth:signWidth+'rpx',minHeight:signWidth+'rpx'}"
:class="[disabled || inputValue >= max ? 'fui-number__disabled' : '']" @tap="plus"> :class="[disabled || inputValue >= max ? 'fui-number__disabled' : '']" @tap="plus">
...@@ -38,6 +38,11 @@ ...@@ -38,6 +38,11 @@
default: 1 default: 1
}, },
// #endif // #endif
//初始化以及页面改变value值时是否触发change等事件
valueEmit: {
type: Boolean,
default: true
},
//number、text(主要用与输入负号) //number、text(主要用与输入负号)
type: { type: {
type: String, type: String,
...@@ -124,6 +129,7 @@ ...@@ -124,6 +129,7 @@
} }
}, },
created() { created() {
this.isEmit = this.valueEmit;
// #ifndef VUE3 // #ifndef VUE3
this.inputValue = this.getValue(this.value); this.inputValue = this.getValue(this.value);
// #endif // #endif
...@@ -145,17 +151,20 @@ ...@@ -145,17 +151,20 @@
return { return {
inputValue: 0, inputValue: 0,
oldValue: 0, oldValue: 0,
isNvue: isNvue isNvue: isNvue,
isEmit: true
}; };
}, },
watch: { watch: {
// #ifndef VUE3 // #ifndef VUE3
value(val) { value(val) {
this.isEmit = this.valueEmit;
this.inputValue = this.getValue(val); this.inputValue = this.getValue(val);
}, },
// #endif // #endif
// #ifdef VUE3 // #ifdef VUE3
modelValue(val) { modelValue(val) {
this.isEmit = this.valueEmit;
this.inputValue = this.getValue(val); this.inputValue = this.getValue(val);
}, },
// #endif // #endif
...@@ -163,17 +172,21 @@ ...@@ -163,17 +172,21 @@
if (!isNaN(Number(newVal)) && Number(newVal) !== Number(oldVal)) { if (!isNaN(Number(newVal)) && Number(newVal) !== Number(oldVal)) {
const val = this.getValue(+newVal) const val = this.getValue(+newVal)
this.oldValue = val this.oldValue = val
this.$emit("change", { if (this.isEmit) {
value: val, this.$emit("change", {
index: this.index, value: val,
params: this.params index: this.index,
}); params: this.params
// TODO vue2 兼容 });
this.$emit("input", val); // TODO vue2 兼容
// TODO vue3 兼容 this.$emit("input", val);
// #ifdef VUE3 // TODO vue3 兼容
this.$emit("update:modelValue", +val); // #ifdef VUE3
// #endif this.$emit("update:modelValue", +val);
// #endif
}
this.isEmit = true;
} }
} }
}, },
...@@ -226,6 +239,7 @@ ...@@ -226,6 +239,7 @@
}, },
blur: function(e) { blur: function(e) {
let value = e.detail.value; let value = e.detail.value;
this.inputValue = value;
if (value && !isNaN(Number(value))) { if (value && !isNaN(Number(value))) {
if (~value.indexOf('.') && Number.isInteger(this.step) && Number.isInteger(Number(value))) { if (~value.indexOf('.') && Number.isInteger(this.step) && Number.isInteger(Number(value))) {
value = value.split('.')[0]; value = value.split('.')[0];
...@@ -236,9 +250,9 @@ ...@@ -236,9 +250,9 @@
} }
setTimeout(() => { setTimeout(() => {
e.detail.value = value e.detail.value = value
this.inputValue = String(value);
this.$emit('blur', e) this.$emit('blur', e)
this.inputValue = value; }, 100)
}, this.type === 'text' ? 100 : 0)
} }
} }
}; };
...@@ -313,10 +327,11 @@ ...@@ -313,10 +327,11 @@
/* #ifdef H5 */ /* #ifdef H5 */
::-webkit-inner-spin-button, ::-webkit-inner-spin-button,
::-webkit-outer-spin-button{ ::-webkit-outer-spin-button {
-webkit-appearance: none; -webkit-appearance: none;
margin: 0; margin: 0;
} }
/* #endif */ /* #endif */
.fui-number__disabled { .fui-number__disabled {
......
...@@ -73,8 +73,13 @@ ...@@ -73,8 +73,13 @@
//加group是为了避免在表单中使用时给组件加value属性 //加group是为了避免在表单中使用时给组件加value属性
behaviors: ['wx://form-field-group'], behaviors: ['wx://form-field-group'],
// #endif // #endif
// #ifdef MP-BAIDU || MP-QQ || H5 // #ifdef MP-BAIDU
//如果在这些平台不需要也能识别,则删除 behaviors: ['swan://form-field'],
// #endif
// #ifdef MP-QQ
behaviors: ['qq://form-field'],
// #endif
// #ifdef H5
behaviors: ['uni://form-field'], behaviors: ['uni://form-field'],
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
...@@ -428,7 +433,7 @@ ...@@ -428,7 +433,7 @@
if ((this.modelModifiers.number || this.number || this.type === 'digit' || this.type === 'number') && ! if ((this.modelModifiers.number || this.number || this.type === 'digit' || this.type === 'number') && !
isNaN(currentVal) && Number.isSafeInteger(currentVal)) { isNaN(currentVal) && Number.isSafeInteger(currentVal)) {
let eVal = this.type === 'digit' ? value : currentVal let eVal = this.type === 'digit' ? value : currentVal
if (typeof currentVal === 'number') { if (typeof eVal === 'number') {
const min = Number(this.min) const min = Number(this.min)
const max = Number(this.max) const max = Number(this.max)
if (typeof min === 'number' && currentVal < min) { if (typeof min === 'number' && currentVal < min) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:class="{'fui-landscape__fixed':!absolute,'fui-landscape__absolute':absolute,'fui-landscape__show':isShow}" :class="{'fui-landscape__fixed':!absolute,'fui-landscape__absolute':absolute,'fui-landscape__show':isShow}"
:style="{background:maskBackground,zIndex:zIndex}" v-if="isShow || !isNvue" @tap.stop="closeWin" :style="{background:maskBackground,zIndex:zIndex}" v-if="isShow || !isNvue" @tap.stop="closeWin"
ref="fui_landscape_ani"> ref="fui_landscape_ani">
<view class="fui-landscape__inner"> <view class="fui-landscape__inner" :style="{marginTop:top+'rpx'}">
<slot></slot> <slot></slot>
<view class="fui-landscape__icon" <view class="fui-landscape__icon"
:class="{'fui-landscape__icon-rt':position==2,'fui-landscape__icon-def':position==3}" :style="getStyles" :class="{'fui-landscape__icon-rt':position==2,'fui-landscape__icon-def':position==3}" :style="getStyles"
...@@ -56,6 +56,10 @@ ...@@ -56,6 +56,10 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
top: {
type: [Number, String],
default: 0
},
maskClosable: { maskClosable: {
type: Boolean, type: Boolean,
default: false default: false
......
...@@ -102,28 +102,36 @@ ...@@ -102,28 +102,36 @@
this.visible = this.local ? true : (this.placeholder ? true : false); this.visible = this.local ? true : (this.placeholder ? true : false);
this.observer = null; this.observer = null;
}, },
// #ifndef APP-NVUE
mounted() { mounted() {
this.isMounted = true this.$nextTick(() => {
setTimeout(() => { // #ifndef APP-NVUE
// #ifdef H5 this.isMounted = true
if (window.self === window.top) { setTimeout(() => {
// #ifdef H5
if (window.self === window.top) {
this.startObserver()
} else {
//嵌套在iframe中
this.handleFade()
}
// #endif
// #ifndef H5
this.startObserver() this.startObserver()
} else { // #endif
//嵌套在iframe中 }, 50)
this.handleFade()
}
// #endif // #endif
// #ifndef H5 // #ifdef APP-NVUE
this.startObserver() setTimeout(() => {
!this.show && this.handleAppear()
}, 2500)
// #endif // #endif
}, 50) })
}, },
// #endif
// #ifdef H5 // #ifdef H5
updated() { updated() {
if(!this.isMounted){ if (!this.isMounted) {
this.handleFade() this.handleFade()
} }
}, },
......
...@@ -160,11 +160,13 @@ ...@@ -160,11 +160,13 @@
//34px //34px
const res = uni.getSystemInfoSync(); const res = uni.getSystemInfoSync();
let iphonex = false; let iphonex = false;
let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax', let models = ['iphonex', 'iphonexr', 'iphonexsmax']
'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini', for (let i = 11; i < 20; i++) {
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini', models.push(`iphone${i}`)
'iphone14pro', 'iphone14promax' models.push(`iphone${i}mini`)
] models.push(`iphone${i}pro`)
models.push(`iphone${i}promax`)
}
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]
if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets if (models.includes(model) || models.includes(newModel) || (res.safeAreaInsets && res.safeAreaInsets
......
<template> <template>
<view class="fui-modal__wrap" :style="{background:maskBackground,zIndex:zIndex}" <view class="fui-modal__wrap" :style="{background:maskBackground,zIndex:zIndex}"
:class="{'fui-modal__fadein':isShow}" @tap="closeModal" @touchmove.stop.prevent="stop" v-if="isShow || !isNvue" :class="{'fui-modal__fadein':isShow}" @tap="closeModal" v-if="isShow || !isNvue" ref="fui_modal_ani">
ref="fui_modal_ani"> <!-- @touchmove.stop.prevent="stop" -->
<view class="fui-modal__inner" <view class="fui-modal__inner"
:style="{width:width+'rpx',background:background,borderRadius:boxRadius+'rpx',paddingTop:padding+'rpx',paddingBottom:padding+'rpx'}" :style="{width:width+'rpx',background:background,borderRadius:boxRadius+'rpx',paddingTop:padding+'rpx',paddingBottom:padding+'rpx',marginTop:top+'rpx'}"
@tap.stop="stop"> @tap.stop="stop">
<text class="fui-modal__title" :style="{fontSize:size+'rpx',color:color}" <text class="fui-modal__title" :style="{fontSize:size+'rpx',color:color}"
v-if="title && title!==true">{{title}}</text> v-if="title && title!==true">{{title}}</text>
...@@ -88,6 +88,10 @@ ...@@ -88,6 +88,10 @@
type: [Number, String], type: [Number, String],
default: 640 default: 640
}, },
top: {
type: [Number, String],
default: 0
},
background: { background: {
type: String, type: String,
default: '#FFFFFF' default: '#FFFFFF'
...@@ -343,10 +347,6 @@ ...@@ -343,10 +347,6 @@
/* #endif */ /* #endif */
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
border-width: 1rpx;
transform: translateZ(0);
/* #endif */
/* #ifdef H5 */
border-width: 1px; border-width: 1px;
/* #endif */ /* #endif */
border-style: solid; border-style: solid;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view> <view>
<!-- #ifdef APP-VUE || H5 --> <!-- #ifdef APP-VUE || H5 -->
<view class="fui-movable__view" :class="{'fui-movable__cursor':direction!=='none'}" :data-direction="direction" <view class="fui-movable__view" :class="{'fui-movable__cursor':direction!=='none'}" :data-direction="direction"
:data-width="maxWidth" :data-height="maxHeight" :data-left="eLeft" :data-top="eTop" :data-width="maxWidth" :data-height="maxHeight" :data-left="eLeft" :data-top="eTop" :data-app="isApp"
@touchstart="handler.touchstart" @touchmove="handler.touchmove" @mousedown="handler.mousedown" @touchstart="handler.touchstart" @touchmove="handler.touchmove" @mousedown="handler.mousedown"
:style="getStyles"> :style="getStyles">
<slot></slot> <slot></slot>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<view class="fui-movable__view" :class="{'fui-movable__cursor':direction!=='none'}" :data-direction="direction" <view class="fui-movable__view" :class="{'fui-movable__cursor':direction!=='none'}" :data-direction="direction"
:data-width="maxWidth" :data-height="maxHeight" :data-left="eLeft" :data-top="eTop" :data-width="maxWidth" :data-height="maxHeight" :data-left="eLeft" :data-top="eTop" :data-app="isApp"
@touchstart="handler.touchstart" :catchtouchmove="handler.touchmove" :style="getStyles"> @touchstart="handler.touchstart" :catchtouchmove="handler.touchmove" :style="getStyles">
<slot></slot> <slot></slot>
</view> </view>
...@@ -76,7 +76,12 @@ ...@@ -76,7 +76,12 @@
} }
}, },
data() { data() {
let isApp = 0;
// #ifdef APP
isApp = 1;
// #endif
return { return {
isApp,
maxWidth: 0, maxWidth: 0,
maxHeight: 0, maxHeight: 0,
eLeft: 0, eLeft: 0,
......
...@@ -3,7 +3,8 @@ var movable = { ...@@ -3,7 +3,8 @@ var movable = {
height: 100, height: 100,
direction: '', direction: '',
left: 0, left: 0,
top: 0 top: 0,
app: false
} }
function isPC() { function isPC() {
...@@ -28,6 +29,7 @@ function setInitValue(dataset, isChange) { ...@@ -28,6 +29,7 @@ function setInitValue(dataset, isChange) {
movable.top = +dataset.top movable.top = +dataset.top
movable.left = +dataset.left movable.left = +dataset.left
movable.direction = dataset.direction movable.direction = dataset.direction
movable.app = (+dataset.app) == 1 ? true : false;
} }
function touchstart(e, ins) { function touchstart(e, ins) {
...@@ -77,18 +79,20 @@ function getTop(pageY, state) { ...@@ -77,18 +79,20 @@ function getTop(pageY, state) {
return top return top
} }
function touchmove(e, ins, event) { function touchmove(e, ins, events) {
if (movable.direction == 'none') return; if (movable.direction == 'none') return;
if (e.preventDefault) { if (e.preventDefault) {
// 阻止页面滚动
e.preventDefault() e.preventDefault()
} }
if (movable.app && event && event.preventDefault) {
event.preventDefault()
}
var state = {} var state = {}
var touch = {} var touch = {}
if (isH5 && isPC()) { if (isH5 && isPC()) {
touch = e; touch = e;
if (event && event.instance) { if (events && events.instance) {
state = event.instance.getState() state = events.instance.getState()
} }
} else { } else {
touch = e.touches[0] || e.changedTouches[0] touch = e.touches[0] || e.changedTouches[0]
......
...@@ -40,39 +40,50 @@ ...@@ -40,39 +40,50 @@
default: '' default: ''
}, },
//标题字体大小,单位px //标题字体大小,单位px
// #ifdef H5
size: { size: {
type: [Number, String], type: [Number, String],
// #ifdef H5
default: 16 default: 16
// #endif },
// #ifndef H5 // #endif
// #ifndef H5
size: {
type: [Number, String],
default: 17 default: 17
// #endif
}, },
// #endif
//标题颜色 //标题颜色
// #ifdef APP-NVUE
color: { color: {
type: String, type: String,
// #ifdef APP-NVUE
default: '#181818' default: '#181818'
// #endif },
// #ifndef APP-NVUE // #endif
// #ifndef APP-NVUE
color: {
type: String,
default: '' default: ''
// #endif
}, },
// #endif
fontWeight: { fontWeight: {
type: [Number, String], type: [Number, String],
default: 500 default: 500
}, },
//背景颜色 // #ifdef APP-NVUE
background: { background: {
type: String, type: String,
// #ifdef APP-NVUE
default: '#fff' default: '#fff'
// #endif },
// #ifndef APP-NVUE // #endif
// #ifndef APP-NVUE
background: {
type: String,
default: '' default: ''
// #endif
}, },
// #endif
//是否需要底部分割线 //是否需要底部分割线
splitLine: { splitLine: {
type: Boolean, type: Boolean,
......
...@@ -6,11 +6,11 @@ ...@@ -6,11 +6,11 @@
<slot></slot> <slot></slot>
</view> </view>
<view class="fui-notice__wrap" :class="{'fui-notice__wrap-scroll':scrollable}" <view class="fui-notice__wrap" :class="{'fui-notice__wrap-scroll':scrollable}"
:style="{height:scrollable&& !isNvue?size+'rpx':'auto'}" ref="fui_notice_box"> :style="{height:scrollable&& !isNvue?getHeight:'auto'}" ref="fui_notice_box">
<view :id="elId_box" <view :id="elId_box"
:class="{'fui-notice__content':scrollable,'fui-notice__content-single':!scrollable && single}"> :class="{'fui-notice__content':scrollable,'fui-notice__content-single':!scrollable && single}">
<text ref="animationEle" class="fui-notice__text" :id="elId" <text ref="animationEle" class="fui-notice__text" :id="elId"
:style="{color:getColor,fontSize:size+'rpx',lineHeight:scrollable && !isNvue?size+'rpx':'normal',fontWeight:bold?'bold':'normal',width:wrapWidth+'px', 'animationDuration': animationDuration,'-webkit-animationDuration': animationDuration,animationPlayState: webviewHide?'paused':animationPlayState,'-webkit-animationPlayState':webviewHide?'paused':animationPlayState, animationDelay: animationDelay, '-webkit-animationDelay':animationDelay}" :style="{color:getColor,fontSize:size+'rpx',lineHeight:scrollable && !isNvue?getHeight:'normal',fontWeight:bold?'bold':'normal',width:wrapWidth+'px', 'animationDuration': animationDuration,'-webkit-animationDuration': animationDuration,animationPlayState: webviewHide?'paused':animationPlayState,'-webkit-animationPlayState':webviewHide?'paused':animationPlayState, animationDelay: animationDelay, '-webkit-animationDelay':animationDelay}"
:class="{'fui-notice__single':!scrollable && single,'fui-notice__scrollable':scrollable,'fui-notice__text-color':!color && !isNvue}">{{content}}</text> :class="{'fui-notice__single':!scrollable && single,'fui-notice__scrollable':scrollable,'fui-notice__text-color':!color && !isNvue}">{{content}}</text>
</view> </view>
</view> </view>
...@@ -90,6 +90,9 @@ ...@@ -90,6 +90,9 @@
} }
// #endif // #endif
return color; return color;
},
getHeight() {
return `${Math.min(Number(this.height),Number(this.size)*2)}rpx`
} }
}, },
data() { data() {
......
<template>
<text class="fui-digitalnumbers"
:class="{'fui-number__highlight':!disabled && highlight,'fui-number__color':!color || color===true}"
:style="{color:getColor, fontSize: getSize, fontWeight: fontWeight,lineHeight:lineHeight?getSize:'auto',textDecoration:decoration}"
@click="handleClick">{{text}}</text>
</template>
<script>
// #ifdef APP-NVUE
var domModule = weex.requireModule('dom');
import fuinumbers from './numbers.ttf'
domModule.addRule('fontFace', {
'fontFamily': 'DigitalNumbers',
'src': "url('" + fuinumbers + "')"
});
// #endif
export default {
emits: ['click'],
name: "fui-number",
// #ifdef MP-WEIXIN
options: {
virtualHost: true,
addGlobalClass: true
},
// #endif
props: {
//数字值
text: {
type: [Number, String],
default: ''
},
size: {
type: [Number, String],
default: 0
},
//rpx | px
unit: {
type: String,
default: ''
},
color: {
type: String,
default: '#333'
},
//字重
fontWeight: {
type: [Number, String],
default: 'normal'
},
//是否禁用点击
disabled: {
type: Boolean,
default: false
},
//是否有点击效果
highlight: {
type: Boolean,
default: false
},
//none、 underline、line-through
decoration: {
type: String,
default: 'none'
},
//是否将行高设置与字体大小一致
lineHeight: {
type: Boolean,
default: false
},
params: {
type: [Number, String],
default: 0
}
},
computed: {
getSize() {
const size = (uni.$fui && uni.$fui.fuiNumber && uni.$fui.fuiNumber.size) || 32
const unit = (uni.$fui && uni.$fui.fuiNumber && uni.$fui.fuiNumber.unit) || 'rpx'
return (this.size || size) + (this.unit || unit)
},
getColor() {
let color = this.color;
// #ifdef APP-NVUE
if (!color && color !== true) {
color = '#333333'
}
// #endif
return color;
}
},
methods: {
handleClick() {
if (this.disabled) return;
this.$emit('click', {
text: this.text,
params: this.params
});
}
}
}
</script>
<style scoped>
/* #ifndef APP-NVUE */
/* 头条小程序组件内不能引入字体,需要在父级页面引入字体文件*/
@font-face {
font-family: DigitalNumbers;
src: url("./numbers.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
.fui-number__color {
color: var(--fui-color-section, #333333) !important;
}
/* #endif */
.fui-digitalnumbers {
font-family: DigitalNumbers;
text-decoration: none;
}
.fui-number__highlight {
/* #ifdef H5 */
cursor: pointer;
/* #endif */
opacity: 1;
}
.fui-number__highlight:active {
opacity: .5;
}
</style>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
v-for="(item,index) in pageNumber" :key="index" v-for="(item,index) in pageNumber" :key="index"
:style="{background:currentIndex===item?getActiveBgColor:pageBgColor,borderRadius:radius+'rpx'}" :style="{background:currentIndex===item?getActiveBgColor:pageBgColor,borderRadius:radius+'rpx'}"
@tap.stop="handleClick(item,index)"> @tap.stop="handleClick(item,index)">
<text class="fui-page__num-text" :class="{'fui-pagination__color':!color && currentIndex!==item}" <text class="fui-page__num-text" :class="{'fui-pagination__color':!pageColor && currentIndex!==item}"
:style="{color:currentIndex===item?activeColor:pageColor}">{{item}}</text> :style="{color:currentIndex===item?activeColor:pageColor}">{{item}}</text>
</view> </view>
</view> </view>
......
...@@ -11,10 +11,11 @@ ...@@ -11,10 +11,11 @@
class="fui-panel__border" :class="{'fui-panel__border-color':!borderColor}"></view> class="fui-panel__border" :class="{'fui-panel__border-color':!borderColor}"></view>
</view> </view>
<view class="fui-panel__mediabox" :style="{paddingLeft:padding+'rpx',paddingRight:padding+'rpx'}" <view class="fui-panel__mediabox" :style="{paddingLeft:padding+'rpx',paddingRight:padding+'rpx'}"
:class="{'fui-mediabox__center':!flexStart,'fui-panel__hover-weex':highlight}" v-for="(item,index) in listData" :class="{'fui-mediabox__center':!flexStart,'fui-panel__hover-weex':highlight,'fui-panel__mediabox-row':!rowReverse,'fui-panel__row-reverse':rowReverse}"
:key="index" :hover-class="highlight?'fui-panel__hover':''" :hover-stay-time="150" v-for="(item,index) in listData" :key="index" :hover-class="highlight?'fui-panel__hover':''"
@tap="handleClick(index)"> :hover-stay-time="150" @tap="handleClick(index)">
<view class="fui-panel__mb-hd" v-if="item[src]" :style="{width:width+'rpx',height:height+'rpx'}"> <view class="fui-panel__mb-hd" :class="[rowReverse?'fui-panel__mb-hdright':'fui-panel__mb-hdleft']"
v-if="item[src]" :style="{width:width+'rpx',height:height+'rpx'}">
<image class="fui-panel__mb-thumb" :src="item[src]" mode="widthFix" <image class="fui-panel__mb-thumb" :src="item[src]" mode="widthFix"
:style="{width:width+'rpx',height:height+'rpx',borderRadius:radius+'rpx'}" /> :style="{width:width+'rpx',height:height+'rpx',borderRadius:radius+'rpx'}" />
</view> </view>
...@@ -62,15 +63,18 @@ ...@@ -62,15 +63,18 @@
return {} return {}
} }
}, },
// #ifdef APP-NVUE
background: { background: {
type: String, type: String,
// #ifdef APP-NVUE
default: '#fff' default: '#fff'
// #endif },
// #ifndef APP-NVUE // #endif
// #ifndef APP-NVUE
background: {
type: String,
default: '' default: ''
// #endif
}, },
// #endif
//是否有点击效果 //是否有点击效果
highlight: { highlight: {
type: Boolean, type: Boolean,
...@@ -80,6 +84,10 @@ ...@@ -80,6 +84,10 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
rowReverse: {
type: Boolean,
default: false
},
marginTop: { marginTop: {
type: [Number, String], type: [Number, String],
default: 0 default: 0
...@@ -113,15 +121,18 @@ ...@@ -113,15 +121,18 @@
type: [Number, String], type: [Number, String],
default: 32 default: 32
}, },
// #ifdef APP-NVUE
headColor: { headColor: {
type: String, type: String,
// #ifdef APP-NVUE
default: '#181818' default: '#181818'
// #endif },
// #ifndef APP-NVUE // #endif
// #ifndef APP-NVUE
headColor: {
type: String,
default: '' default: ''
// #endif
}, },
// #endif
bdBorder: { bdBorder: {
type: Boolean, type: Boolean,
default: true default: true
...@@ -152,15 +163,18 @@ ...@@ -152,15 +163,18 @@
type: [Number, String], type: [Number, String],
default: 32 default: 32
}, },
// #ifdef APP-NVUE
color: { color: {
type: String, type: String,
// #ifdef APP-NVUE
default: '#181818' default: '#181818'
// #endif },
// #ifndef APP-NVUE // #endif
// #ifndef APP-NVUE
color: {
type: String,
default: '' default: ''
// #endif
}, },
// #endif
fontWeight: { fontWeight: {
type: [Number, String], type: [Number, String],
default: 'normal' default: 'normal'
...@@ -169,41 +183,51 @@ ...@@ -169,41 +183,51 @@
type: [Number, String], type: [Number, String],
default: 28 default: 28
}, },
// #ifdef APP-NVUE
descColor: { descColor: {
type: String, type: String,
// #ifdef APP-NVUE
default: '#7F7F7F' default: '#7F7F7F'
// #endif },
// #ifndef APP-NVUE // #endif
// #ifndef APP-NVUE
descColor: {
type: String,
default: '' default: ''
// #endif
}, },
// #endif
infoSize: { infoSize: {
type: [Number, String], type: [Number, String],
default: 24 default: 24
}, },
// #ifdef APP-NVUE
infoColor: { infoColor: {
type: String, type: String,
// #ifdef APP-NVUE
default: '#b2b2b2' default: '#b2b2b2'
// #endif
// #ifndef APP-NVUE
default: ''
// #endif
}, },
//是否需要panel外层上下线条 // #endif
isBorder: { // #ifndef APP-NVUE
type: Boolean, infoColor: {
default: true type: String,
default: ''
}, },
// #endif
// #ifdef APP-NVUE
borderColor: { borderColor: {
type: String, type: String,
// #ifdef APP-NVUE
default: '#eee' default: '#eee'
// #endif },
// #ifndef APP-NVUE // #endif
// #ifndef APP-NVUE
borderColor: {
type: String,
default: '' default: ''
// #endif },
// #endif
//是否需要panel外层上下线条
isBorder: {
type: Boolean,
default: true
} }
}, },
...@@ -228,7 +252,7 @@ ...@@ -228,7 +252,7 @@
deep: true deep: true
}, },
//未做深度监听 //未做深度监听
fields(val){ fields(val) {
this.handleFileds() this.handleFileds()
} }
}, },
...@@ -308,13 +332,14 @@ ...@@ -308,13 +332,14 @@
transform: scaleY(.5) transform: scaleY(.5)
} }
.fui-panel__wrap:after{ .fui-panel__wrap:after {
content: " "; content: " ";
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
height: 1px; height: 1px;
} }
.fui-panel__wrap::before { .fui-panel__wrap::before {
content: " "; content: " ";
position: absolute; position: absolute;
...@@ -332,10 +357,11 @@ ...@@ -332,10 +357,11 @@
transform: scaleY(.5) transform: scaleY(.5)
} }
.fui-panel__unlined::before{ .fui-panel__unlined::before {
border-top-width: 0 !important; border-top-width: 0 !important;
border-bottom-width: 0 !important; border-bottom-width: 0 !important;
} }
.fui-panel__unlined::after { .fui-panel__unlined::after {
border-top-width: 0 !important; border-top-width: 0 !important;
border-bottom-width: 0 !important; border-bottom-width: 0 !important;
...@@ -389,15 +415,22 @@ ...@@ -389,15 +415,22 @@
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
/* #endif */ /* #endif */
}
.fui-panel__mediabox-row {
flex-direction: row; flex-direction: row;
} }
.fui-panel__row-reverse {
flex-direction: row-reverse;
}
.fui-mediabox__center { .fui-mediabox__center {
align-items: center; align-items: center;
} }
.fui-panel__mb-hd { .fui-panel__mb-hd {
margin-right: 32rpx;
overflow: hidden; overflow: hidden;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: flex; display: flex;
...@@ -406,6 +439,15 @@ ...@@ -406,6 +439,15 @@
justify-content: center; justify-content: center;
} }
.fui-panel__mb-hdleft {
margin-right: 32rpx;
}
.fui-panel__mb-hdright {
margin-left: 32rpx;
}
.fui-panel__mb-thumb { .fui-panel__mb-thumb {
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
display: block; display: block;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论