2023.11.1修改
parent
11cecc737f
commit
22c039a8eb
@ -0,0 +1,84 @@
|
||||
<script setup>
|
||||
// 引入依赖
|
||||
import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
|
||||
import uniEasyinput from '@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue'
|
||||
import { onLoad,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
|
||||
// import mySwiper from "@/components/mySwiper.vue"
|
||||
import {ref,onMounted,nextTick,watch} from "vue"
|
||||
import api from '@/api/index.js'
|
||||
import util from "@/utils/index.js"
|
||||
import {useStore} from '@/store/index.js'
|
||||
// import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
|
||||
const store = useStore()
|
||||
// 生命周期
|
||||
onLoad((e) => {
|
||||
getList()
|
||||
})
|
||||
onPullDownRefresh(()=> { // 下拉刷新
|
||||
init()
|
||||
getList()
|
||||
})
|
||||
onReachBottom(() => { // 上滑触底
|
||||
queryParams.value.page++
|
||||
getList()
|
||||
})
|
||||
// 变量
|
||||
const list = ref([])
|
||||
const queryParams = ref({
|
||||
page:1,
|
||||
pageSize:10,
|
||||
isFinish:1
|
||||
})
|
||||
// 函数
|
||||
function init(){
|
||||
list.value = []
|
||||
queryParams.value.page = 1
|
||||
queryParams.value.pageSize = 10
|
||||
}
|
||||
async function getList() {
|
||||
const res = await api.getTodoist(queryParams.value)
|
||||
if(res.code === 0) {
|
||||
if(res.data && res.data.length > 0) {
|
||||
list.value.push(...res.data)
|
||||
}
|
||||
else{
|
||||
queryParams.value.page--
|
||||
}
|
||||
}
|
||||
else{
|
||||
uni.showToast({
|
||||
title:"获取失败",
|
||||
icon:"error",
|
||||
duration:2000
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<view class="todoBox page-box">
|
||||
<view class="td-item" v-for="(item,i) in list">
|
||||
<view class="td-content text-ellipsis-2">
|
||||
{{item.content}}
|
||||
</view>
|
||||
<view class="td-info small-text">
|
||||
{{util.timestampToDate(item.CreatedAt)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
.todoBox{
|
||||
padding: 20rpx;
|
||||
.td-item{
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #eaeaea;
|
||||
margin-bottom: 20rpx;
|
||||
.td-content{
|
||||
padding-bottom:20rpx;
|
||||
}
|
||||
.td-info{
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,84 @@
|
||||
<script setup>
|
||||
// 引入依赖
|
||||
import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
|
||||
import uniEasyinput from '@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue'
|
||||
import { onLoad,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
|
||||
// import mySwiper from "@/components/mySwiper.vue"
|
||||
import {ref,onMounted,nextTick,watch} from "vue"
|
||||
import api from '@/api/index.js'
|
||||
import util from "@/utils/index.js"
|
||||
import {useStore} from '@/store/index.js'
|
||||
// import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
|
||||
const store = useStore()
|
||||
// 生命周期
|
||||
onLoad((e) => {
|
||||
getList()
|
||||
})
|
||||
onPullDownRefresh(()=> { // 下拉刷新
|
||||
init()
|
||||
getList()
|
||||
})
|
||||
onReachBottom(() => { // 上滑触底
|
||||
queryParams.value.page++
|
||||
getList()
|
||||
})
|
||||
// 变量
|
||||
const list = ref([])
|
||||
const queryParams = ref({
|
||||
page:1,
|
||||
pageSize:10,
|
||||
isFinish:0
|
||||
})
|
||||
// 函数
|
||||
function init(){
|
||||
list.value = []
|
||||
queryParams.value.page = 1
|
||||
queryParams.value.pageSize = 10
|
||||
}
|
||||
async function getList() {
|
||||
const res = await api.getTodoist(queryParams.value)
|
||||
if(res.code === 0) {
|
||||
if(res.data && res.data.length > 0) {
|
||||
list.value.push(...res.data)
|
||||
}
|
||||
else{
|
||||
queryParams.value.page--
|
||||
}
|
||||
}
|
||||
else{
|
||||
uni.showToast({
|
||||
title:"获取失败",
|
||||
icon:"error",
|
||||
duration:2000
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<view class="todoBox page-box">
|
||||
<view class="td-item" v-for="(item,i) in list">
|
||||
<view class="td-content text-ellipsis-2">
|
||||
{{item.content}}
|
||||
</view>
|
||||
<view class="td-info small-text">
|
||||
{{util.timestampToDate(item.CreatedAt)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
.todoBox{
|
||||
padding: 20rpx;
|
||||
.td-item{
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #eaeaea;
|
||||
margin-bottom: 20rpx;
|
||||
.td-content{
|
||||
padding-bottom:20rpx;
|
||||
}
|
||||
.td-info{
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,104 @@
|
||||
<script setup>
|
||||
// 引入依赖
|
||||
import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
|
||||
import uniEasyinput from '@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue'
|
||||
import { onLoad,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
|
||||
import emptyCard from "@/components/emptyCard.vue"
|
||||
import {ref,onMounted,nextTick,watch} from "vue"
|
||||
import api from '@/api/index.js'
|
||||
import util from "@/utils/index.js"
|
||||
import {useStore} from '@/store/index.js'
|
||||
// import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
|
||||
const store = useStore()
|
||||
// 生命周期
|
||||
onLoad((e) => {
|
||||
if(store.userInfo){
|
||||
let user_info = JSON.parse(store.userInfo)
|
||||
queryParams.value.userId = user_info.userId
|
||||
}
|
||||
getList()
|
||||
})
|
||||
onPullDownRefresh(()=> { // 下拉刷新
|
||||
init()
|
||||
getList()
|
||||
})
|
||||
onReachBottom(() => { // 上滑触底
|
||||
queryParams.value.page++
|
||||
getList()
|
||||
})
|
||||
// 变量
|
||||
const list = ref([])
|
||||
const queryParams = ref({
|
||||
page:1,
|
||||
pageSize:10,
|
||||
userId:0
|
||||
})
|
||||
// 函数
|
||||
function init(){
|
||||
list.value = []
|
||||
queryParams.value.page = 1
|
||||
queryParams.value.pageSize = 10
|
||||
}
|
||||
async function getList() {
|
||||
const res = await api.getVisionList(queryParams.value)
|
||||
if(res.code === 0) {
|
||||
if(res.data.list && res.data.list.length > 0) {
|
||||
list.value.push(...res.data.list)
|
||||
}
|
||||
else{
|
||||
queryParams.value.page--
|
||||
}
|
||||
}
|
||||
else{
|
||||
uni.showToast({
|
||||
title:"获取失败",
|
||||
icon:"error",
|
||||
duration:2000
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<view class="visinoListBox page-box">
|
||||
<view class="vl-item-box" v-if="list.length > 0">
|
||||
<view class="vl-item" v-for="(item,i) in list">
|
||||
<view class="vl-title">{{util.timestampToDate(item.CreatedAt)}}</view>
|
||||
<view class="vl-row-box">
|
||||
<view class="vl-row">
|
||||
<view class="vlr-left">右眼</view>
|
||||
<view class="vlr-left">{{item.rightEyeVision}}</view>
|
||||
</view>
|
||||
<view class="vl-row">
|
||||
<view class="vlr-left">左眼</view>
|
||||
<view class="vlr-left">{{item.leftEyeVision}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<emptyCard v-else></emptyCard>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
.visinoListBox{
|
||||
.vl-item-box{
|
||||
padding: 20rpx;
|
||||
.vl-item{
|
||||
.vl-title{
|
||||
border-left: 4rpx solid red;
|
||||
}
|
||||
.vl-row-box{
|
||||
.vl-row{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.vlr-left{
|
||||
|
||||
}
|
||||
.vlr-right{
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Binary file not shown.
After Width: | Height: | Size: 7.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
Loading…
Reference in New Issue