2023-10-17 16:02:55 +08:00
if ( typeof Promise !== "undefined" && ! Promise . prototype . finally ) {
Promise . prototype . finally = function ( callback ) {
const promise = this . constructor ;
return this . then (
( value ) => promise . resolve ( callback ( ) ) . then ( ( ) => value ) ,
( reason ) => promise . resolve ( callback ( ) ) . then ( ( ) => {
throw reason ;
} )
) ;
} ;
}
;
if ( typeof uni !== "undefined" && uni && uni . requireGlobal ) {
const global2 = uni . requireGlobal ( ) ;
ArrayBuffer = global2 . ArrayBuffer ;
Int8Array = global2 . Int8Array ;
Uint8Array = global2 . Uint8Array ;
Uint8ClampedArray = global2 . Uint8ClampedArray ;
Int16Array = global2 . Int16Array ;
Uint16Array = global2 . Uint16Array ;
Int32Array = global2 . Int32Array ;
Uint32Array = global2 . Uint32Array ;
Float32Array = global2 . Float32Array ;
Float64Array = global2 . Float64Array ;
BigInt64Array = global2 . BigInt64Array ;
BigUint64Array = global2 . BigUint64Array ;
}
;
if ( uni . restoreGlobal ) {
uni . restoreGlobal ( Vue , weex , plus , setTimeout , clearTimeout , setInterval , clearInterval ) ;
}
( function ( vue , shared ) {
"use strict" ;
2023-10-20 18:45:15 +08:00
const icons = {
"uicon-level" : "" ,
"uicon-column-line" : "" ,
"uicon-checkbox-mark" : "" ,
"uicon-folder" : "" ,
"uicon-movie" : "" ,
"uicon-star-fill" : "" ,
"uicon-star" : "" ,
"uicon-phone-fill" : "" ,
"uicon-phone" : "" ,
"uicon-apple-fill" : "" ,
"uicon-chrome-circle-fill" : "" ,
"uicon-backspace" : "" ,
"uicon-attach" : "" ,
"uicon-cut" : "" ,
"uicon-empty-car" : "" ,
"uicon-empty-coupon" : "" ,
"uicon-empty-address" : "" ,
"uicon-empty-favor" : "" ,
"uicon-empty-permission" : "" ,
"uicon-empty-news" : "" ,
"uicon-empty-search" : "" ,
"uicon-github-circle-fill" : "" ,
"uicon-rmb" : "" ,
"uicon-person-delete-fill" : "" ,
"uicon-reload" : "" ,
"uicon-order" : "" ,
"uicon-server-man" : "" ,
"uicon-search" : "" ,
"uicon-fingerprint" : "" ,
"uicon-more-dot-fill" : "" ,
"uicon-scan" : "" ,
"uicon-share-square" : "" ,
"uicon-map" : "" ,
"uicon-map-fill" : "" ,
"uicon-tags" : "" ,
"uicon-tags-fill" : "" ,
"uicon-bookmark-fill" : "" ,
"uicon-bookmark" : "" ,
"uicon-eye" : "" ,
"uicon-eye-fill" : "" ,
"uicon-mic" : "" ,
"uicon-mic-off" : "" ,
"uicon-calendar" : "" ,
"uicon-calendar-fill" : "" ,
"uicon-trash" : "" ,
"uicon-trash-fill" : "" ,
"uicon-play-left" : "" ,
"uicon-play-right" : "" ,
"uicon-minus" : "" ,
"uicon-plus" : "" ,
"uicon-info" : "" ,
"uicon-info-circle" : "" ,
"uicon-info-circle-fill" : "" ,
"uicon-question" : "" ,
"uicon-error" : "" ,
"uicon-close" : "" ,
"uicon-checkmark" : "" ,
"uicon-android-circle-fill" : "" ,
"uicon-android-fill" : "" ,
"uicon-ie" : "" ,
"uicon-IE-circle-fill" : "" ,
"uicon-google" : "" ,
"uicon-google-circle-fill" : "" ,
"uicon-setting-fill" : "" ,
"uicon-setting" : "" ,
"uicon-minus-square-fill" : "" ,
"uicon-plus-square-fill" : "" ,
"uicon-heart" : "" ,
"uicon-heart-fill" : "" ,
"uicon-camera" : "" ,
"uicon-camera-fill" : "" ,
"uicon-more-circle" : "" ,
"uicon-more-circle-fill" : "" ,
"uicon-chat" : "" ,
"uicon-chat-fill" : "" ,
"uicon-bag-fill" : "" ,
"uicon-bag" : "" ,
"uicon-error-circle-fill" : "" ,
"uicon-error-circle" : "" ,
"uicon-close-circle" : "" ,
"uicon-close-circle-fill" : "" ,
"uicon-checkmark-circle" : "" ,
"uicon-checkmark-circle-fill" : "" ,
"uicon-question-circle-fill" : "" ,
"uicon-question-circle" : "" ,
"uicon-share" : "" ,
"uicon-share-fill" : "" ,
"uicon-shopping-cart" : "" ,
"uicon-shopping-cart-fill" : "" ,
"uicon-bell" : "" ,
"uicon-bell-fill" : "" ,
"uicon-list" : "" ,
"uicon-list-dot" : "" ,
"uicon-zhihu" : "" ,
"uicon-zhihu-circle-fill" : "" ,
"uicon-zhifubao" : "" ,
"uicon-zhifubao-circle-fill" : "" ,
"uicon-weixin-circle-fill" : "" ,
"uicon-weixin-fill" : "" ,
"uicon-twitter-circle-fill" : "" ,
"uicon-twitter" : "" ,
"uicon-taobao-circle-fill" : "" ,
"uicon-taobao" : "" ,
"uicon-weibo-circle-fill" : "" ,
"uicon-weibo" : "" ,
"uicon-qq-fill" : "" ,
"uicon-qq-circle-fill" : "" ,
"uicon-moments-circel-fill" : "" ,
"uicon-moments" : "" ,
"uicon-qzone" : "" ,
"uicon-qzone-circle-fill" : "" ,
"uicon-baidu-circle-fill" : "" ,
"uicon-baidu" : "" ,
"uicon-facebook-circle-fill" : "" ,
"uicon-facebook" : "" ,
"uicon-car" : "" ,
"uicon-car-fill" : "" ,
"uicon-warning-fill" : "" ,
"uicon-warning" : "" ,
"uicon-clock-fill" : "" ,
"uicon-clock" : "" ,
"uicon-edit-pen" : "" ,
"uicon-edit-pen-fill" : "" ,
"uicon-email" : "" ,
"uicon-email-fill" : "" ,
"uicon-minus-circle" : "" ,
"uicon-minus-circle-fill" : "" ,
"uicon-plus-circle" : "" ,
"uicon-plus-circle-fill" : "" ,
"uicon-file-text" : "" ,
"uicon-file-text-fill" : "" ,
"uicon-pushpin" : "" ,
"uicon-pushpin-fill" : "" ,
"uicon-grid" : "" ,
"uicon-grid-fill" : "" ,
"uicon-play-circle" : "" ,
"uicon-play-circle-fill" : "" ,
"uicon-pause-circle-fill" : "" ,
"uicon-pause" : "" ,
"uicon-pause-circle" : "" ,
"uicon-eye-off" : "" ,
"uicon-eye-off-outline" : "" ,
"uicon-gift-fill" : "" ,
"uicon-gift" : "" ,
"uicon-rmb-circle-fill" : "" ,
"uicon-rmb-circle" : "" ,
"uicon-kefu-ermai" : "" ,
"uicon-server-fill" : "" ,
"uicon-coupon-fill" : "" ,
"uicon-coupon" : "" ,
"uicon-integral" : "" ,
"uicon-integral-fill" : "" ,
"uicon-home-fill" : "" ,
"uicon-home" : "" ,
"uicon-hourglass-half-fill" : "" ,
"uicon-hourglass" : "" ,
"uicon-account" : "" ,
"uicon-plus-people-fill" : "" ,
"uicon-minus-people-fill" : "" ,
"uicon-account-fill" : "" ,
"uicon-thumb-down-fill" : "" ,
"uicon-thumb-down" : "" ,
"uicon-thumb-up" : "" ,
"uicon-thumb-up-fill" : "" ,
"uicon-lock-fill" : "" ,
"uicon-lock-open" : "" ,
"uicon-lock-opened-fill" : "" ,
"uicon-lock" : "" ,
"uicon-red-packet-fill" : "" ,
"uicon-photo-fill" : "" ,
"uicon-photo" : "" ,
"uicon-volume-off-fill" : "" ,
"uicon-volume-off" : "" ,
"uicon-volume-fill" : "" ,
"uicon-volume" : "" ,
"uicon-red-packet" : "" ,
"uicon-download" : "" ,
"uicon-arrow-up-fill" : "" ,
"uicon-arrow-down-fill" : "" ,
"uicon-play-left-fill" : "" ,
"uicon-play-right-fill" : "" ,
"uicon-rewind-left-fill" : "" ,
"uicon-rewind-right-fill" : "" ,
"uicon-arrow-downward" : "" ,
"uicon-arrow-leftward" : "" ,
"uicon-arrow-rightward" : "" ,
"uicon-arrow-upward" : "" ,
"uicon-arrow-down" : "" ,
"uicon-arrow-right" : "" ,
"uicon-arrow-left" : "" ,
"uicon-arrow-up" : "" ,
"uicon-skip-back-left" : "" ,
"uicon-skip-forward-right" : "" ,
"uicon-rewind-right" : "" ,
"uicon-rewind-left" : "" ,
"uicon-arrow-right-double" : "" ,
"uicon-arrow-left-double" : "" ,
"uicon-wifi-off" : "" ,
"uicon-wifi" : "" ,
"uicon-empty-data" : "" ,
"uicon-empty-history" : "" ,
"uicon-empty-list" : "" ,
"uicon-empty-page" : "" ,
"uicon-empty-order" : "" ,
"uicon-man" : "" ,
"uicon-woman" : "" ,
"uicon-man-add" : "" ,
"uicon-man-add-fill" : "" ,
"uicon-man-delete" : "" ,
"uicon-man-delete-fill" : "" ,
"uicon-zh" : "" ,
"uicon-en" : ""
} ;
2023-10-17 16:02:55 +08:00
function formatAppLog ( type , filename , ... args ) {
if ( uni . _ _log _ _ ) {
uni . _ _log _ _ ( type , filename , ... args ) ;
} else {
console [ type ] . apply ( console , [ ... args , filename ] ) ;
}
}
function resolveEasycom ( component , easycom ) {
return shared . isString ( component ) ? easycom : component ;
}
const version = "3" ;
{
formatAppLog ( "log" , "at node_modules/uview-plus/libs/config/config.js:5" , `
% c uview - plus V$ { version } % c https : //ijry.github.io/uview-plus/
` , "color: #ffffff; background: #3c9cff; padding:5px 0;", "color: #3c9cff;background: #ffffff; padding:5px 0;");
}
const config$1 = {
v : version ,
version ,
// 主题名称
type : [
"primary" ,
"success" ,
"info" ,
"error" ,
"warning"
] ,
// 颜色部分, 本来可以通过scss的:export导出供js使用, 但是奈何nvue不支持
color : {
"u-primary" : "#2979ff" ,
"u-warning" : "#ff9900" ,
"u-success" : "#19be6b" ,
"u-error" : "#fa3534" ,
"u-info" : "#909399" ,
"u-main-color" : "#303133" ,
"u-content-color" : "#606266" ,
"u-tips-color" : "#909399" ,
"u-light-color" : "#c0c4cc"
} ,
// 默认单位, 可以通过配置为rpx, 那么在用于传入组件大小参数为数值时, 就默认为rpx
unit : "px"
} ;
const ActionSheet = {
// action-sheet组件
actionSheet : {
show : false ,
title : "" ,
description : "" ,
actions : ( ) => [ ] ,
index : "" ,
cancelText : "" ,
closeOnClickAction : true ,
safeAreaInsetBottom : true ,
openType : "" ,
closeOnClickOverlay : true ,
round : 0
}
} ;
const Album = {
// album 组件
album : {
urls : ( ) => [ ] ,
keyName : "" ,
singleSize : 180 ,
multipleSize : 70 ,
space : 6 ,
singleMode : "scaleToFill" ,
multipleMode : "aspectFill" ,
maxCount : 9 ,
previewFullImage : true ,
rowCount : 3 ,
showMore : true
}
} ;
const Alert = {
// alert警告组件
alert : {
title : "" ,
type : "warning" ,
description : "" ,
closable : false ,
showIcon : false ,
effect : "light" ,
center : false ,
fontSize : 14
}
} ;
const Avatar = {
// avatar 组件
avatar : {
src : "" ,
shape : "circle" ,
size : 40 ,
mode : "scaleToFill" ,
text : "" ,
bgColor : "#c0c4cc" ,
color : "#ffffff" ,
fontSize : 18 ,
icon : "" ,
mpAvatar : false ,
randomBgColor : false ,
defaultUrl : "" ,
colorIndex : "" ,
name : ""
}
} ;
const AvatarGroup = {
// avatarGroup 组件
avatarGroup : {
urls : ( ) => [ ] ,
maxCount : 5 ,
shape : "circle" ,
mode : "scaleToFill" ,
showMore : true ,
size : 40 ,
keyName : "" ,
gap : 0.5 ,
extraValue : 0
}
} ;
const Backtop = {
// backtop组件
backtop : {
mode : "circle" ,
icon : "arrow-upward" ,
text : "" ,
duration : 100 ,
scrollTop : 0 ,
top : 400 ,
bottom : 100 ,
right : 20 ,
zIndex : 9 ,
iconStyle : ( ) => ( {
color : "#909399" ,
fontSize : "19px"
} )
}
} ;
const Badge = {
// 徽标数组件
badge : {
isDot : false ,
value : "" ,
show : true ,
max : 999 ,
type : "error" ,
showZero : false ,
bgColor : null ,
color : null ,
shape : "circle" ,
numberType : "overflow" ,
offset : ( ) => [ ] ,
inverted : false ,
absolute : false
}
} ;
const Button = {
// button组件
button : {
hairline : false ,
type : "info" ,
size : "normal" ,
shape : "square" ,
plain : false ,
disabled : false ,
loading : false ,
loadingText : "" ,
loadingMode : "spinner" ,
loadingSize : 15 ,
openType : "" ,
formType : "" ,
appParameter : "" ,
hoverStopPropagation : true ,
lang : "en" ,
sessionFrom : "" ,
sendMessageTitle : "" ,
sendMessagePath : "" ,
sendMessageImg : "" ,
showMessageCard : false ,
dataName : "" ,
throttleTime : 0 ,
hoverStartTime : 0 ,
hoverStayTime : 200 ,
text : "" ,
icon : "" ,
iconColor : "" ,
color : ""
}
} ;
2023-10-20 18:45:15 +08:00
const Calendar$1 = {
2023-10-17 16:02:55 +08:00
// calendar 组件
calendar : {
title : "日期选择" ,
showTitle : true ,
showSubtitle : true ,
mode : "single" ,
startText : "开始" ,
endText : "结束" ,
customList : ( ) => [ ] ,
color : "#3c9cff" ,
minDate : 0 ,
maxDate : 0 ,
defaultDate : null ,
maxCount : Number . MAX _SAFE _INTEGER ,
// Infinity
rowHeight : 56 ,
formatter : null ,
showLunar : false ,
showMark : true ,
confirmText : "确定" ,
confirmDisabledText : "确定" ,
show : false ,
closeOnClickOverlay : false ,
readonly : false ,
showConfirm : true ,
maxRange : Number . MAX _SAFE _INTEGER ,
// Infinity
rangePrompt : "" ,
showRangePrompt : true ,
allowSameDay : false ,
round : 0 ,
monthNum : 3
}
} ;
const CarKeyboard = {
// 车牌号键盘
carKeyboard : {
random : false
}
} ;
const Cell = {
// cell组件的props
cell : {
customClass : "" ,
title : "" ,
label : "" ,
value : "" ,
icon : "" ,
disabled : false ,
border : true ,
center : false ,
url : "" ,
linkType : "navigateTo" ,
clickable : false ,
isLink : false ,
required : false ,
arrowDirection : "" ,
iconStyle : { } ,
rightIconStyle : { } ,
rightIcon : "arrow-right" ,
titleStyle : { } ,
size : "" ,
stop : true ,
name : ""
}
} ;
const CellGroup = {
// cell-group组件的props
cellGroup : {
title : "" ,
border : true ,
customStyle : { }
}
} ;
const Checkbox = {
// checkbox组件
checkbox : {
name : "" ,
shape : "" ,
size : "" ,
checkbox : false ,
disabled : "" ,
activeColor : "" ,
inactiveColor : "" ,
iconSize : "" ,
iconColor : "" ,
label : "" ,
labelSize : "" ,
labelColor : "" ,
labelDisabled : ""
}
} ;
const CheckboxGroup = {
// checkbox-group组件
checkboxGroup : {
name : "" ,
value : ( ) => [ ] ,
shape : "square" ,
disabled : false ,
activeColor : "#2979ff" ,
inactiveColor : "#c8c9cc" ,
size : 18 ,
placement : "row" ,
labelSize : 14 ,
labelColor : "#303133" ,
labelDisabled : false ,
iconColor : "#ffffff" ,
iconSize : 12 ,
iconPlacement : "left" ,
borderBottom : false
}
} ;
const CircleProgress = {
// circleProgress 组件
circleProgress : {
percentage : 30
}
} ;
const Code = {
// code 组件
code : {
seconds : 60 ,
startText : "获取验证码" ,
changeText : "X秒重新获取" ,
endText : "重新获取" ,
keepRunning : false ,
uniqueKey : ""
}
} ;
const CodeInput = {
// codeInput 组件
codeInput : {
adjustPosition : true ,
maxlength : 6 ,
dot : false ,
mode : "box" ,
hairline : false ,
space : 10 ,
value : "" ,
focus : false ,
bold : false ,
color : "#606266" ,
fontSize : 18 ,
size : 35 ,
disabledKeyboard : false ,
borderColor : "#c9cacc" ,
disabledDot : true
}
} ;
const Col = {
// col 组件
col : {
span : 12 ,
offset : 0 ,
justify : "start" ,
align : "stretch" ,
textAlign : "left"
}
} ;
const Collapse = {
// collapse 组件
collapse : {
value : null ,
accordion : false ,
border : true
}
} ;
const CollapseItem = {
// collapseItem 组件
collapseItem : {
title : "" ,
value : "" ,
label : "" ,
disabled : false ,
isLink : true ,
clickable : true ,
border : true ,
align : "left" ,
name : "" ,
icon : "" ,
duration : 300
}
} ;
const ColumnNotice = {
// columnNotice 组件
columnNotice : {
text : "" ,
icon : "volume" ,
mode : "" ,
color : "#f9ae3d" ,
bgColor : "#fdf6ec" ,
fontSize : 14 ,
speed : 80 ,
step : false ,
duration : 1500 ,
disableTouch : true
}
} ;
const CountDown = {
// u-count-down 计时器组件
countDown : {
time : 0 ,
format : "HH:mm:ss" ,
autoStart : true ,
millisecond : false
}
} ;
const CountTo = {
// countTo 组件
countTo : {
startVal : 0 ,
endVal : 0 ,
duration : 2e3 ,
autoplay : true ,
decimals : 0 ,
useEasing : true ,
decimal : "." ,
color : "#606266" ,
fontSize : 22 ,
bold : false ,
separator : ""
}
} ;
const DatetimePicker = {
// datetimePicker 组件
datetimePicker : {
show : false ,
showToolbar : true ,
value : "" ,
title : "" ,
mode : "datetime" ,
maxDate : new Date ( ( /* @__PURE__ */ new Date ( ) ) . getFullYear ( ) + 10 , 0 , 1 ) . getTime ( ) ,
minDate : new Date ( ( /* @__PURE__ */ new Date ( ) ) . getFullYear ( ) - 10 , 0 , 1 ) . getTime ( ) ,
minHour : 0 ,
maxHour : 23 ,
minMinute : 0 ,
maxMinute : 59 ,
filter : null ,
formatter : null ,
loading : false ,
itemHeight : 44 ,
cancelText : "取消" ,
confirmText : "确认" ,
cancelColor : "#909193" ,
confirmColor : "#3c9cff" ,
visibleItemCount : 5 ,
closeOnClickOverlay : false ,
defaultIndex : ( ) => [ ]
}
} ;
const Divider = {
// divider组件
divider : {
dashed : false ,
hairline : true ,
dot : false ,
textPosition : "center" ,
text : "" ,
textSize : 14 ,
textColor : "#909399" ,
lineColor : "#dcdfe6"
}
} ;
const Empty = {
// empty组件
empty : {
icon : "" ,
text : "" ,
textColor : "#c0c4cc" ,
textSize : 14 ,
iconColor : "#c0c4cc" ,
iconSize : 90 ,
mode : "data" ,
width : 160 ,
height : 160 ,
show : true ,
marginTop : 0
}
} ;
const Form = {
// form 组件
form : {
model : ( ) => ( { } ) ,
rules : ( ) => ( { } ) ,
errorType : "message" ,
borderBottom : true ,
labelPosition : "left" ,
labelWidth : 45 ,
labelAlign : "left" ,
labelStyle : ( ) => ( { } )
}
} ;
const GormItem = {
// formItem 组件
formItem : {
label : "" ,
prop : "" ,
borderBottom : "" ,
labelWidth : "" ,
rightIcon : "" ,
leftIcon : "" ,
required : false ,
leftIconStyle : ""
}
} ;
const Gap = {
// gap组件
gap : {
bgColor : "transparent" ,
height : 20 ,
marginTop : 0 ,
marginBottom : 0 ,
customStyle : { }
}
} ;
const Grid = {
// grid组件
grid : {
col : 3 ,
border : false ,
align : "left"
}
} ;
const GridItem = {
// grid-item组件
gridItem : {
name : null ,
bgColor : "transparent"
}
} ;
const {
color : color$3
} = config$1 ;
const Icon = {
// icon组件
icon : {
name : "" ,
color : color$3 [ "u-content-color" ] ,
size : "16px" ,
bold : false ,
index : "" ,
hoverClass : "" ,
customPrefix : "uicon" ,
label : "" ,
labelPos : "right" ,
labelSize : "15px" ,
labelColor : color$3 [ "u-content-color" ] ,
space : "3px" ,
imgMode : "" ,
width : "" ,
height : "" ,
top : 0 ,
stop : false
}
} ;
const Image = {
// image组件
image : {
src : "" ,
mode : "aspectFill" ,
width : "300" ,
height : "225" ,
shape : "square" ,
radius : 0 ,
lazyLoad : true ,
showMenuByLongpress : true ,
loadingIcon : "photo" ,
errorIcon : "error-circle" ,
showLoading : true ,
showError : true ,
fade : true ,
webp : false ,
duration : 500 ,
bgColor : "#f3f4f6"
}
} ;
const IndexAnchor = {
// indexAnchor 组件
indexAnchor : {
text : "" ,
color : "#606266" ,
size : 14 ,
bgColor : "#dedede" ,
height : 32
}
} ;
const IndexList = {
// indexList 组件
indexList : {
inactiveColor : "#606266" ,
activeColor : "#5677fc" ,
indexList : ( ) => [ ] ,
sticky : true ,
customNavHeight : 0
}
} ;
const Input = {
// index 组件
input : {
value : "" ,
type : "text" ,
fixed : false ,
disabled : false ,
disabledColor : "#f5f7fa" ,
clearable : false ,
password : false ,
maxlength : - 1 ,
placeholder : null ,
placeholderClass : "input-placeholder" ,
placeholderStyle : "color: #c0c4cc" ,
showWordLimit : false ,
confirmType : "done" ,
confirmHold : false ,
holdKeyboard : false ,
focus : false ,
autoBlur : false ,
disableDefaultPadding : false ,
cursor : - 1 ,
cursorSpacing : 30 ,
selectionStart : - 1 ,
selectionEnd : - 1 ,
adjustPosition : true ,
inputAlign : "left" ,
fontSize : "15px" ,
color : "#303133" ,
prefixIcon : "" ,
prefixIconStyle : "" ,
suffixIcon : "" ,
suffixIconStyle : "" ,
border : "surround" ,
readonly : false ,
shape : "square" ,
formatter : null
}
} ;
const Keyboard = {
// 键盘组件
keyboard : {
mode : "number" ,
dotDisabled : false ,
tooltip : true ,
showTips : true ,
tips : "" ,
showCancel : true ,
showConfirm : true ,
random : false ,
safeAreaInsetBottom : true ,
closeOnClickOverlay : true ,
show : false ,
overlay : true ,
zIndex : 10075 ,
cancelText : "取消" ,
confirmText : "确定" ,
autoChange : false
}
} ;
const Line = {
// line组件
line : {
color : "#d6d7d9" ,
length : "100%" ,
direction : "row" ,
hairline : true ,
margin : 0 ,
dashed : false
}
} ;
const LineProgress = {
// lineProgress 组件
lineProgress : {
activeColor : "#19be6b" ,
inactiveColor : "#ececec" ,
percentage : 0 ,
showText : true ,
height : 12
}
} ;
const {
color : color$2
} = config$1 ;
const Link = {
// link超链接组件props参数
link : {
color : color$2 [ "u-primary" ] ,
fontSize : 15 ,
underLine : false ,
href : "" ,
mpTips : "链接已复制,请在浏览器打开" ,
lineColor : "" ,
text : ""
}
} ;
const List = {
// list 组件
list : {
showScrollbar : false ,
lowerThreshold : 50 ,
upperThreshold : 0 ,
scrollTop : 0 ,
offsetAccuracy : 10 ,
enableFlex : false ,
pagingEnabled : false ,
scrollable : true ,
scrollIntoView : "" ,
scrollWithAnimation : false ,
enableBackToTop : false ,
height : 0 ,
width : 0 ,
preLoadScreen : 1
}
} ;
const ListItem = {
// listItem 组件
listItem : {
anchor : ""
}
} ;
const {
color : color$1
} = config$1 ;
const LoadingIcon = {
// loading-icon加载中图标组件
loadingIcon : {
show : true ,
color : color$1 [ "u-tips-color" ] ,
textColor : color$1 [ "u-tips-color" ] ,
vertical : false ,
mode : "spinner" ,
size : 24 ,
textSize : 15 ,
text : "" ,
timingFunction : "ease-in-out" ,
duration : 1200 ,
inactiveColor : ""
}
} ;
const LoadingPage = {
// loading-page组件
loadingPage : {
loadingText : "正在加载" ,
image : "" ,
loadingMode : "circle" ,
loading : false ,
bgColor : "#ffffff" ,
color : "#C8C8C8" ,
fontSize : 19 ,
iconSize : 28 ,
loadingColor : "#C8C8C8"
}
} ;
const Loadmore = {
// loadmore 组件
loadmore : {
status : "loadmore" ,
bgColor : "transparent" ,
icon : true ,
fontSize : 14 ,
iconSize : 17 ,
color : "#606266" ,
loadingIcon : "spinner" ,
loadmoreText : "加载更多" ,
loadingText : "正在加载..." ,
nomoreText : "没有更多了" ,
isDot : false ,
iconColor : "#b7b7b7" ,
marginTop : 10 ,
marginBottom : 10 ,
height : "auto" ,
line : false ,
lineColor : "#E6E8EB" ,
dashed : false
}
} ;
const Modal = {
// modal 组件
modal : {
show : false ,
title : "" ,
content : "" ,
confirmText : "确认" ,
cancelText : "取消" ,
showConfirmButton : true ,
showCancelButton : false ,
confirmColor : "#2979ff" ,
cancelColor : "#606266" ,
buttonReverse : false ,
zoom : true ,
asyncClose : false ,
closeOnClickOverlay : false ,
negativeTop : 0 ,
width : "650rpx" ,
confirmButtonShape : ""
}
} ;
const color = {
primary : "#3c9cff" ,
info : "#909399" ,
default : "#909399" ,
warning : "#f9ae3d" ,
error : "#f56c6c" ,
success : "#5ac725" ,
mainColor : "#303133" ,
contentColor : "#606266" ,
tipsColor : "#909399" ,
lightColor : "#c0c4cc" ,
borderColor : "#e4e7ed"
} ;
const Navbar = {
// navbar 组件
navbar : {
safeAreaInsetTop : true ,
placeholder : false ,
fixed : true ,
border : false ,
leftIcon : "arrow-left" ,
leftText : "" ,
rightText : "" ,
rightIcon : "" ,
title : "" ,
bgColor : "#ffffff" ,
titleWidth : "400rpx" ,
height : "44px" ,
leftIconSize : 20 ,
leftIconColor : color . mainColor ,
autoBack : false ,
titleStyle : ""
}
} ;
const NoNetwork = {
// noNetwork
noNetwork : {
tips : "哎呀,网络信号丢失" ,
zIndex : "" ,
image : " data : image / png ; base64 , iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABLKADAAQAAAABAAABLAAAAADYYILnAABAAElEQVR4Ae29CZhkV3kefNeq6m2W7tn3nl0aCbHIAgmQPGB + sLCNzSID9g9PYrAf57d / + 4 + DiW0cy8QBJ06c2In / PLFDHJ78 + MGCGNsYgyxwIwktwEijAc1ohtmnZ + 2 Z7p5eq6vu9r / vuXWrq25VdVV1V3dXVX9Hmj73nv285963vvOd75yraeIEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQaD8E9PbrkvRopSMwMBBYRs + 5 O / yJS68cPnzYXel4tFP / jXbqjPRFEAiCQNe6Bw / 6 gdFn9Oy9Q90LLG2DgBBW2wyldIQIPPPCte2a5q3jtR + 4 ff / 4 wuBuXotrDwSEsNpjHKUXQODppy + udYJMEUEZgbd94DvnNwlA7YGAEFZ7jOOK78Xp06eTTkq7sxwQhmXuf / 754 VXl4iSstRAQwmqt8ZLWlkHg0UcD49qYfUjXfLtMtOZ7npExJu4iqZWLl7DWQUAIq3XGSlpaAYHD77q8xwuCOSUoXw8Sl0eMux977DGzQjES3AIICGG1wCBJEysj8PXnz230XXdr5RQFMYbRvWnv6w8UhMhliyGwYghr4Pjg3oEXL34ey9zyC9tiD2ml5h47dr1LN7S6CMjz / A3PvHh1Z6UyJby5EVgRhKUe7Kz / JU0LfvrJo5f + Y3MPibSuFgQGBgasYSd9l6GDsup0WS / T / 9 RTp9fXmU2SNwECdQ92E7S57iaMeJnPQLK6ixkDLfjlb7546RfrLkQyNBcC3dsP6oHWMd9G + V3JgwPHh7rnm1 / yLQ8CbU9Y33zp0j + nZFUMb / DHmB7 + SHGY3LUKAk8cObtD00xlHDrfNge + Z2ozU3c9dvx4Yr5lSL6lR6CtCWvg6OAPw9z538ZhhZRl6XrwhW8du1KX / iNejtwvPQIDR8 + vSRqJ / obU7GupjdNdh2gW0ZDypJBFR6BtB2rg2OVtuub9JcmpHIpBoK1xfffLzx4f7C0XL2HNiYDp6bs9z23Ypn1fC1Y / 9 PCFDc3ZW2lVHIG2JKzTp4Ok7nv / G6Q054MIvda + bNb74pEgKGtwGAdL7pcfAa8vOKEZ2kyjWuLr7uDh + / q v N 6 o 8 K W d x E W h L w r o y e e k / g 4 z u q w U 6 k N r h y Z c u / U k t a S X N 8 i N w u L 9 / R u v V X t J 9 P b P Q 1 v h m c P 6 t 9 + 4 7 u 9 B y J P / S I d B 2 h D V w 9 M J H Q F Y f r Q d C p h 8 4 e v F X 6 8 k j a Z c P A Z J W w j M X R F p J 2 z r 9 1 t f u v r h 8 v Z C a 5 4 N A 2 x G W r u n v m g 8 Q W C J / N 4 i r 7 f C Y D x a t k O e B B 7 a n 5 0 1 a g X b y g V d v v 9 I K / Z Q 2 F i P Q d i 9 o s G b H + z R N f 7 y 4 m 9 X u 9 M e 7 N 9 n v 0 H X d r 5 Z S 4 p s H g X p J C 9 P / w D R T x 0 V n 1 T x j W G 9 L G r b a U m / F i 5 m e S v c r k x f / C g / o w 9 X q A U k 9 1 v 3 q H T 9 7 r 6 4 7 1 d J K f H M i 8 O y z g x 1 Z 0 3 t 1 Y A Q V T 2 M w g s C 3 u + y X H z i 0 f a Q 5 e y G t q g W B t p O w 2 O l 9 + / T M + s T O n 8 L 0 8 M t z g Q C y + t O H X r 3 j A 0 J W c 6 H U / H F 5 S c s s r 4 j X c Y q f P 6 V / T 8 i q + c e y W g v b U s K K O n 3 8 e J A Y y l 5 6 T A u C E r 2 W Y e i / / 9 C r d / 5 G l F b 8 1 k d A S V o p S F r e r K R l a o Z j 9 H R + 7 0 0 H 1 0 + 0 f g + l B 2 1 N W B x e 2 l h N H s U p D Z r 2 7 m i 4 d V 3 7 9 R 9 + z a 4 / i O 7 F b x 8 E C k n L C P T s T D J 1 7 O 3 3 b J p q n x 6 u 7 J 6 0 P W F x e A c C b M V 5 6 d J f Q K f 1 b k M L f u G h 1 + 7 6 z M o e 9 v b u P U n L s b 2 D t m O e 5 H S x v X s r v W t L B E h a T x 2 9 + M a 2 7 J x 0 S h A Q B A Q B Q U A Q E A Q E A U F A E B A E B A F B Q B A Q B A Q B Q U A Q E A Q E A U F A E B A E B A F B Q B A Q B A Q B Q U A Q a E s E V o Q d V l u O 3 B J 0 6 p t H L 3 4 b 1 X R j p 4 C h 6 R q 2 4 + k m j G 4 N w w g + 9 u A 9 u / 7 3 E j R B q h A E i h A o e 3 x w U Q q 5 W T Y E z p 0 b 3 Z n V / N c f 6 O / 9 A v Y 9 w l h / 6 d y 3 X 7 n c N 5 1 2 Z w 9 B V L X j u A P 4 n p 4 4 v n Q t k Z o E g V k E h L B m s W i K q w s X p j b P B O n 3 g R f e n w n c + 7 G B e + z s j c l v o n F D S 9 n A 9 I y / u 3 x 9 + v A P 3 7 3 5 V P k 4 C R U E F h c B I a z F x b f m 0 k 9 f H D 7 k + v 4 n Q F a P Q I r x 8 G m y x / G J 0 J / t 7 e z 7 m w 0 b 9 M m a C 2 p Q Q g h 0 / Z S m 4 g 5 T w u e W W t q L t 0 H u V y 4 C Q l j L P P Y n B 0 d e p T n + b 3 t + 8 B 4 t 0 A d B U v 9 3 h 2 H 9 x c 6 d a 0 a X s 2 m + r 1 W Q s L R n l 7 N d U v f K R k A I a 5 n G / / r 1 o G t s Z v j T g e v / k q Y H F / T A + A X o q v 4 n p J e m O E i Q U 1 E o 2 l + G 0 m o v B K 1 U B B P U 7 s 9 E 1 + I L A k u N g K w S L j X i q O / k h V t v A R H 8 d x D B R k M z P r F / V + 9 / B l G 5 y 9 C U q l X i n H v 9 m R P X t v u u s 8 8 L 9 H 3 J P v 2 z D 2 y X E x C q A i c J B I F W R w A v v 3 X q w q 0 / P n n + l v / K + Z v f P H 3 p 9 p 5 W 7 5 O 0 f x a B p 7 9 3 c e 3 A w I D M W m Y h a f i V g N t w S M s X e H p 4 e N X J C 8 N f 0 P A d R C i u f / X g r n W U q s q o t c v n l 9 D m R k C d w e X 4 b 9 N 7 + m / i h + m b M r a L M 1 4 y J V w c X I t K p T 1 V R v e + A r C 3 Q q n + 3 g M 7 1 3 2 j K E G Z m 6 t X g 8 6 J 7 O h D f u A / i H w P U p f U Z S f u 2 L 5 9 t X x E o Q x e y x k E g j K e O n L x H b 4 R q C + N Y 5 H 3 + 2 9 5 3 d 4 X l r N N 7 V q 3 E N Y i j + y Z w b G 9 j p t 9 G k B P Q 5 H 9 z g P 9 6 0 7 O V e W p 8 7 c O Q t n 9 z w J f + x D M N F f j + j r y P q X p x j 8 c 2 N n 7 P + S X e y 7 0 l i d u 4 I X z b 0 D N B 4 t r 9 7 5 1 + H V 7 z x S H y d 1 C E R D C W i i C c + Q P j U C n s a q m Z 6 2 O 5 I N 7 N / V U N P 4 8 e e 7 m A Z D T f 4 T t 0 4 9 i U G 4 G u v 4 Z f N L o s 9 U I b o 7 q J W o J E H j y + b P 7 f N s o O c n W 0 A 0 / a a c e f 8 P d G 2 8 s Q T N W T B V C W I s 0 1 O f P j 6 6 B p f q T m q 7 3 2 U n j g T 1 b e i + V q 4 p T v 7 H M 8 C e g 2 / o 1 q L Q u g 7 T + F a a M 3 I q T L Z d e w p o H g Y E j V 9 f p h v O j + O S h W a 5 V + C x v Z t p z v / L w G / a N l 4 u X s P o R w I + 4 u E Y j A J 2 G m d G 8 L 0 F K 2 m Y a + t s r k d X Z y + P 7 x 2 Z u H d W 1 4 P + B L d a n k 9 q 6 Q w d 3 r f + c k F W j R 6 T x 5 Q 2 c P 5 8 K 9 J m 3 V C I r 1 o g t 4 8 l O 2 3 7 r 3 / / 9 6 Y o f e G 1 8 y 9 q 7 R F k l X I T x P X V + 5 D c h K b 3 Z D M y 3 7 N u 5 t u x G 4 R 9 c H H 6 b 4 2 Q f A z l d s + 3 E P X u 2 r f r B I j R F i l w k B I I R 7 S H o J D u r F U 8 9 Z O d 6 8 0 G k e 6 J a W o m v j o B I W N U x q i v F D 8 7 f e j 0 e 0 n 8 F w v r 0 / t 1 r n y q X + Q f n R z 7 g + 8 F X 8 R v 8 v L 3 a u F / I q h x K z R 2 W C P x X q K e q 3 k r D T d j 2 i e r p J E U t C I g O q x a U a k w z N B R 0 D 0 9 y i q e P H O j v e y O k p x L r 9 V M X b 7 3 V 9 7 S / h 3 n D X x 7 Y 2 f d P k A Y b n c W 1 I g I D x y 5 v M 7 L Z t / h g r n L t x y a B r J N x v / 7 2 N + 6 t u N h S L p + E V U Z A C K s y N n X H v H L + 1 q c g N f 2 K b S X u 2 b t 9 d c m S 9 q l z o / f A R g c m C t p z B 3 b 1 / V g 5 Q i u s l L o w E N y
}
} ;
const NoticeBar = {
// noticeBar
noticeBar : {
text : ( ) => [ ] ,
direction : "row" ,
step : false ,
icon : "volume" ,
mode : "" ,
color : "#f9ae3d" ,
bgColor : "#fdf6ec" ,
speed : 80 ,
fontSize : 14 ,
duration : 2e3 ,
disableTouch : true ,
url : "" ,
linkType : "navigateTo"
}
} ;
const Notify = {
// notify组件
notify : {
top : 0 ,
type : "primary" ,
color : "#ffffff" ,
bgColor : "" ,
message : "" ,
duration : 3e3 ,
fontSize : 15 ,
safeAreaInsetTop : false
}
} ;
const NumberBox = {
// 步进器组件
numberBox : {
name : "" ,
value : 0 ,
min : 1 ,
max : Number . MAX _SAFE _INTEGER ,
step : 1 ,
integer : false ,
disabled : false ,
disabledInput : false ,
asyncChange : false ,
inputWidth : 35 ,
showMinus : true ,
showPlus : true ,
decimalLength : null ,
longPress : true ,
color : "#323233" ,
buttonSize : 30 ,
bgColor : "#EBECEE" ,
cursorSpacing : 100 ,
disableMinus : false ,
disablePlus : false ,
iconStyle : ""
}
} ;
const NumberKeyboard = {
// 数字键盘
numberKeyboard : {
mode : "number" ,
dotDisabled : false ,
random : false
}
} ;
const Overlay = {
// overlay组件
overlay : {
show : false ,
zIndex : 10070 ,
duration : 300 ,
opacity : 0.5
}
} ;
const Parse = {
// parse
parse : {
copyLink : true ,
errorImg : "" ,
lazyLoad : false ,
loadingImg : "" ,
pauseVideo : true ,
previewImg : true ,
setTitle : true ,
showImgMenu : true
}
} ;
const Picker = {
// picker
picker : {
show : false ,
showToolbar : true ,
title : "" ,
columns : ( ) => [ ] ,
loading : false ,
itemHeight : 44 ,
cancelText : "取消" ,
confirmText : "确定" ,
cancelColor : "#909193" ,
confirmColor : "#3c9cff" ,
visibleItemCount : 5 ,
keyName : "text" ,
closeOnClickOverlay : false ,
defaultIndex : ( ) => [ ] ,
immediateChange : false
}
} ;
const Popup = {
// popup组件
popup : {
show : false ,
overlay : true ,
mode : "bottom" ,
duration : 300 ,
closeable : false ,
overlayStyle : ( ) => {
} ,
closeOnClickOverlay : true ,
zIndex : 10075 ,
safeAreaInsetBottom : true ,
safeAreaInsetTop : false ,
closeIconPos : "top-right" ,
round : 0 ,
zoom : true ,
bgColor : "" ,
overlayOpacity : 0.5
}
} ;
const Radio = {
// radio组件
radio : {
name : "" ,
shape : "" ,
disabled : "" ,
labelDisabled : "" ,
activeColor : "" ,
inactiveColor : "" ,
iconSize : "" ,
labelSize : "" ,
label : "" ,
labelColor : "" ,
size : "" ,
iconColor : "" ,
placement : ""
}
} ;
const RadioGroup = {
// radio-group组件
radioGroup : {
value : "" ,
disabled : false ,
shape : "circle" ,
activeColor : "#2979ff" ,
inactiveColor : "#c8c9cc" ,
name : "" ,
size : 18 ,
placement : "row" ,
label : "" ,
labelColor : "#303133" ,
labelSize : 14 ,
labelDisabled : false ,
iconColor : "#ffffff" ,
iconSize : 12 ,
borderBottom : false ,
iconPlacement : "left"
}
} ;
const Rate = {
// rate组件
rate : {
value : 1 ,
count : 5 ,
disabled : false ,
size : 18 ,
inactiveColor : "#b2b2b2" ,
activeColor : "#FA3534" ,
gutter : 4 ,
minCount : 1 ,
allowHalf : false ,
activeIcon : "star-fill" ,
inactiveIcon : "star" ,
touchable : true
}
} ;
const ReadMore = {
// readMore
readMore : {
showHeight : 400 ,
toggle : false ,
closeText : "展开阅读全文" ,
openText : "收起" ,
color : "#2979ff" ,
fontSize : 14 ,
textIndent : "2em" ,
name : ""
}
} ;
const Row = {
// row
row : {
gutter : 0 ,
justify : "start" ,
align : "center"
}
} ;
const RowNotice = {
// rowNotice
rowNotice : {
text : "" ,
icon : "volume" ,
mode : "" ,
color : "#f9ae3d" ,
bgColor : "#fdf6ec" ,
fontSize : 14 ,
speed : 80
}
} ;
const ScrollList = {
// scrollList
scrollList : {
indicatorWidth : 50 ,
indicatorBarWidth : 20 ,
indicator : true ,
indicatorColor : "#f2f2f2" ,
indicatorActiveColor : "#3c9cff" ,
indicatorStyle : ""
}
} ;
const Search = {
// search
search : {
shape : "round" ,
bgColor : "#f2f2f2" ,
placeholder : "请输入关键字" ,
clearabled : true ,
focus : false ,
showAction : true ,
actionStyle : ( ) => ( { } ) ,
actionText : "搜索" ,
inputAlign : "left" ,
inputStyle : ( ) => ( { } ) ,
disabled : false ,
borderColor : "transparent" ,
searchIconColor : "#909399" ,
searchIconSize : 22 ,
color : "#606266" ,
placeholderColor : "#909399" ,
searchIcon : "search" ,
margin : "0" ,
animation : false ,
value : "" ,
maxlength : "-1" ,
height : 32 ,
label : null
}
} ;
const Section = {
// u-section组件
section : {
title : "" ,
subTitle : "更多" ,
right : true ,
fontSize : 15 ,
bold : true ,
color : "#303133" ,
subColor : "#909399" ,
showLine : true ,
lineColor : "" ,
arrow : true
}
} ;
const Skeleton = {
// skeleton
skeleton : {
loading : true ,
animate : true ,
rows : 0 ,
rowsWidth : "100%" ,
rowsHeight : 18 ,
title : true ,
titleWidth : "50%" ,
titleHeight : 18 ,
avatar : false ,
avatarSize : 32 ,
avatarShape : "circle"
}
} ;
const Slider = {
// slider组件
slider : {
value : 0 ,
blockSize : 18 ,
min : 0 ,
max : 100 ,
step : 1 ,
activeColor : "#2979ff" ,
inactiveColor : "#c0c4cc" ,
blockColor : "#ffffff" ,
showValue : false ,
disabled : false ,
blockStyle : ( ) => {
}
}
} ;
const StatusBar = {
// statusBar
statusBar : {
bgColor : "transparent"
}
} ;
const Steps = {
// steps组件
steps : {
direction : "row" ,
current : 0 ,
activeColor : "#3c9cff" ,
inactiveColor : "#969799" ,
activeIcon : "" ,
inactiveIcon : "" ,
dot : false
}
} ;
const StepsItem = {
// steps-item组件
stepsItem : {
title : "" ,
desc : "" ,
iconSize : 17 ,
error : false
}
} ;
const Sticky = {
// sticky组件
sticky : {
offsetTop : 0 ,
customNavHeight : 0 ,
disabled : false ,
bgColor : "transparent" ,
zIndex : "" ,
index : ""
}
} ;
const Subsection = {
// subsection组件
subsection : {
list : [ ] ,
current : 0 ,
activeColor : "#3c9cff" ,
inactiveColor : "#303133" ,
mode : "button" ,
fontSize : 12 ,
bold : true ,
bgColor : "#eeeeef" ,
keyName : "name"
}
} ;
const SwipeAction = {
// swipe-action组件
swipeAction : {
autoClose : true
}
} ;
const SwipeActionItem = {
// swipeActionItem 组件
swipeActionItem : {
show : false ,
name : "" ,
disabled : false ,
threshold : 20 ,
autoClose : true ,
options : [ ] ,
duration : 300
}
} ;
const Swiper = {
// swiper 组件
swiper : {
list : ( ) => [ ] ,
indicator : false ,
indicatorActiveColor : "#FFFFFF" ,
indicatorInactiveColor : "rgba(255, 255, 255, 0.35)" ,
indicatorStyle : "" ,
indicatorMode : "line" ,
autoplay : true ,
current : 0 ,
currentItemId : "" ,
interval : 3e3 ,
duration : 300 ,
circular : false ,
previousMargin : 0 ,
nextMargin : 0 ,
acceleration : false ,
displayMultipleItems : 1 ,
easingFunction : "default" ,
keyName : "url" ,
imgMode : "aspectFill" ,
height : 130 ,
bgColor : "#f3f4f6" ,
radius : 4 ,
loading : false ,
showTitle : false
}
} ;
const SwipterIndicator = {
// swiperIndicator 组件
swiperIndicator : {
length : 0 ,
current : 0 ,
indicatorActiveColor : "" ,
indicatorInactiveColor : "" ,
indicatorMode : "line"
}
} ;
const Switch = {
// switch
switch : {
loading : false ,
disabled : false ,
size : 25 ,
activeColor : "#2979ff" ,
inactiveColor : "#ffffff" ,
value : false ,
activeValue : true ,
inactiveValue : false ,
asyncChange : false ,
space : 0
}
} ;
const Tabbar = {
// tabbar
tabbar : {
value : null ,
safeAreaInsetBottom : true ,
border : true ,
zIndex : 1 ,
activeColor : "#1989fa" ,
inactiveColor : "#7d7e80" ,
fixed : true ,
placeholder : true
}
} ;
const TabbarItem = {
//
tabbarItem : {
name : null ,
icon : "" ,
badge : null ,
dot : false ,
text : "" ,
badgeStyle : "top: 6px;right:2px;"
}
} ;
const Tabs = {
//
tabs : {
duration : 300 ,
list : ( ) => [ ] ,
lineColor : "#3c9cff" ,
activeStyle : ( ) => ( {
color : "#303133"
} ) ,
inactiveStyle : ( ) => ( {
color : "#606266"
} ) ,
lineWidth : 20 ,
lineHeight : 3 ,
lineBgSize : "cover" ,
itemStyle : ( ) => ( {
height : "44px"
} ) ,
scrollable : true ,
current : 0 ,
keyName : "name"
}
} ;
const Tag = {
// tag 组件
tag : {
type : "primary" ,
disabled : false ,
size : "medium" ,
shape : "square" ,
text : "" ,
bgColor : "" ,
color : "" ,
borderColor : "" ,
closeColor : "#C6C7CB" ,
name : "" ,
plainFill : false ,
plain : false ,
closable : false ,
show : true ,
icon : ""
}
} ;
const Text = {
// text 组件
text : {
type : "" ,
show : true ,
text : "" ,
prefixIcon : "" ,
suffixIcon : "" ,
mode : "" ,
href : "" ,
format : "" ,
call : false ,
openType : "" ,
bold : false ,
block : false ,
lines : "" ,
color : "#303133" ,
size : 15 ,
iconStyle : ( ) => ( {
fontSize : "15px"
} ) ,
decoration : "none" ,
margin : 0 ,
lineHeight : "" ,
align : "left" ,
wordWrap : "normal"
}
} ;
const Textarea = {
// textarea 组件
textarea : {
value : "" ,
placeholder : "" ,
placeholderClass : "textarea-placeholder" ,
placeholderStyle : "color: #c0c4cc" ,
height : 70 ,
confirmType : "done" ,
disabled : false ,
count : false ,
focus : false ,
autoHeight : false ,
fixed : false ,
cursorSpacing : 0 ,
cursor : "" ,
showConfirmBar : true ,
selectionStart : - 1 ,
selectionEnd : - 1 ,
adjustPosition : true ,
disableDefaultPadding : false ,
holdKeyboard : false ,
maxlength : 140 ,
border : "surround" ,
formatter : null
}
} ;
const Toast = {
// toast组件
toast : {
zIndex : 10090 ,
loading : false ,
text : "" ,
icon : "" ,
type : "" ,
loadingMode : "" ,
show : "" ,
overlay : false ,
position : "center" ,
params : ( ) => {
} ,
duration : 2e3 ,
isTab : false ,
url : "" ,
callback : null ,
back : false
}
} ;
const Toolbar = {
// toolbar 组件
toolbar : {
show : true ,
cancelText : "取消" ,
confirmText : "确认" ,
cancelColor : "#909193" ,
confirmColor : "#3c9cff" ,
title : ""
}
} ;
const Tooltip = {
// tooltip 组件
tooltip : {
text : "" ,
copyText : "" ,
size : 14 ,
color : "#606266" ,
bgColor : "transparent" ,
direction : "top" ,
zIndex : 10071 ,
showCopy : true ,
buttons : ( ) => [ ] ,
overlay : true ,
showToast : true
}
} ;
const Transition = {
// transition动画组件的props
transition : {
show : false ,
mode : "fade" ,
duration : "300" ,
timingFunction : "ease-out"
}
} ;
const Upload = {
// upload组件
upload : {
accept : "image" ,
capture : ( ) => [ "album" , "camera" ] ,
compressed : true ,
camera : "back" ,
maxDuration : 60 ,
uploadIcon : "camera-fill" ,
uploadIconColor : "#D3D4D6" ,
useBeforeRead : false ,
previewFullImage : true ,
maxCount : 52 ,
disabled : false ,
imageMode : "aspectFill" ,
name : "" ,
sizeType : ( ) => [ "original" , "compressed" ] ,
multiple : false ,
deletable : true ,
maxSize : Number . MAX _VALUE ,
fileList : ( ) => [ ] ,
uploadText : "" ,
width : 80 ,
height : 80 ,
previewImage : true
}
} ;
2023-10-20 18:45:15 +08:00
const props$b = {
2023-10-17 16:02:55 +08:00
... ActionSheet ,
... Album ,
... Alert ,
... Avatar ,
... AvatarGroup ,
... Backtop ,
... Badge ,
... Button ,
2023-10-20 18:45:15 +08:00
... Calendar$1 ,
2023-10-17 16:02:55 +08:00
... CarKeyboard ,
... Cell ,
... CellGroup ,
... Checkbox ,
... CheckboxGroup ,
... CircleProgress ,
... Code ,
... CodeInput ,
... Col ,
... Collapse ,
... CollapseItem ,
... ColumnNotice ,
... CountDown ,
... CountTo ,
... DatetimePicker ,
... Divider ,
... Empty ,
... Form ,
... GormItem ,
... Gap ,
... Grid ,
... GridItem ,
... Icon ,
... Image ,
... IndexAnchor ,
... IndexList ,
... Input ,
... Keyboard ,
... Line ,
... LineProgress ,
... Link ,
... List ,
... ListItem ,
... LoadingIcon ,
... LoadingPage ,
... Loadmore ,
... Modal ,
... Navbar ,
... NoNetwork ,
... NoticeBar ,
... Notify ,
... NumberBox ,
... NumberKeyboard ,
... Overlay ,
... Parse ,
... Picker ,
... Popup ,
... Radio ,
... RadioGroup ,
... Rate ,
... ReadMore ,
... Row ,
... RowNotice ,
... ScrollList ,
... Search ,
... Section ,
... Skeleton ,
... Slider ,
... StatusBar ,
... Steps ,
... StepsItem ,
... Sticky ,
... Subsection ,
... SwipeAction ,
... SwipeActionItem ,
... Swiper ,
... SwipterIndicator ,
... Switch ,
... Tabbar ,
... TabbarItem ,
... Tabs ,
... Tag ,
... Text ,
... Textarea ,
... Toast ,
... Toolbar ,
... Tooltip ,
... Transition ,
... Upload
} ;
2023-10-20 18:45:15 +08:00
const props$a = {
2023-10-17 16:02:55 +08:00
props : {
2023-10-20 18:45:15 +08:00
// 图标类名
name : {
2023-10-17 16:02:55 +08:00
type : String ,
2023-10-20 18:45:15 +08:00
default : props$b . icon . name
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 图标颜色,可接受主题色
color : {
2023-10-17 16:02:55 +08:00
type : String ,
2023-10-20 18:45:15 +08:00
default : props$b . icon . color
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 字体大小, 单位px
2023-10-17 16:02:55 +08:00
size : {
type : [ String , Number ] ,
2023-10-20 18:45:15 +08:00
default : props$b . icon . size
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 是否显示粗体
bold : {
type : Boolean ,
default : props$b . icon . bold
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 点击图标的时候传递事件出去的index( 用于区分点击了哪一个)
index : {
2023-10-17 16:02:55 +08:00
type : [ String , Number ] ,
2023-10-20 18:45:15 +08:00
default : props$b . icon . index
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 触摸图标时的类名
hoverClass : {
2023-10-17 16:02:55 +08:00
type : String ,
2023-10-20 18:45:15 +08:00
default : props$b . icon . hoverClass
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 自定义扩展前缀,方便用户扩展自己的图标库
customPrefix : {
type : String ,
default : props$b . icon . customPrefix
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 图标右边或者下面的文字
label : {
type : [ String , Number ] ,
default : props$b . icon . label
} ,
// label的位置, 只能右边或者下边
labelPos : {
type : String ,
default : props$b . icon . labelPos
} ,
// label的大小
labelSize : {
type : [ String , Number ] ,
default : props$b . icon . labelSize
} ,
// label的颜色
labelColor : {
type : String ,
default : props$b . icon . labelColor
} ,
// label与图标的距离
space : {
type : [ String , Number ] ,
default : props$b . icon . space
} ,
// 图片的mode
imgMode : {
2023-10-17 16:02:55 +08:00
type : String ,
2023-10-20 18:45:15 +08:00
default : props$b . icon . imgMode
} ,
// 用于显示图片小图标时,图片的宽度
width : {
type : [ String , Number ] ,
default : props$b . icon . width
} ,
// 用于显示图片小图标时,图片的高度
height : {
type : [ String , Number ] ,
default : props$b . icon . height
} ,
// 用于解决某些情况下,让图标垂直居中的用途
top : {
type : [ String , Number ] ,
default : props$b . icon . top
} ,
// 是否阻止事件传播
stop : {
type : Boolean ,
default : props$b . icon . stop
2023-10-17 16:02:55 +08:00
}
}
} ;
const mpMixin = { } ;
const mixin = {
// 定义每个组件都可能需要用到的外部样式以及类名
props : {
// 每个组件都有的父组件传递的样式,可以为字符串或者对象形式
customStyle : {
type : [ Object , String ] ,
default : ( ) => ( { } )
} ,
customClass : {
type : String ,
default : ""
} ,
// 跳转的页面路径
url : {
type : String ,
default : ""
} ,
// 页面跳转的类型
linkType : {
type : String ,
default : "navigateTo"
}
} ,
data ( ) {
return { } ;
} ,
onLoad ( ) {
this . $u . getRect = this . $uGetRect ;
} ,
created ( ) {
this . $u . getRect = this . $uGetRect ;
} ,
computed : {
// 在2.x版本中, 将会把$u挂载到uni对象下, 导致在模板中无法使用uni.$u.xxx形式
// 所以这里通过computed计算属性将其附加到this.$u上, 就可以在模板或者js中使用uni.$u.xxx
// 只在nvue环境通过此方式引入完整的$u, 其他平台会出现性能问题, 非nvue则按需引入( 主要原因是props过大)
$u ( ) {
return uni . $u . deepMerge ( uni . $u , {
props : void 0 ,
http : void 0 ,
mixin : void 0
} ) ;
} ,
/ * *
* 生成bem规则类名
* 由于微信小程序 , H5 , nvue之间绑定class的差异 , 无法通过 : class = "[bem()]" 的形式进行同用
* 故采用如下折中做法 , 最后返回的是数组 ( 一般平台 ) 或字符串 ( 支付宝和字节跳动平台 ) , 类似 [ 'a' , 'b' , 'c' ] 或 'a b c' 的形式
* @ param { String } name 组件名称
* @ param { Array } fixed 一直会存在的类名
* @ param { Array } change 会根据变量值为true或者false而出现或者隐藏的类名
* @ returns { Array | string }
* /
bem ( ) {
return function ( name , fixed , change ) {
const prefix = ` u- ${ name } -- ` ;
const classes = { } ;
if ( fixed ) {
fixed . map ( ( item ) => {
classes [ prefix + this [ item ] ] = true ;
} ) ;
}
if ( change ) {
change . map ( ( item ) => {
this [ item ] ? classes [ prefix + item ] = this [ item ] : delete classes [ prefix + item ] ;
} ) ;
}
return Object . keys ( classes ) ;
} ;
}
} ,
methods : {
// 跳转某一个页面
openPage ( urlKey = "url" ) {
const url2 = this [ urlKey ] ;
if ( url2 ) {
this . $u . route ( { type : this . linkType , url : url2 } ) ;
}
} ,
// 查询节点信息
// 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸, 为支付宝的bug(2020-07-21)
// 解决办法为在组件根部再套一个没有任何作用的view元素
$uGetRect ( selector , all ) {
return new Promise ( ( resolve ) => {
uni . createSelectorQuery ( ) . in ( this ) [ all ? "selectAll" : "select" ] ( selector ) . boundingClientRect ( ( rect ) => {
if ( all && Array . isArray ( rect ) && rect . length ) {
resolve ( rect ) ;
}
if ( ! all && rect ) {
resolve ( rect ) ;
}
} ) . exec ( ) ;
} ) ;
} ,
getParentData ( parentName = "" ) {
if ( ! this . parent )
this . parent = { } ;
this . parent = uni . $u . $parent . call ( this , parentName ) ;
if ( this . parent . children ) {
this . parent . children . indexOf ( this ) === - 1 && this . parent . children . push ( this ) ;
}
if ( this . parent && this . parentData ) {
Object . keys ( this . parentData ) . map ( ( key ) => {
this . parentData [ key ] = this . parent [ key ] ;
} ) ;
}
} ,
// 阻止事件冒泡
preventEvent ( e ) {
e && typeof e . stopPropagation === "function" && e . stopPropagation ( ) ;
} ,
// 空操作
noop ( e ) {
this . preventEvent ( e ) ;
}
} ,
onReachBottom ( ) {
uni . $emit ( "uOnReachBottom" ) ;
} ,
beforeDestroy ( ) {
if ( this . parent && uni . $u . test . array ( this . parent . children ) ) {
const childrenList = this . parent . children ;
childrenList . map ( ( child , index2 ) => {
if ( child === this ) {
childrenList . splice ( index2 , 1 ) ;
}
} ) ;
}
}
} ;
const _export _sfc = ( sfc , props2 ) => {
const target = sfc . _ _vccOpts || sfc ;
for ( const [ key , val ] of props2 ) {
target [ key ] = val ;
}
return target ;
} ;
2023-10-20 18:45:15 +08:00
const _sfc _main$l = {
name : "u-icon" ,
2023-10-17 16:02:55 +08:00
data ( ) {
2023-10-20 18:45:15 +08:00
return { } ;
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
emits : [ "click" ] ,
mixins : [ mpMixin , mixin , props$a ] ,
2023-10-17 16:02:55 +08:00
computed : {
2023-10-20 18:45:15 +08:00
uClasses ( ) {
let classes = [ ] ;
classes . push ( this . customPrefix + "-" + this . name ) ;
if ( this . color && uni . $u . config . type . includes ( this . color ) )
classes . push ( "u-icon__icon--" + this . color ) ;
return classes ;
} ,
iconStyle ( ) {
let style = { } ;
style = {
fontSize : uni . $u . addUnit ( this . size ) ,
lineHeight : uni . $u . addUnit ( this . size ) ,
fontWeight : this . bold ? "bold" : "normal" ,
// 某些特殊情况需要设置一个到顶部的距离,才能更好的垂直居中
top : uni . $u . addUnit ( this . top )
} ;
if ( this . color && ! uni . $u . config . type . includes ( this . color ) )
style . color = this . color ;
return style ;
} ,
// 判断传入的name属性, 是否图片路径, 只要带有"/"均认为是图片形式
isImg ( ) {
return this . name . indexOf ( "/" ) !== - 1 ;
} ,
imgStyle ( ) {
let style = { } ;
style . width = this . width ? uni . $u . addUnit ( this . width ) : uni . $u . addUnit ( this . size ) ;
style . height = this . height ? uni . $u . addUnit ( this . height ) : uni . $u . addUnit ( this . size ) ;
return style ;
} ,
// 通过图标名,查找对应的图标
icon ( ) {
return icons [ "uicon-" + this . name ] || this . name ;
2023-10-17 16:02:55 +08:00
}
} ,
methods : {
2023-10-20 18:45:15 +08:00
clickHandler ( e ) {
this . $emit ( "click" , this . index ) ;
this . stop && this . preventEvent ( e ) ;
2023-10-17 16:02:55 +08:00
}
}
} ;
2023-10-20 18:45:15 +08:00
function _sfc _render$f ( _ctx , _cache , $props , $setup , $data , $options ) {
return vue . openBlock ( ) , vue . createElementBlock (
2023-10-17 16:02:55 +08:00
"view" ,
{
2023-10-20 18:45:15 +08:00
class : vue . normalizeClass ( [ "u-icon" , [ "u-icon--" + _ctx . labelPos ] ] ) ,
onClick : _cache [ 0 ] || ( _cache [ 0 ] = ( ... args ) => $options . clickHandler && $options . clickHandler ( ... args ) )
2023-10-17 16:02:55 +08:00
} ,
[
2023-10-20 18:45:15 +08:00
$options . isImg ? ( vue . openBlock ( ) , vue . createElementBlock ( "image" , {
key : 0 ,
class : "u-icon__img" ,
src : _ctx . name ,
mode : _ctx . imgMode ,
style : vue . normalizeStyle ( [ $options . imgStyle , _ctx . $u . addStyle ( _ctx . customStyle ) ] )
} , null , 12 , [ "src" , "mode" ] ) ) : ( vue . openBlock ( ) , vue . createElementBlock ( "text" , {
key : 1 ,
class : vue . normalizeClass ( [ "u-icon__icon" , $options . uClasses ] ) ,
style : vue . normalizeStyle ( [ $options . iconStyle , _ctx . $u . addStyle ( _ctx . customStyle ) ] ) ,
"hover-class" : _ctx . hoverClass
} , vue . toDisplayString ( $options . icon ) , 15 , [ "hover-class" ] ) ) ,
vue . createCommentVNode ( ' 这里进行空字符串判断, 如果仅仅是v-if="label", 可能会出现传递0的时候, 结果也无法显示 ' ) ,
_ctx . label !== "" ? ( vue . openBlock ( ) , vue . createElementBlock (
2023-10-17 16:02:55 +08:00
"text" ,
{
2023-10-20 18:45:15 +08:00
key : 2 ,
class : "u-icon__label" ,
2023-10-17 16:02:55 +08:00
style : vue . normalizeStyle ( {
2023-10-20 18:45:15 +08:00
color : _ctx . labelColor ,
fontSize : _ctx . $u . addUnit ( _ctx . labelSize ) ,
marginLeft : _ctx . labelPos == "right" ? _ctx . $u . addUnit ( _ctx . space ) : 0 ,
marginTop : _ctx . labelPos == "bottom" ? _ctx . $u . addUnit ( _ctx . space ) : 0 ,
marginRight : _ctx . labelPos == "left" ? _ctx . $u . addUnit ( _ctx . space ) : 0 ,
marginBottom : _ctx . labelPos == "top" ? _ctx . $u . addUnit ( _ctx . space ) : 0
2023-10-17 16:02:55 +08:00
} )
} ,
2023-10-20 18:45:15 +08:00
vue . toDisplayString ( _ctx . label ) ,
2023-10-17 16:02:55 +08:00
5
/* TEXT, STYLE */
) ) : vue . createCommentVNode ( "v-if" , true )
] ,
2023-10-20 18:45:15 +08:00
2
/* CLASS */
) ;
2023-10-17 16:02:55 +08:00
}
2023-10-20 18:45:15 +08:00
const _ _easycom _2 = /* @__PURE__ */ _export _sfc ( _sfc _main$l , [ [ "render" , _sfc _render$f ] , [ "__scopeId" , "data-v-1c933a9a" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-icon/u-icon.vue" ] ] ) ;
const props$9 = {
2023-10-17 16:02:55 +08:00
props : {
2023-10-20 18:45:15 +08:00
// 是否展示组件
show : {
type : Boolean ,
default : props$b . transition . show
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 使用的动画模式
mode : {
2023-10-17 16:02:55 +08:00
type : String ,
2023-10-20 18:45:15 +08:00
default : props$b . transition . mode
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 动画的执行时间, 单位ms
duration : {
2023-10-17 16:02:55 +08:00
type : [ String , Number ] ,
2023-10-20 18:45:15 +08:00
default : props$b . transition . duration
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 使用的动画过渡函数
timingFunction : {
type : String ,
default : props$b . transition . timingFunction
}
}
} ;
const getClassNames = ( name ) => ( {
enter : ` u- ${ name } -enter u- ${ name } -enter-active ` ,
"enter-to" : ` u- ${ name } -enter-to u- ${ name } -enter-active ` ,
leave : ` u- ${ name } -leave u- ${ name } -leave-active ` ,
"leave-to" : ` u- ${ name } -leave-to u- ${ name } -leave-active `
} ) ;
const transition = {
methods : {
// 组件被点击发出事件
clickHandler ( ) {
this . $emit ( "click" ) ;
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// vue版本的组件进场处理
async vueEnter ( ) {
const classNames = getClassNames ( this . mode ) ;
this . status = "enter" ;
this . $emit ( "beforeEnter" ) ;
this . inited = true ;
this . display = true ;
this . classes = classNames . enter ;
await vue . nextTick ( ) ;
{
this . $emit ( "enter" ) ;
this . transitionEnded = false ;
this . $emit ( "afterEnter" ) ;
this . classes = classNames [ "enter-to" ] ;
}
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 动画离场处理
async vueLeave ( ) {
if ( ! this . display )
return ;
const classNames = getClassNames ( this . mode ) ;
this . status = "leave" ;
this . $emit ( "beforeLeave" ) ;
this . classes = classNames . leave ;
await vue . nextTick ( ) ;
{
this . transitionEnded = false ;
this . $emit ( "leave" ) ;
setTimeout ( this . onTransitionEnd , this . duration ) ;
this . classes = classNames [ "leave-to" ] ;
}
} ,
// 完成过渡后触发
onTransitionEnd ( ) {
if ( this . transitionEnded )
return ;
this . transitionEnded = true ;
this . $emit ( this . status === "leave" ? "afterLeave" : "afterEnter" ) ;
if ( ! this . show && this . display ) {
this . display = false ;
this . inited = false ;
}
}
}
} ;
const _sfc _main$k = {
name : "u-transition" ,
data ( ) {
return {
inited : false ,
// 是否显示/隐藏组件
viewStyle : { } ,
// 组件内部的样式
status : "" ,
// 记录组件动画的状态
transitionEnded : false ,
// 组件是否结束的标记
display : false ,
// 组件是否展示
classes : ""
// 应用的类名
} ;
} ,
emits : [ "click" , "beforeEnter" , "enter" , "afterEnter" , "beforeLeave" , "leave" , "afterLeave" ] ,
computed : {
mergeStyle ( ) {
const { viewStyle , customStyle } = this ;
return {
transitionDuration : ` ${ this . duration } ms ` ,
// display: `${this.display ? '' : 'none'}`,
transitionTimingFunction : this . timingFunction ,
// 避免自定义样式影响到动画属性, 所以写在viewStyle前面
... uni . $u . addStyle ( customStyle ) ,
... viewStyle
} ;
}
} ,
// 将mixin挂在到组件中, uni.$u.mixin实际上为一个vue格式对象
mixins : [ mpMixin , mixin , transition , props$9 ] ,
watch : {
show : {
handler ( newVal ) {
newVal ? this . vueEnter ( ) : this . vueLeave ( ) ;
} ,
// 表示同时监听初始化时的props的show的意思
immediate : true
}
}
} ;
function _sfc _render$e ( _ctx , _cache , $props , $setup , $data , $options ) {
return $data . inited ? ( vue . openBlock ( ) , vue . createElementBlock (
"view" ,
{
key : 0 ,
class : vue . normalizeClass ( [ "u-transition" , $data . classes ] ) ,
ref : "u-transition" ,
onClick : _cache [ 0 ] || ( _cache [ 0 ] = ( ... args ) => _ctx . clickHandler && _ctx . clickHandler ( ... args ) ) ,
style : vue . normalizeStyle ( [ $options . mergeStyle ] ) ,
onTouchmove : _cache [ 1 ] || ( _cache [ 1 ] = ( ... args ) => _ctx . noop && _ctx . noop ( ... args ) )
} ,
[
vue . renderSlot ( _ctx . $slots , "default" , { } , void 0 , true )
] ,
38
/* CLASS, STYLE, HYDRATE_EVENTS */
) ) : vue . createCommentVNode ( "v-if" , true ) ;
}
const _ _easycom _4 = /* @__PURE__ */ _export _sfc ( _sfc _main$k , [ [ "render" , _sfc _render$e ] , [ "__scopeId" , "data-v-0573594d" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-transition/u-transition.vue" ] ] ) ;
const props$8 = {
props : {
// 图片地址
src : {
2023-10-17 16:02:55 +08:00
type : String ,
2023-10-20 18:45:15 +08:00
default : props$b . image . src
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 裁剪模式
mode : {
2023-10-17 16:02:55 +08:00
type : String ,
2023-10-20 18:45:15 +08:00
default : props$b . image . mode
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 宽度,单位任意
width : {
2023-10-17 16:02:55 +08:00
type : [ String , Number ] ,
2023-10-20 18:45:15 +08:00
default : props$b . image . width
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 高度,单位任意
height : {
2023-10-17 16:02:55 +08:00
type : [ String , Number ] ,
2023-10-20 18:45:15 +08:00
default : props$b . image . height
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 图片形状, circle-圆形, square-方形
shape : {
2023-10-17 16:02:55 +08:00
type : String ,
2023-10-20 18:45:15 +08:00
default : props$b . image . shape
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 圆角,单位任意
radius : {
2023-10-17 16:02:55 +08:00
type : [ String , Number ] ,
2023-10-20 18:45:15 +08:00
default : props$b . image . radius
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 是否懒加载, 微信小程序、App、百度小程序、字节跳动小程序
lazyLoad : {
type : Boolean ,
default : props$b . image . lazyLoad
} ,
// 开启长按图片显示识别微信小程序码菜单
showMenuByLongpress : {
type : Boolean ,
default : props$b . image . showMenuByLongpress
} ,
// 加载中的图标,或者小图片
loadingIcon : {
2023-10-17 16:02:55 +08:00
type : String ,
2023-10-20 18:45:15 +08:00
default : props$b . image . loadingIcon
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 加载失败的图标,或者小图片
errorIcon : {
type : String ,
default : props$b . image . errorIcon
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 是否显示加载中的图标或者自定义的slot
showLoading : {
type : Boolean ,
default : props$b . image . showLoading
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 是否显示加载错误的图标或者自定义的slot
showError : {
type : Boolean ,
default : props$b . image . showError
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
// 是否需要淡入效果
fade : {
type : Boolean ,
default : props$b . image . fade
} ,
// 只支持网络资源,只对微信小程序有效
webp : {
2023-10-17 16:02:55 +08:00
type : Boolean ,
2023-10-20 18:45:15 +08:00
default : props$b . image . webp
} ,
// 过渡时间, 单位ms
duration : {
type : [ String , Number ] ,
default : props$b . image . duration
} ,
// 背景颜色,用于深色页面加载图片时,为了和背景色融合
bgColor : {
type : String ,
default : props$b . image . bgColor
2023-10-17 16:02:55 +08:00
}
}
} ;
2023-10-20 18:45:15 +08:00
const _sfc _main$j = {
name : "u-image" ,
mixins : [ mpMixin , mixin , props$8 ] ,
2023-10-17 16:02:55 +08:00
data ( ) {
2023-10-20 18:45:15 +08:00
return {
// 图片是否加载错误,如果是,则显示错误占位图
isError : false ,
// 初始化组件时,默认为加载中状态
loading : true ,
// 不透明度,为了实现淡入淡出的效果
opacity : 1 ,
// 过渡时间, 因为props的值无法修改, 故需要一个中间值
durationTime : this . duration ,
// 图片加载完成时, 去掉背景颜色, 因为如果是png图片, 就会显示灰色的背景
backgroundStyle : { } ,
// 用于fade模式的控制组件显示与否
show : false
} ;
} ,
watch : {
src : {
immediate : true ,
handler ( n ) {
if ( ! n ) {
this . isError = true ;
} else {
this . isError = false ;
this . loading = true ;
}
}
}
2023-10-17 16:02:55 +08:00
} ,
computed : {
2023-10-20 18:45:15 +08:00
wrapStyle ( ) {
2023-10-17 16:02:55 +08:00
let style = { } ;
2023-10-20 18:45:15 +08:00
style . width = this . $u . addUnit ( this . width ) ;
style . height = this . $u . addUnit ( this . height ) ;
style . borderRadius = this . shape == "circle" ? "10000px" : uni . $u . addUnit ( this . radius ) ;
style . overflow = this . radius > 0 ? "hidden" : "visible" ;
return uni . $u . deepMerge ( style , uni . $u . addStyle ( this . customStyle ) ) ;
2023-10-17 16:02:55 +08:00
}
} ,
2023-10-20 18:45:15 +08:00
mounted ( ) {
this . show = true ;
} ,
emits : [ "click" , "error" , "load" ] ,
2023-10-17 16:02:55 +08:00
methods : {
2023-10-20 18:45:15 +08:00
// 点击图片
onClick ( ) {
this . $emit ( "click" ) ;
} ,
// 图片加载失败
onErrorHandler ( err ) {
this . loading = false ;
this . isError = true ;
this . $emit ( "error" , err ) ;
} ,
// 图片加载完成, 标记loading结束
onLoadHandler ( event ) {
this . loading = false ;
this . isError = false ;
this . $emit ( "load" , event ) ;
this . removeBgColor ( ) ;
} ,
// 移除图片的背景色
removeBgColor ( ) {
this . backgroundStyle = {
backgroundColor : "transparent"
} ;
2023-10-17 16:02:55 +08:00
}
}
} ;
2023-10-20 18:45:15 +08:00
function _sfc _render$d ( _ctx , _cache , $props , $setup , $data , $options ) {
const _component _u _icon = resolveEasycom ( vue . resolveDynamicComponent ( "u-icon" ) , _ _easycom _2 ) ;
const _component _u _transition = resolveEasycom ( vue . resolveDynamicComponent ( "u-transition" ) , _ _easycom _4 ) ;
return vue . openBlock ( ) , vue . createBlock ( _component _u _transition , {
mode : "fade" ,
show : $data . show ,
duration : _ctx . fade ? 1e3 : 0
} , {
default : vue . withCtx ( ( ) => [
vue . createElementVNode (
"view" ,
2023-10-17 16:02:55 +08:00
{
2023-10-20 18:45:15 +08:00
class : "u-image" ,
onClick : _cache [ 2 ] || ( _cache [ 2 ] = ( ... args ) => $options . onClick && $options . onClick ( ... args ) ) ,
style : vue . normalizeStyle ( [ $options . wrapStyle , $data . backgroundStyle ] )
2023-10-17 16:02:55 +08:00
} ,
2023-10-20 18:45:15 +08:00
[
! $data . isError ? ( vue . openBlock ( ) , vue . createElementBlock ( "image" , {
key : 0 ,
src : _ctx . src ,
mode : _ctx . mode ,
onError : _cache [ 0 ] || ( _cache [ 0 ] = ( ... args ) => $options . onErrorHandler && $options . onErrorHandler ( ... args ) ) ,
onLoad : _cache [ 1 ] || ( _cache [ 1 ] = ( ... args ) => $options . onLoadHandler && $options . onLoadHandler ( ... args ) ) ,
"show-menu-by-longpress" : _ctx . showMenuByLongpress ,
"lazy-load" : _ctx . lazyLoad ,
class : "u-image__image" ,
style : vue . normalizeStyle ( {
borderRadius : _ctx . shape == "circle" ? "10000px" : _ctx . $u . addUnit ( _ctx . radius ) ,
width : _ctx . $u . addUnit ( _ctx . width ) ,
height : _ctx . $u . addUnit ( _ctx . height )
} )
} , null , 44 , [ "src" , "mode" , "show-menu-by-longpress" , "lazy-load" ] ) ) : vue . createCommentVNode ( "v-if" , true ) ,
_ctx . showLoading && $data . loading ? ( vue . openBlock ( ) , vue . createElementBlock (
"view" ,
{
key : 1 ,
class : "u-image__loading" ,
style : vue . normalizeStyle ( {
borderRadius : _ctx . shape == "circle" ? "50%" : _ctx . $u . addUnit ( _ctx . radius ) ,
backgroundColor : this . bgColor ,
width : _ctx . $u . addUnit ( _ctx . width ) ,
height : _ctx . $u . addUnit ( _ctx . height )
} )
} ,
[
vue . renderSlot ( _ctx . $slots , "loading" , { } , ( ) => [
vue . createVNode ( _component _u _icon , {
name : _ctx . loadingIcon ,
width : _ctx . width ,
height : _ctx . height
} , null , 8 , [ "name" , "width" , "height" ] )
] , true )
] ,
4
/* STYLE */
) ) : vue . createCommentVNode ( "v-if" , true ) ,
_ctx . showError && $data . isError && ! $data . loading ? ( vue . openBlock ( ) , vue . createElementBlock (
"view" ,
{
key : 2 ,
class : "u-image__error" ,
style : vue . normalizeStyle ( {
borderRadius : _ctx . shape == "circle" ? "50%" : _ctx . $u . addUnit ( _ctx . radius ) ,
width : _ctx . $u . addUnit ( _ctx . width ) ,
height : _ctx . $u . addUnit ( _ctx . height )
} )
} ,
[
vue . renderSlot ( _ctx . $slots , "error" , { } , ( ) => [
vue . createVNode ( _component _u _icon , {
name : _ctx . errorIcon ,
width : _ctx . width ,
height : _ctx . height
} , null , 8 , [ "name" , "width" , "height" ] )
] , true )
] ,
4
/* STYLE */
) ) : vue . createCommentVNode ( "v-if" , true )
] ,
4
/* STYLE */
)
] ) ,
_ : 3
/* FORWARDED */
} , 8 , [ "show" , "duration" ] ) ;
}
const _ _easycom _0$4 = /* @__PURE__ */ _export _sfc ( _sfc _main$j , [ [ "render" , _sfc _render$d ] , [ "__scopeId" , "data-v-9d58ba7c" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-image/u-image.vue" ] ] ) ;
let BASE _URL ;
{
BASE _URL = "http://ceshi-suyuan.lihaink.cn/" ;
2023-10-17 16:02:55 +08:00
}
2023-10-20 18:45:15 +08:00
let config = {
HTTP _REQUEST _URL : BASE _URL ,
HEADER : {
"content-type" : "application/json" ,
"Form-type" : "app" ,
"TOKEN" : uni . getStorageSync ( "SY_TOKEN" ) || ""
2023-10-17 16:02:55 +08:00
}
} ;
formatAppLog ( "log" , "at utils/syhttp.js:4" , "指定" ) ;
function baseRequest ( url2 , method , data , {
noAuth = false ,
noVerify = false ,
onReLogin = false
} ) {
let Url = config . HTTP _REQUEST _URL , header = config . HEADER ;
return new Promise ( ( reslove , reject ) => {
uni . request ( {
url : Url + "adminapi" + url2 ,
method : method || "GET" ,
header : {
... header
} ,
data : method != "GET" ? data || { } : { } ,
params : method == "GET" ? data : { } ,
success : ( res ) => {
if ( noVerify )
reslove ( res . data ) ;
else if ( res . data . code == - 1 ) {
if ( onReLogin ) {
return reject ( ) ;
}
} else if ( res . data . code == 0 ) {
if ( res . data . msg != "无登录信息" ) {
uni . showToast ( {
title : res . data . msg || "请检查网络" ,
icon : "none"
} ) ;
}
reject ( res . data ) ;
} else if ( res . data . code == 1 ) {
reslove ( res . data ) ;
} else if ( res . data . code == 200 ) {
reslove ( res . data . data ) ;
} else if ( [ 41e4 , 410001 , 410002 , 4e4 ] . indexOf ( res . data . code ) !== - 1 ) {
reject ( res . data ) ;
} else if ( res . data . code == 501 ) {
reject ( res . data ) ;
} else {
uni . showToast ( {
title : res . data . msg || "请检查网络" ,
icon : "none"
} ) ;
reject ( res . data . msg || "请检查网络" ) ;
}
} ,
fail : ( message ) => {
uni . showToast ( {
title : "网络错误" ,
icon : "none"
} ) ;
reject ( "请求失败" ) ;
}
} ) ;
} ) ;
}
const syhttp = { } ;
[ "options" , "get" , "post" , "put" , "head" , "delete" , "trace" , "connect" ] . forEach ( ( method ) => {
syhttp [ method ] = ( api , data , opt ) => baseRequest ( api , method , data , opt || { } ) ;
} ) ;
const companyMine = ( data ) => syhttp . post ( "/SuYuan/monitorDetail" , data ) ;
var isVue2 = false ;
function set ( target , key , val ) {
if ( Array . isArray ( target ) ) {
target . length = Math . max ( target . length , key ) ;
target . splice ( key , 1 , val ) ;
return val ;
}
target [ key ] = val ;
return val ;
}
function del ( target , key ) {
if ( Array . isArray ( target ) ) {
target . splice ( key , 1 ) ;
return ;
}
delete target [ key ] ;
}
function getDevtoolsGlobalHook ( ) {
return getTarget ( ) . _ _VUE _DEVTOOLS _GLOBAL _HOOK _ _ ;
}
function getTarget ( ) {
return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : { } ;
}
const isProxyAvailable = typeof Proxy === "function" ;
const HOOK _SETUP = "devtools-plugin:setup" ;
const HOOK _PLUGIN _SETTINGS _SET = "plugin:settings:set" ;
let supported ;
let perf ;
function isPerformanceSupported ( ) {
var _a ;
if ( supported !== void 0 ) {
return supported ;
}
if ( typeof window !== "undefined" && window . performance ) {
supported = true ;
perf = window . performance ;
} else if ( typeof global !== "undefined" && ( ( _a = global . perf _hooks ) === null || _a === void 0 ? void 0 : _a . performance ) ) {
supported = true ;
perf = global . perf _hooks . performance ;
} else {
supported = false ;
}
return supported ;
}
function now ( ) {
return isPerformanceSupported ( ) ? perf . now ( ) : Date . now ( ) ;
}
class ApiProxy {
constructor ( plugin , hook ) {
this . target = null ;
this . targetQueue = [ ] ;
this . onQueue = [ ] ;
this . plugin = plugin ;
this . hook = hook ;
const defaultSettings = { } ;
if ( plugin . settings ) {
for ( const id in plugin . settings ) {
const item = plugin . settings [ id ] ;
defaultSettings [ id ] = item . defaultValue ;
}
}
const localSettingsSaveId = ` __vue-devtools-plugin-settings__ ${ plugin . id } ` ;
let currentSettings = Object . assign ( { } , defaultSettings ) ;
try {
const raw = localStorage . getItem ( localSettingsSaveId ) ;
const data = JSON . parse ( raw ) ;
Object . assign ( currentSettings , data ) ;
} catch ( e ) {
}
this . fallbacks = {
getSettings ( ) {
return currentSettings ;
} ,
setSettings ( value ) {
try {
localStorage . setItem ( localSettingsSaveId , JSON . stringify ( value ) ) ;
} catch ( e ) {
}
currentSettings = value ;
} ,
now ( ) {
return now ( ) ;
}
} ;
if ( hook ) {
hook . on ( HOOK _PLUGIN _SETTINGS _SET , ( pluginId , value ) => {
if ( pluginId === this . plugin . id ) {
this . fallbacks . setSettings ( value ) ;
}
} ) ;
}
this . proxiedOn = new Proxy ( { } , {
get : ( _target , prop ) => {
if ( this . target ) {
return this . target . on [ prop ] ;
} else {
return ( ... args ) => {
this . onQueue . push ( {
method : prop ,
args
} ) ;
} ;
}
}
} ) ;
this . proxiedTarget = new Proxy ( { } , {
get : ( _target , prop ) => {
if ( this . target ) {
return this . target [ prop ] ;
} else if ( prop === "on" ) {
return this . proxiedOn ;
} else if ( Object . keys ( this . fallbacks ) . includes ( prop ) ) {
return ( ... args ) => {
this . targetQueue . push ( {
method : prop ,
args ,
resolve : ( ) => {
}
} ) ;
return this . fallbacks [ prop ] ( ... args ) ;
} ;
} else {
return ( ... args ) => {
return new Promise ( ( resolve ) => {
this . targetQueue . push ( {
method : prop ,
args ,
resolve
} ) ;
} ) ;
} ;
}
}
} ) ;
}
async setRealTarget ( target ) {
this . target = target ;
for ( const item of this . onQueue ) {
this . target . on [ item . method ] ( ... item . args ) ;
}
for ( const item of this . targetQueue ) {
item . resolve ( await this . target [ item . method ] ( ... item . args ) ) ;
}
}
}
function setupDevtoolsPlugin ( pluginDescriptor , setupFn ) {
const descriptor = pluginDescriptor ;
const target = getTarget ( ) ;
const hook = getDevtoolsGlobalHook ( ) ;
const enableProxy = isProxyAvailable && descriptor . enableEarlyProxy ;
if ( hook && ( target . _ _VUE _DEVTOOLS _PLUGIN _API _AVAILABLE _ _ || ! enableProxy ) ) {
hook . emit ( HOOK _SETUP , pluginDescriptor , setupFn ) ;
} else {
const proxy = enableProxy ? new ApiProxy ( descriptor , hook ) : null ;
const list = target . _ _VUE _DEVTOOLS _PLUGINS _ _ = target . _ _VUE _DEVTOOLS _PLUGINS _ _ || [ ] ;
list . push ( {
pluginDescriptor : descriptor ,
setupFn ,
proxy
} ) ;
if ( proxy )
setupFn ( proxy . proxiedTarget ) ;
}
}
/ * !
* pinia v2 . 0.33
* ( c ) 2023 Eduardo San Martin Morote
* @ license MIT
* /
let activePinia ;
const setActivePinia = ( pinia ) => activePinia = pinia ;
const piniaSymbol = Symbol ( "pinia" ) ;
function isPlainObject$1 ( o ) {
return o && typeof o === "object" && Object . prototype . toString . call ( o ) === "[object Object]" && typeof o . toJSON !== "function" ;
}
var MutationType ;
( function ( MutationType2 ) {
MutationType2 [ "direct" ] = "direct" ;
MutationType2 [ "patchObject" ] = "patch object" ;
MutationType2 [ "patchFunction" ] = "patch function" ;
} ) ( MutationType || ( MutationType = { } ) ) ;
const IS _CLIENT = typeof window !== "undefined" ;
const USE _DEVTOOLS = IS _CLIENT ;
const _global = /* @__PURE__ */ ( ( ) => typeof window === "object" && window . window === window ? window : typeof self === "object" && self . self === self ? self : typeof global === "object" && global . global === global ? global : typeof globalThis === "object" ? globalThis : { HTMLElement : null } ) ( ) ;
function bom ( blob , { autoBom = false } = { } ) {
if ( autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i . test ( blob . type ) ) {
return new Blob ( [ String . fromCharCode ( 65279 ) , blob ] , { type : blob . type } ) ;
}
return blob ;
}
function download ( url2 , name , opts ) {
const xhr = new XMLHttpRequest ( ) ;
xhr . open ( "GET" , url2 ) ;
xhr . responseType = "blob" ;
xhr . onload = function ( ) {
saveAs ( xhr . response , name , opts ) ;
} ;
xhr . onerror = function ( ) {
console . error ( "could not download file" ) ;
} ;
xhr . send ( ) ;
}
function corsEnabled ( url2 ) {
const xhr = new XMLHttpRequest ( ) ;
xhr . open ( "HEAD" , url2 , false ) ;
try {
xhr . send ( ) ;
} catch ( e ) {
}
return xhr . status >= 200 && xhr . status <= 299 ;
}
function click ( node ) {
try {
node . dispatchEvent ( new MouseEvent ( "click" ) ) ;
} catch ( e ) {
const evt = document . createEvent ( "MouseEvents" ) ;
evt . initMouseEvent ( "click" , true , true , window , 0 , 0 , 0 , 80 , 20 , false , false , false , false , 0 , null ) ;
node . dispatchEvent ( evt ) ;
}
}
const _navigator = typeof navigator === "object" ? navigator : { userAgent : "" } ;
const isMacOSWebView = /* @__PURE__ */ ( ( ) => / Macintosh / . test ( _navigator . userAgent ) && /AppleWebKit/ . test ( _navigator . userAgent ) && ! /Safari/ . test ( _navigator . userAgent ) ) ( ) ;
const saveAs = ! IS _CLIENT ? ( ) => {
} : (
// Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
typeof HTMLAnchorElement !== "undefined" && "download" in HTMLAnchorElement . prototype && ! isMacOSWebView ? downloadSaveAs : (
// Use msSaveOrOpenBlob as a second approach
"msSaveOrOpenBlob" in _navigator ? msSaveAs : (
// Fallback to using FileReader and a popup
fileSaverSaveAs
)
)
) ;
function downloadSaveAs ( blob , name = "download" , opts ) {
const a = document . createElement ( "a" ) ;
a . download = name ;
a . rel = "noopener" ;
if ( typeof blob === "string" ) {
a . href = blob ;
if ( a . origin !== location . origin ) {
if ( corsEnabled ( a . href ) ) {
download ( blob , name , opts ) ;
} else {
a . target = "_blank" ;
click ( a ) ;
}
} else {
click ( a ) ;
}
} else {
a . href = URL . createObjectURL ( blob ) ;
setTimeout ( function ( ) {
URL . revokeObjectURL ( a . href ) ;
} , 4e4 ) ;
setTimeout ( function ( ) {
click ( a ) ;
} , 0 ) ;
}
}
function msSaveAs ( blob , name = "download" , opts ) {
if ( typeof blob === "string" ) {
if ( corsEnabled ( blob ) ) {
download ( blob , name , opts ) ;
} else {
const a = document . createElement ( "a" ) ;
a . href = blob ;
a . target = "_blank" ;
setTimeout ( function ( ) {
click ( a ) ;
} ) ;
}
} else {
navigator . msSaveOrOpenBlob ( bom ( blob , opts ) , name ) ;
}
}
function fileSaverSaveAs ( blob , name , opts , popup ) {
popup = popup || open ( "" , "_blank" ) ;
if ( popup ) {
popup . document . title = popup . document . body . innerText = "downloading..." ;
}
if ( typeof blob === "string" )
return download ( blob , name , opts ) ;
const force = blob . type === "application/octet-stream" ;
const isSafari = /constructor/i . test ( String ( _global . HTMLElement ) ) || "safari" in _global ;
const isChromeIOS = /CriOS\/[\d]+/ . test ( navigator . userAgent ) ;
if ( ( isChromeIOS || force && isSafari || isMacOSWebView ) && typeof FileReader !== "undefined" ) {
const reader = new FileReader ( ) ;
reader . onloadend = function ( ) {
let url2 = reader . result ;
if ( typeof url2 !== "string" ) {
popup = null ;
throw new Error ( "Wrong reader.result type" ) ;
}
url2 = isChromeIOS ? url2 : url2 . replace ( /^data:[^;]*;/ , "data:attachment/file;" ) ;
if ( popup ) {
popup . location . href = url2 ;
} else {
location . assign ( url2 ) ;
}
popup = null ;
} ;
reader . readAsDataURL ( blob ) ;
} else {
const url2 = URL . createObjectURL ( blob ) ;
if ( popup )
popup . location . assign ( url2 ) ;
else
location . href = url2 ;
popup = null ;
setTimeout ( function ( ) {
URL . revokeObjectURL ( url2 ) ;
} , 4e4 ) ;
}
}
function toastMessage ( message , type ) {
const piniaMessage = "🍍 " + message ;
if ( typeof _ _VUE _DEVTOOLS _TOAST _ _ === "function" ) {
_ _VUE _DEVTOOLS _TOAST _ _ ( piniaMessage , type ) ;
} else if ( type === "error" ) {
console . error ( piniaMessage ) ;
} else if ( type === "warn" ) {
console . warn ( piniaMessage ) ;
} else {
console . log ( piniaMessage ) ;
}
}
function isPinia ( o ) {
return "_a" in o && "install" in o ;
}
function checkClipboardAccess ( ) {
if ( ! ( "clipboard" in navigator ) ) {
toastMessage ( ` Your browser doesn't support the Clipboard API ` , "error" ) ;
return true ;
}
}
function checkNotFocusedError ( error2 ) {
if ( error2 instanceof Error && error2 . message . toLowerCase ( ) . includes ( "document is not focused" ) ) {
toastMessage ( 'You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.' , "warn" ) ;
return true ;
}
return false ;
}
async function actionGlobalCopyState ( pinia ) {
if ( checkClipboardAccess ( ) )
return ;
try {
await navigator . clipboard . writeText ( JSON . stringify ( pinia . state . value ) ) ;
toastMessage ( "Global state copied to clipboard." ) ;
} catch ( error2 ) {
if ( checkNotFocusedError ( error2 ) )
return ;
toastMessage ( ` Failed to serialize the state. Check the console for more details. ` , "error" ) ;
console . error ( error2 ) ;
}
}
async function actionGlobalPasteState ( pinia ) {
if ( checkClipboardAccess ( ) )
return ;
try {
pinia . state . value = JSON . parse ( await navigator . clipboard . readText ( ) ) ;
toastMessage ( "Global state pasted from clipboard." ) ;
} catch ( error2 ) {
if ( checkNotFocusedError ( error2 ) )
return ;
toastMessage ( ` Failed to deserialize the state from clipboard. Check the console for more details. ` , "error" ) ;
console . error ( error2 ) ;
}
}
async function actionGlobalSaveState ( pinia ) {
try {
saveAs ( new Blob ( [ JSON . stringify ( pinia . state . value ) ] , {
type : "text/plain;charset=utf-8"
} ) , "pinia-state.json" ) ;
} catch ( error2 ) {
toastMessage ( ` Failed to export the state as JSON. Check the console for more details. ` , "error" ) ;
console . error ( error2 ) ;
}
}
let fileInput ;
function getFileOpener ( ) {
if ( ! fileInput ) {
fileInput = document . createElement ( "input" ) ;
fileInput . type = "file" ;
fileInput . accept = ".json" ;
}
function openFile ( ) {
return new Promise ( ( resolve , reject ) => {
fileInput . onchange = async ( ) => {
const files = fileInput . files ;
if ( ! files )
return resolve ( null ) ;
const file = files . item ( 0 ) ;
if ( ! file )
return resolve ( null ) ;
return resolve ( { text : await file . text ( ) , file } ) ;
} ;
fileInput . oncancel = ( ) => resolve ( null ) ;
fileInput . onerror = reject ;
fileInput . click ( ) ;
} ) ;
}
return openFile ;
}
async function actionGlobalOpenStateFile ( pinia ) {
try {
const open2 = await getFileOpener ( ) ;
const result = await open2 ( ) ;
if ( ! result )
return ;
const { text , file } = result ;
pinia . state . value = JSON . parse ( text ) ;
toastMessage ( ` Global state imported from " ${ file . name } ". ` ) ;
} catch ( error2 ) {
toastMessage ( ` Failed to export the state as JSON. Check the console for more details. ` , "error" ) ;
console . error ( error2 ) ;
}
}
function formatDisplay ( display ) {
return {
_custom : {
display
}
} ;
}
const PINIA _ROOT _LABEL = "🍍 Pinia (root)" ;
const PINIA _ROOT _ID = "_root" ;
function formatStoreForInspectorTree ( store ) {
return isPinia ( store ) ? {
id : PINIA _ROOT _ID ,
label : PINIA _ROOT _LABEL
} : {
id : store . $id ,
label : store . $id
} ;
}
function formatStoreForInspectorState ( store ) {
if ( isPinia ( store ) ) {
const storeNames = Array . from ( store . _s . keys ( ) ) ;
const storeMap = store . _s ;
const state2 = {
state : storeNames . map ( ( storeId ) => ( {
editable : true ,
key : storeId ,
value : store . state . value [ storeId ]
} ) ) ,
getters : storeNames . filter ( ( id ) => storeMap . get ( id ) . _getters ) . map ( ( id ) => {
const store2 = storeMap . get ( id ) ;
return {
editable : false ,
key : id ,
value : store2 . _getters . reduce ( ( getters , key ) => {
getters [ key ] = store2 [ key ] ;
return getters ;
} , { } )
} ;
} )
} ;
return state2 ;
}
const state = {
state : Object . keys ( store . $state ) . map ( ( key ) => ( {
editable : true ,
key ,
value : store . $state [ key ]
} ) )
} ;
if ( store . _getters && store . _getters . length ) {
state . getters = store . _getters . map ( ( getterName ) => ( {
editable : false ,
key : getterName ,
value : store [ getterName ]
} ) ) ;
}
if ( store . _customProperties . size ) {
state . customProperties = Array . from ( store . _customProperties ) . map ( ( key ) => ( {
editable : true ,
key ,
value : store [ key ]
} ) ) ;
}
return state ;
}
function formatEventData ( events ) {
if ( ! events )
return { } ;
if ( Array . isArray ( events ) ) {
return events . reduce ( ( data , event ) => {
data . keys . push ( event . key ) ;
data . operations . push ( event . type ) ;
data . oldValue [ event . key ] = event . oldValue ;
data . newValue [ event . key ] = event . newValue ;
return data ;
} , {
oldValue : { } ,
keys : [ ] ,
operations : [ ] ,
newValue : { }
} ) ;
} else {
return {
operation : formatDisplay ( events . type ) ,
key : formatDisplay ( events . key ) ,
oldValue : events . oldValue ,
newValue : events . newValue
} ;
}
}
function formatMutationType ( type ) {
switch ( type ) {
case MutationType . direct :
return "mutation" ;
case MutationType . patchFunction :
return "$patch" ;
case MutationType . patchObject :
return "$patch" ;
default :
return "unknown" ;
}
}
let isTimelineActive = true ;
const componentStateTypes = [ ] ;
const MUTATIONS _LAYER _ID = "pinia:mutations" ;
const INSPECTOR _ID = "pinia" ;
const { assign : assign$1 } = Object ;
const getStoreType = ( id ) => "🍍 " + id ;
function registerPiniaDevtools ( app , pinia ) {
setupDevtoolsPlugin ( {
id : "dev.esm.pinia" ,
label : "Pinia 🍍" ,
logo : "https://pinia.vuejs.org/logo.svg" ,
packageName : "pinia" ,
homepage : "https://pinia.vuejs.org" ,
componentStateTypes ,
app
} , ( api ) => {
if ( typeof api . now !== "function" ) {
toastMessage ( "You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html." ) ;
}
api . addTimelineLayer ( {
id : MUTATIONS _LAYER _ID ,
label : ` Pinia 🍍 ` ,
color : 15064968
} ) ;
api . addInspector ( {
id : INSPECTOR _ID ,
label : "Pinia 🍍" ,
icon : "storage" ,
treeFilterPlaceholder : "Search stores" ,
actions : [
{
icon : "content_copy" ,
action : ( ) => {
actionGlobalCopyState ( pinia ) ;
} ,
tooltip : "Serialize and copy the state"
} ,
{
icon : "content_paste" ,
action : async ( ) => {
await actionGlobalPasteState ( pinia ) ;
api . sendInspectorTree ( INSPECTOR _ID ) ;
api . sendInspectorState ( INSPECTOR _ID ) ;
} ,
tooltip : "Replace the state with the content of your clipboard"
} ,
{
icon : "save" ,
action : ( ) => {
actionGlobalSaveState ( pinia ) ;
} ,
tooltip : "Save the state as a JSON file"
} ,
{
icon : "folder_open" ,
action : async ( ) => {
await actionGlobalOpenStateFile ( pinia ) ;
api . sendInspectorTree ( INSPECTOR _ID ) ;
api . sendInspectorState ( INSPECTOR _ID ) ;
} ,
tooltip : "Import the state from a JSON file"
}
] ,
nodeActions : [
{
icon : "restore" ,
tooltip : "Reset the state (option store only)" ,
action : ( nodeId ) => {
const store = pinia . _s . get ( nodeId ) ;
if ( ! store ) {
toastMessage ( ` Cannot reset " ${ nodeId } " store because it wasn't found. ` , "warn" ) ;
} else if ( ! store . _isOptionsAPI ) {
toastMessage ( ` Cannot reset " ${ nodeId } " store because it's a setup store. ` , "warn" ) ;
} else {
store . $reset ( ) ;
toastMessage ( ` Store " ${ nodeId } " reset. ` ) ;
}
}
}
]
} ) ;
api . on . inspectComponent ( ( payload , ctx ) => {
const proxy = payload . componentInstance && payload . componentInstance . proxy ;
if ( proxy && proxy . _pStores ) {
const piniaStores = payload . componentInstance . proxy . _pStores ;
Object . values ( piniaStores ) . forEach ( ( store ) => {
payload . instanceData . state . push ( {
type : getStoreType ( store . $id ) ,
key : "state" ,
editable : true ,
value : store . _isOptionsAPI ? {
_custom : {
value : vue . toRaw ( store . $state ) ,
actions : [
{
icon : "restore" ,
tooltip : "Reset the state of this store" ,
action : ( ) => store . $reset ( )
}
]
}
} : (
// NOTE: workaround to unwrap transferred refs
Object . keys ( store . $state ) . reduce ( ( state , key ) => {
state [ key ] = store . $state [ key ] ;
return state ;
} , { } )
)
} ) ;
if ( store . _getters && store . _getters . length ) {
payload . instanceData . state . push ( {
type : getStoreType ( store . $id ) ,
key : "getters" ,
editable : false ,
value : store . _getters . reduce ( ( getters , key ) => {
try {
getters [ key ] = store [ key ] ;
} catch ( error2 ) {
getters [ key ] = error2 ;
}
return getters ;
} , { } )
} ) ;
}
} ) ;
}
} ) ;
api . on . getInspectorTree ( ( payload ) => {
if ( payload . app === app && payload . inspectorId === INSPECTOR _ID ) {
let stores = [ pinia ] ;
stores = stores . concat ( Array . from ( pinia . _s . values ( ) ) ) ;
payload . rootNodes = ( payload . filter ? stores . filter ( ( store ) => "$id" in store ? store . $id . toLowerCase ( ) . includes ( payload . filter . toLowerCase ( ) ) : PINIA _ROOT _LABEL . toLowerCase ( ) . includes ( payload . filter . toLowerCase ( ) ) ) : stores ) . map ( formatStoreForInspectorTree ) ;
}
} ) ;
api . on . getInspectorState ( ( payload ) => {
if ( payload . app === app && payload . inspectorId === INSPECTOR _ID ) {
const inspectedStore = payload . nodeId === PINIA _ROOT _ID ? pinia : pinia . _s . get ( payload . nodeId ) ;
if ( ! inspectedStore ) {
return ;
}
if ( inspectedStore ) {
payload . state = formatStoreForInspectorState ( inspectedStore ) ;
}
}
} ) ;
api . on . editInspectorState ( ( payload , ctx ) => {
if ( payload . app === app && payload . inspectorId === INSPECTOR _ID ) {
const inspectedStore = payload . nodeId === PINIA _ROOT _ID ? pinia : pinia . _s . get ( payload . nodeId ) ;
if ( ! inspectedStore ) {
return toastMessage ( ` store " ${ payload . nodeId } " not found ` , "error" ) ;
}
const { path } = payload ;
if ( ! isPinia ( inspectedStore ) ) {
if ( path . length !== 1 || ! inspectedStore . _customProperties . has ( path [ 0 ] ) || path [ 0 ] in inspectedStore . $state ) {
path . unshift ( "$state" ) ;
}
} else {
path . unshift ( "state" ) ;
}
isTimelineActive = false ;
payload . set ( inspectedStore , path , payload . state . value ) ;
isTimelineActive = true ;
}
} ) ;
api . on . editComponentState ( ( payload ) => {
if ( payload . type . startsWith ( "🍍" ) ) {
const storeId = payload . type . replace ( /^🍍\s*/ , "" ) ;
const store = pinia . _s . get ( storeId ) ;
if ( ! store ) {
return toastMessage ( ` store " ${ storeId } " not found ` , "error" ) ;
}
const { path } = payload ;
if ( path [ 0 ] !== "state" ) {
return toastMessage ( ` Invalid path for store " ${ storeId } ":
$ { path }
Only state can be modified . ` );
}
path [ 0 ] = "$state" ;
isTimelineActive = false ;
payload . set ( store , path , payload . state . value ) ;
isTimelineActive = true ;
}
} ) ;
} ) ;
}
function addStoreToDevtools ( app , store ) {
if ( ! componentStateTypes . includes ( getStoreType ( store . $id ) ) ) {
componentStateTypes . push ( getStoreType ( store . $id ) ) ;
}
setupDevtoolsPlugin ( {
id : "dev.esm.pinia" ,
label : "Pinia 🍍" ,
logo : "https://pinia.vuejs.org/logo.svg" ,
packageName : "pinia" ,
homepage : "https://pinia.vuejs.org" ,
componentStateTypes ,
app ,
settings : {
logStoreChanges : {
label : "Notify about new/deleted stores" ,
type : "boolean" ,
defaultValue : true
}
// useEmojis: {
// label: 'Use emojis in messages ⚡️',
// type: 'boolean',
// defaultValue: true,
// },
}
} , ( api ) => {
const now2 = typeof api . now === "function" ? api . now . bind ( api ) : Date . now ;
store . $onAction ( ( { after , onError , name , args } ) => {
const groupId = runningActionId ++ ;
api . addTimelineEvent ( {
layerId : MUTATIONS _LAYER _ID ,
event : {
time : now2 ( ) ,
title : "🛫 " + name ,
subtitle : "start" ,
data : {
store : formatDisplay ( store . $id ) ,
action : formatDisplay ( name ) ,
args
} ,
groupId
}
} ) ;
after ( ( result ) => {
activeAction = void 0 ;
api . addTimelineEvent ( {
layerId : MUTATIONS _LAYER _ID ,
event : {
time : now2 ( ) ,
title : "🛬 " + name ,
subtitle : "end" ,
data : {
store : formatDisplay ( store . $id ) ,
action : formatDisplay ( name ) ,
args ,
result
} ,
groupId
}
} ) ;
} ) ;
onError ( ( error2 ) => {
activeAction = void 0 ;
api . addTimelineEvent ( {
layerId : MUTATIONS _LAYER _ID ,
event : {
time : now2 ( ) ,
logType : "error" ,
title : "💥 " + name ,
subtitle : "end" ,
data : {
store : formatDisplay ( store . $id ) ,
action : formatDisplay ( name ) ,
args ,
error : error2
} ,
groupId
}
} ) ;
} ) ;
} , true ) ;
store . _customProperties . forEach ( ( name ) => {
vue . watch ( ( ) => vue . unref ( store [ name ] ) , ( newValue , oldValue ) => {
api . notifyComponentUpdate ( ) ;
api . sendInspectorState ( INSPECTOR _ID ) ;
if ( isTimelineActive ) {
api . addTimelineEvent ( {
layerId : MUTATIONS _LAYER _ID ,
event : {
time : now2 ( ) ,
title : "Change" ,
subtitle : name ,
data : {
newValue ,
oldValue
} ,
groupId : activeAction
}
} ) ;
}
} , { deep : true } ) ;
} ) ;
store . $subscribe ( ( { events , type } , state ) => {
api . notifyComponentUpdate ( ) ;
api . sendInspectorState ( INSPECTOR _ID ) ;
if ( ! isTimelineActive )
return ;
const eventData = {
time : now2 ( ) ,
title : formatMutationType ( type ) ,
data : assign$1 ( { store : formatDisplay ( store . $id ) } , formatEventData ( events ) ) ,
groupId : activeAction
} ;
activeAction = void 0 ;
if ( type === MutationType . patchFunction ) {
eventData . subtitle = "⤵️" ;
} else if ( type === MutationType . patchObject ) {
eventData . subtitle = "🧩" ;
} else if ( events && ! Array . isArray ( events ) ) {
eventData . subtitle = events . type ;
}
if ( events ) {
eventData . data [ "rawEvent(s)" ] = {
_custom : {
display : "DebuggerEvent" ,
type : "object" ,
tooltip : "raw DebuggerEvent[]" ,
value : events
}
} ;
}
api . addTimelineEvent ( {
layerId : MUTATIONS _LAYER _ID ,
event : eventData
} ) ;
} , { detached : true , flush : "sync" } ) ;
const hotUpdate = store . _hotUpdate ;
store . _hotUpdate = vue . markRaw ( ( newStore ) => {
hotUpdate ( newStore ) ;
api . addTimelineEvent ( {
layerId : MUTATIONS _LAYER _ID ,
event : {
time : now2 ( ) ,
title : "🔥 " + store . $id ,
subtitle : "HMR update" ,
data : {
store : formatDisplay ( store . $id ) ,
info : formatDisplay ( ` HMR update ` )
}
}
} ) ;
api . notifyComponentUpdate ( ) ;
api . sendInspectorTree ( INSPECTOR _ID ) ;
api . sendInspectorState ( INSPECTOR _ID ) ;
} ) ;
const { $dispose } = store ;
store . $dispose = ( ) => {
$dispose ( ) ;
api . notifyComponentUpdate ( ) ;
api . sendInspectorTree ( INSPECTOR _ID ) ;
api . sendInspectorState ( INSPECTOR _ID ) ;
api . getSettings ( ) . logStoreChanges && toastMessage ( ` Disposed " ${ store . $id } " store 🗑 ` ) ;
} ;
api . notifyComponentUpdate ( ) ;
api . sendInspectorTree ( INSPECTOR _ID ) ;
api . sendInspectorState ( INSPECTOR _ID ) ;
api . getSettings ( ) . logStoreChanges && toastMessage ( ` " ${ store . $id } " store installed 🆕 ` ) ;
} ) ;
}
let runningActionId = 0 ;
let activeAction ;
function patchActionForGrouping ( store , actionNames ) {
const actions = actionNames . reduce ( ( storeActions , actionName ) => {
storeActions [ actionName ] = vue . toRaw ( store ) [ actionName ] ;
return storeActions ;
} , { } ) ;
for ( const actionName in actions ) {
store [ actionName ] = function ( ) {
const _actionId = runningActionId ;
const trackedStore = new Proxy ( store , {
get ( ... args ) {
activeAction = _actionId ;
return Reflect . get ( ... args ) ;
} ,
set ( ... args ) {
activeAction = _actionId ;
return Reflect . set ( ... args ) ;
}
} ) ;
return actions [ actionName ] . apply ( trackedStore , arguments ) ;
} ;
}
}
function devtoolsPlugin ( { app , store , options } ) {
if ( store . $id . startsWith ( "__hot:" ) ) {
return ;
}
if ( options . state ) {
store . _isOptionsAPI = true ;
}
if ( typeof options . state === "function" ) {
patchActionForGrouping (
// @ts-expect-error: can cast the store...
store ,
Object . keys ( options . actions )
) ;
const originalHotUpdate = store . _hotUpdate ;
vue . toRaw ( store ) . _hotUpdate = function ( newStore ) {
originalHotUpdate . apply ( this , arguments ) ;
patchActionForGrouping ( store , Object . keys ( newStore . _hmrPayload . actions ) ) ;
} ;
}
addStoreToDevtools (
app ,
// FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
store
) ;
}
function createPinia ( ) {
const scope = vue . effectScope ( true ) ;
const state = scope . run ( ( ) => vue . ref ( { } ) ) ;
let _p = [ ] ;
let toBeInstalled = [ ] ;
const pinia = vue . markRaw ( {
install ( app ) {
setActivePinia ( pinia ) ;
{
pinia . _a = app ;
app . provide ( piniaSymbol , pinia ) ;
app . config . globalProperties . $pinia = pinia ;
if ( USE _DEVTOOLS ) {
registerPiniaDevtools ( app , pinia ) ;
}
toBeInstalled . forEach ( ( plugin ) => _p . push ( plugin ) ) ;
toBeInstalled = [ ] ;
}
} ,
use ( plugin ) {
if ( ! this . _a && ! isVue2 ) {
toBeInstalled . push ( plugin ) ;
} else {
_p . push ( plugin ) ;
}
return this ;
} ,
_p ,
// it's actually undefined here
// @ts-expect-error
_a : null ,
_e : scope ,
_s : /* @__PURE__ */ new Map ( ) ,
state
} ) ;
if ( USE _DEVTOOLS && typeof Proxy !== "undefined" ) {
pinia . use ( devtoolsPlugin ) ;
}
return pinia ;
}
function patchObject ( newState , oldState ) {
for ( const key in oldState ) {
const subPatch = oldState [ key ] ;
if ( ! ( key in newState ) ) {
continue ;
}
const targetValue = newState [ key ] ;
if ( isPlainObject$1 ( targetValue ) && isPlainObject$1 ( subPatch ) && ! vue . isRef ( subPatch ) && ! vue . isReactive ( subPatch ) ) {
newState [ key ] = patchObject ( targetValue , subPatch ) ;
} else {
{
newState [ key ] = subPatch ;
}
}
}
return newState ;
}
const noop = ( ) => {
} ;
function addSubscription ( subscriptions , callback , detached , onCleanup = noop ) {
subscriptions . push ( callback ) ;
const removeSubscription = ( ) => {
const idx = subscriptions . indexOf ( callback ) ;
if ( idx > - 1 ) {
subscriptions . splice ( idx , 1 ) ;
onCleanup ( ) ;
}
} ;
if ( ! detached && vue . getCurrentScope ( ) ) {
vue . onScopeDispose ( removeSubscription ) ;
}
return removeSubscription ;
}
function triggerSubscriptions ( subscriptions , ... args ) {
subscriptions . slice ( ) . forEach ( ( callback ) => {
callback ( ... args ) ;
} ) ;
}
function mergeReactiveObjects ( target , patchToApply ) {
if ( target instanceof Map && patchToApply instanceof Map ) {
patchToApply . forEach ( ( value , key ) => target . set ( key , value ) ) ;
}
if ( target instanceof Set && patchToApply instanceof Set ) {
patchToApply . forEach ( target . add , target ) ;
}
for ( const key in patchToApply ) {
if ( ! patchToApply . hasOwnProperty ( key ) )
continue ;
const subPatch = patchToApply [ key ] ;
const targetValue = target [ key ] ;
if ( isPlainObject$1 ( targetValue ) && isPlainObject$1 ( subPatch ) && target . hasOwnProperty ( key ) && ! vue . isRef ( subPatch ) && ! vue . isReactive ( subPatch ) ) {
target [ key ] = mergeReactiveObjects ( targetValue , subPatch ) ;
} else {
target [ key ] = subPatch ;
}
}
return target ;
}
const skipHydrateSymbol = Symbol ( "pinia:skipHydration" ) ;
function shouldHydrate ( obj ) {
return ! isPlainObject$1 ( obj ) || ! obj . hasOwnProperty ( skipHydrateSymbol ) ;
}
const { assign } = Object ;
function isComputed ( o ) {
return ! ! ( vue . isRef ( o ) && o . effect ) ;
}
function createOptionsStore ( id , options , pinia , hot ) {
const { state , actions , getters } = options ;
const initialState = pinia . state . value [ id ] ;
let store ;
function setup ( ) {
if ( ! initialState && ! hot ) {
{
pinia . state . value [ id ] = state ? state ( ) : { } ;
}
}
const localState = hot ? (
// use ref() to unwrap refs inside state TODO: check if this is still necessary
vue . toRefs ( vue . ref ( state ? state ( ) : { } ) . value )
) : vue . toRefs ( pinia . state . value [ id ] ) ;
return assign ( localState , actions , Object . keys ( getters || { } ) . reduce ( ( computedGetters , name ) => {
if ( name in localState ) {
console . warn ( ` [🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with " ${ name } " in store " ${ id } ". ` ) ;
}
computedGetters [ name ] = vue . markRaw ( vue . computed ( ( ) => {
setActivePinia ( pinia ) ;
const store2 = pinia . _s . get ( id ) ;
return getters [ name ] . call ( store2 , store2 ) ;
} ) ) ;
return computedGetters ;
} , { } ) ) ;
}
store = createSetupStore ( id , setup , options , pinia , hot , true ) ;
return store ;
}
function createSetupStore ( $id , setup , options = { } , pinia , hot , isOptionsStore ) {
let scope ;
const optionsForPlugin = assign ( { actions : { } } , options ) ;
if ( ! pinia . _e . active ) {
throw new Error ( "Pinia destroyed" ) ;
}
const $subscribeOptions = {
deep : true
// flush: 'post',
} ;
{
$subscribeOptions . onTrigger = ( event ) => {
if ( isListening ) {
debuggerEvents = event ;
} else if ( isListening == false && ! store . _hotUpdating ) {
if ( Array . isArray ( debuggerEvents ) ) {
debuggerEvents . push ( event ) ;
} else {
console . error ( "🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug." ) ;
}
}
} ;
}
let isListening ;
let isSyncListening ;
let subscriptions = vue . markRaw ( [ ] ) ;
let actionSubscriptions = vue . markRaw ( [ ] ) ;
let debuggerEvents ;
const initialState = pinia . state . value [ $id ] ;
if ( ! isOptionsStore && ! initialState && ! hot ) {
{
pinia . state . value [ $id ] = { } ;
}
}
const hotState = vue . ref ( { } ) ;
let activeListener ;
function $patch ( partialStateOrMutator ) {
let subscriptionMutation ;
isListening = isSyncListening = false ;
{
debuggerEvents = [ ] ;
}
if ( typeof partialStateOrMutator === "function" ) {
partialStateOrMutator ( pinia . state . value [ $id ] ) ;
subscriptionMutation = {
type : MutationType . patchFunction ,
storeId : $id ,
events : debuggerEvents
} ;
} else {
mergeReactiveObjects ( pinia . state . value [ $id ] , partialStateOrMutator ) ;
subscriptionMutation = {
type : MutationType . patchObject ,
payload : partialStateOrMutator ,
storeId : $id ,
events : debuggerEvents
} ;
}
const myListenerId = activeListener = Symbol ( ) ;
vue . nextTick ( ) . then ( ( ) => {
if ( activeListener === myListenerId ) {
isListening = true ;
}
} ) ;
isSyncListening = true ;
triggerSubscriptions ( subscriptions , subscriptionMutation , pinia . state . value [ $id ] ) ;
}
const $reset = isOptionsStore ? function $reset2 ( ) {
const { state } = options ;
const newState = state ? state ( ) : { } ;
this . $patch ( ( $state ) => {
assign ( $state , newState ) ;
} ) ;
} : (
/* istanbul ignore next */
( ) => {
throw new Error ( ` 🍍: Store " ${ $id } " is built using the setup syntax and does not implement $ reset(). ` ) ;
}
) ;
function $dispose ( ) {
scope . stop ( ) ;
subscriptions = [ ] ;
actionSubscriptions = [ ] ;
pinia . _s . delete ( $id ) ;
}
function wrapAction ( name , action ) {
return function ( ) {
setActivePinia ( pinia ) ;
const args = Array . from ( arguments ) ;
const afterCallbackList = [ ] ;
const onErrorCallbackList = [ ] ;
function after ( callback ) {
afterCallbackList . push ( callback ) ;
}
function onError ( callback ) {
onErrorCallbackList . push ( callback ) ;
}
triggerSubscriptions ( actionSubscriptions , {
args ,
name ,
store ,
after ,
onError
} ) ;
let ret ;
try {
ret = action . apply ( this && this . $id === $id ? this : store , args ) ;
} catch ( error2 ) {
triggerSubscriptions ( onErrorCallbackList , error2 ) ;
throw error2 ;
}
if ( ret instanceof Promise ) {
return ret . then ( ( value ) => {
triggerSubscriptions ( afterCallbackList , value ) ;
return value ;
} ) . catch ( ( error2 ) => {
triggerSubscriptions ( onErrorCallbackList , error2 ) ;
return Promise . reject ( error2 ) ;
} ) ;
}
triggerSubscriptions ( afterCallbackList , ret ) ;
return ret ;
} ;
}
const _hmrPayload = /* @__PURE__ */ vue . markRaw ( {
actions : { } ,
getters : { } ,
state : [ ] ,
hotState
} ) ;
const partialStore = {
_p : pinia ,
// _s: scope,
$id ,
$onAction : addSubscription . bind ( null , actionSubscriptions ) ,
$patch ,
$reset ,
$subscribe ( callback , options2 = { } ) {
const removeSubscription = addSubscription ( subscriptions , callback , options2 . detached , ( ) => stopWatcher ( ) ) ;
const stopWatcher = scope . run ( ( ) => vue . watch ( ( ) => pinia . state . value [ $id ] , ( state ) => {
if ( options2 . flush === "sync" ? isSyncListening : isListening ) {
callback ( {
storeId : $id ,
type : MutationType . direct ,
events : debuggerEvents
} , state ) ;
}
} , assign ( { } , $subscribeOptions , options2 ) ) ) ;
return removeSubscription ;
} ,
$dispose
} ;
const store = vue . reactive (
assign (
{
_hmrPayload ,
_customProperties : vue . markRaw ( /* @__PURE__ */ new Set ( ) )
// devtools custom properties
} ,
partialStore
// must be added later
// setupStore
)
) ;
pinia . _s . set ( $id , store ) ;
const setupStore = pinia . _e . run ( ( ) => {
scope = vue . effectScope ( ) ;
return scope . run ( ( ) => setup ( ) ) ;
} ) ;
for ( const key in setupStore ) {
const prop = setupStore [ key ] ;
if ( vue . isRef ( prop ) && ! isComputed ( prop ) || vue . isReactive ( prop ) ) {
if ( hot ) {
set ( hotState . value , key , vue . toRef ( setupStore , key ) ) ;
} else if ( ! isOptionsStore ) {
if ( initialState && shouldHydrate ( prop ) ) {
if ( vue . isRef ( prop ) ) {
prop . value = initialState [ key ] ;
} else {
mergeReactiveObjects ( prop , initialState [ key ] ) ;
}
}
{
pinia . state . value [ $id ] [ key ] = prop ;
}
}
{
_hmrPayload . state . push ( key ) ;
}
} else if ( typeof prop === "function" ) {
const actionValue = hot ? prop : wrapAction ( key , prop ) ;
{
setupStore [ key ] = actionValue ;
}
{
_hmrPayload . actions [ key ] = prop ;
}
optionsForPlugin . actions [ key ] = prop ;
} else {
if ( isComputed ( prop ) ) {
_hmrPayload . getters [ key ] = isOptionsStore ? (
// @ts-expect-error
options . getters [ key ]
) : prop ;
if ( IS _CLIENT ) {
const getters = setupStore . _getters || // @ts-expect-error: same
( setupStore . _getters = vue . markRaw ( [ ] ) ) ;
getters . push ( key ) ;
}
}
}
}
{
assign ( store , setupStore ) ;
assign ( vue . toRaw ( store ) , setupStore ) ;
}
Object . defineProperty ( store , "$state" , {
get : ( ) => hot ? hotState . value : pinia . state . value [ $id ] ,
set : ( state ) => {
if ( hot ) {
throw new Error ( "cannot set hotState" ) ;
}
$patch ( ( $state ) => {
assign ( $state , state ) ;
} ) ;
}
} ) ;
{
store . _hotUpdate = vue . markRaw ( ( newStore ) => {
store . _hotUpdating = true ;
newStore . _hmrPayload . state . forEach ( ( stateKey ) => {
if ( stateKey in store . $state ) {
const newStateTarget = newStore . $state [ stateKey ] ;
const oldStateSource = store . $state [ stateKey ] ;
if ( typeof newStateTarget === "object" && isPlainObject$1 ( newStateTarget ) && isPlainObject$1 ( oldStateSource ) ) {
patchObject ( newStateTarget , oldStateSource ) ;
} else {
newStore . $state [ stateKey ] = oldStateSource ;
}
}
set ( store , stateKey , vue . toRef ( newStore . $state , stateKey ) ) ;
} ) ;
Object . keys ( store . $state ) . forEach ( ( stateKey ) => {
if ( ! ( stateKey in newStore . $state ) ) {
del ( store , stateKey ) ;
}
} ) ;
isListening = false ;
isSyncListening = false ;
pinia . state . value [ $id ] = vue . toRef ( newStore . _hmrPayload , "hotState" ) ;
isSyncListening = true ;
vue . nextTick ( ) . then ( ( ) => {
isListening = true ;
} ) ;
for ( const actionName in newStore . _hmrPayload . actions ) {
const action = newStore [ actionName ] ;
set ( store , actionName , wrapAction ( actionName , action ) ) ;
}
for ( const getterName in newStore . _hmrPayload . getters ) {
const getter = newStore . _hmrPayload . getters [ getterName ] ;
const getterValue = isOptionsStore ? (
// special handling of options api
vue . computed ( ( ) => {
setActivePinia ( pinia ) ;
return getter . call ( store , store ) ;
} )
) : getter ;
set ( store , getterName , getterValue ) ;
}
Object . keys ( store . _hmrPayload . getters ) . forEach ( ( key ) => {
if ( ! ( key in newStore . _hmrPayload . getters ) ) {
del ( store , key ) ;
}
} ) ;
Object . keys ( store . _hmrPayload . actions ) . forEach ( ( key ) => {
if ( ! ( key in newStore . _hmrPayload . actions ) ) {
del ( store , key ) ;
}
} ) ;
store . _hmrPayload = newStore . _hmrPayload ;
store . _getters = newStore . _getters ;
store . _hotUpdating = false ;
} ) ;
}
if ( USE _DEVTOOLS ) {
const nonEnumerable = {
writable : true ,
configurable : true ,
// avoid warning on devtools trying to display this property
enumerable : false
} ;
[ "_p" , "_hmrPayload" , "_getters" , "_customProperties" ] . forEach ( ( p ) => {
Object . defineProperty ( store , p , assign ( { value : store [ p ] } , nonEnumerable ) ) ;
} ) ;
}
pinia . _p . forEach ( ( extender ) => {
if ( USE _DEVTOOLS ) {
const extensions = scope . run ( ( ) => extender ( {
store ,
app : pinia . _a ,
pinia ,
options : optionsForPlugin
} ) ) ;
Object . keys ( extensions || { } ) . forEach ( ( key ) => store . _customProperties . add ( key ) ) ;
assign ( store , extensions ) ;
} else {
assign ( store , scope . run ( ( ) => extender ( {
store ,
app : pinia . _a ,
pinia ,
options : optionsForPlugin
} ) ) ) ;
}
} ) ;
if ( store . $state && typeof store . $state === "object" && typeof store . $state . constructor === "function" && ! store . $state . constructor . toString ( ) . includes ( "[native code]" ) ) {
console . warn ( ` [🍍]: The "state" must be a plain object. It cannot be
state : ( ) => new MyClass ( )
Found in store "${store.$id}" . ` );
}
if ( initialState && isOptionsStore && options . hydrate ) {
options . hydrate ( store . $state , initialState ) ;
}
isListening = true ;
isSyncListening = true ;
return store ;
}
function defineStore ( idOrOptions , setup , setupOptions ) {
let id ;
let options ;
const isSetupStore = typeof setup === "function" ;
if ( typeof idOrOptions === "string" ) {
id = idOrOptions ;
options = isSetupStore ? setupOptions : setup ;
} else {
options = idOrOptions ;
id = idOrOptions . id ;
}
function useStore ( pinia , hot ) {
const currentInstance = vue . getCurrentInstance ( ) ;
pinia = // in test mode, ignore the argument provided as we can always retrieve a
// pinia instance with getActivePinia()
pinia || currentInstance && vue . inject ( piniaSymbol , null ) ;
if ( pinia )
setActivePinia ( pinia ) ;
if ( ! activePinia ) {
throw new Error ( ` [🍍]: getActivePinia was called with no active Pinia. Did you forget to install pinia?
const pinia = createPinia ( )
app . use ( pinia )
This will fail in production . ` );
}
pinia = activePinia ;
if ( ! pinia . _s . has ( id ) ) {
if ( isSetupStore ) {
createSetupStore ( id , setup , options , pinia ) ;
} else {
createOptionsStore ( id , options , pinia ) ;
}
{
useStore . _pinia = pinia ;
}
}
const store = pinia . _s . get ( id ) ;
if ( hot ) {
const hotId = "__hot:" + id ;
const newStore = isSetupStore ? createSetupStore ( hotId , setup , options , pinia , true ) : createOptionsStore ( hotId , assign ( { } , options ) , pinia , true ) ;
hot . _hotUpdate ( newStore ) ;
delete pinia . state . value [ hotId ] ;
pinia . _s . delete ( hotId ) ;
}
if ( IS _CLIENT && currentInstance && currentInstance . proxy && // avoid adding stores that are just built for hot module replacement
! hot ) {
const vm = currentInstance . proxy ;
const cache = "_pStores" in vm ? vm . _pStores : vm . _pStores = { } ;
cache [ id ] = store ;
}
return store ;
}
useStore . $id = id ;
return useStore ;
}
const counterStore = defineStore ( "counter" , {
state : ( ) => ( {
count : 0
} ) ,
getters : { } ,
actions : {
increment ( ) {
this . count ++ ;
}
}
} ) ;
2023-10-20 18:45:15 +08:00
const _sfc _main$i = {
_ _name : "planting" ,
2023-10-17 16:02:55 +08:00
setup ( _ _props ) {
2023-10-20 18:45:15 +08:00
const list = vue . reactive ( [ {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} ] ) ;
return ( _ctx , _cache ) => {
return vue . openBlock ( ) , vue . createElementBlock ( "view" , { class : "" } , [
vue . createElementVNode ( "view" , { class : "content" } , [
vue . createElementVNode ( "view" , { class : "border-bgc" } ) ,
vue . createElementVNode ( "view" , {
class : "" ,
style : { "height" : "30rpx" }
} ) ,
vue . createElementVNode ( "view" , { class : "card" } , [
vue . createElementVNode ( "view" , { class : "card-li" } , " 农户名称: 魏鹏飞 " ) ,
vue . createElementVNode ( "view" , { class : "card-li" } , " 种养殖类型: 种植户 " ) ,
vue . createElementVNode ( "view" , { class : "card-li" } , " 土地面积: 00 " ) ,
vue . createElementVNode ( "view" , { class : "card-li" } , " 地址: 对话方式打开就会发生的空间和 " )
] ) ,
( vue . openBlock ( true ) , vue . createElementBlock (
vue . Fragment ,
null ,
vue . renderList ( list , ( item , index2 ) => {
return vue . openBlock ( ) , vue . createElementBlock ( "view" , {
class : "card" ,
key : index2
} , [
vue . createElementVNode ( "view" , { class : "tit card-li" } , [
vue . createElementVNode ( "view" , { class : "" } , " 土地1 " ) ,
vue . createElementVNode ( "view" , {
class : "" ,
style : { "color" : "#00A15E" }
} , " 已种植 " )
] ) ,
vue . createElementVNode ( "view" , { class : "card-li" } , [
vue . createElementVNode ( "view" , { class : "" } , " 面积: 10亩 " )
] ) ,
vue . createElementVNode ( "view" , { class : "card-li tit" } , [
vue . createElementVNode ( "view" , {
class : "" ,
style : { "font-weight" : "normal" }
} , " 农作物: 10亩 " ) ,
vue . createElementVNode ( "view" , {
class : "" ,
style : { "color" : "#FF9B66" }
} , " 已成熟 " )
] ) ,
vue . createElementVNode ( "view" , {
class : "card-li tit" ,
style : { "font-weight" : "normal" }
} , [
vue . createElementVNode ( "view" , { class : "" } , " 预计产量: 100kg " ) ,
vue . createElementVNode ( "view" , { class : "" } , " 已出售: 500kg " )
] )
] ) ;
} ) ,
128
/* KEYED_FRAGMENT */
) ) ,
vue . createElementVNode ( "view" , { style : { "height" : "170rpx" } } )
] ) ,
vue . createElementVNode ( "view" , { class : "bottom" } , [
vue . createElementVNode ( "view" , { class : "add-btn" } , " 批量处理 " ) ,
vue . createElementVNode ( "view" , { class : "add-btn add" } , " 增加种植 " )
] )
] ) ;
2023-10-17 16:02:55 +08:00
} ;
2023-10-20 18:45:15 +08:00
}
} ;
const planting = /* @__PURE__ */ _export _sfc ( _sfc _main$i , [ [ "__scopeId" , "data-v-093aaff7" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/components/index/planting.vue" ] ] ) ;
const _sfc _main$h = {
_ _name : "index" ,
setup ( _ _props ) {
const list = vue . reactive ( [ {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} , {
tit : "土地种植管理"
} ] ) ;
2023-10-17 16:02:55 +08:00
return ( _ctx , _cache ) => {
2023-10-20 18:45:15 +08:00
const _component _u _ _image = resolveEasycom ( vue . resolveDynamicComponent ( "u--image" ) , _ _easycom _0$4 ) ;
2023-10-17 16:02:55 +08:00
return vue . openBlock ( ) , vue . createElementBlock ( "view" , { class : "" } , [
2023-10-20 18:45:15 +08:00
vue . createElementVNode ( "view" , { class : "tabbar" } , [
vue . createElementVNode ( "view" , {
class : "" ,
style : { "padding-top" : "var(--status-bar-height)" }
} ) ,
vue . createElementVNode ( "view" , {
class : "" ,
style : { "display" : "flex" }
} , [
vue . createVNode ( _component _u _ _image , {
src : "/static/img/FH.png" ,
width : "50.82rpx" ,
height : "50.82rpx" ,
alt : ""
} ) ,
vue . createElementVNode ( "view" , { class : "scoll-list" } , [
( vue . openBlock ( true ) , vue . createElementBlock (
vue . Fragment ,
null ,
vue . renderList ( list , ( item , index2 ) => {
return vue . openBlock ( ) , vue . createElementBlock (
"view" ,
{
key : index2 ,
class : "scoll-list-li"
} ,
vue . toDisplayString ( item . tit ) ,
1
/* TEXT */
) ;
} ) ,
128
/* KEYED_FRAGMENT */
) )
] )
] )
] ) ,
vue . createElementVNode ( "view" , { style : { "background-color" : "#34D190" } } , [
vue . createElementVNode ( "view" , {
class : "" ,
style : { "padding-top" : "var(--status-bar-height)" }
} ) ,
vue . createElementVNode ( "view" , {
class : "" ,
style : { "height" : "100rpx" }
} )
] ) ,
vue . createCommentVNode ( " 种植户首页 " ) ,
vue . createVNode ( planting ) ,
vue . createCommentVNode ( " 卖鱼的首页 " ) ,
vue . createCommentVNode ( "v-if" , true )
2023-10-17 16:02:55 +08:00
] ) ;
} ;
}
} ;
2023-10-20 18:45:15 +08:00
const PagesIndexIndex = /* @__PURE__ */ _export _sfc ( _sfc _main$h , [ [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/pages/index/index.vue" ] ] ) ;
const props$7 = {
props : {
// 绑定的值
modelValue : {
type : [ String , Number ] ,
default : props$b . input . value
} ,
// number-数字输入键盘, app-vue下可以输入浮点数, app-nvue和小程序平台下只能输入整数
// idcard-身份证输入键盘, 微信、支付宝、百度、QQ小程序
// digit-带小数点的数字键盘, App的nvue页面、微信、支付宝、百度、头条、QQ小程序
// text-文本输入键盘
type : {
type : String ,
default : props$b . input . type
} ,
// 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,
// 兼容性: 微信小程序、百度小程序、字节跳动小程序、QQ小程序
fixed : {
type : Boolean ,
default : props$b . input . fixed
} ,
// 是否禁用输入框
disabled : {
type : Boolean ,
default : props$b . input . disabled
} ,
// 禁用状态时的背景色
disabledColor : {
type : String ,
default : props$b . input . disabledColor
} ,
// 是否显示清除控件
clearable : {
type : Boolean ,
default : props$b . input . clearable
} ,
// 是否密码类型
password : {
type : Boolean ,
default : props$b . input . password
} ,
// 最大输入长度,设置为 -1 的时候不限制最大长度
maxlength : {
type : [ String , Number ] ,
default : props$b . input . maxlength
} ,
// 输入框为空时的占位符
placeholder : {
type : String ,
default : props$b . input . placeholder
} ,
// 指定placeholder的样式类, 注意页面或组件的style中写了scoped时, 需要在类名前写/deep/
placeholderClass : {
type : String ,
default : props$b . input . placeholderClass
} ,
// 指定placeholder的样式
placeholderStyle : {
type : [ String , Object ] ,
default : props$b . input . placeholderStyle
} ,
// 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效
showWordLimit : {
type : Boolean ,
default : props$b . input . showWordLimit
} ,
// 设置右下角按钮的文字, 有效值: send|search|next|go|done, 兼容性详见uni-app文档
// https://uniapp.dcloud.io/component/input
// https://uniapp.dcloud.io/component/textarea
confirmType : {
type : String ,
default : props$b . input . confirmType
} ,
// 点击键盘右下角按钮时是否保持键盘不收起, H5无效
confirmHold : {
type : Boolean ,
default : props$b . input . confirmHold
} ,
// focus时, 点击页面的时候不收起键盘, 微信小程序有效
holdKeyboard : {
type : Boolean ,
default : props$b . input . holdKeyboard
} ,
// 自动获取焦点
// 在 H5 平台能否聚焦以及软键盘是否跟随弹出, 取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
focus : {
type : Boolean ,
default : props$b . input . focus
} ,
// 键盘收起时, 是否自动失去焦点, 目前仅App3.0.0+有效
autoBlur : {
type : Boolean ,
default : props$b . input . autoBlur
} ,
// 是否去掉 iOS 下的默认内边距, 仅微信小程序, 且type=textarea时有效
disableDefaultPadding : {
type : Boolean ,
default : props$b . input . disableDefaultPadding
} ,
// 指定focus时光标的位置
cursor : {
type : [ String , Number ] ,
default : props$b . input . cursor
} ,
// 输入框聚焦时底部与键盘的距离
cursorSpacing : {
type : [ String , Number ] ,
default : props$b . input . cursorSpacing
} ,
// 光标起始位置, 自动聚集时有效, 需与selection-end搭配使用
selectionStart : {
type : [ String , Number ] ,
default : props$b . input . selectionStart
} ,
// 光标结束位置, 自动聚集时有效, 需与selection-start搭配使用
selectionEnd : {
type : [ String , Number ] ,
default : props$b . input . selectionEnd
} ,
// 键盘弹起时,是否自动上推页面
adjustPosition : {
type : Boolean ,
default : props$b . input . adjustPosition
} ,
// 输入框内容对齐方式, 可选值为: left|center|right
inputAlign : {
type : String ,
default : props$b . input . inputAlign
} ,
// 输入框字体的大小
fontSize : {
type : [ String , Number ] ,
default : props$b . input . fontSize
} ,
// 输入框字体颜色
color : {
type : String ,
default : props$b . input . color
} ,
// 输入框前置图标
prefixIcon : {
type : String ,
default : props$b . input . prefixIcon
} ,
// 前置图标样式,对象或字符串
prefixIconStyle : {
type : [ String , Object ] ,
default : props$b . input . prefixIconStyle
} ,
// 输入框后置图标
suffixIcon : {
type : String ,
default : props$b . input . suffixIcon
} ,
// 后置图标样式,对象或字符串
suffixIconStyle : {
type : [ String , Object ] ,
default : props$b . input . suffixIconStyle
} ,
// 边框类型, surround-四周边框, bottom-底部边框, none-无边框
border : {
type : String ,
default : props$b . input . border
} ,
// 是否只读, 与disabled不同之处在于disabled会置灰组件, 而readonly则不会
readonly : {
type : Boolean ,
default : props$b . input . readonly
} ,
// 输入框形状, circle-圆形, square-方形
shape : {
type : String ,
default : props$b . input . shape
} ,
// 用于处理或者过滤输入框内容的方法
formatter : {
type : [ Function , null ] ,
default : props$b . input . formatter
} ,
// 是否忽略组件内对文本合成系统事件的处理
ignoreCompositionEvent : {
type : Boolean ,
default : true
}
}
} ;
const _sfc _main$g = {
name : "u-input" ,
mixins : [ mpMixin , mixin , props$7 ] ,
data ( ) {
return {
// 输入框的值
innerValue : "" ,
// 是否处于获得焦点状态
focused : false ,
// value是否第一次变化, 在watch中, 由于加入immediate属性, 会在第一次触发, 此时不应该认为value发生了变化
firstChange : true ,
// value绑定值的变化是由内部还是外部引起的
changeFromInner : false ,
// 过滤处理方法
innerFormatter : ( value ) => value
} ;
} ,
watch : {
modelValue : {
immediate : true ,
handler ( newVal , oldVal ) {
this . innerValue = newVal ;
this . firstChange = false ;
this . changeFromInner = false ;
}
}
} ,
computed : {
// 是否显示清除控件
isShowClear ( ) {
const { clearable , readonly , focused , innerValue } = this ;
return ! ! clearable && ! readonly && ! ! focused && innerValue !== "" ;
} ,
// 组件的类名
inputClass ( ) {
let classes = [ ] , { border , disabled , shape } = this ;
border === "surround" && ( classes = classes . concat ( [ "u-border" , "u-input--radius" ] ) ) ;
classes . push ( ` u-input-- ${ shape } ` ) ;
border === "bottom" && ( classes = classes . concat ( [
"u-border-bottom" ,
"u-input--no-radius"
] ) ) ;
return classes . join ( " " ) ;
} ,
// 组件的样式
wrapperStyle ( ) {
const style = { } ;
if ( this . disabled ) {
style . backgroundColor = this . disabledColor ;
}
if ( this . border === "none" ) {
style . padding = "0" ;
} else {
style . paddingTop = "6px" ;
style . paddingBottom = "6px" ;
style . paddingLeft = "9px" ;
style . paddingRight = "9px" ;
}
return uni . $u . deepMerge ( style , uni . $u . addStyle ( this . customStyle ) ) ;
} ,
// 输入框的样式
inputStyle ( ) {
const style = {
color : this . color ,
fontSize : uni . $u . addUnit ( this . fontSize ) ,
textAlign : this . inputAlign
} ;
return style ;
}
} ,
emits : [ "update:modelValue" , "focus" , "blur" , "change" , "confirm" , "clear" , "keyboardheightchange" ] ,
methods : {
// 在微信小程序中, 不支持将函数当做props参数, 故只能通过ref形式调用
setFormatter ( e ) {
this . innerFormatter = e ;
} ,
// 当键盘输入时, 触发input事件
onInput ( e ) {
let { value = "" } = e . detail || { } ;
const formatter = this . formatter || this . innerFormatter ;
const formatValue = formatter ( value ) ;
this . innerValue = value ;
this . $nextTick ( ( ) => {
this . innerValue = formatValue ;
this . valueChange ( ) ;
} ) ;
} ,
// 输入框失去焦点时触发
onBlur ( event ) {
this . $emit ( "blur" , event . detail . value ) ;
uni . $u . sleep ( 50 ) . then ( ( ) => {
this . focused = false ;
} ) ;
uni . $u . formValidate ( this , "blur" ) ;
} ,
// 输入框聚焦时触发
onFocus ( event ) {
this . focused = true ;
this . $emit ( "focus" ) ;
} ,
// 点击完成按钮时触发
onConfirm ( event ) {
this . $emit ( "confirm" , this . innerValue ) ;
} ,
// 键盘高度发生变化的时候触发此事件
// 兼容性: 微信小程序2.7.0+、App 3.1.0+
onkeyboardheightchange ( event ) {
this . $emit ( "keyboardheightchange" , event ) ;
} ,
// 内容发生变化,进行处理
valueChange ( ) {
const value = this . innerValue ;
this . $nextTick ( ( ) => {
this . $emit ( "update:modelValue" , value ) ;
this . changeFromInner = true ;
this . $emit ( "change" , value ) ;
uni . $u . formValidate ( this , "change" ) ;
} ) ;
} ,
// 点击清除控件
onClear ( ) {
this . innerValue = "" ;
this . $nextTick ( ( ) => {
this . valueChange ( ) ;
this . $emit ( "clear" ) ;
} ) ;
} ,
/ * *
* 在安卓nvue上 , 事件无法冒泡
* 在某些时间 , 我们希望监听u - from - item的点击事件 , 此时会导致点击u - form - item内的u - input后
* 无法触发u - form - item的点击事件 , 这里通过手动调用u - form - item的方法进行触发
* /
clickHandler ( ) {
}
}
} ;
function _sfc _render$c ( _ctx , _cache , $props , $setup , $data , $options ) {
const _component _u _icon = resolveEasycom ( vue . resolveDynamicComponent ( "u-icon" ) , _ _easycom _2 ) ;
return vue . openBlock ( ) , vue . createElementBlock (
"view" ,
{
class : vue . normalizeClass ( [ "u-input" , $options . inputClass ] ) ,
style : vue . normalizeStyle ( [ $options . wrapperStyle ] )
} ,
[
vue . createElementVNode ( "view" , { class : "u-input__content" } , [
_ctx . prefixIcon || _ctx . $slots . prefix ? ( vue . openBlock ( ) , vue . createElementBlock ( "view" , {
key : 0 ,
class : "u-input__content__prefix-icon"
} , [
vue . renderSlot ( _ctx . $slots , "prefix" , { } , ( ) => [
vue . createVNode ( _component _u _icon , {
name : _ctx . prefixIcon ,
size : "18" ,
customStyle : _ctx . prefixIconStyle
} , null , 8 , [ "name" , "customStyle" ] )
] , true )
] ) ) : vue . createCommentVNode ( "v-if" , true ) ,
vue . createElementVNode ( "view" , {
class : "u-input__content__field-wrapper" ,
onClick : _cache [ 5 ] || ( _cache [ 5 ] = ( ... args ) => $options . clickHandler && $options . clickHandler ( ... args ) )
} , [
vue . createCommentVNode ( " 根据uni-app的input组件文档, H5和APP中只要声明了password参数(无论true还是false), type均失效, 此时\n 为了防止type=number时, 又存在password属性, type无效, 此时需要设置password为undefined\n " ) ,
vue . createElementVNode ( "input" , {
class : "u-input__content__field-wrapper__field" ,
style : vue . normalizeStyle ( [ $options . inputStyle ] ) ,
type : _ctx . type ,
focus : _ctx . focus ,
cursor : _ctx . cursor ,
value : $data . innerValue ,
"auto-blur" : _ctx . autoBlur ,
disabled : _ctx . disabled || _ctx . readonly ,
maxlength : _ctx . maxlength ,
placeholder : _ctx . placeholder ,
"placeholder-style" : _ctx . placeholderStyle ,
"placeholder-class" : _ctx . placeholderClass ,
"confirm-type" : _ctx . confirmType ,
"confirm-hold" : _ctx . confirmHold ,
"hold-keyboard" : _ctx . holdKeyboard ,
"cursor-spacing" : _ctx . cursorSpacing ,
"adjust-position" : _ctx . adjustPosition ,
"selection-end" : _ctx . selectionEnd ,
"selection-start" : _ctx . selectionStart ,
password : _ctx . password || _ctx . type === "password" || void 0 ,
ignoreCompositionEvent : _ctx . ignoreCompositionEvent ,
onInput : _cache [ 0 ] || ( _cache [ 0 ] = ( ... args ) => $options . onInput && $options . onInput ( ... args ) ) ,
onBlur : _cache [ 1 ] || ( _cache [ 1 ] = ( ... args ) => $options . onBlur && $options . onBlur ( ... args ) ) ,
onFocus : _cache [ 2 ] || ( _cache [ 2 ] = ( ... args ) => $options . onFocus && $options . onFocus ( ... args ) ) ,
onConfirm : _cache [ 3 ] || ( _cache [ 3 ] = ( ... args ) => $options . onConfirm && $options . onConfirm ( ... args ) ) ,
onKeyboardheightchange : _cache [ 4 ] || ( _cache [ 4 ] = ( ... args ) => $options . onkeyboardheightchange && $options . onkeyboardheightchange ( ... args ) )
} , null , 44 , [ "type" , "focus" , "cursor" , "value" , "auto-blur" , "disabled" , "maxlength" , "placeholder" , "placeholder-style" , "placeholder-class" , "confirm-type" , "confirm-hold" , "hold-keyboard" , "cursor-spacing" , "adjust-position" , "selection-end" , "selection-start" , "password" , "ignoreCompositionEvent" ] )
] ) ,
$options . isShowClear ? ( vue . openBlock ( ) , vue . createElementBlock ( "view" , {
key : 1 ,
class : "u-input__content__clear" ,
onClick : _cache [ 6 ] || ( _cache [ 6 ] = ( ... args ) => $options . onClear && $options . onClear ( ... args ) )
} , [
vue . createVNode ( _component _u _icon , {
name : "close" ,
size : "11" ,
color : "#ffffff" ,
customStyle : "line-height: 12px"
} )
] ) ) : vue . createCommentVNode ( "v-if" , true ) ,
_ctx . suffixIcon || _ctx . $slots . suffix ? ( vue . openBlock ( ) , vue . createElementBlock ( "view" , {
key : 2 ,
class : "u-input__content__subfix-icon"
} , [
vue . renderSlot ( _ctx . $slots , "suffix" , { } , ( ) => [
vue . createVNode ( _component _u _icon , {
name : _ctx . suffixIcon ,
size : "18" ,
customStyle : _ctx . suffixIconStyle
} , null , 8 , [ "name" , "customStyle" ] )
] , true )
] ) ) : vue . createCommentVNode ( "v-if" , true )
] )
] ,
6
/* CLASS, STYLE */
) ;
}
const _ _easycom _0$3 = /* @__PURE__ */ _export _sfc ( _sfc _main$g , [ [ "render" , _sfc _render$c ] , [ "__scopeId" , "data-v-5904192e" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-input/u-input.vue" ] ] ) ;
const props$6 = {
props : {
// 是否显示组件
show : {
type : Boolean ,
default : props$b . loadingIcon . show
} ,
// 颜色
color : {
type : String ,
default : props$b . loadingIcon . color
} ,
// 提示文字颜色
textColor : {
type : String ,
default : props$b . loadingIcon . textColor
} ,
// 文字和图标是否垂直排列
vertical : {
type : Boolean ,
default : props$b . loadingIcon . vertical
} ,
// 模式选择, circle-圆形, spinner-花朵形, semicircle-半圆形
mode : {
type : String ,
default : props$b . loadingIcon . mode
} ,
// 图标大小, 单位默认px
size : {
type : [ String , Number ] ,
default : props$b . loadingIcon . size
} ,
// 文字大小
textSize : {
type : [ String , Number ] ,
default : props$b . loadingIcon . textSize
} ,
// 文字内容
text : {
type : [ String , Number ] ,
default : props$b . loadingIcon . text
} ,
// 动画模式
timingFunction : {
type : String ,
default : props$b . loadingIcon . timingFunction
} ,
// 动画执行周期时间
duration : {
type : [ String , Number ] ,
default : props$b . loadingIcon . duration
} ,
// mode=circle时的暗边颜色
inactiveColor : {
type : String ,
default : props$b . loadingIcon . inactiveColor
}
}
} ;
const _sfc _main$f = {
name : "u-loading-icon" ,
mixins : [ mpMixin , mixin , props$6 ] ,
data ( ) {
return {
// Array.form可以通过一个伪数组对象创建指定长度的数组
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Array/from
array12 : Array . from ( {
length : 12
} ) ,
// 这里需要设置默认值为360, 否则在安卓nvue上, 会延迟一个duration周期后才执行
// 在iOS nvue上, 则会一开始默认执行两个周期的动画
aniAngel : 360 ,
// 动画旋转角度
webviewHide : false ,
// 监听webview的状态, 如果隐藏了页面, 则停止动画, 以免性能消耗
loading : false
// 是否运行中, 针对nvue使用
} ;
} ,
computed : {
// 当为circle类型时, 给其另外三边设置一个更轻一些的颜色
// 之所以需要这么做的原因是, 比如父组件传了color为红色, 那么需要另外的三个边为浅红色
// 而不能是固定的某一个其他颜色(因为这个固定的颜色可能浅蓝,导致效果没有那么细腻良好)
otherBorderColor ( ) {
const lightColor = uni . $u . colorGradient ( this . color , "#ffffff" , 100 ) [ 80 ] ;
if ( this . mode === "circle" ) {
return this . inactiveColor ? this . inactiveColor : lightColor ;
} else {
return "transparent" ;
}
}
} ,
watch : {
show ( n ) {
}
} ,
mounted ( ) {
this . init ( ) ;
} ,
methods : {
init ( ) {
setTimeout ( ( ) => {
this . show && this . addEventListenerToWebview ( ) ;
} , 20 ) ;
} ,
// 监听webview的显示与隐藏
addEventListenerToWebview ( ) {
const pages2 = getCurrentPages ( ) ;
const page2 = pages2 [ pages2 . length - 1 ] ;
const currentWebview = page2 . $getAppWebview ( ) ;
currentWebview . addEventListener ( "hide" , ( ) => {
this . webviewHide = true ;
} ) ;
currentWebview . addEventListener ( "show" , ( ) => {
this . webviewHide = false ;
} ) ;
}
}
} ;
function _sfc _render$b ( _ctx , _cache , $props , $setup , $data , $options ) {
return _ctx . show ? ( vue . openBlock ( ) , vue . createElementBlock (
"view" ,
{
key : 0 ,
class : vue . normalizeClass ( [ "u-loading-icon" , [ _ctx . vertical && "u-loading-icon--vertical" ] ] ) ,
style : vue . normalizeStyle ( [ _ctx . $u . addStyle ( _ctx . customStyle ) ] )
} ,
[
! $data . webviewHide ? ( vue . openBlock ( ) , vue . createElementBlock (
"view" ,
{
key : 0 ,
class : vue . normalizeClass ( [ "u-loading-icon__spinner" , [ ` u-loading-icon__spinner-- ${ _ctx . mode } ` ] ] ) ,
ref : "ani" ,
style : vue . normalizeStyle ( {
color : _ctx . color ,
width : _ctx . $u . addUnit ( _ctx . size ) ,
height : _ctx . $u . addUnit ( _ctx . size ) ,
borderTopColor : _ctx . color ,
borderBottomColor : $options . otherBorderColor ,
borderLeftColor : $options . otherBorderColor ,
borderRightColor : $options . otherBorderColor ,
"animation-duration" : ` ${ _ctx . duration } ms ` ,
"animation-timing-function" : _ctx . mode === "semicircle" || _ctx . mode === "circle" ? _ctx . timingFunction : ""
} )
} ,
[
_ctx . mode === "spinner" ? ( vue . openBlock ( true ) , vue . createElementBlock (
vue . Fragment ,
{ key : 0 } ,
vue . renderList ( $data . array12 , ( item , index2 ) => {
return vue . openBlock ( ) , vue . createElementBlock ( "view" , {
key : index2 ,
class : "u-loading-icon__dot"
} ) ;
} ) ,
128
/* KEYED_FRAGMENT */
) ) : vue . createCommentVNode ( "v-if" , true )
] ,
6
/* CLASS, STYLE */
) ) : vue . createCommentVNode ( "v-if" , true ) ,
_ctx . text ? ( vue . openBlock ( ) , vue . createElementBlock (
"text" ,
{
key : 1 ,
class : "u-loading-icon__text" ,
style : vue . normalizeStyle ( {
fontSize : _ctx . $u . addUnit ( _ctx . textSize ) ,
color : _ctx . textColor
} )
} ,
vue . toDisplayString ( _ctx . text ) ,
5
/* TEXT, STYLE */
) ) : vue . createCommentVNode ( "v-if" , true )
] ,
6
/* CLASS, STYLE */
) ) : vue . createCommentVNode ( "v-if" , true ) ;
}
const _ _easycom _0$2 = /* @__PURE__ */ _export _sfc ( _sfc _main$f , [ [ "render" , _sfc _render$b ] , [ "__scopeId" , "data-v-00752c6d" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-loading-icon/u-loading-icon.vue" ] ] ) ;
const props$5 = {
props : {
// 是否细边框
hairline : {
type : Boolean ,
default : props$b . button . hairline
} ,
// 按钮的预置样式, info, primary, error, warning, success
type : {
type : String ,
default : props$b . button . type
} ,
// 按钮尺寸, large, normal, small, mini
size : {
type : String ,
default : props$b . button . size
} ,
// 按钮形状, circle( 两边为半圆) , square( 带圆角)
shape : {
type : String ,
default : props$b . button . shape
} ,
// 按钮是否镂空
plain : {
type : Boolean ,
default : props$b . button . plain
} ,
// 是否禁止状态
disabled : {
type : Boolean ,
default : props$b . button . disabled
} ,
// 是否加载中
loading : {
type : Boolean ,
default : props$b . button . loading
} ,
// 加载中提示文字
loadingText : {
type : [ String , Number ] ,
default : props$b . button . loadingText
} ,
// 加载状态图标类型
loadingMode : {
type : String ,
default : props$b . button . loadingMode
} ,
// 加载图标大小
loadingSize : {
type : [ String , Number ] ,
default : props$b . button . loadingSize
} ,
// 开放能力, 具体请看uniapp稳定关于button组件部分说明
// https://uniapp.dcloud.io/component/button
openType : {
type : String ,
default : props$b . button . openType
} ,
// 用于 <form> 组件,点击分别会触发 <form> 组件的 submit/reset 事件
// 取值为submit( 提交表单) , reset( 重置表单)
formType : {
type : String ,
default : props$b . button . formType
} ,
// 打开 APP 时,向 APP 传递的参数, open-type=launchApp时有效
// 只微信小程序、QQ小程序有效
appParameter : {
type : String ,
default : props$b . button . appParameter
} ,
// 指定是否阻止本节点的祖先节点出现点击态,微信小程序有效
hoverStopPropagation : {
type : Boolean ,
default : props$b . button . hoverStopPropagation
} ,
// 指定返回用户信息的语言, zh_CN 简体中文, zh_TW 繁体中文, en 英文。只微信小程序有效
lang : {
type : String ,
default : props$b . button . lang
} ,
// 会话来源, open-type="contact"时有效。只微信小程序有效
sessionFrom : {
type : String ,
default : props$b . button . sessionFrom
} ,
// 会话内消息卡片标题, open-type="contact"时有效
// 默认当前标题,只微信小程序有效
sendMessageTitle : {
type : String ,
default : props$b . button . sendMessageTitle
} ,
// 会话内消息卡片点击跳转小程序路径, open-type="contact"时有效
// 默认当前分享路径,只微信小程序有效
sendMessagePath : {
type : String ,
default : props$b . button . sendMessagePath
} ,
// 会话内消息卡片图片, open-type="contact"时有效
// 默认当前页面截图,只微信小程序有效
sendMessageImg : {
type : String ,
default : props$b . button . sendMessageImg
} ,
// 是否显示会话内消息卡片,设置此参数为 true, 用户进入客服会话会在右下角显示"可能要发送的小程序"提示,
// 用户点击后可以快速发送小程序消息, open-type="contact"时有效
showMessageCard : {
type : Boolean ,
default : props$b . button . showMessageCard
} ,
// 额外传参参数, 用于小程序的data-xxx属性, 通过target.dataset.name获取
dataName : {
type : String ,
default : props$b . button . dataName
} ,
// 节流,一定时间内只能触发一次
throttleTime : {
type : [ String , Number ] ,
default : props$b . button . throttleTime
} ,
// 按住后多久出现点击态,单位毫秒
hoverStartTime : {
type : [ String , Number ] ,
default : props$b . button . hoverStartTime
} ,
// 手指松开后点击态保留时间,单位毫秒
hoverStayTime : {
type : [ String , Number ] ,
default : props$b . button . hoverStayTime
} ,
// 按钮文字, 之所以通过props传入, 是因为slot传入的话
// nvue中无法控制文字的样式
text : {
type : [ String , Number ] ,
default : props$b . button . text
} ,
// 按钮图标
icon : {
type : String ,
default : props$b . button . icon
} ,
// 按钮图标
iconColor : {
type : String ,
default : props$b . button . icon
} ,
// 按钮颜色, 支持传入linear-gradient渐变色
color : {
type : String ,
default : props$b . button . color
}
}
} ;
const _sfc _main$e = {
name : "u-button" ,
mixins : [ mpMixin , mixin , props$5 ] ,
data ( ) {
return { } ;
} ,
computed : {
// 生成bem风格的类名
bemClass ( ) {
if ( ! this . color ) {
return this . bem (
"button" ,
[ "type" , "shape" , "size" ] ,
[ "disabled" , "plain" , "hairline" ]
) ;
} else {
return this . bem (
"button" ,
[ "shape" , "size" ] ,
[ "disabled" , "plain" , "hairline" ]
) ;
}
} ,
loadingColor ( ) {
if ( this . plain ) {
return this . color ? this . color : uni . $u . config . color [ ` u- ${ this . type } ` ] ;
}
if ( this . type === "info" ) {
return "#c9c9c9" ;
}
return "rgb(200, 200, 200)" ;
} ,
iconColorCom ( ) {
if ( this . iconColor )
return this . iconColor ;
if ( this . plain ) {
return this . color ? this . color : this . type ;
} else {
return this . type === "info" ? "#000000" : "#ffffff" ;
}
} ,
baseColor ( ) {
let style = { } ;
if ( this . color ) {
style . color = this . plain ? this . color : "white" ;
if ( ! this . plain ) {
style [ "background-color" ] = this . color ;
}
if ( this . color . indexOf ( "gradient" ) !== - 1 ) {
style . borderTopWidth = 0 ;
style . borderRightWidth = 0 ;
style . borderBottomWidth = 0 ;
style . borderLeftWidth = 0 ;
if ( ! this . plain ) {
style . backgroundImage = this . color ;
}
} else {
style . borderColor = this . color ;
style . borderWidth = "1px" ;
style . borderStyle = "solid" ;
}
}
return style ;
} ,
// nvue版本按钮的字体不会继承父组件的颜色, 需要对每一个text组件进行单独的设置
nvueTextStyle ( ) {
let style = { } ;
if ( this . type === "info" ) {
style . color = "#323233" ;
}
if ( this . color ) {
style . color = this . plain ? this . color : "white" ;
}
style . fontSize = this . textSize + "px" ;
return style ;
} ,
// 字体大小
textSize ( ) {
let fontSize = 14 , { size } = this ;
if ( size === "large" )
fontSize = 16 ;
if ( size === "normal" )
fontSize = 14 ;
if ( size === "small" )
fontSize = 12 ;
if ( size === "mini" )
fontSize = 10 ;
return fontSize ;
}
} ,
emits : [
"click" ,
"getphonenumber" ,
"getuserinfo" ,
"error" ,
"opensetting" ,
"launchapp"
] ,
methods : {
clickHandler ( ) {
if ( ! this . disabled && ! this . loading ) {
uni . $u . throttle ( ( ) => {
this . $emit ( "click" ) ;
} , this . throttleTime ) ;
}
} ,
// 下面为对接uniapp官方按钮开放能力事件回调的对接
getphonenumber ( res ) {
this . $emit ( "getphonenumber" , res ) ;
} ,
getuserinfo ( res ) {
this . $emit ( "getuserinfo" , res ) ;
} ,
error ( res ) {
this . $emit ( "error" , res ) ;
} ,
opensetting ( res ) {
this . $emit ( "opensetting" , res ) ;
} ,
launchapp ( res ) {
this . $emit ( "launchapp" , res ) ;
}
}
} ;
function _sfc _render$a ( _ctx , _cache , $props , $setup , $data , $options ) {
const _component _u _loading _icon = resolveEasycom ( vue . resolveDynamicComponent ( "u-loading-icon" ) , _ _easycom _0$2 ) ;
const _component _u _icon = resolveEasycom ( vue . resolveDynamicComponent ( "u-icon" ) , _ _easycom _2 ) ;
return vue . openBlock ( ) , vue . createElementBlock ( "button" , {
"hover-start-time" : Number ( _ctx . hoverStartTime ) ,
"hover-stay-time" : Number ( _ctx . hoverStayTime ) ,
"form-type" : _ctx . formType ,
"open-type" : _ctx . openType ,
"app-parameter" : _ctx . appParameter ,
"hover-stop-propagation" : _ctx . hoverStopPropagation ,
"send-message-title" : _ctx . sendMessageTitle ,
"send-message-path" : _ctx . sendMessagePath ,
lang : _ctx . lang ,
"data-name" : _ctx . dataName ,
"session-from" : _ctx . sessionFrom ,
"send-message-img" : _ctx . sendMessageImg ,
"show-message-card" : _ctx . showMessageCard ,
onGetphonenumber : _cache [ 0 ] || ( _cache [ 0 ] = ( ... args ) => $options . getphonenumber && $options . getphonenumber ( ... args ) ) ,
onGetuserinfo : _cache [ 1 ] || ( _cache [ 1 ] = ( ... args ) => $options . getuserinfo && $options . getuserinfo ( ... args ) ) ,
onError : _cache [ 2 ] || ( _cache [ 2 ] = ( ... args ) => $options . error && $options . error ( ... args ) ) ,
onOpensetting : _cache [ 3 ] || ( _cache [ 3 ] = ( ... args ) => $options . opensetting && $options . opensetting ( ... args ) ) ,
onLaunchapp : _cache [ 4 ] || ( _cache [ 4 ] = ( ... args ) => $options . launchapp && $options . launchapp ( ... args ) ) ,
"hover-class" : ! _ctx . disabled && ! _ctx . loading ? "u-button--active" : "" ,
class : vue . normalizeClass ( [ "u-button u-reset-button" , $options . bemClass ] ) ,
style : vue . normalizeStyle ( [ $options . baseColor , _ctx . $u . addStyle ( _ctx . customStyle ) ] ) ,
onClick : _cache [ 5 ] || ( _cache [ 5 ] = ( ... args ) => $options . clickHandler && $options . clickHandler ( ... args ) )
} , [
_ctx . loading ? ( vue . openBlock ( ) , vue . createElementBlock (
vue . Fragment ,
{ key : 0 } ,
[
vue . createVNode ( _component _u _loading _icon , {
mode : _ctx . loadingMode ,
size : _ctx . loadingSize * 1.15 ,
color : $options . loadingColor
} , null , 8 , [ "mode" , "size" , "color" ] ) ,
vue . createElementVNode (
"text" ,
{
class : "u-button__loading-text" ,
style : vue . normalizeStyle ( [ { fontSize : $options . textSize + "px" } ] )
} ,
vue . toDisplayString ( _ctx . loadingText || _ctx . text ) ,
5
/* TEXT, STYLE */
)
] ,
64
/* STABLE_FRAGMENT */
) ) : ( vue . openBlock ( ) , vue . createElementBlock (
vue . Fragment ,
{ key : 1 } ,
[
_ctx . icon ? ( vue . openBlock ( ) , vue . createBlock ( _component _u _icon , {
key : 0 ,
name : _ctx . icon ,
color : $options . iconColorCom ,
size : $options . textSize * 1.35 ,
customStyle : { marginRight : "2px" }
} , null , 8 , [ "name" , "color" , "size" ] ) ) : vue . createCommentVNode ( "v-if" , true ) ,
vue . renderSlot ( _ctx . $slots , "default" , { } , ( ) => [
vue . createElementVNode (
"text" ,
{
class : "u-button__text" ,
style : vue . normalizeStyle ( [ { fontSize : $options . textSize + "px" } ] )
} ,
vue . toDisplayString ( _ctx . text ) ,
5
/* TEXT, STYLE */
)
] , true )
] ,
64
/* STABLE_FRAGMENT */
) )
] , 46 , [ "hover-start-time" , "hover-stay-time" , "form-type" , "open-type" , "app-parameter" , "hover-stop-propagation" , "send-message-title" , "send-message-path" , "lang" , "data-name" , "session-from" , "send-message-img" , "show-message-card" , "hover-class" ] ) ;
}
const _ _easycom _0$1 = /* @__PURE__ */ _export _sfc ( _sfc _main$e , [ [ "render" , _sfc _render$a ] , [ "__scopeId" , "data-v-461e713c" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-button/u-button.vue" ] ] ) ;
const props$4 = {
props : {
// 是否显示遮罩
show : {
type : Boolean ,
default : props$b . overlay . show
} ,
// 层级z-index
zIndex : {
type : [ String , Number ] ,
default : props$b . overlay . zIndex
} ,
// 遮罩的过渡时间, 单位为ms
duration : {
type : [ String , Number ] ,
default : props$b . overlay . duration
} ,
// 不透明度值, 当做rgba的第四个参数
opacity : {
type : [ String , Number ] ,
default : props$b . overlay . opacity
}
}
} ;
const _sfc _main$d = {
name : "u-overlay" ,
mixins : [ mpMixin , mixin , props$4 ] ,
computed : {
overlayStyle ( ) {
const style = {
position : "fixed" ,
top : 0 ,
left : 0 ,
right : 0 ,
zIndex : this . zIndex ,
bottom : 0 ,
"background-color" : ` rgba(0, 0, 0, ${ this . opacity } ) `
} ;
return uni . $u . deepMerge ( style , uni . $u . addStyle ( this . customStyle ) ) ;
}
} ,
emits : [ "click" ] ,
methods : {
clickHandler ( ) {
this . $emit ( "click" ) ;
}
}
} ;
function _sfc _render$9 ( _ctx , _cache , $props , $setup , $data , $options ) {
const _component _u _transition = resolveEasycom ( vue . resolveDynamicComponent ( "u-transition" ) , _ _easycom _4 ) ;
return vue . openBlock ( ) , vue . createBlock ( _component _u _transition , {
show : _ctx . show ,
"custom-class" : "u-overlay" ,
duration : _ctx . duration ,
"custom-style" : $options . overlayStyle ,
onClick : $options . clickHandler
} , {
default : vue . withCtx ( ( ) => [
vue . renderSlot ( _ctx . $slots , "default" , { } , void 0 , true )
] ) ,
_ : 3
/* FORWARDED */
} , 8 , [ "show" , "duration" , "custom-style" , "onClick" ] ) ;
}
const _ _easycom _0 = /* @__PURE__ */ _export _sfc ( _sfc _main$d , [ [ "render" , _sfc _render$9 ] , [ "__scopeId" , "data-v-35f7c3e5" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-overlay/u-overlay.vue" ] ] ) ;
const props$3 = {
props : {
bgColor : {
type : String ,
default : props$b . statusBar . bgColor
}
}
} ;
const _sfc _main$c = {
name : "u-status-bar" ,
mixins : [ mpMixin , mixin , props$3 ] ,
data ( ) {
return { } ;
} ,
computed : {
style ( ) {
const style = { } ;
style . height = uni . $u . addUnit ( uni . $u . sys ( ) . statusBarHeight , "px" ) ;
style . backgroundColor = this . bgColor ;
return uni . $u . deepMerge ( style , uni . $u . addStyle ( this . customStyle ) ) ;
}
}
} ;
function _sfc _render$8 ( _ctx , _cache , $props , $setup , $data , $options ) {
return vue . openBlock ( ) , vue . createElementBlock (
"view" ,
{
style : vue . normalizeStyle ( [ $options . style ] ) ,
class : "u-status-bar"
} ,
[
vue . renderSlot ( _ctx . $slots , "default" , { } , void 0 , true )
] ,
4
/* STYLE */
) ;
}
const _ _easycom _1$2 = /* @__PURE__ */ _export _sfc ( _sfc _main$c , [ [ "render" , _sfc _render$8 ] , [ "__scopeId" , "data-v-c0b45a48" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-status-bar/u-status-bar.vue" ] ] ) ;
const props$2 = {
props : { }
} ;
const _sfc _main$b = {
name : "u-safe-bottom" ,
mixins : [ mpMixin , mixin , props$2 ] ,
data ( ) {
return {
safeAreaBottomHeight : 0 ,
isNvue : false
} ;
} ,
computed : {
style ( ) {
const style = { } ;
return uni . $u . deepMerge ( style , uni . $u . addStyle ( this . customStyle ) ) ;
}
} ,
mounted ( ) {
}
} ;
function _sfc _render$7 ( _ctx , _cache , $props , $setup , $data , $options ) {
return vue . openBlock ( ) , vue . createElementBlock (
"view" ,
{
class : vue . normalizeClass ( [ "u-safe-bottom" , [ ! $data . isNvue && "u-safe-area-inset-bottom" ] ] ) ,
style : vue . normalizeStyle ( [ $options . style ] )
} ,
null ,
6
/* CLASS, STYLE */
) ;
}
const _ _easycom _3 = /* @__PURE__ */ _export _sfc ( _sfc _main$b , [ [ "render" , _sfc _render$7 ] , [ "__scopeId" , "data-v-3ec581de" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-safe-bottom/u-safe-bottom.vue" ] ] ) ;
const props$1 = {
props : {
// 是否展示弹窗
show : {
type : Boolean ,
default : props$b . popup . show
} ,
// 是否显示遮罩
overlay : {
type : Boolean ,
default : props$b . popup . overlay
} ,
// 弹出的方向,可选值为 top bottom right left center
mode : {
type : String ,
default : props$b . popup . mode
} ,
// 动画时长, 单位ms
duration : {
type : [ String , Number ] ,
default : props$b . popup . duration
} ,
// 是否显示关闭图标
closeable : {
type : Boolean ,
default : props$b . popup . closeable
} ,
// 自定义遮罩的样式
overlayStyle : {
type : [ Object , String ] ,
default : props$b . popup . overlayStyle
} ,
// 点击遮罩是否关闭弹窗
closeOnClickOverlay : {
type : Boolean ,
default : props$b . popup . closeOnClickOverlay
} ,
// 层级
zIndex : {
type : [ String , Number ] ,
default : props$b . popup . zIndex
} ,
// 是否为iPhoneX留出底部安全距离
safeAreaInsetBottom : {
type : Boolean ,
default : props$b . popup . safeAreaInsetBottom
} ,
// 是否留出顶部安全距离(状态栏高度)
safeAreaInsetTop : {
type : Boolean ,
default : props$b . popup . safeAreaInsetTop
} ,
// 自定义关闭图标位置, top-left为左上角, top-right为右上角, bottom-left为左下角, bottom-right为右下角
closeIconPos : {
type : String ,
default : props$b . popup . closeIconPos
} ,
// 是否显示圆角
round : {
type : [ Boolean , String , Number ] ,
default : props$b . popup . round
} ,
// mode=center, 也即中部弹出时, 是否使用缩放模式
zoom : {
type : Boolean ,
default : props$b . popup . zoom
} ,
// 弹窗背景色, 设置为transparent可去除白色背景
bgColor : {
type : String ,
default : props$b . popup . bgColor
} ,
// 遮罩的透明度, 0-1之间
overlayOpacity : {
type : [ Number , String ] ,
default : props$b . popup . overlayOpacity
}
}
} ;
const _sfc _main$a = {
name : "u-popup" ,
mixins : [ mpMixin , mixin , props$1 ] ,
data ( ) {
return {
overlayDuration : this . duration + 50
} ;
} ,
watch : {
show ( newValue , oldValue ) {
}
} ,
computed : {
transitionStyle ( ) {
const style = {
zIndex : this . zIndex ,
position : "fixed" ,
display : "flex"
} ;
style [ this . mode ] = 0 ;
if ( this . mode === "left" ) {
return uni . $u . deepMerge ( style , {
bottom : 0 ,
top : 0
} ) ;
} else if ( this . mode === "right" ) {
return uni . $u . deepMerge ( style , {
bottom : 0 ,
top : 0
} ) ;
} else if ( this . mode === "top" ) {
return uni . $u . deepMerge ( style , {
left : 0 ,
right : 0
} ) ;
} else if ( this . mode === "bottom" ) {
return uni . $u . deepMerge ( style , {
left : 0 ,
right : 0
} ) ;
} else if ( this . mode === "center" ) {
return uni . $u . deepMerge ( style , {
alignItems : "center" ,
"justify-content" : "center" ,
top : 0 ,
left : 0 ,
right : 0 ,
bottom : 0
} ) ;
}
} ,
contentStyle ( ) {
const style = { } ;
uni . $u . sys ( ) ;
if ( this . mode !== "center" ) {
style . flex = 1 ;
}
if ( this . bgColor ) {
style . backgroundColor = this . bgColor ;
}
if ( this . round ) {
const value = uni . $u . addUnit ( this . round ) ;
if ( this . mode === "top" ) {
style . borderBottomLeftRadius = value ;
style . borderBottomRightRadius = value ;
} else if ( this . mode === "bottom" ) {
style . borderTopLeftRadius = value ;
style . borderTopRightRadius = value ;
} else if ( this . mode === "center" ) {
style . borderRadius = value ;
}
}
return uni . $u . deepMerge ( style , uni . $u . addStyle ( this . customStyle ) ) ;
} ,
position ( ) {
if ( this . mode === "center" ) {
return this . zoom ? "fade-zoom" : "fade" ;
}
if ( this . mode === "left" ) {
return "slide-left" ;
}
if ( this . mode === "right" ) {
return "slide-right" ;
}
if ( this . mode === "bottom" ) {
return "slide-up" ;
}
if ( this . mode === "top" ) {
return "slide-down" ;
}
}
} ,
emits : [ "open" , "close" , "click" ] ,
methods : {
// 点击遮罩
overlayClick ( ) {
if ( this . closeOnClickOverlay ) {
this . $emit ( "close" ) ;
}
} ,
close ( e ) {
this . $emit ( "close" ) ;
} ,
afterEnter ( ) {
this . $emit ( "open" ) ;
} ,
clickHandler ( ) {
if ( this . mode === "center" ) {
this . overlayClick ( ) ;
}
this . $emit ( "click" ) ;
}
}
} ;
function _sfc _render$6 ( _ctx , _cache , $props , $setup , $data , $options ) {
const _component _u _overlay = resolveEasycom ( vue . resolveDynamicComponent ( "u-overlay" ) , _ _easycom _0 ) ;
const _component _u _status _bar = resolveEasycom ( vue . resolveDynamicComponent ( "u-status-bar" ) , _ _easycom _1$2 ) ;
const _component _u _icon = resolveEasycom ( vue . resolveDynamicComponent ( "u-icon" ) , _ _easycom _2 ) ;
const _component _u _safe _bottom = resolveEasycom ( vue . resolveDynamicComponent ( "u-safe-bottom" ) , _ _easycom _3 ) ;
const _component _u _transition = resolveEasycom ( vue . resolveDynamicComponent ( "u-transition" ) , _ _easycom _4 ) ;
return vue . openBlock ( ) , vue . createElementBlock ( "view" , { class : "u-popup" } , [
_ctx . overlay ? ( vue . openBlock ( ) , vue . createBlock ( _component _u _overlay , {
key : 0 ,
show : _ctx . show ,
onClick : $options . overlayClick ,
duration : $data . overlayDuration ,
customStyle : _ctx . overlayStyle ,
opacity : _ctx . overlayOpacity
} , null , 8 , [ "show" , "onClick" , "duration" , "customStyle" , "opacity" ] ) ) : vue . createCommentVNode ( "v-if" , true ) ,
vue . createVNode ( _component _u _transition , {
show : _ctx . show ,
customStyle : $options . transitionStyle ,
mode : $options . position ,
duration : _ctx . duration ,
onAfterEnter : $options . afterEnter ,
onClick : $options . clickHandler
} , {
default : vue . withCtx ( ( ) => [
vue . createElementVNode (
"view" ,
{
class : "u-popup__content" ,
style : vue . normalizeStyle ( [ $options . contentStyle ] ) ,
onClick : _cache [ 1 ] || ( _cache [ 1 ] = vue . withModifiers ( ( ... args ) => _ctx . noop && _ctx . noop ( ... args ) , [ "stop" ] ) )
} ,
[
_ctx . safeAreaInsetTop ? ( vue . openBlock ( ) , vue . createBlock ( _component _u _status _bar , { key : 0 } ) ) : vue . createCommentVNode ( "v-if" , true ) ,
vue . renderSlot ( _ctx . $slots , "default" , { } , void 0 , true ) ,
_ctx . closeable ? ( vue . openBlock ( ) , vue . createElementBlock (
"view" ,
{
key : 1 ,
onClick : _cache [ 0 ] || ( _cache [ 0 ] = vue . withModifiers ( ( ... args ) => $options . close && $options . close ( ... args ) , [ "stop" ] ) ) ,
class : vue . normalizeClass ( [ "u-popup__content__close" , [ "u-popup__content__close--" + _ctx . closeIconPos ] ] ) ,
"hover-class" : "u-popup__content__close--hover" ,
"hover-stay-time" : "150"
} ,
[
vue . createVNode ( _component _u _icon , {
name : "close" ,
color : "#909399" ,
size : "18" ,
bold : ""
} )
] ,
2
/* CLASS */
) ) : vue . createCommentVNode ( "v-if" , true ) ,
_ctx . safeAreaInsetBottom ? ( vue . openBlock ( ) , vue . createBlock ( _component _u _safe _bottom , { key : 2 } ) ) : vue . createCommentVNode ( "v-if" , true )
] ,
4
/* STYLE */
)
] ) ,
_ : 3
/* FORWARDED */
} , 8 , [ "show" , "customStyle" , "mode" , "duration" , "onAfterEnter" , "onClick" ] )
] ) ;
}
const _ _easycom _1$1 = /* @__PURE__ */ _export _sfc ( _sfc _main$a , [ [ "render" , _sfc _render$6 ] , [ "__scopeId" , "data-v-74921bef" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-popup/u-popup.vue" ] ] ) ;
const _sfc _main$9 = {
name : "u-calendar-header" ,
mixins : [ mpMixin , mixin ] ,
props : {
// 标题
title : {
type : String ,
default : ""
} ,
// 副标题
subtitle : {
type : String ,
default : ""
} ,
// 是否显示标题
showTitle : {
type : Boolean ,
default : true
} ,
// 是否显示副标题
showSubtitle : {
type : Boolean ,
default : true
}
} ,
data ( ) {
return { } ;
} ,
methods : {
name ( ) {
}
}
} ;
function _sfc _render$5 ( _ctx , _cache , $props , $setup , $data , $options ) {
return vue . openBlock ( ) , vue . createElementBlock ( "view" , { class : "u-calendar-header u-border-bottom" } , [
$props . showTitle ? ( vue . openBlock ( ) , vue . createElementBlock (
"text" ,
{
key : 0 ,
class : "u-calendar-header__title"
} ,
vue . toDisplayString ( $props . title ) ,
1
/* TEXT */
) ) : vue . createCommentVNode ( "v-if" , true ) ,
$props . showSubtitle ? ( vue . openBlock ( ) , vue . createElementBlock (
"text" ,
{
key : 1 ,
class : "u-calendar-header__subtitle"
} ,
vue . toDisplayString ( $props . subtitle ) ,
1
/* TEXT */
) ) : vue . createCommentVNode ( "v-if" , true ) ,
vue . createElementVNode ( "view" , { class : "u-calendar-header__weekdays" } , [
vue . createElementVNode ( "text" , { class : "u-calendar-header__weekdays__weekday" } , "一" ) ,
vue . createElementVNode ( "text" , { class : "u-calendar-header__weekdays__weekday" } , "二" ) ,
vue . createElementVNode ( "text" , { class : "u-calendar-header__weekdays__weekday" } , "三" ) ,
vue . createElementVNode ( "text" , { class : "u-calendar-header__weekdays__weekday" } , "四" ) ,
vue . createElementVNode ( "text" , { class : "u-calendar-header__weekdays__weekday" } , "五" ) ,
vue . createElementVNode ( "text" , { class : "u-calendar-header__weekdays__weekday" } , "六" ) ,
vue . createElementVNode ( "text" , { class : "u-calendar-header__weekdays__weekday" } , "日" )
] )
] ) ;
}
const uHeader = /* @__PURE__ */ _export _sfc ( _sfc _main$9 , [ [ "render" , _sfc _render$5 ] , [ "__scopeId" , "data-v-31c8bd61" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-calendar/header.vue" ] ] ) ;
var SECONDS _A _MINUTE = 60 ;
var SECONDS _A _HOUR = SECONDS _A _MINUTE * 60 ;
var SECONDS _A _DAY = SECONDS _A _HOUR * 24 ;
var SECONDS _A _WEEK = SECONDS _A _DAY * 7 ;
var MILLISECONDS _A _SECOND = 1e3 ;
var MILLISECONDS _A _MINUTE = SECONDS _A _MINUTE * MILLISECONDS _A _SECOND ;
var MILLISECONDS _A _HOUR = SECONDS _A _HOUR * MILLISECONDS _A _SECOND ;
var MILLISECONDS _A _DAY = SECONDS _A _DAY * MILLISECONDS _A _SECOND ;
var MILLISECONDS _A _WEEK = SECONDS _A _WEEK * MILLISECONDS _A _SECOND ;
var MS = "millisecond" ;
var S = "second" ;
var MIN = "minute" ;
var H = "hour" ;
var D = "day" ;
var W = "week" ;
var M = "month" ;
var Q = "quarter" ;
var Y = "year" ;
var DATE = "date" ;
var FORMAT _DEFAULT = "YYYY-MM-DDTHH:mm:ssZ" ;
var INVALID _DATE _STRING = "Invalid Date" ;
var REGEX _PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/ ;
var REGEX _FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g ;
const en = {
name : "en" ,
weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday" . split ( "_" ) ,
months : "January_February_March_April_May_June_July_August_September_October_November_December" . split ( "_" ) ,
ordinal : function ordinal ( n ) {
var s = [ "th" , "st" , "nd" , "rd" ] ;
var v = n % 100 ;
return "[" + n + ( s [ ( v - 20 ) % 10 ] || s [ v ] || s [ 0 ] ) + "]" ;
}
} ;
var padStart = function padStart2 ( string2 , length , pad ) {
var s = String ( string2 ) ;
if ( ! s || s . length >= length )
return string2 ;
return "" + Array ( length + 1 - s . length ) . join ( pad ) + string2 ;
} ;
var padZoneStr = function padZoneStr2 ( instance ) {
var negMinutes = - instance . utcOffset ( ) ;
var minutes = Math . abs ( negMinutes ) ;
var hourOffset = Math . floor ( minutes / 60 ) ;
var minuteOffset = minutes % 60 ;
return ( negMinutes <= 0 ? "+" : "-" ) + padStart ( hourOffset , 2 , "0" ) + ":" + padStart ( minuteOffset , 2 , "0" ) ;
} ;
var monthDiff = function monthDiff2 ( a , b ) {
if ( a . date ( ) < b . date ( ) )
return - monthDiff2 ( b , a ) ;
var wholeMonthDiff = ( b . year ( ) - a . year ( ) ) * 12 + ( b . month ( ) - a . month ( ) ) ;
var anchor = a . clone ( ) . add ( wholeMonthDiff , M ) ;
var c = b - anchor < 0 ;
var anchor2 = a . clone ( ) . add ( wholeMonthDiff + ( c ? - 1 : 1 ) , M ) ;
return + ( - ( wholeMonthDiff + ( b - anchor ) / ( c ? anchor - anchor2 : anchor2 - anchor ) ) || 0 ) ;
} ;
var absFloor = function absFloor2 ( n ) {
return n < 0 ? Math . ceil ( n ) || 0 : Math . floor ( n ) ;
} ;
var prettyUnit = function prettyUnit2 ( u ) {
var special = {
M ,
y : Y ,
w : W ,
d : D ,
D : DATE ,
h : H ,
m : MIN ,
s : S ,
ms : MS ,
Q
} ;
return special [ u ] || String ( u || "" ) . toLowerCase ( ) . replace ( /s$/ , "" ) ;
} ;
var isUndefined$1 = function isUndefined2 ( s ) {
return s === void 0 ;
} ;
const U = {
s : padStart ,
z : padZoneStr ,
m : monthDiff ,
a : absFloor ,
p : prettyUnit ,
u : isUndefined$1
} ;
var L = "en" ;
var Ls = { } ;
Ls [ L ] = en ;
var IS _DAYJS = "$isDayjsObject" ;
var isDayjs = function isDayjs2 ( d ) {
return d instanceof Dayjs || ! ! ( d && d [ IS _DAYJS ] ) ;
} ;
var parseLocale = function parseLocale2 ( preset , object2 , isLocal ) {
var l ;
if ( ! preset )
return L ;
if ( typeof preset === "string" ) {
var presetLower = preset . toLowerCase ( ) ;
if ( Ls [ presetLower ] ) {
l = presetLower ;
}
if ( object2 ) {
Ls [ presetLower ] = object2 ;
l = presetLower ;
}
var presetSplit = preset . split ( "-" ) ;
if ( ! l && presetSplit . length > 1 ) {
return parseLocale2 ( presetSplit [ 0 ] ) ;
}
} else {
var name = preset . name ;
Ls [ name ] = preset ;
l = name ;
}
if ( ! isLocal && l )
L = l ;
return l || ! isLocal && L ;
} ;
var dayjs = function dayjs2 ( date2 , c ) {
if ( isDayjs ( date2 ) ) {
return date2 . clone ( ) ;
}
var cfg = typeof c === "object" ? c : { } ;
cfg . date = date2 ;
cfg . args = arguments ;
return new Dayjs ( cfg ) ;
} ;
var wrapper = function wrapper2 ( date2 , instance ) {
return dayjs ( date2 , {
locale : instance . $L ,
utc : instance . $u ,
x : instance . $x ,
$offset : instance . $offset
// todo: refactor; do not use this.$offset in you code
} ) ;
} ;
var Utils = U ;
Utils . l = parseLocale ;
Utils . i = isDayjs ;
Utils . w = wrapper ;
var parseDate = function parseDate2 ( cfg ) {
var date2 = cfg . date , utc = cfg . utc ;
if ( date2 === null )
return /* @__PURE__ */ new Date ( NaN ) ;
if ( Utils . u ( date2 ) )
return /* @__PURE__ */ new Date ( ) ;
if ( date2 instanceof Date )
return new Date ( date2 ) ;
if ( typeof date2 === "string" && ! /Z$/i . test ( date2 ) ) {
var d = date2 . match ( REGEX _PARSE ) ;
if ( d ) {
var m = d [ 2 ] - 1 || 0 ;
var ms = ( d [ 7 ] || "0" ) . substring ( 0 , 3 ) ;
if ( utc ) {
return new Date ( Date . UTC ( d [ 1 ] , m , d [ 3 ] || 1 , d [ 4 ] || 0 , d [ 5 ] || 0 , d [ 6 ] || 0 , ms ) ) ;
}
return new Date ( d [ 1 ] , m , d [ 3 ] || 1 , d [ 4 ] || 0 , d [ 5 ] || 0 , d [ 6 ] || 0 , ms ) ;
}
}
return new Date ( date2 ) ;
} ;
var Dayjs = /* @__PURE__ */ function ( ) {
function Dayjs2 ( cfg ) {
this . $L = parseLocale ( cfg . locale , null , true ) ;
this . parse ( cfg ) ;
this . $x = this . $x || cfg . x || { } ;
this [ IS _DAYJS ] = true ;
}
var _proto = Dayjs2 . prototype ;
_proto . parse = function parse ( cfg ) {
this . $d = parseDate ( cfg ) ;
this . init ( ) ;
} ;
_proto . init = function init ( ) {
var $d = this . $d ;
this . $y = $d . getFullYear ( ) ;
this . $M = $d . getMonth ( ) ;
this . $D = $d . getDate ( ) ;
this . $W = $d . getDay ( ) ;
this . $H = $d . getHours ( ) ;
this . $m = $d . getMinutes ( ) ;
this . $s = $d . getSeconds ( ) ;
this . $ms = $d . getMilliseconds ( ) ;
} ;
_proto . $utils = function $utils ( ) {
return Utils ;
} ;
_proto . isValid = function isValid ( ) {
return ! ( this . $d . toString ( ) === INVALID _DATE _STRING ) ;
} ;
_proto . isSame = function isSame ( that , units ) {
var other = dayjs ( that ) ;
return this . startOf ( units ) <= other && other <= this . endOf ( units ) ;
} ;
_proto . isAfter = function isAfter ( that , units ) {
return dayjs ( that ) < this . startOf ( units ) ;
} ;
_proto . isBefore = function isBefore ( that , units ) {
return this . endOf ( units ) < dayjs ( that ) ;
} ;
_proto . $g = function $g ( input , get , set2 ) {
if ( Utils . u ( input ) )
return this [ get ] ;
return this . set ( set2 , input ) ;
} ;
_proto . unix = function unix ( ) {
return Math . floor ( this . valueOf ( ) / 1e3 ) ;
} ;
_proto . valueOf = function valueOf ( ) {
return this . $d . getTime ( ) ;
} ;
_proto . startOf = function startOf ( units , _startOf ) {
var _this = this ;
var isStartOf = ! Utils . u ( _startOf ) ? _startOf : true ;
var unit = Utils . p ( units ) ;
var instanceFactory = function instanceFactory2 ( d , m ) {
var ins = Utils . w ( _this . $u ? Date . UTC ( _this . $y , m , d ) : new Date ( _this . $y , m , d ) , _this ) ;
return isStartOf ? ins : ins . endOf ( D ) ;
} ;
var instanceFactorySet = function instanceFactorySet2 ( method , slice ) {
var argumentStart = [ 0 , 0 , 0 , 0 ] ;
var argumentEnd = [ 23 , 59 , 59 , 999 ] ;
return Utils . w ( _this . toDate ( ) [ method ] . apply (
// eslint-disable-line prefer-spread
_this . toDate ( "s" ) ,
( isStartOf ? argumentStart : argumentEnd ) . slice ( slice )
) , _this ) ;
} ;
var $W = this . $W , $M = this . $M , $D = this . $D ;
var utcPad = "set" + ( this . $u ? "UTC" : "" ) ;
switch ( unit ) {
case Y :
return isStartOf ? instanceFactory ( 1 , 0 ) : instanceFactory ( 31 , 11 ) ;
case M :
return isStartOf ? instanceFactory ( 1 , $M ) : instanceFactory ( 0 , $M + 1 ) ;
case W : {
var weekStart = this . $locale ( ) . weekStart || 0 ;
var gap = ( $W < weekStart ? $W + 7 : $W ) - weekStart ;
return instanceFactory ( isStartOf ? $D - gap : $D + ( 6 - gap ) , $M ) ;
}
case D :
case DATE :
return instanceFactorySet ( utcPad + "Hours" , 0 ) ;
case H :
return instanceFactorySet ( utcPad + "Minutes" , 1 ) ;
case MIN :
return instanceFactorySet ( utcPad + "Seconds" , 2 ) ;
case S :
return instanceFactorySet ( utcPad + "Milliseconds" , 3 ) ;
default :
return this . clone ( ) ;
}
} ;
_proto . endOf = function endOf ( arg ) {
return this . startOf ( arg , false ) ;
} ;
_proto . $set = function $set ( units , _int ) {
var _C$D$C$DATE$C$M$C$Y$C ;
var unit = Utils . p ( units ) ;
var utcPad = "set" + ( this . $u ? "UTC" : "" ) ;
var name = ( _C$D$C$DATE$C$M$C$Y$C = { } , _C$D$C$DATE$C$M$C$Y$C [ D ] = utcPad + "Date" , _C$D$C$DATE$C$M$C$Y$C [ DATE ] = utcPad + "Date" , _C$D$C$DATE$C$M$C$Y$C [ M ] = utcPad + "Month" , _C$D$C$DATE$C$M$C$Y$C [ Y ] = utcPad + "FullYear" , _C$D$C$DATE$C$M$C$Y$C [ H ] = utcPad + "Hours" , _C$D$C$DATE$C$M$C$Y$C [ MIN ] = utcPad + "Minutes" , _C$D$C$DATE$C$M$C$Y$C [ S ] = utcPad + "Seconds" , _C$D$C$DATE$C$M$C$Y$C [ MS ] = utcPad + "Milliseconds" , _C$D$C$DATE$C$M$C$Y$C ) [ unit ] ;
var arg = unit === D ? this . $D + ( _int - this . $W ) : _int ;
if ( unit === M || unit === Y ) {
var date2 = this . clone ( ) . set ( DATE , 1 ) ;
date2 . $d [ name ] ( arg ) ;
date2 . init ( ) ;
this . $d = date2 . set ( DATE , Math . min ( this . $D , date2 . daysInMonth ( ) ) ) . $d ;
} else if ( name )
this . $d [ name ] ( arg ) ;
this . init ( ) ;
return this ;
} ;
_proto . set = function set2 ( string2 , _int2 ) {
return this . clone ( ) . $set ( string2 , _int2 ) ;
} ;
_proto . get = function get ( unit ) {
return this [ Utils . p ( unit ) ] ( ) ;
} ;
_proto . add = function add ( number2 , units ) {
var _this2 = this , _C$MIN$C$H$C$S$unit ;
number2 = Number ( number2 ) ;
var unit = Utils . p ( units ) ;
var instanceFactorySet = function instanceFactorySet2 ( n ) {
var d = dayjs ( _this2 ) ;
return Utils . w ( d . date ( d . date ( ) + Math . round ( n * number2 ) ) , _this2 ) ;
} ;
if ( unit === M ) {
return this . set ( M , this . $M + number2 ) ;
}
if ( unit === Y ) {
return this . set ( Y , this . $y + number2 ) ;
}
if ( unit === D ) {
return instanceFactorySet ( 1 ) ;
}
if ( unit === W ) {
return instanceFactorySet ( 7 ) ;
}
var step = ( _C$MIN$C$H$C$S$unit = { } , _C$MIN$C$H$C$S$unit [ MIN ] = MILLISECONDS _A _MINUTE , _C$MIN$C$H$C$S$unit [ H ] = MILLISECONDS _A _HOUR , _C$MIN$C$H$C$S$unit [ S ] = MILLISECONDS _A _SECOND , _C$MIN$C$H$C$S$unit ) [ unit ] || 1 ;
var nextTimeStamp = this . $d . getTime ( ) + number2 * step ;
return Utils . w ( nextTimeStamp , this ) ;
} ;
_proto . subtract = function subtract ( number2 , string2 ) {
return this . add ( number2 * - 1 , string2 ) ;
} ;
_proto . format = function format ( formatStr ) {
var _this3 = this ;
var locale = this . $locale ( ) ;
if ( ! this . isValid ( ) )
return locale . invalidDate || INVALID _DATE _STRING ;
var str = formatStr || FORMAT _DEFAULT ;
var zoneStr = Utils . z ( this ) ;
var $H = this . $H , $m = this . $m , $M = this . $M ;
var weekdays = locale . weekdays , months = locale . months , meridiem = locale . meridiem ;
var getShort = function getShort2 ( arr , index2 , full , length ) {
return arr && ( arr [ index2 ] || arr ( _this3 , str ) ) || full [ index2 ] . slice ( 0 , length ) ;
} ;
var get$H = function get$H2 ( num ) {
return Utils . s ( $H % 12 || 12 , num , "0" ) ;
} ;
var meridiemFunc = meridiem || function ( hour , minute , isLowercase ) {
var m = hour < 12 ? "AM" : "PM" ;
return isLowercase ? m . toLowerCase ( ) : m ;
} ;
var matches = function matches2 ( match ) {
switch ( match ) {
case "YY" :
return String ( _this3 . $y ) . slice ( - 2 ) ;
case "YYYY" :
return Utils . s ( _this3 . $y , 4 , "0" ) ;
case "M" :
return $M + 1 ;
case "MM" :
return Utils . s ( $M + 1 , 2 , "0" ) ;
case "MMM" :
return getShort ( locale . monthsShort , $M , months , 3 ) ;
case "MMMM" :
return getShort ( months , $M ) ;
case "D" :
return _this3 . $D ;
case "DD" :
return Utils . s ( _this3 . $D , 2 , "0" ) ;
case "d" :
return String ( _this3 . $W ) ;
case "dd" :
return getShort ( locale . weekdaysMin , _this3 . $W , weekdays , 2 ) ;
case "ddd" :
return getShort ( locale . weekdaysShort , _this3 . $W , weekdays , 3 ) ;
case "dddd" :
return weekdays [ _this3 . $W ] ;
case "H" :
return String ( $H ) ;
case "HH" :
return Utils . s ( $H , 2 , "0" ) ;
case "h" :
return get$H ( 1 ) ;
case "hh" :
return get$H ( 2 ) ;
case "a" :
return meridiemFunc ( $H , $m , true ) ;
case "A" :
return meridiemFunc ( $H , $m , false ) ;
case "m" :
return String ( $m ) ;
case "mm" :
return Utils . s ( $m , 2 , "0" ) ;
case "s" :
return String ( _this3 . $s ) ;
case "ss" :
return Utils . s ( _this3 . $s , 2 , "0" ) ;
case "SSS" :
return Utils . s ( _this3 . $ms , 3 , "0" ) ;
case "Z" :
return zoneStr ;
}
return null ;
} ;
return str . replace ( REGEX _FORMAT , function ( match , $1 ) {
return $1 || matches ( match ) || zoneStr . replace ( ":" , "" ) ;
} ) ;
} ;
_proto . utcOffset = function utcOffset ( ) {
return - Math . round ( this . $d . getTimezoneOffset ( ) / 15 ) * 15 ;
} ;
_proto . diff = function diff ( input , units , _float ) {
var _this4 = this ;
var unit = Utils . p ( units ) ;
var that = dayjs ( input ) ;
var zoneDelta = ( that . utcOffset ( ) - this . utcOffset ( ) ) * MILLISECONDS _A _MINUTE ;
var diff2 = this - that ;
var getMonth = function getMonth2 ( ) {
return Utils . m ( _this4 , that ) ;
} ;
var result ;
switch ( unit ) {
case Y :
result = getMonth ( ) / 12 ;
break ;
case M :
result = getMonth ( ) ;
break ;
case Q :
result = getMonth ( ) / 3 ;
break ;
case W :
result = ( diff2 - zoneDelta ) / MILLISECONDS _A _WEEK ;
break ;
case D :
result = ( diff2 - zoneDelta ) / MILLISECONDS _A _DAY ;
break ;
case H :
result = diff2 / MILLISECONDS _A _HOUR ;
break ;
case MIN :
result = diff2 / MILLISECONDS _A _MINUTE ;
break ;
case S :
result = diff2 / MILLISECONDS _A _SECOND ;
break ;
default :
result = diff2 ;
break ;
}
return _float ? result : Utils . a ( result ) ;
} ;
_proto . daysInMonth = function daysInMonth ( ) {
return this . endOf ( M ) . $D ;
} ;
_proto . $locale = function $locale ( ) {
return Ls [ this . $L ] ;
} ;
_proto . locale = function locale ( preset , object2 ) {
if ( ! preset )
return this . $L ;
var that = this . clone ( ) ;
var nextLocaleName = parseLocale ( preset , object2 , true ) ;
if ( nextLocaleName )
that . $L = nextLocaleName ;
return that ;
} ;
_proto . clone = function clone2 ( ) {
return Utils . w ( this . $d , this ) ;
} ;
_proto . toDate = function toDate ( ) {
return new Date ( this . valueOf ( ) ) ;
} ;
_proto . toJSON = function toJSON ( ) {
return this . isValid ( ) ? this . toISOString ( ) : null ;
} ;
_proto . toISOString = function toISOString ( ) {
return this . $d . toISOString ( ) ;
} ;
_proto . toString = function toString2 ( ) {
return this . $d . toUTCString ( ) ;
} ;
return Dayjs2 ;
} ( ) ;
var proto = Dayjs . prototype ;
dayjs . prototype = proto ;
[ [ "$ms" , MS ] , [ "$s" , S ] , [ "$m" , MIN ] , [ "$H" , H ] , [ "$W" , D ] , [ "$M" , M ] , [ "$y" , Y ] , [ "$D" , DATE ] ] . forEach ( function ( g ) {
proto [ g [ 1 ] ] = function ( input ) {
return this . $g ( input , g [ 0 ] , g [ 1 ] ) ;
} ;
} ) ;
dayjs . extend = function ( plugin , option ) {
if ( ! plugin . $i ) {
plugin ( option , Dayjs , dayjs ) ;
plugin . $i = true ;
}
return dayjs ;
} ;
dayjs . locale = parseLocale ;
dayjs . isDayjs = isDayjs ;
dayjs . unix = function ( timestamp ) {
return dayjs ( timestamp * 1e3 ) ;
} ;
dayjs . en = Ls [ L ] ;
dayjs . Ls = Ls ;
dayjs . p = { } ;
const _sfc _main$8 = {
name : "u-calendar-month" ,
mixins : [ mpMixin , mixin ] ,
props : {
// 是否显示月份背景色
showMark : {
type : Boolean ,
default : true
} ,
// 主题色,对底部按钮和选中日期有效
color : {
type : String ,
default : "#3c9cff"
} ,
// 月份数据
months : {
type : Array ,
default : ( ) => [ ]
} ,
// 日期选择类型
mode : {
type : String ,
default : "single"
} ,
// 日期行高
rowHeight : {
type : [ String , Number ] ,
default : 58
} ,
// mode=multiple时, 最多可选多少个日期
maxCount : {
type : [ String , Number ] ,
default : Infinity
} ,
// mode=range时, 第一个日期底部的提示文字
startText : {
type : String ,
default : "开始"
} ,
// mode=range时, 最后一个日期底部的提示文字
endText : {
type : String ,
default : "结束"
} ,
// 默认选中的日期, mode为multiple或range是必须为数组格式
defaultDate : {
type : [ Array , String , Date ] ,
default : null
} ,
// 最小的可选日期
minDate : {
type : [ String , Number ] ,
default : 0
} ,
// 最大可选日期
maxDate : {
type : [ String , Number ] ,
default : 0
} ,
// 如果没有设置maxDate, 则往后推多少个月
maxMonth : {
type : [ String , Number ] ,
default : 2
} ,
// 是否为只读状态,只读状态下禁止选择日期
readonly : {
type : Boolean ,
default : props$b . calendar . readonly
} ,
// 日期区间最多可选天数, 默认无限制, mode = range时有效
maxRange : {
type : [ Number , String ] ,
default : Infinity
} ,
// 范围选择超过最多可选天数时的提示文案, mode = range时有效
rangePrompt : {
type : String ,
default : ""
} ,
// 范围选择超过最多可选天数时, 是否展示提示文案, mode = range时有效
showRangePrompt : {
type : Boolean ,
default : true
} ,
// 是否允许日期范围的起止时间为同一天, mode = range时有效
allowSameDay : {
type : Boolean ,
default : false
}
} ,
data ( ) {
return {
// 每个日期的宽度
width : 0 ,
// 当前选中的日期item
item : { } ,
selected : [ ]
} ;
} ,
watch : {
selectedChange : {
immediate : true ,
handler ( n ) {
this . setDefaultDate ( ) ;
}
}
} ,
computed : {
// 多个条件的变化,会引起选中日期的变化,这里统一管理监听
selectedChange ( ) {
return [ this . minDate , this . maxDate , this . defaultDate ] ;
} ,
dayStyle ( index1 , index2 , item ) {
return ( index12 , index22 , item2 ) => {
const style = { } ;
let week = item2 . week ;
const dayWidth = Number ( parseFloat ( this . width / 7 ) . toFixed ( 3 ) . slice ( 0 , - 1 ) ) ;
style . height = uni . $u . addUnit ( this . rowHeight ) ;
if ( index22 === 0 ) {
week = ( week === 0 ? 7 : week ) - 1 ;
style . marginLeft = uni . $u . addUnit ( week * dayWidth ) ;
}
if ( this . mode === "range" ) {
style . paddingLeft = 0 ;
style . paddingRight = 0 ;
style . paddingBottom = 0 ;
style . paddingTop = 0 ;
}
return style ;
} ;
} ,
daySelectStyle ( ) {
return ( index1 , index2 , item ) => {
let date2 = dayjs ( item . date ) . format ( "YYYY-MM-DD" ) , style = { } ;
if ( this . selected . some ( ( item2 ) => this . dateSame ( item2 , date2 ) ) ) {
style . backgroundColor = this . color ;
}
if ( this . mode === "single" ) {
if ( date2 === this . selected [ 0 ] ) {
style . borderTopLeftRadius = "3px" ;
style . borderBottomLeftRadius = "3px" ;
style . borderTopRightRadius = "3px" ;
style . borderBottomRightRadius = "3px" ;
}
} else if ( this . mode === "range" ) {
if ( this . selected . length >= 2 ) {
const len = this . selected . length - 1 ;
if ( this . dateSame ( date2 , this . selected [ 0 ] ) ) {
style . borderTopLeftRadius = "3px" ;
style . borderBottomLeftRadius = "3px" ;
}
if ( this . dateSame ( date2 , this . selected [ len ] ) ) {
style . borderTopRightRadius = "3px" ;
style . borderBottomRightRadius = "3px" ;
}
if ( dayjs ( date2 ) . isAfter ( dayjs ( this . selected [ 0 ] ) ) && dayjs ( date2 ) . isBefore ( dayjs ( this . selected [ len ] ) ) ) {
style . backgroundColor = uni . $u . colorGradient ( this . color , "#ffffff" , 100 ) [ 90 ] ;
style . opacity = 0.7 ;
}
} else if ( this . selected . length === 1 ) {
style . borderTopLeftRadius = "3px" ;
style . borderBottomLeftRadius = "3px" ;
}
} else {
if ( this . selected . some ( ( item2 ) => this . dateSame ( item2 , date2 ) ) ) {
style . borderTopLeftRadius = "3px" ;
style . borderBottomLeftRadius = "3px" ;
style . borderTopRightRadius = "3px" ;
style . borderBottomRightRadius = "3px" ;
}
}
return style ;
} ;
} ,
// 某个日期是否被选中
textStyle ( ) {
return ( item ) => {
const date2 = dayjs ( item . date ) . format ( "YYYY-MM-DD" ) , style = { } ;
if ( this . selected . some ( ( item2 ) => this . dateSame ( item2 , date2 ) ) ) {
style . color = "#ffffff" ;
}
if ( this . mode === "range" ) {
const len = this . selected . length - 1 ;
if ( dayjs ( date2 ) . isAfter ( dayjs ( this . selected [ 0 ] ) ) && dayjs ( date2 ) . isBefore ( dayjs ( this . selected [ len ] ) ) ) {
style . color = this . color ;
}
}
return style ;
} ;
} ,
// 获取底部的提示文字
getBottomInfo ( ) {
return ( index1 , index2 , item ) => {
const date2 = dayjs ( item . date ) . format ( "YYYY-MM-DD" ) ;
const bottomInfo = item . bottomInfo ;
if ( this . mode === "range" && this . selected . length > 0 ) {
if ( this . selected . length === 1 ) {
if ( this . dateSame ( date2 , this . selected [ 0 ] ) )
return this . startText ;
else
return bottomInfo ;
} else {
const len = this . selected . length - 1 ;
if ( this . dateSame ( date2 , this . selected [ 0 ] ) && this . dateSame ( date2 , this . selected [ 1 ] ) && len === 1 ) {
return ` ${ this . startText } / ${ this . endText } ` ;
} else if ( this . dateSame ( date2 , this . selected [ 0 ] ) ) {
return this . startText ;
} else if ( this . dateSame ( date2 , this . selected [ len ] ) ) {
return this . endText ;
} else {
return bottomInfo ;
}
}
} else {
return bottomInfo ;
}
} ;
}
} ,
mounted ( ) {
this . init ( ) ;
} ,
methods : {
init ( ) {
this . $emit ( "monthSelected" , this . selected ) ;
this . $nextTick ( ( ) => {
uni . $u . sleep ( 10 ) . then ( ( ) => {
this . getWrapperWidth ( ) ;
this . getMonthRect ( ) ;
} ) ;
} ) ;
} ,
// 判断两个日期是否相等
dateSame ( date1 , date2 ) {
return dayjs ( date1 ) . isSame ( dayjs ( date2 ) ) ;
} ,
// 获取月份数据区域的宽度, 因为nvue不支持百分比, 所以无法通过css设置每个日期item的宽度
getWrapperWidth ( ) {
this . $uGetRect ( ".u-calendar-month-wrapper" ) . then ( ( size ) => {
this . width = size . width ;
} ) ;
} ,
getMonthRect ( ) {
const promiseAllArr = this . months . map ( ( item , index2 ) => this . getMonthRectByPromise (
` u-calendar-month- ${ index2 } `
) ) ;
Promise . all ( promiseAllArr ) . then (
( sizes ) => {
let height = 1 ;
const topArr = [ ] ;
for ( let i = 0 ; i < this . months . length ; i ++ ) {
topArr [ i ] = height ;
height += sizes [ i ] . height ;
}
this . $emit ( "updateMonthTop" , topArr ) ;
}
) ;
} ,
// 获取每个月份区域的尺寸
getMonthRectByPromise ( el ) {
return new Promise ( ( resolve ) => {
this . $uGetRect ( ` . ${ el } ` ) . then ( ( size ) => {
resolve ( size ) ;
} ) ;
} ) ;
} ,
// 点击某一个日期
clickHandler ( index1 , index2 , item ) {
if ( this . readonly ) {
return ;
}
this . item = item ;
const date2 = dayjs ( item . date ) . format ( "YYYY-MM-DD" ) ;
if ( item . disabled )
return ;
let selected = uni . $u . deepClone ( this . selected ) ;
if ( this . mode === "single" ) {
selected = [ date2 ] ;
} else if ( this . mode === "multiple" ) {
if ( selected . some ( ( item2 ) => this . dateSame ( item2 , date2 ) ) ) {
const itemIndex = selected . findIndex ( ( item2 ) => item2 === date2 ) ;
selected . splice ( itemIndex , 1 ) ;
} else {
if ( selected . length < this . maxCount )
selected . push ( date2 ) ;
}
} else {
if ( selected . length === 0 || selected . length >= 2 ) {
selected = [ date2 ] ;
} else if ( selected . length === 1 ) {
const existsDate = selected [ 0 ] ;
if ( dayjs ( date2 ) . isBefore ( existsDate ) ) {
selected = [ date2 ] ;
} else if ( dayjs ( date2 ) . isAfter ( existsDate ) ) {
if ( dayjs ( dayjs ( date2 ) . subtract ( this . maxRange , "day" ) ) . isAfter ( dayjs ( selected [ 0 ] ) ) && this . showRangePrompt ) {
if ( this . rangePrompt ) {
uni . $u . toast ( this . rangePrompt ) ;
} else {
uni . $u . toast ( ` 选择天数不能超过 ${ this . maxRange } 天 ` ) ;
}
return ;
}
selected . push ( date2 ) ;
const startDate = selected [ 0 ] ;
const endDate = selected [ 1 ] ;
const arr = [ ] ;
let i = 0 ;
do {
arr . push ( dayjs ( startDate ) . add ( i , "day" ) . format ( "YYYY-MM-DD" ) ) ;
i ++ ;
} while ( dayjs ( startDate ) . add ( i , "day" ) . isBefore ( dayjs ( endDate ) ) ) ;
arr . push ( endDate ) ;
selected = arr ;
} else {
if ( selected [ 0 ] === date2 && ! this . allowSameDay )
return ;
selected . push ( date2 ) ;
}
}
}
this . setSelected ( selected ) ;
} ,
// 设置默认日期
setDefaultDate ( ) {
if ( ! this . defaultDate ) {
const selected = [ dayjs ( ) . format ( "YYYY-MM-DD" ) ] ;
return this . setSelected ( selected , false ) ;
}
let defaultDate = [ ] ;
const minDate = this . minDate || dayjs ( ) . format ( "YYYY-MM-DD" ) ;
const maxDate = this . maxDate || dayjs ( minDate ) . add ( this . maxMonth - 1 , "month" ) . format ( "YYYY-MM-DD" ) ;
if ( this . mode === "single" ) {
if ( ! uni . $u . test . array ( this . defaultDate ) ) {
defaultDate = [ dayjs ( this . defaultDate ) . format ( "YYYY-MM-DD" ) ] ;
} else {
defaultDate = [ this . defaultDate [ 0 ] ] ;
}
} else {
if ( ! uni . $u . test . array ( this . defaultDate ) )
return ;
defaultDate = this . defaultDate ;
}
defaultDate = defaultDate . filter ( ( item ) => {
return dayjs ( item ) . isAfter ( dayjs ( minDate ) . subtract ( 1 , "day" ) ) && dayjs ( item ) . isBefore ( dayjs (
maxDate
) . add ( 1 , "day" ) ) ;
} ) ;
this . setSelected ( defaultDate , false ) ;
} ,
setSelected ( selected , event = true ) {
this . selected = selected ;
event && this . $emit ( "monthSelected" , this . selected ) ;
}
}
} ;
function _sfc _render$4 ( _ctx , _cache , $props , $setup , $data , $options ) {
return vue . openBlock ( ) , vue . createElementBlock (
"view" ,
{
class : "u-calendar-month-wrapper" ,
ref : "u-calendar-month-wrapper"
} ,
[
( vue . openBlock ( true ) , vue . createElementBlock (
vue . Fragment ,
null ,
vue . renderList ( $props . months , ( item , index2 ) => {
return vue . openBlock ( ) , vue . createElementBlock ( "view" , {
key : index2 ,
class : vue . normalizeClass ( [ ` u-calendar-month- ${ index2 } ` ] ) ,
ref _for : true ,
ref : ` u-calendar-month- ${ index2 } ` ,
id : ` month- ${ index2 } `
} , [
index2 !== 0 ? ( vue . openBlock ( ) , vue . createElementBlock (
"text" ,
{
key : 0 ,
class : "u-calendar-month__title"
} ,
vue . toDisplayString ( item . year ) + "年" + vue . toDisplayString ( item . month ) + "月" ,
1
/* TEXT */
) ) : vue . createCommentVNode ( "v-if" , true ) ,
vue . createElementVNode ( "view" , { class : "u-calendar-month__days" } , [
$props . showMark ? ( vue . openBlock ( ) , vue . createElementBlock ( "view" , {
key : 0 ,
class : "u-calendar-month__days__month-mark-wrapper"
} , [
vue . createElementVNode (
"text" ,
{ class : "u-calendar-month__days__month-mark-wrapper__text" } ,
vue . toDisplayString ( item . month ) ,
1
/* TEXT */
)
] ) ) : vue . createCommentVNode ( "v-if" , true ) ,
( vue . openBlock ( true ) , vue . createElementBlock (
vue . Fragment ,
null ,
vue . renderList ( item . date , ( item1 , index1 ) => {
return vue . openBlock ( ) , vue . createElementBlock ( "view" , {
class : vue . normalizeClass ( [ "u-calendar-month__days__day" , [ item1 . selected && "u-calendar-month__days__day__select--selected" ] ] ) ,
key : index1 ,
style : vue . normalizeStyle ( [ $options . dayStyle ( index2 , index1 , item1 ) ] ) ,
onClick : ( $event ) => $options . clickHandler ( index2 , index1 , item1 )
} , [
vue . createElementVNode (
"view" ,
{
class : "u-calendar-month__days__day__select" ,
style : vue . normalizeStyle ( [ $options . daySelectStyle ( index2 , index1 , item1 ) ] )
} ,
[
vue . createElementVNode (
"text" ,
{
class : vue . normalizeClass ( [ "u-calendar-month__days__day__select__info" , [ item1 . disabled && "u-calendar-month__days__day__select__info--disabled" ] ] ) ,
style : vue . normalizeStyle ( [ $options . textStyle ( item1 ) ] )
} ,
vue . toDisplayString ( item1 . day ) ,
7
/* TEXT, CLASS, STYLE */
) ,
$options . getBottomInfo ( index2 , index1 , item1 ) ? ( vue . openBlock ( ) , vue . createElementBlock (
"text" ,
{
key : 0 ,
class : vue . normalizeClass ( [ "u-calendar-month__days__day__select__buttom-info" , [ item1 . disabled && "u-calendar-month__days__day__select__buttom-info--disabled" ] ] ) ,
style : vue . normalizeStyle ( [ $options . textStyle ( item1 ) ] )
} ,
vue . toDisplayString ( $options . getBottomInfo ( index2 , index1 , item1 ) ) ,
7
/* TEXT, CLASS, STYLE */
) ) : vue . createCommentVNode ( "v-if" , true ) ,
item1 . dot ? ( vue . openBlock ( ) , vue . createElementBlock ( "text" , {
key : 1 ,
class : "u-calendar-month__days__day__select__dot"
} ) ) : vue . createCommentVNode ( "v-if" , true )
] ,
4
/* STYLE */
)
] , 14 , [ "onClick" ] ) ;
} ) ,
128
/* KEYED_FRAGMENT */
) )
] )
] , 10 , [ "id" ] ) ;
} ) ,
128
/* KEYED_FRAGMENT */
) )
] ,
512
/* NEED_PATCH */
) ;
}
const uMonth = /* @__PURE__ */ _export _sfc ( _sfc _main$8 , [ [ "render" , _sfc _render$4 ] , [ "__scopeId" , "data-v-9b76ab7e" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-calendar/month.vue" ] ] ) ;
const props = {
props : {
// 日历顶部标题
title : {
type : String ,
default : props$b . calendar . title
} ,
// 是否显示标题
showTitle : {
type : Boolean ,
default : props$b . calendar . showTitle
} ,
// 是否显示副标题
showSubtitle : {
type : Boolean ,
default : props$b . calendar . showSubtitle
} ,
// 日期类型选择, single-选择单个日期, multiple-可以选择多个日期, range-选择日期范围
mode : {
type : String ,
default : props$b . calendar . mode
} ,
// mode=range时, 第一个日期底部的提示文字
startText : {
type : String ,
default : props$b . calendar . startText
} ,
// mode=range时, 最后一个日期底部的提示文字
endText : {
type : String ,
default : props$b . calendar . endText
} ,
// 自定义列表
customList : {
type : Array ,
default : props$b . calendar . customList
} ,
// 主题色,对底部按钮和选中日期有效
color : {
type : String ,
default : props$b . calendar . color
} ,
// 最小的可选日期
minDate : {
type : [ String , Number ] ,
default : props$b . calendar . minDate
} ,
// 最大可选日期
maxDate : {
type : [ String , Number ] ,
default : props$b . calendar . maxDate
} ,
// 默认选中的日期, mode为multiple或range是必须为数组格式
defaultDate : {
type : [ Array , String , Date , null ] ,
default : props$b . calendar . defaultDate
} ,
// mode=multiple时, 最多可选多少个日期
maxCount : {
type : [ String , Number ] ,
default : props$b . calendar . maxCount
} ,
// 日期行高
rowHeight : {
type : [ String , Number ] ,
default : props$b . calendar . rowHeight
} ,
// 日期格式化函数
formatter : {
type : [ Function , null ] ,
default : props$b . calendar . formatter
} ,
// 是否显示农历
showLunar : {
type : Boolean ,
default : props$b . calendar . showLunar
} ,
// 是否显示月份背景色
showMark : {
type : Boolean ,
default : props$b . calendar . showMark
} ,
// 确定按钮的文字
confirmText : {
type : String ,
default : props$b . calendar . confirmText
} ,
// 确认按钮处于禁用状态时的文字
confirmDisabledText : {
type : String ,
default : props$b . calendar . confirmDisabledText
} ,
// 是否显示日历弹窗
show : {
type : Boolean ,
default : props$b . calendar . show
} ,
// 是否允许点击遮罩关闭日历
closeOnClickOverlay : {
type : Boolean ,
default : props$b . calendar . closeOnClickOverlay
} ,
// 是否为只读状态,只读状态下禁止选择日期
readonly : {
type : Boolean ,
default : props$b . calendar . readonly
} ,
// 是否展示确认按钮
showConfirm : {
type : Boolean ,
default : props$b . calendar . showConfirm
} ,
// 日期区间最多可选天数, 默认无限制, mode = range时有效
maxRange : {
type : [ Number , String ] ,
default : props$b . calendar . maxRange
} ,
// 范围选择超过最多可选天数时的提示文案, mode = range时有效
rangePrompt : {
type : String ,
default : props$b . calendar . rangePrompt
} ,
// 范围选择超过最多可选天数时, 是否展示提示文案, mode = range时有效
showRangePrompt : {
type : Boolean ,
default : props$b . calendar . showRangePrompt
} ,
// 是否允许日期范围的起止时间为同一天, mode = range时有效
allowSameDay : {
type : Boolean ,
default : props$b . calendar . allowSameDay
} ,
// 圆角值
round : {
type : [ Boolean , String , Number ] ,
default : props$b . calendar . round
} ,
// 最多展示月份数量
monthNum : {
type : [ Number , String ] ,
default : 3
}
}
} ;
var Calendar = {
/ * *
* 农历1900 - 2100 的润大小信息表
* @ Array Of Property
* @ return Hex
* /
lunarInfo : [
19416 ,
19168 ,
42352 ,
21717 ,
53856 ,
55632 ,
91476 ,
22176 ,
39632 ,
21970 ,
// 1900-1909
19168 ,
42422 ,
42192 ,
53840 ,
119381 ,
46400 ,
54944 ,
44450 ,
38320 ,
84343 ,
// 1910-1919
18800 ,
42160 ,
46261 ,
27216 ,
27968 ,
109396 ,
11104 ,
38256 ,
21234 ,
18800 ,
// 1920-1929
25958 ,
54432 ,
59984 ,
28309 ,
23248 ,
11104 ,
100067 ,
37600 ,
116951 ,
51536 ,
// 1930-1939
54432 ,
120998 ,
46416 ,
22176 ,
107956 ,
9680 ,
37584 ,
53938 ,
43344 ,
46423 ,
// 1940-1949
27808 ,
46416 ,
86869 ,
19872 ,
42416 ,
83315 ,
21168 ,
43432 ,
59728 ,
27296 ,
// 1950-1959
44710 ,
43856 ,
19296 ,
43748 ,
42352 ,
21088 ,
62051 ,
55632 ,
23383 ,
22176 ,
// 1960-1969
38608 ,
19925 ,
19152 ,
42192 ,
54484 ,
53840 ,
54616 ,
46400 ,
46752 ,
103846 ,
// 1970-1979
38320 ,
18864 ,
43380 ,
42160 ,
45690 ,
27216 ,
27968 ,
44870 ,
43872 ,
38256 ,
// 1980-1989
19189 ,
18800 ,
25776 ,
29859 ,
59984 ,
27480 ,
23232 ,
43872 ,
38613 ,
37600 ,
// 1990-1999
51552 ,
55636 ,
54432 ,
55888 ,
30034 ,
22176 ,
43959 ,
9680 ,
37584 ,
51893 ,
// 2000-2009
43344 ,
46240 ,
47780 ,
44368 ,
21977 ,
19360 ,
42416 ,
86390 ,
21168 ,
43312 ,
// 2010-2019
31060 ,
27296 ,
44368 ,
23378 ,
19296 ,
42726 ,
42208 ,
53856 ,
60005 ,
54576 ,
// 2020-2029
23200 ,
30371 ,
38608 ,
19195 ,
19152 ,
42192 ,
118966 ,
53840 ,
54560 ,
56645 ,
// 2030-2039
46496 ,
22224 ,
21938 ,
18864 ,
42359 ,
42160 ,
43600 ,
111189 ,
27936 ,
44448 ,
// 2040-2049
/** Add By JJonline@JJonline.Cn**/
84835 ,
37744 ,
18936 ,
18800 ,
25776 ,
92326 ,
59984 ,
27424 ,
108228 ,
43744 ,
// 2050-2059
41696 ,
53987 ,
51552 ,
54615 ,
54432 ,
55888 ,
23893 ,
22176 ,
42704 ,
21972 ,
// 2060-2069
21200 ,
43448 ,
43344 ,
46240 ,
46758 ,
44368 ,
21920 ,
43940 ,
42416 ,
21168 ,
// 2070-2079
45683 ,
26928 ,
29495 ,
27296 ,
44368 ,
84821 ,
19296 ,
42352 ,
21732 ,
53600 ,
// 2080-2089
59752 ,
54560 ,
55968 ,
92838 ,
22224 ,
19168 ,
43476 ,
41680 ,
53584 ,
62034 ,
// 2090-2099
54560
] ,
// 2100
/ * *
* 公历每个月份的天数普通表
* @ Array Of Property
* @ return Number
* /
solarMonth : [ 31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 ] ,
/ * *
* 天干地支之天干速查表
* @ Array Of Property trans [ "甲" , "乙" , "丙" , "丁" , "戊" , "己" , "庚" , "辛" , "壬" , "癸" ]
* @ return Cn string
* /
Gan : [ "甲" , "乙" , "丙" , "丁" , "戊" , "己" , "庚" , "辛" , "壬" , "癸" ] ,
/ * *
* 天干地支之地支速查表
* @ Array Of Property
* @ trans [ "子" , "丑" , "寅" , "卯" , "辰" , "巳" , "午" , "未" , "申" , "酉" , "戌" , "亥" ]
* @ return Cn string
* /
Zhi : [ "子" , "丑" , "寅" , "卯" , "辰" , "巳" , "午" , "未" , "申" , "酉" , "戌" , "亥" ] ,
/ * *
* 天干地支之地支速查表 <= > 生肖
* @ Array Of Property
* @ trans [ "鼠" , "牛" , "虎" , "兔" , "龙" , "蛇" , "马" , "羊" , "猴" , "鸡" , "狗" , "猪" ]
* @ return Cn string
* /
Animals : [ "鼠" , "牛" , "虎" , "兔" , "龙" , "蛇" , "马" , "羊" , "猴" , "鸡" , "狗" , "猪" ] ,
/ * *
* 24 节气速查表
* @ Array Of Property
* @ trans [ "小寒" , "大寒" , "立春" , "雨水" , "惊蛰" , "春分" , "清明" , "谷雨" , "立夏" , "小满" , "芒种" , "夏至" , "小暑" , "大暑" , "立秋" , "处暑" , "白露" , "秋分" , "寒露" , "霜降" , "立冬" , "小雪" , "大雪" , "冬至" ]
* @ return Cn string
* /
solarTerm : [ "小寒" , "大寒" , "立春" , "雨水" , "惊蛰" , "春分" , "清明" , "谷雨" , "立夏" , "小满" , "芒种" , "夏至" , "小暑" , "大暑" , "立秋" , "处暑" , "白露" , "秋分" , "寒露" , "霜降" , "立冬" , "小雪" , "大雪" , "冬至" ] ,
/ * *
* 1900 - 2100 各年的24节气日期速查表
* @ Array Of Property
* @ return 0 x string For splice
* /
sTermInfo : [
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf97c3598082c95f8c965cc920f" ,
"97bd0b06bdb0722c965ce1cfcc920f" ,
"b027097bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf97c359801ec95f8c965cc920f" ,
"97bd0b06bdb0722c965ce1cfcc920f" ,
"b027097bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf97c359801ec95f8c965cc920f" ,
"97bd0b06bdb0722c965ce1cfcc920f" ,
"b027097bd097c36b0b6fc9274c91aa" ,
"9778397bd19801ec9210c965cc920e" ,
"97b6b97bd19801ec95f8c965cc920f" ,
"97bd09801d98082c95f8e1cfcc920f" ,
"97bd097bd097c36b0b6fc9210c8dc2" ,
"9778397bd197c36c9210c9274c91aa" ,
"97b6b97bd19801ec95f8c965cc920e" ,
"97bd09801d98082c95f8e1cfcc920f" ,
"97bd097bd097c36b0b6fc9210c8dc2" ,
"9778397bd097c36c9210c9274c91aa" ,
"97b6b97bd19801ec95f8c965cc920e" ,
"97bcf97c3598082c95f8e1cfcc920f" ,
"97bd097bd097c36b0b6fc9210c8dc2" ,
"9778397bd097c36c9210c9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf97c3598082c95f8c965cc920f" ,
"97bd097bd097c35b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf97c3598082c95f8c965cc920f" ,
"97bd097bd097c35b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf97c359801ec95f8c965cc920f" ,
"97bd097bd097c35b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf97c359801ec95f8c965cc920f" ,
"97bd097bd097c35b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf97c359801ec95f8c965cc920f" ,
"97bd097bd07f595b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9210c8dc2" ,
"9778397bd19801ec9210c9274c920e" ,
"97b6b97bd19801ec95f8c965cc920f" ,
"97bd07f5307f595b0b0bc920fb0722" ,
"7f0e397bd097c36b0b6fc9210c8dc2" ,
"9778397bd097c36c9210c9274c920e" ,
"97b6b97bd19801ec95f8c965cc920f" ,
"97bd07f5307f595b0b0bc920fb0722" ,
"7f0e397bd097c36b0b6fc9210c8dc2" ,
"9778397bd097c36c9210c9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bd07f1487f595b0b0bc920fb0722" ,
"7f0e397bd097c36b0b6fc9210c8dc2" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf7f1487f595b0b0bb0b6fb0722" ,
"7f0e397bd097c35b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf7f1487f595b0b0bb0b6fb0722" ,
"7f0e397bd097c35b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf7f1487f531b0b0bb0b6fb0722" ,
"7f0e397bd097c35b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c965cc920e" ,
"97bcf7f1487f531b0b0bb0b6fb0722" ,
"7f0e397bd07f595b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b97bd19801ec9210c9274c920e" ,
"97bcf7f0e47f531b0b0bb0b6fb0722" ,
"7f0e397bd07f595b0b0bc920fb0722" ,
"9778397bd097c36b0b6fc9210c91aa" ,
"97b6b97bd197c36c9210c9274c920e" ,
"97bcf7f0e47f531b0b0bb0b6fb0722" ,
"7f0e397bd07f595b0b0bc920fb0722" ,
"9778397bd097c36b0b6fc9210c8dc2" ,
"9778397bd097c36c9210c9274c920e" ,
"97b6b7f0e47f531b0723b0b6fb0722" ,
"7f0e37f5307f595b0b0bc920fb0722" ,
"7f0e397bd097c36b0b6fc9210c8dc2" ,
"9778397bd097c36b0b70c9274c91aa" ,
"97b6b7f0e47f531b0723b0b6fb0721" ,
"7f0e37f1487f595b0b0bb0b6fb0722" ,
"7f0e397bd097c35b0b6fc9210c8dc2" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b7f0e47f531b0723b0b6fb0721" ,
"7f0e27f1487f595b0b0bb0b6fb0722" ,
"7f0e397bd097c35b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b7f0e47f531b0723b0b6fb0721" ,
"7f0e27f1487f531b0b0bb0b6fb0722" ,
"7f0e397bd097c35b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b7f0e47f531b0723b0b6fb0721" ,
"7f0e27f1487f531b0b0bb0b6fb0722" ,
"7f0e397bd097c35b0b6fc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b7f0e47f531b0723b0b6fb0721" ,
"7f0e27f1487f531b0b0bb0b6fb0722" ,
"7f0e397bd07f595b0b0bc920fb0722" ,
"9778397bd097c36b0b6fc9274c91aa" ,
"97b6b7f0e47f531b0723b0787b0721" ,
"7f0e27f0e47f531b0b0bb0b6fb0722" ,
"7f0e397bd07f595b0b0bc920fb0722" ,
"9778397bd097c36b0b6fc9210c91aa" ,
"97b6b7f0e47f149b0723b0787b0721" ,
"7f0e27f0e47f531b0723b0b6fb0722" ,
"7f0e397bd07f595b0b0bc920fb0722" ,
"9778397bd097c36b0b6fc9210c8dc2" ,
"977837f0e37f149b0723b0787b0721" ,
"7f07e7f0e47f531b0723b0b6fb0722" ,
"7f0e37f5307f595b0b0bc920fb0722" ,
"7f0e397bd097c35b0b6fc9210c8dc2" ,
"977837f0e37f14998082b0787b0721" ,
"7f07e7f0e47f531b0723b0b6fb0721" ,
"7f0e37f1487f595b0b0bb0b6fb0722" ,
"7f0e397bd097c35b0b6fc9210c8dc2" ,
"977837f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f531b0723b0b6fb0721" ,
"7f0e27f1487f531b0b0bb0b6fb0722" ,
"7f0e397bd097c35b0b6fc920fb0722" ,
"977837f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f531b0723b0b6fb0721" ,
"7f0e27f1487f531b0b0bb0b6fb0722" ,
"7f0e397bd097c35b0b6fc920fb0722" ,
"977837f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f531b0723b0b6fb0721" ,
"7f0e27f1487f531b0b0bb0b6fb0722" ,
"7f0e397bd07f595b0b0bc920fb0722" ,
"977837f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f531b0723b0b6fb0721" ,
"7f0e27f1487f531b0b0bb0b6fb0722" ,
"7f0e397bd07f595b0b0bc920fb0722" ,
"977837f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f149b0723b0787b0721" ,
"7f0e27f0e47f531b0b0bb0b6fb0722" ,
"7f0e397bd07f595b0b0bc920fb0722" ,
"977837f0e37f14998082b0723b06bd" ,
"7f07e7f0e37f149b0723b0787b0721" ,
"7f0e27f0e47f531b0723b0b6fb0722" ,
"7f0e397bd07f595b0b0bc920fb0722" ,
"977837f0e37f14898082b0723b02d5" ,
"7ec967f0e37f14998082b0787b0721" ,
"7f07e7f0e47f531b0723b0b6fb0722" ,
"7f0e37f1487f595b0b0bb0b6fb0722" ,
"7f0e37f0e37f14898082b0723b02d5" ,
"7ec967f0e37f14998082b0787b0721" ,
"7f07e7f0e47f531b0723b0b6fb0722" ,
"7f0e37f1487f531b0b0bb0b6fb0722" ,
"7f0e37f0e37f14898082b0723b02d5" ,
"7ec967f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f531b0723b0b6fb0721" ,
"7f0e37f1487f531b0b0bb0b6fb0722" ,
"7f0e37f0e37f14898082b072297c35" ,
"7ec967f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f531b0723b0b6fb0721" ,
"7f0e27f1487f531b0b0bb0b6fb0722" ,
"7f0e37f0e37f14898082b072297c35" ,
"7ec967f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f531b0723b0b6fb0721" ,
"7f0e27f1487f531b0b0bb0b6fb0722" ,
"7f0e37f0e366aa89801eb072297c35" ,
"7ec967f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f149b0723b0787b0721" ,
"7f0e27f1487f531b0b0bb0b6fb0722" ,
"7f0e37f0e366aa89801eb072297c35" ,
"7ec967f0e37f14998082b0723b06bd" ,
"7f07e7f0e47f149b0723b0787b0721" ,
"7f0e27f0e47f531b0723b0b6fb0722" ,
"7f0e37f0e366aa89801eb072297c35" ,
"7ec967f0e37f14998082b0723b06bd" ,
"7f07e7f0e37f14998083b0787b0721" ,
"7f0e27f0e47f531b0723b0b6fb0722" ,
"7f0e37f0e366aa89801eb072297c35" ,
"7ec967f0e37f14898082b0723b02d5" ,
"7f07e7f0e37f14998082b0787b0721" ,
"7f07e7f0e47f531b0723b0b6fb0722" ,
"7f0e36665b66aa89801e9808297c35" ,
"665f67f0e37f14898082b0723b02d5" ,
"7ec967f0e37f14998082b0787b0721" ,
"7f07e7f0e47f531b0723b0b6fb0722" ,
"7f0e36665b66a449801e9808297c35" ,
"665f67f0e37f14898082b0723b02d5" ,
"7ec967f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f531b0723b0b6fb0721" ,
"7f0e36665b66a449801e9808297c35" ,
"665f67f0e37f14898082b072297c35" ,
"7ec967f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f531b0723b0b6fb0721" ,
"7f0e26665b66a449801e9808297c35" ,
"665f67f0e37f1489801eb072297c35" ,
"7ec967f0e37f14998082b0787b06bd" ,
"7f07e7f0e47f531b0723b0b6fb0721" ,
"7f0e27f1487f531b0b0bb0b6fb0722"
] ,
/ * *
* 数字转中文速查表
* @ Array Of Property
* @ trans [ '日' , '一' , '二' , '三' , '四' , '五' , '六' , '七' , '八' , '九' , '十' ]
* @ return Cn string
* /
nStr1 : [ "日" , "一" , "二" , "三" , "四" , "五" , "六" , "七" , "八" , "九" , "十" ] ,
/ * *
* 日期转农历称呼速查表
* @ Array Of Property
* @ trans [ '初' , '十' , '廿' , '卅' ]
* @ return Cn string
* /
nStr2 : [ "初" , "十" , "廿" , "卅" ] ,
/ * *
* 月份转农历称呼速查表
* @ Array Of Property
* @ trans [ '正' , '一' , '二' , '三' , '四' , '五' , '六' , '七' , '八' , '九' , '十' , '冬' , '腊' ]
* @ return Cn string
* /
nStr3 : [ "正" , "二" , "三" , "四" , "五" , "六" , "七" , "八" , "九" , "十" , "冬" , "腊" ] ,
/ * *
* 返回农历y年一整年的总天数
* @ param lunar Year
* @ return Number
* @ eg : var count = calendar . lYearDays ( 1987 ) ; //count=387
* /
lYearDays : function ( y ) {
var i ;
var sum = 348 ;
for ( i = 32768 ; i > 8 ; i >>= 1 ) {
sum += this . lunarInfo [ y - 1900 ] & i ? 1 : 0 ;
}
return sum + this . leapDays ( y ) ;
} ,
/ * *
* 返回农历y年闰月是哪个月 ; 若y年没有闰月 则返回0
* @ param lunar Year
* @ return Number ( 0 - 12 )
* @ eg : var leapMonth = calendar . leapMonth ( 1987 ) ; //leapMonth=6
* /
leapMonth : function ( y ) {
return this . lunarInfo [ y - 1900 ] & 15 ;
} ,
/ * *
* 返回农历y年闰月的天数 若该年没有闰月则返回0
* @ param lunar Year
* @ return Number ( 0 、 29 、 30 )
* @ eg : var leapMonthDay = calendar . leapDays ( 1987 ) ; //leapMonthDay=29
* /
leapDays : function ( y ) {
if ( this . leapMonth ( y ) ) {
return this . lunarInfo [ y - 1900 ] & 65536 ? 30 : 29 ;
}
return 0 ;
} ,
/ * *
* 返回农历y年m月 ( 非闰月 ) 的总天数 , 计算m为闰月时的天数请使用leapDays方法
* @ param lunar Year
* @ return Number ( - 1 、 29 、 30 )
* @ eg : var MonthDay = calendar . monthDays ( 1987 , 9 ) ; //MonthDay=29
* /
monthDays : function ( y , m ) {
if ( m > 12 || m < 1 ) {
return - 1 ;
}
return this . lunarInfo [ y - 1900 ] & 65536 >> m ? 30 : 29 ;
} ,
/ * *
* 返回公历 ( ! ) y年m月的天数
* @ param solar Year
* @ return Number ( - 1 、 28 、 29 、 30 、 31 )
* @ eg : var solarMonthDay = calendar . leapDays ( 1987 ) ; //solarMonthDay=30
* /
solarDays : function ( y , m ) {
if ( m > 12 || m < 1 ) {
return - 1 ;
}
var ms = m - 1 ;
if ( ms == 1 ) {
return y % 4 == 0 && y % 100 != 0 || y % 400 == 0 ? 29 : 28 ;
} else {
return this . solarMonth [ ms ] ;
}
} ,
/ * *
* 农历年份转换为干支纪年
* @ param lYear 农历年的年份数
* @ return Cn string
* /
toGanZhiYear : function ( lYear ) {
var ganKey = ( lYear - 3 ) % 10 ;
var zhiKey = ( lYear - 3 ) % 12 ;
if ( ganKey == 0 )
ganKey = 10 ;
if ( zhiKey == 0 )
zhiKey = 12 ;
return this . Gan [ ganKey - 1 ] + this . Zhi [ zhiKey - 1 ] ;
} ,
/ * *
* 公历月 、 日判断所属星座
* @ param cMonth [ description ]
* @ param cDay [ description ]
* @ return Cn string
* /
toAstro : function ( cMonth , cDay ) {
var s = "魔羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯" ;
var arr = [ 20 , 19 , 21 , 21 , 21 , 22 , 23 , 23 , 23 , 23 , 22 , 22 ] ;
return s . substr ( cMonth * 2 - ( cDay < arr [ cMonth - 1 ] ? 2 : 0 ) , 2 ) + "座" ;
} ,
/ * *
* 传入offset偏移量返回干支
* @ param offset 相对甲子的偏移量
* @ return Cn string
* /
toGanZhi : function ( offset ) {
return this . Gan [ offset % 10 ] + this . Zhi [ offset % 12 ] ;
} ,
/ * *
* 传入公历 ( ! ) y年获得该年第n个节气的公历日期
* @ param y公历年 ( 1900 - 2100 ) ; n二十四节气中的第几个节气 ( 1 ~ 24 ) ; 从n = 1 ( 小寒 ) 算起
* @ return day Number
* @ eg : var _24 = calendar . getTerm ( 1987 , 3 ) ; //_24=4;意即1987年2月4日立春
* /
getTerm : function ( y , n ) {
if ( y < 1900 || y > 2100 ) {
return - 1 ;
}
if ( n < 1 || n > 24 ) {
return - 1 ;
}
var _table = this . sTermInfo [ y - 1900 ] ;
var _info = [
parseInt ( "0x" + _table . substr ( 0 , 5 ) ) . toString ( ) ,
parseInt ( "0x" + _table . substr ( 5 , 5 ) ) . toString ( ) ,
parseInt ( "0x" + _table . substr ( 10 , 5 ) ) . toString ( ) ,
parseInt ( "0x" + _table . substr ( 15 , 5 ) ) . toString ( ) ,
parseInt ( "0x" + _table . substr ( 20 , 5 ) ) . toString ( ) ,
parseInt ( "0x" + _table . substr ( 25 , 5 ) ) . toString ( )
] ;
var _calday = [
_info [ 0 ] . substr ( 0 , 1 ) ,
_info [ 0 ] . substr ( 1 , 2 ) ,
_info [ 0 ] . substr ( 3 , 1 ) ,
_info [ 0 ] . substr ( 4 , 2 ) ,
_info [ 1 ] . substr ( 0 , 1 ) ,
_info [ 1 ] . substr ( 1 , 2 ) ,
_info [ 1 ] . substr ( 3 , 1 ) ,
_info [ 1 ] . substr ( 4 , 2 ) ,
_info [ 2 ] . substr ( 0 , 1 ) ,
_info [ 2 ] . substr ( 1 , 2 ) ,
_info [ 2 ] . substr ( 3 , 1 ) ,
_info [ 2 ] . substr ( 4 , 2 ) ,
_info [ 3 ] . substr ( 0 , 1 ) ,
_info [ 3 ] . substr ( 1 , 2 ) ,
_info [ 3 ] . substr ( 3 , 1 ) ,
_info [ 3 ] . substr ( 4 , 2 ) ,
_info [ 4 ] . substr ( 0 , 1 ) ,
_info [ 4 ] . substr ( 1 , 2 ) ,
_info [ 4 ] . substr ( 3 , 1 ) ,
_info [ 4 ] . substr ( 4 , 2 ) ,
_info [ 5 ] . substr ( 0 , 1 ) ,
_info [ 5 ] . substr ( 1 , 2 ) ,
_info [ 5 ] . substr ( 3 , 1 ) ,
_info [ 5 ] . substr ( 4 , 2 )
] ;
return parseInt ( _calday [ n - 1 ] ) ;
} ,
/ * *
* 传入农历数字月份返回汉语通俗表示法
* @ param lunar month
* @ return Cn string
* @ eg : var cnMonth = calendar . toChinaMonth ( 12 ) ; //cnMonth='腊月'
* /
toChinaMonth : function ( m ) {
if ( m > 12 || m < 1 ) {
return - 1 ;
}
var s = this . nStr3 [ m - 1 ] ;
s += "月" ;
return s ;
} ,
/ * *
* 传入农历日期数字返回汉字表示法
* @ param lunar day
* @ return Cn string
* @ eg : var cnDay = calendar . toChinaDay ( 21 ) ; //cnMonth='廿一'
* /
toChinaDay : function ( d ) {
var s ;
switch ( d ) {
case 10 :
s = "初十" ;
break ;
case 20 :
s = "二十" ;
break ;
case 30 :
s = "三十" ;
break ;
default :
s = this . nStr2 [ Math . floor ( d / 10 ) ] ;
s += this . nStr1 [ d % 10 ] ;
}
return s ;
} ,
/ * *
* 年份转生肖 [ ! 仅能大致转换 ] => 精确划分生肖分界线是 “ 立春 ”
* @ param y year
* @ return Cn string
* @ eg : var animal = calendar . getAnimal ( 1987 ) ; //animal='兔'
* /
getAnimal : function ( y ) {
return this . Animals [ ( y - 4 ) % 12 ] ;
} ,
/ * *
* 传入阳历年月日获得详细的公历 、 农历object信息 <= > JSON
* @ param y solar year
* @ param m solar month
* @ param d solar day
* @ return JSON object
* @ eg : _ _f _ _ ( 'log' , 'at node_modules/uview-plus/libs/util/calendar.js:381' , calendar . solar2lunar ( 1987 , 11 , 01 ) ) ;
* /
solar2lunar : function ( y , m , d ) {
if ( y < 1900 || y > 2100 ) {
return - 1 ;
}
if ( y == 1900 && m == 1 && d < 31 ) {
return - 1 ;
}
if ( ! y ) {
var objDate = /* @__PURE__ */ new Date ( ) ;
} else {
var objDate = new Date ( y , parseInt ( m ) - 1 , d ) ;
}
var i ;
var leap = 0 ;
var temp = 0 ;
var y = objDate . getFullYear ( ) ;
var m = objDate . getMonth ( ) + 1 ;
var d = objDate . getDate ( ) ;
var offset = ( Date . UTC ( objDate . getFullYear ( ) , objDate . getMonth ( ) , objDate . getDate ( ) ) - Date . UTC ( 1900 , 0 , 31 ) ) / 864e5 ;
for ( i = 1900 ; i < 2101 && offset > 0 ; i ++ ) {
temp = this . lYearDays ( i ) ;
offset -= temp ;
}
if ( offset < 0 ) {
offset += temp ;
i -- ;
}
var isTodayObj = /* @__PURE__ */ new Date ( ) ;
var isToday = false ;
if ( isTodayObj . getFullYear ( ) == y && isTodayObj . getMonth ( ) + 1 == m && isTodayObj . getDate ( ) == d ) {
isToday = true ;
}
var nWeek = objDate . getDay ( ) ;
var cWeek = this . nStr1 [ nWeek ] ;
if ( nWeek == 0 ) {
nWeek = 7 ;
}
var year = i ;
var leap = this . leapMonth ( i ) ;
var isLeap = false ;
for ( i = 1 ; i < 13 && offset > 0 ; i ++ ) {
if ( leap > 0 && i == leap + 1 && isLeap == false ) {
-- i ;
isLeap = true ;
temp = this . leapDays ( year ) ;
} else {
temp = this . monthDays ( year , i ) ;
}
if ( isLeap == true && i == leap + 1 ) {
isLeap = false ;
}
offset -= temp ;
}
if ( offset == 0 && leap > 0 && i == leap + 1 ) {
if ( isLeap ) {
isLeap = false ;
} else {
isLeap = true ;
-- i ;
}
}
if ( offset < 0 ) {
offset += temp ;
-- i ;
}
var month = i ;
var day = offset + 1 ;
var sm = m - 1 ;
var gzY = this . toGanZhiYear ( year ) ;
var firstNode = this . getTerm ( y , m * 2 - 1 ) ;
var secondNode = this . getTerm ( y , m * 2 ) ;
var gzM = this . toGanZhi ( ( y - 1900 ) * 12 + m + 11 ) ;
if ( d >= firstNode ) {
gzM = this . toGanZhi ( ( y - 1900 ) * 12 + m + 12 ) ;
}
var isTerm = false ;
var Term = null ;
if ( firstNode == d ) {
isTerm = true ;
Term = this . solarTerm [ m * 2 - 2 ] ;
}
if ( secondNode == d ) {
isTerm = true ;
Term = this . solarTerm [ m * 2 - 1 ] ;
}
var dayCyclical = Date . UTC ( y , sm , 1 , 0 , 0 , 0 , 0 ) / 864e5 + 25567 + 10 ;
var gzD = this . toGanZhi ( dayCyclical + d - 1 ) ;
var astro = this . toAstro ( m , d ) ;
return { "lYear" : year , "lMonth" : month , "lDay" : day , "Animal" : this . getAnimal ( year ) , "IMonthCn" : ( isLeap ? "闰" : "" ) + this . toChinaMonth ( month ) , "IDayCn" : this . toChinaDay ( day ) , "cYear" : y , "cMonth" : m , "cDay" : d , "gzYear" : gzY , "gzMonth" : gzM , "gzDay" : gzD , "isToday" : isToday , "isLeap" : isLeap , "nWeek" : nWeek , "ncWeek" : "星期" + cWeek , "isTerm" : isTerm , "Term" : Term , "astro" : astro } ;
} ,
/ * *
* 传入农历年月日以及传入的月份是否闰月获得详细的公历 、 农历object信息 <= > JSON
* @ param y lunar year
* @ param m lunar month
* @ param d lunar day
* @ param isLeapMonth lunar month is leap or not . [ 如果是农历闰月第四个参数赋值true即可 ]
* @ return JSON object
* @ eg : _ _f _ _ ( 'log' , 'at node_modules/uview-plus/libs/util/calendar.js:500' , calendar . lunar2solar ( 1987 , 9 , 10 ) ) ;
* /
lunar2solar : function ( y , m , d , isLeapMonth ) {
var isLeapMonth = ! ! isLeapMonth ;
var leapMonth = this . leapMonth ( y ) ;
this . leapDays ( y ) ;
if ( isLeapMonth && leapMonth != m ) {
return - 1 ;
}
if ( y == 2100 && m == 12 && d > 1 || y == 1900 && m == 1 && d < 31 ) {
return - 1 ;
}
var day = this . monthDays ( y , m ) ;
var _day = day ;
if ( isLeapMonth ) {
_day = this . leapDays ( y , m ) ;
}
if ( y < 1900 || y > 2100 || d > _day ) {
return - 1 ;
}
var offset = 0 ;
for ( var i = 1900 ; i < y ; i ++ ) {
offset += this . lYearDays ( i ) ;
}
var leap = 0 ;
var isAdd = false ;
for ( var i = 1 ; i < m ; i ++ ) {
leap = this . leapMonth ( y ) ;
if ( ! isAdd ) {
if ( leap <= i && leap > 0 ) {
offset += this . leapDays ( y ) ;
isAdd = true ;
}
}
offset += this . monthDays ( y , i ) ;
}
if ( isLeapMonth ) {
offset += day ;
}
var stmap = Date . UTC ( 1900 , 1 , 30 , 0 , 0 , 0 ) ;
var calObj = new Date ( ( offset + d - 31 ) * 864e5 + stmap ) ;
var cY = calObj . getUTCFullYear ( ) ;
var cM = calObj . getUTCMonth ( ) + 1 ;
var cD = calObj . getUTCDate ( ) ;
return this . solar2lunar ( cY , cM , cD ) ;
}
} ;
const _sfc _main$7 = {
name : "u-calendar" ,
mixins : [ mpMixin , mixin , props ] ,
components : {
uHeader ,
uMonth
} ,
data ( ) {
return {
// 需要显示的月份的数组
months : [ ] ,
// 在月份滚动区域中, 当前视图中月份的index索引
monthIndex : 0 ,
// 月份滚动区域的高度
listHeight : 0 ,
// month组件中选择的日期数组
selected : [ ] ,
scrollIntoView : "" ,
scrollTop : 0 ,
// 过滤处理方法
innerFormatter : ( value ) => value
} ;
} ,
watch : {
selectedChange : {
immediate : true ,
handler ( n ) {
this . setMonth ( ) ;
}
} ,
// 打开弹窗时,设置月份数据
show : {
immediate : true ,
handler ( n ) {
this . setMonth ( ) ;
}
}
} ,
computed : {
// 由于maxDate和minDate可以为字符串(2021-10-10),或者数值(时间戳), 但是dayjs如果接受字符串形式的时间戳会有问题, 这里进行处理
innerMaxDate ( ) {
return uni . $u . test . number ( this . maxDate ) ? Number ( this . maxDate ) : this . maxDate ;
} ,
innerMinDate ( ) {
return uni . $u . test . number ( this . minDate ) ? Number ( this . minDate ) : this . minDate ;
} ,
// 多个条件的变化,会引起选中日期的变化,这里统一管理监听
selectedChange ( ) {
return [ this . innerMinDate , this . innerMaxDate , this . defaultDate ] ;
} ,
subtitle ( ) {
if ( this . months . length ) {
return ` ${ this . months [ this . monthIndex ] . year } 年 ${ this . months [ this . monthIndex ] . month } 月 ` ;
} else {
return "" ;
}
} ,
buttonDisabled ( ) {
if ( this . mode === "range" ) {
if ( this . selected . length <= 1 ) {
return true ;
} else {
return false ;
}
} else {
return false ;
}
}
} ,
mounted ( ) {
this . start = Date . now ( ) ;
this . init ( ) ;
} ,
emits : [ "confirm" , "close" ] ,
methods : {
// 在微信小程序中, 不支持将函数当做props参数, 故只能通过ref形式调用
setFormatter ( e ) {
this . innerFormatter = e ;
} ,
// month组件内部选择日期后, 通过事件通知给父组件
monthSelected ( e ) {
this . selected = e ;
if ( ! this . showConfirm ) {
if ( this . mode === "multiple" || this . mode === "single" || this . mode === "range" && this . selected . length >= 2 ) {
this . $emit ( "confirm" , this . selected ) ;
}
}
} ,
init ( ) {
if ( this . innerMaxDate && new Date ( this . innerMaxDate ) . getTime ( ) <= Date . now ( ) ) {
return uni . $u . error ( "maxDate不能小于当前时间" ) ;
}
this . listHeight = this . rowHeight * 5 + 30 ;
this . setMonth ( ) ;
} ,
close ( ) {
this . $emit ( "close" ) ;
} ,
// 点击确定按钮
confirm ( ) {
if ( ! this . buttonDisabled ) {
this . $emit ( "confirm" , this . selected ) ;
}
} ,
// 获得两个日期之间的月份数
getMonths ( minDate , maxDate ) {
const minYear = dayjs ( minDate ) . year ( ) ;
const minMonth = dayjs ( minDate ) . month ( ) + 1 ;
const maxYear = dayjs ( maxDate ) . year ( ) ;
const maxMonth = dayjs ( maxDate ) . month ( ) + 1 ;
return ( maxYear - minYear ) * 12 + ( maxMonth - minMonth ) + 1 ;
} ,
// 设置月份数据
setMonth ( ) {
const minDate = this . innerMinDate || dayjs ( ) . valueOf ( ) ;
const maxDate = this . innerMaxDate || dayjs ( minDate ) . add ( this . monthNum - 1 , "month" ) . valueOf ( ) ;
const months = uni . $u . range (
1 ,
this . monthNum ,
this . getMonths ( minDate , maxDate )
) ;
this . months = [ ] ;
for ( let i = 0 ; i < months ; i ++ ) {
this . months . push ( {
date : new Array (
dayjs ( minDate ) . add ( i , "month" ) . daysInMonth ( )
) . fill ( 1 ) . map ( ( item , index2 ) => {
let day = index2 + 1 ;
const week = dayjs ( minDate ) . add ( i , "month" ) . date ( day ) . day ( ) ;
const date2 = dayjs ( minDate ) . add ( i , "month" ) . date ( day ) . format ( "YYYY-MM-DD" ) ;
let bottomInfo = "" ;
if ( this . showLunar ) {
const lunar = Calendar . solar2lunar (
dayjs ( date2 ) . year ( ) ,
dayjs ( date2 ) . month ( ) + 1 ,
dayjs ( date2 ) . date ( )
) ;
bottomInfo = lunar . IDayCn ;
}
let config2 = {
day ,
week ,
// 小于最小允许的日期, 或者大于最大的日期, 则设置为disabled状态
disabled : dayjs ( date2 ) . isBefore (
dayjs ( minDate ) . format ( "YYYY-MM-DD" )
) || dayjs ( date2 ) . isAfter (
dayjs ( maxDate ) . format ( "YYYY-MM-DD" )
) ,
// 返回一个日期对象, 供外部的formatter获取当前日期的年月日等信息, 进行加工处理
date : new Date ( date2 ) ,
bottomInfo ,
dot : false ,
month : dayjs ( minDate ) . add ( i , "month" ) . month ( ) + 1
} ;
const formatter = this . formatter || this . innerFormatter ;
return formatter ( config2 ) ;
} ) ,
// 当前所属的月份
month : dayjs ( minDate ) . add ( i , "month" ) . month ( ) + 1 ,
// 当前年份
year : dayjs ( minDate ) . add ( i , "month" ) . year ( )
} ) ;
}
} ,
// 滚动到默认设置的月份
scrollIntoDefaultMonth ( selected ) {
const _index = this . months . findIndex ( ( {
year ,
month
} ) => {
month = uni . $u . padZero ( month ) ;
return ` ${ year } - ${ month } ` === selected ;
} ) ;
if ( _index !== - 1 ) {
this . $nextTick ( ( ) => {
this . scrollIntoView = ` month- ${ _index } ` ;
} ) ;
}
} ,
// scroll-view滚动监听
onScroll ( event ) {
const scrollTop = Math . max ( 0 , event . detail . scrollTop ) ;
for ( let i = 0 ; i < this . months . length ; i ++ ) {
if ( scrollTop >= ( this . months [ i ] . top || this . listHeight ) ) {
this . monthIndex = i ;
}
}
} ,
// 更新月份的top值
updateMonthTop ( topArr = [ ] ) {
topArr . map ( ( item , index2 ) => {
this . months [ index2 ] . top = item ;
} ) ;
if ( ! this . defaultDate ) {
const selected2 = dayjs ( ) . format ( "YYYY-MM" ) ;
this . scrollIntoDefaultMonth ( selected2 ) ;
return ;
}
let selected = dayjs ( ) . format ( "YYYY-MM" ) ;
if ( ! uni . $u . test . array ( this . defaultDate ) ) {
selected = dayjs ( this . defaultDate ) . format ( "YYYY-MM" ) ;
} else {
selected = dayjs ( this . defaultDate [ 0 ] ) . format ( "YYYY-MM" ) ;
}
this . scrollIntoDefaultMonth ( selected ) ;
}
}
} ;
function _sfc _render$3 ( _ctx , _cache , $props , $setup , $data , $options ) {
const _component _uHeader = vue . resolveComponent ( "uHeader" ) ;
const _component _uMonth = vue . resolveComponent ( "uMonth" ) ;
const _component _u _button = resolveEasycom ( vue . resolveDynamicComponent ( "u-button" ) , _ _easycom _0$1 ) ;
const _component _u _popup = resolveEasycom ( vue . resolveDynamicComponent ( "u-popup" ) , _ _easycom _1$1 ) ;
return vue . openBlock ( ) , vue . createBlock ( _component _u _popup , {
show : _ctx . show ,
mode : "bottom" ,
closeable : "" ,
onClose : $options . close ,
round : _ctx . round ,
closeOnClickOverlay : _ctx . closeOnClickOverlay
} , {
default : vue . withCtx ( ( ) => [
vue . createElementVNode ( "view" , { class : "u-calendar" } , [
vue . createVNode ( _component _uHeader , {
title : _ctx . title ,
subtitle : $options . subtitle ,
showSubtitle : _ctx . showSubtitle ,
showTitle : _ctx . showTitle
} , null , 8 , [ "title" , "subtitle" , "showSubtitle" , "showTitle" ] ) ,
vue . createElementVNode ( "scroll-view" , {
style : vue . normalizeStyle ( {
height : _ctx . $u . addUnit ( $data . listHeight )
} ) ,
"scroll-y" : "" ,
onScroll : _cache [ 0 ] || ( _cache [ 0 ] = ( ... args ) => $options . onScroll && $options . onScroll ( ... args ) ) ,
"scroll-top" : $data . scrollTop ,
scrollIntoView : $data . scrollIntoView
} , [
vue . createVNode ( _component _uMonth , {
color : _ctx . color ,
rowHeight : _ctx . rowHeight ,
showMark : _ctx . showMark ,
months : $data . months ,
mode : _ctx . mode ,
maxCount : _ctx . maxCount ,
startText : _ctx . startText ,
endText : _ctx . endText ,
defaultDate : _ctx . defaultDate ,
minDate : $options . innerMinDate ,
maxDate : $options . innerMaxDate ,
maxMonth : _ctx . monthNum ,
readonly : _ctx . readonly ,
maxRange : _ctx . maxRange ,
rangePrompt : _ctx . rangePrompt ,
showRangePrompt : _ctx . showRangePrompt ,
allowSameDay : _ctx . allowSameDay ,
ref : "month" ,
onMonthSelected : $options . monthSelected ,
onUpdateMonthTop : $options . updateMonthTop
} , null , 8 , [ "color" , "rowHeight" , "showMark" , "months" , "mode" , "maxCount" , "startText" , "endText" , "defaultDate" , "minDate" , "maxDate" , "maxMonth" , "readonly" , "maxRange" , "rangePrompt" , "showRangePrompt" , "allowSameDay" , "onMonthSelected" , "onUpdateMonthTop" ] )
] , 44 , [ "scroll-top" , "scrollIntoView" ] ) ,
_ctx . showConfirm ? vue . renderSlot ( _ctx . $slots , "footer" , { key : 0 } , ( ) => [
vue . createElementVNode ( "view" , { class : "u-calendar__confirm" } , [
vue . createVNode ( _component _u _button , {
shape : "circle" ,
text : $options . buttonDisabled ? _ctx . confirmDisabledText : _ctx . confirmText ,
color : _ctx . color ,
onClick : $options . confirm ,
disabled : $options . buttonDisabled
} , null , 8 , [ "text" , "color" , "onClick" , "disabled" ] )
] )
] , true ) : vue . createCommentVNode ( "v-if" , true )
] )
] ) ,
_ : 3
/* FORWARDED */
} , 8 , [ "show" , "onClose" , "round" , "closeOnClickOverlay" ] ) ;
}
const _ _easycom _1 = /* @__PURE__ */ _export _sfc ( _sfc _main$7 , [ [ "render" , _sfc _render$3 ] , [ "__scopeId" , "data-v-4d01889e" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/node_modules/uview-plus/components/u-calendar/u-calendar.vue" ] ] ) ;
const _sfc _main$6 = {
_ _name : "plant" ,
setup ( _ _props ) {
const showDatePicker = vue . ref ( false ) ;
vue . reactive ( {
brand : "" ,
variety : ""
} ) ;
const confirm = ( e ) => {
formatAppLog ( "log" , "at components/InformationAdd/plant.vue:85" , e ) ;
showDatePicker . value = false ;
} ;
return ( _ctx , _cache ) => {
const _component _up _input = resolveEasycom ( vue . resolveDynamicComponent ( "up-input" ) , _ _easycom _0$3 ) ;
const _component _up _calendar = resolveEasycom ( vue . resolveDynamicComponent ( "up-calendar" ) , _ _easycom _1 ) ;
return vue . openBlock ( ) , vue . createElementBlock (
vue . Fragment ,
null ,
[
vue . createElementVNode ( "view" , { class : "card" } , [
vue . createElementVNode ( "view" , { class : "card-li tit" } , [
vue . createElementVNode ( "view" , { class : "" } , " 土地 " ) ,
vue . createElementVNode ( "view" , { style : { "color" : "#00A15E" , "font-weight" : "bold" } } , " 未种植 " )
] ) ,
vue . createElementVNode ( "view" , { class : "card-li tit" } , [
vue . createElementVNode ( "view" , { class : "" } , " 面积: 10亩 " )
] )
] ) ,
vue . createElementVNode ( "view" , { class : "card" } , [
vue . createElementVNode ( "view" , { class : "card-li" } , [
vue . createElementVNode ( "view" , { class : "card-li-tit" } , " 种植品牌 " ) ,
vue . createElementVNode ( "view" , { class : "" } , [
vue . createVNode ( _component _up _input , {
placeholder : "请输入品种" ,
border : "surround" ,
modelValue : _ctx . value ,
"onUpdate:modelValue" : _cache [ 0 ] || ( _cache [ 0 ] = ( $event ) => _ctx . value = $event ) ,
onChange : _ctx . change
} , null , 8 , [ "modelValue" , "onChange" ] )
] )
] ) ,
vue . createElementVNode ( "view" , { class : "card-li" } , [
vue . createElementVNode ( "view" , { class : "card-li-tit" } , " 具体品种 " ) ,
vue . createElementVNode ( "view" , { class : "" } , [
vue . createVNode ( _component _up _input , {
placeholder : "请输入品种" ,
border : "surround" ,
modelValue : _ctx . value ,
"onUpdate:modelValue" : _cache [ 1 ] || ( _cache [ 1 ] = ( $event ) => _ctx . value = $event ) ,
onChange : _ctx . change
} , null , 8 , [ "modelValue" , "onChange" ] )
] )
] ) ,
vue . createElementVNode ( "view" , { class : "card-li" } , [
vue . createElementVNode ( "view" , { class : "card-li-tit" } , " 种子品牌 " ) ,
vue . createElementVNode ( "view" , { class : "" } , [
vue . createVNode ( _component _up _input , {
placeholder : "请输入品种" ,
border : "surround" ,
modelValue : _ctx . value ,
"onUpdate:modelValue" : _cache [ 2 ] || ( _cache [ 2 ] = ( $event ) => _ctx . value = $event ) ,
onChange : _ctx . change
} , null , 8 , [ "modelValue" , "onChange" ] )
] )
] ) ,
vue . createElementVNode ( "view" , { class : "card-li" } , [
vue . createElementVNode ( "view" , { class : "card-li-tit" } , " 种子收购时间 " ) ,
vue . createElementVNode ( "view" , { class : "" } , [
vue . createVNode ( _component _up _input , {
placeholder : "点击输入时间" ,
border : "surround" ,
modelValue : _ctx . value ,
"onUpdate:modelValue" : _cache [ 3 ] || ( _cache [ 3 ] = ( $event ) => _ctx . value = $event ) ,
onFocus : _cache [ 4 ] || ( _cache [ 4 ] = ( $event ) => showDatePicker . value = true )
} , null , 8 , [ "modelValue" ] )
] )
] ) ,
vue . createElementVNode ( "view" , { class : "confim-btn" } , " 确认 " )
] ) ,
vue . createElementVNode ( "view" , { class : "up-img confim-btn" } , " +上传播种图片 " ) ,
vue . createElementVNode ( "view" , { class : "today-btn confim-btn" } , " 今日播种 " ) ,
vue . createCommentVNode ( " 组件 " ) ,
vue . createElementVNode ( "view" , { class : "" } , [
vue . createVNode ( _component _up _calendar , {
closeOnClickOverlay : true ,
show : showDatePicker . value ,
onConfirm : confirm ,
onClose : _cache [ 5 ] || ( _cache [ 5 ] = ( $event ) => showDatePicker . value = false )
} , null , 8 , [ "show" ] )
] )
] ,
64
/* STABLE_FRAGMENT */
) ;
} ;
}
} ;
const plantadd = /* @__PURE__ */ _export _sfc ( _sfc _main$6 , [ [ "__scopeId" , "data-v-0a2913e2" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/components/InformationAdd/plant.vue" ] ] ) ;
const _sfc _main$5 = {
_ _name : "index" ,
setup ( _ _props ) {
return ( _ctx , _cache ) => {
return vue . openBlock ( ) , vue . createElementBlock ( "view" , { class : "content" } , [
vue . createVNode ( plantadd )
] ) ;
} ;
}
} ;
const PagesInformationAddIndex = /* @__PURE__ */ _export _sfc ( _sfc _main$5 , [ [ "__scopeId" , "data-v-2fddea55" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/pages/InformationAdd/index.vue" ] ] ) ;
const _sfc _main$4 = { } ;
function _sfc _render$2 ( _ctx , _cache ) {
return vue . openBlock ( ) , vue . createElementBlock ( "view" , { class : "" } , " SADASD " ) ;
}
const biaoge = /* @__PURE__ */ _export _sfc ( _sfc _main$4 , [ [ "render" , _sfc _render$2 ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/components/biaoge/index.vue" ] ] ) ;
const _sfc _main$3 = {
components : {
biaoge
} ,
data ( ) {
return {
// title: 'Hello'
data : [
{
tit : "土壤温度" ,
icon : "TRWD" ,
dw : "℃" ,
cont : "soil_temperature" ,
flag : false
} ,
{
tit : "土壤湿度" ,
icon : "TRSD" ,
dw : "%RH" ,
cont : "soil_moisture"
} ,
{
tit : "风向" ,
icon : "FX" ,
cont : "wind_direction"
} ,
{
tit : "风速" ,
icon : "FS" ,
dw : "m/s" ,
cont : "wind_speed"
} ,
{
tit : "降雨量" ,
icon : "JYL" ,
dw : "mm" ,
cont : "rainfall"
} ,
{
tit : "光照" ,
icon : "GZ" ,
dw : "Wlux" ,
cont : "illumination"
} ,
{
tit : "二氧化碳" ,
icon : "EYHT" ,
dw : "ppm" ,
cont : "carbon_dioxide_content"
}
] ,
data2 : [ {
cont : "气象多要素百叶箱" ,
cont2 : "1天/1次"
} , {
cont : "多功能控制器" ,
cont2 : "3个小时/次"
} ] ,
baseData : { }
} ;
} ,
onShow ( ) {
companyMine ( {
id : 1 ,
flag : 1
} ) . then ( ( res ) => {
this . baseData = res . data ;
} ) ;
} ,
onPullDownRefresh ( ) {
setTimeout ( ( ) => {
uni . stopPullDownRefresh ( ) ;
} , 500 ) ;
} ,
methods : {
dateFn ( ) {
var today = /* @__PURE__ */ new Date ( ) ;
var year = today . getFullYear ( ) ;
var month = today . getMonth ( ) + 1 ;
var day = today . getDate ( ) ;
var dateStr = year + "-" + month + "-" + day ;
return dateStr ;
} ,
backFn ( ) {
uni . navigateBack ( ) ;
} ,
test ( ) {
companyMine ( ) ;
} ,
urlFn ( name ) {
return ` /static/img/ ${ name } .png ` ;
} ,
img ( w , h , m ) {
return ` width: ${ w } rpx;height: ${ h } ;margin:0 ${ m } rpx ` ;
} ,
navto ( ) {
uni . navigateTo ( {
url : "/pages/index2/index"
} ) ;
}
}
} ;
function _sfc _render$1 ( _ctx , _cache , $props , $setup , $data , $options ) {
const _component _u _ _image = resolveEasycom ( vue . resolveDynamicComponent ( "u--image" ) , _ _easycom _0$4 ) ;
const _component _biaoge = vue . resolveComponent ( "biaoge" ) ;
return vue . openBlock ( ) , vue . createElementBlock ( "view" , { class : "content" } , [
vue . createElementVNode ( "view" , { class : "head-img" } , [
vue . createElementVNode ( "view" , { class : "" } , [
vue . createVNode ( _component _u _ _image , {
src : "/static/img/GJ.jpg" ,
width : "693.93rpx" ,
height : " 394.28rpx" ,
alt : ""
} )
] ) ,
vue . createCommentVNode ( ' <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="click"></u--image> ' ) ,
vue . createElementVNode ( "view" , { class : "poisition" } , [
vue . createElementVNode ( "view" , { style : { "display" : "flex" } } , [
vue . createVNode ( _component _u _ _image , {
src : "/static/img/dw.png" ,
style : { "margin" : "0 5rpx" } ,
width : "35.05rpx" ,
height : "35.05rpx"
} ) ,
vue . createTextVNode ( " 分水岭大南山北326米 " )
] )
] )
] ) ,
vue . createElementVNode ( "view" , { class : "bad-info" } , [
vue . createElementVNode ( "view" , {
class : "" ,
style : { "display" : "flex" , "align-items" : "center" }
} , [
vue . createVNode ( _component _u _ _image , {
src : $options . urlFn ( "sj" ) ,
style : { "margin" : "0 5rpx" } ,
width : "28.04rpx" ,
height : "28.04rpx"
} , null , 8 , [ "src" ] ) ,
vue . createElementVNode (
"text" ,
null ,
"刷新时间:" + vue . toDisplayString ( $options . dateFn ( ) ) ,
1
/* TEXT */
)
] ) ,
vue . createElementVNode ( "view" , { class : "" } , " 查看历史条件> " )
] ) ,
vue . createElementVNode ( "view" , { class : "up-plant-btn" } , " 上传新的种植情况 " ) ,
vue . createElementVNode ( "view" , { class : "card" } , [
vue . createElementVNode ( "view" , { class : "tit" } , [
vue . createElementVNode ( "view" , { class : "" } , " 1号土地 " ) ,
vue . createElementVNode ( "view" , { class : "" } , " 溯源码: 12302 " )
] ) ,
vue . createElementVNode ( "view" , { class : "card-li" } , [
vue . createElementVNode ( "view" , { class : "" } , " 当前种植: 土豆 " ) ,
vue . createElementVNode ( "view" , { class : "" } , " 种植品牌: 的划分等级 " )
] ) ,
vue . createElementVNode ( "view" , { class : "card-li" } , [
vue . createElementVNode ( "view" , { class : "" } , " 土地面积: 20亩 " ) ,
vue . createElementVNode ( "view" , { class : "" } , " 种子品牌: 的划分等级 " )
] ) ,
vue . createElementVNode ( "view" , { class : "card-li" } , [
vue . createElementVNode ( "view" , { class : "" } , " 播种时间: 2020.12.01 " )
] )
] ) ,
vue . createCommentVNode ( " 生长记录 " ) ,
vue . createElementVNode ( "view" , { class : "grow-record" } , [
vue . createElementVNode ( "view" , { class : "grow-record-tit" } , [
vue . createElementVNode ( "view" , { class : "" } , " 生长记录操作 " ) ,
vue . createElementVNode ( "view" , { class : "updata-btn" } , " 更新生长记录 " )
] ) ,
vue . createElementVNode ( "view" , { class : "card" } , [
vue . createVNode ( _component _biaoge )
] )
] ) ,
vue . createElementVNode ( "view" , { class : "data" } , [
vue . createElementVNode ( "view" , { class : "tit" } , [
vue . createElementVNode ( "view" , {
class : "" ,
style : { "display" : "flex" , "justify-content" : "space-between" , "font-size" : "29.79rpx" }
} , [
vue . createElementVNode ( "view" , { class : "" } , " 土地监测数据 " ) ,
vue . createElementVNode ( "view" , { class : "" } , " 查看全部检测记录> " )
] ) ,
vue . createElementVNode ( "view" , { class : "tit-b" } , [
vue . createVNode ( _component _u _ _image , {
src : $options . urlFn ( "sj" ) ,
style : { "margin" : "0 5rpx" } ,
width : "28.04rpx" ,
height : "28.04rpx"
} , null , 8 , [ "src" ] ) ,
vue . createElementVNode (
"text" ,
null ,
"刷新时间:" + vue . toDisplayString ( $options . dateFn ( ) ) ,
1
/* TEXT */
)
] )
] ) ,
vue . createElementVNode ( "view" , { class : "data-cont" } , [
( vue . openBlock ( true ) , vue . createElementBlock (
vue . Fragment ,
null ,
vue . renderList ( $data . data , ( item , index2 ) => {
return vue . openBlock ( ) , vue . createElementBlock ( "view" , {
class : "data-cont-li center" ,
key : index2
} , [
vue . createElementVNode ( "view" , { style : { "margin" : "0 20rpx" } } , [
vue . createElementVNode ( "view" , { class : "center" } , [
vue . createCommentVNode ( ` <img :src="urlFn('B')" :style="img(38.55,38.55,5)" alt=""> ` ) ,
vue . createVNode ( _component _u _ _image , {
src : $options . urlFn ( item . icon ) ,
style : { "margin" : "0 5rpx" } ,
width : "38.55rpx" ,
height : "38.54rpx"
} , null , 8 , [ "src" ] ) ,
vue . createTextVNode (
" " + vue . toDisplayString ( item . tit ) ,
1
/* TEXT */
)
] ) ,
vue . createElementVNode ( "view" , { class : "b-cls" } , [
vue . createElementVNode (
"view" ,
{
class : "" ,
style : vue . normalizeStyle ( { color : item . flag ? "#0095FF" : "" } )
} ,
[
vue . createElementVNode (
"text" ,
{ style : { "font-size" : "70.09rpx" } } ,
vue . toDisplayString ( $data . baseData [ item . cont ] ) ,
1
/* TEXT */
) ,
vue . createTextVNode (
vue . toDisplayString ( item . dw ) ,
1
/* TEXT */
)
] ,
4
/* STYLE */
) ,
item . flag ? ( vue . openBlock ( ) , vue . createElementBlock ( "view" , {
key : 0 ,
class : "" ,
style : { "display" : "flex" , "align-items" : "center" }
} , [
vue . createVNode ( _component _u _ _image , {
src : $options . urlFn ( "D" ) ,
style : { "margin" : "0 5rpx" } ,
width : "31.54rpx" ,
height : "31.54rpx"
} , null , 8 , [ "src" ] ) ,
vue . createElementVNode ( "text" , { style : { "color" : "#0095FF" } } , "5" )
] ) ) : vue . createCommentVNode ( "v-if" , true )
] )
] )
] ) ;
} ) ,
128
/* KEYED_FRAGMENT */
) )
] )
] ) ,
vue . createElementVNode ( "view" , { class : "ripe-btn" } , " 标记为成熟 " )
] ) ;
}
const PagesDetailPlant = /* @__PURE__ */ _export _sfc ( _sfc _main$3 , [ [ "render" , _sfc _render$1 ] , [ "__scopeId" , "data-v-3bac3d0d" ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/pages/detail/plant.vue" ] ] ) ;
2023-10-17 16:02:55 +08:00
const _sfc _main$2 = {
_ _name : "index" ,
setup ( _ _props ) {
const counter = counterStore ( ) ;
return ( _ctx , _cache ) => {
return vue . openBlock ( ) , vue . createElementBlock (
"view" ,
null ,
vue . toDisplayString ( vue . unref ( counter ) . count ) ,
1
/* TEXT */
) ;
} ;
}
} ;
const PagesTestIndex = /* @__PURE__ */ _export _sfc ( _sfc _main$2 , [ [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/pages/test/index.vue" ] ] ) ;
const _sfc _main$1 = { } ;
function _sfc _render ( _ctx , _cache ) {
return vue . openBlock ( ) , vue . createElementBlock ( "view" , null , " dsfsd " ) ;
}
const PagesTestIndex1 = /* @__PURE__ */ _export _sfc ( _sfc _main$1 , [ [ "render" , _sfc _render ] , [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/pages/test/index1.vue" ] ] ) ;
_ _definePage ( "pages/index/index" , PagesIndexIndex ) ;
2023-10-20 18:45:15 +08:00
_ _definePage ( "pages/InformationAdd/index" , PagesInformationAddIndex ) ;
_ _definePage ( "pages/detail/plant" , PagesDetailPlant ) ;
2023-10-17 16:02:55 +08:00
_ _definePage ( "pages/test/index" , PagesTestIndex ) ;
_ _definePage ( "pages/test/index1" , PagesTestIndex1 ) ;
const _sfc _main = {
onLaunch : function ( ) {
formatAppLog ( "log" , "at App.vue:4" , "App Launch" ) ;
uni . setStorageSync ( "SY_TOKEN" , "dfdf4564557445df4df" ) ;
} ,
onShow : function ( ) {
formatAppLog ( "log" , "at App.vue:8" , "App Show" ) ;
} ,
onHide : function ( ) {
formatAppLog ( "log" , "at App.vue:11" , "App Hide" ) ;
}
} ;
const App = /* @__PURE__ */ _export _sfc ( _sfc _main , [ [ "__file" , "D:/zmj/uniapp/TraceabilityAPP/App.vue" ] ] ) ;
const { toString } = Object . prototype ;
function isArray ( val ) {
return toString . call ( val ) === "[object Array]" ;
}
function isObject ( val ) {
return val !== null && typeof val === "object" ;
}
function isDate ( val ) {
return toString . call ( val ) === "[object Date]" ;
}
function isURLSearchParams ( val ) {
return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams ;
}
function forEach ( obj , fn ) {
if ( obj === null || typeof obj === "undefined" ) {
return ;
}
if ( typeof obj !== "object" ) {
obj = [ obj ] ;
}
if ( isArray ( obj ) ) {
for ( let i = 0 , l = obj . length ; i < l ; i ++ ) {
fn . call ( null , obj [ i ] , i , obj ) ;
}
} else {
for ( const key in obj ) {
if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) {
fn . call ( null , obj [ key ] , key , obj ) ;
}
}
}
}
function isPlainObject ( obj ) {
return Object . prototype . toString . call ( obj ) === "[object Object]" ;
}
function deepMerge$1 ( ) {
const result = { } ;
function assignValue ( val , key ) {
if ( typeof result [ key ] === "object" && typeof val === "object" ) {
result [ key ] = deepMerge$1 ( result [ key ] , val ) ;
} else if ( typeof val === "object" ) {
result [ key ] = deepMerge$1 ( { } , val ) ;
} else {
result [ key ] = val ;
}
}
for ( let i = 0 , l = arguments . length ; i < l ; i ++ ) {
forEach ( arguments [ i ] , assignValue ) ;
}
return result ;
}
function isUndefined ( val ) {
return typeof val === "undefined" ;
}
function encode ( val ) {
return encodeURIComponent ( val ) . replace ( /%40/gi , "@" ) . replace ( /%3A/gi , ":" ) . replace ( /%24/g , "$" ) . replace ( /%2C/gi , "," ) . replace ( /%20/g , "+" ) . replace ( /%5B/gi , "[" ) . replace ( /%5D/gi , "]" ) ;
}
function buildURL ( url2 , params ) {
if ( ! params ) {
return url2 ;
}
let serializedParams ;
if ( isURLSearchParams ( params ) ) {
serializedParams = params . toString ( ) ;
} else {
const parts = [ ] ;
forEach ( params , ( val , key ) => {
if ( val === null || typeof val === "undefined" ) {
return ;
}
if ( isArray ( val ) ) {
key = ` ${ key } [] ` ;
} else {
val = [ val ] ;
}
forEach ( val , ( v ) => {
if ( isDate ( v ) ) {
v = v . toISOString ( ) ;
} else if ( isObject ( v ) ) {
v = JSON . stringify ( v ) ;
}
parts . push ( ` ${ encode ( key ) } = ${ encode ( v ) } ` ) ;
} ) ;
} ) ;
serializedParams = parts . join ( "&" ) ;
}
if ( serializedParams ) {
const hashmarkIndex = url2 . indexOf ( "#" ) ;
if ( hashmarkIndex !== - 1 ) {
url2 = url2 . slice ( 0 , hashmarkIndex ) ;
}
url2 += ( url2 . indexOf ( "?" ) === - 1 ? "?" : "&" ) + serializedParams ;
}
return url2 ;
}
function isAbsoluteURL ( url2 ) {
return /^([a-z][a-z\d+\-.]*:)?\/\//i . test ( url2 ) ;
}
function combineURLs ( baseURL , relativeURL ) {
return relativeURL ? ` ${ baseURL . replace ( /\/+$/ , "" ) } / ${ relativeURL . replace ( /^\/+/ , "" ) } ` : baseURL ;
}
function buildFullPath ( baseURL , requestedURL ) {
if ( baseURL && ! isAbsoluteURL ( requestedURL ) ) {
return combineURLs ( baseURL , requestedURL ) ;
}
return requestedURL ;
}
function settle ( resolve , reject , response ) {
const { validateStatus } = response . config ;
const status = response . statusCode ;
if ( status && ( ! validateStatus || validateStatus ( status ) ) ) {
resolve ( response ) ;
} else {
reject ( response ) ;
}
}
const mergeKeys$1 = ( keys , config2 ) => {
const config3 = { } ;
keys . forEach ( ( prop ) => {
if ( ! isUndefined ( config2 [ prop ] ) ) {
config3 [ prop ] = config2 [ prop ] ;
}
} ) ;
return config3 ;
} ;
const adapter = ( config2 ) => new Promise ( ( resolve , reject ) => {
const fullPath = buildURL ( buildFullPath ( config2 . baseURL , config2 . url ) , config2 . params ) ;
const _config = {
url : fullPath ,
header : config2 . header ,
complete : ( response ) => {
config2 . fullPath = fullPath ;
response . config = config2 ;
try {
if ( typeof response . data === "string" ) {
response . data = JSON . parse ( response . data ) ;
}
} catch ( e ) {
}
settle ( resolve , reject , response ) ;
}
} ;
let requestTask ;
if ( config2 . method === "UPLOAD" ) {
delete _config . header [ "content-type" ] ;
delete _config . header [ "Content-Type" ] ;
const otherConfig = {
filePath : config2 . filePath ,
name : config2 . name
} ;
const optionalKeys = [
"files" ,
"timeout" ,
"formData"
] ;
requestTask = uni . uploadFile ( { ... _config , ... otherConfig , ... mergeKeys$1 ( optionalKeys , config2 ) } ) ;
} else if ( config2 . method === "DOWNLOAD" ) {
if ( ! isUndefined ( config2 . timeout ) ) {
_config . timeout = config2 . timeout ;
}
requestTask = uni . downloadFile ( _config ) ;
} else {
const optionalKeys = [
"data" ,
"method" ,
"timeout" ,
"dataType" ,
"responseType" ,
"sslVerify" ,
"firstIpv4"
] ;
requestTask = uni . request ( { ... _config , ... mergeKeys$1 ( optionalKeys , config2 ) } ) ;
}
if ( config2 . getTask ) {
config2 . getTask ( requestTask , config2 ) ;
}
} ) ;
const dispatchRequest = ( config2 ) => adapter ( config2 ) ;
function InterceptorManager ( ) {
this . handlers = [ ] ;
}
InterceptorManager . prototype . use = function use ( fulfilled , rejected ) {
this . handlers . push ( {
fulfilled ,
rejected
} ) ;
return this . handlers . length - 1 ;
} ;
InterceptorManager . prototype . eject = function eject ( id ) {
if ( this . handlers [ id ] ) {
this . handlers [ id ] = null ;
}
} ;
InterceptorManager . prototype . forEach = function forEach2 ( fn ) {
this . handlers . forEach ( ( h ) => {
if ( h !== null ) {
fn ( h ) ;
}
} ) ;
} ;
const mergeKeys = ( keys , globalsConfig , config2 ) => {
const config3 = { } ;
keys . forEach ( ( prop ) => {
if ( ! isUndefined ( config2 [ prop ] ) ) {
config3 [ prop ] = config2 [ prop ] ;
} else if ( ! isUndefined ( globalsConfig [ prop ] ) ) {
config3 [ prop ] = globalsConfig [ prop ] ;
}
} ) ;
return config3 ;
} ;
const mergeConfig = ( globalsConfig , config2 = { } ) => {
const method = config2 . method || globalsConfig . method || "GET" ;
let config3 = {
baseURL : globalsConfig . baseURL || "" ,
method ,
url : config2 . url || "" ,
params : config2 . params || { } ,
custom : { ... globalsConfig . custom || { } , ... config2 . custom || { } } ,
header : deepMerge$1 ( globalsConfig . header || { } , config2 . header || { } )
} ;
const defaultToConfig2Keys = [ "getTask" , "validateStatus" ] ;
config3 = { ... config3 , ... mergeKeys ( defaultToConfig2Keys , globalsConfig , config2 ) } ;
if ( method === "DOWNLOAD" ) {
if ( ! isUndefined ( config2 . timeout ) ) {
config3 . timeout = config2 . timeout ;
} else if ( ! isUndefined ( globalsConfig . timeout ) ) {
config3 . timeout = globalsConfig . timeout ;
}
} else if ( method === "UPLOAD" ) {
delete config3 . header [ "content-type" ] ;
delete config3 . header [ "Content-Type" ] ;
const uploadKeys = [
"files" ,
"filePath" ,
"name" ,
"timeout" ,
"formData"
] ;
uploadKeys . forEach ( ( prop ) => {
if ( ! isUndefined ( config2 [ prop ] ) ) {
config3 [ prop ] = config2 [ prop ] ;
}
} ) ;
if ( isUndefined ( config3 . timeout ) && ! isUndefined ( globalsConfig . timeout ) ) {
config3 . timeout = globalsConfig . timeout ;
}
} else {
const defaultsKeys = [
"data" ,
"timeout" ,
"dataType" ,
"responseType" ,
"sslVerify" ,
"firstIpv4"
] ;
config3 = { ... config3 , ... mergeKeys ( defaultsKeys , globalsConfig , config2 ) } ;
}
return config3 ;
} ;
const defaults = {
baseURL : "" ,
header : { } ,
method : "GET" ,
dataType : "json" ,
responseType : "text" ,
custom : { } ,
timeout : 6e4 ,
sslVerify : true ,
firstIpv4 : false ,
validateStatus : function validateStatus ( status ) {
return status >= 200 && status < 300 ;
}
} ;
var clone = function ( ) {
function _instanceof ( obj , type ) {
return type != null && obj instanceof type ;
}
var nativeMap ;
try {
nativeMap = Map ;
} catch ( _ ) {
nativeMap = function ( ) {
} ;
}
var nativeSet ;
try {
nativeSet = Set ;
} catch ( _ ) {
nativeSet = function ( ) {
} ;
}
var nativePromise ;
try {
nativePromise = Promise ;
} catch ( _ ) {
nativePromise = function ( ) {
} ;
}
function clone2 ( parent , circular , depth , prototype , includeNonEnumerable ) {
if ( typeof circular === "object" ) {
depth = circular . depth ;
prototype = circular . prototype ;
includeNonEnumerable = circular . includeNonEnumerable ;
circular = circular . circular ;
}
var allParents = [ ] ;
var allChildren = [ ] ;
var useBuffer = typeof Buffer != "undefined" ;
if ( typeof circular == "undefined" )
circular = true ;
if ( typeof depth == "undefined" )
depth = Infinity ;
function _clone ( parent2 , depth2 ) {
if ( parent2 === null )
return null ;
if ( depth2 === 0 )
return parent2 ;
var child ;
2023-10-20 18:45:15 +08:00
var proto2 ;
2023-10-17 16:02:55 +08:00
if ( typeof parent2 != "object" ) {
return parent2 ;
}
if ( _instanceof ( parent2 , nativeMap ) ) {
child = new nativeMap ( ) ;
} else if ( _instanceof ( parent2 , nativeSet ) ) {
child = new nativeSet ( ) ;
} else if ( _instanceof ( parent2 , nativePromise ) ) {
child = new nativePromise ( function ( resolve , reject ) {
parent2 . then ( function ( value ) {
resolve ( _clone ( value , depth2 - 1 ) ) ;
} , function ( err ) {
reject ( _clone ( err , depth2 - 1 ) ) ;
} ) ;
} ) ;
} else if ( clone2 . _ _isArray ( parent2 ) ) {
child = [ ] ;
} else if ( clone2 . _ _isRegExp ( parent2 ) ) {
child = new RegExp ( parent2 . source , _ _getRegExpFlags ( parent2 ) ) ;
if ( parent2 . lastIndex )
child . lastIndex = parent2 . lastIndex ;
} else if ( clone2 . _ _isDate ( parent2 ) ) {
child = new Date ( parent2 . getTime ( ) ) ;
} else if ( useBuffer && Buffer . isBuffer ( parent2 ) ) {
if ( Buffer . from ) {
child = Buffer . from ( parent2 ) ;
} else {
child = new Buffer ( parent2 . length ) ;
parent2 . copy ( child ) ;
}
return child ;
} else if ( _instanceof ( parent2 , Error ) ) {
child = Object . create ( parent2 ) ;
} else {
if ( typeof prototype == "undefined" ) {
2023-10-20 18:45:15 +08:00
proto2 = Object . getPrototypeOf ( parent2 ) ;
child = Object . create ( proto2 ) ;
2023-10-17 16:02:55 +08:00
} else {
child = Object . create ( prototype ) ;
2023-10-20 18:45:15 +08:00
proto2 = prototype ;
2023-10-17 16:02:55 +08:00
}
}
if ( circular ) {
var index2 = allParents . indexOf ( parent2 ) ;
if ( index2 != - 1 ) {
return allChildren [ index2 ] ;
}
allParents . push ( parent2 ) ;
allChildren . push ( child ) ;
}
if ( _instanceof ( parent2 , nativeMap ) ) {
parent2 . forEach ( function ( value , key ) {
var keyChild = _clone ( key , depth2 - 1 ) ;
var valueChild = _clone ( value , depth2 - 1 ) ;
child . set ( keyChild , valueChild ) ;
} ) ;
}
if ( _instanceof ( parent2 , nativeSet ) ) {
parent2 . forEach ( function ( value ) {
var entryChild = _clone ( value , depth2 - 1 ) ;
child . add ( entryChild ) ;
} ) ;
}
for ( var i in parent2 ) {
var attrs = Object . getOwnPropertyDescriptor ( parent2 , i ) ;
if ( attrs ) {
child [ i ] = _clone ( parent2 [ i ] , depth2 - 1 ) ;
}
try {
var objProperty = Object . getOwnPropertyDescriptor ( parent2 , i ) ;
if ( objProperty . set === "undefined" ) {
continue ;
}
child [ i ] = _clone ( parent2 [ i ] , depth2 - 1 ) ;
} catch ( e ) {
if ( e instanceof TypeError ) {
continue ;
} else if ( e instanceof ReferenceError ) {
continue ;
}
}
}
if ( Object . getOwnPropertySymbols ) {
var symbols = Object . getOwnPropertySymbols ( parent2 ) ;
for ( var i = 0 ; i < symbols . length ; i ++ ) {
var symbol = symbols [ i ] ;
var descriptor = Object . getOwnPropertyDescriptor ( parent2 , symbol ) ;
if ( descriptor && ! descriptor . enumerable && ! includeNonEnumerable ) {
continue ;
}
child [ symbol ] = _clone ( parent2 [ symbol ] , depth2 - 1 ) ;
Object . defineProperty ( child , symbol , descriptor ) ;
}
}
if ( includeNonEnumerable ) {
var allPropertyNames = Object . getOwnPropertyNames ( parent2 ) ;
for ( var i = 0 ; i < allPropertyNames . length ; i ++ ) {
var propertyName = allPropertyNames [ i ] ;
var descriptor = Object . getOwnPropertyDescriptor ( parent2 , propertyName ) ;
if ( descriptor && descriptor . enumerable ) {
continue ;
}
child [ propertyName ] = _clone ( parent2 [ propertyName ] , depth2 - 1 ) ;
Object . defineProperty ( child , propertyName , descriptor ) ;
}
}
return child ;
}
return _clone ( parent , depth ) ;
}
clone2 . clonePrototype = function clonePrototype ( parent ) {
if ( parent === null )
return null ;
var c = function ( ) {
} ;
c . prototype = parent ;
return new c ( ) ;
} ;
function _ _objToStr ( o ) {
return Object . prototype . toString . call ( o ) ;
}
clone2 . _ _objToStr = _ _objToStr ;
function _ _isDate ( o ) {
return typeof o === "object" && _ _objToStr ( o ) === "[object Date]" ;
}
clone2 . _ _isDate = _ _isDate ;
function _ _isArray ( o ) {
return typeof o === "object" && _ _objToStr ( o ) === "[object Array]" ;
}
clone2 . _ _isArray = _ _isArray ;
function _ _isRegExp ( o ) {
return typeof o === "object" && _ _objToStr ( o ) === "[object RegExp]" ;
}
clone2 . _ _isRegExp = _ _isRegExp ;
function _ _getRegExpFlags ( re ) {
var flags = "" ;
if ( re . global )
flags += "g" ;
if ( re . ignoreCase )
flags += "i" ;
if ( re . multiline )
flags += "m" ;
return flags ;
}
clone2 . _ _getRegExpFlags = _ _getRegExpFlags ;
return clone2 ;
} ( ) ;
class Request {
/ * *
* @ param { Object } arg - 全局配置
* @ param { String } arg . baseURL - 全局根路径
* @ param { Object } arg . header - 全局header
* @ param { String } arg . method = [ GET | POST | PUT | DELETE | CONNECT | HEAD | OPTIONS | TRACE ] - 全局默认请求方式
* @ param { String } arg . dataType = [ json ] - 全局默认的dataType
* @ param { String } arg . responseType = [ text | arraybuffer ] - 全局默认的responseType 。 支付宝小程序不支持
* @ param { Object } arg . custom - 全局默认的自定义参数
* @ param { Number } arg . timeout - 全局默认的超时时间 , 单位 ms 。 默认60000 。 H5 ( HBuilderX 2.9 . 9 + ) 、 APP ( HBuilderX 2.9 . 9 + ) 、 微信小程序 ( 2.10 . 0 ) 、 支付宝小程序
* @ param { Boolean } arg . sslVerify - 全局默认的是否验证 ssl 证书 。 默认true . 仅App安卓端支持 ( HBuilderX 2.3 . 3 + )
* @ param { Boolean } arg . withCredentials - 全局默认的跨域请求时是否携带凭证 ( cookies ) 。 默认false 。 仅H5支持 ( HBuilderX 2.6 . 15 + )
* @ param { Boolean } arg . firstIpv4 - 全DNS解析时优先使用ipv4 。 默认false 。 仅 App - Android 支持 ( HBuilderX 2.8 . 0 + )
* @ param { Function ( statusCode ) : Boolean } arg . validateStatus - 全局默认的自定义验证器 。 默认statusCode >= 200 && statusCode < 300
* /
constructor ( arg = { } ) {
if ( ! isPlainObject ( arg ) ) {
arg = { } ;
formatAppLog ( "warn" , "at node_modules/uview-plus/libs/luch-request/core/Request.js:39" , "设置全局参数必须接收一个Object" ) ;
}
this . config = clone ( { ... defaults , ... arg } ) ;
this . interceptors = {
request : new InterceptorManager ( ) ,
response : new InterceptorManager ( )
} ;
}
/ * *
* @ Function
* @ param { Request ~ setConfigCallback } f - 设置全局默认配置
* /
setConfig ( f ) {
this . config = f ( this . config ) ;
}
middleware ( config2 ) {
config2 = mergeConfig ( this . config , config2 ) ;
const chain = [ dispatchRequest , void 0 ] ;
let promise2 = Promise . resolve ( config2 ) ;
this . interceptors . request . forEach ( ( interceptor ) => {
chain . unshift ( interceptor . fulfilled , interceptor . rejected ) ;
} ) ;
this . interceptors . response . forEach ( ( interceptor ) => {
chain . push ( interceptor . fulfilled , interceptor . rejected ) ;
} ) ;
while ( chain . length ) {
promise2 = promise2 . then ( chain . shift ( ) , chain . shift ( ) ) ;
}
return promise2 ;
}
/ * *
* @ Function
* @ param { Object } config - 请求配置项
* @ prop { String } options . url - 请求路径
* @ prop { Object } options . data - 请求参数
* @ prop { Object } [ options . responseType = config . responseType ] [ text | arraybuffer ] - 响应的数据类型
* @ prop { Object } [ options . dataType = config . dataType ] - 如果设为 json , 会尝试对返回的数据做一次 JSON . parse
* @ prop { Object } [ options . header = config . header ] - 请求header
* @ prop { Object } [ options . method = config . method ] - 请求方法
* @ returns { Promise < unknown > }
* /
request ( config2 = { } ) {
return this . middleware ( config2 ) ;
}
get ( url2 , options = { } ) {
return this . middleware ( {
url : url2 ,
method : "GET" ,
... options
} ) ;
}
post ( url2 , data , options = { } ) {
return this . middleware ( {
url : url2 ,
data ,
method : "POST" ,
... options
} ) ;
}
put ( url2 , data , options = { } ) {
return this . middleware ( {
url : url2 ,
data ,
method : "PUT" ,
... options
} ) ;
}
delete ( url2 , data , options = { } ) {
return this . middleware ( {
url : url2 ,
data ,
method : "DELETE" ,
... options
} ) ;
}
options ( url2 , data , options = { } ) {
return this . middleware ( {
url : url2 ,
data ,
method : "OPTIONS" ,
... options
} ) ;
}
upload ( url2 , config2 = { } ) {
config2 . url = url2 ;
config2 . method = "UPLOAD" ;
return this . middleware ( config2 ) ;
}
download ( url2 , config2 = { } ) {
config2 . url = url2 ;
config2 . method = "DOWNLOAD" ;
return this . middleware ( config2 ) ;
}
}
class Router {
constructor ( ) {
this . config = {
type : "navigateTo" ,
url : "" ,
delta : 1 ,
// navigateBack页面后退时,回退的层数
params : { } ,
// 传递的参数
animationType : "pop-in" ,
// 窗口动画,只在APP有效
animationDuration : 300 ,
// 窗口动画持续时间,单位毫秒,只在APP有效
intercept : false
// 是否需要拦截
} ;
this . route = this . route . bind ( this ) ;
}
// 判断url前面是否有"/",如果没有则加上,否则无法跳转
addRootPath ( url2 ) {
return url2 [ 0 ] === "/" ? url2 : ` / ${ url2 } ` ;
}
// 整合路由参数
mixinParam ( url2 , params ) {
url2 = url2 && this . addRootPath ( url2 ) ;
let query = "" ;
if ( /.*\/.*\?.*=.*/ . test ( url2 ) ) {
query = uni . $u . queryParams ( params , false ) ;
return url2 += ` & ${ query } ` ;
}
query = uni . $u . queryParams ( params ) ;
return url2 += query ;
}
// 对外的方法名称
async route ( options = { } , params = { } ) {
let mergeConfig2 = { } ;
if ( typeof options === "string" ) {
mergeConfig2 . url = this . mixinParam ( options , params ) ;
mergeConfig2 . type = "navigateTo" ;
} else {
mergeConfig2 = uni . $u . deepMerge ( this . config , options ) ;
mergeConfig2 . url = this . mixinParam ( options . url , options . params ) ;
}
if ( mergeConfig2 . url === uni . $u . page ( ) )
return ;
if ( params . intercept ) {
this . config . intercept = params . intercept ;
}
mergeConfig2 . params = params ;
mergeConfig2 = uni . $u . deepMerge ( this . config , mergeConfig2 ) ;
if ( typeof uni . $u . routeIntercept === "function" ) {
const isNext = await new Promise ( ( resolve , reject ) => {
uni . $u . routeIntercept ( mergeConfig2 , resolve ) ;
} ) ;
isNext && this . openPage ( mergeConfig2 ) ;
} else {
this . openPage ( mergeConfig2 ) ;
}
}
// 执行路由跳转
openPage ( config2 ) {
const {
url : url2 ,
type ,
delta ,
animationType ,
animationDuration
} = config2 ;
if ( config2 . type == "navigateTo" || config2 . type == "to" ) {
uni . navigateTo ( {
url : url2 ,
animationType ,
animationDuration
} ) ;
}
if ( config2 . type == "redirectTo" || config2 . type == "redirect" ) {
uni . redirectTo ( {
url : url2
} ) ;
}
if ( config2 . type == "switchTab" || config2 . type == "tab" ) {
uni . switchTab ( {
url : url2
} ) ;
}
if ( config2 . type == "reLaunch" || config2 . type == "launch" ) {
uni . reLaunch ( {
url : url2
} ) ;
}
if ( config2 . type == "navigateBack" || config2 . type == "back" ) {
uni . navigateBack ( {
delta
} ) ;
}
}
}
const route = new Router ( ) . route ;
function colorGradient ( startColor = "rgb(0, 0, 0)" , endColor = "rgb(255, 255, 255)" , step = 10 ) {
const startRGB = hexToRgb ( startColor , false ) ;
const startR = startRGB [ 0 ] ;
const startG = startRGB [ 1 ] ;
const startB = startRGB [ 2 ] ;
const endRGB = hexToRgb ( endColor , false ) ;
const endR = endRGB [ 0 ] ;
const endG = endRGB [ 1 ] ;
const endB = endRGB [ 2 ] ;
const sR = ( endR - startR ) / step ;
const sG = ( endG - startG ) / step ;
const sB = ( endB - startB ) / step ;
const colorArr = [ ] ;
for ( let i = 0 ; i < step ; i ++ ) {
let hex = rgbToHex ( ` rgb( ${ Math . round ( sR * i + startR ) } , ${ Math . round ( sG * i + startG ) } , ${ Math . round ( sB * i + startB ) } ) ` ) ;
if ( i === 0 )
hex = rgbToHex ( startColor ) ;
if ( i === step - 1 )
hex = rgbToHex ( endColor ) ;
colorArr . push ( hex ) ;
}
return colorArr ;
}
function hexToRgb ( sColor , str = true ) {
const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/ ;
sColor = String ( sColor ) . toLowerCase ( ) ;
if ( sColor && reg . test ( sColor ) ) {
if ( sColor . length === 4 ) {
let sColorNew = "#" ;
for ( let i = 1 ; i < 4 ; i += 1 ) {
sColorNew += sColor . slice ( i , i + 1 ) . concat ( sColor . slice ( i , i + 1 ) ) ;
}
sColor = sColorNew ;
}
const sColorChange = [ ] ;
for ( let i = 1 ; i < 7 ; i += 2 ) {
sColorChange . push ( parseInt ( ` 0x ${ sColor . slice ( i , i + 2 ) } ` ) ) ;
}
if ( ! str ) {
return sColorChange ;
}
return ` rgb( ${ sColorChange [ 0 ] } , ${ sColorChange [ 1 ] } , ${ sColorChange [ 2 ] } ) ` ;
}
if ( /^(rgb|RGB)/ . test ( sColor ) ) {
const arr = sColor . replace ( /(?:\(|\)|rgb|RGB)*/g , "" ) . split ( "," ) ;
return arr . map ( ( val ) => Number ( val ) ) ;
}
return sColor ;
}
function rgbToHex ( rgb ) {
const _this = rgb ;
const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/ ;
if ( /^(rgb|RGB)/ . test ( _this ) ) {
const aColor = _this . replace ( /(?:\(|\)|rgb|RGB)*/g , "" ) . split ( "," ) ;
let strHex = "#" ;
for ( let i = 0 ; i < aColor . length ; i ++ ) {
let hex = Number ( aColor [ i ] ) . toString ( 16 ) ;
hex = String ( hex ) . length == 1 ? ` ${ 0 } ${ hex } ` : hex ;
if ( hex === "0" ) {
hex += hex ;
}
strHex += hex ;
}
if ( strHex . length !== 7 ) {
strHex = _this ;
}
return strHex ;
}
if ( reg . test ( _this ) ) {
const aNum = _this . replace ( /#/ , "" ) . split ( "" ) ;
if ( aNum . length === 6 ) {
return _this ;
}
if ( aNum . length === 3 ) {
let numHex = "#" ;
for ( let i = 0 ; i < aNum . length ; i += 1 ) {
numHex += aNum [ i ] + aNum [ i ] ;
}
return numHex ;
}
} else {
return _this ;
}
}
function colorToRgba ( color2 , alpha ) {
color2 = rgbToHex ( color2 ) ;
const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/ ;
let sColor = String ( color2 ) . toLowerCase ( ) ;
if ( sColor && reg . test ( sColor ) ) {
if ( sColor . length === 4 ) {
let sColorNew = "#" ;
for ( let i = 1 ; i < 4 ; i += 1 ) {
sColorNew += sColor . slice ( i , i + 1 ) . concat ( sColor . slice ( i , i + 1 ) ) ;
}
sColor = sColorNew ;
}
const sColorChange = [ ] ;
for ( let i = 1 ; i < 7 ; i += 2 ) {
sColorChange . push ( parseInt ( ` 0x ${ sColor . slice ( i , i + 2 ) } ` ) ) ;
}
return ` rgba( ${ sColorChange . join ( "," ) } , ${ alpha } ) ` ;
}
return sColor ;
}
const colorGradient$1 = {
colorGradient ,
hexToRgb ,
rgbToHex ,
colorToRgba
} ;
function email ( value ) {
return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/ . test ( value ) ;
}
function mobile ( value ) {
return /^1[23456789]\d{9}$/ . test ( value ) ;
}
function url ( value ) {
return /^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+\/?)$/ . test ( value ) ;
}
function date ( value ) {
if ( ! value )
return false ;
if ( number ( value ) )
value = + value ;
return ! /Invalid|NaN/ . test ( new Date ( value ) . toString ( ) ) ;
}
function dateISO ( value ) {
return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/ . test ( value ) ;
}
function number ( value ) {
return /^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/ . test ( value ) ;
}
function string ( value ) {
return typeof value === "string" ;
}
function digits ( value ) {
return /^\d+$/ . test ( value ) ;
}
function idCard ( value ) {
return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/ . test (
value
) ;
}
function carNo ( value ) {
const xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/ ;
const creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/ ;
if ( value . length === 7 ) {
return creg . test ( value ) ;
}
if ( value . length === 8 ) {
return xreg . test ( value ) ;
}
return false ;
}
function amount ( value ) {
return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/ . test ( value ) ;
}
function chinese ( value ) {
const reg = /^[\u4e00-\u9fa5]+$/gi ;
return reg . test ( value ) ;
}
function letter ( value ) {
return /^[a-zA-Z]*$/ . test ( value ) ;
}
function enOrNum ( value ) {
const reg = /^[0-9a-zA-Z]*$/g ;
return reg . test ( value ) ;
}
function contains ( value , param ) {
return value . indexOf ( param ) >= 0 ;
}
function range$1 ( value , param ) {
return value >= param [ 0 ] && value <= param [ 1 ] ;
}
function rangeLength ( value , param ) {
return value . length >= param [ 0 ] && value . length <= param [ 1 ] ;
}
function landline ( value ) {
const reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/ ;
return reg . test ( value ) ;
}
function empty ( value ) {
switch ( typeof value ) {
case "undefined" :
return true ;
case "string" :
if ( value . replace ( /(^[ \t\n\r]*)|([ \t\n\r]*$)/g , "" ) . length == 0 )
return true ;
break ;
case "boolean" :
if ( ! value )
return true ;
break ;
case "number" :
if ( value === 0 || isNaN ( value ) )
return true ;
break ;
case "object" :
if ( value === null || value . length === 0 )
return true ;
for ( const i in value ) {
return false ;
}
return true ;
}
return false ;
}
function jsonString ( value ) {
if ( typeof value === "string" ) {
try {
const obj = JSON . parse ( value ) ;
if ( typeof obj === "object" && obj ) {
return true ;
}
return false ;
} catch ( e ) {
return false ;
}
}
return false ;
}
function array ( value ) {
if ( typeof Array . isArray === "function" ) {
return Array . isArray ( value ) ;
}
return Object . prototype . toString . call ( value ) === "[object Array]" ;
}
function object ( value ) {
return Object . prototype . toString . call ( value ) === "[object Object]" ;
}
function code ( value , len = 6 ) {
return new RegExp ( ` ^ \\ d{ ${ len } } $ ` ) . test ( value ) ;
}
function func ( value ) {
return typeof value === "function" ;
}
function promise ( value ) {
return object ( value ) && func ( value . then ) && func ( value . catch ) ;
}
function image ( value ) {
const newValue = value . split ( "?" ) [ 0 ] ;
const IMAGE _REGEXP = /\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i ;
return IMAGE _REGEXP . test ( newValue ) ;
}
function video ( value ) {
const VIDEO _REGEXP = /\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i ;
return VIDEO _REGEXP . test ( value ) ;
}
function regExp ( o ) {
return o && Object . prototype . toString . call ( o ) === "[object RegExp]" ;
}
const test = {
email ,
mobile ,
url ,
date ,
dateISO ,
number ,
digits ,
idCard ,
carNo ,
amount ,
chinese ,
letter ,
enOrNum ,
contains ,
range : range$1 ,
rangeLength ,
empty ,
isEmpty : empty ,
jsonString ,
landline ,
object ,
array ,
code ,
func ,
promise ,
video ,
image ,
regExp ,
string
} ;
let timeout = null ;
function debounce ( func2 , wait = 500 , immediate = false ) {
if ( timeout !== null )
clearTimeout ( timeout ) ;
if ( immediate ) {
const callNow = ! timeout ;
timeout = setTimeout ( ( ) => {
timeout = null ;
} , wait ) ;
if ( callNow )
typeof func2 === "function" && func2 ( ) ;
} else {
timeout = setTimeout ( ( ) => {
typeof func2 === "function" && func2 ( ) ;
} , wait ) ;
}
}
let flag ;
function throttle ( func2 , wait = 500 , immediate = true ) {
if ( immediate ) {
if ( ! flag ) {
flag = true ;
typeof func2 === "function" && func2 ( ) ;
setTimeout ( ( ) => {
flag = false ;
} , wait ) ;
}
} else if ( ! flag ) {
flag = true ;
setTimeout ( ( ) => {
flag = false ;
typeof func2 === "function" && func2 ( ) ;
} , wait ) ;
}
}
function strip ( num , precision = 15 ) {
return + parseFloat ( Number ( num ) . toPrecision ( precision ) ) ;
}
function digitLength ( num ) {
const eSplit = num . toString ( ) . split ( /[eE]/ ) ;
const len = ( eSplit [ 0 ] . split ( "." ) [ 1 ] || "" ) . length - + ( eSplit [ 1 ] || 0 ) ;
return len > 0 ? len : 0 ;
}
function float2Fixed ( num ) {
if ( num . toString ( ) . indexOf ( "e" ) === - 1 ) {
return Number ( num . toString ( ) . replace ( "." , "" ) ) ;
}
const dLen = digitLength ( num ) ;
return dLen > 0 ? strip ( Number ( num ) * Math . pow ( 10 , dLen ) ) : Number ( num ) ;
}
function checkBoundary ( num ) {
{
if ( num > Number . MAX _SAFE _INTEGER || num < Number . MIN _SAFE _INTEGER ) {
formatAppLog ( "warn" , "at node_modules/uview-plus/libs/function/digit.js:45" , ` ${ num } 超出了精度限制,结果可能不正确 ` ) ;
}
}
}
function iteratorOperation ( arr , operation ) {
const [ num1 , num2 , ... others ] = arr ;
let res = operation ( num1 , num2 ) ;
others . forEach ( ( num ) => {
res = operation ( res , num ) ;
} ) ;
return res ;
}
function times ( ... nums ) {
if ( nums . length > 2 ) {
return iteratorOperation ( nums , times ) ;
}
const [ num1 , num2 ] = nums ;
const num1Changed = float2Fixed ( num1 ) ;
const num2Changed = float2Fixed ( num2 ) ;
const baseNum = digitLength ( num1 ) + digitLength ( num2 ) ;
const leftValue = num1Changed * num2Changed ;
checkBoundary ( leftValue ) ;
return leftValue / Math . pow ( 10 , baseNum ) ;
}
function divide ( ... nums ) {
if ( nums . length > 2 ) {
return iteratorOperation ( nums , divide ) ;
}
const [ num1 , num2 ] = nums ;
const num1Changed = float2Fixed ( num1 ) ;
const num2Changed = float2Fixed ( num2 ) ;
checkBoundary ( num1Changed ) ;
checkBoundary ( num2Changed ) ;
return times ( num1Changed / num2Changed , strip ( Math . pow ( 10 , digitLength ( num2 ) - digitLength ( num1 ) ) ) ) ;
}
function round ( num , ratio ) {
const base = Math . pow ( 10 , ratio ) ;
let result = divide ( Math . round ( Math . abs ( times ( num , base ) ) ) , base ) ;
if ( num < 0 && result !== 0 ) {
result = times ( result , - 1 ) ;
}
return result ;
}
function range ( min = 0 , max = 0 , value = 0 ) {
return Math . max ( min , Math . min ( max , Number ( value ) ) ) ;
}
function getPx ( value , unit = false ) {
if ( test . number ( value ) ) {
return unit ? ` ${ value } px ` : Number ( value ) ;
}
if ( /(rpx|upx)$/ . test ( value ) ) {
return unit ? ` ${ uni . upx2px ( parseInt ( value ) ) } px ` : Number ( uni . upx2px ( parseInt ( value ) ) ) ;
}
return unit ? ` ${ parseInt ( value ) } px ` : parseInt ( value ) ;
}
function sleep ( value = 30 ) {
return new Promise ( ( resolve ) => {
setTimeout ( ( ) => {
resolve ( ) ;
} , value ) ;
} ) ;
}
function os ( ) {
return uni . getSystemInfoSync ( ) . platform . toLowerCase ( ) ;
}
function sys ( ) {
return uni . getSystemInfoSync ( ) ;
}
function random ( min , max ) {
if ( min >= 0 && max > 0 && max >= min ) {
const gab = max - min + 1 ;
return Math . floor ( Math . random ( ) * gab + min ) ;
}
return 0 ;
}
function guid ( len = 32 , firstU = true , radix = null ) {
const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" . split ( "" ) ;
const uuid = [ ] ;
radix = radix || chars . length ;
if ( len ) {
for ( let i = 0 ; i < len ; i ++ )
uuid [ i ] = chars [ 0 | Math . random ( ) * radix ] ;
} else {
let r ;
uuid [ 8 ] = uuid [ 13 ] = uuid [ 18 ] = uuid [ 23 ] = "-" ;
uuid [ 14 ] = "4" ;
for ( let i = 0 ; i < 36 ; i ++ ) {
if ( ! uuid [ i ] ) {
r = 0 | Math . random ( ) * 16 ;
uuid [ i ] = chars [ i == 19 ? r & 3 | 8 : r ] ;
}
}
}
if ( firstU ) {
uuid . shift ( ) ;
return ` u ${ uuid . join ( "" ) } ` ;
}
return uuid . join ( "" ) ;
}
function $parent ( name = void 0 ) {
let parent = this . $parent ;
while ( parent ) {
if ( parent . $options && parent . $options . name !== name ) {
parent = parent . $parent ;
} else {
return parent ;
}
}
return false ;
}
function addStyle ( customStyle , target = "object" ) {
if ( test . empty ( customStyle ) || typeof customStyle === "object" && target === "object" || target === "string" && typeof customStyle === "string" ) {
return customStyle ;
}
if ( target === "object" ) {
customStyle = trim ( customStyle ) ;
const styleArray = customStyle . split ( ";" ) ;
const style = { } ;
for ( let i = 0 ; i < styleArray . length ; i ++ ) {
if ( styleArray [ i ] ) {
const item = styleArray [ i ] . split ( ":" ) ;
style [ trim ( item [ 0 ] ) ] = trim ( item [ 1 ] ) ;
}
}
return style ;
}
let string2 = "" ;
for ( const i in customStyle ) {
const key = i . replace ( /([A-Z])/g , "-$1" ) . toLowerCase ( ) ;
string2 += ` ${ key } : ${ customStyle [ i ] } ; ` ;
}
return trim ( string2 ) ;
}
function addUnit ( value = "auto" , unit = "" ) {
if ( ! unit ) {
unit = uni . $u . config . unit || "px" ;
}
value = String ( value ) ;
return test . number ( value ) ? ` ${ value } ${ unit } ` : value ;
}
function deepClone ( obj ) {
if ( [ null , void 0 , NaN , false ] . includes ( obj ) )
return obj ;
if ( typeof obj !== "object" && typeof obj !== "function" ) {
return obj ;
}
const o = test . array ( obj ) ? [ ] : { } ;
for ( const i in obj ) {
if ( obj . hasOwnProperty ( i ) ) {
o [ i ] = typeof obj [ i ] === "object" ? deepClone ( obj [ i ] ) : obj [ i ] ;
}
}
return o ;
}
function deepMerge ( target = { } , source = { } ) {
target = deepClone ( target ) ;
if ( typeof target !== "object" || typeof source !== "object" )
return false ;
for ( const prop in source ) {
if ( ! source . hasOwnProperty ( prop ) )
continue ;
if ( prop in target ) {
if ( source [ prop ] == null ) {
target [ prop ] = source [ prop ] ;
} else if ( typeof target [ prop ] !== "object" ) {
target [ prop ] = source [ prop ] ;
} else if ( typeof source [ prop ] !== "object" ) {
target [ prop ] = source [ prop ] ;
} else if ( target [ prop ] . concat && source [ prop ] . concat ) {
target [ prop ] = target [ prop ] . concat ( source [ prop ] ) ;
} else {
target [ prop ] = deepMerge ( target [ prop ] , source [ prop ] ) ;
}
} else {
target [ prop ] = source [ prop ] ;
}
}
return target ;
}
function error ( err ) {
{
formatAppLog ( "error" , "at node_modules/uview-plus/libs/function/index.js:240" , ` uView提示: ${ err } ` ) ;
}
}
function randomArray ( array2 = [ ] ) {
return array2 . sort ( ( ) => Math . random ( ) - 0.5 ) ;
}
if ( ! String . prototype . padStart ) {
String . prototype . padStart = function ( maxLength , fillString = " " ) {
if ( Object . prototype . toString . call ( fillString ) !== "[object String]" ) {
throw new TypeError (
"fillString must be String"
) ;
}
const str = this ;
if ( str . length >= maxLength )
return String ( str ) ;
const fillLength = maxLength - str . length ;
let times2 = Math . ceil ( fillLength / fillString . length ) ;
while ( times2 >>= 1 ) {
fillString += fillString ;
if ( times2 === 1 ) {
fillString += fillString ;
}
}
return fillString . slice ( 0 , fillLength ) + str ;
} ;
}
function timeFormat ( dateTime = null , formatStr = "yyyy-mm-dd" ) {
let date2 ;
if ( ! dateTime ) {
date2 = /* @__PURE__ */ new Date ( ) ;
} else if ( /^\d{10}$/ . test ( dateTime . toString ( ) . trim ( ) ) ) {
date2 = new Date ( dateTime * 1e3 ) ;
} else if ( typeof dateTime === "string" && /^\d+$/ . test ( dateTime . trim ( ) ) ) {
date2 = new Date ( Number ( dateTime ) ) ;
} else {
date2 = new Date (
typeof dateTime === "string" ? dateTime . replace ( /-/g , "/" ) : dateTime
) ;
}
const timeSource = {
"y" : date2 . getFullYear ( ) . toString ( ) ,
// 年
"m" : ( date2 . getMonth ( ) + 1 ) . toString ( ) . padStart ( 2 , "0" ) ,
// 月
"d" : date2 . getDate ( ) . toString ( ) . padStart ( 2 , "0" ) ,
// 日
"h" : date2 . getHours ( ) . toString ( ) . padStart ( 2 , "0" ) ,
// 时
"M" : date2 . getMinutes ( ) . toString ( ) . padStart ( 2 , "0" ) ,
// 分
"s" : date2 . getSeconds ( ) . toString ( ) . padStart ( 2 , "0" )
// 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
} ;
for ( const key in timeSource ) {
const [ ret ] = new RegExp ( ` ${ key } + ` ) . exec ( formatStr ) || [ ] ;
if ( ret ) {
const beginIndex = key === "y" && ret . length === 2 ? 2 : 0 ;
formatStr = formatStr . replace ( ret , timeSource [ key ] . slice ( beginIndex ) ) ;
}
}
return formatStr ;
}
function timeFrom ( timestamp = null , format = "yyyy-mm-dd" ) {
if ( timestamp == null )
timestamp = Number ( /* @__PURE__ */ new Date ( ) ) ;
timestamp = parseInt ( timestamp ) ;
if ( timestamp . toString ( ) . length == 10 )
timestamp *= 1e3 ;
let timer = ( /* @__PURE__ */ new Date ( ) ) . getTime ( ) - timestamp ;
timer = parseInt ( timer / 1e3 ) ;
let tips = "" ;
switch ( true ) {
case timer < 300 :
tips = "刚刚" ;
break ;
case ( timer >= 300 && timer < 3600 ) :
tips = ` ${ parseInt ( timer / 60 ) } 分钟前 ` ;
break ;
case ( timer >= 3600 && timer < 86400 ) :
tips = ` ${ parseInt ( timer / 3600 ) } 小时前 ` ;
break ;
case ( timer >= 86400 && timer < 2592e3 ) :
tips = ` ${ parseInt ( timer / 86400 ) } 天前 ` ;
break ;
default :
if ( format === false ) {
if ( timer >= 2592e3 && timer < 365 * 86400 ) {
tips = ` ${ parseInt ( timer / ( 86400 * 30 ) ) } 个月前 ` ;
} else {
tips = ` ${ parseInt ( timer / ( 86400 * 365 ) ) } 年前 ` ;
}
} else {
tips = timeFormat ( timestamp , format ) ;
}
}
return tips ;
}
function trim ( str , pos = "both" ) {
str = String ( str ) ;
if ( pos == "both" ) {
return str . replace ( /^\s+|\s+$/g , "" ) ;
}
if ( pos == "left" ) {
return str . replace ( /^\s*/ , "" ) ;
}
if ( pos == "right" ) {
return str . replace ( /(\s*$)/g , "" ) ;
}
if ( pos == "all" ) {
return str . replace ( /\s+/g , "" ) ;
}
return str ;
}
function queryParams ( data = { } , isPrefix = true , arrayFormat = "brackets" ) {
const prefix = isPrefix ? "?" : "" ;
const _result = [ ] ;
if ( [ "indices" , "brackets" , "repeat" , "comma" ] . indexOf ( arrayFormat ) == - 1 )
arrayFormat = "brackets" ;
for ( const key in data ) {
const value = data [ key ] ;
if ( [ "" , void 0 , null ] . indexOf ( value ) >= 0 ) {
continue ;
}
if ( value . constructor === Array ) {
switch ( arrayFormat ) {
case "indices" :
for ( let i = 0 ; i < value . length ; i ++ ) {
_result . push ( ` ${ key } [ ${ i } ]= ${ value [ i ] } ` ) ;
}
break ;
case "brackets" :
value . forEach ( ( _value ) => {
_result . push ( ` ${ key } []= ${ _value } ` ) ;
} ) ;
break ;
case "repeat" :
value . forEach ( ( _value ) => {
_result . push ( ` ${ key } = ${ _value } ` ) ;
} ) ;
break ;
case "comma" :
let commaStr = "" ;
value . forEach ( ( _value ) => {
commaStr += ( commaStr ? "," : "" ) + _value ;
} ) ;
_result . push ( ` ${ key } = ${ commaStr } ` ) ;
break ;
default :
value . forEach ( ( _value ) => {
_result . push ( ` ${ key } []= ${ _value } ` ) ;
} ) ;
}
} else {
_result . push ( ` ${ key } = ${ value } ` ) ;
}
}
return _result . length ? prefix + _result . join ( "&" ) : "" ;
}
function toast ( title , duration = 2e3 ) {
uni . showToast ( {
title : String ( title ) ,
icon : "none" ,
duration
} ) ;
}
function type2icon ( type = "success" , fill = false ) {
if ( [ "primary" , "info" , "error" , "warning" , "success" ] . indexOf ( type ) == - 1 )
type = "success" ;
let iconName = "" ;
switch ( type ) {
case "primary" :
iconName = "info-circle" ;
break ;
case "info" :
iconName = "info-circle" ;
break ;
case "error" :
iconName = "close-circle" ;
break ;
case "warning" :
iconName = "error-circle" ;
break ;
case "success" :
iconName = "checkmark-circle" ;
break ;
default :
iconName = "checkmark-circle" ;
}
if ( fill )
iconName += "-fill" ;
return iconName ;
}
function priceFormat ( number2 , decimals = 0 , decimalPoint = "." , thousandsSeparator = "," ) {
number2 = ` ${ number2 } ` . replace ( /[^0-9+-Ee.]/g , "" ) ;
const n = ! isFinite ( + number2 ) ? 0 : + number2 ;
const prec = ! isFinite ( + decimals ) ? 0 : Math . abs ( decimals ) ;
const sep = typeof thousandsSeparator === "undefined" ? "," : thousandsSeparator ;
const dec = typeof decimalPoint === "undefined" ? "." : decimalPoint ;
let s = "" ;
s = ( prec ? round ( n , prec ) + "" : ` ${ Math . round ( n ) } ` ) . split ( "." ) ;
const re = /(-?\d+)(\d{3})/ ;
while ( re . test ( s [ 0 ] ) ) {
s [ 0 ] = s [ 0 ] . replace ( re , ` $ 1 ${ sep } $ 2 ` ) ;
}
if ( ( s [ 1 ] || "" ) . length < prec ) {
s [ 1 ] = s [ 1 ] || "" ;
s [ 1 ] += new Array ( prec - s [ 1 ] . length + 1 ) . join ( "0" ) ;
}
return s . join ( dec ) ;
}
function getDuration ( value , unit = true ) {
const valueNum = parseInt ( value ) ;
if ( unit ) {
if ( /s$/ . test ( value ) )
return value ;
return value > 30 ? ` ${ value } ms ` : ` ${ value } s ` ;
}
if ( /ms$/ . test ( value ) )
return valueNum ;
if ( /s$/ . test ( value ) )
return valueNum > 30 ? valueNum : valueNum * 1e3 ;
return valueNum ;
}
function padZero ( value ) {
return ` 00 ${ value } ` . slice ( - 2 ) ;
}
function formValidate ( instance , event ) {
const formItem = uni . $u . $parent . call ( instance , "u-form-item" ) ;
const form = uni . $u . $parent . call ( instance , "u-form" ) ;
if ( formItem && form ) {
form . validateField ( formItem . prop , ( ) => {
} , event ) ;
}
}
function getProperty ( obj , key ) {
if ( ! obj ) {
return ;
}
if ( typeof key !== "string" || key === "" ) {
return "" ;
}
if ( key . indexOf ( "." ) !== - 1 ) {
const keys = key . split ( "." ) ;
let firstObj = obj [ keys [ 0 ] ] || { } ;
for ( let i = 1 ; i < keys . length ; i ++ ) {
if ( firstObj ) {
firstObj = firstObj [ keys [ i ] ] ;
}
}
return firstObj ;
}
return obj [ key ] ;
}
function setProperty ( obj , key , value ) {
if ( ! obj ) {
return ;
}
const inFn = function ( _obj , keys , v ) {
if ( keys . length === 1 ) {
_obj [ keys [ 0 ] ] = v ;
return ;
}
while ( keys . length > 1 ) {
const k = keys [ 0 ] ;
if ( ! _obj [ k ] || typeof _obj [ k ] !== "object" ) {
_obj [ k ] = { } ;
}
keys . shift ( ) ;
inFn ( _obj [ k ] , keys , v ) ;
}
} ;
if ( typeof key !== "string" || key === "" )
;
else if ( key . indexOf ( "." ) !== - 1 ) {
const keys = key . split ( "." ) ;
inFn ( obj , keys , value ) ;
} else {
obj [ key ] = value ;
}
}
function page ( ) {
const pages2 = getCurrentPages ( ) ;
return ` / ${ pages2 [ pages2 . length - 1 ] . route || "" } ` ;
}
function pages ( ) {
const pages2 = getCurrentPages ( ) ;
return pages2 ;
}
function setConfig ( {
props : props2 = { } ,
config : config2 = { } ,
color : color2 = { } ,
zIndex : zIndex2 = { }
} ) {
const {
deepMerge : deepMerge2
} = uni . $u ;
uni . $u . config = deepMerge2 ( uni . $u . config , config2 ) ;
uni . $u . props = deepMerge2 ( uni . $u . props , props2 ) ;
uni . $u . color = deepMerge2 ( uni . $u . color , color2 ) ;
uni . $u . zIndex = deepMerge2 ( uni . $u . zIndex , zIndex2 ) ;
}
const index = {
range ,
getPx ,
sleep ,
os ,
sys ,
random ,
guid ,
$parent ,
addStyle ,
addUnit ,
deepClone ,
deepMerge ,
error ,
randomArray ,
timeFormat ,
timeFrom ,
trim ,
queryParams ,
toast ,
type2icon ,
priceFormat ,
getDuration ,
padZero ,
formValidate ,
getProperty ,
setProperty ,
page ,
pages ,
setConfig
} ;
const zIndex = {
toast : 10090 ,
noNetwork : 10080 ,
// popup包含popup, actionsheet, keyboard, picker的值
popup : 10075 ,
mask : 10070 ,
navbar : 980 ,
topTips : 975 ,
sticky : 970 ,
indexListSticky : 965
} ;
let platform = "none" ;
platform = "vue3" ;
platform = "plus" ;
const platform$1 = platform ;
const $u = {
route ,
date : index . timeFormat ,
// 另名date
colorGradient : colorGradient$1 . colorGradient ,
hexToRgb : colorGradient$1 . hexToRgb ,
rgbToHex : colorGradient$1 . rgbToHex ,
colorToRgba : colorGradient$1 . colorToRgba ,
test ,
type : [ "primary" , "success" , "error" , "warning" , "info" ] ,
http : new Request ( ) ,
config : config$1 ,
// uView配置信息相关, 比如版本号
zIndex ,
debounce ,
throttle ,
mixin ,
mpMixin ,
2023-10-20 18:45:15 +08:00
props : props$b ,
2023-10-17 16:02:55 +08:00
... index ,
color ,
platform : platform$1
} ;
uni . $u = $u ;
const install = ( Vue2 ) => {
Vue2 . config . globalProperties . $u = $u ;
Vue2 . config . globalProperties . $nextTick = ( cb ) => {
cb ( ) ;
} ;
Vue2 . mixin ( mixin ) ;
} ;
const uviewPlus = {
install
} ;
function createApp ( ) {
const app = vue . createVueApp ( App ) ;
const pinia = createPinia ( ) ;
app . use ( pinia ) ;
app . use ( uviewPlus ) ;
return {
app ,
pinia
} ;
}
const { app : _ _app _ _ , Vuex : _ _Vuex _ _ , Pinia : _ _Pinia _ _ } = createApp ( ) ;
uni . Vuex = _ _Vuex _ _ ;
uni . Pinia = _ _Pinia _ _ ;
_ _app _ _ . provide ( "__globalStyles" , _ _uniConfig . styles ) ;
_ _app _ _ . _component . mpType = "app" ;
_ _app _ _ . _component . render = ( ) => {
} ;
_ _app _ _ . mount ( "#app" ) ;
} ) ( Vue , uni . VueShared ) ;