会议详情,项目详情,我的页面
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
// components/popup/popup.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
// 是否弹出显示
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
//点击外部的遮罩层是否允许关闭
|
||||
outClickCanClose: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
// 组件循环需要渲染的数据内容, 接受label和value的形式
|
||||
data: {
|
||||
type: Array,
|
||||
value: [
|
||||
{
|
||||
label: '是',
|
||||
value: 1
|
||||
},{
|
||||
label: '否',
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
closePopup() {
|
||||
this.triggerEvent("close", {
|
||||
visible: this.data.visible
|
||||
})
|
||||
},
|
||||
outClick(){
|
||||
if (this.data.outClickCanClose){
|
||||
this.triggerEvent("close", {
|
||||
visible: this.data.visible
|
||||
})
|
||||
}
|
||||
},
|
||||
ok(e){
|
||||
this.triggerEvent("ok", e.target.dataset.value)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<!--components/popup/popup.wxml-->
|
||||
<view class="i-modal-mask {{ visible ? 'i-modal-mask-show' : '' }}" catchtap='outClick'>
|
||||
<view class='centerView'>
|
||||
<view wx:if="{{visible}}" class='contentText' maxlength="-1" disabled="true" fixed="true">
|
||||
<view wx:for="{{data}}" wx:key="item" class="item">
|
||||
<text bindtap="ok" data-value="{{item.value}}">{{item.label}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,60 @@
|
||||
/* components/popup/popup.wxss */
|
||||
.i-modal-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
z-index: 1000;
|
||||
transition: all 0.2s ease-in-out;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.i-modal-mask-show {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
.centerView {
|
||||
width: 85%;
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 0 15px;
|
||||
max-height: 50%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.centerView::-webkit-scrollbar{
|
||||
width: 0;
|
||||
}
|
||||
|
||||
|
||||
.contentText {
|
||||
width: 100%;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.item{
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
border-bottom: 0.5px solid #f5f5f5;
|
||||
}
|
||||
.item text{
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
.item:last-child{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user