会议详情,项目详情,我的页面
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;
|
||||
}
|
||||
|
||||
+69
-47
@@ -5,10 +5,12 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
visible: false,
|
||||
index: 0,
|
||||
searchParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
needInvoice: 0, // 是否需要发票 0 1
|
||||
needInvoice: 0, // 是否需要发票 0 4
|
||||
pack: 0, // 是否打包 0 1
|
||||
year: '', // 运行年份
|
||||
},
|
||||
@@ -28,19 +30,75 @@ Page({
|
||||
active: false,
|
||||
tabIndex: 3
|
||||
}
|
||||
],
|
||||
data: [
|
||||
{
|
||||
label: '需要',
|
||||
value: 4
|
||||
},{
|
||||
label: '不需要',
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
},
|
||||
// 搜索筛选
|
||||
changeTab(e){
|
||||
this.data.index = e.currentTarget.dataset.index
|
||||
if(this.data.index === 0){
|
||||
this.setData({
|
||||
data: [
|
||||
{
|
||||
label: '需要',
|
||||
value: 4
|
||||
},{
|
||||
label: '不需要',
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
})
|
||||
}else if(this.data.index === 1){
|
||||
this.setData({
|
||||
data: [
|
||||
{
|
||||
label: '是',
|
||||
value: 1
|
||||
},{
|
||||
label: '否',
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
visible: true
|
||||
})
|
||||
},
|
||||
// 关闭弹出层
|
||||
close() {
|
||||
this.setData({
|
||||
visible: false
|
||||
})
|
||||
},
|
||||
ok(e){
|
||||
if(this.data.index === 0){
|
||||
this.setData({
|
||||
'searchParams.needInvoice': e.detail
|
||||
})
|
||||
}else if(this.data.index === 1){
|
||||
this.setData({
|
||||
'searchParams.pack': e.detail
|
||||
})
|
||||
}
|
||||
// this.loadData()
|
||||
console.log(this.data.searchParams)
|
||||
},
|
||||
// 项目详情
|
||||
projectDetail(){
|
||||
wx.navigateTo({
|
||||
url: '../projectDetail/projectDetail',
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
console.log(this.data.searchParams)
|
||||
loadData(){
|
||||
UserApi.projectList(this.data.searchParams).then(res=>{
|
||||
console.log(res)
|
||||
|
||||
@@ -52,53 +110,17 @@ Page({
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
onLoad: function (options) {
|
||||
// this.loadData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
this.data.pageNo++
|
||||
// this.loadData()
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
"navigationBarTitleText": "项目",
|
||||
"usingComponents": {}
|
||||
"usingComponents": {
|
||||
"popup": "../../components/popup/popup"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<!--pages/meeting/meeting.wxml首页会议活动-->
|
||||
<view class="select-list">
|
||||
<view class="select-item" bindtap="changeTab(select)" wx:for="{{selects}}" wx:for-item="select" wx:key="tabIndex">
|
||||
<view class="select-item" bindtap="changeTab" data-index="{{index}}" wx:for="{{selects}}" wx:for-item="select" wx:key="tabIndex">
|
||||
<text>{{select.select}}</text>
|
||||
<image wx:if="{{!select.active}}" src="../../assets/images/toTop.png"></image>
|
||||
<image wx:if="{{select.active}}" src="../../assets/images/toBottom.png"></image>
|
||||
@@ -20,3 +20,4 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<popup visible="{{visible}}" bindclose="close" outClickCanClose="true" bindok="ok" data="{{data}}"></popup>
|
||||
|
||||
Reference in New Issue
Block a user