first commit

This commit is contained in:
PC-202306242200\Administrator
2026-03-28 23:09:02 +08:00
commit dac42e3b0c
3512 changed files with 181637 additions and 0 deletions

View File

@@ -0,0 +1 @@
"use strict";const e=require("../uni-popup/popup.js"),t=require("../../../../common/vendor.js"),o=require("../uni-popup/i18n/index.js"),{t:i}=t.initVueI18n(o.messages),l={name:"uniPopupDialog",mixins:[e.popup],emits:["confirm","close","update:modelValue","input"],props:{inputType:{type:String,default:"text"},showClose:{type:Boolean,default:!0},modelValue:{type:[Number,String],default:""},placeholder:{type:[String,Number],default:""},type:{type:String,default:"error"},mode:{type:String,default:"base"},title:{type:String,default:""},content:{type:String,default:""},beforeClose:{type:Boolean,default:!1},cancelText:{type:String,default:""},confirmText:{type:String,default:""},maxlength:{type:Number,default:-1},focus:{type:Boolean,default:!0}},data:()=>({dialogType:"error",val:""}),computed:{okText(){return this.confirmText||i("uni-popup.ok")},closeText(){return this.cancelText||i("uni-popup.cancel")},placeholderText(){return this.placeholder||i("uni-popup.placeholder")},titleText(){return this.title||i("uni-popup.title")}},watch:{type(e){this.dialogType=e},mode(e){"input"===e&&(this.dialogType="info")},value(e){-1!=this.maxlength&&"input"===this.mode?this.val=e.slice(0,this.maxlength):this.val=e},val(e){this.$emit("update:modelValue",e)}},created(){this.popup.disableMask(),"input"===this.mode?(this.dialogType="info",this.val=this.value,this.val=this.modelValue):this.dialogType=this.type},methods:{onOk(){"input"===this.mode?this.$emit("confirm",this.val):this.$emit("confirm"),this.beforeClose||this.popup.close()},closeDialog(){this.$emit("close"),this.beforeClose||this.popup.close()},close(){this.popup.close()}}};const p=t._export_sfc(l,[["render",function(e,o,i,l,p,s){return t.e({a:t.t(s.titleText),b:t.n("uni-popup__"+p.dialogType),c:"base"===i.mode},"base"===i.mode?{d:t.t(i.content)}:{e:i.maxlength,f:i.inputType,g:s.placeholderText,h:i.focus,i:p.val,j:t.o((e=>p.val=e.detail.value))},{k:i.showClose},i.showClose?{l:t.t(s.closeText),m:t.o(((...e)=>s.closeDialog&&s.closeDialog(...e)))}:{},{n:t.t(s.okText),o:t.n(i.showClose?"uni-border-left":""),p:t.o(((...e)=>s.onOk&&s.onOk(...e)))})}]]);wx.createComponent(p);

View File

@@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="uni-popup-dialog"><view class="uni-dialog-title"><text class="{{['uni-dialog-title-text', b]}}">{{a}}</text></view><view wx:if="{{c}}" class="uni-dialog-content"><block wx:if="{{$slots.d}}"><slot></slot></block><block wx:else><text class="uni-dialog-content-text">{{d}}</text></block></view><view wx:else class="uni-dialog-content"><block wx:if="{{$slots.d}}"><slot></slot></block><block wx:else><block wx:if="{{r0}}"><input class="uni-dialog-input" maxlength="{{e}}" type="{{f}}" placeholder="{{g}}" focus="{{h}}" value="{{i}}" bindinput="{{j}}"></input></block></block></view><view class="uni-dialog-button-group"><view wx:if="{{k}}" class="uni-dialog-button" bindtap="{{m}}"><text class="uni-dialog-button-text">{{l}}</text></view><view class="{{['uni-dialog-button', o]}}" bindtap="{{p}}"><text class="uni-dialog-button-text uni-button-color">{{n}}</text></view></view></view>

View File

@@ -0,0 +1 @@
.uni-popup-dialog{width:300px;border-radius:11px;background-color:#fff}.uni-dialog-title{display:flex;flex-direction:row;justify-content:center;padding-top:25px}.uni-dialog-title-text{font-size:16px;font-weight:500}.uni-dialog-content{display:flex;flex-direction:row;justify-content:center;align-items:center;padding:20px}.uni-dialog-content-text{font-size:14px;color:#6c6c6c}.uni-dialog-button-group{display:flex;flex-direction:row;border-top-color:#f5f5f5;border-top-style:solid;border-top-width:1px}.uni-dialog-button{display:flex;flex:1;flex-direction:row;justify-content:center;align-items:center;height:45px}.uni-border-left{border-left-color:#f0f0f0;border-left-style:solid;border-left-width:1px}.uni-dialog-button-text{font-size:16px;color:#333}.uni-button-color{color:#007aff}.uni-dialog-input{flex:1;font-size:14px;border:1px #eee solid;height:40px;padding:0 10px;border-radius:5px;color:#555}.uni-popup__success{color:#4cd964}.uni-popup__warn{color:#f0ad4e}.uni-popup__error{color:#dd524d}.uni-popup__info{color:#909399}

View File

@@ -0,0 +1 @@
"use strict";const p={en:{"uni-popup.cancel":"cancel","uni-popup.ok":"ok","uni-popup.placeholder":"pleace enter","uni-popup.title":"Hint","uni-popup.shareTitle":"Share to"},"zh-Hans":{"uni-popup.cancel":"取消","uni-popup.ok":"确定","uni-popup.placeholder":"请输入","uni-popup.title":"提示","uni-popup.shareTitle":"分享到"},"zh-Hant":{"uni-popup.cancel":"取消","uni-popup.ok":"確定","uni-popup.placeholder":"請輸入","uni-popup.title":"提示","uni-popup.shareTitle":"分享到"}};exports.messages=p;

View File

@@ -0,0 +1 @@
"use strict";const t={data:()=>({}),created(){this.popup=this.getParent()},methods:{getParent(t="uniPopup"){let e=this.$parent,p=e.$options.name;for(;p!==t;){if(e=e.$parent,!e)return!1;p=e.$options.name}return e}}};exports.popup=t;

View File

@@ -0,0 +1 @@
"use strict";const t=require("../../../../common/vendor.js"),s={name:"uniPopup",components:{},emits:["change","maskClick"],props:{animation:{type:Boolean,default:!0},type:{type:String,default:"center"},isMaskClick:{type:Boolean,default:null},maskClick:{type:Boolean,default:null},backgroundColor:{type:String,default:"none"},safeArea:{type:Boolean,default:!0},maskBackgroundColor:{type:String,default:"rgba(0, 0, 0, 0.4)"},borderRadius:{type:String}},watch:{type:{handler:function(t){this.config[t]&&this[this.config[t]](!0)},immediate:!0},isDesktop:{handler:function(t){this.config[t]&&this[this.config[this.type]](!0)},immediate:!0},maskClick:{handler:function(t){this.mkclick=t},immediate:!0},isMaskClick:{handler:function(t){this.mkclick=t},immediate:!0},showPopup(t){}},data(){return{duration:300,ani:[],showPopup:!1,showTrans:!1,popupWidth:0,popupHeight:0,config:{top:"top",bottom:"bottom",center:"center",left:"left",right:"right",message:"top",dialog:"center",share:"bottom"},maskClass:{position:"fixed",bottom:0,top:0,left:0,right:0,backgroundColor:"rgba(0, 0, 0, 0.4)"},transClass:{backgroundColor:"transparent",borderRadius:this.borderRadius||"0",position:"fixed",left:0,right:0},maskShow:!0,mkclick:!0,popupstyle:"top"}},computed:{getStyles(){let t={backgroundColor:this.bg};return this.borderRadius,t=Object.assign(t,{borderRadius:this.borderRadius}),t},isDesktop(){return this.popupWidth>=500&&this.popupHeight>=500},bg(){return""===this.backgroundColor||"none"===this.backgroundColor?"transparent":this.backgroundColor}},mounted(){(()=>{const{windowWidth:s,windowHeight:i,windowTop:o,safeArea:e,screenHeight:a,safeAreaInsets:r}=t.index.getSystemInfoSync();this.popupWidth=s,this.popupHeight=i+(o||0),e&&this.safeArea?this.safeAreaInsets=a-e.bottom:this.safeAreaInsets=0})()},unmounted(){this.setH5Visible()},activated(){this.setH5Visible(!this.showPopup)},deactivated(){this.setH5Visible(!0)},created(){null===this.isMaskClick&&null===this.maskClick?this.mkclick=!0:this.mkclick=null!==this.isMaskClick?this.isMaskClick:this.maskClick,this.animation?this.duration=300:this.duration=0,this.messageChild=null,this.clearPropagation=!1,this.maskClass.backgroundColor=this.maskBackgroundColor},methods:{setH5Visible(t=!0){},closeMask(){this.maskShow=!1},disableMask(){this.mkclick=!1},clear(t){t.stopPropagation(),this.clearPropagation=!0},open(t){if(this.showPopup)return;t&&-1!==["top","center","bottom","left","right","message","dialog","share"].indexOf(t)||(t=this.type),this.config[t]?(this[this.config[t]](),this.$emit("change",{show:!0,type:t})):console.error("缺少类型:",t)},close(t){this.showTrans=!1,this.$emit("change",{show:!1,type:this.type}),clearTimeout(this.timer),this.timer=setTimeout((()=>{this.showPopup=!1}),300)},touchstart(){this.clearPropagation=!1},onTap(){this.clearPropagation?this.clearPropagation=!1:(this.$emit("maskClick"),this.mkclick&&this.close())},top(t){this.popupstyle=this.isDesktop?"fixforpc-top":"top",this.ani=["slide-top"],this.transClass={position:"fixed",left:0,right:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0"},t||(this.showPopup=!0,this.showTrans=!0,this.$nextTick((()=>{this.messageChild&&"message"===this.type&&this.messageChild.timerClose()})))},bottom(t){this.popupstyle="bottom",this.ani=["slide-bottom"],this.transClass={position:"fixed",left:0,right:0,bottom:0,paddingBottom:this.safeAreaInsets+"px",backgroundColor:this.bg,borderRadius:this.borderRadius||"0"},t||(this.showPopup=!0,this.showTrans=!0)},center(t){this.popupstyle="center",this.ani=["fade"],this.transClass={position:"fixed",display:"flex",flexDirection:"column",bottom:0,left:0,right:0,top:0,justifyContent:"center",alignItems:"center",borderRadius:this.borderRadius||"0"},t||(this.showPopup=!0,this.showTrans=!0)},left(t){this.popupstyle="left",this.ani=["slide-left"],this.transClass={position:"fixed",left:0,bottom:0,top:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0",display:"flex",flexDirection:"column"},t||(this.showPopup=!0,this.showTrans=!0)},right(t){this.popupstyle="right",this.ani=["slide-right"],this.transClass={position:"fixed",bottom:0,right:0,top:0,backgroundColor:this.bg,borderRadius:this.borderRadius||"0",display:"flex",flexDirection:"column"},t||(this.showPopup=!0,this.showTrans=!0)}}};if(!Array){t.resolveComponent("uni-transition")()}Math;const i=t._export_sfc(s,[["render",function(s,i,o,e,a,r){return t.e({a:a.showPopup},a.showPopup?t.e({b:a.maskShow},a.maskShow?{c:t.o(r.onTap),d:t.p({name:"mask","mode-class":"fade",styles:a.maskClass,duration:a.duration,show:a.showTrans})}:{},{e:t.s(r.getStyles),f:t.n(a.popupstyle),g:t.o(((...t)=>r.clear&&r.clear(...t))),h:t.o(r.onTap),i:t.p({"mode-class":a.ani,name:"content",styles:a.transClass,duration:a.duration,show:a.showTrans}),j:t.o(((...t)=>r.touchstart&&r.touchstart(...t))),k:t.n(a.popupstyle),l:t.n(r.isDesktop?"fixforpc-z-index":"")}):{})}]]);wx.createComponent(i);

View File

@@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"uni-transition": "../../../uni-transition/components/uni-transition/uni-transition"
}
}

View File

@@ -0,0 +1 @@
<view wx:if="{{a}}" class="{{['uni-popup', k, l]}}"><view bindtouchstart="{{j}}"><uni-transition wx:if="{{b}}" key="1" bindclick="{{c}}" u-i="2f4ad777-0" bind:__l="__l" u-p="{{d}}"/><uni-transition wx:if="{{i}}" u-s="{{['d']}}" key="2" bindclick="{{h}}" u-i="2f4ad777-1" bind:__l="__l" u-p="{{i}}"><view style="{{e}}" class="{{['uni-popup__wrapper', f]}}" bindtap="{{g}}"><slot/></view></uni-transition></view></view>

View File

@@ -0,0 +1 @@
.uni-popup{position:fixed;z-index:99}.uni-popup.top,.uni-popup.left,.uni-popup.right{top:0}.uni-popup .uni-popup__wrapper{display:block;position:relative}.uni-popup .uni-popup__wrapper.left,.uni-popup .uni-popup__wrapper.right{padding-top:0;flex:1}.fixforpc-z-index{z-index:999}.fixforpc-top{top:0}