Files
ClassContent/历届学生/front-end-team/项目练习/上课项目/uniapp_tpl/pages/index/index.vue
2024-09-27 02:06:13 +08:00

82 lines
1.5 KiB
Vue

<template>
<view class="index">
<image class="logo" src="/static/logo.png"></image>
<v-header></v-header>
<!-- #ifndef H5 -->
<button @click="change">点我</button>
<!-- #endif -->
<view class="item" v-for="i in 200">
{{ i }}
</view>
<uni-load-more :status="test"></uni-load-more>
</view>
</template>
<script>
import header from "@/components/header/header.vue";
export default {
data() {
return {
title: '你好',
test: "more",
tabsList: [
{ id: 1, title: '你好1' },
{ id: 2, title: '你好2' },
{ id: 3, title: '你好3' },
{ id: 4, title: '你好4' },
]
}
},
onLoad() {
},
created() {
this.$utils.test()
this.getIndex()
},
methods: {
async getIndex() {
let res = await this.$http.index.home();
console.log(res)
},
change() {
uni.setScreenBrightness({
value: 1,
success: function () {
console.log('success');
}
});
},
onPullDownRefresh() {
console.log("下拉刷新")
setTimeout(()=>{
uni.stopPullDownRefresh()
},2000)
},
onReachBottom() {
this.test = "loading"
setTimeout(()=>{
this.test = "more"
},2000)
console.log("到底")
},
enterInfo(item) {
uni.navigateTo({
url: `/pages/about/about?id=${item.id}`
})
}
},
components: {
'v-header': header
}
}
</script>
<style lang="less" scoped>
@import "@/assets/less/page/index.less";
</style>