first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
// index.js
// 获取应用实例
const { $http, $utils } = getApp().globalData
Page({
data: {
titleIndex: '首页的标题',
user_name: "",
title: '你好',
src: "https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png",
newLis: [
{ id: 1, title: '新闻1' },
{ id: 2, title: '新闻2' },
{ id: 3, title: '新闻3' },
{ id: 4, title: '新闻4' },
],
list: []
},
onLoad() {
this.getHome()
},
async getHome() {
let res = await $http.index.home();
console.log(res);
this.setData({
list: res.list
})
},
enterInfo(e) {
let item = e.target.dataset.item;
wx.navigateTo({
url: `/pages/info/info?id=${item.id}`,
})
},
test(e){
console.log("test: ", e.detail);
},
UserNameChange(e) {
this.setData({
user_name: e.detail.value
})
}
})

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {
"header": "/component/header/header",
"van-button": "@vant/weapp/button/index"
}
}

View File

@@ -0,0 +1,31 @@
<view class="index">
首页 {{ title }}
<van-button type="primary">主要按钮</van-button>
<header title="{{ titleIndex }}" bindclick="test">
<view slot="left" class="left">left</view>
<view slot="right" class="right">right</view>
</header>
<image src="{{ src }}"></image>
<input bindinput="UserNameChange" class="weui-input" maxlength="10" placeholder="最大输入长度为10" />
<view>{{ user_name }}</view>
<view class="list">
<view class="item" wx:for="{{ newLis }}"
bindtap="enterInfo"
data-item="{{ j }}"
wx:for-item="j"
wx:for-index="i"
wx:key="index">
{{ j.title }} | {{ i }}
</view>
</view>
<view class="listImg">
<view class="item" wx:for="{{ list }}"
wx:key="index">
{{ item.title }}
<image src="{{ item.img_src }}"></image>
</view>
</view>
</view>