88 lines
2.1 KiB
Vue
88 lines
2.1 KiB
Vue
<template>
|
|
<view class="home">
|
|
|
|
<view class="menu">
|
|
<scroll-view :scroll-x="true" :show-scrollbar="false" class="menu_list">
|
|
<view v-for="i in 20" @click="itemClick(i)" class="menu_item">
|
|
<text :class="i == tabIndex ? 'menu_item_active': '' ">首页</text>
|
|
</view>
|
|
</scroll-view>
|
|
<text class="icon iconfont icon-edit"></text>
|
|
</view>
|
|
<swiper :style="{ height: height+'px' }" :current="tabIndex" class="swiper-box" style="flex: 1;"
|
|
:duration="300" @change="ontabchange">
|
|
<swiper-item v-for="i in 20">
|
|
<scroll-view :style="{ height: height+'px' }" :scroll-y="true" @scrolltolower="bottom">
|
|
<view width="45%" class="" v-for="i in 100">
|
|
<view>{{i}}</view>
|
|
</view>
|
|
</scroll-view>
|
|
|
|
</swiper-item>
|
|
</swiper>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
tabIndex: 0,
|
|
title: "测试",
|
|
newsArr: [
|
|
{ id: 1, title: "测试1" },
|
|
{ id: 2, title: "测试2" },
|
|
{ id: 3, title: "测试3" },
|
|
{ id: 4, title: "测试4" },
|
|
],
|
|
system: '',
|
|
height: 0
|
|
};
|
|
},
|
|
onLoad() {
|
|
this.system = uni.getSystemInfoSync();
|
|
console.log(this.system)
|
|
this.height = this.system.windowHeight
|
|
- this.system.statusBarHeight - 50 - 36
|
|
|
|
// this.getInfo()
|
|
},
|
|
methods: {
|
|
bottom() {
|
|
uni.showToast({
|
|
title: '标题',
|
|
duration: 1000
|
|
});
|
|
},
|
|
itemClick(index) {
|
|
this.tabIndex = index
|
|
},
|
|
ontabchange(event) {
|
|
this.tabIndex = event.detail.current
|
|
},
|
|
async getInfo() {
|
|
var res = await this.$http.index.home({ id: 1 });
|
|
console.log(res);
|
|
},
|
|
enterInfo(item) {
|
|
// #ifdef APP-PLUS
|
|
uni.setScreenBrightness({
|
|
value: 0.6,
|
|
success: function () {
|
|
console.log("success");
|
|
},
|
|
});
|
|
// #endif
|
|
// uni.navigateTo({
|
|
// url: `/pages/info/info?id=${item.id}`
|
|
// })
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="less">
|
|
@import "../../common/less/page/Home.less";
|
|
</style>
|