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,66 @@
// pages/about/about.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(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,2 @@
<!--pages/about/about.wxml-->
<text>pages/about/about.wxml</text>

View File

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

View File

@@ -0,0 +1,46 @@
// index.js
// 获取应用实例
const { $http, $util } = getApp().globalData
Page({
data: {
title: "首页测试",
href: "https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#tabBar",
news: [
{ id: 1, title: '标题1' },
{ id: 2, title: '标题2' },
{ id: 3, title: '标题3' },
{ id: 4, title: '标题4' }
],
childData: ""
},
onLoad() {
$util.test();
this.getIndex();
},
async getIndex() {
let res = await $http.index.getIndex();
console.log(res);
},
getUserInfo(e) {
console.log(e);
},
testMe(e) {
let { index } = e.target.dataset;
console.log(index);
},
getChange(e) {
console.log("e.detail ==== : ",e.detail);
// this.childData = e.detail;
this.setData({
childData: e.detail
});
},
bindKeyInput(e) {
this.setData({
childData: e.detail.value
})
console.log("======== : ",e.detail.value);
}
})

View File

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

View File

@@ -0,0 +1,22 @@
<!--index.wxml-->
<view class="container">
<h2>{{ title }}</h2>
<navigator url="/pages/about/about">跳转</navigator>
<button open-type="getUserInfo" bindgetuserinfo="getUserInfo">获取用户信息</button>
<view data-index="hahah" bindtap="testMe">点我传参数</view>
<header list="{{ news }}" bind:change="getChange">
<view slot="top">顶部</view>
<view slot="bottom">底部</view>
</header>
<van-button type="info">信息按钮</van-button>
<input class="weui-input"
maxlength="10"
value="{{ childData }}"
bindinput="bindKeyInput"
placeholder="输入同步到view中"/>
</view>

View File

@@ -0,0 +1,19 @@
/**index.wxss**/
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
color: #aaa;
}
.userinfo-avatar {
overflow: hidden;
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}
.usermotto {
margin-top: 200px;
}

View File

@@ -0,0 +1,15 @@
// logs.js
const util = require('../../utils/util.js')
Page({
data: {
logs: []
},
onLoad() {
this.setData({
logs: (wx.getStorageSync('logs') || []).map(log => {
return util.formatTime(new Date(log))
})
})
}
})

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "查看启动日志",
"usingComponents": {}
}

View File

@@ -0,0 +1,6 @@
<!--logs.wxml-->
<view class="container log-list">
<block wx:for="{{logs}}" wx:for-item="log">
<text class="log-item">{{index + 1}}. {{log}}</text>
</block>
</view>

View File

@@ -0,0 +1,8 @@
.log-list {
display: flex;
flex-direction: column;
padding: 40rpx;
}
.log-item {
margin: 10rpx;
}