62 lines
1.2 KiB
Vue
62 lines
1.2 KiB
Vue
<template>
|
|
<view class="content">
|
|
<image class="logo" src="/static/logo.png"></image>
|
|
|
|
<view class="text-area">
|
|
<view
|
|
class="title"
|
|
v-for="(item, index) in newsArr"
|
|
@click="enterInfo(item)"
|
|
:key="index"
|
|
>
|
|
{{ item.title }}
|
|
</view>
|
|
</view>
|
|
|
|
<view @click="enterInfo">详情</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
title: "测试",
|
|
newsArr: [
|
|
{ id: 1, title: "测试1" },
|
|
{ id: 2, title: "测试2" },
|
|
{ id: 3, title: "测试3" },
|
|
{ id: 4, title: "测试4" },
|
|
],
|
|
};
|
|
},
|
|
onLoad() {
|
|
this.getInfo()
|
|
},
|
|
methods: {
|
|
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>
|