u-list height
parent
cb11fe7667
commit
5fd56bd2bf
|
|
@ -9,7 +9,7 @@
|
||||||
@search="load(true)"
|
@search="load(true)"
|
||||||
@change="changeSearch"
|
@change="changeSearch"
|
||||||
/>
|
/>
|
||||||
<u-list :width="300" @scrolltolower="reachBottom">
|
<u-list :width="300" :height="listHeight" @scrolltolower="reachBottom">
|
||||||
<u-list-item v-for="(item, index) in list" :key="item.id">
|
<u-list-item v-for="(item, index) in list" :key="item.id">
|
||||||
<u-cell
|
<u-cell
|
||||||
:title="item.name"
|
:title="item.name"
|
||||||
|
|
@ -39,10 +39,16 @@ export default {
|
||||||
loading: true,
|
loading: true,
|
||||||
// 'loading', 'nomore', 'loadmore'
|
// 'loading', 'nomore', 'loadmore'
|
||||||
status: 'loadmore',
|
status: 'loadmore',
|
||||||
|
listHeight: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.load(true)
|
this.load(true)
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
this.listHeight = res.safeArea.height - 54
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
|
|
|
||||||
|
|
@ -77,10 +77,10 @@
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.page {
|
.page {
|
||||||
padding: 0 10px;
|
padding: 20px 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.info {
|
.info {
|
||||||
margin-top: 100rpx;
|
|
||||||
background: white;
|
background: white;
|
||||||
}
|
}
|
||||||
.btns {
|
.btns {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@
|
||||||
<view class="add-button">
|
<view class="add-button">
|
||||||
<u-button type="primary" icon="plus" shape="circle" size="large" @click="add" />
|
<u-button type="primary" icon="plus" shape="circle" size="large" @click="add" />
|
||||||
</view>
|
</view>
|
||||||
<u-list class="list" @scrolltolower="reachBottom">
|
<view class="list">
|
||||||
|
<u-list :height="listHeight" @scrolltolower="reachBottom">
|
||||||
<u-swipe-action>
|
<u-swipe-action>
|
||||||
<u-list-item v-for="(item, index) in list" :key="item.id">
|
<u-list-item v-for="(item, index) in list" :key="item.id">
|
||||||
<u-swipe-action-item :options="swipeOption" :name="index" @click="swipeClick">
|
<u-swipe-action-item :options="swipeOption" :name="index" @click="swipeClick">
|
||||||
|
|
@ -27,6 +28,7 @@
|
||||||
</u-list-item>
|
</u-list-item>
|
||||||
</u-swipe-action>
|
</u-swipe-action>
|
||||||
</u-list>
|
</u-list>
|
||||||
|
</view>
|
||||||
<u-action-sheet
|
<u-action-sheet
|
||||||
:actions="option.list"
|
:actions="option.list"
|
||||||
:title="option.title"
|
:title="option.title"
|
||||||
|
|
@ -62,12 +64,17 @@ export default {
|
||||||
},
|
},
|
||||||
swipeOption: [
|
swipeOption: [
|
||||||
{ text: '删除', style: {backgroundColor: '#dd524d'} }
|
{ text: '删除', style: {backgroundColor: '#dd524d'} }
|
||||||
]
|
],
|
||||||
|
listHeight: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.typeId = uni.getStorageSync('medical_record_treat_type_id')
|
this.typeId = uni.getStorageSync('medical_record_treat_type_id')
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
this.listHeight = res.safeArea.height - 54
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.loadData(true)
|
this.loadData(true)
|
||||||
|
|
@ -185,7 +192,6 @@ export default {
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.list {
|
.list {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
padding-bottom: 20px;
|
|
||||||
}
|
}
|
||||||
.add-button {
|
.add-button {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
<view class="add-button">
|
<view class="add-button">
|
||||||
<u-button type="primary" icon="plus" shape="circle" size="large" @click="add" />
|
<u-button type="primary" icon="plus" shape="circle" size="large" @click="add" />
|
||||||
</view>
|
</view>
|
||||||
<u-list class="list" @scrolltolower="reachBottom">
|
<view class="list">
|
||||||
|
<u-list :height="listHeight" @scrolltolower="reachBottom">
|
||||||
<u-swipe-action>
|
<u-swipe-action>
|
||||||
<u-list-item v-for="item in list" :key="item.id">
|
<u-list-item v-for="item in list" :key="item.id">
|
||||||
<u-swipe-action-item :options="swipeOption" :name="item.id" @click="swipeClick">
|
<u-swipe-action-item :options="swipeOption" :name="item.id" @click="swipeClick">
|
||||||
|
|
@ -26,6 +27,7 @@
|
||||||
</u-list-item>
|
</u-list-item>
|
||||||
</u-swipe-action>
|
</u-swipe-action>
|
||||||
</u-list>
|
</u-list>
|
||||||
|
</view>
|
||||||
<u-action-sheet
|
<u-action-sheet
|
||||||
:actions="option.list"
|
:actions="option.list"
|
||||||
:title="option.title"
|
:title="option.title"
|
||||||
|
|
@ -59,11 +61,17 @@ export default {
|
||||||
},
|
},
|
||||||
swipeOption: [
|
swipeOption: [
|
||||||
{ text: '删除', style: {backgroundColor: '#dd524d'} }
|
{ text: '删除', style: {backgroundColor: '#dd524d'} }
|
||||||
]
|
],
|
||||||
|
listHeight: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.patient_id = e.patient
|
this.patient_id = e.patient
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: (res) => {
|
||||||
|
this.listHeight = res.safeArea.height - 20
|
||||||
|
}
|
||||||
|
})
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
|
|
@ -157,8 +165,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
add() {
|
add() {
|
||||||
const type = this.typeList[this.typeIndex]
|
return uni.navigateTo({ url: `/pages/record/form?patient=${this.patient_id}` })
|
||||||
return uni.navigateTo({ url: `/pages/record/form?patient=${this.patient_id}&type=${type.id}` })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue