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>

View File

@@ -0,0 +1,69 @@
// pages/info/info.js
Page({
/**
* 页面的初始数据
*/
data: {
id: 0
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options);
this.setData({
id: options.id
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,3 @@
<view class="info">
详情 {{ id }}
</view>

View File

@@ -0,0 +1 @@
/* pages/info/info.wxss */

View File

@@ -0,0 +1,66 @@
// pages/me/me.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})

View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@@ -0,0 +1,3 @@
<view class="me">
我的
</view>