1
0
Fork 0

u-list height

master
panliang 2023-10-11 00:04:06 +08:00
parent cb11fe7667
commit 5fd56bd2bf
4 changed files with 65 additions and 46 deletions

View File

@ -9,7 +9,7 @@
@search="load(true)"
@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-cell
:title="item.name"
@ -39,10 +39,16 @@ export default {
loading: true,
// 'loading', 'nomore', 'loadmore'
status: 'loadmore',
listHeight: 0,
}
},
created() {
this.load(true)
uni.getSystemInfo({
success: (res) => {
this.listHeight = res.safeArea.height - 54
}
})
},
methods: {
open() {

View File

@ -77,10 +77,10 @@
</script>
<style scoped>
.page {
padding: 0 10px;
padding: 20px 10px;
box-sizing: border-box;
}
.info {
margin-top: 100rpx;
background: white;
}
.btns {

View File

@ -12,21 +12,23 @@
<view class="add-button">
<u-button type="primary" icon="plus" shape="circle" size="large" @click="add" />
</view>
<u-list class="list" @scrolltolower="reachBottom">
<u-swipe-action>
<u-list-item v-for="(item, index) in list" :key="item.id">
<u-swipe-action-item :options="swipeOption" :name="index" @click="swipeClick">
<u-cell
:title="item.name + (item.age != '' ? `(${item.age})` : '')"
:label="item.phone ? item.phone : '暂无联系方式'"
:clickable="true"
:isLink="false"
:url=" `/pages/patient/detail?id=${item.id}`"
/>
</u-swipe-action-item>
</u-list-item>
</u-swipe-action>
</u-list>
<view class="list">
<u-list :height="listHeight" @scrolltolower="reachBottom">
<u-swipe-action>
<u-list-item v-for="(item, index) in list" :key="item.id">
<u-swipe-action-item :options="swipeOption" :name="index" @click="swipeClick">
<u-cell
:title="item.name + (item.age != '' ? `(${item.age})` : '')"
:label="item.phone ? item.phone : '暂无联系方式'"
:clickable="true"
:isLink="false"
:url=" `/pages/patient/detail?id=${item.id}`"
/>
</u-swipe-action-item>
</u-list-item>
</u-swipe-action>
</u-list>
</view>
<u-action-sheet
:actions="option.list"
:title="option.title"
@ -62,12 +64,17 @@ export default {
},
swipeOption: [
{ text: '删除', style: {backgroundColor: '#dd524d'} }
]
],
listHeight: 0,
}
},
onLoad() {
this.typeId = uni.getStorageSync('medical_record_treat_type_id')
uni.getSystemInfo({
success: (res) => {
this.listHeight = res.safeArea.height - 54
}
})
},
onShow() {
this.loadData(true)
@ -185,7 +192,6 @@ export default {
<style scoped>
.list {
background-color: white;
padding-bottom: 20px;
}
.add-button {
position: absolute;

View File

@ -3,29 +3,31 @@
<view class="add-button">
<u-button type="primary" icon="plus" shape="circle" size="large" @click="add" />
</view>
<u-list class="list" @scrolltolower="reachBottom">
<u-swipe-action>
<u-list-item v-for="item in list" :key="item.id">
<u-swipe-action-item :options="swipeOption" :name="item.id" @click="swipeClick">
<u-cell size="large" :url="`/pages/record/detail?id=${item.id}`">
<view slot="title" class="title">
<view class="list-item-title">医师: {{ item.doctor ? item.doctor.name : '' }}</view>
<view class="list-item-price">
<text style="color: #dd524d;font-size: 19px">
<u-icon name="rmb" color="#dd524d" size="19px" />
{{ item.sell_price }}
</text>
<text style="color: #c0c0c0;text-decoration: line-through;">{{ item.origin_price }}</text>
<view class="list">
<u-list :height="listHeight" @scrolltolower="reachBottom">
<u-swipe-action>
<u-list-item v-for="item in list" :key="item.id">
<u-swipe-action-item :options="swipeOption" :name="item.id" @click="swipeClick">
<u-cell size="large" :url="`/pages/record/detail?id=${item.id}`">
<view slot="title" class="title">
<view class="list-item-title">医师: {{ item.doctor ? item.doctor.name : '' }}</view>
<view class="list-item-price">
<text style="color: #dd524d;font-size: 19px">
<u-icon name="rmb" color="#dd524d" size="19px" />
{{ item.sell_price }}
</text>
<text style="color: #c0c0c0;text-decoration: line-through;">{{ item.origin_price }}</text>
</view>
</view>
</view>
<view slot="label" class="label">
时间: {{ item.treat_at }}
</view>
</u-cell>
</u-swipe-action-item>
</u-list-item>
</u-swipe-action>
</u-list>
<view slot="label" class="label">
时间: {{ item.treat_at }}
</view>
</u-cell>
</u-swipe-action-item>
</u-list-item>
</u-swipe-action>
</u-list>
</view>
<u-action-sheet
:actions="option.list"
:title="option.title"
@ -59,11 +61,17 @@ export default {
},
swipeOption: [
{ text: '删除', style: {backgroundColor: '#dd524d'} }
]
],
listHeight: 0
}
},
onLoad(e) {
this.patient_id = e.patient
uni.getSystemInfo({
success: (res) => {
this.listHeight = res.safeArea.height - 20
}
})
this.init()
},
onPullDownRefresh() {
@ -157,8 +165,7 @@ export default {
})
},
add() {
const type = this.typeList[this.typeIndex]
return uni.navigateTo({ url: `/pages/record/form?patient=${this.patient_id}&type=${type.id}` })
return uni.navigateTo({ url: `/pages/record/form?patient=${this.patient_id}` })
}
}
}